@ukic/web-components 3.0.0-alpha.13 → 3.0.0-alpha.14

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 (158) hide show
  1. package/dist/cjs/ic-button_3.cjs.entry.js +59 -1
  2. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-navigation-group.cjs.entry.js +6 -3
  7. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-navigation-menu.cjs.entry.js +36 -22
  9. package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-popover-menu.cjs.entry.js +5 -4
  11. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-select.cjs.entry.js +13 -10
  13. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-side-navigation.cjs.entry.js +7 -4
  15. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-skip-link.cjs.entry.js +10 -9
  17. package/dist/cjs/ic-skip-link.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  19. package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-step.cjs.entry.js +13 -12
  21. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-toast.cjs.entry.js +3 -3
  23. package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
  24. package/dist/collection/components/ic-button/ic-button.css +6 -0
  25. package/dist/collection/components/ic-button/ic-button.js +58 -0
  26. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  27. package/dist/collection/components/ic-button/ic-button.stories.js +179 -0
  28. package/dist/collection/components/ic-menu-item/ic-menu-item.css +1 -0
  29. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +30 -4
  30. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
  31. package/dist/collection/components/ic-navigation-group/ic-navigation-group.types.js.map +1 -1
  32. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js +36 -22
  33. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js.map +1 -1
  34. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +5 -4
  35. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
  36. package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +70 -1
  37. package/dist/collection/components/ic-select/ic-select.css +1 -0
  38. package/dist/collection/components/ic-select/ic-select.js +12 -9
  39. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  40. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +7 -4
  41. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  42. package/dist/collection/components/ic-side-navigation/ic-side-navigation.stories.js +12 -0
  43. package/dist/collection/components/ic-skip-link/ic-skip-link.css +22 -2
  44. package/dist/collection/components/ic-skip-link/ic-skip-link.js +13 -12
  45. package/dist/collection/components/ic-skip-link/ic-skip-link.js.map +1 -1
  46. package/dist/collection/components/ic-skip-link/ic-skip-link.stories.js +375 -31
  47. package/dist/collection/components/ic-status-tag/ic-status-tag.css +1 -1
  48. package/dist/collection/components/ic-step/ic-step.css +2 -2
  49. package/dist/collection/components/ic-step/ic-step.js +12 -11
  50. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  51. package/dist/collection/components/ic-stepper/ic-stepper.stories.js +5 -1
  52. package/dist/collection/components/ic-toast/ic-toast.js +3 -3
  53. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  54. package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +8 -19
  55. package/dist/components/helpers.js +1 -1
  56. package/dist/components/ic-button2.js +59 -1
  57. package/dist/components/ic-button2.js.map +1 -1
  58. package/dist/components/ic-menu-item2.js +1 -1
  59. package/dist/components/ic-menu-item2.js.map +1 -1
  60. package/dist/components/ic-navigation-group.js +6 -3
  61. package/dist/components/ic-navigation-group.js.map +1 -1
  62. package/dist/components/ic-navigation-menu2.js +37 -23
  63. package/dist/components/ic-navigation-menu2.js.map +1 -1
  64. package/dist/components/ic-popover-menu.js +5 -4
  65. package/dist/components/ic-popover-menu.js.map +1 -1
  66. package/dist/components/ic-radio-group.js.map +1 -1
  67. package/dist/components/ic-radio-option.js.map +1 -1
  68. package/dist/components/ic-search-bar.js.map +1 -1
  69. package/dist/components/ic-select.js +13 -10
  70. package/dist/components/ic-select.js.map +1 -1
  71. package/dist/components/ic-side-navigation.js +7 -4
  72. package/dist/components/ic-side-navigation.js.map +1 -1
  73. package/dist/components/ic-skeleton.js.map +1 -1
  74. package/dist/components/ic-skip-link.js +10 -9
  75. package/dist/components/ic-skip-link.js.map +1 -1
  76. package/dist/components/ic-status-tag.js +1 -1
  77. package/dist/components/ic-status-tag.js.map +1 -1
  78. package/dist/components/ic-step.js +13 -12
  79. package/dist/components/ic-step.js.map +1 -1
  80. package/dist/components/ic-tab-panel.js.map +1 -1
  81. package/dist/components/ic-toast.js +4 -4
  82. package/dist/components/ic-toast.js.map +1 -1
  83. package/dist/components/ic-top-navigation.js +1 -1
  84. package/dist/core/core.css +35 -29
  85. package/dist/core/core.esm.js +1 -1
  86. package/dist/core/{p-abf767e3.entry.js → p-1dc0c174.entry.js} +2 -2
  87. package/dist/core/p-1dc0c174.entry.js.map +1 -0
  88. package/dist/core/{p-e30c6d79.entry.js → p-22d88d2f.entry.js} +2 -2
  89. package/dist/core/p-22d88d2f.entry.js.map +1 -0
  90. package/dist/core/p-39bf060d.entry.js +2 -0
  91. package/dist/core/p-39bf060d.entry.js.map +1 -0
  92. package/dist/core/p-4a5ab31e.entry.js.map +1 -1
  93. package/dist/core/p-625f914e.entry.js +2 -0
  94. package/dist/core/p-625f914e.entry.js.map +1 -0
  95. package/dist/core/p-67d47db4.entry.js +2 -0
  96. package/dist/core/p-67d47db4.entry.js.map +1 -0
  97. package/dist/core/{p-8577de91.entry.js → p-9dbe3f3e.entry.js} +2 -2
  98. package/dist/core/{p-8577de91.entry.js.map → p-9dbe3f3e.entry.js.map} +1 -1
  99. package/dist/core/p-a9fd6dcf.entry.js +2 -0
  100. package/dist/core/p-a9fd6dcf.entry.js.map +1 -0
  101. package/dist/core/p-c7be6679.entry.js +2 -0
  102. package/dist/core/p-c7be6679.entry.js.map +1 -0
  103. package/dist/core/p-d80f3ec1.entry.js +2 -0
  104. package/dist/core/p-d80f3ec1.entry.js.map +1 -0
  105. package/dist/core/p-dce2c5e8.entry.js +2 -0
  106. package/dist/core/p-dce2c5e8.entry.js.map +1 -0
  107. package/dist/core/{p-de7542fa.entry.js → p-e3be3502.entry.js} +2 -2
  108. package/dist/core/p-e3be3502.entry.js.map +1 -0
  109. package/dist/esm/ic-button_3.entry.js +59 -1
  110. package/dist/esm/ic-button_3.entry.js.map +1 -1
  111. package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
  112. package/dist/esm/ic-menu-item.entry.js +1 -1
  113. package/dist/esm/ic-menu-item.entry.js.map +1 -1
  114. package/dist/esm/ic-navigation-group.entry.js +6 -3
  115. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  116. package/dist/esm/ic-navigation-menu.entry.js +37 -23
  117. package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
  118. package/dist/esm/ic-popover-menu.entry.js +5 -4
  119. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  120. package/dist/esm/ic-select.entry.js +13 -10
  121. package/dist/esm/ic-select.entry.js.map +1 -1
  122. package/dist/esm/ic-side-navigation.entry.js +7 -4
  123. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  124. package/dist/esm/ic-skip-link.entry.js +10 -9
  125. package/dist/esm/ic-skip-link.entry.js.map +1 -1
  126. package/dist/esm/ic-status-tag.entry.js +1 -1
  127. package/dist/esm/ic-status-tag.entry.js.map +1 -1
  128. package/dist/esm/ic-step.entry.js +13 -12
  129. package/dist/esm/ic-step.entry.js.map +1 -1
  130. package/dist/esm/ic-toast.entry.js +3 -3
  131. package/dist/esm/ic-toast.entry.js.map +1 -1
  132. package/dist/types/components/ic-button/ic-button.d.ts +1 -0
  133. package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +6 -2
  134. package/dist/types/components/ic-navigation-group/ic-navigation-group.types.d.ts +3 -0
  135. package/dist/types/components/ic-navigation-menu/ic-navigation-menu.d.ts +2 -0
  136. package/dist/types/components/ic-skip-link/ic-skip-link.d.ts +4 -4
  137. package/dist/types/components.d.ts +11 -10
  138. package/hydrate/index.js +154 -70
  139. package/hydrate/index.mjs +154 -70
  140. package/package.json +2 -2
  141. package/vscode-data.json +4 -4
  142. package/dist/core/p-052d1ff0.entry.js +0 -2
  143. package/dist/core/p-052d1ff0.entry.js.map +0 -1
  144. package/dist/core/p-0b757d78.entry.js +0 -2
  145. package/dist/core/p-0b757d78.entry.js.map +0 -1
  146. package/dist/core/p-59287779.entry.js +0 -2
  147. package/dist/core/p-59287779.entry.js.map +0 -1
  148. package/dist/core/p-6c8e72b4.entry.js +0 -2
  149. package/dist/core/p-6c8e72b4.entry.js.map +0 -1
  150. package/dist/core/p-6fdb8a79.entry.js +0 -2
  151. package/dist/core/p-6fdb8a79.entry.js.map +0 -1
  152. package/dist/core/p-76bdbc98.entry.js +0 -2
  153. package/dist/core/p-76bdbc98.entry.js.map +0 -1
  154. package/dist/core/p-9bcd2c77.entry.js +0 -2
  155. package/dist/core/p-9bcd2c77.entry.js.map +0 -1
  156. package/dist/core/p-abf767e3.entry.js.map +0 -1
  157. package/dist/core/p-de7542fa.entry.js.map +0 -1
  158. package/dist/core/p-e30c6d79.entry.js.map +0 -1
@@ -7,7 +7,7 @@ export default {
7
7
 
8
8
  export const Default = {
9
9
  render: () =>
10
- html`<ic-skip-link target="#page-content"></ic-skip-link>
10
+ html`<ic-skip-link target="page-content"></ic-skip-link>
11
11
  <ic-top-navigation app-title="Application Name">
12
12
  <svg
13
13
  slot="app-icon"
@@ -30,7 +30,7 @@ export const Default = {
30
30
 
31
31
  export const FullWidth = {
32
32
  render: () =>
33
- html`<ic-skip-link target="#page-content" full-width="true"></ic-skip-link>
33
+ html`<ic-skip-link target="page-content" full-width="true"></ic-skip-link>
34
34
  <ic-top-navigation app-title="Application Name">
35
35
  <svg
36
36
  slot="app-icon"
@@ -51,41 +51,385 @@ export const FullWidth = {
51
51
  name: "Full width",
52
52
  };
53
53
 
54
- export const Inline = {
54
+ export const CustomTopPosition = {
55
55
  render: () =>
56
- html`<ic-skip-link target="#page-content"></ic-skip-link>
57
- <ic-top-navigation app-title="Application Name">
58
- <svg
59
- slot="app-icon"
60
- xmlns="http://www.w3.org/2000/svg"
61
- height="24px"
62
- viewBox="0 0 24 24"
63
- width="24px"
64
- fill="#000000"
56
+ html`<div style="display: flex; flex-direction: column; min-height: 100vh;">
57
+ <div
58
+ id="cookie-banner"
59
+ aria-label="cookies banner"
60
+ role="region"
61
+ style="background: var(--ic-architectural-60); box-shadow: var(--ic-elevation-modal); z-index: var(--ic-z-index-classification-banner); position: sticky; top: 0; width: 100%; padding: var(--ic-space-md) 0"
65
62
  >
66
- <path d="M0 0h24v24H0V0z" fill="none" />
67
- <path
68
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
69
- />
70
- </svg>
71
- </ic-top-navigation>
72
- <br />
73
- <br />
74
- <br />
75
- <main id="page-content">Target element</main>
76
- <ic-skip-link target="#next-content" inline="true"></ic-skip-link>
77
- <br />
78
- <br />
79
- <br />
80
- <main id="next-content">Next target element</main>
81
- <ic-button>Should receive last focus</ic-button>`,
63
+ <ic-section-container full-height aligned="full-width">
64
+ <ic-typography variant="h2">
65
+ Cookies and Storage on this site
66
+ </ic-typography>
67
+ <ic-typography variant="body">
68
+ We’d like to use analytics cookies to understand how you use the
69
+ Design System, so that we can make improvements. Additionally, we
70
+ use local storage to improve your experience by remembering your
71
+ preferences.
72
+ </ic-typography>
73
+ <div
74
+ className="buttons"
75
+ style="display: grid; column-gap: var(--ic-space-md); grid-template-columns: auto auto auto; justify-content: start; align-items: center; padding: var(--ic-space-md) 0 var(--ic-space-xs);"
76
+ >
77
+ <ic-button onclick="closeCookieBanner()"> Accept </ic-button>
78
+ <ic-button variant="secondary" onclick="closeCookieBanner()">
79
+ Decline
80
+ </ic-button>
81
+ <ic-link href=""> Manage preferences </ic-link>
82
+ </div>
83
+ </ic-section-container>
84
+ </div>
85
+ <ic-skip-link target="page-content"></ic-skip-link>
86
+ <ic-top-navigation
87
+ app-title="Application Name"
88
+ status="alpha"
89
+ version="v0.0.7"
90
+ content-aligned="center"
91
+ >
92
+ <svg
93
+ slot="app-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 0h24v24H0V0z" fill="none" />
101
+ <path
102
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
103
+ />
104
+ </svg>
105
+ <ic-search-bar
106
+ slot="search"
107
+ placeholder="Search"
108
+ label="Search"
109
+ ></ic-search-bar>
110
+ <ic-navigation-button
111
+ label="button1"
112
+ slot="buttons"
113
+ onclick="alert('test')"
114
+ >
115
+ <svg
116
+ slot="icon"
117
+ xmlns="http://www.w3.org/2000/svg"
118
+ height="24px"
119
+ viewBox="0 0 24 24"
120
+ width="24px"
121
+ fill="#000000"
122
+ >
123
+ <path d="M0 0h24v24H0V0z" fill="none" />
124
+ <path
125
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
126
+ />
127
+ </svg>
128
+ </ic-navigation-button>
129
+ <ic-navigation-item
130
+ slot="navigation"
131
+ label="Navigation"
132
+ href="/"
133
+ ></ic-navigation-item>
134
+ <ic-navigation-group
135
+ slot="navigation"
136
+ label="Navigation group"
137
+ expandable="true"
138
+ >
139
+ <ic-navigation-item
140
+ label="Navigation"
141
+ href="/"
142
+ ></ic-navigation-item>
143
+ <ic-navigation-item
144
+ label="Navigation"
145
+ href="/"
146
+ ></ic-navigation-item>
147
+ </ic-navigation-group>
148
+ </ic-top-navigation>
149
+ <main style="height: 100%">
150
+ <ic-section-container aligned="center" id="page-content">
151
+ <ic-typography
152
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit.
153
+ Vestibulum pharetra scelerisque arcu, vitae semper nisl rhoncus
154
+ ut. Vestibulum molestie enim at sollicitudin pellentesque. Proin
155
+ sit amet augue sit amet dui suscipit lobortis. Nullam at
156
+ consectetur ante. Suspendisse mollis ultricies porttitor. Nunc
157
+ laoreet leo tortor, ut tristique odio finibus a. In rutrum
158
+ convallis purus, vitae tristique tortor sagittis vel. Donec dictum
159
+ nunc a elit tristique, et facilisis est condimentum. Pellentesque
160
+ maximus nulla libero, nec auctor urna consequat nec. Class aptent
161
+ taciti sociosqu ad litora torquent per conubia nostra, per
162
+ inceptos himenaeos. In maximus velit a erat volutpat, sit amet
163
+ consequat velit rhoncus. Mauris pretium neque eget ante
164
+ consectetur consectetur. Morbi a consequat lectus. Donec venenatis
165
+ ultricies sem nec pulvinar. Fusce lacus augue, laoreet id pretium
166
+ id, efficitur nec leo.</ic-typography
167
+ >
168
+ <br />
169
+ <ic-skip-link
170
+ label="Skip to options"
171
+ target="page-content"
172
+ inline="true"
173
+ ></ic-skip-link>
174
+ <br />
175
+ <ic-typography
176
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit.
177
+ Vestibulum pharetra scelerisque arcu, vitae semper nisl rhoncus
178
+ ut. Vestibulum molestie enim at sollicitudin pellentesque. Proin
179
+ sit amet augue sit amet dui suscipit lobortis. Nullam at
180
+ consectetur ante. Suspendisse mollis ultricies porttitor. Nunc
181
+ laoreet leo tortor, ut tristique odio finibus a. In rutrum
182
+ convallis purus, vitae tristique tortor sagittis vel. Donec dictum
183
+ nunc a elit tristique, et facilisis est condimentum. Pellentesque
184
+ maximus nulla libero, nec auctor urna consequat nec. Class aptent
185
+ taciti sociosqu ad litora torquent per conubia nostra, per
186
+ inceptos himenaeos. In maximus velit a erat volutpat, sit amet
187
+ consequat velit rhoncus. Mauris pretium neque eget ante
188
+ consectetur consectetur. Morbi a consequat lectus. Donec venenatis
189
+ ultricies sem nec pulvinar. Fusce lacus augue, laoreet id pretium
190
+ id, efficitur nec leo.</ic-typography
191
+ >
192
+ <div id="options">
193
+ <ic-checkbox-group label="This is a label" required name="group1">
194
+ <ic-checkbox
195
+ value="valueName1"
196
+ label="Unselected / Default"
197
+ ></ic-checkbox>
198
+ <ic-checkbox
199
+ value="valueName2"
200
+ label="Selected / Default"
201
+ checked
202
+ ></ic-checkbox>
203
+ <ic-checkbox
204
+ value="valueName3"
205
+ label="Unselected / Disabled"
206
+ Disabled
207
+ ></ic-checkbox>
208
+ </ic-checkbox-group>
209
+ </div>
210
+ </ic-section-container>
211
+ </main>
212
+ <ic-footer
213
+ aligned="full-width"
214
+ description="The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback,
215
+ please get in touch."
216
+ caption="All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence."
217
+ ></ic-footer>
218
+ </div>
219
+ <script>
220
+ const debounce = (func, delay) => {
221
+ let timeout;
222
+ return (...args) => {
223
+ clearTimeout(timeout);
224
+ timeout = setTimeout(() => func(...args), delay);
225
+ };
226
+ };
227
+ const updateSkipLinkPosition = () => {
228
+ const cookieBanner = document.getElementById("cookie-banner");
229
+ const skipLink = document.querySelector("ic-skip-link");
230
+ if (cookieBanner && skipLink) {
231
+ requestAnimationFrame(() => {
232
+ const bannerHeight = cookieBanner.offsetHeight;
233
+ skipLink.style.setProperty(
234
+ "--ic-skip-link-position-top",
235
+ bannerHeight + 12 + "px"
236
+ );
237
+ });
238
+ }
239
+ };
240
+ const observeHydration = () => {
241
+ const cookieBanner = document.getElementById("cookie-banner");
242
+ const sectionContainer = cookieBanner?.querySelector(
243
+ "ic-section-container"
244
+ );
245
+ if (sectionContainer) {
246
+ const observer = new MutationObserver((mutationsList) => {
247
+ for (const mutation of mutationsList) {
248
+ if (
249
+ mutation.type === "attributes" &&
250
+ mutation.attributeName === "class" &&
251
+ sectionContainer.classList.contains("hydrated")
252
+ ) {
253
+ updateSkipLinkPosition();
254
+ observer.disconnect();
255
+ }
256
+ }
257
+ });
258
+ observer.observe(sectionContainer, { attributes: true });
259
+ }
260
+ };
261
+ document.addEventListener("DOMContentLoaded", () => {
262
+ observeHydration();
263
+ const debouncedResize = debounce(updateSkipLinkPosition, 100);
264
+ window.addEventListener("resize", debouncedResize);
265
+ });
266
+ const closeCookieBanner = () => {
267
+ const cookieBanner = document.getElementById("cookie-banner");
268
+ cookieBanner.style.setProperty("display", "none");
269
+ updateSkipLinkPosition();
270
+ };
271
+ </script>`,
272
+
273
+ name: "Custom top position",
274
+ parameters: {
275
+ layout: "fullscreen",
276
+ },
277
+ };
278
+
279
+ export const Inline = {
280
+ render: () =>
281
+ html`<ic-skip-link target="page-content"></ic-skip-link>
282
+ <div>
283
+ <div style="display: flex; flex-direction: column; min-height: 100vh;">
284
+ <ic-top-navigation
285
+ app-title="Application Name"
286
+ status="alpha"
287
+ version="v0.0.7"
288
+ content-aligned="center"
289
+ >
290
+ <svg
291
+ slot="app-icon"
292
+ xmlns="http://www.w3.org/2000/svg"
293
+ height="24px"
294
+ viewBox="0 0 24 24"
295
+ width="24px"
296
+ fill="#000000"
297
+ >
298
+ <path d="M0 0h24v24H0V0z" fill="none" />
299
+ <path
300
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
301
+ />
302
+ </svg>
303
+ <ic-search-bar
304
+ slot="search"
305
+ placeholder="Search"
306
+ label="Search"
307
+ ></ic-search-bar>
308
+ <ic-navigation-button
309
+ label="button1"
310
+ slot="buttons"
311
+ onclick="alert('test')"
312
+ >
313
+ <svg
314
+ slot="icon"
315
+ xmlns="http://www.w3.org/2000/svg"
316
+ height="24px"
317
+ viewBox="0 0 24 24"
318
+ width="24px"
319
+ fill="#000000"
320
+ >
321
+ <path d="M0 0h24v24H0V0z" fill="none" />
322
+ <path
323
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5.5-2.5l7.51-3.49L17.5 6.5 9.99 9.99 6.5 17.5zm5.5-6.6c.61 0 1.1.49 1.1 1.1s-.49 1.1-1.1 1.1-1.1-.49-1.1-1.1.49-1.1 1.1-1.1z"
324
+ />
325
+ </svg>
326
+ </ic-navigation-button>
327
+ <ic-navigation-item
328
+ slot="navigation"
329
+ label="Navigation"
330
+ href="/"
331
+ ></ic-navigation-item>
332
+ <ic-navigation-group
333
+ slot="navigation"
334
+ label="Navigation group"
335
+ expandable="true"
336
+ >
337
+ <ic-navigation-item
338
+ label="Navigation"
339
+ href="/"
340
+ ></ic-navigation-item>
341
+ <ic-navigation-item
342
+ label="Navigation"
343
+ href="/"
344
+ ></ic-navigation-item>
345
+ </ic-navigation-group>
346
+ </ic-top-navigation>
347
+ <main style="height: 100%">
348
+ <ic-section-container aligned="center" id="page-content">
349
+ <ic-typography
350
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit.
351
+ Vestibulum pharetra scelerisque arcu, vitae semper nisl rhoncus
352
+ ut. Vestibulum molestie enim at sollicitudin pellentesque. Proin
353
+ sit amet augue sit amet dui suscipit lobortis. Nullam at
354
+ consectetur ante. Suspendisse mollis ultricies porttitor. Nunc
355
+ laoreet leo tortor, ut tristique odio finibus a. In rutrum
356
+ convallis purus, vitae tristique tortor sagittis vel. Donec
357
+ dictum nunc a elit tristique, et facilisis est condimentum.
358
+ Pellentesque maximus nulla libero, nec auctor urna consequat
359
+ nec. Class aptent taciti sociosqu ad litora torquent per conubia
360
+ nostra, per inceptos himenaeos. In maximus velit a erat
361
+ volutpat, sit amet consequat velit rhoncus. Mauris pretium neque
362
+ eget ante consectetur consectetur. Morbi a consequat lectus.
363
+ Donec venenatis ultricies sem nec pulvinar. Fusce lacus augue,
364
+ laoreet id pretium id, efficitur nec leo.</ic-typography
365
+ >
366
+ <br />
367
+ <ic-skip-link
368
+ label="Skip to options"
369
+ target="page-content"
370
+ inline="true"
371
+ ></ic-skip-link>
372
+ <br />
373
+ <ic-typography
374
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit.
375
+ Vestibulum pharetra scelerisque arcu, vitae semper nisl rhoncus
376
+ ut. Vestibulum molestie enim at sollicitudin pellentesque. Proin
377
+ sit amet augue sit amet dui suscipit lobortis. Nullam at
378
+ consectetur ante. Suspendisse mollis ultricies porttitor. Nunc
379
+ laoreet leo tortor, ut tristique odio finibus a. In rutrum
380
+ convallis purus, vitae tristique tortor sagittis vel. Donec
381
+ dictum nunc a elit tristique, et facilisis est condimentum.
382
+ Pellentesque maximus nulla libero, nec auctor urna consequat
383
+ nec. Class aptent taciti sociosqu ad litora torquent per conubia
384
+ nostra, per inceptos himenaeos. In maximus velit a erat
385
+ volutpat, sit amet consequat velit rhoncus. Mauris pretium neque
386
+ eget ante consectetur consectetur. Morbi a consequat lectus.
387
+ Donec venenatis ultricies sem nec pulvinar. Fusce lacus augue,
388
+ laoreet id pretium id, efficitur nec leo.</ic-typography
389
+ >
390
+ <div id="options">
391
+ <ic-checkbox-group
392
+ label="This is a label"
393
+ required
394
+ name="group1"
395
+ >
396
+ <ic-checkbox
397
+ value="valueName1"
398
+ label="Unselected / Default"
399
+ ></ic-checkbox>
400
+ <ic-checkbox
401
+ value="valueName2"
402
+ label="Selected / Default"
403
+ checked
404
+ ></ic-checkbox>
405
+ <ic-checkbox
406
+ value="valueName3"
407
+ label="Unselected / Disabled"
408
+ Disabled
409
+ ></ic-checkbox>
410
+ </ic-checkbox-group>
411
+ </div>
412
+ </ic-section-container>
413
+ </main>
414
+ </div>
415
+ <ic-footer
416
+ aligned="full-width"
417
+ description="The ICDS is maintained by the Design Practice Team. If you've got a question or want to feedback,
418
+ please get in touch."
419
+ caption="All content is available under the Open Government Licence v3.0, except source code and code examples which are available under the MIT Licence."
420
+ ></ic-footer>
421
+ </div>`,
422
+
82
423
  name: "Inline",
424
+ parameters: {
425
+ layout: "fullscreen",
426
+ },
83
427
  };
84
428
 
85
429
  export const HideBackground = {
86
430
  render: () =>
87
431
  html`<ic-skip-link
88
- target="#page-content"
432
+ target="page-content"
89
433
  transparent-background="true"
90
434
  ></ic-skip-link>
91
435
  <ic-top-navigation app-title="Application Name">
@@ -113,7 +457,7 @@ const defaultArgs = {
113
457
  inline: false,
114
458
  label: "Skip to main content",
115
459
  monochrome: false,
116
- target: "#",
460
+ target: "",
117
461
  theme: "inherit",
118
462
  transparentBackground: false,
119
463
  };
@@ -144,7 +488,7 @@ export const Playground = {
144
488
  />
145
489
  </svg>
146
490
  </ic-top-navigation>
147
- <main id=${args.target.replace("#", "")}>Target element</main>
491
+ <main id=${args.target}>Target element</main>
148
492
  <ic-button>Should receive next focus</ic-button>`,
149
493
 
150
494
  args: defaultArgs,
@@ -472,7 +472,7 @@ video {
472
472
 
473
473
  .filled-warning {
474
474
  background-color: var(--ic-status-tag-warning);
475
- --ic-typography-color: var(--ic-status-tag-text-inverted);
475
+ --ic-typography-color: var(--ic-status-tag-filled-warning-text);
476
476
  }
477
477
 
478
478
  .filled-danger {
@@ -80,7 +80,7 @@
80
80
  }
81
81
 
82
82
  :host(.ic-step-compact) .disabled .heading {
83
- color: var(--ic-stepper-compact-step-title);
83
+ color: var(--ic-stepper-compact-step-title-disabled);
84
84
  }
85
85
 
86
86
  .info-line {
@@ -229,7 +229,7 @@
229
229
 
230
230
  .current .step-icon-inner {
231
231
  background-color: var(--ic-step-number-background-active);
232
- color: var(--ic-step-number-text);
232
+ color: var(--ic-step-number-text-current);
233
233
  }
234
234
 
235
235
  .disabled {
@@ -64,21 +64,22 @@ export class Step {
64
64
  statusIcon = (h("span", { key: '37abea1127139c235751e0e5fa159c0123e26045', class: "warning-icon step-icon", "aria-hidden": "true", innerHTML: warningIcon }));
65
65
  }
66
66
  // COMPACT STEP COMPONENT
67
- const compactStep = (h("div", { key: '0a05a9b7ae4878fb3b9be55a8f4f948fe4a27536', class: {
67
+ const compactStep = (h("div", { key: 'b085f35dc01eaca3182762eaa6b985fcdbcc36f6', class: {
68
68
  ["step"]: true,
69
69
  ["current"]: !!this.current,
70
70
  [`compact-step-${this.compactStepStyling}`]: !!this.compactStepStyling,
71
- } }, h("ic-loading-indicator", { key: '87ae2770c142889bf7565ead6cf7322df9d2d76d', class: {
71
+ ["disabled"]: this.type === "disabled" || this.compactStepStyling === "disabled",
72
+ } }, h("ic-loading-indicator", { key: '76d67bd6140d55727e79410263986a6a8b7e8f39', class: {
72
73
  "compact-step-progress-indicator": true,
73
74
  "not-required": this.type === "disabled" ||
74
75
  this.compactStepStyling === "disabled",
75
- }, "aria-hidden": "true", size: "small", "inner-label": this.stepNum, progress: this.progress }), h("div", { key: '84896f3f22cb2ea8fe8794be14b70341d8e23367', class: "heading-area" }, h("ic-typography", { key: 'd62bf42956fcf9ed02747d0a9cf34c0461a26b62', variant: "h4", class: "heading" }, this.heading), h("div", { key: 'b8e96361666f06ac48635cc88cdaf0b127059ed2', class: "info-line" }, h("ic-typography", { key: 'bebffda119401ad7441f247c915b7d535a7be967', variant: "caption", class: "step-num" }, `${this.stepNum} of ${this.lastStepNum}`, h("span", { key: 'd06f2369b86d90f4e8f97a6487235a084289705c', class: "visually-hidden" }, " steps")), (this.subheading ||
76
+ }, "aria-hidden": "true", size: "small", "inner-label": this.stepNum, progress: this.progress }), h("div", { key: 'e1a0ab7ef462c6f9db62d1d5cc21518230c31531', class: "heading-area" }, h("ic-typography", { key: 'cebf670137674ac37747fea2e320d36a465cac42', variant: "h4", class: "heading" }, this.heading), h("div", { key: 'c9a9a5ae0bef717bbdb1cd690596dac06b6a73e2', class: "info-line" }, h("ic-typography", { key: '311760b3af071f4d9864954fb727a9c9b1c7c00d', variant: "caption", class: "step-num" }, `${this.stepNum} of ${this.lastStepNum}`, h("span", { key: '87135f130983c602f8909da57c12c2ae02d3655d', class: "visually-hidden" }, " steps")), (this.subheading ||
76
77
  this.type === "completed" ||
77
78
  this.type === "disabled" ||
78
79
  (this.variant === "compact" &&
79
80
  !!this.compactStepStyling &&
80
81
  this.compactStepStyling !== "active") ||
81
- !!this.status) && (h("div", { key: '767ada3bd54f2ace302dc35bade3820b303beaeb', class: "step-status" }, statusIcon !== undefined && statusIcon, (this.subheading || stepType) && (h("ic-typography", { key: 'd32d553cbc9ed7626bd31f66376f40fc3bd5cafc', variant: "caption" }, this.subheading !== null && isPropDefined(this.subheading)
82
+ !!this.status) && (h("div", { key: '0a5a230fd701a8a589dc774d7d5a11ab4a8f22ec', class: "step-status" }, statusIcon !== undefined && statusIcon, (this.subheading || stepType) && (h("ic-typography", { key: '60f32a581e356b2b86616c0a4d6895e2a765e661', variant: "caption" }, this.subheading !== null && isPropDefined(this.subheading)
82
83
  ? this.subheading
83
84
  : this.type === "disabled" ||
84
85
  (this.variant === "compact" &&
@@ -91,26 +92,26 @@ export class Step {
91
92
  // ICON FOR DEFAULT STEP
92
93
  let icon;
93
94
  if (this.type !== "completed") {
94
- icon = (h("ic-typography", { key: '460d428fc84a424c2deb2bd19673bac9838fc83c', variant: "subtitle-small" }, h("span", { key: '2f9976552109cb2369374d045da5695d0cca48a9', class: "step-icon-inner", "aria-hidden": "true" }, this.stepNum)));
95
+ icon = (h("ic-typography", { key: '316ca02b237660b9ce7dfc2cfa7ee7a9a405850f', variant: "subtitle-small" }, h("span", { key: '28c285e0de19f766bde7540a84a7b6f92f2722f6', class: "step-icon-inner", "aria-hidden": "true" }, this.stepNum)));
95
96
  }
96
97
  else {
97
- icon = (h("div", { key: '6e6d3994d3b43e7aa1b516ffb8fada92af8df313', class: "step-icon-inner", "aria-hidden": "true" }, h("span", { key: 'b45fb9429fcdf1158944f8e3f0912b5d586f879f', class: "check-icon", innerHTML: checkIcon })));
98
+ icon = (h("div", { key: '8a57441521368e3e48abda6607fa7ed834b76539', class: "step-icon-inner", "aria-hidden": "true" }, h("span", { key: '244a4c8979621768867cb1b876ad41c96368f048', class: "check-icon", innerHTML: checkIcon })));
98
99
  }
99
100
  // STEP CONNECT FOR DEFAULT STEP
100
- const partialBar = this.type === "current" && (h("div", { key: 'df1360298cadc4fe9fcc0b2962505ca31f77fdd2', class: "step-connect-inner" }));
101
- const finalStep = !this.lastStep && (h("div", { key: '946927672f4115daf7ef35bb577f12ae1e8de66f', class: {
101
+ const partialBar = this.type === "current" && (h("div", { key: 'e0e0134d5e347c12d2db12c7a7c1fd2f796e680a', class: "step-connect-inner" }));
102
+ const finalStep = !this.lastStep && (h("div", { key: '87b3f5541a9fa51784d054ab418ffd270aa5d131', class: {
102
103
  ["step-connect"]: true,
103
104
  ["aligned-full-width"]: !!(((_a = this.el.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains("ic-stepper-default")) &&
104
105
  !this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
105
106
  } }, partialBar));
106
107
  // DEFAULT STEP COMPONENT
107
- const defaultStep = (h("div", { key: '637edc67a54d7edab0bbf31c7e86e623f78f9966', class: {
108
+ const defaultStep = (h("div", { key: '942e50008de22ed3bf9cfc6f5878fe20780224d4', class: {
108
109
  ["step"]: true,
109
110
  [`${this.type}`]: true,
110
- } }, h("div", { key: '961519160c7998023c7646cb0c52036951aa6316', class: "step-top" }, h("div", { key: '2764963722ae57aad38766d26a5fd13e179aac61', class: "step-icon" }, icon), finalStep), (this.heading || this.subheading || this.status) && (h("div", { key: '6ebf91f7c29e29593d9fbaf78c0aa7db7dbb142e', class: "heading-area" }, this.heading && (h("ic-typography", { key: 'd299782ac1b0ae99f4f3a95dc478a49f27327b75', variant: "subtitle-large", class: "heading" }, this.heading)), this.heading && (this.subheading || this.status) && (h("ic-typography", { key: '9c20efcfae784881552c48f9a4cd779c24126ae6', variant: "caption", class: "subheading" }, this.subheading !== null && isPropDefined(this.subheading)
111
+ } }, h("div", { key: 'ea7466090610c4ca42426a95c5b5eea07c0a3e20', class: "step-top" }, h("div", { key: '8e7a36165cdb25aa4939e7dad24211b6f42deb9b', class: "step-icon" }, icon), finalStep), (this.heading || this.subheading || this.status) && (h("div", { key: 'd6e7a5a41587217e8e29390f7fdccc06c2c772d8', class: "heading-area" }, this.heading && (h("ic-typography", { key: '235524fbe7fc0dd3991dfef222bdf29dfe80bedc', variant: "subtitle-large", class: "heading" }, this.heading)), this.heading && (this.subheading || this.status) && (h("ic-typography", { key: '2d29260629ca84280981ceedc7196fd0be347c3b', variant: "caption", class: "subheading" }, this.subheading !== null && isPropDefined(this.subheading)
111
112
  ? this.subheading
112
113
  : stepStatus))))));
113
- return (h(Host, { key: 'c12621f9fa0f127a55e2c72b6f9ff34a6a6be5a9', role: "listitem", "aria-label": `Step ${this.stepNum}${ariaLabel}`, "aria-current": (this.current || this.type === "current") && "step", class: {
114
+ return (h(Host, { key: 'c8b18833e54cb4cf0eac30b3f3b487a53ef9392f', role: "listitem", "aria-label": `Step ${this.stepNum}${ariaLabel}`, "aria-current": (this.current || this.type === "current") && "step", class: {
114
115
  ["aligned-full-width"]: !!(((_b = this.el.parentElement) === null || _b === void 0 ? void 0 : _b.classList.contains("ic-stepper-default")) &&
115
116
  !this.el.parentElement.classList.contains("ic-stepper-aligned-left")),
116
117
  [`ic-step-${this.variant}`]: true,
@@ -1 +1 @@
1
- {"version":3,"file":"ic-step.js","sourceRoot":"","sources":["../../../src/components/ic-step/ic-step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,SAAS,MAAM,6BAA6B,CAAC;AACpD,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQpD,MAAM,OAAO,IAAI;IALjB;QAaE;;WAEG;QACsB,YAAO,GAAa,KAAK,CAAC;QA0CnD;;WAEG;QACK,UAAK,GAAiB,SAAS,CAAC;QAOxC;;WAEG;QACK,SAAI,GAAiB,QAAQ,CAAC;KA6NvC;IA1NC,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;aAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, Watch } from \"@stencil/core\";\nimport checkIcon from \"../../assets/check-icon.svg\";\nimport warningIcon from \"../../assets/warning-icon-outline.svg\";\nimport { IcStepVariants, IcStepStatuses, IcStepTypes } from \"./ic-step.types\";\nimport { isPropDefined } from \"../../utils/helpers\";\nimport { IcThemeMode } from \"../../utils/types\";\n\n@Component({\n tag: \"ic-step\",\n styleUrl: \"ic-step.css\",\n shadow: true,\n})\nexport class Step {\n @Element() el: HTMLIcStepElement;\n\n /**\n * @internal If a compact stepper is being used, this sets the styling of the step.\n */\n @Prop() compactStepStyling?: IcStepTypes;\n\n /**\n * @internal If `true`, and a compact stepper is being used, the current step will be the only step in view.\n */\n @Prop({ mutable: true }) current?: boolean = false;\n\n /**\n * @internal If `true`, the step will be marked as being the last one in the series. This is managed by ic-stepper.\n */\n @Prop() lastStep!: boolean;\n\n /**\n * @internal The step number of the final step. This is managed by ic-stepper.\n */\n @Prop() lastStepNum?: number;\n\n /**\n * @internal The name of the next step. This is managed by ic-stepper.\n */\n @Prop() nextStepHeading?: string;\n\n /**\n * @internal The progress of the next step, calculated by dividing the current step number by the total number of steps. This is managed by ic-stepper.\n */\n @Prop() progress?: number;\n\n /**\n * @internal The step number, managed by ic-stepper.\n */\n @Prop() stepNum?: number;\n\n /**\n * The status of the step. Use this prop to display a status message on the step if it is required or optional.\n */\n @Prop() status?: IcStepStatuses;\n\n /**\n * Additional information about the step. Use this prop to override the default step status messaging displayed when selecting a step type or step status.\n */\n @Prop() subheading?: string;\n\n /**\n * The title of the step within the stepper.\n */\n @Prop() heading?: string;\n\n /**\n * @internal Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * @internal The variant of the step. This is managed by ic-stepper.\n */\n @Prop() variant!: IcStepVariants;\n\n /**\n * The state of the step within the stepper.\n */\n @Prop() type?: IcStepTypes = \"active\";\n\n @Watch(\"type\")\n typeChangeHandler(): void {\n if (this.variant === \"compact\" && this.type === \"current\") {\n this.current = true;\n } else {\n this.current = false;\n }\n }\n\n render() {\n // ARIA LABEL\n let ariaLabel = \"\";\n\n if (this.type === \"completed\") {\n ariaLabel = \". Completed step\";\n } else if (this.type === \"disabled\") {\n ariaLabel = \". Non-required step\";\n } else if (this.status === \"required\") {\n ariaLabel = \". Required step\";\n } else if (this.status === \"optional\") {\n ariaLabel = \". Optional step\";\n }\n\n // STEP STATUS\n let stepStatus;\n if (this.status && isPropDefined(this.status)) {\n stepStatus = this.status[0].toUpperCase() + this.status.slice(1);\n }\n\n // STEP TYPE\n let stepType;\n if (this.type === \"disabled\" || this.compactStepStyling === \"disabled\") {\n stepType = \"Not required\";\n } else if (this.compactStepStyling === \"completed\") {\n stepType = \"Completed\";\n }\n\n // STATUS ICON FOR COMPACT STEP\n let statusIcon;\n if (this.type === \"completed\" || this.compactStepStyling === \"completed\") {\n statusIcon = (\n <span\n class=\"check-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={checkIcon}\n ></span>\n );\n } else if (\n this.type === \"disabled\" ||\n this.compactStepStyling === \"disabled\"\n ) {\n statusIcon = (\n <span\n class=\"warning-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={warningIcon}\n ></span>\n );\n }\n\n // COMPACT STEP COMPONENT\n const compactStep = (\n <div\n class={{\n [\"step\"]: true,\n [\"current\"]: !!this.current,\n [`compact-step-${this.compactStepStyling}`]:\n !!this.compactStepStyling,\n }}\n >\n <ic-loading-indicator\n class={{\n \"compact-step-progress-indicator\": true,\n \"not-required\":\n this.type === \"disabled\" ||\n this.compactStepStyling === \"disabled\",\n }}\n aria-hidden=\"true\"\n size=\"small\"\n inner-label={this.stepNum}\n progress={this.progress}\n ></ic-loading-indicator>\n <div class=\"heading-area\">\n <ic-typography variant=\"h4\" class=\"heading\">\n {this.heading}\n </ic-typography>\n <div class=\"info-line\">\n <ic-typography variant=\"caption\" class=\"step-num\">\n {`${this.stepNum} of ${this.lastStepNum}`}\n <span class=\"visually-hidden\"> steps</span>\n </ic-typography>\n {(this.subheading ||\n this.type === \"completed\" ||\n this.type === \"disabled\" ||\n (this.variant === \"compact\" &&\n !!this.compactStepStyling &&\n this.compactStepStyling !== \"active\") ||\n !!this.status) && (\n <div class=\"step-status\">\n {statusIcon !== undefined && statusIcon}\n {(this.subheading || stepType) && (\n <ic-typography variant=\"caption\">\n {this.subheading !== null && isPropDefined(this.subheading)\n ? this.subheading\n : this.type === \"disabled\" ||\n (this.variant === \"compact\" &&\n this.compactStepStyling === \"disabled\") ||\n this.type === \"completed\" ||\n (this.variant === \"compact\" &&\n this.compactStepStyling === \"completed\")\n ? stepType\n : this.status && stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n {this.lastStep ? (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n Last step\n </ic-typography>\n ) : (\n isPropDefined(this.nextStepHeading) && (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n Next<span class=\"visually-hidden\"> step is</span>:{\" \"}\n {this.nextStepHeading}\n </ic-typography>\n )\n )}\n </div>\n </div>\n );\n\n // ICON FOR DEFAULT STEP\n let icon;\n if (this.type !== \"completed\") {\n icon = (\n <ic-typography variant=\"subtitle-small\">\n <span class=\"step-icon-inner\" aria-hidden=\"true\">\n {this.stepNum}\n </span>\n </ic-typography>\n );\n } else {\n icon = (\n <div class=\"step-icon-inner\" aria-hidden=\"true\">\n <span class=\"check-icon\" innerHTML={checkIcon}></span>\n </div>\n );\n }\n\n // STEP CONNECT FOR DEFAULT STEP\n const partialBar = this.type === \"current\" && (\n <div class=\"step-connect-inner\"></div>\n );\n\n const finalStep = !this.lastStep && (\n <div\n class={{\n [\"step-connect\"]: true,\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n }}\n >\n {partialBar}\n </div>\n );\n\n // DEFAULT STEP COMPONENT\n const defaultStep = (\n <div\n class={{\n [\"step\"]: true,\n [`${this.type}`]: true,\n }}\n >\n <div class=\"step-top\">\n <div class=\"step-icon\">{icon}</div>\n {finalStep}\n </div>\n {(this.heading || this.subheading || this.status) && (\n <div class=\"heading-area\">\n {this.heading && (\n <ic-typography variant=\"subtitle-large\" class=\"heading\">\n {this.heading}\n </ic-typography>\n )}\n {this.heading && (this.subheading || this.status) && (\n <ic-typography variant=\"caption\" class=\"subheading\">\n {this.subheading !== null && isPropDefined(this.subheading)\n ? this.subheading\n : stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n );\n\n return (\n <Host\n role=\"listitem\"\n aria-label={`Step ${this.stepNum}${ariaLabel}`}\n aria-current={(this.current || this.type === \"current\") && \"step\"}\n class={{\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n [`ic-step-${this.variant}`]: true,\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n {this.variant === \"compact\" ? compactStep : defaultStep}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-step.js","sourceRoot":"","sources":["../../../src/components/ic-step/ic-step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,SAAS,MAA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AAC,CACxB,CAAA,MAAA,IAAI,CAAC,EAAE,CAAC,aAAa,0CAAE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC;oBAC/D,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CACrE;gBACD,CAAC,WAAW,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;gBACjC,CAAC,YAAY,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS;aACrD,IAEA,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAClD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, Watch } from \"@stencil/core\";\nimport checkIcon from \"../../assets/check-icon.svg\";\nimport warningIcon from \"../../assets/warning-icon-outline.svg\";\nimport { IcStepVariants, IcStepStatuses, IcStepTypes } from \"./ic-step.types\";\nimport { isPropDefined } from \"../../utils/helpers\";\nimport { IcThemeMode } from \"../../utils/types\";\n\n@Component({\n tag: \"ic-step\",\n styleUrl: \"ic-step.css\",\n shadow: true,\n})\nexport class Step {\n @Element() el: HTMLIcStepElement;\n\n /**\n * @internal If a compact stepper is being used, this sets the styling of the step.\n */\n @Prop() compactStepStyling?: IcStepTypes;\n\n /**\n * @internal If `true`, and a compact stepper is being used, the current step will be the only step in view.\n */\n @Prop({ mutable: true }) current?: boolean = false;\n\n /**\n * @internal If `true`, the step will be marked as being the last one in the series. This is managed by ic-stepper.\n */\n @Prop() lastStep!: boolean;\n\n /**\n * @internal The step number of the final step. This is managed by ic-stepper.\n */\n @Prop() lastStepNum?: number;\n\n /**\n * @internal The name of the next step. This is managed by ic-stepper.\n */\n @Prop() nextStepHeading?: string;\n\n /**\n * @internal The progress of the next step, calculated by dividing the current step number by the total number of steps. This is managed by ic-stepper.\n */\n @Prop() progress?: number;\n\n /**\n * @internal The step number, managed by ic-stepper.\n */\n @Prop() stepNum?: number;\n\n /**\n * The status of the step. Use this prop to display a status message on the step if it is required or optional.\n */\n @Prop() status?: IcStepStatuses;\n\n /**\n * Additional information about the step. Use this prop to override the default step status messaging displayed when selecting a step type or step status.\n */\n @Prop() subheading?: string;\n\n /**\n * The title of the step within the stepper.\n */\n @Prop() heading?: string;\n\n /**\n * @internal Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * @internal The variant of the step. This is managed by ic-stepper.\n */\n @Prop() variant!: IcStepVariants;\n\n /**\n * The state of the step within the stepper.\n */\n @Prop() type?: IcStepTypes = \"active\";\n\n @Watch(\"type\")\n typeChangeHandler(): void {\n if (this.variant === \"compact\" && this.type === \"current\") {\n this.current = true;\n } else {\n this.current = false;\n }\n }\n\n render() {\n // ARIA LABEL\n let ariaLabel = \"\";\n\n if (this.type === \"completed\") {\n ariaLabel = \". Completed step\";\n } else if (this.type === \"disabled\") {\n ariaLabel = \". Non-required step\";\n } else if (this.status === \"required\") {\n ariaLabel = \". Required step\";\n } else if (this.status === \"optional\") {\n ariaLabel = \". Optional step\";\n }\n\n // STEP STATUS\n let stepStatus;\n if (this.status && isPropDefined(this.status)) {\n stepStatus = this.status[0].toUpperCase() + this.status.slice(1);\n }\n\n // STEP TYPE\n let stepType;\n if (this.type === \"disabled\" || this.compactStepStyling === \"disabled\") {\n stepType = \"Not required\";\n } else if (this.compactStepStyling === \"completed\") {\n stepType = \"Completed\";\n }\n\n // STATUS ICON FOR COMPACT STEP\n let statusIcon;\n if (this.type === \"completed\" || this.compactStepStyling === \"completed\") {\n statusIcon = (\n <span\n class=\"check-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={checkIcon}\n ></span>\n );\n } else if (\n this.type === \"disabled\" ||\n this.compactStepStyling === \"disabled\"\n ) {\n statusIcon = (\n <span\n class=\"warning-icon step-icon\"\n aria-hidden=\"true\"\n innerHTML={warningIcon}\n ></span>\n );\n }\n\n // COMPACT STEP COMPONENT\n const compactStep = (\n <div\n class={{\n [\"step\"]: true,\n [\"current\"]: !!this.current,\n [`compact-step-${this.compactStepStyling}`]:\n !!this.compactStepStyling,\n [\"disabled\"]:\n this.type === \"disabled\" || this.compactStepStyling === \"disabled\",\n }}\n >\n <ic-loading-indicator\n class={{\n \"compact-step-progress-indicator\": true,\n \"not-required\":\n this.type === \"disabled\" ||\n this.compactStepStyling === \"disabled\",\n }}\n aria-hidden=\"true\"\n size=\"small\"\n inner-label={this.stepNum}\n progress={this.progress}\n ></ic-loading-indicator>\n <div class=\"heading-area\">\n <ic-typography variant=\"h4\" class=\"heading\">\n {this.heading}\n </ic-typography>\n <div class=\"info-line\">\n <ic-typography variant=\"caption\" class=\"step-num\">\n {`${this.stepNum} of ${this.lastStepNum}`}\n <span class=\"visually-hidden\"> steps</span>\n </ic-typography>\n {(this.subheading ||\n this.type === \"completed\" ||\n this.type === \"disabled\" ||\n (this.variant === \"compact\" &&\n !!this.compactStepStyling &&\n this.compactStepStyling !== \"active\") ||\n !!this.status) && (\n <div class=\"step-status\">\n {statusIcon !== undefined && statusIcon}\n {(this.subheading || stepType) && (\n <ic-typography variant=\"caption\">\n {this.subheading !== null && isPropDefined(this.subheading)\n ? this.subheading\n : this.type === \"disabled\" ||\n (this.variant === \"compact\" &&\n this.compactStepStyling === \"disabled\") ||\n this.type === \"completed\" ||\n (this.variant === \"compact\" &&\n this.compactStepStyling === \"completed\")\n ? stepType\n : this.status && stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n {this.lastStep ? (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n Last step\n </ic-typography>\n ) : (\n isPropDefined(this.nextStepHeading) && (\n <ic-typography variant=\"subtitle-small\" class=\"next-step\">\n Next<span class=\"visually-hidden\"> step is</span>:{\" \"}\n {this.nextStepHeading}\n </ic-typography>\n )\n )}\n </div>\n </div>\n );\n\n // ICON FOR DEFAULT STEP\n let icon;\n if (this.type !== \"completed\") {\n icon = (\n <ic-typography variant=\"subtitle-small\">\n <span class=\"step-icon-inner\" aria-hidden=\"true\">\n {this.stepNum}\n </span>\n </ic-typography>\n );\n } else {\n icon = (\n <div class=\"step-icon-inner\" aria-hidden=\"true\">\n <span class=\"check-icon\" innerHTML={checkIcon}></span>\n </div>\n );\n }\n\n // STEP CONNECT FOR DEFAULT STEP\n const partialBar = this.type === \"current\" && (\n <div class=\"step-connect-inner\"></div>\n );\n\n const finalStep = !this.lastStep && (\n <div\n class={{\n [\"step-connect\"]: true,\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n }}\n >\n {partialBar}\n </div>\n );\n\n // DEFAULT STEP COMPONENT\n const defaultStep = (\n <div\n class={{\n [\"step\"]: true,\n [`${this.type}`]: true,\n }}\n >\n <div class=\"step-top\">\n <div class=\"step-icon\">{icon}</div>\n {finalStep}\n </div>\n {(this.heading || this.subheading || this.status) && (\n <div class=\"heading-area\">\n {this.heading && (\n <ic-typography variant=\"subtitle-large\" class=\"heading\">\n {this.heading}\n </ic-typography>\n )}\n {this.heading && (this.subheading || this.status) && (\n <ic-typography variant=\"caption\" class=\"subheading\">\n {this.subheading !== null && isPropDefined(this.subheading)\n ? this.subheading\n : stepStatus}\n </ic-typography>\n )}\n </div>\n )}\n </div>\n );\n\n return (\n <Host\n role=\"listitem\"\n aria-label={`Step ${this.stepNum}${ariaLabel}`}\n aria-current={(this.current || this.type === \"current\") && \"step\"}\n class={{\n [\"aligned-full-width\"]: !!(\n this.el.parentElement?.classList.contains(\"ic-stepper-default\") &&\n !this.el.parentElement.classList.contains(\"ic-stepper-aligned-left\")\n ),\n [`ic-step-${this.variant}`]: true,\n [`ic-theme-${this.theme}`]: this.theme !== \"inherit\",\n }}\n >\n {this.variant === \"compact\" ? compactStep : defaultStep}\n </Host>\n );\n }\n}\n"]}
@@ -68,7 +68,11 @@ export const CustomStepper = {
68
68
  subheading="Optional subtitle that is long and should wrap"
69
69
  type="current"
70
70
  ></ic-step>
71
- <ic-step heading="Third" type="disabled"></ic-step>
71
+ <ic-step
72
+ heading="Third"
73
+ subheading="Optional subtitle"
74
+ type="disabled"
75
+ ></ic-step>
72
76
  <ic-step
73
77
  heading="Fourth title that is long and should wrap"
74
78
  subheading="Optional Subtitle"