From c28f695d4326d2df2629ad90bde579d5a0e99da7 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 29 Apr 2024 21:41:16 -0700 Subject: [PATCH] feat(text-area)!: integrate `TextArea` with v11 --- COMPONENT_INDEX.md | 22 ++--- docs/src/COMPONENT_API.json | 62 ++++++++++--- docs/src/pages/components/TextArea.svx | 30 ++++++- src/TextArea/TextArea.svelte | 98 +++++++++++++++------ src/TextArea/TextAreaSkeleton.svelte | 13 +-- types/TextArea/TextArea.svelte.d.ts | 24 +++-- types/TextArea/TextAreaSkeleton.svelte.d.ts | 14 +-- 7 files changed, 182 insertions(+), 81 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 76cc14b220..e568363b8f 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4110,6 +4110,7 @@ None. | cols | No | let | No | number | undefined | Specify the number of cols | | rows | No | let | No | number | 4 | Specify the number of rows | | maxCount | No | let | No | number | undefined | Specify the max character count | +| counterMode | No | let | No | "character" | "word" | "character" | Specify the counter mode | | light | No | let | No | boolean | false | Set to `true` to enable the light variant | | disabled | No | let | No | boolean | false | Set to `true` to disable the input | | readonly | No | let | No | boolean | false | Set to `true` to use the read-only variant | @@ -4118,23 +4119,23 @@ None. | hideLabel | No | let | No | boolean | false | Set to `true` to visually hide the label text | | invalid | No | let | No | boolean | false | Set to `true` to indicate an invalid state | | invalidText | No | let | No | string | "" | Specify the text for the invalid state | +| warn | No | let | No | boolean | false | Set to `true` to indicate an warning state | +| warnText | No | let | No | string | "" | Specify the warning state text | | id | No | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the textarea element | | name | No | let | No | string | undefined | Specify a name attribute for the input | ### Slots -| Slot name | Default | Props | Fallback | -| :-------- | :------ | :---- | :----------------------- | -| labelText | No | -- | {labelText} | +| Slot name | Default | Props | Fallback | +| :---------- | :------ | :---- | :------------------------- | +| invalidText | No | -- | {invalidText} | +| labelText | No | -- | {labelText} | +| warnText | No | -- | {warnText} | ### Events | Event name | Type | Detail | | :--------- | :-------- | :----- | -| click | forwarded | -- | -| mouseover | forwarded | -- | -| mouseenter | forwarded | -- | -| mouseleave | forwarded | -- | | change | forwarded | -- | | input | forwarded | -- | | keydown | forwarded | -- | @@ -4157,12 +4158,7 @@ None. ### Events -| Event name | Type | Detail | -| :--------- | :-------- | :----- | -| click | forwarded | -- | -| mouseover | forwarded | -- | -| mouseenter | forwarded | -- | -| mouseleave | forwarded | -- | +None. ## `TextInput` diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 61f0969dfe..567dcbd247 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -12562,6 +12562,18 @@ "constant": false, "reactive": false }, + { + "name": "counterMode", + "kind": "let", + "description": "Specify the counter mode", + "type": "\"character\" | \"word\"", + "value": "\"character\"", + "isFunction": false, + "isFunctionDeclaration": false, + "isRequired": false, + "constant": false, + "reactive": false + }, { "name": "light", "kind": "let", @@ -12658,6 +12670,30 @@ "constant": false, "reactive": false }, + { + "name": "warn", + "kind": "let", + "description": "Set to `true` to indicate an warning state", + "type": "boolean", + "value": "false", + "isFunction": false, + "isFunctionDeclaration": false, + "isRequired": false, + "constant": false, + "reactive": false + }, + { + "name": "warnText", + "kind": "let", + "description": "Specify the warning state text", + "type": "string", + "value": "\"\"", + "isFunction": false, + "isFunctionDeclaration": false, + "isRequired": false, + "constant": false, + "reactive": false + }, { "name": "id", "kind": "let", @@ -12696,18 +12732,26 @@ ], "moduleExports": [], "slots": [ + { + "name": "invalidText", + "default": false, + "fallback": "{invalidText}", + "slot_props": "{}" + }, { "name": "labelText", "default": false, "fallback": "{labelText}", "slot_props": "{}" + }, + { + "name": "warnText", + "default": false, + "fallback": "{warnText}", + "slot_props": "{}" } ], "events": [ - { "type": "forwarded", "name": "click", "element": "div" }, - { "type": "forwarded", "name": "mouseover", "element": "div" }, - { "type": "forwarded", "name": "mouseenter", "element": "div" }, - { "type": "forwarded", "name": "mouseleave", "element": "div" }, { "type": "forwarded", "name": "change", "element": "textarea" }, { "type": "forwarded", "name": "input", "element": "textarea" }, { "type": "forwarded", "name": "keydown", "element": "textarea" }, @@ -12738,14 +12782,8 @@ ], "moduleExports": [], "slots": [], - "events": [ - { "type": "forwarded", "name": "click", "element": "div" }, - { "type": "forwarded", "name": "mouseover", "element": "div" }, - { "type": "forwarded", "name": "mouseenter", "element": "div" }, - { "type": "forwarded", "name": "mouseleave", "element": "div" } - ], - "typedefs": [], - "rest_props": { "type": "Element", "name": "div" } + "events": [], + "typedefs": [] }, { "moduleName": "TextInput", diff --git a/docs/src/pages/components/TextArea.svx b/docs/src/pages/components/TextArea.svx index 6be736b52a..cef310de14 100644 --- a/docs/src/pages/components/TextArea.svx +++ b/docs/src/pages/components/TextArea.svx @@ -11,14 +11,20 @@ components: ["TextArea", "TextAreaSkeleton"]