@ukic/web-components 2.4.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (750) hide show
  1. package/dist/cjs/core.cjs.js +3 -3
  2. package/dist/cjs/core.cjs.js.map +1 -1
  3. package/dist/cjs/{helpers-d166f875.js → helpers-498eb0e2.js} +8 -1
  4. package/dist/cjs/helpers-498eb0e2.js.map +1 -0
  5. package/dist/cjs/ic-accordion-group.cjs.entry.js +94 -0
  6. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -0
  7. package/dist/cjs/ic-accordion.cjs.entry.js +117 -0
  8. package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -0
  9. package/dist/cjs/ic-alert.cjs.entry.js +2 -2
  10. package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
  11. package/dist/cjs/ic-badge.cjs.entry.js +160 -0
  12. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -0
  13. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +6 -4
  14. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-breadcrumb.cjs.entry.js +5 -5
  16. package/dist/cjs/ic-breadcrumb.cjs.entry.js.map +1 -1
  17. package/dist/cjs/ic-button_3.cjs.entry.js +70 -71
  18. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-card.cjs.entry.js +4 -4
  20. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ic-checkbox-group.cjs.entry.js +6 -6
  22. package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ic-checkbox.cjs.entry.js +22 -16
  24. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-chip.cjs.entry.js +12 -7
  26. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-classification-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/ic-data-entity.cjs.entry.js +6 -5
  29. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  30. package/dist/cjs/ic-data-row.cjs.entry.js +5 -4
  31. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ic-dialog.cjs.entry.js +82 -24
  33. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  34. package/dist/cjs/ic-divider.cjs.entry.js +2 -2
  35. package/dist/cjs/ic-empty-state.cjs.entry.js +5 -4
  36. package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -1
  37. package/dist/cjs/ic-footer-link-group.cjs.entry.js +2 -2
  38. package/dist/cjs/ic-footer-link.cjs.entry.js +2 -2
  39. package/dist/cjs/ic-footer.cjs.entry.js +2 -2
  40. package/dist/cjs/ic-hero.cjs.entry.js +9 -6
  41. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  42. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +3 -3
  43. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js.map +1 -1
  44. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +42 -23
  45. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  46. package/dist/cjs/ic-input-label_2.cjs.entry.js +5 -4
  47. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
  48. package/dist/cjs/ic-link.cjs.entry.js +3 -6
  49. package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
  50. package/dist/cjs/ic-menu-group.cjs.entry.js +4 -2
  51. package/dist/cjs/ic-menu-group.cjs.entry.js.map +1 -1
  52. package/dist/cjs/ic-menu-item.cjs.entry.js +11 -15
  53. package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
  54. package/dist/cjs/ic-navigation-button.cjs.entry.js +3 -3
  55. package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
  56. package/dist/cjs/ic-navigation-group.cjs.entry.js +54 -30
  57. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-navigation-item.cjs.entry.js +29 -8
  59. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  60. package/dist/cjs/ic-navigation-menu.cjs.entry.js +2 -2
  61. package/dist/cjs/ic-page-header.cjs.entry.js +8 -4
  62. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-pagination-item.cjs.entry.js +2 -2
  64. package/dist/cjs/ic-pagination.cjs.entry.js +6 -6
  65. package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
  66. package/dist/cjs/ic-popover-menu.cjs.entry.js +21 -21
  67. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  68. package/dist/cjs/ic-radio-group.cjs.entry.js +57 -10
  69. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  70. package/dist/cjs/ic-radio-option.cjs.entry.js +21 -15
  71. package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
  72. package/dist/cjs/ic-search-bar.cjs.entry.js +27 -22
  73. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  74. package/dist/cjs/ic-section-container.cjs.entry.js +1 -1
  75. package/dist/cjs/ic-select.cjs.entry.js +24 -17
  76. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  77. package/dist/cjs/ic-side-navigation.cjs.entry.js +49 -25
  78. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  79. package/dist/cjs/ic-skeleton.cjs.entry.js +4 -3
  80. package/dist/cjs/ic-skeleton.cjs.entry.js.map +1 -1
  81. package/dist/cjs/ic-status-tag.cjs.entry.js +14 -6
  82. package/dist/cjs/ic-status-tag.cjs.entry.js.map +1 -1
  83. package/dist/cjs/ic-step.cjs.entry.js +7 -5
  84. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  85. package/dist/cjs/ic-stepper.cjs.entry.js +5 -2
  86. package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
  87. package/dist/cjs/ic-switch.cjs.entry.js +7 -6
  88. package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
  89. package/dist/cjs/ic-tab-context.cjs.entry.js +4 -4
  90. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  91. package/dist/cjs/ic-tab-group.cjs.entry.js +2 -3
  92. package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
  93. package/dist/cjs/ic-tab-panel.cjs.entry.js +5 -4
  94. package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
  95. package/dist/cjs/ic-tab.cjs.entry.js +8 -8
  96. package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
  97. package/dist/cjs/ic-text-field.cjs.entry.js +5 -6
  98. package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
  99. package/dist/cjs/ic-theme.cjs.entry.js +2 -2
  100. package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
  101. package/dist/cjs/ic-toast.cjs.entry.js +3 -3
  102. package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
  103. package/dist/cjs/ic-top-navigation.cjs.entry.js +5 -5
  104. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  105. package/dist/cjs/ic-typography.cjs.entry.js +13 -5
  106. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  107. package/dist/cjs/{index-54d2bed9.js → index-4f8c900f.js} +70 -15
  108. package/dist/cjs/index-4f8c900f.js.map +1 -0
  109. package/dist/cjs/loader.cjs.js +2 -2
  110. package/dist/cjs/types-7d67439f.js.map +1 -1
  111. package/dist/collection/collection-manifest.json +10 -7
  112. package/dist/collection/components/ic-accordion/ic-accordion.css +551 -0
  113. package/dist/collection/components/ic-accordion/ic-accordion.js +291 -0
  114. package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -0
  115. package/dist/collection/components/ic-accordion/test/basic/ic-accordion.e2e.js +57 -0
  116. package/dist/collection/components/ic-accordion/test/basic/ic-accordion.e2e.js.map +1 -0
  117. package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js +346 -0
  118. package/dist/collection/components/ic-accordion/test/basic/ic-accordion.spec.js.map +1 -0
  119. package/dist/collection/components/ic-accordion-group/ic-accordion-group.css +465 -0
  120. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js +215 -0
  121. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js.map +1 -0
  122. package/dist/collection/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.js +31 -0
  123. package/dist/collection/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.js.map +1 -0
  124. package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.js +114 -0
  125. package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.e2e.js.map +1 -0
  126. package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.spec.js +126 -0
  127. package/dist/collection/components/ic-accordion-group/test/basic/ic-accordion-group.spec.js.map +1 -0
  128. package/dist/collection/components/ic-badge/ic-badge.css +179 -0
  129. package/dist/collection/components/ic-badge/ic-badge.js +397 -0
  130. package/dist/collection/components/ic-badge/ic-badge.js.map +1 -0
  131. package/dist/collection/components/ic-badge/ic-badge.types.js +2 -0
  132. package/dist/collection/components/ic-badge/ic-badge.types.js.map +1 -0
  133. package/dist/collection/components/ic-badge/test/a11y/ic-badge.test.a11y.js +16 -0
  134. package/dist/collection/components/ic-badge/test/a11y/ic-badge.test.a11y.js.map +1 -0
  135. package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js +259 -0
  136. package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js.map +1 -0
  137. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +4 -4
  138. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js.map +1 -1
  139. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +4 -2
  140. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
  141. package/dist/collection/components/ic-button/ic-button.css +40 -19
  142. package/dist/collection/components/ic-button/ic-button.js +99 -62
  143. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  144. package/dist/collection/components/ic-button/test/basic/ic-button.spec.js +30 -2
  145. package/dist/collection/components/ic-button/test/basic/ic-button.spec.js.map +1 -1
  146. package/dist/collection/components/ic-card/ic-card.css +23 -0
  147. package/dist/collection/components/ic-card/ic-card.js +2 -1
  148. package/dist/collection/components/ic-card/ic-card.js.map +1 -1
  149. package/dist/collection/components/ic-checkbox/ic-checkbox.js +126 -15
  150. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  151. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +4 -4
  152. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
  153. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js +7 -0
  154. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js.map +1 -1
  155. package/dist/collection/components/ic-chip/ic-chip.css +10 -5
  156. package/dist/collection/components/ic-chip/ic-chip.js +40 -8
  157. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
  158. package/dist/collection/components/ic-data-entity/ic-data-entity.js +38 -7
  159. package/dist/collection/components/ic-data-entity/ic-data-entity.js.map +1 -1
  160. package/dist/collection/components/ic-data-entity/test/basic/ic-data-entity.spec.js +3 -3
  161. package/dist/collection/components/ic-data-entity/test/basic/ic-data-entity.spec.js.map +1 -1
  162. package/dist/collection/components/ic-data-row/ic-data-row.js +33 -5
  163. package/dist/collection/components/ic-data-row/ic-data-row.js.map +1 -1
  164. package/dist/collection/components/ic-dialog/ic-dialog.js +127 -33
  165. package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
  166. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.e2e.js +4 -4
  167. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.e2e.js.map +1 -1
  168. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js +58 -0
  169. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js.map +1 -1
  170. package/dist/collection/components/ic-empty-state/ic-empty-state.js +8 -4
  171. package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -1
  172. package/dist/collection/components/ic-hero/ic-hero.js +38 -8
  173. package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
  174. package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.css +1 -1
  175. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +61 -11
  176. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
  177. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js +2 -2
  178. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js.map +1 -1
  179. package/dist/collection/components/ic-input-label/ic-input-label.js +26 -4
  180. package/dist/collection/components/ic-input-label/ic-input-label.js.map +1 -1
  181. package/dist/collection/components/ic-link/ic-link.js +1 -4
  182. package/dist/collection/components/ic-link/ic-link.js.map +1 -1
  183. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +6 -5
  184. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
  185. package/dist/collection/components/ic-menu/ic-menu.js +62 -18
  186. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  187. package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +19 -2
  188. package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
  189. package/dist/collection/components/ic-menu-group/ic-menu-group.js +2 -1
  190. package/dist/collection/components/ic-menu-group/ic-menu-group.js.map +1 -1
  191. package/dist/collection/components/ic-menu-item/ic-menu-item.js +10 -14
  192. package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
  193. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +3 -2
  194. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
  195. package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +1 -0
  196. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js +52 -28
  197. package/dist/collection/components/ic-navigation-group/ic-navigation-group.js.map +1 -1
  198. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +19 -4
  199. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +28 -6
  200. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
  201. package/dist/collection/components/ic-page-header/ic-page-header.js +35 -4
  202. package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
  203. package/dist/collection/components/ic-pagination/ic-pagination.js +4 -4
  204. package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
  205. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +20 -20
  206. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
  207. package/dist/collection/components/ic-radio-group/ic-radio-group.css +3 -3
  208. package/dist/collection/components/ic-radio-group/ic-radio-group.js +92 -13
  209. package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
  210. package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js +40 -2
  211. package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js.map +1 -1
  212. package/dist/collection/components/ic-radio-option/ic-radio-option.js +125 -14
  213. package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
  214. package/dist/collection/components/ic-search-bar/ic-search-bar.js +54 -22
  215. package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
  216. package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js +4 -0
  217. package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js.map +1 -1
  218. package/dist/collection/components/ic-select/ic-select.js +154 -18
  219. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  220. package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js +3 -1
  221. package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js.map +1 -1
  222. package/dist/collection/components/ic-select/test/basic/ic-select.spec.js +7 -0
  223. package/dist/collection/components/ic-select/test/basic/ic-select.spec.js.map +1 -1
  224. package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +261 -218
  225. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +65 -23
  226. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  227. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation-test-examples.js +171 -0
  228. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation-test-examples.js.map +1 -1
  229. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js +46 -2
  230. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js.map +1 -1
  231. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.spec.js +33 -0
  232. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.spec.js.map +1 -1
  233. package/dist/collection/components/ic-skeleton/ic-skeleton.js +26 -4
  234. package/dist/collection/components/ic-skeleton/ic-skeleton.js.map +1 -1
  235. package/dist/collection/components/ic-status-tag/ic-status-tag.js +71 -10
  236. package/dist/collection/components/ic-status-tag/ic-status-tag.js.map +1 -1
  237. package/dist/collection/components/ic-step/ic-step.js +5 -4
  238. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  239. package/dist/collection/components/ic-stepper/ic-stepper.js +3 -0
  240. package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
  241. package/dist/collection/components/ic-stepper/test/basic/ic-stepper.spec.js +3 -1
  242. package/dist/collection/components/ic-stepper/test/basic/ic-stepper.spec.js.map +1 -1
  243. package/dist/collection/components/ic-switch/ic-switch.js +34 -6
  244. package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
  245. package/dist/collection/components/ic-tab/ic-tab.js +8 -7
  246. package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
  247. package/dist/collection/components/ic-tab-context/ic-tab-context.js +3 -3
  248. package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
  249. package/dist/collection/components/ic-tab-group/ic-tab-group.js +0 -1
  250. package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
  251. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +4 -3
  252. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
  253. package/dist/collection/components/ic-text-field/ic-text-field.js +34 -8
  254. package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
  255. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js +1 -1
  256. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js.map +1 -1
  257. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js +17 -17
  258. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js.map +1 -1
  259. package/dist/collection/components/ic-toast/ic-toast.js +2 -2
  260. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  261. package/dist/collection/components/ic-tooltip/ic-tooltip.css +7 -1
  262. package/dist/collection/components/ic-tooltip/ic-tooltip.js +25 -29
  263. package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
  264. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js +0 -8
  265. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js.map +1 -1
  266. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js +10 -1
  267. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js.map +1 -1
  268. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +4 -4
  269. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
  270. package/dist/collection/components/ic-top-navigation/test/basic/ic-top-navigation.mobile.e2e.js +2 -0
  271. package/dist/collection/components/ic-top-navigation/test/basic/ic-top-navigation.mobile.e2e.js.map +1 -1
  272. package/dist/collection/components/ic-typography/ic-typography.css +10 -0
  273. package/dist/collection/components/ic-typography/ic-typography.js +11 -3
  274. package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
  275. package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js +1 -1
  276. package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js.map +1 -1
  277. package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js +14 -0
  278. package/dist/collection/components/ic-typography/test/basic/ic-typography.spec.js.map +1 -1
  279. package/dist/collection/utils/constants.js +2 -0
  280. package/dist/collection/utils/constants.js.map +1 -1
  281. package/dist/collection/utils/helpers.js +4 -0
  282. package/dist/collection/utils/helpers.js.map +1 -1
  283. package/dist/collection/utils/types.js.map +1 -1
  284. package/dist/components/helpers.js +7 -1
  285. package/dist/components/helpers.js.map +1 -1
  286. package/dist/components/ic-accordion-group.d.ts +11 -0
  287. package/dist/components/ic-accordion-group.js +140 -0
  288. package/dist/components/ic-accordion-group.js.map +1 -0
  289. package/dist/components/ic-accordion.d.ts +11 -0
  290. package/dist/components/ic-accordion.js +146 -0
  291. package/dist/components/ic-accordion.js.map +1 -0
  292. package/dist/components/ic-back-to-top.js +3 -1
  293. package/dist/components/ic-back-to-top.js.map +1 -1
  294. package/dist/components/ic-badge.d.ts +11 -0
  295. package/dist/components/ic-badge.js +192 -0
  296. package/dist/components/ic-badge.js.map +1 -0
  297. package/dist/components/ic-breadcrumb-group.js +5 -3
  298. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  299. package/dist/components/ic-breadcrumb2.js +4 -4
  300. package/dist/components/ic-breadcrumb2.js.map +1 -1
  301. package/dist/components/ic-button2.js +62 -42
  302. package/dist/components/ic-button2.js.map +1 -1
  303. package/dist/components/ic-card.js +2 -2
  304. package/dist/components/ic-card.js.map +1 -1
  305. package/dist/components/ic-checkbox-group.js +5 -5
  306. package/dist/components/ic-checkbox-group.js.map +1 -1
  307. package/dist/components/ic-checkbox.js +27 -15
  308. package/dist/components/ic-checkbox.js.map +1 -1
  309. package/dist/components/ic-chip.js +11 -5
  310. package/dist/components/ic-chip.js.map +1 -1
  311. package/dist/components/ic-data-entity.js +6 -4
  312. package/dist/components/ic-data-entity.js.map +1 -1
  313. package/dist/components/ic-data-row.js +5 -3
  314. package/dist/components/ic-data-row.js.map +1 -1
  315. package/dist/components/ic-dialog.js +86 -24
  316. package/dist/components/ic-dialog.js.map +1 -1
  317. package/dist/components/ic-divider2.js +1 -1
  318. package/dist/components/ic-empty-state.js +4 -3
  319. package/dist/components/ic-empty-state.js.map +1 -1
  320. package/dist/components/ic-footer-link-group.js +1 -1
  321. package/dist/components/ic-footer-link.js +1 -1
  322. package/dist/components/ic-footer.js +1 -1
  323. package/dist/components/ic-hero.js +9 -5
  324. package/dist/components/ic-hero.js.map +1 -1
  325. package/dist/components/ic-horizontal-scroll2.js +2 -2
  326. package/dist/components/ic-horizontal-scroll2.js.map +1 -1
  327. package/dist/components/ic-input-component-container2.js +11 -7
  328. package/dist/components/ic-input-component-container2.js.map +1 -1
  329. package/dist/components/ic-input-label2.js +5 -3
  330. package/dist/components/ic-input-label2.js.map +1 -1
  331. package/dist/components/ic-input-validation2.js +1 -1
  332. package/dist/components/ic-link2.js +1 -4
  333. package/dist/components/ic-link2.js.map +1 -1
  334. package/dist/components/ic-loading-indicator2.js +9 -5
  335. package/dist/components/ic-loading-indicator2.js.map +1 -1
  336. package/dist/components/ic-menu-group.js +2 -1
  337. package/dist/components/ic-menu-group.js.map +1 -1
  338. package/dist/components/ic-menu-item2.js +10 -14
  339. package/dist/components/ic-menu-item2.js.map +1 -1
  340. package/dist/components/ic-menu2.js +37 -16
  341. package/dist/components/ic-menu2.js.map +1 -1
  342. package/dist/components/ic-navigation-button.js +2 -2
  343. package/dist/components/ic-navigation-button.js.map +1 -1
  344. package/dist/components/ic-navigation-group.js +53 -29
  345. package/dist/components/ic-navigation-group.js.map +1 -1
  346. package/dist/components/ic-navigation-item.js +28 -7
  347. package/dist/components/ic-navigation-item.js.map +1 -1
  348. package/dist/components/ic-navigation-menu2.js +1 -1
  349. package/dist/components/ic-page-header.js +8 -3
  350. package/dist/components/ic-page-header.js.map +1 -1
  351. package/dist/components/ic-pagination.js +8 -5
  352. package/dist/components/ic-pagination.js.map +1 -1
  353. package/dist/components/ic-popover-menu.js +23 -21
  354. package/dist/components/ic-popover-menu.js.map +1 -1
  355. package/dist/components/ic-radio-group.js +63 -11
  356. package/dist/components/ic-radio-group.js.map +1 -1
  357. package/dist/components/ic-radio-option.js +29 -15
  358. package/dist/components/ic-radio-option.js.map +1 -1
  359. package/dist/components/ic-search-bar.js +33 -22
  360. package/dist/components/ic-search-bar.js.map +1 -1
  361. package/dist/components/ic-select.js +35 -16
  362. package/dist/components/ic-select.js.map +1 -1
  363. package/dist/components/ic-side-navigation.js +49 -24
  364. package/dist/components/ic-side-navigation.js.map +1 -1
  365. package/dist/components/ic-skeleton.js +4 -2
  366. package/dist/components/ic-skeleton.js.map +1 -1
  367. package/dist/components/ic-status-tag.js +15 -5
  368. package/dist/components/ic-status-tag.js.map +1 -1
  369. package/dist/components/ic-step.js +7 -4
  370. package/dist/components/ic-step.js.map +1 -1
  371. package/dist/components/ic-stepper.js +4 -1
  372. package/dist/components/ic-stepper.js.map +1 -1
  373. package/dist/components/ic-switch.js +7 -5
  374. package/dist/components/ic-switch.js.map +1 -1
  375. package/dist/components/ic-tab-context.js +6 -4
  376. package/dist/components/ic-tab-context.js.map +1 -1
  377. package/dist/components/ic-tab-group.js +0 -1
  378. package/dist/components/ic-tab-group.js.map +1 -1
  379. package/dist/components/ic-tab-panel.js +4 -3
  380. package/dist/components/ic-tab-panel.js.map +1 -1
  381. package/dist/components/ic-tab.js +9 -7
  382. package/dist/components/ic-tab.js.map +1 -1
  383. package/dist/components/ic-text-field2.js +10 -7
  384. package/dist/components/ic-text-field2.js.map +1 -1
  385. package/dist/components/ic-theme.js +3 -1
  386. package/dist/components/ic-theme.js.map +1 -1
  387. package/dist/components/ic-toast.js +2 -2
  388. package/dist/components/ic-toast.js.map +1 -1
  389. package/dist/components/ic-tooltip2.js +9 -26
  390. package/dist/components/ic-tooltip2.js.map +1 -1
  391. package/dist/components/ic-top-navigation.js +7 -5
  392. package/dist/components/ic-top-navigation.js.map +1 -1
  393. package/dist/components/ic-typography2.js +13 -3
  394. package/dist/components/ic-typography2.js.map +1 -1
  395. package/dist/components/types.js.map +1 -1
  396. package/dist/core/core.css +6 -3
  397. package/dist/core/core.esm.js +1 -1
  398. package/dist/core/core.esm.js.map +1 -1
  399. package/dist/core/{p-932a67ca.entry.js → p-027ea4ff.entry.js} +2 -2
  400. package/dist/core/{p-5fcbcc3f.entry.js → p-09022de8.entry.js} +2 -2
  401. package/dist/core/{p-630ae754.entry.js → p-09eb825d.entry.js} +2 -2
  402. package/dist/core/p-0baa2141.entry.js +2 -0
  403. package/dist/core/p-0baa2141.entry.js.map +1 -0
  404. package/dist/core/p-0dd70d92.entry.js +2 -0
  405. package/dist/core/p-0dd70d92.entry.js.map +1 -0
  406. package/dist/core/p-134b407d.entry.js +2 -0
  407. package/dist/core/p-134b407d.entry.js.map +1 -0
  408. package/dist/core/p-1a5353ed.entry.js +2 -0
  409. package/dist/core/p-1a5353ed.entry.js.map +1 -0
  410. package/dist/core/{p-521c8f40.entry.js → p-27b46a68.entry.js} +2 -2
  411. package/dist/core/p-27b46a68.entry.js.map +1 -0
  412. package/dist/core/{p-94903a21.entry.js → p-30f9fabc.entry.js} +2 -2
  413. package/dist/core/{p-9650e00e.entry.js → p-31236329.entry.js} +2 -2
  414. package/dist/core/p-31236329.entry.js.map +1 -0
  415. package/dist/core/{p-831b0f3f.entry.js → p-3758c2b5.entry.js} +2 -2
  416. package/dist/core/p-39db6642.entry.js +2 -0
  417. package/dist/core/p-39db6642.entry.js.map +1 -0
  418. package/dist/core/p-409e437f.js +2 -0
  419. package/dist/core/p-409e437f.js.map +1 -0
  420. package/dist/core/{p-e3923b67.entry.js → p-4164e7d5.entry.js} +2 -2
  421. package/dist/core/{p-1c54269e.entry.js → p-46053a32.entry.js} +2 -2
  422. package/dist/core/p-46053a32.entry.js.map +1 -0
  423. package/dist/core/{p-607e7bf2.entry.js → p-48525498.entry.js} +2 -2
  424. package/dist/core/p-4af7cb4c.entry.js +2 -0
  425. package/dist/core/p-4af7cb4c.entry.js.map +1 -0
  426. package/dist/core/{p-c1859843.entry.js → p-500e8584.entry.js} +2 -2
  427. package/dist/core/{p-27bf4783.entry.js → p-522947f5.entry.js} +2 -2
  428. package/dist/core/p-522947f5.entry.js.map +1 -0
  429. package/dist/core/p-53533992.entry.js +2 -0
  430. package/dist/core/p-53533992.entry.js.map +1 -0
  431. package/dist/core/p-536b3c97.entry.js +2 -0
  432. package/dist/core/p-536b3c97.entry.js.map +1 -0
  433. package/dist/core/{p-c390fbad.entry.js → p-5bb6c79b.entry.js} +2 -2
  434. package/dist/core/p-5bb6c79b.entry.js.map +1 -0
  435. package/dist/core/{p-ebd60291.entry.js → p-5c722379.entry.js} +2 -2
  436. package/dist/core/{p-ebd60291.entry.js.map → p-5c722379.entry.js.map} +1 -1
  437. package/dist/core/p-5c9457e2.entry.js +2 -0
  438. package/dist/core/p-5c9457e2.entry.js.map +1 -0
  439. package/dist/core/p-613aa265.js.map +1 -1
  440. package/dist/core/p-6286ad7b.entry.js +2 -0
  441. package/dist/core/p-6286ad7b.entry.js.map +1 -0
  442. package/dist/core/p-65715458.entry.js +2 -0
  443. package/dist/core/p-65715458.entry.js.map +1 -0
  444. package/dist/core/p-667711a8.entry.js +2 -0
  445. package/dist/core/p-667711a8.entry.js.map +1 -0
  446. package/dist/core/p-6991655b.entry.js +2 -0
  447. package/dist/core/p-6991655b.entry.js.map +1 -0
  448. package/dist/core/p-69948c3e.entry.js +2 -0
  449. package/dist/core/p-69948c3e.entry.js.map +1 -0
  450. package/dist/core/p-6ce0a089.entry.js +2 -0
  451. package/dist/core/p-6ce0a089.entry.js.map +1 -0
  452. package/dist/core/{p-d16100e8.entry.js → p-700559ee.entry.js} +2 -2
  453. package/dist/core/{p-a421d3a1.entry.js → p-72d6619c.entry.js} +2 -2
  454. package/dist/core/{p-4c4261e7.entry.js → p-78f0118c.entry.js} +2 -2
  455. package/dist/core/p-78f0118c.entry.js.map +1 -0
  456. package/dist/core/p-7bc6eb83.entry.js +2 -0
  457. package/dist/core/p-7bc6eb83.entry.js.map +1 -0
  458. package/dist/core/p-7c913098.entry.js +2 -0
  459. package/dist/core/p-7c913098.entry.js.map +1 -0
  460. package/dist/core/p-8ae11ca6.entry.js +2 -0
  461. package/dist/core/p-8ae11ca6.entry.js.map +1 -0
  462. package/dist/core/p-8fc9b82b.entry.js +2 -0
  463. package/dist/core/p-8fc9b82b.entry.js.map +1 -0
  464. package/dist/core/{p-18068237.js → p-9d124fc7.js} +3 -3
  465. package/dist/core/p-9d124fc7.js.map +1 -0
  466. package/dist/core/p-9ea62161.entry.js +2 -0
  467. package/dist/core/p-9ea62161.entry.js.map +1 -0
  468. package/dist/core/p-a69c8001.entry.js +2 -0
  469. package/dist/core/p-a69c8001.entry.js.map +1 -0
  470. package/dist/core/p-ae1ed418.entry.js +2 -0
  471. package/dist/core/p-ae1ed418.entry.js.map +1 -0
  472. package/dist/core/{p-d65ace31.entry.js → p-af9f1caa.entry.js} +2 -2
  473. package/dist/core/p-af9f1caa.entry.js.map +1 -0
  474. package/dist/core/{p-99741b0f.entry.js → p-b80520e9.entry.js} +2 -2
  475. package/dist/core/p-b80520e9.entry.js.map +1 -0
  476. package/dist/core/p-ba25f08a.entry.js +2 -0
  477. package/dist/core/p-ba25f08a.entry.js.map +1 -0
  478. package/dist/core/p-bb085716.entry.js +2 -0
  479. package/dist/core/p-bb085716.entry.js.map +1 -0
  480. package/dist/core/{p-3297713b.entry.js → p-bb3e7ce5.entry.js} +2 -2
  481. package/dist/core/p-bb3e7ce5.entry.js.map +1 -0
  482. package/dist/core/p-c01d43cf.entry.js +2 -0
  483. package/dist/core/p-c01d43cf.entry.js.map +1 -0
  484. package/dist/core/{p-4f7c20b3.entry.js → p-c08b5a9a.entry.js} +2 -2
  485. package/dist/core/p-c08b5a9a.entry.js.map +1 -0
  486. package/dist/core/p-c5b6d645.entry.js +2 -0
  487. package/dist/core/p-c5b6d645.entry.js.map +1 -0
  488. package/dist/core/p-d4522596.entry.js +2 -0
  489. package/dist/core/p-d4522596.entry.js.map +1 -0
  490. package/dist/core/p-d8022cec.entry.js +2 -0
  491. package/dist/core/p-d8022cec.entry.js.map +1 -0
  492. package/dist/core/{p-c31e6dbb.entry.js → p-e465a208.entry.js} +2 -2
  493. package/dist/core/{p-e2d0039d.entry.js → p-e71ec1fe.entry.js} +2 -2
  494. package/dist/core/p-e71ec1fe.entry.js.map +1 -0
  495. package/dist/core/{p-85dd5e5b.entry.js → p-ed256f1d.entry.js} +2 -2
  496. package/dist/core/p-f2f8e4aa.entry.js +2 -0
  497. package/dist/core/p-f2f8e4aa.entry.js.map +1 -0
  498. package/dist/core/p-f5947c60.entry.js +2 -0
  499. package/dist/core/p-f5947c60.entry.js.map +1 -0
  500. package/dist/core/p-f5d1a0d7.entry.js +2 -0
  501. package/dist/core/p-f5d1a0d7.entry.js.map +1 -0
  502. package/dist/core/p-f62c902b.entry.js +2 -0
  503. package/dist/core/p-f62c902b.entry.js.map +1 -0
  504. package/dist/core/{p-0dcc76b1.entry.js → p-fee7caf1.entry.js} +2 -2
  505. package/dist/core/p-fee7caf1.entry.js.map +1 -0
  506. package/dist/esm/core.js +4 -4
  507. package/dist/esm/core.js.map +1 -1
  508. package/dist/esm/{helpers-b0e80358.js → helpers-c325e537.js} +8 -2
  509. package/dist/esm/helpers-c325e537.js.map +1 -0
  510. package/dist/esm/ic-accordion-group.entry.js +90 -0
  511. package/dist/esm/ic-accordion-group.entry.js.map +1 -0
  512. package/dist/esm/ic-accordion.entry.js +113 -0
  513. package/dist/esm/ic-accordion.entry.js.map +1 -0
  514. package/dist/esm/ic-alert.entry.js +2 -2
  515. package/dist/esm/ic-back-to-top.entry.js +2 -2
  516. package/dist/esm/ic-badge.entry.js +156 -0
  517. package/dist/esm/ic-badge.entry.js.map +1 -0
  518. package/dist/esm/ic-breadcrumb-group.entry.js +6 -4
  519. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  520. package/dist/esm/ic-breadcrumb.entry.js +5 -5
  521. package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
  522. package/dist/esm/ic-button_3.entry.js +70 -71
  523. package/dist/esm/ic-button_3.entry.js.map +1 -1
  524. package/dist/esm/ic-card.entry.js +4 -4
  525. package/dist/esm/ic-card.entry.js.map +1 -1
  526. package/dist/esm/ic-checkbox-group.entry.js +6 -6
  527. package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
  528. package/dist/esm/ic-checkbox.entry.js +22 -16
  529. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  530. package/dist/esm/ic-chip.entry.js +12 -7
  531. package/dist/esm/ic-chip.entry.js.map +1 -1
  532. package/dist/esm/ic-classification-banner.entry.js +1 -1
  533. package/dist/esm/ic-data-entity.entry.js +6 -5
  534. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  535. package/dist/esm/ic-data-row.entry.js +5 -4
  536. package/dist/esm/ic-data-row.entry.js.map +1 -1
  537. package/dist/esm/ic-dialog.entry.js +82 -24
  538. package/dist/esm/ic-dialog.entry.js.map +1 -1
  539. package/dist/esm/ic-divider.entry.js +2 -2
  540. package/dist/esm/ic-empty-state.entry.js +5 -4
  541. package/dist/esm/ic-empty-state.entry.js.map +1 -1
  542. package/dist/esm/ic-footer-link-group.entry.js +2 -2
  543. package/dist/esm/ic-footer-link.entry.js +2 -2
  544. package/dist/esm/ic-footer.entry.js +2 -2
  545. package/dist/esm/ic-hero.entry.js +9 -6
  546. package/dist/esm/ic-hero.entry.js.map +1 -1
  547. package/dist/esm/ic-horizontal-scroll.entry.js +3 -3
  548. package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
  549. package/dist/esm/ic-input-component-container_3.entry.js +42 -23
  550. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  551. package/dist/esm/ic-input-label_2.entry.js +5 -4
  552. package/dist/esm/ic-input-label_2.entry.js.map +1 -1
  553. package/dist/esm/ic-link.entry.js +3 -6
  554. package/dist/esm/ic-link.entry.js.map +1 -1
  555. package/dist/esm/ic-menu-group.entry.js +4 -2
  556. package/dist/esm/ic-menu-group.entry.js.map +1 -1
  557. package/dist/esm/ic-menu-item.entry.js +11 -15
  558. package/dist/esm/ic-menu-item.entry.js.map +1 -1
  559. package/dist/esm/ic-navigation-button.entry.js +3 -3
  560. package/dist/esm/ic-navigation-button.entry.js.map +1 -1
  561. package/dist/esm/ic-navigation-group.entry.js +54 -30
  562. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  563. package/dist/esm/ic-navigation-item.entry.js +29 -8
  564. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  565. package/dist/esm/ic-navigation-menu.entry.js +2 -2
  566. package/dist/esm/ic-page-header.entry.js +8 -4
  567. package/dist/esm/ic-page-header.entry.js.map +1 -1
  568. package/dist/esm/ic-pagination-item.entry.js +2 -2
  569. package/dist/esm/ic-pagination.entry.js +6 -6
  570. package/dist/esm/ic-pagination.entry.js.map +1 -1
  571. package/dist/esm/ic-popover-menu.entry.js +21 -21
  572. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  573. package/dist/esm/ic-radio-group.entry.js +57 -10
  574. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  575. package/dist/esm/ic-radio-option.entry.js +21 -15
  576. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  577. package/dist/esm/ic-search-bar.entry.js +27 -22
  578. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  579. package/dist/esm/ic-section-container.entry.js +1 -1
  580. package/dist/esm/ic-select.entry.js +24 -17
  581. package/dist/esm/ic-select.entry.js.map +1 -1
  582. package/dist/esm/ic-side-navigation.entry.js +49 -25
  583. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  584. package/dist/esm/ic-skeleton.entry.js +4 -3
  585. package/dist/esm/ic-skeleton.entry.js.map +1 -1
  586. package/dist/esm/ic-status-tag.entry.js +14 -6
  587. package/dist/esm/ic-status-tag.entry.js.map +1 -1
  588. package/dist/esm/ic-step.entry.js +7 -5
  589. package/dist/esm/ic-step.entry.js.map +1 -1
  590. package/dist/esm/ic-stepper.entry.js +5 -2
  591. package/dist/esm/ic-stepper.entry.js.map +1 -1
  592. package/dist/esm/ic-switch.entry.js +7 -6
  593. package/dist/esm/ic-switch.entry.js.map +1 -1
  594. package/dist/esm/ic-tab-context.entry.js +4 -4
  595. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  596. package/dist/esm/ic-tab-group.entry.js +2 -3
  597. package/dist/esm/ic-tab-group.entry.js.map +1 -1
  598. package/dist/esm/ic-tab-panel.entry.js +5 -4
  599. package/dist/esm/ic-tab-panel.entry.js.map +1 -1
  600. package/dist/esm/ic-tab.entry.js +8 -8
  601. package/dist/esm/ic-tab.entry.js.map +1 -1
  602. package/dist/esm/ic-text-field.entry.js +5 -6
  603. package/dist/esm/ic-text-field.entry.js.map +1 -1
  604. package/dist/esm/ic-theme.entry.js +2 -2
  605. package/dist/esm/ic-toast-region.entry.js +1 -1
  606. package/dist/esm/ic-toast.entry.js +3 -3
  607. package/dist/esm/ic-toast.entry.js.map +1 -1
  608. package/dist/esm/ic-top-navigation.entry.js +5 -5
  609. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  610. package/dist/esm/ic-typography.entry.js +13 -5
  611. package/dist/esm/ic-typography.entry.js.map +1 -1
  612. package/dist/esm/{index-14c9f375.js → index-813020f1.js} +70 -16
  613. package/dist/esm/index-813020f1.js.map +1 -0
  614. package/dist/esm/loader.js +3 -3
  615. package/dist/esm/types-b2398b37.js.map +1 -1
  616. package/dist/types/components/ic-accordion/ic-accordion.d.ts +55 -0
  617. package/dist/types/components/ic-accordion-group/ic-accordion-group.d.ts +33 -0
  618. package/dist/types/components/ic-accordion-group/test/a11y/ic-accordion-group.test.a11y.d.ts +1 -0
  619. package/dist/types/components/ic-badge/ic-badge.d.ts +61 -0
  620. package/dist/types/components/ic-badge/ic-badge.types.d.ts +9 -0
  621. package/dist/types/components/ic-badge/test/a11y/ic-badge.test.a11y.d.ts +1 -0
  622. package/dist/types/components/ic-button/ic-button.d.ts +14 -6
  623. package/dist/types/components/ic-card/ic-card.d.ts +1 -0
  624. package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +28 -1
  625. package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +1 -1
  626. package/dist/types/components/ic-chip/ic-chip.d.ts +7 -2
  627. package/dist/types/components/ic-data-entity/ic-data-entity.d.ts +10 -2
  628. package/dist/types/components/ic-data-row/ic-data-row.d.ts +7 -2
  629. package/dist/types/components/ic-dialog/ic-dialog.d.ts +15 -5
  630. package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +4 -1
  631. package/dist/types/components/ic-hero/ic-hero.d.ts +7 -3
  632. package/dist/types/components/ic-input-component-container/ic-input-component-container.d.ts +13 -5
  633. package/dist/types/components/ic-input-label/ic-input-label.d.ts +5 -1
  634. package/dist/types/components/ic-loading-indicator/ic-loading-indicator.d.ts +1 -1
  635. package/dist/types/components/ic-menu/ic-menu.d.ts +8 -3
  636. package/dist/types/components/ic-navigation-button/ic-navigation-button.d.ts +1 -0
  637. package/dist/types/components/ic-navigation-group/ic-navigation-group.d.ts +4 -2
  638. package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +3 -0
  639. package/dist/types/components/ic-page-header/ic-page-header.d.ts +6 -2
  640. package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +1 -1
  641. package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +16 -4
  642. package/dist/types/components/ic-radio-option/ic-radio-option.d.ts +28 -1
  643. package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +6 -2
  644. package/dist/types/components/ic-select/ic-select.d.ts +34 -4
  645. package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +5 -0
  646. package/dist/types/components/ic-side-navigation/test/basic/ic-side-navigation-test-examples.d.ts +2 -0
  647. package/dist/types/components/ic-skeleton/ic-skeleton.d.ts +5 -1
  648. package/dist/types/components/ic-status-tag/ic-status-tag.d.ts +12 -2
  649. package/dist/types/components/ic-stepper/ic-stepper.d.ts +1 -0
  650. package/dist/types/components/ic-switch/ic-switch.d.ts +6 -1
  651. package/dist/types/components/ic-tab/ic-tab.d.ts +2 -1
  652. package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +1 -1
  653. package/dist/types/components/ic-tab-group/ic-tab-group.d.ts +0 -1
  654. package/dist/types/components/ic-tab-panel/ic-tab-panel.d.ts +1 -1
  655. package/dist/types/components/ic-text-field/ic-text-field.d.ts +7 -3
  656. package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +5 -3
  657. package/dist/types/components.d.ts +570 -55
  658. package/dist/types/utils/helpers.d.ts +1 -0
  659. package/dist/types/utils/types.d.ts +4 -2
  660. package/hydrate/index.js +1104 -384
  661. package/package.json +15 -6
  662. package/dist/cjs/helpers-d166f875.js.map +0 -1
  663. package/dist/cjs/index-54d2bed9.js.map +0 -1
  664. package/dist/core/p-0a30f1e5.entry.js +0 -2
  665. package/dist/core/p-0a30f1e5.entry.js.map +0 -1
  666. package/dist/core/p-0dcc76b1.entry.js.map +0 -1
  667. package/dist/core/p-101bce17.entry.js +0 -2
  668. package/dist/core/p-101bce17.entry.js.map +0 -1
  669. package/dist/core/p-16e8bb5a.entry.js +0 -2
  670. package/dist/core/p-16e8bb5a.entry.js.map +0 -1
  671. package/dist/core/p-18068237.js.map +0 -1
  672. package/dist/core/p-1c54269e.entry.js.map +0 -1
  673. package/dist/core/p-27897d29.entry.js +0 -2
  674. package/dist/core/p-27897d29.entry.js.map +0 -1
  675. package/dist/core/p-27bf4783.entry.js.map +0 -1
  676. package/dist/core/p-3297713b.entry.js.map +0 -1
  677. package/dist/core/p-3fc638fc.entry.js +0 -2
  678. package/dist/core/p-3fc638fc.entry.js.map +0 -1
  679. package/dist/core/p-433cfd47.entry.js +0 -2
  680. package/dist/core/p-433cfd47.entry.js.map +0 -1
  681. package/dist/core/p-455bfed1.entry.js +0 -2
  682. package/dist/core/p-455bfed1.entry.js.map +0 -1
  683. package/dist/core/p-4c4261e7.entry.js.map +0 -1
  684. package/dist/core/p-4f7c20b3.entry.js.map +0 -1
  685. package/dist/core/p-521c8f40.entry.js.map +0 -1
  686. package/dist/core/p-5b8be53f.entry.js +0 -2
  687. package/dist/core/p-5b8be53f.entry.js.map +0 -1
  688. package/dist/core/p-62499150.entry.js +0 -2
  689. package/dist/core/p-62499150.entry.js.map +0 -1
  690. package/dist/core/p-65df7222.entry.js +0 -2
  691. package/dist/core/p-65df7222.entry.js.map +0 -1
  692. package/dist/core/p-6781620e.entry.js +0 -2
  693. package/dist/core/p-6781620e.entry.js.map +0 -1
  694. package/dist/core/p-67c18f72.entry.js +0 -2
  695. package/dist/core/p-67c18f72.entry.js.map +0 -1
  696. package/dist/core/p-68fda79a.entry.js +0 -2
  697. package/dist/core/p-68fda79a.entry.js.map +0 -1
  698. package/dist/core/p-7194c255.entry.js +0 -2
  699. package/dist/core/p-7194c255.entry.js.map +0 -1
  700. package/dist/core/p-77266738.entry.js +0 -2
  701. package/dist/core/p-77266738.entry.js.map +0 -1
  702. package/dist/core/p-7be2b1fd.entry.js +0 -2
  703. package/dist/core/p-7be2b1fd.entry.js.map +0 -1
  704. package/dist/core/p-83e535de.entry.js +0 -2
  705. package/dist/core/p-83e535de.entry.js.map +0 -1
  706. package/dist/core/p-87149cbd.entry.js +0 -2
  707. package/dist/core/p-87149cbd.entry.js.map +0 -1
  708. package/dist/core/p-8e6169e0.entry.js +0 -2
  709. package/dist/core/p-8e6169e0.entry.js.map +0 -1
  710. package/dist/core/p-9248228e.entry.js +0 -2
  711. package/dist/core/p-9248228e.entry.js.map +0 -1
  712. package/dist/core/p-937ecd5b.entry.js +0 -2
  713. package/dist/core/p-937ecd5b.entry.js.map +0 -1
  714. package/dist/core/p-96022913.entry.js +0 -2
  715. package/dist/core/p-96022913.entry.js.map +0 -1
  716. package/dist/core/p-9650e00e.entry.js.map +0 -1
  717. package/dist/core/p-99741b0f.entry.js.map +0 -1
  718. package/dist/core/p-a0a02a13.entry.js +0 -2
  719. package/dist/core/p-a0a02a13.entry.js.map +0 -1
  720. package/dist/core/p-a6f48272.entry.js +0 -2
  721. package/dist/core/p-a6f48272.entry.js.map +0 -1
  722. package/dist/core/p-b0b1de0e.entry.js +0 -2
  723. package/dist/core/p-b0b1de0e.entry.js.map +0 -1
  724. package/dist/core/p-c390fbad.entry.js.map +0 -1
  725. package/dist/core/p-cb2c18de.entry.js +0 -2
  726. package/dist/core/p-cb2c18de.entry.js.map +0 -1
  727. package/dist/core/p-d20917ae.entry.js +0 -2
  728. package/dist/core/p-d20917ae.entry.js.map +0 -1
  729. package/dist/core/p-d65ace31.entry.js.map +0 -1
  730. package/dist/core/p-d78c90fe.entry.js +0 -2
  731. package/dist/core/p-d78c90fe.entry.js.map +0 -1
  732. package/dist/core/p-e2d0039d.entry.js.map +0 -1
  733. package/dist/core/p-ebe76390.js +0 -2
  734. package/dist/core/p-ebe76390.js.map +0 -1
  735. package/dist/core/p-fedcfea3.entry.js +0 -2
  736. package/dist/core/p-fedcfea3.entry.js.map +0 -1
  737. package/dist/esm/helpers-b0e80358.js.map +0 -1
  738. package/dist/esm/index-14c9f375.js.map +0 -1
  739. /package/dist/core/{p-932a67ca.entry.js.map → p-027ea4ff.entry.js.map} +0 -0
  740. /package/dist/core/{p-5fcbcc3f.entry.js.map → p-09022de8.entry.js.map} +0 -0
  741. /package/dist/core/{p-630ae754.entry.js.map → p-09eb825d.entry.js.map} +0 -0
  742. /package/dist/core/{p-94903a21.entry.js.map → p-30f9fabc.entry.js.map} +0 -0
  743. /package/dist/core/{p-831b0f3f.entry.js.map → p-3758c2b5.entry.js.map} +0 -0
  744. /package/dist/core/{p-e3923b67.entry.js.map → p-4164e7d5.entry.js.map} +0 -0
  745. /package/dist/core/{p-607e7bf2.entry.js.map → p-48525498.entry.js.map} +0 -0
  746. /package/dist/core/{p-c1859843.entry.js.map → p-500e8584.entry.js.map} +0 -0
  747. /package/dist/core/{p-d16100e8.entry.js.map → p-700559ee.entry.js.map} +0 -0
  748. /package/dist/core/{p-a421d3a1.entry.js.map → p-72d6619c.entry.js.map} +0 -0
  749. /package/dist/core/{p-c31e6dbb.entry.js.map → p-e465a208.entry.js.map} +0 -0
  750. /package/dist/core/{p-85dd5e5b.entry.js.map → p-ed256f1d.entry.js.map} +0 -0
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { Host, h, } from "@stencil/core";
13
+ import { Host, forceUpdate, h, } from "@stencil/core";
14
14
  import { getThemeFromContext, inheritAttributes, isSlotUsed, removeDisabledFalse, } from "../../utils/helpers";
15
15
  import { IC_INHERITED_ARIA } from "../../utils/constants";
16
16
  import { IcThemeForegroundEnum, } from "../../utils/types";
@@ -19,6 +19,7 @@ let buttonIds = 0;
19
19
  * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.
20
20
  * @slot left-icon - Content will be placed to the left of the button label.
21
21
  * @slot right-icon - Content will be placed to the right of the button label.
22
+ * @slot badge - Badge component overlaying the top right of the button.
22
23
  */
23
24
  export class Button {
24
25
  constructor() {
@@ -28,6 +29,7 @@ export class Button {
28
29
  this.describedByEl = null;
29
30
  this.describedById = null;
30
31
  this.mutationObserver = null;
32
+ this.hostMutationObserver = null;
31
33
  this.setViewBox = () => {
32
34
  let iconEl;
33
35
  if (this.hasLeftIconSlot()) {
@@ -62,8 +64,31 @@ export class Button {
62
64
  this.mutationCallback = () => {
63
65
  this.describedByContent = this.describedByEl.innerText;
64
66
  };
67
+ // triggered when attributes of host element change
68
+ this.hostMutationCallback = (mutationList) => {
69
+ let forceComponentUpdate = false;
70
+ mutationList.forEach((item) => {
71
+ if (item.attributeName === "title") {
72
+ this.title = this.el.getAttribute(item.attributeName);
73
+ }
74
+ if (item.attributeName === "aria-label") {
75
+ this.ariaLabel = this.el.getAttribute(item.attributeName);
76
+ }
77
+ if (IC_INHERITED_ARIA.includes(item.attributeName)) {
78
+ this.inheritedAttributes[item.attributeName] = this.el.getAttribute(item.attributeName);
79
+ forceComponentUpdate = true;
80
+ }
81
+ });
82
+ if (forceComponentUpdate) {
83
+ forceUpdate(this);
84
+ }
85
+ };
86
+ this.ariaLabel = null;
65
87
  this.describedByContent = null;
88
+ this.title = null;
66
89
  this.appearance = "default";
90
+ this.ariaControlsId = undefined;
91
+ this.ariaOwnsId = undefined;
67
92
  this.disabled = false;
68
93
  this.disableTooltip = false;
69
94
  this.download = false;
@@ -89,39 +114,55 @@ export class Button {
89
114
  if (this.mutationObserver !== null && this.mutationObserver !== undefined) {
90
115
  this.mutationObserver.disconnect();
91
116
  }
117
+ if (this.hostMutationObserver !== null &&
118
+ this.hostMutationObserver !== undefined) {
119
+ this.hostMutationObserver.disconnect();
120
+ }
92
121
  }
93
122
  componentWillUpdate() {
94
123
  this.loadingWidth();
95
124
  }
96
125
  componentWillLoad() {
97
- this.inheritedAttributes = inheritAttributes(this.el, [
126
+ const allInheritedAttributes = inheritAttributes(this.el, [
98
127
  ...IC_INHERITED_ARIA,
99
- "aria-expanded",
100
128
  "title",
101
129
  ]);
130
+ const { title, "aria-label": ariaLabel } = allInheritedAttributes, restInheritedAttributes = __rest(allInheritedAttributes, ["title", "aria-label"]);
131
+ this.title = title;
132
+ this.ariaLabel = ariaLabel;
133
+ this.inheritedAttributes = restInheritedAttributes;
102
134
  removeDisabledFalse(this.disabled, this.el);
103
135
  this.el.setAttribute("exportparts", "button");
104
136
  const id = this.el.id;
105
137
  this.id = id !== undefined ? id : null;
106
- this.hasTooltip = this.variant === "icon" && this.disableTooltip === false;
138
+ this.hasTooltip =
139
+ !this.disableTooltip && (!!this.title || this.variant === "icon");
107
140
  if (!this.hasTooltip) {
108
141
  const describedById = this.inheritedAttributes["aria-describedby"];
109
142
  if (describedById !== undefined) {
110
143
  this.describedById = describedById;
111
144
  const el = this.el.parentElement.querySelector(`#${describedById}`);
112
- this.describedByContent = el.innerText;
113
- this.describedByEl = el;
145
+ if (el !== undefined && el !== null) {
146
+ this.describedByContent = el.innerText;
147
+ this.describedByEl = el;
148
+ }
114
149
  }
115
150
  }
116
151
  }
117
152
  componentDidLoad() {
118
153
  this.updateTheme();
119
- if (this.describedById) {
120
- this.mutationObserver = new MutationObserver(this.mutationCallback);
121
- this.mutationObserver.observe(this.describedByEl, {
122
- characterData: true,
123
- childList: true,
124
- subtree: true,
154
+ if (typeof MutationObserver !== "undefined") {
155
+ if (this.describedById) {
156
+ this.mutationObserver = new MutationObserver(this.mutationCallback);
157
+ this.mutationObserver.observe(this.describedByEl, {
158
+ characterData: true,
159
+ childList: true,
160
+ subtree: true,
161
+ });
162
+ }
163
+ this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
164
+ this.hostMutationObserver.observe(this.el, {
165
+ attributes: true,
125
166
  });
126
167
  }
127
168
  }
@@ -146,18 +187,6 @@ export class Button {
146
187
  this.buttonEl.focus();
147
188
  }
148
189
  }
149
- /**
150
- * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.
151
- */
152
- async updateAriaLabel(newValue) {
153
- if (this.hasTooltip) {
154
- this.tooltipEl.label = newValue;
155
- this.buttonEl.setAttribute("aria-label", null);
156
- }
157
- else {
158
- this.buttonEl.setAttribute("aria-label", newValue);
159
- }
160
- }
161
190
  hasIconSlot() {
162
191
  const iconEl = this.el.querySelector(`[slot="icon"]`);
163
192
  return iconEl !== null;
@@ -186,7 +215,7 @@ export class Button {
186
215
  }
187
216
  render() {
188
217
  const TagType = (this.href && "a") || "button";
189
- const _a = this.inheritedAttributes, { title, "aria-label": ariaLabel } = _a, restInheritedAttributes = __rest(_a, ["title", "aria-label"]);
218
+ const { title, ariaLabel, inheritedAttributes } = this;
190
219
  const buttonAttrs = TagType === "button"
191
220
  ? {
192
221
  type: this.type,
@@ -206,17 +235,6 @@ export class Button {
206
235
  referrerpolicy: this.referrerpolicy,
207
236
  hreflang: this.hreflang,
208
237
  };
209
- const newTitle = title && title;
210
- const titleAttr = this.hasTooltip ? {} : { title: newTitle };
211
- let tooltipText = "";
212
- if (this.hasTooltip) {
213
- if (newTitle !== undefined) {
214
- tooltipText = newTitle;
215
- }
216
- else if (ariaLabel !== null) {
217
- tooltipText = ariaLabel;
218
- }
219
- }
220
238
  let describedBy = null;
221
239
  let buttonId = null;
222
240
  if (this.hasTooltip) {
@@ -230,7 +248,7 @@ export class Button {
230
248
  describedBy = this.describedById;
231
249
  }
232
250
  const ButtonContent = () => {
233
- return (h(TagType, Object.assign({ class: "button", "aria-disabled": this.loading || this.disabled ? "true" : null, "aria-label": this.loading ? "Loading" : ariaLabel }, buttonAttrs, restInheritedAttributes, titleAttr, { onFocus: this.onFocus, onBlur: this.onBlur, ref: (el) => (this.buttonEl = el), id: buttonId, "aria-describedby": this.hasTooltip && ariaLabel ? null : describedBy, part: "button" }), this.hasIconSlot() && !this.loading && (h("div", { class: "icon-container" }, h("slot", { name: "icon" }))), this.hasLeftIconSlot() && !this.loading && (h("div", { class: "icon-container" }, h("slot", { name: "left-icon" }))), this.loading ? (h("div", { class: "loading-container" }, h("ic-loading-indicator", { type: "linear", appearance: this.variant === "primary" ||
251
+ return (h(TagType, Object.assign({ class: "button", "aria-disabled": this.loading || this.disabled ? "true" : null, "aria-label": this.loading ? "Loading" : ariaLabel }, buttonAttrs, inheritedAttributes, { onFocus: this.onFocus, onBlur: this.onBlur, ref: (el) => (this.buttonEl = el), "aria-describedby": describedBy, part: "button" }), this.hasIconSlot() && !this.loading && (h("div", { class: "icon-container" }, h("slot", { name: "icon" }))), this.hasLeftIconSlot() && !this.loading && (h("div", { class: "icon-container" }, h("slot", { name: "left-icon" }))), this.loading ? (h("div", { class: "loading-container" }, h("ic-loading-indicator", { type: "linear", appearance: this.variant === "primary" ||
234
252
  this.variant === "destructive" ||
235
253
  this.appearance === IcThemeForegroundEnum.Dark ||
236
254
  this.appearance === IcThemeForegroundEnum.Light
@@ -246,7 +264,7 @@ export class Button {
246
264
  ["light"]: this.appearance === IcThemeForegroundEnum.Light,
247
265
  ["full-width"]: this.fullWidth,
248
266
  ["with-badge"]: isSlotUsed(this.el, "badge"),
249
- }, onClick: this.handleClick }, this.hasTooltip && (h("ic-tooltip", { class: { ["tooltip-disabled"]: this.disableTooltip }, ref: (el) => (this.tooltipEl = el), label: tooltipText, target: buttonId, placement: this.tooltipPlacement }, h(ButtonContent, null))), !this.hasTooltip && h(ButtonContent, null), this.describedByContent && (h("span", { id: describedBy, class: "ic-button-describedby" }, this.describedByContent))));
267
+ }, onClick: this.handleClick, "aria-owns": this.ariaOwnsId, "aria-controls": this.ariaControlsId }, this.hasTooltip && (h("ic-tooltip", { id: describedBy, label: title ? title : ariaLabel, target: buttonId, placement: this.tooltipPlacement }, h(ButtonContent, null))), isSlotUsed(this.el, "badge") && h("slot", { name: "badge" }), !this.hasTooltip && h(ButtonContent, null), this.describedByContent && (h("span", { id: describedBy, class: "ic-button-describedby" }, this.describedByContent))));
250
268
  }
251
269
  static get is() { return "ic-button"; }
252
270
  static get encapsulation() { return "shadow"; }
@@ -287,6 +305,46 @@ export class Button {
287
305
  "reflect": false,
288
306
  "defaultValue": "\"default\""
289
307
  },
308
+ "ariaControlsId": {
309
+ "type": "any",
310
+ "mutable": false,
311
+ "complexType": {
312
+ "original": "string | boolean",
313
+ "resolved": "boolean | string",
314
+ "references": {}
315
+ },
316
+ "required": false,
317
+ "optional": false,
318
+ "docs": {
319
+ "tags": [{
320
+ "name": "internal",
321
+ "text": "Used to identify any related child component"
322
+ }],
323
+ "text": ""
324
+ },
325
+ "attribute": "aria-controls-id",
326
+ "reflect": false
327
+ },
328
+ "ariaOwnsId": {
329
+ "type": "any",
330
+ "mutable": false,
331
+ "complexType": {
332
+ "original": "string | boolean",
333
+ "resolved": "boolean | string",
334
+ "references": {}
335
+ },
336
+ "required": false,
337
+ "optional": false,
338
+ "docs": {
339
+ "tags": [{
340
+ "name": "internal",
341
+ "text": "Used to identify any related child component"
342
+ }],
343
+ "text": ""
344
+ },
345
+ "attribute": "aria-owns-id",
346
+ "reflect": false
347
+ },
290
348
  "disabled": {
291
349
  "type": "boolean",
292
350
  "mutable": false,
@@ -669,7 +727,9 @@ export class Button {
669
727
  }
670
728
  static get states() {
671
729
  return {
672
- "describedByContent": {}
730
+ "ariaLabel": {},
731
+ "describedByContent": {},
732
+ "title": {}
673
733
  };
674
734
  }
675
735
  static get events() {
@@ -723,29 +783,6 @@ export class Button {
723
783
  "text": "Sets focus on the native `button`.",
724
784
  "tags": []
725
785
  }
726
- },
727
- "updateAriaLabel": {
728
- "complexType": {
729
- "signature": "(newValue: string) => Promise<void>",
730
- "parameters": [{
731
- "tags": [],
732
- "text": ""
733
- }],
734
- "references": {
735
- "Promise": {
736
- "location": "global",
737
- "id": "global::Promise"
738
- }
739
- },
740
- "return": "Promise<void>"
741
- },
742
- "docs": {
743
- "text": "",
744
- "tags": [{
745
- "name": "internal",
746
- "text": "Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change."
747
- }]
748
- }
749
786
  }
750
787
  };
751
788
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAGL,qBAAqB,GAEtB,MAAM,mBAAmB,CAAC;AAE3B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;;;GAIG;AAQH,MAAM,OAAO,MAAM;;IAET,gBAAW,GAAG,SAAS,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n isSlotUsed,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n IcSizes,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.\n * @slot left-icon - Content will be placed to the left of the button label.\n * @slot right-icon - Content will be placed to the right of the button label.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private tooltipEl: HTMLIcTooltipElement;\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() describedByContent: string = null;\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n }\n\n componentWillUpdate(): void {\n this.loadingWidth();\n }\n\n componentWillLoad(): void {\n this.inheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"aria-expanded\",\n \"title\",\n ]);\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip = this.variant === \"icon\" && this.disableTooltip === false;\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n }\n\n componentWillRender(): void {\n this.setViewBox()?.setAttribute(\"viewBox\", \"0 0 24 24\");\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n /**\n * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.\n */\n @Method()\n async updateAriaLabel(newValue: string): Promise<void> {\n if (this.hasTooltip) {\n this.tooltipEl.label = newValue;\n this.buttonEl.setAttribute(\"aria-label\", null);\n } else {\n this.buttonEl.setAttribute(\"aria-label\", newValue);\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n return iconEl !== null;\n }\n\n private hasRightIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n return iconEl !== null;\n }\n\n private setViewBox = () => {\n let iconEl;\n if (this.hasLeftIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n } else if (this.hasRightIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n } else {\n iconEl = null;\n }\n return iconEl;\n };\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private loadingWidth = () => {\n if (this.loading) {\n this.el.style.setProperty(\n \"--min-width\",\n `${this.el.getBoundingClientRect().width}px`\n );\n }\n };\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = this.inheritedAttributes;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n const newTitle = title && (title as string);\n const titleAttr = this.hasTooltip ? {} : { title: newTitle };\n let tooltipText = \"\";\n if (this.hasTooltip) {\n if (newTitle !== undefined) {\n tooltipText = newTitle;\n } else if (ariaLabel !== null) {\n tooltipText = ariaLabel as string;\n }\n }\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...restInheritedAttributes}\n {...titleAttr}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n id={buttonId}\n aria-describedby={this.hasTooltip && ariaLabel ? null : describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.hasLeftIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n {this.hasRightIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"right-icon\" />\n </div>\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n [\"with-badge\"]: isSlotUsed(this.el, \"badge\"),\n }}\n onClick={this.handleClick}\n >\n {this.hasTooltip && (\n <ic-tooltip\n class={{ [\"tooltip-disabled\"]: this.disableTooltip }}\n ref={(el) => (this.tooltipEl = el)}\n label={tooltipText}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ic-button.js","sourceRoot":"","sources":["../../../src/components/ic-button/ic-button.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,KAAK,EACL,WAAW,EACX,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM1D,OAAO,EAIL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB;;;;;GAKG;AAQH,MAAM,OAAO,MAAM;;IAET,gBAAW,GAAG,SAAS,EAAE,CAAC;IAC1B,eAAU,GAAY,KAAK,CAAC;IAE5B,wBAAmB,GAA6B,EAAE,CAAC;IACnD,kBAAa,GAAgB,IAAI,CAAC;IAClC,kBAAa,GAAW,IAAI,CAAC;IAC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kB,IAAI,CAC1B,YAAM,EAAE,EAAE,WAAW,EAAE,KAAK,EAAC,uBAAuB,IACjD,IAAI,CAAC,kBAAkB,CACnB,CACR,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Method,\n Prop,\n State,\n forceUpdate,\n h,\n} from \"@stencil/core\";\n\nimport {\n getThemeFromContext,\n inheritAttributes,\n isSlotUsed,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\nimport { IC_INHERITED_ARIA } from \"../../utils/constants\";\nimport {\n IcButtonTypes,\n IcButtonVariants,\n IcButtonTooltipPlacement,\n} from \"./ic-button.types\";\nimport {\n IcSizes,\n IcTheme,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../../utils/types\";\n\nlet buttonIds = 0;\n\n/**\n * @slot icon - Deprecated. This slot should not be used anymore. Use left-icon or right-icon slot instead.\n * @slot left-icon - Content will be placed to the left of the button label.\n * @slot right-icon - Content will be placed to the right of the button label.\n * @slot badge - Badge component overlaying the top right of the button.\n */\n@Component({\n tag: \"ic-button\",\n styleUrl: \"ic-button.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Button {\n private buttonEl: HTMLElement;\n private buttonIdNum = buttonIds++;\n private hasTooltip: boolean = false;\n private id: string;\n private inheritedAttributes: { [k: string]: unknown } = {};\n private describedByEl: HTMLElement = null;\n private describedById: string = null;\n private mutationObserver: MutationObserver = null;\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcButtonElement;\n\n @State() ariaLabel: string = null;\n @State() describedByContent: string = null;\n @State() title: string = null;\n\n /**\n * The appearance of the button, e.g. dark, light, or the default.\n */\n @Prop({ mutable: true }) appearance?: IcThemeForeground = \"default\";\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaControlsId: string | boolean;\n\n /**\n * @internal Used to identify any related child component\n */\n @Prop() ariaOwnsId: string | boolean;\n\n /**\n * If `true`, the button will be in disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If `true`, the ic-tooltip which is shown for icon variant will be disabled. Title or aria-label must be set if this prop is not applied.\n */\n @Prop() disableTooltip?: boolean = false;\n\n /**\n * If `true`, the user can save the linked URL instead of navigating to it.\n */\n @Prop() download?: string | boolean = false;\n\n /**\n * The <form> element to associate the button with.\n */\n @Prop() form?: string;\n\n /**\n * The URL that processes the information submitted by the button. It overrides the action attribute of the button's form owner. Does nothing if there is no form owner.\n */\n @Prop() formaction?: string;\n\n /**\n * The way the submitted form data is encoded.\n */\n @Prop() formenctype?: string;\n\n /**\n * The HTTP method used to submit the form.\n */\n @Prop() formmethod?: string;\n\n /**\n * If `true`, the form will not be validated when submitted.\n */\n @Prop() formnovalidate?: boolean;\n\n /**\n * The place to display the response from submitting the form. It overrides the target attribute of the button's form owner.\n */\n @Prop() formtarget?: string;\n\n /**\n * If `true`, the button will fill the width of the container.\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * The URL that the link points to. This will render the button as an \"a\" tag.\n */\n @Prop() href?: string;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string;\n\n /**\n * If `true`, the button will be in loading state.\n */\n @Prop() loading?: boolean = false;\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * The size of the button to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * The position of the tooltip in relation to the button.\n */\n @Prop() tooltipPlacement?: IcButtonTooltipPlacement = \"bottom\";\n\n /**\n * The type of the button.\n */\n @Prop() type?: IcButtonTypes = \"button\";\n\n /**\n * The variant of the button to be displayed.\n */\n @Prop() variant?: IcButtonVariants = \"primary\";\n\n /**\n * Emitted when button has blur\n */\n @Event() icBlur!: EventEmitter<void>;\n\n /**\n * Emitted when button has focus\n */\n @Event() icFocus!: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.mutationObserver !== null && this.mutationObserver !== undefined) {\n this.mutationObserver.disconnect();\n }\n if (\n this.hostMutationObserver !== null &&\n this.hostMutationObserver !== undefined\n ) {\n this.hostMutationObserver.disconnect();\n }\n }\n\n componentWillUpdate(): void {\n this.loadingWidth();\n }\n\n componentWillLoad(): void {\n const allInheritedAttributes = inheritAttributes(this.el, [\n ...IC_INHERITED_ARIA,\n \"title\",\n ]);\n\n const {\n title,\n \"aria-label\": ariaLabel,\n ...restInheritedAttributes\n } = allInheritedAttributes;\n\n this.title = title as string;\n this.ariaLabel = ariaLabel as string;\n this.inheritedAttributes = restInheritedAttributes;\n\n removeDisabledFalse(this.disabled, this.el);\n\n this.el.setAttribute(\"exportparts\", \"button\");\n\n const id = this.el.id;\n this.id = id !== undefined ? id : null;\n this.hasTooltip =\n !this.disableTooltip && (!!this.title || this.variant === \"icon\");\n\n if (!this.hasTooltip) {\n const describedById = this.inheritedAttributes[\n \"aria-describedby\"\n ] as string;\n if (describedById !== undefined) {\n this.describedById = describedById;\n const el = this.el.parentElement.querySelector(\n `#${describedById}`\n ) as HTMLElement;\n if (el !== undefined && el !== null) {\n this.describedByContent = el.innerText;\n this.describedByEl = el;\n }\n }\n }\n }\n\n componentDidLoad(): void {\n this.updateTheme();\n\n if (typeof MutationObserver !== \"undefined\") {\n if (this.describedById) {\n this.mutationObserver = new MutationObserver(this.mutationCallback);\n this.mutationObserver.observe(this.describedByEl, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n }\n\n this.hostMutationObserver = new MutationObserver(\n this.hostMutationCallback\n );\n this.hostMutationObserver.observe(this.el, {\n attributes: true,\n });\n }\n }\n\n componentWillRender(): void {\n this.setViewBox()?.setAttribute(\"viewBox\", \"0 0 24 24\");\n }\n\n @Listen(\"click\", { capture: true })\n handleHostClick(event: Event): void {\n if (this.disabled || this.loading) {\n event.stopImmediatePropagation();\n }\n }\n\n @Listen(\"themeChange\", { target: \"document\" })\n themeChangeHandler(ev: CustomEvent): void {\n const theme: IcTheme = ev.detail;\n this.updateTheme(theme.mode);\n }\n\n /**\n * Sets focus on the native `button`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.buttonEl) {\n this.buttonEl.focus();\n }\n }\n\n private hasIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"icon\"]`);\n return iconEl !== null;\n }\n\n private hasLeftIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n return iconEl !== null;\n }\n\n private hasRightIconSlot(): boolean {\n const iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n return iconEl !== null;\n }\n\n private setViewBox = () => {\n let iconEl;\n if (this.hasLeftIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"left-icon\"]`);\n } else if (this.hasRightIconSlot()) {\n iconEl = this.el.querySelector(`[slot=\"right-icon\"]`);\n } else {\n iconEl = null;\n }\n return iconEl;\n };\n\n private handleHiddenFormButtonClick(form: HTMLFormElement): void {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", this.el.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n }\n\n private handleClick = (): void => {\n if (\n (this.el.type === \"submit\" || this.el.type === \"reset\") &&\n !!this.el.closest(\"FORM\")\n ) {\n this.handleHiddenFormButtonClick(this.el.closest(\"FORM\"));\n }\n };\n\n private onFocus = () => {\n this.icFocus.emit();\n };\n\n private onBlur = () => {\n this.icBlur.emit();\n };\n\n private updateTheme(newTheme: IcThemeForeground = null): void {\n const foregroundColor = getThemeFromContext(this.el, newTheme || null);\n\n if (foregroundColor !== IcThemeForegroundEnum.Default) {\n this.appearance = foregroundColor;\n }\n }\n\n private loadingWidth = () => {\n if (this.loading) {\n this.el.style.setProperty(\n \"--min-width\",\n `${this.el.getBoundingClientRect().width}px`\n );\n }\n };\n\n // triggered when text content of sibling element in light DOM changes\n private mutationCallback = (): void => {\n this.describedByContent = this.describedByEl.innerText;\n };\n\n // triggered when attributes of host element change\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n let forceComponentUpdate = false;\n mutationList.forEach((item) => {\n if (item.attributeName === \"title\") {\n this.title = this.el.getAttribute(item.attributeName);\n }\n if (item.attributeName === \"aria-label\") {\n this.ariaLabel = this.el.getAttribute(item.attributeName);\n }\n if (IC_INHERITED_ARIA.includes(item.attributeName)) {\n this.inheritedAttributes[item.attributeName] = this.el.getAttribute(\n item.attributeName\n );\n forceComponentUpdate = true;\n }\n });\n if (forceComponentUpdate) {\n forceUpdate(this);\n }\n };\n\n render() {\n const TagType = (this.href && \"a\") || \"button\";\n const { title, ariaLabel, inheritedAttributes } = this;\n const buttonAttrs =\n TagType === \"button\"\n ? {\n type: this.type,\n disabled: this.disabled,\n form: this.form,\n formaction: this.formaction,\n formenctype: this.formenctype,\n formmethod: this.formmethod,\n formnovalidate: this.formnovalidate,\n formtarget: this.formtarget,\n }\n : {\n download: this.download !== false ? this.download : null,\n href: this.href,\n rel: this.rel,\n target: this.target,\n referrerpolicy: this.referrerpolicy,\n hreflang: this.hreflang,\n };\n\n let describedBy: string = null;\n let buttonId: string = null;\n if (this.hasTooltip) {\n buttonId =\n this.id !== null\n ? `ic-button-with-tooltip-${this.id}`\n : `ic-button-with-tooltip-${this.buttonIdNum}`;\n describedBy = `ic-tooltip-${buttonId}`;\n } else {\n describedBy = this.describedById;\n }\n\n const ButtonContent = () => {\n return (\n <TagType\n class=\"button\"\n aria-disabled={this.loading || this.disabled ? \"true\" : null}\n aria-label={this.loading ? \"Loading\" : ariaLabel}\n {...buttonAttrs}\n {...inheritedAttributes}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n ref={(el) => (this.buttonEl = el)}\n aria-describedby={describedBy}\n part=\"button\"\n >\n {this.hasIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n {this.hasLeftIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"left-icon\" />\n </div>\n )}\n {this.loading ? (\n <div class=\"loading-container\">\n <ic-loading-indicator\n type=\"linear\"\n appearance={\n this.variant === \"primary\" ||\n this.variant === \"destructive\" ||\n this.appearance === IcThemeForegroundEnum.Dark ||\n this.appearance === IcThemeForegroundEnum.Light\n ? \"light\"\n : \"dark\"\n }\n ></ic-loading-indicator>\n </div>\n ) : (\n <slot />\n )}\n {this.hasRightIconSlot() && !this.loading && (\n <div class=\"icon-container\">\n <slot name=\"right-icon\" />\n </div>\n )}\n </TagType>\n );\n };\n\n return (\n <Host\n class={{\n [\"disabled\"]: this.disabled && !this.loading,\n [`button-variant-${this.variant}`]: true,\n [`button-size-${this.size}`]: true,\n [\"loading\"]: this.loading,\n [\"dark\"]: this.appearance === IcThemeForegroundEnum.Dark,\n [\"light\"]: this.appearance === IcThemeForegroundEnum.Light,\n [\"full-width\"]: this.fullWidth,\n [\"with-badge\"]: isSlotUsed(this.el, \"badge\"),\n }}\n onClick={this.handleClick}\n aria-owns={this.ariaOwnsId}\n aria-controls={this.ariaControlsId}\n >\n {this.hasTooltip && (\n <ic-tooltip\n id={describedBy}\n label={title ? (title as string) : (ariaLabel as string)}\n target={buttonId}\n placement={this.tooltipPlacement}\n >\n <ButtonContent />\n </ic-tooltip>\n )}\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n {!this.hasTooltip && <ButtonContent />}\n {this.describedByContent && (\n <span id={describedBy} class=\"ic-button-describedby\">\n {this.describedByContent}\n </span>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -180,13 +180,41 @@ describe("button component", () => {
180
180
  });
181
181
  expect(page.root).toMatchSnapshot();
182
182
  });
183
- it("should update when method called", async () => {
183
+ it("should update aria-label when attribute changed", async () => {
184
184
  const page = await newSpecPage({
185
185
  components: [Button],
186
186
  html: "<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>",
187
187
  });
188
188
  expect(page.root).toMatchSnapshot();
189
- await page.root.updateAriaLabel("New tooltip text");
189
+ page.root.setAttribute("aria-label", "New tooltip text");
190
+ await page.waitForChanges();
191
+ page.rootInstance.hostMutationCallback([{ attributeName: "aria-label" }]);
192
+ await page.waitForChanges();
193
+ expect(page.root).toMatchSnapshot();
194
+ });
195
+ it("should update aria-expanded when attribute changed", async () => {
196
+ const page = await newSpecPage({
197
+ components: [Button],
198
+ html: "<ic-button variant='icon' aria-expanded='false' id='test-button'>Button</ic-button>",
199
+ });
200
+ expect(page.root).toMatchSnapshot();
201
+ page.root.setAttribute("aria-expanded", "true");
202
+ await page.waitForChanges();
203
+ page.rootInstance.hostMutationCallback([
204
+ { attributeName: "aria-expanded" },
205
+ ]);
206
+ await page.waitForChanges();
207
+ expect(page.root).toMatchSnapshot();
208
+ });
209
+ it("should update tooltip label when title attribute changed", async () => {
210
+ const page = await newSpecPage({
211
+ components: [Button],
212
+ html: "<ic-button variant='icon' title='Tooltip text' id='test-button'>Button</ic-button>",
213
+ });
214
+ expect(page.root).toMatchSnapshot();
215
+ page.root.setAttribute("title", "New tooltip text");
216
+ await page.waitForChanges();
217
+ page.rootInstance.hostMutationCallback([{ attributeName: "title" }]);
190
218
  await page.waitForChanges();
191
219
  expect(page.root).toMatchSnapshot();
192
220
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ic-button.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-button/test/basic/ic-button.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAErD,SAAS,CAAC,GAAG,EAAE;EACb,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,GAAG,EAAE;EACnC,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;IACxB,OAAO,OAAO,CAAC;EACjB,CAAC,CAAC,CAAC;EAEH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE;IACpD,KAAK,EAAE,IAAI;GACZ,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;EAChC,EAAE,CAAC,mCAAmC,EAAE,KAAK,IAAI,EAAE;IACjD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE,+BAA+B;MACrC,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,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C,YAAY,CAAC,gBAAgB,EAAE,CAAC;IAErC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;EACtC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;IACxC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE,8CAA8C;KACrD,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE9C,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACjC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,EAAE,CAAC;EACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Button } from \"../../ic-button\";\nimport { newSpecPage } from \"@stencil/core/testing\";\nimport * as helpers from \"../../../../utils/helpers\";\n\nbeforeAll(() => {\n jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\n});\n\n//mocked as getThemeFromContext is always default when run in test context\nconst mockGetThemeFromContext = () => {\n const func = jest.fn(() => {\n return \"light\";\n });\n\n Object.defineProperty(helpers, \"getThemeFromContext\", {\n value: func,\n });\n};\n\ndescribe(\"button component\", () => {\n it(\"should correctly render with text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Button</ic-button>\",\n supportsShadowDom: true,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should correctly render with custom text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Click Me</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for secondary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='secondary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for tertiary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='tertiary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for destructive variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='destructive'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with left icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='left-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with right icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='right-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - secondary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"secondary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - tertiary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"tertiary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - destructive\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"destructive\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - appearance light\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading appearance=\"light\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"render with correct button type when defined\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button type='reset'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with \"a\" tag when href is passed', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with defined \"a\" tag props', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#' download rel=\"nofollow\" target=\"_blank\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on title\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' title='Tooltip text'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on aria-label\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' aria-label='Tooltip text' tooltip-placement='top'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should disable tooltip when prop set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button' disable-tooltip>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update when method called\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n await page.root.updateAriaLabel(\"New tooltip text\");\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should stop immediate propagation of a click event when disabled\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='test-button' disabled=true onclick='alert('test')'>Button</ic-button>\",\n });\n\n jest.spyOn(window, \"alert\").mockImplementation();\n\n const element = document.getElementById(\"test-button\");\n\n element.click();\n\n await page.waitForChanges();\n\n expect(window.alert).not.toHaveBeenCalled;\n });\n\n it(\"should call 'setFocus' when button is focussed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='ic-button'>Button</ic-button>\",\n });\n\n //Can't expect anything in this test - this is to increase code coverage only\n await page.rootInstance.setFocus().toHaveBeenCalled;\n });\n\n it(\"should test theme change\", async () => {\n mockGetThemeFromContext();\n\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n await page.rootInstance.themeChangeHandler({\n detail: { mode: \"light\" },\n });\n await page.waitForChanges();\n\n expect(page.rootInstance.appearance).toEqual(\"light\");\n });\n\n it(\"should test button as submit button on form\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<form id=\"new-form\"><form><ic-button id='ic-button' type=\"submit\" form=\"new-form\">Button</ic-button>`,\n });\n\n const btn = document.getElementById(\"ic-button\");\n btn.click();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is updated\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n (document.querySelector(\"#button-description\") as HTMLElement).innerText =\n \"This is the new description\";\n page.rootInstance.mutationCallback();\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test blur handler\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n const eventSpy = jest.fn();\n page.win.addEventListener(\"icBlur\", eventSpy);\n\n await page.rootInstance.onBlur();\n await page.waitForChanges();\n expect(eventSpy).toHaveBeenCalled();\n });\n});\n"]}
1
+ {"version":3,"file":"ic-button.spec.js","sourceRoot":"","sources":["../../../../../src/components/ic-button/test/basic/ic-button.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC;AAErD,SAAS,CAAC,GAAG,EAAE;EACb,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,GAAG,EAAE;EACnC,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;IACxB,OAAO,OAAO,CAAC;EACjB,CAAC,CAAC,CAAC;EAEH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,qBAAqB,EAAE;IACpD,KAAK,EAAE,IAAI;G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MAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE;;;;OAIL;KACF,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;EACtC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;IACvD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE;;;;OAIL;KACF,CAAC,CAAC;IAEF,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAiB,CAAC,SAAS;MACtE,6BAA6B,CAAC;IAChC,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;IAErC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAE5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;EACtC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;IACxC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;MACpB,IAAI,EAAE,8CAA8C;KACrD,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3B,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE9C,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACjC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,EAAE,CAAC;EACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { Button } from \"../../ic-button\";\nimport { newSpecPage } from \"@stencil/core/testing\";\nimport * as helpers from \"../../../../utils/helpers\";\n\nbeforeAll(() => {\n jest.spyOn(console, \"warn\").mockImplementation(jest.fn());\n});\n\n//mocked as getThemeFromContext is always default when run in test context\nconst mockGetThemeFromContext = () => {\n const func = jest.fn(() => {\n return \"light\";\n });\n\n Object.defineProperty(helpers, \"getThemeFromContext\", {\n value: func,\n });\n};\n\ndescribe(\"button component\", () => {\n it(\"should correctly render with text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Button</ic-button>\",\n supportsShadowDom: true,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should correctly render with custom text\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button>Click Me</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for secondary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='secondary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for tertiary variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='tertiary'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML for destructive variant\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='destructive'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with left icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='left-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML with right icon\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button>\n <svg slot='right-icon' xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 0 24 24\" width=\"24px\" fill=\"#000000\">\n <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n <path d=\"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z\"/>\n </svg>\n Button\n </ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - secondary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"secondary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - tertiary\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"tertiary\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - destructive\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading variant=\"destructive\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render correct HTML when loading - appearance light\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button loading appearance=\"light\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"render with correct button type when defined\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button type='reset'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with \"a\" tag when href is passed', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#'>Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it('should render with defined \"a\" tag props', async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `\n <ic-button href = '#' download rel=\"nofollow\" target=\"_blank\">Button</ic-button>\n `,\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on title\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' title='Tooltip text'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should render icon variant with a tooltip based on aria-label\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' id='test-button' aria-label='Tooltip text' tooltip-placement='top'>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should disable tooltip when prop set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button' disable-tooltip>Button</ic-button>\",\n });\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update aria-label when attribute changed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-label='Tooltip text' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n page.root.setAttribute(\"aria-label\", \"New tooltip text\");\n await page.waitForChanges();\n\n page.rootInstance.hostMutationCallback([{ attributeName: \"aria-label\" }]);\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update aria-expanded when attribute changed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' aria-expanded='false' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n page.root.setAttribute(\"aria-expanded\", \"true\");\n await page.waitForChanges();\n\n page.rootInstance.hostMutationCallback([\n { attributeName: \"aria-expanded\" },\n ]);\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should update tooltip label when title attribute changed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button variant='icon' title='Tooltip text' id='test-button'>Button</ic-button>\",\n });\n\n expect(page.root).toMatchSnapshot();\n\n page.root.setAttribute(\"title\", \"New tooltip text\");\n await page.waitForChanges();\n\n page.rootInstance.hostMutationCallback([{ attributeName: \"title\" }]);\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should stop immediate propagation of a click event when disabled\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='test-button' disabled=true onclick='alert('test')'>Button</ic-button>\",\n });\n\n jest.spyOn(window, \"alert\").mockImplementation();\n\n const element = document.getElementById(\"test-button\");\n\n element.click();\n\n await page.waitForChanges();\n\n expect(window.alert).not.toHaveBeenCalled;\n });\n\n it(\"should call 'setFocus' when button is focussed\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: \"<ic-button id='ic-button'>Button</ic-button>\",\n });\n\n //Can't expect anything in this test - this is to increase code coverage only\n await page.rootInstance.setFocus().toHaveBeenCalled;\n });\n\n it(\"should test theme change\", async () => {\n mockGetThemeFromContext();\n\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n await page.rootInstance.themeChangeHandler({\n detail: { mode: \"light\" },\n });\n await page.waitForChanges();\n\n expect(page.rootInstance.appearance).toEqual(\"light\");\n });\n\n it(\"should test button as submit button on form\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<form id=\"new-form\"><form><ic-button id='ic-button' type=\"submit\" form=\"new-form\">Button</ic-button>`,\n });\n\n const btn = document.getElementById(\"ic-button\");\n btn.click();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is set\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test aria-describedby is updated\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<span id=\"button-description\">\n This is the button description\n </span>\n <ic-button id='ic-button' aria-describedby=\"button-description\">Button</ic-button>\n `,\n });\n\n (document.querySelector(\"#button-description\") as HTMLElement).innerText =\n \"This is the new description\";\n page.rootInstance.mutationCallback();\n\n await page.waitForChanges();\n\n expect(page.root).toMatchSnapshot();\n });\n\n it(\"should test blur handler\", async () => {\n const page = await newSpecPage({\n components: [Button],\n html: `<ic-button id='ic-button'>Button</ic-button>`,\n });\n\n const eventSpy = jest.fn();\n page.win.addEventListener(\"icBlur\", eventSpy);\n\n await page.rootInstance.onBlur();\n await page.waitForChanges();\n expect(eventSpy).toHaveBeenCalled();\n });\n});\n"]}
@@ -467,6 +467,8 @@ button {
467
467
  text-align: left;
468
468
  color: var(--ic-architechtural-black);
469
469
  transition: var(--ic-easing-transition-fast);
470
+ width: inherit;
471
+ position: relative;
470
472
  }
471
473
 
472
474
  .dark.card,
@@ -618,3 +620,24 @@ button {
618
620
  .expanded-content {
619
621
  margin-top: var(--ic-space-md);
620
622
  }
623
+
624
+ /** High Contrast **/
625
+ @media (forced-colors: active) {
626
+ .card ::slotted(svg) {
627
+ fill: currentcolor;
628
+ }
629
+
630
+ .card.disabled ::slotted(svg) {
631
+ fill: GrayText !important;
632
+ }
633
+
634
+ .card.disabled {
635
+ border-color: GrayText !important;
636
+ }
637
+
638
+ .card.disabled .card-message,
639
+ .card.disabled .subheading,
640
+ .card.disabled .card-title {
641
+ color: GrayText;
642
+ }
643
+ }
@@ -13,6 +13,7 @@ import chevronIcon from "../../assets/chevron-icon.svg";
13
13
  * @slot interaction-button - Content will be placed in the top right corner of the heading section.
14
14
  * @slot interaction-controls - Content will be placed below the card message.
15
15
  * @slot expanded-content - Content will be placed below the interaction controls but will not initially be rendered.
16
+ * @slot badge - Badge component overlaying the top right of the card.
16
17
  */
17
18
  export class Card {
18
19
  constructor() {
@@ -119,7 +120,7 @@ export class Card {
119
120
  ["toggle-button"]: true,
120
121
  ["toggle-button-closed"]: !this.areaExpanded,
121
122
  ["toggle-button-expanded"]: this.areaExpanded,
122
- }, variant: "icon", size: "large", disableTooltip: true, "aria-label": "Toggle expandable area", "aria-expanded": this.areaExpanded, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded, innerHTML: chevronIcon })))), isSlotUsed(this.el, "expanded-content") && this.areaExpanded && (h("div", { class: "expanded-content", id: "expanded-content-area" }, h("slot", { name: "expanded-content" })))));
123
+ }, variant: "icon", size: "large", "aria-label": "Toggle expandable area", "aria-expanded": this.areaExpanded, "aria-controls": "expanded-content-area", onClick: this.toggleExpanded, innerHTML: chevronIcon })))), isSlotUsed(this.el, "expanded-content") && this.areaExpanded && (h("div", { class: "expanded-content", id: "expanded-content-area" }, h("slot", { name: "expanded-content" }))), isSlotUsed(this.el, "badge") && h("slot", { name: "badge" })));
123
124
  }
124
125
  static get is() { return "ic-card"; }
125
126
  static get encapsulation() { return "shadow"; }