@gov-design-system-ce/components 0.0.52 → 0.0.54

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 (523) hide show
  1. package/dist/cjs/{constants-0883e74c.js → constants-393e915a.js} +2 -2
  2. package/dist/cjs/{constants-0883e74c.js.map → constants-393e915a.js.map} +1 -1
  3. package/dist/cjs/constants-440cd5c8.js +29 -0
  4. package/dist/cjs/constants-440cd5c8.js.map +1 -0
  5. package/dist/cjs/core.cjs.js +1 -1
  6. package/dist/cjs/gov-accordion-item.cjs.entry.js +13 -37
  7. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-accordion.cjs.entry.js +5 -5
  9. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-alert.cjs.entry.js +2 -2
  11. package/dist/cjs/gov-app.cjs.entry.js +205 -367
  12. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  13. package/dist/cjs/gov-attachments_3.cjs.entry.js +2 -2
  14. package/dist/cjs/gov-backdrop.cjs.entry.js +2 -2
  15. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  16. package/dist/cjs/gov-badge.cjs.entry.js +5 -11
  17. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +2 -2
  19. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-button.cjs.entry.js +2 -2
  21. package/dist/cjs/gov-card.cjs.entry.js +2 -2
  22. package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
  23. package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
  24. package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
  25. package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
  27. package/dist/cjs/gov-form-group.cjs.entry.js +7 -1
  28. package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
  29. package/dist/cjs/gov-form-input.cjs.entry.js +16 -14
  30. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-form-multi-select.cjs.entry.js +2 -2
  32. package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
  33. package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
  34. package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
  35. package/dist/cjs/gov-icon.cjs.entry.js +26 -17
  36. package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
  37. package/dist/cjs/gov-modal.cjs.entry.js +2 -2
  38. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  39. package/dist/cjs/gov-nav.cjs.entry.js +2 -2
  40. package/dist/cjs/gov-pagination.cjs.entry.js +2 -2
  41. package/dist/cjs/gov-prompt.cjs.entry.js +2 -2
  42. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  43. package/dist/cjs/gov-side-nav.cjs.entry.js +2 -2
  44. package/dist/cjs/gov-skeleton.cjs.entry.js +2 -2
  45. package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
  46. package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
  47. package/dist/cjs/gov-statsbar.cjs.entry.js +3 -3
  48. package/dist/cjs/gov-statsbar.cjs.entry.js.map +1 -1
  49. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  50. package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
  51. package/dist/cjs/gov-tabs.cjs.entry.js +3 -3
  52. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  53. package/dist/cjs/gov-wizard-item.cjs.entry.js +114 -0
  54. package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -0
  55. package/dist/cjs/{gov-wizzard.cjs.entry.js → gov-wizard.cjs.entry.js} +13 -13
  56. package/dist/cjs/gov-wizard.cjs.entry.js.map +1 -0
  57. package/dist/cjs/index-83edd4fe.js +4 -4
  58. package/dist/cjs/loader.cjs.js +1 -1
  59. package/dist/cjs/{wcag-b0321f09.js → wcag-d7912060.js} +2 -2
  60. package/dist/cjs/{wcag-b0321f09.js.map → wcag-d7912060.js.map} +1 -1
  61. package/dist/cjs/{win-53f637d4.js → win-0427c131.js} +4 -1
  62. package/dist/cjs/win-0427c131.js.map +1 -0
  63. package/dist/collection/collection-manifest.json +2 -2
  64. package/dist/collection/components/gov-accordion/constants.js +1 -1
  65. package/dist/collection/components/gov-accordion/constants.js.map +1 -1
  66. package/dist/collection/components/gov-accordion/gov-accordion-item.css +91 -90
  67. package/dist/collection/components/gov-accordion/gov-accordion-item.js +16 -117
  68. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  69. package/dist/collection/components/gov-accordion/gov-accordion.css +2 -2
  70. package/dist/collection/components/gov-accordion/gov-accordion.js +1 -1
  71. package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
  72. package/dist/collection/components/gov-alert/gov-alert.css +1 -1
  73. package/dist/collection/components/gov-app/gov-app.css +1 -1
  74. package/dist/collection/components/gov-app/gov-app.js +2 -2
  75. package/dist/collection/components/gov-app/gov-app.js.map +1 -1
  76. package/dist/collection/components/gov-attachments/gov-attachments-item.css +1 -1
  77. package/dist/collection/components/gov-attachments/gov-attachments.css +1 -1
  78. package/dist/collection/components/gov-backdrop/gov-backdrop.css +1 -1
  79. package/dist/collection/components/gov-backdrop/gov-backdrop.js +1 -1
  80. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  81. package/dist/collection/components/gov-badge/gov-badge.css +21 -21
  82. package/dist/collection/components/gov-badge/gov-badge.js +8 -40
  83. package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
  84. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +1 -1
  85. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +3 -3
  86. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  87. package/dist/collection/components/gov-button/default/gov-button.css +1 -1
  88. package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +1 -1
  89. package/dist/collection/components/gov-card/gov-card.css +1 -1
  90. package/dist/collection/components/gov-container/gov-container.css +1 -1
  91. package/dist/collection/components/gov-control-group/constants.js +1 -1
  92. package/dist/collection/components/gov-control-group/constants.js.map +1 -1
  93. package/dist/collection/components/gov-control-group/gov-control-group.css +1 -1
  94. package/dist/collection/components/gov-control-group/gov-control-group.js +3 -3
  95. package/dist/collection/components/gov-control-group/gov-control-group.js.map +1 -1
  96. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +1 -1
  97. package/dist/collection/components/gov-empty/gov-empty.css +1 -1
  98. package/dist/collection/components/gov-error-code/gov-error-code.css +1 -1
  99. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +1 -1
  100. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +1 -1
  101. package/dist/collection/components/gov-form/control/gov-form-control.css +5 -5
  102. package/dist/collection/components/gov-form/file/gov-form-file.css +1 -1
  103. package/dist/collection/components/gov-form/group/constants.js +5 -0
  104. package/dist/collection/components/gov-form/group/constants.js.map +1 -1
  105. package/dist/collection/components/gov-form/group/gov-form-group.css +9 -2
  106. package/dist/collection/components/gov-form/group/gov-form-group.js +25 -0
  107. package/dist/collection/components/gov-form/group/gov-form-group.js.map +1 -1
  108. package/dist/collection/components/gov-form/input/gov-form-input.css +1 -1
  109. package/dist/collection/components/gov-form/input/gov-form-input.js +27 -19
  110. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  111. package/dist/collection/components/gov-form/label/gov-form-label.css +1 -1
  112. package/dist/collection/components/gov-form/message/gov-form-message.css +1 -1
  113. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +1 -1
  114. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +1 -1
  115. package/dist/collection/components/gov-form/radio/gov-form-radio.css +1 -1
  116. package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
  117. package/dist/collection/components/gov-form/select/gov-form-select.css +1 -1
  118. package/dist/collection/components/gov-form/switch/gov-form-switch.css +1 -1
  119. package/dist/collection/components/gov-grid/gov-grid-item.css +1 -1
  120. package/dist/collection/components/gov-grid/gov-grid.css +1 -1
  121. package/dist/collection/components/gov-icon/gov-icon.css +1 -1
  122. package/dist/collection/components/gov-icon/gov-icon.js +18 -9
  123. package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
  124. package/dist/collection/components/gov-layout/gov-layout-column.css +1 -1
  125. package/dist/collection/components/gov-layout/gov-layout.css +1 -1
  126. package/dist/collection/components/gov-loading/loading/gov-loading.css +1 -1
  127. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +1 -1
  128. package/dist/collection/components/gov-message/gov-message.css +1 -1
  129. package/dist/collection/components/gov-modal/gov-modal.css +1 -1
  130. package/dist/collection/components/gov-modal/gov-modal.js +8 -2
  131. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  132. package/dist/collection/components/gov-nav/gov-nav-item.css +1 -1
  133. package/dist/collection/components/gov-nav/gov-nav.css +1 -1
  134. package/dist/collection/components/gov-pagination/gov-pagination.css +1 -1
  135. package/dist/collection/components/gov-promp/gov-prompt.css +1 -1
  136. package/dist/collection/components/gov-promp/gov-prompt.js +9 -4
  137. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  138. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +1 -1
  139. package/dist/collection/components/gov-side-nav/gov-side-nav.css +1 -1
  140. package/dist/collection/components/gov-spacer/constants.js +1 -1
  141. package/dist/collection/components/gov-spacer/constants.js.map +1 -1
  142. package/dist/collection/components/gov-spacer/gov-spacer.css +1 -1
  143. package/dist/collection/components/gov-spacer/gov-spacer.js +3 -3
  144. package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
  145. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +1 -1
  146. package/dist/collection/components/gov-statsbar/gov-statsbar.css +1 -1
  147. package/dist/collection/components/gov-statsbar/gov-statsbar.js +5 -5
  148. package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
  149. package/dist/collection/components/gov-stepper/gov-stepper-item.css +23 -23
  150. package/dist/collection/components/gov-stepper/gov-stepper.css +1 -1
  151. package/dist/collection/components/gov-tabs/gov-tabs-item.css +1 -1
  152. package/dist/collection/components/gov-tabs/gov-tabs.css +1 -1
  153. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  154. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  155. package/dist/collection/components/gov-tile/container/gov-tiles.css +1 -1
  156. package/dist/collection/components/gov-tile/gov-tile.css +1 -1
  157. package/dist/collection/components/gov-toast/gov-toast.css +1 -1
  158. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +1 -1
  159. package/dist/collection/components/gov-tooltip/gov-tooltip.css +1 -1
  160. package/dist/collection/components/gov-wizard/constants.js +20 -0
  161. package/dist/collection/components/gov-wizard/constants.js.map +1 -0
  162. package/dist/collection/components/gov-wizard/gov-wizard-item.css +471 -0
  163. package/dist/collection/components/gov-wizard/gov-wizard-item.d.js +2 -0
  164. package/dist/collection/components/gov-wizard/gov-wizard-item.d.js.map +1 -0
  165. package/dist/collection/components/{gov-wizzard/gov-wizzard-item.js → gov-wizard/gov-wizard-item.js} +35 -35
  166. package/dist/collection/components/gov-wizard/gov-wizard-item.js.map +1 -0
  167. package/dist/collection/components/gov-wizard/gov-wizard-item.types.js +2 -0
  168. package/dist/collection/components/gov-wizard/gov-wizard-item.types.js.map +1 -0
  169. package/dist/collection/components/{gov-wizzard/gov-wizzard.css → gov-wizard/gov-wizard.css} +4 -4
  170. package/dist/collection/components/{gov-wizzard/gov-wizzard.js → gov-wizard/gov-wizard.js} +20 -20
  171. package/dist/collection/components/gov-wizard/gov-wizard.js.map +1 -0
  172. package/dist/collection/core/constants/tokens.js +17 -0
  173. package/dist/collection/core/constants/tokens.js.map +1 -0
  174. package/dist/collection/helpers/Dom/win.js +2 -0
  175. package/dist/collection/helpers/Dom/win.js.map +1 -1
  176. package/dist/collection/pages/Accordion.js +158 -326
  177. package/dist/collection/pages/Accordion.js.map +1 -1
  178. package/dist/collection/pages/Badge.js +6 -0
  179. package/dist/collection/pages/Badge.js.map +1 -1
  180. package/dist/collection/pages/{Wizzard.js → Wizard.js} +41 -41
  181. package/dist/collection/pages/Wizard.js.map +1 -0
  182. package/dist/collection/utils/icon.utils.js +8 -7
  183. package/dist/collection/utils/icon.utils.js.map +1 -1
  184. package/dist/components/gov-accordion-item.js +1 -1
  185. package/dist/components/gov-accordion-item.js.map +1 -1
  186. package/dist/components/gov-accordion.js +1 -1
  187. package/dist/components/gov-accordion.js.map +1 -1
  188. package/dist/components/gov-alert.js +1 -1
  189. package/dist/components/gov-alert.js.map +1 -1
  190. package/dist/components/gov-app.js +1 -1
  191. package/dist/components/gov-app.js.map +1 -1
  192. package/dist/components/gov-attachments-item.js +1 -1
  193. package/dist/components/gov-attachments.js +1 -1
  194. package/dist/components/gov-backdrop.js +1 -1
  195. package/dist/components/gov-badge.js +1 -1
  196. package/dist/components/gov-breadcrumbs.js +1 -1
  197. package/dist/components/gov-breadcrumbs.js.map +1 -1
  198. package/dist/components/gov-button.js +1 -1
  199. package/dist/components/gov-card.js +1 -1
  200. package/dist/components/gov-control-group.js.map +1 -1
  201. package/dist/components/gov-form-autocomplete.js +1 -1
  202. package/dist/components/gov-form-checkbox.js +1 -1
  203. package/dist/components/gov-form-control.js +1 -1
  204. package/dist/components/gov-form-control.js.map +1 -1
  205. package/dist/components/gov-form-file.js +1 -1
  206. package/dist/components/gov-form-group.js +1 -1
  207. package/dist/components/gov-form-group.js.map +1 -1
  208. package/dist/components/gov-form-input.js +1 -1
  209. package/dist/components/gov-form-multi-select.js +1 -1
  210. package/dist/components/gov-form-radio.js +1 -1
  211. package/dist/components/gov-form-select.js +1 -1
  212. package/dist/components/gov-form-switch.js +1 -1
  213. package/dist/components/gov-icon.js +1 -1
  214. package/dist/components/gov-loading.js +1 -1
  215. package/dist/components/gov-modal.js +1 -1
  216. package/dist/components/gov-modal.js.map +1 -1
  217. package/dist/components/gov-nav.js +1 -1
  218. package/dist/components/gov-pagination.js +1 -1
  219. package/dist/components/gov-prompt.js +1 -1
  220. package/dist/components/gov-prompt.js.map +1 -1
  221. package/dist/components/gov-side-nav-item.js +1 -1
  222. package/dist/components/gov-side-nav.js +1 -1
  223. package/dist/components/gov-side-nav.js.map +1 -1
  224. package/dist/components/gov-skeleton.js +1 -1
  225. package/dist/components/gov-skeleton.js.map +1 -1
  226. package/dist/components/gov-spacer.js +1 -1
  227. package/dist/components/gov-spacer.js.map +1 -1
  228. package/dist/components/gov-statsbar-item.js +1 -1
  229. package/dist/components/gov-statsbar.js +1 -1
  230. package/dist/components/gov-statsbar.js.map +1 -1
  231. package/dist/components/gov-stepper-item.js +1 -1
  232. package/dist/components/gov-stepper-item.js.map +1 -1
  233. package/dist/components/gov-tabs.js +1 -1
  234. package/dist/components/gov-tabs.js.map +1 -1
  235. package/dist/components/gov-tile.js +1 -1
  236. package/dist/components/gov-toast.js +1 -1
  237. package/dist/components/{gov-wizzard-item.d.ts → gov-wizard-item.d.ts} +4 -4
  238. package/dist/components/gov-wizard-item.js +2 -0
  239. package/dist/components/gov-wizard-item.js.map +1 -0
  240. package/dist/components/{gov-wizzard.d.ts → gov-wizard.d.ts} +4 -4
  241. package/dist/components/gov-wizard.js +2 -0
  242. package/dist/components/gov-wizard.js.map +1 -0
  243. package/dist/components/{p-1020a160.js → p-17ebfe85.js} +2 -2
  244. package/dist/components/p-37a7409e.js +2 -0
  245. package/dist/components/p-37a7409e.js.map +1 -0
  246. package/dist/components/{p-80b2c231.js → p-3a46b683.js} +2 -2
  247. package/dist/components/{p-386409dc.js → p-3e8a9e92.js} +2 -2
  248. package/dist/components/{p-386409dc.js.map → p-3e8a9e92.js.map} +1 -1
  249. package/dist/components/{p-ec26407a.js → p-560846c7.js} +2 -2
  250. package/dist/components/p-6834d779.js +2 -0
  251. package/dist/components/p-6834d779.js.map +1 -0
  252. package/dist/components/{p-ccc44ac1.js → p-8da17139.js} +2 -2
  253. package/dist/components/p-a2e601c5.js +2 -0
  254. package/dist/components/p-a2e601c5.js.map +1 -0
  255. package/dist/components/p-ae894a40.js +2 -0
  256. package/dist/components/{p-cd440c95.js → p-b9388dc1.js} +2 -2
  257. package/dist/components/p-b9388dc1.js.map +1 -0
  258. package/dist/components/p-c055eb68.js +2 -0
  259. package/dist/components/p-c055eb68.js.map +1 -0
  260. package/dist/components/p-cac3881f.js +2 -0
  261. package/dist/components/p-cac3881f.js.map +1 -0
  262. package/dist/components/{p-1026d931.js → p-d6ab5b8a.js} +2 -2
  263. package/dist/components/{p-d305407a.js → p-e9a01d67.js} +2 -2
  264. package/dist/core/core.esm.js +1 -1
  265. package/dist/core/core.esm.js.map +1 -1
  266. package/dist/core/p-06699657.entry.js +2 -0
  267. package/dist/core/p-06699657.entry.js.map +1 -0
  268. package/dist/core/{p-f969eec7.entry.js → p-0c1697ce.entry.js} +2 -2
  269. package/dist/core/p-0c1697ce.entry.js.map +1 -0
  270. package/dist/core/{p-a857915f.entry.js → p-0c769f1a.entry.js} +2 -2
  271. package/dist/core/{p-1020a160.js → p-17ebfe85.js} +2 -2
  272. package/dist/core/{p-9a3e3ace.entry.js → p-18ef9623.entry.js} +2 -2
  273. package/dist/core/{p-9a3e3ace.entry.js.map → p-18ef9623.entry.js.map} +1 -1
  274. package/dist/core/{p-eda868dc.entry.js → p-22a86871.entry.js} +2 -2
  275. package/dist/core/p-22a86871.entry.js.map +1 -0
  276. package/dist/core/{p-722218fd.entry.js → p-23385300.entry.js} +2 -2
  277. package/dist/core/p-23385300.entry.js.map +1 -0
  278. package/dist/core/{p-48349167.entry.js → p-33bf5974.entry.js} +2 -2
  279. package/dist/core/p-37a7409e.js +2 -0
  280. package/dist/core/p-37a7409e.js.map +1 -0
  281. package/dist/core/p-3b236ac2.entry.js +2 -0
  282. package/dist/core/p-3b236ac2.entry.js.map +1 -0
  283. package/dist/core/{p-3dbf7f49.js → p-3bacd021.js} +2 -2
  284. package/dist/core/{p-9f541022.entry.js → p-3d0ab343.entry.js} +2 -2
  285. package/dist/core/{p-e0c04c5f.entry.js → p-41e88980.entry.js} +2 -2
  286. package/dist/core/{p-e0c04c5f.entry.js.map → p-41e88980.entry.js.map} +1 -1
  287. package/dist/core/{p-5a855a15.entry.js → p-42c1935f.entry.js} +2 -2
  288. package/dist/core/p-44af4bc9.entry.js +2 -0
  289. package/dist/core/p-44af4bc9.entry.js.map +1 -0
  290. package/dist/core/{p-de3dc437.entry.js → p-48cfc1c6.entry.js} +2 -2
  291. package/dist/core/p-64f7e661.entry.js +2 -0
  292. package/dist/core/p-64f7e661.entry.js.map +1 -0
  293. package/dist/core/p-6834d779.js +2 -0
  294. package/dist/core/p-6834d779.js.map +1 -0
  295. package/dist/core/{p-9ad54c30.entry.js → p-70140f70.entry.js} +2 -2
  296. package/dist/core/{p-a68547b1.entry.js → p-81643870.entry.js} +2 -2
  297. package/dist/core/{p-11be550d.entry.js → p-82f64673.entry.js} +2 -2
  298. package/dist/core/p-82f64673.entry.js.map +1 -0
  299. package/dist/core/{p-6dacb8d3.entry.js → p-88010439.entry.js} +2 -2
  300. package/dist/core/p-88010439.entry.js.map +1 -0
  301. package/dist/core/p-89921159.entry.js.map +1 -1
  302. package/dist/core/{p-fa71fb92.entry.js → p-9d72d80b.entry.js} +2 -2
  303. package/dist/core/{p-1ae47d62.entry.js → p-a5d00433.entry.js} +2 -2
  304. package/dist/core/p-ab426e50.entry.js +2 -0
  305. package/dist/core/p-ab426e50.entry.js.map +1 -0
  306. package/dist/core/p-accf8575.entry.js +2 -0
  307. package/dist/core/p-accf8575.entry.js.map +1 -0
  308. package/dist/core/p-ae894a40.js +2 -0
  309. package/dist/core/p-b9b57928.entry.js +2 -0
  310. package/dist/core/p-b9b57928.entry.js.map +1 -0
  311. package/dist/core/p-bd1cb5bd.entry.js +2 -0
  312. package/dist/core/p-bd1cb5bd.entry.js.map +1 -0
  313. package/dist/core/{p-02c3a3fd.entry.js → p-bfb4d904.entry.js} +2 -2
  314. package/dist/core/{p-1e3cad4b.entry.js → p-c81d62db.entry.js} +2 -2
  315. package/dist/core/p-cac3881f.js +2 -0
  316. package/dist/core/p-cac3881f.js.map +1 -0
  317. package/dist/core/p-d1b7d8a6.entry.js +2 -0
  318. package/dist/core/p-d1b7d8a6.entry.js.map +1 -0
  319. package/dist/core/{p-3d720d54.entry.js → p-dbb46457.entry.js} +2 -2
  320. package/dist/core/{p-b5a560d2.entry.js → p-dfc080f2.entry.js} +2 -2
  321. package/dist/core/{p-2790d89e.entry.js → p-e1780dba.entry.js} +2 -2
  322. package/dist/core/p-e1780dba.entry.js.map +1 -0
  323. package/dist/core/{p-e1b3c361.entry.js → p-e769f3ee.entry.js} +2 -2
  324. package/dist/core/p-ea4459ae.entry.js +2 -0
  325. package/dist/core/p-ea4459ae.entry.js.map +1 -0
  326. package/dist/core/{p-d921bd4b.entry.js → p-f0a5847a.entry.js} +2 -2
  327. package/dist/core/{p-5150efee.entry.js → p-fc853777.entry.js} +2 -2
  328. package/dist/esm/constants-2499979c.js +24 -0
  329. package/dist/esm/constants-2499979c.js.map +1 -0
  330. package/dist/esm/{constants-037c35bc.js → constants-27b48cd1.js} +2 -2
  331. package/dist/esm/{constants-037c35bc.js.map → constants-27b48cd1.js.map} +1 -1
  332. package/dist/esm/{constants-ab132d9c.js → constants-858966b9.js} +2 -2
  333. package/dist/esm/{constants-ab132d9c.js.map → constants-858966b9.js.map} +1 -1
  334. package/dist/esm/{constants-5708696f.js → constants-ba92640d.js} +2 -2
  335. package/dist/esm/{constants-5708696f.js.map → constants-ba92640d.js.map} +1 -1
  336. package/dist/esm/core.js +1 -1
  337. package/dist/esm/gov-accordion-item.entry.js +13 -37
  338. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  339. package/dist/esm/gov-accordion.entry.js +5 -5
  340. package/dist/esm/gov-accordion.entry.js.map +1 -1
  341. package/dist/esm/gov-alert.entry.js +2 -2
  342. package/dist/esm/gov-app.entry.js +205 -367
  343. package/dist/esm/gov-app.entry.js.map +1 -1
  344. package/dist/esm/gov-attachments_3.entry.js +2 -2
  345. package/dist/esm/gov-backdrop.entry.js +2 -2
  346. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  347. package/dist/esm/gov-badge.entry.js +6 -12
  348. package/dist/esm/gov-badge.entry.js.map +1 -1
  349. package/dist/esm/gov-breadcrumbs.entry.js +2 -2
  350. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  351. package/dist/esm/gov-button.entry.js +3 -3
  352. package/dist/esm/gov-card.entry.js +2 -2
  353. package/dist/esm/gov-control-group.entry.js.map +1 -1
  354. package/dist/esm/gov-dropdown.entry.js +1 -1
  355. package/dist/esm/gov-form-checkbox.entry.js +2 -2
  356. package/dist/esm/gov-form-control.entry.js +1 -1
  357. package/dist/esm/gov-form-control.entry.js.map +1 -1
  358. package/dist/esm/gov-form-file.entry.js +2 -2
  359. package/dist/esm/gov-form-group.entry.js +7 -1
  360. package/dist/esm/gov-form-group.entry.js.map +1 -1
  361. package/dist/esm/gov-form-input.entry.js +16 -14
  362. package/dist/esm/gov-form-input.entry.js.map +1 -1
  363. package/dist/esm/gov-form-multi-select.entry.js +2 -2
  364. package/dist/esm/gov-form-radio.entry.js +2 -2
  365. package/dist/esm/gov-form-select.entry.js +2 -2
  366. package/dist/esm/gov-form-switch.entry.js +2 -2
  367. package/dist/esm/gov-icon.entry.js +26 -17
  368. package/dist/esm/gov-icon.entry.js.map +1 -1
  369. package/dist/esm/gov-modal.entry.js +2 -2
  370. package/dist/esm/gov-modal.entry.js.map +1 -1
  371. package/dist/esm/gov-nav.entry.js +2 -2
  372. package/dist/esm/gov-pagination.entry.js +2 -2
  373. package/dist/esm/gov-prompt.entry.js +2 -2
  374. package/dist/esm/gov-prompt.entry.js.map +1 -1
  375. package/dist/esm/gov-side-nav.entry.js +2 -2
  376. package/dist/esm/gov-skeleton.entry.js +2 -2
  377. package/dist/esm/gov-spacer.entry.js +2 -2
  378. package/dist/esm/gov-spacer.entry.js.map +1 -1
  379. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  380. package/dist/esm/gov-statsbar.entry.js +4 -4
  381. package/dist/esm/gov-statsbar.entry.js.map +1 -1
  382. package/dist/esm/gov-stepper-item.entry.js +1 -1
  383. package/dist/esm/gov-stepper-item.entry.js.map +1 -1
  384. package/dist/esm/gov-tabs.entry.js +3 -3
  385. package/dist/esm/gov-tabs.entry.js.map +1 -1
  386. package/dist/esm/gov-wizard-item.entry.js +110 -0
  387. package/dist/esm/gov-wizard-item.entry.js.map +1 -0
  388. package/dist/esm/{gov-wizzard.entry.js → gov-wizard.entry.js} +13 -13
  389. package/dist/esm/gov-wizard.entry.js.map +1 -0
  390. package/dist/esm/index-ae3c50f1.js +4 -4
  391. package/dist/esm/loader.js +1 -1
  392. package/dist/esm/{wcag-afdfdddb.js → wcag-062e7ca9.js} +2 -2
  393. package/dist/esm/{wcag-afdfdddb.js.map → wcag-062e7ca9.js.map} +1 -1
  394. package/dist/esm/{win-7a1a8ac8.js → win-0a50f66e.js} +4 -2
  395. package/dist/esm/win-0a50f66e.js.map +1 -0
  396. package/dist/hydrate/index.js +311 -491
  397. package/dist/stencil.config.js +4 -5
  398. package/dist/stencil.config.js.map +1 -1
  399. package/dist/types/components/gov-accordion/constants.d.ts +1 -1
  400. package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -19
  401. package/dist/types/components/gov-app/gov-app.d.ts +1 -1
  402. package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +1 -1
  403. package/dist/types/components/gov-badge/gov-badge.d.ts +3 -8
  404. package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +2 -2
  405. package/dist/types/components/gov-control-group/constants.d.ts +2 -2
  406. package/dist/types/components/gov-control-group/gov-control-group.d.ts +2 -2
  407. package/dist/types/components/gov-form/group/constants.d.ts +5 -0
  408. package/dist/types/components/gov-form/group/gov-form-group.d.ts +5 -1
  409. package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -4
  410. package/dist/types/components/gov-icon/gov-icon.d.ts +1 -1
  411. package/dist/types/components/gov-modal/gov-modal.d.ts +2 -1
  412. package/dist/types/components/gov-promp/gov-prompt.d.ts +2 -1
  413. package/dist/types/components/gov-spacer/constants.d.ts +1 -1
  414. package/dist/types/components/gov-statsbar/gov-statsbar.d.ts +1 -1
  415. package/dist/types/components/{gov-wizzard → gov-wizard}/constants.d.ts +2 -2
  416. package/dist/types/components/gov-wizard/gov-wizard-item.d.d.ts +4 -0
  417. package/dist/types/components/{gov-wizzard/gov-wizzard-item.d.ts → gov-wizard/gov-wizard-item.d.ts} +13 -13
  418. package/dist/types/components/{gov-wizzard/gov-wizzard-item.types.d.ts → gov-wizard/gov-wizard-item.types.d.ts} +1 -1
  419. package/dist/types/components/{gov-wizzard/gov-wizzard.d.ts → gov-wizard/gov-wizard.d.ts} +7 -7
  420. package/dist/types/components.d.ts +81 -113
  421. package/dist/types/core/constants/tokens.d.ts +1 -0
  422. package/dist/types/helpers/Dom/win.d.ts +2 -0
  423. package/dist/types/pages/Wizard.d.ts +3 -0
  424. package/package.json +2 -2
  425. package/dist/cjs/constants-21559414.js +0 -29
  426. package/dist/cjs/constants-21559414.js.map +0 -1
  427. package/dist/cjs/gov-wizzard-item.cjs.entry.js +0 -114
  428. package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +0 -1
  429. package/dist/cjs/gov-wizzard.cjs.entry.js.map +0 -1
  430. package/dist/cjs/win-53f637d4.js.map +0 -1
  431. package/dist/collection/components/gov-wizzard/constants.js +0 -20
  432. package/dist/collection/components/gov-wizzard/constants.js.map +0 -1
  433. package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +0 -471
  434. package/dist/collection/components/gov-wizzard/gov-wizzard-item.d.js +0 -2
  435. package/dist/collection/components/gov-wizzard/gov-wizzard-item.d.js.map +0 -1
  436. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +0 -1
  437. package/dist/collection/components/gov-wizzard/gov-wizzard-item.types.js +0 -2
  438. package/dist/collection/components/gov-wizzard/gov-wizzard-item.types.js.map +0 -1
  439. package/dist/collection/components/gov-wizzard/gov-wizzard.js.map +0 -1
  440. package/dist/collection/pages/Wizzard.js.map +0 -1
  441. package/dist/components/gov-wizzard-item.js +0 -2
  442. package/dist/components/gov-wizzard-item.js.map +0 -1
  443. package/dist/components/gov-wizzard.js +0 -2
  444. package/dist/components/gov-wizzard.js.map +0 -1
  445. package/dist/components/p-0f5e2b0a.js +0 -2
  446. package/dist/components/p-34152b51.js +0 -2
  447. package/dist/components/p-34152b51.js.map +0 -1
  448. package/dist/components/p-5bf5a42e.js +0 -2
  449. package/dist/components/p-5bf5a42e.js.map +0 -1
  450. package/dist/components/p-64ced668.js +0 -2
  451. package/dist/components/p-64ced668.js.map +0 -1
  452. package/dist/components/p-9da782bf.js +0 -2
  453. package/dist/components/p-9da782bf.js.map +0 -1
  454. package/dist/components/p-a5d69694.js +0 -2
  455. package/dist/components/p-a5d69694.js.map +0 -1
  456. package/dist/components/p-cd440c95.js.map +0 -1
  457. package/dist/core/p-0eadfb3e.entry.js +0 -2
  458. package/dist/core/p-0eadfb3e.entry.js.map +0 -1
  459. package/dist/core/p-0f5e2b0a.js +0 -2
  460. package/dist/core/p-11be550d.entry.js.map +0 -1
  461. package/dist/core/p-2790d89e.entry.js.map +0 -1
  462. package/dist/core/p-34152b51.js +0 -2
  463. package/dist/core/p-34152b51.js.map +0 -1
  464. package/dist/core/p-42cd2cc4.entry.js +0 -2
  465. package/dist/core/p-42cd2cc4.entry.js.map +0 -1
  466. package/dist/core/p-64ced668.js +0 -2
  467. package/dist/core/p-64ced668.js.map +0 -1
  468. package/dist/core/p-6dacb8d3.entry.js.map +0 -1
  469. package/dist/core/p-722218fd.entry.js.map +0 -1
  470. package/dist/core/p-7ab82a55.entry.js +0 -2
  471. package/dist/core/p-7ab82a55.entry.js.map +0 -1
  472. package/dist/core/p-9751af2e.entry.js +0 -2
  473. package/dist/core/p-9751af2e.entry.js.map +0 -1
  474. package/dist/core/p-9e208f40.entry.js +0 -2
  475. package/dist/core/p-9e208f40.entry.js.map +0 -1
  476. package/dist/core/p-a5d69694.js +0 -2
  477. package/dist/core/p-a5d69694.js.map +0 -1
  478. package/dist/core/p-abfa0beb.entry.js +0 -2
  479. package/dist/core/p-abfa0beb.entry.js.map +0 -1
  480. package/dist/core/p-ac94d242.entry.js +0 -2
  481. package/dist/core/p-ac94d242.entry.js.map +0 -1
  482. package/dist/core/p-d2729599.entry.js +0 -2
  483. package/dist/core/p-d2729599.entry.js.map +0 -1
  484. package/dist/core/p-e86db39c.entry.js +0 -2
  485. package/dist/core/p-e86db39c.entry.js.map +0 -1
  486. package/dist/core/p-eda868dc.entry.js.map +0 -1
  487. package/dist/core/p-f95bca5f.entry.js +0 -2
  488. package/dist/core/p-f95bca5f.entry.js.map +0 -1
  489. package/dist/core/p-f969eec7.entry.js.map +0 -1
  490. package/dist/esm/constants-bf5a583f.js +0 -24
  491. package/dist/esm/constants-bf5a583f.js.map +0 -1
  492. package/dist/esm/gov-wizzard-item.entry.js +0 -110
  493. package/dist/esm/gov-wizzard-item.entry.js.map +0 -1
  494. package/dist/esm/gov-wizzard.entry.js.map +0 -1
  495. package/dist/esm/win-7a1a8ac8.js.map +0 -1
  496. package/dist/types/components/gov-wizzard/gov-wizzard-item.d.d.ts +0 -4
  497. package/dist/types/pages/Wizzard.d.ts +0 -3
  498. /package/dist/components/{p-1020a160.js.map → p-17ebfe85.js.map} +0 -0
  499. /package/dist/components/{p-80b2c231.js.map → p-3a46b683.js.map} +0 -0
  500. /package/dist/components/{p-ec26407a.js.map → p-560846c7.js.map} +0 -0
  501. /package/dist/components/{p-ccc44ac1.js.map → p-8da17139.js.map} +0 -0
  502. /package/dist/components/{p-0f5e2b0a.js.map → p-ae894a40.js.map} +0 -0
  503. /package/dist/components/{p-1026d931.js.map → p-d6ab5b8a.js.map} +0 -0
  504. /package/dist/components/{p-d305407a.js.map → p-e9a01d67.js.map} +0 -0
  505. /package/dist/core/{p-a857915f.entry.js.map → p-0c769f1a.entry.js.map} +0 -0
  506. /package/dist/core/{p-1020a160.js.map → p-17ebfe85.js.map} +0 -0
  507. /package/dist/core/{p-48349167.entry.js.map → p-33bf5974.entry.js.map} +0 -0
  508. /package/dist/core/{p-3dbf7f49.js.map → p-3bacd021.js.map} +0 -0
  509. /package/dist/core/{p-9f541022.entry.js.map → p-3d0ab343.entry.js.map} +0 -0
  510. /package/dist/core/{p-5a855a15.entry.js.map → p-42c1935f.entry.js.map} +0 -0
  511. /package/dist/core/{p-de3dc437.entry.js.map → p-48cfc1c6.entry.js.map} +0 -0
  512. /package/dist/core/{p-9ad54c30.entry.js.map → p-70140f70.entry.js.map} +0 -0
  513. /package/dist/core/{p-a68547b1.entry.js.map → p-81643870.entry.js.map} +0 -0
  514. /package/dist/core/{p-fa71fb92.entry.js.map → p-9d72d80b.entry.js.map} +0 -0
  515. /package/dist/core/{p-1ae47d62.entry.js.map → p-a5d00433.entry.js.map} +0 -0
  516. /package/dist/core/{p-0f5e2b0a.js.map → p-ae894a40.js.map} +0 -0
  517. /package/dist/core/{p-02c3a3fd.entry.js.map → p-bfb4d904.entry.js.map} +0 -0
  518. /package/dist/core/{p-1e3cad4b.entry.js.map → p-c81d62db.entry.js.map} +0 -0
  519. /package/dist/core/{p-3d720d54.entry.js.map → p-dbb46457.entry.js.map} +0 -0
  520. /package/dist/core/{p-b5a560d2.entry.js.map → p-dfc080f2.entry.js.map} +0 -0
  521. /package/dist/core/{p-e1b3c361.entry.js.map → p-e769f3ee.entry.js.map} +0 -0
  522. /package/dist/core/{p-d921bd4b.entry.js.map → p-f0a5847a.entry.js.map} +0 -0
  523. /package/dist/core/{p-5150efee.entry.js.map → p-fc853777.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"gov-control-group.entry.cjs.js","mappings":";;;;;;;;;;;AAI6BA,UAAI,CAACC,iBAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAG9D,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB;;ACTD,MAAM,kBAAkB,GAAG,stCAAstC;;MCWpuC,eAAe;EAG3B;;mBAQ6CA,iBAAQ,CAAC,OAAO;oBAIE,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/BC,kBAAY,CAACF,iBAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACxD;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,WAAW,GAAG,SAAS,CAAA;IACjE,QACCG,QAACC,UAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO,IACrBD,qBAAQ,CACF,EACP;GACD;;;;;;;;;;","names":["pick","Variants","govHost","validateProp","h","Host"],"sources":["../../../packages/core/src/components/gov-control-group/constants.ts","../../../packages/core/src/components/gov-control-group/gov-control-group.scss?tag=gov-control-group","../../../packages/core/src/components/gov-control-group/gov-control-group.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroups = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupType = `${ValueOf<typeof ControlGroups>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n","/*\n * Control group\n */\n\n$class: \".gov-control-group\";\n\n#{$class} {\n\t@include base(flex);\n\talign-items: center;\n\tborder-radius: $control-group-border-radius;\n\t.element *,\n\t.gov-button .element {\n\t\tborder: none !important;\n\t\tborder-radius: 0;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $control-group-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t\t> * {\n\t\t\t\tborder-right: get(\"border\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\n\t> * {\n\t\t&:last-child {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n\t&.no-border {\n\t\t> * {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n}\n\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-control-group.entry.cjs.js","mappings":";;;;;;;;;;;AAIoCA,UAAI,CAACC,iBAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAGrE,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB;;ACTD,MAAM,kBAAkB,GAAG,stCAAstC;;MCWpuC,eAAe;EAG3B;;mBAQoDA,iBAAQ,CAAC,OAAO;oBAIL,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/BC,kBAAY,CAACF,iBAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACxD;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,WAAW,GAAG,SAAS,CAAA;IACjE,QACCG,QAACC,UAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO,IACrBD,qBAAQ,CACF,EACP;GACD;;;;;;;;;;","names":["pick","Variants","govHost","validateProp","h","Host"],"sources":["../../../packages/core/src/components/gov-control-group/constants.ts","../../../packages/core/src/components/gov-control-group/gov-control-group.scss?tag=gov-control-group","../../../packages/core/src/components/gov-control-group/gov-control-group.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroupVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupVariantType = `${ValueOf<typeof ControlGroupVariants>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n","/*\n * Control group\n */\n\n$class: \".gov-control-group\";\n\n#{$class} {\n\t@include base(flex);\n\talign-items: center;\n\tborder-radius: $control-group-border-radius;\n\t.element *,\n\t.gov-button .element {\n\t\tborder: none !important;\n\t\tborder-radius: 0;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $control-group-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t\t> * {\n\t\t\t\tborder-right: get(\"border\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\n\t> * {\n\t\t&:last-child {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n\t&.no-border {\n\t\t> * {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n}\n\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupVariantType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupVariantType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -7,8 +7,8 @@ const string_utils = require('./string.utils-0f08c48c.js');
7
7
  const props = require('./props-5f82e4c0.js');
8
8
  const form = require('./form-f68d13c6.js');
9
9
  const template = require('./template-e1c4ff78.js');
10
- const wcag = require('./wcag-b0321f09.js');
11
- const win = require('./win-53f637d4.js');
10
+ const wcag = require('./wcag-d7912060.js');
11
+ const win = require('./win-0427c131.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  const Fragment = require('./Fragment-52846f79.js');
14
14
  require('./gov.log-0c9dca27.js');
@@ -13,7 +13,7 @@ require('./constants-caad94b4.js');
13
13
  require('./constants-6df82618.js');
14
14
  require('./constants-97eea364.js');
15
15
 
16
- const govFormControlCss = ".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-control__holder{display:flex;flex-direction:column;padding:0;border:none}.gov-form-control__bottom>*:last-child{margin-bottom:0}.gov-form-control .gov-form-label .gov-form-label__label{margin:0rem 0rem 0.25rem}.gov-form-control .gov-form-control__bottom{margin:0.25rem 0rem 0rem}.gov-form-control[type=file] .gov-form-label[slot=top] .gov-form-label__label{margin:0rem 0rem 0.5rem}.gov-form-control[type=file] .gov-form-control__bottom{margin:0.5rem 0rem 0rem}.gov-form-control[size=xs][type=checkbox] .gov-form-control__bottom,.gov-form-control[size=xs][type=radio] .gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}.gov-form-control[size=s][type=checkbox] .gov-form-control__bottom,.gov-form-control[size=s][type=radio] .gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}.gov-form-control[size=m][type=checkbox] .gov-form-control__bottom,.gov-form-control[size=m][type=radio] .gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}.gov-form-control[size=l][type=checkbox] .gov-form-control__bottom,.gov-form-control[size=l][type=radio] .gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}.gov-form-control[size=xs][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667 + var(--gov-form-switch-xs-gap, 0.75rem))}.gov-form-control[size=s][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667 + var(--gov-form-switch-s-gap, 0.75rem))}.gov-form-control[size=m][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667 + var(--gov-form-switch-m-gap, 1rem))}.gov-form-control[size=l][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667 + var(--gov-form-switch-l-gap, 1rem))}.gov-form-control[invalid=\"\"] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=true i] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=\"1\"] .gov-form-label[slot=top] .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-control[disabled=\"\"] .gov-form-label__label,.gov-form-control[disabled=true i] .gov-form-label__label,.gov-form-control[disabled=\"1\"] .gov-form-label__label{pointer-events:none}";
16
+ const govFormControlCss = ".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-control__holder{display:flex;flex-direction:column;padding:0;border:none}.gov-form-control__bottom>*:last-child{margin-bottom:0}.gov-form-control .gov-form-label .gov-form-label__label{margin:0rem 0rem 0.25rem}.gov-form-control .gov-form-control__bottom{margin:0.25rem 0rem 0rem}.gov-form-control[type=file] .gov-form-label[slot=top] .gov-form-label__label{margin:0rem 0rem 0.5rem}.gov-form-control[type=file] .gov-form-control__bottom{margin:0.5rem 0rem 0rem}.gov-form-control[size=xs][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom,.gov-form-control[size=xs][type=radio] .gov-form-control__holder>.gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}.gov-form-control[size=s][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom,.gov-form-control[size=s][type=radio] .gov-form-control__holder>.gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}.gov-form-control[size=m][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom,.gov-form-control[size=m][type=radio] .gov-form-control__holder>.gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}.gov-form-control[size=l][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom,.gov-form-control[size=l][type=radio] .gov-form-control__holder>.gov-form-control__bottom{margin-top:var(--gov-form-checkbox-core-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}.gov-form-control[size=xs][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667 + var(--gov-form-switch-xs-gap, 0.75rem))}.gov-form-control[size=s][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667 + var(--gov-form-switch-s-gap, 0.75rem))}.gov-form-control[size=m][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667 + var(--gov-form-switch-m-gap, 1rem))}.gov-form-control[size=l][type=switch] .gov-form-control__bottom{margin-top:var(--gov-form-switch-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667 + var(--gov-form-switch-l-gap, 1rem))}.gov-form-control[invalid=\"\"] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=true i] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=\"1\"] .gov-form-label[slot=top] .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-control[disabled=\"\"] .gov-form-label__label,.gov-form-control[disabled=true i] .gov-form-label__label,.gov-form-control[disabled=\"1\"] .gov-form-label__label{pointer-events:none}";
17
17
 
18
18
  const GovFormControl = class {
19
19
  constructor(hostRef) {
@@ -1 +1 @@
1
- {"file":"gov-form-control.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,89GAA89G;;MCY3+G,cAAc;EAM1B;;;;mBAkBoC,KAAK;oBAKJ,KAAK;mBAKN,KAAK;oB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,IAAI,EAAC,QAAQ,GAAG,CACjB,CACN,CACI,CACA,EACP;GACD;;;;;;;","names":["govHost","govForm","createID","FormControlClass","splitByWhitespace","h","Host"],"sources":["../../../packages/core/src/components/gov-form/control/gov-form-control.scss?tag=gov-form-control","../../../packages/core/src/components/gov-form/control/gov-form-control.tsx"],"sourcesContent":["/*\n * Form Control\n */\n\n$class: \".gov-form-control\";\n\n#{$class} {\n\t&__holder {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 0;\n\t\tborder: none;\n\t}\n\t&__bottom {\n\t\t@include reset-last-margin();\n\t}\n\n\t// VARIANTS\n\t.gov-form-label .gov-form-label__label {\n\t\tmargin: rem-calc(0 0 4);\n\t}\n\t#{$class} {\n\t\t&__bottom {\n\t\t\tmargin: rem-calc(4 0 0);\n\t\t}\n\t}\n\t&[type=\"file\"] {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tmargin: rem-calc(0 0 8);\n\t\t}\n\t\t#{$class} {\n\t\t\t&__bottom {\n\t\t\t\tmargin: rem-calc(8 0 0);\n\t\t\t}\n\t\t}\n\t}\n\t// Checkbox, radio\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"][type=\"checkbox\"],\n\t\t&[size=\"#{$size}\"][type=\"radio\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-width: get(\"indicator-size\", $definitions);\n\t\t\t\t&__bottom {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Switch\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t&[size=\"#{$size}\"][type=\"switch\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-ratio: calc(5 / 3);\n\t\t\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t\t\t&__bottom {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\t.gov-form-label__label {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { createID, splitByWhitespace } from \"../../../utils/string.utils\"\nimport { FormControlClass, FormControlSizesType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-form-control\",\n\tstyleUrl: \"gov-form-control.scss\",\n})\nexport class GovFormControl {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate readonly controlId: string\n\tprivate observer: MutationObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.controlId = createID(\"GovFormControl\")\n\t}\n\n\t@Element() host: HTMLGovFormControlElement\n\t/**\n\t * Defines the space between nested components.\n\t */\n\t@Prop() readonly gap?: FormControlSizesType\n\t/**\n\t * Form element identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean = false\n\t/**\n\t/**\n\t * Indicates the form element is disabled\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\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 = false\n\t/**\n\t * Use control as a fieldset for better accessibility.\n\t * Note: Don't forget to set the legend attribute of the gov-form-label component\n\t */\n\t@Prop() readonly fieldset: boolean = false\n\t/**\n\t * Form element size.\n\t */\n\t@Prop() readonly size?: FormControlSizesType = \"m\"\n\n\tcomponentDidRender() {\n\t\tthis.passChildAttrs()\n\t\tthis.invalidChildAttrs()\n\t\tthis.disabledChildAttrs()\n\t\tthis.syncControlMessages()\n\t\tthis.formElementDescriptionControl()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate passChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"success\", this.success)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate invalidChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"invalid\", this.invalid)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate disabledChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"disabled\", this.disabled)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate formElementDescriptionControl() {\n\t\tconst bottomSlot = this.host.querySelector(\".\" + FormControlClass.bottom)\n\t\tif (!bottomSlot) return\n\t\tthis.observer = new MutationObserver(\n\t\t\tfunction() {\n\t\t\t\tthis.syncControlMessages()\n\t\t\t}.bind(this),\n\t\t)\n\n\t\tthis.observer.observe(bottomSlot, { childList: true })\n\t}\n\n\tprivate syncControlMessages() {\n\t\tPromise.all(this.f.messageElements.map((message: HTMLGovFormMessageElement) => message.identifier())).then((ids: string[]) => {\n\t\t\tthis.f.mainElementsInControl.forEach((element: Element) => {\n\t\t\t\tconst currentValue = splitByWhitespace(element.getAttribute(\"wcag-described-by\"))\n\t\t\t\telement.removeAttribute(\"wcag-described-by\")\n\t\t\t\tif (Array.isArray(currentValue)) {\n\t\t\t\t\tcurrentValue.forEach(id => (id.indexOf(\"GovFormMessage\") === -1 ? ids.push(id) : null))\n\t\t\t\t}\n\t\t\t\tif (ids.length) {\n\t\t\t\t\telement.setAttribute(\"wcag-described-by\", ids.join(\" \"))\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\tconst Tag = this.fieldset ? \"fieldset\" : \"div\"\n\t\treturn (\n\t\t\t<Host size={this.size} class={this.h.classes(FormControlClass.root)}>\n\t\t\t\t<Tag class={FormControlClass.holder}>\n\t\t\t\t\t{this.h.hasSlot(\"top\") && <slot name=\"top\"></slot>}\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.h.hasSlot(\"bottom\") && (\n\t\t\t\t\t\t<div class={FormControlClass.bottom}>\n\t\t\t\t\t\t\t<slot name=\"bottom\" />\n\t\t\t\t\t\t</div>\n\t\t\t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,MAAM,IACjC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAIE,kBAAM,IAAI,EAAC,KAAK,GAAQ,EAClDA,qBAAa,EACZ,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACxBA,iBAAK,KAAK,EAAEF,qBAAgB,CAAC,MAAM,IAClCE,kBAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACN,CACI,CACA,EACP;GACD;;;;;;;","names":["govHost","govForm","createID","FormControlClass","splitByWhitespace","h","Host"],"sources":["../../../packages/core/src/components/gov-form/control/gov-form-control.scss?tag=gov-form-control","../../../packages/core/src/components/gov-form/control/gov-form-control.tsx"],"sourcesContent":["/*\n * Form Control\n */\n\n$class: \".gov-form-control\";\n\n#{$class} {\n\t&__holder {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 0;\n\t\tborder: none;\n\t}\n\t&__bottom {\n\t\t@include reset-last-margin();\n\t}\n\n\t// VARIANTS\n\t.gov-form-label .gov-form-label__label {\n\t\tmargin: rem-calc(0 0 4);\n\t}\n\t#{$class} {\n\t\t&__bottom {\n\t\t\tmargin: rem-calc(4 0 0);\n\t\t}\n\t}\n\t&[type=\"file\"] {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tmargin: rem-calc(0 0 8);\n\t\t}\n\t\t#{$class} {\n\t\t\t&__bottom {\n\t\t\t\tmargin: rem-calc(8 0 0);\n\t\t\t}\n\t\t}\n\t}\n\t// Checkbox, radio\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"][type=\"checkbox\"],\n\t\t&[size=\"#{$size}\"][type=\"radio\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-width: get(\"indicator-size\", $definitions);\n\t\t\t\t&__holder > #{$class}__bottom {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Switch\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t&[size=\"#{$size}\"][type=\"switch\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-ratio: calc(5 / 3);\n\t\t\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t\t\t&__bottom {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\t.gov-form-label__label {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { createID, splitByWhitespace } from \"../../../utils/string.utils\"\nimport { FormControlClass, FormControlSizesType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-form-control\",\n\tstyleUrl: \"gov-form-control.scss\",\n})\nexport class GovFormControl {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate readonly controlId: string\n\tprivate observer: MutationObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.controlId = createID(\"GovFormControl\")\n\t}\n\n\t@Element() host: HTMLGovFormControlElement\n\t/**\n\t * Defines the space between nested components.\n\t */\n\t@Prop() readonly gap?: FormControlSizesType\n\t/**\n\t * Form element identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean = false\n\t/**\n\t/**\n\t * Indicates the form element is disabled\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\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 = false\n\t/**\n\t * Use control as a fieldset for better accessibility.\n\t * Note: Don't forget to set the legend attribute of the gov-form-label component\n\t */\n\t@Prop() readonly fieldset: boolean = false\n\t/**\n\t * Form element size.\n\t */\n\t@Prop() readonly size?: FormControlSizesType = \"m\"\n\n\tcomponentDidRender() {\n\t\tthis.passChildAttrs()\n\t\tthis.invalidChildAttrs()\n\t\tthis.disabledChildAttrs()\n\t\tthis.syncControlMessages()\n\t\tthis.formElementDescriptionControl()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate passChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"success\", this.success)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate invalidChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"invalid\", this.invalid)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate disabledChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"disabled\", this.disabled)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate formElementDescriptionControl() {\n\t\tconst bottomSlot = this.host.querySelector(\".\" + FormControlClass.bottom)\n\t\tif (!bottomSlot) return\n\t\tthis.observer = new MutationObserver(\n\t\t\tfunction() {\n\t\t\t\tthis.syncControlMessages()\n\t\t\t}.bind(this),\n\t\t)\n\n\t\tthis.observer.observe(bottomSlot, { childList: true })\n\t}\n\n\tprivate syncControlMessages() {\n\t\tPromise.all(this.f.messageElements.map((message: HTMLGovFormMessageElement) => message.identifier())).then((ids: string[]) => {\n\t\t\tthis.f.mainElementsInControl.forEach((element: Element) => {\n\t\t\t\tconst currentValue = splitByWhitespace(element.getAttribute(\"wcag-described-by\"))\n\t\t\t\telement.removeAttribute(\"wcag-described-by\")\n\t\t\t\tif (Array.isArray(currentValue)) {\n\t\t\t\t\tcurrentValue.forEach(id => (id.indexOf(\"GovFormMessage\") === -1 ? ids.push(id) : null))\n\t\t\t\t}\n\t\t\t\tif (ids.length) {\n\t\t\t\t\telement.setAttribute(\"wcag-described-by\", ids.join(\" \"))\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\tconst Tag = this.fieldset ? \"fieldset\" : \"div\"\n\t\treturn (\n\t\t\t<Host size={this.size} class={this.h.classes(FormControlClass.root)}>\n\t\t\t\t<Tag class={FormControlClass.holder}>\n\t\t\t\t\t{this.h.hasSlot(\"top\") && <slot name=\"top\"></slot>}\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.h.hasSlot(\"bottom\") && (\n\t\t\t\t\t\t<div class={FormControlClass.bottom}>\n\t\t\t\t\t\t\t<slot name=\"bottom\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-83edd4fe.js');
6
6
  const string_utils = require('./string.utils-0f08c48c.js');
7
7
  const template = require('./template-e1c4ff78.js');
8
- const wcag = require('./wcag-b0321f09.js');
9
- const win = require('./win-53f637d4.js');
8
+ const wcag = require('./wcag-d7912060.js');
9
+ const win = require('./win-0427c131.js');
10
10
  const utils = require('./utils-c9b1bba3.js');
11
11
  const form = require('./form-f68d13c6.js');
12
12
  require('./gov.log-0c9dca27.js');
@@ -10,16 +10,22 @@ const props = require('./props-5f82e4c0.js');
10
10
  require('./gov.log-0c9dca27.js');
11
11
 
12
12
  const FormGroupSizes = utils.pick(sizes.Sizes, ['_2XS', '_XS', '_S', '_M', '_L']);
13
+ var FormGroupOrientation;
14
+ (function (FormGroupOrientation) {
15
+ FormGroupOrientation["HORIZONTAL"] = "horizontal";
16
+ FormGroupOrientation["VERTICAL"] = "vertical";
17
+ })(FormGroupOrientation || (FormGroupOrientation = {}));
13
18
  const FormGroupClass = {
14
19
  root: 'gov-form-group',
15
20
  };
16
21
 
17
- const govFormGroupCss = ".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-group{position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}.gov-form-group .gov-form-label .gov-form-label__label{margin:0}.gov-form-group[gap=\"2xs\"]{gap:0.25rem}.gov-form-group[gap=xs]{gap:0.5rem}.gov-form-group[gap=s]{gap:0.75rem}.gov-form-group[gap=m]{gap:1rem}.gov-form-group[gap=l]{gap:1.25rem}";
22
+ const govFormGroupCss = ".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-group{position:relative;display:flex;width:100%;flex-direction:column;align-items:flex-start}.gov-form-group .gov-form-label__label{margin:0}.gov-form-group[orientation=horizontal]{flex-direction:row;flex-wrap:wrap}.gov-form-group[orientation=horizontal] .gov-form-label__label{white-space:nowrap}.gov-form-group[gap=\"2xs\"]{gap:0.25rem}.gov-form-group[gap=xs]{gap:0.5rem}.gov-form-group[gap=s]{gap:0.75rem}.gov-form-group[gap=m]{gap:1rem}.gov-form-group[gap=l]{gap:1.25rem}";
18
23
 
19
24
  const GovFormGroup = class {
20
25
  constructor(hostRef) {
21
26
  index.registerInstance(this, hostRef);
22
27
  this.gap = undefined;
28
+ this.orientation = 'vertical';
23
29
  this.h = template.govHost(this.host);
24
30
  }
25
31
  validateGap(newValue) {
@@ -1 +1 @@
1
- {"file":"gov-form-group.entry.cjs.js","mappings":";;;;;;;;;;;AAIO,MAAM,cAAc,GAAGA,UAAI,CAACC,WAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAGrE,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB;;ACTD,MAAM,eAAe,GAAG,irBAAirB;;MCU5rB,YAAY;EAGxB;;eAQ4C,SAAS;IAPpD,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EASD,WAAW,CAAC,QAAgB;IAC3BC,kBAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAED,iBAAiB;IAChB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;GAC1B;EAED,MAAM;IACL,QACCC,QAACC,UAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC9DD,qBAAa,CACP,EACP;GACD;;;;;;;;;;","names":["pick","Sizes","govHost","validateProp","h","Host"],"sources":["../../../packages/core/src/components/gov-form/group/constants.ts","../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-group","../../../packages/core/src/components/gov-form/group/gov-form-group.tsx"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n","$class: \".gov-form-group\";\n\n#{$class} {\n\t@include base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label .gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t// VARIANTS\n\t@each $gap, $definitions in $form-group-gaps {\n\t\t&[gap=\"#{$gap}\"] {\n\t\t\tgap: get($gap, $sizes);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { FormGroupClass, FormGroupSizes, FormGroupSizesType } from \"./constants\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\n\n@Component({\n\ttag: \"gov-form-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-group.entry.cjs.js","mappings":";;;;;;;;;;;AAIO,MAAM,cAAc,GAAGA,UAAI,CAACC,WAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAG5E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;EAC/B,iDAAyB,CAAA;EACzB,6CAAqB,CAAA;AACtB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAGM,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB;;ACfD,MAAM,eAAe,GAAG,6zBAA6zB;;MCUx0B,YAAY;EAGxB;;eAQ4C,SAAS;uBAIK,UAAU;IAXnE,IAAI,CAAC,CAAC,GAAGC,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,WAAW,CAAC,QAAgB;IAC3BC,kBAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAED,iBAAiB;IAChB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;GAC1B;EAED,MAAM;IACL,QACCC,QAACC,UAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC9DD,qBAAa,CACP,EACP;GACD;;;;;;;;;;","names":["pick","Sizes","govHost","validateProp","h","Host"],"sources":["../../../packages/core/src/components/gov-form/group/constants.ts","../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-group","../../../packages/core/src/components/gov-form/group/gov-form-group.tsx"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport enum FormGroupOrientation {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type FormGroupOrientationType = `${ValueOf<typeof FormGroupOrientation>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n","$class: \".gov-form-group\";\n\n#{$class} {\n\t@include base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t&[orientation=\"horizontal\"] {\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\t.gov-form-label__label {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $gap, $definitions in $form-group-gaps {\n\t\t&[gap=\"#{$gap}\"] {\n\t\t\tgap: get($gap, $sizes);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { FormGroupClass, FormGroupSizes, FormGroupSizesType, FormGroupOrientationType } from \"./constants\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\n\n@Component({\n\ttag: \"gov-form-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\t/**\n\t * Elements orientation\n\t */\n\t@Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-83edd4fe.js');
6
6
  const form = require('./form-f68d13c6.js');
7
7
  const template = require('./template-e1c4ff78.js');
8
- const win = require('./win-53f637d4.js');
8
+ const win = require('./win-0427c131.js');
9
9
  const props = require('./props-5f82e4c0.js');
10
- const wcag = require('./wcag-b0321f09.js');
10
+ const wcag = require('./wcag-d7912060.js');
11
11
  const string_utils = require('./string.utils-0f08c48c.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  require('./sizes-79872c2a.js');
@@ -34,9 +34,9 @@ const GovFormInput = class {
34
34
  this.govKeyDown = index.createEvent(this, "gov-keydown", 7);
35
35
  this.value = undefined;
36
36
  this.identifier = undefined;
37
- this.variant = 'secondary';
37
+ this.variant = "secondary";
38
38
  this.success = undefined;
39
- this.size = 'm';
39
+ this.size = "m";
40
40
  this.name = undefined;
41
41
  this.multiline = undefined;
42
42
  this.rows = undefined;
@@ -52,7 +52,7 @@ const GovFormInput = class {
52
52
  this.autocomplete = undefined;
53
53
  this.autocorrect = undefined;
54
54
  this.type = undefined;
55
- this.inputType = 'text';
55
+ this.inputType = "text";
56
56
  this.role = undefined;
57
57
  this.invalid = undefined;
58
58
  this.wcagDescribedBy = undefined;
@@ -62,7 +62,7 @@ const GovFormInput = class {
62
62
  this.wcagExpanded = undefined;
63
63
  this.focused = undefined;
64
64
  this.h = template.govHost(this.host);
65
- this.inputId = string_utils.createID('GovInput');
65
+ this.inputId = string_utils.createID("GovInput");
66
66
  this.f = form.govForm(this.h);
67
67
  }
68
68
  validateVariant(newValue) {
@@ -78,13 +78,13 @@ const GovFormInput = class {
78
78
  this.f.passAttrToControl("size", this.size);
79
79
  this.f.passAttrToControl("disabled", template.toBoolAttr(this.disabled));
80
80
  this.f.passAttrToControl("invalid", template.toBoolAttr(this.invalid));
81
- this.f.passAttrToControl('type', this.multiline ? Tags.TEXTAREA : Tags.INPUT);
81
+ this.f.passAttrToControl("type", this.multiline ? Tags.TEXTAREA : Tags.INPUT);
82
82
  }
83
83
  componentWillLoad() {
84
84
  this.validateVariant(this.variant);
85
85
  this.validateSize(this.size);
86
86
  this.passControlAttrs();
87
- this.f.passAttrToLabel('required', String(this.required));
87
+ this.f.passAttrToLabel("required", String(this.required));
88
88
  }
89
89
  async componentDidRender() {
90
90
  if (win.canValidateWcagOnRender()) {
@@ -94,7 +94,9 @@ const GovFormInput = class {
94
94
  }
95
95
  render() {
96
96
  const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
97
- return (index.h(index.Host, { class: form.FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot('prefix') && index.h("slot", { name: "prefix" }), index.h("span", { class: "element" }, this.h.hasSlot('left-icon') && index.h("slot", { name: "left-icon" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && index.h("slot", { name: "right-icon" }), this.success && !this.multiline && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline && index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), index.h(Tag, { type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, readonly: template.toBoolAttrIfDefined(this.readonly), autocomplete: template.toOnOffAttrIfDefined(this.autocomplete), autocorrect: template.toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-disabled": template.toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": template.toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot('sufix') && index.h("slot", { name: "sufix" })));
97
+ return (index.h(index.Host, { class: form.FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot("prefix") && index.h("slot", { name: "prefix" }), index.h("span", { class: "element" }, this.h.hasSlot("left-icon") && index.h("slot", { name: "left-icon" }), this.h.hasSlot("right-icon") && !(this.success || this.invalid) && index.h("slot", { name: "right-icon" }), this.success && !this.multiline &&
98
+ index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
99
+ index.h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), index.h(Tag, { type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, readonly: template.toBoolAttrIfDefined(this.readonly), autocomplete: template.toOnOffAttrIfDefined(this.autocomplete), autocorrect: template.toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": template.toBoolAttrIfDefined(this.required), "aria-invalid": template.toBoolAttrIfDefined(this.invalid), "aria-disabled": template.toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": template.toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot("sufix") && index.h("slot", { name: "sufix" })));
98
100
  }
99
101
  onFocusHandler(e) {
100
102
  e.stopPropagation();
@@ -155,8 +157,8 @@ const GovFormInput = class {
155
157
  * Clears input value
156
158
  */
157
159
  async clearValue() {
158
- this.value = '';
159
- this.inputRef.value = '';
160
+ this.value = "";
161
+ this.inputRef.value = "";
160
162
  }
161
163
  /**
162
164
  * Returns an instance of the native html input element
@@ -168,9 +170,9 @@ const GovFormInput = class {
168
170
  * Validate the WCAG attributes of the component
169
171
  */
170
172
  async validateWcag() {
171
- wcag.validateWcagRef(this.wcagDescribedBy, 'wcag-described-by', form.FormInputClass.root);
172
- wcag.validateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', form.FormInputClass.root);
173
- wcag.validateWcagRef(this.wcagOwns, 'wcag-owns', form.FormInputClass.root);
173
+ wcag.validateWcagRef(this.wcagDescribedBy, "wcag-described-by", form.FormInputClass.root);
174
+ wcag.validateWcagRef(this.wcagLabelledBy, "wcag-labelled-by", form.FormInputClass.root);
175
+ wcag.validateWcagRef(this.wcagOwns, "wcag-owns", form.FormInputClass.root);
174
176
  wcag.validateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, form.FormInputClass.root);
175
177
  }
176
178
  get host() { return index.getElement(this); }
@@ -1 +1 @@
1
- {"file":"gov-form-input.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,ijYAAijY;;ACazkY,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,uBAAe,CAAA;EACf,6BAAqB,CAAA;AACtB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,YAAY;EAMxB;;;;;;;;;mBAkBkD,WAAW;;gBAQhB,GAAG;;;;;oBAqBX,KAAK;;;;;;;;;;;qBA8CF,MAAM;;;;;;;;;IA5F7C,IAAI,CAAC,CAAC,GAAGA,gBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,GAAGC,qBAAQ,CAAC,UAAU,CAAC,CAAA;IACnC,IAAI,CAAC,CAAC,GAAGC,YAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA8ID,eAAe,CAAC,QAAgB;IAC/BC,kBAAY,CAACC,sBAAiB,EAAE,QAAQ,EAAEC,mBAAc,CAAC,IAAI,CAAC,CAAA;GAC9D;EAGD,YAAY,CAAC,QAAgB;IAC5BF,kBAAY,CAACG,mBAAc,EAAE,QAAQ,EAAED,mBAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAMD,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,EAAEE,mBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAEA,mBAAU,CAAC,IAAI,CAAC,OAAO,CAAC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I,CAAC,CAAA;IAC7ES,oBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAET,mBAAc,CAAC,IAAI,CAAC,CAAA;IAChEU,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAEV,mBAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;;;","names":["govHost","createID","govForm","validateProp","FormInputVariants","FormInputClass","FormInputSizes","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","toOnOffAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t*[slot=\"right-icon\"]:not(.icon-validation):not(.icon-arrow) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core'\nimport { govForm } from '../../../helpers/Dom/form'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } 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 { FormInputClass, FormInputSizes, FormInputSizesType, FormInputVariantType, FormInputVariants, InputType, Type } from './constants'\nimport { FormInputEvent } from './gov-form-input.types'\n\nenum Tags {\n\tINPUT = 'input',\n\tTEXTAREA = 'textarea',\n}\n\n@Component({\n\ttag: 'gov-form-input',\n\tstyleUrl: 'gov-form-input.scss',\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID('GovInput')\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType = 'secondary'\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 * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = 'm'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\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 input 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\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop() readonly inputType: InputType = 'text'\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: 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 * 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 * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: 'wcag-autocomplete' }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: 'wcag-expanded' }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-input' }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keyup' }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keydown' }) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\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', this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\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\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\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{this.h.hasSlot('left-icon') && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\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-disabled={toBoolAttrIfDefined(this.disabled)}\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\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\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\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\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.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\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.inputRef.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 * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\t}\n\n\t/**\n\t * Returns an instance of the native html input 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', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-form-input.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,ijYAAijY;;ACsBzkY,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,uBAAe,CAAA;EACf,6BAAqB,CAAA;AACtB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,YAAY;EAMxB;;;;;;;;;mBAkBkD,WAAW;;gBAQhB,GAAG;;;;;oBAqBX,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cAAc,CAAC,CAAa;IACnC,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAA;IACjD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAEA,mBAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,QAAQ,CAAC,OAAsB;IACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;GACnC;;;;EAMD,MAAM,QAAQ,CAAC,KAAa;IAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;GAClB;;;;EAMD,MAAM,UAAU;IACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;IACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAA;GACxB;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjBS,oBAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAET,mBAAc,CAAC,IAAI,CAAC,CAAA;IAC/ES,oBAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAET,mBAAc,CAAC,IAAI,CAAC,CAAA;IAC7ES,oBAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAET,mBAAc,CAAC,IAAI,CAAC,CAAA;IAChEU,yBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAEV,mBAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;;;","names":["govHost","createID","govForm","validateProp","FormInputVariants","FormInputClass","FormInputSizes","toBoolAttr","canValidateWcagOnRender","delay","h","Host","toBoolAttrIfDefined","toOnOffAttrIfDefined","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t*[slot=\"right-icon\"]:not(.icon-validation):not(.icon-arrow) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\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, toOnOffAttrIfDefined } 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\tFormInputClass,\n\tFormInputSizes,\n\tFormInputSizesType,\n\tFormInputVariants,\n\tFormInputVariantType,\n\tInputType,\n\tType,\n} from \"./constants\"\nimport { FormInputEvent } from \"./gov-form-input.types\"\nimport { Nullable } from \"../../../types/interfaces\"\n\nenum Tags {\n\tINPUT = \"input\",\n\tTEXTAREA = \"textarea\",\n}\n\n@Component({\n\ttag: \"gov-form-input\",\n\tstyleUrl: \"gov-form-input.scss\",\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID(\"GovInput\")\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType = \"secondary\"\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 * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\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 input 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\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop() readonly inputType: InputType = \"text\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: Nullable<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 * 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 * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: \"wcag-autocomplete\" }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keyup\" }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keydown\" }) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\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\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\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\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\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{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\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-disabled={toBoolAttrIfDefined(this.disabled)}\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\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\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\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\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.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\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.inputRef.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 * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input 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\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"],"version":3}
@@ -6,8 +6,8 @@ const index = require('./index-83edd4fe.js');
6
6
  const template = require('./template-e1c4ff78.js');
7
7
  const form = require('./form-f68d13c6.js');
8
8
  const props = require('./props-5f82e4c0.js');
9
- const wcag = require('./wcag-b0321f09.js');
10
- const win = require('./win-53f637d4.js');
9
+ const wcag = require('./wcag-d7912060.js');
10
+ const win = require('./win-0427c131.js');
11
11
  const string_utils = require('./string.utils-0f08c48c.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  require('./sizes-79872c2a.js');
@@ -7,8 +7,8 @@ const string_utils = require('./string.utils-0f08c48c.js');
7
7
  const props = require('./props-5f82e4c0.js');
8
8
  const form = require('./form-f68d13c6.js');
9
9
  const template = require('./template-e1c4ff78.js');
10
- const wcag = require('./wcag-b0321f09.js');
11
- const win = require('./win-53f637d4.js');
10
+ const wcag = require('./wcag-d7912060.js');
11
+ const win = require('./win-0427c131.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  const Fragment = require('./Fragment-52846f79.js');
14
14
  require('./gov.log-0c9dca27.js');
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-83edd4fe.js');
6
6
  const form = require('./form-f68d13c6.js');
7
7
  const template = require('./template-e1c4ff78.js');
8
- const win = require('./win-53f637d4.js');
8
+ const win = require('./win-0427c131.js');
9
9
  const props = require('./props-5f82e4c0.js');
10
- const wcag = require('./wcag-b0321f09.js');
10
+ const wcag = require('./wcag-d7912060.js');
11
11
  const string_utils = require('./string.utils-0f08c48c.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  require('./sizes-79872c2a.js');
@@ -7,8 +7,8 @@ const string_utils = require('./string.utils-0f08c48c.js');
7
7
  const props = require('./props-5f82e4c0.js');
8
8
  const form = require('./form-f68d13c6.js');
9
9
  const template = require('./template-e1c4ff78.js');
10
- const wcag = require('./wcag-b0321f09.js');
11
- const win = require('./win-53f637d4.js');
10
+ const wcag = require('./wcag-d7912060.js');
11
+ const win = require('./win-0427c131.js');
12
12
  const utils = require('./utils-c9b1bba3.js');
13
13
  const Fragment = require('./Fragment-52846f79.js');
14
14
  require('./gov.log-0c9dca27.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-83edd4fe.js');
6
- const win = require('./win-53f637d4.js');
6
+ const win = require('./win-0427c131.js');
7
7
  const template = require('./template-e1c4ff78.js');
8
8
  require('./utils-c9b1bba3.js');
9
9
 
@@ -18,7 +18,7 @@ const IconClass = {
18
18
  holder: 'gov-icon__holder',
19
19
  };
20
20
 
21
- const version = "0.0.51";
21
+ const version = "0.0.54";
22
22
 
23
23
  const dsVersion = () => {
24
24
  return version;
@@ -26,7 +26,7 @@ const dsVersion = () => {
26
26
 
27
27
  const iconCache = {};
28
28
  const requestCache = {};
29
- const isExternalUrl = (path) => path.startsWith('http://') || path.startsWith('https://');
29
+ const isExternalUrl = (path) => path.startsWith("http://") || path.startsWith("https://");
30
30
  const iconUrl = (path, name, type) => {
31
31
  if (isExternalUrl(path)) {
32
32
  return `${path}/${type}/${name}.svg?v=${dsVersion()}`;
@@ -34,11 +34,12 @@ const iconUrl = (path, name, type) => {
34
34
  return index.getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`;
35
35
  };
36
36
  async function fetchIcon({ name, type }) {
37
- if (iconCache[name]) {
38
- return iconCache[name];
37
+ const cacheKey = type + "-" + name;
38
+ if (iconCache[cacheKey]) {
39
+ return iconCache[cacheKey];
39
40
  }
40
- if (!requestCache[name]) {
41
- requestCache[name] = fetch(iconUrl(win.iconsPath(), name, type)).then(resp => {
41
+ if (!requestCache[cacheKey]) {
42
+ requestCache[cacheKey] = fetch(iconUrl(win.iconsPath(), name, type)).then(resp => {
42
43
  if (resp.status === 200) {
43
44
  return resp.text();
44
45
  }
@@ -47,8 +48,8 @@ async function fetchIcon({ name, type }) {
47
48
  }
48
49
  });
49
50
  }
50
- const path = await requestCache[name];
51
- iconCache[name] = path;
51
+ const path = await requestCache[cacheKey];
52
+ iconCache[cacheKey] = path;
52
53
  return path;
53
54
  }
54
55
 
@@ -58,7 +59,7 @@ const GovIcon = class {
58
59
  constructor(hostRef) {
59
60
  index.registerInstance(this, hostRef);
60
61
  this.name = null;
61
- this.type = 'basic';
62
+ this.type = "basic";
62
63
  this.iconData = undefined;
63
64
  this.visible = false;
64
65
  this.error = false;
@@ -77,10 +78,16 @@ const GovIcon = class {
77
78
  }
78
79
  }
79
80
  connectedCallback() {
80
- this.waitUntilVisible(async () => {
81
+ if (win.iconsLazyLoad()) {
81
82
  this.visible = true;
82
- await this.loadIconPathData();
83
- });
83
+ this.loadIconPathData().finally();
84
+ }
85
+ else {
86
+ this.waitUntilVisible(async () => {
87
+ this.visible = true;
88
+ await this.loadIconPathData();
89
+ });
90
+ }
84
91
  }
85
92
  disconnectedCallback() {
86
93
  if (this.intersectionObserver) {
@@ -92,19 +99,21 @@ const GovIcon = class {
92
99
  await this.loadIconPathData();
93
100
  }
94
101
  waitUntilVisible(callback) {
95
- if (typeof window === 'undefined' || !window.IntersectionObserver) {
102
+ if (typeof window === "undefined" || !window.IntersectionObserver) {
96
103
  callback();
97
104
  return;
98
105
  }
99
106
  this.intersectionObserver = new IntersectionObserver(entries => {
100
107
  entries.forEach(entry => {
101
108
  if (entry.isIntersecting) {
102
- this.intersectionObserver.disconnect();
103
- this.intersectionObserver = null;
109
+ if (this.intersectionObserver) {
110
+ this.intersectionObserver.disconnect();
111
+ this.intersectionObserver = null;
112
+ }
104
113
  callback();
105
114
  }
106
115
  });
107
- }, { rootMargin: '50px' });
116
+ }, { rootMargin: "50px" });
108
117
  this.intersectionObserver.observe(this.host);
109
118
  }
110
119
  render() {
@@ -1 +1 @@
1
- {"file":"gov-icon.entry.cjs.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,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ACC,UAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAC1CD,kBAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC1D,EACP;GACD;;;;;;;;;;;","names":["getAssetPath","iconsPath","govHost","h","Host"],"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\tif (iconCache[name]) {\n\t\treturn iconCache[name]\n\t}\n\tif (!requestCache[name]) {\n\t\trequestCache[name] = 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[name]\n\ticonCache[name] = 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\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n}\n","import { Build, Component, Element, h, Prop, State, Watch, Host } 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'\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\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\tthis.waitUntilVisible(async () => {\n\t\t\tthis.visible = true\n\t\t\tawait this.loadIconPathData()\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\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\tthis.intersectionObserver = null\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.cjs.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,CAAC,EAAE;IACxB,OAAO,GAAG,IAAI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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,QACCC,QAACC,UAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAC1CD,kBAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC1D,EACP;GACD;;;;;;;;;;;","names":["getAssetPath","iconsPath","govHost","iconsLazyLoad","h","Host"],"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\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 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}
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-83edd4fe.js');
6
6
  const template = require('./template-e1c4ff78.js');
7
- const win = require('./win-53f637d4.js');
7
+ const win = require('./win-0427c131.js');
8
8
  const gov_log = require('./gov.log-0c9dca27.js');
9
- const wcag = require('./wcag-b0321f09.js');
9
+ const wcag = require('./wcag-d7912060.js');
10
10
  const string_utils = require('./string.utils-0f08c48c.js');
11
11
  const utils = require('./utils-c9b1bba3.js');
12
12
  const constants = require('./constants-66cb0615.js');