@ukic/web-components 2.33.0 → 2.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (354) hide show
  1. package/README.md +8 -4
  2. package/dist/cjs/core.cjs.js +1 -1
  3. package/dist/cjs/{helpers-df61b63f.js → helpers-6f6991cb.js} +13 -1
  4. package/dist/cjs/helpers-6f6991cb.js.map +1 -0
  5. package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
  6. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  7. package/dist/cjs/ic-alert.cjs.entry.js +2 -9
  8. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  9. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  10. package/dist/cjs/ic-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
  14. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-card.cjs.entry.js +12 -19
  16. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  17. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  18. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  19. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-empty-state.cjs.entry.js +2 -12
  24. package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  26. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  27. package/dist/cjs/ic-footer.cjs.entry.js +18 -7
  28. package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ic-hero.cjs.entry.js +2 -9
  30. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  31. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -10
  33. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  42. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-pagination.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-select.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  51. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  55. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  57. package/dist/cjs/ic-text-field.cjs.entry.js +8 -7
  58. package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  60. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +10 -2
  62. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-toggle-button.cjs.entry.js +3 -2
  64. package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
  65. package/dist/cjs/ic-top-navigation.cjs.entry.js +2 -2
  66. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  67. package/dist/cjs/ic-typography.cjs.entry.js +1 -1
  68. package/dist/cjs/loader.cjs.js +1 -1
  69. package/dist/cjs/types-dc22e301.js.map +1 -1
  70. package/dist/collection/components/ic-alert/ic-alert.js +3 -10
  71. package/dist/collection/components/ic-alert/ic-alert.js.map +1 -1
  72. package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js +21 -3
  73. package/dist/collection/components/ic-alert/test/basic/ic-alert.spec.js.map +1 -1
  74. package/dist/collection/components/ic-button/ic-button.js +2 -2
  75. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  76. package/dist/collection/components/ic-button/ic-button.types.js.map +1 -1
  77. package/dist/collection/components/ic-card/ic-card.js +13 -20
  78. package/dist/collection/components/ic-card/ic-card.js.map +1 -1
  79. package/dist/collection/components/ic-card/test/basic/ic-card.spec.js +34 -3
  80. package/dist/collection/components/ic-card/test/basic/ic-card.spec.js.map +1 -1
  81. package/dist/collection/components/ic-empty-state/ic-empty-state.js +3 -13
  82. package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -1
  83. package/dist/collection/components/ic-footer/ic-footer.js +18 -7
  84. package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
  85. package/dist/collection/components/ic-footer/test/basic/ic-footer.spec.js +41 -0
  86. package/dist/collection/components/ic-footer/test/basic/ic-footer.spec.js.map +1 -1
  87. package/dist/collection/components/ic-hero/ic-hero.js +3 -10
  88. package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
  89. package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js +21 -3
  90. package/dist/collection/components/ic-hero/test/basic/ic-hero.spec.js.map +1 -1
  91. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +3 -10
  92. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
  93. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js +21 -3
  94. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js.map +1 -1
  95. package/dist/collection/components/ic-menu/ic-menu.css +4 -0
  96. package/dist/collection/components/ic-text-field/ic-text-field.js +8 -7
  97. package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
  98. package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +26 -1
  99. package/dist/collection/components/ic-toggle-button/ic-toggle-button.js.map +1 -1
  100. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +34 -0
  101. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js.map +1 -1
  102. package/dist/collection/components/ic-top-navigation/ic-top-navigation.css +4 -0
  103. package/dist/collection/testspec.setup.js +14 -0
  104. package/dist/collection/testspec.setup.js.map +1 -1
  105. package/dist/collection/utils/helpers.js +11 -0
  106. package/dist/collection/utils/helpers.js.map +1 -1
  107. package/dist/collection/utils/types.js.map +1 -1
  108. package/dist/components/helpers.js +12 -1
  109. package/dist/components/helpers.js.map +1 -1
  110. package/dist/components/ic-alert2.js +3 -10
  111. package/dist/components/ic-alert2.js.map +1 -1
  112. package/dist/components/ic-button2.js.map +1 -1
  113. package/dist/components/ic-card.js +13 -20
  114. package/dist/components/ic-card.js.map +1 -1
  115. package/dist/components/ic-empty-state.js +3 -13
  116. package/dist/components/ic-empty-state.js.map +1 -1
  117. package/dist/components/ic-footer.js +18 -7
  118. package/dist/components/ic-footer.js.map +1 -1
  119. package/dist/components/ic-hero.js +3 -10
  120. package/dist/components/ic-hero.js.map +1 -1
  121. package/dist/components/ic-input-component-container2.js +3 -10
  122. package/dist/components/ic-input-component-container2.js.map +1 -1
  123. package/dist/components/ic-menu2.js +1 -1
  124. package/dist/components/ic-menu2.js.map +1 -1
  125. package/dist/components/ic-select.js +1 -1
  126. package/dist/components/ic-side-navigation.js +1 -1
  127. package/dist/components/ic-stepper.js +1 -1
  128. package/dist/components/ic-text-field2.js +8 -7
  129. package/dist/components/ic-text-field2.js.map +1 -1
  130. package/dist/components/ic-theme.js +1 -1
  131. package/dist/components/ic-toggle-button-group.js +12 -2
  132. package/dist/components/ic-toggle-button-group.js.map +1 -1
  133. package/dist/components/ic-toggle-button.js +3 -1
  134. package/dist/components/ic-toggle-button.js.map +1 -1
  135. package/dist/components/ic-top-navigation.js +2 -2
  136. package/dist/components/ic-top-navigation.js.map +1 -1
  137. package/dist/components/types.js.map +1 -1
  138. package/dist/core/core.esm.js +1 -1
  139. package/dist/core/core.esm.js.map +1 -1
  140. package/dist/core/{p-e218165c.entry.js → p-08478a4c.entry.js} +2 -2
  141. package/dist/core/{p-45b9b893.entry.js → p-12bac804.entry.js} +2 -2
  142. package/dist/core/{p-ae89e61c.entry.js → p-13b2c3a2.entry.js} +2 -2
  143. package/dist/core/{p-9ab3b47e.entry.js → p-168a7440.entry.js} +2 -2
  144. package/dist/core/{p-d9e36712.entry.js → p-193fc7d0.entry.js} +2 -2
  145. package/dist/core/{p-fa83d7c2.entry.js → p-1e4690f8.entry.js} +2 -2
  146. package/dist/core/{p-2c93290d.entry.js → p-1f6d36d5.entry.js} +2 -2
  147. package/dist/core/p-26b7b18f.js.map +1 -1
  148. package/dist/core/p-2a11be1e.entry.js +2 -0
  149. package/dist/core/p-2a11be1e.entry.js.map +1 -0
  150. package/dist/core/{p-cc6a677b.entry.js → p-2cd1a601.entry.js} +2 -2
  151. package/dist/core/p-3ba915a5.entry.js +2 -0
  152. package/dist/core/p-3ba915a5.entry.js.map +1 -0
  153. package/dist/core/{p-742189ad.entry.js → p-405d89bb.entry.js} +2 -2
  154. package/dist/core/{p-72a854dd.entry.js → p-4c6dc1b2.entry.js} +2 -2
  155. package/dist/core/{p-90e4679d.entry.js → p-51407872.entry.js} +2 -2
  156. package/dist/core/{p-ef4acad9.entry.js → p-597c221c.entry.js} +2 -2
  157. package/dist/core/{p-5739e0a9.entry.js → p-5d3c6ea1.entry.js} +2 -2
  158. package/dist/core/{p-f1bf36e4.entry.js → p-65dc77ba.entry.js} +2 -2
  159. package/dist/core/p-6beed7db.entry.js +2 -0
  160. package/dist/core/p-6beed7db.entry.js.map +1 -0
  161. package/dist/core/{p-5ec8938f.entry.js → p-6d8dc552.entry.js} +2 -2
  162. package/dist/core/{p-0bd82370.entry.js → p-72f292f2.entry.js} +2 -2
  163. package/dist/core/p-78f16b1a.entry.js +2 -0
  164. package/dist/core/p-78f16b1a.entry.js.map +1 -0
  165. package/dist/core/{p-1ee0b4eb.entry.js → p-7b3a4b3f.entry.js} +2 -2
  166. package/dist/core/{p-f53503ca.entry.js → p-7e8a4abd.entry.js} +2 -2
  167. package/dist/core/p-7f1594d9.entry.js +2 -0
  168. package/dist/core/p-7f1594d9.entry.js.map +1 -0
  169. package/dist/core/{p-cb344d95.entry.js → p-8dd2d3df.entry.js} +2 -2
  170. package/dist/core/p-90433147.entry.js +2 -0
  171. package/dist/core/p-90433147.entry.js.map +1 -0
  172. package/dist/core/{p-f61a4e8d.entry.js → p-915e5888.entry.js} +2 -2
  173. package/dist/core/{p-614cb828.entry.js → p-91fab13d.entry.js} +2 -2
  174. package/dist/core/{p-20203682.entry.js → p-922036e8.entry.js} +2 -2
  175. package/dist/core/{p-050dc124.entry.js → p-96e79d69.entry.js} +2 -2
  176. package/dist/core/{p-bdb77a91.entry.js → p-9a6790d8.entry.js} +2 -2
  177. package/dist/core/{p-7e6fa0ea.entry.js → p-9ef08234.entry.js} +2 -2
  178. package/dist/core/{p-c02f2a47.entry.js → p-a020afbd.entry.js} +2 -2
  179. package/dist/core/p-a020afbd.entry.js.map +1 -0
  180. package/dist/core/{p-de3d293b.entry.js → p-a141ea39.entry.js} +2 -2
  181. package/dist/core/p-a141ea39.entry.js.map +1 -0
  182. package/dist/core/p-a438656d.entry.js +2 -0
  183. package/dist/core/p-a438656d.entry.js.map +1 -0
  184. package/dist/core/{p-c0885ea6.entry.js → p-a9cea205.entry.js} +2 -2
  185. package/dist/core/{p-b8de998d.entry.js → p-afa78488.entry.js} +2 -2
  186. package/dist/core/{p-a4f42217.entry.js → p-b21d5f94.entry.js} +2 -2
  187. package/dist/core/{p-4bb9c52f.entry.js → p-b262eaff.entry.js} +2 -2
  188. package/dist/core/{p-5a7fd661.entry.js → p-b60912a7.entry.js} +2 -2
  189. package/dist/core/{p-63b88ad2.entry.js → p-b62735aa.entry.js} +2 -2
  190. package/dist/core/{p-cb5f7b90.entry.js → p-ba06cc95.entry.js} +2 -2
  191. package/dist/core/p-ba06cc95.entry.js.map +1 -0
  192. package/dist/core/{p-bb21769c.entry.js → p-ba884064.entry.js} +2 -2
  193. package/dist/core/{p-649bd0e1.entry.js → p-bdaff5c9.entry.js} +2 -2
  194. package/dist/core/{p-7ef7adc4.entry.js → p-c939d07d.entry.js} +2 -2
  195. package/dist/core/p-d3344518.entry.js +2 -0
  196. package/dist/core/p-d3344518.entry.js.map +1 -0
  197. package/dist/core/{p-ad2a8eab.entry.js → p-d375858e.entry.js} +2 -2
  198. package/dist/core/p-d41c847e.js +2 -0
  199. package/dist/core/p-d41c847e.js.map +1 -0
  200. package/dist/core/{p-a15dfa51.entry.js → p-dfb3e76e.entry.js} +2 -2
  201. package/dist/core/{p-48922e0a.entry.js → p-eae017ce.entry.js} +2 -2
  202. package/dist/core/{p-6c31fd9f.entry.js → p-f3599009.entry.js} +2 -2
  203. package/dist/core/{p-d4d4b392.entry.js → p-f39741be.entry.js} +2 -2
  204. package/dist/core/{p-f73cb96b.entry.js → p-f404b35e.entry.js} +2 -2
  205. package/dist/core/{p-04876964.entry.js → p-f4a29c16.entry.js} +2 -2
  206. package/dist/esm/core.js +1 -1
  207. package/dist/esm/{helpers-b0150c61.js → helpers-003f27c9.js} +13 -2
  208. package/dist/{core/p-6d23ec8e.js.map → esm/helpers-003f27c9.js.map} +1 -1
  209. package/dist/esm/ic-accordion-group.entry.js +1 -1
  210. package/dist/esm/ic-accordion.entry.js +1 -1
  211. package/dist/esm/ic-alert.entry.js +3 -10
  212. package/dist/esm/ic-alert.entry.js.map +1 -1
  213. package/dist/esm/ic-back-to-top.entry.js +1 -1
  214. package/dist/esm/ic-badge.entry.js +1 -1
  215. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  216. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  217. package/dist/esm/ic-button_3.entry.js +1 -1
  218. package/dist/esm/ic-button_3.entry.js.map +1 -1
  219. package/dist/esm/ic-card.entry.js +13 -20
  220. package/dist/esm/ic-card.entry.js.map +1 -1
  221. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  222. package/dist/esm/ic-checkbox.entry.js +1 -1
  223. package/dist/esm/ic-chip.entry.js +1 -1
  224. package/dist/esm/ic-data-row.entry.js +1 -1
  225. package/dist/esm/ic-dialog.entry.js +1 -1
  226. package/dist/esm/ic-divider.entry.js +1 -1
  227. package/dist/esm/ic-empty-state.entry.js +3 -13
  228. package/dist/esm/ic-empty-state.entry.js.map +1 -1
  229. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  230. package/dist/esm/ic-footer-link.entry.js +1 -1
  231. package/dist/esm/ic-footer.entry.js +18 -7
  232. package/dist/esm/ic-footer.entry.js.map +1 -1
  233. package/dist/esm/ic-hero.entry.js +3 -10
  234. package/dist/esm/ic-hero.entry.js.map +1 -1
  235. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  236. package/dist/esm/ic-input-component-container_3.entry.js +4 -11
  237. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  238. package/dist/esm/ic-input-label_2.entry.js +1 -1
  239. package/dist/esm/ic-link.entry.js +1 -1
  240. package/dist/esm/ic-menu-group.entry.js +1 -1
  241. package/dist/esm/ic-menu-item.entry.js +1 -1
  242. package/dist/esm/ic-navigation-button.entry.js +1 -1
  243. package/dist/esm/ic-navigation-group.entry.js +1 -1
  244. package/dist/esm/ic-navigation-item.entry.js +1 -1
  245. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  246. package/dist/esm/ic-page-header.entry.js +1 -1
  247. package/dist/esm/ic-pagination-item.entry.js +1 -1
  248. package/dist/esm/ic-pagination.entry.js +1 -1
  249. package/dist/esm/ic-popover-menu.entry.js +1 -1
  250. package/dist/esm/ic-radio-group.entry.js +1 -1
  251. package/dist/esm/ic-radio-option.entry.js +1 -1
  252. package/dist/esm/ic-search-bar.entry.js +1 -1
  253. package/dist/esm/ic-select.entry.js +1 -1
  254. package/dist/esm/ic-side-navigation.entry.js +1 -1
  255. package/dist/esm/ic-status-tag.entry.js +1 -1
  256. package/dist/esm/ic-step.entry.js +1 -1
  257. package/dist/esm/ic-stepper.entry.js +1 -1
  258. package/dist/esm/ic-switch.entry.js +1 -1
  259. package/dist/esm/ic-tab-group.entry.js +1 -1
  260. package/dist/esm/ic-tab.entry.js +1 -1
  261. package/dist/esm/ic-text-field.entry.js +8 -7
  262. package/dist/esm/ic-text-field.entry.js.map +1 -1
  263. package/dist/esm/ic-theme.entry.js +1 -1
  264. package/dist/esm/ic-toast.entry.js +1 -1
  265. package/dist/esm/ic-toggle-button-group.entry.js +10 -2
  266. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
  267. package/dist/esm/ic-toggle-button.entry.js +3 -2
  268. package/dist/esm/ic-toggle-button.entry.js.map +1 -1
  269. package/dist/esm/ic-top-navigation.entry.js +2 -2
  270. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  271. package/dist/esm/ic-typography.entry.js +1 -1
  272. package/dist/esm/loader.js +1 -1
  273. package/dist/esm/types-6f6b41a5.js.map +1 -1
  274. package/dist/types/components/ic-alert/ic-alert.d.ts +0 -1
  275. package/dist/types/components/ic-button/ic-button.d.ts +2 -2
  276. package/dist/types/components/ic-button/ic-button.types.d.ts +0 -1
  277. package/dist/types/components/ic-card/ic-card.d.ts +0 -1
  278. package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +0 -1
  279. package/dist/types/components/ic-footer/ic-footer.d.ts +1 -0
  280. package/dist/types/components/ic-hero/ic-hero.d.ts +0 -1
  281. package/dist/types/components/ic-input-component-container/ic-input-component-container.d.ts +0 -1
  282. package/dist/types/components/ic-text-field/ic-text-field.d.ts +1 -0
  283. package/dist/types/components/ic-toggle-button/ic-toggle-button.d.ts +5 -1
  284. package/dist/types/components/ic-toggle-button-group/ic-toggle-button-group.d.ts +6 -1
  285. package/dist/types/components.d.ts +20 -4
  286. package/dist/types/testspec.setup.d.ts +9 -0
  287. package/dist/types/utils/helpers.d.ts +2 -0
  288. package/dist/types/utils/types.d.ts +1 -0
  289. package/hydrate/index.js +62 -59
  290. package/package.json +2 -2
  291. package/vscode-data.json +36 -0
  292. package/dist/cjs/helpers-df61b63f.js.map +0 -1
  293. package/dist/core/p-145a4619.entry.js +0 -2
  294. package/dist/core/p-145a4619.entry.js.map +0 -1
  295. package/dist/core/p-350d89d0.entry.js +0 -2
  296. package/dist/core/p-350d89d0.entry.js.map +0 -1
  297. package/dist/core/p-618a0098.entry.js +0 -2
  298. package/dist/core/p-618a0098.entry.js.map +0 -1
  299. package/dist/core/p-6d23ec8e.js +0 -2
  300. package/dist/core/p-8920ebe6.entry.js +0 -2
  301. package/dist/core/p-8920ebe6.entry.js.map +0 -1
  302. package/dist/core/p-ac39415d.entry.js +0 -2
  303. package/dist/core/p-ac39415d.entry.js.map +0 -1
  304. package/dist/core/p-c02f2a47.entry.js.map +0 -1
  305. package/dist/core/p-c8b56283.entry.js +0 -2
  306. package/dist/core/p-c8b56283.entry.js.map +0 -1
  307. package/dist/core/p-cb5f7b90.entry.js.map +0 -1
  308. package/dist/core/p-de3d293b.entry.js.map +0 -1
  309. package/dist/core/p-ec15bf1b.entry.js +0 -2
  310. package/dist/core/p-ec15bf1b.entry.js.map +0 -1
  311. package/dist/core/p-f1583332.entry.js +0 -2
  312. package/dist/core/p-f1583332.entry.js.map +0 -1
  313. package/dist/esm/helpers-b0150c61.js.map +0 -1
  314. /package/dist/core/{p-e218165c.entry.js.map → p-08478a4c.entry.js.map} +0 -0
  315. /package/dist/core/{p-45b9b893.entry.js.map → p-12bac804.entry.js.map} +0 -0
  316. /package/dist/core/{p-ae89e61c.entry.js.map → p-13b2c3a2.entry.js.map} +0 -0
  317. /package/dist/core/{p-9ab3b47e.entry.js.map → p-168a7440.entry.js.map} +0 -0
  318. /package/dist/core/{p-d9e36712.entry.js.map → p-193fc7d0.entry.js.map} +0 -0
  319. /package/dist/core/{p-fa83d7c2.entry.js.map → p-1e4690f8.entry.js.map} +0 -0
  320. /package/dist/core/{p-2c93290d.entry.js.map → p-1f6d36d5.entry.js.map} +0 -0
  321. /package/dist/core/{p-cc6a677b.entry.js.map → p-2cd1a601.entry.js.map} +0 -0
  322. /package/dist/core/{p-742189ad.entry.js.map → p-405d89bb.entry.js.map} +0 -0
  323. /package/dist/core/{p-72a854dd.entry.js.map → p-4c6dc1b2.entry.js.map} +0 -0
  324. /package/dist/core/{p-90e4679d.entry.js.map → p-51407872.entry.js.map} +0 -0
  325. /package/dist/core/{p-ef4acad9.entry.js.map → p-597c221c.entry.js.map} +0 -0
  326. /package/dist/core/{p-5739e0a9.entry.js.map → p-5d3c6ea1.entry.js.map} +0 -0
  327. /package/dist/core/{p-f1bf36e4.entry.js.map → p-65dc77ba.entry.js.map} +0 -0
  328. /package/dist/core/{p-5ec8938f.entry.js.map → p-6d8dc552.entry.js.map} +0 -0
  329. /package/dist/core/{p-0bd82370.entry.js.map → p-72f292f2.entry.js.map} +0 -0
  330. /package/dist/core/{p-1ee0b4eb.entry.js.map → p-7b3a4b3f.entry.js.map} +0 -0
  331. /package/dist/core/{p-f53503ca.entry.js.map → p-7e8a4abd.entry.js.map} +0 -0
  332. /package/dist/core/{p-cb344d95.entry.js.map → p-8dd2d3df.entry.js.map} +0 -0
  333. /package/dist/core/{p-f61a4e8d.entry.js.map → p-915e5888.entry.js.map} +0 -0
  334. /package/dist/core/{p-614cb828.entry.js.map → p-91fab13d.entry.js.map} +0 -0
  335. /package/dist/core/{p-20203682.entry.js.map → p-922036e8.entry.js.map} +0 -0
  336. /package/dist/core/{p-050dc124.entry.js.map → p-96e79d69.entry.js.map} +0 -0
  337. /package/dist/core/{p-bdb77a91.entry.js.map → p-9a6790d8.entry.js.map} +0 -0
  338. /package/dist/core/{p-7e6fa0ea.entry.js.map → p-9ef08234.entry.js.map} +0 -0
  339. /package/dist/core/{p-c0885ea6.entry.js.map → p-a9cea205.entry.js.map} +0 -0
  340. /package/dist/core/{p-b8de998d.entry.js.map → p-afa78488.entry.js.map} +0 -0
  341. /package/dist/core/{p-a4f42217.entry.js.map → p-b21d5f94.entry.js.map} +0 -0
  342. /package/dist/core/{p-4bb9c52f.entry.js.map → p-b262eaff.entry.js.map} +0 -0
  343. /package/dist/core/{p-5a7fd661.entry.js.map → p-b60912a7.entry.js.map} +0 -0
  344. /package/dist/core/{p-63b88ad2.entry.js.map → p-b62735aa.entry.js.map} +0 -0
  345. /package/dist/core/{p-bb21769c.entry.js.map → p-ba884064.entry.js.map} +0 -0
  346. /package/dist/core/{p-649bd0e1.entry.js.map → p-bdaff5c9.entry.js.map} +0 -0
  347. /package/dist/core/{p-7ef7adc4.entry.js.map → p-c939d07d.entry.js.map} +0 -0
  348. /package/dist/core/{p-ad2a8eab.entry.js.map → p-d375858e.entry.js.map} +0 -0
  349. /package/dist/core/{p-a15dfa51.entry.js.map → p-dfb3e76e.entry.js.map} +0 -0
  350. /package/dist/core/{p-48922e0a.entry.js.map → p-eae017ce.entry.js.map} +0 -0
  351. /package/dist/core/{p-6c31fd9f.entry.js.map → p-f3599009.entry.js.map} +0 -0
  352. /package/dist/core/{p-d4d4b392.entry.js.map → p-f39741be.entry.js.map} +0 -0
  353. /package/dist/core/{p-f73cb96b.entry.js.map → p-f404b35e.entry.js.map} +0 -0
  354. /package/dist/core/{p-04876964.entry.js.map → p-f4a29c16.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["icToggleButtonGroupCss","TOGGLE_GROUP","ToggleButtonGroup","this","keyListener","ev","lastKeyPressed","key","shift","shiftKey","setSlottedAria","el","btn","shadowRoot","querySelector","aria","getAttribute","accessibleLabel","setAttribute","handleHostFocus","loading","disabled","target","relEl","relatedTarget","toggleButtons","Array","from","querySelectorAll","every","toggleChecked","selectType","tagName","focus","toggledButton","filter","handleKeyDown","event","toggleButtonOptions","getAllToggleButtons","focussedChild","indexOf","document","activeElement","selectMethod","proxySelectHandler","getNextItemToSelect","currentItem","movingDown","numToggles","length","nextItem","watchDisabledHandler","removeDisabledFalse","selectHandler","tabTarget","allToggles","clickedToggle","forEach","id","icChange","emit","detail","selectedOption","toggledOptions","map","opt","toggleButton","componentWillLoad","addEventListener","componentDidLoad","i","size","iconPlacement","appearance","variant","fullWidth","toString","tabIndex","classList","add","disconnectedCallback","removeEventListener","toggle","customEv","CustomEvent","render","h","Host","role","tabindex","class","onFocus"],"sources":["src/components/ic-toggle-button-group/ic-toggle-button-group.css?tag=ic-toggle-button-group&encapsulation=shadow","src/components/ic-toggle-button-group/ic-toggle-button-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/* PARENT HOST */\n\n:root {\n display: block;\n}\n\n:host {\n display: flex;\n flex-direction: row;\n width: fit-content;\n min-width: min-content;\n border: var(--ic-border-width) solid var(--ic-action-default);\n border-radius: var(--ic-border-radius);\n}\n\n:host(.full-width) {\n width: 100%;\n max-width: 100%;\n}\n\n:host(.loading) {\n min-width: max-content;\n}\n\n:host(:focus) {\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-transition-duration-fast);\n outline: none;\n}\n\n/* CHILDREN SLOTTED */\n\n::slotted(ic-toggle-button) {\n flex-grow: 1;\n width: min-content;\n\n --toggle-button-border: none;\n}\n\n::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid var(--ic-action-default);\n}\n\n/* DISABLED */\n:host(.disabled) {\n border: var(--ic-border-disabled);\n pointer-events: none;\n}\n\n:host(.disabled) ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-disabled);\n}\n\n/* DARK */\n:host(.dark) {\n border: var(--ic-border-width) solid var(--ic-action-dark);\n}\n\n:host(.dark) ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid var(--ic-action-dark);\n}\n\n/* LIGHT */\n:host(.light) ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid var(--ic-action-light);\n}\n\n:host(.light) {\n border: var(--ic-border-width) solid var(--ic-action-light);\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n State,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcSizes,\n IcThemeForeground,\n IcSelectTypes,\n IcSelectMethodTypes,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-toggle-button-group.types\";\nimport { removeDisabledFalse } from \"../../utils/helpers\";\n\ninterface lastKey {\n key: string | null;\n shift: boolean;\n}\n\nconst TOGGLE_GROUP = \"IC-TOGGLE-BUTTON-GROUP\";\n\n@Component({\n tag: \"ic-toggle-button-group\",\n styleUrl: \"ic-toggle-button-group.css\",\n shadow: true,\n})\nexport class ToggleButtonGroup {\n @Element() el: HTMLIcToggleButtonGroupElement;\n\n @State() lastKeyPressed: lastKey = {\n key: null,\n shift: false,\n };\n\n /**\n * The accessible label of the toggle button group component to provide context for screen reader users.\n */\n @Prop() accessibleLabel?: string = \"Toggle button group\";\n\n /**\n * The appearance of the toggle button group, e.g dark, or light.\n */\n @Prop() appearance: IcThemeForeground = \"default\";\n\n /**\n * If `true`, the toggle button group will be set to the disabled state.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the toggle button group will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The placement of the icons in relation to the toggle button labels.\n */\n @Prop() iconPlacement?: \"left\" | \"right\" | \"top\";\n\n /**\n * If `true`, the toggle button group will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * If `auto`, controls are toggled automatically when navigated to. If `manual`, the controls must be actioned to change their toggled state. The value of this prop is ignored if `selectType` is set to`multi`.\n */\n @Prop({ mutable: true }) selectMethod?: IcSelectMethodTypes = \"manual\";\n\n /**\n * Sets whether single or multiple options can be toggled. If `multi`, then the `selectMethod` is always `manual`.\n */\n @Prop() selectType?: IcSelectTypes = \"single\";\n\n /**\n * The size of the toggle buttons to be displayed. This does not affect the font size of the accessible label.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The variant of the toggle button.\n */\n @Prop({ reflect: true }) variant: \"default\" | \"icon\" = \"default\";\n\n /**\n * Emitted when a toggle button is selected.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"icToggleChecked\")\n selectHandler(ev: CustomEvent, tabTarget?: HTMLIcToggleButtonElement): void {\n const allToggles = this.getAllToggleButtons();\n let clickedToggle = ev.target as HTMLIcToggleButtonElement;\n // tabTarget used in proxySelectHandler\n tabTarget && tabTarget.focus();\n if (this.selectType === \"single\") {\n if (!clickedToggle) {\n clickedToggle = tabTarget;\n }\n allToggles.forEach((el) => {\n if (el.id !== clickedToggle.id && el.toggleChecked) {\n el.toggleChecked = false;\n }\n });\n\n this.icChange.emit({\n toggleChecked: ev.detail.toggleChecked,\n selectedOption: clickedToggle,\n });\n } else {\n const toggledOptions = this.getAllToggleButtons().filter(\n (el) => el.toggleChecked && !el.disabled\n );\n\n this.icChange.emit({\n toggleChecked: toggledOptions.map((opt) => opt.toggleChecked),\n toggledOptions: toggledOptions.map((opt) => ({\n toggleButton: opt,\n })),\n selectedOption: clickedToggle,\n });\n }\n }\n\n componentWillLoad(): void {\n this.selectType === \"multi\" && (this.selectMethod = \"manual\");\n this.selectMethod === \"auto\" && this.selectType === \"single\";\n document.addEventListener(\"keydown\", this.keyListener);\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n this.getAllToggleButtons().forEach((el, i) => {\n this.setSlottedAria(el);\n el.size = this.size;\n el.loading = this.loading;\n el.iconPlacement = this.iconPlacement;\n el.disabled ? null : (el.disabled = this.disabled);\n el.appearance = this.appearance;\n el.variant = this.variant;\n el.fullWidth = this.fullWidth;\n el.id = i.toString();\n el.tabIndex = -1;\n el.addEventListener(\"keydown\", (ev) => {\n this.handleKeyDown(ev);\n });\n el.classList.add(\"expand-toggle-group-child\");\n });\n }\n\n disconnectedCallback(): void {\n document?.removeEventListener(\"keydown\", this.keyListener);\n }\n\n private keyListener = (ev: KeyboardEvent) => {\n this.lastKeyPressed = {\n key: ev.key,\n shift: ev.shiftKey,\n };\n };\n\n private setSlottedAria = (el: HTMLIcToggleButtonElement) => {\n const btn = el.shadowRoot\n .querySelector(\"ic-button\")\n .shadowRoot.querySelector(\"button\") as HTMLButtonElement;\n let aria = btn.getAttribute(\"aria-label\");\n aria += \", \";\n aria += this.accessibleLabel;\n btn.setAttribute(\"aria-label\", aria);\n };\n\n private handleHostFocus = (ev: FocusEvent): void => {\n if (this.loading || this.disabled) {\n return null;\n }\n const el = ev.target as HTMLIcToggleButtonGroupElement;\n const relEl = ev.relatedTarget as HTMLIcToggleButtonElement;\n const toggleButtons = Array.from(el.querySelectorAll(\"ic-toggle-button\"));\n if (\n ((toggleButtons.every((el) => !el.toggleChecked) ||\n this.selectType !== \"single\") &&\n this.lastKeyPressed.shift === false) ||\n (toggleButtons.every((el) => !el.toggleChecked) &&\n this.lastKeyPressed.shift === true &&\n relEl.tagName == TOGGLE_GROUP)\n ) {\n toggleButtons[0].focus();\n } else if (\n this.lastKeyPressed.shift === false ||\n (this.lastKeyPressed.shift === true && relEl.tagName == TOGGLE_GROUP)\n ) {\n // if toggleChecked is true and selectMethod is \"single\", focus that toggle\n const toggledButton = toggleButtons.filter((el) => el.toggleChecked);\n toggledButton[0].focus();\n }\n };\n\n // trigger selectHandler when unable to add 'target'\n private proxySelectHandler(toggle: HTMLIcToggleButtonElement): void {\n toggle.toggleChecked = true;\n const customEv = new CustomEvent(\"icToggleChecked\", {\n detail: {\n toggleChecked: toggle.toggleChecked,\n },\n });\n this.selectHandler(customEv, toggle);\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n const toggleButtonOptions = this.getAllToggleButtons();\n const focussedChild = toggleButtonOptions.indexOf(\n toggleButtonOptions.filter((el) => el === document.activeElement)[0]\n );\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n this.selectMethod === \"auto\"\n ? this.proxySelectHandler(\n toggleButtonOptions[this.getNextItemToSelect(focussedChild, true)]\n )\n : toggleButtonOptions[\n this.getNextItemToSelect(focussedChild, true)\n ].focus();\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n this.selectMethod === \"auto\"\n ? this.proxySelectHandler(\n toggleButtonOptions[\n this.getNextItemToSelect(focussedChild, false)\n ]\n )\n : toggleButtonOptions[\n this.getNextItemToSelect(focussedChild, false)\n ].focus();\n break;\n case \"Tab\":\n break;\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const toggleButtonOptions = this.getAllToggleButtons();\n const numToggles = toggleButtonOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n if (nextItem < 0) {\n nextItem = numToggles;\n } else if (nextItem > numToggles) {\n nextItem = 0;\n }\n\n if (toggleButtonOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n private getAllToggleButtons(): HTMLIcToggleButtonElement[] {\n return Array.from(this.el.querySelectorAll(\"ic-toggle-button\"));\n }\n\n render() {\n return (\n <Host\n role=\"group\"\n aria-label={this.accessibleLabel}\n aria-disabled={this.disabled ? \"true\" : \"false\"}\n tabindex={0}\n class={{\n [\"full-width\"]: this.fullWidth,\n [\"loading\"]: this.loading,\n [\"disabled\"]: this.disabled,\n [`${this.appearance}`]: true,\n }}\n onFocus={this.handleHostFocus}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"4HAAA,MAAMA,EAAyB,gnHC0B/B,MAAMC,EAAe,yB,MAORC,EAAiB,M,4DAoIpBC,KAAAC,YAAeC,IACrBF,KAAKG,eAAiB,CACpBC,IAAKF,EAAGE,IACRC,MAAOH,EAAGI,SACX,EAGKN,KAAAO,eAAkBC,IACxB,MAAMC,EAAMD,EAAGE,WACZC,cAAc,aACdD,WAAWC,cAAc,UAC5B,IAAIC,EAAOH,EAAII,aAAa,cAC5BD,GAAQ,KACRA,GAAQZ,KAAKc,gBACbL,EAAIM,aAAa,aAAcH,EAAK,EAG9BZ,KAAAgB,gBAAmBd,IACzB,GAAIF,KAAKiB,SAAWjB,KAAKkB,SAAU,CACjC,OAAO,I,CAET,MAAMV,EAAKN,EAAGiB,OACd,MAAMC,EAAQlB,EAAGmB,cACjB,MAAMC,EAAgBC,MAAMC,KAAKhB,EAAGiB,iBAAiB,qBACrD,IACIH,EAAcI,OAAOlB,IAAQA,EAAGmB,iBAChC3B,KAAK4B,aAAe,WACpB5B,KAAKG,eAAeE,QAAU,OAC/BiB,EAAcI,OAAOlB,IAAQA,EAAGmB,iBAC/B3B,KAAKG,eAAeE,QAAU,MAC9Be,EAAMS,SAAW/B,EACnB,CACAwB,EAAc,GAAGQ,O,MACZ,GACL9B,KAAKG,eAAeE,QAAU,OAC7BL,KAAKG,eAAeE,QAAU,MAAQe,EAAMS,SAAW/B,EACxD,CAEA,MAAMiC,EAAgBT,EAAcU,QAAQxB,GAAOA,EAAGmB,gBACtDI,EAAc,GAAGD,O,GAeb9B,KAAAiC,cAAiBC,IACvB,MAAMC,EAAsBnC,KAAKoC,sBACjC,MAAMC,EAAgBF,EAAoBG,QACxCH,EAAoBH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,E,CA6DvB,mBAAA5C,GACN,OAAOb,MAAMC,KAAKxB,KAAKQ,GAAGiB,iBAAiB,oB,CAG7C,MAAA0D,GACE,OACEC,EAACC,EAAI,CACHC,KAAK,QAAO,aACAtF,KAAKc,gBAAe,gBACjBd,KAAKkB,SAAW,OAAS,QACxCqE,SAAU,EACVC,MAAO,CACL,CAAC,cAAexF,KAAKyE,UACrB,CAAC,WAAYzE,KAAKiB,QAClB,CAAC,YAAajB,KAAKkB,SACnB,CAAC,GAAGlB,KAAKuE,cAAe,MAE1BkB,QAASzF,KAAKgB,iBAEdoE,EAAA,a"}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as o,H as i,g as r}from"./p-6b5e91e2.js";import{f as n,I as a,d as s,j as l,i as c,w as d}from"./p-6d23ec8e.js";import{I as p}from"./p-26b7b18f.js";const m='/*! 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;--footer-compliance-padding:1rem 0}:host(.footer-sparse){--footer-links-padding:1.5rem 0;--footer-logo-margin-bottom:var(--ic-space-lg);--footer-link-inner-flex-direction:row}:host(.footer-small){--footer-links-padding:0 0;--footer-logo-margin-bottom:var(--ic-space-md);--footer-link-inner-flex-direction:column}:host(.footer-light){--footer-theme-secondary:var(--ic-theme-secondary);--footer-theme-tertiary:var(--ic-theme-tertiary);--footer-keyline:var(--ic-keyline-lighten)}:host(.footer-dark){--footer-theme-secondary:var(--ic-theme-secondary-light);--footer-theme-tertiary:var(--ic-theme-tertiary-light);--footer-keyline:var(--ic-keyline-darken)}:host(.footer-small.footer-ungrouped){--footer-links-padding:var(--ic-space-md) 0 0 0}footer{display:flex;flex-direction:column;width:100%}.footer-description{background-color:var(--footer-theme-secondary);color:var(--ic-theme-text);border-bottom:var(--footer-keyline)}.footer-description-inner{padding:1rem 0}.footer-links{padding:var(--footer-links-padding);background-color:var(--footer-theme-secondary);color:var(--ic-theme-text)}.footer-links-inner{display:flex;flex-direction:var(--footer-link-inner-flex-direction)}.footer-compliance{background-color:var(--footer-theme-tertiary);color:var(--ic-theme-text)}.footer-compliance-inner{padding:var(--footer-compliance-padding)}.footer-logo{margin-bottom:var(--footer-logo-margin-bottom);display:flex;gap:var(--ic-space-xxl)}.footer-logo>::slotted(){margin-right:var(--ic-space-md)}.footer-caption{margin-bottom:var(--ic-space-md)}.classification-spacing{margin-bottom:var(--ic-space-lg)}@media (forced-colors: active){footer{border-top:var(--ic-hc-border)}}';const f=class{constructor(o){e(this,o);this.footerResized=t(this,"footerResized",7);this.resizeObserver=null;this.resizeObserverCallback=e=>{if(e!==this.deviceSize){this.deviceSize=e}this.footerResized.emit()};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const e=n();this.resizeObserverCallback(e)}));this.resizeObserver.observe(this.footerEl)};this.deviceSize=a.XL;this.foregroundColor=s();this.aligned="left";this.breakpoint="medium";this.caption=undefined;this.copyright=true;this.description=undefined;this.groupLinks=false}disconnectedCallback(){if(this.resizeObserver!==null){this.resizeObserver.disconnect()}}componentWillLoad(){this.deviceSize=n()}componentDidLoad(){l(this.runResizeObserver)}themeChangeHandler(e){const t=e.detail;this.foregroundColor=t.mode}isSmall(){const e=this.breakpoint;return e==="extra small"?this.deviceSize<a.XS:e==="small"?this.deviceSize<a.S:e==="medium"?this.deviceSize<a.M:e==="large"?this.deviceSize<a.L:e==="extra large"?this.deviceSize<a.XL:false}render(){const{aligned:e,caption:t,copyright:r,description:n,groupLinks:s,foregroundColor:l}=this;const m=this.isSmall();return o(i,{class:{footer:true,[`footer-${m?"small":"sparse"}`]:true,[`footer-${s?"grouped":"ungrouped"}`]:true,[`footer-${l}`]:true,[p.Dark]:l===p.Dark,[p.Light]:l===p.Light}},o("footer",{ref:e=>this.footerEl=e},(c(this.el,"description")||n)&&o("div",{class:"footer-description"},o("ic-section-container",{aligned:e,fullHeight:true},o("div",{class:"footer-description-inner"},o("ic-typography",{variant:"body"},o("slot",{name:"description"},n))))),c(this.el,"link")&&o("div",{class:"footer-links"},s&&m?o("div",{class:"footer-links-inner",role:"list"},o("slot",{name:"link"})):o("ic-section-container",{fullHeight:true,aligned:e},o("div",{class:"footer-links-inner",role:"list"},o("slot",{name:"link"})))),o("div",{class:"footer-compliance"},o("ic-section-container",{aligned:e,fullHeight:true},o("div",{class:"footer-compliance-inner"},c(this.el,"logo")&&o("div",{class:"footer-logo"},o("slot",{name:"logo"})),(c(this.el,"caption")||t)&&o("div",{class:"footer-caption"},o("ic-typography",{variant:this.deviceSize<=a.M?"caption":"body"},o("slot",{name:"caption"},t))),r&&o("div",{class:{["footer-copyright"]:true,["classification-spacing"]:d()}},o("ic-typography",{variant:this.deviceSize<=a.M?"caption-uppercase":"label-uppercase"},"© Crown Copyright")))))))}get el(){return r(this)}};f.style=m;export{f as ic_footer};
2
- //# sourceMappingURL=p-ec15bf1b.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icFooterCss","Footer","this","resizeObserver","resizeObserverCallback","currSize","deviceSize","footerResized","emit","runResizeObserver","ResizeObserver","getCurrentDeviceSize","observe","footerEl","IC_DEVICE_SIZES","XL","getThemeForegroundColor","disconnectedCallback","disconnect","componentWillLoad","componentDidLoad","checkResizeObserver","themeChangeHandler","ev","theme","detail","foregroundColor","mode","isSmall","bp","breakpoint","XS","S","M","L","render","aligned","caption","copyright","description","groupLinks","small","h","Host","class","footer","IcThemeForegroundEnum","Dark","Light","ref","isSlotUsed","el","fullHeight","variant","name","role","hasClassificationBanner"],"sources":["src/components/ic-footer/ic-footer.css?tag=ic-footer&encapsulation=shadow","src/components/ic-footer/ic-footer.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --footer-compliance-padding: 1rem 0;\n}\n\n:host(.footer-sparse) {\n --footer-links-padding: 1.5rem 0;\n --footer-logo-margin-bottom: var(--ic-space-lg);\n --footer-link-inner-flex-direction: row;\n}\n\n:host(.footer-small) {\n --footer-links-padding: 0 0;\n --footer-logo-margin-bottom: var(--ic-space-md);\n --footer-link-inner-flex-direction: column;\n}\n\n:host(.footer-light) {\n --footer-theme-secondary: var(--ic-theme-secondary);\n --footer-theme-tertiary: var(--ic-theme-tertiary);\n --footer-keyline: var(--ic-keyline-lighten);\n}\n\n:host(.footer-dark) {\n --footer-theme-secondary: var(--ic-theme-secondary-light);\n --footer-theme-tertiary: var(--ic-theme-tertiary-light);\n --footer-keyline: var(--ic-keyline-darken);\n}\n\n:host(.footer-small.footer-ungrouped) {\n --footer-links-padding: var(--ic-space-md) 0 0 0;\n}\n\n/* Main inner footer element */\nfooter {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* Description */\n\n.footer-description {\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n border-bottom: var(--footer-keyline);\n}\n\n.footer-description-inner {\n padding: 1rem 0;\n}\n\n/* Links */\n\n.footer-links {\n padding: var(--footer-links-padding);\n background-color: var(--footer-theme-secondary);\n color: var(--ic-theme-text);\n}\n\n.footer-links-inner {\n display: flex;\n flex-direction: var(--footer-link-inner-flex-direction);\n}\n\n/* Compliance */\n\n.footer-compliance {\n background-color: var(--footer-theme-tertiary);\n color: var(--ic-theme-text);\n}\n\n.footer-compliance-inner {\n padding: var(--footer-compliance-padding);\n}\n\n.footer-logo {\n margin-bottom: var(--footer-logo-margin-bottom);\n display: flex;\n gap: var(--ic-space-xxl);\n}\n\n.footer-logo > ::slotted() {\n margin-right: var(--ic-space-md);\n}\n\n.footer-caption {\n margin-bottom: var(--ic-space-md);\n}\n\n.classification-spacing {\n margin-bottom: var(--ic-space-lg);\n}\n\n@media (forced-colors: active) {\n footer {\n border-top: var(--ic-hc-border);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Prop,\n State,\n h,\n Host,\n Listen,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getThemeForegroundColor,\n checkResizeObserver,\n hasClassificationBanner,\n isSlotUsed,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n private footerEl: HTMLElement;\n private resizeObserver: ResizeObserver = null;\n\n @Element() el: HTMLIcFooterElement;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n @State() foregroundColor: IcThemeForeground = getThemeForegroundColor();\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright: boolean = true;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description: string;\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n }\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.foregroundColor = theme.mode;\n }\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\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.footerEl);\n };\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n groupLinks,\n foregroundColor,\n } = this;\n const small = this.isSmall();\n\n return (\n <Host\n class={{\n footer: true,\n [`footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`footer-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [IcThemeForegroundEnum.Dark]:\n foregroundColor === IcThemeForegroundEnum.Dark,\n [IcThemeForegroundEnum.Light]:\n foregroundColor === IcThemeForegroundEnum.Light,\n }}\n >\n <footer ref={(footerEl) => (this.footerEl = footerEl)}>\n {/* Description */}\n {(isSlotUsed(this.el, \"description\") || description) && (\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n )}\n\n {/* Links */}\n {isSlotUsed(this.el, \"link\") && (\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\" role=\"list\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\" role=\"list\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n )}\n\n {/* Compliance (logo, caption, copyright) */}\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n {isSlotUsed(this.el, \"logo\") && (\n <div class=\"footer-logo\">\n {/* Logo */}\n <slot name=\"logo\" />\n </div>\n )}\n {(isSlotUsed(this.el, \"caption\") || caption) && (\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption\"\n : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n )}\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n this.deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n &copy; Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n </footer>\n </Host>\n );\n }\n}\n"],"mappings":"2KAAA,MAAMA,EAAc,o/H,MCuCPC,EAAM,M,sEAETC,KAAAC,eAAiC,KA8EjCD,KAAAE,uBAA0BC,IAChC,GAAIA,IAAaH,KAAKI,WAAY,CAChCJ,KAAKI,WAAaD,C,CAEpBH,KAAKK,cAAcC,MAAM,EAGnBN,KAAAO,kBAAoB,KAC1BP,KAAKC,eAAiB,IAAIO,gBAAe,KACvC,MAAML,EAAWM,IACjBT,KAAKE,uBAAuBC,EAAS,IAGvCH,KAAKC,eAAeS,QAAQV,KAAKW,SAAS,E,gBAvFdC,EAAgBC,G,qBACAC,I,aAKd,O,gBAKW,S,sCAUd,K,2CAUE,K,CAO/B,oBAAAC,GACE,GAAIf,KAAKC,iBAAmB,KAAM,CAChCD,KAAKC,eAAee,Y,EAIxB,iBAAAC,GACEjB,KAAKI,WAAaK,G,CAGpB,gBAAAS,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CM,EAAA,OAAKE,MAAM,qBAAqBW,KAAK,QACnCb,EAAA,QAAMY,KAAK,YAQrBZ,EAAA,OAAKE,MAAM,qBACTF,EAAA,wBAAsBN,QAASA,EAASgB,WAAY,MAClDV,EAAA,OAAKE,MAAM,2BACRM,EAAWhD,KAAKiD,GAAI,SACnBT,EAAA,OAAKE,MAAM,eAETF,EAAA,QAAMY,KAAK,WAGbJ,EAAWhD,KAAKiD,GAAI,YAAcd,IAClCK,EAAA,OAAKE,MAAM,kBACTF,EAAA,iBACEW,QACEnD,KAAKI,YAAcQ,EAAgBmB,EAC/B,UACA,QAGNS,EAAA,QAAMY,KAAK,WAAWjB,KAI3BC,GACCI,EAAA,OACEE,MAAO,CACL,CAAC,oBAAqB,KACtB,CAAC,0BAA2BY,MAG9Bd,EAAA,iBACEW,QACEnD,KAAKI,YAAcQ,EAAgBmB,EAC/B,oBACA,mBAAiB,0B"}
@@ -1,2 +0,0 @@
1
- import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-6b5e91e2.js";import{a as o}from"./p-26b7b18f.js";import{k as r,G as l,r as h,O as c,n as d,x as u,m as p,a as m,s as b,p as f,i as x,y as v}from"./p-6d23ec8e.js";const g='/*! 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;--ic-input-label-helpertext-padding:var(--ic-space-xxs)}: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);padding-right:var(--ic-space-xxxs)}.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 w=[...v,"title"];const k=class{constructor(s){t(this,s);this.getValidationText=e(this,"getValidationText",7);this.icBlur=e(this,"icBlur",7);this.icChange=e(this,"icChange",7);this.icFocus=e(this,"icFocus",7);this.icInput=e(this,"icInput",7);this.icKeydown=e(this,"icKeydown",7);this.inheritedAttributes={};this.hostMutationObserver=null;this.getMaxLengthExceeded=t=>{this.numChars=t.length;if(this.type==="number"){this.minValueUnattained=t&&Number(t)<Number(this.min);this.maxValueExceeded=Number(t)>Number(this.max)}if(this.maxLength>0){this.maxLengthExceeded=this.numChars>this.maxLength}};this.getMaxCharactersReached=t=>{this.numChars=t.length;this.maxCharactersReached=this.maxCharacters>0?this.numChars>=this.maxCharacters:false;if(this.maxCharactersError&&!this.maxCharactersReached){this.maxCharactersError=false}};this.onInput=t=>{this.value=t.target.value;this.icInput.emit({value:this.value})};this.onBlur=t=>{const e=t.target.value;this.numChars=e.length;this.minCharactersUnattained=this.minCharacters>0?this.numChars<this.minCharacters:false;this.icBlur.emit({value:e})};this.onFocus=t=>{this.icFocus.emit({value:t.target.value})};this.hasStatus=t=>t!==""&&!this.disabled;this.handleFormReset=()=>{this.value=this.initialValue};this.hostMutationCallback=t=>{let e=false;t.forEach((({attributeName:t,type:i,addedNodes:s,removedNodes:a})=>{if(w.includes(t)){this.inheritedAttributes[t]=this.el.getAttribute(t);e=true}else if(i==="childList"){e=r(s,a,"icon")}}));if(e){i(this)}};this.showValidation=()=>{const t=this.readonly?0:this.maxLength;const e=l(this.validationStatus)||l(this.validationText);const i=this.minValueUnattained||this.maxValueExceeded;const s=t>0||this.maxCharactersError||this.minCharactersUnattained;return(!e||i||s)&&!this.validationInlineInternal};this.numChars=0;this.maxCharactersReached=false;this.maxCharactersError=false;this.minCharactersUnattained=false;this.maxLengthExceeded=false;this.maxValueExceeded=false;this.minValueUnattained=false;this.ariaActiveDescendant=undefined;this.ariaAutocomplete=undefined;this.ariaExpanded=undefined;this.ariaOwns=undefined;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autoFocus=false;this.disabled=false;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.hiddenInput=true;this.inputId=`ic-text-field-input-${y++}`;this.inputmode="text";this.label=undefined;this.max=undefined;this.maxCharacters=0;this.maxLength=0;this.maxLengthMessage="Maximum length exceeded";this.min=undefined;this.minCharacters=0;this.name=this.inputId;this.placeholder="";this.readonly=false;this.required=false;this.resize=false;this.role=undefined;this.rows=1;this.size="default";this.small=false;this.spellcheck=false;this.truncateValue=undefined;this.type="text";this.validationInline=false;this.validationInlineInternal=false;this.validationStatus="";this.validationText="";this.debounce=0;this.value="";this.initialValue=this.value}watchDisabledHandler(){h(this.disabled,this.el)}debounceChanged(){this.icChange=c(this.icChange,this.debounce)}watchValueHandler(t){if(this.inputEl&&this.inputEl.value!==t){this.inputEl.value=t}this.getMaxLengthExceeded(t);this.getMaxCharactersReached(t);this.icChange.emit({value:t})}connectedCallback(){this.debounceChanged()}disconnectedCallback(){var t;d(this.el,this.handleFormReset);(t=this.hostMutationObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){if(this.value!==this.initialValue){this.watchValueHandler(this.value)}this.getMaxLengthExceeded(this.value);this.getMaxCharactersReached(this.value);this.inheritedAttributes=u(this.el,w);if(this.readonly){this.maxLengthExceeded=false;this.maxValueExceeded=false;this.minValueUnattained=false}p(this.el,this.handleFormReset);h(this.disabled,this.el)}componentDidLoad(){m([{prop:this.label,propName:"label"}],"Text Field");if(this.validationInlineInternal){this.getValidationText.emit({value:this.validationText})}this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{attributes:true,childList:true})}handleKeyDown(t){this.icKeydown.emit({event:t});this.maxCharactersError=this.maxCharactersReached}async setFocus(){var t;(t=this.inputEl)===null||t===void 0?void 0:t.focus()}render(){const{inputId:t,name:e,label:i,required:n,size:r,small:l,placeholder:h,helperText:c,rows:d,resize:u,disabled:p,value:m,min:v,max:g,maxLength:y,numChars:w,readonly:k,maxLengthExceeded:z,maxCharacters:C,maxCharactersError:I,maxCharactersReached:$,minCharacters:L,minCharactersUnattained:F,minValueUnattained:M,maxValueExceeded:N,validationStatus:j,validationText:T,validationInline:V,validationInlineInternal:q,spellcheck:H,inputmode:B,fullWidth:D,truncateValue:O,hiddenInput:W,showValidation:E}=this;const K=k||p;const S=z||N||M||F||I?I?o.Warning:o.Error:j;const U=z?this.maxLengthMessage:I?`Maximum input is ${C} characters`:N?`Maximum value of ${g} exceeded`:M?`Minimum value of ${v} not met`:F?`Minimum input is ${L} characters`:T;const _=k?0:y;const G=z||I||N||M||y===0&&S===o.Error?"assertive":"polite";const R=this.hasStatus(S)&&!(S==o.Success&&V)&&!q;const A=d>1;const J=y>0?`${t}-charcount-desc`:"";const P=`${J} ${b(t,c!=="",R)}`.trim();const Q=K&&!k;const X=!!this.el.querySelector(`[slot="icon"]`)&&!Q;const Y=`${S===o.Error}`;if(W){f(true,this.el,e,m,K)}return s(a,{class:{["fullwidth"]:D}},s("ic-input-container",{readonly:k,disabled:K},!this.hideLabel&&s("ic-input-label",{for:t,label:i,helperText:c,required:n,disabled:Q,readonly:k}),s("ic-input-component-container",{size:l?"small":r,validationStatus:S,multiLine:A,disabled:K,readonly:k,validationInline:V,fullWidth:D},X&&s("span",{class:{["readonly"]:k,["has-value"]:m.length>0},slot:"left-icon"},s("slot",{name:"icon"})),!A?s("input",Object.assign({id:t,name:e,ref:t=>this.inputEl=t,type:this.type,min:v,max:g,value:m,class:{["no-left-pad"]:!X&&k,["readonly"]:k,["truncate-value"]:O},placeholder:h?h:"",required:n,disabled:K,readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":P,"aria-invalid":Y,"aria-activedescendant":this.ariaActiveDescendant,"aria-expanded":this.ariaExpanded,"aria-owns":this.ariaOwns,autocomplete:this.autocomplete,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:H,inputmode:B,role:this.role,maxlength:$?C:null,minlength:F?L:null},this.inheritedAttributes)):s("textarea",Object.assign({id:t,class:{["no-resize"]:u===false||k,["no-left-pad"]:!X&&k,["readonly"]:k},name:e,ref:t=>this.inputEl=t,value:m,rows:d,required:n,disabled:K,placeholder:h?h:"",readonly:k,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":P,"aria-invalid":Y,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:H,inputmode:B,maxlength:$?C:null,minlength:F?L:null},this.inheritedAttributes)),x(this.el,"clear-button")&&s("slot",{name:"clear-button"}),x(this.el,"search-submit-button")&&s("slot",{name:"search-submit-button"})),x(this.el,"menu")&&s("slot",{name:"menu"}),E()&&s("ic-input-validation",{status:this.hasStatus(S)===false||S===o.Success&&V||q?"":S,message:R?U:"",ariaLiveMode:G,for:t,fullWidth:D},!k&&_>0&&s("div",{slot:"validation-message-adornment"},s("ic-typography",{variant:"caption",class:{["maxlengthtext"]:true,["error"]:z,["disabled"]:Q}},s("span",{"aria-live":"polite",id:`${t}-charcount`,class:"charcount"},w,"/",_),s("span",{hidden:true,id:J},"Field can contain a maximum of ",_," characters."))))))}get el(){return n(this)}static get watchers(){return{disabled:["watchDisabledHandler"],debounce:["debounceChanged"],value:["watchValueHandler"]}}};k.style=g;export{k as ic_text_field};
2
- //# sourceMappingURL=p-f1583332.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icTextFieldCss","inputIds","MUTABLE_ATTRIBUTES","IC_INHERITED_ARIA","TextField","this","inheritedAttributes","hostMutationObserver","getMaxLengthExceeded","value","numChars","length","type","minValueUnattained","Number","min","maxValueExceeded","max","maxLength","maxLengthExceeded","getMaxCharactersReached","maxCharactersReached","maxCharacters","maxCharactersError","onInput","ev","target","icInput","emit","onBlur","minCharactersUnattained","minCharacters","icBlur","onFocus","icFocus","hasStatus","status","disabled","handleFormReset","initialValue","hostMutationCallback","mutationList","forceComponentUpdate","forEach","attributeName","addedNodes","removedNodes","includes","el","getAttribute","checkSlotInChildMutations","forceUpdate","showValidation","maxNumChars","readonly","emptyString","isEmptyString","validationStatus","validationText","valueOutsideRange","charOutsideRange","validationInlineInternal","undefined","inputId","watchDisabledHandler","removeDisabledFalse","debounceChanged","icChange","debounceEvent","debounce","watchValueHandler","newValue","inputEl","connectedCallback","disconnectedCallback","removeFormResetListener","_a","disconnect","componentWillLoad","inheritAttributes","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","label","propName","getValidationText","MutationObserver","observe","attributes","childList","handleKeyDown","icKeydown","event","setFocus","focus","render","name","required","size","small","placeholder","helperText","rows","resize","validationInline","spellcheck","inputmode","fullWidth","truncateValue","hiddenInput","disabledMode","currentStatus","IcInformationStatus","Warning","Error","currentValidationText","maxLengthMessage","messageAriaLive","showStatusText","Success","multiline","hiddenCharCountDescId","describedBy","getInputDescribedByText","trim","disabledText","showLeftIcon","querySelector","invalid","renderHiddenInput","h","Host","class","hideLabel","for","multiLine","slot","Object","assign","id","ref","ariaActiveDescendant","ariaExpanded","ariaOwns","autocomplete","autocapitalize","autoFocus","role","maxlength","minlength","isSlotUsed","message","ariaLiveMode","variant","hidden"],"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"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n /**\n * @prop --input-width: Width of the input field\n */\n display: block;\n\n --ic-input-label-helpertext-padding: var(--ic-space-xxs);\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 padding-right: var(--ic-space-xxxs);\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 forceUpdate,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcInformationStatusOrEmpty,\n IcValueEventDetail,\n IcSizesNoLarge,\n} from \"../../utils/types\";\nimport {\n inheritAttributes,\n debounceEvent,\n getInputDescribedByText,\n renderHiddenInput,\n isEmptyString,\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n isSlotUsed,\n removeDisabledFalse,\n checkSlotInChildMutations,\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;\nconst MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, \"title\"];\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 private inheritedAttributes: { [k: string]: string } = {};\n private inputEl: HTMLInputElement | HTMLTextAreaElement;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcTextFieldElement;\n\n @State() numChars: number = 0;\n @State() maxCharactersReached: boolean = false;\n @State() maxCharactersError: boolean = false;\n @State() minCharactersUnattained: boolean = false;\n @State() maxLengthExceeded: boolean = false;\n @State() maxValueExceeded: boolean = false;\n @State() minValueUnattained: boolean = false;\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 * @internal The active element when focus is on the ic-menu items.\n */\n @Prop() ariaActiveDescendant?: 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 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 * 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 * If `true`, the disabled state will be set.\n */\n @Prop() disabled: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\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 * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText: string = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel: boolean = false;\n\n /**\n * @internal If `true`, the hidden form input will stop rendering for form submission.\n */\n @Prop() hiddenInput: boolean = true;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-text-field-input-${inputIds++}`;\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 label for the input.\n */\n @Prop() label!: string;\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. Will display an error if too many characters are entered.\n */\n @Prop() maxCharacters: number = 0;\n\n /**\n * The count of characters in the field. Will display a warning if the bound is reached.\n */\n @Prop() maxLength: number = 0;\n\n /**\n * The text to display as the validation message when the maximum length is exceeded.\n */\n @Prop() maxLengthMessage: string = \"Maximum length exceeded\";\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 minimum number of characters that can be entered in the field.\n */\n @Prop() minCharacters: number = 0;\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 * The placeholder value to be displayed.\n */\n @Prop() placeholder: string = \"\";\n\n /**\n * If `true`, the read only state will be set.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required: boolean = false;\n\n /**\n * If `true`, the multiline text area will be resizeable.\n */\n @Prop() resize: boolean = false;\n\n /**\n * @internal Used to set the role if not default textbox;\n */\n @Prop() role: 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 * The size of the text field component.\n */\n @Prop() size?: IcSizesNoLarge = \"default\";\n\n /**\n * @deprecated This prop should not be used anymore. Set prop `size` to \"small\" instead.\n */\n @Prop() small?: boolean = false;\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 * @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 * The type of control to display. The default type is text.\n */\n @Prop() type: IcTextFieldTypes = \"text\";\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 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 * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce: number = 0;\n\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = \"\";\n @State() initialValue = this.value;\n\n @Watch(\"value\")\n private watchValueHandler(newValue: string): void {\n if (this.inputEl && this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n\n this.getMaxLengthExceeded(newValue);\n\n this.getMaxCharactersReached(newValue);\n\n this.icChange.emit({ value: newValue });\n }\n\n /**\n * @internal Emitted when the validationInlineInternal is `true`\n */\n @Event() getValidationText: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input loses focus.\n */\n @Event() icBlur: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when input gains focus.\n */\n @Event() icFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n if (this.value !== this.initialValue) {\n this.watchValueHandler(this.value);\n }\n\n this.getMaxLengthExceeded(this.value);\n\n this.getMaxCharactersReached(this.value);\n\n this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);\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 removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Text Field\"\n );\n if (this.validationInlineInternal) {\n this.getValidationText.emit({ value: this.validationText });\n }\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n childList: true,\n });\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n this.icKeydown.emit({ event: ev });\n this.maxCharactersError = this.maxCharactersReached;\n }\n\n /**\n * Sets focus on the native `input`.\n */\n\n @Method()\n async setFocus(): Promise<void> {\n this.inputEl?.focus();\n }\n\n private getMaxLengthExceeded = (value: string) => {\n this.numChars = value.length;\n\n if (this.type === \"number\") {\n this.minValueUnattained = value && Number(value) < Number(this.min);\n this.maxValueExceeded = Number(value) > Number(this.max);\n }\n\n if (this.maxLength > 0) {\n this.maxLengthExceeded = this.numChars > this.maxLength;\n }\n };\n\n private getMaxCharactersReached = (value: string) => {\n this.numChars = value.length;\n this.maxCharactersReached =\n this.maxCharacters > 0 ? this.numChars >= this.maxCharacters : false;\n\n if (this.maxCharactersError && !this.maxCharactersReached) {\n this.maxCharactersError = false;\n }\n };\n\n private onInput = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n };\n\n private onBlur = (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value;\n this.numChars = value.length;\n this.minCharactersUnattained =\n this.minCharacters > 0 ? this.numChars < this.minCharacters : false;\n this.icBlur.emit({ value: value });\n };\n\n private onFocus = (ev: Event) => {\n this.icFocus.emit({ value: (ev.target as HTMLInputElement).value });\n };\n\n private hasStatus = (status: IcInformationStatusOrEmpty) =>\n status !== \"\" && !this.disabled;\n\n private handleFormReset = (): void => {\n this.value = this.initialValue;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach(\n ({ attributeName, type, addedNodes, removedNodes }) => {\n if (MUTABLE_ATTRIBUTES.includes(attributeName)) {\n this.inheritedAttributes[attributeName] =\n this.el.getAttribute(attributeName);\n forceComponentUpdate = true;\n } else if (type === \"childList\") {\n forceComponentUpdate = checkSlotInChildMutations(\n addedNodes,\n removedNodes,\n \"icon\"\n );\n }\n }\n );\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n private showValidation = (): boolean => {\n const maxNumChars = this.readonly ? 0 : this.maxLength;\n const emptyString =\n isEmptyString(this.validationStatus) ||\n isEmptyString(this.validationText);\n const valueOutsideRange = this.minValueUnattained || this.maxValueExceeded;\n const charOutsideRange =\n maxNumChars > 0 ||\n this.maxCharactersError ||\n this.minCharactersUnattained;\n return (\n (!emptyString || valueOutsideRange || charOutsideRange) &&\n !this.validationInlineInternal\n );\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\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 maxCharacters,\n maxCharactersError,\n maxCharactersReached,\n minCharacters,\n minCharactersUnattained,\n minValueUnattained,\n maxValueExceeded,\n validationStatus,\n validationText,\n validationInline,\n validationInlineInternal,\n spellcheck,\n inputmode,\n fullWidth,\n truncateValue,\n hiddenInput,\n showValidation,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const currentStatus =\n maxLengthExceeded ||\n maxValueExceeded ||\n minValueUnattained ||\n minCharactersUnattained ||\n maxCharactersError\n ? maxCharactersError\n ? IcInformationStatus.Warning\n : IcInformationStatus.Error\n : validationStatus;\n\n const currentValidationText = maxLengthExceeded\n ? this.maxLengthMessage\n : maxCharactersError\n ? `Maximum input is ${maxCharacters} characters`\n : maxValueExceeded\n ? `Maximum value of ${max} exceeded`\n : minValueUnattained\n ? `Minimum value of ${min} not met`\n : minCharactersUnattained\n ? `Minimum input is ${minCharacters} characters`\n : validationText;\n\n const maxNumChars = readonly ? 0 : maxLength;\n const messageAriaLive =\n maxLengthExceeded ||\n maxCharactersError ||\n maxValueExceeded ||\n minValueUnattained ||\n (maxLength === 0 && currentStatus === IcInformationStatus.Error)\n ? \"assertive\"\n : \"polite\";\n\n const showStatusText =\n this.hasStatus(currentStatus) &&\n !(currentStatus == IcInformationStatus.Success && validationInline) &&\n !validationInlineInternal;\n\n const multiline = rows > 1;\n const hiddenCharCountDescId =\n maxLength > 0 ? `${inputId}-charcount-desc` : \"\";\n\n const describedBy = `${hiddenCharCountDescId} ${getInputDescribedByText(\n inputId,\n helperText !== \"\",\n showStatusText\n )}`.trim();\n\n const disabledText = disabledMode && !readonly;\n const showLeftIcon =\n !!this.el.querySelector(`[slot=\"icon\"]`) && !disabledText;\n\n const invalid = `${currentStatus === IcInformationStatus.Error}`;\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 size={small ? \"small\" : size}\n validationStatus={currentStatus}\n multiLine={multiline}\n disabled={disabledMode}\n readonly={readonly}\n validationInline={validationInline}\n fullWidth={fullWidth}\n >\n {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\"]: !showLeftIcon && readonly,\n [\"readonly\"]: readonly,\n [\"truncate-value\"]: truncateValue,\n }}\n placeholder={placeholder ? placeholder : \"\"}\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 maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\n {...this.inheritedAttributes}\n ></input>\n ) : (\n <textarea\n id={inputId}\n class={{\n [\"no-resize\"]: resize === false || readonly,\n [\"no-left-pad\"]: !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={placeholder ? placeholder : \"\"}\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 maxlength={maxCharactersReached ? maxCharacters : null}\n minlength={minCharactersUnattained ? minCharacters : null}\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 {showValidation() && (\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"],"mappings":"4NAAA,MAAMA,EAAiB,09HC0CvB,IAAIC,EAAW,EACf,MAAMC,EAAqB,IAAIC,EAAmB,S,MAUrCC,EAAS,M,uPACZC,KAAAC,oBAA+C,GAE/CD,KAAAE,qBAAyC,KAgVzCF,KAAAG,qBAAwBC,IAC9BJ,KAAKK,SAAWD,EAAME,OAEtB,GAAIN,KAAKO,OAAS,SAAU,CAC1BP,KAAKQ,mBAAqBJ,GAASK,OAAOL,GAASK,OAAOT,KAAKU,KAC/DV,KAAKW,iBAAmBF,OAAOL,GAASK,OAAOT,KAAKY,I,CAGtD,GAAIZ,KAAKa,UAAY,EAAG,CACtBb,KAAKc,kBAAoBd,KAAKK,SAAWL,KAAKa,S,GAI1Cb,KAAAe,wBAA2BX,IACjCJ,KAAKK,SAAWD,EAAME,OACtBN,KAAKgB,qBACHhB,KAAKiB,cAAgB,EAAIjB,KAAKK,UAAYL,KAAKiB,cAAgB,MAEjE,GAAIjB,KA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C,IAAI,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU;;;;","names":[],"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-autocomplete\",\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-expanded\",\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 IcDeviceSizes,\n IcColor,\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;\nconst icInput = \"ic-input\";\nconst linkIcInput = \"input.ic-input\";\n\n/**\n * converts an enum of strings into an array of strings\n */\nexport const stringEnumToArray = (\n theEnum: Record<string, string | number>\n): string[] => {\n const arr: string[] = [];\n Object.values(theEnum).forEach((val) => {\n if (isNaN(Number(val))) {\n const str = val as string;\n arr.push(str);\n }\n });\n return arr;\n};\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]: string } => {\n const attributeObject: { [key: string]: string } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = value;\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 | Date | undefined | null,\n disabled: boolean\n): void => {\n if (name !== undefined && (always || hasShadowDom(container))) {\n const inputs = container.querySelectorAll(linkIcInput);\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(icInput);\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n\n if (value instanceof Date) {\n input.value = value ? value.toISOString() : null;\n } else {\n input.value = value || \"\";\n }\n }\n};\n\n/**\n * This method is used to add a hidden file 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 event: The event that is emitted once a file is selected.\n * @param container The element where the input will be added\n * @param multiple If true, multiple files can be selected\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 * @param accept A string of the accepted files\n */\nexport const renderFileHiddenInput = (\n event: EventEmitter,\n container: HTMLElement,\n multiple: boolean,\n name: string,\n value: FileList | undefined | null,\n disabled: boolean,\n accept: string\n): void => {\n if (name !== undefined && hasShadowDom(container)) {\n const inputs = container.querySelectorAll(linkIcInput);\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.classList.add(icInput);\n container.appendChild(input);\n }\n input.type = \"file\";\n input.hidden = true;\n input.multiple = multiple;\n input.name = name;\n input.files = value;\n input.disabled = disabled;\n input.accept = accept;\n input.onchange = () => {\n event.emit(input.files);\n };\n input.click();\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 !!el.shadowRoot && !!el.attachShadow;\n\nexport const getInputHelperTextID = (id: string): string => id + \"-helper-text\";\n\nexport const getInputValidationTextID = (id: string): string =>\n id + \"-validation-text\";\n\nexport const getInputDescribedByText = (\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string =>\n `${helperText ? getInputHelperTextID(inputId) : \"\"} ${\n validationText ? getInputValidationTextID(inputId) : \"\"\n }`.trim();\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\n/**\n * Checks if the current device is a mobile or tablet device.\n * @returns {boolean} Returns true if the device is a mobile or tablet device, otherwise returns false.\n */\nexport const isMobileOrTablet = (): boolean =>\n \"maxTouchPoints\" in navigator && \"userAgent\" in navigator\n ? navigator.maxTouchPoints > 0 &&\n /iPad|iPhone|iPod|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n : false;\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 value ? value.trim().length === 0 : true;\n\n// A helper function that checks if a prop has been defined\nexport const isPropDefined = (prop: string): string | null =>\n prop !== undefined ? prop : null;\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 valueField = \"value\",\n labelField = \"label\"\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 const matchingValue = ungroupedOptions.find(\n (option) => option[valueField] === value\n );\n if (matchingValue !== undefined) return matchingValue[labelField];\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 labelField = \"label\"\n): IcMenuOption[] =>\n options.filter((option) => {\n const label: string = option[labelField].toLowerCase();\n const description = option.description?.toLowerCase();\n const lowerSearchString = searchString.toLowerCase();\n\n return position === \"anywhere\"\n ? includeDescriptions\n ? label.includes(lowerSearchString) ||\n description?.includes(lowerSearchString)\n : label.includes(lowerSearchString)\n : includeDescriptions\n ? label.startsWith(lowerSearchString) ||\n description?.startsWith(lowerSearchString)\n : label.startsWith(lowerSearchString);\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 getComputedStyle(document.documentElement).getPropertyValue(cssVar);\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 return (\n (parseInt(themeRed) * 299 +\n parseInt(themeGreen) * 587 +\n parseInt(themeBlue) * 114) /\n 1000\n );\n};\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n * @param brightness - Optional custom brightness value. Defaults to `getThemeColorBrightness`\n */\nexport const getThemeForegroundColor = (\n brightness = getThemeColorBrightness()\n): IcThemeForeground =>\n brightness > DARK_MODE_THRESHOLD\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\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 = (\n slot: Element\n): NodeListOf<ChildNode> | 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 : slot.tagName ? [slot] : null;\n } else {\n //check for single element\n return slot === null ? null : [slot];\n }\n};\n\nexport const getNavItemParentDetails = ({\n parentElement,\n}: HTMLElement): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n switch (parentElement.tagName) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: parentElement };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: parentElement };\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(\n getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 0\n S: Number(\n getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 576\n M: Number(\n getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 768\n L: Number(\n getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 992\n XL: Number(\n getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => !!status && !disabled;\n\nexport const isSlotUsed = (\n { children }: HTMLElement,\n slotName: string\n): boolean =>\n Array.from(children).some((child) => child.getAttribute(\"slot\") === slotName);\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 props.forEach(({ prop, propName }) => {\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\n .toLowerCase()\n .split(\"-\")\n .map((word, index) =>\n index === 0\n ? word\n : `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`\n )\n .join(\"\");\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 = (v: string) => parseInt(v, 16);\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n const hexChars = hex\n .replace(\"#\", \"\")\n .split(\"\")\n .map((char) => char.repeat(2));\n return {\n r: hex2dec(hex.length === 4 ? hexChars[0] : hex.slice(1, 3)),\n g: hex2dec(hex.length === 4 ? hexChars[1] : hex.slice(3, 5)),\n b: hex2dec(hex.length === 4 ? hexChars[2] : hex.slice(5)),\n a: 1,\n };\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const isRGBA = rgbaStr.slice(3, 4).toLowerCase() === \"a\";\n const rgbValues = rgbaStr\n .substring(isRGBA ? 5 : 4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\")\n .map(Number);\n return {\n r: rgbValues[0],\n g: rgbValues[1],\n b: rgbValues[2],\n a: isRGBA ? rgbValues[3] : 1,\n };\n};\n\nexport const elementOverflowsX = ({\n scrollWidth,\n clientWidth,\n}: HTMLElement): boolean => scrollWidth > clientWidth;\n\nexport const hasClassificationBanner = (): boolean =>\n !!document.querySelector(\"ic-classification-banner:not([inline='true'])\");\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n el.closest(\"FORM\")?.addEventListener(\"reset\", callbackFn);\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n el.closest(\"FORM\")?.removeEventListener(\"reset\", callbackFn);\n};\n\nexport const pxToRem = (px: string, base = 16): string =>\n `${(1 / base) * parseInt(px)}rem`;\n\n/**\n * Removes the disabled attribute from the provided element when its value is set to false.\n * This effectively makes it null, to not confuse screen readers that cannot interpret the false value\n */\nexport const removeDisabledFalse = (\n disabled: boolean,\n element: HTMLElement\n): void => {\n if (!disabled) {\n element.removeAttribute(\"disabled\");\n }\n};\n\nexport const isMacDevice = (): boolean =>\n window.navigator.userAgent.toUpperCase().indexOf(\"MAC\") >= 0;\n\nexport const isNumeric = (value: string): boolean => /^-?\\d+$/.test(value);\n\nexport async function waitForHydration(): Promise<boolean> {\n const elements = document.getElementsByTagName(\"*\");\n\n for (let i = 0; i < elements.length; i++) {\n if (elements[i].tagName.startsWith(\"IC-\")) {\n if (elements[i].classList.contains(\"hydrated\")) {\n return true;\n }\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nexport const convertToRGBA = (color: IcColor): IcColorRGBA | null => {\n const firstChar = color?.slice(0, 1).toLowerCase();\n return firstChar === \"#\"\n ? hexToRgba(color)\n : firstChar === \"r\"\n ? rgbaStrToObj(color)\n : null;\n};\n\nexport const capitalize = (text: string): string =>\n text.charAt(0).toUpperCase() + text.slice(1);\n\nexport const checkSlotInChildMutations = (\n addedNodes: NodeList,\n removedNodes: NodeList,\n slotName: string | string[]\n): boolean => {\n const hasSlot = (nodeList: NodeList) =>\n Array.from(nodeList).some((node) =>\n Array.isArray(slotName)\n ? slotName.some((name) => (node as Element).slot === name)\n : (node as Element).slot === slotName\n );\n return hasSlot(addedNodes) || hasSlot(removedNodes);\n};\n\nexport const isElInAGGrid = (el: HTMLElement): boolean =>\n !!el.closest(\".ag-cell\") && !!el.closest(\".ag-root\");\n"],"version":3}