@ukic/web-components 3.25.0 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/components/OpenInNew.js +5 -0
  2. package/components/OpenInNew.js.map +1 -0
  3. package/components/check-icon.js +8 -0
  4. package/components/check-icon.js.map +1 -0
  5. package/components/chevron-icon.js +8 -0
  6. package/components/chevron-icon.js.map +1 -0
  7. package/components/close-icon.js +10 -0
  8. package/components/close-icon.js.map +1 -0
  9. package/components/constants.js +184 -0
  10. package/components/constants.js.map +1 -0
  11. package/components/custom-elements.d.ts +2 -0
  12. package/components/helpers.js +547 -0
  13. package/components/helpers.js.map +1 -0
  14. package/components/ic-accordion-group.d.ts +11 -0
  15. package/components/ic-accordion-group.js +191 -0
  16. package/components/ic-accordion-group.js.map +1 -0
  17. package/components/ic-accordion.d.ts +11 -0
  18. package/components/ic-accordion.js +188 -0
  19. package/components/ic-accordion.js.map +1 -0
  20. package/components/ic-action-chip.d.ts +11 -0
  21. package/components/ic-action-chip.js +164 -0
  22. package/components/ic-action-chip.js.map +1 -0
  23. package/components/ic-alert.d.ts +11 -0
  24. package/components/ic-alert.js +193 -0
  25. package/components/ic-alert.js.map +1 -0
  26. package/components/ic-back-to-top.d.ts +11 -0
  27. package/components/ic-back-to-top.js +216 -0
  28. package/components/ic-back-to-top.js.map +1 -0
  29. package/components/ic-badge.d.ts +11 -0
  30. package/components/ic-badge.js +222 -0
  31. package/components/ic-badge.js.map +1 -0
  32. package/components/ic-breadcrumb-group.d.ts +11 -0
  33. package/components/ic-breadcrumb-group.js +278 -0
  34. package/components/ic-breadcrumb-group.js.map +1 -0
  35. package/components/ic-breadcrumb.d.ts +11 -0
  36. package/components/ic-breadcrumb.js +8 -0
  37. package/components/ic-breadcrumb.js.map +1 -0
  38. package/components/ic-breadcrumb2.js +145 -0
  39. package/components/ic-breadcrumb2.js.map +1 -0
  40. package/components/ic-button.d.ts +11 -0
  41. package/components/ic-button.js +8 -0
  42. package/components/ic-button.js.map +1 -0
  43. package/components/ic-button2.js +509 -0
  44. package/components/ic-button2.js.map +1 -0
  45. package/components/ic-card-horizontal.d.ts +11 -0
  46. package/components/ic-card-horizontal.js +214 -0
  47. package/components/ic-card-horizontal.js.map +1 -0
  48. package/components/ic-card-vertical.d.ts +11 -0
  49. package/components/ic-card-vertical.js +219 -0
  50. package/components/ic-card-vertical.js.map +1 -0
  51. package/components/ic-checkbox-group.d.ts +11 -0
  52. package/components/ic-checkbox-group.js +198 -0
  53. package/components/ic-checkbox-group.js.map +1 -0
  54. package/components/ic-checkbox.d.ts +11 -0
  55. package/components/ic-checkbox.js +202 -0
  56. package/components/ic-checkbox.js.map +1 -0
  57. package/components/ic-chip.d.ts +11 -0
  58. package/components/ic-chip.js +183 -0
  59. package/components/ic-chip.js.map +1 -0
  60. package/components/ic-classification-banner.d.ts +11 -0
  61. package/components/ic-classification-banner.js +102 -0
  62. package/components/ic-classification-banner.js.map +1 -0
  63. package/components/ic-data-list.d.ts +11 -0
  64. package/components/ic-data-list.js +63 -0
  65. package/components/ic-data-list.js.map +1 -0
  66. package/components/ic-data-row.d.ts +11 -0
  67. package/components/ic-data-row.js +115 -0
  68. package/components/ic-data-row.js.map +1 -0
  69. package/components/ic-dialog.d.ts +11 -0
  70. package/components/ic-dialog.js +366 -0
  71. package/components/ic-dialog.js.map +1 -0
  72. package/components/ic-divider.d.ts +11 -0
  73. package/components/ic-divider.js +8 -0
  74. package/components/ic-divider.js.map +1 -0
  75. package/components/ic-divider2.js +148 -0
  76. package/components/ic-divider2.js.map +1 -0
  77. package/components/ic-empty-state.d.ts +11 -0
  78. package/components/ic-empty-state.js +82 -0
  79. package/components/ic-empty-state.js.map +1 -0
  80. package/components/ic-footer-link-group.d.ts +11 -0
  81. package/components/ic-footer-link-group.js +101 -0
  82. package/components/ic-footer-link-group.js.map +1 -0
  83. package/components/ic-footer-link.d.ts +11 -0
  84. package/components/ic-footer-link.js +95 -0
  85. package/components/ic-footer-link.js.map +1 -0
  86. package/components/ic-footer.d.ts +11 -0
  87. package/components/ic-footer.js +156 -0
  88. package/components/ic-footer.js.map +1 -0
  89. package/components/ic-hero.d.ts +11 -0
  90. package/components/ic-hero.js +145 -0
  91. package/components/ic-hero.js.map +1 -0
  92. package/components/ic-horizontal-scroll.d.ts +11 -0
  93. package/components/ic-horizontal-scroll.js +8 -0
  94. package/components/ic-horizontal-scroll.js.map +1 -0
  95. package/components/ic-horizontal-scroll2.js +240 -0
  96. package/components/ic-horizontal-scroll2.js.map +1 -0
  97. package/components/ic-input-component-container.d.ts +11 -0
  98. package/components/ic-input-component-container.js +8 -0
  99. package/components/ic-input-component-container.js.map +1 -0
  100. package/components/ic-input-component-container2.js +95 -0
  101. package/components/ic-input-component-container2.js.map +1 -0
  102. package/components/ic-input-container.d.ts +11 -0
  103. package/components/ic-input-container.js +8 -0
  104. package/components/ic-input-container.js.map +1 -0
  105. package/components/ic-input-container2.js +47 -0
  106. package/components/ic-input-container2.js.map +1 -0
  107. package/components/ic-input-label.d.ts +11 -0
  108. package/components/ic-input-label.js +8 -0
  109. package/components/ic-input-label.js.map +1 -0
  110. package/components/ic-input-label2.js +121 -0
  111. package/components/ic-input-label2.js.map +1 -0
  112. package/components/ic-input-validation.d.ts +11 -0
  113. package/components/ic-input-validation.js +8 -0
  114. package/components/ic-input-validation.js.map +1 -0
  115. package/components/ic-input-validation2.js +90 -0
  116. package/components/ic-input-validation2.js.map +1 -0
  117. package/components/ic-layout-grid-item.d.ts +11 -0
  118. package/components/ic-layout-grid-item.js +95 -0
  119. package/components/ic-layout-grid-item.js.map +1 -0
  120. package/components/ic-layout-grid.d.ts +11 -0
  121. package/components/ic-layout-grid.js +188 -0
  122. package/components/ic-layout-grid.js.map +1 -0
  123. package/components/ic-link.d.ts +11 -0
  124. package/components/ic-link.js +8 -0
  125. package/components/ic-link.js.map +1 -0
  126. package/components/ic-link2.js +135 -0
  127. package/components/ic-link2.js.map +1 -0
  128. package/components/ic-loading-indicator.d.ts +11 -0
  129. package/components/ic-loading-indicator.js +8 -0
  130. package/components/ic-loading-indicator.js.map +1 -0
  131. package/components/ic-loading-indicator2.js +278 -0
  132. package/components/ic-loading-indicator2.js.map +1 -0
  133. package/components/ic-menu-group.d.ts +11 -0
  134. package/components/ic-menu-group.js +47 -0
  135. package/components/ic-menu-group.js.map +1 -0
  136. package/components/ic-menu-item.d.ts +11 -0
  137. package/components/ic-menu-item.js +8 -0
  138. package/components/ic-menu-item.js.map +1 -0
  139. package/components/ic-menu-item2.js +171 -0
  140. package/components/ic-menu-item2.js.map +1 -0
  141. package/components/ic-menu.d.ts +11 -0
  142. package/components/ic-menu.js +8 -0
  143. package/components/ic-menu.js.map +1 -0
  144. package/components/ic-menu2.js +2590 -0
  145. package/components/ic-menu2.js.map +1 -0
  146. package/components/ic-navigation-button.d.ts +11 -0
  147. package/components/ic-navigation-button.js +175 -0
  148. package/components/ic-navigation-button.js.map +1 -0
  149. package/components/ic-navigation-group.d.ts +11 -0
  150. package/components/ic-navigation-group.js +326 -0
  151. package/components/ic-navigation-group.js.map +1 -0
  152. package/components/ic-navigation-item.d.ts +11 -0
  153. package/components/ic-navigation-item.js +294 -0
  154. package/components/ic-navigation-item.js.map +1 -0
  155. package/components/ic-navigation-menu.d.ts +11 -0
  156. package/components/ic-navigation-menu.js +8 -0
  157. package/components/ic-navigation-menu.js.map +1 -0
  158. package/components/ic-navigation-menu2.js +188 -0
  159. package/components/ic-navigation-menu2.js.map +1 -0
  160. package/components/ic-page-header.d.ts +11 -0
  161. package/components/ic-page-header.js +196 -0
  162. package/components/ic-page-header.js.map +1 -0
  163. package/components/ic-pagination-bar.d.ts +11 -0
  164. package/components/ic-pagination-bar.js +523 -0
  165. package/components/ic-pagination-bar.js.map +1 -0
  166. package/components/ic-pagination-item.d.ts +11 -0
  167. package/components/ic-pagination-item.js +8 -0
  168. package/components/ic-pagination-item.js.map +1 -0
  169. package/components/ic-pagination-item2.js +107 -0
  170. package/components/ic-pagination-item2.js.map +1 -0
  171. package/components/ic-pagination.d.ts +11 -0
  172. package/components/ic-pagination.js +8 -0
  173. package/components/ic-pagination.js.map +1 -0
  174. package/components/ic-pagination2.js +379 -0
  175. package/components/ic-pagination2.js.map +1 -0
  176. package/components/ic-popover-menu.d.ts +11 -0
  177. package/components/ic-popover-menu.js +369 -0
  178. package/components/ic-popover-menu.js.map +1 -0
  179. package/components/ic-radio-group.d.ts +11 -0
  180. package/components/ic-radio-group.js +317 -0
  181. package/components/ic-radio-group.js.map +1 -0
  182. package/components/ic-radio-option.d.ts +11 -0
  183. package/components/ic-radio-option.js +211 -0
  184. package/components/ic-radio-option.js.map +1 -0
  185. package/components/ic-search-bar.d.ts +11 -0
  186. package/components/ic-search-bar.js +719 -0
  187. package/components/ic-search-bar.js.map +1 -0
  188. package/components/ic-section-container.d.ts +11 -0
  189. package/components/ic-section-container.js +8 -0
  190. package/components/ic-section-container.js.map +1 -0
  191. package/components/ic-section-container2.js +50 -0
  192. package/components/ic-section-container2.js.map +1 -0
  193. package/components/ic-select.d.ts +11 -0
  194. package/components/ic-select.js +8 -0
  195. package/components/ic-select.js.map +1 -0
  196. package/components/ic-select2.js +806 -0
  197. package/components/ic-select2.js.map +1 -0
  198. package/components/ic-side-navigation.d.ts +11 -0
  199. package/components/ic-side-navigation.js +568 -0
  200. package/components/ic-side-navigation.js.map +1 -0
  201. package/components/ic-skeleton.d.ts +11 -0
  202. package/components/ic-skeleton.js +81 -0
  203. package/components/ic-skeleton.js.map +1 -0
  204. package/components/ic-skip-link.d.ts +11 -0
  205. package/components/ic-skip-link.js +91 -0
  206. package/components/ic-skip-link.js.map +1 -0
  207. package/components/ic-status-tag.d.ts +11 -0
  208. package/components/ic-status-tag.js +85 -0
  209. package/components/ic-status-tag.js.map +1 -0
  210. package/components/ic-step.d.ts +11 -0
  211. package/components/ic-step.js +200 -0
  212. package/components/ic-step.js.map +1 -0
  213. package/components/ic-stepper.d.ts +11 -0
  214. package/components/ic-stepper.js +340 -0
  215. package/components/ic-stepper.js.map +1 -0
  216. package/components/ic-switch.d.ts +11 -0
  217. package/components/ic-switch.js +164 -0
  218. package/components/ic-switch.js.map +1 -0
  219. package/components/ic-tab-context.d.ts +11 -0
  220. package/components/ic-tab-context.js +275 -0
  221. package/components/ic-tab-context.js.map +1 -0
  222. package/components/ic-tab-group.d.ts +11 -0
  223. package/components/ic-tab-group.js +89 -0
  224. package/components/ic-tab-group.js.map +1 -0
  225. package/components/ic-tab-panel.d.ts +11 -0
  226. package/components/ic-tab-panel.js +63 -0
  227. package/components/ic-tab-panel.js.map +1 -0
  228. package/components/ic-tab.d.ts +11 -0
  229. package/components/ic-tab.js +143 -0
  230. package/components/ic-tab.js.map +1 -0
  231. package/components/ic-text-field.d.ts +11 -0
  232. package/components/ic-text-field.js +8 -0
  233. package/components/ic-text-field.js.map +1 -0
  234. package/components/ic-text-field2.js +532 -0
  235. package/components/ic-text-field2.js.map +1 -0
  236. package/components/ic-theme.d.ts +11 -0
  237. package/components/ic-theme.js +105 -0
  238. package/components/ic-theme.js.map +1 -0
  239. package/components/ic-toast-region.d.ts +11 -0
  240. package/components/ic-toast-region.js +76 -0
  241. package/components/ic-toast-region.js.map +1 -0
  242. package/components/ic-toast.d.ts +11 -0
  243. package/components/ic-toast.js +295 -0
  244. package/components/ic-toast.js.map +1 -0
  245. package/components/ic-toggle-button-group.d.ts +11 -0
  246. package/components/ic-toggle-button-group.js +323 -0
  247. package/components/ic-toggle-button-group.js.map +1 -0
  248. package/components/ic-toggle-button.d.ts +11 -0
  249. package/components/ic-toggle-button.js +235 -0
  250. package/components/ic-toggle-button.js.map +1 -0
  251. package/components/ic-tooltip.d.ts +11 -0
  252. package/components/ic-tooltip.js +8 -0
  253. package/components/ic-tooltip.js.map +1 -0
  254. package/components/ic-tooltip2.js +2078 -0
  255. package/components/ic-tooltip2.js.map +1 -0
  256. package/components/ic-top-navigation.d.ts +11 -0
  257. package/components/ic-top-navigation.js +320 -0
  258. package/components/ic-top-navigation.js.map +1 -0
  259. package/components/ic-typography.d.ts +11 -0
  260. package/components/ic-typography.js +8 -0
  261. package/components/ic-typography.js.map +1 -0
  262. package/components/ic-typography2.js +228 -0
  263. package/components/ic-typography2.js.map +1 -0
  264. package/components/index.d.ts +33 -0
  265. package/components/index.js +4 -0
  266. package/components/index.js.map +1 -0
  267. package/components/package.json +9 -0
  268. package/dist/cjs/core.cjs.js +1 -1
  269. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  270. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +63 -37
  271. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  272. package/dist/cjs/ic-pagination_3.cjs.entry.js +17 -17
  273. package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
  274. package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
  275. package/dist/cjs/ic-top-navigation.cjs.entry.js +12 -8
  276. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  277. package/dist/cjs/loader.cjs.js +1 -1
  278. package/dist/collection/components/ic-menu/ic-menu.css +19 -0
  279. package/dist/collection/components/ic-menu/ic-menu.js +62 -36
  280. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  281. package/dist/collection/components/ic-menu/ic-menu.types.js.map +1 -1
  282. package/dist/collection/components/ic-select/ic-select.js +17 -17
  283. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  284. package/dist/collection/components/ic-select/ic-select_(single).stories.js +54 -0
  285. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +33 -9
  286. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
  287. package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +26 -0
  288. package/dist/components/ic-menu2.js +63 -37
  289. package/dist/components/ic-menu2.js.map +1 -1
  290. package/dist/components/ic-page-header.js.map +1 -1
  291. package/dist/components/ic-popover-menu.js.map +1 -1
  292. package/dist/components/ic-radio-group.js.map +1 -1
  293. package/dist/components/ic-radio-option.js.map +1 -1
  294. package/dist/components/ic-select2.js +17 -17
  295. package/dist/components/ic-select2.js.map +1 -1
  296. package/dist/components/ic-top-navigation.js +13 -8
  297. package/dist/components/ic-top-navigation.js.map +1 -1
  298. package/dist/core/core.esm.js +1 -1
  299. package/dist/core/core.esm.js.map +1 -1
  300. package/dist/core/{p-46e5a58b.entry.js → p-12474095.entry.js} +2 -2
  301. package/dist/core/p-12474095.entry.js.map +1 -0
  302. package/dist/core/p-98dee727.entry.js.map +1 -1
  303. package/dist/core/p-d1220d2a.entry.js.map +1 -1
  304. package/dist/core/p-e0b66371.entry.js +2 -0
  305. package/dist/core/p-e0b66371.entry.js.map +1 -0
  306. package/dist/core/{p-171a19bf.entry.js → p-fdc4376e.entry.js} +2 -2
  307. package/dist/core/p-fdc4376e.entry.js.map +1 -0
  308. package/dist/esm/core.js +1 -1
  309. package/dist/esm/ic-button_3.entry.js.map +1 -1
  310. package/dist/esm/ic-input-component-container_3.entry.js +63 -37
  311. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  312. package/dist/esm/ic-pagination_3.entry.js +17 -17
  313. package/dist/esm/ic-pagination_3.entry.js.map +1 -1
  314. package/dist/esm/ic-section-container.entry.js.map +1 -1
  315. package/dist/esm/ic-top-navigation.entry.js +12 -8
  316. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  317. package/dist/esm/loader.js +1 -1
  318. package/dist/types/components/ic-menu/ic-menu.types.d.ts +1 -0
  319. package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +4 -1
  320. package/dist/types/components.d.ts +10 -2
  321. package/hydrate/index.js +93 -62
  322. package/hydrate/index.mjs +93 -62
  323. package/package.json +4 -2
  324. package/vscode-data.json +5 -1
  325. package/dist/core/p-171a19bf.entry.js.map +0 -1
  326. package/dist/core/p-343670b4.entry.js +0 -2
  327. package/dist/core/p-343670b4.entry.js.map +0 -1
  328. package/dist/core/p-46e5a58b.entry.js.map +0 -1
@@ -0,0 +1,202 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { r as removeDisabledFalse, s as addFormResetListener, o as onComponentRequiredPropUndefined, t as removeFormResetListener, u as renderHiddenInput, v as removeHiddenInput, i as isSlotUsed } from './helpers.js';
3
+ import { d as defineCustomElement$2 } from './ic-typography2.js';
4
+
5
+ const icCheckboxCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host(.ic-checkbox-disabled){pointer-events:none}.container{display:flex;width:-moz-fit-content;width:fit-content;padding:var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);margin-bottom:var(--ic-space-xxs);align-items:center}:host(.ic-data-table-checkbox) .container{padding:0;margin-bottom:0}:host(.ic-checkbox-small) .container{margin-bottom:var(--ic-space-xxxs)}.checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;position:relative;top:0;left:0;height:var(--ic-space-lg);width:var(--ic-space-lg);background-color:var(--ic-checkbox-background-unselected);border:var(--ic-border-width) solid var(--ic-checkbox-border-unselected);border-radius:var(--ic-border-radius);outline:none;cursor:pointer;transition:var(--ic-easing-transition-fast);flex-shrink:0}:host .container svg{width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.ic-checkbox-small) .checkbox,:host(.ic-checkbox-small) .container svg{width:var(--ic-space-md);height:var(--ic-space-md)}:host(.ic-checkbox-large) .checkbox,:host(.ic-checkbox-large) .container svg{width:var(--ic-space-xl);height:var(--ic-space-xl)}.checkbox:checked{background-color:var(--ic-checkbox-background-selected);border:var(--ic-border-width) solid var(--ic-checkbox-background-selected);transition:var(--ic-easing-transition-slow)}.checkbox:checked:disabled{background-color:var(--ic-checkbox-background-selected-disabled);border:var(--ic-border-width) solid\n var(--ic-checkbox-background-selected-disabled)}.checkbox:indeterminate,.checkbox.indeterminate:checked{background-color:var(--ic-checkbox-background-indeterminate);border:0.125rem solid var(--ic-checkbox-background-indeterminate)}.checkbox:indeterminate:disabled,.checkbox.indeterminate:checked:disabled{background-color:var(--ic-checkbox-background-indeterminate-disabled);border:0.125rem solid var(--ic-checkbox-background-indeterminate-disabled)}.checkbox:checked:hover{background-color:var(--ic-checkbox-background-selected-hover)}.checkbox:indeterminate:hover,.checkbox.indeterminate:checked:hover{background-color:var(--ic-checkbox-background-indeterminate-hover);border:0.125rem solid var(--ic-checkbox-background-indeterminate-hover)}.checkbox:checked:active{background-color:var(--ic-checkbox-background-selected-pressed)}.checkbox:indeterminate:active,.checkbox.indeterminate:checked:active{background-color:var(--ic-checkbox-background-indeterminate-pressed);border:0.125rem solid var(--ic-checkbox-background-indeterminate-pressed)}.checkbox:hover{box-shadow:0 0 0 0.25rem var(--ic-checkbox-action-background-hover);border:var(--ic-border-width) solid\n var(--ic-checkbox-border-unselected-hover)}.checkbox:active{box-shadow:0 0 0 0.25rem var(--ic-checkbox-action-background-pressed);border:var(--ic-border-width) solid\n var(--ic-checkbox-border-unselected-pressed)}.checkbox:focus{box-shadow:var(--ic-border-focus)}.checkbox:disabled{border:var(--ic-border-width) dashed\n var(--ic-checkbox-border-unselected-disabled)}.checkbox-label{--ic-typography-color:var(--ic-checkbox-text)}.checkbox-label>label{padding-left:var(--ic-space-sm);display:inline-block}::slotted([slot=\"label\"]){padding-left:var(--ic-space-sm) !important;color:var(--ic-checkbox-text)}:host(.ic-checkbox-disabled) .checkbox-label{color:var(--ic-checkbox-text-disabled);--ic-typography-color:var(--ic-checkbox-text-disabled)}:host(.ic-checkbox-disabled) ::slotted([slot=\"label\"]){color:var(--ic-checkbox-text-disabled);--ic-typography-color:var(--ic-checkbox-text-disabled)}.checkbox-label:hover{cursor:pointer}.checkmark{position:relative;right:calc(-1 * var(--ic-space-lg));margin-left:calc(-1 * var(--ic-space-lg));fill:var(--ic-checkbox-icon-pressed);z-index:1;background-color:transparent;pointer-events:none;flex-shrink:0}:host(.ic-checkbox-small) .checkmark{margin-left:calc(-1 * var(--ic-space-md));right:calc(-1 * var(--ic-space-md))}:host(.ic-checkbox-large) .checkmark{margin-left:calc(-1 * var(--ic-space-xl));right:calc(-1 * var(--ic-space-xl))}.indeterminate-symbol{position:relative;width:0.875rem;height:var(--ic-space-xxxs);right:-1.188rem;margin-left:-0.875rem;z-index:1;background-color:var(--ic-checkbox-icon-indeterminate);pointer-events:none;flex-shrink:0}:host(.ic-checkbox-small) .indeterminate-symbol{width:0.6rem;right:-0.8rem;margin-left:-0.6rem}:host(.ic-checkbox-large) .indeterminate-symbol{width:1.25rem;right:-1.625rem;margin-left:-1.25rem}.additional-field-wrapper{margin-left:calc(var(--ic-space-md) + var(--ic-space-lg));margin-top:calc(var(--ic-space-sm) / 2)}.branch-corner{height:var(--ic-space-md);width:var(--ic-space-xl);border-radius:0 0 0 0.188rem;border-bottom:0.125rem solid var(--ic-checkbox-required-bar);border-left:0.125rem solid var(--ic-checkbox-required-bar)}.dynamic-container{display:flex;position:relative;margin:var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);gap:var(--ic-space-xs)}.dynamic-text{color:var(--ic-checkbox-required-text);--ic-typography-color:var(--ic-checkbox-required-text);margin-top:calc(var(--ic-space-sm) / 2);margin-bottom:var(--ic-space-xs);border-radius:2%}.dynamic-field-container{flex:100%}.sr-only{position:absolute;left:-9999px}@media (max-width: 576px){::slotted(*){--input-width:100%}.dynamic-field-container{flex:initial}}@media (forced-colors: active){.checkbox{-webkit-appearance:revert;-moz-appearance:revert;appearance:revert}.checkbox:focus-visible{outline:0.125rem solid highlight}.checkbox:disabled:not(:checked){-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.checkmark{fill:none}.indeterminate-symbol{display:none}}.checkmark:dir(rtl){right:0}.checkbox-label:dir(rtl){padding-right:var(--ic-space-sm);padding-left:0}.indeterminate-symbol:dir(rtl){right:0.288rem}.branch-corner:dir(rtl){border-radius:0 0 0.188rem;border-right:0.125rem solid var(--ic-action-default);border-left:none}.dynamic-container:dir(rtl){margin:var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0}@media (prefers-reduced-motion: reduce){.checkbox,.checkbox:checked{transition:none}}";
6
+ const IcCheckboxStyle0 = icCheckboxCss;
7
+
8
+ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.icCheck = createEvent(this, "icCheck", 7);
14
+ /**
15
+ * The style of additionalField that will be displayed if used.
16
+ */
17
+ this.additionalFieldDisplay = "static";
18
+ /**
19
+ * If `true`, the checkbox will be set to the checked state. This is only the initial state and will be updated to unchecked if the checkbox is clicked.
20
+ */
21
+ this.checked = false;
22
+ this.initiallyChecked = this.checked;
23
+ /**
24
+ * If `true`, the checkbox will be set to the disabled state.
25
+ */
26
+ this.disabled = false;
27
+ /**
28
+ * The text to be displayed when dynamic.
29
+ */
30
+ this.dynamicText = "This selection requires additional answers";
31
+ /**
32
+ * If `true`, the label will be hidden and the required label value will be applied as an aria-label.
33
+ */
34
+ this.hideLabel = false;
35
+ /**
36
+ * If `true`, the indeterminate state will be displayed when checked.
37
+ */
38
+ this.indeterminate = false;
39
+ this.displayIndeterminate = this.indeterminate;
40
+ /**
41
+ * If `true`, the checkbox will behave like a native checkbox where the `indeterminate` prop sets the indeterminate visual styling, independent of the `checked` state.
42
+ */
43
+ this.nativeIndeterminateBehaviour = false;
44
+ /**
45
+ * Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
46
+ */
47
+ this.theme = "inherit";
48
+ /**
49
+ * The value for the checkbox.
50
+ */
51
+ this.value = "";
52
+ this.handleClick = () => {
53
+ this.checked = !this.checked;
54
+ this.displayIndeterminate =
55
+ !this.nativeIndeterminateBehaviour && this.indeterminate && this.checked;
56
+ this.icCheck.emit();
57
+ };
58
+ this.handleFormReset = () => {
59
+ this.checked = this.initiallyChecked;
60
+ };
61
+ }
62
+ watchDisabledHandler() {
63
+ removeDisabledFalse(this.disabled, this.el);
64
+ }
65
+ watchIndeterminateHandler() {
66
+ this.displayIndeterminate =
67
+ this.indeterminate && (this.nativeIndeterminateBehaviour || this.checked);
68
+ }
69
+ componentWillLoad() {
70
+ removeDisabledFalse(this.disabled, this.el);
71
+ addFormResetListener(this.el, this.handleFormReset);
72
+ const { parentElement } = this.el;
73
+ if ((parentElement === null || parentElement === void 0 ? void 0 : parentElement.tagName) === "IC-CHECKBOX-GROUP") {
74
+ const { name, label, size } = parentElement;
75
+ if (!this.name)
76
+ this.name = name;
77
+ if (!this.size)
78
+ this.size = size;
79
+ this.groupLabel = label;
80
+ }
81
+ }
82
+ componentDidLoad() {
83
+ if (this.hasLabelSlot()) {
84
+ this.arrangeLabel();
85
+ }
86
+ else {
87
+ onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Checkbox");
88
+ }
89
+ }
90
+ componentDidRender() {
91
+ if (this.additionalFieldDisplay === "static") {
92
+ this.el
93
+ .querySelectorAll("ic-text-field")
94
+ .forEach((textfield) => textfield.setAttribute("disabled", `${!this.checked}`));
95
+ }
96
+ else if (this.additionalFieldContainer) {
97
+ this.additionalFieldContainer.style.display = !this.checked
98
+ ? "none"
99
+ : "flex";
100
+ }
101
+ }
102
+ disconnectedCallback() {
103
+ removeFormResetListener(this.el, this.handleFormReset);
104
+ }
105
+ /**
106
+ * Sets focus on the checkbox.
107
+ */
108
+ async setFocus() {
109
+ var _a;
110
+ (_a = this.checkboxEl) === null || _a === void 0 ? void 0 : _a.focus();
111
+ }
112
+ getCheckboxGroupId() {
113
+ return `ic-checkbox-${this.label}-${this.groupLabel}`.replace(/ /g, "-");
114
+ }
115
+ hasLabelSlot() {
116
+ this.labelSlot = this.el.querySelector('[slot="label"]');
117
+ return !!this.labelSlot;
118
+ }
119
+ arrangeLabel() {
120
+ var _a;
121
+ if (this.labelSlot) {
122
+ this.label = ((_a = this.labelSlot.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || "";
123
+ this.labelSlot.setAttribute("for", this.getCheckboxGroupId());
124
+ if (this.disabled) {
125
+ this.labelSlot.setAttribute("aria-disabled", "true");
126
+ }
127
+ }
128
+ }
129
+ render() {
130
+ const { additionalFieldDisplay, checked, disabled, displayIndeterminate, dynamicText, el, form, handleClick, hideLabel, label, name, size, theme, value, } = this;
131
+ const inputId = this.getCheckboxGroupId();
132
+ const isDynamicAdditionalField = additionalFieldDisplay === "dynamic";
133
+ checked
134
+ ? renderHiddenInput(el, value, name, disabled)
135
+ : removeHiddenInput(el);
136
+ const LabelContent = () => this.hasLabelSlot() ? (h("slot", { name: "label" })) : (h("ic-typography", { class: "checkbox-label", variant: "body" }, h("label", { htmlFor: inputId }, label)));
137
+ return (h(Host, { key: 'b0354f672348084da74301a8d95ec590affc6f1b', class: {
138
+ "ic-checkbox-disabled": disabled,
139
+ [`ic-checkbox-${size}`]: !!size,
140
+ [`ic-theme-${theme}`]: theme !== "inherit",
141
+ } }, h("div", { key: '4f1a7f7f2c44edc8bb4b113abb1e82421f150ec1', class: "container" }, displayIndeterminate ? (h("div", { class: "indeterminate-symbol" })) : (checked && (h("svg", { class: "checkmark", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", "fill-rule": "evenodd", "clip-rule": "evenodd" }, h("title", null, "checkmark icon"), h("path", { d: "M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z" })))), h("input", { key: '11d459b32a35d16969cff6db5087d710776b0c56', role: "checkbox", class: {
142
+ checkbox: true,
143
+ checked,
144
+ indeterminate: displayIndeterminate,
145
+ }, ref: (el) => (this.checkboxEl = el), type: "checkbox", name: name, id: inputId, value: value, disabled: disabled, checked: checked, indeterminate: displayIndeterminate, onClick: handleClick, form: form, "aria-label": hideLabel || this.hasLabelSlot() ? label : undefined }), !hideLabel && h(LabelContent, { key: '0b2e1ba8150dada1ed202f82b87e5090475e4538' })), h("span", { key: 'ac7a0b65fe263404799947a9e38e56d571a4d15b', id: `${inputId}-additional-field-description`, role: "alert", class: "sr-only" }, isDynamicAdditionalField && checked ? dynamicText : ""), isSlotUsed(el, "additional-field") && (h("div", { key: '7c3324bdbe5f4002e68a3cab9452ece5a4a0ec47', class: "dynamic-container", ref: (el) => (this.additionalFieldContainer = el) }, isDynamicAdditionalField && h("div", { key: '3e8f8a84490a9b395625db6e5d3ab41dcfd3f52b', class: "branch-corner" }), h("div", { key: '7a13bef6e34f74553f621d8dced7f0d7c2ad9ff9', class: "dynamic-field-container" }, isDynamicAdditionalField && (h("ic-typography", { key: '97d5099d39ed0a796fb21cc6e39768ad464ae13d', variant: "caption" }, h("p", { key: '565b6fecc59ec1a8786d6a956ef15389f79b1b5d', class: "dynamic-text" }, isDynamicAdditionalField && checked ? dynamicText : ""))), h("div", { key: 'f1f45ea17205c5314c7d0cdb9bc59afc791aa6e9', class: {
146
+ "additional-field-wrapper": !isDynamicAdditionalField,
147
+ } }, h("slot", { key: 'f302388352b40f0d63a8b425aae215af22615570', name: "additional-field" })))))));
148
+ }
149
+ static get delegatesFocus() { return true; }
150
+ get el() { return this; }
151
+ static get watchers() { return {
152
+ "disabled": ["watchDisabledHandler"],
153
+ "indeterminate": ["watchIndeterminateHandler"]
154
+ }; }
155
+ static get style() { return IcCheckboxStyle0; }
156
+ }, [17, "ic-checkbox", {
157
+ "additionalFieldDisplay": [513, "additional-field-display"],
158
+ "checked": [1540],
159
+ "disabled": [4],
160
+ "dynamicText": [1, "dynamic-text"],
161
+ "form": [1],
162
+ "groupLabel": [1025, "group-label"],
163
+ "hideLabel": [4, "hide-label"],
164
+ "indeterminate": [4],
165
+ "label": [1],
166
+ "name": [1025],
167
+ "nativeIndeterminateBehaviour": [4, "native-indeterminate-behaviour"],
168
+ "size": [1025],
169
+ "theme": [1],
170
+ "value": [1],
171
+ "initiallyChecked": [32],
172
+ "displayIndeterminate": [32],
173
+ "setFocus": [64]
174
+ }, undefined, {
175
+ "disabled": ["watchDisabledHandler"],
176
+ "indeterminate": ["watchIndeterminateHandler"]
177
+ }]);
178
+ function defineCustomElement$1() {
179
+ if (typeof customElements === "undefined") {
180
+ return;
181
+ }
182
+ const components = ["ic-checkbox", "ic-typography"];
183
+ components.forEach(tagName => { switch (tagName) {
184
+ case "ic-checkbox":
185
+ if (!customElements.get(tagName)) {
186
+ customElements.define(tagName, Checkbox);
187
+ }
188
+ break;
189
+ case "ic-typography":
190
+ if (!customElements.get(tagName)) {
191
+ defineCustomElement$2();
192
+ }
193
+ break;
194
+ } });
195
+ }
196
+
197
+ const IcCheckbox = Checkbox;
198
+ const defineCustomElement = defineCustomElement$1;
199
+
200
+ export { IcCheckbox, defineCustomElement };
201
+
202
+ //# sourceMappingURL=ic-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"file":"ic-checkbox.js","mappings":";;;;AAAA,MAAM,aAAa,GAAG,8yQAA8yQ,CAAC;AACr0Q,yBAAe,aAAa;;MCqCf,QAAQ;IAPrB;;;;;;;;QAiB2B,2BAAsB,GAC7C,QAAQ,CAAC;;;;QAK6B,YAAO,GAAG,KAAK,CAAC;QAC/C,qBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC;;;;QAKjC,aAAQ,GAAG,KAAK,CAAC;;;;QAUjB,gBAAW,GAAG,4CAA4C,CAAC;;;;QAe3D,cAAS,GAAG,KAAK,CAAC;;;;QAKlB,kBAAa,GAAG,KAAK,CAAC;QACrB,yBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC;;;;QAoB3C,iCAA4B,GAAG,KAAK,CAAC;;;;QAUrC,UAAK,GAAgB,SAAS,CAAC;;;;QAK/B,UAAK,GAAG,EAAE,CAAC;QA8EX,gBAAW,GAAG;YACpB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,IAAI,CAAC,oBAAoB;gBACvB,CAAC,IAAI,CAAC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;;;","names":[],"sources":["src/components/ic-checkbox/ic-checkbox.css?tag=ic-checkbox&encapsulation=shadow","src/components/ic-checkbox/ic-checkbox.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host(.ic-checkbox-disabled) {\n pointer-events: none;\n}\n\n.container {\n display: flex;\n width: fit-content;\n padding: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);\n margin-bottom: var(--ic-space-xxs);\n align-items: center;\n}\n\n:host(.ic-data-table-checkbox) .container {\n padding: 0;\n margin-bottom: 0;\n}\n\n:host(.ic-checkbox-small) .container {\n margin-bottom: var(--ic-space-xxxs);\n}\n\n.checkbox {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: block;\n position: relative;\n top: 0;\n left: 0;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n background-color: var(--ic-checkbox-background-unselected);\n border: var(--ic-border-width) solid var(--ic-checkbox-border-unselected);\n border-radius: var(--ic-border-radius);\n outline: none;\n cursor: pointer;\n transition: var(--ic-easing-transition-fast);\n flex-shrink: 0;\n}\n\n:host .container svg {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n}\n\n:host(.ic-checkbox-small) .checkbox,\n:host(.ic-checkbox-small) .container svg {\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n}\n\n:host(.ic-checkbox-large) .checkbox,\n:host(.ic-checkbox-large) .container svg {\n width: var(--ic-space-xl);\n height: var(--ic-space-xl);\n}\n\n.checkbox:checked {\n background-color: var(--ic-checkbox-background-selected);\n border: var(--ic-border-width) solid var(--ic-checkbox-background-selected);\n transition: var(--ic-easing-transition-slow);\n}\n\n.checkbox:checked:disabled {\n background-color: var(--ic-checkbox-background-selected-disabled);\n border: var(--ic-border-width) solid\n var(--ic-checkbox-background-selected-disabled);\n}\n\n.checkbox:indeterminate,\n.checkbox.indeterminate:checked {\n background-color: var(--ic-checkbox-background-indeterminate);\n border: 0.125rem solid var(--ic-checkbox-background-indeterminate);\n}\n\n.checkbox:indeterminate:disabled,\n.checkbox.indeterminate:checked:disabled {\n background-color: var(--ic-checkbox-background-indeterminate-disabled);\n border: 0.125rem solid var(--ic-checkbox-background-indeterminate-disabled);\n}\n\n.checkbox:checked:hover {\n background-color: var(--ic-checkbox-background-selected-hover);\n}\n\n.checkbox:indeterminate:hover,\n.checkbox.indeterminate:checked:hover {\n background-color: var(--ic-checkbox-background-indeterminate-hover);\n border: 0.125rem solid var(--ic-checkbox-background-indeterminate-hover);\n}\n\n.checkbox:checked:active {\n background-color: var(--ic-checkbox-background-selected-pressed);\n}\n\n.checkbox:indeterminate:active,\n.checkbox.indeterminate:checked:active {\n background-color: var(--ic-checkbox-background-indeterminate-pressed);\n border: 0.125rem solid var(--ic-checkbox-background-indeterminate-pressed);\n}\n\n.checkbox:hover {\n box-shadow: 0 0 0 0.25rem var(--ic-checkbox-action-background-hover);\n border: var(--ic-border-width) solid\n var(--ic-checkbox-border-unselected-hover);\n}\n\n.checkbox:active {\n box-shadow: 0 0 0 0.25rem var(--ic-checkbox-action-background-pressed);\n border: var(--ic-border-width) solid\n var(--ic-checkbox-border-unselected-pressed);\n}\n\n.checkbox:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.checkbox:disabled {\n border: var(--ic-border-width) dashed\n var(--ic-checkbox-border-unselected-disabled);\n}\n\n.checkbox-label {\n --ic-typography-color: var(--ic-checkbox-text);\n}\n\n.checkbox-label > label {\n padding-left: var(--ic-space-sm);\n display: inline-block;\n}\n\n::slotted([slot=\"label\"]) {\n padding-left: var(--ic-space-sm) !important;\n color: var(--ic-checkbox-text);\n}\n\n:host(.ic-checkbox-disabled) .checkbox-label {\n color: var(--ic-checkbox-text-disabled);\n\n --ic-typography-color: var(--ic-checkbox-text-disabled);\n}\n\n:host(.ic-checkbox-disabled) ::slotted([slot=\"label\"]) {\n color: var(--ic-checkbox-text-disabled);\n\n --ic-typography-color: var(--ic-checkbox-text-disabled);\n}\n\n.checkbox-label:hover {\n cursor: pointer;\n}\n\n.checkmark {\n position: relative;\n right: calc(-1 * var(--ic-space-lg));\n margin-left: calc(-1 * var(--ic-space-lg));\n fill: var(--ic-checkbox-icon-pressed);\n z-index: 1;\n background-color: transparent;\n pointer-events: none;\n flex-shrink: 0;\n}\n\n:host(.ic-checkbox-small) .checkmark {\n margin-left: calc(-1 * var(--ic-space-md));\n right: calc(-1 * var(--ic-space-md));\n}\n\n:host(.ic-checkbox-large) .checkmark {\n margin-left: calc(-1 * var(--ic-space-xl));\n right: calc(-1 * var(--ic-space-xl));\n}\n\n.indeterminate-symbol {\n position: relative;\n width: 0.875rem;\n height: var(--ic-space-xxxs);\n right: -1.188rem;\n margin-left: -0.875rem;\n z-index: 1;\n background-color: var(--ic-checkbox-icon-indeterminate);\n pointer-events: none;\n flex-shrink: 0;\n}\n\n:host(.ic-checkbox-small) .indeterminate-symbol {\n width: 0.6rem;\n right: -0.8rem;\n margin-left: -0.6rem;\n}\n\n:host(.ic-checkbox-large) .indeterminate-symbol {\n width: 1.25rem;\n right: -1.625rem;\n margin-left: -1.25rem;\n}\n\n.additional-field-wrapper {\n margin-left: calc(var(--ic-space-md) + var(--ic-space-lg));\n margin-top: calc(var(--ic-space-sm) / 2);\n}\n\n.branch-corner {\n height: var(--ic-space-md);\n width: var(--ic-space-xl);\n border-radius: 0 0 0 0.188rem;\n border-bottom: 0.125rem solid var(--ic-checkbox-required-bar);\n border-left: 0.125rem solid var(--ic-checkbox-required-bar);\n}\n\n.dynamic-container {\n display: flex;\n position: relative;\n margin: var(--ic-space-xxxs) 0 var(--ic-space-xxs) var(--ic-space-md);\n gap: var(--ic-space-xs);\n}\n\n.dynamic-text {\n color: var(--ic-checkbox-required-text);\n\n --ic-typography-color: var(--ic-checkbox-required-text);\n\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-bottom: var(--ic-space-xs);\n border-radius: 2%;\n}\n\n.dynamic-field-container {\n flex: 100%;\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n@media (max-width: 576px) {\n ::slotted(*) {\n --input-width: 100%;\n }\n\n .dynamic-field-container {\n flex: initial;\n }\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n .checkbox {\n appearance: revert;\n }\n\n .checkbox:focus-visible {\n outline: 0.125rem solid highlight;\n }\n\n .checkbox:disabled:not(:checked) {\n appearance: none;\n border-color: GrayText;\n }\n\n .checkmark {\n fill: none;\n }\n\n .indeterminate-symbol {\n display: none;\n }\n}\n\n/* Right to left */\n.checkmark:dir(rtl) {\n right: 0;\n}\n\n.checkbox-label:dir(rtl) {\n padding-right: var(--ic-space-sm);\n padding-left: 0;\n}\n\n.indeterminate-symbol:dir(rtl) {\n right: 0.288rem;\n}\n\n.branch-corner:dir(rtl) {\n border-radius: 0 0 0.188rem;\n border-right: 0.125rem solid var(--ic-action-default);\n border-left: none;\n}\n\n.dynamic-container:dir(rtl) {\n margin: var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .checkbox,\n .checkbox:checked {\n transition: none;\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n State,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcAdditionalFieldTypes,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n renderHiddenInput,\n removeHiddenInput,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n} from \"../../utils/helpers\";\n\n/**\n * @slot additional-field - Content to be displayed alongside a checkbox.\n * @slot label - Label for the checkbox.\n */\n@Component({\n tag: \"ic-checkbox\",\n styleUrl: \"ic-checkbox.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Checkbox {\n private additionalFieldContainer?: HTMLDivElement;\n private checkboxEl?: HTMLInputElement;\n private labelSlot: HTMLElement | null;\n\n @Element() el: HTMLIcCheckboxElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the checkbox will be set to the checked state. This is only the initial state and will be updated to unchecked if the checkbox is clicked.\n */\n @Prop({ reflect: true, mutable: true }) checked = false;\n @State() initiallyChecked = this.checked;\n\n /**\n * If `true`, the checkbox will be set to the disabled state.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The text to be displayed when dynamic.\n */\n\n @Prop() dynamicText = \"This selection requires additional answers\";\n\n /**\n * The <form> element to associate the checkbox with.\n */\n @Prop() form?: string;\n\n /**\n * The group label for the checkbox.\n */\n @Prop({ mutable: true }) groupLabel?: string;\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * If `true`, the indeterminate state will be displayed when checked.\n */\n @Prop() indeterminate = false;\n @State() displayIndeterminate = this.indeterminate;\n @Watch(\"indeterminate\")\n watchIndeterminateHandler(): void {\n this.displayIndeterminate =\n this.indeterminate && (this.nativeIndeterminateBehaviour || this.checked);\n }\n\n /**\n * The label for the checkbox.\n */\n @Prop() label!: string;\n\n /**\n * The name for the checkbox. If not set when used in a checkbox group, the name will be based on the group name.\n */\n @Prop({ mutable: true }) name?: string;\n\n /**\n * If `true`, the checkbox will behave like a native checkbox where the `indeterminate` prop sets the indeterminate visual styling, independent of the `checked` state.\n */\n @Prop() nativeIndeterminateBehaviour = false;\n\n /**\n * The size of the checkbox to be displayed. This does not affect the font size of the label. If a checkbox is contained in a checkbox group, this will override the size set on checkbox group.\n */\n @Prop({ mutable: true }) size?: IcSizes;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * The value for the checkbox.\n */\n @Prop() value = \"\";\n\n /**\n * Emitted when a checkbox has been checked.\n */\n @Event() icCheck: EventEmitter<void>;\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n\n addFormResetListener(this.el, this.handleFormReset);\n\n const { parentElement } = this.el;\n if (parentElement?.tagName === \"IC-CHECKBOX-GROUP\") {\n const { name, label, size } = parentElement as HTMLIcCheckboxGroupElement;\n\n if (!this.name) this.name = name;\n if (!this.size) this.size = size;\n this.groupLabel = label;\n }\n }\n\n componentDidLoad(): void {\n if (this.hasLabelSlot()) {\n this.arrangeLabel();\n } else {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Checkbox\"\n );\n }\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n this.el\n .querySelectorAll(\"ic-text-field\")\n .forEach((textfield) =>\n textfield.setAttribute(\"disabled\", `${!this.checked}`)\n );\n } else if (this.additionalFieldContainer) {\n this.additionalFieldContainer.style.display = !this.checked\n ? \"none\"\n : \"flex\";\n }\n }\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n /**\n * Sets focus on the checkbox.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.checkboxEl?.focus();\n }\n\n private getCheckboxGroupId() {\n return `ic-checkbox-${this.label}-${this.groupLabel}`.replace(/ /g, \"-\");\n }\n\n private hasLabelSlot() {\n this.labelSlot = this.el.querySelector('[slot=\"label\"]');\n return !!this.labelSlot;\n }\n\n private arrangeLabel() {\n if (this.labelSlot) {\n this.label = this.labelSlot.textContent?.trim() || \"\";\n this.labelSlot.setAttribute(\"for\", this.getCheckboxGroupId());\n if (this.disabled) {\n this.labelSlot.setAttribute(\"aria-disabled\", \"true\");\n }\n }\n }\n\n private handleClick = () => {\n this.checked = !this.checked;\n this.displayIndeterminate =\n !this.nativeIndeterminateBehaviour && this.indeterminate && this.checked;\n this.icCheck.emit();\n };\n\n private handleFormReset = (): void => {\n this.checked = this.initiallyChecked;\n };\n\n render() {\n const {\n additionalFieldDisplay,\n checked,\n disabled,\n displayIndeterminate,\n dynamicText,\n el,\n form,\n handleClick,\n hideLabel,\n label,\n name,\n size,\n theme,\n value,\n } = this;\n\n const inputId = this.getCheckboxGroupId();\n\n const isDynamicAdditionalField = additionalFieldDisplay === \"dynamic\";\n\n checked\n ? renderHiddenInput(el, value, name, disabled)\n : removeHiddenInput(el);\n\n const LabelContent = () =>\n this.hasLabelSlot() ? (\n <slot name=\"label\"></slot>\n ) : (\n <ic-typography class=\"checkbox-label\" variant=\"body\">\n <label htmlFor={inputId}>{label}</label>\n </ic-typography>\n );\n\n return (\n <Host\n class={{\n \"ic-checkbox-disabled\": disabled,\n [`ic-checkbox-${size}`]: !!size,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <div class=\"container\">\n {displayIndeterminate ? (\n <div class=\"indeterminate-symbol\" />\n ) : (\n checked && (\n <svg\n class=\"checkmark\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n >\n <title>checkmark icon</title>\n <path d=\"M21 6.285l-11.16 12.733-6.84-6.018 1.319-1.49 5.341 4.686 9.865-11.196 1.475 1.285z\" />\n </svg>\n )\n )}\n <input\n role=\"checkbox\"\n class={{\n checkbox: true,\n checked,\n indeterminate: displayIndeterminate,\n }}\n ref={(el) => (this.checkboxEl = el)}\n type=\"checkbox\"\n name={name}\n id={inputId}\n value={value}\n disabled={disabled}\n checked={checked}\n indeterminate={displayIndeterminate}\n onClick={handleClick}\n form={form}\n aria-label={hideLabel || this.hasLabelSlot() ? label : undefined}\n ></input>\n {!hideLabel && <LabelContent />}\n </div>\n <span\n id={`${inputId}-additional-field-description`}\n role=\"alert\"\n class=\"sr-only\"\n >\n {isDynamicAdditionalField && checked ? dynamicText : \"\"}\n </span>\n {isSlotUsed(el, \"additional-field\") && (\n <div\n class=\"dynamic-container\"\n ref={(el) => (this.additionalFieldContainer = el)}\n >\n {isDynamicAdditionalField && <div class=\"branch-corner\"></div>}\n <div class=\"dynamic-field-container\">\n {isDynamicAdditionalField && (\n <ic-typography variant=\"caption\">\n <p class=\"dynamic-text\">\n {isDynamicAdditionalField && checked ? dynamicText : \"\"}\n </p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\": !isDynamicAdditionalField,\n }}\n >\n <slot name=\"additional-field\"></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface IcChip extends Components.IcChip, HTMLElement {}
4
+ export const IcChip: {
5
+ prototype: IcChip;
6
+ new (): IcChip;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,183 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { k as convertToRGBA, l as getBrandForegroundAppearance, r as removeDisabledFalse, o as onComponentRequiredPropUndefined, e as renderDynamicChildSlots, i as isSlotUsed, a as isElInAGGrid } from './helpers.js';
3
+ import { d as defineCustomElement$3 } from './ic-tooltip2.js';
4
+ import { d as defineCustomElement$2 } from './ic-typography2.js';
5
+
6
+ const dismissIcon = `<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
7
+ <path d="M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59L13.59 5L15 6.41L11.41 10L15 13.59Z" fill="currentColor"/>
8
+ </svg>
9
+ `;
10
+
11
+ const icChipCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:inline-block;max-width:100%;vertical-align:middle}:host(.ic-chip-dismissed){display:none}.chip{--chip-bg-color:transparent;--chip-hover-bg:var(--ic-chip-action-hover);--chip-pressed-bg:var(--ic-chip-action-pressed);display:flex;padding:calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xxs);font-size:0.875rem;border-radius:var(--ic-space-md);text-align:left;text-decoration:none;position:relative;background-color:var(--chip-bg-color);border:var(--ic-border-width) solid transparent;justify-content:space-between;width:-moz-fit-content;width:fit-content;box-sizing:border-box;max-width:100%}.chip.full-width{width:100%}:host(.ic-chip-full-width){width:100%}@media (prefers-reduced-motion: no-preference){.chip{transition:var(--ic-easing-transition-fast)}}.chip.small{padding:var(--ic-space-xxxs) var(--ic-space-xs);border-radius:calc(var(--ic-space-md) - var(--ic-space-xxxs))}.chip.medium{padding:calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xs);border-radius:var(--ic-space-md)}.chip.large{padding:calc(var(--ic-space-xs) - var(--ic-space-1px)) var(--ic-space-xs);border-radius:calc(var(--ic-space-md) + var(--ic-space-xxs))}.label.small{padding:0 var(--ic-space-xxs)}.label.medium{padding:0 calc(var(--ic-space-xs) - var(--ic-space-xxxs))}.label.large{padding:0 var(--ic-space-xs)}.chip:focus-within{box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);z-index:1}ic-tooltip:focus-within{z-index:1}.filled{--chip-bg-color:var(\n --chip-custom-color,\n var(--ic-chip-background-filled-default)\n );--ic-typography-color:var(\n --chip-custom-foreground-color,\n var(--ic-chip-label)\n );color:var(--chip-custom-foreground-color, var(--ic-chip-label))}.filled.disabled{--chip-bg-color:var(--ic-chip-background-filled-inactive)}:host(.ic-chip-dark-text){--chip-custom-foreground-color:var(--ic-architectural-black)}:host(.ic-chip-light-text){--chip-custom-foreground-color:var(--ic-architectural-white)}:host(.ic-chip-dark-text) .chip.filled.hovered:not(:focus-within){--chip-hover-bg:var(--ic-action-dark-bg-hover)}:host(.ic-chip-dark-text) .chip.filled:focus-within{--chip-pressed-bg:var(--ic-action-dark-bg-pressed)}:host(.ic-chip-light-text) .chip.filled.hovered:not(:focus-within){--chip-hover-bg:var(--ic-action-light-bg-hover)}:host(.ic-chip-light-text) .chip.filled:focus-within{--chip-pressed-bg:var(--ic-action-light-bg-pressed)}.outlined{color:var(--ic-chip-outline-label);border-color:var(--chip-custom-color, var(--ic-chip-outline));padding:calc(var(--ic-space-xxs));--ic-typography-color:var(--ic-chip-outline-label)}.outlined.disabled{border:var(--ic-border-disabled);border-color:var(--ic-chip-outline-inactive)}.chip.disabled ic-typography{--ic-typography-color:var(--ic-chip-label-inactive)}.dismiss-icon{border:none;border-radius:50%;padding:0;color:currentcolor;background:none;cursor:pointer;margin:var(--ic-space-xxxs);height:calc(var(--ic-space-lg) - var(--ic-space-xxs));width:calc(var(--ic-space-lg) - var(--ic-space-xxs))}.dismiss-icon:focus{outline:var(--ic-hc-focus-outline)}.dismiss-icon[disabled]{pointer-events:none;color:var(--ic-chip-icon-inactive)}.icon{padding:var(--ic-space-xxxs);box-sizing:border-box}.icon,ic-tooltip{height:var(--ic-space-lg)}.chip.disabled path,.chip.disabled ::slotted(svg){fill:var(--ic-chip-icon-inactive)}.outlined.non-transparent{background-color:var(--ic-chip-outline-background)}:host .chip.hovered:not(:focus-within){background-image:linear-gradient(var(--chip-hover-bg) 0 0)}:host .chip:focus-within{background-image:linear-gradient(var(--chip-pressed-bg) 0 0)}.sr-only{position:absolute;left:-9999px}.sr-only:dir(rtl){right:-9999px}@media (forced-colors: active){.chip{border:var(--ic-border-hc)}.chip.disabled{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-color:GrayText}.chip.disabled ic-typography{--ic-typography-color:GrayText}.chip.disabled path,.chip.disabled ::slotted(svg){fill:GrayText}.chip:focus-within{outline:none;border-color:Highlight}}";
12
+ const IcChipStyle0 = icChipCss;
13
+
14
+ const Chip = /*@__PURE__*/ proxyCustomElement(class Chip extends HTMLElement {
15
+ constructor() {
16
+ super();
17
+ this.__registerHost();
18
+ this.__attachShadow();
19
+ this.icDismiss = createEvent(this, "icDismiss", 7);
20
+ this.foregroundColor = null;
21
+ this.hovered = false;
22
+ this.visible = true;
23
+ /**
24
+ * If `true`, the chip will appear disabled.
25
+ */
26
+ this.disabled = false;
27
+ /**
28
+ * If `true`, the chip will have a close button at the end to dismiss it.
29
+ */
30
+ this.dismissible = false;
31
+ /**
32
+ * The text in the dismiss button tooltip and aria label. Makes the user aware of the action resulting from clicking the 'Dismiss chip' button.
33
+ */
34
+ this.dismissLabel = "Dismiss";
35
+ /**
36
+ * Specify whether the chip fills the full width of the container.
37
+ * If `true`, this overrides the --input-width CSS variable.
38
+ */
39
+ this.fullWidth = false;
40
+ /**
41
+ * The size of the chip.
42
+ */
43
+ this.size = "medium";
44
+ /**
45
+ * Sets the chip to the dark or light theme colors. "inherit" will set the color based on the system settings or ic-theme component.
46
+ * Setting the "customColor" prop will override this.
47
+ */
48
+ this.theme = "inherit";
49
+ /**
50
+ * If `true`, the outlined variant of chip will have a transparent background rather than the theme defined color.
51
+ */
52
+ this.transparentBackground = true;
53
+ /**
54
+ * The emphasis of the chip.
55
+ */
56
+ this.variant = "filled";
57
+ this.dismissAction = () => {
58
+ this.icDismiss.emit();
59
+ };
60
+ this.mouseEnterHandler = () => {
61
+ this.hovered = true;
62
+ };
63
+ this.mouseLeaveHandler = () => {
64
+ this.hovered = false;
65
+ };
66
+ }
67
+ customColorHandler() {
68
+ const colorRGBA = this.customColor && convertToRGBA(this.customColor);
69
+ if (!colorRGBA) {
70
+ this.foregroundColor = null;
71
+ return;
72
+ }
73
+ const { r, g, b, a } = colorRGBA;
74
+ this.foregroundColor = getBrandForegroundAppearance((r * 299 + g * 587 + b * 114) / 1000);
75
+ this.el.setAttribute("style", `--chip-custom-color: rgba(${r}, ${g}, ${b}, ${a});`);
76
+ }
77
+ watchDisabledHandler() {
78
+ removeDisabledFalse(this.disabled, this.el);
79
+ }
80
+ disconnectedCallback() {
81
+ var _a;
82
+ (_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
83
+ }
84
+ componentWillLoad() {
85
+ removeDisabledFalse(this.disabled, this.el);
86
+ this.customColorHandler();
87
+ }
88
+ componentDidLoad() {
89
+ onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Chip");
90
+ this.hostMutationObserver = new MutationObserver((mutationList) => renderDynamicChildSlots(mutationList, ["icon", "badge"], this));
91
+ this.hostMutationObserver.observe(this.el, {
92
+ childList: true,
93
+ });
94
+ }
95
+ handleClick() {
96
+ this.visible = !this.visible;
97
+ }
98
+ /**
99
+ * Sets focus on the chip.
100
+ */
101
+ async setFocus() {
102
+ var _a;
103
+ (_a = this.buttonEl) === null || _a === void 0 ? void 0 : _a.focus();
104
+ }
105
+ render() {
106
+ const { label, variant, size, dismissible, visible, disabled, hovered, theme, foregroundColor, dismissLabel, transparentBackground, fullWidth, } = this;
107
+ const ariaLabel = `${label} chip`;
108
+ return (h(Host, { key: 'a340090512aafa664e16a6537cb7d8dc2fe84b29', class: {
109
+ "ic-chip-dismissed": !visible,
110
+ [`ic-theme-${theme}`]: theme !== "inherit",
111
+ [`ic-chip-${foregroundColor}-text`]: variant === "filled" && !!foregroundColor,
112
+ "ic-chip-full-width": fullWidth,
113
+ } }, visible && (h("div", { key: '174e895e50479492d85f8a2d9871450f37d47997', class: {
114
+ chip: true,
115
+ [`${variant}`]: true,
116
+ [`${size}`]: true,
117
+ disabled,
118
+ dismissible,
119
+ hovered,
120
+ "non-transparent": variant === "outlined" && !transparentBackground,
121
+ "full-width": fullWidth,
122
+ } }, isSlotUsed(this.el, "icon") && (h("div", { key: '3d12f1e7c932cd91f0835f3fe7c76ec6784bc44f', class: "icon" }, h("slot", { key: '5307ba63af7c7342cf32072ccebf02788265e0f5', name: "icon" }))), h("ic-typography", { key: 'e30c971835f38594a238e36d849fd1625aeb4e38', variant: "label", "apply-vertical-margins": false, class: {
123
+ label: true,
124
+ [`${size}`]: true,
125
+ "in-ag-grid": isElInAGGrid(this.el),
126
+ } }, h("span", { key: '40f476a368fbb16cee45b53c7de24d85b94a21a7' }, label)), dismissible && (h("ic-tooltip", { key: 'd8ff86e2c616f8233104b364bb8f698473c3448a', label: dismissLabel, target: "dismiss-icon", class: { "tooltip-disabled": disabled } }, h("button", { key: '290db0fd020cc7114403e9c6145c1cc454537476', id: "dismiss-icon", class: "dismiss-icon", ref: (el) => (this.buttonEl = el), "aria-label": `${dismissLabel} ${ariaLabel}`, disabled: disabled, tabindex: disabled ? -1 : 0, onClick: this.dismissAction, onMouseEnter: this.mouseEnterHandler, onMouseLeave: this.mouseLeaveHandler, innerHTML: dismissIcon }))), isSlotUsed(this.el, "badge") && h("slot", { key: 'd4f25acf6b19a63c9683d6aac41a04319cbea203', name: "badge" }))), dismissible && (h("div", { key: '6f5d1ad6395e82d3ec7cd588aa3944922e7a13de', class: "sr-only", "aria-live": "polite" }, !visible ? `Dismissed ${ariaLabel}` : ""))));
127
+ }
128
+ static get delegatesFocus() { return true; }
129
+ get el() { return this; }
130
+ static get watchers() { return {
131
+ "customColor": ["customColorHandler"],
132
+ "disabled": ["watchDisabledHandler"]
133
+ }; }
134
+ static get style() { return IcChipStyle0; }
135
+ }, [17, "ic-chip", {
136
+ "customColor": [1, "custom-color"],
137
+ "disabled": [4],
138
+ "dismissible": [4],
139
+ "dismissLabel": [1, "dismiss-label"],
140
+ "fullWidth": [4, "full-width"],
141
+ "label": [1],
142
+ "size": [1],
143
+ "theme": [1],
144
+ "transparentBackground": [4, "transparent-background"],
145
+ "variant": [1],
146
+ "foregroundColor": [32],
147
+ "hovered": [32],
148
+ "visible": [32],
149
+ "setFocus": [64]
150
+ }, [[2, "icDismiss", "handleClick"]], {
151
+ "customColor": ["customColorHandler"],
152
+ "disabled": ["watchDisabledHandler"]
153
+ }]);
154
+ function defineCustomElement$1() {
155
+ if (typeof customElements === "undefined") {
156
+ return;
157
+ }
158
+ const components = ["ic-chip", "ic-tooltip", "ic-typography"];
159
+ components.forEach(tagName => { switch (tagName) {
160
+ case "ic-chip":
161
+ if (!customElements.get(tagName)) {
162
+ customElements.define(tagName, Chip);
163
+ }
164
+ break;
165
+ case "ic-tooltip":
166
+ if (!customElements.get(tagName)) {
167
+ defineCustomElement$3();
168
+ }
169
+ break;
170
+ case "ic-typography":
171
+ if (!customElements.get(tagName)) {
172
+ defineCustomElement$2();
173
+ }
174
+ break;
175
+ } });
176
+ }
177
+
178
+ const IcChip = Chip;
179
+ const defineCustomElement = defineCustomElement$1;
180
+
181
+ export { IcChip, defineCustomElement };
182
+
183
+ //# sourceMappingURL=ic-chip.js.map
@@ -0,0 +1 @@
1
+ {"file":"ic-chip.js","mappings":";;;;;;;;;;AAAA,MAAM,SAAS,GAAG,gzMAAgzM,CAAC;AACn0M,qBAAe,SAAS;;MCyCX,IAAI;IAPjB;;;;;QAaW,oBAAe,GAAsC,IAAI,CAAC;QAC1D,YAAO,GAAG,KAAK,CAAC;QAChB,YAAO,GAAG,IAAI,CAAC;;;;QA4BhB,aAAQ,GAAG,KAAK,CAAC;;;;QASjB,gBAAW,GAAG,KAAK,CAAC;;;;QAKpB,iBAAY,GAAG,SAAS,CAAC;;;;;QAMzB,cAAS,GAAG,KAAK,CAAC;;;;QAUlB,SAAI,GAAY,QAAQ,CAAC;;;;;QAKzB,UAAK,GAAgB,SAAS,CAAC;;;;QAK/B,0BAAqB,GAAG,IAAI,CAAC;;;;QAK7B,YAAO,GAAmB,QAAQ,CAAC;QA2CnC,kBAAa,GAAG;YACtB,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;SACvB,CAAC;QAEM,sBAAiB,GAAG;YAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;SACrB,CAAC;QAEM,sBAAiB,GAAG;YAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACtB,CAAC;KA2FH;IAjNC,kBAAkB;QAChB,MAAM,SAAS,GAAG,IAAI,CAAC,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,KAAK,CAAQ,CACN,EACf,WAAW,KACV,mEACE,KAAK,EAAE,YAAY,EACnB,MAAM,EAAC,cAAc,EACrB,KAAK,EAAE,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAEvC,+DACE,EAAE,EAAC,cAAc,EACjB,KAAK,EAAC,cAAc,EACpB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,gBACrB,GAAG,YAAY,IAAI,SAAS,EAAE,EAC1C,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,EAC3B,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,YAAY,EAAE,IAAI,CAAC,iBAAiB,EACpC,YAAY,EAAE,IAAI,CAAC,iBAAiB,EACpC,SAAS,EAAE,WAAW,GACd,CACC,CACd,EACA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,6DAAM,IAAI,EAAC,OAAO,GAAQ,CACvD,CACP,EACA,WAAW,KACV,4DAAK,KAAK,EAAC,SAAS,eAAW,QAAQ,IACpC,CAAC,OAAO,GAAG,aAAa,SAAS,EAAE,GAAG,EAAE,CACrC,CACP,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/ic-chip/ic-chip.css?tag=ic-chip&encapsulation=shadow","src/components/ic-chip/ic-chip.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: inline-block;\n max-width: 100%;\n vertical-align: middle;\n}\n\n:host(.ic-chip-dismissed) {\n display: none;\n}\n\n.chip {\n --chip-bg-color: transparent;\n --chip-hover-bg: var(--ic-chip-action-hover);\n --chip-pressed-bg: var(--ic-chip-action-pressed);\n\n display: flex;\n padding: calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xxs);\n font-size: 0.875rem;\n border-radius: var(--ic-space-md);\n text-align: left;\n text-decoration: none;\n position: relative;\n background-color: var(--chip-bg-color);\n border: var(--ic-border-width) solid transparent;\n justify-content: space-between;\n width: fit-content;\n box-sizing: border-box;\n max-width: 100%;\n}\n\n.chip.full-width {\n width: 100%;\n}\n\n:host(.ic-chip-full-width) {\n width: 100%;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n .chip {\n transition: var(--ic-easing-transition-fast);\n }\n}\n\n.chip.small {\n padding: var(--ic-space-xxxs) var(--ic-space-xs);\n border-radius: calc(var(--ic-space-md) - var(--ic-space-xxxs));\n}\n\n.chip.medium {\n padding: calc(var(--ic-space-xxs) - var(--ic-space-1px)) var(--ic-space-xs);\n border-radius: var(--ic-space-md);\n}\n\n.chip.large {\n padding: calc(var(--ic-space-xs) - var(--ic-space-1px)) var(--ic-space-xs);\n border-radius: calc(var(--ic-space-md) + var(--ic-space-xxs));\n}\n\n.label.small {\n padding: 0 var(--ic-space-xxs);\n}\n\n.label.medium {\n padding: 0 calc(var(--ic-space-xs) - var(--ic-space-xxxs));\n}\n\n.label.large {\n padding: 0 var(--ic-space-xs);\n}\n\n.chip:focus-within {\n box-shadow: var(--ic-border-focus);\n outline: var(--ic-hc-focus-outline);\n z-index: 1;\n}\n\nic-tooltip:focus-within {\n z-index: 1;\n}\n\n.filled {\n --chip-bg-color: var(\n --chip-custom-color,\n var(--ic-chip-background-filled-default)\n );\n --ic-typography-color: var(\n --chip-custom-foreground-color,\n var(--ic-chip-label)\n );\n\n color: var(--chip-custom-foreground-color, var(--ic-chip-label));\n}\n\n.filled.disabled {\n --chip-bg-color: var(--ic-chip-background-filled-inactive);\n}\n\n:host(.ic-chip-dark-text) {\n --chip-custom-foreground-color: var(--ic-architectural-black);\n}\n\n:host(.ic-chip-light-text) {\n --chip-custom-foreground-color: var(--ic-architectural-white);\n}\n\n:host(.ic-chip-dark-text) .chip.filled.hovered:not(:focus-within) {\n --chip-hover-bg: var(--ic-action-dark-bg-hover);\n}\n\n:host(.ic-chip-dark-text) .chip.filled:focus-within {\n --chip-pressed-bg: var(--ic-action-dark-bg-pressed);\n}\n\n:host(.ic-chip-light-text) .chip.filled.hovered:not(:focus-within) {\n --chip-hover-bg: var(--ic-action-light-bg-hover);\n}\n\n:host(.ic-chip-light-text) .chip.filled:focus-within {\n --chip-pressed-bg: var(--ic-action-light-bg-pressed);\n}\n\n.outlined {\n color: var(--ic-chip-outline-label);\n border-color: var(--chip-custom-color, var(--ic-chip-outline));\n padding: calc(var(--ic-space-xxs));\n\n --ic-typography-color: var(--ic-chip-outline-label);\n}\n\n.outlined.disabled {\n border: var(--ic-border-disabled);\n border-color: var(--ic-chip-outline-inactive);\n}\n\n.chip.disabled ic-typography {\n --ic-typography-color: var(--ic-chip-label-inactive);\n}\n\n.dismiss-icon {\n border: none;\n border-radius: 50%;\n padding: 0;\n color: currentcolor;\n background: none;\n cursor: pointer;\n margin: var(--ic-space-xxxs);\n height: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n width: calc(var(--ic-space-lg) - var(--ic-space-xxs));\n}\n\n.dismiss-icon:focus {\n outline: var(--ic-hc-focus-outline);\n}\n\n.dismiss-icon[disabled] {\n pointer-events: none;\n color: var(--ic-chip-icon-inactive);\n}\n\n.icon {\n padding: var(--ic-space-xxxs);\n box-sizing: border-box;\n}\n\n.icon,\nic-tooltip {\n height: var(--ic-space-lg);\n}\n\n.chip.disabled path,\n.chip.disabled ::slotted(svg) {\n fill: var(--ic-chip-icon-inactive);\n}\n\n.outlined.non-transparent {\n background-color: var(--ic-chip-outline-background);\n}\n\n:host .chip.hovered:not(:focus-within) {\n background-image: linear-gradient(var(--chip-hover-bg) 0 0);\n}\n\n:host .chip:focus-within {\n background-image: linear-gradient(var(--chip-pressed-bg) 0 0);\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.sr-only:dir(rtl) {\n right: -9999px;\n}\n\n@media (forced-colors: active) {\n .chip {\n border: var(--ic-border-hc);\n }\n\n .chip.disabled {\n appearance: none;\n border-color: GrayText;\n }\n\n .chip.disabled ic-typography {\n --ic-typography-color: GrayText;\n }\n\n .chip.disabled path,\n .chip.disabled ::slotted(svg) {\n fill: GrayText;\n }\n\n .chip:focus-within {\n outline: none;\n border-color: Highlight;\n }\n}\n","import {\n Component,\n h,\n Prop,\n State,\n Listen,\n Event,\n EventEmitter,\n Element,\n Method,\n Watch,\n Host,\n} from \"@stencil/core\";\nimport {\n onComponentRequiredPropUndefined,\n isSlotUsed,\n removeDisabledFalse,\n convertToRGBA,\n isElInAGGrid,\n getBrandForegroundAppearance,\n renderDynamicChildSlots,\n} from \"../../utils/helpers\";\nimport {\n IcBrandForegroundNoDefault,\n IcColor,\n IcEmphasisType,\n IcSizes,\n IcThemeMode,\n} from \"../../utils/types\";\nimport dismissIcon from \"../../assets/dismiss-icon.svg\";\n\n/**\n * @slot icon - Content will be rendered at the start of the chip.\n * @slot badge - Badge component overlaying the top right of the chip.\n */\n@Component({\n tag: \"ic-chip\",\n styleUrl: \"ic-chip.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Chip {\n private buttonEl?: HTMLButtonElement;\n private hostMutationObserver?: MutationObserver;\n\n @Element() el: HTMLIcChipElement;\n\n @State() foregroundColor: IcBrandForegroundNoDefault | null = null;\n @State() hovered = false;\n @State() visible = true;\n\n /**\n * The custom chip colour. This will override the theme colour.\n * Can be a hex value e.g. \"#ff0000\", RGB e.g. \"rgb(255, 0, 0)\", or RGBA e.g. \"rgba(255, 0, 0, 1)\".\n */\n @Prop() customColor?: IcColor;\n @Watch(\"customColor\")\n customColorHandler(): void {\n const colorRGBA = this.customColor && convertToRGBA(this.customColor);\n if (!colorRGBA) {\n this.foregroundColor = null;\n return;\n }\n\n const { r, g, b, a } = colorRGBA;\n this.foregroundColor = getBrandForegroundAppearance(\n (r * 299 + g * 587 + b * 114) / 1000\n );\n this.el.setAttribute(\n \"style\",\n `--chip-custom-color: rgba(${r}, ${g}, ${b}, ${a});`\n );\n }\n\n /**\n * If `true`, the chip will appear disabled.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the chip will have a close button at the end to dismiss it.\n */\n @Prop() dismissible = false;\n\n /**\n * The text in the dismiss button tooltip and aria label. Makes the user aware of the action resulting from clicking the 'Dismiss chip' button.\n */\n @Prop() dismissLabel = \"Dismiss\";\n\n /**\n * Specify whether the chip fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth = false;\n\n /**\n * The text rendered within the chip.\n */\n @Prop() label!: string;\n\n /**\n * The size of the chip.\n */\n @Prop() size: IcSizes = \"medium\";\n /**\n * Sets the chip to the dark or light theme colors. \"inherit\" will set the color based on the system settings or ic-theme component.\n * Setting the \"customColor\" prop will override this.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * If `true`, the outlined variant of chip will have a transparent background rather than the theme defined color.\n */\n @Prop() transparentBackground = true;\n\n /**\n * The emphasis of the chip.\n */\n @Prop() variant: IcEmphasisType = \"filled\";\n\n /**\n * Is emitted when the user dismisses the chip.\n */\n @Event() icDismiss: EventEmitter<void>;\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n removeDisabledFalse(this.disabled, this.el);\n this.customColorHandler();\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Chip\"\n );\n\n this.hostMutationObserver = new MutationObserver((mutationList) =>\n renderDynamicChildSlots(mutationList, [\"icon\", \"badge\"], this)\n );\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n @Listen(\"icDismiss\", { capture: true })\n handleClick(): void {\n this.visible = !this.visible;\n }\n\n /**\n * Sets focus on the chip.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.buttonEl?.focus();\n }\n\n private dismissAction = () => {\n this.icDismiss.emit();\n };\n\n private mouseEnterHandler = () => {\n this.hovered = true;\n };\n\n private mouseLeaveHandler = () => {\n this.hovered = false;\n };\n\n render() {\n const {\n label,\n variant,\n size,\n dismissible,\n visible,\n disabled,\n hovered,\n theme,\n foregroundColor,\n dismissLabel,\n transparentBackground,\n fullWidth,\n } = this;\n\n const ariaLabel = `${label} chip`;\n\n return (\n <Host\n class={{\n \"ic-chip-dismissed\": !visible,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n [`ic-chip-${foregroundColor}-text`]:\n variant === \"filled\" && !!foregroundColor,\n \"ic-chip-full-width\": fullWidth,\n }}\n >\n {visible && (\n <div\n class={{\n chip: true,\n [`${variant}`]: true,\n [`${size}`]: true,\n disabled,\n dismissible,\n hovered,\n \"non-transparent\":\n variant === \"outlined\" && !transparentBackground,\n \"full-width\": fullWidth,\n }}\n >\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography\n variant=\"label\"\n apply-vertical-margins={false}\n class={{\n label: true,\n [`${size}`]: true,\n \"in-ag-grid\": isElInAGGrid(this.el),\n }}\n >\n <span>{label}</span>\n </ic-typography>\n {dismissible && (\n <ic-tooltip\n label={dismissLabel}\n target=\"dismiss-icon\"\n class={{ \"tooltip-disabled\": disabled }}\n >\n <button\n id=\"dismiss-icon\"\n class=\"dismiss-icon\"\n ref={(el) => (this.buttonEl = el)}\n aria-label={`${dismissLabel} ${ariaLabel}`}\n disabled={disabled}\n tabindex={disabled ? -1 : 0}\n onClick={this.dismissAction}\n onMouseEnter={this.mouseEnterHandler}\n onMouseLeave={this.mouseLeaveHandler}\n innerHTML={dismissIcon}\n ></button>\n </ic-tooltip>\n )}\n {isSlotUsed(this.el, \"badge\") && <slot name=\"badge\"></slot>}\n </div>\n )}\n {dismissible && (\n <div class=\"sr-only\" aria-live=\"polite\">\n {!visible ? `Dismissed ${ariaLabel}` : \"\"}\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface IcClassificationBanner extends Components.IcClassificationBanner, HTMLElement {}
4
+ export const IcClassificationBanner: {
5
+ prototype: IcClassificationBanner;
6
+ new (): IcClassificationBanner;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,102 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './ic-typography2.js';
3
+
4
+ const icClassificationBannerCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{position:fixed;left:0;bottom:0;width:100%;height:var(--ic-space-lg);z-index:var(--ic-z-index-classification-banner);--ic-typography-color:currentcolor}:host(.ic-classification-banner-inline){position:static;left:auto;bottom:auto}.classification-banner{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:var(--ic-space-xxxs) var(--ic-space-md)}.default{background-color:var(--ic-classification-banner-not-set);color:var(--ic-classification-banner-text-inverted)}.official{background-color:var(--ic-classification-banner-official);color:var(--ic-classification-banner-text-inverted)}.official-sensitive{background-color:var(--ic-classification-banner-official-sensitive);color:var(--ic-classification-banner-text-inverted)}.secret{background-color:var(--ic-classification-banner-secret);color:var(--ic-classification-banner-text)}.top-secret{background-color:var(--ic-classification-banner-top-secret);color:var(--ic-classification-banner-text-inverted)}.offscreen{position:absolute;left:-9999px;background-color:#fff;color:#000;text-transform:none}.offscreen:dir(rtl){right:-9999px}@media (forced-colors: active){.classification-banner{border:var(--ic-border-hc)}}";
5
+ const IcClassificationBannerStyle0 = icClassificationBannerCss;
6
+
7
+ const classificationText = {
8
+ default: "protective marking not set",
9
+ official: "official",
10
+ "official-sensitive": "official-sensitive",
11
+ secret: "secret",
12
+ "top-secret": "top secret",
13
+ };
14
+ const ClassificationBanner = /*@__PURE__*/ proxyCustomElement(class ClassificationBanner extends HTMLElement {
15
+ constructor() {
16
+ super();
17
+ this.__registerHost();
18
+ this.__attachShadow();
19
+ /**
20
+ * The additional information that will be displayed after the classification.
21
+ */
22
+ this.additionalSelectors = "";
23
+ /**
24
+ * The classification level to be displayed - also determines the banner and text colour.
25
+ */
26
+ this.classification = "default";
27
+ /**
28
+ * The optional text that will be displayed before classification to specify relevant country/countries.
29
+ */
30
+ this.country = "uk";
31
+ /**
32
+ * The custom text that will appear on the banner. If set, the `additionalSelectors`, `country` and `upTo` props are ignored.
33
+ */
34
+ this.customClassificationText = "";
35
+ /**
36
+ * If `true`, the banner will appear inline with the page, instead of sticking to the bottom of the page.
37
+ */
38
+ this.inline = false;
39
+ /**
40
+ * If `true`, "Up to" will be displayed before the classification and country.
41
+ */
42
+ this.upTo = false;
43
+ }
44
+ render() {
45
+ const { inline, upTo } = this;
46
+ // In case of unrecognized props, fallback to default
47
+ let { country, additionalSelectors, classification, customClassificationText, } = this;
48
+ if (!country)
49
+ country = "";
50
+ if (!additionalSelectors)
51
+ additionalSelectors = "";
52
+ if (!classification ||
53
+ (classification && !classificationText[classification]))
54
+ classification = "default";
55
+ if (!customClassificationText)
56
+ customClassificationText = "";
57
+ return (h(Host, { key: 'dbf7b4fe92229fd32723c06070338a3611939bd5', class: { ["ic-classification-banner-inline"]: !!inline } }, h("banner", { key: '23e95a6a2ca33447e1b64cda93690cf6781bd14f', "aria-label": "Protective marking", class: {
58
+ ["classification-banner"]: true,
59
+ [`${classification}`]: classification,
60
+ } }, classification !== "default" ? (h("span", { class: "offscreen" }, "The protective marking of this page is:", " ")) : null, h("ic-typography", { key: 'ff41a45d594eeeffe2f078b3ae3a99792a6f38c3', variant: "caption-uppercase" }, customClassificationText !== ""
61
+ ? customClassificationText
62
+ : classification === "default"
63
+ ? classificationText[classification]
64
+ : `${upTo ? "up to" : ""}
65
+ ${country}
66
+ ${classificationText[classification]}
67
+ ${additionalSelectors}`))));
68
+ }
69
+ static get style() { return IcClassificationBannerStyle0; }
70
+ }, [1, "ic-classification-banner", {
71
+ "additionalSelectors": [1, "additional-selectors"],
72
+ "classification": [1],
73
+ "country": [1],
74
+ "customClassificationText": [1, "custom-classification-text"],
75
+ "inline": [4],
76
+ "upTo": [4, "up-to"]
77
+ }]);
78
+ function defineCustomElement$1() {
79
+ if (typeof customElements === "undefined") {
80
+ return;
81
+ }
82
+ const components = ["ic-classification-banner", "ic-typography"];
83
+ components.forEach(tagName => { switch (tagName) {
84
+ case "ic-classification-banner":
85
+ if (!customElements.get(tagName)) {
86
+ customElements.define(tagName, ClassificationBanner);
87
+ }
88
+ break;
89
+ case "ic-typography":
90
+ if (!customElements.get(tagName)) {
91
+ defineCustomElement$2();
92
+ }
93
+ break;
94
+ } });
95
+ }
96
+
97
+ const IcClassificationBanner = ClassificationBanner;
98
+ const defineCustomElement = defineCustomElement$1;
99
+
100
+ export { IcClassificationBanner, defineCustomElement };
101
+
102
+ //# sourceMappingURL=ic-classification-banner.js.map