@ukic/web-components 2.1.0-beta.1 → 2.1.0-beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (502) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/ic-alert.cjs.entry.js +2 -0
  3. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-back-to-top.cjs.entry.js +18 -8
  5. package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
  7. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  8. package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
  9. package/dist/cjs/ic-button_3.cjs.entry.js +29 -11
  10. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
  13. package/dist/cjs/ic-checkbox.cjs.entry.js +2 -0
  14. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-chip.cjs.entry.js +66 -0
  16. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -0
  17. package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ic-divider.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-footer-link-group.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-footer-link.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-footer.cjs.entry.js +2 -2
  26. package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  28. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +19 -18
  29. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  30. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
  31. package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
  33. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ic-navigation-item.cjs.entry.js +2 -2
  35. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  36. package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
  37. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  39. package/dist/cjs/ic-radio-option.cjs.entry.js +10 -1
  40. package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
  41. package/dist/cjs/ic-search-bar.cjs.entry.js +16 -2
  42. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  43. package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
  44. package/dist/cjs/ic-select.cjs.entry.js +2 -7
  45. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  46. package/dist/cjs/ic-side-navigation.cjs.entry.js +8 -4
  47. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  48. package/dist/cjs/ic-skeleton.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
  50. package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
  51. package/dist/cjs/ic-step.cjs.entry.js +101 -13
  52. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  53. package/dist/cjs/ic-stepper.cjs.entry.js +161 -40
  54. package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
  55. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
  57. package/dist/cjs/ic-tab-context.cjs.entry.js +6 -1
  58. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
  60. package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
  61. package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
  62. package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-theme.cjs.entry.js +2 -2
  64. package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
  65. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  66. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  67. package/dist/cjs/index-3ef30d9d.js +4 -0
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/collection/assets/dismiss-icon.svg +3 -0
  70. package/dist/collection/assets/warning-icon-outline.svg +3 -0
  71. package/dist/collection/collection-manifest.json +1 -0
  72. package/dist/collection/components/ic-alert/ic-alert.js +27 -8
  73. package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
  74. package/dist/collection/components/ic-back-to-top/ic-back-to-top.css +1 -1
  75. package/dist/collection/components/ic-back-to-top/ic-back-to-top.js +17 -7
  76. package/dist/collection/components/ic-back-to-top/ic-back-to-top.js.map +1 -1
  77. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.css +1 -1
  78. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +4 -4
  79. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js.map +1 -1
  80. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +2 -2
  81. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
  82. package/dist/collection/components/ic-button/ic-button.js +13 -13
  83. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  84. package/dist/collection/components/ic-card/ic-card.js +10 -10
  85. package/dist/collection/components/ic-card/ic-card.js.map +1 -1
  86. package/dist/collection/components/ic-checkbox/ic-checkbox.js +29 -10
  87. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  88. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +10 -10
  89. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
  90. package/dist/collection/components/ic-chip/ic-chip.css +595 -0
  91. package/dist/collection/components/ic-chip/ic-chip.js +199 -0
  92. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -0
  93. package/dist/collection/components/ic-chip/ic-chip.test.a11y.js +11 -0
  94. package/dist/collection/components/ic-chip/ic-chip.test.a11y.js.map +1 -0
  95. package/dist/collection/components/ic-chip/ic-chip.types.js +2 -0
  96. package/dist/collection/components/ic-chip/ic-chip.types.js.map +1 -0
  97. package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +5 -5
  98. package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
  99. package/dist/collection/components/ic-data-entity/ic-data-entity.js +2 -2
  100. package/dist/collection/components/ic-data-entity/ic-data-entity.js.map +1 -1
  101. package/dist/collection/components/ic-data-row/ic-data-row.css +12 -0
  102. package/dist/collection/components/ic-data-row/ic-data-row.js +3 -3
  103. package/dist/collection/components/ic-data-row/ic-data-row.js.map +1 -1
  104. package/dist/collection/components/ic-divider/ic-divider.js +1 -1
  105. package/dist/collection/components/ic-divider/ic-divider.js.map +1 -1
  106. package/dist/collection/components/ic-footer/ic-footer.js +19 -16
  107. package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
  108. package/dist/collection/components/ic-footer-link/ic-footer-link.css +7 -1
  109. package/dist/collection/components/ic-footer-link/ic-footer-link.js +2 -2
  110. package/dist/collection/components/ic-footer-link/ic-footer-link.js.map +1 -1
  111. package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.js +3 -3
  112. package/dist/collection/components/ic-footer-link-group/ic-footer-link-group.js.map +1 -1
  113. package/dist/collection/components/ic-hero/ic-hero.js +10 -10
  114. package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
  115. package/dist/collection/components/ic-input-component-container/ic-input-component-container.css +0 -2
  116. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +8 -8
  117. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
  118. package/dist/collection/components/ic-input-container/ic-input-container.js +2 -2
  119. package/dist/collection/components/ic-input-container/ic-input-container.js.map +1 -1
  120. package/dist/collection/components/ic-input-label/ic-input-label.js +8 -8
  121. package/dist/collection/components/ic-input-label/ic-input-label.js.map +1 -1
  122. package/dist/collection/components/ic-input-validation/ic-input-validation.js +5 -5
  123. package/dist/collection/components/ic-input-validation/ic-input-validation.js.map +1 -1
  124. package/dist/collection/components/ic-link/ic-link.js +7 -7
  125. package/dist/collection/components/ic-link/ic-link.js.map +1 -1
  126. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.css +38 -2
  127. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +45 -9
  128. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
  129. package/dist/collection/components/ic-menu/ic-menu.css +1 -1
  130. package/dist/collection/components/ic-menu/ic-menu.js +35 -31
  131. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  132. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +5 -5
  133. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
  134. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +4 -4
  135. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
  136. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +10 -10
  137. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
  138. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js +3 -3
  139. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js.map +1 -1
  140. package/dist/collection/components/ic-page-header/ic-page-header.css +1 -0
  141. package/dist/collection/components/ic-page-header/ic-page-header.js +8 -8
  142. package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
  143. package/dist/collection/components/ic-radio-group/ic-radio-group.js +10 -10
  144. package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
  145. package/dist/collection/components/ic-radio-option/ic-radio-option.js +34 -17
  146. package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
  147. package/dist/collection/components/ic-search-bar/ic-search-bar.js +51 -30
  148. package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
  149. package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
  150. package/dist/collection/components/ic-section-container/ic-section-container.js.map +1 -1
  151. package/dist/collection/components/ic-select/ic-select.css +1 -1
  152. package/dist/collection/components/ic-select/ic-select.js +19 -24
  153. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  154. package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +5 -13
  155. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +24 -17
  156. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  157. package/dist/collection/components/ic-skeleton/ic-skeleton.css +1 -1
  158. package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
  159. package/dist/collection/components/ic-skeleton/ic-skeleton.js.map +1 -1
  160. package/dist/collection/components/ic-status-tag/ic-status-tag.js +1 -1
  161. package/dist/collection/components/ic-status-tag/ic-status-tag.js.map +1 -1
  162. package/dist/collection/components/ic-step/ic-step.css +120 -24
  163. package/dist/collection/components/ic-step/ic-step.js +269 -28
  164. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  165. package/dist/collection/components/ic-step/ic-step.types.js.map +1 -1
  166. package/dist/collection/components/ic-stepper/ic-stepper-test-examples.js +74 -0
  167. package/dist/collection/components/ic-stepper/ic-stepper-test-examples.js.map +1 -0
  168. package/dist/collection/components/ic-stepper/ic-stepper.css +15 -1
  169. package/dist/collection/components/ic-stepper/ic-stepper.js +206 -39
  170. package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
  171. package/dist/collection/components/ic-stepper/ic-stepper.test.a11y.js +13 -1
  172. package/dist/collection/components/ic-stepper/ic-stepper.test.a11y.js.map +1 -1
  173. package/dist/collection/components/ic-switch/ic-switch.css +1 -1
  174. package/dist/collection/components/ic-switch/ic-switch.js +7 -7
  175. package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
  176. package/dist/collection/components/ic-tab/ic-tab.js +9 -6
  177. package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
  178. package/dist/collection/components/ic-tab-context/ic-tab-context.js +31 -4
  179. package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
  180. package/dist/collection/components/ic-tab-group/ic-tab-group.js +4 -4
  181. package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
  182. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
  183. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
  184. package/dist/collection/components/ic-text-field/ic-text-field.js +28 -28
  185. package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
  186. package/dist/collection/components/ic-theme/ic-theme.js +9 -6
  187. package/dist/collection/components/ic-theme/ic-theme.js.map +1 -1
  188. package/dist/collection/components/ic-tooltip/ic-tooltip.css +1 -1
  189. package/dist/collection/components/ic-tooltip/ic-tooltip.js +22 -1
  190. package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
  191. package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +1 -1
  192. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +7 -7
  193. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
  194. package/dist/collection/components/ic-typography/ic-typography.js +1 -1
  195. package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
  196. package/dist/collection/testspec.setup.js +8 -0
  197. package/dist/collection/testspec.setup.js.map +1 -1
  198. package/dist/components/ic-alert.js +3 -1
  199. package/dist/components/ic-alert.js.map +1 -1
  200. package/dist/components/ic-back-to-top.js +18 -8
  201. package/dist/components/ic-back-to-top.js.map +1 -1
  202. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  203. package/dist/components/ic-breadcrumb2.js +1 -1
  204. package/dist/components/ic-breadcrumb2.js.map +1 -1
  205. package/dist/components/ic-button2.js +3 -3
  206. package/dist/components/ic-button2.js.map +1 -1
  207. package/dist/components/ic-card.js +1 -1
  208. package/dist/components/ic-card.js.map +1 -1
  209. package/dist/components/ic-checkbox-group.js +1 -1
  210. package/dist/components/ic-checkbox-group.js.map +1 -1
  211. package/dist/components/ic-checkbox.js +2 -0
  212. package/dist/components/ic-checkbox.js.map +1 -1
  213. package/dist/components/ic-chip.d.ts +11 -0
  214. package/dist/components/ic-chip.js +99 -0
  215. package/dist/components/ic-chip.js.map +1 -0
  216. package/dist/components/ic-classification-banner.js.map +1 -1
  217. package/dist/components/ic-data-entity.js.map +1 -1
  218. package/dist/components/ic-data-row.js +1 -1
  219. package/dist/components/ic-data-row.js.map +1 -1
  220. package/dist/components/ic-divider2.js +1 -1
  221. package/dist/components/ic-divider2.js.map +1 -1
  222. package/dist/components/ic-footer-link-group.js +1 -1
  223. package/dist/components/ic-footer-link-group.js.map +1 -1
  224. package/dist/components/ic-footer-link.js +2 -2
  225. package/dist/components/ic-footer-link.js.map +1 -1
  226. package/dist/components/ic-footer.js +3 -3
  227. package/dist/components/ic-footer.js.map +1 -1
  228. package/dist/components/ic-hero.js +1 -1
  229. package/dist/components/ic-hero.js.map +1 -1
  230. package/dist/components/ic-input-component-container2.js +1 -1
  231. package/dist/components/ic-input-component-container2.js.map +1 -1
  232. package/dist/components/ic-input-container2.js.map +1 -1
  233. package/dist/components/ic-input-label2.js.map +1 -1
  234. package/dist/components/ic-input-validation2.js.map +1 -1
  235. package/dist/components/ic-link2.js +1 -1
  236. package/dist/components/ic-link2.js.map +1 -1
  237. package/dist/components/ic-loading-indicator2.js +24 -7
  238. package/dist/components/ic-loading-indicator2.js.map +1 -1
  239. package/dist/components/ic-menu2.js +18 -17
  240. package/dist/components/ic-menu2.js.map +1 -1
  241. package/dist/components/ic-navigation-button.js +1 -1
  242. package/dist/components/ic-navigation-button.js.map +1 -1
  243. package/dist/components/ic-navigation-group.js +1 -1
  244. package/dist/components/ic-navigation-group.js.map +1 -1
  245. package/dist/components/ic-navigation-item.js +3 -3
  246. package/dist/components/ic-navigation-item.js.map +1 -1
  247. package/dist/components/ic-navigation-menu2.js +1 -1
  248. package/dist/components/ic-navigation-menu2.js.map +1 -1
  249. package/dist/components/ic-page-header.js.map +1 -1
  250. package/dist/components/ic-radio-group.js +1 -1
  251. package/dist/components/ic-radio-group.js.map +1 -1
  252. package/dist/components/ic-radio-option.js +10 -1
  253. package/dist/components/ic-radio-option.js.map +1 -1
  254. package/dist/components/ic-search-bar.js +18 -3
  255. package/dist/components/ic-search-bar.js.map +1 -1
  256. package/dist/components/ic-section-container2.js.map +1 -1
  257. package/dist/components/ic-select.js +2 -7
  258. package/dist/components/ic-select.js.map +1 -1
  259. package/dist/components/ic-side-navigation.js +9 -5
  260. package/dist/components/ic-side-navigation.js.map +1 -1
  261. package/dist/components/ic-skeleton.js +1 -1
  262. package/dist/components/ic-skeleton.js.map +1 -1
  263. package/dist/components/ic-status-tag.js.map +1 -1
  264. package/dist/components/ic-step.js +117 -16
  265. package/dist/components/ic-step.js.map +1 -1
  266. package/dist/components/ic-stepper.js +169 -41
  267. package/dist/components/ic-stepper.js.map +1 -1
  268. package/dist/components/ic-switch.js +1 -1
  269. package/dist/components/ic-switch.js.map +1 -1
  270. package/dist/components/ic-tab-context.js +6 -1
  271. package/dist/components/ic-tab-context.js.map +1 -1
  272. package/dist/components/ic-tab-group.js.map +1 -1
  273. package/dist/components/ic-tab-panel.js.map +1 -1
  274. package/dist/components/ic-tab.js.map +1 -1
  275. package/dist/components/ic-text-field2.js +2 -2
  276. package/dist/components/ic-text-field2.js.map +1 -1
  277. package/dist/components/ic-theme.js +2 -2
  278. package/dist/components/ic-theme.js.map +1 -1
  279. package/dist/components/ic-tooltip2.js +7 -3
  280. package/dist/components/ic-tooltip2.js.map +1 -1
  281. package/dist/components/ic-top-navigation.js +1 -1
  282. package/dist/components/ic-top-navigation.js.map +1 -1
  283. package/dist/components/ic-typography2.js.map +1 -1
  284. package/dist/components/index.d.ts +2 -1
  285. package/dist/components/index.js +1 -0
  286. package/dist/components/index.js.map +1 -1
  287. package/dist/core/core.esm.js +1 -1
  288. package/dist/core/core.esm.js.map +1 -1
  289. package/dist/core/p-0118400b.entry.js.map +1 -1
  290. package/dist/core/p-07cd789d.entry.js.map +1 -1
  291. package/dist/core/p-0b125f26.entry.js.map +1 -1
  292. package/dist/core/p-0d77bd0c.entry.js +2 -0
  293. package/dist/core/p-0d77bd0c.entry.js.map +1 -0
  294. package/dist/core/p-10da19d2.entry.js.map +1 -1
  295. package/dist/core/p-272c7abd.entry.js.map +1 -1
  296. package/dist/core/p-2b5c9143.entry.js +2 -0
  297. package/dist/core/p-2b5c9143.entry.js.map +1 -0
  298. package/dist/core/p-2f114521.entry.js.map +1 -1
  299. package/dist/core/p-31a8595f.entry.js.map +1 -1
  300. package/dist/core/{p-7b39977f.entry.js → p-3a068a45.entry.js} +2 -2
  301. package/dist/core/p-3a068a45.entry.js.map +1 -0
  302. package/dist/core/{p-e590f1d2.entry.js → p-4c72f3a9.entry.js} +2 -2
  303. package/dist/core/{p-e590f1d2.entry.js.map → p-4c72f3a9.entry.js.map} +1 -1
  304. package/dist/core/{p-ae81dffa.entry.js → p-5831bb8e.entry.js} +2 -2
  305. package/dist/core/p-5831bb8e.entry.js.map +1 -0
  306. package/dist/core/p-5d76bbad.entry.js +2 -0
  307. package/dist/core/p-5d76bbad.entry.js.map +1 -0
  308. package/dist/core/p-5e261268.entry.js.map +1 -1
  309. package/dist/core/p-60ffb73e.entry.js.map +1 -1
  310. package/dist/core/p-6308f1f2.entry.js +2 -0
  311. package/dist/core/p-6308f1f2.entry.js.map +1 -0
  312. package/dist/core/{p-c6dd4f47.entry.js → p-66f3f02b.entry.js} +2 -2
  313. package/dist/core/p-66f3f02b.entry.js.map +1 -0
  314. package/dist/core/p-69650186.entry.js.map +1 -1
  315. package/dist/core/p-6b34d98f.entry.js.map +1 -1
  316. package/dist/core/p-6be5e06b.entry.js.map +1 -1
  317. package/dist/core/p-6d0eaaeb.entry.js.map +1 -1
  318. package/dist/core/p-6f6bd657.entry.js.map +1 -1
  319. package/dist/core/{p-1337db5e.entry.js → p-6fba90ee.entry.js} +2 -2
  320. package/dist/core/p-6fba90ee.entry.js.map +1 -0
  321. package/dist/core/{p-558552f8.entry.js → p-7881b94e.entry.js} +2 -2
  322. package/dist/core/p-7881b94e.entry.js.map +1 -0
  323. package/dist/core/{p-8ddeb574.entry.js → p-7f04e382.entry.js} +2 -2
  324. package/dist/core/{p-8ddeb574.entry.js.map → p-7f04e382.entry.js.map} +1 -1
  325. package/dist/core/p-7f632414.entry.js.map +1 -1
  326. package/dist/core/p-80cd0a2d.entry.js +2 -0
  327. package/dist/core/p-80cd0a2d.entry.js.map +1 -0
  328. package/dist/core/{p-df5caf13.entry.js → p-8144e941.entry.js} +2 -2
  329. package/dist/core/p-8144e941.entry.js.map +1 -0
  330. package/dist/core/p-9cd04875.entry.js.map +1 -1
  331. package/dist/core/p-9e684c58.entry.js +2 -0
  332. package/dist/core/p-9e684c58.entry.js.map +1 -0
  333. package/dist/core/{p-02799e26.entry.js → p-a2d3e955.entry.js} +2 -2
  334. package/dist/core/{p-02799e26.entry.js.map → p-a2d3e955.entry.js.map} +1 -1
  335. package/dist/core/{p-1721bcf3.entry.js → p-b24145f7.entry.js} +2 -2
  336. package/dist/core/p-b24145f7.entry.js.map +1 -0
  337. package/dist/core/p-b3dec76d.entry.js.map +1 -1
  338. package/dist/core/{p-347ec49e.entry.js → p-bf89bcd3.entry.js} +2 -2
  339. package/dist/core/p-bf89bcd3.entry.js.map +1 -0
  340. package/dist/core/p-c4d3c18c.entry.js.map +1 -1
  341. package/dist/core/p-c85689e3.entry.js +2 -0
  342. package/dist/core/p-c85689e3.entry.js.map +1 -0
  343. package/dist/core/p-c8ce6147.entry.js +2 -0
  344. package/dist/core/p-c8ce6147.entry.js.map +1 -0
  345. package/dist/core/p-cadb531f.entry.js.map +1 -1
  346. package/dist/core/p-cc83692e.entry.js.map +1 -1
  347. package/dist/core/p-dd3c3e3c.entry.js.map +1 -1
  348. package/dist/core/p-e93e9aa3.entry.js.map +1 -1
  349. package/dist/core/p-ecfb2e6b.entry.js.map +1 -1
  350. package/dist/core/p-fa7bc907.entry.js +2 -0
  351. package/dist/core/p-fa7bc907.entry.js.map +1 -0
  352. package/dist/core/p-fbde8a26.entry.js +2 -0
  353. package/dist/core/p-fbde8a26.entry.js.map +1 -0
  354. package/dist/esm/core.js +1 -1
  355. package/dist/esm/ic-alert.entry.js +2 -0
  356. package/dist/esm/ic-alert.entry.js.map +1 -1
  357. package/dist/esm/ic-back-to-top.entry.js +18 -8
  358. package/dist/esm/ic-back-to-top.entry.js.map +1 -1
  359. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  360. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  361. package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
  362. package/dist/esm/ic-button_3.entry.js +29 -11
  363. package/dist/esm/ic-button_3.entry.js.map +1 -1
  364. package/dist/esm/ic-card.entry.js.map +1 -1
  365. package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
  366. package/dist/esm/ic-checkbox.entry.js +2 -0
  367. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  368. package/dist/esm/ic-chip.entry.js +62 -0
  369. package/dist/esm/ic-chip.entry.js.map +1 -0
  370. package/dist/esm/ic-classification-banner.entry.js.map +1 -1
  371. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  372. package/dist/esm/ic-data-row.entry.js +1 -1
  373. package/dist/esm/ic-data-row.entry.js.map +1 -1
  374. package/dist/esm/ic-divider.entry.js.map +1 -1
  375. package/dist/esm/ic-footer-link-group.entry.js.map +1 -1
  376. package/dist/esm/ic-footer-link.entry.js +1 -1
  377. package/dist/esm/ic-footer-link.entry.js.map +1 -1
  378. package/dist/esm/ic-footer.entry.js +2 -2
  379. package/dist/esm/ic-footer.entry.js.map +1 -1
  380. package/dist/esm/ic-hero.entry.js.map +1 -1
  381. package/dist/esm/ic-input-component-container_3.entry.js +19 -18
  382. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  383. package/dist/esm/ic-input-label_2.entry.js.map +1 -1
  384. package/dist/esm/ic-link.entry.js.map +1 -1
  385. package/dist/esm/ic-navigation-button.entry.js.map +1 -1
  386. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  387. package/dist/esm/ic-navigation-item.entry.js +2 -2
  388. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  389. package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
  390. package/dist/esm/ic-page-header.entry.js.map +1 -1
  391. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  392. package/dist/esm/ic-radio-option.entry.js +10 -1
  393. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  394. package/dist/esm/ic-search-bar.entry.js +16 -2
  395. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  396. package/dist/esm/ic-section-container.entry.js.map +1 -1
  397. package/dist/esm/ic-select.entry.js +2 -7
  398. package/dist/esm/ic-select.entry.js.map +1 -1
  399. package/dist/esm/ic-side-navigation.entry.js +8 -4
  400. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  401. package/dist/esm/ic-skeleton.entry.js +1 -1
  402. package/dist/esm/ic-skeleton.entry.js.map +1 -1
  403. package/dist/esm/ic-status-tag.entry.js.map +1 -1
  404. package/dist/esm/ic-step.entry.js +101 -13
  405. package/dist/esm/ic-step.entry.js.map +1 -1
  406. package/dist/esm/ic-stepper.entry.js +161 -40
  407. package/dist/esm/ic-stepper.entry.js.map +1 -1
  408. package/dist/esm/ic-switch.entry.js +1 -1
  409. package/dist/esm/ic-switch.entry.js.map +1 -1
  410. package/dist/esm/ic-tab-context.entry.js +6 -1
  411. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  412. package/dist/esm/ic-tab-group.entry.js.map +1 -1
  413. package/dist/esm/ic-tab-panel.entry.js.map +1 -1
  414. package/dist/esm/ic-tab.entry.js.map +1 -1
  415. package/dist/esm/ic-text-field.entry.js.map +1 -1
  416. package/dist/esm/ic-theme.entry.js +2 -2
  417. package/dist/esm/ic-theme.entry.js.map +1 -1
  418. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  419. package/dist/esm/ic-typography.entry.js.map +1 -1
  420. package/dist/esm/index-1500de1f.js +4 -0
  421. package/dist/esm/loader.js +1 -1
  422. package/dist/types/components/ic-alert/ic-alert.d.ts +12 -8
  423. package/dist/types/components/ic-back-to-top/ic-back-to-top.d.ts +1 -0
  424. package/dist/types/components/ic-breadcrumb/ic-breadcrumb.d.ts +5 -5
  425. package/dist/types/components/ic-breadcrumb-group/ic-breadcrumb-group.d.ts +2 -2
  426. package/dist/types/components/ic-button/ic-button.d.ts +10 -10
  427. package/dist/types/components/ic-card/ic-card.d.ts +8 -8
  428. package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +14 -10
  429. package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +9 -9
  430. package/dist/types/components/ic-chip/ic-chip.d.ts +40 -0
  431. package/dist/types/components/ic-chip/ic-chip.test.a11y.d.ts +1 -0
  432. package/dist/types/components/ic-chip/ic-chip.types.d.ts +2 -0
  433. package/dist/types/components/ic-classification-banner/ic-classification-banner.d.ts +5 -5
  434. package/dist/types/components/ic-data-entity/ic-data-entity.d.ts +2 -2
  435. package/dist/types/components/ic-data-row/ic-data-row.d.ts +3 -3
  436. package/dist/types/components/ic-footer/ic-footer.d.ts +12 -12
  437. package/dist/types/components/ic-footer-link-group/ic-footer-link-group.d.ts +1 -1
  438. package/dist/types/components/ic-hero/ic-hero.d.ts +9 -9
  439. package/dist/types/components/ic-input-component-container/ic-input-component-container.d.ts +8 -8
  440. package/dist/types/components/ic-input-container/ic-input-container.d.ts +2 -2
  441. package/dist/types/components/ic-input-label/ic-input-label.d.ts +8 -8
  442. package/dist/types/components/ic-input-validation/ic-input-validation.d.ts +5 -5
  443. package/dist/types/components/ic-link/ic-link.d.ts +6 -6
  444. package/dist/types/components/ic-loading-indicator/ic-loading-indicator.d.ts +8 -3
  445. package/dist/types/components/ic-menu/ic-menu.d.ts +14 -14
  446. package/dist/types/components/ic-navigation-button/ic-navigation-button.d.ts +5 -5
  447. package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +2 -2
  448. package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +7 -7
  449. package/dist/types/components/ic-navigation-menu/ic-navigation-menu.d.ts +2 -2
  450. package/dist/types/components/ic-page-header/ic-page-header.d.ts +10 -8
  451. package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +10 -10
  452. package/dist/types/components/ic-radio-option/ic-radio-option.d.ts +13 -11
  453. package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +28 -25
  454. package/dist/types/components/ic-section-container/ic-section-container.d.ts +2 -2
  455. package/dist/types/components/ic-select/ic-select.d.ts +18 -18
  456. package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +12 -12
  457. package/dist/types/components/ic-skeleton/ic-skeleton.d.ts +2 -2
  458. package/dist/types/components/ic-status-tag/ic-status-tag.d.ts +1 -1
  459. package/dist/types/components/ic-step/ic-step.d.ts +37 -8
  460. package/dist/types/components/ic-step/ic-step.types.d.ts +2 -0
  461. package/dist/types/components/ic-stepper/ic-stepper-test-examples.d.ts +4 -0
  462. package/dist/types/components/ic-stepper/ic-stepper.d.ts +23 -6
  463. package/dist/types/components/ic-switch/ic-switch.d.ts +7 -7
  464. package/dist/types/components/ic-tab/ic-tab.d.ts +5 -5
  465. package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +8 -4
  466. package/dist/types/components/ic-tab-group/ic-tab-group.d.ts +4 -4
  467. package/dist/types/components/ic-tab-panel/ic-tab-panel.d.ts +2 -2
  468. package/dist/types/components/ic-text-field/ic-text-field.d.ts +30 -30
  469. package/dist/types/components/ic-theme/ic-theme.d.ts +3 -3
  470. package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +4 -0
  471. package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +6 -6
  472. package/dist/types/components/ic-typography/ic-typography.d.ts +1 -1
  473. package/dist/types/components.d.ts +625 -535
  474. package/dist/types/testspec.setup.d.ts +1 -0
  475. package/hydrate/index.js +574 -212
  476. package/package.json +3 -3
  477. package/dist/core/p-1337db5e.entry.js.map +0 -1
  478. package/dist/core/p-1721bcf3.entry.js.map +0 -1
  479. package/dist/core/p-33a45ace.entry.js +0 -2
  480. package/dist/core/p-33a45ace.entry.js.map +0 -1
  481. package/dist/core/p-347ec49e.entry.js.map +0 -1
  482. package/dist/core/p-39ae284e.entry.js +0 -2
  483. package/dist/core/p-39ae284e.entry.js.map +0 -1
  484. package/dist/core/p-558552f8.entry.js.map +0 -1
  485. package/dist/core/p-7093d214.entry.js +0 -2
  486. package/dist/core/p-7093d214.entry.js.map +0 -1
  487. package/dist/core/p-7577c6a3.entry.js +0 -2
  488. package/dist/core/p-7577c6a3.entry.js.map +0 -1
  489. package/dist/core/p-7b11e1dc.entry.js +0 -2
  490. package/dist/core/p-7b11e1dc.entry.js.map +0 -1
  491. package/dist/core/p-7b39977f.entry.js.map +0 -1
  492. package/dist/core/p-898607d0.entry.js +0 -2
  493. package/dist/core/p-898607d0.entry.js.map +0 -1
  494. package/dist/core/p-ac43322e.entry.js +0 -2
  495. package/dist/core/p-ac43322e.entry.js.map +0 -1
  496. package/dist/core/p-ae81dffa.entry.js.map +0 -1
  497. package/dist/core/p-b5a988c0.entry.js +0 -2
  498. package/dist/core/p-b5a988c0.entry.js.map +0 -1
  499. package/dist/core/p-c6dd4f47.entry.js.map +0 -1
  500. package/dist/core/p-df5caf13.entry.js.map +0 -1
  501. package/dist/core/p-e106305b.entry.js +0 -2
  502. package/dist/core/p-e106305b.entry.js.map +0 -1
@@ -1,69 +1,190 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { checkResizeObserver } from "../../utils/helpers";
3
- export class IcStepper {
3
+ export class Stepper {
4
4
  constructor() {
5
5
  this.resizeObserver = null;
6
- /**
7
- * Get all steps currently within this stepper
8
- */
6
+ // Get all steps currently within this stepper
9
7
  this.getChildren = () => {
10
8
  this.steps = Array.from(this.el.querySelectorAll("ic-step"));
9
+ this.stepsWithStepTitles = Array.from(this.el.querySelectorAll("ic-step[step-title]"));
10
+ };
11
+ // Inform the user that stepTitles are required on all steps in a compact stepper
12
+ this.checkStepTitles = () => {
13
+ if (this.stepsWithStepTitles.length < this.steps.length &&
14
+ this.variantOverride &&
15
+ this.variant === "compact") {
16
+ this.noOfResizes = this.noOfResizes + 1;
17
+ if (this.noOfResizes === 1) {
18
+ console.error(`The prop 'step-title' (web components) / 'stepTitle' (react) is required for all steps of the Stepper component (compact variant)`);
19
+ }
20
+ }
21
+ };
22
+ this.setStepTypes = () => {
23
+ this.getChildren();
24
+ this.stepTypes = [];
25
+ for (let i = 0; i < this.steps.length; i++) {
26
+ this.stepTypes.push("active");
27
+ }
28
+ };
29
+ this.setStepperWidth = () => {
30
+ this.alignedFullWidth =
31
+ this.variant === "default" && this.aligned === "full-width";
32
+ const lastStep = this.steps[this.steps.length - 1];
33
+ lastStep.style.maxWidth = "none";
34
+ if (this.alignedFullWidth) {
35
+ this.stepperWidth = this.el.offsetWidth;
36
+ lastStep.style.maxWidth = `${this.stepperWidth / this.steps.length}px`;
37
+ this.lastStepWidth = lastStep.offsetWidth;
38
+ }
11
39
  };
12
40
  this.initialiseStepStates = () => {
13
41
  this.steps.forEach((step, index) => {
42
+ // Set variant
43
+ step.variant = this.variant;
14
44
  // Assign stepNum to each step
15
45
  step.stepNum = index + 1;
16
- //Assign lastStep to final step
46
+ // Assign lastStep to final step
17
47
  step.lastStep = index === this.steps.length - 1;
18
- if (step.lastStep) {
19
- step.classList.add("last-step");
20
- if (this.el.classList.contains("aligned-full-width")) {
21
- step.style.maxWidth = `${this.lastStepWidth}px`;
48
+ step.lastStepNum = this.steps.length;
49
+ if (step.stepType !== "current") {
50
+ step.current = false;
51
+ this.stepTypes[index] = step.stepType;
52
+ }
53
+ else {
54
+ step.current = true;
55
+ }
56
+ const stepTitleArea = step.shadowRoot &&
57
+ step.shadowRoot.querySelector(".step > .step-title-area");
58
+ if (this.stepsWithStepTitles.length == 0 && this.variantOverride) {
59
+ if (this.variant === "compact") {
60
+ this.autoSetStepTitles = true;
61
+ if (this.autoSetStepTitles) {
62
+ step.stepTitle = "Step " + step.stepNum;
63
+ stepTitleArea &&
64
+ stepTitleArea
65
+ .querySelector(".step-title")
66
+ .setAttribute("aria-hidden", "true");
67
+ }
68
+ }
69
+ if (this.variant === "default") {
70
+ this.autoSetStepTitles = false;
71
+ if (!this.autoSetStepTitles) {
72
+ step.stepTitle = undefined;
73
+ stepTitleArea &&
74
+ stepTitleArea
75
+ .querySelector(".step-title")
76
+ .removeAttribute("aria-hidden");
77
+ }
78
+ }
79
+ }
80
+ if (this.variant === "compact") {
81
+ if (step.current === true || step.stepType === "current") {
82
+ step.classList.remove("hide");
83
+ step.classList.add("show");
22
84
  }
23
- if (this.el.classList.contains("aligned-left")) {
24
- step.style.maxWidth = `${this.connectorWidth + 48}px`;
85
+ else if (step.classList.contains("show")) {
86
+ step.classList.remove("show");
87
+ step.classList.add("hide");
88
+ }
89
+ if (!step.lastStep) {
90
+ step.nextStepTitle = this.steps[index + 1].stepTitle;
91
+ step.progress = (step.stepNum / this.steps.length) * 100;
92
+ }
93
+ else if (step.lastStep && this.stepTypes[index] !== "completed") {
94
+ step.progress = 95;
95
+ }
96
+ else {
97
+ step.progress = 100;
98
+ }
99
+ if (this.hideStepInfo && stepTitleArea !== null) {
100
+ stepTitleArea.classList.remove("visually-hidden");
101
+ }
102
+ step.compactStepStyling = this.stepTypes[index];
103
+ }
104
+ if (this.variant === "default") {
105
+ if (!step.lastStep) {
106
+ if (this.alignedFullWidth) {
107
+ step.style.width = `${(this.stepperWidth - this.lastStepWidth) / (this.steps.length - 1)}px`;
108
+ step.style.minWidth = "148px";
109
+ }
110
+ }
111
+ else if (step.lastStep) {
112
+ step.classList.add("last-step");
113
+ if (this.alignedFullWidth) {
114
+ step.style.maxWidth = `${this.lastStepWidth}px`;
115
+ }
116
+ else {
117
+ step.style.maxWidth =
118
+ this.connectorWidth > 100
119
+ ? `${this.connectorWidth + 48}px`
120
+ : "148px";
121
+ }
122
+ }
123
+ if (this.aligned === "left") {
124
+ step.style.width =
125
+ this.connectorWidth > 100
126
+ ? `${this.connectorWidth + 48}px`
127
+ : "148px";
128
+ const stepConnect = step.shadowRoot.querySelector(".step > .step-top > .step-connect");
129
+ if (stepConnect) {
130
+ stepConnect.style.width =
131
+ this.connectorWidth > 100 ? `${this.connectorWidth}px` : "100px";
132
+ }
133
+ }
134
+ if (this.hideStepInfo && stepTitleArea !== null) {
135
+ stepTitleArea.classList.add("visually-hidden");
25
136
  }
26
137
  }
27
138
  });
28
- for (let i = 0; i < this.steps.length - 1; i++) {
29
- if (this.el.classList.contains("aligned-full-width")) {
30
- this.steps[i].style.width = `${(this.stepperWidth - this.lastStepWidth) / (this.steps.length - 1)}px`;
31
- this.steps[i].style.minWidth = "148px";
139
+ };
140
+ this.overrideVariant = () => {
141
+ let minDefaultStepperWidth = 148 * this.steps.length;
142
+ if (this.aligned === "left" && this.connectorWidth > 100) {
143
+ minDefaultStepperWidth = (this.connectorWidth + 48) * this.steps.length;
144
+ }
145
+ if (this.variantOverride) {
146
+ if (this.el.clientWidth < minDefaultStepperWidth) {
147
+ this.variant = "compact";
148
+ this.getChildren();
32
149
  }
33
- if (this.el.classList.contains("aligned-left")) {
34
- this.steps[i].style.width = `${this.connectorWidth + 48}px`;
35
- const stepConnect = this.steps[i].shadowRoot.querySelector("div > .step-top > .step-connect");
36
- stepConnect.style.width =
37
- this.connectorWidth > 100 ? `${this.connectorWidth}px` : "100px";
150
+ else {
151
+ this.variant = "default";
152
+ this.getChildren();
38
153
  }
39
154
  }
40
155
  };
156
+ this.resizeObserverCallback = () => {
157
+ this.getChildren();
158
+ this.checkStepTitles();
159
+ this.overrideVariant();
160
+ this.setStepperWidth();
161
+ this.initialiseStepStates();
162
+ };
41
163
  this.runResizeObserver = () => {
42
164
  this.resizeObserver = new ResizeObserver(() => {
43
- this.setStepperWidth();
44
- this.getChildren();
45
- this.initialiseStepStates();
165
+ this.resizeObserverCallback();
46
166
  });
47
167
  this.resizeObserver.observe(this.el);
48
168
  };
49
- this.setStepperWidth = () => {
50
- this.stepperWidth = this.el.offsetWidth;
51
- const allSteps = document.querySelectorAll("ic-step");
52
- const lastStep = allSteps[allSteps.length - 1];
53
- lastStep.style.maxWidth = "none";
54
- if (lastStep.classList.contains("aligned-full-width")) {
55
- lastStep.style.maxWidth = `${this.stepperWidth / allSteps.length}px`;
56
- }
57
- this.lastStepWidth = lastStep.offsetWidth;
58
- this.getChildren();
59
- this.initialiseStepStates();
60
- };
61
169
  this.aligned = "full-width";
170
+ this.variant = "default";
62
171
  this.connectorWidth = 100;
172
+ this.hideStepInfo = false;
63
173
  this.stepperWidth = document
64
174
  .querySelector("ic-stepper")
65
175
  .getBoundingClientRect().width;
66
176
  this.lastStepWidth = 0;
177
+ this.stepTypes = [];
178
+ this.alignedFullWidth = true;
179
+ this.autoSetStepTitles = true;
180
+ this.variantOverride = this.variant !== "compact";
181
+ this.noOfResizes = 0;
182
+ }
183
+ componentWillLoad() {
184
+ this.setStepTypes();
185
+ if (this.variant === "compact") {
186
+ this.variantOverride = false;
187
+ }
67
188
  }
68
189
  componentDidLoad() {
69
190
  checkResizeObserver(this.runResizeObserver);
@@ -75,8 +196,8 @@ export class IcStepper {
75
196
  }
76
197
  render() {
77
198
  return (h(Host, { class: {
78
- ["aligned-left"]: this.aligned === "left",
79
- ["aligned-full-width"]: this.aligned === "full-width",
199
+ [`${this.variant}`]: true,
200
+ ["aligned-left"]: this.variant === "default" && this.aligned === "left",
80
201
  } }, h("ul", { class: "step-item-list" }, h("slot", null))));
81
202
  }
82
203
  static get is() { return "ic-stepper"; }
@@ -110,12 +231,35 @@ export class IcStepper {
110
231
  "optional": true,
111
232
  "docs": {
112
233
  "tags": [],
113
- "text": "How the stepper should be aligned in its container."
234
+ "text": "The alignment of the default stepper within its container."
114
235
  },
115
236
  "attribute": "aligned",
116
237
  "reflect": false,
117
238
  "defaultValue": "\"full-width\""
118
239
  },
240
+ "variant": {
241
+ "type": "string",
242
+ "mutable": true,
243
+ "complexType": {
244
+ "original": "IcStepVariants",
245
+ "resolved": "\"compact\" | \"default\"",
246
+ "references": {
247
+ "IcStepVariants": {
248
+ "location": "import",
249
+ "path": "../ic-step/ic-step.types"
250
+ }
251
+ }
252
+ },
253
+ "required": false,
254
+ "optional": true,
255
+ "docs": {
256
+ "tags": [],
257
+ "text": "The variant of the stepper."
258
+ },
259
+ "attribute": "variant",
260
+ "reflect": false,
261
+ "defaultValue": "\"default\""
262
+ },
119
263
  "connectorWidth": {
120
264
  "type": "number",
121
265
  "mutable": false,
@@ -133,13 +277,36 @@ export class IcStepper {
133
277
  "attribute": "connector-width",
134
278
  "reflect": false,
135
279
  "defaultValue": "100"
280
+ },
281
+ "hideStepInfo": {
282
+ "type": "boolean",
283
+ "mutable": false,
284
+ "complexType": {
285
+ "original": "boolean",
286
+ "resolved": "boolean",
287
+ "references": {}
288
+ },
289
+ "required": false,
290
+ "optional": true,
291
+ "docs": {
292
+ "tags": [],
293
+ "text": "If `true`, the information about each step, i.e. step title, step subtitle and step status, will be hidden on all default steps. The information about each step will still be visible in the compact variant of the stepper."
294
+ },
295
+ "attribute": "hide-step-info",
296
+ "reflect": false,
297
+ "defaultValue": "false"
136
298
  }
137
299
  };
138
300
  }
139
301
  static get states() {
140
302
  return {
141
303
  "stepperWidth": {},
142
- "lastStepWidth": {}
304
+ "lastStepWidth": {},
305
+ "stepTypes": {},
306
+ "alignedFullWidth": {},
307
+ "autoSetStepTitles": {},
308
+ "variantOverride": {},
309
+ "noOfResizes": {}
143
310
  };
144
311
  }
145
312
  static get elementRef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EAAE,IAAI,CAAC,OAAO,KAAK,YAAY;OACtD;MAED,UAAI,KAAK,EAAC,gBAAgB;QACxB,eAAa,CACV,CACA,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, h, State } from \"@stencil/core\";\nimport { checkResizeObserver } from \"../../utils/helpers\";\nimport { IcStepperAlignment } from \"./ic-stepper.types\";\n\n@Component({\n tag: \"ic-stepper\",\n styleUrl: \"ic-stepper.css\",\n shadow: true,\n})\nexport class IcStepper {\n @Element() el: HTMLIcStepperElement;\n\n /**\n * How the stepper should be aligned in its container.\n */\n @Prop() aligned?: IcStepperAlignment = \"full-width\";\n\n /**\n * The length of the connnector between each step in pixels. Minimum length is 100px.\n */\n @Prop() connectorWidth?: number = 100;\n\n @State() stepperWidth: number = document\n .querySelector(\"ic-stepper\")\n .getBoundingClientRect().width;\n\n @State() lastStepWidth: number = 0;\n\n private steps: HTMLIcStepElement[];\n\n private resizeObserver: ResizeObserver = null;\n\n /**\n * Get all steps currently within this stepper\n */\n private getChildren = (): void => {\n this.steps = Array.from(this.el.querySelectorAll(\"ic-step\"));\n };\n\n private initialiseStepStates = (): void => {\n this.steps.forEach((step, index) => {\n // Assign stepNum to each step\n step.stepNum = index + 1;\n //Assign lastStep to final step\n step.lastStep = index === this.steps.length - 1;\n\n if (step.lastStep) {\n step.classList.add(\"last-step\");\n if (this.el.classList.contains(\"aligned-full-width\")) {\n step.style.maxWidth = `${this.lastStepWidth}px`;\n }\n if (this.el.classList.contains(\"aligned-left\")) {\n step.style.maxWidth = `${this.connectorWidth + 48}px`;\n }\n }\n });\n\n for (let i = 0; i < this.steps.length - 1; i++) {\n if (this.el.classList.contains(\"aligned-full-width\")) {\n this.steps[i].style.width = `${\n (this.stepperWidth - this.lastStepWidth) / (this.steps.length - 1)\n }px`;\n this.steps[i].style.minWidth = \"148px\";\n }\n\n if (this.el.classList.contains(\"aligned-left\")) {\n this.steps[i].style.width = `${this.connectorWidth + 48}px`;\n const stepConnect = this.steps[i].shadowRoot.querySelector(\n \"div > .step-top > .step-connect\"\n ) as HTMLElement;\n stepConnect.style.width =\n this.connectorWidth > 100 ? `${this.connectorWidth}px` : \"100px\";\n }\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.setStepperWidth();\n this.getChildren();\n this.initialiseStepStates();\n });\n this.resizeObserver.observe(this.el);\n };\n\n private setStepperWidth = (): void => {\n this.stepperWidth = this.el.offsetWidth;\n const allSteps = document.querySelectorAll(\"ic-step\");\n const lastStep = allSteps[allSteps.length - 1];\n lastStep.style.maxWidth = \"none\";\n if (lastStep.classList.contains(\"aligned-full-width\")) {\n lastStep.style.maxWidth = `${this.stepperWidth / allSteps.length}px`;\n }\n this.lastStepWidth = lastStep.offsetWidth;\n this.getChildren();\n this.initialiseStepStates();\n };\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n return (\n <Host\n class={{\n [\"aligned-left\"]: this.aligned === \"left\",\n [\"aligned-full-width\"]: this.aligned === \"full-width\",\n }}\n >\n <ul class=\"step-item-list\">\n <slot></slot>\n </ul>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-stepper.js","sourceRoot":"","sources":["../../../src/components/ic-stepper/ic-stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAS1D,MAAM,OAAO,OAAO;;IA2CV,mBAAc,GAAmB,IAAI,CAAC;IAE9C,8CAA8C;IACtC,gBAAW,GAAG,GAAS,EAAE;MAC/B,IAAI,CAA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C,OAAO,KAAK,MAAM;OACxD;MAED,UAAI,KAAK,EAAC,gBAAgB;QACxB,eAAa,CACV,CACA,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, h, State } from \"@stencil/core\";\nimport { checkResizeObserver } from \"../../utils/helpers\";\nimport { IcStepperAlignment } from \"./ic-stepper.types\";\nimport { IcStepTypes, IcStepVariants } from \"../ic-step/ic-step.types\";\n\n@Component({\n tag: \"ic-stepper\",\n styleUrl: \"ic-stepper.css\",\n shadow: true,\n})\nexport class Stepper {\n @Element() el: HTMLIcStepperElement;\n\n /**\n * The alignment of the default stepper within its container.\n */\n @Prop() aligned?: IcStepperAlignment = \"full-width\";\n\n /**\n * The variant of the stepper.\n */\n @Prop({ mutable: true }) variant?: IcStepVariants = \"default\";\n\n /**\n * The length of the connnector between each step in pixels. Minimum length is 100px.\n */\n @Prop() connectorWidth?: number = 100;\n\n /**\n * If `true`, the information about each step, i.e. step title, step subtitle and step status, will be hidden on all default steps. The information about each step will still be visible in the compact variant of the stepper.\n */\n @Prop() hideStepInfo?: boolean = false;\n\n @State() stepperWidth: number = document\n .querySelector(\"ic-stepper\")\n .getBoundingClientRect().width;\n\n @State() lastStepWidth: number = 0;\n\n @State() stepTypes: IcStepTypes[] = [];\n\n @State() alignedFullWidth: boolean = true;\n\n @State() autoSetStepTitles: boolean = true;\n\n @State() variantOverride?: boolean = this.variant !== \"compact\";\n\n @State() noOfResizes?: number = 0;\n\n private steps: HTMLIcStepElement[];\n\n private stepsWithStepTitles: HTMLIcStepElement[];\n\n private resizeObserver: ResizeObserver = null;\n\n // Get all steps currently within this stepper\n private getChildren = (): void => {\n this.steps = Array.from(this.el.querySelectorAll(\"ic-step\"));\n\n this.stepsWithStepTitles = Array.from(\n this.el.querySelectorAll(\"ic-step[step-title]\")\n );\n };\n\n // Inform the user that stepTitles are required on all steps in a compact stepper\n private checkStepTitles = (): void => {\n if (\n this.stepsWithStepTitles.length < this.steps.length &&\n this.variantOverride &&\n this.variant === \"compact\"\n ) {\n this.noOfResizes = this.noOfResizes + 1;\n if (this.noOfResizes === 1) {\n console.error(\n `The prop 'step-title' (web components) / 'stepTitle' (react) is required for all steps of the Stepper component (compact variant)`\n );\n }\n }\n };\n\n private setStepTypes = (): void => {\n this.getChildren();\n this.stepTypes = [];\n for (let i = 0; i < this.steps.length; i++) {\n this.stepTypes.push(\"active\");\n }\n };\n\n private setStepperWidth = (): void => {\n this.alignedFullWidth =\n this.variant === \"default\" && this.aligned === \"full-width\";\n\n const lastStep = this.steps[this.steps.length - 1];\n lastStep.style.maxWidth = \"none\";\n\n if (this.alignedFullWidth) {\n this.stepperWidth = this.el.offsetWidth;\n lastStep.style.maxWidth = `${this.stepperWidth / this.steps.length}px`;\n this.lastStepWidth = lastStep.offsetWidth;\n }\n };\n\n private initialiseStepStates = (): void => {\n this.steps.forEach((step, index) => {\n // Set variant\n step.variant = this.variant;\n // Assign stepNum to each step\n step.stepNum = index + 1;\n // Assign lastStep to final step\n step.lastStep = index === this.steps.length - 1;\n step.lastStepNum = this.steps.length;\n\n if (step.stepType !== \"current\") {\n step.current = false;\n this.stepTypes[index] = step.stepType;\n } else {\n step.current = true;\n }\n\n const stepTitleArea =\n step.shadowRoot &&\n step.shadowRoot.querySelector(\".step > .step-title-area\");\n\n if (this.stepsWithStepTitles.length == 0 && this.variantOverride) {\n if (this.variant === \"compact\") {\n this.autoSetStepTitles = true;\n if (this.autoSetStepTitles) {\n step.stepTitle = \"Step \" + step.stepNum;\n stepTitleArea &&\n stepTitleArea\n .querySelector(\".step-title\")\n .setAttribute(\"aria-hidden\", \"true\");\n }\n }\n if (this.variant === \"default\") {\n this.autoSetStepTitles = false;\n if (!this.autoSetStepTitles) {\n step.stepTitle = undefined;\n stepTitleArea &&\n stepTitleArea\n .querySelector(\".step-title\")\n .removeAttribute(\"aria-hidden\");\n }\n }\n }\n\n if (this.variant === \"compact\") {\n if (step.current === true || step.stepType === \"current\") {\n step.classList.remove(\"hide\");\n step.classList.add(\"show\");\n } else if (step.classList.contains(\"show\")) {\n step.classList.remove(\"show\");\n step.classList.add(\"hide\");\n }\n\n if (!step.lastStep) {\n step.nextStepTitle = this.steps[index + 1].stepTitle;\n step.progress = (step.stepNum / this.steps.length) * 100;\n } else if (step.lastStep && this.stepTypes[index] !== \"completed\") {\n step.progress = 95;\n } else {\n step.progress = 100;\n }\n\n if (this.hideStepInfo && stepTitleArea !== null) {\n stepTitleArea.classList.remove(\"visually-hidden\");\n }\n\n step.compactStepStyling = this.stepTypes[index];\n }\n\n if (this.variant === \"default\") {\n if (!step.lastStep) {\n if (this.alignedFullWidth) {\n step.style.width = `${\n (this.stepperWidth - this.lastStepWidth) / (this.steps.length - 1)\n }px`;\n step.style.minWidth = \"148px\";\n }\n } else if (step.lastStep) {\n step.classList.add(\"last-step\");\n if (this.alignedFullWidth) {\n step.style.maxWidth = `${this.lastStepWidth}px`;\n } else {\n step.style.maxWidth =\n this.connectorWidth > 100\n ? `${this.connectorWidth + 48}px`\n : \"148px\";\n }\n }\n\n if (this.aligned === \"left\") {\n step.style.width =\n this.connectorWidth > 100\n ? `${this.connectorWidth + 48}px`\n : \"148px\";\n const stepConnect = step.shadowRoot.querySelector(\n \".step > .step-top > .step-connect\"\n ) as HTMLElement;\n\n if (stepConnect) {\n stepConnect.style.width =\n this.connectorWidth > 100 ? `${this.connectorWidth}px` : \"100px\";\n }\n }\n\n if (this.hideStepInfo && stepTitleArea !== null) {\n stepTitleArea.classList.add(\"visually-hidden\");\n }\n }\n });\n };\n\n private overrideVariant = () => {\n let minDefaultStepperWidth = 148 * this.steps.length;\n\n if (this.aligned === \"left\" && this.connectorWidth > 100) {\n minDefaultStepperWidth = (this.connectorWidth + 48) * this.steps.length;\n }\n\n if (this.variantOverride) {\n if (this.el.clientWidth < minDefaultStepperWidth) {\n this.variant = \"compact\";\n this.getChildren();\n } else {\n this.variant = \"default\";\n this.getChildren();\n }\n }\n };\n\n private resizeObserverCallback = () => {\n this.getChildren();\n this.checkStepTitles();\n this.overrideVariant();\n this.setStepperWidth();\n this.initialiseStepStates();\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n this.resizeObserverCallback();\n });\n this.resizeObserver.observe(this.el);\n };\n\n componentWillLoad(): void {\n this.setStepTypes();\n if (this.variant === \"compact\") {\n this.variantOverride = false;\n }\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n render() {\n return (\n <Host\n class={{\n [`${this.variant}`]: true,\n [\"aligned-left\"]:\n this.variant === \"default\" && this.aligned === \"left\",\n }}\n >\n <ul class=\"step-item-list\">\n <slot></slot>\n </ul>\n </Host>\n );\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { fixture } from "@open-wc/testing-helpers";
2
2
  import { axe } from "jest-axe";
3
3
  import { checkShadowElementRendersCorrectly } from "../../utils/testa11y.helpers";
4
- describe("stepper component", () => {
4
+ describe("default variant of stepper component", () => {
5
5
  it("passes accessibility", async () => {
6
6
  const el = await fixture(`<ic-stepper>
7
7
  <ic-step step-title="First"></ic-step>
@@ -21,4 +21,16 @@ describe("stepper component", () => {
21
21
  expect(await axe(el)).toHaveNoViolations();
22
22
  });
23
23
  });
24
+ describe("compact variant of ic-stepper", () => {
25
+ it("passes accessibility", async () => {
26
+ const el = await fixture(`<ic-stepper variant="compact" id="standard-compact-stepper">
27
+ <ic-step step-title="Create" step-type="completed"></ic-step>
28
+ <ic-step step-title="Read" step-status="complete" current></ic-step>
29
+ <ic-step step-title="Update" step-status="not required"></ic-step>
30
+ <ic-step step-title="Delete" step-status="not required"></ic-step>
31
+ </ic-stepper>`);
32
+ checkShadowElementRendersCorrectly(el);
33
+ expect(await axe(el)).toHaveNoViolations();
34
+ });
35
+ });
24
36
  //# sourceMappingURL=ic-stepper.test.a11y.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ic-stepper.test.a11y.js","sourceRoot":"","sources":["../../../src/components/ic-stepper/ic-stepper.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,8BAA8B,CAAC;AAElF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;EACjC,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;;;;;;;;;;;;;gBAab,CAAC,CAAC;IACd,kCAAkC,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;EAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../utils/testa11y.helpers\";\n\ndescribe(\"stepper component\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`<ic-stepper>\n <ic-step step-title=\"First\"></ic-step>\n <ic-step\n step-title=\"Second With a Very Long Title\"\n step-subtitle=\"Optional Subtitle\"\n step-type=\"current\"\n ></ic-step>\n <ic-step step-title=\"Third\" step-type=\"disabled\"></ic-step>\n <ic-step\n step-title=\"Fourth\"\n step-subtitle=\"Optional Subtitle\"\n step-type=\"completed\"\n ></ic-step>\n </ic-stepper>`);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
1
+ {"version":3,"file":"ic-stepper.test.a11y.js","sourceRoot":"","sources":["../../../src/components/ic-stepper/ic-stepper.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,8BAA8B,CAAC;AAElF,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;EACpD,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;;;;;;;;;;;;;gBAab,CAAC,CAAC;IACd,kCAAkC,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;EAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;EAC7C,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IACpC,MAAM,EAAE,GACN,MAAM,OAAO,CAAC;;;;;oBAKA,CAAC,CAAC;IAClB,kCAAkC,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;EAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\nimport { checkShadowElementRendersCorrectly } from \"../../utils/testa11y.helpers\";\n\ndescribe(\"default variant of stepper component\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`<ic-stepper>\n <ic-step step-title=\"First\"></ic-step>\n <ic-step\n step-title=\"Second With a Very Long Title\"\n step-subtitle=\"Optional Subtitle\"\n step-type=\"current\"\n ></ic-step>\n <ic-step step-title=\"Third\" step-type=\"disabled\"></ic-step>\n <ic-step\n step-title=\"Fourth\"\n step-subtitle=\"Optional Subtitle\"\n step-type=\"completed\"\n ></ic-step>\n </ic-stepper>`);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n\ndescribe(\"compact variant of ic-stepper\", () => {\n it(\"passes accessibility\", async () => {\n const el =\n await fixture(`<ic-stepper variant=\"compact\" id=\"standard-compact-stepper\">\n <ic-step step-title=\"Create\" step-type=\"completed\"></ic-step>\n <ic-step step-title=\"Read\" step-status=\"complete\" current></ic-step>\n <ic-step step-title=\"Update\" step-status=\"not required\"></ic-step>\n <ic-step step-title=\"Delete\" step-status=\"not required\"></ic-step>\n </ic-stepper>`);\n checkShadowElementRendersCorrectly(el);\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
@@ -626,7 +626,7 @@ input {
626
626
  }
627
627
 
628
628
  ::slotted(svg) {
629
- fill: currentColor;
629
+ fill: currentcolor;
630
630
  }
631
631
 
632
632
  @media (forced-colors: active) {
@@ -84,7 +84,7 @@ export class Switch {
84
84
  "optional": false,
85
85
  "docs": {
86
86
  "tags": [],
87
- "text": "Applies an aria-label to the component, for when no visual 'name' is provided."
87
+ "text": "The aria-label applied to the switch when no visual 'name' is provided."
88
88
  },
89
89
  "attribute": "label",
90
90
  "reflect": false
@@ -101,7 +101,7 @@ export class Switch {
101
101
  "optional": true,
102
102
  "docs": {
103
103
  "tags": [],
104
- "text": "Hides the label and applies the required label value as an aria-label."
104
+ "text": "If `true`, the label will be hidden and the required label value will be applied as an aria-label."
105
105
  },
106
106
  "attribute": "hide-label",
107
107
  "reflect": false,
@@ -119,7 +119,7 @@ export class Switch {
119
119
  "optional": true,
120
120
  "docs": {
121
121
  "tags": [],
122
- "text": "Provide helper text to display additional field guidance."
122
+ "text": "The helper text that will be displayed for additional field guidance."
123
123
  },
124
124
  "attribute": "helper-text",
125
125
  "reflect": false,
@@ -137,7 +137,7 @@ export class Switch {
137
137
  "optional": true,
138
138
  "docs": {
139
139
  "tags": [],
140
- "text": "If true, the component is checked."
140
+ "text": "If `true`, the switch will display as checked."
141
141
  },
142
142
  "attribute": "checked",
143
143
  "reflect": false,
@@ -155,7 +155,7 @@ export class Switch {
155
155
  "optional": true,
156
156
  "docs": {
157
157
  "tags": [],
158
- "text": "If true, the component reduces in size to the small state."
158
+ "text": "If `true`, the small styling will be applied to the switch."
159
159
  },
160
160
  "attribute": "small",
161
161
  "reflect": false,
@@ -173,7 +173,7 @@ export class Switch {
173
173
  "optional": true,
174
174
  "docs": {
175
175
  "tags": [],
176
- "text": "If true, the component is not interactive."
176
+ "text": "If `true`, the disabled state will be set."
177
177
  },
178
178
  "attribute": "disabled",
179
179
  "reflect": false,
@@ -209,7 +209,7 @@ export class Switch {
209
209
  "optional": true,
210
210
  "docs": {
211
211
  "tags": [],
212
- "text": "If true, the component will render the On/Off state text."
212
+ "text": "If `true`, the switch will render the On/Off state text."
213
213
  },
214
214
  "attribute": "show-state",
215
215
  "reflect": false,
@@ -1 +1 @@
1
- {"version":3,"file":"ic-switch.js","sourceRoot":"","sources":["../../../src/components/ic-switch/ic-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAChC,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB;;GAEG;AAMH,MAAM,OAAO,MAAM;;IACT,YAAO,GAAG,mBAAmB,QAAQ,EAAE,EAAE,CAAC;IAiE1C,iBAAY,GAAG,GAAG,EAAE;MAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;MACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjB,OAAO,EAAE,IAAI,CAAC,YAAY;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;OAClB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AG,EACrB,EAAE,EAAC,GAAG,EACN,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GACrB,CACE;UACN,WACE,KAAK,EAAC,gBAAgB,iBACV,MAAM,EAClB,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;YAElC,cACE,KAAK,EAAC,uBAAuB,EAC7B,IAAI,EAAC,MAAM,EACX,EAAE,EAAC,GAAG,EACN,EAAE,EAAC,GAAG,EACN,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAC5B,CACE,CACD;QACP,YAAM,IAAI,EAAC,iBAAiB,GAAQ;QACnC,SAAS,IAAI,CACZ,oCACc,MAAM,EAClB,OAAO,EAAC,OAAO,EACf,KAAK,EAAC,0BAA0B,IAE/B,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CACd,CACjB,CACK,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n getInputDescribedByText,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n} from \"../../utils/helpers\";\nimport { IcSwitchChangeEventDetail } from \"./ic-switch.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot right-adornment - Content is placed to the right of switch before state label.\n */\n@Component({\n tag: \"ic-switch\",\n styleUrl: \"ic-switch.css\",\n shadow: true,\n})\nexport class Switch {\n private inputId = `ic-switch-input-${inputIds++}`;\n\n @Element() el: HTMLIcSwitchElement;\n\n /**\n * Applies an aria-label to the component, for when no visual 'name' is provided.\n */\n @Prop() label!: string;\n\n /**\n * Hides the label and applies the required label value as an aria-label.\n */\n @Prop() hideLabel?: boolean = false;\n /**\n * Provide helper text to display additional field guidance.\n */\n @Prop() helperText?: string = \"\";\n /**\n * If true, the component is checked.\n */\n @Prop() checked?: boolean = false;\n /**\n * If true, the component reduces in size to the small state.\n */\n @Prop() small?: boolean = false;\n /**\n * If true, the component is not interactive.\n */\n @Prop() disabled?: boolean = false;\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name?: string = this.inputId;\n /**\n * If true, the component will render the On/Off state text.\n */\n @Prop() showState?: boolean = false;\n\n /**\n * The value of the toggle does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a toggle is analogous to the value of a `<input type=\"checkbox\">`,\n * it's only used when the toggle participates in a native `<form>`.\n */\n @Prop() value?: string | null = \"on\";\n\n /**\n * Emitted when the value property has changed.\n */\n @Event() icChange!: EventEmitter<IcSwitchChangeEventDetail>;\n\n /**\n * Emitted when the toggle has focus.\n */\n @Event() icFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() icBlur!: EventEmitter<void>;\n\n @State() checkedState: boolean = false;\n @State() initiallyChecked = this.checked;\n\n private handleChange = () => {\n this.checkedState = !this.checkedState;\n this.icChange.emit({\n checked: this.checkedState,\n value: this.value,\n });\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private handleFormReset = (): void => {\n this.checkedState = this.initiallyChecked;\n };\n\n componentWillLoad(): void {\n this.checkedState = this.checked;\n addFormResetListener(this.el, this.handleFormReset);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Switch\"\n );\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n render() {\n const {\n label,\n checkedState,\n small,\n disabled,\n name,\n showState,\n value,\n hideLabel,\n helperText,\n inputId,\n } = this;\n\n renderHiddenInput(true, this.el, name, checkedState ? value : \"\", disabled);\n\n const describedBy = getInputDescribedByText(\n inputId,\n helperText !== \"\",\n false\n );\n\n return (\n <Host>\n <label\n class={{\n [\"ic-switch-container\"]: true,\n [\"ic-switch-disabled\"]: disabled,\n [\"ic-switch-small\"]: small,\n }}\n htmlFor={inputId}\n >\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n readonly={true}\n disabled={disabled}\n class={{\n [\"ic-switch-label\"]: true,\n [\"ic-switch-label-small\"]: small,\n }}\n ></ic-input-label>\n )}\n {!hideLabel && <span class=\"ic-switch-line-break\"></span>}\n <input\n checked={checkedState}\n disabled={disabled}\n aria-label={label}\n aria-checked={checkedState ? \"true\" : \"false\"}\n aria-describedby={describedBy}\n role=\"switch\"\n class=\"ic-switch-input\"\n type=\"checkbox\"\n name=\"toggle\"\n id={inputId}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onChange={this.handleChange}\n />\n <span class=\"ic-switch-toggle\">\n <svg\n class=\"ic-switch-icon\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 10 10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n class=\"ic-switch-icon-line\"\n x1=\"9\"\n y1={small ? \"2\" : \"1\"}\n x2=\"9\"\n y2={small ? \"8\" : \"9\"}\n />\n </svg>\n <svg\n class=\"ic-switch-icon\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 10 10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n class=\"ic-switch-icon-circle\"\n fill=\"none\"\n cx=\"5\"\n cy=\"5\"\n r={small ? \"3.335\" : \"4.445\"}\n />\n </svg>\n </span>\n <slot name=\"right-adornment\"></slot>\n {showState && (\n <ic-typography\n aria-hidden=\"true\"\n variant=\"label\"\n class=\"ic-switch-checked-status\"\n >\n {checkedState ? \"On\" : \"Off\"}\n </ic-typography>\n )}\n </label>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-switch.js","sourceRoot":"","sources":["../../../src/components/ic-switch/ic-switch.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,GAEN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAChC,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB;;GAEG;AAMH,MAAM,OAAO,MAAM;;IACT,YAAO,GAAG,mBAAmB,QAAQ,EAAE,EAAE,CAAC;IAiE1C,iBAAY,GAAG,GAAG,EAAE;MAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;MACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjB,OAAO,EAAE,IAAI,CAAC,YAAY;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;OAClB,CAAC,CAAC;IACL,CAAC,CAAC;IAEM,YAAO,GAAG,GAAG,EAAE;MACrB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC,CAAC;IAEM,WAAM,GAAG,GAAG,EAAE;MACpB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC,CAAC;IAEM,oBAAe,GAAG,GAAS,EAAE;MACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC;IAC5C,CAAC,CAAC;;qBAvE4B,KAAK;sBAIL,EAAE;mBAIJ,KAAK;iBAIP,KAAK;oBAIF,KAAK;gBAIV,IAAI,CAAC,OAAO;qBAI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I,EAAC,iBAAiB,GAAQ;QACnC,SAAS,IAAI,CACZ,oCACc,MAAM,EAClB,OAAO,EAAC,OAAO,EACf,KAAK,EAAC,0BAA0B,IAE/B,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CACd,CACjB,CACK,CACH,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Host,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\nimport {\n getInputDescribedByText,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n} from \"../../utils/helpers\";\nimport { IcSwitchChangeEventDetail } from \"./ic-switch.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot right-adornment - Content is placed to the right of switch before state label.\n */\n@Component({\n tag: \"ic-switch\",\n styleUrl: \"ic-switch.css\",\n shadow: true,\n})\nexport class Switch {\n private inputId = `ic-switch-input-${inputIds++}`;\n\n @Element() el: HTMLIcSwitchElement;\n\n /**\n * The aria-label applied to the switch when no visual 'name' is provided.\n */\n @Prop() label!: string;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel?: boolean = false;\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText?: string = \"\";\n /**\n * If `true`, the switch will display as checked.\n */\n @Prop() checked?: boolean = false;\n /**\n * If `true`, the small styling will be applied to the switch.\n */\n @Prop() small?: boolean = false;\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name?: string = this.inputId;\n /**\n * If `true`, the switch will render the On/Off state text.\n */\n @Prop() showState?: boolean = false;\n\n /**\n * The value of the toggle does not mean if it's checked or not, use the `checked`\n * property for that.\n *\n * The value of a toggle is analogous to the value of a `<input type=\"checkbox\">`,\n * it's only used when the toggle participates in a native `<form>`.\n */\n @Prop() value?: string | null = \"on\";\n\n /**\n * Emitted when the value property has changed.\n */\n @Event() icChange!: EventEmitter<IcSwitchChangeEventDetail>;\n\n /**\n * Emitted when the toggle has focus.\n */\n @Event() icFocus!: EventEmitter<void>;\n\n /**\n * Emitted when the toggle loses focus.\n */\n @Event() icBlur!: EventEmitter<void>;\n\n @State() checkedState: boolean = false;\n @State() initiallyChecked = this.checked;\n\n private handleChange = () => {\n this.checkedState = !this.checkedState;\n this.icChange.emit({\n checked: this.checkedState,\n value: this.value,\n });\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private handleFormReset = (): void => {\n this.checkedState = this.initiallyChecked;\n };\n\n componentWillLoad(): void {\n this.checkedState = this.checked;\n addFormResetListener(this.el, this.handleFormReset);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Switch\"\n );\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n render() {\n const {\n label,\n checkedState,\n small,\n disabled,\n name,\n showState,\n value,\n hideLabel,\n helperText,\n inputId,\n } = this;\n\n renderHiddenInput(true, this.el, name, checkedState ? value : \"\", disabled);\n\n const describedBy = getInputDescribedByText(\n inputId,\n helperText !== \"\",\n false\n );\n\n return (\n <Host>\n <label\n class={{\n [\"ic-switch-container\"]: true,\n [\"ic-switch-disabled\"]: disabled,\n [\"ic-switch-small\"]: small,\n }}\n htmlFor={inputId}\n >\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n readonly={true}\n disabled={disabled}\n class={{\n [\"ic-switch-label\"]: true,\n [\"ic-switch-label-small\"]: small,\n }}\n ></ic-input-label>\n )}\n {!hideLabel && <span class=\"ic-switch-line-break\"></span>}\n <input\n checked={checkedState}\n disabled={disabled}\n aria-label={label}\n aria-checked={checkedState ? \"true\" : \"false\"}\n aria-describedby={describedBy}\n role=\"switch\"\n class=\"ic-switch-input\"\n type=\"checkbox\"\n name=\"toggle\"\n id={inputId}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onChange={this.handleChange}\n />\n <span class=\"ic-switch-toggle\">\n <svg\n class=\"ic-switch-icon\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 10 10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n class=\"ic-switch-icon-line\"\n x1=\"9\"\n y1={small ? \"2\" : \"1\"}\n x2=\"9\"\n y2={small ? \"8\" : \"9\"}\n />\n </svg>\n <svg\n class=\"ic-switch-icon\"\n aria-hidden=\"true\"\n focusable=\"false\"\n viewBox=\"0 0 10 10\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n class=\"ic-switch-icon-circle\"\n fill=\"none\"\n cx=\"5\"\n cy=\"5\"\n r={small ? \"3.335\" : \"4.445\"}\n />\n </svg>\n </span>\n <slot name=\"right-adornment\"></slot>\n {showState && (\n <ic-typography\n aria-hidden=\"true\"\n variant=\"label\"\n class=\"ic-switch-checked-status\"\n >\n {checkedState ? \"On\" : \"Off\"}\n </ic-typography>\n )}\n </label>\n </Host>\n );\n }\n}\n"]}
@@ -81,7 +81,7 @@ export class Tab {
81
81
  "docs": {
82
82
  "tags": [{
83
83
  "name": "internal",
84
- "text": "Provide a unique context if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel."
84
+ "text": "The unique context needed if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel."
85
85
  }],
86
86
  "text": ""
87
87
  },
@@ -101,7 +101,7 @@ export class Tab {
101
101
  "optional": true,
102
102
  "docs": {
103
103
  "tags": [],
104
- "text": "Disables the tab."
104
+ "text": "If `true`, the disabled state will be set."
105
105
  },
106
106
  "attribute": "disabled",
107
107
  "reflect": false,
@@ -120,7 +120,7 @@ export class Tab {
120
120
  "docs": {
121
121
  "tags": [{
122
122
  "name": "internal",
123
- "text": "Will display a selected indicator and set tabIndex."
123
+ "text": "If `true`, the tab will display with a selected indicator and tabIndex will be set."
124
124
  }],
125
125
  "text": ""
126
126
  },
@@ -204,8 +204,11 @@ export class Tab {
204
204
  "cancelable": true,
205
205
  "composed": true,
206
206
  "docs": {
207
- "tags": [],
208
- "text": "Called when a tab is selected."
207
+ "tags": [{
208
+ "name": "internal",
209
+ "text": "Emitted when a tab is selected."
210
+ }],
211
+ "text": ""
209
212
  },
210
213
  "complexType": {
211
214
  "original": "IcTabClickEventDetail",
@@ -226,7 +229,7 @@ export class Tab {
226
229
  "docs": {
227
230
  "tags": [{
228
231
  "name": "internal",
229
- "text": "Called when a tab is focussed."
232
+ "text": "Emitted when a tab is focussed."
230
233
  }],
231
234
  "text": ""
232
235
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ic-tab.js","sourceRoot":"","sources":["../../../src/components/ic-tab/ic-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,IAAI,EACJ,CAAC,GACF,MAAM,eAAe,CAAC;AAGvB,OAAO,EAEL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AAMH,MAAM,OAAO,GAAG;;IAiCN,oBAAe,GAAY,IAAI,CAAC;IAChC,mBAAc,GAAY,KAAK,CAAC;IAEhC,gBAAW,GAAG,GAAG,EAAE;MACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,QAAQ,EAAE,IAAI,CAAC,WAAW;OAC3B,CAAC,C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B,WAAW,EAAE,IAAI,CAAC,eAAe,mBAClB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC1C,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;MAE/B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ;MACtE,qBAAe,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,OAAO;QACjD;UACE,eAAa,CACR,CACO,CACX,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n h,\n} from \"@stencil/core\";\n\nimport { IcTabClickEventDetail } from \"./ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\n/**\n * @slot icon - Content will be rendered next to the tab label.\n */\n@Component({\n tag: \"ic-tab\",\n styleUrl: \"ic-tab.css\",\n shadow: true,\n})\nexport class Tab {\n @Element() host: HTMLIcTabElement;\n\n /** @internal Provide a unique context if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel. */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * Disables the tab.\n */\n @Prop() disabled?: boolean = false;\n\n /** @internal Will display a selected indicator and set tabIndex. */\n @Prop({ reflect: true }) selected?: boolean = false;\n\n /** @internal The shared ID between panel and tab. */\n @Prop({ reflect: true }) tabId?: string;\n\n /** @internal The position of the tab inside the tabs array in context. */\n @Prop() tabPosition?: number;\n\n /** @internal Determines whether the light or dark variant of the tabs should be displayed. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n /**\n * Called when a tab is selected.\n */\n @Event() tabClick: EventEmitter<IcTabClickEventDetail>;\n\n /**\n * @internal Called when a tab is focussed.\n */\n @Event() tabFocus: EventEmitter<IcTabClickEventDetail>;\n\n private isInitialRender: boolean = true;\n private focusFromClick: boolean = false;\n\n private handleClick = () => {\n this.tabClick.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n if (this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n this.focusFromClick = false;\n }\n };\n\n private handleFocus = () => {\n if (!this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n }\n };\n\n private handleMouseDown = () => {\n //set flag so that focus gets handled after click\n //there is a timing issue where a long click only causes focus to happen & not the click\n //the focus does need to be a seperate event though to handle focus from keyboard\n this.focusFromClick = true;\n };\n\n componentDidUpdate(): void {\n this.isInitialRender = false;\n }\n\n render() {\n const { disabled, selected, appearance } = this;\n return (\n <Host\n class={{\n [\"with-transition\"]: !this.isInitialRender,\n [\"ic-tab-light\"]: appearance === IcThemeForegroundEnum.Light,\n }}\n role=\"tab\"\n aria-selected={selected ? \"true\" : \"false\"}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onMouseDown={this.handleMouseDown}\n aria-disabled={disabled ? \"true\" : \"false\"}\n tabindex={this.selected ? 0 : -1}\n >\n {this.host.querySelector('[slot=\"icon\"]') && <slot name=\"icon\"></slot>}\n <ic-typography class=\"ic-tab-label\" variant=\"label\">\n <span>\n <slot></slot>\n </span>\n </ic-typography>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-tab.js","sourceRoot":"","sources":["../../../src/components/ic-tab/ic-tab.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,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AC;EAED,MAAM;IACJ,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAChD,OAAO,CACL,EAAC,IAAI,IACH,KAAK,EAAE;QACL,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe;QAC1C,CAAC,cAAc,CAAC,EAAE,UAAU,KAAK,qBAAqB,CAAC,KAAK;OAC7D,EACD,IAAI,EAAC,KAAK,mBACK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC1C,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,WAAW,EAAE,IAAI,CAAC,eAAe,mBAClB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAC1C,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;MAE/B,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ;MACtE,qBAAe,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,OAAO;QACjD;UACE,eAAa,CACR,CACO,CACX,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n h,\n} from \"@stencil/core\";\n\nimport { IcTabClickEventDetail } from \"./ic-tab.types\";\nimport {\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\n/**\n * @slot icon - Content will be rendered next to the tab label.\n */\n@Component({\n tag: \"ic-tab\",\n styleUrl: \"ic-tab.css\",\n shadow: true,\n})\nexport class Tab {\n @Element() host: HTMLIcTabElement;\n\n /** @internal The unique context needed if using multiple tabs inside one another i.e. rendering another tabs inside a tab panel. */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n\n /** @internal If `true`, the tab will display with a selected indicator and tabIndex will be set. */\n @Prop({ reflect: true }) selected?: boolean = false;\n\n /** @internal The shared ID between panel and tab. */\n @Prop({ reflect: true }) tabId?: string;\n\n /** @internal The position of the tab inside the tabs array in context. */\n @Prop() tabPosition?: number;\n\n /** @internal Determines whether the light or dark variant of the tabs should be displayed. */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n /**\n * @internal Emitted when a tab is selected.\n */\n @Event() tabClick: EventEmitter<IcTabClickEventDetail>;\n\n /**\n * @internal Emitted when a tab is focussed.\n */\n @Event() tabFocus: EventEmitter<IcTabClickEventDetail>;\n\n private isInitialRender: boolean = true;\n private focusFromClick: boolean = false;\n\n private handleClick = () => {\n this.tabClick.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n if (this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n this.focusFromClick = false;\n }\n };\n\n private handleFocus = () => {\n if (!this.focusFromClick) {\n this.tabFocus.emit({\n tabId: this.tabId,\n contextId: this.contextId,\n position: this.tabPosition,\n });\n }\n };\n\n private handleMouseDown = () => {\n //set flag so that focus gets handled after click\n //there is a timing issue where a long click only causes focus to happen & not the click\n //the focus does need to be a seperate event though to handle focus from keyboard\n this.focusFromClick = true;\n };\n\n componentDidUpdate(): void {\n this.isInitialRender = false;\n }\n\n render() {\n const { disabled, selected, appearance } = this;\n return (\n <Host\n class={{\n [\"with-transition\"]: !this.isInitialRender,\n [\"ic-tab-light\"]: appearance === IcThemeForegroundEnum.Light,\n }}\n role=\"tab\"\n aria-selected={selected ? \"true\" : \"false\"}\n onClick={this.handleClick}\n onFocus={this.handleFocus}\n onMouseDown={this.handleMouseDown}\n aria-disabled={disabled ? \"true\" : \"false\"}\n tabindex={this.selected ? 0 : -1}\n >\n {this.host.querySelector('[slot=\"icon\"]') && <slot name=\"icon\"></slot>}\n <ic-typography class=\"ic-tab-label\" variant=\"label\">\n <span>\n <slot></slot>\n </span>\n </ic-typography>\n </Host>\n );\n }\n}\n"]}