@gov-design-system-ce/components 0.0.58 → 0.0.59

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 (302) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-app.cjs.entry.js +96 -37
  3. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  5. package/dist/cjs/gov-badge.cjs.entry.js +1 -1
  6. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  7. package/dist/cjs/gov-button.cjs.entry.js +1 -1
  8. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  9. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  10. package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
  11. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  12. package/dist/cjs/gov-infobar.cjs.entry.js +90 -0
  13. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -0
  14. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-tooltip-content.cjs.entry.js +16 -4
  16. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  17. package/dist/cjs/gov-tooltip.cjs.entry.js +73 -46
  18. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  19. package/dist/cjs/index-83edd4fe.js +4 -4
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -1
  22. package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -1
  23. package/dist/collection/components/gov-accordion/gov-accordion.css +1 -1
  24. package/dist/collection/components/gov-app/gov-app.css +1 -1
  25. package/dist/collection/components/gov-app/gov-app.js +2 -2
  26. package/dist/collection/components/gov-app/gov-app.js.map +1 -1
  27. package/dist/collection/components/gov-attachments/gov-attachments-item.css +1 -1
  28. package/dist/collection/components/gov-attachments/gov-attachments.css +1 -1
  29. package/dist/collection/components/gov-backdrop/gov-backdrop.css +1 -1
  30. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  31. package/dist/collection/components/gov-badge/gov-badge.css +41 -11
  32. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +1 -1
  33. package/dist/collection/components/gov-button/default/gov-button.css +10 -1
  34. package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +1 -1
  35. package/dist/collection/components/gov-card/gov-card.css +1 -1
  36. package/dist/collection/components/gov-container/gov-container.css +1 -1
  37. package/dist/collection/components/gov-control-group/gov-control-group.css +1 -1
  38. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +1 -1
  39. package/dist/collection/components/gov-empty/gov-empty.css +1 -1
  40. package/dist/collection/components/gov-error-code/gov-error-code.css +1 -1
  41. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +1 -1
  42. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +1 -1
  43. package/dist/collection/components/gov-form/control/gov-form-control.css +1 -1
  44. package/dist/collection/components/gov-form/file/gov-form-file.css +1 -1
  45. package/dist/collection/components/gov-form/group/gov-form-group.css +1 -1
  46. package/dist/collection/components/gov-form/input/gov-form-input.css +1 -1
  47. package/dist/collection/components/gov-form/label/gov-form-label.css +5 -1
  48. package/dist/collection/components/gov-form/message/gov-form-message.css +1 -1
  49. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +1 -1
  50. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +1 -1
  51. package/dist/collection/components/gov-form/radio/gov-form-radio.css +1 -1
  52. package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
  53. package/dist/collection/components/gov-form/select/gov-form-select.css +1 -1
  54. package/dist/collection/components/gov-form/switch/gov-form-switch.css +1 -1
  55. package/dist/collection/components/gov-grid/gov-grid-item.css +1 -1
  56. package/dist/collection/components/gov-grid/gov-grid.css +1 -1
  57. package/dist/collection/components/gov-icon/gov-icon.css +1 -1
  58. package/dist/collection/components/gov-infobar/default/constants.js +12 -0
  59. package/dist/collection/components/gov-infobar/default/constants.js.map +1 -0
  60. package/dist/collection/components/gov-infobar/default/gov-infobar.css +384 -0
  61. package/dist/collection/components/{gov-alert/gov-alert.js → gov-infobar/default/gov-infobar.js} +27 -27
  62. package/dist/collection/components/gov-infobar/default/gov-infobar.js.map +1 -0
  63. package/dist/collection/components/gov-infobar/default/gov-infobar.types.js +2 -0
  64. package/dist/collection/components/gov-infobar/default/gov-infobar.types.js.map +1 -0
  65. package/dist/collection/components/gov-layout/gov-layout-column.css +1 -1
  66. package/dist/collection/components/gov-layout/gov-layout.css +1 -1
  67. package/dist/collection/components/gov-loading/loading/gov-loading.css +1 -1
  68. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +1 -1
  69. package/dist/collection/components/gov-message/gov-message.css +1 -1
  70. package/dist/collection/components/gov-modal/gov-modal.css +1 -1
  71. package/dist/collection/components/gov-nav/gov-nav-item.css +1 -1
  72. package/dist/collection/components/gov-nav/gov-nav.css +1 -1
  73. package/dist/collection/components/gov-pagination/gov-pagination.css +1 -1
  74. package/dist/collection/components/gov-promp/gov-prompt.css +1 -1
  75. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +1 -1
  76. package/dist/collection/components/gov-side-nav/gov-side-nav.css +1 -1
  77. package/dist/collection/components/gov-spacer/gov-spacer.css +1 -1
  78. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +1 -1
  79. package/dist/collection/components/gov-statsbar/gov-statsbar.css +1 -1
  80. package/dist/collection/components/gov-stepper/gov-stepper-item.css +1 -1
  81. package/dist/collection/components/gov-stepper/gov-stepper.css +1 -1
  82. package/dist/collection/components/gov-tabs/gov-tabs-item.css +1 -1
  83. package/dist/collection/components/gov-tabs/gov-tabs.css +1 -1
  84. package/dist/collection/components/gov-tile/container/gov-tiles.css +1 -1
  85. package/dist/collection/components/gov-tile/gov-tile.css +1 -1
  86. package/dist/collection/components/gov-toast/gov-toast.css +2 -2
  87. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +32 -27
  88. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +101 -5
  89. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
  90. package/dist/collection/components/gov-tooltip/gov-tooltip.css +1 -17
  91. package/dist/collection/components/gov-tooltip/gov-tooltip.js +83 -51
  92. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  93. package/dist/collection/components/gov-wizard/gov-wizard-item.css +1 -1
  94. package/dist/collection/components/gov-wizard/gov-wizard.css +1 -1
  95. package/dist/collection/pages/Card.js +11 -9
  96. package/dist/collection/pages/Card.js.map +1 -1
  97. package/dist/collection/pages/Home.js +43 -1
  98. package/dist/collection/pages/Home.js.map +1 -1
  99. package/dist/collection/pages/{Alert.js → Infobar.js} +42 -27
  100. package/dist/collection/pages/Infobar.js.map +1 -0
  101. package/dist/components/gov-accordion-item.js +1 -1
  102. package/dist/components/gov-app.js +1 -1
  103. package/dist/components/gov-app.js.map +1 -1
  104. package/dist/components/gov-attachments-item.js +1 -1
  105. package/dist/components/gov-badge.js +1 -1
  106. package/dist/components/gov-button.js +1 -1
  107. package/dist/components/gov-card.js +1 -1
  108. package/dist/components/gov-form-autocomplete.js +1 -1
  109. package/dist/components/gov-form-checkbox.js +1 -1
  110. package/dist/components/gov-form-file.js +1 -1
  111. package/dist/components/gov-form-input.js +1 -1
  112. package/dist/components/gov-form-label.js +1 -1
  113. package/dist/components/gov-form-label.js.map +1 -1
  114. package/dist/components/gov-form-multi-select.js +1 -1
  115. package/dist/components/gov-form-select.js +1 -1
  116. package/dist/components/gov-icon.js +1 -1
  117. package/dist/components/{gov-alert.d.ts → gov-infobar.d.ts} +4 -4
  118. package/dist/components/gov-infobar.js +2 -0
  119. package/dist/components/gov-infobar.js.map +1 -0
  120. package/dist/components/gov-loading.js +1 -1
  121. package/dist/components/gov-modal.js +1 -1
  122. package/dist/components/gov-pagination.js +1 -1
  123. package/dist/components/gov-prompt.js +1 -1
  124. package/dist/components/gov-side-nav-item.js +1 -1
  125. package/dist/components/gov-tabs.js +1 -1
  126. package/dist/components/gov-tile.js +1 -1
  127. package/dist/components/gov-toast.js +1 -1
  128. package/dist/components/gov-tooltip-content.js +1 -1
  129. package/dist/components/gov-tooltip-content.js.map +1 -1
  130. package/dist/components/gov-tooltip.js +1 -1
  131. package/dist/components/gov-tooltip.js.map +1 -1
  132. package/dist/components/gov-wizard-item.js +1 -1
  133. package/dist/components/{p-da3b225f.js → p-30af8d08.js} +2 -2
  134. package/dist/components/p-3e8a9e92.js.map +1 -1
  135. package/dist/components/{p-a6915747.js → p-5d8154f9.js} +2 -2
  136. package/dist/components/{p-0378da4d.js → p-8d44ca3c.js} +2 -2
  137. package/dist/components/p-8d44ca3c.js.map +1 -0
  138. package/dist/components/{p-404f469e.js → p-9a4c910d.js} +2 -2
  139. package/dist/components/{p-70d9d879.js → p-ae179d8a.js} +2 -2
  140. package/dist/components/p-ae179d8a.js.map +1 -0
  141. package/dist/components/{p-35f6490a.js → p-afb7fc88.js} +2 -2
  142. package/dist/components/{p-ee60cdd1.js → p-b430ee05.js} +2 -2
  143. package/dist/components/{p-9cba3cd3.js → p-e24896b9.js} +2 -2
  144. package/dist/core/core.css +1 -1
  145. package/dist/core/core.esm.js +1 -1
  146. package/dist/core/core.esm.js.map +1 -1
  147. package/dist/core/{p-3d0ab343.entry.js → p-0c57e410.entry.js} +2 -2
  148. package/dist/core/{p-42c1935f.entry.js → p-243a61bf.entry.js} +2 -2
  149. package/dist/core/{p-18ef9623.entry.js → p-2bf0c1c5.entry.js} +2 -2
  150. package/dist/core/p-2c0ac7ab.entry.js +2 -0
  151. package/dist/core/{p-85258200.entry.js.map → p-2c0ac7ab.entry.js.map} +1 -1
  152. package/dist/core/p-307d4c56.entry.js +2 -0
  153. package/dist/core/p-307d4c56.entry.js.map +1 -0
  154. package/dist/core/{p-6a65af35.entry.js → p-32a4b7e3.entry.js} +2 -2
  155. package/dist/core/p-32a4b7e3.entry.js.map +1 -0
  156. package/dist/core/{p-bd1cb5bd.entry.js → p-4452c278.entry.js} +2 -2
  157. package/dist/core/{p-a85f4a62.entry.js → p-49729bd4.entry.js} +2 -2
  158. package/dist/core/{p-ae894a40.js → p-570ef4e5.js} +2 -2
  159. package/dist/core/p-5cc3e768.entry.js +2 -0
  160. package/dist/core/p-5cc3e768.entry.js.map +1 -0
  161. package/dist/core/{p-33bf5974.entry.js → p-7372b066.entry.js} +2 -2
  162. package/dist/core/{p-69f944d1.entry.js → p-73fb7ac7.entry.js} +2 -2
  163. package/dist/core/{p-87aca157.entry.js → p-7702c8c2.entry.js} +2 -2
  164. package/dist/core/{p-9d72d80b.entry.js → p-7e8d2066.entry.js} +2 -2
  165. package/dist/core/{p-a5d00433.entry.js → p-7fa1290e.entry.js} +2 -2
  166. package/dist/core/{p-fb99f144.entry.js → p-8033916b.entry.js} +2 -2
  167. package/dist/core/p-82b4b522.entry.js +2 -0
  168. package/dist/core/p-82b4b522.entry.js.map +1 -0
  169. package/dist/core/{p-8fce08d1.entry.js → p-8667d5df.entry.js} +2 -2
  170. package/dist/core/{p-41e88980.entry.js → p-93897e60.entry.js} +2 -2
  171. package/dist/core/{p-41e88980.entry.js.map → p-93897e60.entry.js.map} +1 -1
  172. package/dist/core/{p-cacd0fed.entry.js → p-998c3336.entry.js} +2 -2
  173. package/dist/core/{p-404f469e.js → p-9a4c910d.js} +2 -2
  174. package/dist/core/{p-667dc3de.entry.js → p-afa12399.entry.js} +2 -2
  175. package/dist/core/{p-70140f70.entry.js → p-b0c97376.entry.js} +2 -2
  176. package/dist/core/p-bcf71ab5.entry.js +2 -0
  177. package/dist/core/p-bcf71ab5.entry.js.map +1 -0
  178. package/dist/core/{p-0c1697ce.entry.js → p-c4c9ff83.entry.js} +2 -2
  179. package/dist/core/{p-af646ce2.entry.js → p-c61444f7.entry.js} +2 -2
  180. package/dist/core/p-c61444f7.entry.js.map +1 -0
  181. package/dist/core/{p-d4cfa93a.entry.js → p-cb37644f.entry.js} +2 -2
  182. package/dist/core/{p-9bfab069.entry.js → p-ce262a72.entry.js} +2 -2
  183. package/dist/core/p-f9dfaff1.entry.js +2 -0
  184. package/dist/core/p-f9dfaff1.entry.js.map +1 -0
  185. package/dist/core/{p-13624a77.entry.js → p-fea58abc.entry.js} +2 -2
  186. package/dist/core/{p-dd39ede4.entry.js → p-ff97a688.entry.js} +2 -2
  187. package/dist/esm/{constants-f7b618c2.js → constants-887c5391.js} +2 -2
  188. package/dist/esm/{constants-f7b618c2.js.map → constants-887c5391.js.map} +1 -1
  189. package/dist/esm/core.js +1 -1
  190. package/dist/esm/gov-accordion.entry.js +1 -1
  191. package/dist/esm/gov-app.entry.js +96 -37
  192. package/dist/esm/gov-app.entry.js.map +1 -1
  193. package/dist/esm/gov-attachments_3.entry.js +1 -1
  194. package/dist/esm/gov-backdrop.entry.js +1 -1
  195. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  196. package/dist/esm/gov-badge.entry.js +1 -1
  197. package/dist/esm/gov-badge.entry.js.map +1 -1
  198. package/dist/esm/gov-breadcrumbs.entry.js +1 -1
  199. package/dist/esm/gov-button.entry.js +2 -2
  200. package/dist/esm/gov-button.entry.js.map +1 -1
  201. package/dist/esm/gov-card.entry.js +1 -1
  202. package/dist/esm/gov-form-checkbox.entry.js +1 -1
  203. package/dist/esm/gov-form-file.entry.js +1 -1
  204. package/dist/esm/gov-form-input.entry.js +1 -1
  205. package/dist/esm/gov-form-label.entry.js +1 -1
  206. package/dist/esm/gov-form-label.entry.js.map +1 -1
  207. package/dist/esm/gov-form-multi-select.entry.js +1 -1
  208. package/dist/esm/gov-form-radio.entry.js +1 -1
  209. package/dist/esm/gov-form-select.entry.js +1 -1
  210. package/dist/esm/gov-form-switch.entry.js +1 -1
  211. package/dist/esm/gov-icon.entry.js +1 -1
  212. package/dist/esm/gov-infobar.entry.js +86 -0
  213. package/dist/esm/gov-infobar.entry.js.map +1 -0
  214. package/dist/esm/gov-modal.entry.js +1 -1
  215. package/dist/esm/gov-nav.entry.js +1 -1
  216. package/dist/esm/gov-pagination.entry.js +1 -1
  217. package/dist/esm/gov-prompt.entry.js +1 -1
  218. package/dist/esm/gov-side-nav.entry.js +1 -1
  219. package/dist/esm/gov-skeleton.entry.js +1 -1
  220. package/dist/esm/gov-tabs.entry.js +1 -1
  221. package/dist/esm/gov-toast.entry.js +1 -1
  222. package/dist/esm/gov-tooltip-content.entry.js +17 -5
  223. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  224. package/dist/esm/gov-tooltip.entry.js +74 -47
  225. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  226. package/dist/esm/gov-wizard.entry.js +1 -1
  227. package/dist/esm/index-ae3c50f1.js +4 -4
  228. package/dist/esm/loader.js +1 -1
  229. package/dist/esm/{wcag-062e7ca9.js → wcag-06bd4d01.js} +2 -2
  230. package/dist/esm/{wcag-062e7ca9.js.map → wcag-06bd4d01.js.map} +1 -1
  231. package/dist/globals.d.ts +2 -0
  232. package/dist/hydrate/index.js +287 -184
  233. package/dist/types/components/gov-app/gov-app.d.ts +1 -1
  234. package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +1 -1
  235. package/dist/types/components/gov-infobar/default/constants.d.ts +12 -0
  236. package/dist/types/components/{gov-alert/gov-alert.d.ts → gov-infobar/default/gov-infobar.d.ts} +9 -9
  237. package/dist/types/components/gov-infobar/default/gov-infobar.types.d.ts +4 -0
  238. package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +19 -1
  239. package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +7 -3
  240. package/dist/types/components.d.ts +116 -84
  241. package/dist/types/pages/Infobar.d.ts +3 -0
  242. package/dist/types/types/typings.d.ts +6 -0
  243. package/package.json +2 -2
  244. package/dist/cjs/gov-alert.cjs.entry.js +0 -90
  245. package/dist/cjs/gov-alert.cjs.entry.js.map +0 -1
  246. package/dist/collection/components/gov-alert/constants.js +0 -12
  247. package/dist/collection/components/gov-alert/constants.js.map +0 -1
  248. package/dist/collection/components/gov-alert/gov-alert.css +0 -398
  249. package/dist/collection/components/gov-alert/gov-alert.js.map +0 -1
  250. package/dist/collection/components/gov-alert/gov-alert.types.js +0 -2
  251. package/dist/collection/components/gov-alert/gov-alert.types.js.map +0 -1
  252. package/dist/collection/pages/Alert.js.map +0 -1
  253. package/dist/components/gov-alert.js +0 -2
  254. package/dist/components/gov-alert.js.map +0 -1
  255. package/dist/components/p-0378da4d.js.map +0 -1
  256. package/dist/components/p-70d9d879.js.map +0 -1
  257. package/dist/core/p-3b9df792.entry.js +0 -2
  258. package/dist/core/p-3b9df792.entry.js.map +0 -1
  259. package/dist/core/p-3e5432d7.entry.js +0 -2
  260. package/dist/core/p-3e5432d7.entry.js.map +0 -1
  261. package/dist/core/p-4c79a97a.entry.js +0 -2
  262. package/dist/core/p-4c79a97a.entry.js.map +0 -1
  263. package/dist/core/p-6a65af35.entry.js.map +0 -1
  264. package/dist/core/p-85258200.entry.js +0 -2
  265. package/dist/core/p-af646ce2.entry.js.map +0 -1
  266. package/dist/core/p-bbcbe1cc.entry.js +0 -2
  267. package/dist/core/p-bbcbe1cc.entry.js.map +0 -1
  268. package/dist/core/p-dfc080f2.entry.js +0 -2
  269. package/dist/core/p-dfc080f2.entry.js.map +0 -1
  270. package/dist/esm/gov-alert.entry.js +0 -86
  271. package/dist/esm/gov-alert.entry.js.map +0 -1
  272. package/dist/types/components/gov-alert/constants.d.ts +0 -12
  273. package/dist/types/components/gov-alert/gov-alert.types.d.ts +0 -4
  274. package/dist/types/pages/Alert.d.ts +0 -3
  275. /package/dist/components/{p-da3b225f.js.map → p-30af8d08.js.map} +0 -0
  276. /package/dist/components/{p-a6915747.js.map → p-5d8154f9.js.map} +0 -0
  277. /package/dist/components/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
  278. /package/dist/components/{p-35f6490a.js.map → p-afb7fc88.js.map} +0 -0
  279. /package/dist/components/{p-ee60cdd1.js.map → p-b430ee05.js.map} +0 -0
  280. /package/dist/components/{p-9cba3cd3.js.map → p-e24896b9.js.map} +0 -0
  281. /package/dist/core/{p-3d0ab343.entry.js.map → p-0c57e410.entry.js.map} +0 -0
  282. /package/dist/core/{p-42c1935f.entry.js.map → p-243a61bf.entry.js.map} +0 -0
  283. /package/dist/core/{p-18ef9623.entry.js.map → p-2bf0c1c5.entry.js.map} +0 -0
  284. /package/dist/core/{p-bd1cb5bd.entry.js.map → p-4452c278.entry.js.map} +0 -0
  285. /package/dist/core/{p-a85f4a62.entry.js.map → p-49729bd4.entry.js.map} +0 -0
  286. /package/dist/core/{p-ae894a40.js.map → p-570ef4e5.js.map} +0 -0
  287. /package/dist/core/{p-33bf5974.entry.js.map → p-7372b066.entry.js.map} +0 -0
  288. /package/dist/core/{p-69f944d1.entry.js.map → p-73fb7ac7.entry.js.map} +0 -0
  289. /package/dist/core/{p-87aca157.entry.js.map → p-7702c8c2.entry.js.map} +0 -0
  290. /package/dist/core/{p-9d72d80b.entry.js.map → p-7e8d2066.entry.js.map} +0 -0
  291. /package/dist/core/{p-a5d00433.entry.js.map → p-7fa1290e.entry.js.map} +0 -0
  292. /package/dist/core/{p-fb99f144.entry.js.map → p-8033916b.entry.js.map} +0 -0
  293. /package/dist/core/{p-8fce08d1.entry.js.map → p-8667d5df.entry.js.map} +0 -0
  294. /package/dist/core/{p-cacd0fed.entry.js.map → p-998c3336.entry.js.map} +0 -0
  295. /package/dist/core/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
  296. /package/dist/core/{p-667dc3de.entry.js.map → p-afa12399.entry.js.map} +0 -0
  297. /package/dist/core/{p-70140f70.entry.js.map → p-b0c97376.entry.js.map} +0 -0
  298. /package/dist/core/{p-0c1697ce.entry.js.map → p-c4c9ff83.entry.js.map} +0 -0
  299. /package/dist/core/{p-d4cfa93a.entry.js.map → p-cb37644f.entry.js.map} +0 -0
  300. /package/dist/core/{p-9bfab069.entry.js.map → p-ce262a72.entry.js.map} +0 -0
  301. /package/dist/core/{p-13624a77.entry.js.map → p-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,CAAC,aAAa,CAAC,IAC5EH,qBAAQ,CACH,CACI,KAEXA,qBAAQ,CACR,CACI,CACG,EACT,IAAI,CAAC,QAAQ,IAAI,WAAW,CACvB,EACP;GACD;EAED,cAAc,CAAC,CAA2B;IACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAE,UAAU,CAAC,IAAI;MAC1B,GAAG,EAAE,IAAI,CAAC,IAAI;MACd,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,YAAY;IACjB,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClBI,qBAAgB,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;KAC1E;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClBA,qBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;KAC5E;GACD;;;;;;;;;;","names":["pick","Variants","govHost","validateProp","canValidateWcagOnRender","delay","h","Host","Fragment","toBoolAttr","validateWcagProp"],"sources":["../../../packages/core/src/components/gov-alert/constants.ts","../../../packages/core/src/components/gov-alert/gov-alert.scss?tag=gov-alert","../../../packages/core/src/components/gov-alert/gov-alert.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const AlertVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'WARNING', 'ERROR', 'SUCCESS'])\nexport type VariantType = `${ValueOf<typeof AlertVariants>}`\n\nexport const AlertClass = {\n\troot: 'gov-alert',\n\tsection: 'gov-alert__section',\n\ticon: 'gov-alert__icon',\n\tcontent: 'gov-alert__content',\n\theadline: 'gov-alert__headline',\n\tclose: 'gov-alert__close',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-alert\";\n\n#{$class} {\n\t@include base();\n\t&__section {\n\t\t@include container();\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\tpadding-top: rem-calc(16);\n\t\tpadding-bottom: rem-calc(16);\n\t}\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\t& > * {\n\t\t\twidth: rem-calc(20);\n\t\t\theight: rem-calc(20);\n\t\t}\n\t}\n\t&__headline {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\n\t\t+ div {\n\t\t\tmargin-top: rem-calc(8);\n\t\t}\n\n\t\tp {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\tgov-button {\n\t\t\tmargin-top: rem-calc(-4);\n\t\t}\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t\tpadding-right: rem-calc(52);\n\t\tp {\n\t\t\t@include typography($font-size-m);\n\t\t}\n\t\ta {\n\t\t\tcolor: inherit;\n\t\t\t@include hover() {\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n\t&__close {\n\t\tposition: absolute;\n\t\ttop: rem-calc(10);\n\t\tright: rem-calc(16);\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $alert-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tbackground-color: get(\"bg-color\", $definitions);\n\t\t\t#{$class} {\n\t\t\t\t&__icon {\n\t\t\t\t\tcolor: get(\"icon-color\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tcolor: get(\"text-color\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@if deep-map-check($definitions, \"border\") {\n\t\t\t\tborder-bottom: $alert-border;\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\tborder-bottom: $alert-border;\n\t\t\t\tbackground-color: $alert-inverse-bg;\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__icon {\n\t\t\t\t\t\tcolor: get(\"bg-color\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t\t&__content {\n\t\t\t\t\t\tcolor: $alert-inverse-color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: xl) {\n\t\t&__content {\n\t\t\tpadding-right: rem-calc(32);\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { AlertClass, AlertVariants, VariantType } from \"./constants\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { AlertEvent } from \"./gov-alert.types\"\nimport { ButtonEvent } from \"../gov-button/default/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\ttag: \"gov-alert\",\n\tstyleUrl: \"gov-alert.scss\",\n})\nexport class GovAlert {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovAlertElement\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 alert is closable\n\t */\n\t@Prop({ attribute: \"wcag-close-label\" }) readonly wcagCloseLabel: string\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the alert has headline\n\t */\n\t@Prop({ attribute: \"wcag-toggle-label\" }) readonly wcagToggleLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({ eventName: \"gov-close\" }) govClose: EventEmitter<AlertEvent>\n\t/**\n\t * Displays the option to close the alert\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(AlertVariants, newValue, AlertClass.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={AlertClass.close}>\n\t\t\t\t<gov-button\n\t\t\t\t\tsize=\"s\"\n\t\t\t\t\taria-label={this.wcagCloseLabel}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t>\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(AlertClass.root)} variant={this.variant}>\n\t\t\t\t<section class={AlertClass.section} role=\"alert\">\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<div class={AlertClass.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={AlertClass.content}>\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={AlertClass.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\taria-label={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: AlertClass.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', AlertClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.wcagToggleLabel, 'wcag-toggle-label', AlertClass.root)\n\t\t}\n\t}\n}\n"],"version":3}
@@ -1,12 +0,0 @@
1
- import { Variants } from "../../core/constants/variants";
2
- import { pick } from "../../utils/utils";
3
- export const AlertVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'WARNING', 'ERROR', 'SUCCESS']);
4
- export const AlertClass = {
5
- root: 'gov-alert',
6
- section: 'gov-alert__section',
7
- icon: 'gov-alert__icon',
8
- content: 'gov-alert__content',
9
- headline: 'gov-alert__headline',
10
- close: 'gov-alert__close',
11
- };
12
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/components/gov-alert/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAGxC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;AAGpG,MAAM,CAAC,MAAM,UAAU,GAAG;EACzB,IAAI,EAAE,WAAW;EACjB,OAAO,EAAE,oBAAoB;EAC7B,IAAI,EAAE,iBAAiB;EACvB,OAAO,EAAE,oBAAoB;EAC7B,QAAQ,EAAE,qBAAqB;EAC/B,KAAK,EAAE,kBAAkB;CACzB,CAAA","sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const AlertVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'WARNING', 'ERROR', 'SUCCESS'])\nexport type VariantType = `${ValueOf<typeof AlertVariants>}`\n\nexport const AlertClass = {\n\troot: 'gov-alert',\n\tsection: 'gov-alert__section',\n\ticon: 'gov-alert__icon',\n\tcontent: 'gov-alert__content',\n\theadline: 'gov-alert__headline',\n\tclose: 'gov-alert__close',\n}\n"]}
@@ -1,398 +0,0 @@
1
- /* stylelint-disable */
2
- /* stylelint-enable */
3
- /* stylelint-disable */
4
- /* stylelint-enable */
5
- /* stylelint-disable */
6
- /* stylelint-enable */
7
- /* stylelint-disable */
8
- /* stylelint-enable */
9
- /* [Core] - Buttons
10
- ------------------------------------------------------------------ */
11
- /*
12
- * Gets color from theme-colors or from palette-colors
13
- */
14
- /*
15
- * Converts hex value to rgb colors value
16
- */
17
- /* stylelint-disable order/order */
18
- /* stylelint-enable order/order */
19
- /*
20
- * Generates list of utility classes for margin, padding
21
- *
22
- * Make sure $list of definitions is sorted so that last item is defined last
23
- * So largest views are mentioned last.
24
- */
25
- /*
26
- - Variables - Sizes
27
- */
28
- /* "Constants" for general usage */
29
- /*
30
- - Variables - Layout
31
- */
32
- /**
33
- * Utilities - Offset
34
- */
35
- /* stylelint-disable order/order */
36
- /* stylelint-enable order/order */
37
- /* stylelint-disable order/order */
38
- /* stylelint-enable order/order */
39
- /* stylelint-disable order/order */
40
- /* stylelint-enable order/order */
41
- /**
42
- * Generates CSS3 var with default value
43
- */
44
- /*
45
- - Variables - General
46
- */
47
- /*
48
- - Variables - Typography
49
- */
50
- /*
51
- - Variables - Variants
52
- */
53
- /*
54
- - Variables - Container
55
- */
56
- /*
57
- - Variables - Sizes
58
- */
59
- /* "Constants" for general usage */
60
- /*
61
- - Variables - Accordion
62
- */
63
- /*
64
- - Variables - Attachments
65
- */
66
- /*
67
- - Variables - Alert
68
- */
69
- /*
70
- - Variables - Backdrop
71
- */
72
- /*
73
- - Variables - Buttons (&& Badges)
74
- */
75
- /*
76
- - Variables - Breadcrumbs
77
- */
78
- /*
79
- - Variables - Classes
80
- */
81
- /*
82
- - Variables - Colors
83
- */
84
- /*
85
- - Variables - Control Group
86
- */
87
- /*
88
- - Variables - Cookiebar
89
- */
90
- /*
91
- - Variables - Dropdown
92
- */
93
- /*
94
- - Variables - Card
95
- */
96
- /*
97
- - Variables - Message
98
- */
99
- /*
100
- - Variables - Empty
101
- */
102
- /*
103
- - Variables - Error code
104
- */
105
- /*
106
- - Variables - Grid
107
- */
108
- /*
109
- - Variables - Tiles
110
- */
111
- /*
112
- - Variables - Modal & Prompt
113
- */
114
- /**
115
- * Utilities - Offset
116
- */
117
- /*
118
- - Variables - shadows
119
- */
120
- /* "Constants" for general usage */
121
- /*
122
- - Variables - Statsbar
123
- */
124
- /*
125
- - Variables - Tabs
126
- */
127
- /*
128
- - Variables - Tooltip
129
- */
130
- /*
131
- - Variables - Loading
132
- */
133
- /*
134
- - Variables - Forms
135
- */
136
- /*
137
- - Variables - Form Autocomplete
138
- */
139
- /*
140
- - Variables - Form Message
141
- */
142
- /*
143
- - Variables - Form label
144
- */
145
- /*
146
- - Variables - Form switch
147
- */
148
- /*
149
- - Variables - Form select
150
- */
151
- /*
152
- - Variables - Form input
153
- */
154
- /*
155
- - Variables - Form multiselect
156
- */
157
- /*
158
- - Variables - Form password power
159
- */
160
- /*
161
- - Variables - Form checkbox & radio
162
- */
163
- /*
164
- - Variables - Form group
165
- */
166
- /*
167
- - Variables - Form file
168
- */
169
- /*
170
- - Variables - Toast Message
171
- */
172
- /*
173
- - Variables - Wizard
174
- */
175
- /*
176
- - Variables - Stepper
177
- */
178
- /*
179
- - Variables - Side nav
180
- */
181
- /*
182
- - Variables - Grid & Tile
183
- */
184
- /*
185
- - Variables - Pagination
186
- */
187
- /*
188
- - Variables - Nav
189
- */
190
- /*
191
- - Variables - Layout
192
- */
193
- .gov-spin-animation,
194
- .gov-pseudo-spin-animation::before {
195
- animation: spin 4s linear infinite;
196
- }
197
-
198
- @keyframes spin {
199
- 100% {
200
- transform: rotate(360deg);
201
- }
202
- }
203
- @keyframes countdown {
204
- to {
205
- transform: scaleX(0);
206
- }
207
- }
208
- @keyframes progress {
209
- 0% {
210
- background-position: -200px 0;
211
- }
212
- 100% {
213
- background-position: calc(200px + 100%) 0;
214
- }
215
- }
216
- @keyframes pulse {
217
- 0% {
218
- opacity: 1;
219
- }
220
- 50% {
221
- opacity: 0.4;
222
- }
223
- 100% {
224
- opacity: 1;
225
- }
226
- }
227
- /*
228
- * Alert
229
- */
230
- .gov-alert {
231
- position: relative;
232
- display: block;
233
- width: 100%;
234
- }
235
- .gov-alert__section {
236
- display: block;
237
- width: 100%;
238
- max-width: calc(var(--gov-container-width, 73.75rem) + 2 * var(--gov-container-padding, 2.5rem));
239
- margin-right: auto;
240
- margin-left: auto;
241
- padding-right: var(--gov-container-padding-mobile, 1.25rem);
242
- padding-left: var(--gov-container-padding-mobile, 1.25rem);
243
- display: flex;
244
- gap: 1rem;
245
- padding-top: 1rem;
246
- padding-bottom: 1rem;
247
- }
248
- @media (min-width: 48em) {
249
- .gov-alert__section {
250
- padding-right: var(--gov-container-padding, 2.5rem);
251
- padding-left: var(--gov-container-padding, 2.5rem);
252
- }
253
- }
254
- .gov-alert__icon {
255
- flex: 0 0 auto;
256
- }
257
- .gov-alert__icon > * {
258
- width: 1.25rem;
259
- height: 1.25rem;
260
- }
261
- .gov-alert__headline {
262
- display: flex;
263
- gap: 1rem;
264
- }
265
- .gov-alert__headline + div {
266
- margin-top: 0.5rem;
267
- }
268
- .gov-alert__headline p {
269
- margin-bottom: 0;
270
- }
271
- .gov-alert__headline gov-button {
272
- margin-top: -0.25rem;
273
- }
274
- .gov-alert__content {
275
- padding-right: 3.25rem;
276
- }
277
- .gov-alert__content > *:last-child {
278
- margin-bottom: 0;
279
- }
280
- .gov-alert__content p {
281
- font-weight: var(--gov-text-m-font-weight);
282
- font-size: var(--gov-text-m-font-size);
283
- line-height: var(--gov-text-m-line-height);
284
- letter-spacing: var(--gov-text-m-letter-spacing);
285
- }
286
- .gov-alert__content a {
287
- color: inherit;
288
- }
289
- @media not all and (pointer: coarse) {
290
- .gov-alert__content a:hover {
291
- color: inherit;
292
- }
293
- }
294
- .gov-alert__close {
295
- position: absolute;
296
- top: 0.625rem;
297
- right: 1rem;
298
- }
299
- .gov-alert[variant=warning] {
300
- background-color: var(--gov-alert-warning-bg-color, var(--gov-color-warning));
301
- }
302
- .gov-alert[variant=warning] .gov-alert__icon {
303
- color: var(--gov-alert-warning-icon-color, var(--gov-color-secondary));
304
- }
305
- .gov-alert[variant=warning] .gov-alert__content {
306
- color: var(--gov-alert-warning-text-color, var(--gov-color-secondary));
307
- }
308
- .gov-alert[variant=warning][inverse=""], .gov-alert[variant=warning][inverse=true i], .gov-alert[variant=warning][inverse="1"] {
309
- border-bottom: var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));
310
- background-color: var(--gov-alert-inverse-bg, var(--gov-color-neutral-white));
311
- }
312
- .gov-alert[variant=warning][inverse=""] .gov-alert__icon, .gov-alert[variant=warning][inverse=true i] .gov-alert__icon, .gov-alert[variant=warning][inverse="1"] .gov-alert__icon {
313
- color: var(--gov-alert-warning-bg-color, var(--gov-color-warning));
314
- }
315
- .gov-alert[variant=warning][inverse=""] .gov-alert__content, .gov-alert[variant=warning][inverse=true i] .gov-alert__content, .gov-alert[variant=warning][inverse="1"] .gov-alert__content {
316
- color: var(--gov-alert-inverse-color, var(--gov-color-secondary-800));
317
- }
318
- .gov-alert[variant=error] {
319
- background-color: var(--gov-alert-error-bg-color, var(--gov-color-error));
320
- }
321
- .gov-alert[variant=error] .gov-alert__icon {
322
- color: var(--gov-alert-error-icon-color, var(--gov-color-neutral-white));
323
- }
324
- .gov-alert[variant=error] .gov-alert__content {
325
- color: var(--gov-alert-error-text-color, var(--gov-color-neutral-white));
326
- }
327
- .gov-alert[variant=error][inverse=""], .gov-alert[variant=error][inverse=true i], .gov-alert[variant=error][inverse="1"] {
328
- border-bottom: var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));
329
- background-color: var(--gov-alert-inverse-bg, var(--gov-color-neutral-white));
330
- }
331
- .gov-alert[variant=error][inverse=""] .gov-alert__icon, .gov-alert[variant=error][inverse=true i] .gov-alert__icon, .gov-alert[variant=error][inverse="1"] .gov-alert__icon {
332
- color: var(--gov-alert-error-bg-color, var(--gov-color-error));
333
- }
334
- .gov-alert[variant=error][inverse=""] .gov-alert__content, .gov-alert[variant=error][inverse=true i] .gov-alert__content, .gov-alert[variant=error][inverse="1"] .gov-alert__content {
335
- color: var(--gov-alert-inverse-color, var(--gov-color-secondary-800));
336
- }
337
- .gov-alert[variant=secondary] {
338
- background-color: var(--gov-alert-secondary-bg-color, var(--gov-color-secondary));
339
- }
340
- .gov-alert[variant=secondary] .gov-alert__icon {
341
- color: var(--gov-alert-secondary-icon-color, var(--gov-color-neutral-white));
342
- }
343
- .gov-alert[variant=secondary] .gov-alert__content {
344
- color: var(--gov-alert-secondary-text-color, var(--gov-color-neutral-white));
345
- }
346
- .gov-alert[variant=secondary][inverse=""], .gov-alert[variant=secondary][inverse=true i], .gov-alert[variant=secondary][inverse="1"] {
347
- border-bottom: var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));
348
- background-color: var(--gov-alert-inverse-bg, var(--gov-color-neutral-white));
349
- }
350
- .gov-alert[variant=secondary][inverse=""] .gov-alert__icon, .gov-alert[variant=secondary][inverse=true i] .gov-alert__icon, .gov-alert[variant=secondary][inverse="1"] .gov-alert__icon {
351
- color: var(--gov-alert-secondary-bg-color, var(--gov-color-secondary));
352
- }
353
- .gov-alert[variant=secondary][inverse=""] .gov-alert__content, .gov-alert[variant=secondary][inverse=true i] .gov-alert__content, .gov-alert[variant=secondary][inverse="1"] .gov-alert__content {
354
- color: var(--gov-alert-inverse-color, var(--gov-color-secondary-800));
355
- }
356
- .gov-alert[variant=success] {
357
- background-color: var(--gov-alert-success-bg-color, var(--gov-color-success-500));
358
- }
359
- .gov-alert[variant=success] .gov-alert__icon {
360
- color: var(--gov-alert-success-icon-color, var(--gov-color-neutral-white));
361
- }
362
- .gov-alert[variant=success] .gov-alert__content {
363
- color: var(--gov-alert-success-text-color, var(--gov-color-neutral-white));
364
- }
365
- .gov-alert[variant=success][inverse=""], .gov-alert[variant=success][inverse=true i], .gov-alert[variant=success][inverse="1"] {
366
- border-bottom: var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));
367
- background-color: var(--gov-alert-inverse-bg, var(--gov-color-neutral-white));
368
- }
369
- .gov-alert[variant=success][inverse=""] .gov-alert__icon, .gov-alert[variant=success][inverse=true i] .gov-alert__icon, .gov-alert[variant=success][inverse="1"] .gov-alert__icon {
370
- color: var(--gov-alert-success-bg-color, var(--gov-color-success-500));
371
- }
372
- .gov-alert[variant=success][inverse=""] .gov-alert__content, .gov-alert[variant=success][inverse=true i] .gov-alert__content, .gov-alert[variant=success][inverse="1"] .gov-alert__content {
373
- color: var(--gov-alert-inverse-color, var(--gov-color-secondary-800));
374
- }
375
- .gov-alert[variant=primary] {
376
- background-color: var(--gov-alert-primary-bg-color, var(--gov-color-primary));
377
- }
378
- .gov-alert[variant=primary] .gov-alert__icon {
379
- color: var(--gov-alert-primary-icon-color, var(--gov-color-neutral-white));
380
- }
381
- .gov-alert[variant=primary] .gov-alert__content {
382
- color: var(--gov-alert-primary-text-color, var(--gov-color-neutral-white));
383
- }
384
- .gov-alert[variant=primary][inverse=""], .gov-alert[variant=primary][inverse=true i], .gov-alert[variant=primary][inverse="1"] {
385
- border-bottom: var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));
386
- background-color: var(--gov-alert-inverse-bg, var(--gov-color-neutral-white));
387
- }
388
- .gov-alert[variant=primary][inverse=""] .gov-alert__icon, .gov-alert[variant=primary][inverse=true i] .gov-alert__icon, .gov-alert[variant=primary][inverse="1"] .gov-alert__icon {
389
- color: var(--gov-alert-primary-bg-color, var(--gov-color-primary));
390
- }
391
- .gov-alert[variant=primary][inverse=""] .gov-alert__content, .gov-alert[variant=primary][inverse=true i] .gov-alert__content, .gov-alert[variant=primary][inverse="1"] .gov-alert__content {
392
- color: var(--gov-alert-inverse-color, var(--gov-color-secondary-800));
393
- }
394
- @media (min-width: 75em) {
395
- .gov-alert__content {
396
- padding-right: 2rem;
397
- }
398
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"gov-alert.js","sourceRoot":"","sources":["../../../../../../src/components/gov-alert/gov-alert.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,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D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T,IAAI,CAAC,QAAQ,IAAI,WAAW,CACvB,CACP,CAAA;EACF,CAAC;EAED,cAAc,CAAC,CAA2B;IACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAE,UAAU,CAAC,IAAI;MAC1B,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,UAAU,CAAC,IAAI,CAAC,CAAA;KAC1E;IACD,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClB,gBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;KAC5E;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { AlertClass, AlertVariants, VariantType } from \"./constants\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { AlertEvent } from \"./gov-alert.types\"\nimport { ButtonEvent } from \"../gov-button/default/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\ttag: \"gov-alert\",\n\tstyleUrl: \"gov-alert.scss\",\n})\nexport class GovAlert {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovAlertElement\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 alert is closable\n\t */\n\t@Prop({ attribute: \"wcag-close-label\" }) readonly wcagCloseLabel: string\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the alert has headline\n\t */\n\t@Prop({ attribute: \"wcag-toggle-label\" }) readonly wcagToggleLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({ eventName: \"gov-close\" }) govClose: EventEmitter<AlertEvent>\n\t/**\n\t * Displays the option to close the alert\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(AlertVariants, newValue, AlertClass.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={AlertClass.close}>\n\t\t\t\t<gov-button\n\t\t\t\t\tsize=\"s\"\n\t\t\t\t\taria-label={this.wcagCloseLabel}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t>\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(AlertClass.root)} variant={this.variant}>\n\t\t\t\t<section class={AlertClass.section} role=\"alert\">\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<div class={AlertClass.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={AlertClass.content}>\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={AlertClass.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\taria-label={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: AlertClass.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', AlertClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.wcagToggleLabel, 'wcag-toggle-label', AlertClass.root)\n\t\t}\n\t}\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=gov-alert.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gov-alert.types.js","sourceRoot":"","sources":["../../../../../../src/components/gov-alert/gov-alert.types.ts"],"names":[],"mappings":"","sourcesContent":["import { GovBaseEvent } from \"../../types/event.types\"\n\nexport interface AlertEvent extends GovBaseEvent {\n\tref: HTMLGovAlertElement\n}\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../../../src/pages/Alert.ts"],"names":[],"mappings":"AAAA,MAAM,SAAU,SAAQ,WAAW;EAClC,iBAAiB;IAChB,IAAI,CAAC,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFhB,CAAA;EACF,CAAC;CACD;AAED,IAAI,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS,EAAE;EACnD,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA;CAC9C","sourcesContent":["class AlertPage extends HTMLElement {\n\tconnectedCallback() {\n\t\tthis.innerHTML = `\n\t\t<h2>Alert</h2>\n\n\t\t<gov-alert variant=\"secondary\" headline=\"Tohle bude super nadpis pro všechno\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert variant=\"secondary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert variant=\"warning\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tWarning - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert variant=\"error\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert variant=\"success\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert variant=\"primary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\n\t\t<h3>Inverse</h3>\n\t\t<br>\n\t\t<gov-alert inverse=\"TRUE\" variant=\"secondary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tSecondary - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert inverse=\"True\" variant=\"warning\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tWarning - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert inverse=\"1\" variant=\"error\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert inverse=\"true\" variant=\"success\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t<br>\n\t\t<gov-alert inverse=\"true\" variant=\"primary\" closable>\n\t\t\t<gov-icon name=\"info\" slot=\"icon\"></gov-icon>\n\t\t\t<p>\n\t\t\t\tError - Od 20. 12. 2020 do 14:00 h do 20.&nbsp;12. 2020 do 15:00 h bude provedena plánovaná odstávka serverů. V&nbsp;uvedeném termínu bude nedostupné přihlášení k&nbsp;Portálu občana prostřednictvím datové schránky. Více informací <a href=\"#\">zde</a>.\n\t\t\t</p>\n\t\t</gov-alert>\n\t\t`\n\t}\n}\n\nif (customElements.get('alert-page') === undefined) {\n\tcustomElements.define('alert-page', AlertPage)\n}\n"]}
@@ -1,2 +0,0 @@
1
- import{p as r,H as o,c as a,h as e,d as t}from"./p-80c0109d.js";import{v as n}from"./p-26acf964.js";import{V as v}from"./p-ff7365ae.js";import{p as i,d as l}from"./p-03990da5.js";import{g as c,a as g}from"./p-3f37ddb6.js";import{F as s}from"./p-1c1d0bbe.js";import{a as d}from"./p-ae894a40.js";import{c as _}from"./p-cac3881f.js";import{d as m}from"./p-70d9d879.js";import{d as p}from"./p-35f6490a.js";const h=i(v,["PRIMARY","SECONDARY","WARNING","ERROR","SUCCESS"]);const u={root:"gov-alert",section:"gov-alert__section",icon:"gov-alert__icon",content:"gov-alert__content",headline:"gov-alert__headline",close:"gov-alert__close"};const b='.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-alert{position:relative;display:block;width:100%}.gov-alert__section{display:block;width:100%;max-width:calc(var(--gov-container-width, 73.75rem) + 2 * var(--gov-container-padding, 2.5rem));margin-right:auto;margin-left:auto;padding-right:var(--gov-container-padding-mobile, 1.25rem);padding-left:var(--gov-container-padding-mobile, 1.25rem);display:flex;gap:1rem;padding-top:1rem;padding-bottom:1rem}@media (min-width: 48em){.gov-alert__section{padding-right:var(--gov-container-padding, 2.5rem);padding-left:var(--gov-container-padding, 2.5rem)}}.gov-alert__icon{flex:0 0 auto}.gov-alert__icon>*{width:1.25rem;height:1.25rem}.gov-alert__headline{display:flex;gap:1rem}.gov-alert__headline+div{margin-top:0.5rem}.gov-alert__headline p{margin-bottom:0}.gov-alert__headline gov-button{margin-top:-0.25rem}.gov-alert__content{padding-right:3.25rem}.gov-alert__content>*:last-child{margin-bottom:0}.gov-alert__content p{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)}.gov-alert__content a{color:inherit}@media not all and (pointer: coarse){.gov-alert__content a:hover{color:inherit}}.gov-alert__close{position:absolute;top:0.625rem;right:1rem}.gov-alert[variant=warning]{background-color:var(--gov-alert-warning-bg-color, var(--gov-color-warning))}.gov-alert[variant=warning] .gov-alert__icon{color:var(--gov-alert-warning-icon-color, var(--gov-color-secondary))}.gov-alert[variant=warning] .gov-alert__content{color:var(--gov-alert-warning-text-color, var(--gov-color-secondary))}.gov-alert[variant=warning][inverse=""],.gov-alert[variant=warning][inverse=true i],.gov-alert[variant=warning][inverse="1"]{border-bottom:var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-alert-inverse-bg, var(--gov-color-neutral-white))}.gov-alert[variant=warning][inverse=""] .gov-alert__icon,.gov-alert[variant=warning][inverse=true i] .gov-alert__icon,.gov-alert[variant=warning][inverse="1"] .gov-alert__icon{color:var(--gov-alert-warning-bg-color, var(--gov-color-warning))}.gov-alert[variant=warning][inverse=""] .gov-alert__content,.gov-alert[variant=warning][inverse=true i] .gov-alert__content,.gov-alert[variant=warning][inverse="1"] .gov-alert__content{color:var(--gov-alert-inverse-color, var(--gov-color-secondary-800))}.gov-alert[variant=error]{background-color:var(--gov-alert-error-bg-color, var(--gov-color-error))}.gov-alert[variant=error] .gov-alert__icon{color:var(--gov-alert-error-icon-color, var(--gov-color-neutral-white))}.gov-alert[variant=error] .gov-alert__content{color:var(--gov-alert-error-text-color, var(--gov-color-neutral-white))}.gov-alert[variant=error][inverse=""],.gov-alert[variant=error][inverse=true i],.gov-alert[variant=error][inverse="1"]{border-bottom:var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-alert-inverse-bg, var(--gov-color-neutral-white))}.gov-alert[variant=error][inverse=""] .gov-alert__icon,.gov-alert[variant=error][inverse=true i] .gov-alert__icon,.gov-alert[variant=error][inverse="1"] .gov-alert__icon{color:var(--gov-alert-error-bg-color, var(--gov-color-error))}.gov-alert[variant=error][inverse=""] .gov-alert__content,.gov-alert[variant=error][inverse=true i] .gov-alert__content,.gov-alert[variant=error][inverse="1"] .gov-alert__content{color:var(--gov-alert-inverse-color, var(--gov-color-secondary-800))}.gov-alert[variant=secondary]{background-color:var(--gov-alert-secondary-bg-color, var(--gov-color-secondary))}.gov-alert[variant=secondary] .gov-alert__icon{color:var(--gov-alert-secondary-icon-color, var(--gov-color-neutral-white))}.gov-alert[variant=secondary] .gov-alert__content{color:var(--gov-alert-secondary-text-color, var(--gov-color-neutral-white))}.gov-alert[variant=secondary][inverse=""],.gov-alert[variant=secondary][inverse=true i],.gov-alert[variant=secondary][inverse="1"]{border-bottom:var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-alert-inverse-bg, var(--gov-color-neutral-white))}.gov-alert[variant=secondary][inverse=""] .gov-alert__icon,.gov-alert[variant=secondary][inverse=true i] .gov-alert__icon,.gov-alert[variant=secondary][inverse="1"] .gov-alert__icon{color:var(--gov-alert-secondary-bg-color, var(--gov-color-secondary))}.gov-alert[variant=secondary][inverse=""] .gov-alert__content,.gov-alert[variant=secondary][inverse=true i] .gov-alert__content,.gov-alert[variant=secondary][inverse="1"] .gov-alert__content{color:var(--gov-alert-inverse-color, var(--gov-color-secondary-800))}.gov-alert[variant=success]{background-color:var(--gov-alert-success-bg-color, var(--gov-color-success-500))}.gov-alert[variant=success] .gov-alert__icon{color:var(--gov-alert-success-icon-color, var(--gov-color-neutral-white))}.gov-alert[variant=success] .gov-alert__content{color:var(--gov-alert-success-text-color, var(--gov-color-neutral-white))}.gov-alert[variant=success][inverse=""],.gov-alert[variant=success][inverse=true i],.gov-alert[variant=success][inverse="1"]{border-bottom:var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-alert-inverse-bg, var(--gov-color-neutral-white))}.gov-alert[variant=success][inverse=""] .gov-alert__icon,.gov-alert[variant=success][inverse=true i] .gov-alert__icon,.gov-alert[variant=success][inverse="1"] .gov-alert__icon{color:var(--gov-alert-success-bg-color, var(--gov-color-success-500))}.gov-alert[variant=success][inverse=""] .gov-alert__content,.gov-alert[variant=success][inverse=true i] .gov-alert__content,.gov-alert[variant=success][inverse="1"] .gov-alert__content{color:var(--gov-alert-inverse-color, var(--gov-color-secondary-800))}.gov-alert[variant=primary]{background-color:var(--gov-alert-primary-bg-color, var(--gov-color-primary))}.gov-alert[variant=primary] .gov-alert__icon{color:var(--gov-alert-primary-icon-color, var(--gov-color-neutral-white))}.gov-alert[variant=primary] .gov-alert__content{color:var(--gov-alert-primary-text-color, var(--gov-color-neutral-white))}.gov-alert[variant=primary][inverse=""],.gov-alert[variant=primary][inverse=true i],.gov-alert[variant=primary][inverse="1"]{border-bottom:var(--gov-alert-border, 0.0625rem solid var(--gov-color-secondary-400));background-color:var(--gov-alert-inverse-bg, var(--gov-color-neutral-white))}.gov-alert[variant=primary][inverse=""] .gov-alert__icon,.gov-alert[variant=primary][inverse=true i] .gov-alert__icon,.gov-alert[variant=primary][inverse="1"] .gov-alert__icon{color:var(--gov-alert-primary-bg-color, var(--gov-color-primary))}.gov-alert[variant=primary][inverse=""] .gov-alert__content,.gov-alert[variant=primary][inverse=true i] .gov-alert__content,.gov-alert[variant=primary][inverse="1"] .gov-alert__content{color:var(--gov-alert-inverse-color, var(--gov-color-secondary-800))}@media (min-width: 75em){.gov-alert__content{padding-right:2rem}}';const y=r(class r extends o{constructor(){super();this.__registerHost();this.govClose=a(this,"gov-close",7);this.headline=undefined;this.variant="primary";this.inverse=false;this.wcagCloseLabel=undefined;this.wcagToggleLabel=undefined;this.closable=false;this.toggleContent=false;this.h=c(this.host)}validateVariant(r){n(h,r,u.root)}componentWillLoad(){this.validateVariant(this.variant)}async componentDidRender(){if(_()){await l(500);await this.validateWcag()}}render(){let r=!this.inverse;let o=this.inverse?"secondary":this.variant;if(this.variant=="warning"){r=false;o="secondary"}const a=e("div",{class:u.close},e("gov-button",{size:"s","aria-label":this.wcagCloseLabel,type:"base",variant:o,inverse:r,"on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"})));return e(t,{class:this.h.classes(u.root),variant:this.variant},e("section",{class:u.section,role:"alert"},this.h.hasSlot("icon")&&e("div",{class:u.icon},e("slot",{name:"icon"})),e("div",{class:u.content},this.headline?e(s,null,e("div",{class:u.headline},e("p",null,this.headline),e("gov-button",{size:"s","aria-label":this.wcagToggleLabel,type:"base",variant:o,inverse:r,"on-gov-click":()=>this.toggleContent=!this.toggleContent},e("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down"}))),e("div",{hidden:!this.toggleContent,"aria-hidden":g(this.toggleContent)},e("slot",null))):e("slot",null))),this.closable&&a)}onCloseHandler(r){this.govClose.emit({component:u.root,ref:this.host,originalEvent:r})}async validateWcag(){if(this.closable){d(this.wcagCloseLabel,"wcag-close-label",u.root)}if(this.headline){d(this.wcagToggleLabel,"wcag-toggle-label",u.root)}}get host(){return this}static get watchers(){return{variant:["validateVariant"]}}static get style(){return b}},[4,"gov-alert",{headline:[1],variant:[1],inverse:[4],wcagCloseLabel:[1,"wcag-close-label"],wcagToggleLabel:[1,"wcag-toggle-label"],closable:[4],toggleContent:[32],validateWcag:[64]}]);function f(){if(typeof customElements==="undefined"){return}const r=["gov-alert","gov-button","gov-icon"];r.forEach((r=>{switch(r){case"gov-alert":if(!customElements.get(r)){customElements.define(r,y)}break;case"gov-button":if(!customElements.get(r)){m()}break;case"gov-icon":if(!customElements.get(r)){p()}break}}))}f();const w=y;const k=f;export{w as GovAlert,k as defineCustomElement};
2
- //# sourceMappingURL=gov-alert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["AlertVariants","pick","Variants","AlertClass","root","section","icon","content","headline","close","govAlertCss","GovAlert","proxyCustomElement","H","constructor","this","h","govHost","host","validateVariant","newValue","validateProp","componentWillLoad","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","inverse","closeButton","class","size","wcagCloseLabel","type","onCloseHandler","bind","name","Host","classes","role","hasSlot","Fragment","wcagToggleLabel","toggleContent","hidden","toBoolAttr","closable","e","govClose","emit","component","ref","originalEvent","validateWcagProp"],"sources":["../../../packages/core/src/components/gov-alert/constants.ts","../../../packages/core/src/components/gov-alert/gov-alert.scss?tag=gov-alert","../../../packages/core/src/components/gov-alert/gov-alert.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const AlertVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'WARNING', 'ERROR', 'SUCCESS'])\nexport type VariantType = `${ValueOf<typeof AlertVariants>}`\n\nexport const AlertClass = {\n\troot: 'gov-alert',\n\tsection: 'gov-alert__section',\n\ticon: 'gov-alert__icon',\n\tcontent: 'gov-alert__content',\n\theadline: 'gov-alert__headline',\n\tclose: 'gov-alert__close',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-alert\";\n\n#{$class} {\n\t@include base();\n\t&__section {\n\t\t@include container();\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\tpadding-top: rem-calc(16);\n\t\tpadding-bottom: rem-calc(16);\n\t}\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\t& > * {\n\t\t\twidth: rem-calc(20);\n\t\t\theight: rem-calc(20);\n\t\t}\n\t}\n\t&__headline {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\n\t\t+ div {\n\t\t\tmargin-top: rem-calc(8);\n\t\t}\n\n\t\tp {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\tgov-button {\n\t\t\tmargin-top: rem-calc(-4);\n\t\t}\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t\tpadding-right: rem-calc(52);\n\t\tp {\n\t\t\t@include typography($font-size-m);\n\t\t}\n\t\ta {\n\t\t\tcolor: inherit;\n\t\t\t@include hover() {\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n\t&__close {\n\t\tposition: absolute;\n\t\ttop: rem-calc(10);\n\t\tright: rem-calc(16);\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $alert-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tbackground-color: get(\"bg-color\", $definitions);\n\t\t\t#{$class} {\n\t\t\t\t&__icon {\n\t\t\t\t\tcolor: get(\"icon-color\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tcolor: get(\"text-color\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t\t@if deep-map-check($definitions, \"border\") {\n\t\t\t\tborder-bottom: $alert-border;\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\tborder-bottom: $alert-border;\n\t\t\t\tbackground-color: $alert-inverse-bg;\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__icon {\n\t\t\t\t\t\tcolor: get(\"bg-color\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t\t&__content {\n\t\t\t\t\t\tcolor: $alert-inverse-color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: xl) {\n\t\t&__content {\n\t\t\tpadding-right: rem-calc(32);\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { AlertClass, AlertVariants, VariantType } from \"./constants\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { AlertEvent } from \"./gov-alert.types\"\nimport { ButtonEvent } from \"../gov-button/default/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\ttag: \"gov-alert\",\n\tstyleUrl: \"gov-alert.scss\",\n})\nexport class GovAlert {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovAlertElement\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 alert is closable\n\t */\n\t@Prop({ attribute: \"wcag-close-label\" }) readonly wcagCloseLabel: string\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the alert has headline\n\t */\n\t@Prop({ attribute: \"wcag-toggle-label\" }) readonly wcagToggleLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({ eventName: \"gov-close\" }) govClose: EventEmitter<AlertEvent>\n\t/**\n\t * Displays the option to close the alert\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(AlertVariants, newValue, AlertClass.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={AlertClass.close}>\n\t\t\t\t<gov-button\n\t\t\t\t\tsize=\"s\"\n\t\t\t\t\taria-label={this.wcagCloseLabel}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t>\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(AlertClass.root)} variant={this.variant}>\n\t\t\t\t<section class={AlertClass.section} role=\"alert\">\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<div class={AlertClass.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={AlertClass.content}>\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={AlertClass.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\taria-label={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: AlertClass.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', AlertClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.wcagToggleLabel, 'wcag-toggle-label', AlertClass.root)\n\t\t}\n\t}\n}\n"],"mappings":"kZAIO,MAAMA,EAAgBC,EAAKC,EAAU,CAAC,UAAW,YAAa,UAAW,QAAS,YAGlF,MAAMC,EAAa,CACzBC,KAAM,YACNC,QAAS,qBACTC,KAAM,kBACNC,QAAS,qBACTC,SAAU,sBACVC,MAAO,oBCbR,MAAMC,EAAc,gqO,MCgBPC,EAAQC,EAAA,MAAAD,UAAAE,EAGpB,WAAAC,G,uGAawC,U,aAIJ,M,2EAgBE,M,mBAEb,MAlCxBC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAqCvB,eAAAC,CAAgBC,GACfC,EAAarB,EAAeoB,EAAUjB,EAAWC,K,CAGlD,iBAAAkB,GACCP,KAAKI,gBAAgBJ,KAAKQ,Q,CAG3B,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNX,KAAKY,c,EAIb,MAAAC,GACC,IAAIC,GAAWd,KAAKc,QACpB,IAAIN,EAAUR,KAAKc,QAAU,YAAcd,KAAKQ,QAEhD,GAAIR,KAAKQ,SAAW,UAAW,CAC9BM,EAAU,MACVN,EAAU,W,CAGX,MAAMO,EACLd,EAAA,OAAKe,MAAO5B,EAAWM,OACtBO,EAAA,cACCgB,KAAK,IAAG,aACIjB,KAAKkB,eACjBC,KAAK,OACLX,QAASA,EACTM,QAASA,EAAO,eACFd,KAAKoB,eAAeC,KAAKrB,OAEvCC,EAAA,YAAUqB,KAAK,WAKlB,OACCrB,EAACsB,EAAI,CAACP,MAAOhB,KAAKC,EAAEuB,QAAQpC,EAAWC,MAAOmB,QAASR,KAAKQ,SAC3DP,EAAA,WAASe,MAAO5B,EAAWE,QAASmC,KAAK,SACvCzB,KAAKC,EAAEyB,QAAQ,SACfzB,EAAA,OAAKe,MAAO5B,EAAWG,MACtBU,EAAA,QAAMqB,KAAK,UAGbrB,EAAA,OAAKe,MAAO5B,EAAWI,SACrBQ,KAAKP,SACLQ,EAAC0B,EAAQ,KACR1B,EAAA,OAAKe,MAAO5B,EAAWK,UACtBQ,EAAA,SAAID,KAAKP,UACTQ,EAAA,cACCgB,KAAK,IAAG,aACIjB,KAAK4B,gBACjBT,KAAK,OACLX,QAASA,EACTM,QAASA,EAAO,eACF,IAAMd,KAAK6B,eAAiB7B,KAAK6B,eAE/C5B,EAAA,YAAUqB,KAAMtB,KAAK6B,cAAgB,aAAe,mBAGtD5B,EAAA,OAAK6B,QAAS9B,KAAK6B,cAAa,cAAeE,EAAW/B,KAAK6B,gBAC9D5B,EAAA,eAIFA,EAAA,eAIFD,KAAKgC,UAAYjB,E,CAKrB,cAAAK,CAAea,GACdjC,KAAKkC,SAASC,KAAK,CAClBC,UAAWhD,EAAWC,KACtBgD,IAAKrC,KAAKG,KACVmC,cAAeL,G,CAQjB,kBAAMrB,GACL,GAAIZ,KAAKgC,SAAU,CAClBO,EAAiBvC,KAAKkB,eAAgB,mBAAoB9B,EAAWC,K,CAEtE,GAAIW,KAAKP,SAAU,CAClB8C,EAAiBvC,KAAK4B,gBAAiB,oBAAqBxC,EAAWC,K"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeType","BadgeClass","root","inner","hasRight","hasLeft","govBadgeCss","GovBadge","proxyCustomElement","H","constructor","ButtonSizes","_M","ButtonVariants","PRIMARY","this","h","govHost","host","validateVariant","newValue","validateProp","validateSize","componentWillLoad","variant","size","render","Tag","href","A","tag","nativeType","BUTTON","undefined","Host","class","classes","hasSlot","disabled","type","inverse","hoverable","target","wcagLabel","ref","el","triggerRef","onClick","onClickHandler","bind","name","e","stopPropagation","govClick","emit","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-badge/constants.ts","../../../packages/core/src/components/gov-badge/gov-badge.scss?tag=gov-badge","../../../packages/core/src/components/gov-badge/gov-badge.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const BadgeClass = {\n\troot: 'gov-badge',\n\tinner: 'gov-badge__inner',\n\thasRight: 'gov-badge--has-right',\n\thasLeft: 'gov-badge--has-left',\n}\n","/*\n * Badge\n */\n\n// Shared definitions - button & badge\n@import \"../gov-button/default/gov-button-core\";\n\n.gov-badge {\n\t@extend %button-core;\n\tdisplay: inline-flex;\n\ta .gov-icon {\n\t\tmargin: 0;\n\t}\n\t.element {\n\t\tpadding: rem-calc(4 10);\n\t\tfont-family: $font-family-primary;\n\t\tfont-weight: 400;\n\t\tletter-spacing: initial;\n\t}\n\t.gov-button {\n\t\t.element {\n\t\t\tborder: none;\n\t\t}\n\t}\n\t&--has-right > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-right: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t}\n\n\t&--has-left > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-left: 0 !important;\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t$radius: calc(#{get(\"min-height\", $definitions)} * 0.5);\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tborder-radius: $radius;\n\t\t\t}\n\n\t\t\t// HOVERS\n\t\t\t&[hoverable] .element {\n\t\t\t\t@include focus-outline($radius, $outline-offset);\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $badge-inverse-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t.element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($badge-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($badge-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($badge-inverse-variants, $variant, \"color\");\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tborder-color: deep-map-get($badge-inverse-variants, $variant, \"border-color-hover\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { BadgeClass, NativeType, NativeTypesType } from \"./constants\"\nimport { ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType } from \"../gov-button/default/constants\"\n\n@Component({\n\ttag: \"gov-badge\",\n\tstyleUrl: \"gov-badge.scss\",\n})\nexport class GovBadge {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBadgeElement\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 * Makes the badge component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * 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: string\n\t/**\n\t * Badge’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = ButtonSizes._M\n\t/**\n\t * Used to change the HTML tag in the badge\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the badge.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\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 * Emitted when the button click.\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, BadgeClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, BadgeClass.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 Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tBadgeClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? BadgeClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? BadgeClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tvariant={this.variant}\n\t\t\t\ttype={this.inverse ? undefined : \"solid\"}\n\t\t\t\tsize={this.size}\n\t\t\t\tinverse={this.inverse}\n\t\t\t\thoverable={Tag == NativeType.A || Tag == NativeType.BUTTON}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\ttype={nativeType}>\n\t\t\t\t\t{this.h.hasSlot(\"left\") && <slot name=\"left\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"right\") && <slot name=\"right\"></slot>}\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 && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\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"],"mappings":"8KAEA,IAAYA,GAAZ,SAAYA,GACXA,EAAA,SACAA,EAAA,eACAA,EAAA,kBACA,EAJD,CAAYA,MAAU,KAQf,MAAMC,EAAa,CACzBC,KAAM,YACNC,MAAO,mBACPC,SAAU,uBACVC,QAAS,uBCdV,MAAMC,EAAc,mx2E,MCWPC,EAAQC,EAAA,MAAAD,UAAAE,EAIpB,WAAAC,G,+EASoC,M,cAKC,M,oDAcIC,EAAYC,G,SAIb,O,aAIMC,EAAeC,Q,yBAnC5DC,KAAKC,EAAIC,EAAQF,KAAKG,K,CA+CvB,eAAAC,CAAgBC,GACfC,EAAaR,EAAgBO,EAAUnB,EAAWC,K,CAInD,YAAAoB,CAAaF,GACZC,EAAaV,EAAaS,EAAUnB,EAAWC,K,CAGhD,iBAAAqB,GACCR,KAAKI,gBAAgBJ,KAAKS,SAC1BT,KAAKO,aAAaP,KAAKU,K,CAGxB,MAAAC,GACC,MAAMC,EAAMZ,KAAKa,KAAO5B,EAAW6B,EAAId,KAAKe,IAC5C,MAAMC,EAAaJ,GAAO3B,EAAWgC,OAAShC,EAAWgC,OAASC,UAElE,OACCjB,EAACkB,EAAI,CACJC,MAAOpB,KAAKC,EAAEoB,QAAQ,CACrBnC,EAAWC,KACXa,KAAKC,EAAEqB,QAAQ,SAAWpC,EAAWG,SAAW6B,UAChDlB,KAAKC,EAAEqB,QAAQ,QAAUpC,EAAWI,QAAU4B,YAE/CK,SAAUvB,KAAKuB,SACfV,KAAMb,KAAKa,KACXJ,QAAST,KAAKS,QACde,KAAMxB,KAAKyB,QAAUP,UAAY,QACjCR,KAAMV,KAAKU,KACXe,QAASzB,KAAKyB,QACdC,UAAWd,GAAO3B,EAAW6B,GAAKF,GAAO3B,EAAWgC,QAEpDhB,EAACW,EAAG,CACHQ,MAAM,UACNP,KAAMb,KAAKa,KACXc,OAAQ3B,KAAK2B,OAAM,aACP3B,KAAK4B,UACjBC,IAAKC,GAAO9B,KAAK+B,WAAaD,EAC9BE,QAAShC,KAAKiC,eAAeC,KAAKlC,MAClCwB,KAAMR,GACLhB,KAAKC,EAAEqB,QAAQ,SAAWrB,EAAA,QAAMkC,KAAK,SACrCnC,KAAKC,EAAEqB,QAAQ,cAAgBrB,EAAA,QAAMkC,KAAK,cAC3ClC,EAAA,aACCD,KAAKC,EAAEqB,QAAQ,eAAiBrB,EAAA,QAAMkC,KAAK,eAC3CnC,KAAKC,EAAEqB,QAAQ,UAAYrB,EAAA,QAAMkC,KAAK,W,CAMnC,cAAAF,CAAeG,GACtBA,EAAEC,kBACF,GAAIrC,KAAKuB,WAAa,OAASvB,KAAKe,MAAQ9B,EAAWgC,OAAQ,CAC9DjB,KAAKsC,SAASC,KAAKH,E,EAQrB,mBAAMI,GACL,OAAOxC,KAAK+B,U"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["toBool","value","indexOf","govButtonCss","Tags","GovButton","proxyCustomElement","H","constructor","this","h","govHost","host","validateVariant","newValue","validateProp","ButtonVariants","ButtonClass","root","validateType","Type","validateSize","Sizes","validateNativeType","NativeType","componentWillLoad","variant","type","size","nativeType","componentDidRender","canValidateWcagOnRender","delay","validateWcag","classNames","prepareClasses","hasSlot","rootWithIcon","render","Tag","href","A","BUTTON","undefined","Host","hoverable","class","classes","inverse","ref","el","triggerRef","onClick","onClickHandler","bind","onFocus","onFocusHandler","onBlur","onBlurHandler","onMouseDown","isPressed","onMouseUp","disabled","id","identifier","target","download","hreflang","rel","name","tabindex","focusable","wcagActiveDescendant","wcagDescription","wcagControls","wcagDetails","toBoolAttrIfDefined","wcagExpanded","wcagLabel","wcagLabelledBy","wcagOwns","wcagHasPopup","toBoolAttr","wcagCurrent","loading","e","stopPropagation","govClick","emit","component","originalEvent","govFocus","govBlur","setFocus","focus","getTriggerRef","validateWcagRef","validateWcagLabel"],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/default/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/default/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 & badge\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\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}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport {\n\tButtonSizesType,\n\tNativeTypesType,\n\tTypesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tButtonClass,\n\tType,\n\tNativeType,\n\tButtonTargetType,\n} from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, prepareClasses } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { toBool } from \"../../../utils/bool.utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { validateWcagLabel, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { ButtonEvent } from \"./gov-button.types\"\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() readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({ reflect: true }) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parametr\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: \"wcag-description\" }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: \"wcag-details\" }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: \"wcag-has-popup\" }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: \"wcag-pressed\" }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: \"wcag-current\" }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<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\treturn (\n\t\t\t<Host hoverable={true} size={this.size} variant={this.variant} class={this.h.classes(this.classNames)} type={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.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\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<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\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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-10cbc3fe.js";import{v as r}from"./p-26acf964.js";import{T as e,a,b as n,c as l,d as p}from"./p-404f469e.js";import{c}from"./p-24636c53.js";import{g as v}from"./p-3f37ddb6.js";import"./p-561fa17b.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-03990da5.js";const h='.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-tooltip{position:relative;display:inline;border-bottom:1px dashed currentcolor;color:var(--gov-color-primary);cursor:help}.gov-tooltip[icon=""],.gov-tooltip[icon=true i],.gov-tooltip[icon="1"]{display:inline-flex;border-bottom:0}.gov-tooltip[variant=secondary]{--gov-tooltip-content-bg-color:var(--gov-tooltip-secondary-bg-color, var(--gov-color-secondary));--gov-tooltip-content-text-color:var(--gov-tooltip-secondary-text-color, var(--gov-color-neutral-white))}.gov-tooltip[variant=secondary][inverse=""],.gov-tooltip[variant=secondary][inverse=true i],.gov-tooltip[variant=secondary][inverse="1"]{--gov-tooltip-content-bg-color:var(--gov-color-neutral-white);--gov-tooltip-content-text-color:var(--gov-tooltip-secondary-text-color-inverse, var(--gov-color-secondary))}.gov-tooltip[variant=primary]{--gov-tooltip-content-bg-color:var(--gov-tooltip-primary-bg-color, var(--gov-color-primary-300));--gov-tooltip-content-text-color:var(--gov-tooltip-primary-text-color, var(--gov-color-secondary))}.gov-tooltip[variant=primary][inverse=""],.gov-tooltip[variant=primary][inverse=true i],.gov-tooltip[variant=primary][inverse="1"]{--gov-tooltip-content-bg-color:var(--gov-color-neutral-white);--gov-tooltip-content-text-color:var(--gov-tooltip-primary-text-color-inverse, var(--gov-color-primary))}';const g=class{constructor(t){o(this,t);this.variant="primary";this.size="m";this.position="right";this.message=undefined;this.identifier=undefined;this.icon=undefined;this.h=v(this.host);this.tooltipId=c("GovTooltip")}validateVariant(o){r(l,o,n.root)}validateSize(o){r(p,o,n.root)}validatePosition(o){r(a,o,n.root)}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.validatePosition(this.position);this.createContentWrapper();this.registerListeners()}createContentWrapper(){var o;const t=this.host.querySelector(e.root);if(t){this.content=t}else{this.content=document.createElement(e.root);this.content.innerHTML=this.message;this.host.appendChild(this.content)}this.content.setAttribute("id",(o=this.identifier)!==null&&o!==void 0?o:this.tooltipId)}registerListeners(){this.host.addEventListener("focus",(o=>{o.preventDefault();this.showTooltip()}));this.host.addEventListener("blur",(o=>{o.preventDefault();this.hideTooltip()}));this.host.addEventListener("mouseenter",(o=>{o.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(o=>{o.preventDefault();this.hideTooltip()}))}verifyPositionSpace(){const o=12;const t=window.innerWidth;const i=this.host.getBoundingClientRect();const s=this.host.offsetWidth;const r={left:i.left+document.documentElement.scrollLeft,top:i.top+document.documentElement.scrollTop};const e=this.content.offsetWidth;if(this.position===a.LEFT){if(o+r.left<e){this.position=a.TOP;this.content.style.left="0px";this.content.style.width=window.innerWidth-r.left-o+"px";this.content.style.transform="none"}}else if(this.position===a.RIGHT){if(t-(r.left+s)<e){this.position=a.TOP;this.content.style.right="0px";this.content.style.left="auto";this.content.style.width=s+r.left+o+"px";this.content.style.transform="none"}}else{if(e/2>r.left){this.content.style.left="0px";this.content.style.width=window.innerWidth-r.left-o+"px";this.content.style.transform="none"}else if(e/2>t-(r.left+e)){this.content.style.right="0px";this.content.style.left="auto";this.content.style.width=s+r.left+o+"px";this.content.style.transform="none"}}}showTooltip(){if(this.content){this.verifyPositionSpace();this.content.setAttribute("is-visible","true")}}hideTooltip(){if(this.content){this.content.setAttribute("is-visible","false")}}render(){var o;return t(i,{class:this.h.classes(n.root),position:this.position,size:this.size,tabindex:0,"aria-describedby":(o=this.identifier)!==null&&o!==void 0?o:this.tooltipId,variant:this.variant},t("slot",null))}async show(){this.showTooltip()}async hide(){this.hideTooltip()}get host(){return s(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],position:["validatePosition"]}}};g.style=h;export{g as gov_tooltip};
2
- //# sourceMappingURL=p-3b9df792.entry.js.map