@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,257 @@
1
+ import { html } from "lit-html";
2
+
3
+ const defaultArgs = {
4
+ dismissible: false,
5
+ heading: "Heading",
6
+ message: "Message",
7
+ titleAbove: false,
8
+ variant: "neutral",
9
+ showAction: false,
10
+ showDefaultIcon: true,
11
+ showSlottedIcon: false,
12
+ };
13
+
14
+ export default {
15
+ title: "Web Components/Alert",
16
+ component: "ic-alert",
17
+ };
18
+
19
+ export const Variants = {
20
+ render: () =>
21
+ html`<ic-alert
22
+ heading="Neutral"
23
+ message="This alert is for displaying miscellaneous messages"
24
+ ></ic-alert>
25
+ <ic-alert
26
+ variant="info"
27
+ heading="Info"
28
+ message="This alert is for displaying information"
29
+ ></ic-alert>
30
+ <ic-alert
31
+ variant="error"
32
+ heading="Error"
33
+ message="This alert is for displaying errors"
34
+ ></ic-alert>
35
+ <ic-alert
36
+ variant="warning"
37
+ heading="Warning"
38
+ message="This alert is for displaying warnings"
39
+ ></ic-alert>
40
+ <ic-alert
41
+ variant="success"
42
+ heading="Success"
43
+ message="This alert is for displaying success messages. It has a very long message with lots of text which goes over multiple
44
+ lines so the alert should expand as well to make sure it doesn't overflow"
45
+ ></ic-alert>`,
46
+
47
+ name: "Variants",
48
+ };
49
+
50
+ export const MessageOnly = {
51
+ render: () =>
52
+ html`<ic-alert
53
+ message="This alert is for displaying miscellaneous messages"
54
+ ></ic-alert>`,
55
+
56
+ name: "Message only",
57
+ };
58
+
59
+ export const Dismissible = {
60
+ render: () =>
61
+ html`<ic-alert
62
+ heading="Neutral"
63
+ message="This alert is for displaying miscellaneous messages"
64
+ dismissible="true"
65
+ ></ic-alert>`,
66
+
67
+ name: "Dismissible",
68
+ };
69
+
70
+ export const WithAction = {
71
+ render: () =>
72
+ html`<ic-alert
73
+ heading="Neutral"
74
+ message="This alert is for displaying miscellaneous messages"
75
+ ><ic-button slot="action" variant="secondary">Button</ic-button></ic-alert
76
+ >`,
77
+
78
+ name: "With action",
79
+ };
80
+
81
+ export const DismissibleWithAction = {
82
+ render: () =>
83
+ html`<ic-alert
84
+ heading="Neutral"
85
+ message="This alert is for displaying miscellaneous messages"
86
+ dismissible="true"
87
+ ><ic-button slot="action" variant="secondary">Button</ic-button></ic-alert
88
+ >`,
89
+
90
+ name: "Dismissible with action",
91
+ };
92
+
93
+ export const TitleAbove = {
94
+ render: () =>
95
+ html`<ic-alert
96
+ heading="Neutral"
97
+ message="This alert is for displaying miscellaneous messages"
98
+ title-above="true"
99
+ ></ic-alert>`,
100
+
101
+ name: "Title above",
102
+ };
103
+
104
+ export const ResponsiveTitle = {
105
+ render: () =>
106
+ html`<ic-alert
107
+ heading="This title is very long so should force the alert to add 'title-above'"
108
+ message="This alert does not have 'title-above' added as a prop but it is forced to add it due to the length of the title"
109
+ ></ic-alert>
110
+ <ic-alert
111
+ variant="success"
112
+ heading="Shorter title"
113
+ message="Neither of these has 'title-above' set to true"
114
+ ></ic-alert>`,
115
+
116
+ name: "Responsive title",
117
+ };
118
+
119
+ export const CustomMessage = {
120
+ render: () =>
121
+ html`<ic-alert heading="This alert uses a custom message slot">
122
+ <ic-typography variant="body" slot="message">
123
+ <p>
124
+ This is some text and
125
+ <ic-link href="/" inline>this is an inline link</ic-link> within the
126
+ text.
127
+ </p>
128
+ </ic-typography>
129
+ </ic-alert>`,
130
+
131
+ name: "Custom message",
132
+ };
133
+
134
+ export const CustomMessageAndTitleAbove = {
135
+ render: () => html`<ic-alert
136
+ heading="Want to know more about our coffee?"
137
+ title-above="true"
138
+ >
139
+ <span slot="message" style="font:var(--ic-font-body)">
140
+ Go to our <ic-link href="/">coffee page</ic-link> to learn more.
141
+ </ic-typography>
142
+ </ic-alert>`,
143
+
144
+ name: "Custom message and title above",
145
+ };
146
+
147
+ export const Announced = {
148
+ render: () => html`
149
+ <ic-alert
150
+ id="alert"
151
+ heading="Neutral"
152
+ message="This alert is for displaying miscellaneous messages"
153
+ announced="false"
154
+ ></ic-alert>
155
+ <br />
156
+ <br />
157
+ <ic-button variant="primary" size="small" onClick="onClick()" id="btn"
158
+ >Toggle announced prop</ic-button
159
+ >
160
+ <script>
161
+ const alert = document.getElementById("alert");
162
+ const btn = document.getElementById("btn");
163
+ btn.addEventListener("click", onClick);
164
+ function onClick(e) {
165
+ e.preventDefault();
166
+ alert.announced
167
+ ? (alert.announced = "false")
168
+ : (alert.announced = "true");
169
+ }
170
+ </script>
171
+ `,
172
+
173
+ name: "Announced",
174
+ };
175
+
176
+ export const SlottedIcon = {
177
+ render: () => html`
178
+ <ic-alert
179
+ id="alert"
180
+ heading="Neutral"
181
+ message="This alert contains a slotted icon"
182
+ show-default-icon="false"
183
+ >
184
+ <svg
185
+ slot="neutral-icon"
186
+ xmlns="http://www.w3.org/2000/svg"
187
+ height="24px"
188
+ viewBox="0 0 24 24"
189
+ width="24px"
190
+ fill="#000000"
191
+ >
192
+ <path d="M0 0h24v24H0V0z" fill="none" />
193
+ <path
194
+ d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
195
+ />
196
+ </svg>
197
+ </ic-alert>
198
+ `,
199
+
200
+ name: "Slotted icon",
201
+ };
202
+
203
+ export const NoIcon = {
204
+ render: () => html`
205
+ <ic-alert
206
+ id="alert"
207
+ heading="Neutral"
208
+ message="This alert has no icon"
209
+ show-default-icon="false"
210
+ ></ic-alert>
211
+ `,
212
+
213
+ name: "No icon",
214
+ };
215
+
216
+ export const Playground = {
217
+ render: (args) =>
218
+ html`<ic-alert
219
+ dismissible=${args.dismissible}
220
+ variant=${args.variant}
221
+ heading=${args.heading}
222
+ message=${args.message}
223
+ title-above=${args.titleAbove}
224
+ show-default-icon=${args.showDefaultIcon}
225
+ >
226
+ ${args.showAction &&
227
+ html`<ic-button slot="action" variant="secondary">Button</ic-button>`}
228
+ ${args.showSlottedIcon &&
229
+ html`<svg
230
+ slot="neutral-icon"
231
+ xmlns="http://www.w3.org/2000/svg"
232
+ height="24px"
233
+ viewBox="0 0 24 24"
234
+ width="24px"
235
+ fill="#000000"
236
+ >
237
+ <path d="M0 0h24v24H0V0z" fill="none" />
238
+ <path
239
+ d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"
240
+ />
241
+ </svg>`}
242
+ </ic-alert>`,
243
+
244
+ args: defaultArgs,
245
+
246
+ argTypes: {
247
+ variant: {
248
+ options: ["neutral", "info", "warning", "error", "success"],
249
+
250
+ control: {
251
+ type: "select",
252
+ },
253
+ },
254
+ },
255
+
256
+ name: "Playground",
257
+ };
@@ -0,0 +1,162 @@
1
+ import { html } from "lit-html";
2
+
3
+ export default {
4
+ title: "Web Components/Back to top",
5
+ component: "ic-back-to-top",
6
+ };
7
+
8
+ export const Default = {
9
+ render: () => html`
10
+ <div id="topEl" style="margin-top:-20px;">
11
+ <ic-typography variant="h2">Top of the page</ic-typography>
12
+ </div>
13
+ <div style="height:1200px;"></div>
14
+ <ic-back-to-top target="topEl"></ic-back-to-top>
15
+ `,
16
+
17
+ name: "Default",
18
+ };
19
+
20
+ export const IconOnly = {
21
+ render: () => html`
22
+ <div id="topEl" style="margin-top:-20px;">
23
+ <ic-typography variant="h2">Top of the page</ic-typography>
24
+ </div>
25
+ <div style="height:1200px;"></div>
26
+ <ic-back-to-top target="topEl" variant="icon"></ic-back-to-top>
27
+ `,
28
+
29
+ name: "Icon Only",
30
+ };
31
+
32
+ export const PageExample = {
33
+ render: () => html`
34
+ <div
35
+ id="header"
36
+ style="width:100%;height:100px;background-color:#23508e;color:var(--ic-architectural-white)"
37
+ >
38
+ <ic-typography variant="h1">Header</ic-typography>
39
+ <ic-button variant="secondary" appearance="light">Button</ic-button>
40
+ </div>
41
+ <div id="topPageEl">
42
+ <ic-typography variant="h2">Top of the page</ic-typography>
43
+ </div>
44
+ <ic-typography variant="h3">Some content</ic-typography>
45
+ <p>
46
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel velit
47
+ turpis. Cras ac ligula et lectus mollis molestie in a enim. In ac turpis
48
+ in leo rutrum eleifend. Fusce consectetur posuere ligula, vitae semper
49
+ lorem mollis vitae. Fusce vel blandit turpis. Nulla justo ligula, egestas
50
+ quis rutrum id, vulputate eget diam. Integer mattis quis nisi id blandit.
51
+ Duis nisi lectus, suscipit elementum iaculis sed, porta et risus.
52
+ </p>
53
+ <br />
54
+ <br />
55
+ <br />
56
+ <ic-typography variant="h3">More content</ic-typography>
57
+ <p>
58
+ Phasellus accumsan ligula enim, a iaculis sapien rhoncus vitae. Curabitur
59
+ pulvinar posuere diam in luctus. Sed blandit diam id odio aliquam aliquet.
60
+ Pellentesque eros enim, tristique vel mattis eu, blandit at enim.
61
+ Pellentesque sollicitudin pellentesque tellus vel eleifend. Nulla mauris
62
+ lorem, porttitor vel orci eu, iaculis maximus nunc. Ut rhoncus ex ipsum.
63
+ Mauris ultricies, augue sed eleifend pellentesque, leo purus efficitur
64
+ orci, sit amet volutpat tortor diam non lorem. Morbi venenatis neque vel
65
+ accumsan sagittis. Nunc rutrum augue non urna tincidunt auctor in at
66
+ libero. Sed in risus sit amet nisl tempor viverra. Phasellus maximus
67
+ sapien eu erat maximus iaculis. Praesent ultricies id orci eu euismod.
68
+ Fusce eu urna turpis. Praesent ut neque tincidunt, porta sem id, accumsan
69
+ massa.
70
+ </p>
71
+ <br />
72
+ <br />
73
+ <br />
74
+ <ic-typography variant="h3">Some other content</ic-typography>
75
+ <p>
76
+ Curabitur eu tempor justo. Nunc congue viverra tristique. Maecenas massa
77
+ enim, tincidunt consequat maximus at, fermentum vel lectus. Curabitur at
78
+ ligula tellus. Ut a elit sit amet augue sagittis feugiat. Mauris mi enim,
79
+ viverra id turpis ac, auctor vulputate ipsum. Nunc efficitur volutpat
80
+ augue eget sollicitudin. Pellentesque eget pharetra ligula. Integer
81
+ finibus feugiat sapien a pulvinar. Phasellus fermentum est lacus, quis
82
+ volutpat justo pellentesque vitae. Sed vitae diam porta, facilisis metus
83
+ ut, dictum lorem. Proin sed bibendum libero. Maecenas justo neque,
84
+ ultricies sed magna ac, mattis vehicula elit. Donec ac lacus eget sapien
85
+ luctus ultricies in in nibh.
86
+ </p>
87
+ <p>
88
+ Curabitur in nulla urna. Donec ligula est, suscipit eget malesuada vitae,
89
+ elementum et quam. Lorem ipsum dolor sit amet, consectetur adipiscing
90
+ elit. Nulla eu dui a quam mollis porta. Nulla ante nunc, ultrices luctus
91
+ dolor at, ullamcorper convallis erat. Aenean viverra semper arcu nec
92
+ semper. Sed non magna purus. Integer accumsan dui et volutpat auctor.
93
+ Phasellus nec risus ultricies, maximus nunc eu, placerat diam. Etiam
94
+ pulvinar lacinia urna eget molestie. Suspendisse semper hendrerit ipsum,
95
+ vel porttitor lacus venenatis sit amet. Nullam non elit in sem vestibulum
96
+ molestie tempor eget augue. Sed neque ligula, tempus ac mollis bibendum,
97
+ ultrices suscipit risus. Duis suscipit pulvinar varius.
98
+ </p>
99
+ <br />
100
+ <br />
101
+ <br />
102
+ <ic-typography variant="h3">Some more</ic-typography>
103
+ <p>
104
+ Etiam accumsan nibh erat, condimentum tempus metus suscipit nec. Duis
105
+ placerat varius dolor eget ornare. Vestibulum egestas tellus non tellus
106
+ ornare, eu scelerisque erat pulvinar. Nam tempus lacus eu libero
107
+ consequat, in elementum magna ultricies. Etiam at suscipit odio. Duis quis
108
+ quam vitae quam varius luctus. Aliquam erat volutpat. Fusce laoreet
109
+ consectetur tortor, ac suscipit sem feugiat non. Etiam tempus tellus
110
+ aliquet orci pretium, nec pretium nulla faucibus
111
+ </p>
112
+ <br />
113
+ <ic-button>Button</ic-button>
114
+ <br />
115
+ <br />
116
+ <br />
117
+ <ic-typography variant="h3">Nearly there</ic-typography>
118
+ <p>
119
+ Curabitur eu tempor justo. Nunc congue viverra tristique. Maecenas massa
120
+ enim, tincidunt consequat maximus at, fermentum vel lectus. Curabitur at
121
+ ligula tellus. Ut a elit sit amet augue sagittis feugiat. Mauris mi enim,
122
+ viverra id turpis ac, auctor vulputate ipsum. Nunc efficitur volutpat
123
+ augue eget sollicitudin. Pellentesque eget pharetra ligula. Integer
124
+ finibus feugiat sapien a pulvinar. Phasellus fermentum est lacus, quis
125
+ volutpat justo pellentesque vitae. Sed vitae diam porta, facilisis metus
126
+ ut, dictum lorem. Proin sed bibendum libero. Maecenas justo neque,
127
+ ultricies sed magna ac, mattis vehicula elit. Donec ac lacus eget sapien
128
+ luctus ultricies in in nibh.
129
+ </p>
130
+ <p>
131
+ Curabitur in nulla urna. Donec ligula est, suscipit eget malesuada vitae,
132
+ elementum et quam. Lorem ipsum dolor sit amet, consectetur adipiscing
133
+ elit. Nulla eu dui a quam mollis porta. Nulla ante nunc, ultrices luctus
134
+ dolor at, ullamcorper convallis erat. Aenean viverra semper arcu nec
135
+ semper. Sed non magna purus. Integer accumsan dui et volutpat auctor.
136
+ Phasellus nec risus ultricies, maximus nunc eu, placerat diam. Etiam
137
+ pulvinar lacinia urna eget molestie. Suspendisse semper hendrerit ipsum,
138
+ vel porttitor lacus venenatis sit amet. Nullam non elit in sem vestibulum
139
+ molestie tempor eget augue. Sed neque ligula, tempus ac mollis bibendum,
140
+ ultrices suscipit risus. Duis suscipit pulvinar varius.
141
+ </p>
142
+ <br />
143
+ <br />
144
+ <br />
145
+ <ic-typography variant="h3">The end</ic-typography>
146
+ <br />
147
+ <ic-back-to-top target="topPageEl"></ic-back-to-top>
148
+ <footer>
149
+ <div
150
+ id="footer"
151
+ style="width:100%;height:200px;background-color:#23508e;color:var(--ic-architectural-white)"
152
+ >
153
+ <ic-typography variant="h3">Footer</ic-typography>
154
+ </div>
155
+ </footer>
156
+ <ic-classification-banner
157
+ classification="official"
158
+ ></ic-classification-banner>
159
+ `,
160
+
161
+ name: "Page example",
162
+ };