diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md
index 76cc14b2..e568363b 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 61f0969d..567dcbd2 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 6be736b5..cef310de 100644
--- a/docs/src/pages/components/TextArea.svx
+++ b/docs/src/pages/components/TextArea.svx
@@ -11,14 +11,20 @@ components: ["TextArea", "TextAreaSkeleton"]
-## Maximum character count
+## Counter (character)
-Specify the max character count using the `maxCount` prop. A character counter will be displayed to the right of the label.
+Specify a number using the `maxCount` prop to show a character counter. The default mode is `"charcacter"`.
-You can always use the native `maxlength` attribute if you'd prefer that a counter not be shown.
+The `maxlength` attribute is set to `maxCount` in this mode. You can override this by specifying `maxlength={undefined}`.
+## Counter (word)
+
+Specify `counterMode="word"` for the counter to count words instead of characters.
+
+
+
## With helper text
@@ -31,14 +37,32 @@ You can always use the native `maxlength` attribute if you'd prefer that a count
+## Read-only variant
+
+
+
## Custom rows
+Specify `rows` to adjust the height of the textarea.
+
+By default, `rows` is set to `4`.
+
+## Custom cols
+
+If `cols` is a number, the `textarea` will not be resizeable.
+
+
+
## Invalid state
+## Warning state
+
+
+
## Disabled state
diff --git a/src/TextArea/TextArea.svelte b/src/TextArea/TextArea.svelte
index bd11d718..1a8c89e4 100644
--- a/src/TextArea/TextArea.svelte
+++ b/src/TextArea/TextArea.svelte
@@ -1,4 +1,6 @@
-
-
-
-