@ukic/web-components 2.35.0 → 2.35.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.
Files changed (68) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  3. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-toast.cjs.entry.js +2 -2
  5. package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
  6. package/dist/collection/components/ic-accordion/ic-accordion.stories.js +635 -0
  7. package/dist/collection/components/ic-alert/ic-alert.stories.js +257 -0
  8. package/dist/collection/components/ic-back-to-top/ic-back-to-top.stories.js +162 -0
  9. package/dist/collection/components/ic-badge/ic-badge.stories.js +1082 -0
  10. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.stories.js +502 -0
  11. package/dist/collection/components/ic-button/ic-button.stories.js +2218 -0
  12. package/dist/collection/components/ic-card/ic-card.stories.js +1034 -0
  13. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.stories.js +687 -0
  14. package/dist/collection/components/ic-chip/ic-chip.stories.js +670 -0
  15. package/dist/collection/components/ic-classification-banner/ic-classification-banner.stories.js +131 -0
  16. package/dist/collection/components/ic-data-entity/ic-data-entity.stories.js +487 -0
  17. package/dist/collection/components/ic-dialog/ic-dialog.stories.js +1256 -0
  18. package/dist/collection/components/ic-empty-state/ic-empty-state.stories.js +397 -0
  19. package/dist/collection/components/ic-footer/ic-footer.stories.js +383 -0
  20. package/dist/collection/components/ic-hero/ic-hero.stories.js +489 -0
  21. package/dist/collection/components/ic-link/ic-link.stories.js +114 -0
  22. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.stories.js +416 -0
  23. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +7 -35
  24. package/dist/collection/components/ic-page-header/ic-page-header.stories.js +557 -0
  25. package/dist/collection/components/ic-pagination/ic-pagination.stories.js +125 -0
  26. package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +486 -0
  27. package/dist/collection/components/ic-radio-group/ic-radio-group.stories.js +450 -0
  28. package/dist/collection/components/ic-search-bar/ic-search-bar.stories.js +591 -0
  29. package/dist/collection/components/ic-section-container/ic-section-container.stories.js +62 -0
  30. package/dist/collection/components/ic-select/ic-select-searchable.stories.js +953 -0
  31. package/dist/collection/components/ic-select/ic-select-single.stories.js +780 -0
  32. package/dist/collection/components/ic-side-navigation/ic-side-navigation.stories.js +2526 -0
  33. package/dist/collection/components/ic-skeleton/ic-skeleton.stories.js +141 -0
  34. package/dist/collection/components/ic-status-tag/ic-status-tag.stories.js +161 -0
  35. package/dist/collection/components/ic-stepper/ic-stepper.stories.js +327 -0
  36. package/dist/collection/components/ic-switch/ic-switch.stories.js +171 -0
  37. package/dist/collection/components/ic-tab-context/ic-tabs.stories.js +388 -0
  38. package/dist/collection/components/ic-text-field/ic-text-field.stories.js +1083 -0
  39. package/dist/collection/components/ic-theme/ic-theme.stories.js +171 -0
  40. package/dist/collection/components/ic-toast/ic-toast.js +2 -2
  41. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  42. package/dist/collection/components/ic-toast/ic-toast.stories.js +413 -0
  43. package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js +3 -3
  44. package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js.map +1 -1
  45. package/dist/collection/components/ic-toggle-button/ic-toggle-button.stories.js +537 -0
  46. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.stories.js +610 -0
  47. package/dist/collection/components/ic-tooltip/ic-tooltip.stories.js +356 -0
  48. package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +1083 -0
  49. package/dist/collection/components/ic-typography/ic-typography.stories.js +437 -0
  50. package/dist/collection/patterns/top-nav-content-footer.stories.js +109 -0
  51. package/dist/collection/patterns/z-index.stories.js +474 -0
  52. package/dist/components/ic-navigation-item.js +1 -1
  53. package/dist/components/ic-navigation-item.js.map +1 -1
  54. package/dist/components/ic-toast.js +2 -2
  55. package/dist/components/ic-toast.js.map +1 -1
  56. package/dist/core/core.esm.js +1 -1
  57. package/dist/core/p-3e8023ff.entry.js +2 -0
  58. package/dist/core/p-3e8023ff.entry.js.map +1 -0
  59. package/dist/core/{p-7e8a4abd.entry.js → p-bfaa257c.entry.js} +2 -2
  60. package/dist/core/{p-7e8a4abd.entry.js.map → p-bfaa257c.entry.js.map} +1 -1
  61. package/dist/esm/ic-navigation-item.entry.js +1 -1
  62. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  63. package/dist/esm/ic-toast.entry.js +2 -2
  64. package/dist/esm/ic-toast.entry.js.map +1 -1
  65. package/hydrate/index.js +3 -3
  66. package/package.json +15 -11
  67. package/dist/core/p-dfb3e76e.entry.js +0 -2
  68. package/dist/core/p-dfb3e76e.entry.js.map +0 -1
@@ -0,0 +1,1083 @@
1
+ import { html } from "lit-html";
2
+
3
+ const defaultArgs = {
4
+ disabled: false,
5
+ fullWidth: false,
6
+ helperText: "",
7
+ hideLabel: false,
8
+ inputId: "ic-text-field-input-0",
9
+ inputmode: "text",
10
+ label: "Text Field",
11
+ maxCharacters: 0,
12
+ maxLength: 0,
13
+ maxLengthMessage: "Too many characters",
14
+ minCharacters: 0,
15
+ name: "0",
16
+ placeholder: "",
17
+ readonly: false,
18
+ required: false,
19
+ resize: false,
20
+ rows: 1,
21
+ size: "default",
22
+ spellcheck: false,
23
+ type: "text",
24
+ validationInline: false,
25
+ validationStatus: "none",
26
+ validationText: "",
27
+ debounce: 0,
28
+ };
29
+
30
+ export default {
31
+ title: "Web Components/Text field",
32
+ component: "ic-text-field",
33
+ };
34
+
35
+ export const Default = {
36
+ render: (args) =>
37
+ html`<ic-text-field label="What is your favourite coffee?"> </ic-text-field>
38
+ <ic-text-field rows="6" label="What is your favourite coffee?">
39
+ </ic-text-field> `,
40
+
41
+ name: "Default",
42
+ };
43
+
44
+ export const PlaceholderAndRequired = {
45
+ render: (args) =>
46
+ html`<ic-text-field
47
+ label="What is your favourite coffee?"
48
+ required
49
+ placeholder="Placeholder"
50
+ >
51
+ </ic-text-field>
52
+ <ic-text-field
53
+ rows="6"
54
+ label="What is your favourite coffee?"
55
+ required
56
+ placeholder="Placeholder"
57
+ >
58
+ </ic-text-field> `,
59
+
60
+ name: "Placeholder and required",
61
+ };
62
+
63
+ export const HelperText = {
64
+ render: (args) =>
65
+ html`<ic-text-field
66
+ label="What is your favourite coffee?"
67
+ required
68
+ placeholder="Placeholder"
69
+ helper-text="Such as Arabica, Robusta or Liberica"
70
+ >
71
+ </ic-text-field>
72
+ <ic-text-field
73
+ rows="6"
74
+ label="What is your favourite coffee?"
75
+ required
76
+ placeholder="Placeholder"
77
+ helper-text="Such as Arabica, Robusta or Liberica"
78
+ >
79
+ </ic-text-field> `,
80
+
81
+ name: "Helper text",
82
+ };
83
+
84
+ export const WithIcon = {
85
+ render: (args) =>
86
+ html`<ic-text-field
87
+ label="What is your favourite coffee?"
88
+ required
89
+ placeholder="Placeholder"
90
+ helper-text="Such as Arabica, Robusta or Liberica"
91
+ >
92
+ <svg
93
+ slot="icon"
94
+ xmlns="http://www.w3.org/2000/svg"
95
+ height="24px"
96
+ viewBox="0 0 24 24"
97
+ width="24px"
98
+ fill="#000000"
99
+ >
100
+ <path d="M0 0h24v24H0z" fill="none" />
101
+ <path
102
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
103
+ />
104
+ </svg>
105
+ </ic-text-field>
106
+ <ic-text-field
107
+ rows="6"
108
+ label="What is your favourite coffee?"
109
+ required
110
+ placeholder="Placeholder"
111
+ helper-text="Such as Arabica, Robusta or Liberica"
112
+ >
113
+ <svg
114
+ slot="icon"
115
+ xmlns="http://www.w3.org/2000/svg"
116
+ height="24px"
117
+ viewBox="0 0 24 24"
118
+ width="24px"
119
+ fill="#000000"
120
+ >
121
+ <path d="M0 0h24v24H0z" fill="none" />
122
+ <path
123
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
124
+ />
125
+ </svg>
126
+ </ic-text-field> `,
127
+
128
+ name: "With icon",
129
+ };
130
+
131
+ export const WithValue = {
132
+ render: (args) =>
133
+ html`<ic-text-field
134
+ value="Arabica"
135
+ label="What is your favourite coffee?"
136
+ required
137
+ placeholder="Placeholder"
138
+ helper-text="Such as Arabica, Robusta or Liberica"
139
+ >
140
+ <svg
141
+ slot="icon"
142
+ xmlns="http://www.w3.org/2000/svg"
143
+ height="24px"
144
+ viewBox="0 0 24 24"
145
+ width="24px"
146
+ fill="#000000"
147
+ >
148
+ <path d="M0 0h24v24H0z" fill="none" />
149
+ <path
150
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
151
+ />
152
+ </svg>
153
+ </ic-text-field>
154
+ <ic-text-field
155
+ rows="6"
156
+ value="Arabica"
157
+ label="What is your favourite coffee?"
158
+ required
159
+ placeholder="Placeholder"
160
+ helper-text="Such as Arabica, Robusta or Liberica"
161
+ >
162
+ <svg
163
+ slot="icon"
164
+ xmlns="http://www.w3.org/2000/svg"
165
+ height="24px"
166
+ viewBox="0 0 24 24"
167
+ width="24px"
168
+ fill="#000000"
169
+ >
170
+ <path d="M0 0h24v24H0z" fill="none" />
171
+ <path
172
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
173
+ />
174
+ </svg>
175
+ </ic-text-field> `,
176
+
177
+ name: "With value",
178
+ };
179
+
180
+ export const MaxLength = {
181
+ render: (args) =>
182
+ html`<ic-text-field
183
+ max-length="25"
184
+ value="Arabica"
185
+ label="What is your favourite coffee?"
186
+ required
187
+ placeholder="Placeholder"
188
+ helper-text="Such as Arabica, Robusta or Liberica"
189
+ >
190
+ <svg
191
+ slot="icon"
192
+ xmlns="http://www.w3.org/2000/svg"
193
+ height="24px"
194
+ viewBox="0 0 24 24"
195
+ width="24px"
196
+ fill="#000000"
197
+ >
198
+ <path d="M0 0h24v24H0z" fill="none" />
199
+ <path
200
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
201
+ />
202
+ </svg>
203
+ </ic-text-field>
204
+ <ic-text-field
205
+ rows="6"
206
+ max-length="25"
207
+ value="Arabica"
208
+ label="What is your favourite coffee?"
209
+ required
210
+ placeholder="Placeholder"
211
+ helper-text="Such as Arabica, Robusta or Liberica"
212
+ >
213
+ <svg
214
+ slot="icon"
215
+ xmlns="http://www.w3.org/2000/svg"
216
+ height="24px"
217
+ viewBox="0 0 24 24"
218
+ width="24px"
219
+ fill="#000000"
220
+ >
221
+ <path d="M0 0h24v24H0z" fill="none" />
222
+ <path
223
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
224
+ />
225
+ </svg>
226
+ </ic-text-field> `,
227
+
228
+ name: "Max length",
229
+ };
230
+
231
+ export const MaxLengthMessage = {
232
+ render: (args) =>
233
+ html`<ic-text-field
234
+ max-length="25"
235
+ value="Arabica"
236
+ label="What is your favourite coffee?"
237
+ required
238
+ placeholder="Placeholder"
239
+ helper-text="Such as Arabica, Robusta or Liberica"
240
+ max-length-message="You have exceeded the maximum length"
241
+ >
242
+ <svg
243
+ slot="icon"
244
+ xmlns="http://www.w3.org/2000/svg"
245
+ height="24px"
246
+ viewBox="0 0 24 24"
247
+ width="24px"
248
+ fill="#000000"
249
+ >
250
+ <path d="M0 0h24v24H0z" fill="none" />
251
+ <path
252
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
253
+ />
254
+ </svg>
255
+ </ic-text-field>
256
+ <ic-text-field
257
+ rows="6"
258
+ max-length="25"
259
+ value="Arabica"
260
+ label="What is your favourite coffee?"
261
+ required
262
+ placeholder="Placeholder"
263
+ helper-text="Such as Arabica, Robusta or Liberica"
264
+ max-length-message="You have exceeded the maximum length"
265
+ >
266
+ <svg
267
+ slot="icon"
268
+ xmlns="http://www.w3.org/2000/svg"
269
+ height="24px"
270
+ viewBox="0 0 24 24"
271
+ width="24px"
272
+ fill="#000000"
273
+ >
274
+ <path d="M0 0h24v24H0z" fill="none" />
275
+ <path
276
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
277
+ />
278
+ </svg>
279
+ </ic-text-field> `,
280
+
281
+ name: "Max length message",
282
+ };
283
+
284
+ export const CustomWidth = {
285
+ render: (args) =>
286
+ html`<style>
287
+ ic-text-field {
288
+ --input-width: 400px;
289
+ }
290
+ </style>
291
+ <ic-text-field
292
+ value="Arabica"
293
+ max-length="25"
294
+ label="What is your favourite coffee?"
295
+ size="small"
296
+ required="true"
297
+ placeholder="Placeholder"
298
+ helper-text="Such as Arabica, Robusta or Liberica"
299
+ >
300
+ <svg
301
+ slot="icon"
302
+ xmlns="http://www.w3.org/2000/svg"
303
+ height="24px"
304
+ viewBox="0 0 24 24"
305
+ width="24px"
306
+ fill="#000000"
307
+ >
308
+ <path d="M0 0h24v24H0z" fill="none" />
309
+ <path
310
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
311
+ />
312
+ </svg>
313
+ </ic-text-field>
314
+ <ic-text-field
315
+ rows="6"
316
+ value="Arabica"
317
+ max-length="25"
318
+ resize
319
+ label="What is your favourite coffee?"
320
+ size="small"
321
+ required="true"
322
+ placeholder="Placeholder"
323
+ helper-text="Such as Arabica, Robusta or Liberica"
324
+ >
325
+ <svg
326
+ slot="icon"
327
+ xmlns="http://www.w3.org/2000/svg"
328
+ height="24px"
329
+ viewBox="0 0 24 24"
330
+ width="24px"
331
+ fill="#000000"
332
+ >
333
+ <path d="M0 0h24v24H0z" fill="none" />
334
+ <path
335
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
336
+ />
337
+ </svg>
338
+ </ic-text-field> `,
339
+
340
+ name: "Custom width",
341
+ };
342
+
343
+ export const FullWidth = {
344
+ render: (args) =>
345
+ html`<div style="display: flex">
346
+ <ic-text-field
347
+ full-width="true"
348
+ value="Arabica"
349
+ max-length="25"
350
+ label="What is your favourite coffee?"
351
+ size="small"
352
+ required="true"
353
+ placeholder="Placeholder"
354
+ helper-text="Such as Arabica, Robusta or Liberica"
355
+ >
356
+ <svg
357
+ slot="icon"
358
+ xmlns="http://www.w3.org/2000/svg"
359
+ height="24px"
360
+ viewBox="0 0 24 24"
361
+ width="24px"
362
+ fill="#000000"
363
+ >
364
+ <path d="M0 0h24v24H0z" fill="none" />
365
+ <path
366
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
367
+ />
368
+ </svg>
369
+ </ic-text-field>
370
+ </div>
371
+ <ic-text-field
372
+ full-width="true"
373
+ rows="6"
374
+ value="Arabica"
375
+ max-length="25"
376
+ resize
377
+ label="What is your favourite coffee?"
378
+ size="small"
379
+ required="true"
380
+ placeholder="Placeholder"
381
+ helper-text="Such as Arabica, Robusta or Liberica"
382
+ >
383
+ <svg
384
+ slot="icon"
385
+ xmlns="http://www.w3.org/2000/svg"
386
+ height="24px"
387
+ viewBox="0 0 24 24"
388
+ width="24px"
389
+ fill="#000000"
390
+ >
391
+ <path d="M0 0h24v24H0z" fill="none" />
392
+ <path
393
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
394
+ />
395
+ </svg>
396
+ </ic-text-field> `,
397
+
398
+ name: "Full width",
399
+ };
400
+
401
+ export const Disabled = {
402
+ render: (args) =>
403
+ html`<ic-text-field
404
+ value="Arabica"
405
+ label="What is your favourite coffee?"
406
+ disabled
407
+ placeholder="Placeholder"
408
+ helper-text="Such as Arabica, Robusta or Liberica"
409
+ >
410
+ <svg
411
+ slot="icon"
412
+ xmlns="http://www.w3.org/2000/svg"
413
+ height="24px"
414
+ viewBox="0 0 24 24"
415
+ width="24px"
416
+ fill="#000000"
417
+ >
418
+ <path d="M0 0h24v24H0z" fill="none" />
419
+ <path
420
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
421
+ />
422
+ </svg>
423
+ </ic-text-field>
424
+ <ic-text-field
425
+ value="Arabica"
426
+ rows="6"
427
+ label="What is your favourite coffee?"
428
+ disabled
429
+ placeholder="Placeholder"
430
+ helper-text="Such as Arabica, Robusta or Liberica"
431
+ >
432
+ <svg
433
+ slot="icon"
434
+ xmlns="http://www.w3.org/2000/svg"
435
+ height="24px"
436
+ viewBox="0 0 24 24"
437
+ width="24px"
438
+ fill="#000000"
439
+ >
440
+ <path d="M0 0h24v24H0z" fill="none" />
441
+ <path
442
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
443
+ />
444
+ </svg>
445
+ </ic-text-field>
446
+ <ic-text-field
447
+ value="Arabica"
448
+ max-length="25"
449
+ label="What is your favourite coffee?"
450
+ disabled
451
+ placeholder="Placeholder"
452
+ helper-text="Such as Arabica, Robusta or Liberica"
453
+ >
454
+ <svg
455
+ slot="icon"
456
+ xmlns="http://www.w3.org/2000/svg"
457
+ height="24px"
458
+ viewBox="0 0 24 24"
459
+ width="24px"
460
+ fill="#000000"
461
+ >
462
+ <path d="M0 0h24v24H0z" fill="none" />
463
+ <path
464
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
465
+ />
466
+ </svg>
467
+ </ic-text-field>
468
+ <ic-text-field
469
+ rows="6"
470
+ value="Arabica"
471
+ max-length="25"
472
+ label="What is your favourite coffee?"
473
+ disabled
474
+ placeholder="Placeholder"
475
+ helper-text="Such as Arabica, Robusta or Liberica"
476
+ >
477
+ <svg
478
+ slot="icon"
479
+ xmlns="http://www.w3.org/2000/svg"
480
+ height="24px"
481
+ viewBox="0 0 24 24"
482
+ width="24px"
483
+ fill="#000000"
484
+ >
485
+ <path d="M0 0h24v24H0z" fill="none" />
486
+ <path
487
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
488
+ />
489
+ </svg>
490
+ </ic-text-field> `,
491
+
492
+ name: "Disabled",
493
+ };
494
+
495
+ export const ReadOnly = {
496
+ render: (args) =>
497
+ html`<ic-text-field
498
+ value="Arabica"
499
+ max-length="25"
500
+ label="What is your favourite coffee?"
501
+ readonly
502
+ placeholder="Placeholder"
503
+ helper-text="Such as Arabica, Robusta or Liberica"
504
+ >
505
+ <svg
506
+ slot="icon"
507
+ xmlns="http://www.w3.org/2000/svg"
508
+ height="24px"
509
+ viewBox="0 0 24 24"
510
+ width="24px"
511
+ fill="#000000"
512
+ >
513
+ <path d="M0 0h24v24H0z" fill="none" />
514
+ <path
515
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
516
+ />
517
+ </svg>
518
+ </ic-text-field>
519
+ <ic-text-field
520
+ rows="6"
521
+ value="Arabica"
522
+ max-length="25"
523
+ label="What is your favourite coffee?"
524
+ readonly
525
+ placeholder="Placeholder"
526
+ helper-text="Such as Arabica, Robusta or Liberica"
527
+ >
528
+ <svg
529
+ slot="icon"
530
+ xmlns="http://www.w3.org/2000/svg"
531
+ height="24px"
532
+ viewBox="0 0 24 24"
533
+ width="24px"
534
+ fill="#000000"
535
+ >
536
+ <path d="M0 0h24v24H0z" fill="none" />
537
+ <path
538
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
539
+ />
540
+ </svg>
541
+ </ic-text-field>
542
+ <ic-text-field
543
+ value="Arabica"
544
+ max-length="25"
545
+ label="What is your favourite coffee?"
546
+ readonly
547
+ placeholder="Placeholder"
548
+ helper-text="Such as Arabica, Robusta or Liberica"
549
+ >
550
+ </ic-text-field>
551
+ <ic-text-field
552
+ rows="6"
553
+ value="Arabica"
554
+ max-length="25"
555
+ label="What is your favourite coffee?"
556
+ readonly
557
+ placeholder="Placeholder"
558
+ helper-text="Such as Arabica, Robusta or Liberica"
559
+ >
560
+ </ic-text-field> `,
561
+
562
+ name: "Read only",
563
+ };
564
+
565
+ export const Validation = {
566
+ render: (args) =>
567
+ html`<ic-text-field
568
+ validation-status="success"
569
+ validation-text="Good choice!"
570
+ value="Arabica"
571
+ max-length="25"
572
+ label="What is your favourite coffee?"
573
+ required
574
+ placeholder="Placeholder"
575
+ helper-text="Such as Arabica, Robusta or Liberica"
576
+ >
577
+ <svg
578
+ slot="icon"
579
+ xmlns="http://www.w3.org/2000/svg"
580
+ height="24px"
581
+ viewBox="0 0 24 24"
582
+ width="24px"
583
+ fill="#000000"
584
+ >
585
+ <path d="M0 0h24v24H0z" fill="none" />
586
+ <path
587
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
588
+ />
589
+ </svg>
590
+ </ic-text-field>
591
+ <ic-text-field
592
+ rows="6"
593
+ validation-status="success"
594
+ validation-text="Good choice!"
595
+ value="Arabica"
596
+ max-length="25"
597
+ label="What is your favourite coffee?"
598
+ required
599
+ placeholder="Placeholder"
600
+ helper-text="Such as Arabica, Robusta, Liberica or something else to make this label long"
601
+ >
602
+ <svg
603
+ slot="icon"
604
+ xmlns="http://www.w3.org/2000/svg"
605
+ height="24px"
606
+ viewBox="0 0 24 24"
607
+ width="24px"
608
+ fill="#000000"
609
+ >
610
+ <path d="M0 0h24v24H0z" fill="none" />
611
+ <path
612
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
613
+ />
614
+ </svg>
615
+ </ic-text-field>
616
+ <ic-text-field
617
+ validation-status="success"
618
+ validation-text="Good choice!"
619
+ validation-inline="true"
620
+ value="Arabica"
621
+ max-length="25"
622
+ label="What is your favourite coffee?"
623
+ required
624
+ placeholder="Placeholder"
625
+ helper-text="Such as Arabica, Robusta or Liberica"
626
+ >
627
+ <svg
628
+ slot="icon"
629
+ xmlns="http://www.w3.org/2000/svg"
630
+ height="24px"
631
+ viewBox="0 0 24 24"
632
+ width="24px"
633
+ fill="#000000"
634
+ >
635
+ <path d="M0 0h24v24H0z" fill="none" />
636
+ <path
637
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
638
+ />
639
+ </svg>
640
+ </ic-text-field>
641
+ <ic-text-field
642
+ validation-status="success"
643
+ validation-text="Good choice!"
644
+ validation-inline="true"
645
+ value="Arabica"
646
+ max-length="25"
647
+ label="What is your favourite coffee?"
648
+ required
649
+ size="small"
650
+ placeholder="Placeholder"
651
+ helper-text="Such as Arabica, Robusta or Liberica"
652
+ >
653
+ <svg
654
+ slot="icon"
655
+ xmlns="http://www.w3.org/2000/svg"
656
+ height="24px"
657
+ viewBox="0 0 24 24"
658
+ width="24px"
659
+ fill="#000000"
660
+ >
661
+ <path d="M0 0h24v24H0z" fill="none" />
662
+ <path
663
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
664
+ />
665
+ </svg>
666
+ </ic-text-field>
667
+ <ic-text-field
668
+ validation-status="warning"
669
+ validation-text="A very long warning message to test if wrapping works"
670
+ value="Arabica"
671
+ max-length="25"
672
+ label="What is your favourite coffee?"
673
+ required
674
+ placeholder="Placeholder"
675
+ helper-text="Such as Arabica, Robusta or Liberica"
676
+ >
677
+ <svg
678
+ slot="icon"
679
+ xmlns="http://www.w3.org/2000/svg"
680
+ height="24px"
681
+ viewBox="0 0 24 24"
682
+ width="24px"
683
+ fill="#000000"
684
+ >
685
+ <path d="M0 0h24v24H0z" fill="none" />
686
+ <path
687
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
688
+ />
689
+ </svg>
690
+ </ic-text-field>
691
+ <ic-text-field
692
+ rows="6"
693
+ validation-status="warning"
694
+ validation-text="A very long warning message to test if wrapping works"
695
+ value="Arabica"
696
+ max-length="25"
697
+ label="What is your favourite coffee?"
698
+ required
699
+ placeholder="Placeholder"
700
+ helper-text="Such as Arabica, Robusta or Liberica"
701
+ >
702
+ <svg
703
+ slot="icon"
704
+ xmlns="http://www.w3.org/2000/svg"
705
+ height="24px"
706
+ viewBox="0 0 24 24"
707
+ width="24px"
708
+ fill="#000000"
709
+ >
710
+ <path d="M0 0h24v24H0z" fill="none" />
711
+ <path
712
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
713
+ />
714
+ </svg>
715
+ </ic-text-field>
716
+ <ic-text-field
717
+ validation-status="error"
718
+ validation-text="now it has really gone to (coffee) pot"
719
+ value="Tea"
720
+ max-length="25"
721
+ label="What is your favourite coffee?"
722
+ required
723
+ placeholder="Placeholder"
724
+ helper-text="Such as Arabica, Robusta or Liberica"
725
+ >
726
+ <svg
727
+ slot="icon"
728
+ xmlns="http://www.w3.org/2000/svg"
729
+ height="24px"
730
+ viewBox="0 0 24 24"
731
+ width="24px"
732
+ fill="#000000"
733
+ >
734
+ <path d="M0 0h24v24H0z" fill="none" />
735
+ <path
736
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
737
+ />
738
+ </svg>
739
+ </ic-text-field>
740
+ <ic-text-field
741
+ rows="6"
742
+ validation-status="error"
743
+ validation-text="now it has really gone to (coffee) pot"
744
+ value="Tea"
745
+ max-length="25"
746
+ label="What is your favourite coffee?"
747
+ required
748
+ placeholder="Placeholder"
749
+ helper-text="Such as Arabica, Robusta or Liberica"
750
+ >
751
+ <svg
752
+ slot="icon"
753
+ xmlns="http://www.w3.org/2000/svg"
754
+ height="24px"
755
+ viewBox="0 0 24 24"
756
+ width="24px"
757
+ fill="#000000"
758
+ >
759
+ <path d="M0 0h24v24H0z" fill="none" />
760
+ <path
761
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
762
+ />
763
+ </svg>
764
+ </ic-text-field>
765
+ <ic-text-field
766
+ validation-status="error"
767
+ validation-text="now it has really gone to (coffee) pot"
768
+ value="Tea with milk and 2 sugars"
769
+ max-length="25"
770
+ label="What is your favourite coffee?"
771
+ required
772
+ placeholder="Placeholder"
773
+ helper-text="Such as Arabica, Robusta or Liberica"
774
+ >
775
+ <svg
776
+ slot="icon"
777
+ xmlns="http://www.w3.org/2000/svg"
778
+ height="24px"
779
+ viewBox="0 0 24 24"
780
+ width="24px"
781
+ fill="#000000"
782
+ >
783
+ <path d="M0 0h24v24H0z" fill="none" />
784
+ <path
785
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
786
+ />
787
+ </svg>
788
+ </ic-text-field>
789
+ <ic-text-field
790
+ rows="6"
791
+ validation-status="error"
792
+ validation-text="now it has really gone to (coffee) pot"
793
+ value="Tea with milk and 2 sugars"
794
+ max-length="25"
795
+ label="What is your favourite coffee?"
796
+ required
797
+ placeholder="Placeholder"
798
+ helper-text="Such as Arabica, Robusta or Liberica"
799
+ >
800
+ <svg
801
+ slot="icon"
802
+ xmlns="http://www.w3.org/2000/svg"
803
+ height="24px"
804
+ viewBox="0 0 24 24"
805
+ width="24px"
806
+ fill="#000000"
807
+ >
808
+ <path d="M0 0h24v24H0z" fill="none" />
809
+ <path
810
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
811
+ />
812
+ </svg>
813
+ </ic-text-field>
814
+ <ic-text-field
815
+ validation-status="error"
816
+ validation-text="now it has really gone to (coffee) pot"
817
+ value="6"
818
+ inputmode="numeric"
819
+ label="How many coffees do you want?"
820
+ helper-text="Our coffee machines have a maximum capacity of 4 coffees at a time."
821
+ type="number"
822
+ min="1"
823
+ max="4"
824
+ required
825
+ >
826
+ <svg
827
+ slot="icon"
828
+ xmlns="http://www.w3.org/2000/svg"
829
+ height="24px"
830
+ viewBox="0 0 24 24"
831
+ width="24px"
832
+ fill="#000000"
833
+ >
834
+ <path d="M0 0h24v24H0z" fill="none" />
835
+ <path
836
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
837
+ />
838
+ </svg>
839
+ </ic-text-field>
840
+ <ic-text-field
841
+ validation-status="error"
842
+ validation-text="now it has really gone to (coffee) pot"
843
+ value="0"
844
+ inputmode="numeric"
845
+ label="How many coffees do you want?"
846
+ helper-text="Our coffee machines have a maximum capacity of 4 coffees at a time."
847
+ type="number"
848
+ min="1"
849
+ max="4"
850
+ required
851
+ >
852
+ <svg
853
+ slot="icon"
854
+ xmlns="http://www.w3.org/2000/svg"
855
+ height="24px"
856
+ viewBox="0 0 24 24"
857
+ width="24px"
858
+ fill="#000000"
859
+ >
860
+ <path d="M0 0h24v24H0z" fill="none" />
861
+ <path
862
+ d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
863
+ />
864
+ </svg>
865
+ </ic-text-field>
866
+ <ic-text-field
867
+ validation-status="error"
868
+ validation-text="I'm not familiar with this type of coffee"
869
+ validation-inline-internal="true"
870
+ value="Milkshake"
871
+ label="What is your favourite coffee?"
872
+ required
873
+ hide-label
874
+ size="small"
875
+ placeholder="Placeholder"
876
+ helper-text="Such as Arabica, Robusta or Liberica"
877
+ ></ic-text-field>`,
878
+
879
+ name: "Validation",
880
+ };
881
+
882
+ export const TextAreaWithResize = {
883
+ render: (args) =>
884
+ html`<ic-text-field
885
+ rows="6"
886
+ value="Arabica"
887
+ max-length="25"
888
+ resize
889
+ label="What is your favourite coffee?"
890
+ size="small"
891
+ required="true"
892
+ placeholder="Placeholder"
893
+ helper-text="Such as Arabica, Robusta or Liberica"
894
+ >
895
+ <svg
896
+ slot="icon"
897
+ xmlns="http://www.w3.org/2000/svg"
898
+ height="24px"
899
+ viewBox="0 0 24 24"
900
+ width="24px"
901
+ fill="#000000"
902
+ >
903
+ <path d="M0 0h24v24H0z" fill="none" />
904
+ <path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z" />
905
+ </svg>
906
+ </ic-text-field> `,
907
+
908
+ name: "Text area with resize",
909
+ };
910
+
911
+ export const Form = {
912
+ render: (args) => html`
913
+ <form>
914
+ <ic-text-field label="What is your favourite coffee?"></ic-text-field>
915
+ <br />
916
+ <br />
917
+ <input type="submit" value="Submit" />
918
+ <input type="reset" value="Reset" />
919
+ </form>
920
+ <script>
921
+ document.querySelector("form").addEventListener("submit", (ev) => {
922
+ ev.preventDefault();
923
+ console.log(
924
+ document.querySelector('input[name="ic-text-field-input-0"]').value
925
+ );
926
+ });
927
+ </script>
928
+ `,
929
+
930
+ name: "Form",
931
+ };
932
+
933
+ export const MinAndMax = {
934
+ render: (args) =>
935
+ html`<ic-text-field
936
+ inputmode="numeric"
937
+ label="How many coffees do you want?"
938
+ helper-text="Our coffee machines have a maximum capacity of 4 coffees at a time."
939
+ type="number"
940
+ min="1"
941
+ max="4"
942
+ >
943
+ </ic-text-field>`,
944
+
945
+ name: "Min and max",
946
+ };
947
+
948
+ export const LoggingIcChange = {
949
+ render: (args) =>
950
+ html`<script>
951
+ function handleIcChange(ev) {
952
+ console.log(ev.detail.value, "icChange");
953
+ }
954
+ document
955
+ .querySelector("ic-text-field")
956
+ .addEventListener("icChange", handleIcChange);
957
+ </script>
958
+ <ic-text-field label="What is your favourite coffee?"> </ic-text-field>`,
959
+
960
+ name: "Logging icChange",
961
+ };
962
+
963
+ export const MaximumAndMinimumCharacters = {
964
+ render: (args) =>
965
+ html`<ic-text-field
966
+ max-characters="2"
967
+ label="What is your favourite coffee?"
968
+ helper-text="Short answers only."
969
+ >
970
+ </ic-text-field>
971
+ <ic-text-field
972
+ min-characters="3"
973
+ label="What is your favourite coffee?"
974
+ helper-text="Long answer please."
975
+ >
976
+ </ic-text-field> `,
977
+
978
+ name: "Maximum and minimum characters",
979
+ };
980
+
981
+ export const Playground = {
982
+ render: (args) =>
983
+ html`<ic-text-field
984
+ label=${args.label}
985
+ disabled=${args.disabled}
986
+ full-width=${args.fullWidth}
987
+ helper-text=${args.helperText}
988
+ hide-label=${args.hideLabel}
989
+ input-id=${args.inputId}
990
+ inputmode=${args.inputmode}
991
+ max=${args.max}
992
+ max-characters=${args.maxCharacters}
993
+ max-length=${args.maxLength}
994
+ max-length-message=${args.maxLengthMessage}
995
+ min=${args.min}
996
+ min-characters=${args.minCharacters}
997
+ name=${args.name}
998
+ placeholder=${args.placeholder}
999
+ readonly=${args.readonly}
1000
+ required=${args.required}
1001
+ resize=${args.resize}
1002
+ rows=${args.rows}
1003
+ size=${args.size}
1004
+ spellcheck=${args.spellcheck}
1005
+ type=${args.type}
1006
+ validation-status=${args.validationStatus}
1007
+ validation-text=${args.validationText}
1008
+ validation-inline=${args.validationInline}
1009
+ debounce=${args.debounce}
1010
+ >
1011
+ {${args.showIconSlot} && (
1012
+ <SlottedSVG
1013
+ slot="icon"
1014
+ xmlns="http://www.w3.org/2000/svg"
1015
+ height="24px"
1016
+ viewBox="0 0 24 24"
1017
+ width="24px"
1018
+ fill="#000000"
1019
+ >
1020
+ <path d="M0 0h24v24H0z" fill="none" />
1021
+ <path d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z" />
1022
+ </SlottedSVG>
1023
+ </ic-text-field> `,
1024
+
1025
+ name: "Playground",
1026
+ args: defaultArgs,
1027
+
1028
+ argTypes: {
1029
+ inputmode: {
1030
+ options: [
1031
+ "none",
1032
+ "text",
1033
+ "tel",
1034
+ "url",
1035
+ "email",
1036
+ "numeric",
1037
+ "decimal",
1038
+ "search",
1039
+ ],
1040
+
1041
+ control: {
1042
+ type: "select",
1043
+ },
1044
+ },
1045
+
1046
+ size: {
1047
+ options: ["default", "small"],
1048
+
1049
+ control: {
1050
+ type: "inline-radio",
1051
+ },
1052
+ },
1053
+
1054
+ type: {
1055
+ options: ["email", "password", "tel", "text", "url", "number", "search"],
1056
+
1057
+ control: {
1058
+ type: "select",
1059
+ },
1060
+ },
1061
+
1062
+ validationStatus: {
1063
+ options: ["warning", "error", "success", "none"],
1064
+
1065
+ mapping: {
1066
+ warning: "warning",
1067
+ error: "error",
1068
+ success: "success",
1069
+ none: "",
1070
+ },
1071
+
1072
+ control: {
1073
+ type: "select",
1074
+ },
1075
+ },
1076
+
1077
+ showIconSlot: {
1078
+ control: {
1079
+ type: "boolean",
1080
+ },
1081
+ },
1082
+ },
1083
+ };