@warp-ds/elements 2.9.0-next.2 → 2.9.0-next.4

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 (210) hide show
  1. package/dist/custom-elements.json +101 -173
  2. package/dist/docs/affix/accessibility.md +1 -0
  3. package/dist/docs/affix/affix.md +58 -0
  4. package/dist/docs/affix/api.md +44 -0
  5. package/dist/docs/affix/examples.md +1 -0
  6. package/dist/docs/affix/usage.md +1 -0
  7. package/dist/docs/alert/accessibility.md +30 -0
  8. package/dist/docs/alert/alert.md +208 -0
  9. package/dist/docs/alert/api.md +39 -0
  10. package/dist/docs/alert/examples.md +84 -0
  11. package/dist/docs/alert/usage.md +42 -0
  12. package/dist/docs/attention/accessibility.md +1 -0
  13. package/dist/docs/attention/api.md +132 -0
  14. package/dist/docs/attention/attention.md +144 -0
  15. package/dist/docs/attention/examples.md +1 -0
  16. package/dist/docs/attention/usage.md +1 -0
  17. package/dist/docs/badge/accessibility.md +1 -0
  18. package/dist/docs/badge/api.md +28 -0
  19. package/dist/docs/badge/badge.md +42 -0
  20. package/dist/docs/badge/examples.md +1 -0
  21. package/dist/docs/badge/usage.md +1 -0
  22. package/dist/docs/box/accessibility.md +1 -0
  23. package/dist/docs/box/api.md +52 -0
  24. package/dist/docs/box/box.md +66 -0
  25. package/dist/docs/box/examples.md +1 -0
  26. package/dist/docs/box/usage.md +1 -0
  27. package/dist/docs/breadcrumbs/accessibility.md +1 -0
  28. package/dist/docs/breadcrumbs/api.md +20 -0
  29. package/dist/docs/breadcrumbs/breadcrumbs.md +34 -0
  30. package/dist/docs/breadcrumbs/examples.md +1 -0
  31. package/dist/docs/breadcrumbs/usage.md +1 -0
  32. package/dist/docs/button/accessibility.md +1 -0
  33. package/dist/docs/button/api.md +155 -0
  34. package/dist/docs/button/button.md +169 -0
  35. package/dist/docs/button/examples.md +1 -0
  36. package/dist/docs/button/usage.md +1 -0
  37. package/dist/docs/card/accessibility.md +1 -0
  38. package/dist/docs/card/api.md +44 -0
  39. package/dist/docs/card/card.md +58 -0
  40. package/dist/docs/card/examples.md +1 -0
  41. package/dist/docs/card/usage.md +1 -0
  42. package/dist/docs/combobox/accessibility.md +1 -0
  43. package/dist/docs/combobox/api.md +132 -0
  44. package/dist/docs/combobox/combobox.md +146 -0
  45. package/dist/docs/combobox/examples.md +1 -0
  46. package/dist/docs/combobox/usage.md +1 -0
  47. package/dist/docs/datepicker/accessibility.md +1 -0
  48. package/dist/docs/datepicker/api.md +184 -0
  49. package/dist/docs/datepicker/datepicker.md +200 -0
  50. package/dist/docs/datepicker/examples.md +1 -0
  51. package/dist/docs/datepicker/usage.md +1 -0
  52. package/dist/docs/expandable/accessibility.md +1 -0
  53. package/dist/docs/expandable/api.md +100 -0
  54. package/dist/docs/expandable/examples.md +1 -0
  55. package/dist/docs/expandable/expandable.md +114 -0
  56. package/dist/docs/expandable/usage.md +1 -0
  57. package/dist/docs/link/accessibility.md +1 -0
  58. package/dist/docs/link/api.md +87 -0
  59. package/dist/docs/link/examples.md +1 -0
  60. package/dist/docs/link/link.md +101 -0
  61. package/dist/docs/link/usage.md +1 -0
  62. package/dist/docs/page-indicator/accessibility.md +1 -0
  63. package/dist/docs/page-indicator/api.md +28 -0
  64. package/dist/docs/page-indicator/examples.md +1 -0
  65. package/dist/docs/page-indicator/page-indicator.md +41 -0
  66. package/dist/docs/page-indicator/usage.md +1 -0
  67. package/dist/docs/pagination/accessibility.md +1 -0
  68. package/dist/docs/pagination/api.md +44 -0
  69. package/dist/docs/pagination/examples.md +1 -0
  70. package/dist/docs/pagination/pagination.md +58 -0
  71. package/dist/docs/pagination/usage.md +1 -0
  72. package/dist/docs/pill/accessibility.md +1 -0
  73. package/dist/docs/pill/api.md +76 -0
  74. package/dist/docs/pill/examples.md +1 -0
  75. package/dist/docs/pill/pill.md +90 -0
  76. package/dist/docs/pill/usage.md +1 -0
  77. package/dist/docs/select/accessibility.md +1 -0
  78. package/dist/docs/select/api.md +124 -0
  79. package/dist/docs/select/examples.md +1 -0
  80. package/dist/docs/select/select.md +138 -0
  81. package/dist/docs/select/usage.md +1 -0
  82. package/dist/docs/slider/accessibility.md +1 -0
  83. package/dist/docs/slider/api.md +220 -0
  84. package/dist/docs/slider/examples.md +1 -0
  85. package/dist/docs/slider/slider.md +234 -0
  86. package/dist/docs/slider/usage.md +1 -0
  87. package/dist/docs/slider-thumb/accessibility.md +1 -0
  88. package/dist/docs/slider-thumb/api.md +164 -0
  89. package/dist/docs/slider-thumb/examples.md +1 -0
  90. package/dist/docs/slider-thumb/slider-thumb.md +178 -0
  91. package/dist/docs/slider-thumb/usage.md +1 -0
  92. package/dist/docs/step/accessibility.md +1 -0
  93. package/dist/docs/step/api.md +28 -0
  94. package/dist/docs/step/examples.md +1 -0
  95. package/dist/docs/step/step.md +40 -0
  96. package/dist/docs/step/usage.md +1 -0
  97. package/dist/docs/step-indicator/accessibility.md +1 -0
  98. package/dist/docs/step-indicator/api.md +28 -0
  99. package/dist/docs/step-indicator/examples.md +1 -0
  100. package/dist/docs/step-indicator/step-indicator.md +42 -0
  101. package/dist/docs/step-indicator/usage.md +1 -0
  102. package/dist/docs/switch/accessibility.md +1 -0
  103. package/dist/docs/switch/api.md +52 -0
  104. package/dist/docs/switch/examples.md +1 -0
  105. package/dist/docs/switch/switch.md +64 -0
  106. package/dist/docs/switch/usage.md +1 -0
  107. package/dist/docs/tab/accessibility.md +1 -0
  108. package/dist/docs/tab/api.md +92 -0
  109. package/dist/docs/tab/examples.md +1 -0
  110. package/dist/docs/tab/tab.md +106 -0
  111. package/dist/docs/tab/usage.md +1 -0
  112. package/dist/docs/tab-panel/accessibility.md +1 -0
  113. package/dist/docs/tab-panel/api.md +37 -0
  114. package/dist/docs/tab-panel/examples.md +1 -0
  115. package/dist/docs/tab-panel/tab-panel.md +52 -0
  116. package/dist/docs/tab-panel/usage.md +1 -0
  117. package/dist/docs/tabs/accessibility.md +1 -0
  118. package/dist/docs/tabs/api.md +36 -0
  119. package/dist/docs/tabs/examples.md +1 -0
  120. package/dist/docs/tabs/tabs.md +50 -0
  121. package/dist/docs/tabs/usage.md +1 -0
  122. package/dist/docs/textarea/accessibility.md +1 -0
  123. package/dist/docs/textarea/api.md +156 -0
  124. package/dist/docs/textarea/examples.md +1 -0
  125. package/dist/docs/textarea/textarea.md +170 -0
  126. package/dist/docs/textarea/usage.md +1 -0
  127. package/dist/docs/textfield/accessibility.md +1 -0
  128. package/dist/docs/textfield/api.md +204 -0
  129. package/dist/docs/textfield/examples.md +1 -0
  130. package/dist/docs/textfield/textfield.md +218 -0
  131. package/dist/docs/textfield/usage.md +1 -0
  132. package/dist/docs/toast/accessibility.md +9 -0
  133. package/dist/docs/toast/api.md +71 -0
  134. package/dist/docs/toast/examples.md +29 -0
  135. package/dist/docs/toast/toast.md +150 -0
  136. package/dist/docs/toast/usage.md +31 -0
  137. package/dist/index.d.ts +104 -97
  138. package/dist/packages/affix/affix.d.ts +16 -2
  139. package/dist/packages/affix/affix.js +5 -5
  140. package/dist/packages/affix/affix.js.map +2 -2
  141. package/dist/packages/alert/alert.d.ts +15 -0
  142. package/dist/packages/alert/alert.js +6 -6
  143. package/dist/packages/alert/alert.js.map +2 -2
  144. package/dist/packages/attention/attention.d.ts +52 -0
  145. package/dist/packages/attention/attention.js +5 -5
  146. package/dist/packages/attention/attention.js.map +2 -2
  147. package/dist/packages/badge/badge.d.ts +8 -0
  148. package/dist/packages/badge/badge.js.map +2 -2
  149. package/dist/packages/box/box.d.ts +20 -0
  150. package/dist/packages/box/box.js.map +2 -2
  151. package/dist/packages/button/button.d.ts +60 -2
  152. package/dist/packages/button/button.js.map +2 -2
  153. package/dist/packages/card/card.d.ts +12 -0
  154. package/dist/packages/card/card.js.map +2 -2
  155. package/dist/packages/combobox/combobox.d.ts +60 -15
  156. package/dist/packages/combobox/combobox.js.map +2 -2
  157. package/dist/packages/datepicker/datepicker.d.ts +32 -5
  158. package/dist/packages/datepicker/datepicker.js +1 -1
  159. package/dist/packages/datepicker/datepicker.js.map +2 -2
  160. package/dist/packages/expandable/expandable.d.ts +44 -0
  161. package/dist/packages/expandable/expandable.js +7 -7
  162. package/dist/packages/expandable/expandable.js.map +2 -2
  163. package/dist/packages/icon/icon.js +2 -2
  164. package/dist/packages/icon/icon.js.map +2 -2
  165. package/dist/packages/icon/icon.test.js +14 -0
  166. package/dist/packages/link/link.d.ts +32 -0
  167. package/dist/packages/link/link.js.map +2 -2
  168. package/dist/packages/modal-header/modal-header.js +6 -6
  169. package/dist/packages/modal-header/modal-header.js.map +2 -2
  170. package/dist/packages/page-indicator/page-indicator.d.ts +8 -2
  171. package/dist/packages/page-indicator/page-indicator.js.map +2 -2
  172. package/dist/packages/pagination/pagination.d.ts +16 -0
  173. package/dist/packages/pagination/pagination.js +3 -3
  174. package/dist/packages/pagination/pagination.js.map +2 -2
  175. package/dist/packages/pill/pill.d.ts +24 -2
  176. package/dist/packages/pill/pill.js +3 -3
  177. package/dist/packages/pill/pill.js.map +2 -2
  178. package/dist/packages/select/select.d.ts +56 -12
  179. package/dist/packages/select/select.js +4 -4
  180. package/dist/packages/select/select.js.map +2 -2
  181. package/dist/packages/slider/slider.d.ts +65 -8
  182. package/dist/packages/slider/slider.js +7 -7
  183. package/dist/packages/slider/slider.js.map +3 -3
  184. package/dist/packages/slider/slider.test.js +68 -0
  185. package/dist/packages/slider-thumb/slider-thumb.d.ts +44 -6
  186. package/dist/packages/slider-thumb/slider-thumb.js +24 -23
  187. package/dist/packages/slider-thumb/slider-thumb.js.map +3 -3
  188. package/dist/packages/step/step.d.ts +8 -0
  189. package/dist/packages/step/step.js +4 -4
  190. package/dist/packages/step/step.js.map +2 -2
  191. package/dist/packages/step-indicator/step-indicator.d.ts +8 -0
  192. package/dist/packages/step-indicator/step-indicator.js.map +2 -2
  193. package/dist/packages/switch/switch.d.ts +16 -0
  194. package/dist/packages/switch/switch.js.map +2 -2
  195. package/dist/packages/tab/tab.d.ts +28 -3
  196. package/dist/packages/tab/tab.js.map +2 -2
  197. package/dist/packages/tab-panel/tab-panel.d.ts +8 -2
  198. package/dist/packages/tab-panel/tab-panel.js.map +2 -2
  199. package/dist/packages/tabs/tabs.d.ts +4 -0
  200. package/dist/packages/tabs/tabs.js.map +2 -2
  201. package/dist/packages/textarea/textarea.d.ts +52 -1
  202. package/dist/packages/textarea/textarea.js.map +2 -2
  203. package/dist/packages/textfield/textfield.d.ts +92 -4
  204. package/dist/packages/textfield/textfield.js.map +2 -2
  205. package/dist/packages/toast/toast.js +4 -4
  206. package/dist/packages/toast/toast.js.map +2 -2
  207. package/dist/packages/toast-container/toast-container.d.ts +14 -0
  208. package/dist/packages/toast-container/toast-container.js.map +2 -2
  209. package/dist/web-types.json +77 -225
  210. package/package.json +8 -3
@@ -0,0 +1,170 @@
1
+ # Textarea (w-textarea)
2
+
3
+ ## Description
4
+
5
+ A single line text input element.
6
+
7
+ [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
8
+
9
+ ## Usage
10
+
11
+ ## Accessibility
12
+
13
+ ## Examples
14
+
15
+ ## API Documentation
16
+
17
+ ### Properties
18
+
19
+ | Name | Type | Default | Summary |
20
+ |-|-|-|-|
21
+ | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
22
+ | disabled | `boolean` | `false` | - |
23
+ | invalid | `boolean` | `false` | - |
24
+ | label | `string` | `-` | - |
25
+ | helpText | `string` | `-` | - |
26
+ | maxRows | `number` | `-` | - |
27
+ | minRows | `number` | `-` | - |
28
+ | name | `string` | `-` | - |
29
+ | placeholder | `string` | `-` | - |
30
+ | readOnly | `boolean` | `false` | - |
31
+ | readonly | `boolean` | `false` | - |
32
+ | required | `boolean` | `false` | - |
33
+ | value | `string` | `-` | - |
34
+ | optional | `boolean` | `false` | - |
35
+ | minHeight | `unknown` | `-` | - |
36
+ | maxHeight | `unknown` | `-` | - |
37
+ | validationMessage | `string` | `-` | - |
38
+ | validity | `ValidityState` | `-` | - |
39
+
40
+ ### Property Details
41
+
42
+ #### shadowRootOptions
43
+
44
+
45
+
46
+ - Type: `object`
47
+ - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
48
+
49
+ #### disabled
50
+
51
+
52
+
53
+ - Type: `boolean`
54
+ - Default: `false`
55
+
56
+ #### invalid
57
+
58
+
59
+
60
+ - Type: `boolean`
61
+ - Default: `false`
62
+
63
+ #### label
64
+
65
+
66
+
67
+ - Type: `string`
68
+ - Default: `-`
69
+
70
+ #### helpText
71
+
72
+
73
+
74
+ - Type: `string`
75
+ - Default: `-`
76
+
77
+ #### maxRows
78
+
79
+
80
+
81
+ - Type: `number`
82
+ - Default: `-`
83
+
84
+ #### minRows
85
+
86
+
87
+
88
+ - Type: `number`
89
+ - Default: `-`
90
+
91
+ #### name
92
+
93
+
94
+
95
+ - Type: `string`
96
+ - Default: `-`
97
+
98
+ #### placeholder
99
+
100
+
101
+
102
+ - Type: `string`
103
+ - Default: `-`
104
+
105
+ #### readOnly
106
+
107
+
108
+
109
+ - Type: `boolean`
110
+ - Default: `false`
111
+
112
+ #### readonly
113
+
114
+
115
+
116
+ - Type: `boolean`
117
+ - Default: `false`
118
+
119
+ #### required
120
+
121
+
122
+
123
+ - Type: `boolean`
124
+ - Default: `false`
125
+
126
+ #### value
127
+
128
+
129
+
130
+ - Type: `string`
131
+ - Default: `-`
132
+
133
+ #### optional
134
+
135
+
136
+
137
+ - Type: `boolean`
138
+ - Default: `false`
139
+
140
+ #### minHeight
141
+
142
+
143
+
144
+ - Type: `unknown`
145
+ - Default: `-`
146
+
147
+ #### maxHeight
148
+
149
+
150
+
151
+ - Type: `unknown`
152
+ - Default: `-`
153
+
154
+ #### validationMessage
155
+
156
+ Returns the validation message if the textarea is invalid, otherwise an empty string
157
+
158
+ - Type: `string`
159
+ - Default: `-`
160
+
161
+ #### validity
162
+
163
+ Returns the validity state of the textarea
164
+
165
+ - Type: `ValidityState`
166
+ - Default: `-`
167
+
168
+ ### Types
169
+
170
+ No types documented.
@@ -0,0 +1 @@
1
+ ## Usage
@@ -0,0 +1 @@
1
+ ## Accessibility
@@ -0,0 +1,204 @@
1
+ ## API Documentation
2
+
3
+ ### Properties
4
+
5
+ | Name | Type | Default | Summary |
6
+ |-|-|-|-|
7
+ | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
8
+ | disabled | `boolean` | `false` | - |
9
+ | invalid | `boolean` | `false` | - |
10
+ | id | `string` | `-` | - |
11
+ | label | `string` | `-` | - |
12
+ | helpText | `string` | `-` | - |
13
+ | size | `string` | `-` | - |
14
+ | max | `number` | `-` | - |
15
+ | min | `number` | `-` | - |
16
+ | minLength | `number` | `-` | - |
17
+ | maxLength | `number` | `-` | - |
18
+ | pattern | `string` | `-` | - |
19
+ | placeholder | `string` | `-` | - |
20
+ | readOnly | `boolean` | `false` | - |
21
+ | readonly | `boolean` | `false` | - |
22
+ | required | `boolean` | `false` | - |
23
+ | type | `string` | `-` | - |
24
+ | value | `string` | `-` | - |
25
+ | name | `string` | `-` | - |
26
+ | step | `number` | `-` | - |
27
+ | autocomplete | `string | undefined` | `-` | - |
28
+ | formatter | `(value: string) => string` | `-` | - |
29
+ | _hasPrefix | `unknown` | `-` | - |
30
+ | _hasSuffix | `unknown` | `-` | - |
31
+
32
+ ### Property Details
33
+
34
+ #### shadowRootOptions
35
+
36
+
37
+
38
+ - Type: `object`
39
+ - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
40
+
41
+ #### disabled
42
+
43
+
44
+
45
+ - Type: `boolean`
46
+ - Default: `false`
47
+
48
+ #### invalid
49
+
50
+
51
+
52
+ - Type: `boolean`
53
+ - Default: `false`
54
+
55
+ #### id
56
+
57
+
58
+
59
+ - Type: `string`
60
+ - Default: `-`
61
+
62
+ #### label
63
+
64
+
65
+
66
+ - Type: `string`
67
+ - Default: `-`
68
+
69
+ #### helpText
70
+
71
+
72
+
73
+ - Type: `string`
74
+ - Default: `-`
75
+
76
+ #### size
77
+
78
+
79
+
80
+ - Type: `string`
81
+ - Default: `-`
82
+
83
+ #### max
84
+
85
+
86
+
87
+ - Type: `number`
88
+ - Default: `-`
89
+
90
+ #### min
91
+
92
+
93
+
94
+ - Type: `number`
95
+ - Default: `-`
96
+
97
+ #### minLength
98
+
99
+
100
+
101
+ - Type: `number`
102
+ - Default: `-`
103
+
104
+ #### maxLength
105
+
106
+
107
+
108
+ - Type: `number`
109
+ - Default: `-`
110
+
111
+ #### pattern
112
+
113
+
114
+
115
+ - Type: `string`
116
+ - Default: `-`
117
+
118
+ #### placeholder
119
+
120
+
121
+
122
+ - Type: `string`
123
+ - Default: `-`
124
+
125
+ #### readOnly
126
+
127
+
128
+
129
+ - Type: `boolean`
130
+ - Default: `false`
131
+
132
+ #### readonly
133
+
134
+
135
+
136
+ - Type: `boolean`
137
+ - Default: `false`
138
+
139
+ #### required
140
+
141
+
142
+
143
+ - Type: `boolean`
144
+ - Default: `false`
145
+
146
+ #### type
147
+
148
+
149
+
150
+ - Type: `string`
151
+ - Default: `-`
152
+
153
+ #### value
154
+
155
+
156
+
157
+ - Type: `string`
158
+ - Default: `-`
159
+
160
+ #### name
161
+
162
+
163
+
164
+ - Type: `string`
165
+ - Default: `-`
166
+
167
+ #### step
168
+
169
+
170
+
171
+ - Type: `number`
172
+ - Default: `-`
173
+
174
+ #### autocomplete
175
+
176
+
177
+
178
+ - Type: `string | undefined`
179
+ - Default: `-`
180
+
181
+ #### formatter
182
+
183
+
184
+
185
+ - Type: `(value: string) => string`
186
+ - Default: `-`
187
+
188
+ #### _hasPrefix
189
+
190
+
191
+
192
+ - Type: `unknown`
193
+ - Default: `-`
194
+
195
+ #### _hasSuffix
196
+
197
+
198
+
199
+ - Type: `unknown`
200
+ - Default: `-`
201
+
202
+ ### Types
203
+
204
+ No types documented.
@@ -0,0 +1 @@
1
+ ## Examples
@@ -0,0 +1,218 @@
1
+ # TextField (w-textfield)
2
+
3
+ ## Description
4
+
5
+ A single line text input element.
6
+
7
+ [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
8
+
9
+ ## Usage
10
+
11
+ ## Accessibility
12
+
13
+ ## Examples
14
+
15
+ ## API Documentation
16
+
17
+ ### Properties
18
+
19
+ | Name | Type | Default | Summary |
20
+ |-|-|-|-|
21
+ | shadowRootOptions | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }` | - |
22
+ | disabled | `boolean` | `false` | - |
23
+ | invalid | `boolean` | `false` | - |
24
+ | id | `string` | `-` | - |
25
+ | label | `string` | `-` | - |
26
+ | helpText | `string` | `-` | - |
27
+ | size | `string` | `-` | - |
28
+ | max | `number` | `-` | - |
29
+ | min | `number` | `-` | - |
30
+ | minLength | `number` | `-` | - |
31
+ | maxLength | `number` | `-` | - |
32
+ | pattern | `string` | `-` | - |
33
+ | placeholder | `string` | `-` | - |
34
+ | readOnly | `boolean` | `false` | - |
35
+ | readonly | `boolean` | `false` | - |
36
+ | required | `boolean` | `false` | - |
37
+ | type | `string` | `-` | - |
38
+ | value | `string` | `-` | - |
39
+ | name | `string` | `-` | - |
40
+ | step | `number` | `-` | - |
41
+ | autocomplete | `string | undefined` | `-` | - |
42
+ | formatter | `(value: string) => string` | `-` | - |
43
+ | _hasPrefix | `unknown` | `-` | - |
44
+ | _hasSuffix | `unknown` | `-` | - |
45
+
46
+ ### Property Details
47
+
48
+ #### shadowRootOptions
49
+
50
+
51
+
52
+ - Type: `object`
53
+ - Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true, }`
54
+
55
+ #### disabled
56
+
57
+
58
+
59
+ - Type: `boolean`
60
+ - Default: `false`
61
+
62
+ #### invalid
63
+
64
+
65
+
66
+ - Type: `boolean`
67
+ - Default: `false`
68
+
69
+ #### id
70
+
71
+
72
+
73
+ - Type: `string`
74
+ - Default: `-`
75
+
76
+ #### label
77
+
78
+
79
+
80
+ - Type: `string`
81
+ - Default: `-`
82
+
83
+ #### helpText
84
+
85
+
86
+
87
+ - Type: `string`
88
+ - Default: `-`
89
+
90
+ #### size
91
+
92
+
93
+
94
+ - Type: `string`
95
+ - Default: `-`
96
+
97
+ #### max
98
+
99
+
100
+
101
+ - Type: `number`
102
+ - Default: `-`
103
+
104
+ #### min
105
+
106
+
107
+
108
+ - Type: `number`
109
+ - Default: `-`
110
+
111
+ #### minLength
112
+
113
+
114
+
115
+ - Type: `number`
116
+ - Default: `-`
117
+
118
+ #### maxLength
119
+
120
+
121
+
122
+ - Type: `number`
123
+ - Default: `-`
124
+
125
+ #### pattern
126
+
127
+
128
+
129
+ - Type: `string`
130
+ - Default: `-`
131
+
132
+ #### placeholder
133
+
134
+
135
+
136
+ - Type: `string`
137
+ - Default: `-`
138
+
139
+ #### readOnly
140
+
141
+
142
+
143
+ - Type: `boolean`
144
+ - Default: `false`
145
+
146
+ #### readonly
147
+
148
+
149
+
150
+ - Type: `boolean`
151
+ - Default: `false`
152
+
153
+ #### required
154
+
155
+
156
+
157
+ - Type: `boolean`
158
+ - Default: `false`
159
+
160
+ #### type
161
+
162
+
163
+
164
+ - Type: `string`
165
+ - Default: `-`
166
+
167
+ #### value
168
+
169
+
170
+
171
+ - Type: `string`
172
+ - Default: `-`
173
+
174
+ #### name
175
+
176
+
177
+
178
+ - Type: `string`
179
+ - Default: `-`
180
+
181
+ #### step
182
+
183
+
184
+
185
+ - Type: `number`
186
+ - Default: `-`
187
+
188
+ #### autocomplete
189
+
190
+
191
+
192
+ - Type: `string | undefined`
193
+ - Default: `-`
194
+
195
+ #### formatter
196
+
197
+
198
+
199
+ - Type: `(value: string) => string`
200
+ - Default: `-`
201
+
202
+ #### _hasPrefix
203
+
204
+
205
+
206
+ - Type: `unknown`
207
+ - Default: `-`
208
+
209
+ #### _hasSuffix
210
+
211
+
212
+
213
+ - Type: `unknown`
214
+ - Default: `-`
215
+
216
+ ### Types
217
+
218
+ No types documented.
@@ -0,0 +1 @@
1
+ ## Usage
@@ -0,0 +1,9 @@
1
+ ## Accessibility
2
+
3
+ From an accessibility perspective, toasts should never contain interactive elements, as these should always appear in the same location as the action that triggered them.
4
+
5
+ Auto-clearing toasts based on a timeout violate WCAG 2 success criteria 2.2.1, unless the information they contain is either redundant (i.e. also available elsewhere in a persistent manner) or insignificant to all people.
6
+
7
+ You are also advised to avoid putting information in a toast that cannot be re-accessed in any other way due to the impermanent nature of the current toast implementation.
8
+
9
+ Because of these points we consider the use of toasts to be somewhat of an anti-pattern, and recommend exploring alternative approaches wherever possible. That said, you may still use toasts, as long as you avoid interactive elements like links or close buttons.
@@ -0,0 +1,71 @@
1
+ ## API Documentation
2
+
3
+ ### toast
4
+
5
+ ```js
6
+ import { toast } from '@warp-ds/elements/toast';
7
+
8
+ const theToast = toast('Toasts are somewhat of an anti-pattern');
9
+ ```
10
+
11
+ Returns [ToastOptions](#toastoptions), which includes the ID you need for [updateToast](#updatetoast) and [removeToast](#removetoast).
12
+
13
+ If you can't pass the result from `toast` to where you call `updateToast` or `removeToast` you can set a known ID manually.
14
+
15
+ ```js
16
+ toast('Toasts are somewhat of an anti-pattern', {
17
+ id: 'something-unique-but-stable',
18
+ });
19
+ ```
20
+
21
+ | Parameter | Type | Summary |
22
+ | --- | --- | --- |
23
+ | message | `string` | The text content |
24
+ | options | [ToastOptions](#toastoptions) (optional) | |
25
+
26
+
27
+ ### updateToast
28
+
29
+ ```js
30
+ import { toast, updateToast } from '@warp-ds/elements/toast';
31
+
32
+ const theToast = toast('The toast function returns an ID');
33
+
34
+ updateToast(theToast.id, 'Use it to update the text');
35
+ ```
36
+
37
+ Returns [ToastOptions](#toastoptions).
38
+
39
+ | Parameter | Type | Summary |
40
+ | --- | --- | --- |
41
+ | id |  `string` | The ID of the toast you want to update |
42
+ | message | `string` | The new text content |
43
+ | options | [ToastOptions](#toastoptions) (optional) | |
44
+
45
+ ### removeToast
46
+
47
+ Toasts disappear after a set time, but if you need to remove one before that happens you can do so.
48
+
49
+ ```js
50
+ import { toast, removeToast } from '@warp-ds/elements/toast';
51
+
52
+ const theToast = toast('The toast function returns an ID');
53
+
54
+ removeToast(theToast.id);
55
+ ```
56
+
57
+ ### Types
58
+
59
+ #### ToastOptions
60
+
61
+ | Name | Type | Default | Summary |
62
+ | --- | --- | --- | --- |
63
+ | id | `string` | Random | Random generated unique ID for the toast element |
64
+ | type | [`ToastVariants`](#toastvariants) | `'success'` | Visual style of the toast |
65
+ | text | `string` | `-` | The given toast message |
66
+ | duration | `number` | `5000` | Duration of toast in milliseconds |
67
+ | canclose | `boolean` | `false` | See [Dismissable toast](#dismissable-toast) |
68
+
69
+ #### ToastVariants
70
+
71
+ `'success' | 'warning' | 'error'`
@@ -0,0 +1,29 @@
1
+ ## Examples
2
+
3
+ ### Success / positive
4
+
5
+ This is the default.
6
+
7
+ <style-isolate id="toast-usage">
8
+ <w-button id="toast-btn" onclick="toast('Toasts are somewhat of an anti-pattern')">Show a success toast</w-button>
9
+ </style-isolate>
10
+
11
+ ### Warning
12
+
13
+ If the user should be warned about something, a toast is probably not the right way to do so. Consider an [Alert](/docs/components/alert/overview) instead.
14
+
15
+ A toast is easy to miss, especially on larger screens. Toasts that automatically close are also an accessibility problem if the information is not available elsewhere, or is insignificant (which shouldn't be the case for warnings).
16
+
17
+ <style-isolate id="toast-usage">
18
+ <w-button id="toast-btn" onclick="toast('Toasts are somewhat of an anti-pattern', { type: 'warning' })">Show a warning toast</w-button>
19
+ </style-isolate>
20
+
21
+ ### Error / negative
22
+
23
+ If the user should be told about an error, a toast is probably not the right way to do so. Consider an [Alert](/docs/components/alert/overview) instead.
24
+
25
+ A toast is easy to miss, especially on larger screens. Toasts that automatically close are also an accessibility problem if the information is not available elsewhere, or is insignificant (which shouldn't be the case for errors).
26
+
27
+ <style-isolate id="toast-usage">
28
+ <w-button id="toast-btn" onclick="toast('Toasts are somewhat of an anti-pattern', { type: 'error' })">Show an error toast</w-button>
29
+ </style-isolate>