@gov-design-system-ce/components 4.0.6 → 4.0.8-rc01

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 (504) hide show
  1. package/dist/cjs/array.utils-5a024b3a.js +46 -0
  2. package/dist/cjs/array.utils-5a024b3a.js.map +1 -0
  3. package/dist/cjs/core.cjs.js +1 -1
  4. package/dist/cjs/{form-74063d50.js → form-47b5ef29.js} +2 -2
  5. package/dist/cjs/form-47b5ef29.js.map +1 -0
  6. package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
  7. package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
  8. package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
  9. package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
  10. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +26 -3
  11. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-button.cjs.entry.js +7 -4
  13. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-card.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-chip.cjs.entry.js +2 -2
  16. package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
  17. package/dist/cjs/gov-container.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
  19. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  20. package/dist/cjs/gov-dropdown.cjs.entry.js +1 -1
  21. package/dist/cjs/gov-empty.cjs.entry.js +1 -1
  22. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  23. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
  24. package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
  25. package/dist/cjs/gov-form-control.cjs.entry.js +2 -2
  26. package/dist/cjs/gov-form-file.cjs.entry.js +17 -5
  27. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-form-group.cjs.entry.js +1 -1
  29. package/dist/cjs/gov-form-input.cjs.entry.js +6 -2
  30. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-form-multi-select.cjs.entry.js +83 -102
  32. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  33. package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
  34. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  35. package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
  36. package/dist/cjs/gov-form-select.cjs.entry.js +15 -19
  37. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
  39. package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
  40. package/dist/cjs/gov-grid.cjs.entry.js +1 -1
  41. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  42. package/dist/cjs/gov-infobar.cjs.entry.js +3 -2
  43. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  44. package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
  45. package/dist/cjs/gov-layout.cjs.entry.js +1 -1
  46. package/dist/cjs/gov-loading.cjs.entry.js +1 -1
  47. package/dist/cjs/gov-message.cjs.entry.js +1 -1
  48. package/dist/cjs/gov-modal.cjs.entry.js +5 -2
  49. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  50. package/dist/cjs/gov-pagination.cjs.entry.js +9 -11
  51. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  52. package/dist/cjs/gov-prompt.cjs.entry.js +5 -2
  53. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  54. package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
  55. package/dist/cjs/gov-side-nav.cjs.entry.js +1 -1
  56. package/dist/cjs/gov-skeleton.cjs.entry.js +1 -1
  57. package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
  58. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  59. package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
  60. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  61. package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
  62. package/dist/cjs/gov-tabs-item.cjs.entry.js +1 -1
  63. package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
  64. package/dist/cjs/gov-tag.cjs.entry.js +2 -2
  65. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
  66. package/dist/cjs/gov-tile.cjs.entry.js +3 -3
  67. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  68. package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
  69. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  70. package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
  71. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  72. package/dist/cjs/gov-tooltip.cjs.entry.js +8 -9
  73. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  74. package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
  75. package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
  76. package/dist/cjs/loader.cjs.js +1 -1
  77. package/dist/cjs/stencil.utils-22814956.js +11 -0
  78. package/dist/cjs/stencil.utils-22814956.js.map +1 -0
  79. package/dist/cjs/{template-4b951d1d.js → template-9534c584.js} +5 -1
  80. package/dist/cjs/template-9534c584.js.map +1 -0
  81. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +58 -16
  82. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +48 -1
  83. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  84. package/dist/collection/components/gov-button/button/gov-button.css +1 -1
  85. package/dist/collection/components/gov-button/button/gov-button.js +13 -16
  86. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
  87. package/dist/collection/components/gov-chip/gov-chip.css +2 -6
  88. package/dist/collection/components/gov-form/file/gov-form-file.js +51 -3
  89. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  90. package/dist/collection/components/gov-form/input/gov-form-input.js +18 -0
  91. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  92. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +134 -253
  93. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  94. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -1
  95. package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
  96. package/dist/collection/components/gov-form/select/constants.js +1 -1
  97. package/dist/collection/components/gov-form/select/constants.js.map +1 -1
  98. package/dist/collection/components/gov-form/select/gov-form-select.js +40 -64
  99. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  100. package/dist/collection/components/gov-form/select/gov-form-select.types.js.map +1 -1
  101. package/dist/collection/components/gov-infobar/gov-infobar.js +25 -1
  102. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
  103. package/dist/collection/components/gov-modal/gov-modal.js +6 -3
  104. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  105. package/dist/collection/components/gov-pagination/gov-pagination.js +80 -5
  106. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  107. package/dist/collection/components/gov-promp/gov-prompt.js +4 -1
  108. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  109. package/dist/collection/components/gov-tag/gov-tag.css +5 -100
  110. package/dist/collection/components/gov-tile/gov-tile.css +3 -5
  111. package/dist/collection/components/gov-tile/gov-tile.js +1 -1
  112. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  113. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +2 -1
  114. package/dist/collection/components/gov-tooltip/gov-tooltip.js +7 -8
  115. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  116. package/dist/collection/helpers/Dom/template.js +3 -0
  117. package/dist/collection/helpers/Dom/template.js.map +1 -1
  118. package/dist/collection/pages/Breadcrumbs.js +3 -2
  119. package/dist/collection/pages/Breadcrumbs.js.map +1 -1
  120. package/dist/collection/pages/Button.js +101 -101
  121. package/dist/collection/pages/Button.js.map +1 -1
  122. package/dist/collection/pages/Chip.js +50 -50
  123. package/dist/collection/pages/Chip.js.map +1 -1
  124. package/dist/collection/pages/Forms.js +27 -17
  125. package/dist/collection/pages/Forms.js.map +1 -1
  126. package/dist/collection/pages/Tag.js +27 -27
  127. package/dist/collection/pages/Tag.js.map +1 -1
  128. package/dist/collection/pages/Tooltip.js +13 -16
  129. package/dist/collection/pages/Tooltip.js.map +1 -1
  130. package/dist/collection/utils/array.utils.js +14 -0
  131. package/dist/collection/utils/array.utils.js.map +1 -1
  132. package/dist/collection/utils/object.utils.js +18 -0
  133. package/dist/collection/utils/object.utils.js.map +1 -0
  134. package/dist/collection/utils/stencil.utils.js +6 -0
  135. package/dist/collection/utils/stencil.utils.js.map +1 -0
  136. package/dist/components/gov-accordion-item.js +1 -1
  137. package/dist/components/gov-accordion.js +1 -1
  138. package/dist/components/gov-attachments-item.js +1 -1
  139. package/dist/components/gov-attachments.js +1 -1
  140. package/dist/components/gov-backdrop.js +1 -1
  141. package/dist/components/gov-breadcrumbs.js +1 -1
  142. package/dist/components/gov-breadcrumbs.js.map +1 -1
  143. package/dist/components/gov-button.js +1 -1
  144. package/dist/components/gov-card.js +1 -1
  145. package/dist/components/gov-chip.js +1 -1
  146. package/dist/components/gov-container.js +1 -1
  147. package/dist/components/gov-control-group.js +1 -1
  148. package/dist/components/gov-cookiebar.js +1 -1
  149. package/dist/components/gov-dropdown.js +1 -1
  150. package/dist/components/gov-empty.js +1 -1
  151. package/dist/components/gov-error-code.js +1 -1
  152. package/dist/components/gov-form-autocomplete.js +1 -1
  153. package/dist/components/gov-form-checkbox.js +1 -1
  154. package/dist/components/gov-form-control.js +1 -1
  155. package/dist/components/gov-form-file.js +1 -1
  156. package/dist/components/gov-form-file.js.map +1 -1
  157. package/dist/components/gov-form-group.js +1 -1
  158. package/dist/components/gov-form-input.js +1 -1
  159. package/dist/components/gov-form-message.js +1 -1
  160. package/dist/components/gov-form-multi-select.js +1 -1
  161. package/dist/components/gov-form-multi-select.js.map +1 -1
  162. package/dist/components/gov-form-radio.js +1 -1
  163. package/dist/components/gov-form-search.js +1 -1
  164. package/dist/components/gov-form-search.js.map +1 -1
  165. package/dist/components/gov-form-select.js +1 -1
  166. package/dist/components/gov-form-switch.js +1 -1
  167. package/dist/components/gov-grid-item.js +1 -1
  168. package/dist/components/gov-grid.js +1 -1
  169. package/dist/components/gov-icon.js +1 -1
  170. package/dist/components/gov-infobar.js +1 -1
  171. package/dist/components/gov-infobar.js.map +1 -1
  172. package/dist/components/gov-layout-column.js +1 -1
  173. package/dist/components/gov-layout.js +1 -1
  174. package/dist/components/gov-loading.js +1 -1
  175. package/dist/components/gov-message.js +1 -1
  176. package/dist/components/gov-modal.js +1 -1
  177. package/dist/components/gov-modal.js.map +1 -1
  178. package/dist/components/gov-pagination.js +1 -1
  179. package/dist/components/gov-pagination.js.map +1 -1
  180. package/dist/components/gov-prompt.js +1 -1
  181. package/dist/components/gov-prompt.js.map +1 -1
  182. package/dist/components/gov-side-nav-item.js +1 -1
  183. package/dist/components/gov-side-nav.js +1 -1
  184. package/dist/components/gov-side-nav.js.map +1 -1
  185. package/dist/components/gov-skeleton.js +1 -1
  186. package/dist/components/gov-skeleton.js.map +1 -1
  187. package/dist/components/gov-spacer.js +1 -1
  188. package/dist/components/gov-statsbar-item.js +1 -1
  189. package/dist/components/gov-statsbar.js +1 -1
  190. package/dist/components/gov-stepper-item.js +1 -1
  191. package/dist/components/gov-stepper.js +1 -1
  192. package/dist/components/gov-tabs-item.js +1 -1
  193. package/dist/components/gov-tabs.js +1 -1
  194. package/dist/components/gov-tag.js +1 -1
  195. package/dist/components/gov-tag.js.map +1 -1
  196. package/dist/components/gov-tile.js +1 -1
  197. package/dist/components/gov-tile.js.map +1 -1
  198. package/dist/components/gov-tiles.js +1 -1
  199. package/dist/components/gov-toast.js +1 -1
  200. package/dist/components/gov-tooltip-content.js +1 -1
  201. package/dist/components/gov-tooltip-content.js.map +1 -1
  202. package/dist/components/gov-tooltip.js +1 -1
  203. package/dist/components/gov-tooltip.js.map +1 -1
  204. package/dist/components/gov-wizard-item.js +1 -1
  205. package/dist/components/gov-wizard.js +1 -1
  206. package/dist/components/{p-b526e440.js → p-033f8bda.js} +2 -2
  207. package/dist/components/{p-ec6c2272.js → p-23990b41.js} +2 -2
  208. package/dist/components/{p-62074db5.js → p-26805569.js} +2 -2
  209. package/dist/components/p-2dee9951.js.map +1 -1
  210. package/dist/components/p-6c1d0f47.js +2 -0
  211. package/dist/components/p-6c1d0f47.js.map +1 -0
  212. package/dist/components/p-a6a15eb1.js +2 -0
  213. package/dist/components/p-a6a15eb1.js.map +1 -0
  214. package/dist/components/p-b48d3aae.js +2 -0
  215. package/dist/components/p-b48d3aae.js.map +1 -0
  216. package/dist/components/{p-990d2990.js → p-b5a06a0a.js} +2 -2
  217. package/dist/components/p-b5a06a0a.js.map +1 -0
  218. package/dist/components/{p-9795ad94.js → p-b9ee51d6.js} +2 -2
  219. package/dist/components/{p-28e59384.js → p-c353678b.js} +2 -2
  220. package/dist/components/p-c353678b.js.map +1 -0
  221. package/dist/components/p-c9baa62f.js +2 -0
  222. package/dist/components/p-c9baa62f.js.map +1 -0
  223. package/dist/components/{p-d29431c0.js → p-e2bee1ef.js} +2 -2
  224. package/dist/components/p-e2bee1ef.js.map +1 -0
  225. package/dist/components/{p-570803ab.js → p-f8b7ea69.js} +2 -2
  226. package/dist/components/p-f9f8e529.js +2 -0
  227. package/dist/components/{p-6f391c4a.js.map → p-f9f8e529.js.map} +1 -1
  228. package/dist/core/core.css +1 -1
  229. package/dist/core/core.esm.js +1 -1
  230. package/dist/core/core.esm.js.map +1 -1
  231. package/dist/core/{p-96d141a3.entry.js → p-0028fadc.entry.js} +2 -2
  232. package/dist/core/{p-2969eb69.entry.js → p-0ab12526.entry.js} +2 -2
  233. package/dist/core/{p-22abe742.entry.js → p-0c5c6dee.entry.js} +2 -2
  234. package/dist/core/{p-1116fec6.entry.js → p-127af1b4.entry.js} +2 -2
  235. package/dist/core/{p-fb51d693.entry.js → p-151f1b89.entry.js} +2 -2
  236. package/dist/core/{p-fd4b0f54.entry.js → p-191e9b0c.entry.js} +2 -2
  237. package/dist/core/p-1cbd2c7c.entry.js +2 -0
  238. package/dist/core/p-1cbd2c7c.entry.js.map +1 -0
  239. package/dist/core/{p-fc8a29e9.entry.js → p-2a13c39c.entry.js} +2 -2
  240. package/dist/core/{p-6dc942b8.entry.js → p-2d1f3d62.entry.js} +2 -2
  241. package/dist/core/p-2d1f3d62.entry.js.map +1 -0
  242. package/dist/core/p-30673e46.entry.js +2 -0
  243. package/dist/core/p-30673e46.entry.js.map +1 -0
  244. package/dist/core/{p-de3429ab.entry.js → p-3975851f.entry.js} +2 -2
  245. package/dist/core/{p-141d9af4.entry.js → p-4988c0bb.entry.js} +2 -2
  246. package/dist/core/p-4b4a270d.entry.js +2 -0
  247. package/dist/core/p-4b4a270d.entry.js.map +1 -0
  248. package/dist/core/{p-83e998d8.entry.js → p-529ce9a4.entry.js} +2 -2
  249. package/dist/core/{p-fc2a1e14.entry.js → p-53e0ad52.entry.js} +2 -2
  250. package/dist/core/{p-81593c86.entry.js → p-54fa7af5.entry.js} +2 -2
  251. package/dist/core/{p-41c18f64.entry.js → p-555eaa93.entry.js} +2 -2
  252. package/dist/core/{p-e24236b0.entry.js → p-55cb727e.entry.js} +2 -2
  253. package/dist/core/p-575d0c94.entry.js +2 -0
  254. package/dist/core/p-575d0c94.entry.js.map +1 -0
  255. package/dist/core/p-5bc604a3.js.map +1 -1
  256. package/dist/core/{p-28e59384.js → p-5de606f8.js} +2 -2
  257. package/dist/core/p-5de606f8.js.map +1 -0
  258. package/dist/core/{p-3c12c766.entry.js → p-60d681a6.entry.js} +2 -2
  259. package/dist/core/{p-b4a59c79.entry.js → p-64c5748e.entry.js} +2 -2
  260. package/dist/core/p-64c5748e.entry.js.map +1 -0
  261. package/dist/core/p-67096d72.entry.js +2 -0
  262. package/dist/core/p-67096d72.entry.js.map +1 -0
  263. package/dist/core/{p-b49293dc.entry.js → p-6bf8e7bf.entry.js} +2 -2
  264. package/dist/core/{p-89b3e4d4.entry.js → p-72c5997f.entry.js} +2 -2
  265. package/dist/core/p-7f158b6f.entry.js +2 -0
  266. package/dist/core/p-7f158b6f.entry.js.map +1 -0
  267. package/dist/core/p-831edc90.entry.js +2 -0
  268. package/dist/core/p-831edc90.entry.js.map +1 -0
  269. package/dist/core/{p-bb7f0a66.entry.js → p-8f121cad.entry.js} +2 -2
  270. package/dist/core/p-8fcc8483.js +2 -0
  271. package/dist/core/p-8fcc8483.js.map +1 -0
  272. package/dist/core/{p-01d928c5.entry.js → p-90c068ff.entry.js} +2 -2
  273. package/dist/core/{p-cf86a858.entry.js → p-927880d6.entry.js} +2 -2
  274. package/dist/core/p-927880d6.entry.js.map +1 -0
  275. package/dist/core/{p-b4ab0d15.entry.js → p-9469ecc2.entry.js} +2 -2
  276. package/dist/core/{p-f29b0193.entry.js → p-984b36f7.entry.js} +2 -2
  277. package/dist/core/p-9c04470d.entry.js +2 -0
  278. package/dist/core/p-9c04470d.entry.js.map +1 -0
  279. package/dist/core/{p-ccf73a1a.entry.js → p-a35484ed.entry.js} +2 -2
  280. package/dist/core/p-a49391e5.entry.js +2 -0
  281. package/dist/core/p-a49391e5.entry.js.map +1 -0
  282. package/dist/core/{p-b127c8a8.entry.js → p-aaf2510a.entry.js} +2 -2
  283. package/dist/core/p-aaf2510a.entry.js.map +1 -0
  284. package/dist/core/p-ab5a13ea.js +2 -0
  285. package/dist/core/p-ab5a13ea.js.map +1 -0
  286. package/dist/core/{p-b580666b.entry.js → p-adf276b0.entry.js} +2 -2
  287. package/dist/core/{p-b1184db4.entry.js → p-af9a14e3.entry.js} +2 -2
  288. package/dist/core/{p-e5c2f601.entry.js → p-b7e0b030.entry.js} +2 -2
  289. package/dist/core/{p-78942f76.entry.js → p-be8eec3f.entry.js} +2 -2
  290. package/dist/core/{p-9c6699d6.entry.js → p-c0e8802d.entry.js} +2 -2
  291. package/dist/core/p-c0e8802d.entry.js.map +1 -0
  292. package/dist/core/{p-f1227928.entry.js → p-c6a4ca41.entry.js} +2 -2
  293. package/dist/core/{p-67138ae9.entry.js → p-ce1486b8.entry.js} +2 -2
  294. package/dist/core/{p-ee4c58e3.entry.js → p-d2c370d6.entry.js} +2 -2
  295. package/dist/core/p-d513468a.entry.js +2 -0
  296. package/dist/core/p-d513468a.entry.js.map +1 -0
  297. package/dist/core/p-d784c44d.js +2 -0
  298. package/dist/core/p-d784c44d.js.map +1 -0
  299. package/dist/core/{p-ac5e5b2c.entry.js → p-dd4445ee.entry.js} +2 -2
  300. package/dist/core/{p-b7d23697.entry.js → p-dd8816aa.entry.js} +2 -2
  301. package/dist/core/p-dd8816aa.entry.js.map +1 -0
  302. package/dist/core/{p-92af05f2.entry.js → p-e4f11ddf.entry.js} +2 -2
  303. package/dist/core/{p-6675a0f0.entry.js → p-eaedc9e3.entry.js} +2 -2
  304. package/dist/core/{p-b5e1ee46.entry.js → p-ed580ac7.entry.js} +2 -2
  305. package/dist/core/p-ef387ab2.entry.js +2 -0
  306. package/dist/core/{p-f76f0a67.entry.js.map → p-ef387ab2.entry.js.map} +1 -1
  307. package/dist/core/{p-f636a1ca.entry.js → p-f2206bbb.entry.js} +2 -2
  308. package/dist/core/{p-497c90ea.entry.js → p-f4f969d0.entry.js} +2 -2
  309. package/dist/core/p-f4f969d0.entry.js.map +1 -0
  310. package/dist/core/{p-4a235ef5.entry.js → p-f59b858f.entry.js} +2 -2
  311. package/dist/core/{p-7757e4a1.entry.js → p-fc710edb.entry.js} +2 -2
  312. package/dist/esm/array.utils-b27436ea.js +43 -0
  313. package/dist/esm/array.utils-b27436ea.js.map +1 -0
  314. package/dist/esm/core.js +1 -1
  315. package/dist/esm/{form-39dc6896.js → form-e3424b70.js} +2 -2
  316. package/dist/esm/form-e3424b70.js.map +1 -0
  317. package/dist/esm/gov-accordion-item.entry.js +1 -1
  318. package/dist/esm/gov-accordion.entry.js +1 -1
  319. package/dist/esm/gov-attachments_3.entry.js +1 -1
  320. package/dist/esm/gov-backdrop.entry.js +1 -1
  321. package/dist/esm/gov-breadcrumbs.entry.js +26 -3
  322. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  323. package/dist/esm/gov-button.entry.js +7 -4
  324. package/dist/esm/gov-button.entry.js.map +1 -1
  325. package/dist/esm/gov-card.entry.js +1 -1
  326. package/dist/esm/gov-chip.entry.js +2 -2
  327. package/dist/esm/gov-chip.entry.js.map +1 -1
  328. package/dist/esm/gov-container.entry.js +1 -1
  329. package/dist/esm/gov-control-group.entry.js +1 -1
  330. package/dist/esm/gov-cookiebar.entry.js +1 -1
  331. package/dist/esm/gov-dropdown.entry.js +1 -1
  332. package/dist/esm/gov-empty.entry.js +1 -1
  333. package/dist/esm/gov-error-code.entry.js +1 -1
  334. package/dist/esm/gov-form-autocomplete.entry.js +1 -1
  335. package/dist/esm/gov-form-checkbox.entry.js +2 -2
  336. package/dist/esm/gov-form-control.entry.js +2 -2
  337. package/dist/esm/gov-form-file.entry.js +17 -5
  338. package/dist/esm/gov-form-file.entry.js.map +1 -1
  339. package/dist/esm/gov-form-group.entry.js +1 -1
  340. package/dist/esm/gov-form-input.entry.js +6 -2
  341. package/dist/esm/gov-form-input.entry.js.map +1 -1
  342. package/dist/esm/gov-form-multi-select.entry.js +83 -102
  343. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  344. package/dist/esm/gov-form-radio.entry.js +2 -2
  345. package/dist/esm/gov-form-search.entry.js +1 -1
  346. package/dist/esm/gov-form-search.entry.js.map +1 -1
  347. package/dist/esm/gov-form-select.entry.js +15 -19
  348. package/dist/esm/gov-form-select.entry.js.map +1 -1
  349. package/dist/esm/gov-form-switch.entry.js +2 -2
  350. package/dist/esm/gov-grid-item.entry.js +1 -1
  351. package/dist/esm/gov-grid.entry.js +1 -1
  352. package/dist/esm/gov-icon.entry.js +2 -2
  353. package/dist/esm/gov-infobar.entry.js +3 -2
  354. package/dist/esm/gov-infobar.entry.js.map +1 -1
  355. package/dist/esm/gov-layout-column.entry.js +1 -1
  356. package/dist/esm/gov-layout.entry.js +1 -1
  357. package/dist/esm/gov-loading.entry.js +1 -1
  358. package/dist/esm/gov-message.entry.js +1 -1
  359. package/dist/esm/gov-modal.entry.js +5 -2
  360. package/dist/esm/gov-modal.entry.js.map +1 -1
  361. package/dist/esm/gov-pagination.entry.js +9 -11
  362. package/dist/esm/gov-pagination.entry.js.map +1 -1
  363. package/dist/esm/gov-prompt.entry.js +5 -2
  364. package/dist/esm/gov-prompt.entry.js.map +1 -1
  365. package/dist/esm/gov-side-nav-item.entry.js +1 -1
  366. package/dist/esm/gov-side-nav.entry.js +1 -1
  367. package/dist/esm/gov-skeleton.entry.js +1 -1
  368. package/dist/esm/gov-spacer.entry.js +1 -1
  369. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  370. package/dist/esm/gov-statsbar.entry.js +1 -1
  371. package/dist/esm/gov-stepper-item.entry.js +1 -1
  372. package/dist/esm/gov-stepper.entry.js +1 -1
  373. package/dist/esm/gov-tabs-item.entry.js +1 -1
  374. package/dist/esm/gov-tabs.entry.js +1 -1
  375. package/dist/esm/gov-tag.entry.js +2 -2
  376. package/dist/esm/gov-tag.entry.js.map +1 -1
  377. package/dist/esm/gov-tile.entry.js +3 -3
  378. package/dist/esm/gov-tile.entry.js.map +1 -1
  379. package/dist/esm/gov-tiles.entry.js +1 -1
  380. package/dist/esm/gov-toast.entry.js +1 -1
  381. package/dist/esm/gov-tooltip-content.entry.js +2 -2
  382. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  383. package/dist/esm/gov-tooltip.entry.js +8 -9
  384. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  385. package/dist/esm/gov-wizard-item.entry.js +1 -1
  386. package/dist/esm/gov-wizard.entry.js +1 -1
  387. package/dist/esm/loader.js +1 -1
  388. package/dist/esm/stencil.utils-7cb5b075.js +9 -0
  389. package/dist/esm/stencil.utils-7cb5b075.js.map +1 -0
  390. package/dist/esm/{template-df429738.js → template-a0067bb6.js} +5 -2
  391. package/dist/esm/template-a0067bb6.js.map +1 -0
  392. package/dist/hydrate/index.js +238 -167
  393. package/dist/stencil.config.js +23 -1
  394. package/dist/stencil.config.js.map +1 -1
  395. package/dist/types/Users/iwory/iWork/asseco/mv/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
  396. package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +9 -0
  397. package/dist/types/components/gov-button/button/gov-button.d.ts +5 -4
  398. package/dist/types/components/gov-form/file/gov-form-file.d.ts +9 -0
  399. package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -0
  400. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +17 -29
  401. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +3 -2
  402. package/dist/types/components/gov-form/select/constants.d.ts +1 -1
  403. package/dist/types/components/gov-form/select/gov-form-select.d.ts +6 -9
  404. package/dist/types/components/gov-form/select/gov-form-select.types.d.ts +1 -1
  405. package/dist/types/components/gov-infobar/gov-infobar.d.ts +4 -0
  406. package/dist/types/components/gov-modal/gov-modal.d.ts +1 -0
  407. package/dist/types/components/gov-pagination/gov-pagination.d.ts +17 -1
  408. package/dist/types/components/gov-promp/gov-prompt.d.ts +1 -0
  409. package/dist/types/components/gov-tile/gov-tile.d.ts +3 -3
  410. package/dist/types/components.d.ts +100 -40
  411. package/dist/types/helpers/Dom/template.d.ts +1 -0
  412. package/dist/types/utils/array.utils.d.ts +1 -0
  413. package/dist/types/utils/object.utils.d.ts +1 -0
  414. package/dist/types/utils/stencil.utils.d.ts +1 -0
  415. package/package.json +2 -2
  416. package/dist/cjs/form-74063d50.js.map +0 -1
  417. package/dist/cjs/template-4b951d1d.js.map +0 -1
  418. package/dist/components/p-28e59384.js.map +0 -1
  419. package/dist/components/p-43554d2d.js +0 -2
  420. package/dist/components/p-43554d2d.js.map +0 -1
  421. package/dist/components/p-53e02bee.js +0 -2
  422. package/dist/components/p-53e02bee.js.map +0 -1
  423. package/dist/components/p-6f391c4a.js +0 -2
  424. package/dist/components/p-990d2990.js.map +0 -1
  425. package/dist/components/p-a3d5a7e3.js +0 -2
  426. package/dist/components/p-a3d5a7e3.js.map +0 -1
  427. package/dist/components/p-d29431c0.js.map +0 -1
  428. package/dist/core/p-044f4c35.entry.js +0 -2
  429. package/dist/core/p-044f4c35.entry.js.map +0 -1
  430. package/dist/core/p-09966eaa.entry.js +0 -2
  431. package/dist/core/p-09966eaa.entry.js.map +0 -1
  432. package/dist/core/p-0e5fa8bf.js +0 -2
  433. package/dist/core/p-0e5fa8bf.js.map +0 -1
  434. package/dist/core/p-2712444e.entry.js +0 -2
  435. package/dist/core/p-2712444e.entry.js.map +0 -1
  436. package/dist/core/p-28e59384.js.map +0 -1
  437. package/dist/core/p-2f858bf5.entry.js +0 -2
  438. package/dist/core/p-2f858bf5.entry.js.map +0 -1
  439. package/dist/core/p-3b42950e.entry.js +0 -2
  440. package/dist/core/p-3b42950e.entry.js.map +0 -1
  441. package/dist/core/p-497c90ea.entry.js.map +0 -1
  442. package/dist/core/p-6dc942b8.entry.js.map +0 -1
  443. package/dist/core/p-73b7585b.entry.js +0 -2
  444. package/dist/core/p-73b7585b.entry.js.map +0 -1
  445. package/dist/core/p-9c6699d6.entry.js.map +0 -1
  446. package/dist/core/p-a63bb91e.entry.js +0 -2
  447. package/dist/core/p-a63bb91e.entry.js.map +0 -1
  448. package/dist/core/p-a6b6dc73.entry.js +0 -2
  449. package/dist/core/p-a6b6dc73.entry.js.map +0 -1
  450. package/dist/core/p-b127c8a8.entry.js.map +0 -1
  451. package/dist/core/p-b4a59c79.entry.js.map +0 -1
  452. package/dist/core/p-b7d23697.entry.js.map +0 -1
  453. package/dist/core/p-c574ecc8.entry.js +0 -2
  454. package/dist/core/p-c574ecc8.entry.js.map +0 -1
  455. package/dist/core/p-cf86a858.entry.js.map +0 -1
  456. package/dist/core/p-d69599bc.entry.js +0 -2
  457. package/dist/core/p-d69599bc.entry.js.map +0 -1
  458. package/dist/core/p-f76f0a67.entry.js +0 -2
  459. package/dist/esm/form-39dc6896.js.map +0 -1
  460. package/dist/esm/template-df429738.js.map +0 -1
  461. package/dist/globals.d.ts +0 -2
  462. package/dist/types/Users/leo/Projects/repos/asseco/design-system/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
  463. package/dist/types/types/typings.d.ts +0 -6
  464. /package/dist/components/{p-b526e440.js.map → p-033f8bda.js.map} +0 -0
  465. /package/dist/components/{p-ec6c2272.js.map → p-23990b41.js.map} +0 -0
  466. /package/dist/components/{p-62074db5.js.map → p-26805569.js.map} +0 -0
  467. /package/dist/components/{p-9795ad94.js.map → p-b9ee51d6.js.map} +0 -0
  468. /package/dist/components/{p-570803ab.js.map → p-f8b7ea69.js.map} +0 -0
  469. /package/dist/core/{p-96d141a3.entry.js.map → p-0028fadc.entry.js.map} +0 -0
  470. /package/dist/core/{p-2969eb69.entry.js.map → p-0ab12526.entry.js.map} +0 -0
  471. /package/dist/core/{p-22abe742.entry.js.map → p-0c5c6dee.entry.js.map} +0 -0
  472. /package/dist/core/{p-1116fec6.entry.js.map → p-127af1b4.entry.js.map} +0 -0
  473. /package/dist/core/{p-fb51d693.entry.js.map → p-151f1b89.entry.js.map} +0 -0
  474. /package/dist/core/{p-fd4b0f54.entry.js.map → p-191e9b0c.entry.js.map} +0 -0
  475. /package/dist/core/{p-fc8a29e9.entry.js.map → p-2a13c39c.entry.js.map} +0 -0
  476. /package/dist/core/{p-de3429ab.entry.js.map → p-3975851f.entry.js.map} +0 -0
  477. /package/dist/core/{p-141d9af4.entry.js.map → p-4988c0bb.entry.js.map} +0 -0
  478. /package/dist/core/{p-83e998d8.entry.js.map → p-529ce9a4.entry.js.map} +0 -0
  479. /package/dist/core/{p-fc2a1e14.entry.js.map → p-53e0ad52.entry.js.map} +0 -0
  480. /package/dist/core/{p-81593c86.entry.js.map → p-54fa7af5.entry.js.map} +0 -0
  481. /package/dist/core/{p-41c18f64.entry.js.map → p-555eaa93.entry.js.map} +0 -0
  482. /package/dist/core/{p-e24236b0.entry.js.map → p-55cb727e.entry.js.map} +0 -0
  483. /package/dist/core/{p-3c12c766.entry.js.map → p-60d681a6.entry.js.map} +0 -0
  484. /package/dist/core/{p-b49293dc.entry.js.map → p-6bf8e7bf.entry.js.map} +0 -0
  485. /package/dist/core/{p-89b3e4d4.entry.js.map → p-72c5997f.entry.js.map} +0 -0
  486. /package/dist/core/{p-bb7f0a66.entry.js.map → p-8f121cad.entry.js.map} +0 -0
  487. /package/dist/core/{p-01d928c5.entry.js.map → p-90c068ff.entry.js.map} +0 -0
  488. /package/dist/core/{p-b4ab0d15.entry.js.map → p-9469ecc2.entry.js.map} +0 -0
  489. /package/dist/core/{p-f29b0193.entry.js.map → p-984b36f7.entry.js.map} +0 -0
  490. /package/dist/core/{p-ccf73a1a.entry.js.map → p-a35484ed.entry.js.map} +0 -0
  491. /package/dist/core/{p-b580666b.entry.js.map → p-adf276b0.entry.js.map} +0 -0
  492. /package/dist/core/{p-b1184db4.entry.js.map → p-af9a14e3.entry.js.map} +0 -0
  493. /package/dist/core/{p-e5c2f601.entry.js.map → p-b7e0b030.entry.js.map} +0 -0
  494. /package/dist/core/{p-78942f76.entry.js.map → p-be8eec3f.entry.js.map} +0 -0
  495. /package/dist/core/{p-f1227928.entry.js.map → p-c6a4ca41.entry.js.map} +0 -0
  496. /package/dist/core/{p-67138ae9.entry.js.map → p-ce1486b8.entry.js.map} +0 -0
  497. /package/dist/core/{p-ee4c58e3.entry.js.map → p-d2c370d6.entry.js.map} +0 -0
  498. /package/dist/core/{p-ac5e5b2c.entry.js.map → p-dd4445ee.entry.js.map} +0 -0
  499. /package/dist/core/{p-92af05f2.entry.js.map → p-e4f11ddf.entry.js.map} +0 -0
  500. /package/dist/core/{p-6675a0f0.entry.js.map → p-eaedc9e3.entry.js.map} +0 -0
  501. /package/dist/core/{p-b5e1ee46.entry.js.map → p-ed580ac7.entry.js.map} +0 -0
  502. /package/dist/core/{p-f636a1ca.entry.js.map → p-f2206bbb.entry.js.map} +0 -0
  503. /package/dist/core/{p-4a235ef5.entry.js.map → p-f59b858f.entry.js.map} +0 -0
  504. /package/dist/core/{p-7757e4a1.entry.js.map → p-fc710edb.entry.js.map} +0 -0
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, a as Host, g as getElement
2
2
  import { v as validateWcagLabel } from './wcag-7d25e12b.js';
3
3
  import { c as canValidateWcagOnRender } from './win-1dbd3f5c.js';
4
4
  import { d as delay } from './utils-c057a3fa.js';
5
- import { g as govHost } from './template-df429738.js';
5
+ import { g as govHost } from './template-a0067bb6.js';
6
6
  import './gov.log-49da0221.js';
7
7
  import './string.utils-f268fc6b.js';
8
8
 
@@ -10,32 +10,55 @@ const BreadcrumbsClass = {
10
10
  root: 'gov-breadcrumbs',
11
11
  };
12
12
 
13
- const govBreadcrumbsCss = ".gov-breadcrumbs ul{margin:0;padding:0}.gov-breadcrumbs li{margin:0;padding:0;background:none}.gov-breadcrumbs li::before{display:none}.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-breadcrumbs ul{position:relative;display:flex;width:100%;padding-bottom:0.3125rem;overflow-x:auto}.gov-breadcrumbs li{display:flex;justify-content:flex-start;align-items:center;white-space:nowrap}.gov-breadcrumbs button{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0;border:none;background:none;color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary));text-decoration:underline}.gov-breadcrumbs button:hover{text-decoration:none}.gov-breadcrumbs .gov-icon{width:0.625rem;height:0.625rem;margin:0rem 1rem;color:var(--gov-breadcrumbs-arrow-color, var(--gov-color-secondary-600))}";
13
+ const govBreadcrumbsCss = ".gov-breadcrumbs ul{margin:0;padding:0}.gov-breadcrumbs li{margin:0;padding:0;background:none}.gov-breadcrumbs li::before{display:none}.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-breadcrumbs{position:relative;display:flex;width:100%;justify-content:space-between;align-items:flex-start;gap:var(--gov-breadcrumbs-gap, 1rem)}.gov-breadcrumbs nav{overflow:hidden;width:100%}.gov-breadcrumbs ul{position:relative;display:flex;width:100%;flex-direction:column;gap:8px;margin-bottom:0}.gov-breadcrumbs li{display:flex;justify-content:flex-start;align-items:flex-start;margin-bottom:0 !important}.gov-breadcrumbs li .gov-icon{flex:0 0 auto;width:var(--gov-breadcrumbs-icon-size, 0.625rem);height:var(--gov-breadcrumbs-icon-size, 0.625rem);margin:calc((24px - var(--gov-breadcrumbs-icon-size, 0.625rem)) / 2) var(--gov-breadcrumbs-gap, 1rem) 0;color:var(--gov-breadcrumbs-arrow-color, var(--gov-color-secondary-600))}.gov-breadcrumbs li>a:first-child,.gov-breadcrumbs li>button:first-child{margin-left:calc(var(--gov-breadcrumbs-icon-size, 0.625rem) + 2 * var(--gov-breadcrumbs-gap, 1rem))}.gov-breadcrumbs a{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary))}.gov-breadcrumbs button{font-weight:var(--text-font-weight, var(--gov-text-m-font-weight));font-size:var(--text-font-size, var(--gov-text-m-font-size));line-height:var(--text-line-height, var(--gov-text-m-line-height));letter-spacing:var(--text-letter-spacing, var(--gov-text-m-letter-spacing));color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary));padding:0;border:none;background:none;text-decoration:underline}.gov-breadcrumbs[collapsed=\"\"],.gov-breadcrumbs[collapsed=true i],.gov-breadcrumbs[collapsed=\"1\"]{align-items:center}.gov-breadcrumbs[collapsed=\"\"] ul,.gov-breadcrumbs[collapsed=true i] ul,.gov-breadcrumbs[collapsed=\"1\"] ul{overflow-x:hidden;flex-direction:row}.gov-breadcrumbs[collapsed=\"\"] li,.gov-breadcrumbs[collapsed=true i] li,.gov-breadcrumbs[collapsed=\"1\"] li{align-items:center;white-space:nowrap}.gov-breadcrumbs[collapsed=\"\"] li .gov-icon,.gov-breadcrumbs[collapsed=true i] li .gov-icon,.gov-breadcrumbs[collapsed=\"1\"] li .gov-icon{margin-top:0}.gov-breadcrumbs[collapsed=\"\"] li>a:first-child,.gov-breadcrumbs[collapsed=\"\"] li>button:first-child,.gov-breadcrumbs[collapsed=true i] li>a:first-child,.gov-breadcrumbs[collapsed=true i] li>button:first-child,.gov-breadcrumbs[collapsed=\"1\"] li>a:first-child,.gov-breadcrumbs[collapsed=\"1\"] li>button:first-child{margin-left:0}";
14
14
 
15
15
  const GovBreadcrumbs = class {
16
16
  constructor(hostRef) {
17
17
  registerInstance(this, hostRef);
18
18
  this.govChange = createEvent(this, "gov-change", 7);
19
+ this.inited = false;
19
20
  this.collapsible = false;
20
21
  this.isExpanded = false;
21
22
  this.wcagLabel = undefined;
22
23
  this.wcagLabelledBy = undefined;
24
+ this.wcagToggleLabel = 'Zobrazit či skrýt navigaci';
25
+ this.collapsed = true;
26
+ this.toggleOption = false;
23
27
  this.h = govHost(this.host);
24
28
  }
25
29
  async componentDidRender() {
30
+ this.scheduleContentVerification();
26
31
  if (canValidateWcagOnRender()) {
27
32
  await delay(500);
28
33
  await this.validateWcag();
29
34
  }
30
35
  }
36
+ scheduleContentVerification() {
37
+ if (this.inited)
38
+ return;
39
+ this.inited = true;
40
+ requestAnimationFrame(() => {
41
+ this.calculateWidthOfItems();
42
+ this.inited = false;
43
+ });
44
+ }
45
+ calculateWidthOfItems() {
46
+ const hostWidth = this.host.getBoundingClientRect().width;
47
+ let sumOfWidths = 0;
48
+ this.host.querySelectorAll('li').forEach((li) => {
49
+ sumOfWidths += li.getBoundingClientRect().width;
50
+ });
51
+ this.toggleOption = sumOfWidths > hostWidth;
52
+ }
31
53
  render() {
32
- return (h(Host, { class: this.h.classes(BreadcrumbsClass.root) }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("slot", null))));
54
+ return (h(Host, { class: this.h.classes(BreadcrumbsClass.root), collapsed: this.collapsed }, h("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, h("slot", null)), this.toggleOption ? (h("gov-button", { size: 'xs', variant: 'primary', type: 'base', wcagLabel: this.wcagToggleLabel, wcagPressed: !this.collapsed, wcagExpanded: !this.collapsed, "on-gov-click": () => this.collapsed = !this.collapsed }, h("gov-icon", { name: this.collapsed ? 'chevron-down' : 'chevron-up' }))) : null));
33
55
  }
34
56
  /**
35
57
  * Validate the WCAG attributes of the component
36
58
  */
37
59
  async validateWcag() {
38
60
  validateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root);
61
+ validateWcagLabel(this.wcagToggleLabel, undefined, BreadcrumbsClass.root);
39
62
  }
40
63
  get host() { return getElement(this); }
41
64
  };
@@ -1 +1 @@
1
- {"file":"gov-breadcrumbs.entry.js","mappings":";;;;;;;;AAAO,MAAM,gBAAgB,GAAG;EAC/B,IAAI,EAAE,iBAAiB;CACvB;;ACFD,MAAM,iBAAiB,GAAG,mrCAAmrC;;MCahsC,cAAc;EAG1B;;;uBAQwC,KAAK;sBAIsB,KAAK;;;IAXvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IACjD,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc,IACpE,eAAO,CACF,CACA,EACP;GACD;;;;EAOD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GAC7E;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.scss?tag=gov-breadcrumbs","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-breadcrumbs\";\n\n#{$class} {\n\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tpadding-bottom: rem-calc(5);\n\t\toverflow-x: auto;\n\t}\n\tli {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: flex-start;\n\t\talign-items: center;\n\t\twhite-space: nowrap;\n\t}\n\tbutton {\n\t\t@include typography($font-size-m);\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\tcolor: $breadcrumbs-link-color;\n\t\ttext-decoration: underline;\n\t\t&:hover {\n\t\t\ttext-decoration: none;\n\t\t}\n\t}\n\t& .gov-icon {\n\t\twidth: rem-calc(10);\n\t\theight: rem-calc(10);\n\t\tmargin: rem-calc(0 16px);\n\t\tcolor: $breadcrumbs-arrow-color;\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } from '@stencil/core'\nimport { BreadcrumbsClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovBreadcrumbsChangeEvent } from './gov-breadcrumbs.d'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({ attribute: 'is-expanded' }) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: 'wcag-labeled-by' }) readonly wcagLabelledBy: string\n\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\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\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-breadcrumbs.entry.js","mappings":";;;;;;;;AAAO,MAAM,gBAAgB,GAAG;EAC/B,IAAI,EAAE,iBAAiB;CACvB;;ACFD,MAAM,iBAAiB,GAAG,mgGAAmgG;;MCahhG,cAAc;EAI1B;;;IAHQ,WAAM,GAAG,KAAK,CAAC;uBAWiB,KAAK;sBAIoB,KAAK;;;2BAYK,4BAA4B;qBAOlF,IAAI;wBACD,KAAK;IA/B5B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAgCD,MAAM,kBAAkB;IACvB,IAAI,CAAC,2BAA2B,EAAE,CAAA;IAClC,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAEO,2BAA2B;IAClC,IAAI,IAAI,CAAC,MAAM;MAAE,OAAO;IACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACnB,qBAAqB,CAAC;MACrB,IAAI,CAAC,qBAAqB,EAAE,CAAC;MAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACpB,CAAC,CAAC;GACH;EAGO,qBAAqB;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC;IAC1D,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE;MAC3C,WAAW,IAAI,EAAE,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAA;KAC/C,CAAC,CAAA;IACF,IAAI,CAAC,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;GAC5C;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,IAC5E,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc,IACpE,eAAO,CACF,EACL,IAAI,CAAC,YAAY,IACjB,kBACC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,EAClB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,IAAI,CAAC,eAAe,EAC/B,WAAW,EAAE,CAAC,IAAI,CAAC,SAAS,EAC5B,YAAY,EAAE,CAAC,IAAI,CAAC,SAAS,kBACf,MAAM,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,IAEpD,gBAAU,IAAI,EAAE,IAAI,CAAC,SAAS,GAAG,cAAc,GAAG,YAAY,GAAa,CAC/D,IACV,IAAI,CACF,EACP;GACD;;;;EAOD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;IAC7E,iBAAiB,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GACzE;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.scss?tag=gov-breadcrumbs","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-breadcrumbs\";\n\n#{$class} {\n\t@include base(flex);\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tgap: $breadcrumbs-gap;\n\n\tnav {\n\t\toverflow: hidden;\n\t\twidth: 100%;\n\t}\n\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t\tmargin-bottom: 0;\n\t}\n\tli {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: flex-start;\n\t\talign-items: flex-start;\n\t\tmargin-bottom: 0 !important;\n\t\t.gov-icon {\n\t\t\tflex: 0 0 auto;\n\t\t\twidth: $breadcrumbs-icon-size;\n\t\t\theight: $breadcrumbs-icon-size;\n\t\t\tmargin: calc((24px - $breadcrumbs-icon-size) / 2) $breadcrumbs-gap 0;\n\t\t\tcolor: $breadcrumbs-arrow-color;\n\t\t}\n\t\t> a:first-child,\n\t\t> button:first-child {\n\t\t\tmargin-left: calc($breadcrumbs-icon-size + (2 * $breadcrumbs-gap));\n\t\t}\n\t}\n\ta {\n\t\t@include typography-component($font-size-m);\n\t\tcolor: $breadcrumbs-link-color;\n\t}\n\tbutton {\n\t\t@include typography-component($font-size-m);\n\t\tcolor: $breadcrumbs-link-color;\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\ttext-decoration: underline;\n\t}\n\n\t@include parameter(\"collapsed\") {\n\t\talign-items: center;\n\t\tul {\n\t\t\toverflow-x: hidden;\n\t\t\tflex-direction: row;\n\t\t}\n\t\tli {\n\t\t\talign-items: center;\n\t\t\twhite-space: nowrap;\n\t\t\t.gov-icon {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\t\tli > a:first-child,\n\t\tli > button:first-child {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateWcagLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate inited = false;\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({attribute: 'is-expanded'}) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-label'}) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'wcag-labeled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds an accessible label to display the full breadcrumb navigation that only screen readers can see.\n\t */\n\t@Prop({attribute: 'wcag-toggle-label'}) readonly wcagToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\t@State() collapsed = true;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\trequestAnimationFrame(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\n\n\tprivate calculateWidthOfItems() {\n\t\tconst hostWidth = this.host.getBoundingClientRect().width;\n\t\tlet sumOfWidths = 0;\n\t\tthis.host.querySelectorAll('li').forEach((li) => {\n\t\t\tsumOfWidths += li.getBoundingClientRect().width\n\t\t})\n\t\tthis.toggleOption = sumOfWidths > hostWidth;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)} collapsed={this.collapsed}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t\t{this.toggleOption ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize={'xs'}\n\t\t\t\t\t\tvariant={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\twcagLabel={this.wcagToggleLabel}\n\t\t\t\t\t\twcagPressed={!this.collapsed}\n\t\t\t\t\t\twcagExpanded={!this.collapsed}\n\t\t\t\t\t\ton-gov-click={() => this.collapsed = !this.collapsed}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.collapsed ? 'chevron-down' : 'chevron-up'}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t\tvalidateWcagLabel(this.wcagToggleLabel, undefined, BreadcrumbsClass.root)\n\t}\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
2
2
  import { v as validateProp } from './props-a85d9c89.js';
3
3
  import { B as ButtonClass, b as ButtonVariants, T as Type, N as NativeType } from './constants-34a29ae2.js';
4
- import { g as govHost, p as prepareClasses, t as toBoolAttrIfDefined, a as toBoolAttr } from './template-df429738.js';
4
+ import { g as govHost, p as prepareClasses, t as toBoolAttrIfDefined } from './template-a0067bb6.js';
5
5
  import { S as Sizes } from './sizes-6c5943b4.js';
6
6
  import { a as validateWcagRef, v as validateWcagLabel } from './wcag-7d25e12b.js';
7
7
  import { c as canValidateWcagOnRender } from './win-1dbd3f5c.js';
@@ -39,9 +39,10 @@ const GovButton = class {
39
39
  this.govClick = createEvent(this, "gov-click", 7);
40
40
  this.govFocus = createEvent(this, "gov-focus", 7);
41
41
  this.govBlur = createEvent(this, "gov-blur", 7);
42
+ this.hydrated = false;
42
43
  this.variant = undefined;
43
44
  this.size = "m";
44
- this.type = "solid";
45
+ this.type = undefined;
45
46
  this.expanded = false;
46
47
  this.inverse = false;
47
48
  this.name = undefined;
@@ -70,7 +71,6 @@ const GovButton = class {
70
71
  this.wcagHasPopup = undefined;
71
72
  this.wcagPressed = undefined;
72
73
  this.wcagCurrent = undefined;
73
- this.isPressed = false;
74
74
  this.h = govHost(this.host);
75
75
  }
76
76
  validateVariant(newValue) {
@@ -101,12 +101,15 @@ const GovButton = class {
101
101
  const { h } = this;
102
102
  return prepareClasses([ButtonClass.root, h.hasSlot("left-icon") && ButtonClass.rootWithIcon, h.hasSlot("right-icon") && ButtonClass.rootWithIcon]);
103
103
  }
104
+ connectedCallback() {
105
+ this.hydrated = true;
106
+ }
104
107
  render() {
105
108
  const Tag = this.href ? Tags.A : Tags.BUTTON;
106
109
  const nativeType = Tag === Tags.A ? undefined : this.nativeType;
107
110
  const iconLeft = prepareIconFormat(this.iconLeft);
108
111
  const iconRight = prepareIconFormat(this.iconRight);
109
- return (h(Host, { hoverable: true, size: this.size, variant: this.variant, class: this.h.classes(this.classNames), type: this.type, inverse: this.inverse }, h(Tag, { class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onMouseDown: () => (this.isPressed = true), onMouseUp: () => (this.isPressed = false), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.focusable ? "0" : "-1", "aria-activedescendant": this.wcagActiveDescendant, "aria-describedby": this.wcagActiveDescendant, "aria-description": this.wcagDescription, "aria-controls": this.wcagControls, "aria-details": this.wcagDetails, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-haspopup": toBoolAttrIfDefined(this.wcagHasPopup), "aria-pressed": toBoolAttr(this.isPressed), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-current": this.wcagCurrent }, toBool(this.loading) && !this.h.hasSlot("right-icon") &&
112
+ return (h(Host, { hoverable: true, size: this.size, hydrated: this.hydrated, variant: this.variant, class: this.h.classes(this.classNames), type: this.type, inverse: this.inverse }, h(Tag, { class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.focusable ? "0" : "-1", "aria-activedescendant": this.wcagActiveDescendant, "aria-describedby": this.wcagActiveDescendant, "aria-description": this.wcagDescription, "aria-controls": this.wcagControls, "aria-details": this.wcagDetails, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-haspopup": toBoolAttrIfDefined(this.wcagHasPopup), "aria-pressed": toBoolAttrIfDefined(this.wcagPressed), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-current": this.wcagCurrent }, toBool(this.loading) && !this.h.hasSlot("right-icon") &&
110
113
  h("gov-icon", { name: "loader", class: "gov-spin-animation" }), this.h.hasSlot("left-icon") && h("slot", { name: "left-icon" }), iconLeft && h("gov-icon", { type: iconLeft.type, name: iconLeft.name }), h("slot", null), this.h.hasSlot("right-icon") && h("slot", { name: "right-icon" }), iconRight && h("gov-icon", { type: iconRight.type, name: iconRight.name }), toBool(this.loading) && this.h.hasSlot("right-icon") &&
111
114
  h("gov-icon", { name: "loader", class: "gov-spin-animation" }))));
112
115
  }
@@ -1 +1 @@
1
- {"file":"gov-button.entry.js","mappings":";;;;;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;EAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;GAC1D;OAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,KAAK,GAAG,CAAC,CAAA;GAChB;OAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;IACtC,OAAO,KAAK,CAAA;GACZ;OAAM;IACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;GAC3B;AACF;;ACVA,MAAM,YAAY,GAAG,gtyEAAgtyE;;ACuBruyE,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,eAAO,CAAA;EACP,yBAAiB,CAAA;AAClB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,SAAS;EAIrB;;;;;;gBAayD,GAAG;gBAIT,OAAO;oBAIN,KAAK;mBAIN,KAAK;;;;oBAiBJ,KAAK;sBAKT,QAAQ;;;;;;;;qBAuClB,IAAI;;;;;;;;;;;;;;qBAwFrB,KAAK;IA7KzB,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyJD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;GACxD;EAGD,YAAY,CAAC,QAAgB;IAC5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AAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;KACxE;GACD;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"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 & chip\n@import \"gov-button-core\";\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\tjustify-content: flex-start;\n\t\t\talign-items: flex-start;\n\t\t\ttext-align: left;\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\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\t.gov-icon {\n\t\t\t\tmargin: 0;\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&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n\t&[size=\"s\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 4px;\n\t}\n\t&[size=\"m\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 2px;\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 {\n\tButtonClass,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonVariants,\n\tButtonVariantType,\n\tNativeType,\n\tNativeTypesType,\n\tType,\n\tTypesType,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttr, toBoolAttrIfDefined} 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\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {prepareIconFormat} from \"../../gov-icon/helpers\";\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 triggerRef?: HTMLButtonElement | HTMLLinkElement\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({reflect: true}) 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({reflect: true}) 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 * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * 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 parameter\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<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\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\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\n\t\treturn (\n\t\t\t<Host hoverable={true}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tclass={this.h.classes(this.classNames)}\n\t\t\t\t\t\ttype={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.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\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\") &&\n\t\t\t\t\t\t<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{iconLeft && \t<gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\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{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t<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({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n\n\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"],"version":3}
1
+ {"file":"gov-button.entry.js","mappings":";;;;;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;EAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;GAC1D;OAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,KAAK,GAAG,CAAC,CAAA;GAChB;OAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;IACtC,OAAO,KAAK,CAAA;GACZ;OAAM;IACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;GAC3B;AACF;;ACVA,MAAM,YAAY,GAAG,gtyEAAgtyE;;ACuBruyE,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,eAAO,CAAA;EACP,yBAAiB,CAAA;AAClB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,SAAS;EAKrB;;;;;IAFQ,aAAQ,GAAG,KAAK,CAAA;;gBAei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,CAAC,IAAI,CAAC,CAAA;MACrE,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACnE,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MAC7D,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;KACxE;GACD;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"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 & chip\n@import \"gov-button-core\";\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\tjustify-content: flex-start;\n\t\t\talign-items: flex-start;\n\t\t\ttext-align: left;\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\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\t.gov-icon {\n\t\t\t\tmargin: 0;\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&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n\t&[size=\"s\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 4px;\n\t}\n\t&[size=\"m\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 2px;\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonVariants,\n\tButtonVariantType,\n\tNativeType,\n\tNativeTypesType,\n\tType,\n\tTypesType,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttrIfDefined} 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\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {prepareIconFormat} from \"../../gov-icon/helpers\";\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 triggerRef?: HTMLButtonElement | HTMLLinkElement\n\tprivate hydrated = false\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\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) 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({reflect: true}) 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 * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * 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 parameter\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: boolean\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<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\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\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\tconnectedCallback() {\n\t\tthis.hydrated = true\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\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\n\t\treturn (\n\t\t\t<Host hoverable={true}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\thydrated={this.hydrated}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tclass={this.h.classes(this.classNames)}\n\t\t\t\t\t\ttype={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.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\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\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={toBoolAttrIfDefined(this.wcagPressed)}\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\") &&\n\t\t\t\t\t\t<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{iconLeft && <gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\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{iconRight && <gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t<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({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n\n\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"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
2
- import { g as govHost, b as booleanString } from './template-df429738.js';
2
+ import { g as govHost, b as booleanString } from './template-a0067bb6.js';
3
3
  import { c as createID } from './string.utils-f268fc6b.js';
4
4
  import { a as govErrorLog } from './gov.log-49da0221.js';
5
5
  import { v as validateWcagLabel } from './wcag-7d25e12b.js';