@gov-design-system-ce/components 4.1.0-rc04 → 4.1.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 (830) hide show
  1. package/dist/cjs/{colors-976f6dff.js → colors-f7c8eadd.js} +7 -9
  2. package/dist/cjs/colors-f7c8eadd.js.map +1 -0
  3. package/dist/cjs/{constants-e2807da6.js → constants-49f0efa6.js} +2 -2
  4. package/dist/cjs/{constants-e2807da6.js.map → constants-49f0efa6.js.map} +1 -1
  5. package/dist/cjs/{constants-43c0c51b.js → constants-4dfa23e3.js} +2 -2
  6. package/dist/cjs/{constants-43c0c51b.js.map → constants-4dfa23e3.js.map} +1 -1
  7. package/dist/cjs/{constants-441d1af4.js → constants-82929d01.js} +2 -2
  8. package/dist/cjs/{constants-441d1af4.js.map → constants-82929d01.js.map} +1 -1
  9. package/dist/cjs/{constants-bd0d66ac.js → constants-b9fece07.js} +2 -2
  10. package/dist/cjs/{constants-bd0d66ac.js.map → constants-b9fece07.js.map} +1 -1
  11. package/dist/cjs/{constants-5037cdc9.js → constants-c0886404.js} +2 -2
  12. package/dist/cjs/{constants-5037cdc9.js.map → constants-c0886404.js.map} +1 -1
  13. package/dist/cjs/{constants-861428a4.js → constants-f464dc4c.js} +2 -2
  14. package/dist/cjs/{constants-861428a4.js.map → constants-f464dc4c.js.map} +1 -1
  15. package/dist/cjs/core.cjs.js +1 -1
  16. package/dist/cjs/{form-c1aec07a.js → form-4e66039a.js} +4 -3
  17. package/dist/cjs/form-4e66039a.js.map +1 -0
  18. package/dist/cjs/gov-accordion-item.cjs.entry.js +4 -5
  19. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-accordion.cjs.entry.js +3 -4
  21. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-attachments_3.cjs.entry.js +11 -12
  23. package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-backdrop.cjs.entry.js +4 -5
  25. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +5 -6
  27. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-button.cjs.entry.js +10 -11
  29. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  30. package/dist/cjs/gov-card.cjs.entry.js +5 -6
  31. package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
  32. package/dist/cjs/gov-chip.cjs.entry.js +11 -12
  33. package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
  34. package/dist/cjs/gov-container.cjs.entry.js +2 -10
  35. package/dist/cjs/gov-container.cjs.entry.js.map +1 -1
  36. package/dist/cjs/gov-control-group.cjs.entry.js +4 -5
  37. package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  39. package/dist/cjs/gov-dialog.cjs.entry.js +5 -6
  40. package/dist/cjs/gov-dialog.cjs.entry.js.map +1 -1
  41. package/dist/cjs/gov-dropdown.cjs.entry.js +3 -3
  42. package/dist/cjs/gov-empty.cjs.entry.js +3 -4
  43. package/dist/cjs/gov-empty.cjs.entry.js.map +1 -1
  44. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  45. package/dist/cjs/gov-flex_4.cjs.entry.js +322 -0
  46. package/dist/cjs/gov-flex_4.cjs.entry.js.map +1 -0
  47. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +4 -6
  48. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  49. package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +5 -6
  50. package/dist/cjs/gov-form-checkbox-group.cjs.entry.js.map +1 -1
  51. package/dist/cjs/gov-form-checkbox.cjs.entry.js +7 -8
  52. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  53. package/dist/cjs/gov-form-control.cjs.entry.js +5 -5
  54. package/dist/cjs/gov-form-file.cjs.entry.js +5 -6
  55. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  56. package/dist/cjs/gov-form-group.cjs.entry.js +4 -5
  57. package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
  58. package/dist/cjs/gov-form-input_2.cjs.entry.js +12 -11
  59. package/dist/cjs/gov-form-input_2.cjs.entry.js.map +1 -1
  60. package/dist/cjs/gov-form-multi-select.cjs.entry.js +9 -10
  61. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  62. package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
  63. package/dist/cjs/gov-form-radio-group.cjs.entry.js +5 -6
  64. package/dist/cjs/gov-form-radio-group.cjs.entry.js.map +1 -1
  65. package/dist/cjs/gov-form-radio.cjs.entry.js +6 -7
  66. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  67. package/dist/cjs/gov-form-search.cjs.entry.js +2 -2
  68. package/dist/cjs/gov-form-select.cjs.entry.js +8 -9
  69. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  70. package/dist/cjs/gov-form-switch.cjs.entry.js +7 -8
  71. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  72. package/dist/cjs/gov-grid-item.cjs.entry.js +2 -2
  73. package/dist/cjs/gov-grid.cjs.entry.js +2 -2
  74. package/dist/cjs/gov-infobar.cjs.entry.js +6 -7
  75. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  76. package/dist/cjs/gov-layout-column.cjs.entry.js +2 -2
  77. package/dist/cjs/gov-layout.cjs.entry.js +2 -2
  78. package/dist/cjs/gov-lifecycle.cjs.entry.js +1 -1
  79. package/dist/cjs/gov-link.cjs.entry.js +51 -0
  80. package/dist/cjs/gov-link.cjs.entry.js.map +1 -0
  81. package/dist/cjs/gov-loading.cjs.entry.js +4 -5
  82. package/dist/cjs/gov-loading.cjs.entry.js.map +1 -1
  83. package/dist/cjs/gov-message.cjs.entry.js +5 -6
  84. package/dist/cjs/gov-message.cjs.entry.js.map +1 -1
  85. package/dist/cjs/gov-pagination.cjs.entry.js +5 -6
  86. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  87. package/dist/cjs/gov-spacer.cjs.entry.js +4 -5
  88. package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
  89. package/dist/cjs/gov-stepper-item.cjs.entry.js +6 -7
  90. package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
  91. package/dist/cjs/gov-stepper.cjs.entry.js +6 -7
  92. package/dist/cjs/gov-stepper.cjs.entry.js.map +1 -1
  93. package/dist/cjs/gov-tabs-item.cjs.entry.js +4 -4
  94. package/dist/cjs/gov-tabs.cjs.entry.js +6 -7
  95. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  96. package/dist/cjs/gov-tag.cjs.entry.js +10 -11
  97. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
  98. package/dist/cjs/gov-tile.cjs.entry.js +2 -2
  99. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  100. package/dist/cjs/gov-tiles.cjs.entry.js +2 -2
  101. package/dist/cjs/gov-toast.cjs.entry.js +6 -6
  102. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  103. package/dist/cjs/gov-tooltip-content.cjs.entry.js +4 -4
  104. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  105. package/dist/cjs/gov-tooltip.cjs.entry.js +10 -11
  106. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  107. package/dist/cjs/gov-wizard-item.cjs.entry.js +8 -9
  108. package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
  109. package/dist/cjs/gov-wizard.cjs.entry.js +8 -9
  110. package/dist/cjs/gov-wizard.cjs.entry.js.map +1 -1
  111. package/dist/cjs/{win-587f4614.js → gov.log-bfea3151.js} +16 -4
  112. package/dist/cjs/gov.log-bfea3151.js.map +1 -0
  113. package/dist/cjs/index-7ff4447c.js +6 -14
  114. package/dist/cjs/loader.cjs.js +1 -1
  115. package/dist/cjs/{props-b8a955b2.js → props-d189860c.js} +2 -2
  116. package/dist/cjs/{props-b8a955b2.js.map → props-d189860c.js.map} +1 -1
  117. package/dist/cjs/{template-b070338f.js → template-39939fd6.js} +1 -20
  118. package/dist/cjs/template-39939fd6.js.map +1 -0
  119. package/dist/cjs/{wcag-b8d80c7d.js → wcag-2927ff73.js} +4 -5
  120. package/dist/cjs/wcag-2927ff73.js.map +1 -0
  121. package/dist/collection/collection-manifest.json +1 -0
  122. package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
  123. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  124. package/dist/collection/components/gov-attachments/gov-attachments-item.css +6 -35
  125. package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
  126. package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
  127. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
  128. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  129. package/dist/collection/components/gov-button/button/gov-button.js +9 -9
  130. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
  131. package/dist/collection/components/gov-card/gov-card.js +1 -1
  132. package/dist/collection/components/gov-card/gov-card.js.map +1 -1
  133. package/dist/collection/components/gov-chip/gov-chip.js +16 -16
  134. package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
  135. package/dist/collection/components/gov-container/gov-container.js +2 -38
  136. package/dist/collection/components/gov-container/gov-container.js.map +1 -1
  137. package/dist/collection/components/gov-dialog/gov-dialog.js +1 -1
  138. package/dist/collection/components/gov-dialog/gov-dialog.js.map +1 -1
  139. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +1 -20
  140. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  141. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +1 -1
  142. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  143. package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
  144. package/dist/collection/components/gov-form/file/gov-form-file.js +1 -20
  145. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  146. package/dist/collection/components/gov-form/group/gov-form-checkbox-group.js +1 -1
  147. package/dist/collection/components/gov-form/group/gov-form-group.css +7 -36
  148. package/dist/collection/components/gov-form/group/gov-form-group.js +1 -1
  149. package/dist/collection/components/gov-form/group/gov-form-radio-group.js +1 -1
  150. package/dist/collection/components/gov-form/input/constants.js +1 -0
  151. package/dist/collection/components/gov-form/input/constants.js.map +1 -1
  152. package/dist/collection/components/gov-form/input/gov-form-input.js +5 -3
  153. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  154. package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
  155. package/dist/collection/components/gov-form/message/gov-form-message.js +1 -1
  156. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +4 -4
  157. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  158. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +1 -1
  159. package/dist/collection/components/gov-form/search/gov-form-search.js +1 -1
  160. package/dist/collection/components/gov-form/select/gov-form-select.js +2 -2
  161. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  162. package/dist/collection/components/gov-form/switch/constants.js +1 -1
  163. package/dist/collection/components/gov-form/switch/constants.js.map +1 -1
  164. package/dist/collection/components/gov-form/switch/gov-form-switch.js +2 -2
  165. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  166. package/dist/collection/components/gov-grid/gov-grid-item.js +1 -1
  167. package/dist/collection/components/gov-grid/gov-grid.js +1 -1
  168. package/dist/collection/components/gov-icon/constants.js +8 -7
  169. package/dist/collection/components/gov-icon/constants.js.map +1 -1
  170. package/dist/collection/components/gov-icon/gov-icon.js +38 -6
  171. package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
  172. package/dist/collection/components/gov-icon/list.js +37 -151
  173. package/dist/collection/components/gov-icon/list.js.map +1 -1
  174. package/dist/collection/components/gov-infobar/gov-infobar.js +2 -2
  175. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
  176. package/dist/collection/components/gov-layout/gov-layout-column.js +1 -1
  177. package/dist/collection/components/gov-layout/gov-layout.js +1 -1
  178. package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js +1 -1
  179. package/dist/collection/components/gov-link/constants.js +7 -0
  180. package/dist/collection/components/gov-link/constants.js.map +1 -0
  181. package/dist/collection/components/gov-link/gov-link.js +129 -0
  182. package/dist/collection/components/gov-link/gov-link.js.map +1 -0
  183. package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
  184. package/dist/collection/components/gov-loading/loading/gov-loading.js.map +1 -1
  185. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +1 -1
  186. package/dist/collection/components/gov-message/gov-message.js +1 -1
  187. package/dist/collection/components/gov-pagination/gov-pagination.js +1 -1
  188. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  189. package/dist/collection/components/gov-spacer/gov-spacer.js +1 -1
  190. package/dist/collection/components/gov-stepper/gov-stepper-item.js +1 -1
  191. package/dist/collection/components/gov-stepper/gov-stepper.js +1 -1
  192. package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -1
  193. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  194. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  195. package/dist/collection/components/gov-tag/gov-tag.js +9 -9
  196. package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
  197. package/dist/collection/components/gov-theme-switch/constants.js +9 -1
  198. package/dist/collection/components/gov-theme-switch/constants.js.map +1 -1
  199. package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +134 -10
  200. package/dist/collection/components/gov-theme-switch/gov-theme-switch.js.map +1 -1
  201. package/dist/collection/components/gov-tile/container/gov-tiles.js +1 -1
  202. package/dist/collection/components/gov-tile/gov-tile.js +7 -7
  203. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  204. package/dist/collection/components/gov-toast/constants.js +1 -0
  205. package/dist/collection/components/gov-toast/constants.js.map +1 -1
  206. package/dist/collection/components/gov-toast/gov-toast.js +1 -1
  207. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  208. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +1 -1
  209. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
  210. package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
  211. package/dist/collection/components/gov-wizard/gov-wizard-item.js +3 -3
  212. package/dist/collection/components/gov-wizard/gov-wizard-item.js.map +1 -1
  213. package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
  214. package/dist/collection/core/constants/colors.js +6 -8
  215. package/dist/collection/core/constants/colors.js.map +1 -1
  216. package/dist/collection/data/color-definitions.js +359 -172
  217. package/dist/collection/helpers/Dom/document.js +28 -0
  218. package/dist/collection/helpers/Dom/document.js.map +1 -0
  219. package/dist/collection/helpers/Dom/template.js +0 -18
  220. package/dist/collection/helpers/Dom/template.js.map +1 -1
  221. package/dist/collection/helpers/Dom/template.types.js.map +1 -1
  222. package/dist/collection/pages/Accordion.js +30 -30
  223. package/dist/collection/pages/Accordion.js.map +1 -1
  224. package/dist/collection/pages/Button.js +383 -383
  225. package/dist/collection/pages/Button.js.map +1 -1
  226. package/dist/collection/pages/Chip.js +53 -53
  227. package/dist/collection/pages/Chip.js.map +1 -1
  228. package/dist/collection/pages/ControlGroup.js +18 -18
  229. package/dist/collection/pages/ControlGroup.js.map +1 -1
  230. package/dist/collection/pages/Dialog.js +1 -1
  231. package/dist/collection/pages/Dialog.js.map +1 -1
  232. package/dist/collection/pages/Forms.js +47 -37
  233. package/dist/collection/pages/Forms.js.map +1 -1
  234. package/dist/collection/pages/Icon.js +10 -0
  235. package/dist/collection/pages/Icon.js.map +1 -1
  236. package/dist/collection/pages/Infobar.js +16 -16
  237. package/dist/collection/pages/Infobar.js.map +1 -1
  238. package/dist/collection/pages/Message.js +20 -20
  239. package/dist/collection/pages/Message.js.map +1 -1
  240. package/dist/collection/pages/Stepper.js +15 -15
  241. package/dist/collection/pages/Stepper.js.map +1 -1
  242. package/dist/collection/pages/Tag.js +23 -23
  243. package/dist/collection/pages/Tag.js.map +1 -1
  244. package/dist/collection/pages/ToastMessage.js +4 -4
  245. package/dist/collection/pages/ToastMessage.js.map +1 -1
  246. package/dist/collection/pages/ToastMessageCountdown.js +4 -4
  247. package/dist/collection/pages/ToastMessageCountdown.js.map +1 -1
  248. package/dist/collection/pages/Tooltip.js +2 -2
  249. package/dist/collection/pages/Tooltip.js.map +1 -1
  250. package/dist/collection/pages/Typography.js +20 -0
  251. package/dist/collection/pages/Typography.js.map +1 -1
  252. package/dist/collection/pages/Wizard.js +1 -1
  253. package/dist/collection/pages/Wizard.js.map +1 -1
  254. package/dist/components/gov-accordion-item.js +1 -1
  255. package/dist/components/gov-accordion-item.js.map +1 -1
  256. package/dist/components/gov-accordion.js +1 -1
  257. package/dist/components/gov-attachments-item.js +1 -1
  258. package/dist/components/gov-attachments.js +1 -1
  259. package/dist/components/gov-backdrop.js +1 -1
  260. package/dist/components/gov-breadcrumbs.js +1 -1
  261. package/dist/components/gov-breadcrumbs.js.map +1 -1
  262. package/dist/components/gov-button.js +1 -1
  263. package/dist/components/gov-card.js +1 -1
  264. package/dist/components/gov-card.js.map +1 -1
  265. package/dist/components/gov-chip.js +1 -1
  266. package/dist/components/gov-container.js +1 -1
  267. package/dist/components/gov-container.js.map +1 -1
  268. package/dist/components/gov-control-group.js +1 -1
  269. package/dist/components/gov-cookiebar.js +1 -1
  270. package/dist/components/gov-dialog.js +1 -1
  271. package/dist/components/gov-dialog.js.map +1 -1
  272. package/dist/components/gov-dropdown.js +1 -1
  273. package/dist/components/gov-empty.js +1 -1
  274. package/dist/components/gov-error-code.js +1 -1
  275. package/dist/components/gov-flex.js +1 -1
  276. package/dist/components/gov-form-autocomplete.js +1 -1
  277. package/dist/components/gov-form-checkbox-group.js +1 -1
  278. package/dist/components/gov-form-checkbox-group.js.map +1 -1
  279. package/dist/components/gov-form-checkbox.js +1 -1
  280. package/dist/components/gov-form-checkbox.js.map +1 -1
  281. package/dist/components/gov-form-control.js +1 -1
  282. package/dist/components/gov-form-file.js +1 -1
  283. package/dist/components/gov-form-file.js.map +1 -1
  284. package/dist/components/gov-form-group.js +1 -1
  285. package/dist/components/gov-form-input.js +1 -1
  286. package/dist/components/gov-form-label.js +1 -1
  287. package/dist/components/gov-form-label.js.map +1 -1
  288. package/dist/components/gov-form-message.js +1 -1
  289. package/dist/components/gov-form-multi-select.js +1 -1
  290. package/dist/components/gov-form-multi-select.js.map +1 -1
  291. package/dist/components/gov-form-password-power.js +1 -1
  292. package/dist/components/gov-form-password-power.js.map +1 -1
  293. package/dist/components/gov-form-radio-group.js +1 -1
  294. package/dist/components/gov-form-radio-group.js.map +1 -1
  295. package/dist/components/gov-form-radio.js +1 -1
  296. package/dist/components/gov-form-radio.js.map +1 -1
  297. package/dist/components/gov-form-search.js +1 -1
  298. package/dist/components/gov-form-select.js +1 -1
  299. package/dist/components/gov-form-switch.js +1 -1
  300. package/dist/components/gov-form-switch.js.map +1 -1
  301. package/dist/components/gov-grid-item.js +1 -1
  302. package/dist/components/gov-grid.js +1 -1
  303. package/dist/components/gov-icon.js +1 -1
  304. package/dist/components/gov-infobar.js +1 -1
  305. package/dist/components/gov-infobar.js.map +1 -1
  306. package/dist/components/gov-layout-column.js +1 -1
  307. package/dist/components/gov-layout.js +1 -1
  308. package/dist/components/gov-lifecycle.js +1 -1
  309. package/dist/components/gov-link.d.ts +11 -0
  310. package/dist/components/gov-link.js +2 -0
  311. package/dist/components/gov-link.js.map +1 -0
  312. package/dist/components/gov-loading.js +1 -1
  313. package/dist/components/gov-loading.js.map +1 -1
  314. package/dist/components/gov-message.js +1 -1
  315. package/dist/components/gov-pagination.js +1 -1
  316. package/dist/components/gov-pagination.js.map +1 -1
  317. package/dist/components/gov-skeleton.js +1 -1
  318. package/dist/components/gov-spacer.js +1 -1
  319. package/dist/components/gov-stepper-item.js +1 -1
  320. package/dist/components/gov-stepper.js +1 -1
  321. package/dist/components/gov-tabs-item.js +1 -1
  322. package/dist/components/gov-tabs.js +1 -1
  323. package/dist/components/gov-tabs.js.map +1 -1
  324. package/dist/components/gov-tag.js +1 -1
  325. package/dist/components/gov-tag.js.map +1 -1
  326. package/dist/components/gov-theme-switch.js +1 -1
  327. package/dist/components/gov-theme-switch.js.map +1 -1
  328. package/dist/components/gov-tile.js +1 -1
  329. package/dist/components/gov-tile.js.map +1 -1
  330. package/dist/components/gov-tiles.js +1 -1
  331. package/dist/components/gov-toast.js +1 -1
  332. package/dist/components/gov-toast.js.map +1 -1
  333. package/dist/components/gov-tooltip-content.js +1 -1
  334. package/dist/components/gov-tooltip-content.js.map +1 -1
  335. package/dist/components/gov-tooltip.js +1 -1
  336. package/dist/components/gov-tooltip.js.map +1 -1
  337. package/dist/components/gov-wizard-item.js +1 -1
  338. package/dist/components/gov-wizard-item.js.map +1 -1
  339. package/dist/components/gov-wizard.js +1 -1
  340. package/dist/components/p-20c2203a.js +2 -0
  341. package/dist/components/p-20c2203a.js.map +1 -0
  342. package/dist/components/p-227eb30d.js +2 -0
  343. package/dist/components/{p-dcee21ca.js.map → p-227eb30d.js.map} +1 -1
  344. package/dist/components/p-2b87c27b.js +2 -0
  345. package/dist/components/{p-3b807239.js.map → p-2b87c27b.js.map} +1 -1
  346. package/dist/components/p-31a99bfc.js +2 -0
  347. package/dist/components/{p-bd22e21d.js → p-4149f195.js} +2 -2
  348. package/dist/components/p-44a8a668.js +2 -0
  349. package/dist/components/p-45097b4c.js +2 -0
  350. package/dist/components/p-45097b4c.js.map +1 -0
  351. package/dist/components/{p-1f3bb41d.js → p-5952a5d0.js} +2 -2
  352. package/dist/components/p-5aad3497.js +2 -0
  353. package/dist/components/p-5aad3497.js.map +1 -0
  354. package/dist/components/p-68a1aaec.js +2 -0
  355. package/dist/components/p-68a1aaec.js.map +1 -0
  356. package/dist/components/p-76d604c6.js +2 -0
  357. package/dist/components/p-7d4f2214.js +2 -0
  358. package/dist/components/{p-6ea84137.js.map → p-7d4f2214.js.map} +1 -1
  359. package/dist/components/p-7f3becc5.js +2 -0
  360. package/dist/components/p-859a4f0d.js +2 -0
  361. package/dist/components/{p-820b66c0.js.map → p-859a4f0d.js.map} +1 -1
  362. package/dist/components/{p-7f8a24a7.js → p-860520b0.js} +2 -2
  363. package/dist/components/p-929ebfb5.js +2 -0
  364. package/dist/components/p-929ebfb5.js.map +1 -0
  365. package/dist/components/p-9908b9f0.js +2 -0
  366. package/dist/components/p-9908b9f0.js.map +1 -0
  367. package/dist/components/{p-19c681a3.js → p-a2435993.js} +2 -2
  368. package/dist/components/{p-59737af9.js → p-a521c59a.js} +2 -2
  369. package/dist/components/{p-0c93dd39.js → p-c61a5830.js} +2 -2
  370. package/dist/components/p-dc952cc2.js +2 -0
  371. package/dist/components/p-dc952cc2.js.map +1 -0
  372. package/dist/components/{p-23b7e680.js → p-dfb5794a.js} +2 -2
  373. package/dist/components/p-ea7fdd2e.js +2 -0
  374. package/dist/components/p-ea7fdd2e.js.map +1 -0
  375. package/dist/components/p-f44899e1.js +2 -0
  376. package/dist/components/p-f44899e1.js.map +1 -0
  377. package/dist/core/core.css +7985 -7198
  378. package/dist/core/core.esm.js +1 -1
  379. package/dist/core/core.esm.js.map +1 -1
  380. package/dist/core/p-00d153bf.entry.js +2 -0
  381. package/dist/core/p-019e967c.entry.js +2 -0
  382. package/dist/core/{p-83aa4327.entry.js.map → p-019e967c.entry.js.map} +1 -1
  383. package/dist/core/p-0be19b89.entry.js +2 -0
  384. package/dist/core/p-1abdcb62.entry.js +2 -0
  385. package/dist/core/p-1abdcb62.entry.js.map +1 -0
  386. package/dist/core/p-1ac9544f.entry.js +2 -0
  387. package/dist/core/{p-f963bb2f.entry.js.map → p-1ac9544f.entry.js.map} +1 -1
  388. package/dist/core/p-1b3c808d.entry.js +2 -0
  389. package/dist/core/p-1b3c808d.entry.js.map +1 -0
  390. package/dist/core/p-20c2203a.js +2 -0
  391. package/dist/core/p-20c2203a.js.map +1 -0
  392. package/dist/core/p-22fa411d.entry.js +2 -0
  393. package/dist/core/p-2c290fe5.entry.js +2 -0
  394. package/dist/core/p-2c290fe5.entry.js.map +1 -0
  395. package/dist/core/p-2c59483f.entry.js +2 -0
  396. package/dist/core/p-2c59483f.entry.js.map +1 -0
  397. package/dist/core/p-30eaeeec.entry.js +2 -0
  398. package/dist/core/p-3bbb77a0.js +2 -0
  399. package/dist/core/p-3fc3c26b.entry.js +2 -0
  400. package/dist/core/{p-212759be.entry.js.map → p-3fc3c26b.entry.js.map} +1 -1
  401. package/dist/core/p-40d764ac.entry.js +2 -0
  402. package/dist/core/{p-0d2c4d31.entry.js.map → p-40d764ac.entry.js.map} +1 -1
  403. package/dist/core/p-410ec0dd.entry.js +2 -0
  404. package/dist/core/{p-10f9bf55.entry.js.map → p-410ec0dd.entry.js.map} +1 -1
  405. package/dist/core/p-439b66a5.entry.js +2 -0
  406. package/dist/core/{p-92e13f9d.entry.js.map → p-439b66a5.entry.js.map} +1 -1
  407. package/dist/core/p-443a813a.entry.js +2 -0
  408. package/dist/core/{p-eebf7ad8.entry.js.map → p-443a813a.entry.js.map} +1 -1
  409. package/dist/core/p-48c93ac0.entry.js +2 -0
  410. package/dist/core/p-48c93ac0.entry.js.map +1 -0
  411. package/dist/core/p-52ca31be.entry.js +2 -0
  412. package/dist/core/{p-378e0723.entry.js.map → p-52ca31be.entry.js.map} +1 -1
  413. package/dist/core/p-535316b4.entry.js +2 -0
  414. package/dist/core/{p-b822b9ff.entry.js → p-5396935e.entry.js} +2 -2
  415. package/dist/core/{p-42d9924c.js → p-56efd4a2.js} +2 -2
  416. package/dist/core/p-5aad3497.js +2 -0
  417. package/dist/core/p-5aad3497.js.map +1 -0
  418. package/dist/core/p-5b2131c1.entry.js +2 -0
  419. package/dist/core/p-5ed63e9c.entry.js +2 -0
  420. package/dist/core/{p-1fdc2457.entry.js.map → p-5ed63e9c.entry.js.map} +1 -1
  421. package/dist/core/{p-60658ae9.js → p-5f1000da.js} +2 -2
  422. package/dist/core/p-6454af62.entry.js +2 -0
  423. package/dist/core/{p-56f9e026.entry.js.map → p-6454af62.entry.js.map} +1 -1
  424. package/dist/core/p-74458da3.entry.js +2 -0
  425. package/dist/core/p-74458da3.entry.js.map +1 -0
  426. package/dist/core/p-76d604c6.js +2 -0
  427. package/dist/core/{p-a21dc94f.js.map → p-76d604c6.js.map} +1 -1
  428. package/dist/core/p-773f71f6.entry.js +2 -0
  429. package/dist/core/{p-67200095.entry.js.map → p-773f71f6.entry.js.map} +1 -1
  430. package/dist/core/p-783a6b5b.entry.js +2 -0
  431. package/dist/core/{p-0a24806a.entry.js.map → p-783a6b5b.entry.js.map} +1 -1
  432. package/dist/core/p-7b7e502b.entry.js +2 -0
  433. package/dist/core/p-7ba4daf4.js +2 -0
  434. package/dist/core/p-7bf52eb9.entry.js +2 -0
  435. package/dist/core/p-7bf52eb9.entry.js.map +1 -0
  436. package/dist/core/p-7d6073aa.entry.js +2 -0
  437. package/dist/core/{p-fb0df3a5.entry.js.map → p-7d6073aa.entry.js.map} +1 -1
  438. package/dist/core/p-7f3becc5.js +2 -0
  439. package/dist/core/{p-e9a6cd71.js → p-860520b0.js} +2 -2
  440. package/dist/core/p-8701c28e.entry.js +2 -0
  441. package/dist/core/p-8701c28e.entry.js.map +1 -0
  442. package/dist/core/p-951823cb.entry.js +2 -0
  443. package/dist/core/{p-75ea368b.entry.js.map → p-951823cb.entry.js.map} +1 -1
  444. package/dist/core/p-9da91318.entry.js +2 -0
  445. package/dist/core/{p-1f1895c0.entry.js.map → p-9da91318.entry.js.map} +1 -1
  446. package/dist/core/p-a218e2eb.entry.js +2 -0
  447. package/dist/core/{p-d3963396.entry.js.map → p-a218e2eb.entry.js.map} +1 -1
  448. package/dist/core/{p-169b67af.js → p-a2435993.js} +2 -2
  449. package/dist/core/p-a521c59a.js +2 -0
  450. package/dist/core/p-b1efeb41.entry.js +2 -0
  451. package/dist/core/p-b1efeb41.entry.js.map +1 -0
  452. package/dist/core/p-b4af0bec.entry.js +2 -0
  453. package/dist/core/p-b4af0bec.entry.js.map +1 -0
  454. package/dist/core/p-bc966c46.entry.js +2 -0
  455. package/dist/core/p-bdc51179.entry.js +2 -0
  456. package/dist/core/p-bdc51179.entry.js.map +1 -0
  457. package/dist/core/p-c20fe3da.entry.js +2 -0
  458. package/dist/core/{p-8f10919c.entry.js.map → p-c20fe3da.entry.js.map} +1 -1
  459. package/dist/core/p-c4ffcc37.entry.js +2 -0
  460. package/dist/core/p-c4ffcc37.entry.js.map +1 -0
  461. package/dist/core/p-c52afdfc.js +2 -0
  462. package/dist/core/{p-842cb87f.js.map → p-c52afdfc.js.map} +1 -1
  463. package/dist/core/{p-c990d746.js → p-c61a5830.js} +2 -2
  464. package/dist/core/p-cb557873.entry.js +2 -0
  465. package/dist/core/{p-3844a27d.entry.js.map → p-cb557873.entry.js.map} +1 -1
  466. package/dist/core/p-d24710ff.entry.js +2 -0
  467. package/dist/core/p-d24710ff.entry.js.map +1 -0
  468. package/dist/core/p-d65cef62.entry.js +2 -0
  469. package/dist/core/{p-4cb4de7b.entry.js.map → p-d65cef62.entry.js.map} +1 -1
  470. package/dist/core/p-da1db6fd.js +2 -0
  471. package/dist/core/p-da1db6fd.js.map +1 -0
  472. package/dist/core/p-db22d51c.entry.js +2 -0
  473. package/dist/core/{p-f1c8a96b.entry.js.map → p-db22d51c.entry.js.map} +1 -1
  474. package/dist/core/p-dec3f948.entry.js +2 -0
  475. package/dist/core/{p-7b48b1b8.entry.js.map → p-dec3f948.entry.js.map} +1 -1
  476. package/dist/core/{p-45a30859.js → p-e0e2e9c1.js} +2 -2
  477. package/dist/core/p-e2517a72.entry.js +2 -0
  478. package/dist/core/{p-57b0e670.entry.js.map → p-e2517a72.entry.js.map} +1 -1
  479. package/dist/core/p-e44a0fee.js +2 -0
  480. package/dist/core/{p-58dc3ec3.entry.js → p-e834ee73.entry.js} +2 -2
  481. package/dist/core/p-ea7fdd2e.js +2 -0
  482. package/dist/core/p-ea7fdd2e.js.map +1 -0
  483. package/dist/core/p-ed1131cb.entry.js +2 -0
  484. package/dist/core/{p-c5b5fd69.entry.js.map → p-ed1131cb.entry.js.map} +1 -1
  485. package/dist/core/p-f1056a83.entry.js +2 -0
  486. package/dist/core/{p-32bba4e7.entry.js.map → p-f1056a83.entry.js.map} +1 -1
  487. package/dist/core/p-f1fa5e1e.entry.js +2 -0
  488. package/dist/core/{p-1600c1fb.entry.js.map → p-f1fa5e1e.entry.js.map} +1 -1
  489. package/dist/core/p-f4bcf817.entry.js +2 -0
  490. package/dist/core/p-f4bcf817.entry.js.map +1 -0
  491. package/dist/core/p-f6709826.entry.js +2 -0
  492. package/dist/core/p-f6709826.entry.js.map +1 -0
  493. package/dist/core/{p-5ad3097c.entry.js → p-f7a4da9d.entry.js} +2 -2
  494. package/dist/core/p-fca60e04.entry.js +2 -0
  495. package/dist/core/{p-8fe36a5b.entry.js.map → p-fca60e04.entry.js.map} +1 -1
  496. package/dist/core/p-fe6fed11.entry.js +2 -0
  497. package/dist/core/p-fe6fed11.entry.js.map +1 -0
  498. package/dist/esm/{colors-02c1ea96.js → colors-4cf64720.js} +7 -9
  499. package/dist/esm/colors-4cf64720.js.map +1 -0
  500. package/dist/esm/{constants-6d727976.js → constants-085f9943.js} +2 -2
  501. package/dist/esm/{constants-6d727976.js.map → constants-085f9943.js.map} +1 -1
  502. package/dist/esm/{constants-990365f1.js → constants-372455eb.js} +3 -3
  503. package/dist/esm/{constants-990365f1.js.map → constants-372455eb.js.map} +1 -1
  504. package/dist/esm/{constants-d6418889.js → constants-3ab65c42.js} +2 -2
  505. package/dist/esm/{constants-d6418889.js.map → constants-3ab65c42.js.map} +1 -1
  506. package/dist/esm/{constants-48177684.js → constants-3b914c35.js} +3 -3
  507. package/dist/esm/{constants-48177684.js.map → constants-3b914c35.js.map} +1 -1
  508. package/dist/esm/{constants-d42abf99.js → constants-43f10674.js} +2 -2
  509. package/dist/esm/{constants-d42abf99.js.map → constants-43f10674.js.map} +1 -1
  510. package/dist/esm/{constants-501eb756.js → constants-4da2b3c0.js} +2 -2
  511. package/dist/esm/{constants-501eb756.js.map → constants-4da2b3c0.js.map} +1 -1
  512. package/dist/esm/{constants-c716fa44.js → constants-51f51588.js} +3 -3
  513. package/dist/esm/{constants-c716fa44.js.map → constants-51f51588.js.map} +1 -1
  514. package/dist/esm/{constants-f4e4ede6.js → constants-8429b68f.js} +3 -3
  515. package/dist/esm/{constants-f4e4ede6.js.map → constants-8429b68f.js.map} +1 -1
  516. package/dist/esm/{constants-47e20524.js → constants-9177ea52.js} +3 -3
  517. package/dist/esm/{constants-47e20524.js.map → constants-9177ea52.js.map} +1 -1
  518. package/dist/esm/{constants-7307438d.js → constants-bc210662.js} +3 -3
  519. package/dist/esm/{constants-7307438d.js.map → constants-bc210662.js.map} +1 -1
  520. package/dist/esm/core.js +1 -1
  521. package/dist/esm/{form-472e078d.js → form-713f26fd.js} +7 -6
  522. package/dist/esm/form-713f26fd.js.map +1 -0
  523. package/dist/esm/gov-accordion-item.entry.js +6 -7
  524. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  525. package/dist/esm/gov-accordion.entry.js +5 -6
  526. package/dist/esm/gov-accordion.entry.js.map +1 -1
  527. package/dist/esm/gov-attachments_3.entry.js +10 -11
  528. package/dist/esm/gov-attachments_3.entry.js.map +1 -1
  529. package/dist/esm/gov-backdrop.entry.js +4 -5
  530. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  531. package/dist/esm/gov-breadcrumbs.entry.js +5 -6
  532. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  533. package/dist/esm/gov-button.entry.js +10 -11
  534. package/dist/esm/gov-button.entry.js.map +1 -1
  535. package/dist/esm/gov-card.entry.js +5 -6
  536. package/dist/esm/gov-card.entry.js.map +1 -1
  537. package/dist/esm/gov-chip.entry.js +12 -13
  538. package/dist/esm/gov-chip.entry.js.map +1 -1
  539. package/dist/esm/gov-container.entry.js +2 -10
  540. package/dist/esm/gov-container.entry.js.map +1 -1
  541. package/dist/esm/gov-control-group.entry.js +5 -6
  542. package/dist/esm/gov-control-group.entry.js.map +1 -1
  543. package/dist/esm/gov-cookiebar.entry.js +1 -1
  544. package/dist/esm/gov-dialog.entry.js +5 -6
  545. package/dist/esm/gov-dialog.entry.js.map +1 -1
  546. package/dist/esm/gov-dropdown.entry.js +4 -4
  547. package/dist/esm/gov-empty.entry.js +5 -6
  548. package/dist/esm/gov-empty.entry.js.map +1 -1
  549. package/dist/esm/gov-error-code.entry.js +1 -1
  550. package/dist/esm/gov-flex_4.entry.js +315 -0
  551. package/dist/esm/gov-flex_4.entry.js.map +1 -0
  552. package/dist/esm/gov-form-autocomplete.entry.js +6 -8
  553. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  554. package/dist/esm/gov-form-checkbox-group.entry.js +7 -8
  555. package/dist/esm/gov-form-checkbox-group.entry.js.map +1 -1
  556. package/dist/esm/gov-form-checkbox.entry.js +10 -11
  557. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  558. package/dist/esm/gov-form-control.entry.js +8 -8
  559. package/dist/esm/gov-form-file.entry.js +8 -9
  560. package/dist/esm/gov-form-file.entry.js.map +1 -1
  561. package/dist/esm/gov-form-group.entry.js +6 -7
  562. package/dist/esm/gov-form-group.entry.js.map +1 -1
  563. package/dist/esm/gov-form-input_2.entry.js +15 -14
  564. package/dist/esm/gov-form-input_2.entry.js.map +1 -1
  565. package/dist/esm/gov-form-multi-select.entry.js +12 -13
  566. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  567. package/dist/esm/gov-form-password-power.entry.js +1 -1
  568. package/dist/esm/gov-form-radio-group.entry.js +7 -8
  569. package/dist/esm/gov-form-radio-group.entry.js.map +1 -1
  570. package/dist/esm/gov-form-radio.entry.js +9 -10
  571. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  572. package/dist/esm/gov-form-search.entry.js +3 -3
  573. package/dist/esm/gov-form-select.entry.js +11 -12
  574. package/dist/esm/gov-form-select.entry.js.map +1 -1
  575. package/dist/esm/gov-form-switch.entry.js +10 -11
  576. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  577. package/dist/esm/gov-grid-item.entry.js +2 -2
  578. package/dist/esm/gov-grid.entry.js +2 -2
  579. package/dist/esm/gov-infobar.entry.js +7 -8
  580. package/dist/esm/gov-infobar.entry.js.map +1 -1
  581. package/dist/esm/gov-layout-column.entry.js +2 -2
  582. package/dist/esm/gov-layout.entry.js +2 -2
  583. package/dist/esm/gov-lifecycle.entry.js +1 -1
  584. package/dist/esm/gov-link.entry.js +47 -0
  585. package/dist/esm/gov-link.entry.js.map +1 -0
  586. package/dist/esm/gov-loading.entry.js +5 -6
  587. package/dist/esm/gov-loading.entry.js.map +1 -1
  588. package/dist/esm/gov-message.entry.js +6 -7
  589. package/dist/esm/gov-message.entry.js.map +1 -1
  590. package/dist/esm/gov-pagination.entry.js +6 -7
  591. package/dist/esm/gov-pagination.entry.js.map +1 -1
  592. package/dist/esm/gov-spacer.entry.js +5 -6
  593. package/dist/esm/gov-spacer.entry.js.map +1 -1
  594. package/dist/esm/gov-stepper-item.entry.js +7 -8
  595. package/dist/esm/gov-stepper-item.entry.js.map +1 -1
  596. package/dist/esm/gov-stepper.entry.js +7 -8
  597. package/dist/esm/gov-stepper.entry.js.map +1 -1
  598. package/dist/esm/gov-tabs-item.entry.js +5 -5
  599. package/dist/esm/gov-tabs.entry.js +7 -8
  600. package/dist/esm/gov-tabs.entry.js.map +1 -1
  601. package/dist/esm/gov-tag.entry.js +11 -12
  602. package/dist/esm/gov-tag.entry.js.map +1 -1
  603. package/dist/esm/gov-tile.entry.js +3 -3
  604. package/dist/esm/gov-tile.entry.js.map +1 -1
  605. package/dist/esm/gov-tiles.entry.js +2 -2
  606. package/dist/esm/gov-toast.entry.js +7 -7
  607. package/dist/esm/gov-toast.entry.js.map +1 -1
  608. package/dist/esm/gov-tooltip-content.entry.js +5 -5
  609. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  610. package/dist/esm/gov-tooltip.entry.js +8 -9
  611. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  612. package/dist/esm/gov-wizard-item.entry.js +9 -10
  613. package/dist/esm/gov-wizard-item.entry.js.map +1 -1
  614. package/dist/esm/gov-wizard.entry.js +8 -9
  615. package/dist/esm/gov-wizard.entry.js.map +1 -1
  616. package/dist/esm/{win-cec370ad.js → gov.log-066c3139.js} +17 -3
  617. package/dist/esm/gov.log-066c3139.js.map +1 -0
  618. package/dist/esm/index-c263e031.js +6 -14
  619. package/dist/esm/loader.js +1 -1
  620. package/dist/esm/{props-c82e1abf.js → props-fb6587c3.js} +2 -2
  621. package/dist/esm/{props-c82e1abf.js.map → props-fb6587c3.js.map} +1 -1
  622. package/dist/esm/{template-3d84d705.js → template-7ecee4d1.js} +2 -20
  623. package/dist/esm/template-7ecee4d1.js.map +1 -0
  624. package/dist/esm/{utils-2b4ef320.js → utils-e10e994d.js} +2 -2
  625. package/dist/esm/{utils-2b4ef320.js.map → utils-e10e994d.js.map} +1 -1
  626. package/dist/esm/{wcag-d7c6c252.js → wcag-de9a3dc6.js} +2 -3
  627. package/dist/esm/wcag-de9a3dc6.js.map +1 -0
  628. package/dist/hydrate/index.js +224 -138
  629. package/dist/hydrate/index.mjs +224 -138
  630. package/dist/stencil.config.js +6 -4
  631. package/dist/stencil.config.js.map +1 -1
  632. package/dist/types/components/gov-button/button/gov-button.d.ts +1 -1
  633. package/dist/types/components/gov-chip/gov-chip.d.ts +3 -3
  634. package/dist/types/components/gov-container/gov-container.d.ts +0 -6
  635. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +0 -4
  636. package/dist/types/components/gov-form/file/gov-form-file.d.ts +0 -4
  637. package/dist/types/components/gov-form/input/constants.d.ts +1 -0
  638. package/dist/types/components/gov-form/switch/constants.d.ts +1 -1
  639. package/dist/types/components/gov-icon/constants.d.ts +4 -1
  640. package/dist/types/components/gov-icon/gov-icon.d.ts +8 -2
  641. package/dist/types/components/gov-icon/list.d.ts +1 -1
  642. package/dist/types/components/gov-link/constants.d.ts +7 -0
  643. package/dist/types/components/gov-link/gov-link.d.ts +30 -0
  644. package/dist/types/components/gov-tag/gov-tag.d.ts +2 -2
  645. package/dist/types/components/gov-theme-switch/constants.d.ts +9 -0
  646. package/dist/types/components/gov-theme-switch/gov-theme-switch.d.ts +26 -2
  647. package/dist/types/components/gov-tile/gov-tile.d.ts +1 -1
  648. package/dist/types/components/gov-toast/constants.d.ts +1 -0
  649. package/dist/types/components.d.ts +117 -37
  650. package/dist/types/core/constants/colors.d.ts +6 -8
  651. package/dist/types/helpers/Dom/document.d.ts +3 -0
  652. package/dist/types/helpers/Dom/template.d.ts +0 -1
  653. package/dist/types/helpers/Dom/template.types.d.ts +0 -1
  654. package/package.json +3 -3
  655. package/dist/cjs/colors-976f6dff.js.map +0 -1
  656. package/dist/cjs/form-c1aec07a.js.map +0 -1
  657. package/dist/cjs/gov-flex.cjs.entry.js +0 -31
  658. package/dist/cjs/gov-flex.cjs.entry.js.map +0 -1
  659. package/dist/cjs/gov-form-label.cjs.entry.js +0 -27
  660. package/dist/cjs/gov-form-label.cjs.entry.js.map +0 -1
  661. package/dist/cjs/gov-icon.cjs.entry.js +0 -161
  662. package/dist/cjs/gov-icon.cjs.entry.js.map +0 -1
  663. package/dist/cjs/gov-theme-switch.cjs.entry.js +0 -73
  664. package/dist/cjs/gov-theme-switch.cjs.entry.js.map +0 -1
  665. package/dist/cjs/gov.log-1e8bab6e.js +0 -21
  666. package/dist/cjs/gov.log-1e8bab6e.js.map +0 -1
  667. package/dist/cjs/template-b070338f.js.map +0 -1
  668. package/dist/cjs/wcag-b8d80c7d.js.map +0 -1
  669. package/dist/cjs/win-587f4614.js.map +0 -1
  670. package/dist/components/p-0075138f.js +0 -2
  671. package/dist/components/p-0075138f.js.map +0 -1
  672. package/dist/components/p-02da2aee.js +0 -2
  673. package/dist/components/p-02da2aee.js.map +0 -1
  674. package/dist/components/p-08621bdf.js +0 -2
  675. package/dist/components/p-1a0b3b4f.js +0 -2
  676. package/dist/components/p-1a0b3b4f.js.map +0 -1
  677. package/dist/components/p-1d3019f3.js +0 -2
  678. package/dist/components/p-255d0471.js +0 -2
  679. package/dist/components/p-255d0471.js.map +0 -1
  680. package/dist/components/p-387052e1.js +0 -2
  681. package/dist/components/p-387052e1.js.map +0 -1
  682. package/dist/components/p-3b807239.js +0 -2
  683. package/dist/components/p-565120d5.js +0 -2
  684. package/dist/components/p-5cc316bc.js +0 -2
  685. package/dist/components/p-5cc316bc.js.map +0 -1
  686. package/dist/components/p-6ea84137.js +0 -2
  687. package/dist/components/p-7501abe8.js +0 -2
  688. package/dist/components/p-7501abe8.js.map +0 -1
  689. package/dist/components/p-820b66c0.js +0 -2
  690. package/dist/components/p-c211c3e1.js +0 -2
  691. package/dist/components/p-c211c3e1.js.map +0 -1
  692. package/dist/components/p-dcee21ca.js +0 -2
  693. package/dist/components/p-e3aeaca0.js +0 -2
  694. package/dist/components/p-e3aeaca0.js.map +0 -1
  695. package/dist/components/p-edd1417b.js +0 -2
  696. package/dist/core/p-0075138f.js +0 -2
  697. package/dist/core/p-0075138f.js.map +0 -1
  698. package/dist/core/p-052cc573.js +0 -2
  699. package/dist/core/p-0a24806a.entry.js +0 -2
  700. package/dist/core/p-0d2c4d31.entry.js +0 -2
  701. package/dist/core/p-10f9bf55.entry.js +0 -2
  702. package/dist/core/p-12680890.entry.js +0 -2
  703. package/dist/core/p-12680890.entry.js.map +0 -1
  704. package/dist/core/p-1600c1fb.entry.js +0 -2
  705. package/dist/core/p-18025823.entry.js +0 -2
  706. package/dist/core/p-18025823.entry.js.map +0 -1
  707. package/dist/core/p-18dbe177.entry.js +0 -2
  708. package/dist/core/p-18dbe177.entry.js.map +0 -1
  709. package/dist/core/p-1a550eee.entry.js +0 -2
  710. package/dist/core/p-1a550eee.entry.js.map +0 -1
  711. package/dist/core/p-1f1895c0.entry.js +0 -2
  712. package/dist/core/p-1fdc2457.entry.js +0 -2
  713. package/dist/core/p-212759be.entry.js +0 -2
  714. package/dist/core/p-215504c1.entry.js +0 -2
  715. package/dist/core/p-2614044c.js +0 -2
  716. package/dist/core/p-2c3ddc57.entry.js +0 -2
  717. package/dist/core/p-31e7d262.entry.js +0 -2
  718. package/dist/core/p-31e7d262.entry.js.map +0 -1
  719. package/dist/core/p-32bba4e7.entry.js +0 -2
  720. package/dist/core/p-378e0723.entry.js +0 -2
  721. package/dist/core/p-3844a27d.entry.js +0 -2
  722. package/dist/core/p-4bce896c.js +0 -2
  723. package/dist/core/p-4cb4de7b.entry.js +0 -2
  724. package/dist/core/p-56f9e026.entry.js +0 -2
  725. package/dist/core/p-57b0e670.entry.js +0 -2
  726. package/dist/core/p-668ca722.entry.js +0 -2
  727. package/dist/core/p-67200095.entry.js +0 -2
  728. package/dist/core/p-69d56f17.js +0 -2
  729. package/dist/core/p-6aa40794.js +0 -2
  730. package/dist/core/p-731fe7d8.entry.js +0 -2
  731. package/dist/core/p-731fe7d8.entry.js.map +0 -1
  732. package/dist/core/p-7591976a.entry.js +0 -2
  733. package/dist/core/p-75ea368b.entry.js +0 -2
  734. package/dist/core/p-7b48b1b8.entry.js +0 -2
  735. package/dist/core/p-7de47344.entry.js +0 -2
  736. package/dist/core/p-7de47344.entry.js.map +0 -1
  737. package/dist/core/p-83aa4327.entry.js +0 -2
  738. package/dist/core/p-842cb87f.js +0 -2
  739. package/dist/core/p-89b69743.entry.js +0 -2
  740. package/dist/core/p-89b69743.entry.js.map +0 -1
  741. package/dist/core/p-8a796fbe.entry.js +0 -2
  742. package/dist/core/p-8f10919c.entry.js +0 -2
  743. package/dist/core/p-8fe36a5b.entry.js +0 -2
  744. package/dist/core/p-915e53ac.entry.js +0 -2
  745. package/dist/core/p-915e53ac.entry.js.map +0 -1
  746. package/dist/core/p-92e13f9d.entry.js +0 -2
  747. package/dist/core/p-a21dc94f.js +0 -2
  748. package/dist/core/p-a274cdaa.entry.js +0 -2
  749. package/dist/core/p-a274cdaa.entry.js.map +0 -1
  750. package/dist/core/p-a693ffbf.js +0 -2
  751. package/dist/core/p-a693ffbf.js.map +0 -1
  752. package/dist/core/p-a9a095c2.entry.js +0 -2
  753. package/dist/core/p-a9a095c2.entry.js.map +0 -1
  754. package/dist/core/p-ab68c0b7.entry.js +0 -2
  755. package/dist/core/p-ab68c0b7.entry.js.map +0 -1
  756. package/dist/core/p-b48a4aa0.js +0 -2
  757. package/dist/core/p-b48a4aa0.js.map +0 -1
  758. package/dist/core/p-b50ffab3.entry.js +0 -2
  759. package/dist/core/p-b70cc248.entry.js +0 -2
  760. package/dist/core/p-c0a5a3f7.entry.js +0 -2
  761. package/dist/core/p-c0a5a3f7.entry.js.map +0 -1
  762. package/dist/core/p-c5b5fd69.entry.js +0 -2
  763. package/dist/core/p-d1c4eb91.entry.js +0 -2
  764. package/dist/core/p-d3963396.entry.js +0 -2
  765. package/dist/core/p-d4fbc249.entry.js +0 -2
  766. package/dist/core/p-d4fbc249.entry.js.map +0 -1
  767. package/dist/core/p-d949aac7.entry.js +0 -2
  768. package/dist/core/p-d949aac7.entry.js.map +0 -1
  769. package/dist/core/p-e0d428c9.js +0 -2
  770. package/dist/core/p-e0d428c9.js.map +0 -1
  771. package/dist/core/p-e3aeaca0.js +0 -2
  772. package/dist/core/p-e3aeaca0.js.map +0 -1
  773. package/dist/core/p-e6af4c58.entry.js +0 -2
  774. package/dist/core/p-e6af4c58.entry.js.map +0 -1
  775. package/dist/core/p-ede7af0a.entry.js +0 -2
  776. package/dist/core/p-ede7af0a.entry.js.map +0 -1
  777. package/dist/core/p-eebc9e71.entry.js +0 -2
  778. package/dist/core/p-eebc9e71.entry.js.map +0 -1
  779. package/dist/core/p-eebf7ad8.entry.js +0 -2
  780. package/dist/core/p-f1c8a96b.entry.js +0 -2
  781. package/dist/core/p-f963bb2f.entry.js +0 -2
  782. package/dist/core/p-fb0df3a5.entry.js +0 -2
  783. package/dist/esm/colors-02c1ea96.js.map +0 -1
  784. package/dist/esm/form-472e078d.js.map +0 -1
  785. package/dist/esm/gov-flex.entry.js +0 -27
  786. package/dist/esm/gov-flex.entry.js.map +0 -1
  787. package/dist/esm/gov-form-label.entry.js +0 -23
  788. package/dist/esm/gov-form-label.entry.js.map +0 -1
  789. package/dist/esm/gov-icon.entry.js +0 -157
  790. package/dist/esm/gov-icon.entry.js.map +0 -1
  791. package/dist/esm/gov-theme-switch.entry.js +0 -69
  792. package/dist/esm/gov-theme-switch.entry.js.map +0 -1
  793. package/dist/esm/gov.log-6e9faad2.js +0 -19
  794. package/dist/esm/gov.log-6e9faad2.js.map +0 -1
  795. package/dist/esm/template-3d84d705.js.map +0 -1
  796. package/dist/esm/wcag-d7c6c252.js.map +0 -1
  797. package/dist/esm/win-cec370ad.js.map +0 -1
  798. /package/dist/components/{p-1d3019f3.js.map → p-31a99bfc.js.map} +0 -0
  799. /package/dist/components/{p-bd22e21d.js.map → p-4149f195.js.map} +0 -0
  800. /package/dist/components/{p-08621bdf.js.map → p-44a8a668.js.map} +0 -0
  801. /package/dist/components/{p-1f3bb41d.js.map → p-5952a5d0.js.map} +0 -0
  802. /package/dist/components/{p-565120d5.js.map → p-76d604c6.js.map} +0 -0
  803. /package/dist/components/{p-edd1417b.js.map → p-7f3becc5.js.map} +0 -0
  804. /package/dist/components/{p-7f8a24a7.js.map → p-860520b0.js.map} +0 -0
  805. /package/dist/components/{p-19c681a3.js.map → p-a2435993.js.map} +0 -0
  806. /package/dist/components/{p-59737af9.js.map → p-a521c59a.js.map} +0 -0
  807. /package/dist/components/{p-0c93dd39.js.map → p-c61a5830.js.map} +0 -0
  808. /package/dist/components/{p-23b7e680.js.map → p-dfb5794a.js.map} +0 -0
  809. /package/dist/core/{p-b50ffab3.entry.js.map → p-00d153bf.entry.js.map} +0 -0
  810. /package/dist/core/{p-d1c4eb91.entry.js.map → p-0be19b89.entry.js.map} +0 -0
  811. /package/dist/core/{p-215504c1.entry.js.map → p-22fa411d.entry.js.map} +0 -0
  812. /package/dist/core/{p-668ca722.entry.js.map → p-30eaeeec.entry.js.map} +0 -0
  813. /package/dist/core/{p-69d56f17.js.map → p-3bbb77a0.js.map} +0 -0
  814. /package/dist/core/{p-7591976a.entry.js.map → p-535316b4.entry.js.map} +0 -0
  815. /package/dist/core/{p-b822b9ff.entry.js.map → p-5396935e.entry.js.map} +0 -0
  816. /package/dist/core/{p-42d9924c.js.map → p-56efd4a2.js.map} +0 -0
  817. /package/dist/core/{p-8a796fbe.entry.js.map → p-5b2131c1.entry.js.map} +0 -0
  818. /package/dist/core/{p-60658ae9.js.map → p-5f1000da.js.map} +0 -0
  819. /package/dist/core/{p-b70cc248.entry.js.map → p-7b7e502b.entry.js.map} +0 -0
  820. /package/dist/core/{p-2614044c.js.map → p-7ba4daf4.js.map} +0 -0
  821. /package/dist/core/{p-6aa40794.js.map → p-7f3becc5.js.map} +0 -0
  822. /package/dist/core/{p-e9a6cd71.js.map → p-860520b0.js.map} +0 -0
  823. /package/dist/core/{p-169b67af.js.map → p-a2435993.js.map} +0 -0
  824. /package/dist/core/{p-4bce896c.js.map → p-a521c59a.js.map} +0 -0
  825. /package/dist/core/{p-2c3ddc57.entry.js.map → p-bc966c46.entry.js.map} +0 -0
  826. /package/dist/core/{p-c990d746.js.map → p-c61a5830.js.map} +0 -0
  827. /package/dist/core/{p-45a30859.js.map → p-e0e2e9c1.js.map} +0 -0
  828. /package/dist/core/{p-052cc573.js.map → p-e44a0fee.js.map} +0 -0
  829. /package/dist/core/{p-58dc3ec3.entry.js.map → p-e834ee73.entry.js.map} +0 -0
  830. /package/dist/core/{p-5ad3097c.entry.js.map → p-f7a4da9d.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["GovTabs","proxyCustomElement","H","constructor","this","triggerRefs","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","size","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","stopObserving","removeAttribute","Object","assign","skipDefault","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","direction","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","color","type","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}/>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}/>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"left-icon\"/>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"right-icon\"/>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"oZA2BaA,EAAOC,EAAA,MAAAD,UAAAE,EAKnB,WAAAC,G,oEAHQC,KAAAC,YAAsE,G,UAW7C,O,UAIK,I,WAID,U,iBAIc,a,eAIW,M,iBAqBf,G,gBACzB,E,yBACqB,GA9C1CD,KAAKE,EAAIC,EAAQH,KAAKI,K,CA8BvB,YAAAC,CAAaC,GACZC,EAAaC,EAAUF,EAAUG,EAAUC,K,CAI5C,aAAAC,CAAcL,GACbC,EAAaK,EAAWN,EAAUG,EAAUC,K,CAI7C,YAAAG,CAAaP,GACZC,EAAaO,EAAUR,EAAUG,EAAUC,K,CAO5C,gBAAAK,GACCf,KAAKgB,kBAAoB,IAAIC,EAAkBjB,KAAKI,MAAM,CAACc,EAAeZ,KACzEN,KAAKmB,sBAAsBD,EAAeZ,EAAS,IAGpDN,KAAKgB,kBAAkBI,eAAeC,E,CAGvC,iBAAAC,GACCtB,KAAKuB,qBACLvB,KAAKa,aAAab,KAAKwB,MACvBxB,KAAKyB,oBAAsBC,EAAsB1B,KAAKI,K,CAGvD,oBAAAuB,GACC3B,KAAKgB,kBAAkBY,e,CAGxB,qBAAAT,CAAsBD,EAAuBZ,GAC5CN,KAAKI,KAAKyB,gBAAgBX,GAC1BlB,KAAKyB,oBAAmBK,OAAAC,OAAAD,OAAAC,OAAA,GAAO/B,KAAKyB,qBAAmB,CAAEP,CAACA,GAAgBZ,G,CAGnE,kBAAAiB,CAAmBS,EAAc,OACxChC,KAAKiC,YAAc,GACnB,MAAMC,EAA4C,GAClDlC,KAAKI,KAAK+B,iBAAiBC,EAAc1B,MAAM2B,SAASC,IACvD,MAAMC,EAAcC,QAAQC,IAAI,CAC/BH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AGDjH,KAAKiC,YAAYjC,KAAKgE,YAAYN,OAAS,MAE3C,GAAImD,IAAY,IAAMA,IAAY,GAAI,CACrC7G,KAAKgE,aACL,GAAIhE,KAAKgE,YAAchE,KAAKiC,YAAYgF,OAAQ,CAC/CjH,KAAKgE,WAAa,C,CAEnB,GAAIhE,KAAKiC,YAAYjC,KAAKgE,YAAYhB,SAAU,CAC/ChD,KAAK+G,aAAa,G,OAEb,GAAIF,IAAY,IAAMA,IAAY,GAAI,CAC5C7G,KAAKgE,aACL,GAAIhE,KAAKgE,WAAa,EAAG,CACxBhE,KAAKgE,WAAahE,KAAKiC,YAAYgF,OAAS,C,CAE7C,GAAIjH,KAAKiC,YAAYjC,KAAKgE,YAAYhB,SAAU,CAC/ChD,KAAK+G,aAAa,G,EAIpB,GAAI/G,KAAKgE,YAAc,GAAKhE,KAAKgE,YAAchE,KAAKiC,YAAYgF,OAAS,EAAG,CAC3E,MAAMC,EAAUlH,KAAKiC,YAAYjC,KAAKgE,YACtCkD,EAAQxD,OAAS,KACjB,MAAMyD,EAAUnH,KAAKC,YAAYiH,EAAQnE,mBACzC,GAAIoE,EAAQC,SAASC,gBAAkB,WAAY,CACjDrH,KAAKC,YAAYiH,EAAQnE,mBAA0CuE,U,KAC9D,CACNtH,KAAKC,YAAYiH,EAAQnE,mBAAmBwE,O,CAG7CvH,KAAKiC,YAAc,IAAIjC,KAAKiC,aAC5BjC,KAAKoE,WACLpE,KAAK0G,UAAUC,KAAK3G,KAAKsG,gBAAgB7C,Q,GAS5C,aAAM+D,GACLxH,KAAKuB,oB,CAON,gBAAMkG,GACL,OAAOzH,KAAKsG,gBAAgB7C,SAAW,I,CAOxC,kBAAMiE,CAAa5E,GAClB9C,KAAKqE,sBAAsBvB,GAC3B9C,KAAKoE,U,CAON,cAAMuD,GACL3H,KAAKuB,mBAAmB,K","ignoreList":[]}
1
+ {"version":3,"names":["GovTabs","proxyCustomElement","H","constructor","this","triggerRefs","h","govHost","host","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateColor","TabColors","validateSize","TabSizes","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","prepareControllers","size","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","stopObserving","removeAttribute","Object","assign","skipDefault","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","iconStart","prepareIconFormat","iconEnd","label","direction","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","color","type","onKeyDown","onKeydownHandler","bind","tabs","role","list","btn","id","onClick","onSelectHandler","toBoolAttr","tabindex","ref","el","name","tag","booleanString","focusable","slot","getCurrentTab","find","index","t","govChange","emit","e","keyCode","stopPropagation","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tColorType,\n\tTabColors,\n\tTabOrientationType,\n\tTabsClass,\n\tTabsItemClass,\n\tTabSizes,\n\tTabSizeType,\n\tTabType,\n\tTabTypes\n} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {booleanString, govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n\n@Component({\n\ttag: \"gov-tabs\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Tabs size.\n\t */\n\t@Prop() readonly size?: TabSizeType = 'm'\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly color?: ColorType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Icon and description display direction\n\t */\n\t@Prop({reflect: true}) readonly direction: 'row' | 'column' = 'row'\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TabColors, newValue, TabsClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TabSizes, newValue, TabsClass.root)\n\t}\n\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\tconst iconStart = prepareIconFormat(tab.getAttribute('icon-start'))\n\t\t\t\tconst iconEnd = prepareIconFormat(tab.getAttribute('icon-end'))\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tdirection: tab.getAttribute(\"direction\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t\ticonStart,\n\t\t\t\t\ticonEnd\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tsize={this.size}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tdirection={this.direction}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs}\n\t\t\t\t\t role=\"tablist\"\n\t\t\t\t\t {...this.inheritedAttributes}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\taria-selected={booleanString(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\t\t\t\t\tsize={this.size === \"xs\" ? \"xs\" : (this.size === \"s\" ? \"s\" : \"m\")}\n\t\t\t\t\t\t\t\t\t\ttype={control.active ? \"solid\" : \"outlined\"}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.iconStart ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconStart.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconStart.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-start\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t\t{control.iconEnd ? (<gov-icon\n\t\t\t\t\t\t\t\t\t\t\tname={control.iconEnd.name}\n\t\t\t\t\t\t\t\t\t\t\ttype={control.iconEnd.type}\n\t\t\t\t\t\t\t\t\t\t\tslot=\"icon-end\"></gov-icon>) : null}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n}\n"],"mappings":"oZA2BaA,EAAOC,EAAA,MAAAD,UAAAE,EAKnB,WAAAC,G,oEAHQC,KAAAC,YAAsE,G,UAW7C,O,UAIK,I,WAID,U,iBAIc,a,eAIW,M,iBAqBf,G,gBACzB,E,yBACqB,GA9C1CD,KAAKE,EAAIC,EAAQH,KAAKI,K,CA8BvB,YAAAC,CAAaC,GACZC,EAAaC,EAAUF,EAAUG,EAAUC,K,CAI5C,aAAAC,CAAcL,GACbC,EAAaK,EAAWN,EAAUG,EAAUC,K,CAI7C,YAAAG,CAAaP,GACZC,EAAaO,EAAUR,EAAUG,EAAUC,K,CAO5C,gBAAAK,GACCf,KAAKgB,kBAAoB,IAAIC,EAAkBjB,KAAKI,MAAM,CAACc,EAAeZ,KACzEN,KAAKmB,sBAAsBD,EAAeZ,EAAS,IAGpDN,KAAKgB,kBAAkBI,eAAeC,E,CAGvC,iBAAAC,GACCtB,KAAKuB,qBACLvB,KAAKa,aAAab,KAAKwB,MACvBxB,KAAKyB,oBAAsBC,EAAsB1B,KAAKI,K,CAGvD,oBAAAuB,GACC3B,KAAKgB,kBAAkBY,e,CAGxB,qBAAAT,CAAsBD,EAAuBZ,GAC5CN,KAAKI,KAAKyB,gBAAgBX,GAC1BlB,KAAKyB,oBAAmBK,OAAAC,OAAAD,OAAAC,OAAA,GAAO/B,KAAKyB,qBAAmB,CAAEP,CAACA,GAAgBZ,G,CAGnE,kBAAAiB,CAAmBS,EAAc,OACxChC,KAAKiC,YAAc,GACnB,MAAMC,EAA4C,GAClDlC,KAAKI,KAAK+B,iBAAiBC,EAAc1B,MAAM2B,SAASC,IACvD,MAAMC,EAAcC,QAAQC,I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g as i}from"./p-0075138f.js";import{v as c}from"./p-19c681a3.js";import{a,c as n}from"./p-08621bdf.js";import{p as d}from"./p-e0e2e9c1.js";import{S as r}from"./p-92f420cb.js";import{p as f}from"./p-016bbea6.js";import{d as l}from"./p-387052e1.js";const m=d(r,["_XS","_S","_M"]);var p;(function(e){e["BOLD"]="bold";e["SUBTLE"]="subtle"})(p||(p={}));const b={root:"gov-tag"};const h=e(class e extends t{constructor(){super();this.__registerHost();this.iconLeft=undefined;this.iconRight=undefined;this.size=m._S;this.color=a.PRIMARY;this.type=undefined;this.h=i(this.host)}validateColor(e){c(a,e,b.root)}validateSize(e){c(n,e,b.root)}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size)}render(){const e=f(this.iconLeft);const t=f(this.iconRight);return s(o,{key:"9dede4ae44585315490e2ebad775381cd77a86c4",class:this.h.classes(b.root),color:this.color,size:this.size,type:this.type},s("span",{key:"84529d30dcf3f26a59b9320234dc05d4bfb1ac8c",class:"element"},s("slot",{key:"07e19e9e805572c5efa3e5138d6dc97255c58c3f",name:"left-icon"},e&&s("gov-icon",{key:"14aee821e6e2f75d0fe178dcc9680633ec15de57",type:e.type,name:e.name})),s("slot",{key:"973d6bcd03d962830b061d6b98acbc2ff8eb099b"}),s("slot",{key:"74def1aa50e02199d3160cbb90bd219fbf5863e6",name:"right-icon"},t&&s("gov-icon",{key:"7a72370126731b4bb285e8d557c3fd7cd84b2499",type:t.type,name:t.name}))))}get host(){return this}static get watchers(){return{color:["validateColor"],size:["validateSize"]}}},[4,"gov-tag",{iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],size:[513],color:[513],type:[513]},undefined,{color:["validateColor"],size:["validateSize"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-tag","gov-icon"];e.forEach((e=>{switch(e){case"gov-tag":if(!customElements.get(e)){customElements.define(e,h)}break;case"gov-icon":if(!customElements.get(e)){l()}break}}))}g();const u=h;const v=g;export{u as GovTag,v as defineCustomElement};
1
+ import{p as e,H as t,h as s,d as o}from"./p-42200001.js";import{g as a}from"./p-ea7fdd2e.js";import{v as i}from"./p-a2435993.js";import{a as c,c as n}from"./p-44a8a668.js";import{p as r}from"./p-e0e2e9c1.js";import{S as d}from"./p-92f420cb.js";import{p as f}from"./p-016bbea6.js";import{d as m}from"./p-f44899e1.js";const l=r(d,["_XS","_S","_M"]);var p;(function(e){e["BOLD"]="bold";e["SUBTLE"]="subtle"})(p||(p={}));const h={root:"gov-tag"};const b=e(class e extends t{constructor(){super();this.__registerHost();this.iconStart=undefined;this.iconEnd=undefined;this.size=l._S;this.color=c.PRIMARY;this.type=undefined;this.h=a(this.host)}validateColor(e){i(c,e,h.root)}validateSize(e){i(n,e,h.root)}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size)}render(){const e=f(this.iconStart);const t=f(this.iconEnd);return s(o,{key:"c883cf9721b32aa8c06609bf09272ef196456e18",class:this.h.classes(h.root),color:this.color,size:this.size,type:this.type},s("span",{key:"614f39f6f1004d6c3ee1d0f13990a4e52dee66bc",class:"element"},s("slot",{key:"f7d4dc9576768e917a363bc7cafa86567213ea82",name:"icon-start"},e&&s("gov-icon",{key:"8d57b52a0314e8d76461872116b4ce04e546c180",type:e.type,name:e.name})),s("slot",{key:"4cd134377c3ea7843aa899b0a2962aa19f5d569e"}),s("slot",{key:"4dc1cccaced24ef26bb15e648788590a4b7d1838",name:"icon-end"},t&&s("gov-icon",{key:"7946e18900c98bdff4c610813b2422bf75b30049",type:t.type,name:t.name}))))}get host(){return this}static get watchers(){return{color:["validateColor"],size:["validateSize"]}}},[4,"gov-tag",{iconStart:[1,"icon-start"],iconEnd:[1,"icon-end"],size:[513],color:[513],type:[513]},undefined,{color:["validateColor"],size:["validateSize"]}]);function u(){if(typeof customElements==="undefined"){return}const e=["gov-tag","gov-icon"];e.forEach((e=>{switch(e){case"gov-tag":if(!customElements.get(e)){customElements.define(e,b)}break;case"gov-icon":if(!customElements.get(e)){m()}break}}))}u();const v=b;const g=u;export{v as GovTag,g as defineCustomElement};
2
2
  //# sourceMappingURL=gov-tag.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["TagSizes","pick","Sizes","TagType","TagClass","root","GovTag","proxyCustomElement","H","constructor","_S","ButtonColors","PRIMARY","this","h","govHost","host","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","color","size","render","iconLeft","prepareIconFormat","iconRight","Host","key","class","classes","type","name"],"sources":["../../../packages/core/src/components/gov-tag/constants.ts","../../../packages/core/src/components/gov-tag/gov-tag.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TagSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type TagSizesType = `${ValueOf<typeof TagSizes>}`\n\nexport enum TagType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type TagTypesType = `${ValueOf<typeof TagType>}`\n\nexport const TagClass = {\n\troot: 'gov-tag',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonColors, ButtonColorType} from '../gov-button/button/constants'\nimport {TagClass, TagSizes, TagSizesType, TagTypesType} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: TagSizesType = TagSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Tag’s type\n\t */\n\t@Prop({reflect: true}) readonly type: TagTypesType\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\tcolor={this.color}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<slot name=\"left-icon\">\n\t\t\t\t\t\t{iconLeft && <gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"right-icon\">\n\t\t\t\t\t\t{iconRight && <gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"uTAIO,MAAMA,EAAWC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGlD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,kBACA,EAHD,CAAYA,MAAO,KAMZ,MAAMC,EAAW,CACvBC,KAAM,W,MCHMC,EAAMC,EAAA,MAAAD,UAAAE,EAGlB,WAAAC,G,yFAiBqDT,EAASU,G,WAILC,EAAaC,Q,oBApBrEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CA2BvB,aAAAC,CAAcC,GACbC,EAAaR,EAAcO,EAAUd,EAASC,K,CAI/C,YAAAe,CAAaF,GACZC,EAAaE,EAAaH,EAAUd,EAASC,K,CAG9C,iBAAAiB,GACCT,KAAKI,cAAcJ,KAAKU,OACxBV,KAAKO,aAAaP,KAAKW,K,CAGxB,MAAAC,GACC,MAAMC,EAAWC,EAAkBd,KAAKa,UACxC,MAAME,EAAYD,EAAkBd,KAAKe,WACzC,OACCd,EAACe,EAAI,CAAAC,IAAA,2CAACC,MAAOlB,KAAKC,EAAEkB,QAAQ5B,EAASC,MACpCkB,MAAOV,KAAKU,MACZC,KAAMX,KAAKW,KACXS,KAAMpB,KAAKoB,MAEXnB,EAAA,QAAAgB,IAAA,2CAAMC,MAAM,WACXjB,EAAA,QAAAgB,IAAA,2CAAMI,KAAK,aACTR,GAAYZ,EAAA,YAAAgB,IAAA,2CAAUG,KAAMP,EAASO,KAAMC,KAAMR,EAASQ,QAE5DpB,EAAA,QAAAgB,IAAA,6CACAhB,EAAA,QAAAgB,IAAA,2CAAMI,KAAK,cACTN,GAAad,EAAA,YAAAgB,IAAA,2CAAUG,KAAML,EAAUK,KAAMC,KAAMN,EAAUM,S","ignoreList":[]}
1
+ {"version":3,"names":["TagSizes","pick","Sizes","TagType","TagClass","root","GovTag","proxyCustomElement","H","constructor","_S","ButtonColors","PRIMARY","this","h","govHost","host","validateColor","newValue","validateProp","validateSize","ButtonSizes","componentWillLoad","color","size","render","iconStart","prepareIconFormat","iconEnd","Host","key","class","classes","type","name"],"sources":["../../../packages/core/src/components/gov-tag/constants.ts","../../../packages/core/src/components/gov-tag/gov-tag.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TagSizes = pick(Sizes, ['_XS', '_S', '_M'])\nexport type TagSizesType = `${ValueOf<typeof TagSizes>}`\n\nexport enum TagType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type TagTypesType = `${ValueOf<typeof TagType>}`\n\nexport const TagClass = {\n\troot: 'gov-tag',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonColors, ButtonColorType} from '../gov-button/button/constants'\nimport {TagClass, TagSizes, TagSizesType, TagTypesType} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-start\"}) readonly iconStart?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-end\"}) readonly iconEnd?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: TagSizesType = TagSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly color: ButtonColorType = ButtonColors.PRIMARY\n\t/**\n\t * Tag’s type\n\t */\n\t@Prop({reflect: true}) readonly type: TagTypesType\n\n\t@Watch('color')\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ButtonColors, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconStart = prepareIconFormat(this.iconStart)\n\t\tconst iconEnd = prepareIconFormat(this.iconEnd)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\tcolor={this.color}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<slot name=\"icon-start\">\n\t\t\t\t\t\t{iconStart && <gov-icon type={iconStart.type} name={iconStart.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<slot name=\"icon-end\">\n\t\t\t\t\t\t{iconEnd && <gov-icon type={iconEnd.type} name={iconEnd.name}></gov-icon>}\n\t\t\t\t\t</slot>\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"4TAIO,MAAMA,EAAWC,EAAKC,EAAO,CAAC,MAAO,KAAM,OAGlD,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,kBACA,EAHD,CAAYA,MAAO,KAMZ,MAAMC,EAAW,CACvBC,KAAM,W,MCHMC,EAAMC,EAAA,MAAAD,UAAAE,EAGlB,WAAAC,G,wFAiBqDT,EAASU,G,WAILC,EAAaC,Q,oBApBrEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CA2BvB,aAAAC,CAAcC,GACbC,EAAaR,EAAcO,EAAUd,EAASC,K,CAI/C,YAAAe,CAAaF,GACZC,EAAaE,EAAaH,EAAUd,EAASC,K,CAG9C,iBAAAiB,GACCT,KAAKI,cAAcJ,KAAKU,OACxBV,KAAKO,aAAaP,KAAKW,K,CAGxB,MAAAC,GACC,MAAMC,EAAYC,EAAkBd,KAAKa,WACzC,MAAME,EAAUD,EAAkBd,KAAKe,SACvC,OACCd,EAACe,EAAI,CAAAC,IAAA,2CAACC,MAAOlB,KAAKC,EAAEkB,QAAQ5B,EAASC,MACpCkB,MAAOV,KAAKU,MACZC,KAAMX,KAAKW,KACXS,KAAMpB,KAAKoB,MAEXnB,EAAA,QAAAgB,IAAA,2CAAMC,MAAM,WACXjB,EAAA,QAAAgB,IAAA,2CAAMI,KAAK,cACTR,GAAaZ,EAAA,YAAAgB,IAAA,2CAAUG,KAAMP,EAAUO,KAAMC,KAAMR,EAAUQ,QAE/DpB,EAAA,QAAAgB,IAAA,6CACAhB,EAAA,QAAAgB,IAAA,2CAAMI,KAAK,YACTN,GAAWd,EAAA,YAAAgB,IAAA,2CAAUG,KAAML,EAAQK,KAAMC,KAAMN,EAAQM,S","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as s,h as o,d as i}from"./p-42200001.js";import{g as c}from"./p-0075138f.js";import{f as h}from"./p-7501abe8.js";const n={root:"gov-theme-switch"};const a="data-theme";var r;(function(t){t["auto"]="auto";t["light"]="light";t["dark"]="dark"})(r||(r={}));const l=t(class t extends e{constructor(){super();this.__registerHost();this.govChange=s(this,"gov-change",7);this.setThemeState=t=>{this.htmlElement.setAttribute(a,t);localStorage.setItem(a,t);this.theme=t;this.govChange.emit({component:n.root,state:this.theme,ref:this.host})};this.theme=r.auto;this.h=c(this.host)}get localStorageValue(){return h?localStorage.getItem(a):null}get htmlElement(){return document.documentElement}componentWillLoad(){this.initDefaultState()}initDefaultState(){const t=Object.keys(r);let e=this.localStorageValue;const s=this.htmlElement.getAttribute(a);if(e&&t.includes(e)){this.htmlElement.setAttribute(a,e);this.theme=e}else if(s&&t.includes(s)){localStorage.setItem(a,s);this.theme=s}else{localStorage.setItem(a,r.auto);this.theme=r.auto}}render(){return o(i,{key:"139c85bffa33cbcbe42cc9e62be6e31683fd107b",class:this.h.classes(n.root)},o("button",{key:"81f2ff7e246341d67d422ea39f405f1071a0b733",onClick:()=>this.setThemeState(r.light)},"light"),o("button",{key:"32559e57bde0843bc75512bd89398ec3e4aa5147",onClick:()=>this.setThemeState(r.dark)},"dark"))}get host(){return this}},[0,"gov-theme-switch",{theme:[32]}]);function f(){if(typeof customElements==="undefined"){return}const t=["gov-theme-switch"];t.forEach((t=>{switch(t){case"gov-theme-switch":if(!customElements.get(t)){customElements.define(t,l)}break}}))}f();const m=l;const u=f;export{m as GovThemeSwitch,u as defineCustomElement};
1
+ import{p as e,H as t,c as s,h as i,d as a}from"./p-42200001.js";import{g as o}from"./p-ea7fdd2e.js";import{p as c}from"./p-e0e2e9c1.js";import{S as n}from"./p-92f420cb.js";import{b as h}from"./p-20c2203a.js";import{v as r}from"./p-a2435993.js";import{d as l}from"./p-68a1aaec.js";import{d as f}from"./p-f44899e1.js";const m=c(n,["_XS","_S","_M","_L","_XL"]);const d={root:"gov-theme-switch",indicator:"gov-theme-switch__indicator",iconLight:"gov-theme-switch__icon-light",iconDark:"gov-theme-switch__icon-dark",labelLight:"gov-theme-switch__label-light",labelDark:"gov-theme-switch__label-dark"};const b="data-theme";var u;(function(e){e["auto"]="auto";e["light"]="light";e["dark"]="dark"})(u||(u={}));const g=(e,t,s)=>{if(!h){return}let i="";if(s){const e=new Date;e.setTime(e.getTime()+s*24*60*60*1e3);i="; expires="+e.toUTCString()}document.cookie=`${e}=${encodeURIComponent(t)}${i}; path=/`};const p=e=>{if(!h){return null}const t=e+"=";const s=document.cookie.split(";");for(let e=0;e<s.length;e++){let i=s[e].trim();if(i.startsWith(t)){return decodeURIComponent(i.substring(t.length))}}return null};const k=e(class e extends t{constructor(){super();this.__registerHost();this.govChange=s(this,"gov-change",7);this.setThemeState=e=>{this.theme=e;this.govChange.emit({component:d.root,state:this.theme,ref:this.host})};this.size="m";this.ariaLabelLight=undefined;this.ariaLabelDark=undefined;this.labelLight=undefined;this.labelDark=undefined;this.theme=u.auto;this.h=o(this.host)}validateSize(e){r(m,e,d.root)}watchTheme(e){this.htmlElement.setAttribute(b,e);this.htmlElement.classList.remove(...Object.keys(u));this.htmlElement.classList.add(e);g(b,e)}get storageValue(){return p(b)}get htmlElement(){return document.documentElement}get isSystemPrefersColorDark(){return h&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}componentWillLoad(){this.initDefaultState();this.validateSize(this.size)}initDefaultState(){const e=Object.keys(u);let t=this.storageValue;const s=this.htmlElement.getAttribute(b);if(t&&e.includes(t)){this.theme=t}else if(s&&e.includes(s)){this.theme=s}else{this.theme=u.auto}}render(){let e=this.theme===u.dark;if(this.theme===u.auto){e=this.isSystemPrefersColorDark}return i(a,{key:"a83f030f54527f8e8a2d23c3769f3f1b41c4af4f",class:this.h.classes(d.root),theme:e?u.dark:u.light,size:this.size},i("button",{key:"54f8337d911cf64f24c8db089b9092b806c3a926",onClick:()=>this.setThemeState(e?u.light:u.dark),"aria-label":e?this.ariaLabelLight:this.ariaLabelDark},i("span",{key:"483310b54df8e8de42c087f04b7e0758067c22b8"},i("span",{key:"88b822cac4b5dc3897fa19252b5b1e1a559b8d6d",class:d.indicator},u.light&&i("gov-icon",{key:"f6f162cda66facba8940ba55f7f3283e7796d157",name:"sun",class:d.iconLight,type:"components"}),u.dark&&i("gov-icon",{key:"b36b009c1787e37a3fd5108618c6bb5993f97a23",name:"moon",class:d.iconDark,type:"components"})),i("gov-form-label",{key:"dff2b2b454a87faa1d7e471d2a271c333c983aad",class:d.labelLight,size:this.size},this.labelLight),i("gov-form-label",{key:"1b682ccaff92cc4cfe8462ff2a59507fd61b114b",class:d.labelDark,size:this.size},this.labelDark))))}get host(){return this}static get watchers(){return{size:["validateSize"],theme:["watchTheme"]}}},[0,"gov-theme-switch",{size:[1],ariaLabelLight:[1,"aria-label-light"],ariaLabelDark:[1,"aria-label-dark"],labelLight:[1,"label-light"],labelDark:[1,"label-dark"],theme:[32]},undefined,{size:["validateSize"],theme:["watchTheme"]}]);function v(){if(typeof customElements==="undefined"){return}const e=["gov-theme-switch","gov-form-label","gov-icon"];e.forEach((e=>{switch(e){case"gov-theme-switch":if(!customElements.get(e)){customElements.define(e,k)}break;case"gov-form-label":if(!customElements.get(e)){l()}break;case"gov-icon":if(!customElements.get(e)){f()}break}}))}v();const w=k;const _=v;export{w as GovThemeSwitch,_ as defineCustomElement};
2
2
  //# sourceMappingURL=gov-theme-switch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ThemeSwitchClass","root","ATTRIBUTE_THEME_NAME","ThemeList","GovThemeSwitch","proxyCustomElement","H","constructor","this","setThemeState","state","htmlElement","setAttribute","localStorage","setItem","theme","govChange","emit","component","ref","host","auto","h","govHost","localStorageValue","isWindow","getItem","document","documentElement","componentWillLoad","initDefaultState","options","Object","keys","currentState","htmlState","getAttribute","includes","render","Host","key","class","classes","onClick","light","dark"],"sources":["../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["export const ThemeSwitchClass = {\n\troot: 'gov-theme-switch'\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Component, Element, Event, EventEmitter, h, Host, State} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovLoadingElement\n\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get localStorageValue() {\n\t\treturn isWindow ? localStorage.getItem(ATTRIBUTE_THEME_NAME) : null;\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.localStorageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, currentState);\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tlocalStorage.setItem(ATTRIBUTE_THEME_NAME, htmlState);\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tlocalStorage.setItem(ATTRIBUTE_THEME_NAME, ThemeList.auto);\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, state);\n\t\tlocalStorage.setItem(ATTRIBUTE_THEME_NAME, state);\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}>\n\t\t\t\t<button onClick={() => this.setThemeState(ThemeList.light)}>light</button>\n\t\t\t\t<button onClick={() => this.setThemeState(ThemeList.dark)}>dark</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"wIAAO,MAAMA,EAAmB,CAC/BC,KAAM,oBAGA,MAAMC,EAAuB,aCFpC,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,iBACAA,EAAA,cACA,EAJD,CAAYA,MAAS,K,MCQRC,EAAcC,EAAA,MAAAD,UAAAE,EAG1B,WAAAC,G,oEA0CQC,KAAAC,cAAiBC,IACxBF,KAAKG,YAAYC,aAAaV,EAAsBQ,GACpDG,aAAaC,QAAQZ,EAAsBQ,GAC3CF,KAAKO,MAAQL,EAEbF,KAAKQ,UAAUC,KAAK,CACnBC,UAAWlB,EAAiBC,KAC5BS,MAAOF,KAAKO,MACZI,IAAKX,KAAKY,MACT,E,WAxCyBjB,EAAUkB,KAVrCb,KAAKc,EAAIC,EAAQf,KAAKY,K,CAYvB,qBAAYI,GACX,OAAOC,EAAWZ,aAAaa,QAAQxB,GAAwB,I,CAGhE,eAAYS,GACX,OAAOgB,SAASC,e,CAGjB,iBAAAC,GACCrB,KAAKsB,kB,CAGE,gBAAAA,GACP,MAAMC,EAAUC,OAAOC,KAAK9B,GAC5B,IAAI+B,EAAe1B,KAAKgB,kBACxB,MAAMW,EAAY3B,KAAKG,YAAYyB,aAAalC,GAEhD,GAAIgC,GAAgBH,EAAQM,SAASH,GAAe,CACnD1B,KAAKG,YAAYC,aAAaV,EAAsBgC,GACpD1B,KAAKO,MAAQmB,C,MACP,GAAIC,GAAaJ,EAAQM,SAASF,GAAY,CACpDtB,aAAaC,QAAQZ,EAAsBiC,GAC3C3B,KAAKO,MAAQoB,C,KACP,CACNtB,aAAaC,QAAQZ,EAAsBC,EAAUkB,MACrDb,KAAKO,MAAQZ,EAAUkB,I,EAgBzB,MAAAiB,GACC,OACChB,EAACiB,EAAI,CAAAC,IAAA,2CAACC,MAAOjC,KAAKc,EAAEoB,QAAQ1C,EAAiBC,OAC5CqB,EAAA,UAAAkB,IAAA,2CAAQG,QAAS,IAAMnC,KAAKC,cAAcN,EAAUyC,QAAM,SAC1DtB,EAAA,UAAAkB,IAAA,2CAAQG,QAAS,IAAMnC,KAAKC,cAAcN,EAAU0C,OAAK,Q","ignoreList":[]}
1
+ {"version":3,"names":["ThemeSwitchSizes","pick","Sizes","ThemeSwitchClass","root","indicator","iconLight","iconDark","labelLight","labelDark","ATTRIBUTE_THEME_NAME","ThemeList","setCookie","name","value","days","isWindow","expires","date","Date","setTime","getTime","toUTCString","document","cookie","encodeURIComponent","getCookie","nameEQ","cookies","split","i","length","trim","startsWith","decodeURIComponent","substring","GovThemeSwitch","proxyCustomElement","H","constructor","this","setThemeState","state","theme","govChange","emit","component","ref","host","auto","h","govHost","validateSize","newValue","validateProp","watchTheme","htmlElement","setAttribute","classList","remove","Object","keys","add","storageValue","documentElement","isSystemPrefersColorDark","window","matchMedia","matches","componentWillLoad","initDefaultState","size","options","currentState","htmlState","getAttribute","includes","render","isDark","dark","Host","key","class","classes","light","onClick","ariaLabelLight","ariaLabelDark","type"],"sources":["../../../packages/core/src/components/gov-theme-switch/constants.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.types.ts","../../../packages/core/src/helpers/Dom/document.ts","../../../packages/core/src/components/gov-theme-switch/gov-theme-switch.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const ThemeSwitchSizes = pick(Sizes, ['_XS', '_S', '_M', '_L', '_XL'])\nexport type ThemeSwitchSizesType = `${ValueOf<typeof ThemeSwitchSizes>}`\n\nexport const ThemeSwitchClass = {\n\troot: 'gov-theme-switch',\n\tindicator: 'gov-theme-switch__indicator',\n\ticonLight: 'gov-theme-switch__icon-light',\n\ticonDark: 'gov-theme-switch__icon-dark',\n\tlabelLight: 'gov-theme-switch__label-light',\n\tlabelDark: 'gov-theme-switch__label-dark',\n}\n\nexport const ATTRIBUTE_THEME_NAME = 'data-theme'\n","import {GovBaseEvent} from \"../../types/event.types\";\n\nexport enum ThemeList {\n\tauto = 'auto',\n\tlight = 'light',\n\tdark = 'dark'\n}\n\nexport interface ThemeSwitchEvent extends GovBaseEvent {\n\tref: HTMLGovThemeSwitchElement;\n\tstate: ThemeList\n}\n\n","import {Nullable} from \"../../utils/helpers.types\";\nimport {isWindow} from \"./win\";\n\nexport const setCookie = (name: string, value: string, days?: number) => {\n\tif (!isWindow) {\n\t\treturn\n\t}\n\tlet expires = \"\";\n\tif (days) {\n\t\tconst date = new Date();\n\t\tdate.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\n\t\texpires = \"; expires=\" + date.toUTCString();\n\t}\n\tdocument.cookie = `${name}=${encodeURIComponent(value)}${expires}; path=/`;\n}\n\nexport const getCookie = (name: string): Nullable<string> => {\n\tif (!isWindow) {\n\t\treturn null\n\t}\n\tconst nameEQ = name + \"=\";\n\tconst cookies = document.cookie.split(';');\n\tfor (let i = 0; i < cookies.length; i++) {\n\t\tlet cookie = cookies[i].trim();\n\t\tif (cookie.startsWith(nameEQ)) {\n\t\t\treturn decodeURIComponent(cookie.substring(nameEQ.length));\n\t\t}\n\t}\n\treturn null;\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {GovHost} from \"../../helpers/Dom/template.types\";\nimport {govHost} from \"../../helpers/Dom/template\";\nimport {ATTRIBUTE_THEME_NAME, ThemeSwitchClass, ThemeSwitchSizes, ThemeSwitchSizesType} from \"./constants\";\nimport {isWindow} from \"../../helpers/Dom/win\";\nimport {ThemeList, ThemeSwitchEvent} from \"./gov-theme-switch.types\";\nimport {validateProp} from \"../../helpers/Validate/props\";\nimport {getCookie, setCookie} from \"../../helpers/Dom/document\";\n\n@Component({\n\ttag: \"gov-theme-switch\",\n})\nexport class GovThemeSwitch {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovThemeSwitchElement\n\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: ThemeSwitchSizesType = \"m\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"aria-label-light\"}) readonly ariaLabelLight?: \"Přenout na tmavý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"aria-label-dark\"}) readonly ariaLabelDark?: \"Přepnout na světlý mód\"\n\t/**\n\t * Label in light mode\n\t */\n\t@Prop({attribute: \"label-light\"}) readonly labelLight?: \"Světlý mód\"\n\t/**\n\t * Label in dark mode\n\t */\n\t@Prop({attribute: \"label-dark\"}) readonly labelDark?: \"Tmavý mód\"\n\t/**\n\t * Called when the theme is changed by the user\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<ThemeSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ThemeSwitchSizes, newValue, ThemeSwitchClass.root)\n\t}\n\n\t@Watch(\"theme\")\n\twatchTheme(newValue: ThemeList): void {\n\t\tthis.htmlElement.setAttribute(ATTRIBUTE_THEME_NAME, newValue);\n\t\tthis.htmlElement.classList.remove(...Object.keys(ThemeList));\n\t\tthis.htmlElement.classList.add(newValue);\n\t\tsetCookie(ATTRIBUTE_THEME_NAME, newValue);\n\t}\n\n\t@State() theme: ThemeList = ThemeList.auto\n\n\tprivate get storageValue() {\n\t\treturn getCookie(ATTRIBUTE_THEME_NAME)\n\t}\n\n\tprivate get htmlElement(): HTMLElement {\n\t\treturn document.documentElement\n\t}\n\n\tprivate get isSystemPrefersColorDark(): boolean {\n\t\treturn isWindow && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.initDefaultState()\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate initDefaultState() {\n\t\tconst options = Object.keys(ThemeList);\n\t\tlet currentState = this.storageValue;\n\t\tconst htmlState = this.htmlElement.getAttribute(ATTRIBUTE_THEME_NAME)\n\n\t\tif (currentState && options.includes(currentState)) {\n\t\t\tthis.theme = currentState as ThemeList;\n\t\t} else if (htmlState && options.includes(htmlState)) {\n\t\t\tthis.theme = htmlState as ThemeList;\n\t\t} else {\n\t\t\tthis.theme = ThemeList.auto;\n\t\t}\n\t}\n\n\tprivate setThemeState = (state: ThemeList) => {\n\t\tthis.theme = state;\n\n\t\tthis.govChange.emit({\n\t\t\tcomponent: ThemeSwitchClass.root,\n\t\t\tstate: this.theme,\n\t\t\tref: this.host\n\t\t})\n\t}\n\n\trender() {\n\t\tlet isDark = this.theme === ThemeList.dark;\n\t\tif (this.theme === ThemeList.auto) {\n\t\t\tisDark = this.isSystemPrefersColorDark;\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ThemeSwitchClass.root)}\n\t\t\t\t theme={isDark ? ThemeList.dark : ThemeList.light}\n\t\t\t\t size={this.size}>\n\t\t\t\t<button onClick={() => this.setThemeState(isDark ? ThemeList.light : ThemeList.dark)}\n\t\t\t\t\t\taria-label={isDark ? this.ariaLabelLight : this.ariaLabelDark}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<span class={ThemeSwitchClass.indicator}>\n\t\t\t\t\t\t\t{ThemeList.light && <gov-icon name=\"sun\" class={ThemeSwitchClass.iconLight} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t\t{ThemeList.dark && <gov-icon name=\"moon\" class={ThemeSwitchClass.iconDark} type=\"components\"></gov-icon>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<gov-form-label class={ThemeSwitchClass.labelLight} size={this.size}>\n\t\t\t\t\t\t\t{this.labelLight}\n\t\t\t\t\t\t</gov-form-label>\n\t\t\t\t\t\t<gov-form-label class={ThemeSwitchClass.labelDark} size={this.size}>\n\t\t\t\t\t\t\t{this.labelDark}\n\t\t\t\t\t\t</gov-form-label>\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"4TAIO,MAAMA,EAAmBC,EAAKC,EAAO,CAAC,MAAO,KAAM,KAAM,KAAM,QAG/D,MAAMC,EAAmB,CAC/BC,KAAM,mBACNC,UAAW,8BACXC,UAAW,+BACXC,SAAU,8BACVC,WAAY,gCACZC,UAAW,gCAGL,MAAMC,EAAuB,aCdpC,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,iBACAA,EAAA,cACA,EAJD,CAAYA,MAAS,KCCd,MAAMC,EAAY,CAACC,EAAcC,EAAeC,KACtD,IAAKC,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AiBM,UAAW8D,KAAM/B,KAAK+B,MAC5D/B,KAAK/B,a","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,h as s,F as i,d as o}from"./p-42200001.js";import{p as c}from"./p-e0e2e9c1.js";import{S as n}from"./p-92f420cb.js";import{g as a}from"./p-0075138f.js";import{d as r}from"./p-387052e1.js";c(n,["_S","_M","_L"]);const d={root:"gov-tile",link:"gov-tile__link",content:"gov-tile__content",text:"gov-tile__text",title:"gov-tile__title",icon:"gov-tile__icon",annotation:"gov-tile__annotation"};const f=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.orientation=undefined;this.noBorder=false;this.href=undefined;this.target=undefined;this.h=a(this.host)}render(){return s(o,{key:"423d9bc7b52a7408c4b9513612cdbac6c5a7df9c",class:this.h.classes(d.root),size:this.size,orientation:this.orientation,clickable:this.href?true:null},s("slot",{key:"b56ff3ed2dc8fd6f4de661e7892fe1513202da5e",name:"icon"}),s("div",{key:"e35827cda3520c1532de79be0a2d8fca8b952617",class:d.content},s("div",{key:"79c97706744f088c671b0cebf6969425226341d0",class:d.text},s("div",{key:"f5799184ba8a0040a74638fa4a37759c35a4cdec",class:d.title},this.href?s(i,null,s("a",{href:this.href,target:this.target,class:d.link,ref:e=>this.triggerRef=e},s("slot",{name:"title"})),s("span",{class:d.icon},s("gov-icon",{name:"chevron-right"}))):s("slot",{name:"title"})),s("div",{key:"eba9d4e70c1a295834adf26577ee965db054fbb2",class:`${d.annotation} ${this.href?`${d.annotation}--padding`:""}`},s("slot",{key:"ce4b626ae9551d82c3ff614f50379e6c1100dd07"}))),s("slot",{key:"c5ac0203d657d60469c64ea2afc1469f08cc867f",name:"button"})))}async getTriggerRef(){return this.triggerRef}get host(){return this}},[4,"gov-tile",{size:[513],orientation:[1],noBorder:[4,"no-border"],href:[513],target:[1],getTriggerRef:[64]}]);function l(){if(typeof customElements==="undefined"){return}const e=["gov-tile","gov-icon"];e.forEach((e=>{switch(e){case"gov-tile":if(!customElements.get(e)){customElements.define(e,f)}break;case"gov-icon":if(!customElements.get(e)){r()}break}}))}l();const g=f;const h=l;export{g as GovTile,h as defineCustomElement};
1
+ import{p as e,H as t,h as s,F as i,d as o}from"./p-42200001.js";import{p as n}from"./p-e0e2e9c1.js";import{S as c}from"./p-92f420cb.js";import{g as a}from"./p-ea7fdd2e.js";import{d as r}from"./p-f44899e1.js";n(c,["_S","_M","_L"]);const f={root:"gov-tile",link:"gov-tile__link",content:"gov-tile__content",text:"gov-tile__text",title:"gov-tile__title",icon:"gov-tile__icon",annotation:"gov-tile__annotation"};const d=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.orientation=undefined;this.noBorder=false;this.href=undefined;this.target=undefined;this.h=a(this.host)}render(){return s(o,{key:"3fd4f5bb8f7cdcdb5a6bbed610ed4ab6ec2837f5",class:this.h.classes(f.root),size:this.size,orientation:this.orientation,clickable:this.href?true:null},s("slot",{key:"97179af17c8f8b16de49ca36a7c548d20e53cbdf",name:"icon"}),s("div",{key:"a60a8e60effd1337cc11c5afb347ab395673d724",class:f.content},s("div",{key:"b27682c73305417442d9ebfd27e02cc80d10034c",class:f.text},s("div",{key:"0c891f670607dde529d5ef6b1c86a843b7600a30",class:f.title},this.href?s(i,null,s("a",{href:this.href,target:this.target,class:f.link,ref:e=>this.triggerRef=e},s("slot",{name:"title"})),s("span",{class:f.icon},s("gov-icon",{name:"chevron-right",type:"components"}))):s("slot",{name:"title"})),s("div",{key:"dcb5f3be57fa6ebaa507c12c9394f1b12837856e",class:`${f.annotation} ${this.href?`${f.annotation}--padding`:""}`},s("slot",{key:"c3b7fe9ef111769219f1d915929112fe083927c8"}))),s("slot",{key:"98173ea276fedd176720b79e5a55b3b2d5272536",name:"button"})))}async getTriggerRef(){return this.triggerRef}get host(){return this}},[4,"gov-tile",{size:[513],orientation:[1],noBorder:[4,"no-border"],href:[513],target:[1],getTriggerRef:[64]}]);function l(){if(typeof customElements==="undefined"){return}const e=["gov-tile","gov-icon"];e.forEach((e=>{switch(e){case"gov-tile":if(!customElements.get(e)){customElements.define(e,d)}break;case"gov-icon":if(!customElements.get(e)){r()}break}}))}l();const b=d;const g=l;export{b as GovTile,g as defineCustomElement};
2
2
  //# sourceMappingURL=gov-tile.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["pick","Sizes","TileClass","root","link","content","text","title","icon","annotation","GovTile","proxyCustomElement","H","constructor","this","h","govHost","host","render","Host","key","class","classes","size","orientation","clickable","href","name","Fragment","target","ref","el","triggerRef","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TileSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type TileSizesType = `${ValueOf<typeof TileSizes>}`\n\nexport const TileClass = {\n\troot: 'gov-tile',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\ttext: 'gov-tile__text',\n\ttitle: 'gov-tile__title',\n\ticon: 'gov-tile__icon',\n\tannotation: 'gov-tile__annotation',\n}\n","import {Component, Element, Fragment, h, Host, Method, Prop} from \"@stencil/core\"\nimport {TileClass, TileSizesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {ButtonTargetType} from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n})\nexport class GovTile {\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Tile’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: TileSizesType = \"m\"\n\t/**\n\t * Style variation of the tile.\n\t */\n\t@Prop() readonly orientation: \"vertical\" | \"horizontal\"\n\t/**\n\t * Tiles border\n\t */\n\t@Prop({ attribute: 'no-border' }) readonly noBorder: boolean = false\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}\n\t\t\t\t size={this.size}\n\t\t\t\t orientation={this.orientation}\n\t\t\t\t clickable={this.href ? true : null}\n\t\t\t>\n\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t<div class={TileClass.text}>\n\t\t\t\t\t\t<div class={TileClass.title}>\n\t\t\t\t\t\t\t{this.href ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-right\"/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={`${TileClass.annotation} ${this.href ? `${TileClass.annotation}--padding` : ''}`}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot name=\"button\"/>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\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}
1
+ {"version":3,"names":["pick","Sizes","TileClass","root","link","content","text","title","icon","annotation","GovTile","proxyCustomElement","H","constructor","this","h","govHost","host","render","Host","key","class","classes","size","orientation","clickable","href","name","Fragment","target","ref","el","triggerRef","type","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["import {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\nimport {ValueOf} from \"../../types/interfaces\";\n\nexport const TileSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type TileSizesType = `${ValueOf<typeof TileSizes>}`\n\nexport const TileClass = {\n\troot: 'gov-tile',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\ttext: 'gov-tile__text',\n\ttitle: 'gov-tile__title',\n\ticon: 'gov-tile__icon',\n\tannotation: 'gov-tile__annotation',\n}\n","import {Component, Element, Fragment, h, Host, Method, Prop} from \"@stencil/core\"\nimport {TileClass, TileSizesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {ButtonTargetType} from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n})\nexport class GovTile {\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Tile’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: TileSizesType = \"m\"\n\t/**\n\t * Style variation of the tile.\n\t */\n\t@Prop() readonly orientation: \"vertical\" | \"horizontal\"\n\t/**\n\t * Tiles border\n\t */\n\t@Prop({ attribute: 'no-border' }) readonly noBorder: boolean = false\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}\n\t\t\t\t size={this.size}\n\t\t\t\t orientation={this.orientation}\n\t\t\t\t clickable={this.href ? true : null}\n\t\t\t>\n\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t<div class={TileClass.text}>\n\t\t\t\t\t\t<div class={TileClass.title}>\n\t\t\t\t\t\t\t{this.href ? (\n\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-right\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<slot name=\"title\"/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={`${TileClass.annotation} ${this.href ? `${TileClass.annotation}--padding` : ''}`}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot name=\"button\"/>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"mappings":"gNAIyBA,EAAKC,EAAO,CAAC,KAAM,KAAM,OAG3C,MAAMC,EAAY,CACxBC,KAAM,WACNC,KAAM,iBACNC,QAAS,oBACTC,KAAM,iBACNC,MAAO,kBACPC,KAAM,iBACNC,WAAY,wB,MCLAC,EAAOC,EAAA,MAAAD,UAAAE,EA0BnB,WAAAC,G,wCArBuD,I,yCAQQ,M,0CAc9DC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAGvB,MAAAC,GACC,OACCH,EAACI,EAAI,CAAAC,IAAA,2CAACC,MAAOP,KAAKC,EAAEO,QAAQpB,EAAUC,MACnCoB,KAAMT,KAAKS,KACXC,YAAaV,KAAKU,YAClBC,UAAWX,KAAKY,KAAO,KAAO,MAEhCX,EAAA,QAAAK,IAAA,2CAAMO,KAAK,SACXZ,EAAA,OAAAK,IAAA,2CAAKC,MAAOnB,EAAUG,SACrBU,EAAA,OAAAK,IAAA,2CAAKC,MAAOnB,EAAUI,MACrBS,EAAA,OAAAK,IAAA,2CAAKC,MAAOnB,EAAUK,OACpBO,KAAKY,KACLX,EAACa,EAAQ,KACRb,EAAA,KACCW,KAAMZ,KAAKY,KACXG,OAAQf,KAAKe,OACbR,MAAOnB,EAAUE,KACjB0B,IAAKC,GAAOjB,KAAKkB,WAAaD,GAC9BhB,EAAA,QAAMY,KAAK,WAEZZ,EAAA,QAAMM,MAAOnB,EAAUM,MACtBO,EAAA,YAAUY,KAAK,gBAAgBM,KAAK,iBAItClB,EAAA,QAAMY,KAAK,WAGbZ,EAAA,OAAAK,IAAA,2CAAKC,MAAO,GAAGnB,EAAUO,cAAcK,KAAKY,KAAO,GAAGxB,EAAUO,sBAAwB,MACvFM,EAAA,QAAAK,IAAA,+CAGFL,EAAA,QAAAK,IAAA,2CAAMO,KAAK,Y,CAUf,mBAAMO,GACL,OAAOpB,KAAKkB,U","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as s,H as e,h as t,d as o}from"./p-42200001.js";import{g as c}from"./p-0075138f.js";const n={root:"gov-tiles"};const r=s(class s extends e{constructor(){super();this.__registerHost();this.columns=4;this.h=c(this.host)}render(){return t(o,{key:"98fc98abea209d53790a2a06b1ce6e1feda7c53d",class:this.h.classes(n.root)},t("slot",{key:"e074660d6ed9b773e68ef5f0523ab7b8bd57ea9e"}))}get host(){return this}},[4,"gov-tiles",{columns:[514]}]);function i(){if(typeof customElements==="undefined"){return}const s=["gov-tiles"];s.forEach((s=>{switch(s){case"gov-tiles":if(!customElements.get(s)){customElements.define(s,r)}break}}))}i();const a=r;const f=i;export{a as GovTiles,f as defineCustomElement};
1
+ import{p as e,H as s,h as t,d as o}from"./p-42200001.js";import{g as c}from"./p-ea7fdd2e.js";const n={root:"gov-tiles"};const r=e(class e extends s{constructor(){super();this.__registerHost();this.columns=4;this.h=c(this.host)}render(){return t(o,{key:"edb08ecaceb976d51978baf7ba3779d7e4e333cc",class:this.h.classes(n.root)},t("slot",{key:"a4aa065a8e108b9ceb692c264dec8c4fc559f80e"}))}get host(){return this}},[4,"gov-tiles",{columns:[514]}]);function i(){if(typeof customElements==="undefined"){return}const e=["gov-tiles"];e.forEach((e=>{switch(e){case"gov-tiles":if(!customElements.get(e)){customElements.define(e,r)}break}}))}i();const a=r;const d=i;export{a as GovTiles,d as defineCustomElement};
2
2
  //# sourceMappingURL=gov-tiles.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,c as e,h as i,d as o}from"./p-42200001.js";import{v as a}from"./p-19c681a3.js";import{C as c}from"./p-e3aeaca0.js";import{p as r}from"./p-e0e2e9c1.js";import{g as n}from"./p-0075138f.js";import{c as h}from"./p-cd6c2938.js";import{A as l,a as d,i as m}from"./p-33d5d1ed.js";import{d as b}from"./p-6ea84137.js";import{d as f}from"./p-387052e1.js";const u=r(c,["PRIMARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var p;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(p||(p={}));const v={root:"gov-toast",hidden:"gov-toast--hidden",content:"gov-toast__content",close:"gov-toast__close",timer:"gov-toast__timer"};const g=t(class t extends s{constructor(){super();this.__registerHost();this.govClose=e(this,"gov-close",7);this.color="primary";this.gravity="top";this.position="right";this.type="bold";this.time=0;this.closeLabel=undefined;this.accessibleCloseLabel=undefined;this.inheritedAttributes={};this.h=n(this.host);this.toastId=h("GovToast")}validateColor(t){a(u,t,v.root)}componentDidLoad(){this.attributeObserver=new l(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(d)}componentWillLoad(){this.validateColor(this.color);this.runTimer();this.inheritedAttributes=m(this.host)}disconnectedCallback(){clearTimeout(this.timeout);this.attributeObserver.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}runTimer(){if(this.isTimer){this.timeout=setTimeout((()=>{this.host.classList.add(v.hidden);setTimeout((()=>{this.destroy().catch();this.govClose.emit(this.toastId)}),600)}),this.time)}}render(){return i(o,{key:"595478e5b0bc6df5256332f59eb1fb8c5a186d47",class:this.h.classes(v.root),"data-toast-id":this.toastId,gravity:this.gravity,position:this.position,color:this.color,type:this.type,style:{"--toast-duration":this.time+"ms"}},this.h.hasSlot("icon")&&i("slot",{key:"d515d7be4fcad971f825b953a7ee6354cb7a36c8",name:"icon"}),i("div",Object.assign({key:"9e9e2895921e6309de75acba2c8340a1073ae243",class:v.content},this.inheritedAttributes,{"aria-live":"polite",role:"status"}),i("slot",{key:"d373fbf45bd63a84e116614971b8d6ccacc041e5"})),i("gov-button",{key:"0e3cc61c61632f5e3f2a9056299e86453a4cac3f",size:"s","aria-label":this.accessibleCloseLabel,color:this.isBold?this.color:"neutral",type:"base","on-gov-click":this.onCloseHandler.bind(this),class:v.close},this.closeLabel?this.closeLabel:i("gov-icon",{name:"x-lg"})),i("div",{key:"90ff65de7a67d968bbfb2726a5642052d7c125ce",class:v.timer}))}onCloseHandler(){this.govClose.emit(this.toastId);this.destroy().catch()}get isBold(){return this.type==="bold"}get isTimer(){return Number.isInteger(this.time)&&this.time>0}async destroy(){clearTimeout(this.timeout);const t=document.querySelector(`[data-toast-id="${this.toastId}"]`);if(t){t.classList.add(v.hidden);if(typeof t.remove==="function"){t.remove()}}}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-toast",{color:[1],gravity:[1],position:[1],type:[1],time:[2],closeLabel:[1,"close-label"],accessibleCloseLabel:[1,"accessible-close-label"],inheritedAttributes:[32],destroy:[64]},undefined,{color:["validateColor"]}]);function y(){if(typeof customElements==="undefined"){return}const t=["gov-toast","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-toast":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-button":if(!customElements.get(t)){b()}break;case"gov-icon":if(!customElements.get(t)){f()}break}}))}y();const j=g;const k=y;export{j as GovToast,k as defineCustomElement};
1
+ import{p as t,H as s,c as o,h as i,d as e}from"./p-42200001.js";import{v as a}from"./p-a2435993.js";import{C as c}from"./p-5aad3497.js";import{p as n}from"./p-e0e2e9c1.js";import{g as r}from"./p-ea7fdd2e.js";import{c as d}from"./p-cd6c2938.js";import{A as h,a as l,i as f}from"./p-33d5d1ed.js";import{d as m}from"./p-7d4f2214.js";import{d as b}from"./p-f44899e1.js";const p=n(c,["PRIMARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var u;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(u||(u={}));const v={root:"gov-toast",hidden:"gov-toast--hidden",content:"gov-toast__content",icon:"gov-toast__icon",close:"gov-toast__close",timer:"gov-toast__timer"};const g=t(class t extends s{constructor(){super();this.__registerHost();this.govClose=o(this,"gov-close",7);this.color="primary";this.gravity="top";this.position="right";this.type="bold";this.time=0;this.closeLabel=undefined;this.accessibleCloseLabel=undefined;this.inheritedAttributes={};this.h=r(this.host);this.toastId=d("GovToast")}validateColor(t){a(p,t,v.root)}componentDidLoad(){this.attributeObserver=new h(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(l)}componentWillLoad(){this.validateColor(this.color);this.runTimer();this.inheritedAttributes=f(this.host)}disconnectedCallback(){clearTimeout(this.timeout);this.attributeObserver.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}runTimer(){if(this.isTimer){this.timeout=setTimeout((()=>{this.host.classList.add(v.hidden);setTimeout((()=>{this.destroy().catch();this.govClose.emit(this.toastId)}),600)}),this.time)}}render(){return i(e,{key:"897da92a579e5854078657783d54c4fcca1f0311",class:this.h.classes(v.root),"data-toast-id":this.toastId,gravity:this.gravity,position:this.position,color:this.color,type:this.type,style:{"--toast-duration":this.time+"ms"}},this.h.hasSlot("icon")&&i("span",{key:"50b2dde54f6e566f95c81bbd5dd6c27870338a70",class:v.icon},i("slot",{key:"f47d01268f3098f56b064fc41dc18bab64771073",name:"icon"})),i("div",Object.assign({key:"4e508603bd41bc5375ecf2d84e5a1df239fcc6c4",class:v.content},this.inheritedAttributes,{"aria-live":"polite",role:"status"}),i("slot",{key:"ff7e107c1486319621a1832bdcc0387f56dc56db"})),i("gov-button",{key:"dfe2964f40d66df0335219b9bc66f5a316ecf8ca",size:"s","aria-label":this.accessibleCloseLabel,color:this.isBold?this.color:"neutral",type:"base","on-gov-click":this.onCloseHandler.bind(this),class:v.close},this.closeLabel?this.closeLabel:i("gov-icon",{name:"x-lg",type:"components"})),i("div",{key:"5f0c872a74f8cac07431903519ecc191322d4397",class:v.timer}))}onCloseHandler(){this.govClose.emit(this.toastId);this.destroy().catch()}get isBold(){return this.type==="bold"}get isTimer(){return Number.isInteger(this.time)&&this.time>0}async destroy(){clearTimeout(this.timeout);const t=document.querySelector(`[data-toast-id="${this.toastId}"]`);if(t){t.classList.add(v.hidden);if(typeof t.remove==="function"){t.remove()}}}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-toast",{color:[1],gravity:[1],position:[1],type:[1],time:[2],closeLabel:[1,"close-label"],accessibleCloseLabel:[1,"accessible-close-label"],inheritedAttributes:[32],destroy:[64]},undefined,{color:["validateColor"]}]);function y(){if(typeof customElements==="undefined"){return}const t=["gov-toast","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-toast":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-button":if(!customElements.get(t)){m()}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}y();const j=g;const k=y;export{j as GovToast,k as defineCustomElement};
2
2
  //# sourceMappingURL=gov-toast.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ToastColors","pick","Colors","ToastType","ToastClass","root","hidden","content","close","timer","GovToast","proxyCustomElement","H","constructor","this","h","govHost","host","toastId","createID","validateColor","newValue","validateProp","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","color","runTimer","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","clearTimeout","timeout","stopObserving","removeAttribute","Object","assign","isTimer","setTimeout","classList","add","destroy","catch","govClose","emit","time","render","Host","key","class","classes","gravity","position","type","style","hasSlot","name","role","size","accessibleCloseLabel","isBold","onCloseHandler","bind","closeLabel","Number","isInteger","toast","document","querySelector","remove"],"sources":["../../../packages/core/src/components/gov-toast/constants.ts","../../../packages/core/src/components/gov-toast/gov-toast.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const ToastColors = pick(Colors, ['PRIMARY', 'NEUTRAL', 'ERROR', 'SUCCESS', 'WARNING'])\nexport type ToastColorType = `${ValueOf<typeof ToastColors>}`\n\nexport enum ToastType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type ToastTypesType = `${ValueOf<typeof ToastType>}`\n\nexport const ToastClass = {\n\troot: 'gov-toast',\n\thidden: 'gov-toast--hidden',\n\tcontent: 'gov-toast__content',\n\tclose: 'gov-toast__close',\n\ttimer: 'gov-toast__timer',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {ToastClass, ToastColors, ToastColorType, ToastTypesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createID} from \"../../utils/string.utils\"\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: \"gov-toast\",\n})\nexport class GovToast {\n\tprivate h: GovHost\n\tprivate timeout\n\tprivate readonly toastId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.toastId = createID(\"GovToast\")\n\t}\n\n\t@Element() host: HTMLGovToastElement\n\t/**\n\t * Style variation of the toast message.\n\t */\n\t@Prop() readonly color?: ToastColorType = \"primary\"\n\n\t/**\n\t * Toast’s gravity\n\t */\n\t@Prop() readonly gravity: \"top\" | \"bottom\" = \"top\"\n\t/**\n\t * Toast’s position\n\t */\n\t@Prop() readonly position: \"left\" | \"center\" | \"right\" = \"right\"\n\t/**\n\t * Toast type\n\t */\n\t@Prop() readonly type?: ToastTypesType = \"bold\"\n\t/**\n\t * Number of milliseconds to wait before Toast disappear\n\t */\n\t@Prop() readonly time: number = 0\n\t/**\n\t * Closing button texting instead of icons\n\t */\n\t@Prop({attribute: \"close-label\"}) readonly closeLabel: string\n\t/**\n\t * Aria label for the closing button. It is mandatory if the alert is closable\n\t */\n\t@Prop({attribute: \"accessible-close-label\"}) readonly accessibleCloseLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: \"gov-close\"}) govClose: EventEmitter<string>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ToastColors, newValue, ToastClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.runTimer()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\n\tdisconnectedCallback() {\n\t\tclearTimeout(this.timeout)\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate runTimer() {\n\t\tif (this.isTimer) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.classList.add(ToastClass.hidden)\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.destroy().catch()\n\t\t\t\t\tthis.govClose.emit(this.toastId)\n\t\t\t\t}, 600)\n\t\t\t}, this.time)\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(ToastClass.root)}\n\t\t\t\tdata-toast-id={this.toastId}\n\t\t\t\tgravity={this.gravity}\n\t\t\t\tposition={this.position}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tstyle={{\"--toast-duration\": this.time + \"ms\"}}\n\t\t\t>\n\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t)}\n\n\t\t\t\t<div class={ToastClass.content} {...this.inheritedAttributes} aria-live=\"polite\" role=\"status\">\n\t\t\t\t\t<slot/>\n\t\t\t\t</div>\n\n\t\t\t\t<gov-button\n\t\t\t\t\tsize=\"s\"\n\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\tclass={ToastClass.close}\n\t\t\t\t>\n\t\t\t\t\t{this.closeLabel ? this.closeLabel : <gov-icon name=\"x-lg\"></gov-icon>}\n\t\t\t\t</gov-button>\n\n\t\t\t\t<div class={ToastClass.timer}></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(): void {\n\t\tthis.govClose.emit(this.toastId)\n\t\tthis.destroy().catch()\n\t}\n\n\tget isBold(): boolean {\n\t\treturn this.type === \"bold\"\n\t}\n\n\tget isTimer(): boolean {\n\t\treturn Number.isInteger(this.time) && this.time > 0\n\t}\n\n\t/**\n\t * Remove toast from dom\n\t */\n\t@Method()\n\tasync destroy(): Promise<void> {\n\t\tclearTimeout(this.timeout)\n\t\tconst toast = document.querySelector(`[data-toast-id=\"${this.toastId}\"]`)\n\t\tif (toast) {\n\t\t\ttoast.classList.add(ToastClass.hidden)\n\t\t\tif (typeof toast.remove === \"function\") {\n\t\t\t\ttoast.remove()\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"8WAIO,MAAMA,EAAcC,EAAKC,EAAQ,CAAC,UAAW,UAAW,QAAS,UAAW,YAGnF,IAAYC,GAAZ,SAAYA,GACXA,EAAA,eACAA,EAAA,kBACA,EAHD,CAAYA,MAAS,KAMd,MAAMC,EAAa,CACzBC,KAAM,YACNC,OAAQ,oBACRC,QAAS,qBACTC,MAAO,mBACPC,MAAO,oB,MCLKC,EAAQC,EAAA,MAAAD,UAAAE,EAMpB,WAAAC,G,6EAS0C,U,aAKG,M,cAIY,Q,UAIhB,O,UAIT,E,uFAmBW,GA5C1CC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,W,CAuCzB,aAAAC,CAAcC,GACbC,EAAatB,EAAaqB,EAAUjB,EAAWC,K,CAKhD,gBAAAkB,GACCT,KAAKU,kBAAoB,IAAIC,EAAkBX,KA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AAOjB,KAAKmD,OAASnD,KAAKiB,MAAQ,UAClC2B,KAAK,OAAM,eACG5C,KAAKoD,eAAeC,KAAKrD,MACvCwC,MAAOlD,EAAWI,OAEjBM,KAAKsD,WAAatD,KAAKsD,WAAarD,EAAA,YAAU8C,KAAK,UAGrD9C,EAAA,OAAAsC,IAAA,2CAAKC,MAAOlD,EAAWK,Q,CAKlB,cAAAyD,GACPpD,KAAKkC,SAASC,KAAKnC,KAAKI,SACxBJ,KAAKgC,UAAUC,O,CAGhB,UAAIkB,GACH,OAAOnD,KAAK4C,OAAS,M,CAGtB,WAAIhB,GACH,OAAO2B,OAAOC,UAAUxD,KAAKoC,OAASpC,KAAKoC,KAAO,C,CAOnD,aAAMJ,GACLV,aAAatB,KAAKuB,SAClB,MAAMkC,EAAQC,SAASC,cAAc,mBAAmB3D,KAAKI,aAC7D,GAAIqD,EAAO,CACVA,EAAM3B,UAAUC,IAAIzC,EAAWE,QAC/B,UAAWiE,EAAMG,SAAW,WAAY,CACvCH,EAAMG,Q","ignoreList":[]}
1
+ {"version":3,"names":["ToastColors","pick","Colors","ToastType","ToastClass","root","hidden","content","icon","close","timer","GovToast","proxyCustomElement","H","constructor","this","h","govHost","host","toastId","createID","validateColor","newValue","validateProp","componentDidLoad","attributeObserver","AttributeObserver","attributeName","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","color","runTimer","inheritedAttributes","inheritAriaAttributes","disconnectedCallback","clearTimeout","timeout","stopObserving","removeAttribute","Object","assign","isTimer","setTimeout","classList","add","destroy","catch","govClose","emit","time","render","Host","key","class","classes","gravity","position","type","style","hasSlot","name","role","size","accessibleCloseLabel","isBold","onCloseHandler","bind","closeLabel","Number","isInteger","toast","document","querySelector","remove"],"sources":["../../../packages/core/src/components/gov-toast/constants.ts","../../../packages/core/src/components/gov-toast/gov-toast.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const ToastColors = pick(Colors, ['PRIMARY', 'NEUTRAL', 'ERROR', 'SUCCESS', 'WARNING'])\nexport type ToastColorType = `${ValueOf<typeof ToastColors>}`\n\nexport enum ToastType {\n\tBOLD = 'bold',\n\tSUBTLE = 'subtle',\n}\nexport type ToastTypesType = `${ValueOf<typeof ToastType>}`\n\nexport const ToastClass = {\n\troot: 'gov-toast',\n\thidden: 'gov-toast--hidden',\n\tcontent: 'gov-toast__content',\n\ticon: 'gov-toast__icon',\n\tclose: 'gov-toast__close',\n\ttimer: 'gov-toast__timer',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {ToastClass, ToastColors, ToastColorType, ToastTypesType} from \"./constants\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createID} from \"../../utils/string.utils\"\nimport {AttributeObserver, Attributes} from \"../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: \"gov-toast\",\n})\nexport class GovToast {\n\tprivate h: GovHost\n\tprivate timeout\n\tprivate readonly toastId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.toastId = createID(\"GovToast\")\n\t}\n\n\t@Element() host: HTMLGovToastElement\n\t/**\n\t * Style variation of the toast message.\n\t */\n\t@Prop() readonly color?: ToastColorType = \"primary\"\n\n\t/**\n\t * Toast’s gravity\n\t */\n\t@Prop() readonly gravity: \"top\" | \"bottom\" = \"top\"\n\t/**\n\t * Toast’s position\n\t */\n\t@Prop() readonly position: \"left\" | \"center\" | \"right\" = \"right\"\n\t/**\n\t * Toast type\n\t */\n\t@Prop() readonly type?: ToastTypesType = \"bold\"\n\t/**\n\t * Number of milliseconds to wait before Toast disappear\n\t */\n\t@Prop() readonly time: number = 0\n\t/**\n\t * Closing button texting instead of icons\n\t */\n\t@Prop({attribute: \"close-label\"}) readonly closeLabel: string\n\t/**\n\t * Aria label for the closing button. It is mandatory if the alert is closable\n\t */\n\t@Prop({attribute: \"accessible-close-label\"}) readonly accessibleCloseLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: \"gov-close\"}) govClose: EventEmitter<string>\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(ToastColors, newValue, ToastClass.root)\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.runTimer()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\n\tdisconnectedCallback() {\n\t\tclearTimeout(this.timeout)\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\tprivate runTimer() {\n\t\tif (this.isTimer) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.classList.add(ToastClass.hidden)\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.destroy().catch()\n\t\t\t\t\tthis.govClose.emit(this.toastId)\n\t\t\t\t}, 600)\n\t\t\t}, this.time)\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(ToastClass.root)}\n\t\t\t\tdata-toast-id={this.toastId}\n\t\t\t\tgravity={this.gravity}\n\t\t\t\tposition={this.position}\n\t\t\t\tcolor={this.color}\n\t\t\t\ttype={this.type}\n\t\t\t\tstyle={{\"--toast-duration\": this.time + \"ms\"}}\n\t\t\t>\n\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t<span class={ToastClass.icon}>\n\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\n\t\t\t\t<div class={ToastClass.content} {...this.inheritedAttributes} aria-live=\"polite\" role=\"status\">\n\t\t\t\t\t<slot/>\n\t\t\t\t</div>\n\n\t\t\t\t<gov-button\n\t\t\t\t\tsize=\"s\"\n\t\t\t\t\taria-label={this.accessibleCloseLabel}\n\t\t\t\t\tcolor={this.isBold ? this.color : \"neutral\"}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\tclass={ToastClass.close}\n\t\t\t\t>\n\t\t\t\t\t{this.closeLabel ? this.closeLabel : <gov-icon name=\"x-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t</gov-button>\n\n\t\t\t\t<div class={ToastClass.timer}></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(): void {\n\t\tthis.govClose.emit(this.toastId)\n\t\tthis.destroy().catch()\n\t}\n\n\tget isBold(): boolean {\n\t\treturn this.type === \"bold\"\n\t}\n\n\tget isTimer(): boolean {\n\t\treturn Number.isInteger(this.time) && this.time > 0\n\t}\n\n\t/**\n\t * Remove toast from dom\n\t */\n\t@Method()\n\tasync destroy(): Promise<void> {\n\t\tclearTimeout(this.timeout)\n\t\tconst toast = document.querySelector(`[data-toast-id=\"${this.toastId}\"]`)\n\t\tif (toast) {\n\t\t\ttoast.classList.add(ToastClass.hidden)\n\t\t\tif (typeof toast.remove === \"function\") {\n\t\t\t\ttoast.remove()\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"8WAIO,MAAMA,EAAcC,EAAKC,EAAQ,CAAC,UAAW,UAAW,QAAS,UAAW,YAGnF,IAAYC,G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{T as o,a as n,b as a}from"./p-565120d5.js";import{c}from"./p-0075138f.js";import{d as l}from"./p-6ea84137.js";import{d as r}from"./p-387052e1.js";const h=t(class t extends s{constructor(){super();this.__registerHost();this.color=o.PRIMARY;this.size=n._M;this.persist=false;this.isVisible=false;this.parentId=null}visibleContent(t){clearTimeout(this.timeout);if(t===false){this.timeout=setTimeout((()=>{this.host.style.visibility="hidden"}),250)}else{this.host.style.visibility="visible"}}hideContent(){this.isVisible=false;this.persist=false;const t=document.getElementById(this.parentId);if(t){t.hide().catch()}}render(){return e(i,{key:"f57a1f6fb8d74271b6fc993838115ab419d9b429",class:a.root,role:"tooltip",hidden:!this.isVisible,"aria-hidden":!c(this.isVisible),"is-visible":this.isVisible},e("slot",{key:"921baaaaa6286be7365cefaaaea8ecc20c16bebf"}),this.persist?e("gov-button",{"on-gov-click":this.hideContent.bind(this),color:this.color,size:this.size,type:"base"},e("gov-icon",{slot:"left-icon",name:"x-lg",type:"basic"})):null)}get host(){return this}static get watchers(){return{isVisible:["visibleContent"]}}},[4,"gov-tooltip-content",{color:[1],size:[1],persist:[4],isVisible:[1028,"is-visible"],parentId:[1,"parent-id"]},undefined,{isVisible:["visibleContent"]}]);function f(){if(typeof customElements==="undefined"){return}const t=["gov-tooltip-content","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-tooltip-content":if(!customElements.get(t)){customElements.define(t,h)}break;case"gov-button":if(!customElements.get(t)){l()}break;case"gov-icon":if(!customElements.get(t)){r()}break}}))}f();const b=h;const m=f;export{b as GovTooltipContent,m as defineCustomElement};
1
+ import{p as t,H as s,h as e,d as i}from"./p-42200001.js";import{T as o,a as n,b as c}from"./p-76d604c6.js";import{c as a}from"./p-ea7fdd2e.js";import{d as l}from"./p-7d4f2214.js";import{d as r}from"./p-f44899e1.js";const h=t(class t extends s{constructor(){super();this.__registerHost();this.color=o.PRIMARY;this.size=n._M;this.persist=false;this.isVisible=false;this.parentId=null}visibleContent(t){clearTimeout(this.timeout);if(t===false){this.timeout=setTimeout((()=>{this.host.style.visibility="hidden"}),250)}else{this.host.style.visibility="visible"}}hideContent(){this.isVisible=false;this.persist=false;const t=document.getElementById(this.parentId);if(t){t.hide().catch()}}render(){return e(i,{key:"9775080ab420c435e879ee1516f16bd7fb35f18d",class:c.root,role:"tooltip",hidden:!this.isVisible,"aria-hidden":!a(this.isVisible),"is-visible":this.isVisible},e("slot",{key:"b5a4adc4ff5ce735d2c1d3688a031e08cb8a97a1"}),this.persist?e("gov-button",{"on-gov-click":this.hideContent.bind(this),color:this.color,size:this.size,type:"base"},e("gov-icon",{slot:"icon-start",name:"x-lg",type:"components"})):null)}get host(){return this}static get watchers(){return{isVisible:["visibleContent"]}}},[4,"gov-tooltip-content",{color:[1],size:[1],persist:[4],isVisible:[1028,"is-visible"],parentId:[1,"parent-id"]},undefined,{isVisible:["visibleContent"]}]);function d(){if(typeof customElements==="undefined"){return}const t=["gov-tooltip-content","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-tooltip-content":if(!customElements.get(t)){customElements.define(t,h)}break;case"gov-button":if(!customElements.get(t)){l()}break;case"gov-icon":if(!customElements.get(t)){r()}break}}))}d();const f=h;const m=d;export{f as GovTooltipContent,m as defineCustomElement};
2
2
  //# sourceMappingURL=gov-tooltip-content.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GovTooltipContent","proxyCustomElement","H","TooltipColors","PRIMARY","TooltipSize","_M","visibleContent","newValue","clearTimeout","this","timeout","setTimeout","host","style","visibility","hideContent","isVisible","persist","parentEl","document","getElementById","parentId","hide","catch","render","h","Host","key","class","TooltipContentClass","root","role","hidden","toBoolAttr","bind","color","size","type","slot","name"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipColors, TooltipColorType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t<slot></slot>\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}>\n\t\t\t\t\t\t<gov-icon slot={\"left-icon\"} name={\"x-lg\"} type={\"basic\"}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"wNAOaA,EAAiBC,EAAA,MAAAD,UAAAE,E,uDAOeC,EAAcC,Q,UAIhBC,EAAYC,G,aAI1B,M,eAIkC,M,cAIT,I,CAGrD,cAAAC,CAAeC,GACdC,aAAaC,KAAKC,SAClB,GAAIH,IAAa,MAAO,CACvBE,KAAKC,QAAUC,YAAW,KACzBF,KAAKG,KAAKC,MAAMC,WAAa,QAAQ,GACnC,I,KACG,CACNL,KAAKG,KAAKC,MAAMC,WAAa,S,EAI/B,WAAAC,GACCN,KAAKO,UAAY,MACjBP,KAAKQ,QAAU,MACf,MAAMC,EAAWC,SAASC,eAAeX,KAAKY,UAC9C,GAAIH,EAAU,CACbA,EAASI,OAAOC,O,EAIlB,MAAAC,GACC,OACCC,EAACC,EAAI,CAAAC,IAAA,2CACJC,MAAOC,EAAoBC,KAC3BC,KAAM,UACNC,QAASvB,KAAKO,UAAS,eACTiB,EAAWxB,KAAKO,WAAU,aAC5BP,KAAKO,WACjBS,EAAA,QAAAE,IAAA,6CACClB,KAAKQ,QACLQ,EAAA,6BACehB,KAAKM,YAAYmB,KAAKzB,MACpC0B,MAAO1B,KAAK0B,MACZC,KAAM3B,KAAK2B,KACXC,KAAM,QACNZ,EAAA,YAAUa,KAAM,YAAaC,KAAM,OAAQF,KAAM,WAE/C,K","ignoreList":[]}
1
+ {"version":3,"names":["GovTooltipContent","proxyCustomElement","H","TooltipColors","PRIMARY","TooltipSize","_M","visibleContent","newValue","clearTimeout","this","timeout","setTimeout","host","style","visibility","hideContent","isVisible","persist","parentEl","document","getElementById","parentId","hide","catch","render","h","Host","key","class","TooltipContentClass","root","role","hidden","toBoolAttr","bind","color","size","type","slot","name"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipColors, TooltipColorType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t<slot></slot>\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}>\n\t\t\t\t\t\t<gov-icon slot={\"icon-start\"} name={\"x-lg\"} type={\"components\"}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"6NAOaA,EAAiBC,EAAA,MAAAD,UAAAE,E,uDAOeC,EAAcC,Q,UAIhBC,EAAYC,G,aAI1B,M,eAIkC,M,cAIT,I,CAGrD,cAAAC,CAAeC,GACdC,aAAaC,KAAKC,SAClB,GAAIH,IAAa,MAAO,CACvBE,KAAKC,QAAUC,YAAW,KACzBF,KAAKG,KAAKC,MAAMC,WAAa,QAAQ,GACnC,I,KACG,CACNL,KAAKG,KAAKC,MAAMC,WAAa,S,EAI/B,WAAAC,GACCN,KAAKO,UAAY,MACjBP,KAAKQ,QAAU,MACf,MAAMC,EAAWC,SAASC,eAAeX,KAAKY,UAC9C,GAAIH,EAAU,CACbA,EAASI,OAAOC,O,EAIlB,MAAAC,GACC,OACCC,EAACC,EAAI,CAAAC,IAAA,2CACJC,MAAOC,EAAoBC,KAC3BC,KAAM,UACNC,QAASvB,KAAKO,UAAS,eACTiB,EAAWxB,KAAKO,WAAU,aAC5BP,KAAKO,WACjBS,EAAA,QAAAE,IAAA,6CACClB,KAAKQ,QACLQ,EAAA,6BACehB,KAAKM,YAAYmB,KAAKzB,MACpC0B,MAAO1B,KAAK0B,MACZC,KAAM3B,KAAK2B,KACXC,KAAM,QACNZ,EAAA,YAAUa,KAAM,aAAcC,KAAM,OAAQF,KAAM,gBAEhD,K","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as t,H as i,h as s,d as e}from"./p-42200001.js";import{v as o}from"./p-19c681a3.js";import{T as h,a as n,b as a,c as r,d as c}from"./p-565120d5.js";import{c as l}from"./p-cd6c2938.js";import{g as d}from"./p-0075138f.js";import{e as f}from"./p-7501abe8.js";import{t as p}from"./p-26618322.js";const u=t(class t extends i{constructor(){super();this.__registerHost();this.tooltipContentId=undefined;this.tooltipId=undefined;this.color=h.PRIMARY;this.size=n._M;this.position="right";this.message=undefined;this.identifier=undefined;this.icon=undefined;this.persist=false;this.h=d(this.host);this.tooltipId=l("GovTooltip");this.tooltipContentId=l("GovContentTooltip")}validateColor(t){o(h,t,c.root)}validateSize(t){o(n,t,c.root)}validatePosition(t){o(r,t,c.root)}rerenderMessage(){this.createContentWrapper()}connectedCallback(){this.createContentWrapper();this.registerListeners()}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size);this.validatePosition(this.position)}componentDidUpdate(){this.createContentWrapper()}disconnectedCallback(){this.removeContent()}createContentWrapper(){var t;if(this.tooltipContent){if(this.message){this.tooltipContent.innerHTML=this.message}else if(this.insideContent){this.tooltipContent.innerHTML=this.insideContent.innerHTML}return}let i;if(this.insideContent){i=this.insideContent}else{i=f().createElement(a.root);i.innerHTML=this.message}i.setAttribute("id",(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId);i.setAttribute("parent-id",this.tooltipId);i.setAttribute("color",this.color);i.setAttribute("size",this.size);f().body.appendChild(i)}get tooltipContent(){var t;return f().body.querySelector(`#${(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId}`)}get insideContent(){return this.host.querySelector(a.root)}registerListeners(){this.host.addEventListener("click",(t=>{t.preventDefault();this.persist=true;if(this.tooltipContent){this.tooltipContent.setAttribute("persist","true")}this.showTooltip()}));this.host.addEventListener("mouseenter",(t=>{t.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(t=>{t.preventDefault();if(this.persist===false){this.hideTooltip()}}))}verifyPositionSpace(){const t=12;const i=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);const s=this.host.getBoundingClientRect();const e=this.host.offsetWidth;const o=this.host.offsetHeight;const h=this.tooltipContent.offsetWidth;const n=this.tooltipContent.offsetHeight;const a={left:s.left+document.documentElement.scrollLeft,top:s.top+document.documentElement.scrollTop};const c=a.left+t+s.width+h<=i;const l=a.left>h;if(this.position===r.LEFT||this.position===r.RIGHT){this.tooltipContent.style.top=a.top-(n-o)/2+"px";if(c===false&&l===false){this.position=r.TOP;this.tooltipContent.setAttribute("position",r.TOP)}if(l&&c===false&&this.position===r.RIGHT){this.position=r.LEFT}if(c&&l===false&&this.position===r.LEFT){this.position=r.RIGHT}}if(this.position===r.RIGHT){this.tooltipContent.setAttribute("position",r.RIGHT);this.tooltipContent.style.left=a.left+t+s.width+"px"}if(this.position===r.LEFT){this.tooltipContent.setAttribute("position",r.LEFT);this.tooltipContent.style.left=a.left-(h+t)+"px"}if(this.position===r.TOP||this.position===r.BOTTOM){if(h>e){let s=a.left-(h-e)/2;const o=s<0;const n=s+h>i;if(o&&n){this.tooltipContent.style.width="auto";this.tooltipContent.style.left=t+"px";this.tooltipContent.style.right=t+"px"}else{if(o){s=t}if(n){s=s-(i-(s+h+t))*-1}this.tooltipContent.style.left=s+"px"}}else{const t=a.left+(e-h)/2;this.tooltipContent.style.left=t+"px"}}if(this.position===r.TOP){this.tooltipContent.setAttribute("position",r.TOP);this.tooltipContent.style.top=a.top-(n+t)+"px"}if(this.position===r.BOTTOM){this.tooltipContent.setAttribute("position",r.BOTTOM);this.tooltipContent.style.top=a.top+(o+t)+"px"}this.tooltipContent.style.opacity="1"}showTooltip(){if(this.tooltipContent){this.tooltipContent.style.opacity="0";this.tooltipContent.hidden=false;this.tooltipContent.setAttribute("is-visible","true");p((()=>{this.verifyPositionSpace()}))}}hideTooltip(){if(this.tooltipContent){this.tooltipContent.setAttribute("is-visible","false");this.tooltipContent.setAttribute("persist","false");this.tooltipContent.removeAttribute("style")}}removeContent(){const t=document.getElementById(this.tooltipContentId);if(t){t.remove()}}render(){var t;return s(e,{key:"062963ab589de44e81d5b8c99e60e52caed85373",id:this.tooltipId,class:this.h.classes(c.root),position:this.position},s("span",{key:"2e9be2bc7a907ff709b4e7468f590d44a2936352",role:"button",tabindex:0,onKeyPress:()=>this.showTooltip(),onBlur:()=>{if(this.persist===false){this.hideTooltip()}},"aria-describedby":(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId},s("slot",{key:"e8c852804d1e84f31ca4bc6a8f9454c8ce98e6a6"})))}async show(){this.showTooltip()}async hide(){this.persist=false;this.hideTooltip()}get host(){return this}static get watchers(){return{color:["validateColor"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}}},[4,"gov-tooltip",{color:[1],size:[1],position:[1025],message:[1],identifier:[1],icon:[516],persist:[32],show:[64],hide:[64]},undefined,{color:["validateColor"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}]);function m(){if(typeof customElements==="undefined"){return}const t=["gov-tooltip"];t.forEach((t=>{switch(t){case"gov-tooltip":if(!customElements.get(t)){customElements.define(t,u)}break}}))}m();const v=u;const b=m;export{v as GovTooltip,b as defineCustomElement};
1
+ import{p as t,H as i,h as s,d as e}from"./p-42200001.js";import{v as o}from"./p-a2435993.js";import{T as h,a as n,b as a,c as r,d}from"./p-76d604c6.js";import{c}from"./p-cd6c2938.js";import{g as l}from"./p-ea7fdd2e.js";import{d as f}from"./p-20c2203a.js";import{t as p}from"./p-26618322.js";const u=t(class t extends i{constructor(){super();this.__registerHost();this.tooltipContentId=undefined;this.tooltipId=undefined;this.color=h.PRIMARY;this.size=n._M;this.position="right";this.message=undefined;this.identifier=undefined;this.icon=undefined;this.persist=false;this.h=l(this.host);this.tooltipId=c("GovTooltip");this.tooltipContentId=c("GovContentTooltip")}validateColor(t){o(h,t,d.root)}validateSize(t){o(n,t,d.root)}validatePosition(t){o(r,t,d.root)}rerenderMessage(){this.createContentWrapper()}connectedCallback(){this.createContentWrapper();this.registerListeners()}componentWillLoad(){this.validateColor(this.color);this.validateSize(this.size);this.validatePosition(this.position)}componentDidUpdate(){this.createContentWrapper()}disconnectedCallback(){this.removeContent()}createContentWrapper(){var t;if(this.tooltipContent){if(this.message){this.tooltipContent.innerHTML=this.message}else if(this.insideContent){this.tooltipContent.innerHTML=this.insideContent.innerHTML}return}let i;if(this.insideContent){i=this.insideContent}else{i=f().createElement(a.root);i.innerHTML=this.message}i.setAttribute("id",(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId);i.setAttribute("parent-id",this.tooltipId);i.setAttribute("color",this.color);i.setAttribute("size",this.size);f().body.appendChild(i)}get tooltipContent(){var t;return f().body.querySelector(`#${(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId}`)}get insideContent(){return this.host.querySelector(a.root)}registerListeners(){this.host.addEventListener("click",(t=>{t.preventDefault();this.persist=true;if(this.tooltipContent){this.tooltipContent.setAttribute("persist","true")}this.showTooltip()}));this.host.addEventListener("mouseenter",(t=>{t.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(t=>{t.preventDefault();if(this.persist===false){this.hideTooltip()}}))}verifyPositionSpace(){const t=12;const i=window.innerWidth-(window.innerWidth-document.documentElement.clientWidth);const s=this.host.getBoundingClientRect();const e=this.host.offsetWidth;const o=this.host.offsetHeight;const h=this.tooltipContent.offsetWidth;const n=this.tooltipContent.offsetHeight;const a={left:s.left+document.documentElement.scrollLeft,top:s.top+document.documentElement.scrollTop};const d=a.left+t+s.width+h<=i;const c=a.left>h;if(this.position===r.LEFT||this.position===r.RIGHT){this.tooltipContent.style.top=a.top-(n-o)/2+"px";if(d===false&&c===false){this.position=r.TOP;this.tooltipContent.setAttribute("position",r.TOP)}if(c&&d===false&&this.position===r.RIGHT){this.position=r.LEFT}if(d&&c===false&&this.position===r.LEFT){this.position=r.RIGHT}}if(this.position===r.RIGHT){this.tooltipContent.setAttribute("position",r.RIGHT);this.tooltipContent.style.left=a.left+t+s.width+"px"}if(this.position===r.LEFT){this.tooltipContent.setAttribute("position",r.LEFT);this.tooltipContent.style.left=a.left-(h+t)+"px"}if(this.position===r.TOP||this.position===r.BOTTOM){if(h>e){let s=a.left-(h-e)/2;const o=s<0;const n=s+h>i;if(o&&n){this.tooltipContent.style.width="auto";this.tooltipContent.style.left=t+"px";this.tooltipContent.style.right=t+"px"}else{if(o){s=t}if(n){s=s-(i-(s+h+t))*-1}this.tooltipContent.style.left=s+"px"}}else{const t=a.left+(e-h)/2;this.tooltipContent.style.left=t+"px"}}if(this.position===r.TOP){this.tooltipContent.setAttribute("position",r.TOP);this.tooltipContent.style.top=a.top-(n+t)+"px"}if(this.position===r.BOTTOM){this.tooltipContent.setAttribute("position",r.BOTTOM);this.tooltipContent.style.top=a.top+(o+t)+"px"}this.tooltipContent.style.opacity="1"}showTooltip(){if(this.tooltipContent){this.tooltipContent.style.opacity="0";this.tooltipContent.hidden=false;this.tooltipContent.setAttribute("is-visible","true");p((()=>{this.verifyPositionSpace()}))}}hideTooltip(){if(this.tooltipContent){this.tooltipContent.setAttribute("is-visible","false");this.tooltipContent.setAttribute("persist","false");this.tooltipContent.removeAttribute("style")}}removeContent(){const t=document.getElementById(this.tooltipContentId);if(t){t.remove()}}render(){var t;return s(e,{key:"bc4cfa206b2e4060ca6070f0d4796df1a5df1bfc",id:this.tooltipId,class:this.h.classes(d.root),position:this.position},s("span",{key:"8ce3bf37e9ab13190c476db7cf47b7d0319719fe",role:"button",tabindex:0,onKeyPress:()=>this.showTooltip(),onBlur:()=>{if(this.persist===false){this.hideTooltip()}},"aria-describedby":(t=this.identifier)!==null&&t!==void 0?t:this.tooltipContentId},s("slot",{key:"c622fcd797a2c0dd303395d2d6391fbc747e4d18"})))}async show(){this.showTooltip()}async hide(){this.persist=false;this.hideTooltip()}get host(){return this}static get watchers(){return{color:["validateColor"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}}},[4,"gov-tooltip",{color:[1],size:[1],position:[1025],message:[1],identifier:[1],icon:[516],persist:[32],show:[64],hide:[64]},undefined,{color:["validateColor"],size:["validateSize"],position:["validatePosition"],message:["rerenderMessage"]}]);function m(){if(typeof customElements==="undefined"){return}const t=["gov-tooltip"];t.forEach((t=>{switch(t){case"gov-tooltip":if(!customElements.get(t)){customElements.define(t,u)}break}}))}m();const v=u;const b=m;export{v as GovTooltip,b as defineCustomElement};
2
2
  //# sourceMappingURL=gov-tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["GovTooltip","proxyCustomElement","H","constructor","this","tooltipContentId","undefined","tooltipId","TooltipColors","PRIMARY","TooltipSize","_M","h","govHost","host","createID","validateColor","newValue","validateProp","TooltipClass","root","validateSize","validatePosition","TooltipPosition","rerenderMessage","createContentWrapper","connectedCallback","registerListeners","componentWillLoad","color","size","position","componentDidUpdate","disconnectedCallback","removeContent","tooltipContent","message","innerHTML","insideContent","content","documentNode","createElement","TooltipContentClass","setAttribute","_a","identifier","body","appendChild","querySelector","addEventListener","e","preventDefault","persist","showTooltip","hideTooltip","verifyPositionSpace","offset","windowWidth","window","innerWidth","document","documentElement","clientWidth","trigger","getBoundingClientRect","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","left","scrollLeft","top","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","style","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","tick","removeAttribute","contentEl","getElementById","remove","render","Host","key","id","class","classes","role","tabindex","onKeyPress","onBlur","show","hide"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx"],"sourcesContent":["import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.message\n\t\t\t} else if (this.insideContent) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.insideContent.innerHTML\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tcontent.innerHTML = this.message\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}>\n\t\t\t\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"],"mappings":"mTAsBaA,EAAUC,EAAA,MAAAD,UAAAE,EAKtB,WAAAC,G,8BAHiBC,KAAAC,iBAAmBC,UACnBF,KAAAG,UAAYD,U,WAYeE,EAAcC,Q,UAIhBC,EAAYC,G,cAIC,Q,aAIpBL,U,oCAQaA,U,aAE7B,MA/BlBF,KAAKQ,EAAIC,EAAQT,KAAKU,MACtBV,KAAKG,UAAYQ,EAAS,cAC1BX,KAAKC,iBAAmBU,EAAS,oB,CAgClC,aAAAC,CAAcC,GACbC,EAAaV,EAAeS,EAAUE,EAAaC,K,CAIpD,YAAAC,CAAaJ,GACZC,EAAaR,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2B,WAAaR,EAAgB4D,OAAQ,CAC7C/E,KAAK+B,eAAeQ,aAAa,WAAYpB,EAAgB4D,QAC7D/E,KAAK+B,eAAe8C,MAAMP,IAAOH,EAAWG,KAAOP,EAAYX,GAAW,I,CAG3EpD,KAAK+B,eAAe8C,MAAMO,QAAU,G,CAI7B,WAAAnC,GACP,GAAIjD,KAAK+B,eAAgB,CACxB/B,KAAK+B,eAAe8C,MAAMO,QAAU,IACpCpF,KAAK+B,eAAesD,OAAS,MAC7BrF,KAAK+B,eAAeQ,aAAa,aAAc,QAC/C+C,GAAK,KACJtF,KAAKmD,qBAAqB,G,EAKrB,WAAAD,GACP,GAAIlD,KAAK+B,eAAgB,CACxB/B,KAAK+B,eAAeQ,aAAa,aAAc,SAC/CvC,KAAK+B,eAAeQ,aAAa,UAAW,SAC5CvC,KAAK+B,eAAewD,gBAAgB,Q,EAI9B,aAAAzD,GACP,MAAM0D,EAAYhC,SAASiC,eAAezF,KAAKC,kBAC/C,GAAIuF,EAAW,CACdA,EAAUE,Q,EAIZ,MAAAC,G,MACC,OACCnF,EAACoF,EAAI,CAAAC,IAAA,2CACJC,GAAI9F,KAAKG,UACT4F,MAAO/F,KAAKQ,EAAEwF,QAAQjF,EAAaC,MACnCW,SAAU3B,KAAK2B,UACfnB,EAAA,QAAAqF,IAAA,2CAAMI,KAAM,SACTC,SAAU,EACVC,WAAY,IAAMnG,KAAKiD,cACvBmD,OAAQ,KACP,GAAIpG,KAAKgD,UAAY,MAAO,CAC3BhD,KAAKkD,a,GAEN,oBACiBV,EAAAxC,KAAKyC,cAAU,MAAAD,SAAA,EAAAA,EAAIxC,KAAKC,kBAAkBO,EAAA,QAAAqF,IAAA,8C,CASlE,UAAMQ,GACLrG,KAAKiD,a,CAON,UAAMqD,GACLtG,KAAKgD,QAAU,MACfhD,KAAKkD,a","ignoreList":[]}
1
+ {"version":3,"names":["GovTooltip","proxyCustomElement","H","constructor","this","tooltipContentId","undefined","tooltipId","TooltipColors","PRIMARY","TooltipSize","_M","h","govHost","host","createID","validateColor","newValue","validateProp","TooltipClass","root","validateSize","validatePosition","TooltipPosition","rerenderMessage","createContentWrapper","connectedCallback","registerListeners","componentWillLoad","color","size","position","componentDidUpdate","disconnectedCallback","removeContent","tooltipContent","message","innerHTML","insideContent","content","documentNode","createElement","TooltipContentClass","setAttribute","_a","identifier","body","appendChild","querySelector","addEventListener","e","preventDefault","persist","showTooltip","hideTooltip","verifyPositionSpace","offset","windowWidth","window","innerWidth","document","documentElement","clientWidth","trigger","getBoundingClientRect","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","left","scrollLeft","top","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","style","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","tick","removeAttribute","contentEl","getElementById","remove","render","Host","key","id","class","classes","role","tabindex","onKeyPress","onBlur","show","hide"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx"],"sourcesContent":["import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.message\n\t\t\t} else if (this.insideContent) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.insideContent.innerHTML\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tcontent.innerHTML = this.message\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}>\n\t\t\t\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"],"mappings":"ySAsBaA,EAAUC,EAAA,MAAAD,UAAAE,EAKtB,WAAAC,G,8BAHiBC,KAAAC,iBAAmBC,UACnBF,KAAAG,UAAYD,U,WAYeE,EAAcC,Q,UAIhBC,EAAYC,G,cAIC,Q,aAIpBL,U,oCAQaA,U,aAE7B,MA/BlBF,KAAKQ,EAAIC,EAAQT,KAAKU,MACtBV,KAAKG,UAAYQ,EAAS,cAC1BX,KAAKC,iBAAmBU,EAAS,oB,CAgClC,aAAAC,CAAcC,GACbC,EAAaV,EAAeS,EAAUE,EAAaC,K,CAIpD,YAAAC,CAAaJ,GACZC,EAAaR,EAAaO,EAAUE,EAAaC,K,CAIlD,gBAAAE,CAAiBL,GAChBC,EAAaK,EAAiBN,EAAUE,EAAaC,K,CAItD,eAAAI,GACC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MAAMP,IAAOH,EAAWG,KAAOP,EAAYX,GAAW,I,CAG3EpD,KAAK+B,eAAe8C,MAAMO,QAAU,G,CAI7B,WAAAnC,GACP,GAAIjD,KAAK+B,eAAgB,CACxB/B,KAAK+B,eAAe8C,MAAMO,QAAU,IACpCpF,KAAK+B,eAAesD,OAAS,MAC7BrF,KAAK+B,eAAeQ,aAAa,aAAc,QAC/C+C,GAAK,KACJtF,KAAKmD,qBAAqB,G,EAKrB,WAAAD,GACP,GAAIlD,KAAK+B,eAAgB,CACxB/B,KAAK+B,eAAeQ,aAAa,aAAc,SAC/CvC,KAAK+B,eAAeQ,aAAa,UAAW,SAC5CvC,KAAK+B,eAAewD,gBAAgB,Q,EAI9B,aAAAzD,GACP,MAAM0D,EAAYhC,SAASiC,eAAezF,KAAKC,kBAC/C,GAAIuF,EAAW,CACdA,EAAUE,Q,EAIZ,MAAAC,G,MACC,OACCnF,EAACoF,EAAI,CAAAC,IAAA,2CACJC,GAAI9F,KAAKG,UACT4F,MAAO/F,KAAKQ,EAAEwF,QAAQjF,EAAaC,MACnCW,SAAU3B,KAAK2B,UACfnB,EAAA,QAAAqF,IAAA,2CAAMI,KAAM,SACTC,SAAU,EACVC,WAAY,IAAMnG,KAAKiD,cACvBmD,OAAQ,KACP,GAAIpG,KAAKgD,UAAY,MAAO,CAC3BhD,KAAKkD,a,GAEN,oBACiBV,EAAAxC,KAAKyC,cAAU,MAAAD,SAAA,EAAAA,EAAIxC,KAAKC,kBAAkBO,EAAA,QAAAqF,IAAA,8C,CASlE,UAAMQ,GACLrG,KAAKiD,a,CAON,UAAMqD,GACLtG,KAAKgD,QAAU,MACfhD,KAAKkD,a","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as s,H as t,c as i,h as e,d as a}from"./p-42200001.js";import{v as o}from"./p-19c681a3.js";import{W as n,c as d}from"./p-0c93dd39.js";import{c}from"./p-cd6c2938.js";import{g as h,b as l,t as r}from"./p-0075138f.js";import{d as m}from"./p-387052e1.js";var f;(function(s){s["DIV"]="div";s["BUTTON"]="button"})(f||(f={}));const p=s(class s extends t{constructor(){super();this.__registerHost();this.govChange=i(this,"gov-change",7);this.hydrated=false;this.color="primary";this.size="m";this.identifier=undefined;this.collapsible=false;this.disabled=false;this.isExpanded=false;this.h=h(this.host);this.triggerId=c("GovWizardItem");this.contentId=c("GovWizardContent")}validateColor(s){o(d,s,n.root)}emmitChange(){this.govChange.emit({expanded:this.isExpanded,component:n.root})}componentWillLoad(){this.validateColor(this.color)}connectedCallback(){this.hydrated=true}render(){const s=this.identifier||this.triggerId;const t=this.collapsible?f.BUTTON:f.DIV;const i=this.h.hasSlot("prefix")&&e("span",{key:"89a426f07ecb1d1b32fbdb39052a2ac7d8049c2a",class:n.prefix},e("slot",{key:"26e071baf3858a37ce9bda6cf9f09947abd21db0",name:"prefix"}));return e(a,{key:"e8e377730b03812ee75737606565ddd968e209fd",class:this.h.classes(n.root),"is-expanded":this.isExpanded,color:this.color,size:this.size,role:"listitem",collapsible:this.collapsible,hydrated:this.hydrated},e("div",{key:"4ea2d580649e6183df0aafdef2de7262bffbe7c0",class:n.header},i,this.collapsible?e(t,{id:s,class:this.h.classes(n.label),"aria-expanded":l(this.isExpanded),"aria-controls":this.contentId,disabled:this.disabled,"aria-disabled":r(this.disabled),onClick:s=>{s.preventDefault();s.stopPropagation();this.toggle()}},e("span",{class:n.headline},e("slot",{name:"headline"}),this.collapsible&&e("gov-icon",{class:n.chevron,name:"chevron-down"})),e("slot",{name:"annotation"})):e(t,{class:this.h.classes(n.label)},e("span",{class:n.headline},e("slot",{name:"headline"}),this.collapsible&&e("gov-icon",{class:n.chevron,name:"chevron-down"})),e("slot",{name:"annotation"}))),this.collapsible?e("div",{class:n.content,id:this.contentId,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":s},e("slot",null)):e("div",{class:n.content,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded},e("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-wizard-item",{color:[1],size:[1],identifier:[1],collapsible:[4],disabled:[4],isExpanded:[1028,"is-expanded"],open:[64],close:[64],toggle:[64],currentState:[64]},undefined,{color:["validateColor"]}]);function b(){if(typeof customElements==="undefined"){return}const s=["gov-wizard-item","gov-icon"];s.forEach((s=>{switch(s){case"gov-wizard-item":if(!customElements.get(s)){customElements.define(s,p)}break;case"gov-icon":if(!customElements.get(s)){m()}break}}))}b();const u=p;const v=b;export{u as GovWizardItem,v as defineCustomElement};
1
+ import{p as s,H as t,c as e,h as i,d as a}from"./p-42200001.js";import{v as o}from"./p-a2435993.js";import{W as n,c}from"./p-c61a5830.js";import{c as d}from"./p-cd6c2938.js";import{g as h,b as l,t as r}from"./p-ea7fdd2e.js";import{d as m}from"./p-f44899e1.js";var f;(function(s){s["DIV"]="div";s["BUTTON"]="button"})(f||(f={}));const p=s(class s extends t{constructor(){super();this.__registerHost();this.govChange=e(this,"gov-change",7);this.hydrated=false;this.color="primary";this.size="m";this.identifier=undefined;this.collapsible=false;this.disabled=false;this.isExpanded=false;this.h=h(this.host);this.triggerId=d("GovWizardItem");this.contentId=d("GovWizardContent")}validateColor(s){o(c,s,n.root)}emmitChange(){this.govChange.emit({expanded:this.isExpanded,component:n.root})}componentWillLoad(){this.validateColor(this.color)}connectedCallback(){this.hydrated=true}render(){const s=this.identifier||this.triggerId;const t=this.collapsible?f.BUTTON:f.DIV;const e=this.h.hasSlot("prefix")&&i("span",{key:"5b4e2b9c66285827959d4df9801cef2b8de29764",class:n.prefix},i("slot",{key:"6ffa576fe3be8febb899186208d8aa7ae1fecd96",name:"prefix"}));return i(a,{key:"60fd0ec72cb212f73dddeec698c2003117b1fc02",class:this.h.classes(n.root),"is-expanded":this.isExpanded,color:this.color,size:this.size,role:"listitem",collapsible:this.collapsible,hydrated:this.hydrated},i("div",{key:"02e7e16d0d559a3fd3f88a85b23d6263dfb3eeb8",class:n.header},e,this.collapsible?i(t,{id:s,class:this.h.classes(n.label),"aria-expanded":l(this.isExpanded),"aria-controls":this.contentId,disabled:this.disabled,"aria-disabled":r(this.disabled),onClick:s=>{s.preventDefault();s.stopPropagation();this.toggle()}},i("span",{class:n.headline},i("slot",{name:"headline"}),this.collapsible&&i("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),i("slot",{name:"annotation"})):i(t,{class:this.h.classes(n.label)},i("span",{class:n.headline},i("slot",{name:"headline"}),this.collapsible&&i("gov-icon",{class:n.chevron,name:"chevron-down",type:"components"})),i("slot",{name:"annotation"}))),this.collapsible?i("div",{class:n.content,id:this.contentId,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded,"aria-labelledby":s},i("slot",null)):i("div",{class:n.content,"aria-hidden":l(!this.isExpanded),hidden:!this.isExpanded},i("slot",null)))}async open(){this.isExpanded=true;this.emmitChange()}async close(){this.isExpanded=false;this.emmitChange()}async toggle(){this.isExpanded=!this.isExpanded;this.emmitChange()}async currentState(){return this.isExpanded}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-wizard-item",{color:[1],size:[1],identifier:[1],collapsible:[4],disabled:[4],isExpanded:[1028,"is-expanded"],open:[64],close:[64],toggle:[64],currentState:[64]},undefined,{color:["validateColor"]}]);function b(){if(typeof customElements==="undefined"){return}const s=["gov-wizard-item","gov-icon"];s.forEach((s=>{switch(s){case"gov-wizard-item":if(!customElements.get(s)){customElements.define(s,p)}break;case"gov-icon":if(!customElements.get(s)){m()}break}}))}b();const u=p;const v=b;export{u as GovWizardItem,v as defineCustomElement};
2
2
  //# sourceMappingURL=gov-wizard-item.js.map