mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Adopts Standardize props and events #1621
This commit is contained in:
parent
00338eb6df
commit
d8d16a63d1
5 changed files with 130 additions and 87 deletions
|
@ -12698,11 +12698,9 @@
|
|||
"filePath": "src/TextInput/TextInput.svelte",
|
||||
"props": [
|
||||
{
|
||||
"name": "disabled",
|
||||
"name": "counter",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to disable the input",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"description": "Set to \"char\" to enable display the character counter or \"word\" to display the word count.",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -12710,10 +12708,11 @@
|
|||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "counter",
|
||||
"name": "disabled",
|
||||
"kind": "let",
|
||||
"description": "Set to \"char\" to enable display the character counter or \"word\" to display the word count.",
|
||||
"type": "\"char\" | \"word\"",
|
||||
"description": "Set to `true` to disable the input",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
@ -12932,10 +12931,40 @@
|
|||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "labelAttributes",
|
||||
"kind": "let",
|
||||
"description": "Set HTML attributes on the `label` element",
|
||||
"type": "Record<string, string>",
|
||||
"value": "{}",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "inputAttributes",
|
||||
"kind": "let",
|
||||
"description": "Set HTML attributes on the `input` element",
|
||||
"type": "Record<string, string>",
|
||||
"value": "{}",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
}
|
||||
],
|
||||
"moduleExports": [],
|
||||
"slots": [
|
||||
{
|
||||
"name": "helperText",
|
||||
"default": false,
|
||||
"fallback": "{helperText}",
|
||||
"slot_props": "{}"
|
||||
},
|
||||
{
|
||||
"name": "labelText",
|
||||
"default": false,
|
||||
|
@ -12944,16 +12973,6 @@
|
|||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"type": "dispatched",
|
||||
"name": "change",
|
||||
"detail": "null | number | string"
|
||||
},
|
||||
{
|
||||
"type": "dispatched",
|
||||
"name": "input",
|
||||
"detail": "null | number | string"
|
||||
},
|
||||
{ "type": "forwarded", "name": "click", "element": "div" },
|
||||
{ "type": "forwarded", "name": "mouseover", "element": "div" },
|
||||
{ "type": "forwarded", "name": "mouseenter", "element": "div" },
|
||||
|
@ -12962,10 +12981,11 @@
|
|||
{ "type": "forwarded", "name": "keyup", "element": "input" },
|
||||
{ "type": "forwarded", "name": "focus", "element": "input" },
|
||||
{ "type": "forwarded", "name": "blur", "element": "input" },
|
||||
{ "type": "forwarded", "name": "paste", "element": "input" }
|
||||
{ "type": "forwarded", "name": "paste", "element": "input" },
|
||||
{ "type": "dispatched", "name": "input" },
|
||||
{ "type": "dispatched", "name": "change" }
|
||||
],
|
||||
"typedefs": [],
|
||||
"rest_props": { "type": "Element", "name": "input" }
|
||||
"typedefs": []
|
||||
},
|
||||
{
|
||||
"moduleName": "TextInputSkeleton",
|
||||
|
|
|
@ -9,35 +9,35 @@ components: ["TextInput", "TextInputSkeleton"]
|
|||
|
||||
## Default
|
||||
|
||||
<TextInput labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## With helper text
|
||||
|
||||
<TextInput labelText="User name" helperText="Your user name is associated with your email" placeholder="Enter user name..." />
|
||||
<TextInput labelText="Username" helperText="Your username is associated with your email" placeholder="Enter username..." />
|
||||
|
||||
## Hidden label
|
||||
|
||||
<TextInput hideLabel labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput hideLabel labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Light variant
|
||||
|
||||
<TextInput light labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput light labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Inline variant
|
||||
|
||||
<TextInput inline labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput inline labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Read-only variant
|
||||
|
||||
<TextInput readonly labelText="User name" value="IBM" />
|
||||
<TextInput readonly labelText="Username" value="IBM" />
|
||||
|
||||
## Large size
|
||||
|
||||
<TextInput size="lg" labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput size="lg" labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Small size
|
||||
|
||||
<TextInput size="sm" labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput size="sm" labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Character Counter
|
||||
|
||||
|
@ -45,15 +45,15 @@ components: ["TextInput", "TextInputSkeleton"]
|
|||
|
||||
## Invalid state
|
||||
|
||||
<TextInput invalid invalidText="User name is already taken. Please try another." labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput invalid invalidText="Username is already taken. Please try another." labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Warning state
|
||||
|
||||
<TextInput warn warnText="Your user name is different from your log in ID." labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput warn warnText="Your username is different from your log in ID." labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Disabled state
|
||||
|
||||
<TextInput disabled labelText="User name" placeholder="Enter user name..." />
|
||||
<TextInput disabled labelText="Username" placeholder="Enter username..." />
|
||||
|
||||
## Skeleton
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue