@gov-design-system-ce/components 0.0.16 → 0.0.18

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 (280) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +5 -1
  3. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-accordion.cjs.entry.js +5 -1
  5. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-app.cjs.entry.js +11 -8
  7. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-backdrop.cjs.entry.js +0 -4
  9. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-button.cjs.entry.js +28 -14
  11. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +33 -14
  13. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-form-checkbox.cjs.entry.js +25 -18
  15. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  16. package/dist/cjs/gov-form-file.cjs.entry.js +57 -27
  17. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-form-input.cjs.entry.js +21 -5
  19. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-form-multi-select.cjs.entry.js +30 -19
  21. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-form-radio.cjs.entry.js +23 -16
  23. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-form-select.cjs.entry.js +27 -15
  25. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-switch.cjs.entry.js +23 -16
  27. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  29. package/dist/cjs/gov-loading.cjs.entry.js +1 -1
  30. package/dist/cjs/gov-loading.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-modal.cjs.entry.js +1 -1
  32. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  33. package/dist/cjs/gov-pagination.cjs.entry.js +18 -10
  34. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  35. package/dist/cjs/gov-prompt.cjs.entry.js +8 -8
  36. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  37. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  38. package/dist/cjs/loader.cjs.js +1 -1
  39. package/dist/collection/components/gov-accordion/gov-accordion-item.js +9 -5
  40. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  41. package/dist/collection/components/gov-accordion/gov-accordion.js +9 -5
  42. package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
  43. package/dist/collection/components/gov-accordion/gov-accordion.types.js +2 -0
  44. package/dist/collection/components/gov-accordion/gov-accordion.types.js.map +1 -0
  45. package/dist/collection/components/gov-backdrop/gov-backdrop.js +0 -22
  46. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  47. package/dist/collection/components/gov-button/gov-button.css +2 -2
  48. package/dist/collection/components/gov-button/gov-button.js +54 -37
  49. package/dist/collection/components/gov-button/gov-button.js.map +1 -1
  50. package/dist/collection/components/gov-button/gov-button.types.js +2 -0
  51. package/dist/collection/components/gov-button/gov-button.types.js.map +1 -0
  52. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +60 -38
  53. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  54. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.types.js.map +1 -1
  55. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +60 -39
  56. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  57. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.types.js +2 -0
  58. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.types.js.map +1 -0
  59. package/dist/collection/components/gov-form/file/gov-form-file.js +129 -59
  60. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  61. package/dist/collection/components/gov-form/file/gov-form-file.types.js.map +1 -1
  62. package/dist/collection/components/gov-form/input/gov-form-input.js +42 -22
  63. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  64. package/dist/collection/components/gov-form/input/gov-form-input.types.js +2 -0
  65. package/dist/collection/components/gov-form/input/gov-form-input.types.js.map +1 -0
  66. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +53 -40
  67. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  68. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js +2 -0
  69. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -0
  70. package/dist/collection/components/gov-form/radio/gov-form-radio.js +57 -36
  71. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  72. package/dist/collection/components/gov-form/radio/gov-form-radio.types.js +2 -0
  73. package/dist/collection/components/gov-form/radio/gov-form-radio.types.js.map +1 -0
  74. package/dist/collection/components/gov-form/select/gov-form-select.js +56 -37
  75. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  76. package/dist/collection/components/gov-form/select/gov-form-select.types.js +2 -0
  77. package/dist/collection/components/gov-form/select/gov-form-select.types.js.map +1 -0
  78. package/dist/collection/components/gov-form/switch/gov-form-switch.js +57 -36
  79. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  80. package/dist/collection/components/gov-form/switch/gov-form-switch.types.js +2 -0
  81. package/dist/collection/components/gov-form/switch/gov-form-switch.types.js.map +1 -0
  82. package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
  83. package/dist/collection/components/gov-loading/loading/gov-loading.js.map +1 -1
  84. package/dist/collection/components/gov-modal/gov-modal.js +1 -1
  85. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  86. package/dist/collection/components/gov-pagination/gov-pagination.js +16 -13
  87. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  88. package/dist/collection/components/gov-pagination/gov-pagination.types.js +2 -0
  89. package/dist/collection/components/gov-pagination/gov-pagination.types.js.map +1 -0
  90. package/dist/collection/components/gov-promp/gov-prompt.js +18 -18
  91. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  92. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  93. package/dist/collection/pages/Forms.js +3 -0
  94. package/dist/collection/pages/Forms.js.map +1 -1
  95. package/dist/collection/pages/Pagination.js +8 -8
  96. package/dist/collection/pages/Pagination.js.map +1 -1
  97. package/dist/collection/types/event.types.js +2 -0
  98. package/dist/collection/types/event.types.js.map +1 -0
  99. package/dist/collection/utils/array.utils.js +6 -1
  100. package/dist/collection/utils/array.utils.js.map +1 -1
  101. package/dist/components/gov-accordion-item.js +5 -1
  102. package/dist/components/gov-accordion-item.js.map +1 -1
  103. package/dist/components/gov-accordion.js +5 -1
  104. package/dist/components/gov-accordion.js.map +1 -1
  105. package/dist/components/gov-app.js +11 -8
  106. package/dist/components/gov-app.js.map +1 -1
  107. package/dist/components/gov-backdrop2.js +0 -5
  108. package/dist/components/gov-backdrop2.js.map +1 -1
  109. package/dist/components/gov-button2.js +28 -14
  110. package/dist/components/gov-button2.js.map +1 -1
  111. package/dist/components/gov-form-autocomplete2.js +33 -14
  112. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  113. package/dist/components/gov-form-checkbox.js +27 -20
  114. package/dist/components/gov-form-checkbox.js.map +1 -1
  115. package/dist/components/gov-form-file.js +59 -27
  116. package/dist/components/gov-form-file.js.map +1 -1
  117. package/dist/components/gov-form-input2.js +22 -6
  118. package/dist/components/gov-form-input2.js.map +1 -1
  119. package/dist/components/gov-form-multi-select.js +30 -19
  120. package/dist/components/gov-form-multi-select.js.map +1 -1
  121. package/dist/components/gov-form-radio.js +25 -18
  122. package/dist/components/gov-form-radio.js.map +1 -1
  123. package/dist/components/gov-form-select2.js +28 -16
  124. package/dist/components/gov-form-select2.js.map +1 -1
  125. package/dist/components/gov-form-switch.js +25 -18
  126. package/dist/components/gov-form-switch.js.map +1 -1
  127. package/dist/components/gov-icon2.js +1 -1
  128. package/dist/components/gov-loading.js +1 -1
  129. package/dist/components/gov-loading.js.map +1 -1
  130. package/dist/components/gov-modal.js +1 -1
  131. package/dist/components/gov-modal.js.map +1 -1
  132. package/dist/components/gov-pagination.js +18 -10
  133. package/dist/components/gov-pagination.js.map +1 -1
  134. package/dist/components/gov-prompt.js +8 -8
  135. package/dist/components/gov-prompt.js.map +1 -1
  136. package/dist/components/gov-tile.js.map +1 -1
  137. package/dist/core/core.esm.js +1 -1
  138. package/dist/core/core.esm.js.map +1 -1
  139. package/dist/core/p-26260897.entry.js +2 -0
  140. package/dist/core/p-26260897.entry.js.map +1 -0
  141. package/dist/core/{p-30b162df.entry.js → p-354c6a6d.entry.js} +2 -2
  142. package/dist/core/p-354c6a6d.entry.js.map +1 -0
  143. package/dist/core/{p-e6b8c610.entry.js → p-3a50ac4c.entry.js} +2 -2
  144. package/dist/core/p-3a50ac4c.entry.js.map +1 -0
  145. package/dist/core/p-52f2f67c.entry.js +2 -0
  146. package/dist/core/p-52f2f67c.entry.js.map +1 -0
  147. package/dist/core/{p-e3141382.entry.js → p-5e5e925d.entry.js} +2 -2
  148. package/dist/core/p-5e5e925d.entry.js.map +1 -0
  149. package/dist/core/p-67006730.entry.js.map +1 -1
  150. package/dist/core/p-724921e7.entry.js +2 -0
  151. package/dist/core/p-724921e7.entry.js.map +1 -0
  152. package/dist/core/{p-d2f6053f.entry.js → p-8b2a6f87.entry.js} +2 -2
  153. package/dist/core/p-8b2a6f87.entry.js.map +1 -0
  154. package/dist/core/{p-9bdce72b.entry.js → p-8feb8960.entry.js} +2 -2
  155. package/dist/core/p-8feb8960.entry.js.map +1 -0
  156. package/dist/core/{p-f027a1a1.entry.js → p-a37ef1b2.entry.js} +2 -2
  157. package/dist/core/{p-bce96aac.entry.js → p-b2d1dd2a.entry.js} +2 -2
  158. package/dist/core/p-b2d1dd2a.entry.js.map +1 -0
  159. package/dist/core/{p-131c50d1.entry.js → p-b9b80796.entry.js} +2 -2
  160. package/dist/core/p-b9b80796.entry.js.map +1 -0
  161. package/dist/core/{p-b7587525.entry.js → p-bb3afae6.entry.js} +2 -2
  162. package/dist/core/p-bb3afae6.entry.js.map +1 -0
  163. package/dist/core/{p-c91928ed.entry.js → p-be799dfa.entry.js} +2 -2
  164. package/dist/core/p-be799dfa.entry.js.map +1 -0
  165. package/dist/core/{p-2426fa82.entry.js → p-c970a479.entry.js} +2 -2
  166. package/dist/core/p-c970a479.entry.js.map +1 -0
  167. package/dist/core/{p-471c0863.entry.js → p-cba27477.entry.js} +2 -2
  168. package/dist/core/p-cba27477.entry.js.map +1 -0
  169. package/dist/core/{p-93edcce2.entry.js → p-d79d0f7a.entry.js} +2 -2
  170. package/dist/core/p-d79d0f7a.entry.js.map +1 -0
  171. package/dist/core/{p-c836f7cd.entry.js → p-e51baf04.entry.js} +2 -2
  172. package/dist/core/p-e51baf04.entry.js.map +1 -0
  173. package/dist/core/{p-0272ffa0.entry.js → p-f73d482b.entry.js} +2 -2
  174. package/dist/core/p-f73d482b.entry.js.map +1 -0
  175. package/dist/custom-elements/index.js +1 -1
  176. package/dist/custom-elements/index.js.map +1 -1
  177. package/dist/esm/core.js +1 -1
  178. package/dist/esm/gov-accordion-item.entry.js +5 -1
  179. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  180. package/dist/esm/gov-accordion.entry.js +5 -1
  181. package/dist/esm/gov-accordion.entry.js.map +1 -1
  182. package/dist/esm/gov-app.entry.js +11 -8
  183. package/dist/esm/gov-app.entry.js.map +1 -1
  184. package/dist/esm/gov-backdrop.entry.js +0 -4
  185. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  186. package/dist/esm/gov-button.entry.js +28 -14
  187. package/dist/esm/gov-button.entry.js.map +1 -1
  188. package/dist/esm/gov-form-autocomplete.entry.js +33 -14
  189. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  190. package/dist/esm/gov-form-checkbox.entry.js +25 -18
  191. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  192. package/dist/esm/gov-form-file.entry.js +57 -27
  193. package/dist/esm/gov-form-file.entry.js.map +1 -1
  194. package/dist/esm/gov-form-input.entry.js +21 -5
  195. package/dist/esm/gov-form-input.entry.js.map +1 -1
  196. package/dist/esm/gov-form-multi-select.entry.js +30 -19
  197. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  198. package/dist/esm/gov-form-radio.entry.js +23 -16
  199. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  200. package/dist/esm/gov-form-select.entry.js +27 -15
  201. package/dist/esm/gov-form-select.entry.js.map +1 -1
  202. package/dist/esm/gov-form-switch.entry.js +23 -16
  203. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  204. package/dist/esm/gov-icon.entry.js +1 -1
  205. package/dist/esm/gov-loading.entry.js +1 -1
  206. package/dist/esm/gov-loading.entry.js.map +1 -1
  207. package/dist/esm/gov-modal.entry.js +1 -1
  208. package/dist/esm/gov-modal.entry.js.map +1 -1
  209. package/dist/esm/gov-pagination.entry.js +18 -10
  210. package/dist/esm/gov-pagination.entry.js.map +1 -1
  211. package/dist/esm/gov-prompt.entry.js +8 -8
  212. package/dist/esm/gov-prompt.entry.js.map +1 -1
  213. package/dist/esm/gov-tile.entry.js.map +1 -1
  214. package/dist/esm/loader.js +1 -1
  215. package/dist/hydrate/index.js +326 -187
  216. package/dist/stencil.config.js +1 -1
  217. package/dist/stencil.config.js.map +1 -1
  218. package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +2 -2
  219. package/dist/types/components/gov-accordion/gov-accordion.d.ts +2 -2
  220. package/dist/types/components/gov-accordion/gov-accordion.types.d.ts +9 -0
  221. package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +0 -4
  222. package/dist/types/components/gov-button/gov-button.d.ts +6 -5
  223. package/dist/types/components/gov-button/gov-button.types.d.ts +4 -0
  224. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +8 -8
  225. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.types.d.ts +6 -0
  226. package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +11 -8
  227. package/dist/types/components/gov-form/checkbox/gov-form-checkbox.types.d.ts +5 -0
  228. package/dist/types/components/gov-form/file/gov-form-file.d.ts +16 -8
  229. package/dist/types/components/gov-form/file/gov-form-file.types.d.ts +5 -0
  230. package/dist/types/components/gov-form/input/gov-form-input.d.ts +6 -5
  231. package/dist/types/components/gov-form/input/gov-form-input.types.d.ts +4 -0
  232. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +6 -6
  233. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +8 -0
  234. package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +10 -7
  235. package/dist/types/components/gov-form/radio/gov-form-radio.types.d.ts +5 -0
  236. package/dist/types/components/gov-form/select/gov-form-select.d.ts +7 -6
  237. package/dist/types/components/gov-form/select/gov-form-select.types.d.ts +4 -0
  238. package/dist/types/components/gov-form/switch/gov-form-switch.d.ts +10 -7
  239. package/dist/types/components/gov-form/switch/gov-form-switch.types.d.ts +5 -0
  240. package/dist/types/components/gov-pagination/gov-pagination.d.ts +2 -1
  241. package/dist/types/components/gov-pagination/gov-pagination.types.d.ts +5 -0
  242. package/dist/types/components.d.ts +69 -54
  243. package/dist/types/types/event.types.d.ts +4 -0
  244. package/package.json +1 -1
  245. package/dist/collection/components/gov-accordion/gov-accordion-item.d.js +0 -2
  246. package/dist/collection/components/gov-accordion/gov-accordion-item.d.js.map +0 -1
  247. package/dist/collection/components/gov-form/checkbox/interfaces.js +0 -2
  248. package/dist/collection/components/gov-form/checkbox/interfaces.js.map +0 -1
  249. package/dist/collection/components/gov-form/multiselect/interfaces.js +0 -2
  250. package/dist/collection/components/gov-form/multiselect/interfaces.js.map +0 -1
  251. package/dist/collection/components/gov-form/radio/interfaces.js +0 -2
  252. package/dist/collection/components/gov-form/radio/interfaces.js.map +0 -1
  253. package/dist/collection/components/gov-form/switch/interfaces.js +0 -2
  254. package/dist/collection/components/gov-form/switch/interfaces.js.map +0 -1
  255. package/dist/core/p-0272ffa0.entry.js.map +0 -1
  256. package/dist/core/p-131c50d1.entry.js.map +0 -1
  257. package/dist/core/p-2426fa82.entry.js.map +0 -1
  258. package/dist/core/p-30b162df.entry.js.map +0 -1
  259. package/dist/core/p-337fb136.entry.js +0 -2
  260. package/dist/core/p-337fb136.entry.js.map +0 -1
  261. package/dist/core/p-402c2751.entry.js +0 -2
  262. package/dist/core/p-402c2751.entry.js.map +0 -1
  263. package/dist/core/p-405fc50f.entry.js +0 -2
  264. package/dist/core/p-405fc50f.entry.js.map +0 -1
  265. package/dist/core/p-471c0863.entry.js.map +0 -1
  266. package/dist/core/p-93edcce2.entry.js.map +0 -1
  267. package/dist/core/p-9bdce72b.entry.js.map +0 -1
  268. package/dist/core/p-b7587525.entry.js.map +0 -1
  269. package/dist/core/p-bce96aac.entry.js.map +0 -1
  270. package/dist/core/p-c836f7cd.entry.js.map +0 -1
  271. package/dist/core/p-c91928ed.entry.js.map +0 -1
  272. package/dist/core/p-d2f6053f.entry.js.map +0 -1
  273. package/dist/core/p-e3141382.entry.js.map +0 -1
  274. package/dist/core/p-e6b8c610.entry.js.map +0 -1
  275. package/dist/types/components/gov-accordion/gov-accordion-item.d.d.ts +0 -4
  276. package/dist/types/components/gov-form/checkbox/interfaces.d.ts +0 -4
  277. package/dist/types/components/gov-form/multiselect/interfaces.d.ts +0 -4
  278. package/dist/types/components/gov-form/radio/interfaces.d.ts +0 -4
  279. package/dist/types/components/gov-form/switch/interfaces.d.ts +0 -4
  280. /package/dist/core/{p-f027a1a1.entry.js.map → p-a37ef1b2.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/gov-button.tsx"],"names":["toBool","value","indexOf","govButtonCss","Tags","GovButton","[object Object]","hostRef","this","h","govHost","host","newValue","validateProp","ButtonVariants","ButtonClass","root","Type","Sizes","NativeType","validateVariant","variant","validateType","type","validateSize","size","validateNativeType","nativeType","canValidateWcagOnRender","delay","validateWcag","classNames","prepareClasses","hasSlot","rootWithIcon","Tag","href","A","BUTTON","undefined","Host","hoverable","class","classes","inverse","ref","el","buttonRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","onMouseDown","isPressed","onMouseUp","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","focusable","aria-activedescendant","wcagActiveDescendant","aria-describedby","aria-description","wcagDescription","aria-controls","wcagControls","aria-details","wcagDetails","aria-expanded","toBoolAttrIfDefined","wcagExpanded","aria-label","wcagLabel","aria-labelledby","wcagLabelledBy","aria-owns","wcagOwns","aria-haspopup","wcagHasPopup","aria-pressed","toBoolAttr","aria-disabled","aria-current","wcagCurrent","loading","e","stopPropagation","govClick","emit","govFocus","govBlur","focus","validateWcagRef","validateWcagLabel"],"mappings":"8bAAgBA,EAAOC,GACtB,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAKC,QAAQD,MAAY,OACnD,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,OACT,UAAWA,IAAU,UAAW,CACtC,OAAOA,MACD,CACN,OAAOA,EAAQ,KAAO,OCRxB,MAAME,EAAe,8mxECWrB,IAAKC,GAAL,SAAKA,GACJA,EAAA,KAAA,IACAA,EAAA,UAAA,UAFD,CAAKA,IAAAA,EAAI,WASIC,EAAS,MAIrBC,YAAAC,wJAayD,cAIN,sBAId,mBAID,w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AAW,CACnBkC,EAAgB7F,KAAK6D,qBAAsB,wBAAyBtD,EAAYC,MAChFqF,EAAgB7F,KAAKkE,aAAc,gBAAiB3D,EAAYC,MAChEqF,EAAgB7F,KAAKoE,YAAa,eAAgB7D,EAAYC,MAC9DqF,EAAgB7F,KAAK6E,SAAU,YAAatE,EAAYC,MACxDqF,EAAgB7F,KAAK+E,aAAc,gBAAiBxE,EAAYC,MAChEsF,EAAkB9F,KAAKyE,UAAWzE,KAAK2E,eAAgBpE,EAAYC","sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & badge\n@import \"./gov-button-core.scss\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tpadding: 0;\n\t\t\ttext-decoration: underline;\n\t\t\tline-height: inherit;\n\t\t\tmin-height: inherit;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&:not(&--w-icon)[loading=\"0\"][size=\"#{$size}\"],\n\t\t&:not(&--w-icon)[loading=\"false\"][size=\"#{$size}\"],\n\t\t&:not(&--w-icon)[loading=\"\"][size=\"#{$size}\"]\n\t\t&:not[type=\"link\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions)\n\t\t\t\t\tcalc(get(\"padding-x\", $definitions) + (get(\"padding-x\", $definitions) / 2) + (get(\"icon-size\", $definitions) / 2));\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 { validateProp } from '../../helpers/Validate/props'\nimport { ButtonSizesType, NativeTypesType, TypesType, ButtonVariants, ButtonVariantType, ButtonClass, Type, NativeType, ButtonTargetType } from './constants'\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, prepareClasses } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { toBool } from '../../utils/bool.utils'\nimport { Sizes } from '../../core/constants/sizes'\nimport { validateWcagLabel, validateWcagRef } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\n\nenum Tags {\n\tA = 'a',\n\tBUTTON = 'button',\n}\n\n@Component({\n\ttag: 'gov-button',\n\tstyleUrl: 'gov-button.scss',\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate buttonRef?: HTMLButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly variant?: ButtonVariantType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = 'm'\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type?: TypesType = 'solid'\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = 'button'\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parametr\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: 'wcag-active-descendant' }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: 'wcag-controls' }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: 'wcag-description' }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: 'wcag-details' }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: 'wcag-expanded' }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: 'wcag-has-popup' }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: 'wcag-pressed' }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: 'wcag-current' }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch('type')\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch('nativeType')\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\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\tget classNames(): string {\n\t\tconst { h } = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot('left-icon') && ButtonClass.rootWithIcon, h.hasSlot('right-icon') && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host hoverable={true} size={this.size} variant={this.variant} class={this.h.classes(this.classNames)} type={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.buttonRef = el as HTMLButtonElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tonMouseDown={() => (this.isPressed = true)}\n\t\t\t\t\tonMouseUp={() => (this.isPressed = false)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.focusable ? '0' : '-1'}\n\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\taria-describedby={this.wcagActiveDescendant}\n\t\t\t\t\taria-description={this.wcagDescription}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-details={this.wcagDetails}\n\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\taria-haspopup={toBoolAttrIfDefined(this.wcagHasPopup)}\n\t\t\t\t\taria-pressed={toBoolAttr(this.isPressed)}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\taria-current={this.wcagCurrent}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot('right-icon') && <gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot('left-icon') && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot('right-icon') && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot('right-icon') && <gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit(e)\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.buttonRef.focus()\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\tif (this.focusable) {\n\t\t\tvalidateWcagRef(this.wcagActiveDescendant, 'aria-activedescendant', ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagControls, 'aria-controls', ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagDetails, 'aria-details', ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagOwns, 'aria-owns', ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, 'aria-haspopup', ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, ButtonClass.root)\n\t\t}\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/components/gov-accordion/gov-accordion-item.scss?tag=gov-accordion-item","../../../packages/core/src/components/gov-accordion/gov-accordion-item.tsx"],"names":["govAccordionItemCss","GovAccordionItem","[object Object]","hostRef","this","h","govHost","host","triggerId","createID","contentId","newValue","govErrorLog","AccordionItemClass","root","validTags","includes","validateProp","AccordionSizes","AccordionVariants","govChange","emit","open","isExpandedState","element","isExpanded","validateSize","size","validateLabel","label","validateVariant","variant","validateTriggerTag","triggerTag","identifier","TriggerTag","Host","class","classes","no-border","noBorder","role","id","header","aria-expanded","booleanString","aria-controls","disabled","aria-disabled","toBoolAttrIfDefined","onClick","e","stopPropagation","toggle","finally","title","hasSlot","icon","name","annotation","annot","suffix","arrow","content","aria-hidden","hidden","aria-labelledby","emmitChange"],"mappings":"wVAAA,MAAMA,EAAsB,yhTCoBfC,EAAgB,MAK5BC,YAAAC,+FAYkD,qHAqBb,sBAI8B,sBAID,mBAIH,MA5C9DC,KAAKC,EAAIC,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AEmD,QAAQ,SACfnD,EAAA,OAAA,CAAMgC,MAAOxB,EAAmB4C,MAC/BpD,EAAA,OAAA,CAAMqD,KAAK,UAIbrD,EAAA,OAAA,CAAMgC,MAAOxB,EAAmB6C,MAC/BrD,EAAA,OAAA,CAAMgC,MAAOxB,EAAmBgB,OAAQA,GACvCzB,KAAKuD,YAActD,EAAA,OAAA,CAAMgC,MAAOxB,EAAmB+C,OAAQxD,KAAKuD,aAGjEvD,KAAKC,EAAEmD,QAAQ,WACfnD,EAAA,OAAA,CAAMgC,MAAOxB,EAAmBgD,QAC/BxD,EAAA,OAAA,CAAMqD,KAAK,aAKdrD,EAAA,WAAA,CAAUgC,MAAOxB,EAAmBiD,MAAOJ,KAAK,kBAEjDrD,EAAA,MAAA,CACCgC,MAAOxB,EAAmBkD,QAC1BrB,GAAIhC,EAASsD,cACAnB,GAAetB,GAC5B0C,QAAS1C,EAAe2C,kBACP1D,GACjBH,EAAA,OAAA,QAUJH,aACCE,KAAKmB,gBAAkB,KACvBnB,KAAK+D,cAONjE,cACCE,KAAKmB,gBAAkB,MACvBnB,KAAK+D,cAONjE,eACCE,KAAKmB,iBAAmBnB,KAAKmB,gBAC7BnB,KAAK+D,cAONjE,qBACC,OAAOE,KAAKmB","sourcesContent":["/*\n * Accordion - Item\n */\n\n$class: \".gov-accordion-item\";\n\n#{$class} {\n\t@include base();\n\t&__header {\n\t\t@include button-core();\n\t\t@include focus-outline();\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t\ttext-transform: none;\n\t\ttransition: background-color $t ease-in-out;\n\t\t&::before {\n\t\t\t@include pseudo();\n\t\t\tright: 0;\n\t\t\tbottom: -1px;\n\t\t\tleft: 0;\n\t\t\theight: 1px;\n\t\t}\n\n\t\t// STATES\n\t\t&:focus-visible {\n\t\t\t&::before {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"aria-expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__arrow {\n\t\t\t\t\ttransform: scale(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\talign-self: center;\n\t}\n\t&__icon {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t}\n\t&__suffix {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t\talign-self: start;\n\t\tmargin-left: auto;\n\t\tline-height: initial;\n\t}\n\t&__title {\n\t\t@include general;\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\talign-items: flex-start;\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t&__annot {\n\t\tcolor: color(\"secondary\");\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $accordion-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tgap: get(\"headline-gap\", $definitions);\n\t\t\t\t\tmin-height: get(\"min-height\", $definitions);\n\t\t\t\t\tpadding: get(\"padding-y\", $definitions) get(\"padding-x\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__arrow {\n\t\t\t\t\twidth: get(\"icon-size\", $definitions);\n\t\t\t\t\theight: get(\"icon-size\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__icon {\n\t\t\t\t\twidth: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\theight: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\ttransform: translateY(get(\"icon-position\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__title {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tgap: get(\"headline-gap\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__annot {\n\t\t\t\t\t@include typography(get(\"font-annot\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tpadding: get(\"padding-inner\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $accordion-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tbackground-color: get(\"background\", $definitions);\n\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t&::before {\n\t\t\t\t\t\tbackground-color: get(\"separator\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tbackground-color: get(\"background-hover\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"disabled\") {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__header {\n\t\t\t\t\t\tcolor: get(\"disabled-color\", $definitions);\n\t\t\t\t\t\t@include hover() {\n\t\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\t\tcursor: not-allowed;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($until: md) {\n\t\t&__title {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t&__label {\n\t\t\tflex: 0 0 auto;\n\t\t\t// max-width: calc(100% - 50px);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Prop, State, Watch, Host, Method, Event, EventEmitter } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tAccordionSizeType,\n\tAccordionSizes,\n\tAccordionItemClass,\n\tAccordionVariantType,\n\tAccordionVariants,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovAccordionItemChangeEvent } from \"./gov-accordion-item.d\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-accordion-item\",\n\tstyleUrl: \"gov-accordion-item.scss\",\n})\nexport class GovAccordionItem {\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovAccordionItem\")\n\t\tthis.contentId = createID(\"GovAccordionContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() isExpandedState: boolean\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: AccordionVariantType = \"primary\"\n\t/**\n\t * Custom accordion item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop() readonly size?: AccordionSizeType\n\t/**\n\t * Item name of the accordion\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Item annotation of the accordion\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by default\n\t */\n\t@Prop({ attribute: \"is-expanded\" }) readonly isExpanded: boolean = false\n\t/**\n\t * Used to change the HTML tag in the accordion trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: \"trigger-tag\" }) readonly triggerTag: string = \"h3\"\n\t/**\n\t * To remove the main underline of an item\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<GovAccordionItemChangeEvent>\n\n\t@Watch(\"label\")\n\tvalidateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${AccordionItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch(\"triggerTag\")\n\tvalidateTriggerTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"span\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${AccordionItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(AccordionVariants, newValue, AccordionItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ open: this.isExpandedState, element: this.host })\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.isExpandedState = this.isExpanded\n\t\tthis.validateSize(this.size)\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.triggerTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\t\tconst { isExpandedState, label } = this\n\t\tconst TriggerTag = this.triggerTag\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AccordionItemClass.root)} no-border={this.noBorder} role=\"listitem\">\n\t\t\t\t<button\n\t\t\t\t\tid={triggerId}\n\t\t\t\t\tclass={AccordionItemClass.header}\n\t\t\t\t\taria-expanded={booleanString(isExpandedState)}\n\t\t\t\t\taria-controls={contentId}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tthis.toggle().finally()\n\t\t\t\t\t}}>\n\t\t\t\t\t<TriggerTag class={AccordionItemClass.title}>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={AccordionItemClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<span class={AccordionItemClass.name}>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.label}>{label}</span>\n\t\t\t\t\t\t\t{this.annotation && <span class={AccordionItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t{this.h.hasSlot(\"suffix\") && (\n\t\t\t\t\t\t\t<span class={AccordionItemClass.suffix}>\n\t\t\t\t\t\t\t\t<slot name=\"suffix\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</TriggerTag>\n\n\t\t\t\t\t<gov-icon class={AccordionItemClass.arrow} name=\"chevron-down\"></gov-icon>\n\t\t\t\t</button>\n\t\t\t\t<div\n\t\t\t\t\tclass={AccordionItemClass.content}\n\t\t\t\t\tid={contentId}\n\t\t\t\t\taria-hidden={booleanString(!isExpandedState)}\n\t\t\t\t\thidden={!isExpandedState}\n\t\t\t\t\taria-labelledby={triggerId}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Opening the accordion\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpandedState = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the accordion\n\t */\n\t@Method()\n\tasync close(): Promise<void> {\n\t\tthis.isExpandedState = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.isExpandedState = !this.isExpandedState\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.isExpandedState\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.scss?tag=gov-form-radio","../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"names":["govFormRadioCss","GovFormRadio","[object Object]","hostRef","this","radioId","createID","h","govHost","host","f","govForm","newValue","isChecked","govChange","emit","checked","value","validateProp","FormRadioSizes","FormRadioClass","root","passAttrToControl","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","wrapCheckbox","children","noLabel","Host","class","is-checked","size","invalid","toBoolAttrIfDefined","holder","Fragment","input","id","type","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","aria-checked","aria-required","aria-invalid","aria-describedby","wcagDescribedBy","aria-labelledby","wcagLabelledBy","aria-disabled","disabled","e","stopPropagation","govFocus","govBlur","target","validateWcagRef","validateWcagLabelFor"],"mappings":"oiBAAA,MAAMA,EAAkB,q7OCmBXC,EAAY,MAMxBC,YAAAC,2JAe6D,mBAIR,oBAKhB,4DAaQ,2IApC5CC,KAAKC,QAAUC,EAAS,YAExBF,KAAKG,EAAIC,EAAQJ,KAAKK,MACtBL,KAAKM,EAAIC,EAAQP,KAAKG,GAkEvBL,mBAAmBU,GAClBR,KAAKS,UAAYD,EACjBR,KAAKU,UAAUC,KAAK,CACnBC,QAASZ,KAAKS,UACdI,MAAOb,KAAKa,QAKdf,aAAaU,GACZM,EAAaC,EAAgBP,EAAUQ,EAAeC,MAGvDnB,oBACCE,KAAKS,UAAYT,KAAKY,QAEtBZ,KAAKM,EAAEY,kBAAkB,OAAQ,SAGlCpB,2BACCE,KAAKM,EAAEa,gBAAgB,aAAcnB,KAAKoB,YAAcpB,KAAKC,SAC7DD,KAAKM,EAAEa,gBAAgB,WAAYE,OAAOrB,KAAKsB,WAC/C,GAAIC,IAA2B,OACxBC,EAAM,WACNxB,KAAKyB,gBAIb3B,SACC,MAAMW,UAAEA,GAAcT,KACtB,MAA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AAeC,MAC1E+C,EAAgBhE,KAAKwD,eAAgB,mBAAoBxC,EAAeC,MACxEgD,EAAqBjE,KAAKoB,YAAcpB,KAAKC,QAASD,KAAKwD,eAAgBxC,EAAeC","sourcesContent":["/*\n * Radio\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-radio\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t&::after {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: $form-radio-indicator-bg;\n\t\t\topacity: 0;\n\t\t\ttransition: $t linear opacity;\n\t\t}\n\t}\n\n\t// STATES\n\tinput:checked + span::after {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput + span::after {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::after {\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\tinput + span::after {\n\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\twidth: get(\"dot-size\", $definitions);\n\t\t\t\theight: get(\"dot-size\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Host, h, Prop, State, Event, EventEmitter, Element, Watch, Method } from '@stencil/core'\nimport { createID } from '../../../utils/string.utils'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { FormRadioClass, FormRadioSizes, FormRadioSizesType } from './constants'\nimport { toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { delay } from '../../../utils/utils'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { govForm } from '../../../helpers/Dom/form'\nimport { GovFormRadioChangeEvent } from './interfaces'\nimport Fragment from \"../../../helpers/Fragment\"\n\n@Component({\n\ttag: 'gov-form-radio',\n\tstyleUrl: 'gov-form-radio.scss',\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\n\tprivate readonly radioId: string\n\n\tconstructor() {\n\t\tthis.radioId = createID('GovRadio')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Radio default state\n\t */\n\t@Prop({ reflect: true }) readonly checked: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = 'm'\n\t/**\n\t * Custom radio identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the radio has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovFormRadioChangeEvent>\n\n\t@State() isChecked: boolean\n\n\t@Watch('checked')\n\tupdateCheckedState(newValue: boolean): void {\n\t\tthis.isChecked = newValue\n\t\tthis.govChange.emit({\n\t\t\tchecked: this.isChecked,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.isChecked = this.checked\n\n\t\tthis.f.passAttrToControl('type', 'radio')\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel('identifier', this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { isChecked } = this\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} is-checked={isChecked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormRadioClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tchecked={this.isChecked}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.isChecked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.isChecked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tchecked: this.isChecked,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormRadioClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormRadioClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.radioId, this.wcagLabelledBy, FormRadioClass.root)\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/components/gov-promp/gov-prompt.scss?tag=gov-prompt","../../../packages/core/src/components/gov-promp/gov-prompt.tsx"],"names":["govPromptCss","GovPrompt","[object Object]","hostRef","this","h","govHost","host","labelId","createID","contentId","newValue","validTags","includes","govErrorLog","ModalClass","root","modalVisible","document","body","classList","add","bodyFix","remove","showModal","hideModal","open","canValidateWcagOnRender","delay","validateWcag","LabelTag","labelTag","Host","class","classes","rootPrompt","dialog","hidden","tabindex","aria-modal","aria-hidden","toBoolAttr","aria-labelledby","wcaglabelledBy","aria-describedby","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","wcagCloseLabel","wcagLabelledBy","wcagCloseLabelledBy","type","on-gov-click","onCloseHandler","bind","content","actions","visible","wcag-label","wcag-labelled-by","e","stopPropagation","govClose","emit","validateWcagRef"],"mappings":"mUAAA,MAAMA,EAAe,s1FCeRC,EAAS,MAKrBC,YAAAC,2DAUe,qCAQqB,uBAI0B,qJAsBtC,MA3CvBC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,kBACxBL,KAAKM,UAAYD,EAAS,oBA4C3BP,iBAAiBS,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,uBAM5CT,UAAUS,GACTP,KAAKa,aAAeN,EA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OlB,EAAWkD,QAASX,GAAIlD,KAAKM,WACxCL,EAAA,OAAA,OAEDA,EAAA,MAAA,CAAK4B,MAAOlB,EAAWmD,SACtB7D,EAAA,OAAA,CAAM8C,KAAK,eAKd9C,EAAA,eAAA,CACC8D,QAAS/D,KAAKa,aAAYmD,aACdhE,KAAKsD,eAAcW,mBACbjE,KAAKwD,oBAAmBE,eAC5B1D,KAAK2D,eAAeC,KAAK5D,SAMnCF,eAAeoE,GACtBA,EAAEC,kBACFnE,KAAKqB,YACLrB,KAAKoE,SAASC,KAAKH,GAOpBpE,aACCE,KAAKoB,YAONtB,aACCE,KAAKqB,YAONvB,qBACCwE,EAAgBtE,KAAKuC,eAAgB,kBAAmB5B,EAAWC,MACnE0D,EAAgBtE,KAAKyC,gBAAiB,mBAAoB9B,EAAWC","sourcesContent":["/*\n * Prompt\n */\n\n// $class: \".gov-prompt\";\n@import \"../gov-modal/gov-modal.scss\";\n\n// #{$class} {\n// \t//\n// }\n","import { Component, Event, Element, EventEmitter, h, Host, Method, Prop, Watch, State } from \"@stencil/core\"\nimport { createID } from '../../utils/string.utils'\nimport { validateWcagRef } from '../../helpers/Validate/wcag'\nimport { ModalClass } from '../gov-modal/constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { toBoolAttr } from '../../helpers/Dom/template'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\n\n@Component({\n\ttag: 'gov-prompt',\n\tstyleUrl: 'gov-prompt.scss',\n})\nexport class GovPrompt {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovPromptLabel')\n\t\tthis.contentId = createID('GovPromptContent')\n\t}\n\n\t@Element() host: HTMLGovPromptElement\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop() open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({ attribute: 'role' }) role = 'dialog'\n\t/**\n\t * Used to change the HMTL tag in the modal label for correct semantic structure\n\t */\n\t@Prop({ attribute: 'label-tag' }) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) wcaglabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-close-label' }) wcagCloseLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({ attribute: 'wcag-close-labelled-by' }) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({ eventName: 'gov-close' }) govClose: EventEmitter<PointerEvent>\n\n\t@State() modalVisible = false\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"open\")\n\twatchOpen(newValue: boolean): void {\n\t\tthis.modalVisible = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.modalVisible = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.modalVisible = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.modalVisible) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.modalVisible = this.open\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 LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.rootPrompt)} open={this.modalVisible}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.modalVisible}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.modalVisible}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.modalVisible)}\n\t\t\t\t\taria-labelledby={this.wcaglabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\" />\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.actions}>\n\t\t\t\t\t\t\t<slot name=\"actions\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t<gov-backdrop\n\t\t\t\t\tvisible={this.modalVisible}\n\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t/>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hidding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\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.wcaglabelledBy, 'aria-labelledby', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'aria-describedby', ModalClass.root)\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"names":["govFormCheckboxCss","GovFormCheckbox","[object Object]","hostRef","this","checkboxId","createID","h","govHost","host","f","govForm","newValue","isChecked","govChange","emit","checked","value","validateProp","FormCheckboxSizes","FormCheckboxClass","root","passAttrToControl","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","wrapCheckbox","children","noLabel","Host","class","is-checked","size","invalid","toBoolAttrIfDefined","Fragment","id","type","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","aria-checked","toBoolAttr","aria-required","aria-invalid","aria-describedby","wcagDescribedBy","aria-labelledby","wcagLabelledBy","aria-disabled","disabled","check","e","stopPropagation","govFocus","govBlur","target","validateWcagRef","validateWcagLabelFor"],"mappings":"siBAAA,MAAMA,EAAqB,40PCmBdC,EAAe,MAM3BC,YAAAC,2JAeqD,oBAKhB,4DAaW,2CAQa,mHAxC5DC,KAAKC,WAAaC,EAAS,eAE3BF,KAAKG,EAAIC,EAAQJ,KAAKK,MACtBL,KAAKM,EAAIC,EAAQP,KAAKG,GAkEvBL,mBAAmBU,GAClBR,KAAKS,UAAYD,EACjBR,KAAKU,UAAUC,KAAK,CACnBC,QAASZ,KAAKS,UACdI,MAAOb,KAAKa,QAKdf,aAAaU,GACZM,EAAaC,EAAmBP,EAAUQ,EAAkBC,MAG7DnB,oBACCE,KAAKS,UAAYT,KAAKY,QAEtBZ,KAAKM,EAAEY,kBAAkB,OAAQ,YAGlCpB,2BACCE,KAAKM,EAAEa,gBAAgB,aAAcnB,KAAKoB,YAAcpB,KAAKC,YAC7DD,KAAKM,EAAEa,gBAAgB,WAAYE,OAAOrB,KAAKsB,WAC/C,GAAIC,IAA2B,OACxBC,EAAM,WACNxB,KAAKyB,gBAIb3B,SACC,MAAMW,UAAEA,GAAcT,KACtB,MAAM0B,EAAgBC,IACrB,GAAI3B,KAAK4B,QAAS,CACjB,OACCzB,EAAA,QAAA,KACEwB,GAIJ,OAAOA,GAGR,OACCxB,EAAC0B,EAAI,CAACC,MAAOd,EAAkBC,KAAIc,aAActB,EAAWuB,KAAMhC,KAAKgC,KAAMC,QAASC,EAAoBlC,KAAKiC,UAC7GP,EACAvB,EAACgC,EAAQ,KACRhC,EAAA,QAAA,CACCiC,GAAIpC,KAAKoB,YAAcpB,KAAKC,WAC5BoC,KAAK,WACLxB,MAAOb,KAAKa,MACZyB,KAAMtC,KAAKsC,KACX1B,QAASZ,KAAKS,UACd8B,QAASvC,KAAKwC,eAAeC,KAAKzC,MAClC0C,SAAU1C,KAAK2C,gBAAgBF,KAAKzC,MACpC4C,QAAS5C,KAAK6C,eAAeJ,KAAKzC,MAClC8C,OAAQ9C,KAAK+C,cAAcN,KAAKzC,MAChCsB,SAAUtB,KAAKsB,SAAQ0B,eACTC,EAAWjD,KAAKS,WAAUyC,gBACzBhB,EAAoBlC,KAAKsB,UAAS6B,eACnCjB,EAAoBlC,KAAKiC,SAAQmB,mBAC7BpD,KAAKqD,gBAAeC,kBACrBtD,KAAKuD,eAAcC,gBACrBtB,EAAoBlC,KAAKyD,YAEzCtD,EAAA,OAAA,KACCA,EAAA,OAAA,CAAMmC,KAAK,UACXnC,EAAA,WAAA,CAAU2B,MAAOd,EAAkB0C,MAAOpB,KAAK,iBAQ7CxC,eAAe6D,GACtBA,EAAEC,kBACF5D,KAAK6D,SAASlD,KAAKgD,GAGZ7D,cAAc6D,GACrBA,EAAEC,kBACF5D,KAAK8D,QAAQnD,KAAKgD,GAGX7D,eAAe6D,GACtBA,EAAEC,kBAGK9D,gBAAgB6D,GACvB3D,KAAKS,UAAakD,EAAEI,OAA4BnD,QAChD+C,EAAEC,kBACF5D,KAAKU,UAAUC,KAAK,CACnBC,QAASZ,KAAKS,UACdI,MAAOb,KAAKa,QAQdf,qBACCkE,EAAgBhE,KAAKqD,gBAAiB,oBAAqBrC,EAAkBC,MAC7E+C,EAAgBhE,KAAKuD,eAAgB,mBAAoBvC,EAAkBC,MAC3EgD,EAAqBjE,KAAKoB,YAAcpB,KAAKC,WAAYD,KAAKuD,eAAgBvC,EAAkBC","sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: $border-radius;\n\t\t}\n\t}\n\t&__check {\n\t\tposition: absolute;\n\t\tcolor: $form-checkbox-check-color;\n\t\topacity: 0;\n\t\ttransition: $t linear opacity;\n\t}\n\n\t// STATES\n\tinput:checked + span::before {\n\t\tbackground: $form-checkbox-indicator-bg;\n\t}\n\tinput:checked + span &__check {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput:checked + span::before {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::before {\n\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__check {\n\t\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\twidth: get(\"check-size\", $definitions);\n\t\t\t\t\theight: get(\"check-size\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Host, h, Prop, State, Event, EventEmitter, Element, Watch, Method } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType } from \"./constants\"\nimport { toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovFormCheckboxChangeEvent } from \"./interfaces\"\nimport Fragment from \"../../../helpers/Fragment\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox default state\n\t */\n\t@Prop({ reflect: true }) readonly checked: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkbox's size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<GovFormCheckboxChangeEvent>\n\n\t@State() isChecked: boolean\n\n\t@Watch(\"checked\")\n\tupdateCheckedState(newValue: boolean): void {\n\t\tthis.isChecked = newValue\n\t\tthis.govChange.emit({\n\t\t\tchecked: this.isChecked,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.isChecked = this.checked\n\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel('identifier', this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst { isChecked } = this\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} is-checked={isChecked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.isChecked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.isChecked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.isChecked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tchecked: this.isChecked,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"]}
@@ -1,4 +0,0 @@
1
- export interface GovAccordionItemChangeEvent {
2
- open: boolean;
3
- element: HTMLGovAccordionItemElement;
4
- }
@@ -1,4 +0,0 @@
1
- export interface GovFormCheckboxChangeEvent {
2
- checked: boolean;
3
- value: string;
4
- }
@@ -1,4 +0,0 @@
1
- export interface GovFormMultiSelectItem {
2
- name: string;
3
- value: string;
4
- }
@@ -1,4 +0,0 @@
1
- export interface GovFormRadioChangeEvent {
2
- checked: boolean;
3
- value: string;
4
- }
@@ -1,4 +0,0 @@
1
- export interface GovFormSwitchChangeEvent {
2
- checked: boolean;
3
- value: string;
4
- }