@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,450 @@
1
+ import { html } from "lit-html";
2
+
3
+ const defaultArgs = {
4
+ disabled: false,
5
+ helperText: "Some helper text",
6
+ hideLabel: false,
7
+ label: "This is a label",
8
+ name: "1",
9
+ orientation: "vertical",
10
+ required: false,
11
+ size: "default",
12
+ validationStatus: "",
13
+ validationText: "",
14
+ additionalFieldDisplay: "static",
15
+ radioDisabled: false,
16
+ dynamicText: "This selection requires additional answers",
17
+ radioLabel: "Radio 1",
18
+ radioName: "radio1",
19
+ value: "valueName1",
20
+ selected: false,
21
+ additionalFieldSlot: true,
22
+ };
23
+
24
+ export default {
25
+ title: "Web Components/Radio button",
26
+ component: "Radio",
27
+ };
28
+
29
+ export const Default = {
30
+ render: (args) => html`
31
+ <ic-radio-group label="This is a label" name="1">
32
+ <ic-radio-option
33
+ value="valueName1"
34
+ label="Unselected / Default"
35
+ ></ic-radio-option>
36
+ <ic-radio-option
37
+ value="valueName2"
38
+ label="Selected / Default"
39
+ selected
40
+ ></ic-radio-option>
41
+ <ic-radio-option
42
+ value="valueName3"
43
+ label="Unselected / Disabled"
44
+ disabled
45
+ ></ic-radio-option>
46
+ </ic-radio-group>
47
+ `,
48
+
49
+ name: "Default",
50
+ };
51
+
52
+ export const Horizontal = {
53
+ render: (args) => html`
54
+ <ic-radio-group
55
+ orientation="horizontal"
56
+ label="This should be horizontal"
57
+ name="1"
58
+ >
59
+ <ic-radio-option
60
+ value="valueName1"
61
+ label="Selected / Default"
62
+ selected
63
+ ></ic-radio-option>
64
+ <ic-radio-option
65
+ value="valueName2"
66
+ label="Unselected / Default"
67
+ ></ic-radio-option>
68
+ </ic-radio-group>
69
+ <br />
70
+ <p>Horizontal orientation is overridden with >2 radio options</p>
71
+ <br />
72
+ <ic-radio-group
73
+ orientation="horizontal"
74
+ label="This should be vertical"
75
+ name="2"
76
+ >
77
+ <ic-radio-option
78
+ value="valueNameA"
79
+ label="First"
80
+ selected
81
+ ></ic-radio-option>
82
+ <ic-radio-option value="valueNameB" label="Second"></ic-radio-option>
83
+ <ic-radio-option value="valueNameC" label="Third"></ic-radio-option>
84
+ </ic-radio-group>
85
+ `,
86
+
87
+ name: "Horizontal",
88
+ };
89
+
90
+ export const Required = {
91
+ render: (args) => html`
92
+ <ic-radio-group label="This is a label" required name="1">
93
+ <ic-radio-option
94
+ value="valueName1"
95
+ label="Unselected / Default"
96
+ ></ic-radio-option>
97
+ <ic-radio-option
98
+ value="valueName2"
99
+ label="Selected / Default"
100
+ selected
101
+ ></ic-radio-option>
102
+ <ic-radio-option
103
+ value="valueName3"
104
+ label="Unselected / Disabled"
105
+ disabled
106
+ ></ic-radio-option>
107
+ </ic-radio-group>
108
+ `,
109
+
110
+ name: "Required",
111
+ };
112
+
113
+ export const Disabled = {
114
+ render: (args) => html`
115
+ <ic-radio-group label="This is a label" name="1">
116
+ <ic-radio-option
117
+ value="valueName1"
118
+ label="Unselected / Disabled 1"
119
+ disabled
120
+ ></ic-radio-option>
121
+ <ic-radio-option
122
+ value="valueName2"
123
+ label="Unselected / Disabled 2"
124
+ disabled
125
+ ></ic-radio-option>
126
+ <ic-radio-option
127
+ value="valueName3"
128
+ label="Unselected / Disabled 3"
129
+ disabled
130
+ ></ic-radio-option>
131
+ <ic-radio-option
132
+ value="valueName4"
133
+ label="Selected / Disabled"
134
+ disabled
135
+ selected
136
+ ></ic-radio-option>
137
+ </ic-radio-group>
138
+ `,
139
+
140
+ name: "Disabled",
141
+ };
142
+
143
+ export const ConditionalDynamic = {
144
+ render: (args) => html`
145
+ <script>
146
+ function handleIcChange(ev) {
147
+ console.log(ev.detail.selectedOption);
148
+ }
149
+ document
150
+ .querySelector("ic-radio-group")
151
+ .addEventListener("icChange", handleIcChange);
152
+ document
153
+ .querySelector("ic-button")
154
+ .addEventListener("click", () => alert("Button"));
155
+ </script>
156
+ <ic-radio-group label="Conditional dynamic" name="1">
157
+ <ic-radio-option
158
+ additional-field-display="dynamic"
159
+ value="valueName1"
160
+ label="Option with Radio as conditional slotted additional field"
161
+ selected
162
+ >
163
+ <ic-radio-group
164
+ slot="additional-field"
165
+ helperText="Child Group Helper Text"
166
+ label="Children"
167
+ name="radio-group-2"
168
+ >
169
+ <ic-radio-option
170
+ key="child-option-1"
171
+ label="child-option-1"
172
+ value="child-option-1"
173
+ ></ic-radio-option>
174
+ <ic-radio-option
175
+ key="child-option-2"
176
+ label="child-option-2"
177
+ value="child-option-2"
178
+ ></ic-radio-option>
179
+ </ic-radio-group>
180
+ </ic-radio-option>
181
+ <ic-radio-option
182
+ additional-field-display="dynamic"
183
+ value="valueName2"
184
+ label="Option with Text-field as conditional slotted additional field"
185
+ >
186
+ <ic-text-field
187
+ validation-status="error"
188
+ validation-text="Now it has really gone to (coffee) pot"
189
+ slot="additional-field"
190
+ placeholder="Placeholder"
191
+ label="What's your favourite type of coffee?"
192
+ >
193
+ </ic-text-field>
194
+ </ic-radio-option>
195
+ <ic-radio-option
196
+ additional-field-display="dynamic"
197
+ value="valueName3"
198
+ label="Option with Button as conditional slotted additional field"
199
+ >
200
+ <ic-button slot="additional-field">Hello world</ic-button>
201
+ </ic-radio-option>
202
+ </ic-radio-group>
203
+ `,
204
+
205
+ name: "Conditional dynamic",
206
+ };
207
+
208
+ export const ConditionalStatic = {
209
+ render: (args) => html`
210
+ <ic-radio-group label=" Conditional static" name="1">
211
+ <ic-radio-option value="valueName1" label="option1">
212
+ <ic-text-field
213
+ slot="additional-field"
214
+ label="What's your favourite type of coffee?"
215
+ ></ic-text-field>
216
+ </ic-radio-option>
217
+ <ic-radio-option value="valueName2" label="option2">
218
+ <ic-radio-group
219
+ slot="additional-field"
220
+ helperText="Child Group Helper Text"
221
+ label="Children"
222
+ name="radio-group-2"
223
+ >
224
+ <ic-radio-option
225
+ key="child-option-1"
226
+ label="child-option-1"
227
+ value="child-option-1"
228
+ ></ic-radio-option>
229
+ <ic-radio-option
230
+ key="child-option-2"
231
+ label="child-option-2"
232
+ value="child-option-2"
233
+ ></ic-radio-option>
234
+ </ic-radio-group>
235
+ </ic-radio-option>
236
+ </ic-radio-group>
237
+ `,
238
+
239
+ name: "Conditional static",
240
+ };
241
+
242
+ export const HelperText = {
243
+ render: (args) => html`
244
+ <ic-radio-group label="This is a label" name="1" helper-text="Helper text">
245
+ <ic-radio-option
246
+ value="valueName1"
247
+ label="Unselected / Default"
248
+ ></ic-radio-option>
249
+ <ic-radio-option
250
+ value="valueName2"
251
+ label="Selected / Default"
252
+ selected
253
+ ></ic-radio-option>
254
+ <ic-radio-option
255
+ value="valueName3"
256
+ label="Unselected / Disabled"
257
+ disabled
258
+ ></ic-radio-option>
259
+ </ic-radio-group>
260
+ `,
261
+
262
+ name: "Helper text",
263
+ };
264
+
265
+ export const Small = {
266
+ render: (args) => html`
267
+ <ic-radio-group label="This is a label" name="1" size="small">
268
+ <ic-radio-option
269
+ value="valueName1"
270
+ label="Unselected / Default"
271
+ ></ic-radio-option>
272
+ <ic-radio-option
273
+ value="valueName2"
274
+ label="Selected / Default"
275
+ selected
276
+ ></ic-radio-option>
277
+ <ic-radio-option
278
+ value="valueName3"
279
+ label="Unselected / Disabled"
280
+ disabled
281
+ ></ic-radio-option>
282
+ </ic-radio-group>
283
+ `,
284
+
285
+ name: "Small",
286
+ };
287
+
288
+ export const DeprecatedSmall = {
289
+ render: (args) => html`
290
+ <ic-radio-group label="This is a label" name="1" small>
291
+ <ic-radio-option
292
+ value="valueName1"
293
+ label="Unselected / Default"
294
+ ></ic-radio-option>
295
+ <ic-radio-option
296
+ value="valueName2"
297
+ label="Selected / Default"
298
+ selected
299
+ ></ic-radio-option>
300
+ <ic-radio-option
301
+ value="valueName3"
302
+ label="Unselected / Disabled"
303
+ disabled
304
+ ></ic-radio-option>
305
+ </ic-radio-group>
306
+ `,
307
+
308
+ name: "Deprecated - small",
309
+ };
310
+
311
+ export const Validation = {
312
+ render: (args) => html`
313
+ <ic-radio-group
314
+ label="This is a label"
315
+ name="1"
316
+ validation-status="error"
317
+ validation-text="Error message"
318
+ >
319
+ <ic-radio-option
320
+ value="valueName1"
321
+ label="Unselected / Default"
322
+ ></ic-radio-option>
323
+ <ic-radio-option
324
+ value="valueName2"
325
+ label="Selected / Default"
326
+ selected
327
+ ></ic-radio-option>
328
+ <ic-radio-option
329
+ value="valueName3"
330
+ label="Unselected / Disabled"
331
+ disabled
332
+ ></ic-radio-option>
333
+ </ic-radio-group>
334
+ `,
335
+
336
+ name: "Validation",
337
+ };
338
+
339
+ export const Form = {
340
+ render: (args) => html`
341
+ <form>
342
+ <ic-radio-group label="This is a label" name="1">
343
+ <ic-radio-option
344
+ value="valueName1"
345
+ label="Unselected / Default"
346
+ ></ic-radio-option>
347
+ <ic-radio-option
348
+ value="valueName2"
349
+ label="Selected / Default"
350
+ ></ic-radio-option>
351
+ <ic-radio-option
352
+ value="valueName3"
353
+ label="Unselected / Disabled"
354
+ disabled
355
+ ></ic-radio-option>
356
+ </ic-radio-group>
357
+ <input type="submit" value="Submit" />
358
+ <input type="reset" value="Reset" />
359
+ </form>
360
+ <script>
361
+ document.querySelector("form").addEventListener("submit", (ev) => {
362
+ ev.preventDefault();
363
+ console.log(document.querySelector('input[name="1"]').value);
364
+ });
365
+ </script>
366
+ `,
367
+
368
+ name: "Form",
369
+ };
370
+
371
+ const inlineRadioSelector = "inline-radio";
372
+
373
+ export const Playground = {
374
+ render: (args) => html`
375
+ <ic-radio-group
376
+ label=${args.label}
377
+ name=${args.name}
378
+ orientation=${args.orientation}
379
+ required=${args.required}
380
+ size=${args.size}
381
+ validation-status=${args.validationStatus}
382
+ validation-text=${args.validationText}
383
+ helper-text=${args.helperText}
384
+ disabled=${args.disabled}
385
+ hide-label=${args.hideLabel}
386
+ >
387
+ <ic-radio-option
388
+ additional-field-display=${args.additionalFieldDisplay}
389
+ value=${args.value}
390
+ label=${args.radioLabel}
391
+ name=${args.radioName}
392
+ selected=${args.selected}
393
+ disabled=${args.radioDisabled}
394
+ dynamic-text=${args.dynamicText}
395
+ >
396
+ <ic-text-field
397
+ slot=${args.additionalFieldSlot}
398
+ placeholder="Placeholder"
399
+ label="What's your favourite type of coffee?"
400
+ ></ic-text-field>
401
+ </ic-radio-option>
402
+ <ic-radio-option value="valueName2" label="Radio 2"></ic-radio-option>
403
+ </ic-radio-group>
404
+ `,
405
+
406
+ args: defaultArgs,
407
+
408
+ argTypes: {
409
+ orientation: {
410
+ options: ["vertical", "horizontal"],
411
+
412
+ control: {
413
+ type: "inline-radio",
414
+ },
415
+ },
416
+
417
+ size: {
418
+ options: ["default", "small"],
419
+
420
+ control: {
421
+ type: inlineRadioSelector,
422
+ },
423
+ },
424
+
425
+ validationStatus: {
426
+ options: ["error", "warning", "success", ""],
427
+
428
+ control: {
429
+ type: "radio",
430
+ },
431
+ },
432
+
433
+ additionalFieldDisplay: {
434
+ options: ["static", "dynamic"],
435
+
436
+ control: {
437
+ type: inlineRadioSelector,
438
+ },
439
+ },
440
+
441
+ additionalFieldSlot: {
442
+ mapping: {
443
+ true: "additional-field",
444
+ false: "",
445
+ },
446
+ },
447
+ },
448
+
449
+ name: "Playground",
450
+ };