mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
chore: v11 TextInput
Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.
This commit is contained in:
parent
2ca2833945
commit
9285c72a50
6 changed files with 10 additions and 12 deletions
|
@ -4113,7 +4113,7 @@ None.
|
||||||
| :---------- | :------- | :--------------- | :------- | --------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
| :---------- | :------- | :--------------- | :------- | --------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
||||||
| ref | No | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
| ref | No | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
||||||
| value | No | <code>let</code> | Yes | <code>null | number | string</code> | <code>""</code> | Specify the input value.<br /><br />`value` will be set to `null` if type="number"<br />and the value is empty. |
|
| value | No | <code>let</code> | Yes | <code>null | number | string</code> | <code>""</code> | Specify the input value.<br /><br />`value` will be set to `null` if type="number"<br />and the value is empty. |
|
||||||
| size | No | <code>let</code> | No | <code>"sm" | "xl"</code> | <code>undefined</code> | Set the size of the input |
|
| size | No | <code>let</code> | No | <code>"sm" | "lg"</code> | <code>undefined</code> | Set the size of the input |
|
||||||
| placeholder | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the placeholder text |
|
| placeholder | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the placeholder text |
|
||||||
| light | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
| light | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to enable the light variant |
|
||||||
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the input |
|
| disabled | No | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to disable the input |
|
||||||
|
|
|
@ -12676,7 +12676,7 @@
|
||||||
"name": "size",
|
"name": "size",
|
||||||
"kind": "let",
|
"kind": "let",
|
||||||
"description": "Set the size of the input",
|
"description": "Set the size of the input",
|
||||||
"type": "\"sm\" | \"xl\"",
|
"type": "\"sm\" | \"lg\"",
|
||||||
"isFunction": false,
|
"isFunction": false,
|
||||||
"isFunctionDeclaration": false,
|
"isFunctionDeclaration": false,
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
|
|
|
@ -31,9 +31,9 @@ components: ["TextInput", "TextInputSkeleton"]
|
||||||
|
|
||||||
<TextInput readonly labelText="User name" value="IBM" />
|
<TextInput readonly labelText="User name" value="IBM" />
|
||||||
|
|
||||||
## Extra-large size
|
## Large size
|
||||||
|
|
||||||
<TextInput size="xl" labelText="User name" placeholder="Enter user name..." />
|
<TextInput size="lg" labelText="User name" placeholder="Enter user name..." />
|
||||||
|
|
||||||
## Small size
|
## Small size
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of the input
|
* Set the size of the input
|
||||||
* @type {"sm" | "xl"}
|
* @type {"sm" | "lg"}
|
||||||
*/
|
*/
|
||||||
export let size = undefined;
|
export let size = undefined;
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
class:bx--label--disabled="{disabled}"
|
class:bx--label--disabled="{disabled}"
|
||||||
class:bx--label--inline="{inline}"
|
class:bx--label--inline="{inline}"
|
||||||
class:bx--label--inline--sm="{size === 'sm'}"
|
class:bx--label--inline--sm="{size === 'sm'}"
|
||||||
class:bx--label--inline--xl="{size === 'xl'}"
|
class:bx--label--inline--lg="{size === 'lg' || size === 'xl'}"
|
||||||
>
|
>
|
||||||
<slot name="labelText">
|
<slot name="labelText">
|
||||||
{labelText}
|
{labelText}
|
||||||
|
@ -168,9 +168,7 @@
|
||||||
class:bx--text-input__field-wrapper="{true}"
|
class:bx--text-input__field-wrapper="{true}"
|
||||||
class:bx--text-input__field-wrapper--warning="{!invalid && warn}"
|
class:bx--text-input__field-wrapper--warning="{!invalid && warn}"
|
||||||
>
|
>
|
||||||
{#if readonly}
|
{#if !readonly}
|
||||||
<EditOff class="bx--text-input__readonly-icon" />
|
|
||||||
{:else}
|
|
||||||
{#if invalid}
|
{#if invalid}
|
||||||
<WarningFilled class="bx--text-input__invalid-icon" />
|
<WarningFilled class="bx--text-input__invalid-icon" />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -205,7 +203,7 @@
|
||||||
class:bx--text-input--invalid="{error}"
|
class:bx--text-input--invalid="{error}"
|
||||||
class:bx--text-input--warning="{warn}"
|
class:bx--text-input--warning="{warn}"
|
||||||
class:bx--text-input--sm="{size === 'sm'}"
|
class:bx--text-input--sm="{size === 'sm'}"
|
||||||
class:bx--text-input--xl="{size === 'xl'}"
|
class:bx--text-input--lg="{size === 'lg' || size === 'xl'}"
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
on:change="{onChange}"
|
on:change="{onChange}"
|
||||||
on:input="{onInput}"
|
on:input="{onInput}"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<TextInput inline labelText="User name" placeholder="Enter user name..." />
|
<TextInput inline labelText="User name" placeholder="Enter user name..." />
|
||||||
|
|
||||||
<TextInput size="xl" labelText="User name" placeholder="Enter user name..." />
|
<TextInput size="lg" labelText="User name" placeholder="Enter user name..." />
|
||||||
|
|
||||||
<TextInput size="sm" labelText="User name" placeholder="Enter user name..." />
|
<TextInput size="sm" labelText="User name" placeholder="Enter user name..." />
|
||||||
|
|
||||||
|
|
2
types/TextInput/TextInput.svelte.d.ts
vendored
2
types/TextInput/TextInput.svelte.d.ts
vendored
|
@ -8,7 +8,7 @@ export interface TextInputProps extends RestProps {
|
||||||
* Set the size of the input
|
* Set the size of the input
|
||||||
* @default undefined
|
* @default undefined
|
||||||
*/
|
*/
|
||||||
size?: "sm" | "xl";
|
size?: "sm" | "lg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify the input value.
|
* Specify the input value.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue