@gov-design-system-ce/components 0.0.65 → 0.0.67

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 (376) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
  3. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-accordion.cjs.entry.js +2 -2
  5. package/dist/cjs/gov-app.cjs.entry.js +159 -0
  6. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  7. package/dist/cjs/gov-attachments_3.cjs.entry.js +2 -2
  8. package/dist/cjs/gov-backdrop.cjs.entry.js +2 -2
  9. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +2 -2
  10. package/dist/cjs/gov-button.cjs.entry.js +9 -4
  11. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-card.cjs.entry.js +2 -2
  13. package/dist/cjs/gov-chip.cjs.entry.js +7 -2
  14. package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
  15. package/dist/cjs/gov-control-group.cjs.entry.js +2 -2
  16. package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
  17. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-error-code.cjs.entry.js.map +1 -1
  19. package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
  20. package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
  21. package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
  23. package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
  24. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  25. package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-multi-select.cjs.entry.js +73 -10
  27. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
  29. package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
  30. package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
  31. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  32. package/dist/cjs/gov-infobar.cjs.entry.js +13 -13
  33. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  34. package/dist/cjs/gov-modal.cjs.entry.js +11 -11
  35. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  36. package/dist/cjs/gov-nav.cjs.entry.js +2 -2
  37. package/dist/cjs/gov-pagination.cjs.entry.js +2 -2
  38. package/dist/cjs/gov-prompt.cjs.entry.js +14 -14
  39. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  40. package/dist/cjs/gov-side-nav.cjs.entry.js +2 -2
  41. package/dist/cjs/gov-skeleton.cjs.entry.js +2 -2
  42. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  43. package/dist/cjs/gov-statsbar-item.cjs.entry.js.map +1 -1
  44. package/dist/cjs/gov-tabs.cjs.entry.js +2 -2
  45. package/dist/cjs/gov-tag.cjs.entry.js +7 -2
  46. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
  47. package/dist/cjs/gov-toast.cjs.entry.js +2 -1
  48. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  49. package/dist/cjs/gov-tooltip.cjs.entry.js +1 -1
  50. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  51. package/dist/cjs/gov-wizard.cjs.entry.js +2 -2
  52. package/dist/cjs/helpers-2c870ff5.js +19 -0
  53. package/dist/cjs/helpers-2c870ff5.js.map +1 -0
  54. package/dist/cjs/loader.cjs.js +1 -1
  55. package/dist/cjs/{wcag-d7912060.js → wcag-ebd590c0.js} +2 -2
  56. package/dist/cjs/{wcag-d7912060.js.map → wcag-ebd590c0.js.map} +1 -1
  57. package/dist/cjs/{win-0427c131.js → win-9d1a8a53.js} +2 -2
  58. package/dist/cjs/win-9d1a8a53.js.map +1 -0
  59. package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -0
  60. package/dist/collection/components/gov-button/button/gov-button.css +0 -15
  61. package/dist/collection/components/gov-button/button/gov-button.js +44 -5
  62. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
  63. package/dist/collection/components/gov-chip/gov-chip.css +0 -15
  64. package/dist/collection/components/gov-chip/gov-chip.js +40 -1
  65. package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
  66. package/dist/collection/components/gov-control-group/constants.js +1 -1
  67. package/dist/collection/components/gov-control-group/constants.js.map +1 -1
  68. package/dist/collection/components/gov-control-group/gov-control-group.css +18 -0
  69. package/dist/collection/components/gov-control-group/gov-control-group.js +1 -1
  70. package/dist/collection/components/gov-error-code/gov-error-code.css +4 -4
  71. package/dist/collection/components/gov-form/control/gov-form-control.css +13 -13
  72. package/dist/collection/components/gov-form/label/gov-form-label.css +5 -0
  73. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +250 -11
  74. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  75. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -1
  76. package/dist/collection/components/gov-icon/helpers.js +14 -0
  77. package/dist/collection/components/gov-icon/helpers.js.map +1 -0
  78. package/dist/collection/components/gov-infobar/gov-infobar.css +3 -5
  79. package/dist/collection/components/gov-infobar/gov-infobar.js +13 -12
  80. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
  81. package/dist/collection/components/gov-modal/gov-modal.js +13 -12
  82. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  83. package/dist/collection/components/gov-promp/gov-prompt.js +18 -17
  84. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  85. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +2 -2
  86. package/dist/collection/components/gov-tag/gov-tag.css +0 -15
  87. package/dist/collection/components/gov-tag/gov-tag.js +40 -1
  88. package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
  89. package/dist/collection/components/gov-toast/gov-toast.js +2 -1
  90. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  91. package/dist/collection/components/gov-tooltip/gov-tooltip.css +0 -2
  92. package/dist/collection/helpers/Dom/win.js +1 -1
  93. package/dist/collection/helpers/Dom/win.js.map +1 -1
  94. package/dist/collection/pages/Button.js +4 -0
  95. package/dist/collection/pages/Button.js.map +1 -1
  96. package/dist/collection/pages/ControlGroup.js +95 -0
  97. package/dist/collection/pages/ControlGroup.js.map +1 -1
  98. package/dist/collection/pages/Forms.js +16 -0
  99. package/dist/collection/pages/Forms.js.map +1 -1
  100. package/dist/collection/pages/Infobar.js +44 -0
  101. package/dist/collection/pages/Infobar.js.map +1 -1
  102. package/dist/collection/utils/helpers.types.js +54 -0
  103. package/dist/collection/utils/helpers.types.js.map +1 -0
  104. package/dist/components/gov-accordion-item.js +1 -1
  105. package/dist/components/gov-accordion-item.js.map +1 -1
  106. package/dist/components/gov-accordion.js +1 -1
  107. package/dist/components/gov-app.js +1 -1
  108. package/dist/components/gov-app.js.map +1 -1
  109. package/dist/components/gov-attachments-item.js +1 -1
  110. package/dist/components/gov-attachments.js +1 -1
  111. package/dist/components/gov-backdrop.js +1 -1
  112. package/dist/components/gov-breadcrumbs.js +1 -1
  113. package/dist/components/gov-button.js +1 -1
  114. package/dist/components/gov-card.js +1 -1
  115. package/dist/components/gov-chip.js +1 -1
  116. package/dist/components/gov-control-group.js +1 -1
  117. package/dist/components/gov-control-group.js.map +1 -1
  118. package/dist/components/gov-error-code.js +1 -1
  119. package/dist/components/gov-error-code.js.map +1 -1
  120. package/dist/components/gov-form-autocomplete.js +1 -1
  121. package/dist/components/gov-form-checkbox.js +1 -1
  122. package/dist/components/gov-form-control.js +1 -1
  123. package/dist/components/gov-form-control.js.map +1 -1
  124. package/dist/components/gov-form-file.js +1 -1
  125. package/dist/components/gov-form-input.js +1 -1
  126. package/dist/components/gov-form-label.js +1 -1
  127. package/dist/components/gov-form-label.js.map +1 -1
  128. package/dist/components/gov-form-multi-select.js +1 -1
  129. package/dist/components/gov-form-multi-select.js.map +1 -1
  130. package/dist/components/gov-form-radio.js +1 -1
  131. package/dist/components/gov-form-select.js +1 -1
  132. package/dist/components/gov-form-switch.js +1 -1
  133. package/dist/components/gov-icon.js +1 -1
  134. package/dist/components/gov-infobar.js +1 -1
  135. package/dist/components/gov-infobar.js.map +1 -1
  136. package/dist/components/gov-loading.js +1 -1
  137. package/dist/components/gov-modal.js +1 -1
  138. package/dist/components/gov-modal.js.map +1 -1
  139. package/dist/components/gov-nav.js +1 -1
  140. package/dist/components/gov-pagination.js +1 -1
  141. package/dist/components/gov-prompt.js +1 -1
  142. package/dist/components/gov-prompt.js.map +1 -1
  143. package/dist/components/gov-side-nav-item.js +1 -1
  144. package/dist/components/gov-side-nav.js +1 -1
  145. package/dist/components/gov-skeleton.js +1 -1
  146. package/dist/components/gov-statsbar-item.js +1 -1
  147. package/dist/components/gov-statsbar-item.js.map +1 -1
  148. package/dist/components/gov-tabs.js +1 -1
  149. package/dist/components/gov-tag.js +1 -1
  150. package/dist/components/gov-tag.js.map +1 -1
  151. package/dist/components/gov-tile.js +1 -1
  152. package/dist/components/gov-toast.js +1 -1
  153. package/dist/components/gov-toast.js.map +1 -1
  154. package/dist/components/gov-tooltip-content.js +1 -1
  155. package/dist/components/gov-tooltip.js +1 -1
  156. package/dist/components/gov-tooltip.js.map +1 -1
  157. package/dist/components/gov-wizard-item.js +1 -1
  158. package/dist/components/gov-wizard.js +1 -1
  159. package/dist/components/p-00b7c4f5.js +2 -0
  160. package/dist/components/{p-d60bcfde.js → p-26dfbba1.js} +2 -2
  161. package/dist/components/p-2bf5b814.js +2 -0
  162. package/dist/components/p-2bf5b814.js.map +1 -0
  163. package/dist/components/p-3e4eae42.js +2 -0
  164. package/dist/components/p-3e4eae42.js.map +1 -0
  165. package/dist/components/{p-9e0bf80f.js → p-464fc42a.js} +2 -2
  166. package/dist/components/{p-9e3c2bf4.js → p-4fdfb242.js} +2 -2
  167. package/dist/components/{p-f2efd9b5.js → p-530fbb0a.js} +2 -2
  168. package/dist/components/{p-b9d84775.js → p-8cdad015.js} +2 -2
  169. package/dist/components/{p-20072d33.js → p-a00cf51c.js} +2 -2
  170. package/dist/components/{p-f775857a.js → p-a0a3393f.js} +2 -2
  171. package/dist/components/p-b07b6908.js +2 -0
  172. package/dist/components/p-b07b6908.js.map +1 -0
  173. package/dist/components/p-d23e6972.js +2 -0
  174. package/dist/components/p-d23e6972.js.map +1 -0
  175. package/dist/core/core.css +1 -1
  176. package/dist/core/core.esm.js +1 -1
  177. package/dist/core/core.esm.js.map +1 -1
  178. package/dist/core/{p-c0be9590.entry.js → p-093160bb.entry.js} +2 -2
  179. package/dist/core/{p-9af6210d.entry.js → p-0950ca8d.entry.js} +2 -2
  180. package/dist/core/{p-466f885b.entry.js → p-13942637.entry.js} +2 -2
  181. package/dist/core/p-13942637.entry.js.map +1 -0
  182. package/dist/core/{p-ae13fbbc.entry.js → p-18396341.entry.js} +2 -2
  183. package/dist/core/p-18396341.entry.js.map +1 -0
  184. package/dist/core/p-1fd3d109.entry.js +2 -0
  185. package/dist/core/{p-2bcabdd5.entry.js.map → p-1fd3d109.entry.js.map} +1 -1
  186. package/dist/core/{p-965f24fb.entry.js → p-26921fac.entry.js} +2 -2
  187. package/dist/core/{p-c3e4700b.entry.js → p-28c83bdf.entry.js} +2 -2
  188. package/dist/core/p-2bf5b814.js +2 -0
  189. package/dist/core/p-2bf5b814.js.map +1 -0
  190. package/dist/core/p-31b93317.entry.js +2 -0
  191. package/dist/core/p-31b93317.entry.js.map +1 -0
  192. package/dist/core/{p-e9c0fac1.entry.js → p-3aa4cf18.entry.js} +2 -2
  193. package/dist/core/{p-029beaf4.entry.js → p-6b1c11ba.entry.js} +2 -2
  194. package/dist/core/p-6b1c11ba.entry.js.map +1 -0
  195. package/dist/core/p-74882c70.entry.js +2 -0
  196. package/dist/core/p-74882c70.entry.js.map +1 -0
  197. package/dist/core/{p-b3840f50.entry.js → p-79ca1b62.entry.js} +2 -2
  198. package/dist/core/{p-a54c1e85.entry.js → p-7cd73b1e.entry.js} +2 -2
  199. package/dist/core/p-878741b6.entry.js +2 -0
  200. package/dist/core/{p-9d4a6e9b.entry.js.map → p-878741b6.entry.js.map} +1 -1
  201. package/dist/core/{p-2016172f.entry.js → p-89b3e4d4.entry.js} +2 -2
  202. package/dist/core/{p-2016172f.entry.js.map → p-89b3e4d4.entry.js.map} +1 -1
  203. package/dist/core/p-9aeb4282.entry.js +2 -0
  204. package/dist/core/p-9aeb4282.entry.js.map +1 -0
  205. package/dist/core/{p-a3b6c5c7.entry.js → p-9d10131d.entry.js} +2 -2
  206. package/dist/core/p-a7d895cb.entry.js +2 -0
  207. package/dist/core/{p-7b7f8cc2.entry.js.map → p-a7d895cb.entry.js.map} +1 -1
  208. package/dist/core/{p-a133cdda.entry.js → p-acb40ea2.entry.js} +2 -2
  209. package/dist/core/{p-b49ac370.entry.js → p-af1433f7.entry.js} +2 -2
  210. package/dist/core/{p-eb0c9716.entry.js → p-ba7cbd7f.entry.js} +2 -2
  211. package/dist/core/p-bb7f0a66.entry.js +2 -0
  212. package/dist/core/p-bb7f0a66.entry.js.map +1 -0
  213. package/dist/core/p-bd763705.entry.js +2 -0
  214. package/dist/core/p-bd763705.entry.js.map +1 -0
  215. package/dist/core/p-bf39d442.entry.js +2 -0
  216. package/dist/core/p-bf39d442.entry.js.map +1 -0
  217. package/dist/core/p-c44d44df.entry.js +2 -0
  218. package/dist/core/p-c44d44df.entry.js.map +1 -0
  219. package/dist/core/{p-87b5668e.entry.js → p-cef10fe5.entry.js} +2 -2
  220. package/dist/core/p-d1a3e571.entry.js +2 -0
  221. package/dist/core/p-d1a3e571.entry.js.map +1 -0
  222. package/dist/core/p-d23e6972.js +2 -0
  223. package/dist/core/p-d23e6972.js.map +1 -0
  224. package/dist/core/{p-4accef73.entry.js → p-d4d59523.entry.js} +2 -2
  225. package/dist/core/p-ea275d90.entry.js +2 -0
  226. package/dist/core/p-ea275d90.entry.js.map +1 -0
  227. package/dist/core/p-ecc8cc47.entry.js +2 -0
  228. package/dist/core/p-ecc8cc47.entry.js.map +1 -0
  229. package/dist/core/p-ee35ca3f.entry.js +2 -0
  230. package/dist/core/p-ee35ca3f.entry.js.map +1 -0
  231. package/dist/core/{p-6833aeaf.entry.js → p-f4a6a339.entry.js} +2 -2
  232. package/dist/core/p-faabd332.js +2 -0
  233. package/dist/core/p-fc81b896.entry.js +2 -0
  234. package/dist/core/p-fc81b896.entry.js.map +1 -0
  235. package/dist/core/{p-39d79238.entry.js → p-fda41420.entry.js} +2 -2
  236. package/dist/esm/core.js +1 -1
  237. package/dist/esm/gov-accordion-item.entry.js +1 -1
  238. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  239. package/dist/esm/gov-accordion.entry.js +2 -2
  240. package/dist/esm/gov-app.entry.js +159 -0
  241. package/dist/esm/gov-app.entry.js.map +1 -1
  242. package/dist/esm/gov-attachments_3.entry.js +2 -2
  243. package/dist/esm/gov-backdrop.entry.js +2 -2
  244. package/dist/esm/gov-breadcrumbs.entry.js +2 -2
  245. package/dist/esm/gov-button.entry.js +9 -4
  246. package/dist/esm/gov-button.entry.js.map +1 -1
  247. package/dist/esm/gov-card.entry.js +2 -2
  248. package/dist/esm/gov-chip.entry.js +7 -2
  249. package/dist/esm/gov-chip.entry.js.map +1 -1
  250. package/dist/esm/gov-control-group.entry.js +2 -2
  251. package/dist/esm/gov-control-group.entry.js.map +1 -1
  252. package/dist/esm/gov-error-code.entry.js +1 -1
  253. package/dist/esm/gov-error-code.entry.js.map +1 -1
  254. package/dist/esm/gov-form-checkbox.entry.js +2 -2
  255. package/dist/esm/gov-form-control.entry.js +1 -1
  256. package/dist/esm/gov-form-control.entry.js.map +1 -1
  257. package/dist/esm/gov-form-file.entry.js +2 -2
  258. package/dist/esm/gov-form-input.entry.js +2 -2
  259. package/dist/esm/gov-form-label.entry.js +1 -1
  260. package/dist/esm/gov-form-label.entry.js.map +1 -1
  261. package/dist/esm/gov-form-multi-select.entry.js +73 -10
  262. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  263. package/dist/esm/gov-form-radio.entry.js +2 -2
  264. package/dist/esm/gov-form-select.entry.js +2 -2
  265. package/dist/esm/gov-form-switch.entry.js +2 -2
  266. package/dist/esm/gov-icon.entry.js +2 -2
  267. package/dist/esm/gov-infobar.entry.js +13 -13
  268. package/dist/esm/gov-infobar.entry.js.map +1 -1
  269. package/dist/esm/gov-modal.entry.js +11 -11
  270. package/dist/esm/gov-modal.entry.js.map +1 -1
  271. package/dist/esm/gov-nav.entry.js +2 -2
  272. package/dist/esm/gov-pagination.entry.js +2 -2
  273. package/dist/esm/gov-prompt.entry.js +14 -14
  274. package/dist/esm/gov-prompt.entry.js.map +1 -1
  275. package/dist/esm/gov-side-nav.entry.js +2 -2
  276. package/dist/esm/gov-skeleton.entry.js +2 -2
  277. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  278. package/dist/esm/gov-statsbar-item.entry.js.map +1 -1
  279. package/dist/esm/gov-tabs.entry.js +2 -2
  280. package/dist/esm/gov-tag.entry.js +7 -2
  281. package/dist/esm/gov-tag.entry.js.map +1 -1
  282. package/dist/esm/gov-toast.entry.js +2 -1
  283. package/dist/esm/gov-toast.entry.js.map +1 -1
  284. package/dist/esm/gov-tooltip.entry.js +1 -1
  285. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  286. package/dist/esm/gov-wizard.entry.js +2 -2
  287. package/dist/esm/helpers-bc0fd116.js +17 -0
  288. package/dist/esm/helpers-bc0fd116.js.map +1 -0
  289. package/dist/esm/loader.js +1 -1
  290. package/dist/esm/{wcag-06bd4d01.js → wcag-b7b67e25.js} +2 -2
  291. package/dist/esm/{wcag-06bd4d01.js.map → wcag-b7b67e25.js.map} +1 -1
  292. package/dist/esm/{win-0a50f66e.js → win-0d231cca.js} +2 -2
  293. package/dist/esm/win-0d231cca.js.map +1 -0
  294. package/dist/hydrate/index.js +317 -55
  295. package/dist/types/components/gov-button/button/gov-button.d.ts +9 -1
  296. package/dist/types/components/gov-chip/gov-chip.d.ts +8 -0
  297. package/dist/types/components/gov-control-group/constants.d.ts +1 -1
  298. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +33 -1
  299. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +1 -0
  300. package/dist/types/components/gov-icon/helpers.d.ts +5 -0
  301. package/dist/types/components/gov-infobar/gov-infobar.d.ts +4 -4
  302. package/dist/types/components/gov-modal/gov-modal.d.ts +3 -3
  303. package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -3
  304. package/dist/types/components/gov-tag/gov-tag.d.ts +8 -0
  305. package/dist/types/components.d.ts +86 -2
  306. package/dist/types/utils/helpers.types.d.ts +49 -0
  307. package/package.json +2 -2
  308. package/dist/cjs/win-0427c131.js.map +0 -1
  309. package/dist/collection/helpers/StorybookDocsTemplate.js +0 -9
  310. package/dist/collection/helpers/StorybookDocsTemplate.js.map +0 -1
  311. package/dist/components/p-94bf1f51.js +0 -2
  312. package/dist/components/p-94bf1f51.js.map +0 -1
  313. package/dist/components/p-ae894a40.js +0 -2
  314. package/dist/components/p-cac3881f.js +0 -2
  315. package/dist/components/p-cac3881f.js.map +0 -1
  316. package/dist/components/p-dc1e2f70.js +0 -2
  317. package/dist/components/p-dc1e2f70.js.map +0 -1
  318. package/dist/core/p-029beaf4.entry.js.map +0 -1
  319. package/dist/core/p-1a04e45e.entry.js +0 -2
  320. package/dist/core/p-1a04e45e.entry.js.map +0 -1
  321. package/dist/core/p-2a95f9fb.entry.js +0 -2
  322. package/dist/core/p-2a95f9fb.entry.js.map +0 -1
  323. package/dist/core/p-2aef69ed.entry.js +0 -2
  324. package/dist/core/p-2aef69ed.entry.js.map +0 -1
  325. package/dist/core/p-2bcabdd5.entry.js +0 -2
  326. package/dist/core/p-356adceb.entry.js +0 -2
  327. package/dist/core/p-356adceb.entry.js.map +0 -1
  328. package/dist/core/p-461d28ed.entry.js +0 -2
  329. package/dist/core/p-461d28ed.entry.js.map +0 -1
  330. package/dist/core/p-466f885b.entry.js.map +0 -1
  331. package/dist/core/p-53549fe4.entry.js +0 -2
  332. package/dist/core/p-53549fe4.entry.js.map +0 -1
  333. package/dist/core/p-570ef4e5.js +0 -2
  334. package/dist/core/p-603a9d99.entry.js +0 -2
  335. package/dist/core/p-603a9d99.entry.js.map +0 -1
  336. package/dist/core/p-7b7f8cc2.entry.js +0 -2
  337. package/dist/core/p-7d85bc32.entry.js +0 -2
  338. package/dist/core/p-7d85bc32.entry.js.map +0 -1
  339. package/dist/core/p-9d4a6e9b.entry.js +0 -2
  340. package/dist/core/p-a9493d11.entry.js +0 -2
  341. package/dist/core/p-a9493d11.entry.js.map +0 -1
  342. package/dist/core/p-ae13fbbc.entry.js.map +0 -1
  343. package/dist/core/p-c5e9da95.entry.js +0 -2
  344. package/dist/core/p-c5e9da95.entry.js.map +0 -1
  345. package/dist/core/p-cac3881f.js +0 -2
  346. package/dist/core/p-cac3881f.js.map +0 -1
  347. package/dist/core/p-d4c468b9.entry.js +0 -2
  348. package/dist/core/p-d4c468b9.entry.js.map +0 -1
  349. package/dist/core/p-f9f212a6.entry.js +0 -2
  350. package/dist/core/p-f9f212a6.entry.js.map +0 -1
  351. package/dist/esm/win-0a50f66e.js.map +0 -1
  352. package/dist/types/helpers/StorybookDocsTemplate.d.ts +0 -3
  353. /package/dist/components/{p-ae894a40.js.map → p-00b7c4f5.js.map} +0 -0
  354. /package/dist/components/{p-d60bcfde.js.map → p-26dfbba1.js.map} +0 -0
  355. /package/dist/components/{p-9e0bf80f.js.map → p-464fc42a.js.map} +0 -0
  356. /package/dist/components/{p-9e3c2bf4.js.map → p-4fdfb242.js.map} +0 -0
  357. /package/dist/components/{p-f2efd9b5.js.map → p-530fbb0a.js.map} +0 -0
  358. /package/dist/components/{p-b9d84775.js.map → p-8cdad015.js.map} +0 -0
  359. /package/dist/components/{p-20072d33.js.map → p-a00cf51c.js.map} +0 -0
  360. /package/dist/components/{p-f775857a.js.map → p-a0a3393f.js.map} +0 -0
  361. /package/dist/core/{p-c0be9590.entry.js.map → p-093160bb.entry.js.map} +0 -0
  362. /package/dist/core/{p-9af6210d.entry.js.map → p-0950ca8d.entry.js.map} +0 -0
  363. /package/dist/core/{p-965f24fb.entry.js.map → p-26921fac.entry.js.map} +0 -0
  364. /package/dist/core/{p-c3e4700b.entry.js.map → p-28c83bdf.entry.js.map} +0 -0
  365. /package/dist/core/{p-e9c0fac1.entry.js.map → p-3aa4cf18.entry.js.map} +0 -0
  366. /package/dist/core/{p-b3840f50.entry.js.map → p-79ca1b62.entry.js.map} +0 -0
  367. /package/dist/core/{p-a54c1e85.entry.js.map → p-7cd73b1e.entry.js.map} +0 -0
  368. /package/dist/core/{p-a3b6c5c7.entry.js.map → p-9d10131d.entry.js.map} +0 -0
  369. /package/dist/core/{p-a133cdda.entry.js.map → p-acb40ea2.entry.js.map} +0 -0
  370. /package/dist/core/{p-b49ac370.entry.js.map → p-af1433f7.entry.js.map} +0 -0
  371. /package/dist/core/{p-eb0c9716.entry.js.map → p-ba7cbd7f.entry.js.map} +0 -0
  372. /package/dist/core/{p-87b5668e.entry.js.map → p-cef10fe5.entry.js.map} +0 -0
  373. /package/dist/core/{p-4accef73.entry.js.map → p-d4d59523.entry.js.map} +0 -0
  374. /package/dist/core/{p-6833aeaf.entry.js.map → p-f4a6a339.entry.js.map} +0 -0
  375. /package/dist/core/{p-570ef4e5.js.map → p-faabd332.js.map} +0 -0
  376. /package/dist/core/{p-39d79238.entry.js.map → p-fda41420.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"gov-infobar.js","sourceRoot":"","sources":["../../../../../../src/components/gov-infobar/gov-infobar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE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AAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,GAAa,CACpE,CACT;UACN,WAAK,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa,iBAAe,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC;YAC3E,eAAO,CACH,CACG,CACZ,CAAC,CAAC,CAAC,CACF,eAAO,CACR,CACG,CACE;MACT,IAAI,CAAC,QAAQ,IAAI,WAAW,CACxB,CACR,CAAA;EACH,CAAC;EAED,cAAc,CAAC,CAA2B;IACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MACjB,SAAS,EAAE,YAAY,CAAC,IAAI;MAC5B,GAAG,EAAE,IAAI,CAAC,IAAI;MACd,aAAa,EAAE,CAAC;KACjB,CAAC,CAAA;EACJ,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;MACjB,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;KAC7E;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE;MACjB,gBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;KAC/E;EACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {InfobarClass, InfobarVariants, VariantType} from \"./constants\"\nimport {govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {InfobarEvent} from \"./gov-infobar.types\"\nimport {ButtonEvent} from \"../gov-button/button/gov-button.types\"\nimport Fragment from \"../../helpers/Fragment\"\nimport {validateWcagProp} from \"../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../helpers/Dom/win\"\nimport {delay} from \"../../utils/utils\"\n\n@Component({\n tag: \"gov-infobar\",\n styleUrl: \"gov-infobar.scss\",\n})\nexport class GovInfobar {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovInfobarElement\n\n /**\n * Style variation of the button.\n */\n @Prop() readonly headline: string\n /**\n * Style variation of the button.\n */\n @Prop() readonly variant: VariantType = \"primary\"\n /**\n * Determine if component should have inverse colors to be used on dark background\n */\n @Prop() readonly inverse: boolean = false\n /**\n * Aria label for the closing button. It is mandatory if the infobar is closable\n */\n @Prop({attribute: \"wcag-close-label\"}) readonly wcagCloseLabel: string\n /**\n * Aria label for the toggle button. It is mandatory if the infobar has headline\n */\n @Prop({attribute: \"wcag-toggle-label\"}) readonly wcagToggleLabel: string = 'Zobrazit více informací'\n /**\n * Called when the close button is clicked\n */\n @Event({eventName: \"gov-close\"}) govClose: EventEmitter<InfobarEvent>\n /**\n * Displays the option to close the infobar\n */\n @Prop() readonly closable?: boolean = false\n\n @State() toggleContent = false\n\n @Watch(\"variant\")\n validateVariant(newValue: string): void {\n validateProp(InfobarVariants, newValue, InfobarClass.root)\n }\n\n componentWillLoad(): void {\n this.validateVariant(this.variant)\n }\n\n async componentDidRender() {\n if (canValidateWcagOnRender()) {\n await delay(500)\n await this.validateWcag()\n }\n }\n\n render() {\n let inverse = !this.inverse\n let variant = this.inverse ? \"secondary\" : this.variant\n\n if (this.variant == \"warning\") {\n inverse = false\n variant = \"secondary\"\n }\n\n const closeButton = (\n <div class={InfobarClass.close}>\n <gov-button\n size=\"s\"\n aria-label={this.wcagCloseLabel}\n type=\"base\"\n variant={variant}\n inverse={inverse}\n on-gov-click={this.onCloseHandler.bind(this)}\n >\n <gov-icon name=\"x-lg\"></gov-icon>\n </gov-button>\n </div>\n )\n\n return (\n <Host class={this.h.classes(InfobarClass.root)} variant={this.variant}>\n <section class={InfobarClass.section} role=\"infobar\">\n {this.h.hasSlot(\"icon\") && (\n <div class={InfobarClass.icon}>\n <slot name=\"icon\"/>\n </div>\n )}\n <div class={InfobarClass.content + (this.closable ? ' ' + InfobarClass.closable : '')}>\n {this.headline ? (\n <Fragment>\n <div class={InfobarClass.headline}>\n <p>{this.headline}</p>\n <gov-button\n size=\"s\"\n aria-label={this.wcagToggleLabel}\n type=\"base\"\n variant={variant}\n inverse={inverse}\n on-gov-click={() => this.toggleContent = !this.toggleContent}\n >\n <gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'}></gov-icon>\n </gov-button>\n </div>\n <div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n <slot/>\n </div>\n </Fragment>\n ) : (\n <slot/>\n )}\n </div>\n </section>\n {this.closable && closeButton}\n </Host>\n )\n }\n\n onCloseHandler(e: CustomEvent<ButtonEvent>) {\n this.govClose.emit({\n component: InfobarClass.root,\n ref: this.host,\n originalEvent: e,\n })\n }\n\n /**\n * Validate the WCAG attributes of the component\n */\n @Method()\n async validateWcag(): Promise<void> {\n if (this.closable) {\n validateWcagProp(this.wcagCloseLabel, 'wcag-close-label', InfobarClass.root)\n }\n if (this.headline) {\n validateWcagProp(this.wcagToggleLabel, 'wcag-toggle-label', InfobarClass.root)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"gov-infobar.js","sourceRoot":"","sources":["../../../../../../src/components/gov-infobar/gov-infobar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EA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K,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa,iBAAe,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC;YAC5E,eAAQ,CACH,CACI,CACX,CAAC,CAAC,CAAC,CACH,eAAQ,CACR,CACI,CACG;MACT,IAAI,CAAC,QAAQ,IAAI,WAAW,CACvB,CACP,CAAA;EACF,CAAC;EAED,cAAc,CAAC,CAA2B;IACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAE,YAAY,CAAC,IAAI;MAC5B,GAAG,EAAE,IAAI,CAAC,IAAI;MACd,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;EACH,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,gBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;KAC5E;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,gBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;KAC9E;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core'\nimport { govHost, toBoolAttr } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport Fragment from '../../helpers/Fragment'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { delay } from '../../utils/utils'\nimport { ButtonEvent } from '../gov-button/button/gov-button.types'\nimport { InfobarClass, InfobarVariants, VariantType } from './constants'\nimport { InfobarEvent } from './gov-infobar.types'\n\n@Component({\n\ttag: 'gov-infobar',\n\tstyleUrl: 'gov-infobar.scss',\n})\nexport class GovInfobar {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovInfobarElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly headline: string\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant: VariantType = 'primary'\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Aria label for the closing button. It is mandatory if the infobar is closable\n\t */\n\t@Prop({ attribute: 'wcag-close-label' }) readonly wcagCloseLabel: string = 'Zavřít informační lištu'\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the infobar has headline\n\t */\n\t@Prop({ attribute: 'wcag-toggle-label' }) readonly wcagToggleLabel: string = 'Zobrazit více informací'\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({ eventName: 'gov-close' }) govClose: EventEmitter<InfobarEvent>\n\t/**\n\t * Displays the option to close the infobar\n\t */\n\t@Prop() readonly closable?: boolean = false\n\n\t@State() toggleContent = false\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(InfobarVariants, newValue, InfobarClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tlet inverse = !this.inverse\n\t\tlet variant = this.inverse ? 'secondary' : this.variant\n\n\t\tif (this.variant == 'warning') {\n\t\t\tinverse = false\n\t\t\tvariant = 'secondary'\n\t\t}\n\n\t\tconst closeButton = (\n\t\t\t<div class={InfobarClass.close}>\n\t\t\t\t<gov-button size=\"s\" wcagLabel={this.wcagCloseLabel} type=\"base\" variant={variant} inverse={inverse} on-gov-click={this.onCloseHandler.bind(this)}>\n\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t</gov-button>\n\t\t\t</div>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(InfobarClass.root)} variant={this.variant}>\n\t\t\t\t<section class={InfobarClass.section} role=\"infobar\">\n\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t<div class={InfobarClass.icon}>\n\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={InfobarClass.content + (this.closable ? ' ' + InfobarClass.closable : '')}>\n\t\t\t\t\t\t{this.headline ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class={InfobarClass.headline}>\n\t\t\t\t\t\t\t\t\t<p>{this.headline}</p>\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\twcagLabel={this.wcagToggleLabel}\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\t\t\t\tinverse={inverse}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => (this.toggleContent = !this.toggleContent)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'}></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n\t\t\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t\t{this.closable && closeButton}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCloseHandler(e: CustomEvent<ButtonEvent>) {\n\t\tthis.govClose.emit({\n\t\t\tcomponent: InfobarClass.root,\n\t\t\tref: this.host,\n\t\t\toriginalEvent: e,\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\tif (this.closable) {\n\t\t\tvalidateWcagProp(this.wcagCloseLabel, 'wcag-close-label', InfobarClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.wcagToggleLabel, 'wcag-toggle-label', InfobarClass.root)\n\t\t}\n\t}\n}\n"]}
@@ -11,18 +11,18 @@ export class GovModal {
11
11
  this.open = false;
12
12
  this.blockClose = false;
13
13
  this.label = undefined;
14
- this.role = "dialog";
15
- this.labelTag = "h2";
14
+ this.role = 'dialog';
15
+ this.labelTag = 'h2';
16
16
  this.wcagLabelledBy = undefined;
17
17
  this.wcagDescribedBy = undefined;
18
- this.wcagCloseLabel = undefined;
18
+ this.wcagCloseLabel = 'Zavřít okno';
19
19
  this.wcagCloseLabelledBy = undefined;
20
20
  this.h = govHost(this.host);
21
- this.labelId = createID("GovModalLabel");
22
- this.contentId = createID("GovModalContent");
21
+ this.labelId = createID('GovModalLabel');
22
+ this.contentId = createID('GovModalContent');
23
23
  }
24
24
  validateLabelTag(newValue) {
25
- const validTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
25
+ const validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
26
26
  if (newValue) {
27
27
  if (!validTags.includes(newValue)) {
28
28
  govErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`);
@@ -56,7 +56,7 @@ export class GovModal {
56
56
  }
57
57
  render() {
58
58
  const LabelTag = this.labelTag;
59
- return (h(Host, { class: this.h.classes(ModalClass.root), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot("icon") && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { disabled: this.blockClose, class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), this.h.hasSlot("footer") && (h("div", { class: ModalClass.footer }, h("slot", { name: "footer" }))))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
59
+ return (h(Host, { class: this.h.classes(ModalClass.root), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot('icon') && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { disabled: this.blockClose, class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), this.h.hasSlot('footer') && (h("div", { class: ModalClass.footer }, h("slot", { name: "footer" }))))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
60
60
  }
61
61
  onCloseHandler(e) {
62
62
  e.stopPropagation();
@@ -81,8 +81,8 @@ export class GovModal {
81
81
  * Validate the WCAG attributes of the component
82
82
  */
83
83
  async validateWcag() {
84
- validateWcagRef(this.wcagLabelledBy, "wcag-labelled-by", ModalClass.root);
85
- validateWcagRef(this.wcagDescribedBy, "wcag-described-by", ModalClass.root);
84
+ validateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root);
85
+ validateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root);
86
86
  }
87
87
  static get is() { return "gov-modal"; }
88
88
  static get originalStyleUrls() {
@@ -172,7 +172,7 @@ export class GovModal {
172
172
  },
173
173
  "attribute": "role",
174
174
  "reflect": false,
175
- "defaultValue": "\"dialog\""
175
+ "defaultValue": "'dialog'"
176
176
  },
177
177
  "labelTag": {
178
178
  "type": "string",
@@ -190,7 +190,7 @@ export class GovModal {
190
190
  },
191
191
  "attribute": "label-tag",
192
192
  "reflect": false,
193
- "defaultValue": "\"h2\""
193
+ "defaultValue": "'h2'"
194
194
  },
195
195
  "wcagLabelledBy": {
196
196
  "type": "string",
@@ -241,7 +241,8 @@ export class GovModal {
241
241
  "text": "Adds accessible label for the modal close button that is only shown for screen readers."
242
242
  },
243
243
  "attribute": "wcag-close-label",
244
- "reflect": false
244
+ "reflect": false,
245
+ "defaultValue": "'Zav\u0159\u00EDt okno'"
245
246
  },
246
247
  "wcagCloseLabelledBy": {
247
248
  "type": "string",
@@ -1 +1 @@
1
- {"version":3,"file":"gov-modal.js","sourceRoot":"","sources":["../../../../../../src/components/gov-modal/gov-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OA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AAI,CAAC,CAAC,CAAC,CAAA;KACrB;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from \"@stencil/core\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateWcagRef } from \"../../helpers/Validate/wcag\"\nimport { createID } from \"../../utils/string.utils\"\nimport { delay } from \"../../utils/utils\"\nimport { ModalClass } from \"./constants\"\nimport { Nullable } from \"../../types/interfaces\"\n\n@Component({\n\ttag: \"gov-modal\",\n\tstyleUrl: \"gov-modal.scss\",\n})\nexport class GovModal {\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(\"GovModalLabel\")\n\t\tthis.contentId = createID(\"GovModalContent\")\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Attribute allowing blocking the modal closing\n\t */\n\t@Prop() blockClose = 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: Nullable<string> = \"dialog\"\n\t/**\n\t * Used to change the HTML 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@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.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\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\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.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\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\tdisabled={this.blockClose}\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{this.h.hasSlot(\"footer\") && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tif(this.blockClose === false) {\n\t\t\tthis.hideModal()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding 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, \"wcag-labelled-by\", ModalClass.root)\n\t\tvalidateWcagRef(this.wcag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EACF,CAAC;EAEO,cAAc,CAAC,CAAe;IACrC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE;MAC9B,IAAI,CAAC,SAAS,EAAE,CAAA;MAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACrB;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from '@stencil/core'\nimport { govHost, toBoolAttr } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateWcagRef } from '../../helpers/Validate/wcag'\nimport { Nullable } from '../../types/interfaces'\nimport { createID } from '../../utils/string.utils'\nimport { delay } from '../../utils/utils'\nimport { ModalClass } from './constants'\n\n@Component({\n\ttag: 'gov-modal',\n\tstyleUrl: 'gov-modal.scss',\n})\nexport class GovModal {\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('GovModalLabel')\n\t\tthis.contentId = createID('GovModalContent')\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Attribute allowing blocking the modal closing\n\t */\n\t@Prop() blockClose = 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: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML 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' }) readonly wcagCloseLabel: string = 'Zavřít okno'\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@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.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\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\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.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\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\tdisabled={this.blockClose}\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{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop wcag-label={this.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy} on-gov-click={this.onCloseHandler.bind(this)} />\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideModal()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding 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, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"]}
@@ -1,27 +1,27 @@
1
1
  import { h, Host } from "@stencil/core";
2
- import { createID } from "../../utils/string.utils";
3
- import { validateWcagRef } from "../../helpers/Validate/wcag";
4
- import { ModalClass } from "../gov-modal/constants";
5
- import { canValidateWcagOnRender } from "../../helpers/Dom/win";
6
- import { delay } from "../../utils/utils";
7
2
  import { govHost, toBoolAttr } from "../../helpers/Dom/template";
3
+ import { canValidateWcagOnRender } from "../../helpers/Dom/win";
8
4
  import { govErrorLog } from "../../helpers/Log/gov.log";
5
+ import { validateWcagRef } from "../../helpers/Validate/wcag";
6
+ import { createID } from "../../utils/string.utils";
7
+ import { delay } from "../../utils/utils";
8
+ import { ModalClass } from "../gov-modal/constants";
9
9
  export class GovPrompt {
10
10
  constructor() {
11
11
  this.open = false;
12
12
  this.label = undefined;
13
- this.role = "dialog";
14
- this.labelTag = "h2";
13
+ this.role = 'dialog';
14
+ this.labelTag = 'h2';
15
15
  this.wcagLabelledBy = undefined;
16
16
  this.wcagDescribedBy = undefined;
17
- this.wcagCloseLabel = undefined;
17
+ this.wcagCloseLabel = 'Zavřít okno';
18
18
  this.wcagCloseLabelledBy = undefined;
19
19
  this.h = govHost(this.host);
20
- this.labelId = createID("GovPromptLabel");
21
- this.contentId = createID("GovPromptContent");
20
+ this.labelId = createID('GovPromptLabel');
21
+ this.contentId = createID('GovPromptContent');
22
22
  }
23
23
  validateLabelTag(newValue) {
24
- const validTags = ["h1", "h2", "h3", "h4", "h5", "h6"];
24
+ const validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
25
25
  if (newValue) {
26
26
  if (!validTags.includes(newValue)) {
27
27
  govErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`);
@@ -55,7 +55,7 @@ export class GovPrompt {
55
55
  }
56
56
  render() {
57
57
  const LabelTag = this.labelTag;
58
- return (h(Host, { class: this.h.classes(ModalClass.rootPrompt), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot("icon") && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), h("div", { class: ModalClass.actions }, h("slot", { name: "actions" })))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
58
+ return (h(Host, { class: this.h.classes(ModalClass.rootPrompt), open: this.open }, h("dialog", { class: ModalClass.dialog, hidden: !this.open, tabindex: "-1", open: this.open, "aria-modal": "true", "aria-hidden": toBoolAttr(!this.open), "aria-labelledby": this.wcagLabelledBy || this.labelId, "aria-describedby": this.wcagDescribedBy || this.contentId, role: this.role }, h("div", { class: ModalClass.inner }, h("div", { class: ModalClass.header }, this.h.hasSlot('icon') && (h("div", { class: ModalClass.icon }, h("slot", { name: "icon" }))), this.label && (h(LabelTag, { class: ModalClass.title, id: this.labelId }, this.label)), h("gov-button", { class: ModalClass.close, variant: "primary", wcagLabel: this.wcagCloseLabel, wcagLabelledBy: this.wcagCloseLabelledBy, type: "base", "on-gov-click": this.onCloseHandler.bind(this) }, h("gov-icon", { name: "x-lg" }))), h("div", { class: ModalClass.content, id: this.contentId }, h("slot", null)), h("div", { class: ModalClass.actions }, h("slot", { name: "actions" })))), this.open ? (h("gov-backdrop", { "wcag-label": this.wcagCloseLabel, "wcag-labelled-by": this.wcagCloseLabelledBy, "on-gov-click": this.onCloseHandler.bind(this) })) : null));
59
59
  }
60
60
  onCloseHandler(e) {
61
61
  e.stopPropagation();
@@ -78,8 +78,8 @@ export class GovPrompt {
78
78
  * Validate the WCAG attributes of the component
79
79
  */
80
80
  async validateWcag() {
81
- validateWcagRef(this.wcagLabelledBy, "wcag-labelled-by", ModalClass.root);
82
- validateWcagRef(this.wcagDescribedBy, "wcag-described-by", ModalClass.root);
81
+ validateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root);
82
+ validateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root);
83
83
  }
84
84
  static get is() { return "gov-prompt"; }
85
85
  static get originalStyleUrls() {
@@ -151,7 +151,7 @@ export class GovPrompt {
151
151
  },
152
152
  "attribute": "role",
153
153
  "reflect": false,
154
- "defaultValue": "\"dialog\""
154
+ "defaultValue": "'dialog'"
155
155
  },
156
156
  "labelTag": {
157
157
  "type": "string",
@@ -169,7 +169,7 @@ export class GovPrompt {
169
169
  },
170
170
  "attribute": "label-tag",
171
171
  "reflect": false,
172
- "defaultValue": "\"h2\""
172
+ "defaultValue": "'h2'"
173
173
  },
174
174
  "wcagLabelledBy": {
175
175
  "type": "string",
@@ -220,7 +220,8 @@ export class GovPrompt {
220
220
  "text": "Adds accessible label for the modal close button that is only shown for screen readers."
221
221
  },
222
222
  "attribute": "wcag-close-label",
223
- "reflect": false
223
+ "reflect": false,
224
+ "defaultValue": "'Zav\u0159\u00EDt okno'"
224
225
  },
225
226
  "wcagCloseLabelledBy": {
226
227
  "type": "string",
@@ -1 +1 @@
1
- {"version":3,"file":"gov-prompt.js","sourceRoot":"","sources":["../../../../../../src/components/gov-promp/gov-prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB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CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } 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 { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { Nullable } from \"../../types/interfaces\"\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({ mutable: true }) 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: Nullable<string> = \"dialog\"\n\t/**\n\t * Used to change the HTML 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@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.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\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\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.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\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{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\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 * Hiding 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, \"wcag-labelled-by\", ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", ModalClass.root)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-prompt.js","sourceRoot":"","sources":["../../../../../../src/components/gov-promp/gov-prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA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,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport { govHost, toBoolAttr } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateWcagRef } from '../../helpers/Validate/wcag'\nimport { Nullable } from '../../types/interfaces'\nimport { createID } from '../../utils/string.utils'\nimport { delay } from '../../utils/utils'\nimport { ModalClass } from '../gov-modal/constants'\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({ mutable: true }) 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: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML 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' }) readonly wcagCloseLabel: string = 'Zavřít okno'\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@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.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\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\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.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\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{this.open ? (\n\t\t\t\t\t<gov-backdrop wcag-label={this.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy} on-gov-click={this.onCloseHandler.bind(this)} />\n\t\t\t\t) : null}\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 * Hiding 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, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"]}
@@ -238,7 +238,7 @@
238
238
  .gov-statsbar-item__icon, .gov-statsbar-item__number {
239
239
  margin-bottom: 1rem;
240
240
  }
241
- .gov-statsbar-item__icon {
241
+ .gov-statsbar-item__icon, .gov-statsbar-item__icon .gov-icon {
242
242
  display: block;
243
243
  width: 2rem;
244
244
  height: 2rem;
@@ -277,7 +277,7 @@
277
277
  .gov-statsbar-item {
278
278
  padding: 2.5rem;
279
279
  }
280
- .gov-statsbar-item__icon {
280
+ .gov-statsbar-item__icon, .gov-statsbar-item__icon .gov-icon {
281
281
  width: 3rem;
282
282
  height: 3rem;
283
283
  }
@@ -298,7 +298,6 @@
298
298
  [type=solid][variant=primary].gov-tag .element {
299
299
  background-color: var(--gov-button-primary-solid-bg, var(--gov-color-primary));
300
300
  color: var(--gov-button-primary-solid-color, var(--gov-color-neutral-white));
301
- border-width: 0;
302
301
  }
303
302
  [type=solid][variant=primary][inverse=""].gov-tag .element, [type=solid][variant=primary][inverse=true i].gov-tag .element, [type=solid][variant=primary][inverse="1"].gov-tag .element {
304
303
  color: var(--gov-button-primary-solid-inverse-color, var(--gov-color-primary));
@@ -375,7 +374,6 @@
375
374
  }
376
375
  [type=base][variant=primary].gov-tag .element {
377
376
  color: var(--gov-button-primary-base-color, var(--gov-color-primary));
378
- border-width: 0;
379
377
  }
380
378
  [type=base][variant=primary][inverse=""].gov-tag .element, [type=base][variant=primary][inverse=true i].gov-tag .element, [type=base][variant=primary][inverse="1"].gov-tag .element {
381
379
  color: var(--gov-button-primary-base-inverse-color, var(--gov-color-neutral-white));
@@ -409,7 +407,6 @@
409
407
  }
410
408
  [type=link][variant=primary].gov-tag .element {
411
409
  color: var(--gov-button-primary-link-color, var(--gov-color-primary));
412
- border-width: 0;
413
410
  }
414
411
  [type=link][variant=primary][inverse=""].gov-tag .element, [type=link][variant=primary][inverse=true i].gov-tag .element, [type=link][variant=primary][inverse="1"].gov-tag .element {
415
412
  color: var(--gov-button-primary-link-inverse-color, var(--gov-color-neutral-white));
@@ -445,7 +442,6 @@
445
442
  [type=solid][variant=secondary].gov-tag .element {
446
443
  background-color: var(--gov-button-secondary-solid-bg, var(--gov-color-secondary));
447
444
  color: var(--gov-button-secondary-solid-color, var(--gov-color-neutral-white));
448
- border-width: 0;
449
445
  }
450
446
  [type=solid][variant=secondary][inverse=""].gov-tag .element, [type=solid][variant=secondary][inverse=true i].gov-tag .element, [type=solid][variant=secondary][inverse="1"].gov-tag .element {
451
447
  color: var(--gov-button-secondary-solid-inverse-color, var(--gov-color-secondary));
@@ -524,7 +520,6 @@
524
520
  }
525
521
  [type=base][variant=secondary].gov-tag .element {
526
522
  color: var(--gov-button-secondary-base-color, var(--gov-color-secondary));
527
- border-width: 0;
528
523
  }
529
524
  [type=base][variant=secondary][inverse=""].gov-tag .element, [type=base][variant=secondary][inverse=true i].gov-tag .element, [type=base][variant=secondary][inverse="1"].gov-tag .element {
530
525
  color: var(--gov-button-secondary-base-inverse-color, var(--gov-color-neutral-white));
@@ -558,7 +553,6 @@
558
553
  }
559
554
  [type=link][variant=secondary].gov-tag .element {
560
555
  color: var(--gov-button-secondary-link-color, var(--gov-color-secondary));
561
- border-width: 0;
562
556
  }
563
557
  [type=link][variant=secondary][inverse=""].gov-tag .element, [type=link][variant=secondary][inverse=true i].gov-tag .element, [type=link][variant=secondary][inverse="1"].gov-tag .element {
564
558
  color: var(--gov-button-secondary-link-inverse-color, var(--gov-color-neutral-white));
@@ -594,7 +588,6 @@
594
588
  [type=solid][variant=error].gov-tag .element {
595
589
  background-color: var(--gov-button-error-solid-bg, var(--gov-color-error));
596
590
  color: var(--gov-button-error-solid-color, var(--gov-color-neutral-white));
597
- border-width: 0;
598
591
  }
599
592
  [type=solid][variant=error][inverse=""].gov-tag .element, [type=solid][variant=error][inverse=true i].gov-tag .element, [type=solid][variant=error][inverse="1"].gov-tag .element {
600
593
  color: var(--gov-button-error-solid-inverse-color, var(--gov-color-error));
@@ -671,7 +664,6 @@
671
664
  }
672
665
  [type=base][variant=error].gov-tag .element {
673
666
  color: var(--gov-button-error-base-color, var(--gov-color-error));
674
- border-width: 0;
675
667
  }
676
668
  [type=base][variant=error][inverse=""].gov-tag .element, [type=base][variant=error][inverse=true i].gov-tag .element, [type=base][variant=error][inverse="1"].gov-tag .element {
677
669
  color: var(--gov-button-error-base-inverse-color, var(--gov-color-neutral-white));
@@ -705,7 +697,6 @@
705
697
  }
706
698
  [type=link][variant=error].gov-tag .element {
707
699
  color: var(--gov-button-error-link-color, var(--gov-color-error));
708
- border-width: 0;
709
700
  }
710
701
  [type=link][variant=error][inverse=""].gov-tag .element, [type=link][variant=error][inverse=true i].gov-tag .element, [type=link][variant=error][inverse="1"].gov-tag .element {
711
702
  color: var(--gov-button-error-link-inverse-color, var(--gov-color-neutral-white));
@@ -741,7 +732,6 @@
741
732
  [type=solid][variant=success].gov-tag .element {
742
733
  background-color: var(--gov-button-success-solid-bg, var(--gov-color-success-500));
743
734
  color: var(--gov-button-success-solid-color, var(--gov-color-neutral-white));
744
- border-width: 0;
745
735
  }
746
736
  [type=solid][variant=success][inverse=""].gov-tag .element, [type=solid][variant=success][inverse=true i].gov-tag .element, [type=solid][variant=success][inverse="1"].gov-tag .element {
747
737
  color: var(--gov-button-success-solid-inverse-color, var(--gov-color-success));
@@ -818,7 +808,6 @@
818
808
  }
819
809
  [type=base][variant=success].gov-tag .element {
820
810
  color: var(--gov-button-success-base-color, var(--gov-color-success-500));
821
- border-width: 0;
822
811
  }
823
812
  [type=base][variant=success][inverse=""].gov-tag .element, [type=base][variant=success][inverse=true i].gov-tag .element, [type=base][variant=success][inverse="1"].gov-tag .element {
824
813
  color: var(--gov-button-success-base-inverse-color, var(--gov-color-neutral-white));
@@ -852,7 +841,6 @@
852
841
  }
853
842
  [type=link][variant=success].gov-tag .element {
854
843
  color: var(--gov-button-success-link-color, var(--gov-color-success-500));
855
- border-width: 0;
856
844
  }
857
845
  [type=link][variant=success][inverse=""].gov-tag .element, [type=link][variant=success][inverse=true i].gov-tag .element, [type=link][variant=success][inverse="1"].gov-tag .element {
858
846
  color: var(--gov-button-success-link-inverse-color, var(--gov-color-neutral-white));
@@ -888,7 +876,6 @@
888
876
  [type=solid][variant=warning].gov-tag .element {
889
877
  background-color: var(--gov-button-warning-solid-bg, var(--gov-color-warning-500));
890
878
  color: var(--gov-button-warning-solid-color, var(--gov-color-neutral-white));
891
- border-width: 0;
892
879
  }
893
880
  [type=solid][variant=warning][inverse=""].gov-tag .element, [type=solid][variant=warning][inverse=true i].gov-tag .element, [type=solid][variant=warning][inverse="1"].gov-tag .element {
894
881
  color: var(--gov-button-warning-solid-inverse-color, var(--gov-color-warning));
@@ -965,7 +952,6 @@
965
952
  }
966
953
  [type=base][variant=warning].gov-tag .element {
967
954
  color: var(--gov-button-warning-base-color, var(--gov-color-warning-500));
968
- border-width: 0;
969
955
  }
970
956
  [type=base][variant=warning][inverse=""].gov-tag .element, [type=base][variant=warning][inverse=true i].gov-tag .element, [type=base][variant=warning][inverse="1"].gov-tag .element {
971
957
  color: var(--gov-button-warning-base-inverse-color, var(--gov-color-neutral-white));
@@ -999,7 +985,6 @@
999
985
  }
1000
986
  [type=link][variant=warning].gov-tag .element {
1001
987
  color: var(--gov-button-warning-link-color, var(--gov-color-warning-500));
1002
- border-width: 0;
1003
988
  }
1004
989
  [type=link][variant=warning][inverse=""].gov-tag .element, [type=link][variant=warning][inverse=true i].gov-tag .element, [type=link][variant=warning][inverse="1"].gov-tag .element {
1005
990
  color: var(--gov-button-warning-link-inverse-color, var(--gov-color-neutral-white));
@@ -3,9 +3,12 @@ import { govHost } from "../../helpers/Dom/template";
3
3
  import { validateProp } from "../../helpers/Validate/props";
4
4
  import { ButtonSizes, ButtonVariants } from "../gov-button/button/constants";
5
5
  import { TagClass } from "./constants";
6
+ import { prepareIconFormat } from "../gov-icon/helpers";
6
7
  export class GovTag {
7
8
  constructor() {
8
9
  this.inverse = false;
10
+ this.iconLeft = undefined;
11
+ this.iconRight = undefined;
9
12
  this.size = ButtonSizes._S;
10
13
  this.variant = ButtonVariants.PRIMARY;
11
14
  this.h = govHost(this.host);
@@ -21,7 +24,9 @@ export class GovTag {
21
24
  this.validateSize(this.size);
22
25
  }
23
26
  render() {
24
- return (h(Host, { class: this.h.classes(TagClass.root), variant: this.variant, type: this.inverse ? undefined : 'solid', size: this.size, inverse: this.inverse }, h("span", { class: "element" }, this.h.hasSlot('left-icon') && h("slot", { name: "left-icon" }), h("slot", null), this.h.hasSlot('right-icon') && h("slot", { name: "right-icon" }))));
27
+ const iconLeft = prepareIconFormat(this.iconLeft);
28
+ const iconRight = prepareIconFormat(this.iconRight);
29
+ return (h(Host, { class: this.h.classes(TagClass.root), variant: this.variant, type: this.inverse ? undefined : 'solid', size: this.size, inverse: this.inverse }, h("span", { class: "element" }, this.h.hasSlot('left-icon') && h("slot", { name: "left-icon" }), iconLeft && h("gov-icon", { type: iconLeft.type, name: iconLeft.name }), h("slot", null), iconRight && h("gov-icon", { type: iconRight.type, name: iconRight.name }), this.h.hasSlot('right-icon') && h("slot", { name: "right-icon" }))));
25
30
  }
26
31
  static get is() { return "gov-tag"; }
27
32
  static get originalStyleUrls() {
@@ -54,6 +59,40 @@ export class GovTag {
54
59
  "reflect": false,
55
60
  "defaultValue": "false"
56
61
  },
62
+ "iconLeft": {
63
+ "type": "string",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "string",
67
+ "resolved": "string",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": true,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": "Definition of the button icon on the left. The icon must be defined in the form \"type/name\"."
75
+ },
76
+ "attribute": "icon-left",
77
+ "reflect": false
78
+ },
79
+ "iconRight": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "string",
84
+ "resolved": "string",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": true,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": "Definition of the button icon on the left. The icon must be defined in the form \"type/name\"."
92
+ },
93
+ "attribute": "icon-right",
94
+ "reflect": false
95
+ },
57
96
  "size": {
58
97
  "type": "string",
59
98
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"gov-tag.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tag/gov-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAC,WAAW,EAAmB,cAAc,EAAoB,MAAM,gCAAgC,CAAA;AAC9G,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAMpC,MAAM,OAAO,MAAM;EAGlB;mBASoC,KAAK;gBAIe,WAAW,CAAC,EAAE;mBAIT,cAAc,CAAC,OAAO;IAhBlF,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAkBD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;EACtD,CAAC;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;EACnD,CAAC;EAED,iBAAiB;IAChB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAClC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;EAC7B,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EACvC,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EACxC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO;MACxC,YAAM,KAAK,EAAC,SAAS;QACnB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,YAAM,IAAI,EAAC,WAAW,GAAQ;QAC9D,eAAO;QACN,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAM,IAAI,EAAC,YAAY,GAAQ,CAC1D,CACD,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType} from '../gov-button/button/constants'\nimport {TagClass} from './constants'\n\n@Component({\n\ttag: 'gov-tag',\n\tstyleUrl: 'gov-tag.scss',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: ButtonSizesType = ButtonSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\ttype={this.inverse ? undefined : 'solid'}\n\t\t\t\t\t\tsize={this.size} inverse={this.inverse}>\n\t\t\t\t<span class=\"element\">\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</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-tag.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tag/gov-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,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CAAC,CAAC,OAAO,EACxC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO;MACxC,YAAM,KAAK,EAAC,SAAS;QACnB,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,YAAM,IAAI,EAAC,WAAW,GAAQ;QAC7D,QAAQ,IAAK,gBAAU,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAa;QAC7E,eAAO;QACN,SAAS,IAAK,gBAAU,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,GAAa;QAC/E,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAM,IAAI,EAAC,YAAY,GAAQ,CAC1D,CACD,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType} from '../gov-button/button/constants'\nimport {TagClass} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n\tstyleUrl: 'gov-tag.scss',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: ButtonSizesType = ButtonSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\ttype={this.inverse ? undefined : 'solid'}\n\t\t\t\t\t\tsize={this.size} inverse={this.inverse}>\n\t\t\t\t<span class=\"element\">\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{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot('right-icon') && <slot name=\"right-icon\"></slot>}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -33,7 +33,7 @@ export class GovToast {
33
33
  this.timeout = setTimeout(() => {
34
34
  this.host.classList.add(ToastClass.hidden);
35
35
  setTimeout(() => {
36
- this.destroy.bind(this);
36
+ this.destroy().catch();
37
37
  this.govClose.emit(this.toastId);
38
38
  }, 600);
39
39
  }, this.time);
@@ -59,6 +59,7 @@ export class GovToast {
59
59
  async destroy() {
60
60
  clearTimeout(this.timeout);
61
61
  const toast = document.querySelector(`[data-toast-id="${this.toastId}"]`);
62
+ console.log(toast);
62
63
  if (toast) {
63
64
  toast.classList.add(ToastClass.hidden);
64
65
  if (typeof toast.remove === "function") {