@ukic/web-components 2.1.0-beta.13 → 2.1.0-beta.15

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 (377) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-2021e212.js → helpers-d6b5880e.js} +19 -25
  3. package/dist/cjs/helpers-d6b5880e.js.map +1 -0
  4. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  6. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +14 -14
  7. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-breadcrumb.cjs.entry.js +5 -4
  9. package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-button_3.cjs.entry.js +4 -7
  11. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-card.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  14. package/dist/cjs/ic-checkbox.cjs.entry.js +5 -4
  15. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  18. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  19. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-footer.cjs.entry.js +5 -3
  22. package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  25. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +5 -2
  26. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  28. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  29. package/dist/cjs/ic-menu-item.cjs.entry.js +3 -2
  30. package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
  31. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-navigation-group.cjs.entry.js +7 -4
  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 +1 -7
  37. package/dist/cjs/ic-navigation-menu.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-page-header.cjs.entry.js +10 -13
  39. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  40. package/dist/cjs/ic-pagination.cjs.entry.js +13 -2
  41. package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
  42. package/dist/cjs/ic-popover-menu.cjs.entry.js +5 -4
  43. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  44. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-select.cjs.entry.js +2 -3
  48. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  49. package/dist/cjs/ic-side-navigation.cjs.entry.js +20 -16
  50. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  51. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-step.cjs.entry.js +2 -2
  53. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  54. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  55. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-tab-context.cjs.entry.js +7 -5
  57. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  59. package/dist/cjs/ic-tab-panel.cjs.entry.js +3 -1
  60. package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
  61. package/dist/cjs/ic-tab.cjs.entry.js +3 -1
  62. package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-text-field.cjs.entry.js +6 -14
  64. package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
  65. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  66. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-typography.cjs.entry.js +95 -3
  69. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  70. package/dist/cjs/loader.cjs.js +1 -1
  71. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +4 -3
  72. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js.map +1 -1
  73. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +13 -13
  74. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
  75. package/dist/collection/components/ic-button/ic-button.css +6 -0
  76. package/dist/collection/components/ic-button/ic-button.js +1 -4
  77. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  78. package/dist/collection/components/ic-checkbox/ic-checkbox.js +4 -3
  79. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  80. package/dist/collection/components/ic-footer/ic-footer.css +2 -2
  81. package/dist/collection/components/ic-footer/ic-footer.js +4 -2
  82. package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
  83. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.css +1 -1
  84. package/dist/collection/components/ic-menu/ic-menu.js +4 -1
  85. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  86. package/dist/collection/components/ic-menu-item/ic-menu-item.js +2 -1
  87. package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
  88. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +6 -3
  89. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
  90. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +13 -7
  91. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js +0 -6
  92. package/dist/collection/components/ic-navigation-menu/ic-navigation-menu.js.map +1 -1
  93. package/dist/collection/components/ic-page-header/ic-page-header.js +9 -12
  94. package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
  95. package/dist/collection/components/ic-pagination/ic-pagination.css +0 -4
  96. package/dist/collection/components/ic-pagination/ic-pagination.js +52 -1
  97. package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
  98. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +4 -3
  99. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
  100. package/dist/collection/components/ic-select/ic-select.js +11 -12
  101. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  102. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +19 -15
  103. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  104. package/dist/collection/components/ic-step/ic-step.css +5 -5
  105. package/dist/collection/components/ic-step/ic-step.js +1 -1
  106. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  107. package/dist/collection/components/ic-tab/ic-tab.js +3 -1
  108. package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
  109. package/dist/collection/components/ic-tab-context/ic-tab-context.js +7 -5
  110. package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
  111. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +3 -1
  112. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
  113. package/dist/collection/components/ic-text-field/ic-text-field.js +5 -13
  114. package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
  115. package/dist/collection/components/ic-typography/ic-typography.css +39 -0
  116. package/dist/collection/components/ic-typography/ic-typography.js +120 -2
  117. package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
  118. package/dist/collection/utils/helpers.js +18 -24
  119. package/dist/collection/utils/helpers.js.map +1 -1
  120. package/dist/components/helpers.js +18 -24
  121. package/dist/components/helpers.js.map +1 -1
  122. package/dist/components/ic-breadcrumb-group.js +13 -13
  123. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  124. package/dist/components/ic-breadcrumb2.js +4 -3
  125. package/dist/components/ic-breadcrumb2.js.map +1 -1
  126. package/dist/components/ic-button2.js +2 -5
  127. package/dist/components/ic-button2.js.map +1 -1
  128. package/dist/components/ic-checkbox.js +4 -3
  129. package/dist/components/ic-checkbox.js.map +1 -1
  130. package/dist/components/ic-footer.js +5 -3
  131. package/dist/components/ic-footer.js.map +1 -1
  132. package/dist/components/ic-loading-indicator2.js +1 -1
  133. package/dist/components/ic-loading-indicator2.js.map +1 -1
  134. package/dist/components/ic-menu-item2.js +2 -1
  135. package/dist/components/ic-menu-item2.js.map +1 -1
  136. package/dist/components/ic-menu2.js +4 -1
  137. package/dist/components/ic-menu2.js.map +1 -1
  138. package/dist/components/ic-navigation-group.js +6 -3
  139. package/dist/components/ic-navigation-group.js.map +1 -1
  140. package/dist/components/ic-navigation-item.js +1 -1
  141. package/dist/components/ic-navigation-item.js.map +1 -1
  142. package/dist/components/ic-navigation-menu2.js +0 -6
  143. package/dist/components/ic-navigation-menu2.js.map +1 -1
  144. package/dist/components/ic-page-header.js +9 -12
  145. package/dist/components/ic-page-header.js.map +1 -1
  146. package/dist/components/ic-pagination.js +15 -3
  147. package/dist/components/ic-pagination.js.map +1 -1
  148. package/dist/components/ic-popover-menu.js +4 -3
  149. package/dist/components/ic-popover-menu.js.map +1 -1
  150. package/dist/components/ic-select.js +1 -2
  151. package/dist/components/ic-select.js.map +1 -1
  152. package/dist/components/ic-side-navigation.js +19 -15
  153. package/dist/components/ic-side-navigation.js.map +1 -1
  154. package/dist/components/ic-step.js +2 -2
  155. package/dist/components/ic-step.js.map +1 -1
  156. package/dist/components/ic-tab-context.js +7 -5
  157. package/dist/components/ic-tab-context.js.map +1 -1
  158. package/dist/components/ic-tab-panel.js +3 -1
  159. package/dist/components/ic-tab-panel.js.map +1 -1
  160. package/dist/components/ic-tab.js +3 -1
  161. package/dist/components/ic-tab.js.map +1 -1
  162. package/dist/components/ic-text-field2.js +5 -13
  163. package/dist/components/ic-text-field2.js.map +1 -1
  164. package/dist/components/ic-typography2.js +99 -4
  165. package/dist/components/ic-typography2.js.map +1 -1
  166. package/dist/core/core.esm.js +1 -1
  167. package/dist/core/core.esm.js.map +1 -1
  168. package/dist/core/{p-0575a77f.entry.js → p-050dbce8.entry.js} +2 -2
  169. package/dist/core/p-06962e10.entry.js +2 -0
  170. package/dist/core/p-06962e10.entry.js.map +1 -0
  171. package/dist/core/{p-0a41c3cb.entry.js → p-0969a95a.entry.js} +2 -2
  172. package/dist/core/{p-56fe91ad.entry.js → p-0a11ec35.entry.js} +2 -2
  173. package/dist/core/p-0a11ec35.entry.js.map +1 -0
  174. package/dist/core/{p-b61e76e2.entry.js → p-0f153569.entry.js} +2 -2
  175. package/dist/core/{p-3fb307e6.entry.js → p-1585e5c1.entry.js} +2 -2
  176. package/dist/core/p-29ea6f88.entry.js +2 -0
  177. package/dist/core/p-29ea6f88.entry.js.map +1 -0
  178. package/dist/core/p-2e63f202.entry.js +2 -0
  179. package/dist/core/p-2e63f202.entry.js.map +1 -0
  180. package/dist/core/p-2e6ea6d3.entry.js +2 -0
  181. package/dist/core/p-2e6ea6d3.entry.js.map +1 -0
  182. package/dist/core/{p-e0f24ccd.entry.js → p-2fb97a1b.entry.js} +2 -2
  183. package/dist/core/p-2fb97a1b.entry.js.map +1 -0
  184. package/dist/core/{p-100dbcec.entry.js → p-31b4b684.entry.js} +2 -2
  185. package/dist/core/{p-e839e5dc.entry.js → p-32cc8827.entry.js} +2 -2
  186. package/dist/core/{p-3845b769.entry.js → p-3498db0b.entry.js} +2 -2
  187. package/dist/core/p-3498db0b.entry.js.map +1 -0
  188. package/dist/core/{p-d5d9923a.entry.js → p-36e0671f.entry.js} +2 -2
  189. package/dist/core/p-443052a7.entry.js +2 -0
  190. package/dist/core/p-443052a7.entry.js.map +1 -0
  191. package/dist/core/{p-6a77992e.entry.js → p-46371c05.entry.js} +2 -2
  192. package/dist/core/p-471820e6.js +2 -0
  193. package/dist/core/p-471820e6.js.map +1 -0
  194. package/dist/core/{p-9413d639.entry.js → p-4dd0eb6a.entry.js} +2 -2
  195. package/dist/core/p-50421f27.entry.js +2 -0
  196. package/dist/core/p-50421f27.entry.js.map +1 -0
  197. package/dist/core/p-559b3d17.entry.js +2 -0
  198. package/dist/core/p-559b3d17.entry.js.map +1 -0
  199. package/dist/core/{p-895bda21.entry.js → p-5a3f3f37.entry.js} +2 -2
  200. package/dist/core/p-5a3f3f37.entry.js.map +1 -0
  201. package/dist/core/{p-dc0b9e80.entry.js → p-5e896163.entry.js} +2 -2
  202. package/dist/core/{p-e41e701a.entry.js → p-68547339.entry.js} +2 -2
  203. package/dist/core/p-6f2be5bd.entry.js +2 -0
  204. package/dist/core/p-6f2be5bd.entry.js.map +1 -0
  205. package/dist/core/{p-1eb0992b.entry.js → p-70124e59.entry.js} +2 -2
  206. package/dist/core/p-80164baa.entry.js +2 -0
  207. package/dist/core/p-80164baa.entry.js.map +1 -0
  208. package/dist/core/{p-6b39f8b4.entry.js → p-8edd3a9b.entry.js} +2 -2
  209. package/dist/core/{p-c0813424.entry.js → p-9715ec62.entry.js} +2 -2
  210. package/dist/core/{p-cb437317.entry.js → p-983cb33c.entry.js} +2 -2
  211. package/dist/core/{p-002a63e9.entry.js → p-a18c0672.entry.js} +2 -2
  212. package/dist/core/{p-47b0ed42.entry.js → p-a8dc8196.entry.js} +2 -2
  213. package/dist/core/{p-52fd3533.entry.js → p-a9184841.entry.js} +2 -2
  214. package/dist/core/p-a9184841.entry.js.map +1 -0
  215. package/dist/core/{p-e384aaee.entry.js → p-af815dfb.entry.js} +2 -2
  216. package/dist/core/{p-8780890e.entry.js → p-b69226d2.entry.js} +2 -2
  217. package/dist/core/p-b7cf6411.entry.js +2 -0
  218. package/dist/core/p-b7cf6411.entry.js.map +1 -0
  219. package/dist/core/{p-3a67718c.entry.js → p-bffa2e1a.entry.js} +2 -2
  220. package/dist/core/p-c85476c0.entry.js +2 -0
  221. package/dist/core/p-c85476c0.entry.js.map +1 -0
  222. package/dist/core/{p-a0f4e641.entry.js → p-ca20c9c3.entry.js} +2 -2
  223. package/dist/core/{p-a33a04b2.entry.js → p-cee45622.entry.js} +2 -2
  224. package/dist/core/p-cee45622.entry.js.map +1 -0
  225. package/dist/core/{p-f3e10149.entry.js → p-d2d5132d.entry.js} +2 -2
  226. package/dist/core/{p-f3e10149.entry.js.map → p-d2d5132d.entry.js.map} +1 -1
  227. package/dist/core/{p-546b620e.entry.js → p-df1b0f17.entry.js} +2 -2
  228. package/dist/core/{p-92c4fa7f.entry.js → p-e16e817e.entry.js} +2 -2
  229. package/dist/core/p-e16e817e.entry.js.map +1 -0
  230. package/dist/core/p-e6217f40.entry.js +2 -0
  231. package/dist/core/p-e6217f40.entry.js.map +1 -0
  232. package/dist/core/{p-3dc2ff7b.entry.js → p-faeedfd1.entry.js} +2 -2
  233. package/dist/core/p-faeedfd1.entry.js.map +1 -0
  234. package/dist/core/{p-5d077cf7.entry.js → p-fb5861c6.entry.js} +2 -2
  235. package/dist/core/{p-3e5eb873.entry.js → p-fd18d7a3.entry.js} +2 -2
  236. package/dist/esm/core.js +1 -1
  237. package/dist/esm/{helpers-b2b47a7d.js → helpers-73666f14.js} +19 -25
  238. package/dist/esm/helpers-73666f14.js.map +1 -0
  239. package/dist/esm/ic-alert.entry.js +1 -1
  240. package/dist/esm/ic-back-to-top.entry.js +1 -1
  241. package/dist/esm/ic-breadcrumb-group.entry.js +14 -14
  242. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  243. package/dist/esm/ic-breadcrumb.entry.js +5 -4
  244. package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
  245. package/dist/esm/ic-button_3.entry.js +4 -7
  246. package/dist/esm/ic-button_3.entry.js.map +1 -1
  247. package/dist/esm/ic-card.entry.js +1 -1
  248. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  249. package/dist/esm/ic-checkbox.entry.js +5 -4
  250. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  251. package/dist/esm/ic-chip.entry.js +1 -1
  252. package/dist/esm/ic-data-row.entry.js +1 -1
  253. package/dist/esm/ic-divider.entry.js +1 -1
  254. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  255. package/dist/esm/ic-footer-link.entry.js +1 -1
  256. package/dist/esm/ic-footer.entry.js +5 -3
  257. package/dist/esm/ic-footer.entry.js.map +1 -1
  258. package/dist/esm/ic-hero.entry.js +1 -1
  259. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  260. package/dist/esm/ic-input-component-container_3.entry.js +5 -2
  261. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  262. package/dist/esm/ic-input-label_2.entry.js +1 -1
  263. package/dist/esm/ic-link.entry.js +1 -1
  264. package/dist/esm/ic-menu-item.entry.js +3 -2
  265. package/dist/esm/ic-menu-item.entry.js.map +1 -1
  266. package/dist/esm/ic-navigation-button.entry.js +1 -1
  267. package/dist/esm/ic-navigation-group.entry.js +7 -4
  268. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  269. package/dist/esm/ic-navigation-item.entry.js +2 -2
  270. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  271. package/dist/esm/ic-navigation-menu.entry.js +1 -7
  272. package/dist/esm/ic-navigation-menu.entry.js.map +1 -1
  273. package/dist/esm/ic-page-header.entry.js +10 -13
  274. package/dist/esm/ic-page-header.entry.js.map +1 -1
  275. package/dist/esm/ic-pagination.entry.js +13 -2
  276. package/dist/esm/ic-pagination.entry.js.map +1 -1
  277. package/dist/esm/ic-popover-menu.entry.js +5 -4
  278. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  279. package/dist/esm/ic-radio-group.entry.js +1 -1
  280. package/dist/esm/ic-radio-option.entry.js +1 -1
  281. package/dist/esm/ic-search-bar.entry.js +1 -1
  282. package/dist/esm/ic-select.entry.js +2 -3
  283. package/dist/esm/ic-select.entry.js.map +1 -1
  284. package/dist/esm/ic-side-navigation.entry.js +20 -16
  285. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  286. package/dist/esm/ic-status-tag.entry.js +1 -1
  287. package/dist/esm/ic-step.entry.js +2 -2
  288. package/dist/esm/ic-step.entry.js.map +1 -1
  289. package/dist/esm/ic-stepper.entry.js +1 -1
  290. package/dist/esm/ic-switch.entry.js +1 -1
  291. package/dist/esm/ic-tab-context.entry.js +7 -5
  292. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  293. package/dist/esm/ic-tab-group.entry.js +1 -1
  294. package/dist/esm/ic-tab-panel.entry.js +3 -1
  295. package/dist/esm/ic-tab-panel.entry.js.map +1 -1
  296. package/dist/esm/ic-tab.entry.js +3 -1
  297. package/dist/esm/ic-tab.entry.js.map +1 -1
  298. package/dist/esm/ic-text-field.entry.js +6 -14
  299. package/dist/esm/ic-text-field.entry.js.map +1 -1
  300. package/dist/esm/ic-theme.entry.js +1 -1
  301. package/dist/esm/ic-toast.entry.js +1 -1
  302. package/dist/esm/ic-top-navigation.entry.js +1 -1
  303. package/dist/esm/ic-typography.entry.js +95 -3
  304. package/dist/esm/ic-typography.entry.js.map +1 -1
  305. package/dist/esm/loader.js +1 -1
  306. package/dist/types/components/ic-breadcrumb-group/ic-breadcrumb-group.d.ts +3 -0
  307. package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +1 -0
  308. package/dist/types/components/ic-menu/ic-menu.d.ts +1 -0
  309. package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +1 -0
  310. package/dist/types/components/ic-pagination/ic-pagination.d.ts +7 -0
  311. package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +1 -0
  312. package/dist/types/components/ic-select/ic-select.d.ts +11 -11
  313. package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +1 -0
  314. package/dist/types/components/ic-typography/ic-typography.d.ts +27 -0
  315. package/dist/types/components.d.ts +35 -15
  316. package/hydrate/index.js +226 -125
  317. package/package.json +3 -3
  318. package/dist/cjs/helpers-2021e212.js.map +0 -1
  319. package/dist/core/p-14835d6f.entry.js +0 -2
  320. package/dist/core/p-14835d6f.entry.js.map +0 -1
  321. package/dist/core/p-276f7ecb.entry.js +0 -2
  322. package/dist/core/p-276f7ecb.entry.js.map +0 -1
  323. package/dist/core/p-3845b769.entry.js.map +0 -1
  324. package/dist/core/p-3c23f963.entry.js +0 -2
  325. package/dist/core/p-3c23f963.entry.js.map +0 -1
  326. package/dist/core/p-3dc2ff7b.entry.js.map +0 -1
  327. package/dist/core/p-3dea2867.js +0 -2
  328. package/dist/core/p-3dea2867.js.map +0 -1
  329. package/dist/core/p-4b87445b.entry.js +0 -2
  330. package/dist/core/p-4b87445b.entry.js.map +0 -1
  331. package/dist/core/p-4c8fcfe6.entry.js +0 -2
  332. package/dist/core/p-4c8fcfe6.entry.js.map +0 -1
  333. package/dist/core/p-52fd3533.entry.js.map +0 -1
  334. package/dist/core/p-56fe91ad.entry.js.map +0 -1
  335. package/dist/core/p-864b46bf.entry.js +0 -2
  336. package/dist/core/p-864b46bf.entry.js.map +0 -1
  337. package/dist/core/p-895bda21.entry.js.map +0 -1
  338. package/dist/core/p-92c4fa7f.entry.js.map +0 -1
  339. package/dist/core/p-a33a04b2.entry.js.map +0 -1
  340. package/dist/core/p-a5bee11f.entry.js +0 -2
  341. package/dist/core/p-a5bee11f.entry.js.map +0 -1
  342. package/dist/core/p-db7131b6.entry.js +0 -2
  343. package/dist/core/p-db7131b6.entry.js.map +0 -1
  344. package/dist/core/p-de891d3d.entry.js +0 -2
  345. package/dist/core/p-de891d3d.entry.js.map +0 -1
  346. package/dist/core/p-e0f24ccd.entry.js.map +0 -1
  347. package/dist/core/p-ea526b54.entry.js +0 -2
  348. package/dist/core/p-ea526b54.entry.js.map +0 -1
  349. package/dist/core/p-ec8b228c.entry.js +0 -2
  350. package/dist/core/p-ec8b228c.entry.js.map +0 -1
  351. package/dist/core/p-ff6583e6.entry.js +0 -2
  352. package/dist/core/p-ff6583e6.entry.js.map +0 -1
  353. package/dist/esm/helpers-b2b47a7d.js.map +0 -1
  354. /package/dist/core/{p-0575a77f.entry.js.map → p-050dbce8.entry.js.map} +0 -0
  355. /package/dist/core/{p-0a41c3cb.entry.js.map → p-0969a95a.entry.js.map} +0 -0
  356. /package/dist/core/{p-b61e76e2.entry.js.map → p-0f153569.entry.js.map} +0 -0
  357. /package/dist/core/{p-3fb307e6.entry.js.map → p-1585e5c1.entry.js.map} +0 -0
  358. /package/dist/core/{p-100dbcec.entry.js.map → p-31b4b684.entry.js.map} +0 -0
  359. /package/dist/core/{p-e839e5dc.entry.js.map → p-32cc8827.entry.js.map} +0 -0
  360. /package/dist/core/{p-d5d9923a.entry.js.map → p-36e0671f.entry.js.map} +0 -0
  361. /package/dist/core/{p-6a77992e.entry.js.map → p-46371c05.entry.js.map} +0 -0
  362. /package/dist/core/{p-9413d639.entry.js.map → p-4dd0eb6a.entry.js.map} +0 -0
  363. /package/dist/core/{p-dc0b9e80.entry.js.map → p-5e896163.entry.js.map} +0 -0
  364. /package/dist/core/{p-e41e701a.entry.js.map → p-68547339.entry.js.map} +0 -0
  365. /package/dist/core/{p-1eb0992b.entry.js.map → p-70124e59.entry.js.map} +0 -0
  366. /package/dist/core/{p-6b39f8b4.entry.js.map → p-8edd3a9b.entry.js.map} +0 -0
  367. /package/dist/core/{p-c0813424.entry.js.map → p-9715ec62.entry.js.map} +0 -0
  368. /package/dist/core/{p-cb437317.entry.js.map → p-983cb33c.entry.js.map} +0 -0
  369. /package/dist/core/{p-002a63e9.entry.js.map → p-a18c0672.entry.js.map} +0 -0
  370. /package/dist/core/{p-47b0ed42.entry.js.map → p-a8dc8196.entry.js.map} +0 -0
  371. /package/dist/core/{p-e384aaee.entry.js.map → p-af815dfb.entry.js.map} +0 -0
  372. /package/dist/core/{p-8780890e.entry.js.map → p-b69226d2.entry.js.map} +0 -0
  373. /package/dist/core/{p-3a67718c.entry.js.map → p-bffa2e1a.entry.js.map} +0 -0
  374. /package/dist/core/{p-a0f4e641.entry.js.map → p-ca20c9c3.entry.js.map} +0 -0
  375. /package/dist/core/{p-546b620e.entry.js.map → p-df1b0f17.entry.js.map} +0 -0
  376. /package/dist/core/{p-5d077cf7.entry.js.map → p-fb5861c6.entry.js.map} +0 -0
  377. /package/dist/core/{p-3e5eb873.entry.js.map → p-fd18d7a3.entry.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukic/web-components",
3
- "version": "2.1.0-beta.13",
3
+ "version": "2.1.0-beta.15",
4
4
  "description": "A web component UI library compiled with StencilJS",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "dependencies": {
41
41
  "@popperjs/core": "^2.11.2",
42
42
  "@stencil/core": "^2.16.1",
43
- "@ukic/fonts": "^2.1.0-beta.13"
43
+ "@ukic/fonts": "^2.1.0-beta.15"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@babel/core": "^7.16.0",
@@ -74,5 +74,5 @@
74
74
  "webpack": "^5.76.0"
75
75
  },
76
76
  "license": "MIT",
77
- "gitHead": "7664d68763eab819ccf264f23a36a2390d45c22e"
77
+ "gitHead": "6d62b7b3236a74ffcc29cfdbf13cd792c649874a"
78
78
  }
@@ -1 +0,0 @@
1
- {"file":"helpers-2021e212.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;MACa,aAAa,GAAG;EAC3B,OAAO,EAAE;IACP,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,SAAS;GACrB;EACD,IAAI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AAW,GAAG,OAAO,CAAC,WAAW,CAAC;AACnD,EAAE;AACF;;;;;MAKa,oBAAoB,GAAG,CAAC,KAAkB,KACrD,KAAK,CAAC,aAAa,CAAC,QAAQ;MAEjB,gBAAgB,GAAG,CAAC,KAAkB,KACjD,KAAK,CAAC,cAAc;MAET,uBAAuB,GAAG;EACrC,IAAI,QAAQ,CAAC,aAAa,CAAC,+CAA+C,CAAC,EAAE;IAC3E,OAAO,IAAI,CAAC;GACb;OAAM;IACL,OAAO,KAAK,CAAC;GACd;AACH,EAAE;AAEK,MAAM,OAAO,GAAG,CAAC,EAAe;EACrC,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC,CAAC;MAEW,oBAAoB,GAAG,CAClC,EAAe,EACf,UAAsC;EAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;EACzB,IAAI,IAAI,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;GAC5C;AACH,EAAE;MAEW,uBAAuB,GAAG,CACrC,EAAe,EACf,UAAsC;EAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;EACzB,IAAI,IAAI,KAAK,IAAI,EAAE;IACjB,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;GAC/C;AACH,EAAE;MAEW,OAAO,GAAG,CAAC,EAAU,EAAE,IAAI,GAAG,EAAE;EAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;EAC5B,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,KAAK,CAAC;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["IcThemeForegroundEnum"],"sources":["./src/utils/constants.ts","./src/utils/helpers.ts"],"sourcesContent":["import errorIcon from \"../assets/error-icon.svg\";\nimport infoIcon from \"../assets/info-icon.svg\";\nimport neutralIcon from \"../assets/neutral-icon.svg\";\nimport successIcon from \"../assets/success-icon.svg\";\nimport warningIcon from \"../assets/warning-icon.svg\";\n\n// Global status icons\nexport const VARIANT_ICONS = {\n neutral: {\n icon: neutralIcon,\n ariaLabel: \"Neutral\",\n },\n info: {\n icon: infoIcon,\n ariaLabel: \"For your information\",\n },\n warning: {\n icon: warningIcon,\n ariaLabel: \"Warning\",\n },\n error: {\n icon: errorIcon,\n ariaLabel: \"Error\",\n },\n success: {\n icon: successIcon,\n ariaLabel: \"Success\",\n },\n};\n\n// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n\n/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours\n * The brightness difference must be greater than 125 to provide good colour visibility\n * Calculated by:\n * - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)\n * - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)\n */\nexport const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;\nexport const WHITE_MAX_COLOR_BRIGHTNESS = 130;\n","import { EventEmitter } from \"@stencil/core\";\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n} from \"./types\";\n\nimport {\n IcMenuOption,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../utils/types\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\n\n/**\n * Used to inherit global attributes set on the host. Called in componentWillLoad and assigned\n * to a variable that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (\n element: HTMLElement,\n attributes: string[] = []\n): { [key: string]: unknown } => {\n const attributeObject: { [key: string]: unknown } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = element.getAttribute(attr);\n }\n element.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n};\n\nexport const debounceEvent = (\n event: EventEmitter,\n wait: number\n): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait),\n } as EventEmitter;\n};\n\nexport const debounce = (\n func: (...args: unknown[]) => void,\n wait = 0\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * This method is used to add a hidden input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param always Add a hidden input even if the container does not use Shadow\n * @param container The element where the input will be added\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n */\nexport const renderHiddenInput = (\n always: boolean,\n container: HTMLElement,\n name: string,\n value: string | undefined | null,\n disabled: boolean\n): void => {\n if (name !== undefined) {\n if (always || hasShadowDom(container)) {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.type = \"hidden\";\n input.classList.add(\"ic-input\");\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n input.value = value || \"\";\n }\n }\n};\n\nexport const removeHiddenInput = (container: HTMLElement): void => {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n const input = filtered[0] as HTMLInputElement;\n input?.remove();\n};\n\nexport const hasShadowDom = (el: HTMLElement): boolean => {\n return !!el.shadowRoot && !!el.attachShadow;\n};\n\nexport const getInputHelperTextID = (id: string): string => {\n return id + \"-helper-text\";\n};\n\nexport const getInputValidationTextID = (id: string): string => {\n return id + \"-validation-text\";\n};\n\nexport const getInputDescribedByText = (\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string => {\n return `${helperText ? getInputHelperTextID(inputId) : \"\"} ${\n validationText ? getInputValidationTextID(inputId) : \"\"\n }`.trim();\n};\n\n/**\n * This method helps to understand the context in which a component exists,\n * to assist with choosing appropriate foreground colours to use. For example,\n * this method will help you use the 'white' version of a button if it's within\n * a block colour element using white foreground text.\n *\n * This only works for components/elements passed via <slot> and not if they\n * are part of an IC component.\n *\n * \"\"\n * @returns IcThemeForeground depending on the context\n */\nexport const getThemeFromContext = (\n el: Element,\n themeFromEvent: IcThemeForeground = null\n): IcThemeForeground => {\n const parentElement =\n el.parentElement || (<ShadowRoot>el.getRootNode()).host.parentElement;\n const blockColorParent = parentElement.closest(\n IC_BLOCK_COLOR_COMPONENTS.join(\",\")\n );\n\n // If within a block color component\n if (blockColorParent !== null) {\n const parentTag = blockColorParent.tagName.toLowerCase();\n const currentTag = el.tagName.toLowerCase();\n\n if (IC_BLOCK_COLOR_EXCEPTIONS[parentTag]?.includes(currentTag)) {\n return IcThemeForegroundEnum.Default;\n } else if (\n themeFromEvent !== null &&\n !IC_FIXED_COLOR_COMPONENTS.includes(parentTag)\n ) {\n return themeFromEvent;\n } else if (\n blockColorParent.classList.contains(IcThemeForegroundEnum.Dark)\n ) {\n return IcThemeForegroundEnum.Dark;\n }\n\n return IcThemeForegroundEnum.Light;\n }\n\n return IcThemeForegroundEnum.Default;\n};\n\nexport const isMobileOrTablet = (): boolean => {\n let isMobileOrTablet = false;\n if (\"maxTouchPoints\" in navigator) {\n isMobileOrTablet = navigator.maxTouchPoints > 0;\n }\n return isMobileOrTablet;\n};\n\n/**\n * Will create a button within the lightDOM which interacts with the parent form.\n * This is required as buttons within the shadowDOM will not invoke a submit or reset\n *\n * @param form - parent form element which contains shadowDom button\n * @param button - shadowDOM button\n */\nexport const handleHiddenFormButtonClick = (\n form: HTMLFormElement,\n button: HTMLIcButtonElement | HTMLButtonElement\n): void => {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", button.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n};\n\nexport const isEmptyString = (value: string): boolean => {\n if (!value) {\n return true;\n }\n\n return value.trim().length === 0;\n};\n\n/**\n * Extracts the label using the value from an object. Requires the object to have a label and value property.\n * @param value - value from object\n * @param options - list of menu items\n * @returns - label corresponding to value\n */\nexport const getLabelFromValue = (\n value: string,\n options: IcMenuOption[]\n): string | undefined => {\n const ungroupedOptions: IcMenuOption[] = [];\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option: IcMenuOption) =>\n ungroupedOptions.push(option)\n );\n } else {\n ungroupedOptions.push(option);\n }\n });\n return ungroupedOptions.find((option) => option.value === value)?.label;\n }\n\n return undefined;\n};\n\n/**\n * Filters the options based on the search string.\n * @param options - array of options\n * @param includeDescriptions - determines whether option descriptions are included when filtering options\n * @param searchString - string used to filter the options\n * @param position - whether the search string matches the start of or anywhere in the options\n * @returns filtered array of options\n */\nexport const getFilteredMenuOptions = (\n options: IcMenuOption[],\n includeDescriptions: boolean,\n searchString: string,\n position: IcSearchMatchPositions\n): IcMenuOption[] => {\n let rawFilteredOptions;\n\n if (position === \"anywhere\") {\n rawFilteredOptions = options.filter((option) => {\n if (includeDescriptions) {\n return (\n option.label.toLowerCase().includes(searchString.toLowerCase()) ||\n option.description?.toLowerCase().includes(searchString.toLowerCase())\n );\n } else {\n return option.label.toLowerCase().includes(searchString.toLowerCase());\n }\n });\n } else {\n rawFilteredOptions = options.filter((option) => {\n if (includeDescriptions) {\n return (\n option.label.toLowerCase().startsWith(searchString.toLowerCase()) ||\n option.description\n ?.toLowerCase()\n .startsWith(searchString.toLowerCase())\n );\n } else {\n return option.label\n .toLowerCase()\n .startsWith(searchString.toLowerCase());\n }\n });\n }\n\n return rawFilteredOptions;\n};\n\nexport const deviceSizeMatches = (size: number): boolean =>\n window.matchMedia(`(max-width: ${size}px)`).matches;\n\nexport const getCurrentDeviceSize = (): number => {\n if (deviceSizeMatches(DEVICE_SIZES.S)) {\n return DEVICE_SIZES.S;\n }\n if (deviceSizeMatches(DEVICE_SIZES.M)) {\n return DEVICE_SIZES.M;\n }\n if (deviceSizeMatches(DEVICE_SIZES.L)) {\n return DEVICE_SIZES.L;\n }\n if (deviceSizeMatches(DEVICE_SIZES.XL)) {\n return DEVICE_SIZES.XL;\n }\n //fallback needed as all of above get initialised to 0 in jest tests\n return DEVICE_SIZES.UNDEFINED;\n};\n\nexport const getCssProperty = (cssVar: string): string => {\n return getComputedStyle(document.documentElement).getPropertyValue(cssVar);\n};\n\n/**\n * Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:\n * - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding them together and dividing by 1000\n * This is a similar calculation to its CSS counterpart: \"--ic-theme-text\"\n * @returns number representing the brightness of the theme colour\n */\nexport const getThemeColorBrightness = (): number => {\n const themeRed = getCssProperty(\"--ic-theme-primary-r\");\n const themeGreen = getCssProperty(\"--ic-theme-primary-g\");\n const themeBlue = getCssProperty(\"--ic-theme-primary-b\");\n const themeColorBrightness =\n (parseInt(themeRed) * 299 +\n parseInt(themeGreen) * 587 +\n parseInt(themeBlue) * 114) /\n 1000;\n return themeColorBrightness;\n};\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n */\nexport const getThemeForegroundColor = (): IcThemeForeground => {\n return getThemeColorBrightness() > DARK_MODE_THRESHOLD\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n};\n\nexport const getSlot = (element: HTMLElement, name: string): Element | null => {\n if (element && element.querySelector) {\n return element.querySelector(`[slot=\"${name}\"]`);\n }\n return null;\n};\n\nexport const slotHasContent = (element: HTMLElement, name: string): boolean =>\n getSlot(element, name) !== null;\n\nexport const getSlotContent = (\n element: HTMLElement,\n name: string\n): Element[] | NodeListOf<ChildNode> | null => {\n const slot = getSlot(element, name);\n if (slot) {\n return getSlotElements(slot);\n }\n\n return null;\n};\n\nexport const getSlotElements = (slot: Element) => {\n const slotContent = slot.firstElementChild as HTMLSlotElement;\n\n if (slotContent !== null) {\n const elements = slotContent.assignedElements\n ? slotContent.assignedElements()\n : slotContent.childNodes;\n return elements.length ? elements : null;\n } else {\n //check for single element\n return slot === null ? null : [slot];\n }\n};\n\nexport const getNavItemParentDetails = (\n el: HTMLElement\n): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n switch (getParentElementType(el)) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(el.parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: getParentElement(el) };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: getParentElement(el) };\n break;\n case \"IC-PAGE-HEADER\":\n navType = { navType: \"page-header\", parent: null };\n break;\n }\n return navType;\n};\n\nexport const DEVICE_SIZES = {\n XS: Number(getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")), // 0\n S: Number(getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")), // 576\n M: Number(getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")), // 768\n L: Number(getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")), // 992\n XL: Number(getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")), // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => {\n return status !== \"\" && !disabled;\n};\n\nexport const isSlotUsed = (element: HTMLElement, slotName: string): boolean => {\n return Array.from(element.children).some(\n (child) => child.getAttribute(\"slot\") === slotName\n );\n};\n\n// added as a common method to allow detection of gatsby hydration issue, where (camelCase) props are initially undefined & then update\n// with a value. Allows a callback function to be executed when this is the case\nexport const onComponentPropUndefinedChange = (\n oldValue: string | undefined,\n newValue: string | undefined,\n callback: IcCallbackFunctionNoReturn\n): void => {\n if (oldValue === undefined && newValue !== oldValue) {\n callback();\n }\n};\n\nexport const onComponentRequiredPropUndefined = (\n props: IcPropObject[],\n component: string\n): void => {\n for (let i = 0; i < props.length; i++) {\n const { prop, propName } = props[i];\n if (prop === null || prop === undefined) {\n console.error(\n `No ${propName} specified for ${component} component - prop '${propName}' (web components) / '${kebabToCamelCase(\n propName\n )}' (react) required`\n );\n }\n }\n};\n\nexport const kebabToCamelCase = (kebabCase: string): string => {\n kebabCase = kebabCase.toLowerCase();\n const individualWords: string[] = kebabCase.split(\"-\");\n let camelCase = individualWords[0];\n for (let i = 1; i < individualWords.length; i++) {\n camelCase +=\n individualWords[i].substring(0, 1).toUpperCase() +\n individualWords[i].substring(1);\n }\n return camelCase;\n};\n\nexport const checkResizeObserver = (\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n if (\n typeof window !== \"undefined\" &&\n typeof window.ResizeObserver !== \"undefined\"\n ) {\n callbackFn();\n }\n};\n\nconst hex2dec = function (v: string) {\n return parseInt(v, 16);\n};\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n let c;\n if (hex.length === 4) {\n c = hex.replace(\"#\", \"\").split(\"\");\n return {\n r: hex2dec(c[0] + c[0]),\n g: hex2dec(c[1] + c[1]),\n b: hex2dec(c[2] + c[2]),\n a: 1,\n };\n } else {\n return {\n r: hex2dec(hex.slice(1, 3)),\n g: hex2dec(hex.slice(3, 5)),\n b: hex2dec(hex.slice(5)),\n a: 1,\n };\n }\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const fourthChar = rgbaStr.slice(3, 4);\n let colorRGBA: IcColorRGBA;\n if (fourthChar.toLowerCase() === \"a\") {\n colorRGBA = { r: null, g: null, b: null, a: null };\n const rgba = rgbaStr\n .substring(5, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgba[0]);\n colorRGBA.g = Number(rgba[1]);\n colorRGBA.b = Number(rgba[2]);\n colorRGBA.a = Number(rgba[3]);\n } else {\n colorRGBA = { r: null, g: null, b: null, a: 1 };\n const rgb = rgbaStr\n .substring(4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgb[0]);\n colorRGBA.g = Number(rgb[1]);\n colorRGBA.b = Number(rgb[2]);\n }\n\n return colorRGBA;\n};\n\nexport const elementOverflowsX = (element: HTMLElement): boolean => {\n return element.scrollWidth > element.clientWidth;\n};\n/**\n *\n * @param child - The child element\n * @returns string\n */\nexport const getParentElementType = (child: HTMLElement): string =>\n child.parentElement.tagName;\n\nexport const getParentElement = (child: HTMLElement): HTMLElement =>\n child.parentElement;\n\nexport const hasClassificationBanner = (): boolean => {\n if (document.querySelector(\"ic-classification-banner:not([inline='true'])\")) {\n return true;\n } else {\n return false;\n }\n};\n\nexport const getForm = (el: HTMLElement): HTMLFormElement | null => {\n return el.closest(\"FORM\");\n};\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.addEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.removeEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const pxToRem = (px: string, base = 16) => {\n const tempPx = parseInt(px);\n return `${(1 / base) * tempPx}rem`;\n};\n"],"version":3}
@@ -1,2 +0,0 @@
1
- import{r as t,h as e,H as i,g as o}from"./p-589f6dd3.js";const a='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.ic-typography-vertical-margins-h1){margin:0 0 var(--ic-space-xl)}:host(.ic-typography-vertical-margins-h2){margin:var(--ic-space-xxl) 0 var(--ic-space-lg)}:host(.ic-typography-vertical-margins-h3){margin:var(--ic-space-xl) 0 var(--ic-space-md)}:host(.ic-typography-vertical-margins-h4){margin:var(--ic-space-lg) 0 var(--ic-space-md)}:host(.ic-typography-vertical-margins-subtitle-large),:host(.ic-typography-vertical-margins-subtitle-small),:host(.ic-typography-vertical-margins-body),:host(.ic-typography-vertical-margins-code-large),:host(.ic-typography-vertical-margins-code-small),:host(.ic-typography-vertical-margins-code-extra-small){margin:0 0 var(--ic-space-md)}:host(.ic-typography-vertical-margins-caption),:host(.ic-typography-vertical-margins-caption-uppercase){margin:0 0 var(--ic-space-xs)}:host(.ic-typography-vertical-margins-h2:first-child),:host(.ic-typography-vertical-margins-h3:first-child),:host(.ic-typography-vertical-margins-h4:first-child){margin-top:0}:host(.ic-typography-h1){font:var(--ic-font-h1)}:host(.ic-typography-h2){font:var(--ic-font-h2);letter-spacing:var(--ic-font-letter-spacing-0pt0025)}:host(.ic-typography-h3){font:var(--ic-font-h3)}:host(.ic-typography-h4){font:var(--ic-font-h4);letter-spacing:var(--ic-font-letter-spacing-0pt0015)}:host(.ic-typography-subtitle-large){font:var(--ic-font-subtitle-large);letter-spacing:var(--ic-font-letter-spacing-0pt0015)}:host(.ic-typography-subtitle-small){font:var(--ic-font-subtitle-small);letter-spacing:var(--ic-font-letter-spacing-0pt0015)}:host(.ic-typography-body){font:var(--ic-font-body);letter-spacing:var(--ic-font-letter-spacing-0pt005)}:host(.ic-typography-caption){font:var(--ic-font-caption);letter-spacing:var(--ic-font-letter-spacing-0pt0025)}:host(.ic-typography-caption-uppercase){font:var(--ic-font-caption);letter-spacing:var(--ic-font-letter-spacing-0pt0025);text-transform:uppercase}:host(.ic-typography-label){font:var(--ic-font-label);letter-spacing:var(--ic-font-letter-spacing-0pt025)}:host(.ic-typography-label-uppercase){font:var(--ic-font-label);letter-spacing:var(--ic-font-letter-spacing-0pt025);text-transform:uppercase}:host(.ic-typography-code-large){font:var(--ic-font-code-large);letter-spacing:var(--ic-font-letter-spacing-0pt025)}:host(.ic-typography-code-small){font:var(--ic-font-code-small);letter-spacing:var(--ic-font-letter-spacing-0pt005)}:host(.ic-typography-code-extra-small){font:var(--ic-font-code-extra-small);letter-spacing:var(--ic-font-letter-spacing-0pt025)}:host(.ic-typography-no-wrap){white-space:nowrap}:host ::slotted(h1),:host ::slotted(h2),:host ::slotted(h3),:host ::slotted(h4),:host ::slotted(h5),:host ::slotted(h6),:host ::slotted(p),:host ::slotted(label){font:inherit;letter-spacing:inherit}';const r=class{constructor(e){t(this,e);this.variant="body";this.applyVerticalMargins=false}render(){const{variant:t,applyVerticalMargins:o}=this;return e(i,{class:{[`ic-typography-${t}`]:true,[`ic-typography-vertical-margins-${t}`]:o}},e("slot",null))}get el(){return o(this)}};r.style=a;export{r as ic_typography};
2
- //# sourceMappingURL=p-14835d6f.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-typography/ic-typography.css?tag=ic-typography&encapsulation=shadow","src/components/ic-typography/ic-typography.tsx"],"names":["icTypographyCss","Typography","[object Object]","variant","applyVerticalMargins","this","h","Host","class"],"mappings":"yDAAA,MAAMA,EAAkB,4jKCSXC,EAAU,4CAMoB,iCAKA,MAEzCC,SACE,MAAMC,QAAEA,EAAOC,qBAAEA,GAAyBC,KAE1C,OACEC,EAACC,EAAI,CACHC,MAAO,CACLN,CAAC,iBAAiBC,KAAY,KAC9BD,CAAC,kCAAkCC,KAAYC,IAGjDE,EAAA,OAAA","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n}\n\n:host(.ic-typography-vertical-margins-h1) {\n margin: 0 0 var(--ic-space-xl);\n}\n\n:host(.ic-typography-vertical-margins-h2) {\n margin: var(--ic-space-xxl) 0 var(--ic-space-lg);\n}\n\n:host(.ic-typography-vertical-margins-h3) {\n margin: var(--ic-space-xl) 0 var(--ic-space-md);\n}\n\n:host(.ic-typography-vertical-margins-h4) {\n margin: var(--ic-space-lg) 0 var(--ic-space-md);\n}\n\n:host(.ic-typography-vertical-margins-subtitle-large),\n:host(.ic-typography-vertical-margins-subtitle-small),\n:host(.ic-typography-vertical-margins-body),\n:host(.ic-typography-vertical-margins-code-large),\n:host(.ic-typography-vertical-margins-code-small),\n:host(.ic-typography-vertical-margins-code-extra-small) {\n margin: 0 0 var(--ic-space-md);\n}\n\n:host(.ic-typography-vertical-margins-caption),\n:host(.ic-typography-vertical-margins-caption-uppercase) {\n margin: 0 0 var(--ic-space-xs);\n}\n\n:host(.ic-typography-vertical-margins-h2:first-child),\n:host(.ic-typography-vertical-margins-h3:first-child),\n:host(.ic-typography-vertical-margins-h4:first-child) {\n margin-top: 0;\n}\n\n:host(.ic-typography-h1) {\n font: var(--ic-font-h1);\n}\n\n:host(.ic-typography-h2) {\n font: var(--ic-font-h2);\n letter-spacing: var(--ic-font-letter-spacing-0pt0025);\n}\n\n:host(.ic-typography-h3) {\n font: var(--ic-font-h3);\n}\n\n:host(.ic-typography-h4) {\n font: var(--ic-font-h4);\n letter-spacing: var(--ic-font-letter-spacing-0pt0015);\n}\n\n:host(.ic-typography-subtitle-large) {\n font: var(--ic-font-subtitle-large);\n letter-spacing: var(--ic-font-letter-spacing-0pt0015);\n}\n\n:host(.ic-typography-subtitle-small) {\n font: var(--ic-font-subtitle-small);\n letter-spacing: var(--ic-font-letter-spacing-0pt0015);\n}\n\n:host(.ic-typography-body) {\n font: var(--ic-font-body);\n letter-spacing: var(--ic-font-letter-spacing-0pt005);\n}\n\n:host(.ic-typography-caption) {\n font: var(--ic-font-caption);\n letter-spacing: var(--ic-font-letter-spacing-0pt0025);\n}\n\n:host(.ic-typography-caption-uppercase) {\n font: var(--ic-font-caption);\n letter-spacing: var(--ic-font-letter-spacing-0pt0025);\n text-transform: uppercase;\n}\n\n:host(.ic-typography-label) {\n font: var(--ic-font-label);\n letter-spacing: var(--ic-font-letter-spacing-0pt025);\n}\n\n:host(.ic-typography-label-uppercase) {\n font: var(--ic-font-label);\n letter-spacing: var(--ic-font-letter-spacing-0pt025);\n text-transform: uppercase;\n}\n\n:host(.ic-typography-code-large) {\n font: var(--ic-font-code-large);\n letter-spacing: var(--ic-font-letter-spacing-0pt025);\n}\n\n:host(.ic-typography-code-small) {\n font: var(--ic-font-code-small);\n letter-spacing: var(--ic-font-letter-spacing-0pt005);\n}\n\n:host(.ic-typography-code-extra-small) {\n font: var(--ic-font-code-extra-small);\n letter-spacing: var(--ic-font-letter-spacing-0pt025);\n}\n\n:host(.ic-typography-no-wrap) {\n white-space: nowrap;\n}\n\n:host ::slotted(h1),\n:host ::slotted(h2),\n:host ::slotted(h3),\n:host ::slotted(h4),\n:host ::slotted(h5),\n:host ::slotted(h6),\n:host ::slotted(p),\n:host ::slotted(label) {\n font: inherit;\n letter-spacing: inherit;\n}\n","import { Component, Prop, h, Element, Host } from \"@stencil/core\";\n\nimport { IcTypographyVariants } from \"../../utils/types\";\n\n@Component({\n styleUrl: \"ic-typography.css\",\n tag: \"ic-typography\",\n shadow: true,\n})\nexport class Typography {\n @Element() el: HTMLIcTypographyElement;\n\n /**\n * The ICDS typography style to use.\n */\n @Prop() variant?: IcTypographyVariants = \"body\";\n\n /**\n * If `true`, appropriate top and bottom margins will be applied to the typography.\n */\n @Prop() applyVerticalMargins?: boolean = false;\n\n render() {\n const { variant, applyVerticalMargins } = this;\n\n return (\n <Host\n class={{\n [`ic-typography-${variant}`]: true,\n [`ic-typography-vertical-margins-${variant}`]: applyVerticalMargins,\n }}\n >\n <slot />\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{r as s,h as i,H as t,g as e}from"./p-589f6dd3.js";import{D as l,g as a,c as h}from"./p-3dea2867.js";import"./p-6f57b13c.js";const c=":host{display:block}:host ol{display:flex;list-style-type:none;align-items:center;flex-wrap:wrap;padding:0;margin:0}:host(.back) ol ::slotted(ic-breadcrumb){display:none}:host(.back) ol ::slotted(ic-breadcrumb.show){display:flex}:host(.collapsed) ol ::slotted(ic-breadcrumb.hide){display:none;opacity:0;visibility:hidden}:host(.collapsed) ol ::slotted(ic-breadcrumb.visuallyhidden){display:block;opacity:0;transition:all var(--ic-easing-transition-slow)}:host(.collapsed) ol ::slotted(ic-breadcrumb.fade){opacity:1}";const o=class{constructor(i){s(this,i);this.ADD_CLASS_DELAY=50;this.setBackBreadcrumb=()=>{if(this.backBreadcrumbOnly){this.setBackBreadcrumbAttr()}};this.setBackBreadcrumbAttr=()=>{const s=this.getLastParentBreadcrumb();if(s){s.classList.add("show");s.setAttribute("show-back-icon","true")}};this.getLastParentBreadcrumb=()=>{const s=Array.from(this.el.querySelectorAll("ic-breadcrumb"));if(s.length===1){return null}this.breadcrumbs=s.filter((s=>!s.getAttribute("current")));this.breadcrumb=this.breadcrumbs[this.breadcrumbs.length-1];return this.breadcrumb};this.setDefaultBreadcrumbs=()=>{const s=Array.from(this.el.querySelectorAll("ic-breadcrumb"));s.forEach((s=>{s.setAttribute("show-back-icon","false")}))};this.setCollapsed=()=>{if(this.collapsed){const s=Array.from(this.el.querySelectorAll("ic-breadcrumb"));this.collapsedBreadcrumbs=s.splice(1,s.length-2).filter((s=>!s.classList.contains("collapsed-breadcrumb-wrapper")));this.collapsedBreadcrumbs.forEach((s=>s.classList.add("hide")));const i=s[0];if(i){i.insertAdjacentElement("afterend",this.collapsedBreadcrumbWrapper)}}};this.renderCollapsedBreadcrumb=()=>{this.collapsedBreadcrumbWrapper=document.createElement("ic-breadcrumb");this.collapsedBreadcrumbWrapper.classList.add("collapsed-breadcrumb-wrapper");const s=document.createElement("button");const i=document.createElement("span");i.id="collapsed-button-label";i.innerText="Collapsed breadcrumbs";i.className="hide";s.setAttribute("aria-labelledby","collapsed-button-label");const t=document.createElement("span");t.id="collapsed-button-described";t.innerText="Select to view collapsed breadcrumbs";t.className="hide";s.setAttribute("aria-describedby","collapsed-button-described");s.id="collapsed-ellipsis";s.innerText="...";s.classList.add("collapsed-breadcrumb");s.addEventListener("click",(()=>{this.handleHiddenCollapsedBreadcrumbs(this.collapsedBreadcrumbWrapper)}));this.collapsedBreadcrumbWrapper.append(t);this.collapsedBreadcrumbWrapper.append(i);this.collapsedBreadcrumbWrapper.append(s);return this.collapsedBreadcrumbWrapper};this.handleHiddenCollapsedBreadcrumbs=s=>{s.remove();this.collapsedBreadcrumbs.forEach((s=>{s.classList.add("visuallyhidden");s.classList.remove("hide");setTimeout((()=>{s.classList.add("fade")}),this.ADD_CLASS_DELAY);this.removeVisuallyHiddenClass(s)}));this.expandedBreadcrumbs=true};this.removeVisuallyHiddenClass=s=>{s.addEventListener("transitionend",(i=>{if(i.propertyName==="opacity"){s.classList.remove("visuallyhidden")}}))};this.setLastParentCollapsedBackBreadcrumb=()=>{const s=this.getLastParentBreadcrumb();this.setBackBreadcrumbAttr();s.classList.remove("hide")};this.revertLastParentCollapsedBreadcrumb=()=>{const s=this.getLastParentBreadcrumb();s.setAttribute("show-back-icon","false")};this.resizeObserver=null;this.resizeObserverCallback=s=>{if(s!==this.deviceSize){this.deviceSize=s;if(this.deviceSize<=l.S){this.el.setAttribute("back-breadcrumb-only","true");if(this.collapsed){this.setLastParentCollapsedBackBreadcrumb()}else{this.setBackBreadcrumb()}}else{this.el.setAttribute("back-breadcrumb-only","false");if(this.collapsed&&this.breadcrumbs&&this.breadcrumbs.length>2){this.revertLastParentCollapsedBreadcrumb();if(this.expandedBreadcrumbs){this.setDefaultBreadcrumbs()}else{this.setCollapsed()}}else{this.setDefaultBreadcrumbs()}}}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const s=a();this.resizeObserverCallback(s)}));this.resizeObserver.observe(this.el)};this.backBreadcrumbOnly=false;this.collapsed=false;this.deviceSize=l.XL;this.expandedBreadcrumbs=false}componentWillLoad(){const s=Array.from(this.el.querySelectorAll("ic-breadcrumb"));if(this.backBreadcrumbOnly){this.setBackBreadcrumb()}else{h(this.runResizeObserver)}if(this.collapsed){this.collapsedBreadcrumbWrapper=this.renderCollapsedBreadcrumb();if(s.length>2){if(a()===l.S){this.setLastParentCollapsedBackBreadcrumb()}else{this.setCollapsed()}}}}render(){return i(t,{class:{back:this.backBreadcrumbOnly,collapsed:this.collapsed}},i("nav",{"aria-label":"breadcrumbs"},i("ol",null,i("slot",null))))}get el(){return e(this)}};o.style=c;export{o as ic_breadcrumb_group};
2
- //# sourceMappingURL=p-276f7ecb.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-breadcrumb-group/ic-breadcrumb-group.css?tag=ic-breadcrumb-group&encapsulation=shadow","src/components/ic-breadcrumb-group/ic-breadcrumb-group.tsx"],"names":["icBreadcrumbGroupCss","BreadcrumbGroup","this","ADD_CLASS_DELAY","setBackBreadcrumb","backBreadcrumbOnly","setBackBreadcrumbAttr","lastParentBreadcrumb","getLastParentBreadcrumb","classList","add","setAttribute","allBreadcrumbs","Array","from","el","querySelectorAll","length","breadcrumbs","filter","breadcrumb","getAttribute","setDefaultBreadcrumbs","forEach","setCollapsed","collapsed","collapsedBreadcrumbs","splice","contains","firstBreadcrumb","insertAdjacentElement","collapsedBreadcrumbWrapper","renderCollapsedBreadcrumb","document","createElement","collapsedBreadcrumbEl","ariaLabel","id","innerText","className","ariaDescribed","addEventListener","handleHiddenCollapsedBreadcrumbs","append","remove","setTimeout","removeVisuallyHiddenClass","expandedBreadcrumbs","e","propertyName","setLastParentCollapsedBackBreadcrumb","revertLastParentCollapsedBreadcrumb","resizeObserver","resizeObserverCallback","currSize","deviceSize","DEVICE_SIZES","S","runResizeObserver","ResizeObserver","getCurrentDeviceSize","observe","XL","[object Object]","checkResizeObserver","h","Host","class","back","aria-label"],"mappings":"mIAAA,MAAMA,EAAuB,4gBCchBC,EAAe,+BAiBlBC,KAAAC,gBAAkB,GAGlBD,KAAAE,kBAAoB,KAC1B,GAAIF,KAAKG,mBAAoB,CAC3BH,KAAKI,0BAIDJ,KAAAI,sBAAwB,KAC9B,MAAMC,EAAuBL,KAAKM,0BAClC,GAAID,EAAsB,CACxBA,EAAqBE,UAAUC,IAAI,QACnCH,EAAqBI,aAAa,iBAAkB,UAIhDT,KAAAM,wBAA0B,KAChC,MAAMI,EAAiBC,MAAMC,KAC3BZ,KAAKa,GAAGC,iBAAiB,kBAG3B,GAAIJ,EAAeK,SAAW,EAAG,CAC/B,OAAO,KAGTf,KAAKgB,YAAcN,EAAeO,QAC/BC,IAAgBA,EAAWC,aAAa,aAE3CnB,KAAKkB,WAAalB,KAAKgB,YAAYhB,KAAKgB,YAAYD,OAAS,GAE7D,OAAOf,KAAKkB,YAGNlB,KAAAoB,sBAAwB,KAC9B,MAAMV,EAAiBC,MAAM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AAoB,CAC3BH,KAAKE,wBACA,CACL4D,EAAoB9D,KAAKwD,mBAG3B,GAAIxD,KAAKuB,UAAW,CAClBvB,KAAK6B,2BAA6B7B,KAAK8B,4BAEvC,GAAIpB,EAAeK,OAAS,EAAG,CAC7B,GAAI2C,MAA2BJ,EAAaC,EAAG,CAC7CvD,KAAKgD,2CACA,CACLhD,KAAKsB,kBAMbuC,SACE,OACEE,EAACC,EAAI,CACHC,MAAO,CACLC,KAAMlE,KAAKG,mBACXoB,UAAWvB,KAAKuB,YAGlBwC,EAAA,MAAA,CAAAI,aAAgB,eACdJ,EAAA,KAAA,KACEA,EAAA,OAAA","sourcesContent":[":host {\n display: block;\n}\n\n:host ol {\n display: flex;\n list-style-type: none;\n align-items: center;\n flex-wrap: wrap;\n padding: 0;\n margin: 0;\n}\n\n:host(.back) ol ::slotted(ic-breadcrumb) {\n display: none;\n}\n\n:host(.back) ol ::slotted(ic-breadcrumb.show) {\n display: flex;\n}\n\n:host(.collapsed) ol ::slotted(ic-breadcrumb.hide) {\n display: none;\n opacity: 0;\n visibility: hidden;\n}\n\n:host(.collapsed) ol ::slotted(ic-breadcrumb.visuallyhidden) {\n display: block;\n opacity: 0;\n transition: all var(--ic-easing-transition-slow);\n}\n\n:host(.collapsed) ol ::slotted(ic-breadcrumb.fade) {\n opacity: 1;\n}\n","import { Component, Host, h, Element, Prop, State } from \"@stencil/core\";\nimport {\n checkResizeObserver,\n DEVICE_SIZES,\n getCurrentDeviceSize,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-breadcrumb-group\",\n styleUrl: \"ic-breadcrumb-group.css\",\n shadow: true,\n})\n\n// Added ResizeObserver to find out width of breadcrumbs and parents. Use side navigation long title for ref.\nexport class BreadcrumbGroup {\n @Element() el: HTMLIcBreadcrumbGroupElement;\n /**\n * If `true`, display only a single breadcrumb for the parent page with a back icon.\n */\n @Prop() backBreadcrumbOnly: boolean = false;\n /**\n * If `true`, all breadcrumbs between the first and last breadcrumb will be collapsed.\n */\n @Prop() collapsed: boolean = false;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n @State() expandedBreadcrumbs: boolean = false;\n\n private breadcrumbs: HTMLIcBreadcrumbElement[];\n private breadcrumb: HTMLIcBreadcrumbElement;\n private collapsedBreadcrumbs: HTMLIcBreadcrumbElement[];\n private ADD_CLASS_DELAY = 50;\n private collapsedBreadcrumbWrapper: HTMLIcBreadcrumbElement;\n\n private setBackBreadcrumb = () => {\n if (this.backBreadcrumbOnly) {\n this.setBackBreadcrumbAttr();\n }\n };\n\n private setBackBreadcrumbAttr = () => {\n const lastParentBreadcrumb = this.getLastParentBreadcrumb();\n if (lastParentBreadcrumb) {\n lastParentBreadcrumb.classList.add(\"show\");\n lastParentBreadcrumb.setAttribute(\"show-back-icon\", \"true\");\n }\n };\n\n private getLastParentBreadcrumb = (): HTMLIcBreadcrumbElement | null => {\n const allBreadcrumbs = Array.from(\n this.el.querySelectorAll(\"ic-breadcrumb\")\n );\n\n if (allBreadcrumbs.length === 1) {\n return null;\n }\n\n this.breadcrumbs = allBreadcrumbs.filter(\n (breadcrumb) => !breadcrumb.getAttribute(\"current\")\n );\n this.breadcrumb = this.breadcrumbs[this.breadcrumbs.length - 1];\n\n return this.breadcrumb;\n };\n\n private setDefaultBreadcrumbs = () => {\n const allBreadcrumbs = Array.from(\n this.el.querySelectorAll(\"ic-breadcrumb\")\n );\n allBreadcrumbs.forEach((breadcrumb) => {\n breadcrumb.setAttribute(\"show-back-icon\", \"false\");\n });\n };\n\n private setCollapsed = () => {\n if (this.collapsed) {\n const allBreadcrumbs = Array.from(\n this.el.querySelectorAll(\"ic-breadcrumb\")\n );\n this.collapsedBreadcrumbs = allBreadcrumbs\n .splice(1, allBreadcrumbs.length - 2)\n .filter(\n (breadcrumb) =>\n !breadcrumb.classList.contains(\"collapsed-breadcrumb-wrapper\")\n );\n\n this.collapsedBreadcrumbs.forEach((breadcrumb) =>\n breadcrumb.classList.add(\"hide\")\n );\n\n const firstBreadcrumb = allBreadcrumbs[0];\n\n if (firstBreadcrumb) {\n firstBreadcrumb.insertAdjacentElement(\n \"afterend\",\n this.collapsedBreadcrumbWrapper\n );\n }\n }\n };\n\n private renderCollapsedBreadcrumb = () => {\n this.collapsedBreadcrumbWrapper = document.createElement(\"ic-breadcrumb\");\n this.collapsedBreadcrumbWrapper.classList.add(\n \"collapsed-breadcrumb-wrapper\"\n );\n const collapsedBreadcrumbEl = document.createElement(\"button\");\n\n const ariaLabel = document.createElement(\"span\");\n ariaLabel.id = \"collapsed-button-label\";\n ariaLabel.innerText = \"Collapsed breadcrumbs\";\n ariaLabel.className = \"hide\";\n collapsedBreadcrumbEl.setAttribute(\n \"aria-labelledby\",\n \"collapsed-button-label\"\n );\n\n const ariaDescribed = document.createElement(\"span\");\n ariaDescribed.id = \"collapsed-button-described\";\n ariaDescribed.innerText = \"Select to view collapsed breadcrumbs\";\n ariaDescribed.className = \"hide\";\n collapsedBreadcrumbEl.setAttribute(\n \"aria-describedby\",\n \"collapsed-button-described\"\n );\n\n collapsedBreadcrumbEl.id = \"collapsed-ellipsis\";\n collapsedBreadcrumbEl.innerText = \"...\";\n collapsedBreadcrumbEl.classList.add(\"collapsed-breadcrumb\");\n collapsedBreadcrumbEl.addEventListener(\"click\", () => {\n this.handleHiddenCollapsedBreadcrumbs(this.collapsedBreadcrumbWrapper);\n });\n\n this.collapsedBreadcrumbWrapper.append(ariaDescribed);\n this.collapsedBreadcrumbWrapper.append(ariaLabel);\n this.collapsedBreadcrumbWrapper.append(collapsedBreadcrumbEl);\n\n return this.collapsedBreadcrumbWrapper;\n };\n\n private handleHiddenCollapsedBreadcrumbs = (\n collapsedBreadcrumbWrapper: HTMLIcBreadcrumbElement\n ) => {\n collapsedBreadcrumbWrapper.remove();\n this.collapsedBreadcrumbs.forEach((breadcrumb) => {\n breadcrumb.classList.add(\"visuallyhidden\");\n breadcrumb.classList.remove(\"hide\");\n setTimeout(() => {\n breadcrumb.classList.add(\"fade\");\n }, this.ADD_CLASS_DELAY);\n\n this.removeVisuallyHiddenClass(breadcrumb);\n });\n this.expandedBreadcrumbs = true;\n };\n\n private removeVisuallyHiddenClass = (breadcrumb: HTMLIcBreadcrumbElement) => {\n breadcrumb.addEventListener(\"transitionend\", (e) => {\n if (e.propertyName === \"opacity\") {\n breadcrumb.classList.remove(\"visuallyhidden\");\n }\n });\n };\n\n private setLastParentCollapsedBackBreadcrumb = () => {\n const lastParentBreadcrumb = this.getLastParentBreadcrumb();\n this.setBackBreadcrumbAttr();\n lastParentBreadcrumb.classList.remove(\"hide\");\n };\n\n private revertLastParentCollapsedBreadcrumb = () => {\n const lastParentBreadcrumb = this.getLastParentBreadcrumb();\n lastParentBreadcrumb.setAttribute(\"show-back-icon\", \"false\");\n };\n\n private resizeObserver: ResizeObserver = null;\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n\n if (this.deviceSize <= DEVICE_SIZES.S) {\n this.el.setAttribute(\"back-breadcrumb-only\", \"true\");\n if (this.collapsed) {\n this.setLastParentCollapsedBackBreadcrumb();\n } else {\n this.setBackBreadcrumb();\n }\n } else {\n this.el.setAttribute(\"back-breadcrumb-only\", \"false\");\n if (this.collapsed && this.breadcrumbs && this.breadcrumbs.length > 2) {\n this.revertLastParentCollapsedBreadcrumb();\n if (this.expandedBreadcrumbs) {\n this.setDefaultBreadcrumbs();\n } else {\n this.setCollapsed();\n }\n } else {\n this.setDefaultBreadcrumbs();\n }\n }\n }\n };\n\n private runResizeObserver = () => {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.el);\n };\n\n componentWillLoad(): void {\n const allBreadcrumbs = Array.from(\n this.el.querySelectorAll(\"ic-breadcrumb\")\n );\n\n if (this.backBreadcrumbOnly) {\n this.setBackBreadcrumb();\n } else {\n checkResizeObserver(this.runResizeObserver);\n }\n\n if (this.collapsed) {\n this.collapsedBreadcrumbWrapper = this.renderCollapsedBreadcrumb();\n\n if (allBreadcrumbs.length > 2) {\n if (getCurrentDeviceSize() === DEVICE_SIZES.S) {\n this.setLastParentCollapsedBackBreadcrumb();\n } else {\n this.setCollapsed();\n }\n }\n }\n }\n\n render() {\n return (\n <Host\n class={{\n back: this.backBreadcrumbOnly,\n collapsed: this.collapsed,\n }}\n >\n <nav aria-label=\"breadcrumbs\">\n <ol>\n <slot />\n </ol>\n </nav>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-checkbox/ic-checkbox.css?tag=ic-checkbox&encapsulation=shadow","src/components/ic-checkbox/ic-checkbox.tsx"],"names":["icCheckboxCss","Checkbox","this","handleClick","checked","icCheck","emit","checkboxChecked","handleFormReset","initiallyChecked","[object Object]","checkboxEl","host","shadowRoot","querySelector","focus","additionalFieldDisplay","textfield","setAttribute","removeAttribute","additionalFieldContainer","style","display","addFormResetListener","_a","addEventListener","e","stopImmediatePropagation","onComponentRequiredPropUndefined","prop","label","propName","value","removeFormResetListener","removeEventListener","id","undefined","groupLabel","replace","renderHiddenInput","name","disabled","removeHiddenInput","h","Host","class","small","indeterminate","width","height","viewBox","xmlns","fill-rule","clip-rule","d","role","type","onClick","variant","htmlFor","isSlotUsed","ref","el","aria-live","dynamicText","additional-field-wrapper"],"mappings":"+JAAA,MAAMA,EAAgB,4lMC6BTC,EAAQ,iHA4DXC,KAAAC,YAAc,KACpBD,KAAKE,SAAWF,KAAKE,QACrBF,KAAKG,QAAQC,OACbJ,KAAKK,gBAAgBD,QAGfJ,KAAAM,gBAAkB,KACxBN,KAAKE,QAAUF,KAAKO,+BA/DsC,oBAI/B,+GAoBC,yEAK5B,4BAI+B,iBAKP,4BAEEP,KAAKE,QA8BjCM,iBACE,MAAMC,EACJT,KAAKU,KAAKC,WAAWC,cAAc,aACrC,GAAIH,EAAY,CACdA,EAAWI,SAIfL,qBACE,GAAIR,KAAKc,yBAA2B,SAAU,CAC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EVV,EAAA,QAAA,KAAA,kBACAA,EAAA,OAAA,CAAMW,EAAE,yFAGXpD,KAAKE,SAAWF,KAAK6C,eACpBJ,EAAA,MAAA,CAAKE,MAAM,yBAEbF,EAAA,QAAA,CACEY,KAAK,WACLV,MAAO,CACLnC,CAAC,YAAa,KACdA,CAAC,WAAYR,KAAKE,QAClBM,CAAC,iBAAkBR,KAAK6C,eAE1BS,KAAK,WACLhB,KAAMtC,KAAKsC,KACXL,GAAIA,EACJH,MAAO9B,KAAK8B,MACZS,SAAUvC,KAAKuC,SAAW,KAAO,KACjCrC,QAASF,KAAKE,QACd2C,cAAe7C,KAAK6C,cACpBU,QAASvD,KAAKC,cAEhBwC,EAAA,gBAAA,CAAeE,MAAM,iBAAiBa,QAAQ,QAC5Cf,EAAA,QAAA,CAAOgB,QAASxB,GAAKjC,KAAK4B,SAG7B8B,EAAW1D,KAAKU,KAAM,qBACrB+B,EAAA,MAAA,CACEE,MAAM,oBACNgB,IAAMC,GAAQ5D,KAAKkB,yBAA2B0C,GAE7C5D,KAAKc,yBAA2B,WAC/B2B,EAAA,MAAA,CAAKE,MAAM,kBAEbF,EAAA,MAAA,KACGzC,KAAKc,yBAA2B,WAC/B2B,EAAA,gBAAA,CAAee,QAAQ,WACrBf,EAAA,IAAA,CAAGE,MAAM,eAAckB,YAAW,UAC/B7D,KAAK8D,cAIZrB,EAAA,MAAA,CACEE,MAAO,CACLoB,2BACE/D,KAAKc,yBAA2B,WAGpC2B,EAAA,OAAA,CAAMH,KAAK","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host(.disabled) {\n color: var(--ic-architectural-200);\n pointer-events: none;\n}\n\n.container {\n display: flex;\n width: fit-content;\n padding: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);\n margin-bottom: var(--ic-space-xxs);\n align-items: center;\n}\n\n:host(.small) .container {\n margin-bottom: var(--ic-space-xxxs);\n}\n\n.checkbox {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: block;\n position: relative;\n top: 0;\n left: 0;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n background-color: transparent;\n border: var(--ic-space-1px) solid var(--ic-architectural-300);\n border-radius: var(--ic-border-radius);\n outline: none;\n cursor: pointer;\n transition: var(--ic-easing-transition-fast);\n flex-shrink: 0;\n}\n\n.checkbox:checked {\n background-color: var(--ic-action-default);\n border: var(--ic-space-1px) solid var(--ic-action-default);\n transition: var(--ic-easing-transition-slow);\n}\n\n.checkbox:checked:disabled {\n background-color: var(--ic-architectural-200);\n}\n\n.checkbox:indeterminate,\n.checkbox.indeterminate:checked {\n background-color: transparent;\n border: 0.125rem solid var(--ic-action-default);\n}\n\n.checkbox:checked:hover {\n background-color: var(--ic-action-default-hover);\n}\n\n.checkbox:indeterminate:hover,\n.checkbox.indeterminate:checked:hover {\n background-color: var(--ic-action-default-bg-hover);\n border: 0.125rem solid var(--ic-action-default-hover);\n}\n\n.checkbox:checked:active {\n background-color: var(--ic-action-default-active);\n}\n\n.checkbox:indeterminate:active,\n.checkbox.indeterminate:checked:active {\n background-color: var(--ic-action-default-bg-active);\n border: 0.125rem solid var(--ic-action-default-active);\n}\n\n.checkbox:hover {\n background-color: var(--ic-action-default-bg-hover);\n box-shadow: 0 0 0 0.25rem var(--ic-action-default-bg-hover);\n border: var(--ic-space-1px) solid var(--ic-action-default-hover);\n}\n\n.checkbox:active {\n background-color: var(--ic-action-default-bg-active);\n box-shadow: 0 0 0 0.25rem var(--ic-action-default-bg-active);\n border: var(--ic-space-1px) solid var(--ic-action-default-active);\n}\n\n.checkbox:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.checkbox:disabled {\n border: var(--ic-space-1px) dashed var(--ic-architectural-200);\n}\n\n.checkbox-label {\n padding-left: var(--ic-space-sm);\n}\n\n.checkbox-label:hover {\n cursor: pointer;\n}\n\n.checkmark {\n position: relative;\n right: calc(-1 * var(--ic-space-lg));\n margin-left: calc(-1 * var(--ic-space-lg));\n fill: white;\n z-index: 1;\n background-color: transparent;\n pointer-events: none;\n flex-shrink: 0;\n}\n\n.indeterminate-symbol {\n position: relative;\n width: 0.875rem;\n height: var(--ic-space-xxxs);\n right: -1.188rem;\n margin-left: -0.875rem;\n z-index: 1;\n background-color: var(--ic-action-default);\n pointer-events: none;\n flex-shrink: 0;\n}\n\n.container:hover .indeterminate-symbol {\n background-color: var(--ic-action-default-hover);\n}\n\n.container:active .indeterminate-symbol {\n background-color: var(--ic-action-default-active);\n}\n\n.additional-field-wrapper {\n margin-left: calc(var(--ic-space-md) + var(--ic-space-lg));\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n.branch-corner {\n color: var(--ic-action-default);\n height: var(--ic-space-md);\n width: var(--ic-space-xl);\n border-radius: 0 0 0 0.188rem;\n border-bottom: 0.125rem solid var(--ic-action-default);\n border-left: 0.125rem solid var(--ic-action-default);\n}\n\n.dynamic-container {\n display: flex;\n position: relative;\n margin: var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);\n gap: var(--ic-space-xs);\n}\n\n.dynamic-text {\n color: var(--ic-action-default);\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-bottom: var(--ic-space-xs);\n border-radius: 2%;\n}\n\n@media (max-width: 576px) {\n ::slotted(ic-text-field) {\n --input-width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n .checkbox {\n appearance: revert;\n transition: none;\n }\n\n .checkbox:checked {\n transition: none;\n }\n\n .checkbox:focus-visible {\n outline: 0.125rem solid highlight;\n }\n\n .checkbox:disabled:not(:checked) {\n appearance: none;\n border-color: GrayText;\n }\n\n .checkmark {\n fill: none;\n }\n\n .indeterminate-symbol {\n display: none;\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n} from \"@stencil/core\";\nimport { IcAdditionalFieldTypes } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n} from \"../../utils/helpers\";\n\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class Checkbox {\n /**\n * If `true`, the checkbox will be set to the checked state.\n */\n @Prop({ reflect: true, mutable: true }) checked?: boolean = false;\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled?: boolean = false;\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n /**\n * The value for the checkbox.\n */\n @Prop() value!: string;\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop() name: string;\n /**\n * The group label for the checkbox.\n */\n @Prop() groupLabel: string;\n /**\n * The text to be displayed when dynamic.\n */\n @Prop() dynamicText: string = \"This selection requires additional answers\";\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate: boolean = false;\n\n /**\n * If true, the small styling will be applied to the checkbox.\n */\n @Prop() small?: boolean = false;\n\n @State() initiallyChecked = this.checked;\n\n @Element() host: HTMLIcCheckboxElement;\n\n /**\n * @deprecated This event should not be used anymore. Use icCheck instead.\n */\n @Event() checkboxChecked: EventEmitter<void>;\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n private additionalFieldContainer: HTMLDivElement;\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.icCheck.emit();\n this.checkboxChecked.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n const checkboxEl: HTMLElement =\n this.host.shadowRoot.querySelector(\".checkbox\");\n if (checkboxEl) {\n checkboxEl.focus();\n }\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const textfield = this.host.querySelector(\"ic-text-field\");\n if (!this.checked) {\n textfield && textfield.setAttribute(\"disabled\", \"\");\n } else {\n textfield && textfield.removeAttribute(\"disabled\");\n }\n } else {\n if (!this.checked) {\n this.additionalFieldContainer.style.display = \"none\";\n } else {\n this.additionalFieldContainer.style.display = \"flex\";\n }\n }\n }\n\n componentWillLoad(): void {\n addFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(\"ic-text-field\")\n ?.addEventListener(\"icChange\", (e) => e.stopImmediatePropagation());\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [\n { prop: this.label, propName: \"label\" },\n { prop: this.value, propName: \"value\" },\n ],\n \"Checkbox\"\n );\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.host, this.handleFormReset);\n this.host\n .querySelector(\"ic-text-field\")\n ?.removeEventListener(\"icChange\", (e) => e.stopImmediatePropagation());\n }\n\n render() {\n let id = `ic-checkbox-${\n this.label !== undefined ? this.label : this.value\n }-${this.groupLabel}`;\n\n id = id.replace(/ /g, \"-\");\n\n this.checked\n ? renderHiddenInput(\n true,\n this.host,\n this.name,\n this.checked && this.value,\n this.disabled\n )\n : removeHiddenInput(this.host);\n\n return (\n <Host class={{ [\"disabled\"]: this.disabled, [\"small\"]: this.small }}>\n <div class=\"container\">\n {this.checked && !this.indeterminate && (\n <svg\n class=\"checkmark\"\n width=\"1.5rem\"\n height=\"1.5rem\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n )}\n {this.checked && this.indeterminate && (\n <div class=\"indeterminate-symbol\" />\n )}\n <input\n role=\"checkbox\"\n class={{\n [\"checkbox\"]: true,\n [\"checked\"]: this.checked,\n [\"indeterminate\"]: this.indeterminate,\n }}\n type=\"checkbox\"\n name={this.name}\n id={id}\n value={this.value}\n disabled={this.disabled ? true : null}\n checked={this.checked}\n indeterminate={this.indeterminate}\n onClick={this.handleClick}\n ></input>\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={id}>{this.label}</label>\n </ic-typography>\n </div>\n {isSlotUsed(this.host, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {this.additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {this.additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\" aria-live=\"polite\">\n {this.dynamicText}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n this.additionalFieldDisplay === \"static\",\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{r as t,c as e,h as i,H as s,g as a}from"./p-589f6dd3.js";import{a as n}from"./p-6f57b13c.js";import{J as o,m as r,d as l,a as h,r as c,h as d,e as u,i as p,K as m,n as b}from"./p-3dea2867.js";const f='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.fullwidth){width:100%}::-moz-placeholder{color:var(--ic-color-tertiary-text);opacity:1}::placeholder{color:var(--ic-color-tertiary-text);opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs)}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(--ic-architectural-200)}input.readonly,textarea.readonly{color:var(--ic-color-primary-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.maxlengthtext{color:var(--ic-color-secondary-text)}.error{color:var(--ic-status-error)}.disabled{color:var(--ic-architectural-200)}.no-left-pad{padding-left:0}::slotted([slot="icon"]){fill:var(--ic-color-tertiary-text)}.has-value ::slotted([slot="icon"]){fill:var(--ic-color-primary-text)}.charcount{margin-right:calc(-1 * var(--ic-space-xxxs))}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-results-button,input[type="search"]::-webkit-search-results-decoration{display:none}input[type="search"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot="icon"]){fill:currentcolor}}';let y=0;const v=class{constructor(i){t(this,i);this.icKeydown=e(this,"icKeydown",7);this.icInput=e(this,"icInput",7);this.icBlur=e(this,"icBlur",7);this.icFocus=e(this,"icFocus",7);this.icChange=e(this,"icChange",7);this.getValidationText=e(this,"getValidationText",7);this.inheritedAttributes={};this.showLeftIcon=this.hasLeftIconSlot();this.onInput=t=>{this.value=t.target.value;this.icInput.emit({value:this.value})};this.onBlur=t=>{const e=t.target.value;this.icBlur.emit({value:e})};this.onFocus=t=>{const e=t.target.value;this.icFocus.emit({value:e})};this.isTextArea=()=>this.rows>1;this.getInlineValidationText=()=>{this.getValidationText.emit({value:this.validationText})};this.hasStatus=t=>t!==""&&!this.disabled;this.showStatusText=t=>{if(this.hasStatus(t)&&!(t==n.Success&&this.validationInline)&&!this.validationInlineInternal){return true}return false};this.handleFormReset=()=>{this.value=this.initialValue};this.inputId=`ic-text-field-input-${y++}`;this.label=undefined;this.required=false;this.disabled=false;this.readonly=false;this.placeholder="";this.fullWidth=false;this.hideLabel=false;this.helperText="";this.rows=1;this.resize=false;this.small=false;this.value="";this.min=undefined;this.max=undefined;this.maxLength=0;this.validationStatus="";this.validationText="";this.validationInline=false;this.validationInlineInternal=false;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autoFocus=false;this.debounce=0;this.type="text";this.inputmode="text";this.name=this.inputId;this.spellcheck=false;this.ariaActiveDescendant=undefined;this.truncateValue=undefined;this.ariaExpanded=undefined;this.ariaOwns=undefined;this.ariaAutocomplete=undefined;this.role=undefined;this.hiddenInput=true;this.numChars=0;this.maxLengthExceeded=false;this.minValueUnattained=false;this.maxValueExceeded=false;this.initialValue=this.value}debounceChanged(){this.icChange=o(this.icChange,this.debounce)}watchValueHandler(t){if(this.inputEl&&this.inputEl.value!==t){this.inputEl.value=t}this.numChars=t.length;if(this.type==="number"){if(t&&Number(t)<Number(this.min)){this.minValueUnattained=true}else{this.minValueUnattained=false}if(Number(t)>Number(this.max)){this.maxValueExceeded=true}else{this.maxValueExceeded=false}}if(this.maxLength>0){if(t.length>this.maxLength){this.maxLengthExceeded=true}else{this.maxLengthExceeded=false}}this.icChange.emit({value:t})}async setFocus(){if(this.inputEl){this.inputEl.focus()}}handleKeyDown(t){this.icKeydown.emit({event:t});t.cancelBubble=true}hasLeftIconSlot(){const t=this.el.querySelector(`[slot="icon"]`);if(t!=null){return true}return false}connectedCallback(){this.debounceChanged()}componentWillLoad(){this.watchValueHandler(this.value);this.inheritedAttributes=r(this.el,[...b,"title","aria-autocomplete","aria-haspopup"]);if(this.readonly){this.maxLengthExceeded=false;this.maxValueExceeded=false;this.minValueUnattained=false}l(this.el,this.handleFormReset)}componentDidLoad(){h([{prop:this.label,propName:"label"}],"Text Field");if(this.validationInlineInternal){this.getInlineValidationText()}}disconnectedCallback(){c(this.el,this.handleFormReset)}render(){const{inputId:t,name:e,label:a,required:o,small:r,placeholder:l,helperText:h,rows:c,resize:b,disabled:f,value:y,min:v,max:x,maxLength:g,numChars:w,readonly:k,maxLengthExceeded:z,minValueUnattained:I,maxValueExceeded:F,validationStatus:L,validationText:j,validationInline:T,validationInlineInternal:q,spellcheck:C,inputmode:V,fullWidth:M,truncateValue:N,hiddenInput:B}=this;const W=k?true:f;const $=f?"":l;const H=z||F||I?n.Error:L;const K=z?"Maximum length exceeded":F?`Maximum value of ${x} exceeded`:I?`Minimum value of ${v} not met`:j;const S=k?0:g;const D=z||F||I||g===0&&H===n.Error?"assertive":"polite";const E=this.showStatusText(H);const O=this.isTextArea();const _=g>0?t+"-charcount-desc":"";const J=(_+" "+d(t,h!=="",E)).trim();if(this.showLeftIcon){if(!k&&W){this.showLeftIcon=false}}const U=H===n.Error?"true":"false";const A=W&&!k;if(B){u(true,this.el,e,y,W)}return i(s,{class:{["fullwidth"]:M}},i("ic-input-container",{readonly:k,disabled:W},!this.hideLabel&&i("ic-input-label",{for:t,label:a,helperText:h,required:o,disabled:A,readonly:k}),i("ic-input-component-container",{small:r,validationStatus:H,multiLine:O,disabled:W,readonly:k,validationInline:T,fullWidth:M},this.showLeftIcon&&i("span",{class:{["readonly"]:k,["has-value"]:y.length>0},slot:"left-icon"},i("slot",{name:"icon"})),!O&&i("input",Object.assign({id:t,name:e,ref:t=>this.inputEl=t,type:this.type,min:v,max:x,value:y,class:{["no-left-pad"]:!this.showLeftIcon&&k,["readonly"]:k,["truncate-value"]:N},placeholder:$,required:o,disabled:W,readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":a,"aria-describedby":J,"aria-invalid":U,"aria-activedescendant":this.ariaActiveDescendant,"aria-expanded":this.ariaExpanded,"aria-owns":this.ariaOwns,autocomplete:this.autocomplete,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:C,inputmode:V,role:this.role},this.inheritedAttributes)),O&&i("textarea",Object.assign({id:t,class:{["no-resize"]:b===false||k,["no-left-pad"]:!this.showLeftIcon&&k,["readonly"]:k},name:e,ref:t=>this.inputEl=t,value:y,rows:c,required:o,disabled:W,placeholder:$,readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":a,"aria-describedby":J,"aria-invalid":U,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:C,inputmode:V},this.inheritedAttributes)),p(this.el,"clear-button")&&i("slot",{name:"clear-button"}),p(this.el,"search-submit-button")&&i("slot",{name:"search-submit-button"})),p(this.el,"menu")&&i("slot",{name:"menu"}),(!m(L)||!m(j)||S>0||F||I)&&!q&&i("ic-input-validation",{status:this.hasStatus(H)===false||H===n.Success&&T||q?"":H,message:E?K:"",ariaLiveMode:D,for:t,fullWidth:M},!k&&S>0&&i("div",{slot:"validation-message-adornment"},i("ic-typography",{variant:"caption",class:{["maxlengthtext"]:true,["error"]:z,["disabled"]:A}},i("span",{"aria-live":"polite",id:`${t}-charcount`,class:"charcount"},w,"/",S),i("span",{hidden:true,id:_},"Field can contain a maximum of ",S," characters."))))))}get el(){return a(this)}static get watchers(){return{debounce:["debounceChanged"],value:["watchValueHandler"]}}};v.style=f;export{v as ic_text_field};
2
- //# sourceMappingURL=p-3c23f963.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-text-field/ic-text-field.css?tag=ic-text-field&encapsulation=shadow","src/components/ic-text-field/ic-text-field.tsx"],"names":["icTextFieldCss","inputIds","TextField","this","inheritedAttributes","showLeftIcon","hasLeftIconSlot","onInput","ev","value","target","icInput","emit","onBlur","icBlur","onFocus","icFocus","isTextArea","rows","getInlineValidationText","getValidationText","validationText","hasStatus","status","disabled","showStatusText","IcInformationStatus","Success","validationInline","validationInlineInternal","handleFormReset","initialValue","undefined","inputId","[object Object]","icChange","debounceEvent","debounce","newValue","inputEl","numChars","length","type","Number","min","minValueUnattained","max","maxValueExceeded","maxLength","maxLengthExceeded","focus","icKeydown","event","cancelBubble","iconEl","el","querySelector","debounceChanged","watchValueHandler","inheritAttributes","IC_INHERITED_ARIA","readonly","addFormResetListener","onComponentRequiredPropUndefined","prop","label","propName","removeFormResetListener","name","required","small","placeholder","helperText","resize","validationStatus","spellcheck","inputmode","fullWidth","truncateValue","hiddenInput","disabledMode","placeholderText","currentStatus","Error","currentValidationText","maxNumChars","messageAriaLive","multiline","hiddenCharCountDescId","describedBy","getInputDescribedByText","trim","invalid","disabledText","renderHiddenInput","h","Host","class","hideLabel","for","multiLine","slot","Object","assign","id","ref","aria-label","aria-describedby","aria-invalid","aria-activedescendant","ariaActiveDescendant","aria-expanded","ariaExpanded","aria-owns","ariaOwns","autocomplete","autocapitalize","autoFocus","role","isSlotUsed","isEmptyString","message","ariaLiveMode","variant","aria-live","hidden"],"mappings":"uMAAA,MAAMA,EAAiB,+8HCuCvB,IAAIC,EAAW,QAUFC,EAAS,6PAIZC,KAAAC,oBAAgD,GAsIhDD,KAAAE,aAAwBF,KAAKG,kBA8H7BH,KAAAI,QAAWC,IACjBL,KAAKM,MAASD,EAAGE,OAA4BD,MAC7CN,KAAKQ,QAAQC,KAAK,CAAEH,MAAON,KAAKM,SAO1BN,KAAAU,OAAUL,IAChB,MAAMC,EAASD,EAAGE,OAA4BD,MAC9CN,KAAKW,OAAOF,KAAK,CAAEH,MAAOA,KAOpBN,KAAAY,QAAWP,IACjB,MAAMC,EAASD,EAAGE,OAA4BD,MAC9CN,KAAKa,QAAQJ,KAAK,CAAEH,MAAOA,KAQrBN,KAAAc,WAAa,IACZd,KAAKe,KAAO,EAQbf,KAAAgB,wBAA0B,KAChChB,KAAKiB,kBAAkBR,KAAK,CAAEH,MAAON,KAAKkB,kBAWpClB,KAAAmB,UAAaC,GACZA,IAAW,KAAOpB,KAAKqB,SAGxBrB,KAAAsB,eAAkBF,IACxB,GACEpB,KAAKmB,UAAUC,MACbA,GAAUG,EAAoBC,SAAWxB,KAAKyB,oBAC/CzB,KAAK0B,yBACN,CACA,OAAO,KAET,OAAO,OAGD1B,KAAA2B,gBAAkB,KACxB3B,KAAKM,MAAQN,KAAK4B,2BA1TO,uBAAuB9B,yCAUtB,oBAIA,oBAKiB,uBAKf,kBAMD,qBAKA,sBAK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da,IAAKlE,EACL4C,UAAWA,IAEThB,GAAYwB,EAAc,GAC1BU,EAAA,MAAA,CAAKM,KAAK,gCACRN,EAAA,gBAAA,CACE4B,QAAQ,UACR1B,MAAO,CACL/D,CAAC,iBAAkB,KACnBA,CAAC,SAAUe,EACXf,CAAC,YAAa2D,IAGhBE,EAAA,OAAA,CAAA6B,YACY,SACVpB,GAAI,GAAGvE,cACPgE,MAAM,aAELzD,EAAQ,IAAG6C,GAEdU,EAAA,OAAA,CAAM8B,OAAQ,KAAMrB,GAAIhB,GAAqB,kCACXH,EAAW","sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n /**\n * @prop --input-width: Width of the input field\n */\n display: block;\n}\n\n:host(.fullwidth) {\n width: 100%;\n}\n\n::placeholder {\n color: var(--ic-color-tertiary-text);\n opacity: 1;\n}\n\ninput,\ntextarea {\n border: 0;\n border-radius: var(--ic-border-radius);\n background-color: var(--ic-architectural-white);\n line-height: 1.5rem;\n letter-spacing: 0.005rem;\n width: 100%;\n padding-right: var(--ic-space-xs);\n padding-left: var(--ic-space-xs);\n}\n\ntextarea {\n min-height: var(--ic-space-lg);\n resize: vertical;\n padding-top: 0.375rem;\n}\n\ninput:focus,\ntextarea:focus {\n border: 0;\n outline: 0;\n}\n\ninput:disabled,\ntextarea:disabled {\n color: var(--ic-architectural-200);\n}\n\ninput.readonly,\ntextarea.readonly {\n color: var(--ic-color-primary-text);\n}\n\n/* Chrome, Safari, Edge */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n/* Firefox */\ninput[type=\"number\"] {\n -moz-appearance: textfield;\n}\n\ntextarea.no-resize {\n resize: none;\n}\n\n.maxlengthtext {\n color: var(--ic-color-secondary-text);\n}\n\n.error {\n color: var(--ic-status-error);\n}\n\n.disabled {\n color: var(--ic-architectural-200);\n}\n\n.no-left-pad {\n padding-left: 0;\n}\n\n::slotted([slot=\"icon\"]) {\n fill: var(--ic-color-tertiary-text);\n}\n\n.has-value ::slotted([slot=\"icon\"]) {\n fill: var(--ic-color-primary-text);\n}\n\n.charcount {\n margin-right: calc(-1 * var(--ic-space-xxxs));\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput[type=\"search\"].truncate-value {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n@media (forced-colors: active) {\n input.readonly,\n textarea.readonly {\n color: canvastext;\n }\n\n .has-value ::slotted([slot=\"icon\"]) {\n fill: currentcolor;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n} from \"@stencil/core\";\n\nimport {\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcInformationStatusOrEmpty,\n IcValueEventDetail,\n} from \"../../interface\";\nimport { IcInformationStatus } from \"../../utils/types\";\nimport {\n inheritAttributes,\n debounceEvent,\n getInputDescribedByText,\n renderHiddenInput,\n isEmptyString,\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcAriaAutocompleteTypes,\n IcTextFieldInputModes,\n IcTextFieldTypes,\n} from \"./ic-text-field.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot icon - Content will be placed to the left of the text input.\n */\n@Component({\n tag: \"ic-text-field\",\n styleUrl: \"ic-text-field.css\",\n shadow: true,\n})\nexport class TextField {\n @Element() el: HTMLIcTextFieldElement;\n\n private inputEl: HTMLInputElement | HTMLTextAreaElement;\n private inheritedAttributes: { [k: string]: unknown } = {};\n\n /**\n * @slot clear-button - an ic-button clear component will render as an end adornment to the input.\n * @slot search-submit-button - an ic-button search submit component will render as an end adornment to the input.\n * @slot menu - an ic-menu component will appear below the input.\n */\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-text-field-input-${inputIds++}`;\n\n /**\n * The label for the input.\n */\n @Prop() label!: string;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required: boolean = false;\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * If `true`, the read only state will be set.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * The placeholder value to be displayed.\n */\n @Prop() placeholder: string = \"\";\n\n /**\n * Specify whether the text field fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth: boolean = false;\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 /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string = \"\";\n\n /**\n * The number of rows to transform the text field into a text area with a specific height.\n */\n @Prop() rows: number = 1;\n\n /**\n * If `true`, the multiline text area will be resizeable.\n */\n @Prop() resize: boolean = false;\n\n /**\n * If `true`, the small styling will be applied to the text field.\n */\n @Prop({ reflect: true }) small: boolean = false;\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = \"\";\n\n /**\n * The minimum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of min value in `helperText` or `label`)\n */\n @Prop() min: string | number = undefined;\n\n /**\n * The maximum number that can be accepted as a value, when `type` is `number` and `rows` is `1`. (NOTE: Ensure to include visual indication of max value in `helperText` or `label`)\n */\n @Prop() max: string | number = undefined;\n\n /**\n * The maximum number of characters that can be entered in the field.\n */\n @Prop() maxLength: number = 0;\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationStatus: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The validation state - e.g. 'error' | 'warning' | 'success'.\n */\n @Prop() validationText: string = \"\";\n\n /**\n * If `true`, the icon in input control will be displayed - only applies when validationStatus ='success'.\n */\n @Prop() validationInline: boolean = false;\n\n /**\n * @internal If `true`, the validation will display inline.\n */\n @Prop() validationInlineInternal: boolean = false;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autoFocus = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce: number = 0;\n\n private showLeftIcon: boolean = this.hasLeftIconSlot();\n\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The type of control to display. The default type is text.\n */\n @Prop() type: IcTextFieldTypes = \"text\";\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n @Prop() inputmode: IcTextFieldInputModes = \"text\";\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * If `true`, the value of the text field will have its spelling and grammar checked.\n */\n @Prop() spellcheck: boolean = false;\n\n /**\n * @internal The active element when focus is on the ic-menu items.\n */\n @Prop() ariaActiveDescendant?: string;\n /**\n * @internal If `true`, an ellipsis will be displayed at the end of the value if the value is longer than the container.\n */\n @Prop() truncateValue?: boolean;\n\n /**\n * @internal Used to identify if the slotted menu is rendered\n */\n @Prop() ariaExpanded: string;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwns: string;\n\n /**\n * @internal Used to identify whether inputting any text triggers more predictions\n */\n @Prop() ariaAutocomplete: IcAriaAutocompleteTypes = undefined;\n\n /**\n * @internal Used to set the role if not default textbox;\n */\n @Prop() role: string;\n\n /**\n * @internal If `true`, the hidden form input will stop rendering for form submission.\n */\n @Prop() hiddenInput: boolean = true;\n\n @State() numChars: number = 0;\n @State() maxLengthExceeded: boolean = false;\n @State() minValueUnattained: boolean = false;\n @State() maxValueExceeded: boolean = false;\n @State() initialValue = this.value;\n\n @Watch(\"value\")\n watchValueHandler(newValue: string): void {\n if (this.inputEl && this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n\n this.numChars = newValue.length;\n\n if (this.type === \"number\") {\n if (newValue && Number(newValue) < Number(this.min)) {\n this.minValueUnattained = true;\n } else {\n this.minValueUnattained = false;\n }\n if (Number(newValue) > Number(this.max)) {\n this.maxValueExceeded = true;\n } else {\n this.maxValueExceeded = false;\n }\n }\n\n if (this.maxLength > 0) {\n if (newValue.length > this.maxLength) {\n this.maxLengthExceeded = true;\n } else {\n this.maxLengthExceeded = false;\n }\n }\n this.icChange.emit({ value: newValue });\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.inputEl) {\n this.inputEl.focus();\n }\n }\n\n //stop keydown event bubbling up to storybook\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n this.icKeydown.emit({ event: ev });\n ev.cancelBubble = true;\n }\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n private onInput = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n };\n\n /**\n * Emitted when input loses focus.\n */\n @Event() icBlur: EventEmitter<IcValueEventDetail>;\n private onBlur = (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value;\n this.icBlur.emit({ value: value });\n };\n\n /**\n * Emitted when input gains focus.\n */\n @Event() icFocus: EventEmitter<IcValueEventDetail>;\n private onFocus = (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value;\n this.icFocus.emit({ value: value });\n };\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n private isTextArea = (): boolean => {\n return this.rows > 1;\n };\n\n /**\n * @internal Emitted when the validationInlineInternal is `true`\n */\n @Event() getValidationText: EventEmitter<IcValueEventDetail>;\n\n private getInlineValidationText = () => {\n this.getValidationText.emit({ value: this.validationText });\n };\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n if (iconEl != null) {\n return true;\n }\n return false;\n }\n\n private hasStatus = (status: IcInformationStatusOrEmpty): boolean => {\n return status !== \"\" && !this.disabled;\n };\n\n private showStatusText = (status: IcInformationStatusOrEmpty): boolean => {\n if (\n this.hasStatus(status) &&\n !(status == IcInformationStatus.Success && this.validationInline) &&\n !this.validationInlineInternal\n ) {\n return true;\n }\n return false;\n };\n\n private handleFormReset = (): void => {\n this.value = this.initialValue;\n };\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n componentWillLoad(): void {\n this.watchValueHandler(this.value);\n\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"title\",\n \"aria-autocomplete\",\n \"aria-haspopup\",\n ]);\n\n if (this.readonly) {\n this.maxLengthExceeded = false;\n this.maxValueExceeded = false;\n this.minValueUnattained = false;\n }\n\n addFormResetListener(this.el, this.handleFormReset);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Text Field\"\n );\n if (this.validationInlineInternal) {\n this.getInlineValidationText();\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n small,\n placeholder,\n helperText,\n rows,\n resize,\n disabled,\n value,\n min,\n max,\n maxLength,\n numChars,\n readonly,\n maxLengthExceeded,\n minValueUnattained,\n maxValueExceeded,\n validationStatus,\n validationText,\n validationInline,\n validationInlineInternal,\n spellcheck,\n inputmode,\n fullWidth,\n truncateValue,\n hiddenInput,\n } = this;\n\n const disabledMode = readonly ? true : disabled;\n\n const placeholderText = disabled ? \"\" : placeholder;\n\n const currentStatus =\n maxLengthExceeded || maxValueExceeded || minValueUnattained\n ? IcInformationStatus.Error\n : validationStatus;\n\n const currentValidationText = maxLengthExceeded\n ? \"Maximum length exceeded\"\n : maxValueExceeded\n ? `Maximum value of ${max} exceeded`\n : minValueUnattained\n ? `Minimum value of ${min} not met`\n : validationText;\n\n const maxNumChars = readonly ? 0 : maxLength;\n\n const messageAriaLive =\n maxLengthExceeded ||\n maxValueExceeded ||\n minValueUnattained ||\n (maxLength === 0 && currentStatus === IcInformationStatus.Error)\n ? \"assertive\"\n : \"polite\";\n\n const showStatusText = this.showStatusText(currentStatus);\n const multiline = this.isTextArea();\n const hiddenCharCountDescId =\n maxLength > 0 ? inputId + \"-charcount-desc\" : \"\";\n const describedBy = (\n hiddenCharCountDescId +\n \" \" +\n getInputDescribedByText(inputId, helperText !== \"\", showStatusText)\n ).trim();\n\n if (this.showLeftIcon) {\n if (!readonly && disabledMode) {\n this.showLeftIcon = false;\n }\n }\n\n const invalid =\n currentStatus === IcInformationStatus.Error ? \"true\" : \"false\";\n const disabledText = disabledMode && !readonly;\n\n if (hiddenInput) {\n renderHiddenInput(true, this.el, name, value, disabledMode);\n }\n return (\n <Host class={{ [\"fullwidth\"]: fullWidth }}>\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!this.hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledText}\n readonly={readonly}\n ></ic-input-label>\n )}\n\n <ic-input-component-container\n small={small}\n validationStatus={currentStatus}\n multiLine={multiline}\n disabled={disabledMode}\n readonly={readonly}\n validationInline={validationInline}\n fullWidth={fullWidth}\n >\n {this.showLeftIcon && (\n <span\n class={{\n [\"readonly\"]: readonly,\n [\"has-value\"]: value.length > 0,\n }}\n slot=\"left-icon\"\n >\n <slot name=\"icon\" />\n </span>\n )}\n\n {!multiline && (\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLInputElement)}\n type={this.type}\n min={min}\n max={max}\n value={value}\n class={{\n [\"no-left-pad\"]: !this.showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n [\"truncate-value\"]: truncateValue,\n }}\n placeholder={placeholderText}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-activedescendant={this.ariaActiveDescendant}\n aria-expanded={this.ariaExpanded}\n aria-owns={this.ariaOwns}\n autocomplete={this.autocomplete}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n role={this.role}\n {...this.inheritedAttributes}\n ></input>\n )}\n {multiline && (\n <textarea\n id={inputId}\n class={{\n [\"no-resize\"]: resize === false || readonly,\n [\"no-left-pad\"]: !this.showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n }}\n name={name}\n ref={(el) => (this.inputEl = el as HTMLTextAreaElement)}\n value={value}\n rows={rows}\n required={required}\n disabled={disabledMode}\n placeholder={placeholderText}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n aria-label={label}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n autocapitalize={this.autocapitalize}\n autoFocus={this.autoFocus}\n spellcheck={spellcheck}\n inputmode={inputmode}\n {...this.inheritedAttributes}\n ></textarea>\n )}\n {isSlotUsed(this.el, \"clear-button\") && (\n <slot name=\"clear-button\"></slot>\n )}\n {isSlotUsed(this.el, \"search-submit-button\") && (\n <slot name=\"search-submit-button\"></slot>\n )}\n </ic-input-component-container>\n {isSlotUsed(this.el, \"menu\") && <slot name=\"menu\"></slot>}\n {(!isEmptyString(validationStatus) ||\n !isEmptyString(validationText) ||\n maxNumChars > 0 ||\n maxValueExceeded ||\n minValueUnattained) &&\n !validationInlineInternal && (\n <ic-input-validation\n status={\n this.hasStatus(currentStatus) === false ||\n (currentStatus === IcInformationStatus.Success &&\n validationInline) ||\n validationInlineInternal\n ? \"\"\n : currentStatus\n }\n message={showStatusText ? currentValidationText : \"\"}\n ariaLiveMode={messageAriaLive}\n for={inputId}\n fullWidth={fullWidth}\n >\n {!readonly && maxNumChars > 0 && (\n <div slot=\"validation-message-adornment\">\n <ic-typography\n variant=\"caption\"\n class={{\n [\"maxlengthtext\"]: true,\n [\"error\"]: maxLengthExceeded,\n [\"disabled\"]: disabledText,\n }}\n >\n <span\n aria-live=\"polite\"\n id={`${inputId}-charcount`}\n class=\"charcount\"\n >\n {numChars}/{maxNumChars}\n </span>\n <span hidden={true} id={hiddenCharCountDescId}>\n Field can contain a maximum of {maxNumChars} characters.\n </span>\n </ic-typography>\n </div>\n )}\n </ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-tab/ic-tab.css?tag=ic-tab&encapsulation=shadow","src/components/ic-tab/ic-tab.tsx"],"names":["icTabCss","Tab","this","isInitialRender","focusFromClick","handleClick","tabClick","emit","tabId","contextId","position","tabPosition","tabFocus","handleFocus","focusTabId","handleMouseDown","[object Object]","host","focus","tabCreated","tabContext","document","querySelector","tabRemovedHandler","disabled","selected","appearance","h","Host","class","IcThemeForegroundEnum","Light","role","aria-selected","onClick","onFocus","onMouseDown","aria-disabled","tabindex","name","variant"],"mappings":"oGAAA,MAAMA,EAAW,w7HCyBJC,EAAG,mLA0CNC,KAAAC,gBAA2B,KAC3BD,KAAAE,eAA0B,MAG1BF,KAAAG,YAAc,KACpBH,KAAKI,SAASC,KAAK,CACjBC,MAAON,KAAKM,MACZC,UAAWP,KAAKO,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23 89 188 / 0%);\n --indicator-color: var(--ic-action-default);\n --focus-indicator: var(--ic-border-focus);\n --label-color: var(--ic-color-primary-text);\n --background-color-hover: var(--ic-action-default-bg-hover);\n --background-color-active: var(--ic-action-default-bg-active);\n\n display: flex;\n align-items: center;\n border-radius: 0;\n color: var(--label-color);\n height: 2.5rem;\n padding: 0 var(--ic-space-md);\n cursor: pointer;\n position: relative;\n border-bottom: var(--ic-space-xxs) solid var(--indicator-initial-color);\n gap: var(--ic-space-xs);\n transition: all var(--ic-easing-transition-fast);\n}\n\n:host(:focus) {\n box-shadow: var(--focus-indicator);\n border-radius: var(--ic-border-radius);\n}\n\n:host(:focus-visible) {\n outline: var(--ic-hc-focus-outline);\n}\n\n:host(:hover) {\n background-color: var(--background-color-hover);\n}\n\n:host(:active) {\n background-color: var(--background-color-active);\n}\n\n:host(.ic-tab-light) {\n --indicator-initial-color: rgb(255 255 255 / 0%);\n --indicator-color: rgb(255 255 255 / 100%);\n --focus-indicator: var(--ic-border-focus);\n --label-color: white;\n --background-color-hover: var(--ic-action-dark-bg-hover);\n --background-color-active: var(--ic-action-dark-bg-active);\n}\n\n:host(.selected) {\n border-bottom: var(--ic-space-xxs) solid var(--indicator-color);\n}\n\n:host(.disabled) {\n pointer-events: none;\n color: var(--ic-architectural-300);\n}\n\n:host(.selected.with-transition) {\n transition: all var(--ic-easing-transition-slow),\n border-color var(--ic-transition-duration-slow);\n}\n\n.ic-tab-label {\n pointer-events: none;\n}\n\n::slotted(svg) {\n fill: currentcolor;\n}\n\n@media (forced-colors: active) {\n :host {\n border-bottom: var(--ic-space-xxs) solid canvas;\n }\n\n :host(.disabled) {\n color: GrayText;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n h,\n Method,\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 * @internal Emitted when a tab is dynamically created.\n */\n @Event() tabCreated: EventEmitter<HTMLIcTabElement>;\n\n /**\n * @internal Emitted when a tab is unmounted.\n */\n @Event() tabRemoved: EventEmitter<void>;\n\n private isInitialRender: boolean = true;\n private focusFromClick: boolean = false;\n private focusTabId: string;\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.focusTabId = this.tabId;\n\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 /**\n * Sets focus on the tab.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.host) {\n this.host.focus();\n }\n }\n\n componentDidUpdate(): void {\n this.isInitialRender = false;\n }\n\n connectedCallback(): void {\n this.tabCreated.emit(this.host);\n }\n\n disconnectedCallback(): void {\n const tabContext = document.querySelector(\n `ic-tab-context[context-id=${this.contextId}]`\n ) as HTMLIcTabContextElement;\n tabContext.tabRemovedHandler(!!this.focusTabId);\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 [\"selected\"]: selected,\n [\"disabled\"]: disabled,\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,2 +0,0 @@
1
- import{I as n}from"./p-6f57b13c.js";const t=`<svg aria-labelledby="error-title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000">\n <title id="error-title">Error</title>\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>\n</svg>\n`;const e=`<svg aria-labelledby="info-title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000">\n <title id="info-title">For your information</title>\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>\n</svg>\n`;const r=`<svg aria-labelledby="neutral-title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000">\n <title id="neutral-title">Neutral</title>\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"/>\n</svg>\n`;const s=`<svg aria-labelledby="success-title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000">\n <title id="success-title">Success</title>\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>\n</svg>\n`;const a=`<svg aria-labelledby="warning-title" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000">\n <title id="warning-title">Warning</title>\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>\n</svg>\n`;const i={neutral:{icon:r,ariaLabel:"Neutral"},info:{icon:e,ariaLabel:"For your information"},warning:{icon:a,ariaLabel:"Warning"},error:{icon:t,ariaLabel:"Error"},success:{icon:s,ariaLabel:"Success"}};const o=["aria-atomic","aria-busy","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-relevant","aria-roledescription"];const l={XS:576,S:768,M:992,L:1200,XL:99999};const c=["ic-hero","ic-top-navigation","ic-footer","ic-side-navigation","ic-alert"];const u=["ic-alert"];const d={"ic-alert":["ic-link"]};const p=136.701;const f=130;const v=133.3505;const b=(n,t=[])=>{const e={};t.forEach((t=>{if(n.hasAttribute(t)){const r=n.getAttribute(t);if(r!==null){e[t]=n.getAttribute(t)}n.removeAttribute(t)}}));return e};const m=(n,t)=>{const e=n._original||n;return{_original:n,emit:h(e.emit.bind(e),t)}};const h=(n,t=0)=>{let e;return(...r)=>{clearTimeout(e);e=setTimeout(n,t,...r)}};const g=(n,t,e,r,s)=>{if(e!==undefined){if(n||y(t)){const n=t.querySelectorAll("input.ic-input");const a=Array.from(n);const i=a.filter((n=>t===n.parentElement));let o=i[0];if(o===null||o===undefined){o=t.ownerDocument.createElement("input");o.type="hidden";o.classList.add("ic-input");t.appendChild(o)}o.disabled=s;o.name=e;o.value=r||""}}};const w=n=>{const t=n.querySelectorAll("input.ic-input");const e=Array.from(t);const r=e.filter((t=>n===t.parentElement));const s=r[0];s===null||s===void 0?void 0:s.remove()};const y=n=>!!n.shadowRoot&&!!n.attachShadow;const N=n=>n+"-helper-text";const x=n=>n+"-validation-text";const z=(n,t,e)=>`${t?N(n):""} ${e?x(n):""}`.trim();const I=(t,e=null)=>{var r;const s=t.parentElement||t.getRootNode().host.parentElement;const a=s.closest(c.join(","));if(a!==null){const s=a.tagName.toLowerCase();const i=t.tagName.toLowerCase();if((r=d[s])===null||r===void 0?void 0:r.includes(i)){return n.Default}else if(e!==null&&!u.includes(s)){return e}else if(a.classList.contains(n.Dark)){return n.Dark}return n.Light}return n.Default};const L=()=>{let n=false;if("maxTouchPoints"in navigator){n=navigator.maxTouchPoints>0}return n};const M=(n,t)=>{const e=document.createElement("button");e.setAttribute("type",t.type);e.style.display="none";n.appendChild(e);e.click();e.remove()};const k=n=>{if(!n){return true}return n.trim().length===0};const A=(n,t)=>{var e;const r=[];if(t.length>0&&t.map){t.map((n=>{if(n.children){n.children.map((n=>r.push(n)))}else{r.push(n)}}));return(e=r.find((t=>t.value===n)))===null||e===void 0?void 0:e.label}return undefined};const S=(n,t,e,r)=>{let s;if(r==="anywhere"){s=n.filter((n=>{var r;if(t){return n.label.toLowerCase().includes(e.toLowerCase())||((r=n.description)===null||r===void 0?void 0:r.toLowerCase().includes(e.toLowerCase()))}else{return n.label.toLowerCase().includes(e.toLowerCase())}}))}else{s=n.filter((n=>{var r;if(t){return n.label.toLowerCase().startsWith(e.toLowerCase())||((r=n.description)===null||r===void 0?void 0:r.toLowerCase().startsWith(e.toLowerCase()))}else{return n.label.toLowerCase().startsWith(e.toLowerCase())}}))}return s};const C=n=>window.matchMedia(`(max-width: ${n}px)`).matches;const T=()=>{if(C(P.S)){return P.S}if(C(P.M)){return P.M}if(C(P.L)){return P.L}if(C(P.XL)){return P.XL}return P.UNDEFINED};const E=n=>getComputedStyle(document.documentElement).getPropertyValue(n);const $=()=>{const n=E("--ic-theme-primary-r");const t=E("--ic-theme-primary-g");const e=E("--ic-theme-primary-b");const r=(parseInt(n)*299+parseInt(t)*587+parseInt(e)*114)/1e3;return r};const H=()=>$()>v?n.Dark:n.Light;const O=(n,t)=>{if(n&&n.querySelector){return n.querySelector(`[slot="${t}"]`)}return null};const B=(n,t)=>O(n,t)!==null;const G=(n,t)=>{const e=O(n,t);if(e){return D(e)}return null};const D=n=>{const t=n.firstElementChild;if(t!==null){const n=t.assignedElements?t.assignedElements():t.childNodes;return n.length?n:null}else{return n===null?null:[n]}};const F=n=>{let t={navType:"",parent:null};switch(_(n)){case"IC-NAVIGATION-GROUP":t=F(n.parentElement);break;case"IC-TOP-NAVIGATION":t={navType:"top",parent:Y(n)};break;case"IC-SIDE-NAVIGATION":t={navType:"side",parent:Y(n)};break;case"IC-PAGE-HEADER":t={navType:"page-header",parent:null};break}return t};const P={XS:Number(E("--ic-breakpoint-xs").replace("px","")),S:Number(E("--ic-breakpoint-sm").replace("px","")),M:Number(E("--ic-breakpoint-md").replace("px","")),L:Number(E("--ic-breakpoint-lg").replace("px","")),XL:Number(E("--ic-breakpoint-xl").replace("px","")),UNDEFINED:1200};const V=(n,t)=>n!==""&&!t;const X=(n,t)=>Array.from(n.children).some((n=>n.getAttribute("slot")===t));const R=(n,t,e)=>{if(n===undefined&&t!==n){e()}};const W=(n,t)=>{for(let e=0;e<n.length;e++){const{prop:r,propName:s}=n[e];if(r===null||r===undefined){console.error(`No ${s} specified for ${t} component - prop '${s}' (web components) / '${j(s)}' (react) required`)}}};const j=n=>{n=n.toLowerCase();const t=n.split("-");let e=t[0];for(let n=1;n<t.length;n++){e+=t[n].substring(0,1).toUpperCase()+t[n].substring(1)}return e};const q=n=>{if(typeof window!=="undefined"&&typeof window.ResizeObserver!=="undefined"){n()}};const U=function(n){return parseInt(n,16)};const J=n=>{let t;if(n.length===4){t=n.replace("#","").split("");return{r:U(t[0]+t[0]),g:U(t[1]+t[1]),b:U(t[2]+t[2]),a:1}}else{return{r:U(n.slice(1,3)),g:U(n.slice(3,5)),b:U(n.slice(5)),a:1}}};const K=n=>{const t=n.slice(3,4);let e;if(t.toLowerCase()==="a"){e={r:null,g:null,b:null,a:null};const t=n.substring(5,n.length-1).replace(/ /g,"").split(",");e.r=Number(t[0]);e.g=Number(t[1]);e.b=Number(t[2]);e.a=Number(t[3])}else{e={r:null,g:null,b:null,a:1};const t=n.substring(4,n.length-1).replace(/ /g,"").split(",");e.r=Number(t[0]);e.g=Number(t[1]);e.b=Number(t[2])}return e};const Q=n=>n.scrollWidth>n.clientWidth;const _=n=>n.parentElement.tagName;const Y=n=>n.parentElement;const Z=()=>{if(document.querySelector("ic-classification-banner:not([inline='true'])")){return true}else{return false}};const nn=n=>n.closest("FORM");const tn=(n,t)=>{const e=nn(n);if(e!==null){e.addEventListener("reset",t)}};const en=(n,t)=>{const e=nn(n);if(e!==null){e.removeEventListener("reset",t)}};const rn=(n,t=16)=>{const e=parseInt(n);return`${1/t*e}rem`};export{rn as A,$ as B,p as C,P as D,J as E,K as F,O as G,Y as H,l as I,m as J,k as K,s as L,Q as M,N,x as O,a as P,t as Q,i as V,f as W,W as a,I as b,q as c,tn as d,g as e,w as f,T as g,z as h,X as i,V as j,H as k,Z as l,b as m,o as n,R as o,F as p,_ as q,en as r,B as s,D as t,G as u,M as v,S as w,A as x,L as y,E as z};
2
- //# sourceMappingURL=p-3dea2867.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/utils/constants.ts","src/utils/helpers.ts"],"names":["VARIANT_ICONS","neutral","icon","neutralIcon","ariaLabel","info","infoIcon","warning","warningIcon","error","errorIcon","success","successIcon","IC_INHERITED_ARIA","IC_DEVICE_SIZES","XS","S","M","L","XL","IC_BLOCK_COLOR_COMPONENTS","IC_FIXED_COLOR_COMPONENTS","IC_BLOCK_COLOR_EXCEPTIONS","ic-alert","BLACK_MIN_COLOR_BRIGHTNESS","WHITE_MAX_COLOR_BRIGHTNESS","DARK_MODE_THRESHOLD","inheritAttributes","element","attributes","attributeObject","forEach","attr","hasAttribute","value","getAttribute","removeAttribute","debounceEvent","event","wait","original","_original","emit","debounce","bind","func","timer","args","clearTimeout","setTimeout","renderHiddenInput","always","container","name","disabled","undefined","hasShadowDom","inputs","querySelectorAll","inputEls","Array","from","filtered","filter","el","parentElement","input","ownerDocument","createElement","type","classList","add","appendChild","removeHiddenInput","remove","shadowRoot","attachShadow","getInputHelperTextID","id","getInputValidationTextID","getInputDescribedByText","inputId","helperText","validationText","trim","getThemeFromContext","themeFromEvent","getRootNode","host","blockColorParent","closest","join","parentTag","tagName","toLowerCase","currentTag","_a","includes","IcThemeForegroundEnum","Default","contains","Dark","Light","isMobileOrTablet","navigator","maxTouchPoints","handleHiddenFormButtonClick","form","button","hiddenFormButton","document","setAttribute","style","display","click","isEmptyString","length","getLabelFromValue","options","ungroupedOptions","map","option","children","push","find","label","getFilteredMenuOptions","includeDescriptions","searchString","position","rawFilteredOptions","description","startsWith","deviceSizeMatches","size","window","matchMedia","matches","getCurrentDeviceSize","DEVICE_SIZES","UNDEFINED","getCssProperty","cssVar","getComputedStyle","documentElement","getPropertyValue","getThemeColorBrightness","themeRed","themeGreen","themeBlue","themeColorBrightness","parseInt","getThemeForegroundColor","getSlot","querySelector","slotHasContent","getSlotContent","slot","getSlotElements","slotContent","firstElementChild","elements","assignedElements","childNodes","getNavItemParentDetails","navType","parent","getParentElementType","getParentElement","Number","replace","hasValidationStatus","status","isSlotUsed","slotName","some","child","onComponentPropUndefinedChange","oldValue","newValue","callback","onComponentRequiredPropUndefined","props","component","i","prop","propName","console","kebabToCamelCase","kebabCase","individualWords","split","camelCase","substring","toUpperCase","checkResizeObserver","callbackFn","ResizeObserver","hex2dec","v","hexToRgba","hex","c","r","g","b","a","slice","rgbaStrToObj","rgbaStr","fourthChar","colorRGBA","rgba","rgb","elementOverflowsX","scrollWidth","clientWidth","hasClassificationBanner","getForm","addFormResetListener","addEventListener","removeFormResetListener","removeEventListener","pxToRem","px","base","tempPx"],"mappings":"y4DAOaA,EAAgB,CAC3BC,QAAS,CACPC,KAAMC,EACNC,UAAW,WAEbC,KAAM,CACJH,KAAMI,EACNF,UAAW,wBAEbG,QAAS,CACPL,KAAMM,EACNJ,UAAW,WAEbK,MAAO,CACLP,KAAMQ,EACNN,UAAW,SAEbO,QAAS,CACPT,KAAMU,EACNR,UAAW,kBAKFS,EAAoB,CAC/B,cACA,YACA,gBACA,eACA,mBACA,mBACA,eACA,gBACA,kBACA,oBACA,cACA,eACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,8BAGWC,EAAkB,CAC7BC,GAAI,IACJC,EAAG,IACHC,EAAG,IACHC,EAAG,KACHC,GAAI,OAGC,MAAMC,EAA4B,CACvC,UACA,oBACA,YACA,qBACA,YAGK,MAAMC,EAA4B,CAAC,YAMnC,MAAMC,EAA+C,CAC1DC,W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,EAA0B,KACrC,GAAI3G,SAAS4C,cAAc,iDAAkD,CAC3E,OAAO,SACF,CACL,OAAO,QAIJ,MAAMgE,GAAW1J,GACfA,EAAG0B,QAAQ,cAGPiI,GAAuB,CAClC3J,EACAoI,KAEA,MAAMzF,EAAO+G,GAAQ1J,GACrB,GAAI2C,IAAS,KAAM,CACjBA,EAAKiH,iBAAiB,QAASxB,WAItByB,GAA0B,CACrC7J,EACAoI,KAEA,MAAMzF,EAAO+G,GAAQ1J,GACrB,GAAI2C,IAAS,KAAM,CACjBA,EAAKmH,oBAAoB,QAAS1B,WAIzB2B,GAAU,CAACC,EAAYC,EAAO,MACzC,MAAMC,EAAS3E,SAASyE,GACxB,MAAO,GAAI,EAAIC,EAAQC","sourcesContent":["import errorIcon from \"../assets/error-icon.svg\";\nimport infoIcon from \"../assets/info-icon.svg\";\nimport neutralIcon from \"../assets/neutral-icon.svg\";\nimport successIcon from \"../assets/success-icon.svg\";\nimport warningIcon from \"../assets/warning-icon.svg\";\n\n// Global status icons\nexport const VARIANT_ICONS = {\n neutral: {\n icon: neutralIcon,\n ariaLabel: \"Neutral\",\n },\n info: {\n icon: infoIcon,\n ariaLabel: \"For your information\",\n },\n warning: {\n icon: warningIcon,\n ariaLabel: \"Warning\",\n },\n error: {\n icon: errorIcon,\n ariaLabel: \"Error\",\n },\n success: {\n icon: successIcon,\n ariaLabel: \"Success\",\n },\n};\n\n// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n\n/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours\n * The brightness difference must be greater than 125 to provide good colour visibility\n * Calculated by:\n * - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)\n * - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)\n */\nexport const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;\nexport const WHITE_MAX_COLOR_BRIGHTNESS = 130;\n","import { EventEmitter } from \"@stencil/core\";\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n} from \"./types\";\n\nimport {\n IcMenuOption,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../utils/types\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\n\n/**\n * Used to inherit global attributes set on the host. Called in componentWillLoad and assigned\n * to a variable that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (\n element: HTMLElement,\n attributes: string[] = []\n): { [key: string]: unknown } => {\n const attributeObject: { [key: string]: unknown } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = element.getAttribute(attr);\n }\n element.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n};\n\nexport const debounceEvent = (\n event: EventEmitter,\n wait: number\n): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait),\n } as EventEmitter;\n};\n\nexport const debounce = (\n func: (...args: unknown[]) => void,\n wait = 0\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * This method is used to add a hidden input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param always Add a hidden input even if the container does not use Shadow\n * @param container The element where the input will be added\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n */\nexport const renderHiddenInput = (\n always: boolean,\n container: HTMLElement,\n name: string,\n value: string | undefined | null,\n disabled: boolean\n): void => {\n if (name !== undefined) {\n if (always || hasShadowDom(container)) {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.type = \"hidden\";\n input.classList.add(\"ic-input\");\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n input.value = value || \"\";\n }\n }\n};\n\nexport const removeHiddenInput = (container: HTMLElement): void => {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n const input = filtered[0] as HTMLInputElement;\n input?.remove();\n};\n\nexport const hasShadowDom = (el: HTMLElement): boolean => {\n return !!el.shadowRoot && !!el.attachShadow;\n};\n\nexport const getInputHelperTextID = (id: string): string => {\n return id + \"-helper-text\";\n};\n\nexport const getInputValidationTextID = (id: string): string => {\n return id + \"-validation-text\";\n};\n\nexport const getInputDescribedByText = (\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string => {\n return `${helperText ? getInputHelperTextID(inputId) : \"\"} ${\n validationText ? getInputValidationTextID(inputId) : \"\"\n }`.trim();\n};\n\n/**\n * This method helps to understand the context in which a component exists,\n * to assist with choosing appropriate foreground colours to use. For example,\n * this method will help you use the 'white' version of a button if it's within\n * a block colour element using white foreground text.\n *\n * This only works for components/elements passed via <slot> and not if they\n * are part of an IC component.\n *\n * \"\"\n * @returns IcThemeForeground depending on the context\n */\nexport const getThemeFromContext = (\n el: Element,\n themeFromEvent: IcThemeForeground = null\n): IcThemeForeground => {\n const parentElement =\n el.parentElement || (<ShadowRoot>el.getRootNode()).host.parentElement;\n const blockColorParent = parentElement.closest(\n IC_BLOCK_COLOR_COMPONENTS.join(\",\")\n );\n\n // If within a block color component\n if (blockColorParent !== null) {\n const parentTag = blockColorParent.tagName.toLowerCase();\n const currentTag = el.tagName.toLowerCase();\n\n if (IC_BLOCK_COLOR_EXCEPTIONS[parentTag]?.includes(currentTag)) {\n return IcThemeForegroundEnum.Default;\n } else if (\n themeFromEvent !== null &&\n !IC_FIXED_COLOR_COMPONENTS.includes(parentTag)\n ) {\n return themeFromEvent;\n } else if (\n blockColorParent.classList.contains(IcThemeForegroundEnum.Dark)\n ) {\n return IcThemeForegroundEnum.Dark;\n }\n\n return IcThemeForegroundEnum.Light;\n }\n\n return IcThemeForegroundEnum.Default;\n};\n\nexport const isMobileOrTablet = (): boolean => {\n let isMobileOrTablet = false;\n if (\"maxTouchPoints\" in navigator) {\n isMobileOrTablet = navigator.maxTouchPoints > 0;\n }\n return isMobileOrTablet;\n};\n\n/**\n * Will create a button within the lightDOM which interacts with the parent form.\n * This is required as buttons within the shadowDOM will not invoke a submit or reset\n *\n * @param form - parent form element which contains shadowDom button\n * @param button - shadowDOM button\n */\nexport const handleHiddenFormButtonClick = (\n form: HTMLFormElement,\n button: HTMLIcButtonElement | HTMLButtonElement\n): void => {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", button.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n};\n\nexport const isEmptyString = (value: string): boolean => {\n if (!value) {\n return true;\n }\n\n return value.trim().length === 0;\n};\n\n/**\n * Extracts the label using the value from an object. Requires the object to have a label and value property.\n * @param value - value from object\n * @param options - list of menu items\n * @returns - label corresponding to value\n */\nexport const getLabelFromValue = (\n value: string,\n options: IcMenuOption[]\n): string | undefined => {\n const ungroupedOptions: IcMenuOption[] = [];\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option: IcMenuOption) =>\n ungroupedOptions.push(option)\n );\n } else {\n ungroupedOptions.push(option);\n }\n });\n return ungroupedOptions.find((option) => option.value === value)?.label;\n }\n\n return undefined;\n};\n\n/**\n * Filters the options based on the search string.\n * @param options - array of options\n * @param includeDescriptions - determines whether option descriptions are included when filtering options\n * @param searchString - string used to filter the options\n * @param position - whether the search string matches the start of or anywhere in the options\n * @returns filtered array of options\n */\nexport const getFilteredMenuOptions = (\n options: IcMenuOption[],\n includeDescriptions: boolean,\n searchString: string,\n position: IcSearchMatchPositions\n): IcMenuOption[] => {\n let rawFilteredOptions;\n\n if (position === \"anywhere\") {\n rawFilteredOptions = options.filter((option) => {\n if (includeDescriptions) {\n return (\n option.label.toLowerCase().includes(searchString.toLowerCase()) ||\n option.description?.toLowerCase().includes(searchString.toLowerCase())\n );\n } else {\n return option.label.toLowerCase().includes(searchString.toLowerCase());\n }\n });\n } else {\n rawFilteredOptions = options.filter((option) => {\n if (includeDescriptions) {\n return (\n option.label.toLowerCase().startsWith(searchString.toLowerCase()) ||\n option.description\n ?.toLowerCase()\n .startsWith(searchString.toLowerCase())\n );\n } else {\n return option.label\n .toLowerCase()\n .startsWith(searchString.toLowerCase());\n }\n });\n }\n\n return rawFilteredOptions;\n};\n\nexport const deviceSizeMatches = (size: number): boolean =>\n window.matchMedia(`(max-width: ${size}px)`).matches;\n\nexport const getCurrentDeviceSize = (): number => {\n if (deviceSizeMatches(DEVICE_SIZES.S)) {\n return DEVICE_SIZES.S;\n }\n if (deviceSizeMatches(DEVICE_SIZES.M)) {\n return DEVICE_SIZES.M;\n }\n if (deviceSizeMatches(DEVICE_SIZES.L)) {\n return DEVICE_SIZES.L;\n }\n if (deviceSizeMatches(DEVICE_SIZES.XL)) {\n return DEVICE_SIZES.XL;\n }\n //fallback needed as all of above get initialised to 0 in jest tests\n return DEVICE_SIZES.UNDEFINED;\n};\n\nexport const getCssProperty = (cssVar: string): string => {\n return getComputedStyle(document.documentElement).getPropertyValue(cssVar);\n};\n\n/**\n * Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:\n * - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding them together and dividing by 1000\n * This is a similar calculation to its CSS counterpart: \"--ic-theme-text\"\n * @returns number representing the brightness of the theme colour\n */\nexport const getThemeColorBrightness = (): number => {\n const themeRed = getCssProperty(\"--ic-theme-primary-r\");\n const themeGreen = getCssProperty(\"--ic-theme-primary-g\");\n const themeBlue = getCssProperty(\"--ic-theme-primary-b\");\n const themeColorBrightness =\n (parseInt(themeRed) * 299 +\n parseInt(themeGreen) * 587 +\n parseInt(themeBlue) * 114) /\n 1000;\n return themeColorBrightness;\n};\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n */\nexport const getThemeForegroundColor = (): IcThemeForeground => {\n return getThemeColorBrightness() > DARK_MODE_THRESHOLD\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n};\n\nexport const getSlot = (element: HTMLElement, name: string): Element | null => {\n if (element && element.querySelector) {\n return element.querySelector(`[slot=\"${name}\"]`);\n }\n return null;\n};\n\nexport const slotHasContent = (element: HTMLElement, name: string): boolean =>\n getSlot(element, name) !== null;\n\nexport const getSlotContent = (\n element: HTMLElement,\n name: string\n): Element[] | NodeListOf<ChildNode> | null => {\n const slot = getSlot(element, name);\n if (slot) {\n return getSlotElements(slot);\n }\n\n return null;\n};\n\nexport const getSlotElements = (slot: Element) => {\n const slotContent = slot.firstElementChild as HTMLSlotElement;\n\n if (slotContent !== null) {\n const elements = slotContent.assignedElements\n ? slotContent.assignedElements()\n : slotContent.childNodes;\n return elements.length ? elements : null;\n } else {\n //check for single element\n return slot === null ? null : [slot];\n }\n};\n\nexport const getNavItemParentDetails = (\n el: HTMLElement\n): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n switch (getParentElementType(el)) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(el.parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: getParentElement(el) };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: getParentElement(el) };\n break;\n case \"IC-PAGE-HEADER\":\n navType = { navType: \"page-header\", parent: null };\n break;\n }\n return navType;\n};\n\nexport const DEVICE_SIZES = {\n XS: Number(getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")), // 0\n S: Number(getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")), // 576\n M: Number(getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")), // 768\n L: Number(getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")), // 992\n XL: Number(getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")), // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => {\n return status !== \"\" && !disabled;\n};\n\nexport const isSlotUsed = (element: HTMLElement, slotName: string): boolean => {\n return Array.from(element.children).some(\n (child) => child.getAttribute(\"slot\") === slotName\n );\n};\n\n// added as a common method to allow detection of gatsby hydration issue, where (camelCase) props are initially undefined & then update\n// with a value. Allows a callback function to be executed when this is the case\nexport const onComponentPropUndefinedChange = (\n oldValue: string | undefined,\n newValue: string | undefined,\n callback: IcCallbackFunctionNoReturn\n): void => {\n if (oldValue === undefined && newValue !== oldValue) {\n callback();\n }\n};\n\nexport const onComponentRequiredPropUndefined = (\n props: IcPropObject[],\n component: string\n): void => {\n for (let i = 0; i < props.length; i++) {\n const { prop, propName } = props[i];\n if (prop === null || prop === undefined) {\n console.error(\n `No ${propName} specified for ${component} component - prop '${propName}' (web components) / '${kebabToCamelCase(\n propName\n )}' (react) required`\n );\n }\n }\n};\n\nexport const kebabToCamelCase = (kebabCase: string): string => {\n kebabCase = kebabCase.toLowerCase();\n const individualWords: string[] = kebabCase.split(\"-\");\n let camelCase = individualWords[0];\n for (let i = 1; i < individualWords.length; i++) {\n camelCase +=\n individualWords[i].substring(0, 1).toUpperCase() +\n individualWords[i].substring(1);\n }\n return camelCase;\n};\n\nexport const checkResizeObserver = (\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n if (\n typeof window !== \"undefined\" &&\n typeof window.ResizeObserver !== \"undefined\"\n ) {\n callbackFn();\n }\n};\n\nconst hex2dec = function (v: string) {\n return parseInt(v, 16);\n};\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n let c;\n if (hex.length === 4) {\n c = hex.replace(\"#\", \"\").split(\"\");\n return {\n r: hex2dec(c[0] + c[0]),\n g: hex2dec(c[1] + c[1]),\n b: hex2dec(c[2] + c[2]),\n a: 1,\n };\n } else {\n return {\n r: hex2dec(hex.slice(1, 3)),\n g: hex2dec(hex.slice(3, 5)),\n b: hex2dec(hex.slice(5)),\n a: 1,\n };\n }\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const fourthChar = rgbaStr.slice(3, 4);\n let colorRGBA: IcColorRGBA;\n if (fourthChar.toLowerCase() === \"a\") {\n colorRGBA = { r: null, g: null, b: null, a: null };\n const rgba = rgbaStr\n .substring(5, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgba[0]);\n colorRGBA.g = Number(rgba[1]);\n colorRGBA.b = Number(rgba[2]);\n colorRGBA.a = Number(rgba[3]);\n } else {\n colorRGBA = { r: null, g: null, b: null, a: 1 };\n const rgb = rgbaStr\n .substring(4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgb[0]);\n colorRGBA.g = Number(rgb[1]);\n colorRGBA.b = Number(rgb[2]);\n }\n\n return colorRGBA;\n};\n\nexport const elementOverflowsX = (element: HTMLElement): boolean => {\n return element.scrollWidth > element.clientWidth;\n};\n/**\n *\n * @param child - The child element\n * @returns string\n */\nexport const getParentElementType = (child: HTMLElement): string =>\n child.parentElement.tagName;\n\nexport const getParentElement = (child: HTMLElement): HTMLElement =>\n child.parentElement;\n\nexport const hasClassificationBanner = (): boolean => {\n if (document.querySelector(\"ic-classification-banner:not([inline='true'])\")) {\n return true;\n } else {\n return false;\n }\n};\n\nexport const getForm = (el: HTMLElement): HTMLFormElement | null => {\n return el.closest(\"FORM\");\n};\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.addEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.removeEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const pxToRem = (px: string, base = 16) => {\n const tempPx = parseInt(px);\n return `${(1 / base) * tempPx}rem`;\n};\n"]}
@@ -1,2 +0,0 @@
1
- import{r as t,c as s,h as i,g as h}from"./p-589f6dd3.js";import{I as e}from"./p-6f57b13c.js";const a=class{constructor(i){t(this,i);this.tabSelect=s(this,"tabSelect",7);this.icTabSelect=s(this,"icTabSelect",7);this.newTabs=[];this.newTabPanels=[];this.linkTabs=()=>{this.tabs.forEach(((t,s)=>{const i=`ic-tab-${s}-context-${this.contextId}`;const h=`ic-tab-panel-${s}-context-${this.contextId}`;const a=`ic-tab--${s}-context-${this.contextId}`;t.setAttribute("id",i);t.tabId=a;t.tabPosition=s;t.setAttribute("aria-controls",h);t.setAttribute("context-id",this.contextId);this.tabGroup.setAttribute("context-id",this.contextId);this.tabPanels[s].setAttribute("id",h);this.tabPanels[s].panelId=a;this.tabPanels[s].tabPosition=s;this.tabPanels[s].setAttribute("aria-labelledby",i);this.tabPanels[s].setAttribute("context-id",this.contextId);if(this.appearance===e.Light){t.appearance=this.appearance;this.tabPanels[s].appearance=this.appearance}}));if(this.appearance===e.Light){this.tabGroup.appearance=this.appearance}};this.getChildren=()=>{this.tabGroup=this.host.querySelector("ic-tab-group");this.tabs=Array.from(this.tabGroup.querySelectorAll("ic-tab"));this.tabPanels=Array.from(this.host.children).filter((t=>t.tagName==="IC-TAB-PANEL"));this.enabledTabs=this.getEnabledTabs()};this.attatchEventListeners=()=>{if(this.activationType==="automatic"){this.tabGroup.addEventListener("keydown",(t=>{this.handleKeyBoardNavAutomatic(t)}))}else{this.tabGroup.addEventListener("keydown",(t=>{this.handleKeyBoardNavManual(t)}))}};this.setControlledMode=()=>{if(this.selectedTabIndex!==undefined){this.controlledMode=true;this.selectedTab=this.selectedTabIndex}};this.setInitialTab=()=>{if(this.controlledMode){this.selectedTab=this.selectedTabIndex;this.focusedTabIndex=this.selectedTabIndex}else{const t=this.tabs.findIndex((t=>t.tabId===this.enabledTabs[0].tabId));this.selectedTab=t;this.focusedTabIndex=t}};this.configureTabs=()=>{this.enabledTabs.forEach((t=>{t.selected=t.tabPosition===this.selectedTab}));this.tabPanels.forEach((t=>{t.selectedTab=this.tabs[this.selectedTab].tabId}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.getIndexOfEnabledTab=t=>this.enabledTabs.findIndex((s=>s.tabId===this.tabs[t].tabId));this.keyboardSelectTab=t=>{const s=this.tabs.findIndex((s=>s.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(!this.controlledMode){this.selectedTab=s}else{this.icTabSelect.emit({tabIndex:s});this.tabSelect.emit({tabIndex:s})}};this.keyboardFocusTab=t=>{const s=this.tabs.findIndex((s=>s.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();this.focusedTabIndex=s};this.handleKeyBoardNavAutomatic=t=>{const s=t.key;const i=this.getIndexOfEnabledTab(this.selectedTab);let h=true;switch(s){case"Home":this.keyboardSelectTab(0);break;case"End":this.keyboardSelectTab(this.enabledTabs.length-1);break;case"ArrowRight":if(i<this.enabledTabs.length-1){this.keyboardSelectTab(i+1)}else{this.keyboardSelectTab(0)}break;case"ArrowLeft":if(i>0){this.keyboardSelectTab(i-1)}else{this.keyboardSelectTab(this.enabledTabs.length-1)}break;default:h=false}if(h)t.preventDefault()};this.handleKeyBoardNavManual=t=>{const s=t.key;const i=this.getIndexOfEnabledTab(this.focusedTabIndex);let h=true;switch(s){case"Home":this.keyboardFocusTab(0);break;case"End":this.keyboardFocusTab(this.enabledTabs.length-1);break;case"ArrowRight":if(i<this.enabledTabs.length-1){this.keyboardFocusTab(i+1)}else{this.keyboardFocusTab(0)}break;case"ArrowLeft":if(i>0){this.keyboardFocusTab(i-1)}else{this.keyboardFocusTab(this.enabledTabs.length-1)}break;case"Enter":this.keyboardSelectTab(this.focusedTabIndex);break;case" ":this.keyboardSelectTab(this.focusedTabIndex);break;default:h=false}if(h)t.preventDefault()};this.contextId="default";this.activationType="automatic";this.selectedTabIndex=undefined;this.appearance="dark";this.selectedTab=undefined}updateSelectedTab(t){this.selectedTab=t}tabClickHandler(t){if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position});this.tabSelect.emit({tabIndex:t.detail.position})}tabCreatedHandler(t){if(this.tabs&&this.tabPanels){(t.detail.setFocus?this.newTabs:this.newTabPanels).push(t.detail);if(this.newTabs.length===this.newTabPanels.length){this.tabs.push(...this.newTabs);this.tabPanels.push(...this.newTabPanels);this.enabledTabs=this.getEnabledTabs();this.linkTabs();this.newTabs=[];this.newTabPanels=[]}}}async tabRemovedHandler(t){this.getChildren();this.enabledTabs=this.getEnabledTabs();this.linkTabs();if(this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true;this.tabPanels[this.selectedTab].selectedTab=this.tabs[this.selectedTab].tabId}else{this.setInitialTab()}if(t){this.tabs[this.selectedTab].setFocus()}}componentDidLoad(){this.setControlledMode();this.getChildren();this.linkTabs();this.attatchEventListeners();this.setInitialTab();this.configureTabs()}componentWillUpdate(){this.configureTabs()}disconnectedCallback(){if(this.activationType==="manual"){this.tabGroup.removeEventListener("keydown",(t=>this.handleKeyBoardNavManual(t)))}else{this.tabGroup.removeEventListener("keydown",(t=>this.handleKeyBoardNavAutomatic(t)))}}render(){return i("slot",null)}get host(){return h(this)}static get watchers(){return{selectedTabIndex:["updateSelectedTab"]}}};export{a as ic_tab_context};
2
- //# sourceMappingURL=p-4b87445b.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["src/components/ic-tab-context/ic-tab-context.tsx"],"names":["TabContext","this","newTabs","newTabPanels","linkTabs","tabs","forEach","tab","index","tabId","contextId","tabPanelId","shared","setAttribute","tabPosition","tabGroup","tabPanels","panelId","appearance","IcThemeForegroundEnum","Light","getChildren","host","querySelector","Array","from","querySelectorAll","children","filter","child","tagName","enabledTabs","getEnabledTabs","attatchEventListeners","activationType","addEventListener","event","handleKeyBoardNavAutomatic","handleKeyBoardNavManual","setControlledMode","selectedTabIndex","undefined","controlledMode","selectedTab","setInitialTab","focusedTabIndex","firstEnabledTabIndex","findIndex","configureTabs","selected","tabPanel","disabled","getIndexOfEnabledTab","allTabsIndex","keyboardSelectTab","enabledTabIndex","newIndex","focus","icTabSelect","emit","tabIndex","tabSelect","keyboardFocusTab","key","preventDefault","length","[object Object]","newValue","detail","position","ev","setFocus","push","hadFocus","removeEventListener","h"],"mappings":"mGA0BaA,EAAU,6GAObC,KAAAC,QAA8B,GAC9BD,KAAAE,aAAwC,GA+FxCF,KAAAG,SAAW,KACjBH,KAAKI,KAAKC,SAAQ,CAACC,EAAKC,KACtB,MAAMC,EAAQ,UAAUD,aAAiBP,KAAKS,YAC9C,MAAMC,EAAa,gBAAgBH,aAAiBP,KAAKS,YACzD,MAAME,EAAS,WAAWJ,aAAiBP,KAAKS,YAChDH,EAAIM,aAAa,KAAMJ,GACvBF,EAAIE,MAAQG,EACZL,EAAIO,YAAcN,EAClBD,EAAIM,aAAa,gBAAiBF,GAClCJ,EAAIM,aAAa,aAAcZ,KAAKS,WACpCT,KAAKc,SAASF,aAAa,aAAcZ,KAAKS,WAC9CT,KAAKe,UAAUR,GAAOK,aAAa,KAAMF,GACzCV,KAAKe,UAAUR,GAAOS,QAAUL,EAChCX,KAAKe,UAAUR,GAAOM,YAAcN,EACpCP,KAAKe,UAAUR,GAAOK,aAAa,kBAAmBJ,GACtDR,KAAKe,UAAUR,GAAOK,aAAa,aAAcZ,KAAKS,WAEtD,GAAIT,KAAKiB,aAAeC,EAAsBC,MAAO,CACnDb,EAAIW,WAAajB,KAAKiB,WACtBjB,KAAKe,UAAUR,GAAOU,WAAajB,KAAKiB,eAI5C,GAAIjB,KAAKiB,aAAeC,EAAsBC,MAAO,CACnDnB,KAAKc,SAASG,WAAajB,KAAKiB,aAM5BjB,KAAAoB,YAAc,KACpBpB,KAAKc,SAAWd,KAAKqB,KAAKC,cAAc,gBACxCtB,KAAKI,KAAOmB,MAAMC,KAAKxB,KAAKc,SAASW,iBAAiB,WACtDzB,KAAKe,UAAYQ,MAAMC,KAAKxB,KAAKqB,KAAKK,UAAUC,QAC7CC,GAAUA,EAAMC,UAAY,iBAE/B7B,KAAK8B,YAAc9B,KAAK+B,kBAIlB/B,KAAAgC,sBAA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AAU,CACZxE,KAAKI,KAAKJ,KAAK0C,aAAa4B,YA+LhCL,mBACEjE,KAAKsC,oBACLtC,KAAKoB,cACLpB,KAAKG,WACLH,KAAKgC,wBACLhC,KAAK2C,gBACL3C,KAAK+C,gBAGPkB,sBACEjE,KAAK+C,gBAGPkB,uBACE,GAAIjE,KAAKiC,iBAAmB,SAAU,CACpCjC,KAAKc,SAAS2D,oBAAoB,WAAYtC,GAC5CnC,KAAKqC,wBAAwBF,SAE1B,CACLnC,KAAKc,SAAS2D,oBAAoB,WAAYtC,GAC5CnC,KAAKoC,2BAA2BD,MAKtC8B,SACE,OAAOS,EAAA,OAAA","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Listen,\n Prop,\n State,\n h,\n Watch,\n Method,\n} from \"@stencil/core\";\nimport {\n IcActivationTypes,\n IcThemeForegroundNoDefault,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nimport {\n IcTabClickEventDetail,\n IcTabSelectEventDetail,\n} from \"../ic-tab/ic-tab.types\";\n\n@Component({\n tag: \"ic-tab-context\",\n})\nexport class TabContext {\n private controlledMode: boolean;\n private tabs: HTMLIcTabElement[];\n private enabledTabs: HTMLIcTabElement[];\n private tabPanels: HTMLIcTabPanelElement[];\n private tabGroup: HTMLIcTabGroupElement;\n private focusedTabIndex: number;\n private newTabs: HTMLIcTabElement[] = [];\n private newTabPanels: HTMLIcTabPanelElement[] = [];\n\n @Element() host: HTMLIcTabContextElement;\n\n /**\n * The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\n */\n @Prop({ reflect: true }) contextId?: string = \"default\";\n\n /**\n * Determines whether tabs have to be manually activated (by pressing 'Enter' or 'Space') when they receive focus using keyboard navigation.\n */\n @Prop() activationType?: IcActivationTypes = \"automatic\";\n\n /**\n * The selected tab to be controlled by the user. Must be used alongside the icTabSelect event to manage tab selection.\n */\n @Prop() selectedTabIndex?: number;\n\n /**\n * The appearance of the tab context, e.g dark, or light.\n */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n @State() selectedTab: number | null;\n\n @Watch(\"selectedTabIndex\")\n updateSelectedTab(newValue: number): void {\n this.selectedTab = newValue;\n }\n\n /**\n * @deprecated This event should not be used anymore. Use icTabSelect instead.\n */\n @Event() tabSelect: EventEmitter<IcTabSelectEventDetail>;\n\n /**\n * Emitted when a user selects a tab.\n */\n @Event() icTabSelect: EventEmitter<IcTabSelectEventDetail>;\n\n @Listen(\"tabClick\")\n tabClickHandler(event: CustomEvent<IcTabClickEventDetail>): void {\n if (\n this.selectedTabIndex === undefined &&\n event.detail.contextId === this.contextId\n ) {\n this.selectedTab = event.detail.position;\n }\n this.icTabSelect.emit({\n tabIndex: event.detail.position,\n });\n this.tabSelect.emit({\n tabIndex: event.detail.position,\n });\n }\n\n @Listen(\"tabCreated\")\n @Listen(\"tabPanelCreated\")\n tabCreatedHandler(ev: CustomEvent) {\n if (this.tabs && this.tabPanels) {\n (ev.detail.setFocus ? this.newTabs : this.newTabPanels).push(ev.detail);\n if (this.newTabs.length === this.newTabPanels.length) {\n this.tabs.push(...this.newTabs);\n this.tabPanels.push(...this.newTabPanels);\n this.enabledTabs = this.getEnabledTabs();\n this.linkTabs();\n this.newTabs = [];\n this.newTabPanels = [];\n }\n }\n }\n\n /**\n * @internal Used to set tab/tab panel IDs when a tab/tab panel has been removed\n */\n @Method()\n async tabRemovedHandler(hadFocus?: boolean) {\n this.getChildren();\n this.enabledTabs = this.getEnabledTabs();\n this.linkTabs();\n if (this.tabs[this.selectedTab] && this.tabPanels[this.selectedTab]) {\n this.tabs[this.selectedTab].selected = true;\n this.tabPanels[this.selectedTab].selectedTab =\n this.tabs[this.selectedTab].tabId;\n } else {\n this.setInitialTab();\n }\n\n if (hadFocus) {\n this.tabs[this.selectedTab].setFocus();\n }\n }\n\n // Sets attributes to link tab-group, tabs and tab-panels\n private linkTabs = () => {\n this.tabs.forEach((tab, index) => {\n const tabId = `ic-tab-${index}-context-${this.contextId}`;\n const tabPanelId = `ic-tab-panel-${index}-context-${this.contextId}`;\n const shared = `ic-tab--${index}-context-${this.contextId}`;\n tab.setAttribute(\"id\", tabId);\n tab.tabId = shared;\n tab.tabPosition = index;\n tab.setAttribute(\"aria-controls\", tabPanelId);\n tab.setAttribute(\"context-id\", this.contextId);\n this.tabGroup.setAttribute(\"context-id\", this.contextId);\n this.tabPanels[index].setAttribute(\"id\", tabPanelId);\n this.tabPanels[index].panelId = shared;\n this.tabPanels[index].tabPosition = index;\n this.tabPanels[index].setAttribute(\"aria-labelledby\", tabId);\n this.tabPanels[index].setAttribute(\"context-id\", this.contextId);\n\n if (this.appearance === IcThemeForegroundEnum.Light) {\n tab.appearance = this.appearance;\n this.tabPanels[index].appearance = this.appearance;\n }\n });\n\n if (this.appearance === IcThemeForegroundEnum.Light) {\n this.tabGroup.appearance = this.appearance;\n }\n };\n\n // Gets tabs and tabpanels with the same context ID\n // Using querySelector to selector the children in relation to the host\n private getChildren = (): void => {\n this.tabGroup = this.host.querySelector(\"ic-tab-group\");\n this.tabs = Array.from(this.tabGroup.querySelectorAll(\"ic-tab\"));\n this.tabPanels = Array.from(this.host.children).filter(\n (child) => child.tagName === \"IC-TAB-PANEL\"\n ) as HTMLIcTabPanelElement[];\n this.enabledTabs = this.getEnabledTabs();\n };\n\n // Determines how keyboard navigation is to be handled based on the activation type\n private attatchEventListeners = (): void => {\n if (this.activationType === \"automatic\") {\n this.tabGroup.addEventListener(\"keydown\", (event) => {\n this.handleKeyBoardNavAutomatic(event);\n });\n } else {\n this.tabGroup.addEventListener(\"keydown\", (event) => {\n this.handleKeyBoardNavManual(event);\n });\n }\n };\n\n // Determines whether the selected tab is being controlled within the component\n // or by the user (via selectedTabIndex and onIcTabSelect)\n private setControlledMode = (): void => {\n if (this.selectedTabIndex !== undefined) {\n this.controlledMode = true;\n this.selectedTab = this.selectedTabIndex;\n }\n };\n\n // Sets the tab that is selected on initial render\n private setInitialTab = (): void => {\n if (this.controlledMode) {\n this.selectedTab = this.selectedTabIndex;\n this.focusedTabIndex = this.selectedTabIndex;\n } else {\n const firstEnabledTabIndex = this.tabs.findIndex(\n (tab) => tab.tabId === this.enabledTabs[0].tabId\n );\n this.selectedTab = firstEnabledTabIndex;\n this.focusedTabIndex = firstEnabledTabIndex;\n }\n };\n\n // Passes the selected tab to the tab and tab panel components\n private configureTabs = () => {\n this.enabledTabs.forEach((tab) => {\n tab.selected = tab.tabPosition === this.selectedTab;\n });\n this.tabPanels.forEach((tabPanel) => {\n tabPanel.selectedTab = this.tabs[this.selectedTab].tabId;\n });\n };\n\n private getEnabledTabs = () => {\n return Array.from(this.tabs).filter((child) => !child.disabled);\n };\n\n private getIndexOfEnabledTab = (allTabsIndex: number) => {\n return this.enabledTabs.findIndex(\n (tab) => tab.tabId === this.tabs[allTabsIndex].tabId\n );\n };\n\n // Sets focus on tab and selects it\n private keyboardSelectTab = (enabledTabIndex: number) => {\n const newIndex = this.tabs.findIndex(\n (tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId\n );\n this.enabledTabs[enabledTabIndex].focus();\n if (!this.controlledMode) {\n this.selectedTab = newIndex;\n } else {\n this.icTabSelect.emit({ tabIndex: newIndex });\n this.tabSelect.emit({ tabIndex: newIndex });\n }\n };\n\n // Sets focus on tab without selecting it (for manual activation)\n private keyboardFocusTab = (enabledTabIndex: number) => {\n const newIndex = this.tabs.findIndex(\n (tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId\n );\n this.enabledTabs[enabledTabIndex].focus();\n this.focusedTabIndex = newIndex;\n };\n\n private handleKeyBoardNavAutomatic = (event: KeyboardEvent) => {\n const key = event.key;\n const enabledTabIndex = this.getIndexOfEnabledTab(this.selectedTab);\n let preventDefault = true;\n switch (key) {\n case \"Home\":\n this.keyboardSelectTab(0);\n break;\n case \"End\":\n this.keyboardSelectTab(this.enabledTabs.length - 1);\n break;\n case \"ArrowRight\":\n if (enabledTabIndex < this.enabledTabs.length - 1) {\n this.keyboardSelectTab(enabledTabIndex + 1);\n } else {\n this.keyboardSelectTab(0);\n }\n break;\n case \"ArrowLeft\":\n if (enabledTabIndex > 0) {\n this.keyboardSelectTab(enabledTabIndex - 1);\n } else {\n this.keyboardSelectTab(this.enabledTabs.length - 1);\n }\n break;\n default:\n preventDefault = false;\n }\n if (preventDefault) event.preventDefault();\n };\n\n private handleKeyBoardNavManual = (event: KeyboardEvent) => {\n const key = event.key;\n const enabledTabIndex = this.getIndexOfEnabledTab(this.focusedTabIndex);\n let preventDefault = true;\n switch (key) {\n case \"Home\":\n this.keyboardFocusTab(0);\n break;\n case \"End\":\n this.keyboardFocusTab(this.enabledTabs.length - 1);\n break;\n case \"ArrowRight\":\n if (enabledTabIndex < this.enabledTabs.length - 1) {\n this.keyboardFocusTab(enabledTabIndex + 1);\n } else {\n this.keyboardFocusTab(0);\n }\n break;\n case \"ArrowLeft\":\n if (enabledTabIndex > 0) {\n this.keyboardFocusTab(enabledTabIndex - 1);\n } else {\n this.keyboardFocusTab(this.enabledTabs.length - 1);\n }\n break;\n case \"Enter\":\n this.keyboardSelectTab(this.focusedTabIndex);\n break;\n case \" \":\n this.keyboardSelectTab(this.focusedTabIndex);\n break;\n default:\n preventDefault = false;\n }\n if (preventDefault) event.preventDefault();\n };\n\n componentDidLoad(): void {\n this.setControlledMode();\n this.getChildren();\n this.linkTabs();\n this.attatchEventListeners();\n this.setInitialTab();\n this.configureTabs();\n }\n\n componentWillUpdate(): void {\n this.configureTabs();\n }\n\n disconnectedCallback(): void {\n if (this.activationType === \"manual\") {\n this.tabGroup.removeEventListener(\"keydown\", (event) =>\n this.handleKeyBoardNavManual(event)\n );\n } else {\n this.tabGroup.removeEventListener(\"keydown\", (event) =>\n this.handleKeyBoardNavAutomatic(event)\n );\n }\n }\n\n render() {\n return <slot></slot>;\n }\n}\n"]}