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

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 (416) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-app.cjs.entry.js +174 -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-dropdown.cjs.entry.js +1 -1
  10. package/dist/cjs/gov-dropdown.cjs.entry.js.map +1 -1
  11. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +15 -15
  12. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  13. package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
  14. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  15. package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
  16. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  17. package/dist/cjs/gov-form-input.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  19. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  20. package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
  21. package/dist/cjs/gov-form-multi-select.cjs.entry.js +29 -24
  22. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  23. package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
  24. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  25. package/dist/cjs/gov-form-select.cjs.entry.js +18 -17
  26. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  27. package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
  28. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  29. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  30. package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-infobar.cjs.entry.js +90 -0
  32. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -0
  33. package/dist/cjs/gov-pagination.cjs.entry.js +1 -1
  34. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  35. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  36. package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
  37. package/dist/cjs/gov-toast.cjs.entry.js +5 -2
  38. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  39. package/dist/cjs/gov-tooltip-content.cjs.entry.js +16 -4
  40. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  41. package/dist/cjs/gov-tooltip.cjs.entry.js +73 -46
  42. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  43. package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
  44. package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
  45. package/dist/cjs/index-83edd4fe.js +4 -4
  46. package/dist/cjs/loader.cjs.js +1 -1
  47. package/dist/collection/collection-manifest.json +1 -1
  48. package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -1
  49. package/dist/collection/components/gov-accordion/gov-accordion.css +1 -1
  50. package/dist/collection/components/gov-app/gov-app.css +1 -1
  51. package/dist/collection/components/gov-app/gov-app.js +2 -2
  52. package/dist/collection/components/gov-app/gov-app.js.map +1 -1
  53. package/dist/collection/components/gov-attachments/gov-attachments-item.css +1 -1
  54. package/dist/collection/components/gov-attachments/gov-attachments.css +1 -1
  55. package/dist/collection/components/gov-backdrop/gov-backdrop.css +1 -1
  56. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  57. package/dist/collection/components/gov-badge/gov-badge.css +41 -11
  58. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +1 -1
  59. package/dist/collection/components/gov-button/default/gov-button.css +10 -1
  60. package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +1 -3
  61. package/dist/collection/components/gov-card/gov-card.css +1 -1
  62. package/dist/collection/components/gov-container/gov-container.css +1 -1
  63. package/dist/collection/components/gov-control-group/gov-control-group.css +1 -1
  64. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +1 -1
  65. package/dist/collection/components/gov-empty/gov-empty.css +1 -1
  66. package/dist/collection/components/gov-error-code/gov-error-code.css +1 -1
  67. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +1 -1
  68. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +24 -23
  69. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  70. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +1 -1
  71. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +5 -4
  72. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  73. package/dist/collection/components/gov-form/control/gov-form-control.css +1 -1
  74. package/dist/collection/components/gov-form/file/gov-form-file.css +1 -1
  75. package/dist/collection/components/gov-form/file/gov-form-file.js +4 -3
  76. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  77. package/dist/collection/components/gov-form/group/gov-form-group.css +1 -1
  78. package/dist/collection/components/gov-form/input/gov-form-input.css +1 -1
  79. package/dist/collection/components/gov-form/input/gov-form-input.js +4 -3
  80. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  81. package/dist/collection/components/gov-form/label/gov-form-label.css +5 -1
  82. package/dist/collection/components/gov-form/message/gov-form-message.css +1 -1
  83. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +49 -4
  84. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +87 -26
  85. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  86. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +1 -1
  87. package/dist/collection/components/gov-form/radio/gov-form-radio.css +1 -1
  88. package/dist/collection/components/gov-form/radio/gov-form-radio.js +4 -3
  89. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  90. package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
  91. package/dist/collection/components/gov-form/select/gov-form-select.css +49 -1
  92. package/dist/collection/components/gov-form/select/gov-form-select.js +39 -20
  93. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  94. package/dist/collection/components/gov-form/switch/gov-form-switch.css +1 -1
  95. package/dist/collection/components/gov-form/switch/gov-form-switch.js +5 -4
  96. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  97. package/dist/collection/components/gov-grid/gov-grid-item.css +1 -1
  98. package/dist/collection/components/gov-grid/gov-grid.css +1 -1
  99. package/dist/collection/components/gov-icon/gov-icon.css +3 -1
  100. package/dist/collection/components/gov-infobar/default/constants.js +12 -0
  101. package/dist/collection/components/gov-infobar/default/constants.js.map +1 -0
  102. package/dist/collection/components/gov-infobar/default/gov-infobar.css +384 -0
  103. package/dist/collection/components/{gov-alert/gov-alert.js → gov-infobar/default/gov-infobar.js} +27 -27
  104. package/dist/collection/components/gov-infobar/default/gov-infobar.js.map +1 -0
  105. package/dist/collection/components/gov-infobar/default/gov-infobar.types.js +2 -0
  106. package/dist/collection/components/gov-infobar/default/gov-infobar.types.js.map +1 -0
  107. package/dist/collection/components/gov-layout/gov-layout-column.css +1 -1
  108. package/dist/collection/components/gov-layout/gov-layout.css +1 -1
  109. package/dist/collection/components/gov-loading/loading/gov-loading.css +1 -1
  110. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +1 -1
  111. package/dist/collection/components/gov-message/gov-message.css +1 -1
  112. package/dist/collection/components/gov-modal/gov-modal.css +1 -1
  113. package/dist/collection/components/gov-nav/gov-nav-item.css +1 -1
  114. package/dist/collection/components/gov-nav/gov-nav.css +1 -1
  115. package/dist/collection/components/gov-pagination/gov-pagination.css +2 -2
  116. package/dist/collection/components/gov-promp/gov-prompt.css +1 -1
  117. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +1 -1
  118. package/dist/collection/components/gov-side-nav/gov-side-nav.css +1 -1
  119. package/dist/collection/components/gov-spacer/gov-spacer.css +1 -1
  120. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +1 -1
  121. package/dist/collection/components/gov-statsbar/gov-statsbar.css +1 -1
  122. package/dist/collection/components/gov-stepper/gov-stepper-item.css +2 -1
  123. package/dist/collection/components/gov-stepper/gov-stepper.css +1 -1
  124. package/dist/collection/components/gov-tabs/gov-tabs-item.css +1 -1
  125. package/dist/collection/components/gov-tabs/gov-tabs.css +1 -1
  126. package/dist/collection/components/gov-tile/container/gov-tiles.css +1 -1
  127. package/dist/collection/components/gov-tile/gov-tile.css +1 -1
  128. package/dist/collection/components/gov-toast/gov-toast.css +2 -2
  129. package/dist/collection/components/gov-toast/gov-toast.js +4 -1
  130. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  131. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +32 -27
  132. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +101 -5
  133. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
  134. package/dist/collection/components/gov-tooltip/gov-tooltip.css +1 -17
  135. package/dist/collection/components/gov-tooltip/gov-tooltip.js +83 -51
  136. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  137. package/dist/collection/components/gov-wizard/gov-wizard-item.css +2 -4
  138. package/dist/collection/components/gov-wizard/gov-wizard.css +1 -1
  139. package/dist/collection/data/color-definitions.js +307 -0
  140. package/dist/collection/data/font-definitions.js +94 -0
  141. package/dist/collection/pages/Card.js +11 -9
  142. package/dist/collection/pages/Card.js.map +1 -1
  143. package/dist/collection/pages/Forms.js +75 -0
  144. package/dist/collection/pages/Forms.js.map +1 -1
  145. package/dist/collection/pages/Home.js +43 -1
  146. package/dist/collection/pages/Home.js.map +1 -1
  147. package/dist/collection/pages/{Alert.js → Infobar.js} +42 -27
  148. package/dist/collection/pages/Infobar.js.map +1 -0
  149. package/dist/collection/pages/Stepper.js +3 -0
  150. package/dist/collection/pages/Stepper.js.map +1 -1
  151. package/dist/components/gov-accordion-item.js +1 -1
  152. package/dist/components/gov-app.js +1 -1
  153. package/dist/components/gov-app.js.map +1 -1
  154. package/dist/components/gov-attachments-item.js +1 -1
  155. package/dist/components/gov-badge.js +1 -1
  156. package/dist/components/gov-button.js +1 -1
  157. package/dist/components/gov-card.js +1 -1
  158. package/dist/components/gov-dropdown.js +1 -1
  159. package/dist/components/gov-dropdown.js.map +1 -1
  160. package/dist/components/gov-form-autocomplete.js +1 -1
  161. package/dist/components/gov-form-checkbox.js +1 -1
  162. package/dist/components/gov-form-checkbox.js.map +1 -1
  163. package/dist/components/gov-form-file.js +1 -1
  164. package/dist/components/gov-form-file.js.map +1 -1
  165. package/dist/components/gov-form-input.js +1 -1
  166. package/dist/components/gov-form-label.js +1 -1
  167. package/dist/components/gov-form-label.js.map +1 -1
  168. package/dist/components/gov-form-multi-select.js +1 -1
  169. package/dist/components/gov-form-multi-select.js.map +1 -1
  170. package/dist/components/gov-form-radio.js +1 -1
  171. package/dist/components/gov-form-radio.js.map +1 -1
  172. package/dist/components/gov-form-select.js +1 -1
  173. package/dist/components/gov-form-switch.js +1 -1
  174. package/dist/components/gov-form-switch.js.map +1 -1
  175. package/dist/components/gov-icon.js +1 -1
  176. package/dist/components/{gov-alert.d.ts → gov-infobar.d.ts} +4 -4
  177. package/dist/components/gov-infobar.js +2 -0
  178. package/dist/components/gov-infobar.js.map +1 -0
  179. package/dist/components/gov-loading.js +1 -1
  180. package/dist/components/gov-modal.js +1 -1
  181. package/dist/components/gov-pagination.js +1 -1
  182. package/dist/components/gov-pagination.js.map +1 -1
  183. package/dist/components/gov-prompt.js +1 -1
  184. package/dist/components/gov-side-nav-item.js +1 -1
  185. package/dist/components/gov-stepper-item.js +1 -1
  186. package/dist/components/gov-stepper-item.js.map +1 -1
  187. package/dist/components/gov-tabs.js +1 -1
  188. package/dist/components/gov-tile.js +1 -1
  189. package/dist/components/gov-toast.js +1 -1
  190. package/dist/components/gov-toast.js.map +1 -1
  191. package/dist/components/gov-tooltip-content.js +1 -1
  192. package/dist/components/gov-tooltip-content.js.map +1 -1
  193. package/dist/components/gov-tooltip.js +1 -1
  194. package/dist/components/gov-tooltip.js.map +1 -1
  195. package/dist/components/gov-wizard-item.js +1 -1
  196. package/dist/components/gov-wizard-item.js.map +1 -1
  197. package/dist/components/p-010f8351.js +2 -0
  198. package/dist/components/{p-35f6490a.js.map → p-010f8351.js.map} +1 -1
  199. package/dist/components/p-3e8a9e92.js.map +1 -1
  200. package/dist/components/p-4981dc67.js +2 -0
  201. package/dist/components/p-4981dc67.js.map +1 -0
  202. package/dist/components/{p-0378da4d.js → p-8d44ca3c.js} +2 -2
  203. package/dist/components/p-8d44ca3c.js.map +1 -0
  204. package/dist/components/{p-da3b225f.js → p-9231ec61.js} +2 -2
  205. package/dist/components/p-9231ec61.js.map +1 -0
  206. package/dist/components/{p-404f469e.js → p-9a4c910d.js} +2 -2
  207. package/dist/components/{p-70d9d879.js → p-a3d3943d.js} +2 -2
  208. package/dist/components/p-a3d3943d.js.map +1 -0
  209. package/dist/components/{p-9cba3cd3.js → p-b00d2836.js} +2 -2
  210. package/dist/components/{p-a6915747.js → p-b9447c86.js} +2 -2
  211. package/dist/components/p-b9447c86.js.map +1 -0
  212. package/dist/core/core.css +1 -1
  213. package/dist/core/core.esm.js +1 -1
  214. package/dist/core/core.esm.js.map +1 -1
  215. package/dist/core/p-0553eb92.entry.js +2 -0
  216. package/dist/core/p-0553eb92.entry.js.map +1 -0
  217. package/dist/core/{p-3d0ab343.entry.js → p-0c57e410.entry.js} +2 -2
  218. package/dist/core/{p-d4cfa93a.entry.js → p-19a54ee9.entry.js} +2 -2
  219. package/dist/core/p-19a54ee9.entry.js.map +1 -0
  220. package/dist/core/p-19b897c0.entry.js +2 -0
  221. package/dist/core/p-19b897c0.entry.js.map +1 -0
  222. package/dist/core/{p-69f944d1.entry.js → p-1c40fdd5.entry.js} +2 -2
  223. package/dist/core/p-1c40fdd5.entry.js.map +1 -0
  224. package/dist/core/{p-13624a77.entry.js → p-28f39f69.entry.js} +2 -2
  225. package/dist/core/p-28f39f69.entry.js.map +1 -0
  226. package/dist/core/{p-18ef9623.entry.js → p-2bf0c1c5.entry.js} +2 -2
  227. package/dist/core/{p-6a65af35.entry.js → p-32a4b7e3.entry.js} +2 -2
  228. package/dist/core/p-32a4b7e3.entry.js.map +1 -0
  229. package/dist/core/p-35c1c12c.entry.js +2 -0
  230. package/dist/core/p-35c1c12c.entry.js.map +1 -0
  231. package/dist/core/{p-bd1cb5bd.entry.js → p-4452c278.entry.js} +2 -2
  232. package/dist/core/{p-ae894a40.js → p-570ef4e5.js} +2 -2
  233. package/dist/core/p-5cc3e768.entry.js +2 -0
  234. package/dist/core/p-5cc3e768.entry.js.map +1 -0
  235. package/dist/core/{p-33bf5974.entry.js → p-7372b066.entry.js} +2 -2
  236. package/dist/core/{p-87aca157.entry.js → p-7702c8c2.entry.js} +2 -2
  237. package/dist/core/{p-9d72d80b.entry.js → p-7e8d2066.entry.js} +2 -2
  238. package/dist/core/{p-a5d00433.entry.js → p-7fa1290e.entry.js} +2 -2
  239. package/dist/core/p-80f5140b.entry.js +2 -0
  240. package/dist/core/{p-2944bf77.entry.js.map → p-80f5140b.entry.js.map} +1 -1
  241. package/dist/core/p-82b4b522.entry.js +2 -0
  242. package/dist/core/p-82b4b522.entry.js.map +1 -0
  243. package/dist/core/p-84f6b11a.entry.js +2 -0
  244. package/dist/core/{p-0c769f1a.entry.js.map → p-84f6b11a.entry.js.map} +1 -1
  245. package/dist/core/{p-41e88980.entry.js → p-93897e60.entry.js} +2 -2
  246. package/dist/core/{p-41e88980.entry.js.map → p-93897e60.entry.js.map} +1 -1
  247. package/dist/core/{p-cacd0fed.entry.js → p-998c3336.entry.js} +2 -2
  248. package/dist/core/{p-404f469e.js → p-9a4c910d.js} +2 -2
  249. package/dist/core/p-a7719b55.entry.js +2 -0
  250. package/dist/core/p-a7719b55.entry.js.map +1 -0
  251. package/dist/core/{p-9bfab069.entry.js → p-acd6a9f4.entry.js} +2 -2
  252. package/dist/core/p-acd6a9f4.entry.js.map +1 -0
  253. package/dist/core/{p-667dc3de.entry.js → p-afa12399.entry.js} +2 -2
  254. package/dist/core/{p-70140f70.entry.js → p-b0c97376.entry.js} +2 -2
  255. package/dist/core/p-b8c35c57.entry.js +2 -0
  256. package/dist/core/p-b8c35c57.entry.js.map +1 -0
  257. package/dist/core/p-bcf71ab5.entry.js +2 -0
  258. package/dist/core/p-bcf71ab5.entry.js.map +1 -0
  259. package/dist/core/{p-0c1697ce.entry.js → p-c4c9ff83.entry.js} +2 -2
  260. package/dist/core/p-c5d3efc2.entry.js +2 -0
  261. package/dist/core/{p-f8252fea.entry.js.map → p-c5d3efc2.entry.js.map} +1 -1
  262. package/dist/core/{p-af646ce2.entry.js → p-c61444f7.entry.js} +2 -2
  263. package/dist/core/p-c61444f7.entry.js.map +1 -0
  264. package/dist/core/p-d84b290e.entry.js +2 -0
  265. package/dist/core/p-d84b290e.entry.js.map +1 -0
  266. package/dist/core/{p-a85f4a62.entry.js → p-e2d6efaf.entry.js} +2 -2
  267. package/dist/core/p-e2d6efaf.entry.js.map +1 -0
  268. package/dist/core/{p-dd39ede4.entry.js → p-e5227e40.entry.js} +2 -2
  269. package/dist/core/{p-dd39ede4.entry.js.map → p-e5227e40.entry.js.map} +1 -1
  270. package/dist/core/{p-8fce08d1.entry.js → p-fab698a7.entry.js} +2 -2
  271. package/dist/core/p-fab698a7.entry.js.map +1 -0
  272. package/dist/esm/{constants-f7b618c2.js → constants-887c5391.js} +2 -2
  273. package/dist/esm/{constants-f7b618c2.js.map → constants-887c5391.js.map} +1 -1
  274. package/dist/esm/core.js +1 -1
  275. package/dist/esm/gov-accordion.entry.js +1 -1
  276. package/dist/esm/gov-app.entry.js +174 -37
  277. package/dist/esm/gov-app.entry.js.map +1 -1
  278. package/dist/esm/gov-attachments_3.entry.js +1 -1
  279. package/dist/esm/gov-backdrop.entry.js +1 -1
  280. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  281. package/dist/esm/gov-badge.entry.js +1 -1
  282. package/dist/esm/gov-badge.entry.js.map +1 -1
  283. package/dist/esm/gov-breadcrumbs.entry.js +1 -1
  284. package/dist/esm/gov-button.entry.js +2 -2
  285. package/dist/esm/gov-button.entry.js.map +1 -1
  286. package/dist/esm/gov-card.entry.js +1 -1
  287. package/dist/esm/gov-dropdown.entry.js +1 -1
  288. package/dist/esm/gov-dropdown.entry.js.map +1 -1
  289. package/dist/esm/gov-form-autocomplete.entry.js +15 -15
  290. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  291. package/dist/esm/gov-form-checkbox.entry.js +3 -3
  292. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  293. package/dist/esm/gov-form-file.entry.js +2 -2
  294. package/dist/esm/gov-form-file.entry.js.map +1 -1
  295. package/dist/esm/gov-form-input.entry.js +2 -2
  296. package/dist/esm/gov-form-input.entry.js.map +1 -1
  297. package/dist/esm/gov-form-label.entry.js +1 -1
  298. package/dist/esm/gov-form-label.entry.js.map +1 -1
  299. package/dist/esm/gov-form-multi-select.entry.js +30 -25
  300. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  301. package/dist/esm/gov-form-radio.entry.js +2 -2
  302. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  303. package/dist/esm/gov-form-select.entry.js +19 -18
  304. package/dist/esm/gov-form-select.entry.js.map +1 -1
  305. package/dist/esm/gov-form-switch.entry.js +3 -3
  306. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  307. package/dist/esm/gov-icon.entry.js +2 -2
  308. package/dist/esm/gov-icon.entry.js.map +1 -1
  309. package/dist/esm/gov-infobar.entry.js +86 -0
  310. package/dist/esm/gov-infobar.entry.js.map +1 -0
  311. package/dist/esm/gov-modal.entry.js +1 -1
  312. package/dist/esm/gov-nav.entry.js +1 -1
  313. package/dist/esm/gov-pagination.entry.js +2 -2
  314. package/dist/esm/gov-pagination.entry.js.map +1 -1
  315. package/dist/esm/gov-prompt.entry.js +1 -1
  316. package/dist/esm/gov-side-nav.entry.js +1 -1
  317. package/dist/esm/gov-skeleton.entry.js +1 -1
  318. package/dist/esm/gov-stepper-item.entry.js +1 -1
  319. package/dist/esm/gov-stepper-item.entry.js.map +1 -1
  320. package/dist/esm/gov-tabs.entry.js +1 -1
  321. package/dist/esm/gov-toast.entry.js +5 -2
  322. package/dist/esm/gov-toast.entry.js.map +1 -1
  323. package/dist/esm/gov-tooltip-content.entry.js +17 -5
  324. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  325. package/dist/esm/gov-tooltip.entry.js +74 -47
  326. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  327. package/dist/esm/gov-wizard-item.entry.js +1 -1
  328. package/dist/esm/gov-wizard-item.entry.js.map +1 -1
  329. package/dist/esm/gov-wizard.entry.js +1 -1
  330. package/dist/esm/index-ae3c50f1.js +4 -4
  331. package/dist/esm/loader.js +1 -1
  332. package/dist/esm/{wcag-062e7ca9.js → wcag-06bd4d01.js} +2 -2
  333. package/dist/esm/{wcag-062e7ca9.js.map → wcag-06bd4d01.js.map} +1 -1
  334. package/dist/globals.d.ts +2 -0
  335. package/dist/hydrate/index.js +461 -267
  336. package/dist/types/components/gov-app/gov-app.d.ts +1 -1
  337. package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +1 -1
  338. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +3 -3
  339. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +15 -3
  340. package/dist/types/components/gov-form/select/gov-form-select.d.ts +7 -3
  341. package/dist/types/components/gov-infobar/default/constants.d.ts +12 -0
  342. package/dist/types/components/{gov-alert/gov-alert.d.ts → gov-infobar/default/gov-infobar.d.ts} +9 -9
  343. package/dist/types/components/gov-infobar/default/gov-infobar.types.d.ts +4 -0
  344. package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +19 -1
  345. package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +7 -3
  346. package/dist/types/components.d.ts +148 -84
  347. package/dist/types/pages/Infobar.d.ts +3 -0
  348. package/dist/types/types/typings.d.ts +6 -0
  349. package/package.json +2 -2
  350. package/dist/cjs/gov-alert.cjs.entry.js +0 -90
  351. package/dist/cjs/gov-alert.cjs.entry.js.map +0 -1
  352. package/dist/collection/components/gov-alert/constants.js +0 -12
  353. package/dist/collection/components/gov-alert/constants.js.map +0 -1
  354. package/dist/collection/components/gov-alert/gov-alert.css +0 -398
  355. package/dist/collection/components/gov-alert/gov-alert.js.map +0 -1
  356. package/dist/collection/components/gov-alert/gov-alert.types.js +0 -2
  357. package/dist/collection/components/gov-alert/gov-alert.types.js.map +0 -1
  358. package/dist/collection/pages/Alert.js.map +0 -1
  359. package/dist/components/gov-alert.js +0 -2
  360. package/dist/components/gov-alert.js.map +0 -1
  361. package/dist/components/p-0378da4d.js.map +0 -1
  362. package/dist/components/p-35f6490a.js +0 -2
  363. package/dist/components/p-70d9d879.js.map +0 -1
  364. package/dist/components/p-a6915747.js.map +0 -1
  365. package/dist/components/p-da3b225f.js.map +0 -1
  366. package/dist/components/p-ee60cdd1.js +0 -2
  367. package/dist/components/p-ee60cdd1.js.map +0 -1
  368. package/dist/core/p-0c769f1a.entry.js +0 -2
  369. package/dist/core/p-13624a77.entry.js.map +0 -1
  370. package/dist/core/p-2944bf77.entry.js +0 -2
  371. package/dist/core/p-3b9df792.entry.js +0 -2
  372. package/dist/core/p-3b9df792.entry.js.map +0 -1
  373. package/dist/core/p-3e5432d7.entry.js +0 -2
  374. package/dist/core/p-3e5432d7.entry.js.map +0 -1
  375. package/dist/core/p-42c1935f.entry.js +0 -2
  376. package/dist/core/p-42c1935f.entry.js.map +0 -1
  377. package/dist/core/p-4c79a97a.entry.js +0 -2
  378. package/dist/core/p-4c79a97a.entry.js.map +0 -1
  379. package/dist/core/p-69f944d1.entry.js.map +0 -1
  380. package/dist/core/p-6a65af35.entry.js.map +0 -1
  381. package/dist/core/p-85258200.entry.js +0 -2
  382. package/dist/core/p-85258200.entry.js.map +0 -1
  383. package/dist/core/p-8fce08d1.entry.js.map +0 -1
  384. package/dist/core/p-9bfab069.entry.js.map +0 -1
  385. package/dist/core/p-a85f4a62.entry.js.map +0 -1
  386. package/dist/core/p-ae04e58f.entry.js +0 -2
  387. package/dist/core/p-ae04e58f.entry.js.map +0 -1
  388. package/dist/core/p-af646ce2.entry.js.map +0 -1
  389. package/dist/core/p-bbcbe1cc.entry.js +0 -2
  390. package/dist/core/p-bbcbe1cc.entry.js.map +0 -1
  391. package/dist/core/p-d4cfa93a.entry.js.map +0 -1
  392. package/dist/core/p-dfc080f2.entry.js +0 -2
  393. package/dist/core/p-dfc080f2.entry.js.map +0 -1
  394. package/dist/core/p-f8252fea.entry.js +0 -2
  395. package/dist/core/p-fb99f144.entry.js +0 -2
  396. package/dist/core/p-fb99f144.entry.js.map +0 -1
  397. package/dist/esm/gov-alert.entry.js +0 -86
  398. package/dist/esm/gov-alert.entry.js.map +0 -1
  399. package/dist/types/components/gov-alert/constants.d.ts +0 -12
  400. package/dist/types/components/gov-alert/gov-alert.types.d.ts +0 -4
  401. package/dist/types/pages/Alert.d.ts +0 -3
  402. /package/dist/components/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
  403. /package/dist/components/{p-9cba3cd3.js.map → p-b00d2836.js.map} +0 -0
  404. /package/dist/core/{p-3d0ab343.entry.js.map → p-0c57e410.entry.js.map} +0 -0
  405. /package/dist/core/{p-18ef9623.entry.js.map → p-2bf0c1c5.entry.js.map} +0 -0
  406. /package/dist/core/{p-bd1cb5bd.entry.js.map → p-4452c278.entry.js.map} +0 -0
  407. /package/dist/core/{p-ae894a40.js.map → p-570ef4e5.js.map} +0 -0
  408. /package/dist/core/{p-33bf5974.entry.js.map → p-7372b066.entry.js.map} +0 -0
  409. /package/dist/core/{p-87aca157.entry.js.map → p-7702c8c2.entry.js.map} +0 -0
  410. /package/dist/core/{p-9d72d80b.entry.js.map → p-7e8d2066.entry.js.map} +0 -0
  411. /package/dist/core/{p-a5d00433.entry.js.map → p-7fa1290e.entry.js.map} +0 -0
  412. /package/dist/core/{p-cacd0fed.entry.js.map → p-998c3336.entry.js.map} +0 -0
  413. /package/dist/core/{p-404f469e.js.map → p-9a4c910d.js.map} +0 -0
  414. /package/dist/core/{p-667dc3de.entry.js.map → p-afa12399.entry.js.map} +0 -0
  415. /package/dist/core/{p-70140f70.entry.js.map → p-b0c97376.entry.js.map} +0 -0
  416. /package/dist/core/{p-0c1697ce.entry.js.map → p-c4c9ff83.entry.js.map} +0 -0
@@ -1,18 +1,22 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { validateProp } from "../../helpers/Validate/props";
3
- import { TooltipPosition, TooltipSize, TooltipClass, TooltipContentClass, TooltipVariant, } from "./constants";
3
+ import { TooltipClass, TooltipContentClass, TooltipPosition, TooltipSize, TooltipVariant, } from "./constants";
4
4
  import { createID } from "../../utils/string.utils";
5
5
  import { govHost } from "../../helpers/Dom/template";
6
6
  export class GovTooltip {
7
7
  constructor() {
8
- this.variant = 'primary';
9
- this.size = 'm';
10
- this.position = 'right';
8
+ this.tooltipContentId = undefined;
9
+ this.tooltipId = undefined;
10
+ this.variant = TooltipVariant.PRIMARY;
11
+ this.size = TooltipSize._M;
12
+ this.position = "right";
11
13
  this.message = undefined;
12
14
  this.identifier = undefined;
13
15
  this.icon = undefined;
16
+ this.persist = false;
14
17
  this.h = govHost(this.host);
15
- this.tooltipId = createID('GovTooltip');
18
+ this.tooltipId = createID("GovTooltip");
19
+ this.tooltipContentId = createID("GovContentTooltip");
16
20
  }
17
21
  validateVariant(newValue) {
18
22
  validateProp(TooltipVariant, newValue, TooltipClass.root);
@@ -30,6 +34,9 @@ export class GovTooltip {
30
34
  this.createContentWrapper();
31
35
  this.registerListeners();
32
36
  }
37
+ disconnectedCallback() {
38
+ this.removeContent();
39
+ }
33
40
  createContentWrapper() {
34
41
  var _a;
35
42
  const hasContentInside = this.host.querySelector(TooltipContentClass.root);
@@ -41,84 +48,103 @@ export class GovTooltip {
41
48
  this.content.innerHTML = this.message;
42
49
  this.host.appendChild(this.content);
43
50
  }
44
- this.content.setAttribute('id', (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipId);
51
+ this.content.setAttribute("id", (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId);
52
+ this.content.setAttribute("parent-id", this.tooltipId);
53
+ this.content.setAttribute("variant", this.variant);
54
+ this.content.setAttribute("size", this.size);
55
+ document.body.appendChild(this.content);
45
56
  }
46
57
  registerListeners() {
47
- this.host.addEventListener('focus', e => {
58
+ this.host.addEventListener("click", e => {
48
59
  e.preventDefault();
60
+ this.persist = true;
49
61
  this.showTooltip();
50
62
  });
51
- this.host.addEventListener('blur', e => {
63
+ this.host.addEventListener("focus", e => {
52
64
  e.preventDefault();
53
- this.hideTooltip();
65
+ this.showTooltip();
66
+ });
67
+ this.host.addEventListener("blur", e => {
68
+ e.preventDefault();
69
+ if (this.persist === false) {
70
+ this.hideTooltip();
71
+ }
54
72
  });
55
- this.host.addEventListener('mouseenter', e => {
73
+ this.host.addEventListener("mouseenter", e => {
56
74
  e.preventDefault();
57
75
  this.showTooltip();
58
76
  });
59
- this.host.addEventListener('mouseleave', e => {
77
+ this.host.addEventListener("mouseleave", e => {
60
78
  e.preventDefault();
61
- this.hideTooltip();
79
+ if (this.persist === false) {
80
+ this.hideTooltip();
81
+ }
62
82
  });
63
83
  }
64
84
  verifyPositionSpace() {
65
- // @TODO Improve positioning of broken lines
66
85
  const offset = 12;
67
- const windowWidth = window.innerWidth;
68
86
  const trigger = this.host.getBoundingClientRect();
69
87
  const trgWidth = this.host.offsetWidth;
88
+ const trgHeight = this.host.offsetHeight;
89
+ const contentWidth = this.content.offsetWidth;
90
+ const contentHeight = this.content.offsetHeight;
70
91
  const triggerPos = {
71
92
  left: trigger.left + document.documentElement.scrollLeft,
72
93
  top: trigger.top + document.documentElement.scrollTop,
73
94
  };
74
- const tltWidth = this.content.offsetWidth;
75
- if (this.position === TooltipPosition.LEFT) {
76
- if (offset + triggerPos.left < tltWidth) {
77
- this.position = TooltipPosition.TOP;
78
- this.content.style.left = '0px';
79
- this.content.style.width = window.innerWidth - triggerPos.left - offset + 'px';
80
- this.content.style.transform = 'none';
81
- }
95
+ // @TODO check space for displaying tooltip
96
+ if (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {
97
+ this.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + "px";
82
98
  }
83
- else if (this.position === TooltipPosition.RIGHT) {
84
- if (windowWidth - (triggerPos.left + trgWidth) < tltWidth) {
85
- this.position = TooltipPosition.TOP;
86
- this.content.style.right = '0px';
87
- this.content.style.left = 'auto';
88
- this.content.style.width = trgWidth + triggerPos.left + offset + 'px';
89
- this.content.style.transform = 'none';
90
- }
99
+ if (this.position === TooltipPosition.RIGHT) {
100
+ this.content.setAttribute("position", TooltipPosition.RIGHT);
101
+ this.content.style.left = (triggerPos.left + offset + trigger.width) + "px";
91
102
  }
92
- else {
93
- // doesn't fit from the left
94
- if (tltWidth / 2 > triggerPos.left) {
95
- this.content.style.left = '0px';
96
- this.content.style.width = window.innerWidth - triggerPos.left - offset + 'px';
97
- this.content.style.transform = 'none';
103
+ if (this.position === TooltipPosition.LEFT) {
104
+ this.content.setAttribute("position", TooltipPosition.LEFT);
105
+ this.content.style.left = (triggerPos.left - (contentWidth + offset)) + "px";
106
+ }
107
+ if (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {
108
+ if (contentWidth > trgWidth) {
109
+ this.content.style.left = (triggerPos.left - ((contentWidth - trgWidth) / 2)) + "px";
98
110
  }
99
- // doesn't fit from the right
100
- else if (tltWidth / 2 > windowWidth - (triggerPos.left + tltWidth)) {
101
- this.content.style.right = '0px';
102
- this.content.style.left = 'auto';
103
- this.content.style.width = trgWidth + triggerPos.left + offset + 'px';
104
- this.content.style.transform = 'none';
111
+ else {
112
+ this.content.style.left = (triggerPos.left + ((trgWidth - contentWidth) / 2)) + "px";
105
113
  }
106
114
  }
115
+ if (this.position === TooltipPosition.TOP) {
116
+ this.content.setAttribute("position", TooltipPosition.TOP);
117
+ this.content.style.top = (triggerPos.top - (contentHeight + offset)) + "px";
118
+ }
119
+ if (this.position === TooltipPosition.BOTTOM) {
120
+ this.content.setAttribute("position", TooltipPosition.BOTTOM);
121
+ this.content.style.top = (triggerPos.top + (trgHeight + offset)) + "px";
122
+ }
107
123
  }
108
124
  showTooltip() {
109
125
  if (this.content) {
110
126
  this.verifyPositionSpace();
111
- this.content.setAttribute('is-visible', 'true');
127
+ this.content.setAttribute("is-visible", "true");
128
+ if (this.persist) {
129
+ this.content.setAttribute("persist", "true");
130
+ }
112
131
  }
113
132
  }
114
133
  hideTooltip() {
115
134
  if (this.content) {
116
- this.content.setAttribute('is-visible', 'false');
135
+ this.content.setAttribute("is-visible", "false");
136
+ this.content.setAttribute("persist", "false");
137
+ }
138
+ }
139
+ removeContent() {
140
+ const contentEl = document.getElementById(this.tooltipContentId);
141
+ if (contentEl) {
142
+ contentEl.remove();
117
143
  }
118
144
  }
119
145
  render() {
120
146
  var _a;
121
- return (h(Host, { class: this.h.classes(TooltipClass.root), position: this.position, size: this.size, tabindex: 0, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipId, variant: this.variant }, h("slot", null)));
147
+ return (h(Host, { id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position, tabindex: 0, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, h("slot", null)));
122
148
  }
123
149
  /**
124
150
  * Showing the modal
@@ -127,9 +153,10 @@ export class GovTooltip {
127
153
  this.showTooltip();
128
154
  }
129
155
  /**
130
- * Hidding the modal
156
+ * Hiding the modal
131
157
  */
132
158
  async hide() {
159
+ this.persist = false;
133
160
  this.hideTooltip();
134
161
  }
135
162
  static get is() { return "gov-tooltip"; }
@@ -167,7 +194,7 @@ export class GovTooltip {
167
194
  },
168
195
  "attribute": "variant",
169
196
  "reflect": false,
170
- "defaultValue": "'primary'"
197
+ "defaultValue": "TooltipVariant.PRIMARY"
171
198
  },
172
199
  "size": {
173
200
  "type": "string",
@@ -191,7 +218,7 @@ export class GovTooltip {
191
218
  },
192
219
  "attribute": "size",
193
220
  "reflect": false,
194
- "defaultValue": "'m'"
221
+ "defaultValue": "TooltipSize._M"
195
222
  },
196
223
  "position": {
197
224
  "type": "string",
@@ -215,7 +242,7 @@ export class GovTooltip {
215
242
  },
216
243
  "attribute": "position",
217
244
  "reflect": false,
218
- "defaultValue": "'right'"
245
+ "defaultValue": "\"right\""
219
246
  },
220
247
  "message": {
221
248
  "type": "string",
@@ -229,7 +256,7 @@ export class GovTooltip {
229
256
  "optional": false,
230
257
  "docs": {
231
258
  "tags": [],
232
- "text": "Information contained in the tolltip"
259
+ "text": "Information contained in the tooltip"
233
260
  },
234
261
  "attribute": "message",
235
262
  "reflect": false,
@@ -272,6 +299,11 @@ export class GovTooltip {
272
299
  }
273
300
  };
274
301
  }
302
+ static get states() {
303
+ return {
304
+ "persist": {}
305
+ };
306
+ }
275
307
  static get methods() {
276
308
  return {
277
309
  "show": {
@@ -304,7 +336,7 @@ export class GovTooltip {
304
336
  "return": "Promise<void>"
305
337
  },
306
338
  "docs": {
307
- "text": "Hidding the modal",
339
+ "text": "Hiding the modal",
308
340
  "tags": []
309
341
  }
310
342
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,E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O,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;KAChD;EACF,CAAC;EAED,MAAM;;IACL,OAAO,CACN,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,CAAC,sBACO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,SAAS,EACnD,OAAO,EAAE,IAAI,CAAC,OAAO;MAErB,eAAQ,CACF,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, Watch } from '@stencil/core'\nimport { validateProp } from '../../helpers/Validate/props'\nimport {\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from './constants'\nimport { createID } from '../../utils/string.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-tooltip',\n\tstyleUrl: 'gov-tooltip.scss',\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipId\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID('GovTooltip')\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = 'primary'\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = 'm'\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop() position: TooltipPositionType = 'right'\n\t/**\n\t * Information contained in the tolltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({ attribute: 'icon' }) readonly icon: boolean = undefined\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch('position')\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tthis.content.setAttribute('id', this.identifier ?? this.tooltipId)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener('focus', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener('blur', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.hideTooltip()\n\t\t})\n\t\tthis.host.addEventListener('mouseenter', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener('mouseleave', e => {\n\t\t\te.preventDefault()\n\t\t\tthis.hideTooltip()\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\t// @TODO Improve positioning of broken lines\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\t\tconst tltWidth = this.content.offsetWidth\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tif (offset + triggerPos.left < tltWidth) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.content.style.left = '0px'\n\t\t\t\tthis.content.style.width = window.innerWidth - triggerPos.left - offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t} else if (this.position === TooltipPosition.RIGHT) {\n\t\t\tif (windowWidth - (triggerPos.left + trgWidth) < tltWidth) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.content.style.right = '0px'\n\t\t\t\tthis.content.style.left = 'auto'\n\t\t\t\tthis.content.style.width = trgWidth + triggerPos.left + offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t} else {\n\t\t\t// doesn't fit from the left\n\t\t\tif (tltWidth / 2 > triggerPos.left) {\n\t\t\t\tthis.content.style.left = '0px'\n\t\t\t\tthis.content.style.width = window.innerWidth - triggerPos.left - offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t\t// doesn't fit from the right\n\t\t\telse if (tltWidth / 2 > windowWidth - (triggerPos.left + tltWidth)) {\n\t\t\t\tthis.content.style.right = '0px'\n\t\t\t\tthis.content.style.left = 'auto'\n\t\t\t\tthis.content.style.width = trgWidth + triggerPos.left + offset + 'px'\n\t\t\t\tthis.content.style.transform = 'none'\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.verifyPositionSpace()\n\t\t\tthis.content.setAttribute('is-visible', 'true')\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute('is-visible', 'false')\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\tsize={this.size}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipId}\n\t\t\t\tvariant={this.variant}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hidding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideTooltip()\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAEf,WAAW,EAEX,cAAc,GAEd,MAAM,aAAa,CAAA;AACpB,OA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,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAChE,IAAI,SAAS,EAAE;MACd,SAAS,CAAC,MAAM,EAAE,CAAA;KAClB;EACF,CAAC;EAED,MAAM;;IACL,OAAO,CACN,EAAC,IAAI,IACJ,EAAE,EAAE,IAAI,CAAC,SAAS,EAClB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,CAAC,sBACO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,gBAAgB;MAC1D,eAAQ,CACF,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACpB,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-tooltip\",\n\tstyleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop() position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({ attribute: \"icon\" }) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tthis.content.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tthis.content.setAttribute(\"parent-id\", this.tooltipId)\n\t\tthis.content.setAttribute(\"variant\", this.variant)\n\t\tthis.content.setAttribute(\"size\", this.size)\n\t\tdocument.body.appendChild(this.content)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"focus\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"blur\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.content.offsetWidth\n\t\tconst contentHeight = this.content.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\t\t// @TODO check space for displaying tooltip\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.content.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.content.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tthis.content.style.left = (triggerPos.left - ((contentWidth - trgWidth) / 2)) + \"px\"\n\t\t\t} else {\n\t\t\t\tthis.content.style.left = (triggerPos.left + ((trgWidth - contentWidth) / 2)) + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.content.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.content.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.verifyPositionSpace()\n\t\t\tthis.content.setAttribute(\"is-visible\", \"true\")\n\t\t\tif (this.persist) {\n\t\t\t\tthis.content.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.content.setAttribute(\"persist\", \"false\")\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"]}
@@ -64,7 +64,7 @@
64
64
  - Variables - Attachments
65
65
  */
66
66
  /*
67
- - Variables - Alert
67
+ - Variables - Infobar
68
68
  */
69
69
  /*
70
70
  - Variables - Backdrop
@@ -283,6 +283,7 @@
283
283
  display: flex;
284
284
  gap: 0.5rem;
285
285
  align-items: center;
286
+ font-weight: var(--gov-wizard-title-font-weight, 700);
286
287
  }
287
288
  .gov-wizard-item__annot {
288
289
  color: var(--gov-color-secondary);
@@ -344,9 +345,6 @@
344
345
  position: absolute;
345
346
  left: 1rem;
346
347
  }
347
- .gov-wizard-item__label {
348
- font-weight: var(--gov-wizard-title-font-weight, 700);
349
- }
350
348
  .gov-wizard-item__header[aria-expanded=true] .gov-wizard-item__label .gov-icon {
351
349
  transform: scale(-1);
352
350
  }
@@ -64,7 +64,7 @@
64
64
  - Variables - Attachments
65
65
  */
66
66
  /*
67
- - Variables - Alert
67
+ - Variables - Infobar
68
68
  */
69
69
  /*
70
70
  - Variables - Backdrop
@@ -0,0 +1,307 @@
1
+ export const primaryColors = [
2
+ {
3
+ name: "Primary 100",
4
+ description: null,
5
+
6
+ hex: "#ecf7ff",
7
+ tokens: ["var(--gov-color-primary-100)", ".gov-color--primary-100"],
8
+ },
9
+ {
10
+ name: "Primary 200",
11
+ description: null,
12
+
13
+ hex: "#d9efff",
14
+ tokens: ["var(--gov-color-primary-200)", ".gov-color--primary-200"],
15
+ },
16
+ {
17
+ name: "Primary 300",
18
+ description: null,
19
+
20
+ hex: "#b5d9f3",
21
+ tokens: ["var(--gov-color-primary-300)", ".gov-color--primary-300"],
22
+ },
23
+ {
24
+ name: "Primary 400",
25
+ description: null,
26
+
27
+ hex: "#66a1d8",
28
+ tokens: ["var(--gov-color-primary-400)", ".gov-color--primary-400"],
29
+ },
30
+ {
31
+ name: "Primary 500",
32
+ description: null,
33
+
34
+ hex: "#3077b7",
35
+ tokens: ["var(--gov-color-primary-500)", ".gov-color--primary"],
36
+ },
37
+ {
38
+ name: "Primary 600",
39
+ description: null,
40
+
41
+ hex: "#2362a2",
42
+ tokens: ["var(--gov-color-primary-600)", ".gov-color--primary-600"],
43
+ },
44
+ {
45
+ name: "Primary 700",
46
+ description: null,
47
+
48
+ hex: "#254e80",
49
+ tokens: ["var(--gov-color-primary-700)", ".gov-color--primary-700"],
50
+ },
51
+ {
52
+ name: "Primary 800",
53
+ description: null,
54
+
55
+ hex: "#15355e",
56
+ tokens: ["var(--gov-color-primary-800)", ".gov-color--primary-800"],
57
+ },
58
+ {
59
+ name: "Primary 900",
60
+ description: null,
61
+
62
+ hex: "#0d213a",
63
+ tokens: ["var(--gov-color-primary-900)", ".gov-color--primary-900"],
64
+ },
65
+ ]
66
+
67
+ export const secondaryColors = [
68
+ {
69
+ name: "Secondary 100",
70
+ description: null,
71
+
72
+ hex: "#FCFCFC",
73
+ tokens: ["var(--gov-color-secondary-100)", ".gov-color--secondary-100"],
74
+ },
75
+ {
76
+ name: "Secondary 200",
77
+ description: null,
78
+
79
+ hex: "#fafafa",
80
+ tokens: ["var(--gov-color-secondary-200)", ".gov-color--secondary-200"],
81
+ },
82
+ {
83
+ name: "Secondary 300",
84
+ description: null,
85
+
86
+ hex: "#f5f5f5",
87
+ tokens: ["var(--gov-color-secondary-300)", ".gov-color--secondary-300"],
88
+ },
89
+ {
90
+ name: "Secondary 400",
91
+ description: null,
92
+
93
+ hex: "#eaeaea",
94
+ tokens: ["var(--gov-color-secondary-400)", ".gov-color--secondary-400"],
95
+ },
96
+ {
97
+ name: "Secondary 500",
98
+ description: null,
99
+
100
+ hex: "#ddd",
101
+ tokens: ["var(--gov-color-secondary-500)", ".gov-color--secondary"],
102
+ },
103
+ {
104
+ name: "Secondary 600",
105
+ description: null,
106
+
107
+ hex: "#a8a8a8",
108
+ tokens: ["var(--gov-color-secondary-600)", ".gov-color--secondary-600"],
109
+ },
110
+ {
111
+ name: "Secondary 700",
112
+ description: null,
113
+
114
+ hex: "#686868",
115
+ tokens: ["var(--gov-color-secondary-700)", ".gov-color--secondary-700"],
116
+ },
117
+ {
118
+ name: "Secondary 800",
119
+ description: null,
120
+
121
+ hex: "#3b3b3b",
122
+ tokens: ["var(--gov-color-secondary-800)", ".gov-color--secondary-800"],
123
+ },
124
+ {
125
+ name: "Secondary 900",
126
+ description: null,
127
+
128
+ hex: "#232323",
129
+ tokens: ["var(--gov-color-secondary-900)", ".gov-color--secondary-900"],
130
+ },
131
+ ]
132
+
133
+ export const successColors = [
134
+ {
135
+ name: "Success 100",
136
+ description: null,
137
+
138
+ hex: "#f5faf0",
139
+ tokens: ["var(--gov-color-success-100)", ".gov-color--success-100"],
140
+ },
141
+ {
142
+ name: "Success 200",
143
+ description: null,
144
+
145
+ hex: "#dcefcc",
146
+ tokens: ["var(--gov-color-success-200)", ".gov-color--success-200"],
147
+ },
148
+ {
149
+ name: "Success 300",
150
+ description: null,
151
+
152
+ hex: "#a3d578",
153
+ tokens: ["var(--gov-color-success-300)", ".gov-color--success-300"],
154
+ },
155
+ {
156
+ name: "Success 400",
157
+ description: null,
158
+
159
+ hex: "#6fbd2c",
160
+ tokens: ["var(--gov-color-success-400)", ".gov-color--success-400"],
161
+ },
162
+ {
163
+ name: "Success 500",
164
+ description: null,
165
+
166
+ hex: "#488515",
167
+ tokens: ["var(--gov-color-success-500)", ".gov-color--success"],
168
+ },
169
+ {
170
+ name: "Success 600",
171
+ description: null,
172
+
173
+ hex: "#3a6217",
174
+ tokens: ["var(--gov-color-success-600)", ".gov-color--success-600"],
175
+ },
176
+ {
177
+ name: "Success 700",
178
+ description: null,
179
+
180
+ hex: "#2c4f0d",
181
+ tokens: ["var(--gov-color-success-700)", ".gov-color--success-700"],
182
+ },
183
+ ]
184
+
185
+ export const warningColors = [
186
+ {
187
+ name: "Warning 100",
188
+ description: null,
189
+
190
+ hex: "#fef9ef",
191
+ tokens: ["var(--gov-color-warning-100)", ".gov-color--warning-100"],
192
+ },
193
+ {
194
+ name: "Warning 200",
195
+ description: null,
196
+
197
+ hex: "#faecc8",
198
+ tokens: ["var(--gov-color-warning-200)", ".gov-color--warning-200"],
199
+ },
200
+ {
201
+ name: "Warning 300",
202
+ description: null,
203
+
204
+ hex: "#fad47b",
205
+ tokens: ["var(--gov-color-warning-300)", ".gov-color--warning-300"],
206
+ },
207
+ {
208
+ name: "Warning 400",
209
+ description: null,
210
+
211
+ hex: "#f9c13c",
212
+ tokens: ["var(--gov-color-warning-400)", ".gov-color--warning-400"],
213
+ },
214
+ {
215
+ name: "Warning 500",
216
+ description: null,
217
+
218
+ hex: "#c78300",
219
+ tokens: ["var(--gov-color-warning-500)", ".gov-color--warning"],
220
+ },
221
+ {
222
+ name: "Warning 600",
223
+ description: null,
224
+
225
+ hex: "#99620f",
226
+ tokens: ["var(--gov-color-warning-600)", ".gov-color--warning-600"],
227
+ },
228
+ {
229
+ name: "Warning 700",
230
+ description: null,
231
+
232
+ hex: "#865102",
233
+ tokens: ["var(--gov-color-warning-700)", ".gov-color--warning-700"],
234
+ },
235
+ ]
236
+
237
+ export const errorColors = [
238
+ {
239
+ name: "Error 100",
240
+ description: null,
241
+
242
+ hex: "#ffe8ea",
243
+ tokens: ["var(--gov-color-error-100)", ".gov-color--error-100"],
244
+ },
245
+ {
246
+ name: "Error 200",
247
+ description: null,
248
+
249
+ hex: "#f7cdd2",
250
+ tokens: ["var(--gov-color-error-200)", ".gov-color--error-200"],
251
+ },
252
+ {
253
+ name: "Error 300",
254
+ description: null,
255
+
256
+ hex: "#d96671",
257
+ tokens: ["var(--gov-color-error-300)", ".gov-color--error-300"],
258
+ },
259
+ {
260
+ name: "Error 400",
261
+ description: null,
262
+
263
+ hex: "#c52a3a",
264
+ tokens: ["var(--gov-color-error-400)", ".gov-color--error-400"],
265
+ },
266
+ {
267
+ name: "Error 500",
268
+ description: null,
269
+
270
+ hex: "#9e0615",
271
+ tokens: ["var(--gov-color-error-500)", ".gov-color--error"],
272
+ },
273
+ {
274
+ name: "Error 600",
275
+ description: null,
276
+
277
+ hex: "#830713",
278
+ tokens: ["var(--gov-color-error-600)", ".gov-color--error-600"],
279
+ },
280
+ ]
281
+
282
+ export const focusColors = [
283
+ {
284
+ name: "Focus Base",
285
+ description: null,
286
+
287
+ hex: "#007bff",
288
+ tokens: ["var(--gov-color-focus-base)", ".gov-color--focus-base"],
289
+ },
290
+ ]
291
+
292
+ export const neutralColors = [
293
+ {
294
+ name: "Neutral Black",
295
+ description: null,
296
+
297
+ hex: "#000",
298
+ tokens: ["var(--gov-color-neutral-black)", ".gov-color--neutral-black"],
299
+ },
300
+ {
301
+ name: "Neutral White",
302
+ description: null,
303
+
304
+ hex: "#FFF",
305
+ tokens: ["var(--gov-color-neutral-white)", ".gov-color--neutral-white"],
306
+ },
307
+ ]