@ukic/web-components 2.5.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (715) hide show
  1. package/dist/cjs/core.cjs.js +2 -2
  2. package/dist/cjs/{helpers-d166f875.js → helpers-0d63359f.js} +40 -102
  3. package/dist/cjs/helpers-0d63359f.js.map +1 -0
  4. package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-accordion.cjs.entry.js +6 -4
  7. package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-alert.cjs.entry.js +2 -2
  9. package/dist/cjs/ic-back-to-top.cjs.entry.js +2 -2
  10. package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-badge.cjs.entry.js +10 -6
  12. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  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 +13 -6
  22. package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ic-checkbox.cjs.entry.js +20 -23
  24. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-chip.cjs.entry.js +11 -6
  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 +49 -12
  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 +5 -4
  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 +2 -2
  57. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-navigation-item.cjs.entry.js +4 -4
  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 +9 -8
  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 +40 -30
  76. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  77. package/dist/cjs/ic-side-navigation.cjs.entry.js +23 -21
  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 +2 -2
  86. package/dist/cjs/ic-switch.cjs.entry.js +13 -6
  87. package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
  88. package/dist/cjs/ic-tab-context.cjs.entry.js +4 -4
  89. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  90. package/dist/cjs/ic-tab-group.cjs.entry.js +3 -4
  91. package/dist/cjs/ic-tab-group.cjs.entry.js.map +1 -1
  92. package/dist/cjs/ic-tab-panel.cjs.entry.js +5 -4
  93. package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
  94. package/dist/cjs/ic-tab.cjs.entry.js +8 -8
  95. package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
  96. package/dist/cjs/ic-text-field.cjs.entry.js +5 -6
  97. package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
  98. package/dist/cjs/ic-theme.cjs.entry.js +2 -2
  99. package/dist/cjs/ic-toast-region.cjs.entry.js +21 -9
  100. package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
  101. package/dist/cjs/ic-toast.cjs.entry.js +7 -6
  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 +12 -4
  106. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  107. package/dist/cjs/{index-afe53465.js → index-4f8c900f.js} +14 -1
  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 +3 -3
  112. package/dist/collection/components/ic-accordion/ic-accordion.js +4 -2
  113. package/dist/collection/components/ic-accordion/ic-accordion.js.map +1 -1
  114. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js +0 -1
  115. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js.map +1 -1
  116. package/dist/collection/components/ic-badge/ic-badge.js +41 -15
  117. package/dist/collection/components/ic-badge/ic-badge.js.map +1 -1
  118. package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js +92 -0
  119. package/dist/collection/components/ic-badge/test/basic/ic-badge.spec.js.map +1 -1
  120. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js +4 -4
  121. package/dist/collection/components/ic-breadcrumb/ic-breadcrumb.js.map +1 -1
  122. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +4 -2
  123. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
  124. package/dist/collection/components/ic-button/ic-button.css +36 -19
  125. package/dist/collection/components/ic-button/ic-button.js +98 -62
  126. package/dist/collection/components/ic-button/ic-button.js.map +1 -1
  127. package/dist/collection/components/ic-button/test/basic/ic-button.spec.js +30 -2
  128. package/dist/collection/components/ic-button/test/basic/ic-button.spec.js.map +1 -1
  129. package/dist/collection/components/ic-card/ic-card.css +1 -0
  130. package/dist/collection/components/ic-card/ic-card.js +2 -1
  131. package/dist/collection/components/ic-card/ic-card.js.map +1 -1
  132. package/dist/collection/components/ic-checkbox/ic-checkbox.js +124 -22
  133. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  134. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +17 -4
  135. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
  136. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js +7 -0
  137. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js.map +1 -1
  138. package/dist/collection/components/ic-chip/ic-chip.css +10 -5
  139. package/dist/collection/components/ic-chip/ic-chip.js +38 -7
  140. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
  141. package/dist/collection/components/ic-data-entity/ic-data-entity.js +38 -7
  142. package/dist/collection/components/ic-data-entity/ic-data-entity.js.map +1 -1
  143. package/dist/collection/components/ic-data-entity/test/basic/ic-data-entity.spec.js +3 -3
  144. package/dist/collection/components/ic-data-entity/test/basic/ic-data-entity.spec.js.map +1 -1
  145. package/dist/collection/components/ic-data-row/ic-data-row.js +33 -5
  146. package/dist/collection/components/ic-data-row/ic-data-row.js.map +1 -1
  147. package/dist/collection/components/ic-dialog/ic-dialog.css +2 -1
  148. package/dist/collection/components/ic-dialog/ic-dialog.js +111 -20
  149. package/dist/collection/components/ic-dialog/ic-dialog.js.map +1 -1
  150. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.e2e.js +4 -4
  151. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.e2e.js.map +1 -1
  152. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js +74 -0
  153. package/dist/collection/components/ic-dialog/test/basic/ic-dialog.spec.js.map +1 -1
  154. package/dist/collection/components/ic-empty-state/ic-empty-state.js +8 -4
  155. package/dist/collection/components/ic-empty-state/ic-empty-state.js.map +1 -1
  156. package/dist/collection/components/ic-hero/ic-hero.js +38 -8
  157. package/dist/collection/components/ic-hero/ic-hero.js.map +1 -1
  158. package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js +24 -2
  159. package/dist/collection/components/ic-horizontal-scroll/ic-horizontal-scroll.js.map +1 -1
  160. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js +61 -11
  161. package/dist/collection/components/ic-input-component-container/ic-input-component-container.js.map +1 -1
  162. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js +2 -2
  163. package/dist/collection/components/ic-input-component-container/test/basic/ic-input-component-container.spec.js.map +1 -1
  164. package/dist/collection/components/ic-input-label/ic-input-label.js +26 -4
  165. package/dist/collection/components/ic-input-label/ic-input-label.js.map +1 -1
  166. package/dist/collection/components/ic-link/ic-link.js +1 -4
  167. package/dist/collection/components/ic-link/ic-link.js.map +1 -1
  168. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js +6 -5
  169. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.js.map +1 -1
  170. package/dist/collection/components/ic-menu/ic-menu.js +62 -18
  171. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  172. package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js +19 -2
  173. package/dist/collection/components/ic-menu/test/basic/ic-menu.spec.js.map +1 -1
  174. package/dist/collection/components/ic-menu-group/ic-menu-group.js +2 -1
  175. package/dist/collection/components/ic-menu-group/ic-menu-group.js.map +1 -1
  176. package/dist/collection/components/ic-menu-item/ic-menu-item.js +10 -14
  177. package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
  178. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js +3 -2
  179. package/dist/collection/components/ic-navigation-button/ic-navigation-button.js.map +1 -1
  180. package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +1 -0
  181. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +1 -0
  182. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js +3 -2
  183. package/dist/collection/components/ic-navigation-item/ic-navigation-item.js.map +1 -1
  184. package/dist/collection/components/ic-page-header/ic-page-header.js +35 -4
  185. package/dist/collection/components/ic-page-header/ic-page-header.js.map +1 -1
  186. package/dist/collection/components/ic-pagination/ic-pagination.js +4 -4
  187. package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
  188. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +20 -20
  189. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
  190. package/dist/collection/components/ic-radio-group/ic-radio-group.js +37 -9
  191. package/dist/collection/components/ic-radio-group/ic-radio-group.js.map +1 -1
  192. package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js +7 -0
  193. package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.spec.js.map +1 -1
  194. package/dist/collection/components/ic-radio-option/ic-radio-option.js +125 -14
  195. package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
  196. package/dist/collection/components/ic-search-bar/ic-search-bar.js +54 -22
  197. package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
  198. package/dist/collection/components/ic-select/ic-select.css +1 -0
  199. package/dist/collection/components/ic-select/ic-select.js +169 -30
  200. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  201. package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js +24 -0
  202. package/dist/collection/components/ic-select/test/basic/ic-select.e2e.js.map +1 -1
  203. package/dist/collection/components/ic-select/test/basic/ic-select.spec.js +17 -2
  204. package/dist/collection/components/ic-select/test/basic/ic-select.spec.js.map +1 -1
  205. package/dist/collection/components/ic-side-navigation/ic-side-navigation.css +226 -224
  206. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +39 -19
  207. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  208. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js +1 -1
  209. package/dist/collection/components/ic-side-navigation/test/basic/ic-side-navigation.e2e.js.map +1 -1
  210. package/dist/collection/components/ic-skeleton/ic-skeleton.js +26 -4
  211. package/dist/collection/components/ic-skeleton/ic-skeleton.js.map +1 -1
  212. package/dist/collection/components/ic-status-tag/ic-status-tag.js +71 -10
  213. package/dist/collection/components/ic-status-tag/ic-status-tag.js.map +1 -1
  214. package/dist/collection/components/ic-step/ic-step.js +5 -4
  215. package/dist/collection/components/ic-step/ic-step.js.map +1 -1
  216. package/dist/collection/components/ic-switch/ic-switch.js +43 -6
  217. package/dist/collection/components/ic-switch/ic-switch.js.map +1 -1
  218. package/dist/collection/components/ic-tab/ic-tab.js +6 -6
  219. package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
  220. package/dist/collection/components/ic-tab-context/ic-tab-context.js +3 -3
  221. package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
  222. package/dist/collection/components/ic-tab-context/test/basic/ic-tab-context.e2e.js +35 -0
  223. package/dist/collection/components/ic-tab-context/test/basic/ic-tab-context.e2e.js.map +1 -1
  224. package/dist/collection/components/ic-tab-group/ic-tab-group.js +1 -2
  225. package/dist/collection/components/ic-tab-group/ic-tab-group.js.map +1 -1
  226. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +4 -3
  227. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
  228. package/dist/collection/components/ic-text-field/ic-text-field.js +34 -8
  229. package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
  230. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js +1 -1
  231. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.input.spec.js.map +1 -1
  232. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js +17 -17
  233. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.textarea.spec.js.map +1 -1
  234. package/dist/collection/components/ic-toast/ic-toast.js +10 -6
  235. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  236. package/dist/collection/components/ic-toast-region/ic-toast-region.js +53 -17
  237. package/dist/collection/components/ic-toast-region/ic-toast-region.js.map +1 -1
  238. package/dist/collection/components/ic-toast-region/test/basic/ic-toast-region.spec.js +23 -1
  239. package/dist/collection/components/ic-toast-region/test/basic/ic-toast-region.spec.js.map +1 -1
  240. package/dist/collection/components/ic-tooltip/ic-tooltip.css +7 -1
  241. package/dist/collection/components/ic-tooltip/ic-tooltip.js +25 -29
  242. package/dist/collection/components/ic-tooltip/ic-tooltip.js.map +1 -1
  243. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js +0 -8
  244. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js.map +1 -1
  245. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js +10 -1
  246. package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.spec.js.map +1 -1
  247. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +4 -4
  248. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
  249. package/dist/collection/components/ic-typography/ic-typography.js +10 -2
  250. package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
  251. package/dist/collection/utils/constants.js +2 -0
  252. package/dist/collection/utils/constants.js.map +1 -1
  253. package/dist/collection/utils/helpers.js +36 -101
  254. package/dist/collection/utils/helpers.js.map +1 -1
  255. package/dist/collection/utils/types.js.map +1 -1
  256. package/dist/components/helpers.js +39 -102
  257. package/dist/components/helpers.js.map +1 -1
  258. package/dist/components/ic-accordion-group.js.map +1 -1
  259. package/dist/components/ic-accordion.js +4 -2
  260. package/dist/components/ic-accordion.js.map +1 -1
  261. package/dist/components/ic-back-to-top.js +1 -1
  262. package/dist/components/ic-badge.js +10 -6
  263. package/dist/components/ic-badge.js.map +1 -1
  264. package/dist/components/ic-breadcrumb-group.js +5 -3
  265. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  266. package/dist/components/ic-breadcrumb2.js +4 -4
  267. package/dist/components/ic-breadcrumb2.js.map +1 -1
  268. package/dist/components/ic-button2.js +62 -42
  269. package/dist/components/ic-button2.js.map +1 -1
  270. package/dist/components/ic-card.js +2 -2
  271. package/dist/components/ic-card.js.map +1 -1
  272. package/dist/components/ic-checkbox-group.js +13 -6
  273. package/dist/components/ic-checkbox-group.js.map +1 -1
  274. package/dist/components/ic-checkbox.js +25 -22
  275. package/dist/components/ic-checkbox.js.map +1 -1
  276. package/dist/components/ic-chip.js +10 -4
  277. package/dist/components/ic-chip.js.map +1 -1
  278. package/dist/components/ic-data-entity.js +6 -4
  279. package/dist/components/ic-data-entity.js.map +1 -1
  280. package/dist/components/ic-data-row.js +5 -3
  281. package/dist/components/ic-data-row.js.map +1 -1
  282. package/dist/components/ic-dialog.js +51 -11
  283. package/dist/components/ic-dialog.js.map +1 -1
  284. package/dist/components/ic-divider2.js +1 -1
  285. package/dist/components/ic-empty-state.js +4 -3
  286. package/dist/components/ic-empty-state.js.map +1 -1
  287. package/dist/components/ic-footer-link-group.js +1 -1
  288. package/dist/components/ic-footer-link.js +1 -1
  289. package/dist/components/ic-footer.js +1 -1
  290. package/dist/components/ic-hero.js +9 -5
  291. package/dist/components/ic-hero.js.map +1 -1
  292. package/dist/components/ic-horizontal-scroll2.js +5 -3
  293. package/dist/components/ic-horizontal-scroll2.js.map +1 -1
  294. package/dist/components/ic-input-component-container2.js +11 -7
  295. package/dist/components/ic-input-component-container2.js.map +1 -1
  296. package/dist/components/ic-input-label2.js +5 -3
  297. package/dist/components/ic-input-label2.js.map +1 -1
  298. package/dist/components/ic-input-validation2.js +1 -1
  299. package/dist/components/ic-link2.js +1 -4
  300. package/dist/components/ic-link2.js.map +1 -1
  301. package/dist/components/ic-loading-indicator2.js +6 -5
  302. package/dist/components/ic-loading-indicator2.js.map +1 -1
  303. package/dist/components/ic-menu-group.js +2 -1
  304. package/dist/components/ic-menu-group.js.map +1 -1
  305. package/dist/components/ic-menu-item2.js +10 -14
  306. package/dist/components/ic-menu-item2.js.map +1 -1
  307. package/dist/components/ic-menu2.js +34 -16
  308. package/dist/components/ic-menu2.js.map +1 -1
  309. package/dist/components/ic-navigation-button.js +2 -2
  310. package/dist/components/ic-navigation-button.js.map +1 -1
  311. package/dist/components/ic-navigation-group.js +1 -1
  312. package/dist/components/ic-navigation-group.js.map +1 -1
  313. package/dist/components/ic-navigation-item.js +3 -3
  314. package/dist/components/ic-navigation-item.js.map +1 -1
  315. package/dist/components/ic-navigation-menu2.js +1 -1
  316. package/dist/components/ic-page-header.js +8 -3
  317. package/dist/components/ic-page-header.js.map +1 -1
  318. package/dist/components/ic-pagination.js +4 -4
  319. package/dist/components/ic-pagination.js.map +1 -1
  320. package/dist/components/ic-popover-menu.js +20 -20
  321. package/dist/components/ic-popover-menu.js.map +1 -1
  322. package/dist/components/ic-radio-group.js +9 -7
  323. package/dist/components/ic-radio-group.js.map +1 -1
  324. package/dist/components/ic-radio-option.js +26 -14
  325. package/dist/components/ic-radio-option.js.map +1 -1
  326. package/dist/components/ic-search-bar.js +27 -21
  327. package/dist/components/ic-search-bar.js.map +1 -1
  328. package/dist/components/ic-select.js +46 -29
  329. package/dist/components/ic-select.js.map +1 -1
  330. package/dist/components/ic-side-navigation.js +23 -20
  331. package/dist/components/ic-side-navigation.js.map +1 -1
  332. package/dist/components/ic-skeleton.js +4 -2
  333. package/dist/components/ic-skeleton.js.map +1 -1
  334. package/dist/components/ic-status-tag.js +15 -5
  335. package/dist/components/ic-status-tag.js.map +1 -1
  336. package/dist/components/ic-step.js +5 -4
  337. package/dist/components/ic-step.js.map +1 -1
  338. package/dist/components/ic-stepper.js +1 -1
  339. package/dist/components/ic-switch.js +15 -5
  340. package/dist/components/ic-switch.js.map +1 -1
  341. package/dist/components/ic-tab-context.js +3 -3
  342. package/dist/components/ic-tab-context.js.map +1 -1
  343. package/dist/components/ic-tab-group.js +1 -2
  344. package/dist/components/ic-tab-group.js.map +1 -1
  345. package/dist/components/ic-tab-panel.js +4 -3
  346. package/dist/components/ic-tab-panel.js.map +1 -1
  347. package/dist/components/ic-tab.js +6 -6
  348. package/dist/components/ic-tab.js.map +1 -1
  349. package/dist/components/ic-text-field2.js +6 -6
  350. package/dist/components/ic-text-field2.js.map +1 -1
  351. package/dist/components/ic-theme.js +1 -1
  352. package/dist/components/ic-toast-region.js +24 -9
  353. package/dist/components/ic-toast-region.js.map +1 -1
  354. package/dist/components/ic-toast.js +6 -5
  355. package/dist/components/ic-toast.js.map +1 -1
  356. package/dist/components/ic-tooltip2.js +9 -28
  357. package/dist/components/ic-tooltip2.js.map +1 -1
  358. package/dist/components/ic-top-navigation.js +4 -4
  359. package/dist/components/ic-top-navigation.js.map +1 -1
  360. package/dist/components/ic-typography2.js +10 -2
  361. package/dist/components/ic-typography2.js.map +1 -1
  362. package/dist/components/types.js.map +1 -1
  363. package/dist/core/core.esm.js +1 -1
  364. package/dist/core/core.esm.js.map +1 -1
  365. package/dist/core/{p-1db57a3f.entry.js → p-025f9d2a.entry.js} +2 -2
  366. package/dist/core/p-025f9d2a.entry.js.map +1 -0
  367. package/dist/core/p-03329fd0.entry.js +2 -0
  368. package/dist/core/p-03329fd0.entry.js.map +1 -0
  369. package/dist/core/p-08b59078.entry.js +2 -0
  370. package/dist/core/p-08b59078.entry.js.map +1 -0
  371. package/dist/core/p-0c82048e.entry.js +2 -0
  372. package/dist/core/p-0c82048e.entry.js.map +1 -0
  373. package/dist/core/{p-64999983.entry.js → p-0dc4f225.entry.js} +2 -2
  374. package/dist/core/p-0dc4f225.entry.js.map +1 -0
  375. package/dist/core/p-12124e24.entry.js +2 -0
  376. package/dist/core/p-12124e24.entry.js.map +1 -0
  377. package/dist/core/{p-1ed0a71d.entry.js → p-1cf2a6aa.entry.js} +2 -2
  378. package/dist/core/p-1cf2a6aa.entry.js.map +1 -0
  379. package/dist/core/{p-ca6e5474.entry.js → p-2265e418.entry.js} +2 -2
  380. package/dist/core/p-2265e418.entry.js.map +1 -0
  381. package/dist/core/{p-9ee852d9.entry.js → p-2c30b583.entry.js} +2 -2
  382. package/dist/core/p-345fe84a.entry.js +2 -0
  383. package/dist/core/p-345fe84a.entry.js.map +1 -0
  384. package/dist/core/p-39c8111d.entry.js +2 -0
  385. package/dist/core/p-39c8111d.entry.js.map +1 -0
  386. package/dist/core/p-3a15202f.entry.js +2 -0
  387. package/dist/core/p-3a15202f.entry.js.map +1 -0
  388. package/dist/core/{p-2d21de19.entry.js → p-3a814fc4.entry.js} +2 -2
  389. package/dist/core/p-3a814fc4.entry.js.map +1 -0
  390. package/dist/core/p-3fd897c9.entry.js +2 -0
  391. package/dist/core/p-3fd897c9.entry.js.map +1 -0
  392. package/dist/core/p-41c6eaa1.entry.js +2 -0
  393. package/dist/core/p-41c6eaa1.entry.js.map +1 -0
  394. package/dist/core/p-432f8ff0.entry.js +2 -0
  395. package/dist/core/p-432f8ff0.entry.js.map +1 -0
  396. package/dist/core/p-4559600a.entry.js +2 -0
  397. package/dist/core/p-4559600a.entry.js.map +1 -0
  398. package/dist/core/{p-913da6d0.entry.js → p-475b7bd2.entry.js} +2 -2
  399. package/dist/core/{p-913da6d0.entry.js.map → p-475b7bd2.entry.js.map} +1 -1
  400. package/dist/core/{p-0fdb1e52.entry.js → p-48525498.entry.js} +2 -2
  401. package/dist/core/p-536b3c97.entry.js +2 -0
  402. package/dist/core/p-536b3c97.entry.js.map +1 -0
  403. package/dist/core/p-59bdafff.entry.js +2 -0
  404. package/dist/core/p-59bdafff.entry.js.map +1 -0
  405. package/dist/core/p-5b487daa.entry.js +2 -0
  406. package/dist/core/p-5b487daa.entry.js.map +1 -0
  407. package/dist/core/{p-4f070381.entry.js → p-5bb6c79b.entry.js} +2 -2
  408. package/dist/core/p-5bb6c79b.entry.js.map +1 -0
  409. package/dist/core/p-5ca39ed5.entry.js +2 -0
  410. package/dist/core/p-5ca39ed5.entry.js.map +1 -0
  411. package/dist/core/p-5fcd202e.entry.js +2 -0
  412. package/dist/core/p-5fcd202e.entry.js.map +1 -0
  413. package/dist/core/p-613aa265.js.map +1 -1
  414. package/dist/core/{p-038601a3.entry.js → p-69948c3e.entry.js} +2 -2
  415. package/dist/core/{p-038601a3.entry.js.map → p-69948c3e.entry.js.map} +1 -1
  416. package/dist/core/{p-d9fc7243.entry.js → p-752f0f9a.entry.js} +2 -2
  417. package/dist/core/p-752f0f9a.entry.js.map +1 -0
  418. package/dist/core/p-763d0822.entry.js +2 -0
  419. package/dist/core/p-763d0822.entry.js.map +1 -0
  420. package/dist/core/{p-9bd160bb.entry.js → p-76563540.entry.js} +2 -2
  421. package/dist/core/p-76563540.entry.js.map +1 -0
  422. package/dist/core/{p-cf95dd66.entry.js → p-7bb3c340.entry.js} +2 -2
  423. package/dist/core/p-88ea1e49.entry.js +2 -0
  424. package/dist/core/p-8b18346a.entry.js +2 -0
  425. package/dist/core/p-8b18346a.entry.js.map +1 -0
  426. package/dist/core/p-8fb4f0c0.js +2 -0
  427. package/dist/core/p-8fb4f0c0.js.map +1 -0
  428. package/dist/core/{p-05249867.entry.js → p-932fb4b7.entry.js} +2 -2
  429. package/dist/core/p-9ccfb863.entry.js +2 -0
  430. package/dist/core/p-9ccfb863.entry.js.map +1 -0
  431. package/dist/core/{p-85903a81.js → p-9d124fc7.js} +3 -3
  432. package/dist/core/p-9d124fc7.js.map +1 -0
  433. package/dist/core/{p-e904d985.entry.js → p-a4397df4.entry.js} +2 -2
  434. package/dist/core/{p-4fbe1dc3.entry.js → p-a448d873.entry.js} +2 -2
  435. package/dist/core/p-a448d873.entry.js.map +1 -0
  436. package/dist/core/{p-a388750d.entry.js → p-af9f1caa.entry.js} +2 -2
  437. package/dist/core/p-af9f1caa.entry.js.map +1 -0
  438. package/dist/core/{p-4ef8342f.entry.js → p-b0ce60a0.entry.js} +2 -2
  439. package/dist/core/{p-0e1a4f8d.entry.js → p-b77ab20a.entry.js} +2 -2
  440. package/dist/core/p-b77ab20a.entry.js.map +1 -0
  441. package/dist/core/p-ba495175.entry.js +2 -0
  442. package/dist/core/p-ba495175.entry.js.map +1 -0
  443. package/dist/core/p-c0c62df4.entry.js +2 -0
  444. package/dist/core/p-c0c62df4.entry.js.map +1 -0
  445. package/dist/core/{p-60fef702.entry.js → p-c36cbd8a.entry.js} +2 -2
  446. package/dist/core/p-c36cbd8a.entry.js.map +1 -0
  447. package/dist/core/p-c9ef9f5c.entry.js +2 -0
  448. package/dist/core/p-c9ef9f5c.entry.js.map +1 -0
  449. package/dist/core/{p-e59d2d50.entry.js → p-ccac1730.entry.js} +2 -2
  450. package/dist/core/p-cf4bacee.entry.js +2 -0
  451. package/dist/core/p-cf4bacee.entry.js.map +1 -0
  452. package/dist/core/p-e2903ce9.entry.js +2 -0
  453. package/dist/core/p-e2903ce9.entry.js.map +1 -0
  454. package/dist/core/{p-b42b8ffa.entry.js → p-e2fd542e.entry.js} +2 -2
  455. package/dist/core/p-e2fd542e.entry.js.map +1 -0
  456. package/dist/core/{p-ac82781b.entry.js → p-e3bffcae.entry.js} +2 -2
  457. package/dist/core/p-ea6ad791.entry.js +2 -0
  458. package/dist/core/p-ea6ad791.entry.js.map +1 -0
  459. package/dist/core/{p-1650c1c2.entry.js → p-eb063498.entry.js} +2 -2
  460. package/dist/core/p-eb063498.entry.js.map +1 -0
  461. package/dist/core/p-ec82fa24.entry.js +2 -0
  462. package/dist/core/p-ec82fa24.entry.js.map +1 -0
  463. package/dist/core/{p-c1e8d13e.entry.js → p-ed256f1d.entry.js} +2 -2
  464. package/dist/core/{p-2184a72f.entry.js → p-f00e510b.entry.js} +2 -2
  465. package/dist/core/p-f00e510b.entry.js.map +1 -0
  466. package/dist/core/{p-482397ae.entry.js → p-f019219c.entry.js} +2 -2
  467. package/dist/core/p-f69fb26b.entry.js +2 -0
  468. package/dist/core/p-f69fb26b.entry.js.map +1 -0
  469. package/dist/core/{p-675fe4db.entry.js → p-fbc8a739.entry.js} +2 -2
  470. package/dist/core/p-fbc8a739.entry.js.map +1 -0
  471. package/dist/core/p-fe6e0c0e.entry.js +2 -0
  472. package/dist/core/p-fe6e0c0e.entry.js.map +1 -0
  473. package/dist/esm/core.js +3 -3
  474. package/dist/esm/{helpers-81a88a11.js → helpers-24f6e762.js} +40 -103
  475. package/dist/esm/helpers-24f6e762.js.map +1 -0
  476. package/dist/esm/ic-accordion-group.entry.js +1 -1
  477. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  478. package/dist/esm/ic-accordion.entry.js +6 -4
  479. package/dist/esm/ic-accordion.entry.js.map +1 -1
  480. package/dist/esm/ic-alert.entry.js +2 -2
  481. package/dist/esm/ic-back-to-top.entry.js +2 -2
  482. package/dist/esm/ic-back-to-top.entry.js.map +1 -1
  483. package/dist/esm/ic-badge.entry.js +10 -6
  484. package/dist/esm/ic-badge.entry.js.map +1 -1
  485. package/dist/esm/ic-breadcrumb-group.entry.js +6 -4
  486. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  487. package/dist/esm/ic-breadcrumb.entry.js +5 -5
  488. package/dist/esm/ic-breadcrumb.entry.js.map +1 -1
  489. package/dist/esm/ic-button_3.entry.js +70 -71
  490. package/dist/esm/ic-button_3.entry.js.map +1 -1
  491. package/dist/esm/ic-card.entry.js +4 -4
  492. package/dist/esm/ic-card.entry.js.map +1 -1
  493. package/dist/esm/ic-checkbox-group.entry.js +13 -6
  494. package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
  495. package/dist/esm/ic-checkbox.entry.js +20 -23
  496. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  497. package/dist/esm/ic-chip.entry.js +11 -6
  498. package/dist/esm/ic-chip.entry.js.map +1 -1
  499. package/dist/esm/ic-classification-banner.entry.js +1 -1
  500. package/dist/esm/ic-data-entity.entry.js +6 -5
  501. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  502. package/dist/esm/ic-data-row.entry.js +5 -4
  503. package/dist/esm/ic-data-row.entry.js.map +1 -1
  504. package/dist/esm/ic-dialog.entry.js +49 -12
  505. package/dist/esm/ic-dialog.entry.js.map +1 -1
  506. package/dist/esm/ic-divider.entry.js +2 -2
  507. package/dist/esm/ic-empty-state.entry.js +5 -4
  508. package/dist/esm/ic-empty-state.entry.js.map +1 -1
  509. package/dist/esm/ic-footer-link-group.entry.js +2 -2
  510. package/dist/esm/ic-footer-link.entry.js +2 -2
  511. package/dist/esm/ic-footer.entry.js +2 -2
  512. package/dist/esm/ic-hero.entry.js +9 -6
  513. package/dist/esm/ic-hero.entry.js.map +1 -1
  514. package/dist/esm/ic-horizontal-scroll.entry.js +5 -4
  515. package/dist/esm/ic-horizontal-scroll.entry.js.map +1 -1
  516. package/dist/esm/ic-input-component-container_3.entry.js +42 -23
  517. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  518. package/dist/esm/ic-input-label_2.entry.js +5 -4
  519. package/dist/esm/ic-input-label_2.entry.js.map +1 -1
  520. package/dist/esm/ic-link.entry.js +3 -6
  521. package/dist/esm/ic-link.entry.js.map +1 -1
  522. package/dist/esm/ic-menu-group.entry.js +4 -2
  523. package/dist/esm/ic-menu-group.entry.js.map +1 -1
  524. package/dist/esm/ic-menu-item.entry.js +11 -15
  525. package/dist/esm/ic-menu-item.entry.js.map +1 -1
  526. package/dist/esm/ic-navigation-button.entry.js +3 -3
  527. package/dist/esm/ic-navigation-button.entry.js.map +1 -1
  528. package/dist/esm/ic-navigation-group.entry.js +2 -2
  529. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  530. package/dist/esm/ic-navigation-item.entry.js +4 -4
  531. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  532. package/dist/esm/ic-navigation-menu.entry.js +2 -2
  533. package/dist/esm/ic-page-header.entry.js +8 -4
  534. package/dist/esm/ic-page-header.entry.js.map +1 -1
  535. package/dist/esm/ic-pagination-item.entry.js +2 -2
  536. package/dist/esm/ic-pagination.entry.js +6 -6
  537. package/dist/esm/ic-pagination.entry.js.map +1 -1
  538. package/dist/esm/ic-popover-menu.entry.js +21 -21
  539. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  540. package/dist/esm/ic-radio-group.entry.js +9 -8
  541. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  542. package/dist/esm/ic-radio-option.entry.js +21 -15
  543. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  544. package/dist/esm/ic-search-bar.entry.js +27 -22
  545. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  546. package/dist/esm/ic-section-container.entry.js +1 -1
  547. package/dist/esm/ic-select.entry.js +40 -30
  548. package/dist/esm/ic-select.entry.js.map +1 -1
  549. package/dist/esm/ic-side-navigation.entry.js +23 -21
  550. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  551. package/dist/esm/ic-skeleton.entry.js +4 -3
  552. package/dist/esm/ic-skeleton.entry.js.map +1 -1
  553. package/dist/esm/ic-status-tag.entry.js +14 -6
  554. package/dist/esm/ic-status-tag.entry.js.map +1 -1
  555. package/dist/esm/ic-step.entry.js +7 -5
  556. package/dist/esm/ic-step.entry.js.map +1 -1
  557. package/dist/esm/ic-stepper.entry.js +2 -2
  558. package/dist/esm/ic-switch.entry.js +13 -6
  559. package/dist/esm/ic-switch.entry.js.map +1 -1
  560. package/dist/esm/ic-tab-context.entry.js +4 -4
  561. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  562. package/dist/esm/ic-tab-group.entry.js +3 -4
  563. package/dist/esm/ic-tab-group.entry.js.map +1 -1
  564. package/dist/esm/ic-tab-panel.entry.js +5 -4
  565. package/dist/esm/ic-tab-panel.entry.js.map +1 -1
  566. package/dist/esm/ic-tab.entry.js +8 -8
  567. package/dist/esm/ic-tab.entry.js.map +1 -1
  568. package/dist/esm/ic-text-field.entry.js +5 -6
  569. package/dist/esm/ic-text-field.entry.js.map +1 -1
  570. package/dist/esm/ic-theme.entry.js +2 -2
  571. package/dist/esm/ic-toast-region.entry.js +21 -9
  572. package/dist/esm/ic-toast-region.entry.js.map +1 -1
  573. package/dist/esm/ic-toast.entry.js +7 -6
  574. package/dist/esm/ic-toast.entry.js.map +1 -1
  575. package/dist/esm/ic-top-navigation.entry.js +5 -5
  576. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  577. package/dist/esm/ic-typography.entry.js +12 -4
  578. package/dist/esm/ic-typography.entry.js.map +1 -1
  579. package/dist/esm/{index-b006ae9d.js → index-813020f1.js} +14 -2
  580. package/dist/esm/index-813020f1.js.map +1 -0
  581. package/dist/esm/loader.js +3 -3
  582. package/dist/esm/types-b2398b37.js.map +1 -1
  583. package/dist/types/components/ic-accordion/ic-accordion.d.ts +1 -0
  584. package/dist/types/components/ic-badge/ic-badge.d.ts +10 -3
  585. package/dist/types/components/ic-button/ic-button.d.ts +12 -5
  586. package/dist/types/components/ic-card/ic-card.d.ts +1 -0
  587. package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +28 -2
  588. package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +2 -1
  589. package/dist/types/components/ic-chip/ic-chip.d.ts +6 -2
  590. package/dist/types/components/ic-data-entity/ic-data-entity.d.ts +10 -2
  591. package/dist/types/components/ic-data-row/ic-data-row.d.ts +7 -2
  592. package/dist/types/components/ic-dialog/ic-dialog.d.ts +15 -5
  593. package/dist/types/components/ic-empty-state/ic-empty-state.d.ts +4 -1
  594. package/dist/types/components/ic-hero/ic-hero.d.ts +7 -3
  595. package/dist/types/components/ic-horizontal-scroll/ic-horizontal-scroll.d.ts +4 -0
  596. package/dist/types/components/ic-input-component-container/ic-input-component-container.d.ts +13 -5
  597. package/dist/types/components/ic-input-label/ic-input-label.d.ts +5 -1
  598. package/dist/types/components/ic-loading-indicator/ic-loading-indicator.d.ts +1 -1
  599. package/dist/types/components/ic-menu/ic-menu.d.ts +8 -3
  600. package/dist/types/components/ic-navigation-button/ic-navigation-button.d.ts +1 -0
  601. package/dist/types/components/ic-navigation-item/ic-navigation-item.d.ts +1 -0
  602. package/dist/types/components/ic-page-header/ic-page-header.d.ts +6 -2
  603. package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +1 -1
  604. package/dist/types/components/ic-radio-group/ic-radio-group.d.ts +8 -4
  605. package/dist/types/components/ic-radio-option/ic-radio-option.d.ts +28 -1
  606. package/dist/types/components/ic-search-bar/ic-search-bar.d.ts +6 -2
  607. package/dist/types/components/ic-select/ic-select.d.ts +34 -4
  608. package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +5 -0
  609. package/dist/types/components/ic-skeleton/ic-skeleton.d.ts +5 -1
  610. package/dist/types/components/ic-status-tag/ic-status-tag.d.ts +12 -2
  611. package/dist/types/components/ic-switch/ic-switch.d.ts +7 -1
  612. package/dist/types/components/ic-tab/ic-tab.d.ts +1 -1
  613. package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +1 -1
  614. package/dist/types/components/ic-tab-group/ic-tab-group.d.ts +0 -1
  615. package/dist/types/components/ic-tab-panel/ic-tab-panel.d.ts +1 -1
  616. package/dist/types/components/ic-text-field/ic-text-field.d.ts +7 -3
  617. package/dist/types/components/ic-toast/ic-toast.d.ts +1 -1
  618. package/dist/types/components/ic-toast-region/ic-toast-region.d.ts +7 -2
  619. package/dist/types/components/ic-tooltip/ic-tooltip.d.ts +5 -3
  620. package/dist/types/components.d.ts +388 -60
  621. package/dist/types/utils/helpers.d.ts +2 -1
  622. package/dist/types/utils/types.d.ts +2 -0
  623. package/hydrate/index.js +581 -450
  624. package/package.json +5 -5
  625. package/dist/cjs/helpers-d166f875.js.map +0 -1
  626. package/dist/cjs/index-afe53465.js.map +0 -1
  627. package/dist/core/p-0353a1d8.entry.js +0 -2
  628. package/dist/core/p-0353a1d8.entry.js.map +0 -1
  629. package/dist/core/p-08c6119a.entry.js +0 -2
  630. package/dist/core/p-08c6119a.entry.js.map +0 -1
  631. package/dist/core/p-09004694.entry.js +0 -2
  632. package/dist/core/p-09004694.entry.js.map +0 -1
  633. package/dist/core/p-0d71a937.entry.js +0 -2
  634. package/dist/core/p-0d71a937.entry.js.map +0 -1
  635. package/dist/core/p-0e1a4f8d.entry.js.map +0 -1
  636. package/dist/core/p-10bfc292.entry.js +0 -2
  637. package/dist/core/p-10bfc292.entry.js.map +0 -1
  638. package/dist/core/p-1650c1c2.entry.js.map +0 -1
  639. package/dist/core/p-1db57a3f.entry.js.map +0 -1
  640. package/dist/core/p-1ed0a71d.entry.js.map +0 -1
  641. package/dist/core/p-2184a72f.entry.js.map +0 -1
  642. package/dist/core/p-293f4c5f.entry.js +0 -2
  643. package/dist/core/p-293f4c5f.entry.js.map +0 -1
  644. package/dist/core/p-2afa6d29.entry.js +0 -2
  645. package/dist/core/p-2afa6d29.entry.js.map +0 -1
  646. package/dist/core/p-2c09f9e0.entry.js +0 -2
  647. package/dist/core/p-2c09f9e0.entry.js.map +0 -1
  648. package/dist/core/p-2d21de19.entry.js.map +0 -1
  649. package/dist/core/p-32510505.entry.js +0 -2
  650. package/dist/core/p-32510505.entry.js.map +0 -1
  651. package/dist/core/p-4f070381.entry.js.map +0 -1
  652. package/dist/core/p-4fbe1dc3.entry.js.map +0 -1
  653. package/dist/core/p-5401863e.entry.js +0 -2
  654. package/dist/core/p-5401863e.entry.js.map +0 -1
  655. package/dist/core/p-59b24198.entry.js +0 -2
  656. package/dist/core/p-59b24198.entry.js.map +0 -1
  657. package/dist/core/p-5cc070c4.entry.js +0 -2
  658. package/dist/core/p-5cc070c4.entry.js.map +0 -1
  659. package/dist/core/p-5f881644.entry.js +0 -2
  660. package/dist/core/p-5f881644.entry.js.map +0 -1
  661. package/dist/core/p-60fef702.entry.js.map +0 -1
  662. package/dist/core/p-64999983.entry.js.map +0 -1
  663. package/dist/core/p-675fe4db.entry.js.map +0 -1
  664. package/dist/core/p-6aec6bce.entry.js +0 -2
  665. package/dist/core/p-6aec6bce.entry.js.map +0 -1
  666. package/dist/core/p-6ec3cd12.entry.js +0 -2
  667. package/dist/core/p-6ec3cd12.entry.js.map +0 -1
  668. package/dist/core/p-76daa5b0.entry.js +0 -2
  669. package/dist/core/p-777e5556.entry.js +0 -2
  670. package/dist/core/p-777e5556.entry.js.map +0 -1
  671. package/dist/core/p-7a61d94a.entry.js +0 -2
  672. package/dist/core/p-7a61d94a.entry.js.map +0 -1
  673. package/dist/core/p-85903a81.js.map +0 -1
  674. package/dist/core/p-932fe2a0.entry.js +0 -2
  675. package/dist/core/p-932fe2a0.entry.js.map +0 -1
  676. package/dist/core/p-9bd160bb.entry.js.map +0 -1
  677. package/dist/core/p-a388750d.entry.js.map +0 -1
  678. package/dist/core/p-a46c1690.entry.js +0 -2
  679. package/dist/core/p-a46c1690.entry.js.map +0 -1
  680. package/dist/core/p-abf60097.entry.js +0 -2
  681. package/dist/core/p-abf60097.entry.js.map +0 -1
  682. package/dist/core/p-ad520f36.entry.js +0 -2
  683. package/dist/core/p-ad520f36.entry.js.map +0 -1
  684. package/dist/core/p-b42b8ffa.entry.js.map +0 -1
  685. package/dist/core/p-b96bd8be.entry.js +0 -2
  686. package/dist/core/p-b96bd8be.entry.js.map +0 -1
  687. package/dist/core/p-c30d9b20.js +0 -2
  688. package/dist/core/p-c30d9b20.js.map +0 -1
  689. package/dist/core/p-ca6e5474.entry.js.map +0 -1
  690. package/dist/core/p-ceed0fee.entry.js +0 -2
  691. package/dist/core/p-ceed0fee.entry.js.map +0 -1
  692. package/dist/core/p-d005a71a.entry.js +0 -2
  693. package/dist/core/p-d005a71a.entry.js.map +0 -1
  694. package/dist/core/p-d5282ede.entry.js +0 -2
  695. package/dist/core/p-d5282ede.entry.js.map +0 -1
  696. package/dist/core/p-d9fc7243.entry.js.map +0 -1
  697. package/dist/core/p-db4a15bd.entry.js +0 -2
  698. package/dist/core/p-db4a15bd.entry.js.map +0 -1
  699. package/dist/core/p-e75b04af.entry.js +0 -2
  700. package/dist/core/p-e75b04af.entry.js.map +0 -1
  701. package/dist/core/p-ea55f25c.entry.js +0 -2
  702. package/dist/core/p-ea55f25c.entry.js.map +0 -1
  703. package/dist/esm/helpers-81a88a11.js.map +0 -1
  704. package/dist/esm/index-b006ae9d.js.map +0 -1
  705. /package/dist/core/{p-9ee852d9.entry.js.map → p-2c30b583.entry.js.map} +0 -0
  706. /package/dist/core/{p-0fdb1e52.entry.js.map → p-48525498.entry.js.map} +0 -0
  707. /package/dist/core/{p-cf95dd66.entry.js.map → p-7bb3c340.entry.js.map} +0 -0
  708. /package/dist/core/{p-76daa5b0.entry.js.map → p-88ea1e49.entry.js.map} +0 -0
  709. /package/dist/core/{p-05249867.entry.js.map → p-932fb4b7.entry.js.map} +0 -0
  710. /package/dist/core/{p-e904d985.entry.js.map → p-a4397df4.entry.js.map} +0 -0
  711. /package/dist/core/{p-4ef8342f.entry.js.map → p-b0ce60a0.entry.js.map} +0 -0
  712. /package/dist/core/{p-e59d2d50.entry.js.map → p-ccac1730.entry.js.map} +0 -0
  713. /package/dist/core/{p-ac82781b.entry.js.map → p-e3bffcae.entry.js.map} +0 -0
  714. /package/dist/core/{p-c1e8d13e.entry.js.map → p-ed256f1d.entry.js.map} +0 -0
  715. /package/dist/core/{p-482397ae.entry.js.map → p-f019219c.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";
@@ -29,6 +29,7 @@ export class Button {
29
29
  this.describedByEl = null;
30
30
  this.describedById = null;
31
31
  this.mutationObserver = null;
32
+ this.hostMutationObserver = null;
32
33
  this.setViewBox = () => {
33
34
  let iconEl;
34
35
  if (this.hasLeftIconSlot()) {
@@ -63,8 +64,31 @@ export class Button {
63
64
  this.mutationCallback = () => {
64
65
  this.describedByContent = this.describedByEl.innerText;
65
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;
66
87
  this.describedByContent = null;
88
+ this.title = null;
67
89
  this.appearance = "default";
90
+ this.ariaControlsId = undefined;
91
+ this.ariaOwnsId = undefined;
68
92
  this.disabled = false;
69
93
  this.disableTooltip = false;
70
94
  this.download = false;
@@ -90,39 +114,55 @@ export class Button {
90
114
  if (this.mutationObserver !== null && this.mutationObserver !== undefined) {
91
115
  this.mutationObserver.disconnect();
92
116
  }
117
+ if (this.hostMutationObserver !== null &&
118
+ this.hostMutationObserver !== undefined) {
119
+ this.hostMutationObserver.disconnect();
120
+ }
93
121
  }
94
122
  componentWillUpdate() {
95
123
  this.loadingWidth();
96
124
  }
97
125
  componentWillLoad() {
98
- this.inheritedAttributes = inheritAttributes(this.el, [
126
+ const allInheritedAttributes = inheritAttributes(this.el, [
99
127
  ...IC_INHERITED_ARIA,
100
- "aria-expanded",
101
128
  "title",
102
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;
103
134
  removeDisabledFalse(this.disabled, this.el);
104
135
  this.el.setAttribute("exportparts", "button");
105
136
  const id = this.el.id;
106
137
  this.id = id !== undefined ? id : null;
107
- this.hasTooltip = this.variant === "icon" && this.disableTooltip === false;
138
+ this.hasTooltip =
139
+ !this.disableTooltip && (!!this.title || this.variant === "icon");
108
140
  if (!this.hasTooltip) {
109
141
  const describedById = this.inheritedAttributes["aria-describedby"];
110
142
  if (describedById !== undefined) {
111
143
  this.describedById = describedById;
112
144
  const el = this.el.parentElement.querySelector(`#${describedById}`);
113
- this.describedByContent = el.innerText;
114
- this.describedByEl = el;
145
+ if (el !== undefined && el !== null) {
146
+ this.describedByContent = el.innerText;
147
+ this.describedByEl = el;
148
+ }
115
149
  }
116
150
  }
117
151
  }
118
152
  componentDidLoad() {
119
153
  this.updateTheme();
120
- if (this.describedById) {
121
- this.mutationObserver = new MutationObserver(this.mutationCallback);
122
- this.mutationObserver.observe(this.describedByEl, {
123
- characterData: true,
124
- childList: true,
125
- 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,
126
166
  });
127
167
  }
128
168
  }
@@ -147,18 +187,6 @@ export class Button {
147
187
  this.buttonEl.focus();
148
188
  }
149
189
  }
150
- /**
151
- * @internal Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change.
152
- */
153
- async updateAriaLabel(newValue) {
154
- if (this.hasTooltip) {
155
- this.tooltipEl.label = newValue;
156
- this.buttonEl.setAttribute("aria-label", null);
157
- }
158
- else {
159
- this.buttonEl.setAttribute("aria-label", newValue);
160
- }
161
- }
162
190
  hasIconSlot() {
163
191
  const iconEl = this.el.querySelector(`[slot="icon"]`);
164
192
  return iconEl !== null;
@@ -187,7 +215,7 @@ export class Button {
187
215
  }
188
216
  render() {
189
217
  const TagType = (this.href && "a") || "button";
190
- const _a = this.inheritedAttributes, { title, "aria-label": ariaLabel } = _a, restInheritedAttributes = __rest(_a, ["title", "aria-label"]);
218
+ const { title, ariaLabel, inheritedAttributes } = this;
191
219
  const buttonAttrs = TagType === "button"
192
220
  ? {
193
221
  type: this.type,
@@ -207,17 +235,6 @@ export class Button {
207
235
  referrerpolicy: this.referrerpolicy,
208
236
  hreflang: this.hreflang,
209
237
  };
210
- const newTitle = title && title;
211
- const titleAttr = this.hasTooltip ? {} : { title: newTitle };
212
- let tooltipText = "";
213
- if (this.hasTooltip) {
214
- if (newTitle !== undefined) {
215
- tooltipText = newTitle;
216
- }
217
- else if (ariaLabel !== null) {
218
- tooltipText = ariaLabel;
219
- }
220
- }
221
238
  let describedBy = null;
222
239
  let buttonId = null;
223
240
  if (this.hasTooltip) {
@@ -231,7 +248,7 @@ export class Button {
231
248
  describedBy = this.describedById;
232
249
  }
233
250
  const ButtonContent = () => {
234
- 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" ||
235
252
  this.variant === "destructive" ||
236
253
  this.appearance === IcThemeForegroundEnum.Dark ||
237
254
  this.appearance === IcThemeForegroundEnum.Light
@@ -247,7 +264,7 @@ export class Button {
247
264
  ["light"]: this.appearance === IcThemeForegroundEnum.Light,
248
265
  ["full-width"]: this.fullWidth,
249
266
  ["with-badge"]: isSlotUsed(this.el, "badge"),
250
- }, 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))), 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))));
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))));
251
268
  }
252
269
  static get is() { return "ic-button"; }
253
270
  static get encapsulation() { return "shadow"; }
@@ -288,6 +305,46 @@ export class Button {
288
305
  "reflect": false,
289
306
  "defaultValue": "\"default\""
290
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
+ },
291
348
  "disabled": {
292
349
  "type": "boolean",
293
350
  "mutable": false,
@@ -670,7 +727,9 @@ export class Button {
670
727
  }
671
728
  static get states() {
672
729
  return {
673
- "describedByContent": {}
730
+ "ariaLabel": {},
731
+ "describedByContent": {},
732
+ "title": {}
674
733
  };
675
734
  }
676
735
  static get events() {
@@ -724,29 +783,6 @@ export class Button {
724
783
  "text": "Sets focus on the native `button`.",
725
784
  "tags": []
726
785
  }
727
- },
728
- "updateAriaLabel": {
729
- "complexType": {
730
- "signature": "(newValue: string) => Promise<void>",
731
- "parameters": [{
732
- "tags": [],
733
- "text": ""
734
- }],
735
- "references": {
736
- "Promise": {
737
- "location": "global",
738
- "id": "global::Promise"
739
- }
740
- },
741
- "return": "Promise<void>"
742
- },
743
- "docs": {
744
- "text": "",
745
- "tags": [{
746
- "name": "internal",
747
- "text": "Updates tooltip/aria-label text - needed as can't watch an ARIA attribute change."
748
- }]
749
- }
750
786
  }
751
787
  };
752
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,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;IAEnD,kBAAa,GAAgB,IAAI,CAAC;IAClC,kBAAa,GAAW,IAAI,CAAC;IAC7B,qBAAgB,GAAqB,IAAI,CAAC;IAqO1C,eAAU,GAAG,GAAG,EAAE;MACxB,IAAI,MAAM,CAAC;MACX,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE;QAC1B,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;OACtD;WAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;QAClC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;OACvD;WAAM;QACL,MAAM,GAAG,IAAI,CAAC;OACf;MACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAcM,gBAAW,GAAG,GAAS,EAAE;MAC/B,IACE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KA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AI,CAAC,UAAU,IAAI,EAAC,aAAa,OAAG;MACrC,IAAI,CAAC,kBAAkB,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 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 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 {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"]}
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;IAC7B,qBAAgB,GAAqB,IAAI,CAAC;IAC1C,yBAAoB,GAAqB,IAAI,CAAC;IA+P9C,eAAU,GAAG,GAAG,EAAE;MACxB,IAAI,MAAM,CAAC;MACX,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE;QAC1B,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;OACtD;WAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;QAClC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;OACvD;WAAM;QACL,MAAM,GAAG,IAAI,CAAC;OACf;MACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IAcM,gBAAW,GAAG,GAAS,E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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 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,C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AE9C,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;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,CAAC;EACtC,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;IACxD,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,E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AErC,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"]}
@@ -468,6 +468,7 @@ button {
468
468
  color: var(--ic-architechtural-black);
469
469
  transition: var(--ic-easing-transition-fast);
470
470
  width: inherit;
471
+ position: relative;
471
472
  }
472
473
 
473
474
  .dark.card,
@@ -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"; }