@gov-design-system-ce/components 0.0.66 → 0.0.68
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.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +2 -2
- package/dist/cjs/gov-app.cjs.entry.js +159 -0
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +2 -2
- package/dist/cjs/gov-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/gov-button.cjs.entry.js +8 -3
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +2 -2
- package/dist/cjs/gov-chip.cjs.entry.js +6 -1
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +2 -2
- package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +74 -11
- package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-infobar.cjs.entry.js +3 -3
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +11 -11
- package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-nav.cjs.entry.js +2 -2
- package/dist/cjs/gov-pagination.cjs.entry.js +2 -2
- package/dist/cjs/gov-prompt.cjs.entry.js +14 -14
- package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-side-nav.cjs.entry.js +2 -2
- package/dist/cjs/gov-skeleton.cjs.entry.js +2 -2
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +2 -2
- package/dist/cjs/gov-tag.cjs.entry.js +6 -1
- package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard.cjs.entry.js +2 -2
- package/dist/cjs/helpers-2c870ff5.js +19 -0
- package/dist/cjs/helpers-2c870ff5.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{wcag-d7912060.js → wcag-ebd590c0.js} +2 -2
- package/dist/cjs/{wcag-d7912060.js.map → wcag-ebd590c0.js.map} +1 -1
- package/dist/cjs/{win-0427c131.js → win-9d1a8a53.js} +2 -2
- package/dist/cjs/win-9d1a8a53.js.map +1 -0
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -0
- package/dist/collection/components/gov-button/button/gov-button.js +44 -5
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
- package/dist/collection/components/gov-chip/gov-chip.js +40 -1
- package/dist/collection/components/gov-chip/gov-chip.js.map +1 -1
- package/dist/collection/components/gov-control-group/constants.js +1 -1
- package/dist/collection/components/gov-control-group/constants.js.map +1 -1
- package/dist/collection/components/gov-control-group/gov-control-group.css +18 -0
- package/dist/collection/components/gov-control-group/gov-control-group.js +1 -1
- package/dist/collection/components/gov-error-code/gov-error-code.css +4 -4
- package/dist/collection/components/gov-form/control/gov-form-control.css +13 -13
- package/dist/collection/components/gov-form/label/gov-form-label.css +5 -0
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +251 -12
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.types.js.map +1 -1
- package/dist/collection/components/gov-icon/helpers.js +14 -0
- package/dist/collection/components/gov-icon/helpers.js.map +1 -0
- package/dist/collection/components/gov-infobar/gov-infobar.css +3 -5
- package/dist/collection/components/gov-modal/gov-modal.js +13 -12
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-promp/gov-prompt.js +18 -17
- package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +2 -2
- package/dist/collection/components/gov-tag/gov-tag.js +40 -1
- package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +0 -2
- package/dist/collection/helpers/Dom/win.js +1 -1
- package/dist/collection/helpers/Dom/win.js.map +1 -1
- package/dist/collection/pages/Button.js +4 -0
- package/dist/collection/pages/Button.js.map +1 -1
- package/dist/collection/pages/ControlGroup.js +95 -0
- package/dist/collection/pages/ControlGroup.js.map +1 -1
- package/dist/collection/pages/Forms.js +16 -0
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Infobar.js +44 -0
- package/dist/collection/pages/Infobar.js.map +1 -1
- package/dist/collection/utils/helpers.types.js +54 -0
- package/dist/collection/utils/helpers.types.js.map +1 -0
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +1 -1
- package/dist/components/gov-app.js +1 -1
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-attachments.js +1 -1
- package/dist/components/gov-backdrop.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-control-group.js +1 -1
- package/dist/components/gov-control-group.js.map +1 -1
- package/dist/components/gov-error-code.js +1 -1
- package/dist/components/gov-error-code.js.map +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-control.js +1 -1
- package/dist/components/gov-form-control.js.map +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-label.js +1 -1
- package/dist/components/gov-form-label.js.map +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-multi-select.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-infobar.js.map +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-nav.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-prompt.js.map +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-side-nav.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-statsbar-item.js +1 -1
- package/dist/components/gov-statsbar-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-tag.js.map +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/p-00b7c4f5.js +2 -0
- package/dist/components/{p-01973e7c.js → p-09c9405e.js} +2 -2
- package/dist/components/{p-517eadc5.js → p-0ef237e1.js} +2 -2
- package/dist/components/p-12aebffb.js +2 -0
- package/dist/components/p-12aebffb.js.map +1 -0
- package/dist/{core/p-4bd25e13.entry.js → components/p-12ffcecf.js} +2 -2
- package/dist/components/p-12ffcecf.js.map +1 -0
- package/dist/components/{p-4d3ad11d.js → p-1e6a2ff1.js} +2 -2
- package/dist/components/{p-d60bcfde.js → p-26dfbba1.js} +2 -2
- package/dist/components/p-2bf5b814.js +2 -0
- package/dist/components/p-2bf5b814.js.map +1 -0
- package/dist/components/{p-977c00bf.js → p-3186d4f6.js} +2 -2
- package/dist/components/{p-f2efd9b5.js → p-530fbb0a.js} +2 -2
- package/dist/components/{p-3718261d.js → p-7bfd6fca.js} +2 -2
- package/dist/components/p-d23e6972.js +2 -0
- package/dist/components/p-d23e6972.js.map +1 -0
- package/dist/core/core.css +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-c0be9590.entry.js → p-093160bb.entry.js} +2 -2
- package/dist/core/{p-9af6210d.entry.js → p-0950ca8d.entry.js} +2 -2
- package/dist/core/{p-466f885b.entry.js → p-13942637.entry.js} +2 -2
- package/dist/core/p-13942637.entry.js.map +1 -0
- package/dist/core/p-1fd3d109.entry.js +2 -0
- package/dist/core/{p-2bcabdd5.entry.js.map → p-1fd3d109.entry.js.map} +1 -1
- package/dist/core/{p-965f24fb.entry.js → p-26921fac.entry.js} +2 -2
- package/dist/core/{p-c3e4700b.entry.js → p-28c83bdf.entry.js} +2 -2
- package/dist/core/p-2bf5b814.js +2 -0
- package/dist/core/p-2bf5b814.js.map +1 -0
- package/dist/core/p-31b93317.entry.js +2 -0
- package/dist/core/p-31b93317.entry.js.map +1 -0
- package/dist/core/{p-e9c0fac1.entry.js → p-3aa4cf18.entry.js} +2 -2
- package/dist/core/p-5d8776c1.entry.js +2 -0
- package/dist/core/p-5d8776c1.entry.js.map +1 -0
- package/dist/core/{p-029beaf4.entry.js → p-6b1c11ba.entry.js} +2 -2
- package/dist/core/p-6b1c11ba.entry.js.map +1 -0
- package/dist/core/p-74882c70.entry.js +2 -0
- package/dist/core/p-74882c70.entry.js.map +1 -0
- package/dist/core/{p-b3840f50.entry.js → p-79ca1b62.entry.js} +2 -2
- package/dist/core/{p-a54c1e85.entry.js → p-7cd73b1e.entry.js} +2 -2
- package/dist/core/p-878741b6.entry.js +2 -0
- package/dist/core/{p-9d4a6e9b.entry.js.map → p-878741b6.entry.js.map} +1 -1
- package/dist/core/{p-2016172f.entry.js → p-89b3e4d4.entry.js} +2 -2
- package/dist/core/{p-2016172f.entry.js.map → p-89b3e4d4.entry.js.map} +1 -1
- package/dist/core/p-9aeb4282.entry.js +2 -0
- package/dist/core/p-9aeb4282.entry.js.map +1 -0
- package/dist/core/{p-a3b6c5c7.entry.js → p-9d10131d.entry.js} +2 -2
- package/dist/core/{p-83afcd5b.entry.js → p-9f9e2bd8.entry.js} +2 -2
- package/dist/core/p-a7d895cb.entry.js +2 -0
- package/dist/core/{p-7b7f8cc2.entry.js.map → p-a7d895cb.entry.js.map} +1 -1
- package/dist/core/{p-a133cdda.entry.js → p-acb40ea2.entry.js} +2 -2
- package/dist/core/{p-b49ac370.entry.js → p-af1433f7.entry.js} +2 -2
- package/dist/core/{p-eb0c9716.entry.js → p-ba7cbd7f.entry.js} +2 -2
- package/dist/core/p-bb7f0a66.entry.js +2 -0
- package/dist/core/p-bb7f0a66.entry.js.map +1 -0
- package/dist/core/p-bd763705.entry.js +2 -0
- package/dist/core/p-bd763705.entry.js.map +1 -0
- package/dist/core/p-bf39d442.entry.js +2 -0
- package/dist/core/p-bf39d442.entry.js.map +1 -0
- package/dist/core/p-c44d44df.entry.js +2 -0
- package/dist/core/p-c44d44df.entry.js.map +1 -0
- package/dist/core/{p-87b5668e.entry.js → p-cef10fe5.entry.js} +2 -2
- package/dist/core/p-d1a3e571.entry.js +2 -0
- package/dist/core/p-d1a3e571.entry.js.map +1 -0
- package/dist/core/p-d23e6972.js +2 -0
- package/dist/core/p-d23e6972.js.map +1 -0
- package/dist/core/{p-4accef73.entry.js → p-d4d59523.entry.js} +2 -2
- package/dist/core/p-ecc8cc47.entry.js +2 -0
- package/dist/core/p-ecc8cc47.entry.js.map +1 -0
- package/dist/core/p-ee35ca3f.entry.js +2 -0
- package/dist/core/p-ee35ca3f.entry.js.map +1 -0
- package/dist/core/{p-6833aeaf.entry.js → p-f4a6a339.entry.js} +2 -2
- package/dist/core/p-faabd332.js +2 -0
- package/dist/core/p-fc81b896.entry.js +2 -0
- package/dist/core/p-fc81b896.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +2 -2
- package/dist/esm/gov-app.entry.js +159 -0
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +2 -2
- package/dist/esm/gov-backdrop.entry.js +2 -2
- package/dist/esm/gov-breadcrumbs.entry.js +2 -2
- package/dist/esm/gov-button.entry.js +8 -3
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +2 -2
- package/dist/esm/gov-chip.entry.js +6 -1
- package/dist/esm/gov-chip.entry.js.map +1 -1
- package/dist/esm/gov-control-group.entry.js +2 -2
- package/dist/esm/gov-control-group.entry.js.map +1 -1
- package/dist/esm/gov-error-code.entry.js +1 -1
- package/dist/esm/gov-error-code.entry.js.map +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +2 -2
- package/dist/esm/gov-form-control.entry.js +1 -1
- package/dist/esm/gov-form-control.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +2 -2
- package/dist/esm/gov-form-input.entry.js +2 -2
- package/dist/esm/gov-form-label.entry.js +1 -1
- package/dist/esm/gov-form-label.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +74 -11
- package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +2 -2
- package/dist/esm/gov-form-select.entry.js +2 -2
- package/dist/esm/gov-form-switch.entry.js +2 -2
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-infobar.entry.js +3 -3
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-modal.entry.js +11 -11
- package/dist/esm/gov-modal.entry.js.map +1 -1
- package/dist/esm/gov-nav.entry.js +2 -2
- package/dist/esm/gov-pagination.entry.js +2 -2
- package/dist/esm/gov-prompt.entry.js +14 -14
- package/dist/esm/gov-prompt.entry.js.map +1 -1
- package/dist/esm/gov-side-nav.entry.js +2 -2
- package/dist/esm/gov-skeleton.entry.js +2 -2
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar-item.entry.js.map +1 -1
- package/dist/esm/gov-tabs.entry.js +2 -2
- package/dist/esm/gov-tag.entry.js +6 -1
- package/dist/esm/gov-tag.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +1 -1
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard.entry.js +2 -2
- package/dist/esm/helpers-bc0fd116.js +17 -0
- package/dist/esm/helpers-bc0fd116.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{wcag-06bd4d01.js → wcag-b7b67e25.js} +2 -2
- package/dist/esm/{wcag-06bd4d01.js.map → wcag-b7b67e25.js.map} +1 -1
- package/dist/esm/{win-0a50f66e.js → win-0d231cca.js} +2 -2
- package/dist/esm/win-0d231cca.js.map +1 -0
- package/dist/hydrate/index.js +306 -45
- package/dist/types/components/gov-button/button/gov-button.d.ts +9 -1
- package/dist/types/components/gov-chip/gov-chip.d.ts +8 -0
- package/dist/types/components/gov-control-group/constants.d.ts +1 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +33 -1
- package/dist/types/components/gov-form/multiselect/gov-form-multi-select.types.d.ts +1 -0
- package/dist/types/components/gov-icon/helpers.d.ts +5 -0
- package/dist/types/components/gov-modal/gov-modal.d.ts +3 -3
- package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -3
- package/dist/types/components/gov-tag/gov-tag.d.ts +8 -0
- package/dist/types/components.d.ts +86 -2
- package/dist/types/utils/helpers.types.d.ts +49 -0
- package/package.json +2 -2
- package/dist/cjs/win-0427c131.js.map +0 -1
- package/dist/collection/helpers/StorybookDocsTemplate.js +0 -9
- package/dist/collection/helpers/StorybookDocsTemplate.js.map +0 -1
- package/dist/components/p-7fe7f6cd.js +0 -2
- package/dist/components/p-7fe7f6cd.js.map +0 -1
- package/dist/components/p-ae894a40.js +0 -2
- package/dist/components/p-cac3881f.js +0 -2
- package/dist/components/p-cac3881f.js.map +0 -1
- package/dist/components/p-d71d23ef.js +0 -2
- package/dist/components/p-d71d23ef.js.map +0 -1
- package/dist/core/p-029beaf4.entry.js.map +0 -1
- package/dist/core/p-14ca0233.entry.js +0 -2
- package/dist/core/p-14ca0233.entry.js.map +0 -1
- package/dist/core/p-2a95f9fb.entry.js +0 -2
- package/dist/core/p-2a95f9fb.entry.js.map +0 -1
- package/dist/core/p-2bcabdd5.entry.js +0 -2
- package/dist/core/p-356adceb.entry.js +0 -2
- package/dist/core/p-356adceb.entry.js.map +0 -1
- package/dist/core/p-3bd226fc.entry.js +0 -2
- package/dist/core/p-3bd226fc.entry.js.map +0 -1
- package/dist/core/p-466f885b.entry.js.map +0 -1
- package/dist/core/p-4bd25e13.entry.js.map +0 -1
- package/dist/core/p-53549fe4.entry.js +0 -2
- package/dist/core/p-53549fe4.entry.js.map +0 -1
- package/dist/core/p-570ef4e5.js +0 -2
- package/dist/core/p-603a9d99.entry.js +0 -2
- package/dist/core/p-603a9d99.entry.js.map +0 -1
- package/dist/core/p-7b7f8cc2.entry.js +0 -2
- package/dist/core/p-7d85bc32.entry.js +0 -2
- package/dist/core/p-7d85bc32.entry.js.map +0 -1
- package/dist/core/p-8811fe68.entry.js +0 -2
- package/dist/core/p-8811fe68.entry.js.map +0 -1
- package/dist/core/p-9d4a6e9b.entry.js +0 -2
- package/dist/core/p-a9493d11.entry.js +0 -2
- package/dist/core/p-a9493d11.entry.js.map +0 -1
- package/dist/core/p-c5e9da95.entry.js +0 -2
- package/dist/core/p-c5e9da95.entry.js.map +0 -1
- package/dist/core/p-cac3881f.js +0 -2
- package/dist/core/p-cac3881f.js.map +0 -1
- package/dist/core/p-d4c468b9.entry.js +0 -2
- package/dist/core/p-d4c468b9.entry.js.map +0 -1
- package/dist/esm/win-0a50f66e.js.map +0 -1
- package/dist/types/helpers/StorybookDocsTemplate.d.ts +0 -3
- /package/dist/components/{p-ae894a40.js.map → p-00b7c4f5.js.map} +0 -0
- /package/dist/components/{p-01973e7c.js.map → p-09c9405e.js.map} +0 -0
- /package/dist/components/{p-517eadc5.js.map → p-0ef237e1.js.map} +0 -0
- /package/dist/components/{p-4d3ad11d.js.map → p-1e6a2ff1.js.map} +0 -0
- /package/dist/components/{p-d60bcfde.js.map → p-26dfbba1.js.map} +0 -0
- /package/dist/components/{p-977c00bf.js.map → p-3186d4f6.js.map} +0 -0
- /package/dist/components/{p-f2efd9b5.js.map → p-530fbb0a.js.map} +0 -0
- /package/dist/components/{p-3718261d.js.map → p-7bfd6fca.js.map} +0 -0
- /package/dist/core/{p-c0be9590.entry.js.map → p-093160bb.entry.js.map} +0 -0
- /package/dist/core/{p-9af6210d.entry.js.map → p-0950ca8d.entry.js.map} +0 -0
- /package/dist/core/{p-965f24fb.entry.js.map → p-26921fac.entry.js.map} +0 -0
- /package/dist/core/{p-c3e4700b.entry.js.map → p-28c83bdf.entry.js.map} +0 -0
- /package/dist/core/{p-e9c0fac1.entry.js.map → p-3aa4cf18.entry.js.map} +0 -0
- /package/dist/core/{p-b3840f50.entry.js.map → p-79ca1b62.entry.js.map} +0 -0
- /package/dist/core/{p-a54c1e85.entry.js.map → p-7cd73b1e.entry.js.map} +0 -0
- /package/dist/core/{p-a3b6c5c7.entry.js.map → p-9d10131d.entry.js.map} +0 -0
- /package/dist/core/{p-83afcd5b.entry.js.map → p-9f9e2bd8.entry.js.map} +0 -0
- /package/dist/core/{p-a133cdda.entry.js.map → p-acb40ea2.entry.js.map} +0 -0
- /package/dist/core/{p-b49ac370.entry.js.map → p-af1433f7.entry.js.map} +0 -0
- /package/dist/core/{p-eb0c9716.entry.js.map → p-ba7cbd7f.entry.js.map} +0 -0
- /package/dist/core/{p-87b5668e.entry.js.map → p-cef10fe5.entry.js.map} +0 -0
- /package/dist/core/{p-4accef73.entry.js.map → p-d4d59523.entry.js.map} +0 -0
- /package/dist/core/{p-6833aeaf.entry.js.map → p-f4a6a339.entry.js.map} +0 -0
- /package/dist/core/{p-570ef4e5.js.map → p-faabd332.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as Host, g as getElement, c as createEvent } from './index-eb59f132.js';
|
|
2
|
-
import { c as validateWcagProp, v as validateWcagLabel } from './wcag-
|
|
3
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
2
|
+
import { c as validateWcagProp, v as validateWcagLabel } from './wcag-b7b67e25.js';
|
|
3
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
4
4
|
import { d as delay } from './utils-c057a3fa.js';
|
|
5
5
|
import { g as govHost } from './template-df429738.js';
|
|
6
6
|
import { F as FormMessageClass, a as FormMessageVariants } from './constants-3df712e2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
|
|
2
|
-
import { v as validateWcagLabel } from './wcag-
|
|
3
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
2
|
+
import { v as validateWcagLabel } from './wcag-b7b67e25.js';
|
|
3
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
4
4
|
import { d as delay } from './utils-c057a3fa.js';
|
|
5
5
|
import { g as govHost } from './template-df429738.js';
|
|
6
6
|
import './gov.log-af905420.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
|
|
2
|
-
import { v as validateWcagLabel } from './wcag-
|
|
3
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
2
|
+
import { v as validateWcagLabel } from './wcag-b7b67e25.js';
|
|
3
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
4
4
|
import { d as delay } from './utils-c057a3fa.js';
|
|
5
5
|
import { g as govHost } from './template-df429738.js';
|
|
6
6
|
import './gov.log-af905420.js';
|
|
@@ -3,9 +3,10 @@ import { v as validateProp } from './props-789f7529.js';
|
|
|
3
3
|
import { B as ButtonClass, b as ButtonVariants, T as Type, N as NativeType } from './constants-34a29ae2.js';
|
|
4
4
|
import { g as govHost, p as prepareClasses, t as toBoolAttrIfDefined, a as toBoolAttr } from './template-df429738.js';
|
|
5
5
|
import { S as Sizes } from './sizes-6c5943b4.js';
|
|
6
|
-
import { a as validateWcagRef, v as validateWcagLabel } from './wcag-
|
|
7
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
6
|
+
import { a as validateWcagRef, v as validateWcagLabel } from './wcag-b7b67e25.js';
|
|
7
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
8
8
|
import { d as delay } from './utils-c057a3fa.js';
|
|
9
|
+
import { p as prepareIconFormat } from './helpers-bc0fd116.js';
|
|
9
10
|
import './gov.log-af905420.js';
|
|
10
11
|
import './variants-2b936d58.js';
|
|
11
12
|
import './string.utils-f268fc6b.js';
|
|
@@ -44,6 +45,8 @@ const GovButton = class {
|
|
|
44
45
|
this.expanded = false;
|
|
45
46
|
this.inverse = false;
|
|
46
47
|
this.name = undefined;
|
|
48
|
+
this.iconLeft = undefined;
|
|
49
|
+
this.iconRight = undefined;
|
|
47
50
|
this.disabled = false;
|
|
48
51
|
this.nativeType = "button";
|
|
49
52
|
this.href = undefined;
|
|
@@ -101,8 +104,10 @@ const GovButton = class {
|
|
|
101
104
|
render() {
|
|
102
105
|
const Tag = this.href ? Tags.A : Tags.BUTTON;
|
|
103
106
|
const nativeType = Tag === Tags.A ? undefined : this.nativeType;
|
|
107
|
+
const iconLeft = prepareIconFormat(this.iconLeft);
|
|
108
|
+
const iconRight = prepareIconFormat(this.iconRight);
|
|
104
109
|
return (h(Host, { hoverable: true, size: this.size, variant: this.variant, class: this.h.classes(this.classNames), type: this.type, inverse: this.inverse }, h(Tag, { class: "element", ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onMouseDown: () => (this.isPressed = true), onMouseUp: () => (this.isPressed = false), disabled: this.disabled, id: this.identifier, href: this.href, target: this.target, download: this.download, hreflang: this.hreflang, rel: this.rel, name: this.name, type: nativeType, tabindex: this.focusable ? "0" : "-1", "aria-activedescendant": this.wcagActiveDescendant, "aria-describedby": this.wcagActiveDescendant, "aria-description": this.wcagDescription, "aria-controls": this.wcagControls, "aria-details": this.wcagDetails, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-haspopup": toBoolAttrIfDefined(this.wcagHasPopup), "aria-pressed": toBoolAttr(this.isPressed), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-current": this.wcagCurrent }, toBool(this.loading) && !this.h.hasSlot("right-icon") &&
|
|
105
|
-
h("gov-icon", { name: "loader", class: "gov-spin-animation" }), this.h.hasSlot("left-icon") && h("slot", { name: "left-icon" }), h("slot", null), this.h.hasSlot("right-icon") && h("slot", { name: "right-icon" }), toBool(this.loading) && this.h.hasSlot("right-icon") &&
|
|
110
|
+
h("gov-icon", { name: "loader", class: "gov-spin-animation" }), this.h.hasSlot("left-icon") && h("slot", { name: "left-icon" }), iconLeft && h("gov-icon", { type: iconLeft.type, name: iconLeft.name }), h("slot", null), this.h.hasSlot("right-icon") && h("slot", { name: "right-icon" }), iconRight && h("gov-icon", { type: iconRight.type, name: iconRight.name }), toBool(this.loading) && this.h.hasSlot("right-icon") &&
|
|
106
111
|
h("gov-icon", { name: "loader", class: "gov-spin-animation" }))));
|
|
107
112
|
}
|
|
108
113
|
onClickHandler(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-button.entry.js","mappings":";;;;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;EAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;GAC1D;OAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,KAAK,GAAG,CAAC,CAAA;GAChB;OAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;IACtC,OAAO,KAAK,CAAA;GACZ;OAAM;IACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;GAC3B;AACF;;ACVA,MAAM,YAAY,GAAG,gtyEAAgtyE;;ACsBruyE,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,eAAO,CAAA;EACP,yBAAiB,CAAA;AAClB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,SAAS;EAIrB;;;;;;gBAa2D,GAAG;gBAIT,OAAO;oBAIvB,KAAK;mBAIN,KAAK;;oBASa,KAAK;sBAKX,QAAQ;;;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;KACxE;GACD;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & chip\n@import \"gov-button-core\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tjustify-content: flex-start;\n\t\t\talign-items: flex-start;\n\t\t\ttext-align: left;\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n\t&[size=\"s\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 4px;\n\t}\n\t&[size=\"m\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 2px;\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport {\n\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 parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: \"wcag-description\" }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: \"wcag-details\" }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: \"wcag-has-popup\" }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: \"wcag-pressed\" }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: \"wcag-current\" }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tget classNames(): string {\n\t\tconst { h } = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot(\"left-icon\") && ButtonClass.rootWithIcon, h.hasSlot(\"right-icon\") && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\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.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, \"aria-haspopup\", ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, ButtonClass.root)\n\t\t}\n\t}\n}\n"],"version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,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAE,WAAW,CAAC,IAAI;MAC3B,aAAa,EAAE,CAAC;MAChB,GAAG,EAAE,IAAI,CAAC,IAAI;KACd,CAAC,CAAA;GACF;EAEO,aAAa,CAAC,CAAa;IAClC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;MACjB,SAAS,EAAE,WAAW,CAAC,IAAI;MAC3B,aAAa,EAAE,CAAC;MAChB,GAAG,EAAE,IAAI,CAAC,IAAI;KACd,CAAC,CAAA;GACF;;;;EAMD,MAAM,QAAQ;IACb,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;GACvB;;;;EAMD,MAAM,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;GACtB;;;;EAMD,MAAM,YAAY;IACjB,IAAI,IAAI,CAAC,SAAS,EAAE;MACnB,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,uBAAuB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrF,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACnE,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MAC7D,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;KACxE;GACD;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/button/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/button/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & chip\n@import \"gov-button-core\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tjustify-content: flex-start;\n\t\t\talign-items: flex-start;\n\t\t\ttext-align: left;\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n\t&[size=\"s\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 4px;\n\t}\n\t&[size=\"m\"][type=\"link\"] .gov-icon {\n\t\tmargin-top: 2px;\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {\n\tButtonClass,\n\tButtonSizesType,\n\tButtonTargetType,\n\tButtonVariants,\n\tButtonVariantType,\n\tNativeType,\n\tNativeTypesType,\n\tType,\n\tTypesType,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {toBool} from \"../../../utils/bool.utils\"\nimport {Sizes} from \"../../../core/constants/sizes\"\nimport {validateWcagLabel, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {ButtonEvent} from \"./gov-button.types\"\nimport {prepareIconFormat} from \"../../gov-icon/helpers\";\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n\tstyleUrl: \"gov-button.scss\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({reflect: true}) readonly variant?: ButtonVariantType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({reflect: true}) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({reflect: true}) readonly type?: TypesType = \"solid\"\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop({reflect: true}) readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop({reflect: true}) readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({attribute: \"wcag-active-descendant\"}) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({attribute: \"wcag-controls\"}) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({attribute: \"wcag-description\"}) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({attribute: \"wcag-details\"}) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({attribute: \"wcag-expanded\"}) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({attribute: \"wcag-label\"}) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({attribute: \"wcag-owns\"}) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({attribute: \"wcag-has-popup\"}) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({attribute: \"wcag-pressed\"}) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({attribute: \"wcag-current\"}) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({eventName: \"gov-click\"}) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tget classNames(): string {\n\t\tconst {h} = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot(\"left-icon\") && ButtonClass.rootWithIcon, h.hasSlot(\"right-icon\") && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\n\t\treturn (\n\t\t\t<Host hoverable={true}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\tclass={this.h.classes(this.classNames)}\n\t\t\t\t\t\ttype={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tonMouseDown={() => (this.isPressed = true)}\n\t\t\t\t\tonMouseUp={() => (this.isPressed = false)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\taria-describedby={this.wcagActiveDescendant}\n\t\t\t\t\taria-description={this.wcagDescription}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-details={this.wcagDetails}\n\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\taria-haspopup={toBoolAttrIfDefined(this.wcagHasPopup)}\n\t\t\t\t\taria-pressed={toBoolAttr(this.isPressed)}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\taria-current={this.wcagCurrent}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t{iconLeft && \t<gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tif (this.focusable) {\n\t\t\tvalidateWcagRef(this.wcagActiveDescendant, \"aria-activedescendant\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagControls, \"aria-controls\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagDetails, \"aria-details\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagOwns, \"aria-owns\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, \"aria-haspopup\", ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, ButtonClass.root)\n\t\t}\n\t}\n}\n"],"version":3}
|
|
@@ -2,8 +2,8 @@ import { r as registerInstance, c as createEvent, h, a as Host, g as getElement
|
|
|
2
2
|
import { g as govHost, b as booleanString } from './template-df429738.js';
|
|
3
3
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
4
4
|
import { a as govErrorLog } from './gov.log-af905420.js';
|
|
5
|
-
import { v as validateWcagLabel } from './wcag-
|
|
6
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
5
|
+
import { v as validateWcagLabel } from './wcag-b7b67e25.js';
|
|
6
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
7
7
|
import { d as delay } from './utils-c057a3fa.js';
|
|
8
8
|
|
|
9
9
|
const CardClass = {
|
|
@@ -3,6 +3,7 @@ import { v as validateProp } from './props-789f7529.js';
|
|
|
3
3
|
import { g as govHost, a as toBoolAttr } from './template-df429738.js';
|
|
4
4
|
import { a as ButtonSizes, b as ButtonVariants } from './constants-34a29ae2.js';
|
|
5
5
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
6
|
+
import { p as prepareIconFormat } from './helpers-bc0fd116.js';
|
|
6
7
|
import './gov.log-af905420.js';
|
|
7
8
|
import './sizes-6c5943b4.js';
|
|
8
9
|
import './variants-2b936d58.js';
|
|
@@ -31,6 +32,8 @@ const GovChip = class {
|
|
|
31
32
|
this.disabled = false;
|
|
32
33
|
this.href = undefined;
|
|
33
34
|
this.target = undefined;
|
|
35
|
+
this.iconLeft = undefined;
|
|
36
|
+
this.iconRight = undefined;
|
|
34
37
|
this.size = ButtonSizes._M;
|
|
35
38
|
this.tag = "span";
|
|
36
39
|
this.variant = ButtonVariants.PRIMARY;
|
|
@@ -55,11 +58,13 @@ const GovChip = class {
|
|
|
55
58
|
render() {
|
|
56
59
|
const Tag = this.href ? NativeType.A : this.tag;
|
|
57
60
|
const nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined;
|
|
61
|
+
const iconLeft = prepareIconFormat(this.iconLeft);
|
|
62
|
+
const iconRight = prepareIconFormat(this.iconRight);
|
|
58
63
|
return (h(Host, { class: this.h.classes([
|
|
59
64
|
ChipClass.root,
|
|
60
65
|
this.h.hasSlot("right") ? ChipClass.hasRight : undefined,
|
|
61
66
|
this.h.hasSlot("left") ? ChipClass.hasLeft : undefined,
|
|
62
|
-
]), disabled: this.disabled, href: this.href, variant: this.variant, type: this.inverse ? undefined : "solid", size: this.size, inverse: this.inverse, hoverable: Tag == NativeType.A || Tag == NativeType.BUTTON }, h(Tag, { class: "element", href: this.href, target: this.target, "aria-label": this.wcagLabel, ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), "aria-controls": this.wcagControls, "aria-selected": toBoolAttr(this.wcagSelected), tabindex: this.focusable ? "0" : "-1", id: this.identifier || this.chipId, type: nativeType }, this.h.hasSlot("left") && h("slot", { name: "left" }), this.h.hasSlot("left-icon") && h("slot", { name: "left-icon" }), h("slot", null), this.h.hasSlot("right-icon") && h("slot", { name: "right-icon" }), this.h.hasSlot("right") && h("slot", { name: "right" }))));
|
|
67
|
+
]), disabled: this.disabled, href: this.href, variant: this.variant, type: this.inverse ? undefined : "solid", size: this.size, inverse: this.inverse, hoverable: Tag == NativeType.A || Tag == NativeType.BUTTON }, h(Tag, { class: "element", href: this.href, target: this.target, "aria-label": this.wcagLabel, ref: el => (this.triggerRef = el), onClick: this.onClickHandler.bind(this), "aria-controls": this.wcagControls, "aria-selected": toBoolAttr(this.wcagSelected), tabindex: this.focusable ? "0" : "-1", id: this.identifier || this.chipId, type: nativeType }, this.h.hasSlot("left") && h("slot", { name: "left" }), this.h.hasSlot("left-icon") && h("slot", { name: "left-icon" }), iconLeft && h("gov-icon", { type: iconLeft.type, name: iconLeft.name }), h("slot", null), this.h.hasSlot("right-icon") && h("slot", { name: "right-icon" }), this.h.hasSlot("right") && h("slot", { name: "right" }), iconRight && h("gov-icon", { type: iconRight.type, name: iconRight.name }))));
|
|
63
68
|
}
|
|
64
69
|
onClickHandler(e) {
|
|
65
70
|
e.stopPropagation();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-chip.entry.js","mappings":";;;;;;;;;;AAEA,IAAY,UAIX;AAJD,WAAY,UAAU;EACrB,qBAAO,CAAA;EACP,2BAAa,CAAA;EACb,+BAAiB,CAAA;AAClB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAIM,MAAM,SAAS,GAAG;EACxB,IAAI,EAAE,UAAU;EAChB,KAAK,EAAE,iBAAiB;EACxB,QAAQ,EAAE,qBAAqB;EAC/B,OAAO,EAAE,oBAAoB;CAC7B;;ACfD,MAAM,UAAU,GAAG,mr6EAAmr6E;;MCYzr6E,OAAO;EAKnB;;;mBAUoC,KAAK;oBAKJ,KAAK;;;gBAcD,WAAW,CAAC,EAAE;eAIf,MAAM;mBAIA,cAAc,CAAC,OAAO;qBAK9B,IAAI;;;;;IAzCzC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;GACjC;EAgED,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;GACtD;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;GACnD;EAED,iBAAiB;IAChB,IAAI,CA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mBACjB,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,EAC5C,QAAQ,EAAE,IAAI,CAAC,SAAS,GAAG,GAAG,GAAG,IAAI,EACrC,EAAE,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,EAClC,IAAI,EAAE,UAAU,IACf,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,EACnD,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,YAAM,IAAI,EAAC,WAAW,GAAQ,EAC9D,eAAQ,EACP,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAM,IAAI,EAAC,YAAY,GAAQ,EAC/D,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,YAAM,IAAI,EAAC,OAAO,GAAQ,CACjD,CACA,EACP;GACD;EAEO,cAAc,CAAC,CAAe;IACrC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,UAAU,CAAC,MAAM,EAAE;MAC9D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACrB;GACD;;;;EAMD,MAAM,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;GACtB;;;;EAMD,MAAM,oBAAoB;IACzB,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;GACrC;;;;EAMD,MAAM,QAAQ;IACb,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;GACvB;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-chip/constants.ts","../../../packages/core/src/components/gov-chip/gov-chip.scss?tag=gov-chip","../../../packages/core/src/components/gov-chip/gov-chip.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 ChipClass = {\n\troot: 'gov-chip',\n\tinner: 'gov-chip__inner',\n\thasRight: 'gov-chip--has-right',\n\thasLeft: 'gov-chip--has-left',\n}\n","/*\n * Chip\n */\n\n// Shared definitions - button & chip\n@import \"../gov-button/button/gov-button-core\";\n\n.gov-chip {\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 $chip-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.element .element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($chip-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($chip-inverse-variants, $variant, \"color\");\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tborder-color: deep-map-get($chip-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, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { ChipClass, NativeType, NativeTypesType } from \"./constants\"\nimport { ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType } from \"../gov-button/button/constants\"\nimport { createID } from \"../../utils/string.utils\"\n\n@Component({\n\ttag: \"gov-chip\",\n\tstyleUrl: \"gov-chip.scss\",\n})\nexport class GovChip {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\tprivate readonly chipId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.chipId = createID('GovChip')\n\t}\n\n\t@Element() host: HTMLGovChipElement\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 chip 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 * Chip’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = ButtonSizes._M\n\t/**\n\t * Used to change the HTML tag in the chip\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the chip.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom chip identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\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 * 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 * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n\t */\n\t@Prop({ attribute: \"wcag-selected\" }) readonly wcagSelected: boolean\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, ChipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, ChipClass.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\tChipClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? ChipClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? ChipClass.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\taria-controls={this.wcagControls}\n\t\t\t\t\taria-selected={toBoolAttr(this.wcagSelected)}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\tid={this.identifier || this.chipId}\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\t/**\n\t * Returns a unique tab trigger identifier\n\t */\n\t@Method()\n\tasync getTriggerIdentifier(): Promise<string> {\n\t\treturn this.identifier || this.chipId\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus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I,CAAC,MAAM,EAClC,IAAI,EAAE,UAAU,IACf,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,YAAM,IAAI,EAAC,MAAM,GAAQ,EACnD,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,YAAM,IAAI,EAAC,WAAW,GAAQ,EAC7D,QAAQ,IAAK,gBAAU,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAa,EAC7E,eAAQ,EACP,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAM,IAAI,EAAC,YAAY,GAAQ,EAC/D,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,YAAM,IAAI,EAAC,OAAO,GAAQ,EACrD,SAAS,IAAK,gBAAU,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,GAAa,CAC3E,CACA,EACP;GACD;EAEO,cAAc,CAAC,CAAe;IACrC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,IAAI,CAAC,QAAQ,KAAK,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,UAAU,CAAC,MAAM,EAAE;MAC9D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACrB;GACD;;;;EAMD,MAAM,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;GACtB;;;;EAMD,MAAM,oBAAoB;IACzB,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;GACrC;;;;EAMD,MAAM,QAAQ;IACb,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;GACvB;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-chip/constants.ts","../../../packages/core/src/components/gov-chip/gov-chip.scss?tag=gov-chip","../../../packages/core/src/components/gov-chip/gov-chip.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 ChipClass = {\n\troot: 'gov-chip',\n\tinner: 'gov-chip__inner',\n\thasRight: 'gov-chip--has-right',\n\thasLeft: 'gov-chip--has-left',\n}\n","/*\n * Chip\n */\n\n// Shared definitions - button & chip\n@import \"../gov-button/button/gov-button-core\";\n\n.gov-chip {\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 $chip-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.element .element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($chip-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($chip-inverse-variants, $variant, \"color\");\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tborder-color: deep-map-get($chip-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, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { ChipClass, NativeType, NativeTypesType } from \"./constants\"\nimport { ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType } from \"../gov-button/button/constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: \"gov-chip\",\n\tstyleUrl: \"gov-chip.scss\",\n})\nexport class GovChip {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\tprivate readonly chipId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.chipId = createID('GovChip')\n\t}\n\n\t@Element() host: HTMLGovChipElement\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 chip 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 * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Chip’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = ButtonSizes._M\n\t/**\n\t * Used to change the HTML tag in the chip\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the chip.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom chip identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\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 * 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 * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n\t */\n\t@Prop({ attribute: \"wcag-selected\" }) readonly wcagSelected: boolean\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, ChipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, ChipClass.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\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tChipClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? ChipClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? ChipClass.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\taria-controls={this.wcagControls}\n\t\t\t\t\taria-selected={toBoolAttr(this.wcagSelected)}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\tid={this.identifier || this.chipId}\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{iconLeft && \t<gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"right\") && <slot name=\"right\"></slot>}\n\t\t\t\t\t{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></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 && 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\t/**\n\t * Returns a unique tab trigger identifier\n\t */\n\t@Method()\n\tasync getTriggerIdentifier(): Promise<string> {\n\t\treturn this.identifier || this.chipId\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"],"version":3}
|
|
@@ -5,12 +5,12 @@ import { v as validateProp } from './props-789f7529.js';
|
|
|
5
5
|
import { p as pick } from './utils-c057a3fa.js';
|
|
6
6
|
import './gov.log-af905420.js';
|
|
7
7
|
|
|
8
|
-
pick(Variants, ['PRIMARY', 'SECONDARY']);
|
|
8
|
+
pick(Variants, ['PRIMARY', 'SECONDARY', 'SUCCESS', 'ERROR', 'WARNING']);
|
|
9
9
|
const ControlGroupClass = {
|
|
10
10
|
root: 'gov-control-group',
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const govControlGroupCss = ".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-control-group{position:relative;display:flex;width:100%;align-items:center;border-radius:var(--gov-control-group-border-radius, 0.25rem)}.gov-control-group .element *,.gov-control-group .gov-button .element{border:none !important;border-radius:0}.gov-control-group[variant=primary]{border:var(--gov-control-group-border-primary, 0.0625rem solid var(--gov-color-primary-600))}.gov-control-group[variant=primary]>*{border-right:var(--gov-control-group-border-primary, 0.0625rem solid var(--gov-color-primary-600))}.gov-control-group[variant=secondary]{border:var(--gov-control-group-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}.gov-control-group[variant=secondary]>*{border-right:var(--gov-control-group-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}.gov-control-group>*:last-child{border-right:none}.gov-control-group.no-border>*{border-right:none}";
|
|
13
|
+
const govControlGroupCss = ".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-control-group{position:relative;display:flex;width:100%;align-items:center;border-radius:var(--gov-control-group-border-radius, 0.25rem)}.gov-control-group .element *,.gov-control-group .gov-button .element{border:none !important;border-radius:0}.gov-control-group[variant=primary]{border:var(--gov-control-group-border-primary, 0.0625rem solid var(--gov-color-primary-600))}.gov-control-group[variant=primary]>*{border-right:var(--gov-control-group-border-primary, 0.0625rem solid var(--gov-color-primary-600))}.gov-control-group[variant=secondary]{border:var(--gov-control-group-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}.gov-control-group[variant=secondary]>*{border-right:var(--gov-control-group-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}.gov-control-group[variant=success]{border:var(--gov-control-group-border-success, 0.0625rem solid var(--gov-color-success-500))}.gov-control-group[variant=success]>*{border-right:var(--gov-control-group-border-success, 0.0625rem solid var(--gov-color-success-500))}.gov-control-group[variant=warning]{border:var(--gov-control-group-border-warning, 0.0625rem solid var(--gov-color-warning-500))}.gov-control-group[variant=warning]>*{border-right:var(--gov-control-group-border-warning, 0.0625rem solid var(--gov-color-warning-500))}.gov-control-group[variant=error]{border:var(--gov-control-group-border-error, 0.0625rem solid var(--gov-color-error-400))}.gov-control-group[variant=error]>*{border-right:var(--gov-control-group-border-error, 0.0625rem solid var(--gov-color-error-400))}.gov-control-group>*:last-child{border-right:none}.gov-control-group.no-border>*{border-right:none}";
|
|
14
14
|
|
|
15
15
|
const GovControlGroup = class {
|
|
16
16
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-control-group.entry.js","mappings":";;;;;;;AAIoC,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;
|
|
1
|
+
{"file":"gov-control-group.entry.js","mappings":";;;;;;;AAIoC,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,EAAC;AAGpG,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB;;ACTD,MAAM,kBAAkB,GAAG,w+DAAw+D;;MCWt/D,eAAe;EAG3B;;mBAQoD,QAAQ,CAAC,OAAO;oBAIL,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACxD;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,WAAW,GAAG,SAAS,CAAA;IACjE,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO,IACrB,eAAQ,CACF,EACP;GACD;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-control-group/constants.ts","../../../packages/core/src/components/gov-control-group/gov-control-group.scss?tag=gov-control-group","../../../packages/core/src/components/gov-control-group/gov-control-group.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroupVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'SUCCESS', 'ERROR', 'WARNING'])\nexport type ControlGroupVariantType = `${ValueOf<typeof ControlGroupVariants>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n","/*\n * Control group\n */\n\n$class: \".gov-control-group\";\n\n#{$class} {\n\t@include base(flex);\n\talign-items: center;\n\tborder-radius: $control-group-border-radius;\n\t.element *,\n\t.gov-button .element {\n\t\tborder: none !important;\n\t\tborder-radius: 0;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $control-group-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t\t> * {\n\t\t\t\tborder-right: get(\"border\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\n\t> * {\n\t\t&:last-child {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n\t&.no-border {\n\t\t> * {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n}\n\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupVariantType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupVariantType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -8,7 +8,7 @@ const ErrorCodeClass = {
|
|
|
8
8
|
content: 'gov-error-code__content',
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
const govErrorCodeCss = ".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-error-code{position:relative;display:block;width:100%}.gov-error-code__holder{margin:0 auto;text-align:center}.gov-error-code__content>*:last-child{margin-bottom:0}.gov-error-code__icon{display:flex;justify-content:center;align-items:center;width:9.375rem;height:9.375rem;margin:0 auto 1.5rem;border-radius:50%;background:var(--gov-error-icon-circle-bg, linear-gradient(to bottom, var(--gov-color-primary-200), var(--gov-color-neutral-white)));color:var(--gov-error-icon-color, var(--gov-color-primary))}.gov-error-code__icon>*{width:
|
|
11
|
+
const govErrorCodeCss = ".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-error-code{position:relative;display:block;width:100%}.gov-error-code__holder{margin:0 auto;text-align:center}.gov-error-code__content>*:last-child{margin-bottom:0}.gov-error-code__icon{display:flex;justify-content:center;align-items:center;width:9.375rem;height:9.375rem;margin:0 auto 1.5rem;border-radius:50%;background:var(--gov-error-icon-circle-bg, linear-gradient(to bottom, var(--gov-color-primary-200), var(--gov-color-neutral-white)));color:var(--gov-error-icon-color, var(--gov-color-primary))}.gov-error-code__icon>*{width:6.5625rem;height:6.5625rem}@media (min-width: 48em){.gov-error-code__icon{width:12.5rem;height:12.5rem;margin:0 auto 2rem}.gov-error-code__icon>*{width:8.75rem;height:8.75rem}}";
|
|
12
12
|
|
|
13
13
|
const GovErrorCode = class {
|
|
14
14
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-error-code.entry.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,sBAAsB;EAC5B,MAAM,EAAE,wBAAwB;EAChC,OAAO,EAAE,yBAAyB;CAClC;;ACLD,MAAM,eAAe,GAAG
|
|
1
|
+
{"file":"gov-error-code.entry.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,sBAAsB;EAC5B,MAAM,EAAE,wBAAwB;EAChC,OAAO,EAAE,yBAAyB;CAClC;;ACLD,MAAM,eAAe,GAAG,miCAAmiC;;MCS9iC,YAAY;EAGxB;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,WAAK,KAAK,EAAE,cAAc,CAAC,MAAM,IAC/B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtB,WAAK,KAAK,EAAE,cAAc,CAAC,IAAI,IAC9B,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,CACN,EACD,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IACjC,eAAQ,CACH,CACD,CACA,EACP;GACD;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-error-code/constants.ts","../../../packages/core/src/components/gov-error-code/gov-error-code.scss?tag=gov-error-code","../../../packages/core/src/components/gov-error-code/gov-error-code.tsx"],"sourcesContent":["export const ErrorCodeClass = {\n\troot: 'gov-error-code',\n\ticon: 'gov-error-code__icon',\n\tholder: 'gov-error-code__holder',\n\tcontent: 'gov-error-code__content',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-error-code\";\n\n#{$class} {\n\t@include base();\n\t&__holder {\n\t\tmargin: 0 auto;\n\t\ttext-align: center;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\t&__icon {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: rem-calc(150);\n\t\theight: rem-calc(150);\n\t\tmargin: 0 auto rem-calc(24);\n\t\tborder-radius: 50%;\n\t\tbackground: $error-icon-circle-bg;\n\t\tcolor: $error-icon-color;\n\t\t& > * {\n\t\t\twidth: rem-calc(105);\n\t\t\theight: rem-calc(105);\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\t&__icon {\n\t\t\twidth: rem-calc(200);\n\t\t\theight: rem-calc(200);\n\t\t\tmargin: 0 auto rem-calc(32);\n\t\t\t& > * {\n\t\t\t\twidth: rem-calc(140);\n\t\t\t\theight: rem-calc(140);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host } from '@stencil/core'\nimport { ErrorCodeClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-error-code',\n\tstyleUrl: 'gov-error-code.scss',\n})\nexport class GovErrorCode {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovErrorCodeElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ErrorCodeClass.root)}>\n\t\t\t\t<div class={ErrorCodeClass.holder}>\n\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t<div class={ErrorCodeClass.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={ErrorCodeClass.content}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -3,8 +3,8 @@ import { c as createID } from './string.utils-f268fc6b.js';
|
|
|
3
3
|
import { v as validateProp } from './props-789f7529.js';
|
|
4
4
|
import { g as govForm, F as FormCheckboxClass, a as FormCheckboxSizes } from './form-39dc6896.js';
|
|
5
5
|
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
|
|
6
|
-
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-
|
|
7
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
6
|
+
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-b7b67e25.js';
|
|
7
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
8
8
|
import { d as delay } from './utils-c057a3fa.js';
|
|
9
9
|
import { F as Fragment } from './Fragment-8d8d54fb.js';
|
|
10
10
|
import './gov.log-af905420.js';
|
|
@@ -9,7 +9,7 @@ import './constants-3df712e2.js';
|
|
|
9
9
|
import './constants-47d7a8bc.js';
|
|
10
10
|
import './constants-ebec7de8.js';
|
|
11
11
|
|
|
12
|
-
const govFormControlCss = ".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-form-control__holder{display:flex;flex-direction:column;padding:0;border:none}.gov-form-control__bottom>*:last-child{margin-bottom:0}.gov-form-
|
|
12
|
+
const govFormControlCss = ".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-form-control__holder{display:flex;flex-direction:column;padding:0;border:none}.gov-form-control__bottom>*:last-child{margin-bottom:0}.gov-form-control__bottom>:first-child{margin-top:0.25rem}.gov-form-control .gov-form-label .gov-form-label__label{margin:0rem 0rem 0.25rem}.gov-form-control[type=file] .gov-form-label[slot=top] .gov-form-label__label{margin:0rem 0rem 0.5rem}.gov-form-control[type=file] .gov-form-control__bottom>:first-child{margin-top:0.5rem}.gov-form-control[size=xs][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom>:first-child,.gov-form-control[size=xs][type=radio] .gov-form-control__holder>.gov-form-control__bottom>:first-child{margin-top:var(--gov-form-checkbox-core-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}.gov-form-control[size=s][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom>:first-child,.gov-form-control[size=s][type=radio] .gov-form-control__holder>.gov-form-control__bottom>:first-child{margin-top:var(--gov-form-checkbox-core-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}.gov-form-control[size=m][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom>:first-child,.gov-form-control[size=m][type=radio] .gov-form-control__holder>.gov-form-control__bottom>:first-child{margin-top:var(--gov-form-checkbox-core-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}.gov-form-control[size=l][type=checkbox] .gov-form-control__holder>.gov-form-control__bottom>:first-child,.gov-form-control[size=l][type=radio] .gov-form-control__holder>.gov-form-control__bottom>:first-child{margin-top:var(--gov-form-checkbox-core-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}.gov-form-control[size=xs][type=switch] .gov-form-control__bottom>:first-child{margin-top:var(--gov-form-switch-xs-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-xs-indicator-height, 1.25rem) * 1.6666666667 + var(--gov-form-switch-xs-gap, 0.75rem))}.gov-form-control[size=s][type=switch] .gov-form-control__bottom>:first-child{margin-top:var(--gov-form-switch-s-message-gap, 0.5rem);margin-left:calc(var(--gov-form-switch-s-indicator-height, 1.375rem) * 1.6666666667 + var(--gov-form-switch-s-gap, 0.75rem))}.gov-form-control[size=m][type=switch] .gov-form-control__bottom>:first-child{margin-top:var(--gov-form-switch-m-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-m-indicator-height, 1.5rem) * 1.6666666667 + var(--gov-form-switch-m-gap, 1rem))}.gov-form-control[size=l][type=switch] .gov-form-control__bottom>:first-child{margin-top:var(--gov-form-switch-l-message-gap, 0.75rem);margin-left:calc(var(--gov-form-switch-l-indicator-height, 2rem) * 1.6666666667 + var(--gov-form-switch-l-gap, 1rem))}.gov-form-control[invalid=\"\"] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=true i] .gov-form-label[slot=top] .gov-form-label__label,.gov-form-control[invalid=\"1\"] .gov-form-label[slot=top] .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-control[disabled=\"\"] .gov-form-label__label,.gov-form-control[disabled=true i] .gov-form-label__label,.gov-form-control[disabled=\"1\"] .gov-form-label__label{pointer-events:none}";
|
|
13
13
|
|
|
14
14
|
const GovFormControl = class {
|
|
15
15
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-control.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"file":"gov-form-control.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,s0HAAs0H;;MCYn1H,cAAc;EAM1B;;;;mBAkBoC,KAAK;oBAKJ,KAAK;mBAKN,KAAK;oBAKJ,KAAK;gBAIK,GAAG;IApCjD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAA;GAC3C;EAmCD,kBAAkB;IACjB,IAAI,CAAC,cAAc,EAAE,CAAA;IACrB,IAAI,CAAC,iBAAiB,EAAE,CAAA;IACxB,IAAI,CAAC,mBAAmB,EAAE,CAAA;IAC1B,IAAI,CAAC,6BAA6B,EAAE,CAAA;GACpC;EAED,oBAAoB;;IACnB,MAAA,IAAI,CAAC,QAAQ,0CAAE,UAAU,EAAE,CAAA;GAC3B;EAEO,cAAc;IACrB,MAAM,YAAY,GAAG;MACpB,iBAAiB;MACjB,gBAAgB;MAChB,iBAAiB;MACjB,mBAAmB;MACnB,gBAAgB;MAChB,uBAAuB;MACvB,eAAe;MACf,iBAAiB;KACjB,CAAA;IACD,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IAE3D,IAAI,IAAI,CAAC,CAAC,CAAC,gBAAgB,KAAK,KAAK,EAAE;MACtC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,YAAY,EAAE,gBAAgB,CAAC,EAAE,YAAY,EAAE,IA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,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAA;QACjF,OAAO,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAA;QAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;UAChC,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;SACvF;QACD,IAAI,GAAG,CAAC,MAAM,EAAE;UACf,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;SACxD;OACD,CAAC,CAAA;KACF,CAAC,CAAA;GACF;EAED,MAAM;IACL,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAA;IAC9C,QACC,EAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAClE,EAAC,GAAG,IAAC,KAAK,EAAE,gBAAgB,CAAC,MAAM,IACjC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,YAAM,IAAI,EAAC,KAAK,GAAQ,EAClD,eAAa,EACZ,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACxB,WAAK,KAAK,EAAE,gBAAgB,CAAC,MAAM,IAClC,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACN,CACI,CACA,EACP;GACD;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/control/gov-form-control.scss?tag=gov-form-control","../../../packages/core/src/components/gov-form/control/gov-form-control.tsx"],"sourcesContent":["/*\n * Form Control\n */\n\n$class: \".gov-form-control\";\n\n#{$class} {\n\t&__holder {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 0;\n\t\tborder: none;\n\t}\n\t&__bottom {\n\t\t@include reset-last-margin();\n\t\t> :first-child {\n\t\t\tmargin-top: rem-calc(4);\n\t\t}\n\t}\n\n\t// VARIANTS\n\t.gov-form-label .gov-form-label__label {\n\t\tmargin: rem-calc(0 0 4);\n\t}\n\t&[type=\"file\"] {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tmargin: rem-calc(0 0 8);\n\t\t}\n\t\t#{$class}__bottom > :first-child {\n\t\t\tmargin-top: rem-calc(8);\n\t\t}\n\t}\n\t// Checkbox, radio\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"][type=\"checkbox\"],\n\t\t&[size=\"#{$size}\"][type=\"radio\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-width: get(\"indicator-size\", $definitions);\n\t\t\t\t&__holder > #{$class}__bottom > :first-child {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Switch\n\t@each $size, $definitions in $form-switch-sizes {\n\t\t&[size=\"#{$size}\"][type=\"switch\"] {\n\t\t\t#{$class} {\n\t\t\t\t$indicator-ratio: calc(5 / 3);\n\t\t\t\t$indicator-width: calc(get(\"indicator-height\", $definitions) * $indicator-ratio);\n\t\t\t\t&__bottom > :first-child {\n\t\t\t\t\tmargin-top: get(\"message-gap\", $definitions);\n\t\t\t\t\tmargin-left: calc($indicator-width + get(\"gap\", $definitions));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t.gov-form-label[slot=\"top\"] .gov-form-label__label {\n\t\t\tcolor: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\t.gov-form-label__label {\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { createID, splitByWhitespace } from \"../../../utils/string.utils\"\nimport { FormControlClass, FormControlSizesType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-form-control\",\n\tstyleUrl: \"gov-form-control.scss\",\n})\nexport class GovFormControl {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate readonly controlId: string\n\tprivate observer: MutationObserver\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.controlId = createID(\"GovFormControl\")\n\t}\n\n\t@Element() host: HTMLGovFormControlElement\n\t/**\n\t * Defines the space between nested components.\n\t */\n\t@Prop() readonly gap?: FormControlSizesType\n\t/**\n\t * Form element identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean = false\n\t/**\n\t/**\n\t * Indicates the form element is disabled\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean = false\n\t/**\n\t * Use control as a fieldset for better accessibility.\n\t * Note: Don't forget to set the legend attribute of the gov-form-label component\n\t */\n\t@Prop() readonly fieldset: boolean = false\n\t/**\n\t * Form element size.\n\t */\n\t@Prop() readonly size?: FormControlSizesType = \"m\"\n\n\tcomponentDidRender() {\n\t\tthis.passChildAttrs()\n\t\tthis.invalidChildAttrs()\n\t\tthis.syncControlMessages()\n\t\tthis.formElementDescriptionControl()\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tthis.observer?.disconnect()\n\t}\n\n\tprivate passChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"success\", this.success)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate invalidChildAttrs() {\n\t\tconst formElements = [\n\t\t\t\"gov-form-select\",\n\t\t\t\"gov-form-input\",\n\t\t\t\"gov-form-switch\",\n\t\t\t\"gov-form-checkbox\",\n\t\t\t\"gov-form-radio\",\n\t\t\t\"gov-form-multi-select\",\n\t\t\t\"gov-form-file\",\n\t\t\t\"gov-form-search\",\n\t\t]\n\t\tthis.h.passChildAttr(formElements, \"invalid\", this.invalid)\n\n\t\tif (this.f.hasGroupChildren === false) {\n\t\t\tthis.h.passChildAttr([...formElements, \"gov-form-label\"], \"identifier\", this.identifier || this.controlId)\n\t\t}\n\t}\n\n\tprivate formElementDescriptionControl() {\n\t\tconst bottomSlot = this.host.querySelector(\".\" + FormControlClass.bottom)\n\t\tif (!bottomSlot) return\n\t\tthis.observer = new MutationObserver(\n\t\t\tfunction() {\n\t\t\t\tthis.syncControlMessages()\n\t\t\t}.bind(this),\n\t\t)\n\n\t\tthis.observer.observe(bottomSlot, { childList: true })\n\t}\n\n\tprivate syncControlMessages() {\n\t\tPromise.all(this.f.messageElements.map((message: HTMLGovFormMessageElement) => message.identifier())).then((ids: string[]) => {\n\t\t\tthis.f.mainElementsInControl.forEach((element: Element) => {\n\t\t\t\tconst currentValue = splitByWhitespace(element.getAttribute(\"wcag-described-by\"))\n\t\t\t\telement.removeAttribute(\"wcag-described-by\")\n\t\t\t\tif (Array.isArray(currentValue)) {\n\t\t\t\t\tcurrentValue.forEach(id => (id.indexOf(\"GovFormMessage\") === -1 ? ids.push(id) : null))\n\t\t\t\t}\n\t\t\t\tif (ids.length) {\n\t\t\t\t\telement.setAttribute(\"wcag-described-by\", ids.join(\" \"))\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n\n\trender() {\n\t\tconst Tag = this.fieldset ? \"fieldset\" : \"div\"\n\t\treturn (\n\t\t\t<Host size={this.size} class={this.h.classes(FormControlClass.root)}>\n\t\t\t\t<Tag class={FormControlClass.holder}>\n\t\t\t\t\t{this.h.hasSlot(\"top\") && <slot name=\"top\"></slot>}\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.h.hasSlot(\"bottom\") && (\n\t\t\t\t\t\t<div class={FormControlClass.bottom}>\n\t\t\t\t\t\t\t<slot name=\"bottom\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
|
|
2
2
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
3
3
|
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
|
|
4
|
-
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-
|
|
5
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
4
|
+
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-b7b67e25.js';
|
|
5
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
6
6
|
import { d as delay } from './utils-c057a3fa.js';
|
|
7
7
|
import { g as govForm } from './form-39dc6896.js';
|
|
8
8
|
import './gov.log-af905420.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, g as getElement } from './index-eb59f132.js';
|
|
2
2
|
import { g as govForm, k as FormInputClass, l as FormInputVariants, m as FormInputSizes } from './form-39dc6896.js';
|
|
3
3
|
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined, c as toOnOffAttrIfDefined } from './template-df429738.js';
|
|
4
|
-
import { c as canValidateWcagOnRender } from './win-
|
|
4
|
+
import { c as canValidateWcagOnRender } from './win-0d231cca.js';
|
|
5
5
|
import { v as validateProp } from './props-789f7529.js';
|
|
6
|
-
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-
|
|
6
|
+
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-b7b67e25.js';
|
|
7
7
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
8
8
|
import { d as delay } from './utils-c057a3fa.js';
|
|
9
9
|
import './sizes-6c5943b4.js';
|
|
@@ -3,7 +3,7 @@ import { F as FormLabelClass } from './constants-ebec7de8.js';
|
|
|
3
3
|
import './utils-c057a3fa.js';
|
|
4
4
|
import './sizes-6c5943b4.js';
|
|
5
5
|
|
|
6
|
-
const govFormLabelCss = ".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-form-label{position:relative;display:flex;width:100%}.gov-form-label__label{display:inline-block;color:var(--gov-form-label-color, #686868);cursor:pointer;box-sizing:border-box}.gov-form-label[legend=\"\"] .gov-form-label__label,.gov-form-label[legend=true i] .gov-form-label__label,.gov-form-label[legend=\"1\"] .gov-form-label__label{margin-bottom:1rem;color:var(--gov-form-legend-color, #3b3b3b)}";
|
|
6
|
+
const govFormLabelCss = ".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-form-label{position:relative;display:flex;width:100%}.gov-form-label__label{display:inline-block;color:var(--gov-form-label-color, #686868);cursor:pointer;box-sizing:border-box}.gov-form-label[legend=\"\"] .gov-form-label__label,.gov-form-label[legend=true i] .gov-form-label__label,.gov-form-label[legend=\"1\"] .gov-form-label__label{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);margin-bottom:1rem;padding:0;color:var(--gov-form-legend-color, #3b3b3b)}";
|
|
7
7
|
|
|
8
8
|
const GovFormLabel = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-label.entry.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,
|
|
1
|
+
{"file":"gov-form-label.entry.js","mappings":";;;;;AAAA,MAAM,eAAe,GAAG,g6BAAg6B;;MCO36B,YAAY;;;;;gBAQsB,GAAG;oBAIZ,KAAK;kBAKP,KAAK;;EAMxC,MAAM;IACL,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IAC5C,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,IAChD,EAAC,GAAG,IAAC,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAC9F,eAAa,EACZ,IAAI,CAAC,QAAQ,GAAG,YAAM,KAAK,EAAC,sBAAsB,cAAe,GAAG,IAAI,CACpE,CACA,EACP;GACD;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/label/gov-form-label.scss?tag=gov-form-label","../../../packages/core/src/components/gov-form/label/gov-form-label.tsx"],"sourcesContent":["/*\n * Label\n */\n\n$class: \".gov-form-label\";\n\n#{$class} {\n\t@include base(flex);\n\t&__label {\n\t\tdisplay: inline-block;\n\t\tcolor: $form-label-color;\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\t}\n\n\t@include parameter(\"legend\") {\n\t\t#{$class}__label {\n\t\t\t@include typography($font-size-l);\n\t\t\tmargin-bottom: 1rem;\n\t\t\tpadding: 0;\n\t\t\tcolor: $form-legend-color;\n\t\t}\n\t}\n}\n","import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n\tstyleUrl: 'gov-form-label.scss',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--error-500\"> *</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|