@warp-ds/elements 2.9.1 → 2.10.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +347 -284
- package/dist/docs/button/accessibility.md +42 -0
- package/dist/docs/button/api.md +63 -39
- package/dist/docs/button/button.md +322 -40
- package/dist/docs/button/examples.md +126 -0
- package/dist/docs/button/usage.md +89 -0
- package/dist/docs/modal/accessibility.md +1 -0
- package/dist/docs/modal/api.md +51 -0
- package/dist/docs/modal/examples.md +67 -0
- package/dist/docs/modal/modal.md +238 -0
- package/dist/docs/modal/usage.md +110 -0
- package/dist/docs/modal-footer/accessibility.md +1 -0
- package/dist/docs/modal-footer/api.md +11 -0
- package/dist/docs/modal-footer/examples.md +1 -0
- package/dist/docs/modal-footer/modal-footer.md +23 -0
- package/dist/docs/modal-footer/usage.md +1 -0
- package/dist/docs/modal-header/accessibility.md +1 -0
- package/dist/docs/modal-header/api.md +42 -0
- package/dist/docs/modal-header/examples.md +1 -0
- package/dist/docs/modal-header/modal-header.md +54 -0
- package/dist/docs/modal-header/usage.md +1 -0
- package/dist/docs/page-indicator/api.md +6 -6
- package/dist/docs/page-indicator/examples.md +8 -0
- package/dist/docs/page-indicator/page-indicator.md +23 -6
- package/dist/docs/page-indicator/usage.md +8 -0
- package/dist/docs/pagination/api.md +12 -10
- package/dist/docs/pagination/examples.md +20 -0
- package/dist/docs/pagination/pagination.md +50 -12
- package/dist/docs/pagination/usage.md +18 -0
- package/dist/docs/pill/accessibility.md +2 -0
- package/dist/docs/pill/api.md +10 -26
- package/dist/docs/pill/examples.md +23 -0
- package/dist/docs/pill/pill.md +43 -28
- package/dist/docs/pill/usage.md +8 -0
- package/dist/docs/radio/accessibility.md +1 -0
- package/dist/docs/radio/api.md +57 -0
- package/dist/docs/radio/examples.md +1 -0
- package/dist/docs/radio/radio.md +69 -0
- package/dist/docs/radio/usage.md +1 -0
- package/dist/docs/radio-group/accessibility.md +1 -0
- package/dist/docs/radio-group/api.md +69 -0
- package/dist/docs/radio-group/examples.md +68 -0
- package/dist/docs/radio-group/radio-group.md +311 -0
- package/dist/docs/radio-group/styling.md +118 -0
- package/dist/docs/radio-group/usage.md +44 -0
- package/dist/docs/select/accessibility.md +2 -0
- package/dist/docs/select/api.md +20 -16
- package/dist/docs/select/examples.md +116 -0
- package/dist/docs/select/select.md +168 -18
- package/dist/docs/select/usage.md +30 -0
- package/dist/index.d.ts +441 -474
- package/dist/packages/attention/attention.js +23 -21
- package/dist/packages/attention/attention.js.map +3 -3
- package/dist/packages/button/button.d.ts +54 -37
- package/dist/packages/button/button.js +17 -15
- package/dist/packages/button/button.js.map +3 -3
- package/dist/packages/button/button.react.stories.d.ts +2 -2
- package/dist/packages/button/react.d.ts +1 -1
- package/dist/packages/modal/index.d.ts +4 -4
- package/dist/packages/modal/index.js +4 -4
- package/dist/packages/modal/modal.d.ts +21 -12
- package/dist/packages/modal/modal.js +4 -4
- package/dist/packages/modal/modal.js.map +3 -3
- package/dist/packages/modal/modal.react.stories.d.ts +3 -3
- package/dist/packages/modal/modal.stories.d.ts +2 -1
- package/dist/packages/modal/modal.stories.js +85 -3
- package/dist/packages/modal/react.d.ts +2 -2
- package/dist/packages/modal-footer/modal-footer.d.ts +5 -3
- package/dist/packages/modal-footer/modal-footer.js +4 -4
- package/dist/packages/modal-footer/modal-footer.js.map +3 -3
- package/dist/packages/modal-footer/react.d.ts +1 -1
- package/dist/packages/modal-header/modal-header.d.ts +21 -11
- package/dist/packages/modal-header/modal-header.js +1 -1
- package/dist/packages/modal-header/modal-header.js.map +3 -3
- package/dist/packages/modal-header/react.d.ts +2 -2
- package/dist/packages/page-indicator/page-indicator.d.ts +9 -14
- package/dist/packages/page-indicator/page-indicator.js.map +2 -2
- package/dist/packages/pagination/pagination.d.ts +11 -11
- package/dist/packages/pagination/pagination.js.map +2 -2
- package/dist/packages/pill/pill.d.ts +14 -29
- package/dist/packages/pill/pill.js.map +2 -2
- package/dist/packages/pill/pill.react.stories.d.ts +2 -2
- package/dist/packages/pill/react.d.ts +1 -1
- package/dist/packages/radio/radio.d.ts +51 -13
- package/dist/packages/radio/radio.js +3 -3
- package/dist/packages/radio/radio.js.map +3 -3
- package/dist/packages/radio/radio.react.stories.d.ts +1 -1
- package/dist/packages/radio/radio.stories.d.ts +2 -2
- package/dist/packages/radio/react.d.ts +2 -2
- package/dist/packages/radio-group/radio-group.d.ts +43 -5
- package/dist/packages/radio-group/radio-group.js +7 -7
- package/dist/packages/radio-group/radio-group.js.map +3 -3
- package/dist/packages/radio-group/react.d.ts +4 -4
- package/dist/packages/select/select.d.ts +32 -48
- package/dist/packages/select/select.js.map +2 -2
- package/dist/web-types.json +349 -115
- package/package.json +5 -5
|
@@ -1 +1,117 @@
|
|
|
1
1
|
## Examples
|
|
2
|
+
|
|
3
|
+
<elements-example>
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<w-select label="Berries">
|
|
7
|
+
<option value="raspberries">Raspberries</option>
|
|
8
|
+
<option value="strawberries">Strawberries</option>
|
|
9
|
+
<option value="cloudberries">Cloudberries</option>
|
|
10
|
+
</w-select>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
</elements-example>
|
|
14
|
+
|
|
15
|
+
### Placeholder
|
|
16
|
+
|
|
17
|
+
A select doesn't have a `placeholder` as such, but an `<option>` with an empty value gives a similar result.
|
|
18
|
+
|
|
19
|
+
<elements-example>
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<w-select label="Berries">
|
|
23
|
+
<option value="">Select an option</option>
|
|
24
|
+
<option value="raspberries">Raspberries</option>
|
|
25
|
+
<option value="strawberries">Strawberries</option>
|
|
26
|
+
<option value="cloudberries">Cloudberries</option>
|
|
27
|
+
</w-select>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
</elements-example>
|
|
31
|
+
|
|
32
|
+
### Optional
|
|
33
|
+
|
|
34
|
+
Add the `optional` prop to indicate that the select is not required. To make the select optional you must add an `<option>` with an empty value.
|
|
35
|
+
|
|
36
|
+
<elements-example>
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<w-select label="Berries" optional>
|
|
40
|
+
<option value="">Select an option</option>
|
|
41
|
+
<option value="raspberries">Raspberries</option>
|
|
42
|
+
<option value="strawberries">Strawberries</option>
|
|
43
|
+
<option value="cloudberries">Cloudberries</option>
|
|
44
|
+
</w-select>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
</elements-example>
|
|
48
|
+
|
|
49
|
+
### Help text
|
|
50
|
+
|
|
51
|
+
Use `help-text` to give additional context when the label and options are not enough.
|
|
52
|
+
|
|
53
|
+
<elements-example>
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<w-select label="Berries" help-text="We assume this is your jam">
|
|
57
|
+
<option value="raspberries">Raspberries</option>
|
|
58
|
+
<option value="strawberries">Strawberries</option>
|
|
59
|
+
<option value="cloudberries">Cloudberries</option>
|
|
60
|
+
</w-select>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
</elements-example>
|
|
64
|
+
|
|
65
|
+
### No visual label
|
|
66
|
+
|
|
67
|
+
You must set either an `aria-label` or an [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby).
|
|
68
|
+
|
|
69
|
+
<elements-example>
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<w-select aria-label="Berries">
|
|
73
|
+
<option value="raspberries">Raspberries</option>
|
|
74
|
+
<option value="strawberries" selected>Strawberries</option>
|
|
75
|
+
<option value="cloudberries">Cloudberries</option>
|
|
76
|
+
</w-select>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</elements-example>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Disabled
|
|
83
|
+
|
|
84
|
+
Keep in mind that using disabled is an anti-pattern.
|
|
85
|
+
|
|
86
|
+
There will always be users who don't understand why an element is disabled, or users who can't even see that
|
|
87
|
+
it is disabled because of poor lighting conditions or other reasons.
|
|
88
|
+
|
|
89
|
+
Please consider more informative alternatives before choosing to use disabled on an element.
|
|
90
|
+
|
|
91
|
+
<elements-example>
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<w-select label="Berries" disabled>
|
|
95
|
+
<option value="raspberries">Raspberries</option>
|
|
96
|
+
<option value="strawberries">Strawberries</option>
|
|
97
|
+
<option value="cloudberries">Cloudberries</option>
|
|
98
|
+
</w-select>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
</elements-example>
|
|
102
|
+
|
|
103
|
+
### Read only
|
|
104
|
+
|
|
105
|
+
The `readonly` boolean attribute makes the selection immutable. Unlike disabled the select remains focusable. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/readOnly) for more information.
|
|
106
|
+
|
|
107
|
+
<elements-example>
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<w-select label="Berries" readonly>
|
|
111
|
+
<option value="raspberries">Raspberries</option>
|
|
112
|
+
<option value="strawberries">Strawberries</option>
|
|
113
|
+
<option value="cloudberries">Cloudberries</option>
|
|
114
|
+
</w-select>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
</elements-example>
|
|
@@ -4,14 +4,160 @@
|
|
|
4
4
|
|
|
5
5
|
A dropdown component for selecting a single value.
|
|
6
6
|
|
|
7
|
-
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-select--docs)
|
|
8
|
-
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
9
|
+
<elements-example>
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<w-select label="Berries">
|
|
13
|
+
<option value="raspberries">Raspberries</option>
|
|
14
|
+
<option value="strawberries">Strawberries</option>
|
|
15
|
+
<option value="cloudberries">Cloudberries</option>
|
|
16
|
+
</w-select>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
</elements-example>
|
|
20
|
+
|
|
21
|
+
### Validation
|
|
22
|
+
|
|
23
|
+
Set the `invalid` attribute to display a textfield as invalid.
|
|
24
|
+
|
|
25
|
+
`invalid` should be paired with `help-text` to provide feedback to the user about how to correct the error.
|
|
26
|
+
|
|
27
|
+
<elements-example>
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<w-select label="Berries" invalid help-text="Select a red berry">
|
|
31
|
+
<option value="raspberries">Raspberries</option>
|
|
32
|
+
<option value="strawberries">Strawberries</option>
|
|
33
|
+
<option value="cloudberries" selected>Cloudberries</option>
|
|
34
|
+
</w-select>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
</elements-example>
|
|
38
|
+
|
|
11
39
|
## Accessibility
|
|
12
40
|
|
|
41
|
+
If a visible label isn't specified, an `aria-label` must be provided to the text field for accessibility. If the field is labeled by a separate element, an `aria-labelledby` property must be provided using the `id` of the labeling element instead.
|
|
42
|
+
|
|
13
43
|
## Examples
|
|
14
44
|
|
|
45
|
+
<elements-example>
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<w-select label="Berries">
|
|
49
|
+
<option value="raspberries">Raspberries</option>
|
|
50
|
+
<option value="strawberries">Strawberries</option>
|
|
51
|
+
<option value="cloudberries">Cloudberries</option>
|
|
52
|
+
</w-select>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</elements-example>
|
|
56
|
+
|
|
57
|
+
### Placeholder
|
|
58
|
+
|
|
59
|
+
A select doesn't have a `placeholder` as such, but an `<option>` with an empty value gives a similar result.
|
|
60
|
+
|
|
61
|
+
<elements-example>
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<w-select label="Berries">
|
|
65
|
+
<option value="">Select an option</option>
|
|
66
|
+
<option value="raspberries">Raspberries</option>
|
|
67
|
+
<option value="strawberries">Strawberries</option>
|
|
68
|
+
<option value="cloudberries">Cloudberries</option>
|
|
69
|
+
</w-select>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
</elements-example>
|
|
73
|
+
|
|
74
|
+
### Optional
|
|
75
|
+
|
|
76
|
+
Add the `optional` prop to indicate that the select is not required. To make the select optional you must add an `<option>` with an empty value.
|
|
77
|
+
|
|
78
|
+
<elements-example>
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<w-select label="Berries" optional>
|
|
82
|
+
<option value="">Select an option</option>
|
|
83
|
+
<option value="raspberries">Raspberries</option>
|
|
84
|
+
<option value="strawberries">Strawberries</option>
|
|
85
|
+
<option value="cloudberries">Cloudberries</option>
|
|
86
|
+
</w-select>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
</elements-example>
|
|
90
|
+
|
|
91
|
+
### Help text
|
|
92
|
+
|
|
93
|
+
Use `help-text` to give additional context when the label and options are not enough.
|
|
94
|
+
|
|
95
|
+
<elements-example>
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<w-select label="Berries" help-text="We assume this is your jam">
|
|
99
|
+
<option value="raspberries">Raspberries</option>
|
|
100
|
+
<option value="strawberries">Strawberries</option>
|
|
101
|
+
<option value="cloudberries">Cloudberries</option>
|
|
102
|
+
</w-select>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
</elements-example>
|
|
106
|
+
|
|
107
|
+
### No visual label
|
|
108
|
+
|
|
109
|
+
You must set either an `aria-label` or an [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-labelledby).
|
|
110
|
+
|
|
111
|
+
<elements-example>
|
|
112
|
+
|
|
113
|
+
```html
|
|
114
|
+
<w-select aria-label="Berries">
|
|
115
|
+
<option value="raspberries">Raspberries</option>
|
|
116
|
+
<option value="strawberries" selected>Strawberries</option>
|
|
117
|
+
<option value="cloudberries">Cloudberries</option>
|
|
118
|
+
</w-select>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
</elements-example>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Disabled
|
|
125
|
+
|
|
126
|
+
Keep in mind that using disabled is an anti-pattern.
|
|
127
|
+
|
|
128
|
+
There will always be users who don't understand why an element is disabled, or users who can't even see that
|
|
129
|
+
it is disabled because of poor lighting conditions or other reasons.
|
|
130
|
+
|
|
131
|
+
Please consider more informative alternatives before choosing to use disabled on an element.
|
|
132
|
+
|
|
133
|
+
<elements-example>
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<w-select label="Berries" disabled>
|
|
137
|
+
<option value="raspberries">Raspberries</option>
|
|
138
|
+
<option value="strawberries">Strawberries</option>
|
|
139
|
+
<option value="cloudberries">Cloudberries</option>
|
|
140
|
+
</w-select>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
</elements-example>
|
|
144
|
+
|
|
145
|
+
### Read only
|
|
146
|
+
|
|
147
|
+
The `readonly` boolean attribute makes the selection immutable. Unlike disabled the select remains focusable. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/readOnly) for more information.
|
|
148
|
+
|
|
149
|
+
<elements-example>
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<w-select label="Berries" readonly>
|
|
153
|
+
<option value="raspberries">Raspberries</option>
|
|
154
|
+
<option value="strawberries">Strawberries</option>
|
|
155
|
+
<option value="cloudberries">Cloudberries</option>
|
|
156
|
+
</w-select>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
</elements-example>
|
|
160
|
+
|
|
15
161
|
## `<w-select>` API
|
|
16
162
|
|
|
17
163
|
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
@@ -20,19 +166,19 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
|
|
|
20
166
|
|
|
21
167
|
| Name | Type | Default | Summary |
|
|
22
168
|
|-|-|-|-|
|
|
23
|
-
| always | `boolean` | `false` | Whether to always show a hint
|
|
24
|
-
| auto-focus | `boolean` | `false` | Whether the element should receive focus on render
|
|
169
|
+
| always | `boolean` | `false` | Whether to always show a hint. **Deprecated**: Use `help-text` instead and only set it if you want to display the help text. |
|
|
170
|
+
| auto-focus | `boolean` | `false` | Whether the element should receive focus on render. **Deprecated**: Use the native `autofocus` attribute instead. |
|
|
25
171
|
| autofocus | `boolean` | `false` | Whether the element should receive focus on render |
|
|
26
172
|
| disabled | `boolean` | `false` | Renders the field in a disabled state. |
|
|
27
|
-
| help-text | `string` | `-` | The content displayed as the help text.
|
|
28
|
-
| hint | `string` | `-` | The content displayed as the help text
|
|
29
|
-
| invalid | `boolean` | `false` | Renders the field in an invalid state.
|
|
30
|
-
| label | `string` | `-` | The content to
|
|
31
|
-
| name | `string` | `-` | - |
|
|
32
|
-
| optional | `boolean` | `false` | Whether to show optional
|
|
33
|
-
| read-only | `boolean` | `false` | Renders the field in a readonly state
|
|
173
|
+
| help-text | `string` | `-` | The content displayed as the help text. |
|
|
174
|
+
| hint | `string` | `-` | The content displayed as the help text. **Deprecated**: Use `help-text` instead. |
|
|
175
|
+
| invalid | `boolean` | `false` | Renders the field in an invalid state. |
|
|
176
|
+
| label | `string` | `-` | The content to display as the label. |
|
|
177
|
+
| name | `string` | `-` | The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the select when submitting the form. |
|
|
178
|
+
| optional | `boolean` | `false` | Whether to show the optional indicator after the label. |
|
|
179
|
+
| read-only | `boolean` | `false` | Renders the field in a readonly state. **Deprecated**: Use the native readonly attribute instead. |
|
|
34
180
|
| readonly | `boolean` | `false` | Renders the field in a readonly state. |
|
|
35
|
-
| value | `string` | `-` |
|
|
181
|
+
| value | `string` | `-` | Lets you set the current value. |
|
|
36
182
|
|
|
37
183
|
### Property Details
|
|
38
184
|
|
|
@@ -70,7 +216,9 @@ Renders the field in a disabled state.
|
|
|
70
216
|
|
|
71
217
|
#### help-text
|
|
72
218
|
|
|
73
|
-
The content displayed as the help text.
|
|
219
|
+
The content displayed as the help text.
|
|
220
|
+
|
|
221
|
+
Paired with `invalid` to show the text as a validation error.
|
|
74
222
|
|
|
75
223
|
- Type: `string`
|
|
76
224
|
- Default: `-`
|
|
@@ -86,28 +234,30 @@ The content displayed as the help text.
|
|
|
86
234
|
|
|
87
235
|
#### invalid
|
|
88
236
|
|
|
89
|
-
Renders the field in an invalid state.
|
|
237
|
+
Renders the field in an invalid state.
|
|
238
|
+
|
|
239
|
+
Paired with `help-text` to provide feedback about the error.
|
|
90
240
|
|
|
91
241
|
- Type: `boolean`
|
|
92
242
|
- Default: `false`
|
|
93
243
|
|
|
94
244
|
#### label
|
|
95
245
|
|
|
96
|
-
The content to
|
|
246
|
+
The content to display as the label.
|
|
97
247
|
|
|
98
248
|
- Type: `string`
|
|
99
249
|
- Default: `-`
|
|
100
250
|
|
|
101
251
|
#### name
|
|
102
252
|
|
|
103
|
-
|
|
253
|
+
The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the select when submitting the form.
|
|
104
254
|
|
|
105
255
|
- Type: `string`
|
|
106
256
|
- Default: `-`
|
|
107
257
|
|
|
108
258
|
#### optional
|
|
109
259
|
|
|
110
|
-
Whether to show optional
|
|
260
|
+
Whether to show the optional indicator after the label.
|
|
111
261
|
|
|
112
262
|
- Type: `boolean`
|
|
113
263
|
- Default: `false`
|
|
@@ -130,7 +280,7 @@ Renders the field in a readonly state.
|
|
|
130
280
|
|
|
131
281
|
#### value
|
|
132
282
|
|
|
133
|
-
|
|
283
|
+
Lets you set the current value.
|
|
134
284
|
|
|
135
285
|
- Type: `string`
|
|
136
286
|
- Default: `-`
|
|
@@ -1 +1,31 @@
|
|
|
1
1
|
## Usage
|
|
2
|
+
|
|
3
|
+
<elements-example>
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<w-select label="Berries">
|
|
7
|
+
<option value="raspberries">Raspberries</option>
|
|
8
|
+
<option value="strawberries">Strawberries</option>
|
|
9
|
+
<option value="cloudberries">Cloudberries</option>
|
|
10
|
+
</w-select>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
</elements-example>
|
|
14
|
+
|
|
15
|
+
### Validation
|
|
16
|
+
|
|
17
|
+
Set the `invalid` attribute to display a textfield as invalid.
|
|
18
|
+
|
|
19
|
+
`invalid` should be paired with `help-text` to provide feedback to the user about how to correct the error.
|
|
20
|
+
|
|
21
|
+
<elements-example>
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<w-select label="Berries" invalid help-text="Select a red berry">
|
|
25
|
+
<option value="raspberries">Raspberries</option>
|
|
26
|
+
<option value="strawberries">Strawberries</option>
|
|
27
|
+
<option value="cloudberries" selected>Cloudberries</option>
|
|
28
|
+
</w-select>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
</elements-example>
|