@warp-ds/elements 2.10.0-next.1 → 2.10.0-next.3

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.
Files changed (84) hide show
  1. package/dist/custom-elements.json +146 -69
  2. package/dist/docs/card/accessibility.md +74 -0
  3. package/dist/docs/card/api.md +9 -3
  4. package/dist/docs/card/card.md +234 -3
  5. package/dist/docs/card/examples.md +75 -0
  6. package/dist/docs/card/usage.md +76 -0
  7. package/dist/docs/combobox/accessibility.md +71 -0
  8. package/dist/docs/combobox/api.md +60 -30
  9. package/dist/docs/combobox/combobox.md +203 -30
  10. package/dist/docs/combobox/examples.md +44 -0
  11. package/dist/docs/combobox/usage.md +28 -0
  12. package/dist/docs/icon/accessibility.md +5 -0
  13. package/dist/docs/icon/api.md +37 -0
  14. package/dist/docs/icon/examples.md +45 -0
  15. package/dist/docs/icon/icon.md +107 -0
  16. package/dist/docs/icon/usage.md +11 -0
  17. package/dist/docs/link/api.md +18 -22
  18. package/dist/docs/link/examples.md +75 -0
  19. package/dist/docs/link/link.md +111 -22
  20. package/dist/docs/link/usage.md +18 -0
  21. package/dist/index.d.ts +479 -183
  22. package/dist/packages/affix/affix.js +3 -3
  23. package/dist/packages/affix/affix.js.map +4 -4
  24. package/dist/packages/alert/alert.js +1 -1
  25. package/dist/packages/alert/alert.js.map +3 -3
  26. package/dist/packages/attention/attention.js.map +4 -4
  27. package/dist/packages/attention/attention.test.js +1 -1
  28. package/dist/packages/breadcrumbs/breadcrumbs.js.map +1 -1
  29. package/dist/packages/button/button.js.map +3 -3
  30. package/dist/packages/card/card.d.ts +9 -6
  31. package/dist/packages/card/card.js.map +3 -3
  32. package/dist/packages/checkbox/checkbox.d.ts +40 -11
  33. package/dist/packages/checkbox/checkbox.js.map +2 -2
  34. package/dist/packages/checkbox/checkbox.test.js +1 -1
  35. package/dist/packages/checkbox-group/checkbox-group.a11y.test.js +1 -1
  36. package/dist/packages/checkbox-group/checkbox-group.d.ts +30 -5
  37. package/dist/packages/checkbox-group/checkbox-group.js.map +3 -3
  38. package/dist/packages/combobox/combobox.a11y.test.js +24 -0
  39. package/dist/packages/combobox/combobox.d.ts +65 -45
  40. package/dist/packages/combobox/combobox.hydration.test.js +39 -1
  41. package/dist/packages/combobox/combobox.js +13 -13
  42. package/dist/packages/combobox/combobox.js.map +4 -4
  43. package/dist/packages/combobox/combobox.stories.js +28 -15
  44. package/dist/packages/combobox/combobox.test.js +110 -0
  45. package/dist/packages/datepicker/DatePicker.test.js +1 -1
  46. package/dist/packages/datepicker/datepicker.js.map +4 -4
  47. package/dist/packages/datepicker/datepicker.test.js +1 -1
  48. package/dist/packages/expandable/expandable.js +2 -2
  49. package/dist/packages/expandable/expandable.js.map +3 -3
  50. package/dist/packages/icon/icon.d.ts +13 -3
  51. package/dist/packages/icon/icon.js +2 -2
  52. package/dist/packages/icon/icon.js.map +3 -3
  53. package/dist/packages/icon/icon.react.stories.d.ts +1 -1
  54. package/dist/packages/icon/react.d.ts +2 -2
  55. package/dist/packages/link/link.d.ts +15 -16
  56. package/dist/packages/link/link.js.map +2 -2
  57. package/dist/packages/link/link.test.js +1 -1
  58. package/dist/packages/modal-header/modal-header.js +3 -1
  59. package/dist/packages/modal-header/modal-header.js.map +4 -4
  60. package/dist/packages/page-indicator/page-indicator.js.map +1 -1
  61. package/dist/packages/pagination/pagination.js.map +4 -4
  62. package/dist/packages/pagination/pagination.test.js +1 -1
  63. package/dist/packages/pill/pill.js.map +4 -4
  64. package/dist/packages/radio/radio.test.js +1 -1
  65. package/dist/packages/radio-group/radio-group.a11y.test.js +1 -1
  66. package/dist/packages/radio-group/radio-group.js.map +1 -1
  67. package/dist/packages/select/select.js.map +4 -4
  68. package/dist/packages/slider/slider.js.map +1 -1
  69. package/dist/packages/slider/slider.test.js +1 -1
  70. package/dist/packages/slider-thumb/slider-thumb.js.map +1 -1
  71. package/dist/packages/step/step.js +1 -1
  72. package/dist/packages/step/step.js.map +4 -4
  73. package/dist/packages/switch/switch.a11y.test.js +1 -1
  74. package/dist/packages/tabs/tabs.a11y.test.js +1 -1
  75. package/dist/packages/tabs/tabs.test.js +1 -1
  76. package/dist/packages/textarea/textarea.js.map +1 -1
  77. package/dist/packages/textarea/textarea.test.js +1 -1
  78. package/dist/packages/textfield/textfield.test.js +1 -1
  79. package/dist/packages/toast/toast.js +3 -3
  80. package/dist/packages/toast/toast.js.map +4 -4
  81. package/dist/packages/toast/toast.stories.d.ts +1 -5
  82. package/dist/packages/toast/toast.stories.js +0 -17
  83. package/dist/web-types.json +147 -75
  84. package/package.json +2 -2
@@ -1 +1,75 @@
1
1
  ## Accessibility
2
+
3
+ Card is a visual container. It does not create a heading, landmark, list item, link, button, or other semantic structure for the slotted content.
4
+
5
+ ### Provide Semantic Content
6
+
7
+ Use semantic HTML inside the card so assistive technologies can understand the content.
8
+
9
+ ```html
10
+ <w-card>
11
+ <article style="padding: 16px;" aria-labelledby="listing-heading">
12
+ <h3 id="listing-heading">Apartment in Oslo</h3>
13
+ <p>Bright 3-room apartment with balcony.</p>
14
+ </article>
15
+ </w-card>
16
+ ```
17
+
18
+ Do not rely on the card surface, border, or selected styling to communicate meaning.
19
+
20
+ ### Selected State
21
+
22
+ Use `selected` only when the card represents a selected item or choice.
23
+
24
+ ```html
25
+ <w-card selected>
26
+ <div style="padding: 16px;">
27
+ <h3>Standard delivery</h3>
28
+ <p>Delivered in 2-4 business days.</p>
29
+ </div>
30
+ </w-card>
31
+ ```
32
+
33
+ The selected state should also be clear from the surrounding context, such as a group label, heading, or visible text.
34
+
35
+ ### Clickable Cards
36
+
37
+ Use `clickable` only when the whole card has one action or represents one selectable choice.
38
+
39
+ ```html
40
+ <w-card clickable>
41
+ <div style="padding: 16px;">
42
+ <h3>Home delivery</h3>
43
+ <p>Delivered to your door.</p>
44
+ </div>
45
+ </w-card>
46
+ ```
47
+
48
+ The visible card content should describe what will be selected or activated. Do not put separate links, buttons, form controls, or other interactive elements inside a clickable card.
49
+
50
+ ### Prefer Specific Interactive Elements
51
+
52
+ If only part of the card is interactive, use the appropriate element for that action.
53
+
54
+ Use a link for navigation:
55
+
56
+ ```html
57
+ <w-card>
58
+ <div style="padding: 16px;">
59
+ <h3><a href="/listings/123">Apartment in Oslo</a></h3>
60
+ <p>Bright 3-room apartment with balcony.</p>
61
+ </div>
62
+ </w-card>
63
+ ```
64
+
65
+ Use a button for an action on the current page:
66
+
67
+ ```html
68
+ <w-card>
69
+ <div style="padding: 16px;">
70
+ <h3>Apartment in Oslo</h3>
71
+ <p>Bright 3-room apartment with balcony.</p>
72
+ <w-button variant="primary">Contact seller</w-button>
73
+ </div>
74
+ </w-card>
75
+ ```
@@ -7,9 +7,9 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
9
  | buttonText (JS only) | `unknown` | `-` | - |
10
- | clickable | `boolean` | `false` | - |
11
- | flat | `boolean` | `false` | - |
12
- | selected | `boolean` | `false` | - |
10
+ | clickable | `boolean` | `false` | Whether the whole card is interactive. |
11
+ | flat | `boolean` | `false` | Whether the card uses the flat visual treatment. |
12
+ | selected | `boolean` | `false` | Whether the card is visually selected. |
13
13
 
14
14
  ### Property Details
15
15
 
@@ -22,21 +22,27 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
22
22
 
23
23
  #### clickable
24
24
 
25
+ Whether the whole card is interactive.
25
26
 
27
+ When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.
26
28
 
27
29
  - Type: `boolean`
28
30
  - Default: `false`
29
31
 
30
32
  #### flat
31
33
 
34
+ Whether the card uses the flat visual treatment.
32
35
 
36
+ Flat cards use a bordered surface instead of the default elevated surface. Use this for denser layouts or when the card sits inside another surface.
33
37
 
34
38
  - Type: `boolean`
35
39
  - Default: `false`
36
40
 
37
41
  #### selected
38
42
 
43
+ Whether the card is visually selected.
39
44
 
45
+ Use this when the card represents a selected item or choice. This only controls the visual selected state; update it from your application state when the selection changes.
40
46
 
41
47
  - Type: `boolean`
42
48
  - Default: `false`
@@ -8,10 +8,235 @@ Card is a layout component used for separating content areas on a page.
8
8
 
9
9
  ## Usage
10
10
 
11
+ Card is a layout component for visually grouping related content as one item.
12
+
13
+ Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object. The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
14
+
15
+ ### Basic Card
16
+
17
+ ```html
18
+ <w-card>
19
+ <div style="padding: 16px;">
20
+ <h3>Apartment in Oslo</h3>
21
+ <p>Bright 3-room apartment with balcony.</p>
22
+ </div>
23
+ </w-card>
24
+ ```
25
+
26
+ ### Visual Treatments
27
+
28
+ The default card uses an elevated surface. Use `flat` when the card should sit more quietly in the layout.
29
+
30
+ ```html
31
+ <w-card>
32
+ <div style="padding: 16px;">
33
+ <h3>Elevated card</h3>
34
+ <p>Use this for cards that need more visual separation.</p>
35
+ </div>
36
+ </w-card>
37
+
38
+ <w-card flat>
39
+ <div style="padding: 16px;">
40
+ <h3>Flat card</h3>
41
+ <p>Use this for dense layouts or cards inside another surface.</p>
42
+ </div>
43
+ </w-card>
44
+ ```
45
+
46
+ ### Selected Cards
47
+
48
+ Use `selected` when a card represents a selected item or choice.
49
+
50
+ ```html
51
+ <w-card selected>
52
+ <div style="padding: 16px;">
53
+ <h3>Standard delivery</h3>
54
+ <p>Delivered in 2-4 business days.</p>
55
+ </div>
56
+ </w-card>
57
+ ```
58
+
59
+ The `selected` property only controls the card's visual state. Update it from your application state when the selection changes.
60
+
61
+ ### Clickable Cards
62
+
63
+ Use `clickable` when the whole card should behave as one interactive choice. The card becomes keyboard focusable, and Enter or Space triggers a click on the card.
64
+
65
+ ```html
66
+ <w-card clickable>
67
+ <div style="padding: 16px;">
68
+ <h3>Pick up nearby</h3>
69
+ <p>Collect the item from a pickup point.</p>
70
+ </div>
71
+ </w-card>
72
+ ```
73
+
74
+ Listen for the card's click event and update `selected` yourself.
75
+
76
+ ```html
77
+ <w-card clickable selected>
78
+ <div style="padding: 16px;">
79
+ <h3>Home delivery</h3>
80
+ <p>Delivered to your door.</p>
81
+ </div>
82
+ </w-card>
83
+ ```
84
+
85
+ Do not use `clickable` when the card contains separate links, buttons, form controls, or other interactive elements. In those cases, keep the card non-clickable and make the specific control interactive instead.
86
+
11
87
  ## Accessibility
12
88
 
89
+ Card is a visual container. It does not create a heading, landmark, list item, link, button, or other semantic structure for the slotted content.
90
+
91
+ ### Provide Semantic Content
92
+
93
+ Use semantic HTML inside the card so assistive technologies can understand the content.
94
+
95
+ ```html
96
+ <w-card>
97
+ <article style="padding: 16px;" aria-labelledby="listing-heading">
98
+ <h3 id="listing-heading">Apartment in Oslo</h3>
99
+ <p>Bright 3-room apartment with balcony.</p>
100
+ </article>
101
+ </w-card>
102
+ ```
103
+
104
+ Do not rely on the card surface, border, or selected styling to communicate meaning.
105
+
106
+ ### Selected State
107
+
108
+ Use `selected` only when the card represents a selected item or choice.
109
+
110
+ ```html
111
+ <w-card selected>
112
+ <div style="padding: 16px;">
113
+ <h3>Standard delivery</h3>
114
+ <p>Delivered in 2-4 business days.</p>
115
+ </div>
116
+ </w-card>
117
+ ```
118
+
119
+ The selected state should also be clear from the surrounding context, such as a group label, heading, or visible text.
120
+
121
+ ### Clickable Cards
122
+
123
+ Use `clickable` only when the whole card has one action or represents one selectable choice.
124
+
125
+ ```html
126
+ <w-card clickable>
127
+ <div style="padding: 16px;">
128
+ <h3>Home delivery</h3>
129
+ <p>Delivered to your door.</p>
130
+ </div>
131
+ </w-card>
132
+ ```
133
+
134
+ The visible card content should describe what will be selected or activated. Do not put separate links, buttons, form controls, or other interactive elements inside a clickable card.
135
+
136
+ ### Prefer Specific Interactive Elements
137
+
138
+ If only part of the card is interactive, use the appropriate element for that action.
139
+
140
+ Use a link for navigation:
141
+
142
+ ```html
143
+ <w-card>
144
+ <div style="padding: 16px;">
145
+ <h3><a href="/listings/123">Apartment in Oslo</a></h3>
146
+ <p>Bright 3-room apartment with balcony.</p>
147
+ </div>
148
+ </w-card>
149
+ ```
150
+
151
+ Use a button for an action on the current page:
152
+
153
+ ```html
154
+ <w-card>
155
+ <div style="padding: 16px;">
156
+ <h3>Apartment in Oslo</h3>
157
+ <p>Bright 3-room apartment with balcony.</p>
158
+ <w-button variant="primary">Contact seller</w-button>
159
+ </div>
160
+ </w-card>
161
+ ```
162
+
13
163
  ## Examples
14
164
 
165
+ ### Basic
166
+
167
+ <elements-example>
168
+
169
+ ```html
170
+ <w-card>
171
+ <div style="padding: 16px;">
172
+ <h3>Apartment in Oslo</h3>
173
+ <p>Bright 3-room apartment with balcony.</p>
174
+ </div>
175
+ </w-card>
176
+ ```
177
+
178
+ </elements-example>
179
+
180
+ ### Flat
181
+
182
+ <elements-example>
183
+
184
+ ```html
185
+ <w-card flat>
186
+ <div style="padding: 16px;">
187
+ <h3>Order summary</h3>
188
+ <p>Review the item price, delivery, and total before continuing.</p>
189
+ </div>
190
+ </w-card>
191
+ ```
192
+
193
+ </elements-example>
194
+
195
+ ### Selected
196
+
197
+ <elements-example>
198
+
199
+ ```html
200
+ <w-card selected>
201
+ <div style="padding: 16px;">
202
+ <h3>Standard delivery</h3>
203
+ <p>Delivered in 2-4 business days.</p>
204
+ </div>
205
+ </w-card>
206
+ ```
207
+
208
+ </elements-example>
209
+
210
+ ### Flat Selected
211
+
212
+ <elements-example>
213
+
214
+ ```html
215
+ <w-card flat selected>
216
+ <div style="padding: 16px;">
217
+ <h3>Pickup point</h3>
218
+ <p>Collect the item from a nearby pickup point.</p>
219
+ </div>
220
+ </w-card>
221
+ ```
222
+
223
+ </elements-example>
224
+
225
+ ### Clickable
226
+
227
+ <elements-example>
228
+
229
+ ```html
230
+ <w-card clickable>
231
+ <div style="padding: 16px;">
232
+ <h3>Home delivery</h3>
233
+ <p>Delivered to your door.</p>
234
+ </div>
235
+ </w-card>
236
+ ```
237
+
238
+ </elements-example>
239
+
15
240
  ## `<w-card>` API
16
241
 
17
242
  Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
@@ -21,9 +246,9 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
21
246
  | Name | Type | Default | Summary |
22
247
  |-|-|-|-|
23
248
  | buttonText (JS only) | `unknown` | `-` | - |
24
- | clickable | `boolean` | `false` | - |
25
- | flat | `boolean` | `false` | - |
26
- | selected | `boolean` | `false` | - |
249
+ | clickable | `boolean` | `false` | Whether the whole card is interactive. |
250
+ | flat | `boolean` | `false` | Whether the card uses the flat visual treatment. |
251
+ | selected | `boolean` | `false` | Whether the card is visually selected. |
27
252
 
28
253
  ### Property Details
29
254
 
@@ -36,21 +261,27 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
36
261
 
37
262
  #### clickable
38
263
 
264
+ Whether the whole card is interactive.
39
265
 
266
+ When set, the card becomes keyboard focusable and Enter or Space triggers a click on the card. Use this only when the whole card has one action or represents one selectable choice.
40
267
 
41
268
  - Type: `boolean`
42
269
  - Default: `false`
43
270
 
44
271
  #### flat
45
272
 
273
+ Whether the card uses the flat visual treatment.
46
274
 
275
+ Flat cards use a bordered surface instead of the default elevated surface. Use this for denser layouts or when the card sits inside another surface.
47
276
 
48
277
  - Type: `boolean`
49
278
  - Default: `false`
50
279
 
51
280
  #### selected
52
281
 
282
+ Whether the card is visually selected.
53
283
 
284
+ Use this when the card represents a selected item or choice. This only controls the visual selected state; update it from your application state when the selection changes.
54
285
 
55
286
  - Type: `boolean`
56
287
  - Default: `false`
@@ -1 +1,76 @@
1
1
  ## Examples
2
+
3
+ ### Basic
4
+
5
+ <elements-example>
6
+
7
+ ```html
8
+ <w-card>
9
+ <div style="padding: 16px;">
10
+ <h3>Apartment in Oslo</h3>
11
+ <p>Bright 3-room apartment with balcony.</p>
12
+ </div>
13
+ </w-card>
14
+ ```
15
+
16
+ </elements-example>
17
+
18
+ ### Flat
19
+
20
+ <elements-example>
21
+
22
+ ```html
23
+ <w-card flat>
24
+ <div style="padding: 16px;">
25
+ <h3>Order summary</h3>
26
+ <p>Review the item price, delivery, and total before continuing.</p>
27
+ </div>
28
+ </w-card>
29
+ ```
30
+
31
+ </elements-example>
32
+
33
+ ### Selected
34
+
35
+ <elements-example>
36
+
37
+ ```html
38
+ <w-card selected>
39
+ <div style="padding: 16px;">
40
+ <h3>Standard delivery</h3>
41
+ <p>Delivered in 2-4 business days.</p>
42
+ </div>
43
+ </w-card>
44
+ ```
45
+
46
+ </elements-example>
47
+
48
+ ### Flat Selected
49
+
50
+ <elements-example>
51
+
52
+ ```html
53
+ <w-card flat selected>
54
+ <div style="padding: 16px;">
55
+ <h3>Pickup point</h3>
56
+ <p>Collect the item from a nearby pickup point.</p>
57
+ </div>
58
+ </w-card>
59
+ ```
60
+
61
+ </elements-example>
62
+
63
+ ### Clickable
64
+
65
+ <elements-example>
66
+
67
+ ```html
68
+ <w-card clickable>
69
+ <div style="padding: 16px;">
70
+ <h3>Home delivery</h3>
71
+ <p>Delivered to your door.</p>
72
+ </div>
73
+ </w-card>
74
+ ```
75
+
76
+ </elements-example>
@@ -1 +1,77 @@
1
1
  ## Usage
2
+
3
+ Card is a layout component for visually grouping related content as one item.
4
+
5
+ Use `w-card` for listings, summaries, recommendations, or selectable choices where the grouped content should feel like a single object. The component does not add padding, headings, spacing between children, or semantic structure. Those must be provided by the content inside the card.
6
+
7
+ ### Basic Card
8
+
9
+ ```html
10
+ <w-card>
11
+ <div style="padding: 16px;">
12
+ <h3>Apartment in Oslo</h3>
13
+ <p>Bright 3-room apartment with balcony.</p>
14
+ </div>
15
+ </w-card>
16
+ ```
17
+
18
+ ### Visual Treatments
19
+
20
+ The default card uses an elevated surface. Use `flat` when the card should sit more quietly in the layout.
21
+
22
+ ```html
23
+ <w-card>
24
+ <div style="padding: 16px;">
25
+ <h3>Elevated card</h3>
26
+ <p>Use this for cards that need more visual separation.</p>
27
+ </div>
28
+ </w-card>
29
+
30
+ <w-card flat>
31
+ <div style="padding: 16px;">
32
+ <h3>Flat card</h3>
33
+ <p>Use this for dense layouts or cards inside another surface.</p>
34
+ </div>
35
+ </w-card>
36
+ ```
37
+
38
+ ### Selected Cards
39
+
40
+ Use `selected` when a card represents a selected item or choice.
41
+
42
+ ```html
43
+ <w-card selected>
44
+ <div style="padding: 16px;">
45
+ <h3>Standard delivery</h3>
46
+ <p>Delivered in 2-4 business days.</p>
47
+ </div>
48
+ </w-card>
49
+ ```
50
+
51
+ The `selected` property only controls the card's visual state. Update it from your application state when the selection changes.
52
+
53
+ ### Clickable Cards
54
+
55
+ Use `clickable` when the whole card should behave as one interactive choice. The card becomes keyboard focusable, and Enter or Space triggers a click on the card.
56
+
57
+ ```html
58
+ <w-card clickable>
59
+ <div style="padding: 16px;">
60
+ <h3>Pick up nearby</h3>
61
+ <p>Collect the item from a pickup point.</p>
62
+ </div>
63
+ </w-card>
64
+ ```
65
+
66
+ Listen for the card's click event and update `selected` yourself.
67
+
68
+ ```html
69
+ <w-card clickable selected>
70
+ <div style="padding: 16px;">
71
+ <h3>Home delivery</h3>
72
+ <p>Delivered to your door.</p>
73
+ </div>
74
+ </w-card>
75
+ ```
76
+
77
+ Do not use `clickable` when the card contains separate links, buttons, form controls, or other interactive elements. In those cases, keep the card non-clickable and make the specific control interactive instead.
@@ -1 +1,72 @@
1
1
  ## Accessibility
2
+
3
+ Combobox renders an input with `role="combobox"` and a popup list with `role="listbox"`. Each suggestion is rendered with `role="option"`, and the active suggestion is connected to the input with `aria-activedescendant`.
4
+
5
+ ### Provide A Label
6
+
7
+ Always provide a visible label.
8
+
9
+ ```html
10
+ <w-combobox label="Country" placeholder="Search">
11
+ <option value="no">Norway</option>
12
+ <option value="se">Sweden</option>
13
+ <option value="dk">Denmark</option>
14
+ </w-combobox>
15
+ ```
16
+
17
+ Do not rely on placeholder text as the only label. Placeholder text disappears as soon as the user types and is not a reliable accessible name.
18
+
19
+ ### Help Text And Errors
20
+
21
+ Use `help-text` for extra guidance or validation feedback.
22
+
23
+ ```html
24
+ <w-combobox label="Country" help-text="Start typing to filter countries">
25
+ <option value="no">Norway</option>
26
+ <option value="se">Sweden</option>
27
+ <option value="dk">Denmark</option>
28
+ </w-combobox>
29
+ ```
30
+
31
+ When the combobox is invalid, pair `invalid` with help text that explains how to correct the error.
32
+
33
+ ```html
34
+ <w-combobox label="Country" invalid help-text="Select a country from the list">
35
+ <option value="no">Norway</option>
36
+ <option value="se">Sweden</option>
37
+ <option value="dk">Denmark</option>
38
+ </w-combobox>
39
+ ```
40
+
41
+ Do not rely on invalid styling alone.
42
+
43
+ ### Keyboard Interaction
44
+
45
+ The input follows common combobox keyboard behavior:
46
+
47
+ - Arrow Down and Arrow Up open the list and move between suggestions.
48
+ - Home and End move to the first and last suggestion.
49
+ - Page Up and Page Down move through suggestions in larger steps.
50
+ - Enter selects the active suggestion.
51
+ - Escape closes the list. When the list is already closed, Escape clears the value.
52
+ - Tab closes the list and moves focus onward.
53
+
54
+ ### Suggestions
55
+
56
+ The component announces the number of available suggestions through a screen-reader-only status message while the list is open.
57
+
58
+ Keep option labels short and unique enough to distinguish. If the submitted `value` differs from what users should read, provide a clear option label.
59
+
60
+ ```html
61
+ <w-combobox label="Country" placeholder="Search">
62
+ <option value="us" label="United States">US</option>
63
+ <option value="uk" label="United Kingdom">UK</option>
64
+ <option value="no">Norway</option>
65
+ </w-combobox>
66
+ ```
67
+
68
+ ### Disabled Comboboxes
69
+
70
+ Avoid disabled comboboxes where possible. Disabled controls can be hard to discover and do not explain why the field is unavailable.
71
+
72
+ Prefer leaving the combobox enabled and showing validation or explanatory feedback when the user tries to continue.