@gov-design-system-ce/components 0.0.61 → 0.0.63

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 (693) hide show
  1. package/dist/cjs/{constants-0488d137.js → constants-25f7a6be.js} +2 -2
  2. package/dist/cjs/{constants-0488d137.js.map → constants-25f7a6be.js.map} +1 -1
  3. package/dist/cjs/{constants-23b7a283.js → constants-427a2843.js} +2 -2
  4. package/dist/cjs/constants-427a2843.js.map +1 -0
  5. package/dist/cjs/{constants-ff12205f.js → constants-a31344ad.js} +1 -1
  6. package/dist/{collection/components/gov-button/default/constants.js.map → cjs/constants-a31344ad.js.map} +1 -1
  7. package/dist/cjs/core.cjs.js +1 -1
  8. package/dist/cjs/{form-f68d13c6.js → form-74063d50.js} +3 -1
  9. package/dist/cjs/form-74063d50.js.map +1 -0
  10. package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
  13. package/dist/cjs/gov-app.cjs.entry.js +791 -514
  14. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  15. package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
  16. package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
  17. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  19. package/dist/cjs/gov-button.cjs.entry.js +2 -2
  20. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  21. package/dist/cjs/gov-card.cjs.entry.js +1 -1
  22. package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
  23. package/dist/cjs/gov-chip.cjs.entry.js +102 -0
  24. package/dist/cjs/gov-chip.cjs.entry.js.map +1 -0
  25. package/dist/cjs/gov-container.cjs.entry.js +1 -1
  26. package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
  27. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  28. package/dist/cjs/gov-dropdown.cjs.entry.js +2 -2
  29. package/dist/cjs/gov-dropdown.cjs.entry.js.map +1 -1
  30. package/dist/cjs/gov-empty.cjs.entry.js +1 -1
  31. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  32. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
  33. package/dist/cjs/gov-form-checkbox.cjs.entry.js +4 -4
  34. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  35. package/dist/cjs/gov-form-control.cjs.entry.js +3 -3
  36. package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
  37. package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
  38. package/dist/cjs/gov-form-group.cjs.entry.js +12 -3
  39. package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
  40. package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
  41. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  42. package/dist/cjs/gov-form-multi-select.cjs.entry.js +2 -2
  43. package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
  44. package/dist/cjs/gov-form-password-power.cjs.entry.js.map +1 -1
  45. package/dist/cjs/gov-form-radio.cjs.entry.js +6 -6
  46. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  47. package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
  48. package/dist/cjs/gov-form-select.cjs.entry.js +14 -3
  49. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  50. package/dist/cjs/gov-form-switch.cjs.entry.js +3 -3
  51. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  52. package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
  53. package/dist/cjs/gov-grid.cjs.entry.js +1 -1
  54. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  55. package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
  56. package/dist/cjs/gov-infobar.cjs.entry.js +5 -4
  57. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  58. package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
  59. package/dist/cjs/gov-layout.cjs.entry.js +1 -1
  60. package/dist/cjs/gov-loading.cjs.entry.js +1 -1
  61. package/dist/cjs/gov-message.cjs.entry.js +1 -1
  62. package/dist/cjs/gov-modal.cjs.entry.js +7 -4
  63. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  64. package/dist/cjs/gov-pagination.cjs.entry.js +1 -1
  65. package/dist/cjs/gov-prompt.cjs.entry.js +1 -1
  66. package/dist/cjs/gov-side-nav-item.cjs.entry.js +4 -4
  67. package/dist/cjs/gov-side-nav-item.cjs.entry.js.map +1 -1
  68. package/dist/cjs/gov-side-nav.cjs.entry.js +2 -2
  69. package/dist/cjs/gov-skeleton.cjs.entry.js +1 -1
  70. package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
  71. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  72. package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
  73. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  74. package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
  75. package/dist/cjs/gov-tabs-item.cjs.entry.js +5 -5
  76. package/dist/cjs/gov-tabs-item.cjs.entry.js.map +1 -1
  77. package/dist/cjs/gov-tabs.cjs.entry.js +25 -16
  78. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  79. package/dist/cjs/gov-tag.cjs.entry.js +51 -0
  80. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -0
  81. package/dist/cjs/gov-tile.cjs.entry.js +1 -1
  82. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  83. package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
  84. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  85. package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
  86. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  87. package/dist/cjs/gov-tooltip.cjs.entry.js +40 -5
  88. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  89. package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
  90. package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
  91. package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
  92. package/dist/cjs/index-83edd4fe.js +6 -2
  93. package/dist/cjs/loader.cjs.js +1 -1
  94. package/dist/cjs/{template-e1c4ff78.js → template-4b951d1d.js} +8 -1
  95. package/dist/cjs/template-4b951d1d.js.map +1 -0
  96. package/dist/collection/collection-manifest.json +4 -3
  97. package/dist/collection/components/gov-accordion/gov-accordion-item.css +5 -2
  98. package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
  99. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  100. package/dist/collection/components/gov-accordion/gov-accordion.css +5 -2
  101. package/dist/collection/components/gov-app/gov-app.css +5 -2
  102. package/dist/collection/components/gov-app/gov-app.js +5 -3
  103. package/dist/collection/components/gov-app/gov-app.js.map +1 -1
  104. package/dist/collection/components/gov-attachments/gov-attachments-item.css +5 -2
  105. package/dist/collection/components/gov-attachments/gov-attachments.css +5 -2
  106. package/dist/collection/components/gov-backdrop/gov-backdrop.css +5 -2
  107. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +5 -2
  108. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
  109. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  110. package/dist/collection/components/gov-button/button/constants.js.map +1 -0
  111. package/dist/collection/components/gov-button/{default → button}/gov-button.css +6 -3
  112. package/dist/collection/components/gov-button/{default → button}/gov-button.js +9 -9
  113. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -0
  114. package/dist/collection/components/gov-button/button/gov-button.types.js.map +1 -0
  115. package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +5 -2
  116. package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +1 -1
  117. package/dist/collection/components/gov-button/dropdown/gov-dropdown.js.map +1 -1
  118. package/dist/collection/components/gov-card/gov-card.css +5 -2
  119. package/dist/collection/components/gov-card/gov-card.js +1 -1
  120. package/dist/collection/components/gov-card/gov-card.js.map +1 -1
  121. package/dist/collection/components/{gov-badge → gov-chip}/constants.js +5 -5
  122. package/dist/collection/components/gov-chip/constants.js.map +1 -0
  123. package/dist/collection/components/gov-chip/gov-chip.css +1270 -0
  124. package/dist/collection/components/{gov-badge/gov-badge.js → gov-chip/gov-chip.js} +150 -23
  125. package/dist/collection/components/gov-chip/gov-chip.js.map +1 -0
  126. package/dist/collection/components/gov-container/gov-container.css +5 -2
  127. package/dist/collection/components/gov-control-group/gov-control-group.css +5 -2
  128. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +5 -2
  129. package/dist/collection/components/gov-empty/gov-empty.css +5 -2
  130. package/dist/collection/components/gov-error-code/gov-error-code.css +5 -2
  131. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +5 -2
  132. package/dist/collection/components/gov-form/checkbox/constants.js +1 -0
  133. package/dist/collection/components/gov-form/checkbox/constants.js.map +1 -1
  134. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +8 -2
  135. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +2 -2
  136. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  137. package/dist/collection/components/gov-form/control/gov-form-control.css +5 -2
  138. package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
  139. package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
  140. package/dist/collection/components/gov-form/file/gov-form-file.css +5 -2
  141. package/dist/collection/components/gov-form/group/gov-form-group.css +5 -2
  142. package/dist/collection/components/gov-form/group/gov-form-group.js +13 -2
  143. package/dist/collection/components/gov-form/group/gov-form-group.js.map +1 -1
  144. package/dist/collection/components/gov-form/input/gov-form-input.css +5 -2
  145. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  146. package/dist/collection/components/gov-form/label/gov-form-label.css +5 -2
  147. package/dist/collection/components/gov-form/message/gov-form-message.css +5 -2
  148. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +5 -2
  149. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +8 -4
  150. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +1 -1
  151. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js.map +1 -1
  152. package/dist/collection/components/gov-form/radio/constants.js +1 -0
  153. package/dist/collection/components/gov-form/radio/constants.js.map +1 -1
  154. package/dist/collection/components/gov-form/radio/gov-form-radio.css +8 -2
  155. package/dist/collection/components/gov-form/radio/gov-form-radio.js +4 -4
  156. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  157. package/dist/collection/components/gov-form/search/gov-form-search.css +5 -2
  158. package/dist/collection/components/gov-form/search/gov-form-search.js +1 -1
  159. package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
  160. package/dist/collection/components/gov-form/select/gov-form-select.css +5 -2
  161. package/dist/collection/components/gov-form/select/gov-form-select.js +39 -2
  162. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  163. package/dist/collection/components/gov-form/select/gov-form-select.types.js.map +1 -1
  164. package/dist/collection/components/gov-form/switch/gov-form-switch.css +7 -2
  165. package/dist/collection/components/gov-form/switch/gov-form-switch.js +1 -1
  166. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  167. package/dist/collection/components/gov-grid/gov-grid-item.css +5 -2
  168. package/dist/collection/components/gov-grid/gov-grid.css +5 -2
  169. package/dist/collection/components/gov-icon/gov-icon.css +5 -2
  170. package/dist/collection/components/gov-icon/gov-icon.js +4 -10
  171. package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
  172. package/dist/collection/components/gov-icon/list.js +17 -11
  173. package/dist/collection/components/gov-icon/list.js.map +1 -1
  174. package/dist/collection/components/gov-infobar/{default/constants.js → constants.js} +3 -2
  175. package/dist/collection/components/gov-infobar/constants.js.map +1 -0
  176. package/dist/collection/components/gov-infobar/{default/gov-infobar.css → gov-infobar.css} +9 -3
  177. package/dist/collection/components/gov-infobar/{default/gov-infobar.js → gov-infobar.js} +12 -11
  178. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -0
  179. package/dist/collection/components/gov-infobar/gov-infobar.types.js.map +1 -0
  180. package/dist/collection/components/gov-layout/gov-layout-column.css +5 -2
  181. package/dist/collection/components/gov-layout/gov-layout.css +5 -2
  182. package/dist/collection/components/gov-loading/loading/gov-loading.css +5 -2
  183. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +5 -2
  184. package/dist/collection/components/gov-message/gov-message.css +5 -2
  185. package/dist/collection/components/gov-modal/gov-modal.css +5 -2
  186. package/dist/collection/components/gov-modal/gov-modal.js +24 -3
  187. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  188. package/dist/collection/components/gov-nav/gov-nav-item.css +5 -2
  189. package/dist/collection/components/gov-nav/gov-nav.css +5 -2
  190. package/dist/collection/components/gov-pagination/gov-pagination.css +5 -2
  191. package/dist/collection/components/gov-promp/gov-prompt.css +5 -2
  192. package/dist/collection/components/gov-side-nav/constants.js +1 -1
  193. package/dist/collection/components/gov-side-nav/constants.js.map +1 -1
  194. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +6 -3
  195. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +2 -2
  196. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js.map +1 -1
  197. package/dist/collection/components/gov-side-nav/gov-side-nav.css +5 -2
  198. package/dist/collection/components/gov-spacer/gov-spacer.css +5 -2
  199. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +5 -2
  200. package/dist/collection/components/gov-statsbar/gov-statsbar.css +5 -2
  201. package/dist/collection/components/gov-stepper/gov-stepper-item.css +5 -2
  202. package/dist/collection/components/gov-stepper/gov-stepper.css +5 -2
  203. package/dist/collection/components/gov-tabs/constants.js +1 -1
  204. package/dist/collection/components/gov-tabs/constants.js.map +1 -1
  205. package/dist/collection/components/gov-tabs/gov-tabs-item.css +5 -2
  206. package/dist/collection/components/gov-tabs/gov-tabs-item.js +4 -4
  207. package/dist/collection/components/gov-tabs/gov-tabs-item.js.map +1 -1
  208. package/dist/collection/components/gov-tabs/gov-tabs.css +16 -14
  209. package/dist/collection/components/gov-tabs/gov-tabs.js +29 -21
  210. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  211. package/dist/collection/components/gov-tag/constants.js +4 -0
  212. package/dist/collection/components/gov-tag/constants.js.map +1 -0
  213. package/dist/collection/components/gov-tag/gov-tag.css +1274 -0
  214. package/dist/collection/components/gov-tag/gov-tag.js +118 -0
  215. package/dist/collection/components/gov-tag/gov-tag.js.map +1 -0
  216. package/dist/collection/components/gov-tile/container/gov-tiles.css +5 -2
  217. package/dist/collection/components/gov-tile/gov-tile.css +5 -2
  218. package/dist/collection/components/gov-tile/gov-tile.js +3 -3
  219. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  220. package/dist/collection/components/gov-toast/gov-toast.css +5 -2
  221. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +14 -2
  222. package/dist/collection/components/gov-tooltip/gov-tooltip.css +6 -3
  223. package/dist/collection/components/gov-tooltip/gov-tooltip.js +40 -5
  224. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  225. package/dist/collection/components/gov-wizard/gov-wizard-item.css +5 -2
  226. package/dist/collection/components/gov-wizard/gov-wizard-item.js +1 -1
  227. package/dist/collection/components/gov-wizard/gov-wizard-item.js.map +1 -1
  228. package/dist/collection/components/gov-wizard/gov-wizard.css +5 -2
  229. package/dist/collection/data/font-definitions.js +6 -6
  230. package/dist/collection/helpers/Dom/template.js +7 -0
  231. package/dist/collection/helpers/Dom/template.js.map +1 -1
  232. package/dist/collection/helpers/Dom/template.types.js.map +1 -1
  233. package/dist/collection/pages/Accordion.js +15 -15
  234. package/dist/collection/pages/Accordion.js.map +1 -1
  235. package/dist/collection/pages/{Badge.js → Chip.js} +181 -181
  236. package/dist/collection/pages/Chip.js.map +1 -0
  237. package/dist/collection/pages/Forms.js +23 -0
  238. package/dist/collection/pages/Forms.js.map +1 -1
  239. package/dist/collection/pages/Infobar.js +5 -5
  240. package/dist/collection/pages/Infobar.js.map +1 -1
  241. package/dist/collection/pages/Tabs.js +7 -7
  242. package/dist/collection/pages/Tabs.js.map +1 -1
  243. package/dist/collection/pages/Tag.js +253 -0
  244. package/dist/collection/pages/Tag.js.map +1 -0
  245. package/dist/collection/pages/Tooltip.js +3 -3
  246. package/dist/collection/pages/Tooltip.js.map +1 -1
  247. package/dist/components/gov-accordion-item.js +1 -1
  248. package/dist/components/gov-accordion-item.js.map +1 -1
  249. package/dist/components/gov-accordion.js +1 -1
  250. package/dist/components/gov-app.js +1 -1
  251. package/dist/components/gov-app.js.map +1 -1
  252. package/dist/components/gov-attachments-item.js +1 -1
  253. package/dist/components/gov-attachments.js +1 -1
  254. package/dist/components/gov-backdrop.js +1 -1
  255. package/dist/components/gov-breadcrumbs.js +1 -1
  256. package/dist/components/gov-breadcrumbs.js.map +1 -1
  257. package/dist/components/gov-button.js +1 -1
  258. package/dist/components/gov-card.js +1 -1
  259. package/dist/components/gov-card.js.map +1 -1
  260. package/dist/components/{gov-badge.d.ts → gov-chip.d.ts} +4 -4
  261. package/dist/components/gov-chip.js +2 -0
  262. package/dist/components/gov-container.js +1 -1
  263. package/dist/components/gov-control-group.js +1 -1
  264. package/dist/components/gov-cookiebar.js +1 -1
  265. package/dist/components/gov-dropdown.js +1 -1
  266. package/dist/components/gov-dropdown.js.map +1 -1
  267. package/dist/components/gov-empty.js +1 -1
  268. package/dist/components/gov-error-code.js +1 -1
  269. package/dist/components/gov-form-autocomplete.js +1 -1
  270. package/dist/components/gov-form-checkbox.js +1 -1
  271. package/dist/components/gov-form-checkbox.js.map +1 -1
  272. package/dist/components/gov-form-control.js +1 -1
  273. package/dist/components/gov-form-control.js.map +1 -1
  274. package/dist/components/gov-form-file.js +1 -1
  275. package/dist/components/gov-form-group.js +1 -1
  276. package/dist/components/gov-form-group.js.map +1 -1
  277. package/dist/components/gov-form-input.js +1 -1
  278. package/dist/components/gov-form-message.js +1 -1
  279. package/dist/components/gov-form-multi-select.js +1 -1
  280. package/dist/components/gov-form-password-power.js +1 -1
  281. package/dist/components/gov-form-password-power.js.map +1 -1
  282. package/dist/components/gov-form-radio.js +1 -1
  283. package/dist/components/gov-form-radio.js.map +1 -1
  284. package/dist/components/gov-form-search.js +1 -1
  285. package/dist/components/gov-form-search.js.map +1 -1
  286. package/dist/components/gov-form-select.js +1 -1
  287. package/dist/components/gov-form-switch.js +1 -1
  288. package/dist/components/gov-form-switch.js.map +1 -1
  289. package/dist/components/gov-grid-item.js +1 -1
  290. package/dist/components/gov-grid.js +1 -1
  291. package/dist/components/gov-icon.js +1 -1
  292. package/dist/components/gov-infobar.js +1 -1
  293. package/dist/components/gov-infobar.js.map +1 -1
  294. package/dist/components/gov-layout-column.js +1 -1
  295. package/dist/components/gov-layout.js +1 -1
  296. package/dist/components/gov-loading.js +1 -1
  297. package/dist/components/gov-message.js +1 -1
  298. package/dist/components/gov-modal.js +1 -1
  299. package/dist/components/gov-modal.js.map +1 -1
  300. package/dist/components/gov-pagination.js +1 -1
  301. package/dist/components/gov-prompt.js +1 -1
  302. package/dist/components/gov-side-nav-item.js +1 -1
  303. package/dist/components/gov-side-nav-item.js.map +1 -1
  304. package/dist/components/gov-side-nav.js +1 -1
  305. package/dist/components/gov-skeleton.js +1 -1
  306. package/dist/components/gov-spacer.js +1 -1
  307. package/dist/components/gov-statsbar-item.js +1 -1
  308. package/dist/components/gov-statsbar.js +1 -1
  309. package/dist/components/gov-stepper-item.js +1 -1
  310. package/dist/components/gov-stepper.js +1 -1
  311. package/dist/components/gov-tabs-item.js +1 -1
  312. package/dist/components/gov-tabs-item.js.map +1 -1
  313. package/dist/components/gov-tabs.js +1 -1
  314. package/dist/components/gov-tabs.js.map +1 -1
  315. package/dist/components/gov-tag.d.ts +11 -0
  316. package/dist/components/gov-tag.js +2 -0
  317. package/dist/components/gov-tag.js.map +1 -0
  318. package/dist/components/gov-tile.js +1 -1
  319. package/dist/components/gov-tile.js.map +1 -1
  320. package/dist/components/gov-tiles.js +1 -1
  321. package/dist/components/gov-toast.js +1 -1
  322. package/dist/components/gov-tooltip-content.js +1 -1
  323. package/dist/components/gov-tooltip-content.js.map +1 -1
  324. package/dist/components/gov-tooltip.js +1 -1
  325. package/dist/components/gov-tooltip.js.map +1 -1
  326. package/dist/components/gov-wizard-item.js +1 -1
  327. package/dist/components/gov-wizard-item.js.map +1 -1
  328. package/dist/components/gov-wizard.js +1 -1
  329. package/dist/components/{p-1b4f2520.js → p-25b64ce2.js} +2 -2
  330. package/dist/components/p-28e59384.js +2 -0
  331. package/dist/components/p-28e59384.js.map +1 -0
  332. package/dist/components/{p-3dbf7f49.js → p-3c71d697.js} +1 -1
  333. package/dist/{cjs/constants-ff12205f.js.map → components/p-3c71d697.js.map} +1 -1
  334. package/dist/components/p-53e02bee.js +2 -0
  335. package/dist/components/p-53e02bee.js.map +1 -0
  336. package/dist/components/{p-3e8a9e92.js → p-6b256c8e.js} +2 -2
  337. package/dist/components/{p-f72ecbef.js → p-7ad6b936.js} +2 -2
  338. package/dist/components/p-7ad6b936.js.map +1 -0
  339. package/dist/components/{p-9ba6e755.js → p-a29d84e4.js} +2 -2
  340. package/dist/components/p-a29d84e4.js.map +1 -0
  341. package/dist/components/p-b0d4961a.js +2 -0
  342. package/dist/components/p-b0d4961a.js.map +1 -0
  343. package/dist/components/{p-522dd298.js → p-b47d953a.js} +2 -2
  344. package/dist/components/{p-522dd298.js.map → p-b47d953a.js.map} +1 -1
  345. package/dist/components/{p-8da17139.js → p-b60b159d.js} +2 -2
  346. package/dist/components/p-db1f0452.js +2 -0
  347. package/dist/components/p-db1f0452.js.map +1 -0
  348. package/dist/components/{p-b3cb7945.js → p-dde10734.js} +2 -2
  349. package/dist/components/{p-94542a50.js → p-e2d7dc71.js} +2 -2
  350. package/dist/components/p-e2d7dc71.js.map +1 -0
  351. package/dist/components/{p-bc5d5903.js → p-ee3a01c0.js} +2 -2
  352. package/dist/components/p-fa1e4aea.js +2 -0
  353. package/dist/components/p-fa1e4aea.js.map +1 -0
  354. package/dist/core/core.esm.js +1 -1
  355. package/dist/core/core.esm.js.map +1 -1
  356. package/dist/core/p-002c922c.entry.js +2 -0
  357. package/dist/core/p-002c922c.entry.js.map +1 -0
  358. package/dist/core/{p-7702c8c2.entry.js → p-046613ca.entry.js} +2 -2
  359. package/dist/core/p-0a84ab6c.entry.js +2 -0
  360. package/dist/core/p-0a84ab6c.entry.js.map +1 -0
  361. package/dist/core/{p-0c57e410.entry.js → p-0db95d0a.entry.js} +2 -2
  362. package/dist/core/p-0db95d0a.entry.js.map +1 -0
  363. package/dist/core/p-0e5fa8bf.js +2 -0
  364. package/dist/core/p-0e5fa8bf.js.map +1 -0
  365. package/dist/core/{p-f62efc34.entry.js → p-1da19326.entry.js} +2 -2
  366. package/dist/core/p-1da19326.entry.js.map +1 -0
  367. package/dist/core/{p-1c62f175.entry.js → p-1e41751e.entry.js} +2 -2
  368. package/dist/core/{p-e5227e40.entry.js → p-21a02f11.entry.js} +2 -2
  369. package/dist/core/{p-acd6a9f4.entry.js → p-2370e823.entry.js} +2 -2
  370. package/dist/core/p-2370e823.entry.js.map +1 -0
  371. package/dist/core/{p-06699657.entry.js → p-25620fed.entry.js} +2 -2
  372. package/dist/core/p-25620fed.entry.js.map +1 -0
  373. package/dist/core/{p-6f43bd00.entry.js → p-28d98a7d.entry.js} +2 -2
  374. package/dist/core/p-28e59384.js +2 -0
  375. package/dist/core/p-28e59384.js.map +1 -0
  376. package/dist/core/{p-e2d6efaf.entry.js → p-2c5b8f32.entry.js} +2 -2
  377. package/dist/core/{p-1da9f871.entry.js → p-3191317e.entry.js} +2 -2
  378. package/dist/core/{p-32a4b7e3.entry.js → p-32a4bac2.entry.js} +2 -2
  379. package/dist/core/p-32a4bac2.entry.js.map +1 -0
  380. package/dist/core/{p-7372b066.entry.js → p-34613499.entry.js} +2 -2
  381. package/dist/core/{p-88010439.entry.js → p-3d11d9a0.entry.js} +2 -2
  382. package/dist/core/{p-7fa1290e.entry.js → p-409f054b.entry.js} +2 -2
  383. package/dist/core/{p-afa12399.entry.js → p-4281eecd.entry.js} +2 -2
  384. package/dist/core/p-4281eecd.entry.js.map +1 -0
  385. package/dist/core/p-475e46be.entry.js +2 -0
  386. package/dist/core/p-475e46be.entry.js.map +1 -0
  387. package/dist/core/{p-3bacd021.js → p-4c55142b.js} +1 -1
  388. package/dist/core/p-4c55142b.js.map +1 -0
  389. package/dist/core/p-4df6aec4.entry.js +2 -0
  390. package/dist/core/p-4df6aec4.entry.js.map +1 -0
  391. package/dist/core/{p-bc6f1479.entry.js → p-4f34cea7.entry.js} +2 -2
  392. package/dist/core/p-4f34cea7.entry.js.map +1 -0
  393. package/dist/core/{p-35c1c12c.entry.js → p-52d767a8.entry.js} +2 -2
  394. package/dist/core/p-52d767a8.entry.js.map +1 -0
  395. package/dist/core/p-5e23a6ba.entry.js.map +1 -1
  396. package/dist/core/{p-2bb9f781.entry.js → p-679625c1.entry.js} +2 -2
  397. package/dist/core/{p-19b897c0.entry.js → p-7632b949.entry.js} +2 -2
  398. package/dist/core/{p-80f5140b.entry.js → p-7b01e961.entry.js} +2 -2
  399. package/dist/core/{p-93897e60.entry.js → p-7c38556b.entry.js} +2 -2
  400. package/dist/core/p-7d756211.entry.js +2 -0
  401. package/dist/core/p-7d756211.entry.js.map +1 -0
  402. package/dist/core/{p-7e8d2066.entry.js → p-7e11320f.entry.js} +2 -2
  403. package/dist/core/{p-c81d62db.entry.js → p-80ebaaf5.entry.js} +2 -2
  404. package/dist/core/{p-93042b25.entry.js → p-83512243.entry.js} +2 -2
  405. package/dist/core/{p-739dd451.entry.js → p-84e61610.entry.js} +2 -2
  406. package/dist/core/p-87700ea3.entry.js +2 -0
  407. package/dist/core/p-87700ea3.entry.js.map +1 -0
  408. package/dist/core/{p-998c3336.entry.js → p-87a91e77.entry.js} +2 -2
  409. package/dist/core/{p-4452c278.entry.js → p-8a931ff2.entry.js} +2 -2
  410. package/dist/core/{p-041d30b1.entry.js → p-8e5599d1.entry.js} +2 -2
  411. package/dist/core/{p-84f6b11a.entry.js → p-8f3d9099.entry.js} +2 -2
  412. package/dist/core/{p-84f6b11a.entry.js.map → p-8f3d9099.entry.js.map} +1 -1
  413. package/dist/core/{p-19a54ee9.entry.js → p-92ce6f87.entry.js} +2 -2
  414. package/dist/core/p-92ce6f87.entry.js.map +1 -0
  415. package/dist/core/{p-e1780dba.entry.js → p-96354948.entry.js} +2 -2
  416. package/dist/core/{p-2fe9d3ea.entry.js → p-a8b5ac68.entry.js} +2 -2
  417. package/dist/core/{p-2bf0c1c5.entry.js → p-aec21036.entry.js} +2 -2
  418. package/dist/core/{p-2bf0c1c5.entry.js.map → p-aec21036.entry.js.map} +1 -1
  419. package/dist/core/{p-228da18e.entry.js → p-af42ea63.entry.js} +2 -2
  420. package/dist/core/p-b21a3c79.entry.js +2 -0
  421. package/dist/core/p-b21a3c79.entry.js.map +1 -0
  422. package/dist/core/{p-9633e7b5.entry.js → p-baae15b9.entry.js} +2 -2
  423. package/dist/core/p-baae15b9.entry.js.map +1 -0
  424. package/dist/core/{p-88a78167.entry.js → p-c13ad31c.entry.js} +2 -2
  425. package/dist/core/{p-c5d3efc2.entry.js → p-c91daf1e.entry.js} +2 -2
  426. package/dist/core/{p-c5d3efc2.entry.js.map → p-c91daf1e.entry.js.map} +1 -1
  427. package/dist/core/p-c9ac8361.entry.js +2 -0
  428. package/dist/core/p-c9ac8361.entry.js.map +1 -0
  429. package/dist/core/p-cb3ac3f5.entry.js +2 -0
  430. package/dist/core/{p-5316e768.entry.js.map → p-cb3ac3f5.entry.js.map} +1 -1
  431. package/dist/core/{p-de5c9181.entry.js → p-cc48e49d.entry.js} +2 -2
  432. package/dist/core/{p-de5c9181.entry.js.map → p-cc48e49d.entry.js.map} +1 -1
  433. package/dist/core/{p-28f39f69.entry.js → p-d6e6d683.entry.js} +2 -2
  434. package/dist/core/p-db1f0452.js +2 -0
  435. package/dist/core/p-db1f0452.js.map +1 -0
  436. package/dist/core/{p-a7719b55.entry.js → p-e4ae862e.entry.js} +2 -2
  437. package/dist/core/{p-74ce7780.entry.js → p-e4e4ae20.entry.js} +2 -2
  438. package/dist/core/p-e4e4ae20.entry.js.map +1 -0
  439. package/dist/core/{p-1c40fdd5.entry.js → p-e6af7eb5.entry.js} +2 -2
  440. package/dist/core/p-e6af7eb5.entry.js.map +1 -0
  441. package/dist/core/p-ef2895f8.entry.js +2 -0
  442. package/dist/core/p-ef2895f8.entry.js.map +1 -0
  443. package/dist/core/{p-89921159.entry.js → p-f069df4a.entry.js} +2 -2
  444. package/dist/core/p-f8407153.entry.js +2 -0
  445. package/dist/core/p-f8407153.entry.js.map +1 -0
  446. package/dist/core/p-fa1e4aea.js +2 -0
  447. package/dist/core/p-fa1e4aea.js.map +1 -0
  448. package/dist/core/{p-0eb11cfc.entry.js → p-ff061e6b.entry.js} +2 -2
  449. package/dist/esm/{constants-ba92640d.js → constants-34a29ae2.js} +1 -1
  450. package/dist/{components/p-3dbf7f49.js.map → esm/constants-34a29ae2.js.map} +1 -1
  451. package/dist/esm/{constants-24dad929.js → constants-6df4edc4.js} +2 -2
  452. package/dist/esm/constants-6df4edc4.js.map +1 -0
  453. package/dist/esm/{constants-f5c21493.js → constants-867ac6e2.js} +2 -2
  454. package/dist/esm/{constants-f5c21493.js.map → constants-867ac6e2.js.map} +1 -1
  455. package/dist/esm/core.js +1 -1
  456. package/dist/esm/{form-2d9f68d9.js → form-39dc6896.js} +3 -1
  457. package/dist/esm/form-39dc6896.js.map +1 -0
  458. package/dist/esm/gov-accordion-item.entry.js +1 -1
  459. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  460. package/dist/esm/gov-accordion.entry.js +1 -1
  461. package/dist/esm/gov-app.entry.js +791 -514
  462. package/dist/esm/gov-app.entry.js.map +1 -1
  463. package/dist/esm/gov-attachments_3.entry.js +1 -1
  464. package/dist/esm/gov-backdrop.entry.js +1 -1
  465. package/dist/esm/gov-breadcrumbs.entry.js +1 -1
  466. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  467. package/dist/esm/gov-button.entry.js +2 -2
  468. package/dist/esm/gov-button.entry.js.map +1 -1
  469. package/dist/esm/gov-card.entry.js +1 -1
  470. package/dist/esm/gov-card.entry.js.map +1 -1
  471. package/dist/esm/gov-chip.entry.js +98 -0
  472. package/dist/esm/gov-chip.entry.js.map +1 -0
  473. package/dist/esm/gov-container.entry.js +1 -1
  474. package/dist/esm/gov-control-group.entry.js +1 -1
  475. package/dist/esm/gov-cookiebar.entry.js +1 -1
  476. package/dist/esm/gov-dropdown.entry.js +2 -2
  477. package/dist/esm/gov-dropdown.entry.js.map +1 -1
  478. package/dist/esm/gov-empty.entry.js +1 -1
  479. package/dist/esm/gov-error-code.entry.js +1 -1
  480. package/dist/esm/gov-form-autocomplete.entry.js +1 -1
  481. package/dist/esm/gov-form-checkbox.entry.js +4 -4
  482. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  483. package/dist/esm/gov-form-control.entry.js +3 -3
  484. package/dist/esm/gov-form-control.entry.js.map +1 -1
  485. package/dist/esm/gov-form-file.entry.js +2 -2
  486. package/dist/esm/gov-form-group.entry.js +12 -3
  487. package/dist/esm/gov-form-group.entry.js.map +1 -1
  488. package/dist/esm/gov-form-input.entry.js +2 -2
  489. package/dist/esm/gov-form-input.entry.js.map +1 -1
  490. package/dist/esm/gov-form-multi-select.entry.js +2 -2
  491. package/dist/esm/gov-form-password-power.entry.js +1 -1
  492. package/dist/esm/gov-form-password-power.entry.js.map +1 -1
  493. package/dist/esm/gov-form-radio.entry.js +6 -6
  494. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  495. package/dist/esm/gov-form-search.entry.js.map +1 -1
  496. package/dist/esm/gov-form-select.entry.js +14 -3
  497. package/dist/esm/gov-form-select.entry.js.map +1 -1
  498. package/dist/esm/gov-form-switch.entry.js +3 -3
  499. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  500. package/dist/esm/gov-grid-item.entry.js +1 -1
  501. package/dist/esm/gov-grid.entry.js +1 -1
  502. package/dist/esm/gov-icon.entry.js +2 -2
  503. package/dist/esm/gov-icon.entry.js.map +1 -1
  504. package/dist/esm/gov-infobar.entry.js +5 -4
  505. package/dist/esm/gov-infobar.entry.js.map +1 -1
  506. package/dist/esm/gov-layout-column.entry.js +1 -1
  507. package/dist/esm/gov-layout.entry.js +1 -1
  508. package/dist/esm/gov-loading.entry.js +1 -1
  509. package/dist/esm/gov-message.entry.js +1 -1
  510. package/dist/esm/gov-modal.entry.js +7 -4
  511. package/dist/esm/gov-modal.entry.js.map +1 -1
  512. package/dist/esm/gov-pagination.entry.js +1 -1
  513. package/dist/esm/gov-prompt.entry.js +1 -1
  514. package/dist/esm/gov-side-nav-item.entry.js +4 -4
  515. package/dist/esm/gov-side-nav-item.entry.js.map +1 -1
  516. package/dist/esm/gov-side-nav.entry.js +2 -2
  517. package/dist/esm/gov-skeleton.entry.js +1 -1
  518. package/dist/esm/gov-spacer.entry.js +1 -1
  519. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  520. package/dist/esm/gov-statsbar.entry.js +1 -1
  521. package/dist/esm/gov-stepper-item.entry.js +1 -1
  522. package/dist/esm/gov-stepper.entry.js +1 -1
  523. package/dist/esm/gov-tabs-item.entry.js +5 -5
  524. package/dist/esm/gov-tabs-item.entry.js.map +1 -1
  525. package/dist/esm/gov-tabs.entry.js +25 -16
  526. package/dist/esm/gov-tabs.entry.js.map +1 -1
  527. package/dist/esm/gov-tag.entry.js +47 -0
  528. package/dist/esm/gov-tag.entry.js.map +1 -0
  529. package/dist/esm/gov-tile.entry.js +1 -1
  530. package/dist/esm/gov-tile.entry.js.map +1 -1
  531. package/dist/esm/gov-tiles.entry.js +1 -1
  532. package/dist/esm/gov-toast.entry.js +1 -1
  533. package/dist/esm/gov-tooltip-content.entry.js +2 -2
  534. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  535. package/dist/esm/gov-tooltip.entry.js +40 -5
  536. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  537. package/dist/esm/gov-wizard-item.entry.js +1 -1
  538. package/dist/esm/gov-wizard-item.entry.js.map +1 -1
  539. package/dist/esm/gov-wizard.entry.js +1 -1
  540. package/dist/esm/index-ae3c50f1.js +6 -2
  541. package/dist/esm/loader.js +1 -1
  542. package/dist/esm/{template-10332292.js → template-df429738.js} +8 -1
  543. package/dist/esm/template-df429738.js.map +1 -0
  544. package/dist/hydrate/index.js +1400 -972
  545. package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -1
  546. package/dist/types/components/gov-app/gov-app.d.ts +3 -2
  547. package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +1 -1
  548. package/dist/types/components/gov-button/{default → button}/gov-button.d.ts +1 -1
  549. package/dist/types/components/gov-card/gov-card.d.ts +1 -1
  550. package/dist/types/components/{gov-badge → gov-chip}/constants.d.ts +1 -1
  551. package/dist/types/components/{gov-badge/gov-badge.d.ts → gov-chip/gov-chip.d.ts} +34 -7
  552. package/dist/types/components/gov-form/checkbox/constants.d.ts +1 -0
  553. package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +1 -1
  554. package/dist/types/components/gov-form/group/gov-form-group.d.ts +2 -1
  555. package/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +2 -2
  556. package/dist/types/components/gov-form/radio/constants.d.ts +1 -0
  557. package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +1 -1
  558. package/dist/types/components/gov-form/select/gov-form-select.d.ts +6 -1
  559. package/dist/types/components/gov-form/select/gov-form-select.types.d.ts +5 -0
  560. package/dist/types/components/gov-form/switch/gov-form-switch.d.ts +1 -1
  561. package/dist/types/components/gov-icon/gov-icon.d.ts +2 -3
  562. package/dist/types/components/gov-infobar/{default/constants.d.ts → constants.d.ts} +3 -2
  563. package/dist/types/components/gov-infobar/{default/gov-infobar.d.ts → gov-infobar.d.ts} +2 -2
  564. package/dist/types/components/gov-infobar/{default/gov-infobar.types.d.ts → gov-infobar.types.d.ts} +1 -1
  565. package/dist/types/components/gov-modal/gov-modal.d.ts +4 -0
  566. package/dist/types/components/gov-side-nav/constants.d.ts +1 -1
  567. package/dist/types/components/gov-side-nav/gov-side-nav-item.d.ts +1 -1
  568. package/dist/types/components/gov-tabs/constants.d.ts +1 -1
  569. package/dist/types/components/gov-tabs/gov-tabs-item.d.ts +1 -1
  570. package/dist/types/components/gov-tabs/gov-tabs.d.ts +5 -6
  571. package/dist/types/components/gov-tag/constants.d.ts +3 -0
  572. package/dist/types/components/gov-tag/gov-tag.d.ts +22 -0
  573. package/dist/types/components/gov-tile/gov-tile.d.ts +1 -1
  574. package/dist/types/components/gov-wizard/gov-wizard-item.d.ts +1 -1
  575. package/dist/types/components.d.ts +224 -133
  576. package/dist/types/helpers/Dom/template.types.d.ts +1 -0
  577. package/dist/types/pages/Chip.d.ts +3 -0
  578. package/dist/types/pages/Tag.d.ts +3 -0
  579. package/package.json +3 -3
  580. package/dist/cjs/constants-23b7a283.js.map +0 -1
  581. package/dist/cjs/form-f68d13c6.js.map +0 -1
  582. package/dist/cjs/gov-badge.cjs.entry.js +0 -84
  583. package/dist/cjs/gov-badge.cjs.entry.js.map +0 -1
  584. package/dist/cjs/template-e1c4ff78.js.map +0 -1
  585. package/dist/collection/components/gov-badge/constants.js.map +0 -1
  586. package/dist/collection/components/gov-badge/gov-badge.css +0 -1267
  587. package/dist/collection/components/gov-badge/gov-badge.js.map +0 -1
  588. package/dist/collection/components/gov-button/default/gov-button.js.map +0 -1
  589. package/dist/collection/components/gov-button/default/gov-button.types.js.map +0 -1
  590. package/dist/collection/components/gov-infobar/default/constants.js.map +0 -1
  591. package/dist/collection/components/gov-infobar/default/gov-infobar.js.map +0 -1
  592. package/dist/collection/components/gov-infobar/default/gov-infobar.types.js.map +0 -1
  593. package/dist/collection/pages/Badge.js.map +0 -1
  594. package/dist/components/gov-badge.js +0 -2
  595. package/dist/components/p-17c1ffc1.js +0 -2
  596. package/dist/components/p-17c1ffc1.js.map +0 -1
  597. package/dist/components/p-36be8f6e.js +0 -2
  598. package/dist/components/p-36be8f6e.js.map +0 -1
  599. package/dist/components/p-3f37ddb6.js +0 -2
  600. package/dist/components/p-3f37ddb6.js.map +0 -1
  601. package/dist/components/p-80e30702.js +0 -2
  602. package/dist/components/p-80e30702.js.map +0 -1
  603. package/dist/components/p-8d44ca3c.js +0 -2
  604. package/dist/components/p-8d44ca3c.js.map +0 -1
  605. package/dist/components/p-94542a50.js.map +0 -1
  606. package/dist/components/p-9ba6e755.js.map +0 -1
  607. package/dist/components/p-f72ecbef.js.map +0 -1
  608. package/dist/core/p-0553eb92.entry.js +0 -2
  609. package/dist/core/p-0553eb92.entry.js.map +0 -1
  610. package/dist/core/p-06699657.entry.js.map +0 -1
  611. package/dist/core/p-0c57e410.entry.js.map +0 -1
  612. package/dist/core/p-19a54ee9.entry.js.map +0 -1
  613. package/dist/core/p-1c40fdd5.entry.js.map +0 -1
  614. package/dist/core/p-32a4b7e3.entry.js.map +0 -1
  615. package/dist/core/p-34ed07f6.js +0 -2
  616. package/dist/core/p-34ed07f6.js.map +0 -1
  617. package/dist/core/p-35c1c12c.entry.js.map +0 -1
  618. package/dist/core/p-36be8f6e.js +0 -2
  619. package/dist/core/p-36be8f6e.js.map +0 -1
  620. package/dist/core/p-3bacd021.js.map +0 -1
  621. package/dist/core/p-3f37ddb6.js +0 -2
  622. package/dist/core/p-3f37ddb6.js.map +0 -1
  623. package/dist/core/p-49926f53.entry.js +0 -2
  624. package/dist/core/p-49926f53.entry.js.map +0 -1
  625. package/dist/core/p-5316e768.entry.js +0 -2
  626. package/dist/core/p-5cc3e768.entry.js +0 -2
  627. package/dist/core/p-5cc3e768.entry.js.map +0 -1
  628. package/dist/core/p-74ce7780.entry.js.map +0 -1
  629. package/dist/core/p-80e30702.js +0 -2
  630. package/dist/core/p-80e30702.js.map +0 -1
  631. package/dist/core/p-9633e7b5.entry.js.map +0 -1
  632. package/dist/core/p-acd6a9f4.entry.js.map +0 -1
  633. package/dist/core/p-afa12399.entry.js.map +0 -1
  634. package/dist/core/p-bc6f1479.entry.js.map +0 -1
  635. package/dist/core/p-bcf71ab5.entry.js +0 -2
  636. package/dist/core/p-bcf71ab5.entry.js.map +0 -1
  637. package/dist/core/p-c4c9ff83.entry.js +0 -2
  638. package/dist/core/p-c4c9ff83.entry.js.map +0 -1
  639. package/dist/core/p-c61444f7.entry.js +0 -2
  640. package/dist/core/p-c61444f7.entry.js.map +0 -1
  641. package/dist/core/p-d84b290e.entry.js +0 -2
  642. package/dist/core/p-d84b290e.entry.js.map +0 -1
  643. package/dist/core/p-da762184.entry.js +0 -2
  644. package/dist/core/p-da762184.entry.js.map +0 -1
  645. package/dist/core/p-f62efc34.entry.js.map +0 -1
  646. package/dist/core/p-fab698a7.entry.js +0 -2
  647. package/dist/core/p-fab698a7.entry.js.map +0 -1
  648. package/dist/esm/constants-24dad929.js.map +0 -1
  649. package/dist/esm/constants-ba92640d.js.map +0 -1
  650. package/dist/esm/form-2d9f68d9.js.map +0 -1
  651. package/dist/esm/gov-badge.entry.js +0 -80
  652. package/dist/esm/gov-badge.entry.js.map +0 -1
  653. package/dist/esm/template-10332292.js.map +0 -1
  654. package/dist/types/pages/Badge.d.ts +0 -3
  655. /package/dist/collection/components/gov-button/{default → button}/constants.js +0 -0
  656. /package/dist/collection/components/gov-button/{default → button}/gov-button.types.js +0 -0
  657. /package/dist/collection/components/gov-infobar/{default/gov-infobar.types.js → gov-infobar.types.js} +0 -0
  658. /package/dist/components/{gov-badge.js.map → gov-chip.js.map} +0 -0
  659. /package/dist/components/{p-1b4f2520.js.map → p-25b64ce2.js.map} +0 -0
  660. /package/dist/components/{p-3e8a9e92.js.map → p-6b256c8e.js.map} +0 -0
  661. /package/dist/components/{p-8da17139.js.map → p-b60b159d.js.map} +0 -0
  662. /package/dist/components/{p-b3cb7945.js.map → p-dde10734.js.map} +0 -0
  663. /package/dist/components/{p-bc5d5903.js.map → p-ee3a01c0.js.map} +0 -0
  664. /package/dist/core/{p-7702c8c2.entry.js.map → p-046613ca.entry.js.map} +0 -0
  665. /package/dist/core/{p-1c62f175.entry.js.map → p-1e41751e.entry.js.map} +0 -0
  666. /package/dist/core/{p-e5227e40.entry.js.map → p-21a02f11.entry.js.map} +0 -0
  667. /package/dist/core/{p-6f43bd00.entry.js.map → p-28d98a7d.entry.js.map} +0 -0
  668. /package/dist/core/{p-e2d6efaf.entry.js.map → p-2c5b8f32.entry.js.map} +0 -0
  669. /package/dist/core/{p-1da9f871.entry.js.map → p-3191317e.entry.js.map} +0 -0
  670. /package/dist/core/{p-7372b066.entry.js.map → p-34613499.entry.js.map} +0 -0
  671. /package/dist/core/{p-88010439.entry.js.map → p-3d11d9a0.entry.js.map} +0 -0
  672. /package/dist/core/{p-7fa1290e.entry.js.map → p-409f054b.entry.js.map} +0 -0
  673. /package/dist/core/{p-2bb9f781.entry.js.map → p-679625c1.entry.js.map} +0 -0
  674. /package/dist/core/{p-19b897c0.entry.js.map → p-7632b949.entry.js.map} +0 -0
  675. /package/dist/core/{p-80f5140b.entry.js.map → p-7b01e961.entry.js.map} +0 -0
  676. /package/dist/core/{p-93897e60.entry.js.map → p-7c38556b.entry.js.map} +0 -0
  677. /package/dist/core/{p-7e8d2066.entry.js.map → p-7e11320f.entry.js.map} +0 -0
  678. /package/dist/core/{p-c81d62db.entry.js.map → p-80ebaaf5.entry.js.map} +0 -0
  679. /package/dist/core/{p-93042b25.entry.js.map → p-83512243.entry.js.map} +0 -0
  680. /package/dist/core/{p-739dd451.entry.js.map → p-84e61610.entry.js.map} +0 -0
  681. /package/dist/core/{p-998c3336.entry.js.map → p-87a91e77.entry.js.map} +0 -0
  682. /package/dist/core/{p-4452c278.entry.js.map → p-8a931ff2.entry.js.map} +0 -0
  683. /package/dist/core/{p-041d30b1.entry.js.map → p-8e5599d1.entry.js.map} +0 -0
  684. /package/dist/core/{p-e1780dba.entry.js.map → p-96354948.entry.js.map} +0 -0
  685. /package/dist/core/{p-2fe9d3ea.entry.js.map → p-a8b5ac68.entry.js.map} +0 -0
  686. /package/dist/core/{p-228da18e.entry.js.map → p-af42ea63.entry.js.map} +0 -0
  687. /package/dist/core/{p-88a78167.entry.js.map → p-c13ad31c.entry.js.map} +0 -0
  688. /package/dist/core/{p-28f39f69.entry.js.map → p-d6e6d683.entry.js.map} +0 -0
  689. /package/dist/core/{p-a7719b55.entry.js.map → p-e4ae862e.entry.js.map} +0 -0
  690. /package/dist/core/{p-89921159.entry.js.map → p-f069df4a.entry.js.map} +0 -0
  691. /package/dist/core/{p-0eb11cfc.entry.js.map → p-ff061e6b.entry.js.map} +0 -0
  692. /package/dist/types/components/gov-button/{default → button}/constants.d.ts +0 -0
  693. /package/dist/types/components/gov-button/{default → button}/gov-button.types.d.ts +0 -0
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
2
  import { c as createID } from './string.utils-f268fc6b.js';
3
3
  import { v as validateProp } from './props-789f7529.js';
4
- import { g as govForm, f as FormRadioClass, h as FormRadioSizes } from './form-2d9f68d9.js';
5
- import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-10332292.js';
4
+ import { g as govForm, f as FormRadioClass, h as FormRadioSizes } from './form-39dc6896.js';
5
+ import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
6
6
  import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
7
7
  import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
8
8
  import { d as delay } from './utils-c057a3fa.js';
@@ -14,7 +14,7 @@ import './constants-3df712e2.js';
14
14
  import './constants-47d7a8bc.js';
15
15
  import './constants-ebec7de8.js';
16
16
 
17
- const govFormRadioCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block;cursor:pointer}.gov-form-radio input+span::before{content:\"\";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=\"\"].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid=\"1\"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=\"\"].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid=\"1\"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=\"\"].gov-form-radio,[disabled=true i].gov-form-radio,[disabled=\"1\"].gov-form-radio{pointer-events:none}[disabled=\"\"].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled=\"1\"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=\"\"].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled=\"1\"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:\"\";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=\"\"] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid=\"1\"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=\"\"] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled=\"1\"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}";
17
+ const govFormRadioCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block;cursor:pointer}.gov-form-radio input+span::before{content:\"\";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=\"\"].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid=\"1\"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=\"\"].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid=\"1\"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=\"\"].gov-form-radio,[disabled=true i].gov-form-radio,[disabled=\"1\"].gov-form-radio{pointer-events:none}[disabled=\"\"].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled=\"1\"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=\"\"].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled=\"1\"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:\"\";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio__label{position:relative}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=\"\"] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid=\"1\"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=\"\"] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled=\"1\"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}";
18
18
 
19
19
  const GovFormRadio = class {
20
20
  constructor(hostRef) {
@@ -61,13 +61,13 @@ const GovFormRadio = class {
61
61
  }
62
62
  }
63
63
  render() {
64
- const wrapCheckbox = children => {
64
+ const wrapRadio = children => {
65
65
  if (this.noLabel) {
66
- return h("label", null, children);
66
+ return h("label", { class: FormRadioClass.label }, children);
67
67
  }
68
68
  return children;
69
69
  };
70
- return (h(Host, { class: FormRadioClass.root, checked: this.checked, size: this.size, invalid: toBoolAttrIfDefined(this.invalid) }, h("div", { class: FormRadioClass.holder }, wrapCheckbox(h(Fragment, null, h("input", { class: FormRadioClass.input, id: this.identifier || this.radioId, type: "radio", value: this.value, name: this.name, checked: this.checked, disabled: this.disabled, onClick: this.onClickHandler.bind(this), onChange: this.onChangeHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), ref: el => (this.inputRef = el), required: this.required, "aria-checked": this.checked, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-disabled": toBoolAttrIfDefined(this.disabled) }), h("span", null, h("slot", { name: "label" })))))));
70
+ return (h(Host, { class: FormRadioClass.root, checked: this.checked, size: this.size, invalid: toBoolAttrIfDefined(this.invalid) }, h("div", { class: FormRadioClass.holder }, wrapRadio(h(Fragment, null, h("input", { class: FormRadioClass.input, id: this.identifier || this.radioId, type: "radio", value: this.value, name: this.name, checked: this.checked, disabled: this.disabled, onClick: this.onClickHandler.bind(this), onChange: this.onChangeHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), ref: el => (this.inputRef = el), required: this.required, "aria-checked": this.checked, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-disabled": toBoolAttrIfDefined(this.disabled) }), h("span", null, h("slot", { name: "label" })))))));
71
71
  }
72
72
  onClickHandler(e) {
73
73
  e.stopPropagation();
@@ -1 +1 @@
1
- {"file":"gov-form-radio.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,wjPAAwjP;;MCkBnkP,YAAY;EAOxB;;;;;;mBAe6D,KAAK;mBAIhB,KAAK;oBAKlB,KAAK;oBAKL,KAAK;;gBAQG,GAAG;;;;;IApC/C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEnC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA+DD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAKD,aAAa;IACZ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AAO,EAAE,IAAI,CAAC,OAAO;MACrB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;EAEO,aAAa,CAAC,CAAa;IAClC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;MACjB,SAAS,EAAE,cAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;EAEO,eAAe,CAAC,CAAQ;IAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;IACrD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MACnB,SAAS,EAAE,cAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC/E,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7E,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.scss?tag=gov-form-radio","../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"sourcesContent":["/*\n * Radio\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-radio\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t&::after {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: $form-radio-indicator-bg;\n\t\t\topacity: 0;\n\t\t\ttransition: $t linear opacity;\n\t\t}\n\t}\n\n\t// STATES\n\tinput:checked + span::after {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput + span::after {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::after {\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\tinput + span::after {\n\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\twidth: get(\"dot-size\", $definitions);\n\t\t\t\theight: get(\"dot-size\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormRadioClass, FormRadioSizes, FormRadioSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormRadioEvent } from \"./gov-form-radio.types\"\n\n@Component({\n\ttag: \"gov-form-radio\",\n\tstyleUrl: \"gov-form-radio.scss\",\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly radioId: string\n\n\tconstructor() {\n\t\tthis.radioId = createID(\"GovRadio\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Radio default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = \"m\"\n\t/**\n\t * Custom radio identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the radio has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"radio\")\n\t}\n\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = children => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormRadioClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormRadioClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormRadioClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.radioId, this.wcagLabelledBy, FormRadioClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-radio.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,imPAAimP;;MCkB5mP,YAAY;EAOxB;;;;;;mBAe6D,KAAK;mBAIhB,KAAK;oBAKlB,KAAK;oBAKL,KAAK;;gBAQG,GAAG;;;;;IApC/C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAA;IAEnC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA+DD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAKD,aAAa;IACZ,IAAI,CAAC,gBAAgB,EAAE,CAAA;GACvB;EAEO,gBAAgB;IACvB,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAA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AEO,aAAa,CAAC,CAAa;IAClC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;MACjB,SAAS,EAAE,cAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;EAEO,eAAe,CAAC,CAAQ;IAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;IACrD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MACnB,SAAS,EAAE,cAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC/E,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7E,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.scss?tag=gov-form-radio","../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"sourcesContent":["/*\n * Radio\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-radio\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t&::after {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: $form-radio-indicator-bg;\n\t\t\topacity: 0;\n\t\t\ttransition: $t linear opacity;\n\t\t}\n\t}\n\n\t&__label {\n\t\tposition: relative;\n\t}\n\n\t// STATES\n\tinput:checked + span::after {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput + span::after {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::after {\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\tinput + span::after {\n\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\twidth: get(\"dot-size\", $definitions);\n\t\t\t\theight: get(\"dot-size\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormRadioClass, FormRadioSizes, FormRadioSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormRadioEvent } from \"./gov-form-radio.types\"\n\n@Component({\n\ttag: \"gov-form-radio\",\n\tstyleUrl: \"gov-form-radio.scss\",\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly radioId: string\n\n\tconstructor() {\n\t\tthis.radioId = createID(\"GovRadio\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Radio button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = \"m\"\n\t/**\n\t * Custom radio identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the radio has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"radio\")\n\t}\n\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapRadio = children => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label class={FormRadioClass.label}>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormRadioClass.holder}>\n\t\t\t\t\t{wrapRadio(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormRadioClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormRadioClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.radioId, this.wcagLabelledBy, FormRadioClass.root)\n\t}\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"gov-form-search.entry.js","mappings":";;;;AAI2B,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAG5D,MAAM,eAAe,GAAG;EAC9B,IAAI,EAAE,iBAAiB;EACvB,KAAK,EAAE,wBAAwB;EAC/B,MAAM,EAAE,yBAAyB;CACjC;;ACXD,MAAM,gBAAgB,GAAG,w6CAAw6C;;MCMp7C,aAAa;;;mBAKyB,WAAW;;EAE7D,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,eAAe,CAAC,IAAI,IAChC,YAAM,KAAK,EAAE,eAAe,CAAC,KAAK,IACjC,YAAM,IAAI,EAAC,OAAO,GAAG,CACf,EACP,YAAM,KAAK,EAAE,eAAe,CAAC,MAAM,IAClC,YAAM,IAAI,EAAC,QAAQ,GAAG,CAChB,CACD,EACP;GACD;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/search/constants.ts","../../../packages/core/src/components/gov-form/search/gov-form-search.scss?tag=gov-form-search","../../../packages/core/src/components/gov-form/search/gov-form-search.tsx"],"sourcesContent":["import { Variants } from '../../../core/constants/variants'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormSearchs = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type FormSearchVariantType = `${ValueOf<typeof FormSearchs>}`\n\nexport const FormSearchClass = {\n\troot: 'gov-form-search',\n\tinput: 'gov-form-search__input',\n\tbutton: 'gov-form-search__button',\n}\n","/*\n * Search\n */\n\n$class: \".gov-form-search\";\n\n#{$class} {\n\t@include base(flex);\n\t@include focus-outline($border-radius, 0, true);\n\tgap: rem-calc(8);\n\talign-items: center;\n\tborder-radius: $border-radius;\n\tbackground-color: $form-bg-color;\n\t&__input {\n\t\tflex: 1 1 auto;\n\t\tinput {\n\t\t\theight: auto;\n\t\t\tborder-width: 0 !important;\n\t\t\t&:focus-visible {\n\t\t\t\toutline: none !important;\n\t\t\t}\n\t\t}\n\t}\n\t&__button {\n\t\tflex: 0 0 auto;\n\t\tmargin: rem-calc(3) rem-calc(3) rem-calc(3) 0;\n\t}\n\n\t@each $variant, $definitions in $form-input-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { FormSearchClass, FormSearchVariantType } from './constants'\n@Component({\n\ttag: 'gov-form-search',\n\tstyleUrl: 'gov-form-search.scss',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant: FormSearchVariantType = 'secondary'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root}>\n\t\t\t\t<span class={FormSearchClass.input}>\n\t\t\t\t\t<slot name=\"input\" />\n\t\t\t\t</span>\n\t\t\t\t<span class={FormSearchClass.button}>\n\t\t\t\t\t<slot name=\"button\" />\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-search.entry.js","mappings":";;;;AAI2B,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAG5D,MAAM,eAAe,GAAG;EAC9B,IAAI,EAAE,iBAAiB;EACvB,KAAK,EAAE,wBAAwB;EAC/B,MAAM,EAAE,yBAAyB;CACjC;;ACXD,MAAM,gBAAgB,GAAG,w6CAAw6C;;MCMp7C,aAAa;;;mBAKwC,WAAW;;EAE5E,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,eAAe,CAAC,IAAI,IAChC,YAAM,KAAK,EAAE,eAAe,CAAC,KAAK,IACjC,YAAM,IAAI,EAAC,OAAO,GAAG,CACf,EACP,YAAM,KAAK,EAAE,eAAe,CAAC,MAAM,IAClC,YAAM,IAAI,EAAC,QAAQ,GAAG,CAChB,CACD,EACP;GACD;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/search/constants.ts","../../../packages/core/src/components/gov-form/search/gov-form-search.scss?tag=gov-form-search","../../../packages/core/src/components/gov-form/search/gov-form-search.tsx"],"sourcesContent":["import { Variants } from '../../../core/constants/variants'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormSearchs = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type FormSearchVariantType = `${ValueOf<typeof FormSearchs>}`\n\nexport const FormSearchClass = {\n\troot: 'gov-form-search',\n\tinput: 'gov-form-search__input',\n\tbutton: 'gov-form-search__button',\n}\n","/*\n * Search\n */\n\n$class: \".gov-form-search\";\n\n#{$class} {\n\t@include base(flex);\n\t@include focus-outline($border-radius, 0, true);\n\tgap: rem-calc(8);\n\talign-items: center;\n\tborder-radius: $border-radius;\n\tbackground-color: $form-bg-color;\n\t&__input {\n\t\tflex: 1 1 auto;\n\t\tinput {\n\t\t\theight: auto;\n\t\t\tborder-width: 0 !important;\n\t\t\t&:focus-visible {\n\t\t\t\toutline: none !important;\n\t\t\t}\n\t\t}\n\t}\n\t&__button {\n\t\tflex: 0 0 auto;\n\t\tmargin: rem-calc(3) rem-calc(3) rem-calc(3) 0;\n\t}\n\n\t@each $variant, $definitions in $form-input-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { FormSearchClass, FormSearchVariantType } from './constants'\n@Component({\n\ttag: 'gov-form-search',\n\tstyleUrl: 'gov-form-search.scss',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop({reflect: true}) readonly variant: FormSearchVariantType = 'secondary'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root}>\n\t\t\t\t<span class={FormSearchClass.input}>\n\t\t\t\t\t<slot name=\"input\" />\n\t\t\t\t</span>\n\t\t\t\t<span class={FormSearchClass.button}>\n\t\t\t\t\t<slot name=\"button\" />\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
- import { g as govForm, n as FormSelectClass, o as FormSelectVariants, p as FormSelectSizes } from './form-2d9f68d9.js';
3
- import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-10332292.js';
2
+ import { g as govForm, n as FormSelectClass, o as FormSelectVariants, p as FormSelectSizes } from './form-39dc6896.js';
3
+ import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
4
4
  import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
5
5
  import { v as validateProp } from './props-789f7529.js';
6
6
  import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
@@ -36,6 +36,7 @@ const GovFormSelect = class {
36
36
  this.wcagLabelledBy = undefined;
37
37
  this.wcagOwns = undefined;
38
38
  this.focused = undefined;
39
+ this.options = [];
39
40
  this.h = govHost(this.host);
40
41
  this.f = govForm(this.h);
41
42
  this.selectId = createID('GovSelect');
@@ -82,7 +83,9 @@ const GovFormSelect = class {
82
83
  });
83
84
  }
84
85
  render() {
85
- return (h(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, h("gov-icon", { slot: "right-icon", name: "chevron-down", class: "icon-arrow" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
86
+ return (h(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, h("gov-icon", { slot: "right-icon", name: "chevron-down", class: "icon-arrow" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null), this.options.map((option) => {
87
+ return (h("option", { value: option.value, selected: option.value === this.value, disabled: option === null || option === void 0 ? void 0 : option.disabled }, option.label));
88
+ }))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
86
89
  }
87
90
  onFocusHandler(e) {
88
91
  this.focused = true;
@@ -127,6 +130,14 @@ const GovFormSelect = class {
127
130
  async getRef() {
128
131
  return this.selectRef;
129
132
  }
133
+ /**
134
+ * Sets the selection options
135
+ */
136
+ async setOptions(options) {
137
+ if (Array.isArray(options)) {
138
+ this.options = options;
139
+ }
140
+ }
130
141
  /**
131
142
  * Validate the WCAG attributes of the component
132
143
  */
@@ -1 +1 @@
1
- {"file":"gov-form-select.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,28lBAA28lB;;MCiBv9lB,aAAa;EAOzB;;;;;;;mBAkBmD,WAAW;gBAIhB,GAAG;;oBASZ,KAAK;;oBASL,KAAK;;;;;;;;IAvCzC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;GACrC;EA4ED,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,kBAAkB,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAChE;EAGD,YAAY,CAAC,QAAgB;IAC5B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AMD,MAAM,QAAQ,CAAC,OAAsB;IACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;GACpC;;;;EAMD,MAAM,QAAQ,CAAC,KAAa;IAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;GAClB;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,SAAS,CAAA;GACrB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC1F,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAChF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACjE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GACjG;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.scss?tag=gov-form-select","../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["/*\n * Select\n */\n\n@import \"../select/gov-form-select-core.scss\";\n\n$class: \".gov-form-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core'\nimport { govForm } from '../../../helpers/Dom/form'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { createID } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { FormSelectClass, FormSelectSizes, FormSelectSizesType, FormSelectVariants, FormSelectVariantType } from './constants'\nimport { FormSelectEvent } from './gov-form-select.types'\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType = 'secondary'\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a related component’s visually focused element.\n\t */\n\t@Prop({ attribute: 'wcag-active-descendant' }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({ attribute: 'wcag-controls' }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\" class=\"icon-arrow\"></gov-icon>\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-select.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,28lBAA28lB;;MCuBv9lB,aAAa;EAOzB;;;;;;;mBAkBmD,WAAW;gBAIhB,GAAG;;oBASZ,KAAK;;oBASL,KAAK;;;;;;;;mBAsCH,EAAE;IA7ExC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;GACrC;EA6ED,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,kBAAkB,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAChE;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,eAAe,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAC7D;EAKD,aAAa;IACZ,IAAI,CAAC,gBAAgB,EAAE,CAAA;GACvB;EAGD,UAAU;IACT,IAAI,CAAC,iBAAiB,EAAE,CAAA;GACxB;EAEO,gBAAgB;IACvB,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3C,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,IAAI,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C,KAAa;IAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;GAClB;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,SAAS,CAAA;GACrB;;;;EAMD,MAAM,UAAU,CAAC,OAA2B;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;MAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;KACtB;GACD;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,wBAAwB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC1F,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAChF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACjE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GACjG;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.scss?tag=gov-form-select","../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["/*\n * Select\n */\n\n@import \"../select/gov-form-select-core.scss\";\n\n$class: \".gov-form-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {createID} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {\n\tFormSelectClass,\n\tFormSelectSizes,\n\tFormSelectSizesType,\n\tFormSelectVariants,\n\tFormSelectVariantType\n} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType = 'secondary'\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a related component’s visually focused element.\n\t */\n\t@Prop({attribute: 'wcag-active-descendant'}) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({attribute: 'wcag-controls'}) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() options: FormSelectOption[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('size')\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\" class=\"icon-arrow\"></gov-icon>\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t{this.options.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Sets the selection options\n\t */\n\t@Method()\n\tasync setOptions(options: FormSelectOption[]): Promise<void> {\n\t\tif (Array.isArray(options)) {\n\t\t\tthis.options = options\n\t\t}\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"],"version":3}
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
2
  import { c as createID } from './string.utils-f268fc6b.js';
3
3
  import { v as validateProp } from './props-789f7529.js';
4
- import { g as govForm, i as FormSwitchClass, j as FormSwitchSizes } from './form-2d9f68d9.js';
5
- import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-10332292.js';
4
+ import { g as govForm, i as FormSwitchClass, j as FormSwitchSizes } from './form-39dc6896.js';
5
+ import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
6
6
  import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
7
7
  import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
8
8
  import { d as delay } from './utils-c057a3fa.js';
@@ -14,7 +14,7 @@ import './constants-3df712e2.js';
14
14
  import './constants-47d7a8bc.js';
15
15
  import './constants-ebec7de8.js';
16
16
 
17
- const govFormSwitchCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-switch{position:relative;display:flex}.gov-form-switch__holder{display:inline-flex}.gov-form-switch__input{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-switch .gov-form-label__label{position:relative;z-index:1;margin-bottom:0;color:var(--gov-form-switch-color, var(--gov-color-secondary-800))}.gov-form-switch__indicator{position:absolute;top:0;left:0;border:var(--gov-form-switch-indicator-border, 0.0625rem solid var(--gov-color-secondary-500));background-color:var(--gov-form-switch-indicator-bg, var(--gov-color-secondary-300));transition:150ms linear background-color}.gov-form-switch__indicator::before{content:\"\";position:absolute;display:block;border-radius:50%;background-color:var(--gov-form-switch-indicator-circle-bg, var(--gov-color-neutral-white));transition:150ms linear left;box-shadow:var(--gov-form-switch-indicator-circle-box-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.35))}.gov-form-switch__input:focus-visible~.gov-form-switch__indicator{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-form-switch__input:checked+.gov-form-switch__indicator{border-color:var(--gov-form-switch-indicator-bg-checked, var(--gov-color-primary));background-color:var(--gov-form-switch-indicator-bg-checked, var(--gov-color-primary))}.gov-form-switch[disabled=\"\"],.gov-form-switch[disabled=true i],.gov-form-switch[disabled=\"1\"]{pointer-events:none}.gov-form-switch[disabled=\"\"] .gov-form-label__label,.gov-form-switch[disabled=true i] .gov-form-label__label,.gov-form-switch[disabled=\"1\"] .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}.gov-form-switch[disabled=\"\"] .gov-form-switch__indicator::before,.gov-form-switch[disabled=true i] .gov-form-switch__indicator::before,.gov-form-switch[disabled=\"1\"] .gov-form-switch__indicator::before{background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300))}.gov-form-switch[disabled=\"\"] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[disabled=true i] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[disabled=\"1\"] .gov-form-switch__input:checked+.gov-form-switch__indicator{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-switch[invalid=\"\"] .gov-form-label__label,.gov-form-switch[invalid=true i] .gov-form-label__label,.gov-form-switch[invalid=\"1\"] .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[invalid=\"\"] .gov-form-switch__indicator,.gov-form-switch[invalid=true i] .gov-form-switch__indicator,.gov-form-switch[invalid=\"1\"] .gov-form-switch__indicator{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[invalid=\"\"] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[invalid=true i] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[invalid=\"1\"] .gov-form-switch__input:checked+.gov-form-switch__indicator{background-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[size=xs] .gov-form-label__label{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);margin-bottom:0}.gov-form-switch[size=xs] .gov-form-switch__holder{gap:var(--gov-form-switch-xs-gap, 0.75rem)}.gov-form-switch[size=xs] .gov-form-switch__input{width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667);height:var(--gov-form-switch-xs-indicator-height, 1.25rem)}.gov-form-switch[size=xs] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667);height:var(--gov-form-switch-xs-indicator-height, 1.25rem);border-radius:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 0.5)}.gov-form-switch[size=xs] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem);left:calc(var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem);width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) - 2 * var(--gov-form-switch-xs-toggle-offset, 0.051875rem));height:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) - 2 * var(--gov-form-switch-xs-toggle-offset, 0.051875rem))}.gov-form-switch[size=xs] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667 - var(--gov-form-switch-xs-indicator-height, 1.25rem) + var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem)}.gov-form-switch[size=xs] label{display:inline-flex}.gov-form-switch[size=xs] label .gov-form-switch__input{width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667)}.gov-form-switch[size=s] .gov-form-label__label{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);margin-bottom:0}.gov-form-switch[size=s] .gov-form-switch__holder{gap:var(--gov-form-switch-s-gap, 0.75rem)}.gov-form-switch[size=s] .gov-form-switch__input{width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667);height:var(--gov-form-switch-s-indicator-height, 1.375rem)}.gov-form-switch[size=s] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667);height:var(--gov-form-switch-s-indicator-height, 1.375rem);border-radius:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 0.5)}.gov-form-switch[size=s] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem);left:calc(var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem);width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) - 2 * var(--gov-form-switch-s-toggle-offset, 0.0575rem));height:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) - 2 * var(--gov-form-switch-s-toggle-offset, 0.0575rem))}.gov-form-switch[size=s] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667 - var(--gov-form-switch-s-indicator-height, 1.375rem) + var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem)}.gov-form-switch[size=s] label{display:inline-flex}.gov-form-switch[size=s] label .gov-form-switch__input{width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667)}.gov-form-switch[size=m] .gov-form-label__label{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);margin-bottom:0}.gov-form-switch[size=m] .gov-form-switch__holder{gap:var(--gov-form-switch-m-gap, 1rem)}.gov-form-switch[size=m] .gov-form-switch__input{width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667);height:var(--gov-form-switch-m-indicator-height, 1.5rem)}.gov-form-switch[size=m] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667);height:var(--gov-form-switch-m-indicator-height, 1.5rem);border-radius:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 0.5)}.gov-form-switch[size=m] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem);left:calc(var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem);width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) - 2 * var(--gov-form-switch-m-toggle-offset, 0.0625rem));height:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) - 2 * var(--gov-form-switch-m-toggle-offset, 0.0625rem))}.gov-form-switch[size=m] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667 - var(--gov-form-switch-m-indicator-height, 1.5rem) + var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem)}.gov-form-switch[size=m] label{display:inline-flex}.gov-form-switch[size=m] label .gov-form-switch__input{width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667)}.gov-form-switch[size=l] .gov-form-label__label{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);margin-bottom:0}.gov-form-switch[size=l] .gov-form-switch__holder{gap:var(--gov-form-switch-l-gap, 1rem)}.gov-form-switch[size=l] .gov-form-switch__input{width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667);height:var(--gov-form-switch-l-indicator-height, 2rem)}.gov-form-switch[size=l] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667);height:var(--gov-form-switch-l-indicator-height, 2rem);border-radius:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 0.5)}.gov-form-switch[size=l] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem);left:calc(var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem);width:calc(var(--gov-form-switch-l-indicator-height, 2rem) - 2 * var(--gov-form-switch-l-toggle-offset, 0.083125rem));height:calc(var(--gov-form-switch-l-indicator-height, 2rem) - 2 * var(--gov-form-switch-l-toggle-offset, 0.083125rem))}.gov-form-switch[size=l] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667 - var(--gov-form-switch-l-indicator-height, 2rem) + var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem)}.gov-form-switch[size=l] label{display:inline-flex}.gov-form-switch[size=l] label .gov-form-switch__input{width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667)}";
17
+ const govFormSwitchCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-switch{position:relative;display:flex}.gov-form-switch__holder{display:inline-flex}.gov-form-switch__input{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;flex-shrink:0}.gov-form-switch .gov-form-label__label{position:relative;z-index:1;margin-bottom:0;color:var(--gov-form-switch-color, var(--gov-color-secondary-800))}.gov-form-switch__indicator{position:absolute;top:0;left:0;border:var(--gov-form-switch-indicator-border, 0.0625rem solid var(--gov-color-secondary-500));background-color:var(--gov-form-switch-indicator-bg, var(--gov-color-secondary-300));transition:150ms linear background-color}.gov-form-switch__indicator::before{content:\"\";position:absolute;display:block;border-radius:50%;background-color:var(--gov-form-switch-indicator-circle-bg, var(--gov-color-neutral-white));transition:150ms linear left;box-shadow:var(--gov-form-switch-indicator-circle-box-shadow, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.35))}.gov-form-switch__input:focus-visible~.gov-form-switch__indicator{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-form-switch__input:checked+.gov-form-switch__indicator{border-color:var(--gov-form-switch-indicator-bg-checked, var(--gov-color-primary));background-color:var(--gov-form-switch-indicator-bg-checked, var(--gov-color-primary))}.gov-form-switch[disabled=\"\"],.gov-form-switch[disabled=true i],.gov-form-switch[disabled=\"1\"]{pointer-events:none}.gov-form-switch[disabled=\"\"] .gov-form-label__label,.gov-form-switch[disabled=true i] .gov-form-label__label,.gov-form-switch[disabled=\"1\"] .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}.gov-form-switch[disabled=\"\"] .gov-form-switch__indicator::before,.gov-form-switch[disabled=true i] .gov-form-switch__indicator::before,.gov-form-switch[disabled=\"1\"] .gov-form-switch__indicator::before{background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300))}.gov-form-switch[disabled=\"\"] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[disabled=true i] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[disabled=\"1\"] .gov-form-switch__input:checked+.gov-form-switch__indicator{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-switch[invalid=\"\"] .gov-form-label__label,.gov-form-switch[invalid=true i] .gov-form-label__label,.gov-form-switch[invalid=\"1\"] .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[invalid=\"\"] .gov-form-switch__indicator,.gov-form-switch[invalid=true i] .gov-form-switch__indicator,.gov-form-switch[invalid=\"1\"] .gov-form-switch__indicator{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[invalid=\"\"] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[invalid=true i] .gov-form-switch__input:checked+.gov-form-switch__indicator,.gov-form-switch[invalid=\"1\"] .gov-form-switch__input:checked+.gov-form-switch__indicator{background-color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-switch[size=xs] .gov-form-label__label{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);margin-bottom:0}.gov-form-switch[size=xs] .gov-form-switch__holder{gap:var(--gov-form-switch-xs-gap, 0.75rem)}.gov-form-switch[size=xs] .gov-form-switch__input{width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667);height:var(--gov-form-switch-xs-indicator-height, 1.25rem)}.gov-form-switch[size=xs] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667);height:var(--gov-form-switch-xs-indicator-height, 1.25rem);border-radius:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 0.5)}.gov-form-switch[size=xs] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem);left:calc(var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem);width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) - 2 * var(--gov-form-switch-xs-toggle-offset, 0.051875rem));height:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) - 2 * var(--gov-form-switch-xs-toggle-offset, 0.051875rem))}.gov-form-switch[size=xs] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667 - var(--gov-form-switch-xs-indicator-height, 1.25rem) + var(--gov-form-switch-xs-toggle-offset, 0.051875rem) - 0.0625rem)}.gov-form-switch[size=xs] label{display:inline-flex}.gov-form-switch[size=xs] label .gov-form-switch__input{width:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667)}.gov-form-switch[size=s] .gov-form-label__label{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);margin-bottom:0}.gov-form-switch[size=s] .gov-form-switch__holder{gap:var(--gov-form-switch-s-gap, 0.75rem)}.gov-form-switch[size=s] .gov-form-switch__input{width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667);height:var(--gov-form-switch-s-indicator-height, 1.375rem)}.gov-form-switch[size=s] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667);height:var(--gov-form-switch-s-indicator-height, 1.375rem);border-radius:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 0.5)}.gov-form-switch[size=s] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem);left:calc(var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem);width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) - 2 * var(--gov-form-switch-s-toggle-offset, 0.0575rem));height:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) - 2 * var(--gov-form-switch-s-toggle-offset, 0.0575rem))}.gov-form-switch[size=s] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667 - var(--gov-form-switch-s-indicator-height, 1.375rem) + var(--gov-form-switch-s-toggle-offset, 0.0575rem) - 0.0625rem)}.gov-form-switch[size=s] label{display:inline-flex}.gov-form-switch[size=s] label .gov-form-switch__input{width:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667)}.gov-form-switch[size=m] .gov-form-label__label{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);margin-bottom:0}.gov-form-switch[size=m] .gov-form-switch__holder{gap:var(--gov-form-switch-m-gap, 1rem)}.gov-form-switch[size=m] .gov-form-switch__input{width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667);height:var(--gov-form-switch-m-indicator-height, 1.5rem)}.gov-form-switch[size=m] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667);height:var(--gov-form-switch-m-indicator-height, 1.5rem);border-radius:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 0.5)}.gov-form-switch[size=m] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem);left:calc(var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem);width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) - 2 * var(--gov-form-switch-m-toggle-offset, 0.0625rem));height:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) - 2 * var(--gov-form-switch-m-toggle-offset, 0.0625rem))}.gov-form-switch[size=m] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667 - var(--gov-form-switch-m-indicator-height, 1.5rem) + var(--gov-form-switch-m-toggle-offset, 0.0625rem) - 0.0625rem)}.gov-form-switch[size=m] label{display:inline-flex}.gov-form-switch[size=m] label .gov-form-switch__input{width:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667)}.gov-form-switch[size=l] .gov-form-label__label{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);margin-bottom:0}.gov-form-switch[size=l] .gov-form-switch__holder{gap:var(--gov-form-switch-l-gap, 1rem)}.gov-form-switch[size=l] .gov-form-switch__input{width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667);height:var(--gov-form-switch-l-indicator-height, 2rem)}.gov-form-switch[size=l] .gov-form-switch__indicator{display:block;width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667);height:var(--gov-form-switch-l-indicator-height, 2rem);border-radius:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 0.5)}.gov-form-switch[size=l] .gov-form-switch__indicator::before{top:calc(var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem);left:calc(var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem);width:calc(var(--gov-form-switch-l-indicator-height, 2rem) - 2 * var(--gov-form-switch-l-toggle-offset, 0.083125rem));height:calc(var(--gov-form-switch-l-indicator-height, 2rem) - 2 * var(--gov-form-switch-l-toggle-offset, 0.083125rem))}.gov-form-switch[size=l] .gov-form-switch__input[aria-checked]+.gov-form-switch__indicator::before{left:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667 - var(--gov-form-switch-l-indicator-height, 2rem) + var(--gov-form-switch-l-toggle-offset, 0.083125rem) - 0.0625rem)}.gov-form-switch[size=l] label{display:inline-flex}.gov-form-switch[size=l] label .gov-form-switch__input{width:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667)}";
18
18
 
19
19
  const GovFormSwitch = class {
20
20
  constructor(hostRef) {
@@ -1 +1 @@
1
- {"file":"gov-form-switch.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,stUAAstU;;MCkBluU,aAAa;EAOzB;;;;;;mBAe6D,KAAK;mBAIhB,KAAK;oBAKlB,KAAK;oBAKL,KAAK;;gBAQI,GAAG;;;;;IApChD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;IAEzC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA+DD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,eAAe,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAC7D;EAKD,aAAa;IACZ,IAAI,CAAC,gBAAgB,EAAE,CAAA;GACvB;EAEO,gBAAgB;IACvB,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3C,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7D,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;GAC1C;EAED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IAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;IACrD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MACnB,SAAS,EAAE,eAAe,CAAC,IAAI;MAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAChF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC9E,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GACnG;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/switch/gov-form-switch.scss?tag=gov-form-switch","../../../packages/core/src/components/gov-form/switch/gov-form-switch.tsx"],"sourcesContent":["/*\n * Switch\n */\n\n$class: \".gov-form-switch\";\n$indicator-ratio: calc(5 / 3);\n\n#{$class} {\n\tposition: relative;\n\tdisplay: flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t}\n\t&__input {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tappearance: none;\n\t}\n\t.gov-form-label__label {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tmargin-bottom: 0;\n\t\tcolor: $form-switch-color;\n\t}\n\t&__indicator {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tborder: $form-switch-indicator-border;\n\t\tbackground-color: $form-switch-indicator-bg;\n\t\ttransition: $t linear background-color;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground-color: $form-switch-indicator-circle-bg;\n\t\t\ttransition: $t linear left;\n\t\t\tbox-shadow: $form-switch-indicator-circle-box-shadow;\n\t\t}\n\t}\n\n\t// STATES\n\t// focus\n\t&__input:focus-visible ~ &__indicator {\n\t\toutline: $outline;\n\t}\n\t// checked\n\t&__input:checked + &__indicator {\n\t\tborder-color: $form-switch-indicator-bg-checked;\n\t\tbackground-color: $form-switch-indicator-bg-checked;\n\t}\n\n\t// disabled\n\t@include parameter(\"disabled\") {\n\t\tpointer-events: none;\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-disabled;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground: $form-state-bg-input-disabled;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t\t}\n\t\t}\n\t}\n\n\t// invalid\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tbackground-color: $form-state-color-error;\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t$indicator-height: get(\"indicator-height\", $definitions);\n\t\t$border-offset: calc(get(\"toggle-offset\", $definitions) - rem-calc(1));\n\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.gov-form-label__label {\n\t\t\t\t@include typography($size);\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__holder {\n\t\t\t\t\tgap: get(\"gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t}\n\t\t\t\t&__indicator {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t\tborder-radius: calc($indicator-height * 0.5);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\ttop: $border-offset;\n\t\t\t\t\t\tleft: $border-offset;\n\t\t\t\t\t\twidth: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t\theight: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// STATES\n\t\t\t\t&__input[aria-checked] + #{$class}__indicator {\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tleft: calc($indicator-width - $indicator-height + $border-offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\t#{$class}__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormSwitchClass, FormSwitchSizes, FormSwitchSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormSwitchEvent } from \"./gov-form-switch.types\"\n\n@Component({\n\ttag: \"gov-form-switch\",\n\tstyleUrl: \"gov-form-switch.scss\",\n})\nexport class GovFormSwitch {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSwitchElement\n\t/**\n\t * Value of switch\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Switch default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the switch component disabled.\n\t * This prevents users from being able to interact with the switch, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the switch.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: FormSwitchSizesType = \"m\"\n\t/**\n\t * Custom switch identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the switch has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSwitchSizes, newValue, FormSwitchClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"switch\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormSwitchClass.root)} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormSwitchClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormSwitchClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class={FormSwitchClass.indicator}></span>\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormSwitchClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormSwitchClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormSwitchClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-switch.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,mvUAAmvU;;MCkB/vU,aAAa;EAOzB;;;;;;mBAe6D,KAAK;mBAIhB,KAAK;oBAKlB,KAAK;oBAKL,KAAK;;gBAQI,GAAG;;;;;IApChD,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;IAEzC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA+DD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,eAAe,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GAC7D;EAKD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,IAAI,CAAC;MAClB,SAAS,EAAE,eAAe,CAAC,IAAI;MAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;EAEO,aAAa,CAAC,CAAa;IAClC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;MACjB,SAAS,EAAE,eAAe,CAAC,IAAI;MAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;EAEO,eAAe,CAAC,CAAQ;IAC/B,IAAI,CAAC,OAAO,GAAI,CAAC,CAAC,MAA2B,CAAC,OAAO,CAAA;IACrD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;MACnB,SAAS,EAAE,eAAe,CAAC,IAAI;MAC/B,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAChF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAC9E,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;GACnG;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/switch/gov-form-switch.scss?tag=gov-form-switch","../../../packages/core/src/components/gov-form/switch/gov-form-switch.tsx"],"sourcesContent":["/*\n * Switch\n */\n\n$class: \".gov-form-switch\";\n$indicator-ratio: calc(5 / 3);\n\n#{$class} {\n\tposition: relative;\n\tdisplay: flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t}\n\t&__input {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tappearance: none;\n\t\tcursor: pointer;\n\t\tflex-shrink: 0;\n\t}\n\t.gov-form-label__label {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tmargin-bottom: 0;\n\t\tcolor: $form-switch-color;\n\t}\n\t&__indicator {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tborder: $form-switch-indicator-border;\n\t\tbackground-color: $form-switch-indicator-bg;\n\t\ttransition: $t linear background-color;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground-color: $form-switch-indicator-circle-bg;\n\t\t\ttransition: $t linear left;\n\t\t\tbox-shadow: $form-switch-indicator-circle-box-shadow;\n\t\t}\n\t}\n\n\t// STATES\n\t// focus\n\t&__input:focus-visible ~ &__indicator {\n\t\toutline: $outline;\n\t}\n\t// checked\n\t&__input:checked + &__indicator {\n\t\tborder-color: $form-switch-indicator-bg-checked;\n\t\tbackground-color: $form-switch-indicator-bg-checked;\n\t}\n\n\t// disabled\n\t@include parameter(\"disabled\") {\n\t\tpointer-events: none;\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-disabled;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground: $form-state-bg-input-disabled;\n\t\t\t\t}\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t\t}\n\t\t}\n\t}\n\n\t// invalid\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t\t#{$class} {\n\t\t\t&__indicator {\n\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t}\n\t\t\t&__input:checked + #{$class}__indicator {\n\t\t\t\tbackground-color: $form-state-color-error;\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t$indicator-height: get(\"indicator-height\", $definitions);\n\t\t$border-offset: calc(get(\"toggle-offset\", $definitions) - rem-calc(1));\n\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.gov-form-label__label {\n\t\t\t\t@include typography($size);\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t#{$class} {\n\t\t\t\t&__holder {\n\t\t\t\t\tgap: get(\"gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t}\n\t\t\t\t&__indicator {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t\theight: $indicator-height;\n\t\t\t\t\tborder-radius: calc($indicator-height * 0.5);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\ttop: $border-offset;\n\t\t\t\t\t\tleft: $border-offset;\n\t\t\t\t\t\twidth: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t\theight: calc($indicator-height - (2 * get(\"toggle-offset\", $definitions)));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// STATES\n\t\t\t\t&__input[aria-checked] + #{$class}__indicator {\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tleft: calc($indicator-width - $indicator-height + $border-offset);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlabel {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\t#{$class}__input {\n\t\t\t\t\twidth: $indicator-width;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormSwitchClass, FormSwitchSizes, FormSwitchSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormSwitchEvent } from \"./gov-form-switch.types\"\n\n@Component({\n\ttag: \"gov-form-switch\",\n\tstyleUrl: \"gov-form-switch.scss\",\n})\nexport class GovFormSwitch {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSwitchElement\n\t/**\n\t * Value of switch\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Switch button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the switch component disabled.\n\t * This prevents users from being able to interact with the switch, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the switch.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Switch's size.\n\t */\n\t@Prop() readonly size?: FormSwitchSizesType = \"m\"\n\t/**\n\t * Custom switch identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the switch has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormSwitchEvent>\n\t/**\n\t * Emitted when the switch change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormSwitchEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSwitchSizes, newValue, FormSwitchClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", \"switch\")\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FormSwitchClass.root)} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormSwitchClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormSwitchClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class={FormSwitchClass.indicator}></span>\n\t\t\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSwitchClass.root,\n\t\t\tchecked: this.checked,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormSwitchClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormSwitchClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormSwitchClass.root)\n\t}\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
2
  import { a as GridItemClass } from './constants-2b14bb01.js';
3
- import { g as govHost } from './template-10332292.js';
3
+ import { g as govHost } from './template-df429738.js';
4
4
 
5
5
  const govGridItemCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-grid-item{border:0 solid transparent;-o-border-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E\");border-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E\")}.gov-grid-item[size=\"1/12\"]{width:8.3333333333%}.gov-grid-item[size=\"2/12\"]{width:16.6666666667%}.gov-grid-item[size=\"3/12\"]{width:25%}.gov-grid-item[size=\"4/12\"]{width:33.3333333333%}.gov-grid-item[size=\"5/12\"]{width:41.6666666667%}.gov-grid-item[size=\"6/12\"]{width:50%}.gov-grid-item[size=\"7/12\"]{width:58.3333333333%}.gov-grid-item[size=\"8/12\"]{width:66.6666666667%}.gov-grid-item[size=\"9/12\"]{width:75%}.gov-grid-item[size=\"10/12\"]{width:83.3333333333%}.gov-grid-item[size=\"11/12\"]{width:91.6666666667%}.gov-grid-item[size=\"12/12\"]{width:100%}@media (min-width: 30em){.gov-grid-item[size-sm=\"1/12\"]{width:8.3333333333%}.gov-grid-item[size-sm=\"2/12\"]{width:16.6666666667%}.gov-grid-item[size-sm=\"3/12\"]{width:25%}.gov-grid-item[size-sm=\"4/12\"]{width:33.3333333333%}.gov-grid-item[size-sm=\"5/12\"]{width:41.6666666667%}.gov-grid-item[size-sm=\"6/12\"]{width:50%}.gov-grid-item[size-sm=\"7/12\"]{width:58.3333333333%}.gov-grid-item[size-sm=\"8/12\"]{width:66.6666666667%}.gov-grid-item[size-sm=\"9/12\"]{width:75%}.gov-grid-item[size-sm=\"10/12\"]{width:83.3333333333%}.gov-grid-item[size-sm=\"11/12\"]{width:91.6666666667%}.gov-grid-item[size-sm=\"12/12\"]{width:100%}}@media (min-width: 48em){.gov-grid-item[size-md=\"1/12\"]{width:8.3333333333%}.gov-grid-item[size-md=\"2/12\"]{width:16.6666666667%}.gov-grid-item[size-md=\"3/12\"]{width:25%}.gov-grid-item[size-md=\"4/12\"]{width:33.3333333333%}.gov-grid-item[size-md=\"5/12\"]{width:41.6666666667%}.gov-grid-item[size-md=\"6/12\"]{width:50%}.gov-grid-item[size-md=\"7/12\"]{width:58.3333333333%}.gov-grid-item[size-md=\"8/12\"]{width:66.6666666667%}.gov-grid-item[size-md=\"9/12\"]{width:75%}.gov-grid-item[size-md=\"10/12\"]{width:83.3333333333%}.gov-grid-item[size-md=\"11/12\"]{width:91.6666666667%}.gov-grid-item[size-md=\"12/12\"]{width:100%}}@media (min-width: 64em){.gov-grid-item[size-lg=\"1/12\"]{width:8.3333333333%}.gov-grid-item[size-lg=\"2/12\"]{width:16.6666666667%}.gov-grid-item[size-lg=\"3/12\"]{width:25%}.gov-grid-item[size-lg=\"4/12\"]{width:33.3333333333%}.gov-grid-item[size-lg=\"5/12\"]{width:41.6666666667%}.gov-grid-item[size-lg=\"6/12\"]{width:50%}.gov-grid-item[size-lg=\"7/12\"]{width:58.3333333333%}.gov-grid-item[size-lg=\"8/12\"]{width:66.6666666667%}.gov-grid-item[size-lg=\"9/12\"]{width:75%}.gov-grid-item[size-lg=\"10/12\"]{width:83.3333333333%}.gov-grid-item[size-lg=\"11/12\"]{width:91.6666666667%}.gov-grid-item[size-lg=\"12/12\"]{width:100%}}@media (min-width: 75em){.gov-grid-item[size-xl=\"1/12\"]{width:8.3333333333%}.gov-grid-item[size-xl=\"2/12\"]{width:16.6666666667%}.gov-grid-item[size-xl=\"3/12\"]{width:25%}.gov-grid-item[size-xl=\"4/12\"]{width:33.3333333333%}.gov-grid-item[size-xl=\"5/12\"]{width:41.6666666667%}.gov-grid-item[size-xl=\"6/12\"]{width:50%}.gov-grid-item[size-xl=\"7/12\"]{width:58.3333333333%}.gov-grid-item[size-xl=\"8/12\"]{width:66.6666666667%}.gov-grid-item[size-xl=\"9/12\"]{width:75%}.gov-grid-item[size-xl=\"10/12\"]{width:83.3333333333%}.gov-grid-item[size-xl=\"11/12\"]{width:91.6666666667%}.gov-grid-item[size-xl=\"12/12\"]{width:100%}}";
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
2
  import { G as GridClass } from './constants-2b14bb01.js';
3
- import { g as govHost } from './template-10332292.js';
3
+ import { g as govHost } from './template-df429738.js';
4
4
 
5
5
  const govGridCss = ".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-grid{position:relative;display:flex;width:100%;flex-wrap:wrap}.gov-grid[align-x=middle]{align-items:center}.gov-grid[align-x=bottom]{align-items:flex-end}.gov-grid[align-y=center]{justify-content:center}.gov-grid[align-y=right]{justify-content:flex-end}.gov-grid[align-y=space-between]{justify-content:space-between}.gov-grid[align-y=space-around]{justify-content:space-around}";
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { a as getAssetPath, r as registerInstance, h, H as Host, g as getElement } from './index-ae3c50f1.js';
2
2
  import { i as iconsPath, a as iconsLazyLoad } from './win-0a50f66e.js';
3
- import { g as govHost } from './template-10332292.js';
3
+ import { g as govHost } from './template-df429738.js';
4
4
  import './utils-c057a3fa.js';
5
5
 
6
6
  var Types;
@@ -14,7 +14,7 @@ const IconClass = {
14
14
  holder: 'gov-icon__holder',
15
15
  };
16
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CAAA;KACF;GACD;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,oBAAoB,EAAE;MAC9B,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAA;MACtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;KAChC;GACD;EAED,MAAM,iBAAiB;IACtB,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAA;GAC7B;EAEO,gBAAgB,CAAC,QAAoB;IAC5C,IAAwB,OAAO,MAAM,KAAK,WAAW,IAAI,CAAE,MAAc,CAAC,oBAAoB,EAAE;MAC/F,QAAQ,EAAE,CAAA;MACV,OAAM;KACN;IACD,IAAI,CAAC,oBAAoB,GAAG,IAAI,oBAAoB,CACnD,OAAO;MACN,OAAO,CAAC,OAAO,CAAC,KAAK;QACpB,IAAI,KAAK,CAAC,cAAc,EAAE;UACzB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC9B,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAA;YACtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;WAChC;UACD,QAAQ,EAAE,CAAA;SACV;OACD,CAAC,CAAA;KACF,EACD,EAAE,UAAU,EAAE,MAAM,EAAE,CACtB,CAAA;IACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC5C;EAED,MAAM;IACL,IAAI,IAAI,CAAC,KAAK,EAAE;MACf,OAAO,IAAI,CAAA;KACX;IACD,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAC1C,YAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC1D,EACP;GACD;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/components/gov-icon/gov-icon.scss?tag=gov-icon","../../../packages/core/src/components/gov-icon/gov-icon.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tif (!requestCache[cacheKey]) {\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","/*\n * Icon\n */\n\n$class: \".gov-icon\";\n\n#{$class} {\n\tdisplay: inline-flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t}\n}\n","import { Build, Component, Element, h, Host, Prop, State, Watch } from \"@stencil/core\"\nimport { IconClass, Type } from \"./constants\"\nimport { fetchIcon } from \"../../utils/icon.utils\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { iconsLazyLoad } from \"../../helpers/Dom/win\"\n\n@Component({\n\tassetsDirs: [\"assets\"],\n\tstyleUrl: \"gov-icon.scss\",\n\ttag: \"gov-icon\",\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Name of icon\n\t */\n\t@Prop() name: string = null\n\t/**\n\t * Type of icon\n\t */\n\t@Prop() type: Type = \"basic\"\n\t@State() private iconData: string\n\t@State() private visible = false\n\t@State() private error = false\n\tprivate intersectionObserver: IntersectionObserver\n\n\t@Watch(\"name\")\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst { name, visible, type } = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tthis.iconData = await fetchIcon({ name, type })\n\t\t} catch (e) {\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\tconnectedCallback(): void {\n\t\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\n\t\t}\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif (this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{ rootMargin: \"50px\" },\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)}>\n\t\t\t\t<span class={IconClass.holder} innerHTML={this.iconData}></span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-icon.entry.js","mappings":";;;;;AAEA,IAAK,KAIJ;AAJD,WAAK,KAAK;EACT,wBAAe,CAAA;EACf,4BAAmB,CAAA;EACnB,4BAAmB,CAAA;AACpB,CAAC,EAJI,KAAK,KAAL,KAAK,QAIT;AAGM,MAAM,SAAS,GAAG;EACxB,IAAI,EAAE,UAAU;EAChB,MAAM,EAAE,kBAAkB;CAC1B;;;;ACVM,MAAM,SAAS,GAAG;EACxB,OAAO,OAAO,CAAA;AACf,CAAC;;ACAD,MAAM,SAAS,GAA8B,EAAE,CAAA;AAC/C,MAAM,YAAY,GAAuC,EAAE,CAAA;AAE3D,MAAM,aAAa,GAAG,CAAC,IAAY,KAAK,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AACjG,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,IAAY;EACxD,IAAI,aAAa,CAAC,IAAI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,CAAA;KACH,EACD,EAAC,UAAU,EAAE,MAAM,EAAC,CACrB,CAAA;IACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC7C;EAED,MAAM;IACJ,IAAI,IAAI,CAAC,KAAK,EAAE;MACd,OAAO,IAAI,CAAA;KACZ;IACD,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IACzC,YAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC3D,EACR;GACF;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/components/gov-icon/gov-icon.scss?tag=gov-icon","../../../packages/core/src/components/gov-icon/gov-icon.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tif (!requestCache[cacheKey]) {\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","/*\n * Icon\n */\n\n$class: \".gov-icon\";\n\n#{$class} {\n\tdisplay: inline-flex;\n\t&__holder {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmax-width: 100%;\n\t\tmax-height: 100%;\n\t}\n}\n","import {Build, Component, Element, h, Host, Prop, State, Watch} from \"@stencil/core\"\nimport {IconClass} from \"./constants\"\nimport {fetchIcon} from \"../../utils/icon.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {iconsLazyLoad} from \"../../helpers/Dom/win\"\n\n@Component({\n assetsDirs: [\"assets\"],\n styleUrl: \"gov-icon.scss\",\n tag: \"gov-icon\",\n})\nexport class GovIcon {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovIconElement\n /**\n * Name of icon\n */\n @Prop() name: string = null\n /**\n * Type (folder) of icon\n */\n @Prop() type: string = \"basic\"\n @State() private iconData: string\n @State() private visible = false\n @State() private error = false\n private intersectionObserver: IntersectionObserver\n\n @Watch(\"name\")\n private async loadIconPathData(): Promise<void> {\n const {name, visible, type} = this\n if (!Build.isBrowser || !name || !visible) {\n return\n }\n try {\n this.iconData = await fetchIcon({name, type})\n } catch (e) {\n this.error = true\n }\n }\n\n connectedCallback(): void {\n if (iconsLazyLoad()) {\n this.visible = true\n this.loadIconPathData().finally()\n } else {\n this.waitUntilVisible(async () => {\n this.visible = true\n await this.loadIconPathData()\n })\n }\n }\n\n disconnectedCallback(): void {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n }\n\n async componentWillLoad(): Promise<void> {\n await this.loadIconPathData()\n }\n\n private waitUntilVisible(callback: () => void): void {\n if (!Build.isBrowser || typeof window === \"undefined\" || !(window as any).IntersectionObserver) {\n callback()\n return\n }\n this.intersectionObserver = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect()\n this.intersectionObserver = null\n }\n callback()\n }\n })\n },\n {rootMargin: \"50px\"},\n )\n this.intersectionObserver.observe(this.host)\n }\n\n render() {\n if (this.error) {\n return null\n }\n return (\n <Host class={this.h.classes(IconClass.root)}>\n <span class={IconClass.holder} innerHTML={this.iconData}></span>\n </Host>\n )\n }\n}\n"],"version":3}