@warp-ds/elements 2.10.0-next.13 → 2.10.0-next.15

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 (125) hide show
  1. package/dist/custom-elements.json +384 -0
  2. package/dist/docs/attention/api.md +48 -0
  3. package/dist/docs/attention/attention.md +48 -0
  4. package/dist/docs/button/api.md +8 -0
  5. package/dist/docs/button/button.md +8 -0
  6. package/dist/docs/card/api.md +8 -0
  7. package/dist/docs/card/card.md +8 -0
  8. package/dist/docs/checkbox/api.md +48 -0
  9. package/dist/docs/checkbox/checkbox.md +48 -0
  10. package/dist/docs/checkbox-group/api.md +24 -0
  11. package/dist/docs/checkbox-group/checkbox-group.md +24 -0
  12. package/dist/docs/combobox/api.md +8 -0
  13. package/dist/docs/combobox/combobox.md +8 -0
  14. package/dist/docs/datepicker/api.md +8 -0
  15. package/dist/docs/datepicker/datepicker.md +8 -0
  16. package/dist/docs/index.md +2 -0
  17. package/dist/docs/modal/api.md +16 -0
  18. package/dist/docs/modal/modal.md +16 -0
  19. package/dist/docs/slider-thumb/api.md +16 -0
  20. package/dist/docs/slider-thumb/slider-thumb.md +16 -0
  21. package/dist/docs/snackbar/accessibility.md +20 -0
  22. package/dist/docs/snackbar/api.md +30 -0
  23. package/dist/docs/snackbar/examples.md +191 -0
  24. package/dist/docs/snackbar/snackbar.md +385 -0
  25. package/dist/docs/snackbar/styling.md +72 -0
  26. package/dist/docs/snackbar/usage.md +60 -0
  27. package/dist/docs/snackbar-item/api.md +41 -0
  28. package/dist/docs/snackbar-item/snackbar-item.md +49 -0
  29. package/dist/docs/step/api.md +16 -0
  30. package/dist/docs/step/step.md +16 -0
  31. package/dist/docs/switch/api.md +8 -0
  32. package/dist/docs/switch/switch.md +8 -0
  33. package/dist/docs/textarea/api.md +40 -0
  34. package/dist/docs/textarea/textarea.md +40 -0
  35. package/dist/docs/textfield/api.md +32 -0
  36. package/dist/docs/textfield/textfield.md +32 -0
  37. package/dist/index.d.ts +292 -1
  38. package/dist/packages/affix/affix.js +4 -4
  39. package/dist/packages/affix/affix.js.map +2 -2
  40. package/dist/packages/alert/alert.js +2 -2
  41. package/dist/packages/alert/alert.js.map +2 -2
  42. package/dist/packages/attention/attention.d.ts +5 -0
  43. package/dist/packages/attention/attention.js +14 -14
  44. package/dist/packages/attention/attention.js.map +2 -2
  45. package/dist/packages/button/button.d.ts +5 -0
  46. package/dist/packages/button/button.js +3 -3
  47. package/dist/packages/button/button.js.map +2 -2
  48. package/dist/packages/button/button.react.stories.d.ts +2 -2
  49. package/dist/packages/button/button.test.js +0 -1
  50. package/dist/packages/button/react.d.ts +1 -1
  51. package/dist/packages/datepicker/DatePicker.test.js +5 -3
  52. package/dist/packages/datepicker/datepicker.js +49 -48
  53. package/dist/packages/datepicker/datepicker.js.map +3 -3
  54. package/dist/packages/datepicker/datepicker.test.js +1 -1
  55. package/dist/packages/datepicker/utils.d.ts +3 -0
  56. package/dist/packages/datepicker/utils.js +33 -0
  57. package/dist/packages/datepicker/utils.test.d.ts +1 -0
  58. package/dist/packages/datepicker/utils.test.js +29 -0
  59. package/dist/packages/expandable/expandable.js +9 -9
  60. package/dist/packages/expandable/expandable.js.map +4 -4
  61. package/dist/packages/global.d.ts +1 -0
  62. package/dist/packages/global.js +5 -0
  63. package/dist/packages/icon/icon.d.ts +5 -0
  64. package/dist/packages/icon/icon.js +2 -2
  65. package/dist/packages/icon/icon.js.map +2 -2
  66. package/dist/packages/interaction-type-detection.d.ts +22 -0
  67. package/dist/packages/interaction-type-detection.js +38 -0
  68. package/dist/packages/modal/modal.js +1 -1
  69. package/dist/packages/modal/modal.js.map +2 -2
  70. package/dist/packages/modal-header/modal-header.js +3 -3
  71. package/dist/packages/modal-header/modal-header.js.map +2 -2
  72. package/dist/packages/pagination/pagination.js +1 -1
  73. package/dist/packages/pagination/pagination.js.map +2 -2
  74. package/dist/packages/pill/pill.js +4 -4
  75. package/dist/packages/pill/pill.js.map +2 -2
  76. package/dist/packages/select/select.js +3 -3
  77. package/dist/packages/select/select.js.map +2 -2
  78. package/dist/packages/snackbar/locales/da/messages.d.mts +1 -0
  79. package/dist/packages/snackbar/locales/da/messages.mjs +1 -0
  80. package/dist/packages/snackbar/locales/en/messages.d.mts +1 -0
  81. package/dist/packages/snackbar/locales/en/messages.mjs +1 -0
  82. package/dist/packages/snackbar/locales/fi/messages.d.mts +1 -0
  83. package/dist/packages/snackbar/locales/fi/messages.mjs +1 -0
  84. package/dist/packages/snackbar/locales/nb/messages.d.mts +1 -0
  85. package/dist/packages/snackbar/locales/nb/messages.mjs +1 -0
  86. package/dist/packages/snackbar/locales/sv/messages.d.mts +1 -0
  87. package/dist/packages/snackbar/locales/sv/messages.mjs +1 -0
  88. package/dist/packages/snackbar/react.d.ts +2 -0
  89. package/dist/packages/snackbar/react.js +11 -0
  90. package/dist/packages/snackbar/snackbar.d.ts +132 -0
  91. package/dist/packages/snackbar/snackbar.hydration.test.d.ts +1 -0
  92. package/dist/packages/snackbar/snackbar.hydration.test.js +13 -0
  93. package/dist/packages/snackbar/snackbar.js +2646 -0
  94. package/dist/packages/snackbar/snackbar.js.map +7 -0
  95. package/dist/packages/snackbar/snackbar.react.stories.d.ts +12 -0
  96. package/dist/packages/snackbar/snackbar.react.stories.js +160 -0
  97. package/dist/packages/snackbar/snackbar.stories.d.ts +20 -0
  98. package/dist/packages/snackbar/snackbar.stories.js +291 -0
  99. package/dist/packages/snackbar/snackbar.test.d.ts +4 -0
  100. package/dist/packages/snackbar/snackbar.test.js +17 -0
  101. package/dist/packages/snackbar/styles.d.ts +1 -0
  102. package/dist/packages/snackbar/styles.js +35 -0
  103. package/dist/packages/snackbar-item/react.d.ts +5 -0
  104. package/dist/packages/snackbar-item/react.js +15 -0
  105. package/dist/packages/snackbar-item/snackbar-item.d.ts +69 -0
  106. package/dist/packages/snackbar-item/snackbar-item.js +2601 -0
  107. package/dist/packages/snackbar-item/snackbar-item.js.map +7 -0
  108. package/dist/packages/snackbar-item/snackbar-item.react.test.d.ts +1 -0
  109. package/dist/packages/snackbar-item/snackbar-item.react.test.js +5 -0
  110. package/dist/packages/snackbar-item/styles.d.ts +1 -0
  111. package/dist/packages/snackbar-item/styles.js +111 -0
  112. package/dist/packages/step/step.js +9 -9
  113. package/dist/packages/step/step.js.map +2 -2
  114. package/dist/packages/tabs/tabs.react.stories.d.ts +4 -4
  115. package/dist/packages/tabs/tabs.react.stories.js +1 -1
  116. package/dist/packages/tabs/tabs.stories.d.ts +1 -1
  117. package/dist/packages/tabs/tabs.stories.js +1 -1
  118. package/dist/packages/toast/toast.js +6 -6
  119. package/dist/packages/toast/toast.js.map +4 -4
  120. package/dist/packages/utils/element-collapse.d.ts +12 -0
  121. package/dist/packages/utils/element-collapse.js +92 -0
  122. package/dist/packages/utils/expand-transition.js +1 -1
  123. package/dist/web-types.json +88 -3
  124. package/eik/index.js +12 -12
  125. package/package.json +1 -3
@@ -5,13 +5,19 @@
5
5
  | Name | Type | Default | Summary |
6
6
  |-|-|-|-|
7
7
  | _computedInvalid (JS only) | `boolean` | `-` | Computed invalid state: combines own invalid with group invalid |
8
+ | blur (JS only) | `blur() => void` | `-` | - |
9
+ | checkValidity (JS only) | `checkValidity() => boolean` | `-` | Checks whether the checkbox passes constraint validation |
8
10
  | checked | `boolean` | `false` | Whether the checkbox is checked. |
11
+ | click (JS only) | `click() => void` | `-` | - |
9
12
  | disabled | `boolean` | `false` | Whether the checkbox is disabled. |
13
+ | focus (JS only) | `focus(options?: FocusOptions) => void` | `-` | - |
10
14
  | indeterminate | `boolean` | `false` | Whether the checkbox is visually indeterminate. |
11
15
  | input (JS only) | `HTMLInputElement` | `-` | - |
12
16
  | invalid | `boolean` | `false` | Whether the checkbox is visually invalid. |
13
17
  | name | `string \| undefined` | `-` | The name of the checkbox. |
18
+ | reportValidity (JS only) | `reportValidity() => boolean` | `-` | Checks validity and shows the browser's validation message if invalid |
14
19
  | required | `boolean` | `false` | Whether the checkbox must be checked before form submission. |
20
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
15
21
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true }` | - |
16
22
  | validationMessage (JS only) | `string` | `-` | Returns the validation message if the checkbox is invalid, otherwise an empty string |
17
23
  | validity (JS only) | `ValidityState` | `-` | Returns the validity state of the checkbox |
@@ -26,6 +32,20 @@ Computed invalid state: combines own invalid with group invalid
26
32
  - Type: `boolean`
27
33
  - Default: `-`
28
34
 
35
+ ##### blur (JS only)
36
+
37
+
38
+
39
+ - Type: `blur() => void`
40
+ - Default: `-`
41
+
42
+ ##### checkValidity (JS only)
43
+
44
+ Checks whether the checkbox passes constraint validation
45
+
46
+ - Type: `checkValidity() => boolean`
47
+ - Default: `-`
48
+
29
49
  ##### checked
30
50
 
31
51
  Whether the checkbox is checked.
@@ -35,6 +55,13 @@ Checked checkboxes submit their value with form data. The property is reflected
35
55
  - Type: `boolean`
36
56
  - Default: `false`
37
57
 
58
+ ##### click (JS only)
59
+
60
+
61
+
62
+ - Type: `click() => void`
63
+ - Default: `-`
64
+
38
65
  ##### disabled
39
66
 
40
67
  Whether the checkbox is disabled.
@@ -44,6 +71,13 @@ Disabled checkboxes cannot be focused, changed, or submitted with form data.
44
71
  - Type: `boolean`
45
72
  - Default: `false`
46
73
 
74
+ ##### focus (JS only)
75
+
76
+
77
+
78
+ - Type: `focus(options?: FocusOptions) => void`
79
+ - Default: `-`
80
+
47
81
  ##### indeterminate
48
82
 
49
83
  Whether the checkbox is visually indeterminate.
@@ -78,6 +112,13 @@ When the checkbox is checked and belongs to a form, this name is submitted with
78
112
  - Type: `string | undefined`
79
113
  - Default: `-`
80
114
 
115
+ ##### reportValidity (JS only)
116
+
117
+ Checks validity and shows the browser's validation message if invalid
118
+
119
+ - Type: `reportValidity() => boolean`
120
+ - Default: `-`
121
+
81
122
  ##### required
82
123
 
83
124
  Whether the checkbox must be checked before form submission.
@@ -87,6 +128,13 @@ A required checkbox is invalid until it is checked. For requiring at least one o
87
128
  - Type: `boolean`
88
129
  - Default: `false`
89
130
 
131
+ ##### resetFormControl (JS only)
132
+
133
+
134
+
135
+ - Type: `resetFormControl() => void`
136
+ - Default: `-`
137
+
90
138
  ##### shadowRootOptions (JS only)
91
139
 
92
140
 
@@ -11,13 +11,19 @@ Checkbox lets users select one or more options. Use it for independent yes/no ch
11
11
  | Name | Type | Default | Summary |
12
12
  |-|-|-|-|
13
13
  | _computedInvalid (JS only) | `boolean` | `-` | Computed invalid state: combines own invalid with group invalid |
14
+ | blur (JS only) | `blur() => void` | `-` | - |
15
+ | checkValidity (JS only) | `checkValidity() => boolean` | `-` | Checks whether the checkbox passes constraint validation |
14
16
  | checked | `boolean` | `false` | Whether the checkbox is checked. |
17
+ | click (JS only) | `click() => void` | `-` | - |
15
18
  | disabled | `boolean` | `false` | Whether the checkbox is disabled. |
19
+ | focus (JS only) | `focus(options?: FocusOptions) => void` | `-` | - |
16
20
  | indeterminate | `boolean` | `false` | Whether the checkbox is visually indeterminate. |
17
21
  | input (JS only) | `HTMLInputElement` | `-` | - |
18
22
  | invalid | `boolean` | `false` | Whether the checkbox is visually invalid. |
19
23
  | name | `string \| undefined` | `-` | The name of the checkbox. |
24
+ | reportValidity (JS only) | `reportValidity() => boolean` | `-` | Checks validity and shows the browser's validation message if invalid |
20
25
  | required | `boolean` | `false` | Whether the checkbox must be checked before form submission. |
26
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
21
27
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true }` | - |
22
28
  | validationMessage (JS only) | `string` | `-` | Returns the validation message if the checkbox is invalid, otherwise an empty string |
23
29
  | validity (JS only) | `ValidityState` | `-` | Returns the validity state of the checkbox |
@@ -32,6 +38,20 @@ Computed invalid state: combines own invalid with group invalid
32
38
  - Type: `boolean`
33
39
  - Default: `-`
34
40
 
41
+ ##### blur (JS only)
42
+
43
+
44
+
45
+ - Type: `blur() => void`
46
+ - Default: `-`
47
+
48
+ ##### checkValidity (JS only)
49
+
50
+ Checks whether the checkbox passes constraint validation
51
+
52
+ - Type: `checkValidity() => boolean`
53
+ - Default: `-`
54
+
35
55
  ##### checked
36
56
 
37
57
  Whether the checkbox is checked.
@@ -41,6 +61,13 @@ Checked checkboxes submit their value with form data. The property is reflected
41
61
  - Type: `boolean`
42
62
  - Default: `false`
43
63
 
64
+ ##### click (JS only)
65
+
66
+
67
+
68
+ - Type: `click() => void`
69
+ - Default: `-`
70
+
44
71
  ##### disabled
45
72
 
46
73
  Whether the checkbox is disabled.
@@ -50,6 +77,13 @@ Disabled checkboxes cannot be focused, changed, or submitted with form data.
50
77
  - Type: `boolean`
51
78
  - Default: `false`
52
79
 
80
+ ##### focus (JS only)
81
+
82
+
83
+
84
+ - Type: `focus(options?: FocusOptions) => void`
85
+ - Default: `-`
86
+
53
87
  ##### indeterminate
54
88
 
55
89
  Whether the checkbox is visually indeterminate.
@@ -84,6 +118,13 @@ When the checkbox is checked and belongs to a form, this name is submitted with
84
118
  - Type: `string | undefined`
85
119
  - Default: `-`
86
120
 
121
+ ##### reportValidity (JS only)
122
+
123
+ Checks validity and shows the browser's validation message if invalid
124
+
125
+ - Type: `reportValidity() => boolean`
126
+ - Default: `-`
127
+
87
128
  ##### required
88
129
 
89
130
  Whether the checkbox must be checked before form submission.
@@ -93,6 +134,13 @@ A required checkbox is invalid until it is checked. For requiring at least one o
93
134
  - Type: `boolean`
94
135
  - Default: `false`
95
136
 
137
+ ##### resetFormControl (JS only)
138
+
139
+
140
+
141
+ - Type: `resetFormControl() => void`
142
+ - Default: `-`
143
+
96
144
  ##### shadowRootOptions (JS only)
97
145
 
98
146
 
@@ -6,16 +6,33 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
6
6
 
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
+ | checkValidity (JS only) | `checkValidity() => boolean` | `-` | Checks whether the group passes constraint validation |
10
+ | focus (JS only) | `focus(options?: FocusOptions) => void` | `-` | Sets focus on the checkbox group. |
9
11
  | help-text | `string \| undefined` | `-` | Help text displayed below the checkbox group. |
10
12
  | invalid | `boolean` | `false` | Whether the checkbox group is visually invalid. |
11
13
  | label | `string \| undefined` | `-` | The group label displayed above the checkboxes. |
12
14
  | name | `string \| undefined` | `-` | The name applied to child checkboxes when they do not provide one. |
13
15
  | optional | `boolean` | `false` | Whether to show optional text next to the label. |
16
+ | reportValidity (JS only) | `reportValidity() => boolean` | `-` | Checks validity and shows the validation message if invalid |
14
17
  | required | `boolean` | `false` | Whether at least one checkbox in the group must be selected. |
15
18
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
16
19
 
17
20
  ### Property Details
18
21
 
22
+ #### checkValidity (JS only)
23
+
24
+ Checks whether the group passes constraint validation
25
+
26
+ - Type: `checkValidity() => boolean`
27
+ - Default: `-`
28
+
29
+ #### focus (JS only)
30
+
31
+ Sets focus on the checkbox group.
32
+
33
+ - Type: `focus(options?: FocusOptions) => void`
34
+ - Default: `-`
35
+
19
36
  #### help-text
20
37
 
21
38
  Help text displayed below the checkbox group.
@@ -61,6 +78,13 @@ Use this to indicate that selecting an option from the group is not required.
61
78
  - Type: `boolean`
62
79
  - Default: `false`
63
80
 
81
+ #### reportValidity (JS only)
82
+
83
+ Checks validity and shows the validation message if invalid
84
+
85
+ - Type: `reportValidity() => boolean`
86
+ - Default: `-`
87
+
64
88
  #### required
65
89
 
66
90
  Whether at least one checkbox in the group must be selected.
@@ -419,16 +419,33 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
419
419
 
420
420
  | Name | Type | Default | Summary |
421
421
  |-|-|-|-|
422
+ | checkValidity (JS only) | `checkValidity() => boolean` | `-` | Checks whether the group passes constraint validation |
423
+ | focus (JS only) | `focus(options?: FocusOptions) => void` | `-` | Sets focus on the checkbox group. |
422
424
  | help-text | `string \| undefined` | `-` | Help text displayed below the checkbox group. |
423
425
  | invalid | `boolean` | `false` | Whether the checkbox group is visually invalid. |
424
426
  | label | `string \| undefined` | `-` | The group label displayed above the checkboxes. |
425
427
  | name | `string \| undefined` | `-` | The name applied to child checkboxes when they do not provide one. |
426
428
  | optional | `boolean` | `false` | Whether to show optional text next to the label. |
429
+ | reportValidity (JS only) | `reportValidity() => boolean` | `-` | Checks validity and shows the validation message if invalid |
427
430
  | required | `boolean` | `false` | Whether at least one checkbox in the group must be selected. |
428
431
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
429
432
 
430
433
  ### Property Details
431
434
 
435
+ #### checkValidity (JS only)
436
+
437
+ Checks whether the group passes constraint validation
438
+
439
+ - Type: `checkValidity() => boolean`
440
+ - Default: `-`
441
+
442
+ #### focus (JS only)
443
+
444
+ Sets focus on the checkbox group.
445
+
446
+ - Type: `focus(options?: FocusOptions) => void`
447
+ - Default: `-`
448
+
432
449
  #### help-text
433
450
 
434
451
  Help text displayed below the checkbox group.
@@ -474,6 +491,13 @@ Use this to indicate that selecting an option from the group is not required.
474
491
  - Type: `boolean`
475
492
  - Default: `false`
476
493
 
494
+ #### reportValidity (JS only)
495
+
496
+ Checks validity and shows the validation message if invalid
497
+
498
+ - Type: `reportValidity() => boolean`
499
+ - Default: `-`
500
+
477
501
  #### required
478
502
 
479
503
  Whether at least one checkbox in the group must be selected.
@@ -19,6 +19,7 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
19
19
  | options | `ComboboxOption[]` | `[]` | The available options to select from. |
20
20
  | placeholder | `string \| undefined` | `''` | Placeholder text displayed when the input is empty. |
21
21
  | required | `boolean` | `false` | Whether the combobox is required before form submission. |
22
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
22
23
  | select-on-blur | `boolean` | `true` | Whether the active option is selected when the input loses focus. |
23
24
  | value | `string` | `''` | The selected or typed value. |
24
25
 
@@ -141,6 +142,13 @@ Use this when the user must provide a value before submitting the form.
141
142
  - Type: `boolean`
142
143
  - Default: `false`
143
144
 
145
+ #### resetFormControl (JS only)
146
+
147
+
148
+
149
+ - Type: `resetFormControl() => void`
150
+ - Default: `-`
151
+
144
152
  #### select-on-blur
145
153
 
146
154
  Whether the active option is selected when the input loses focus.
@@ -176,6 +176,7 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
176
176
  | options | `ComboboxOption[]` | `[]` | The available options to select from. |
177
177
  | placeholder | `string \| undefined` | `''` | Placeholder text displayed when the input is empty. |
178
178
  | required | `boolean` | `false` | Whether the combobox is required before form submission. |
179
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
179
180
  | select-on-blur | `boolean` | `true` | Whether the active option is selected when the input loses focus. |
180
181
  | value | `string` | `''` | The selected or typed value. |
181
182
 
@@ -298,6 +299,13 @@ Use this when the user must provide a value before submitting the form.
298
299
  - Type: `boolean`
299
300
  - Default: `false`
300
301
 
302
+ #### resetFormControl (JS only)
303
+
304
+
305
+
306
+ - Type: `resetFormControl() => void`
307
+ - Default: `-`
308
+
301
309
  #### select-on-blur
302
310
 
303
311
  Whether the active option is selected when the input loses focus.
@@ -18,6 +18,7 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
18
18
  | name | `string \| undefined` | `-` | The name submitted with the date value. |
19
19
  | navigationDate (JS only) | `Date` | `-` | - |
20
20
  | previousMonthButton (JS only) | `HTMLButtonElement` | `-` | This is the first focusable element, needed for the modal focus trap. |
21
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
21
22
  | selectedCell (JS only) | `HTMLTableCellElement` | `-` | - |
22
23
  | selectedDate (JS only) | `Date \| null` | `-` | - |
23
24
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
@@ -130,6 +131,13 @@ the query will point to an element that doesn't exist anymore.
130
131
  - Type: `HTMLButtonElement`
131
132
  - Default: `-`
132
133
 
134
+ #### resetFormControl (JS only)
135
+
136
+
137
+
138
+ - Type: `resetFormControl() => void`
139
+ - Default: `-`
140
+
133
141
  #### selectedCell (JS only)
134
142
 
135
143
 
@@ -218,6 +218,7 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
218
218
  | name | `string \| undefined` | `-` | The name submitted with the date value. |
219
219
  | navigationDate (JS only) | `Date` | `-` | - |
220
220
  | previousMonthButton (JS only) | `HTMLButtonElement` | `-` | This is the first focusable element, needed for the modal focus trap. |
221
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
221
222
  | selectedCell (JS only) | `HTMLTableCellElement` | `-` | - |
222
223
  | selectedDate (JS only) | `Date \| null` | `-` | - |
223
224
  | shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
@@ -330,6 +331,13 @@ the query will point to an element that doesn't exist anymore.
330
331
  - Type: `HTMLButtonElement`
331
332
  - Default: `-`
332
333
 
334
+ #### resetFormControl (JS only)
335
+
336
+
337
+
338
+ - Type: `resetFormControl() => void`
339
+ - Default: `-`
340
+
333
341
  #### selectedCell (JS only)
334
342
 
335
343
 
@@ -35,6 +35,8 @@ Generated by `pnpm build:docs`. This file indexes the Markdown documentation shi
35
35
  | Select | `<w-select>` | `select` | A dropdown component for selecting a single value. | [select.md](./select/select.md) |
36
36
  | Slider | `<w-slider>` | `slider` | Parent component for sliders (both single and range sliders). Used in combination with a `<w-slider-thumb>`. | [slider.md](./slider/slider.md) |
37
37
  | Slider Thumb | `<w-slider-thumb>` | `slider-thumb` | Component to place inside a `<w-slider>`. | [slider-thumb.md](./slider-thumb/slider-thumb.md) |
38
+ | Snackbar | `<w-snackbar>` | `snackbar` | A Snackbar shows brief user feedback messages that overlay content, with an optional action such as Undo. Include one `<w-snackbar></w-snackbar>` in the document `<body>`. Use the `create` function to create messages. | [snackbar.md](./snackbar/snackbar.md) |
39
+ | Snackbar Item | `<w-snackbar-item>` | `snackbar-item` | An item to show in a `w-snackbar`. See the `create` function on `w-snackbar` for a convenience API which helps you make snackbar items. | [snackbar-item.md](./snackbar-item/snackbar-item.md) |
38
40
  | Step | `<w-step>` | `step` | Individual step component that shows a single step in a process | [step.md](./step/step.md) |
39
41
  | Step Indicator | `<w-step-indicator>` | `step-indicator` | Steps are used to show progress through a process or to guide users through a multi-step task. | [step-indicator.md](./step-indicator/step-indicator.md) |
40
42
  | Switch | `<w-switch>` | `switch` | The Switch component allows users to toggle between two states. | [switch.md](./switch/switch.md) |
@@ -6,12 +6,21 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
6
6
 
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
+ | close (JS only) | `close() => void` | `-` | - |
9
10
  | content-id | `string \| undefined` | `-` | - |
10
11
  | ignore-backdrop-clicks | `boolean` | `false` | Ignores clicks to the backdrop when set |
12
+ | open (JS only) | `open() => void` | `-` | - |
11
13
  | show | `boolean` | `false` | Controls if the modal should show or hide. |
12
14
 
13
15
  ### Property Details
14
16
 
17
+ #### close (JS only)
18
+
19
+
20
+
21
+ - Type: `close() => void`
22
+ - Default: `-`
23
+
15
24
  #### content-id
16
25
 
17
26
 
@@ -26,6 +35,13 @@ Ignores clicks to the backdrop when set
26
35
  - Type: `boolean`
27
36
  - Default: `false`
28
37
 
38
+ #### open (JS only)
39
+
40
+
41
+
42
+ - Type: `open() => void`
43
+ - Default: `-`
44
+
29
45
  #### show
30
46
 
31
47
  Controls if the modal should show or hide.
@@ -195,12 +195,21 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
195
195
 
196
196
  | Name | Type | Default | Summary |
197
197
  |-|-|-|-|
198
+ | close (JS only) | `close() => void` | `-` | - |
198
199
  | content-id | `string \| undefined` | `-` | - |
199
200
  | ignore-backdrop-clicks | `boolean` | `false` | Ignores clicks to the backdrop when set |
201
+ | open (JS only) | `open() => void` | `-` | - |
200
202
  | show | `boolean` | `false` | Controls if the modal should show or hide. |
201
203
 
202
204
  ### Property Details
203
205
 
206
+ #### close (JS only)
207
+
208
+
209
+
210
+ - Type: `close() => void`
211
+ - Default: `-`
212
+
204
213
  #### content-id
205
214
 
206
215
 
@@ -215,6 +224,13 @@ Ignores clicks to the backdrop when set
215
224
  - Type: `boolean`
216
225
  - Default: `false`
217
226
 
227
+ #### open (JS only)
228
+
229
+
230
+
231
+ - Type: `open() => void`
232
+ - Default: `-`
233
+
218
234
  #### show
219
235
 
220
236
  Controls if the modal should show or hide.
@@ -8,6 +8,8 @@
8
8
  | aria-label | `string \| null` | `null` | Label for the range input. |
9
9
  | name | `string \| undefined` | `-` | The name of this input field in the form. The canonical source of the value is the text field. |
10
10
  | placeholder | `string \| undefined` | `-` | Placeholder in empty text fields |
11
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
12
+ | updateFieldAfterValidation (JS only) | `updateFieldAfterValidation() => void` | `-` | - |
11
13
  | value | `string \| undefined` | `-` | The initial value, if any |
12
14
 
13
15
  #### Property Details
@@ -40,6 +42,20 @@ Placeholder in empty text fields
40
42
  - Type: `string | undefined`
41
43
  - Default: `-`
42
44
 
45
+ ##### resetFormControl (JS only)
46
+
47
+
48
+
49
+ - Type: `resetFormControl() => void`
50
+ - Default: `-`
51
+
52
+ ##### updateFieldAfterValidation (JS only)
53
+
54
+
55
+
56
+ - Type: `updateFieldAfterValidation() => void`
57
+ - Default: `-`
58
+
43
59
  ##### value
44
60
 
45
61
  The initial value, if any
@@ -22,6 +22,8 @@ Component to place inside a `<w-slider>`.
22
22
  | aria-label | `string \| null` | `null` | Label for the range input. |
23
23
  | name | `string \| undefined` | `-` | The name of this input field in the form. The canonical source of the value is the text field. |
24
24
  | placeholder | `string \| undefined` | `-` | Placeholder in empty text fields |
25
+ | resetFormControl (JS only) | `resetFormControl() => void` | `-` | - |
26
+ | updateFieldAfterValidation (JS only) | `updateFieldAfterValidation() => void` | `-` | - |
25
27
  | value | `string \| undefined` | `-` | The initial value, if any |
26
28
 
27
29
  #### Property Details
@@ -54,6 +56,20 @@ Placeholder in empty text fields
54
56
  - Type: `string | undefined`
55
57
  - Default: `-`
56
58
 
59
+ ##### resetFormControl (JS only)
60
+
61
+
62
+
63
+ - Type: `resetFormControl() => void`
64
+ - Default: `-`
65
+
66
+ ##### updateFieldAfterValidation (JS only)
67
+
68
+
69
+
70
+ - Type: `updateFieldAfterValidation() => void`
71
+ - Default: `-`
72
+
57
73
  ##### value
58
74
 
59
75
  The initial value, if any
@@ -0,0 +1,20 @@
1
+ ## Accessibility
2
+
3
+ From an accessibility perspective the snackbar component is problematic.
4
+
5
+ - Since the snackbar items disappear on their own users might not even see them, especially when zoomed in.
6
+ - The snackbar items are in practice impossible to reach with keyboard since they appear in the DOM away from the element that triggered them.
7
+ - Important elements on the page might get hidden behind the snackbar item.
8
+
9
+ A snackbar must never be the backbone of your user experience, it should only ever include information and actions that are available elsewhere.
10
+
11
+ - Keep messages and actions short since the snackbar item is available only for a short time.
12
+ - Ensure any information and action in the snackbar, such as Undo, is possible to do elsewhere.
13
+
14
+ `<w-snackbar>` creates an ARIA live region so messages you add to the snackbar get announced to assistive technologies.
15
+
16
+ ### Keyboard behavior
17
+
18
+ `<w-snackbar>` is problematic from a keyboard user perspective. We do not override the default <kbd>Tab</kbd> behavior, with the result that the focusable buttons in a snackbar item probably come first or last in the focus order, depending on what end of `<body>` you put `<w-snackbar>`. We're investigating ways to provide keyboard shortcuts for moving focus to the snackbar item, but have yet to conclude on a design.
19
+
20
+ `<w-snackbar>` sets up a keyboard event listener on `document`. Pressing <kbd>Escape</kbd> while a snackbar item is open will close it. If more than one item is open the oldest one will close.
@@ -0,0 +1,30 @@
1
+ ## `<w-snackbar>` API
2
+
3
+ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
4
+
5
+ ### Properties
6
+
7
+ | Name | Type | Default | Summary |
8
+ |-|-|-|-|
9
+ | create (JS only) | `create(message: string, options: CreateSnackbarOptions = {}) => void` | `-` | Creates a snackbar item and immediately adds it to the snackbar. |
10
+
11
+ ### Property Details
12
+
13
+ #### create (JS only)
14
+
15
+ Creates a snackbar item and immediately adds it to the snackbar.
16
+
17
+ By default the snackbar item automatically closes after 4 seconds (`SnackbarDuration.Short`).
18
+
19
+ If you include an `action` in the options the default `duration` is
20
+ set to 10 seconds (`SnackbarDuration.Long`) and can not be made shorter.
21
+
22
+ A `duration` of 10 seconds or longer forces the close button to be visible.
23
+
24
+ The default `variant` is `neutral` which does not have an icon.
25
+
26
+ Set `duration` to `SnackbarDuration.Infinite` if you want a persistent message.
27
+
28
+ - Type: `create(message: string, options: CreateSnackbarOptions = {}) => void`
29
+ - Default: `-`
30
+