@gov-design-system-ce/components 0.0.61 → 0.0.63
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/{constants-0488d137.js → constants-25f7a6be.js} +2 -2
- package/dist/cjs/{constants-0488d137.js.map → constants-25f7a6be.js.map} +1 -1
- package/dist/cjs/{constants-23b7a283.js → constants-427a2843.js} +2 -2
- package/dist/cjs/constants-427a2843.js.map +1 -0
- package/dist/cjs/{constants-ff12205f.js → constants-a31344ad.js} +1 -1
- package/dist/{collection/components/gov-button/default/constants.js.map → cjs/constants-a31344ad.js.map} +1 -1
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{form-f68d13c6.js → form-74063d50.js} +3 -1
- package/dist/cjs/form-74063d50.js.map +1 -0
- 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 +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +791 -514
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
- package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-button.cjs.entry.js +2 -2
- package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-card.cjs.entry.js +1 -1
- package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-chip.cjs.entry.js +102 -0
- package/dist/cjs/gov-chip.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-container.cjs.entry.js +1 -1
- package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
- package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/gov-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/gov-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-empty.cjs.entry.js +1 -1
- package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-control.cjs.entry.js +3 -3
- 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-group.cjs.entry.js +12 -3
- package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-multi-select.cjs.entry.js +2 -2
- package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
- package/dist/cjs/gov-form-password-power.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-radio.cjs.entry.js +6 -6
- package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-select.cjs.entry.js +14 -3
- package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-switch.cjs.entry.js +3 -3
- package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-grid.cjs.entry.js +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +2 -2
- package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-infobar.cjs.entry.js +5 -4
- package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
- package/dist/cjs/gov-layout.cjs.entry.js +1 -1
- package/dist/cjs/gov-loading.cjs.entry.js +1 -1
- package/dist/cjs/gov-message.cjs.entry.js +1 -1
- package/dist/cjs/gov-modal.cjs.entry.js +7 -4
- package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +1 -1
- package/dist/cjs/gov-prompt.cjs.entry.js +1 -1
- package/dist/cjs/gov-side-nav-item.cjs.entry.js +4 -4
- package/dist/cjs/gov-side-nav-item.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 +1 -1
- package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js +5 -5
- package/dist/cjs/gov-tabs-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +25 -16
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tag.cjs.entry.js +51 -0
- package/dist/cjs/gov-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/gov-tile.cjs.entry.js +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
- package/dist/cjs/gov-toast.cjs.entry.js +1 -1
- package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
- package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +40 -5
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
- package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
- package/dist/cjs/index-83edd4fe.js +6 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{template-e1c4ff78.js → template-4b951d1d.js} +8 -1
- package/dist/cjs/template-4b951d1d.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +5 -2
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion.css +5 -2
- package/dist/collection/components/gov-app/gov-app.css +5 -2
- package/dist/collection/components/gov-app/gov-app.js +5 -3
- package/dist/collection/components/gov-app/gov-app.js.map +1 -1
- package/dist/collection/components/gov-attachments/gov-attachments-item.css +5 -2
- package/dist/collection/components/gov-attachments/gov-attachments.css +5 -2
- package/dist/collection/components/gov-backdrop/gov-backdrop.css +5 -2
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +5 -2
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
- package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
- package/dist/collection/components/gov-button/button/constants.js.map +1 -0
- package/dist/collection/components/gov-button/{default → button}/gov-button.css +6 -3
- package/dist/collection/components/gov-button/{default → button}/gov-button.js +9 -9
- package/dist/collection/components/gov-button/button/gov-button.js.map +1 -0
- package/dist/collection/components/gov-button/button/gov-button.types.js.map +1 -0
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.css +5 -2
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js +1 -1
- package/dist/collection/components/gov-button/dropdown/gov-dropdown.js.map +1 -1
- package/dist/collection/components/gov-card/gov-card.css +5 -2
- package/dist/collection/components/gov-card/gov-card.js +1 -1
- package/dist/collection/components/gov-card/gov-card.js.map +1 -1
- package/dist/collection/components/{gov-badge → gov-chip}/constants.js +5 -5
- package/dist/collection/components/gov-chip/constants.js.map +1 -0
- package/dist/collection/components/gov-chip/gov-chip.css +1270 -0
- package/dist/collection/components/{gov-badge/gov-badge.js → gov-chip/gov-chip.js} +150 -23
- package/dist/collection/components/gov-chip/gov-chip.js.map +1 -0
- package/dist/collection/components/gov-container/gov-container.css +5 -2
- package/dist/collection/components/gov-control-group/gov-control-group.css +5 -2
- package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +5 -2
- package/dist/collection/components/gov-empty/gov-empty.css +5 -2
- package/dist/collection/components/gov-error-code/gov-error-code.css +5 -2
- package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +5 -2
- package/dist/collection/components/gov-form/checkbox/constants.js +1 -0
- package/dist/collection/components/gov-form/checkbox/constants.js.map +1 -1
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +8 -2
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +2 -2
- package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.css +5 -2
- package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
- package/dist/collection/components/gov-form/control/gov-form-control.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.css +5 -2
- package/dist/collection/components/gov-form/group/gov-form-group.css +5 -2
- package/dist/collection/components/gov-form/group/gov-form-group.js +13 -2
- package/dist/collection/components/gov-form/group/gov-form-group.js.map +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.css +5 -2
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-form/label/gov-form-label.css +5 -2
- package/dist/collection/components/gov-form/message/gov-form-message.css +5 -2
- package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +5 -2
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +8 -4
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +1 -1
- package/dist/collection/components/gov-form/password-power/gov-form-password-power.js.map +1 -1
- package/dist/collection/components/gov-form/radio/constants.js +1 -0
- package/dist/collection/components/gov-form/radio/constants.js.map +1 -1
- package/dist/collection/components/gov-form/radio/gov-form-radio.css +8 -2
- package/dist/collection/components/gov-form/radio/gov-form-radio.js +4 -4
- package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.css +5 -2
- package/dist/collection/components/gov-form/search/gov-form-search.js +1 -1
- package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.css +5 -2
- package/dist/collection/components/gov-form/select/gov-form-select.js +39 -2
- package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
- package/dist/collection/components/gov-form/select/gov-form-select.types.js.map +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.css +7 -2
- package/dist/collection/components/gov-form/switch/gov-form-switch.js +1 -1
- package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
- package/dist/collection/components/gov-grid/gov-grid-item.css +5 -2
- package/dist/collection/components/gov-grid/gov-grid.css +5 -2
- package/dist/collection/components/gov-icon/gov-icon.css +5 -2
- package/dist/collection/components/gov-icon/gov-icon.js +4 -10
- package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
- package/dist/collection/components/gov-icon/list.js +17 -11
- package/dist/collection/components/gov-icon/list.js.map +1 -1
- package/dist/collection/components/gov-infobar/{default/constants.js → constants.js} +3 -2
- package/dist/collection/components/gov-infobar/constants.js.map +1 -0
- package/dist/collection/components/gov-infobar/{default/gov-infobar.css → gov-infobar.css} +9 -3
- package/dist/collection/components/gov-infobar/{default/gov-infobar.js → gov-infobar.js} +12 -11
- package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -0
- package/dist/collection/components/gov-infobar/gov-infobar.types.js.map +1 -0
- package/dist/collection/components/gov-layout/gov-layout-column.css +5 -2
- package/dist/collection/components/gov-layout/gov-layout.css +5 -2
- package/dist/collection/components/gov-loading/loading/gov-loading.css +5 -2
- package/dist/collection/components/gov-loading/skeleton/gov-skeleton.css +5 -2
- package/dist/collection/components/gov-message/gov-message.css +5 -2
- package/dist/collection/components/gov-modal/gov-modal.css +5 -2
- package/dist/collection/components/gov-modal/gov-modal.js +24 -3
- package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
- package/dist/collection/components/gov-nav/gov-nav-item.css +5 -2
- package/dist/collection/components/gov-nav/gov-nav.css +5 -2
- package/dist/collection/components/gov-pagination/gov-pagination.css +5 -2
- package/dist/collection/components/gov-promp/gov-prompt.css +5 -2
- package/dist/collection/components/gov-side-nav/constants.js +1 -1
- package/dist/collection/components/gov-side-nav/constants.js.map +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +6 -3
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +2 -2
- package/dist/collection/components/gov-side-nav/gov-side-nav-item.js.map +1 -1
- package/dist/collection/components/gov-side-nav/gov-side-nav.css +5 -2
- package/dist/collection/components/gov-spacer/gov-spacer.css +5 -2
- package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +5 -2
- package/dist/collection/components/gov-statsbar/gov-statsbar.css +5 -2
- package/dist/collection/components/gov-stepper/gov-stepper-item.css +5 -2
- package/dist/collection/components/gov-stepper/gov-stepper.css +5 -2
- package/dist/collection/components/gov-tabs/constants.js +1 -1
- package/dist/collection/components/gov-tabs/constants.js.map +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs-item.css +5 -2
- package/dist/collection/components/gov-tabs/gov-tabs-item.js +4 -4
- package/dist/collection/components/gov-tabs/gov-tabs-item.js.map +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.css +16 -14
- package/dist/collection/components/gov-tabs/gov-tabs.js +29 -21
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tag/constants.js +4 -0
- package/dist/collection/components/gov-tag/constants.js.map +1 -0
- package/dist/collection/components/gov-tag/gov-tag.css +1274 -0
- package/dist/collection/components/gov-tag/gov-tag.js +118 -0
- package/dist/collection/components/gov-tag/gov-tag.js.map +1 -0
- package/dist/collection/components/gov-tile/container/gov-tiles.css +5 -2
- package/dist/collection/components/gov-tile/gov-tile.css +5 -2
- package/dist/collection/components/gov-tile/gov-tile.js +3 -3
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/components/gov-toast/gov-toast.css +5 -2
- package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +14 -2
- package/dist/collection/components/gov-tooltip/gov-tooltip.css +6 -3
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +40 -5
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.css +5 -2
- package/dist/collection/components/gov-wizard/gov-wizard-item.js +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard-item.js.map +1 -1
- package/dist/collection/components/gov-wizard/gov-wizard.css +5 -2
- package/dist/collection/data/font-definitions.js +6 -6
- package/dist/collection/helpers/Dom/template.js +7 -0
- package/dist/collection/helpers/Dom/template.js.map +1 -1
- package/dist/collection/helpers/Dom/template.types.js.map +1 -1
- package/dist/collection/pages/Accordion.js +15 -15
- package/dist/collection/pages/Accordion.js.map +1 -1
- package/dist/collection/pages/{Badge.js → Chip.js} +181 -181
- package/dist/collection/pages/Chip.js.map +1 -0
- package/dist/collection/pages/Forms.js +23 -0
- package/dist/collection/pages/Forms.js.map +1 -1
- package/dist/collection/pages/Infobar.js +5 -5
- package/dist/collection/pages/Infobar.js.map +1 -1
- package/dist/collection/pages/Tabs.js +7 -7
- package/dist/collection/pages/Tabs.js.map +1 -1
- package/dist/collection/pages/Tag.js +253 -0
- package/dist/collection/pages/Tag.js.map +1 -0
- package/dist/collection/pages/Tooltip.js +3 -3
- package/dist/collection/pages/Tooltip.js.map +1 -1
- 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-breadcrumbs.js.map +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-card.js.map +1 -1
- package/dist/components/{gov-badge.d.ts → gov-chip.d.ts} +4 -4
- package/dist/components/gov-chip.js +2 -0
- package/dist/components/gov-container.js +1 -1
- package/dist/components/gov-control-group.js +1 -1
- package/dist/components/gov-cookiebar.js +1 -1
- package/dist/components/gov-dropdown.js +1 -1
- package/dist/components/gov-dropdown.js.map +1 -1
- package/dist/components/gov-empty.js +1 -1
- package/dist/components/gov-error-code.js +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-checkbox.js.map +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-group.js +1 -1
- package/dist/components/gov-form-group.js.map +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-message.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-password-power.js +1 -1
- package/dist/components/gov-form-password-power.js.map +1 -1
- package/dist/components/gov-form-radio.js +1 -1
- package/dist/components/gov-form-radio.js.map +1 -1
- package/dist/components/gov-form-search.js +1 -1
- package/dist/components/gov-form-search.js.map +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-form-switch.js +1 -1
- package/dist/components/gov-form-switch.js.map +1 -1
- package/dist/components/gov-grid-item.js +1 -1
- package/dist/components/gov-grid.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-layout-column.js +1 -1
- package/dist/components/gov-layout.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-message.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-modal.js.map +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-side-nav-item.js.map +1 -1
- package/dist/components/gov-side-nav.js +1 -1
- package/dist/components/gov-skeleton.js +1 -1
- package/dist/components/gov-spacer.js +1 -1
- package/dist/components/gov-statsbar-item.js +1 -1
- package/dist/components/gov-statsbar.js +1 -1
- package/dist/components/gov-stepper-item.js +1 -1
- package/dist/components/gov-stepper.js +1 -1
- package/dist/components/gov-tabs-item.js +1 -1
- package/dist/components/gov-tabs-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.d.ts +11 -0
- package/dist/components/gov-tag.js +2 -0
- package/dist/components/gov-tag.js.map +1 -0
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-tiles.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-content.js.map +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-item.js.map +1 -1
- package/dist/components/gov-wizard.js +1 -1
- package/dist/components/{p-1b4f2520.js → p-25b64ce2.js} +2 -2
- package/dist/components/p-28e59384.js +2 -0
- package/dist/components/p-28e59384.js.map +1 -0
- package/dist/components/{p-3dbf7f49.js → p-3c71d697.js} +1 -1
- package/dist/{cjs/constants-ff12205f.js.map → components/p-3c71d697.js.map} +1 -1
- package/dist/components/p-53e02bee.js +2 -0
- package/dist/components/p-53e02bee.js.map +1 -0
- package/dist/components/{p-3e8a9e92.js → p-6b256c8e.js} +2 -2
- package/dist/components/{p-f72ecbef.js → p-7ad6b936.js} +2 -2
- package/dist/components/p-7ad6b936.js.map +1 -0
- package/dist/components/{p-9ba6e755.js → p-a29d84e4.js} +2 -2
- package/dist/components/p-a29d84e4.js.map +1 -0
- package/dist/components/p-b0d4961a.js +2 -0
- package/dist/components/p-b0d4961a.js.map +1 -0
- package/dist/components/{p-522dd298.js → p-b47d953a.js} +2 -2
- package/dist/components/{p-522dd298.js.map → p-b47d953a.js.map} +1 -1
- package/dist/components/{p-8da17139.js → p-b60b159d.js} +2 -2
- package/dist/components/p-db1f0452.js +2 -0
- package/dist/components/p-db1f0452.js.map +1 -0
- package/dist/components/{p-b3cb7945.js → p-dde10734.js} +2 -2
- package/dist/components/{p-94542a50.js → p-e2d7dc71.js} +2 -2
- package/dist/components/p-e2d7dc71.js.map +1 -0
- package/dist/components/{p-bc5d5903.js → p-ee3a01c0.js} +2 -2
- package/dist/components/p-fa1e4aea.js +2 -0
- package/dist/components/p-fa1e4aea.js.map +1 -0
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/p-002c922c.entry.js +2 -0
- package/dist/core/p-002c922c.entry.js.map +1 -0
- package/dist/core/{p-7702c8c2.entry.js → p-046613ca.entry.js} +2 -2
- package/dist/core/p-0a84ab6c.entry.js +2 -0
- package/dist/core/p-0a84ab6c.entry.js.map +1 -0
- package/dist/core/{p-0c57e410.entry.js → p-0db95d0a.entry.js} +2 -2
- package/dist/core/p-0db95d0a.entry.js.map +1 -0
- package/dist/core/p-0e5fa8bf.js +2 -0
- package/dist/core/p-0e5fa8bf.js.map +1 -0
- package/dist/core/{p-f62efc34.entry.js → p-1da19326.entry.js} +2 -2
- package/dist/core/p-1da19326.entry.js.map +1 -0
- package/dist/core/{p-1c62f175.entry.js → p-1e41751e.entry.js} +2 -2
- package/dist/core/{p-e5227e40.entry.js → p-21a02f11.entry.js} +2 -2
- package/dist/core/{p-acd6a9f4.entry.js → p-2370e823.entry.js} +2 -2
- package/dist/core/p-2370e823.entry.js.map +1 -0
- package/dist/core/{p-06699657.entry.js → p-25620fed.entry.js} +2 -2
- package/dist/core/p-25620fed.entry.js.map +1 -0
- package/dist/core/{p-6f43bd00.entry.js → p-28d98a7d.entry.js} +2 -2
- package/dist/core/p-28e59384.js +2 -0
- package/dist/core/p-28e59384.js.map +1 -0
- package/dist/core/{p-e2d6efaf.entry.js → p-2c5b8f32.entry.js} +2 -2
- package/dist/core/{p-1da9f871.entry.js → p-3191317e.entry.js} +2 -2
- package/dist/core/{p-32a4b7e3.entry.js → p-32a4bac2.entry.js} +2 -2
- package/dist/core/p-32a4bac2.entry.js.map +1 -0
- package/dist/core/{p-7372b066.entry.js → p-34613499.entry.js} +2 -2
- package/dist/core/{p-88010439.entry.js → p-3d11d9a0.entry.js} +2 -2
- package/dist/core/{p-7fa1290e.entry.js → p-409f054b.entry.js} +2 -2
- package/dist/core/{p-afa12399.entry.js → p-4281eecd.entry.js} +2 -2
- package/dist/core/p-4281eecd.entry.js.map +1 -0
- package/dist/core/p-475e46be.entry.js +2 -0
- package/dist/core/p-475e46be.entry.js.map +1 -0
- package/dist/core/{p-3bacd021.js → p-4c55142b.js} +1 -1
- package/dist/core/p-4c55142b.js.map +1 -0
- package/dist/core/p-4df6aec4.entry.js +2 -0
- package/dist/core/p-4df6aec4.entry.js.map +1 -0
- package/dist/core/{p-bc6f1479.entry.js → p-4f34cea7.entry.js} +2 -2
- package/dist/core/p-4f34cea7.entry.js.map +1 -0
- package/dist/core/{p-35c1c12c.entry.js → p-52d767a8.entry.js} +2 -2
- package/dist/core/p-52d767a8.entry.js.map +1 -0
- package/dist/core/p-5e23a6ba.entry.js.map +1 -1
- package/dist/core/{p-2bb9f781.entry.js → p-679625c1.entry.js} +2 -2
- package/dist/core/{p-19b897c0.entry.js → p-7632b949.entry.js} +2 -2
- package/dist/core/{p-80f5140b.entry.js → p-7b01e961.entry.js} +2 -2
- package/dist/core/{p-93897e60.entry.js → p-7c38556b.entry.js} +2 -2
- package/dist/core/p-7d756211.entry.js +2 -0
- package/dist/core/p-7d756211.entry.js.map +1 -0
- package/dist/core/{p-7e8d2066.entry.js → p-7e11320f.entry.js} +2 -2
- package/dist/core/{p-c81d62db.entry.js → p-80ebaaf5.entry.js} +2 -2
- package/dist/core/{p-93042b25.entry.js → p-83512243.entry.js} +2 -2
- package/dist/core/{p-739dd451.entry.js → p-84e61610.entry.js} +2 -2
- package/dist/core/p-87700ea3.entry.js +2 -0
- package/dist/core/p-87700ea3.entry.js.map +1 -0
- package/dist/core/{p-998c3336.entry.js → p-87a91e77.entry.js} +2 -2
- package/dist/core/{p-4452c278.entry.js → p-8a931ff2.entry.js} +2 -2
- package/dist/core/{p-041d30b1.entry.js → p-8e5599d1.entry.js} +2 -2
- package/dist/core/{p-84f6b11a.entry.js → p-8f3d9099.entry.js} +2 -2
- package/dist/core/{p-84f6b11a.entry.js.map → p-8f3d9099.entry.js.map} +1 -1
- package/dist/core/{p-19a54ee9.entry.js → p-92ce6f87.entry.js} +2 -2
- package/dist/core/p-92ce6f87.entry.js.map +1 -0
- package/dist/core/{p-e1780dba.entry.js → p-96354948.entry.js} +2 -2
- package/dist/core/{p-2fe9d3ea.entry.js → p-a8b5ac68.entry.js} +2 -2
- package/dist/core/{p-2bf0c1c5.entry.js → p-aec21036.entry.js} +2 -2
- package/dist/core/{p-2bf0c1c5.entry.js.map → p-aec21036.entry.js.map} +1 -1
- package/dist/core/{p-228da18e.entry.js → p-af42ea63.entry.js} +2 -2
- package/dist/core/p-b21a3c79.entry.js +2 -0
- package/dist/core/p-b21a3c79.entry.js.map +1 -0
- package/dist/core/{p-9633e7b5.entry.js → p-baae15b9.entry.js} +2 -2
- package/dist/core/p-baae15b9.entry.js.map +1 -0
- package/dist/core/{p-88a78167.entry.js → p-c13ad31c.entry.js} +2 -2
- package/dist/core/{p-c5d3efc2.entry.js → p-c91daf1e.entry.js} +2 -2
- package/dist/core/{p-c5d3efc2.entry.js.map → p-c91daf1e.entry.js.map} +1 -1
- package/dist/core/p-c9ac8361.entry.js +2 -0
- package/dist/core/p-c9ac8361.entry.js.map +1 -0
- package/dist/core/p-cb3ac3f5.entry.js +2 -0
- package/dist/core/{p-5316e768.entry.js.map → p-cb3ac3f5.entry.js.map} +1 -1
- package/dist/core/{p-de5c9181.entry.js → p-cc48e49d.entry.js} +2 -2
- package/dist/core/{p-de5c9181.entry.js.map → p-cc48e49d.entry.js.map} +1 -1
- package/dist/core/{p-28f39f69.entry.js → p-d6e6d683.entry.js} +2 -2
- package/dist/core/p-db1f0452.js +2 -0
- package/dist/core/p-db1f0452.js.map +1 -0
- package/dist/core/{p-a7719b55.entry.js → p-e4ae862e.entry.js} +2 -2
- package/dist/core/{p-74ce7780.entry.js → p-e4e4ae20.entry.js} +2 -2
- package/dist/core/p-e4e4ae20.entry.js.map +1 -0
- package/dist/core/{p-1c40fdd5.entry.js → p-e6af7eb5.entry.js} +2 -2
- package/dist/core/p-e6af7eb5.entry.js.map +1 -0
- package/dist/core/p-ef2895f8.entry.js +2 -0
- package/dist/core/p-ef2895f8.entry.js.map +1 -0
- package/dist/core/{p-89921159.entry.js → p-f069df4a.entry.js} +2 -2
- package/dist/core/p-f8407153.entry.js +2 -0
- package/dist/core/p-f8407153.entry.js.map +1 -0
- package/dist/core/p-fa1e4aea.js +2 -0
- package/dist/core/p-fa1e4aea.js.map +1 -0
- package/dist/core/{p-0eb11cfc.entry.js → p-ff061e6b.entry.js} +2 -2
- package/dist/esm/{constants-ba92640d.js → constants-34a29ae2.js} +1 -1
- package/dist/{components/p-3dbf7f49.js.map → esm/constants-34a29ae2.js.map} +1 -1
- package/dist/esm/{constants-24dad929.js → constants-6df4edc4.js} +2 -2
- package/dist/esm/constants-6df4edc4.js.map +1 -0
- package/dist/esm/{constants-f5c21493.js → constants-867ac6e2.js} +2 -2
- package/dist/esm/{constants-f5c21493.js.map → constants-867ac6e2.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/{form-2d9f68d9.js → form-39dc6896.js} +3 -1
- package/dist/esm/form-39dc6896.js.map +1 -0
- 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 +1 -1
- package/dist/esm/gov-app.entry.js +791 -514
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-attachments_3.entry.js +1 -1
- package/dist/esm/gov-backdrop.entry.js +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js +1 -1
- package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/gov-button.entry.js +2 -2
- package/dist/esm/gov-button.entry.js.map +1 -1
- package/dist/esm/gov-card.entry.js +1 -1
- package/dist/esm/gov-card.entry.js.map +1 -1
- package/dist/esm/gov-chip.entry.js +98 -0
- package/dist/esm/gov-chip.entry.js.map +1 -0
- package/dist/esm/gov-container.entry.js +1 -1
- package/dist/esm/gov-control-group.entry.js +1 -1
- package/dist/esm/gov-cookiebar.entry.js +1 -1
- package/dist/esm/gov-dropdown.entry.js +2 -2
- package/dist/esm/gov-dropdown.entry.js.map +1 -1
- package/dist/esm/gov-empty.entry.js +1 -1
- package/dist/esm/gov-error-code.entry.js +1 -1
- package/dist/esm/gov-form-autocomplete.entry.js +1 -1
- package/dist/esm/gov-form-checkbox.entry.js +4 -4
- package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
- package/dist/esm/gov-form-control.entry.js +3 -3
- 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-group.entry.js +12 -3
- package/dist/esm/gov-form-group.entry.js.map +1 -1
- package/dist/esm/gov-form-input.entry.js +2 -2
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-form-multi-select.entry.js +2 -2
- package/dist/esm/gov-form-password-power.entry.js +1 -1
- package/dist/esm/gov-form-password-power.entry.js.map +1 -1
- package/dist/esm/gov-form-radio.entry.js +6 -6
- package/dist/esm/gov-form-radio.entry.js.map +1 -1
- package/dist/esm/gov-form-search.entry.js.map +1 -1
- package/dist/esm/gov-form-select.entry.js +14 -3
- package/dist/esm/gov-form-select.entry.js.map +1 -1
- package/dist/esm/gov-form-switch.entry.js +3 -3
- package/dist/esm/gov-form-switch.entry.js.map +1 -1
- package/dist/esm/gov-grid-item.entry.js +1 -1
- package/dist/esm/gov-grid.entry.js +1 -1
- package/dist/esm/gov-icon.entry.js +2 -2
- package/dist/esm/gov-icon.entry.js.map +1 -1
- package/dist/esm/gov-infobar.entry.js +5 -4
- package/dist/esm/gov-infobar.entry.js.map +1 -1
- package/dist/esm/gov-layout-column.entry.js +1 -1
- package/dist/esm/gov-layout.entry.js +1 -1
- package/dist/esm/gov-loading.entry.js +1 -1
- package/dist/esm/gov-message.entry.js +1 -1
- package/dist/esm/gov-modal.entry.js +7 -4
- package/dist/esm/gov-modal.entry.js.map +1 -1
- package/dist/esm/gov-pagination.entry.js +1 -1
- package/dist/esm/gov-prompt.entry.js +1 -1
- package/dist/esm/gov-side-nav-item.entry.js +4 -4
- package/dist/esm/gov-side-nav-item.entry.js.map +1 -1
- package/dist/esm/gov-side-nav.entry.js +2 -2
- package/dist/esm/gov-skeleton.entry.js +1 -1
- package/dist/esm/gov-spacer.entry.js +1 -1
- package/dist/esm/gov-statsbar-item.entry.js +1 -1
- package/dist/esm/gov-statsbar.entry.js +1 -1
- package/dist/esm/gov-stepper-item.entry.js +1 -1
- package/dist/esm/gov-stepper.entry.js +1 -1
- package/dist/esm/gov-tabs-item.entry.js +5 -5
- package/dist/esm/gov-tabs-item.entry.js.map +1 -1
- package/dist/esm/gov-tabs.entry.js +25 -16
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/gov-tag.entry.js +47 -0
- package/dist/esm/gov-tag.entry.js.map +1 -0
- package/dist/esm/gov-tile.entry.js +1 -1
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/gov-tiles.entry.js +1 -1
- package/dist/esm/gov-toast.entry.js +1 -1
- package/dist/esm/gov-tooltip-content.entry.js +2 -2
- package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +40 -5
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/gov-wizard-item.entry.js +1 -1
- package/dist/esm/gov-wizard-item.entry.js.map +1 -1
- package/dist/esm/gov-wizard.entry.js +1 -1
- package/dist/esm/index-ae3c50f1.js +6 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{template-10332292.js → template-df429738.js} +8 -1
- package/dist/esm/template-df429738.js.map +1 -0
- package/dist/hydrate/index.js +1400 -972
- package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -1
- package/dist/types/components/gov-app/gov-app.d.ts +3 -2
- package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +1 -1
- package/dist/types/components/gov-button/{default → button}/gov-button.d.ts +1 -1
- package/dist/types/components/gov-card/gov-card.d.ts +1 -1
- package/dist/types/components/{gov-badge → gov-chip}/constants.d.ts +1 -1
- package/dist/types/components/{gov-badge/gov-badge.d.ts → gov-chip/gov-chip.d.ts} +34 -7
- package/dist/types/components/gov-form/checkbox/constants.d.ts +1 -0
- package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +1 -1
- package/dist/types/components/gov-form/group/gov-form-group.d.ts +2 -1
- package/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +2 -2
- package/dist/types/components/gov-form/radio/constants.d.ts +1 -0
- package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +1 -1
- package/dist/types/components/gov-form/select/gov-form-select.d.ts +6 -1
- package/dist/types/components/gov-form/select/gov-form-select.types.d.ts +5 -0
- package/dist/types/components/gov-form/switch/gov-form-switch.d.ts +1 -1
- package/dist/types/components/gov-icon/gov-icon.d.ts +2 -3
- package/dist/types/components/gov-infobar/{default/constants.d.ts → constants.d.ts} +3 -2
- package/dist/types/components/gov-infobar/{default/gov-infobar.d.ts → gov-infobar.d.ts} +2 -2
- package/dist/types/components/gov-infobar/{default/gov-infobar.types.d.ts → gov-infobar.types.d.ts} +1 -1
- package/dist/types/components/gov-modal/gov-modal.d.ts +4 -0
- package/dist/types/components/gov-side-nav/constants.d.ts +1 -1
- package/dist/types/components/gov-side-nav/gov-side-nav-item.d.ts +1 -1
- package/dist/types/components/gov-tabs/constants.d.ts +1 -1
- package/dist/types/components/gov-tabs/gov-tabs-item.d.ts +1 -1
- package/dist/types/components/gov-tabs/gov-tabs.d.ts +5 -6
- package/dist/types/components/gov-tag/constants.d.ts +3 -0
- package/dist/types/components/gov-tag/gov-tag.d.ts +22 -0
- package/dist/types/components/gov-tile/gov-tile.d.ts +1 -1
- package/dist/types/components/gov-wizard/gov-wizard-item.d.ts +1 -1
- package/dist/types/components.d.ts +224 -133
- package/dist/types/helpers/Dom/template.types.d.ts +1 -0
- package/dist/types/pages/Chip.d.ts +3 -0
- package/dist/types/pages/Tag.d.ts +3 -0
- package/package.json +3 -3
- package/dist/cjs/constants-23b7a283.js.map +0 -1
- package/dist/cjs/form-f68d13c6.js.map +0 -1
- package/dist/cjs/gov-badge.cjs.entry.js +0 -84
- package/dist/cjs/gov-badge.cjs.entry.js.map +0 -1
- package/dist/cjs/template-e1c4ff78.js.map +0 -1
- package/dist/collection/components/gov-badge/constants.js.map +0 -1
- package/dist/collection/components/gov-badge/gov-badge.css +0 -1267
- package/dist/collection/components/gov-badge/gov-badge.js.map +0 -1
- package/dist/collection/components/gov-button/default/gov-button.js.map +0 -1
- package/dist/collection/components/gov-button/default/gov-button.types.js.map +0 -1
- package/dist/collection/components/gov-infobar/default/constants.js.map +0 -1
- package/dist/collection/components/gov-infobar/default/gov-infobar.js.map +0 -1
- package/dist/collection/components/gov-infobar/default/gov-infobar.types.js.map +0 -1
- package/dist/collection/pages/Badge.js.map +0 -1
- package/dist/components/gov-badge.js +0 -2
- package/dist/components/p-17c1ffc1.js +0 -2
- package/dist/components/p-17c1ffc1.js.map +0 -1
- package/dist/components/p-36be8f6e.js +0 -2
- package/dist/components/p-36be8f6e.js.map +0 -1
- package/dist/components/p-3f37ddb6.js +0 -2
- package/dist/components/p-3f37ddb6.js.map +0 -1
- package/dist/components/p-80e30702.js +0 -2
- package/dist/components/p-80e30702.js.map +0 -1
- package/dist/components/p-8d44ca3c.js +0 -2
- package/dist/components/p-8d44ca3c.js.map +0 -1
- package/dist/components/p-94542a50.js.map +0 -1
- package/dist/components/p-9ba6e755.js.map +0 -1
- package/dist/components/p-f72ecbef.js.map +0 -1
- package/dist/core/p-0553eb92.entry.js +0 -2
- package/dist/core/p-0553eb92.entry.js.map +0 -1
- package/dist/core/p-06699657.entry.js.map +0 -1
- package/dist/core/p-0c57e410.entry.js.map +0 -1
- package/dist/core/p-19a54ee9.entry.js.map +0 -1
- package/dist/core/p-1c40fdd5.entry.js.map +0 -1
- package/dist/core/p-32a4b7e3.entry.js.map +0 -1
- package/dist/core/p-34ed07f6.js +0 -2
- package/dist/core/p-34ed07f6.js.map +0 -1
- package/dist/core/p-35c1c12c.entry.js.map +0 -1
- package/dist/core/p-36be8f6e.js +0 -2
- package/dist/core/p-36be8f6e.js.map +0 -1
- package/dist/core/p-3bacd021.js.map +0 -1
- package/dist/core/p-3f37ddb6.js +0 -2
- package/dist/core/p-3f37ddb6.js.map +0 -1
- package/dist/core/p-49926f53.entry.js +0 -2
- package/dist/core/p-49926f53.entry.js.map +0 -1
- package/dist/core/p-5316e768.entry.js +0 -2
- package/dist/core/p-5cc3e768.entry.js +0 -2
- package/dist/core/p-5cc3e768.entry.js.map +0 -1
- package/dist/core/p-74ce7780.entry.js.map +0 -1
- package/dist/core/p-80e30702.js +0 -2
- package/dist/core/p-80e30702.js.map +0 -1
- package/dist/core/p-9633e7b5.entry.js.map +0 -1
- package/dist/core/p-acd6a9f4.entry.js.map +0 -1
- package/dist/core/p-afa12399.entry.js.map +0 -1
- package/dist/core/p-bc6f1479.entry.js.map +0 -1
- package/dist/core/p-bcf71ab5.entry.js +0 -2
- package/dist/core/p-bcf71ab5.entry.js.map +0 -1
- package/dist/core/p-c4c9ff83.entry.js +0 -2
- package/dist/core/p-c4c9ff83.entry.js.map +0 -1
- package/dist/core/p-c61444f7.entry.js +0 -2
- package/dist/core/p-c61444f7.entry.js.map +0 -1
- package/dist/core/p-d84b290e.entry.js +0 -2
- package/dist/core/p-d84b290e.entry.js.map +0 -1
- package/dist/core/p-da762184.entry.js +0 -2
- package/dist/core/p-da762184.entry.js.map +0 -1
- package/dist/core/p-f62efc34.entry.js.map +0 -1
- package/dist/core/p-fab698a7.entry.js +0 -2
- package/dist/core/p-fab698a7.entry.js.map +0 -1
- package/dist/esm/constants-24dad929.js.map +0 -1
- package/dist/esm/constants-ba92640d.js.map +0 -1
- package/dist/esm/form-2d9f68d9.js.map +0 -1
- package/dist/esm/gov-badge.entry.js +0 -80
- package/dist/esm/gov-badge.entry.js.map +0 -1
- package/dist/esm/template-10332292.js.map +0 -1
- package/dist/types/pages/Badge.d.ts +0 -3
- /package/dist/collection/components/gov-button/{default → button}/constants.js +0 -0
- /package/dist/collection/components/gov-button/{default → button}/gov-button.types.js +0 -0
- /package/dist/collection/components/gov-infobar/{default/gov-infobar.types.js → gov-infobar.types.js} +0 -0
- /package/dist/components/{gov-badge.js.map → gov-chip.js.map} +0 -0
- /package/dist/components/{p-1b4f2520.js.map → p-25b64ce2.js.map} +0 -0
- /package/dist/components/{p-3e8a9e92.js.map → p-6b256c8e.js.map} +0 -0
- /package/dist/components/{p-8da17139.js.map → p-b60b159d.js.map} +0 -0
- /package/dist/components/{p-b3cb7945.js.map → p-dde10734.js.map} +0 -0
- /package/dist/components/{p-bc5d5903.js.map → p-ee3a01c0.js.map} +0 -0
- /package/dist/core/{p-7702c8c2.entry.js.map → p-046613ca.entry.js.map} +0 -0
- /package/dist/core/{p-1c62f175.entry.js.map → p-1e41751e.entry.js.map} +0 -0
- /package/dist/core/{p-e5227e40.entry.js.map → p-21a02f11.entry.js.map} +0 -0
- /package/dist/core/{p-6f43bd00.entry.js.map → p-28d98a7d.entry.js.map} +0 -0
- /package/dist/core/{p-e2d6efaf.entry.js.map → p-2c5b8f32.entry.js.map} +0 -0
- /package/dist/core/{p-1da9f871.entry.js.map → p-3191317e.entry.js.map} +0 -0
- /package/dist/core/{p-7372b066.entry.js.map → p-34613499.entry.js.map} +0 -0
- /package/dist/core/{p-88010439.entry.js.map → p-3d11d9a0.entry.js.map} +0 -0
- /package/dist/core/{p-7fa1290e.entry.js.map → p-409f054b.entry.js.map} +0 -0
- /package/dist/core/{p-2bb9f781.entry.js.map → p-679625c1.entry.js.map} +0 -0
- /package/dist/core/{p-19b897c0.entry.js.map → p-7632b949.entry.js.map} +0 -0
- /package/dist/core/{p-80f5140b.entry.js.map → p-7b01e961.entry.js.map} +0 -0
- /package/dist/core/{p-93897e60.entry.js.map → p-7c38556b.entry.js.map} +0 -0
- /package/dist/core/{p-7e8d2066.entry.js.map → p-7e11320f.entry.js.map} +0 -0
- /package/dist/core/{p-c81d62db.entry.js.map → p-80ebaaf5.entry.js.map} +0 -0
- /package/dist/core/{p-93042b25.entry.js.map → p-83512243.entry.js.map} +0 -0
- /package/dist/core/{p-739dd451.entry.js.map → p-84e61610.entry.js.map} +0 -0
- /package/dist/core/{p-998c3336.entry.js.map → p-87a91e77.entry.js.map} +0 -0
- /package/dist/core/{p-4452c278.entry.js.map → p-8a931ff2.entry.js.map} +0 -0
- /package/dist/core/{p-041d30b1.entry.js.map → p-8e5599d1.entry.js.map} +0 -0
- /package/dist/core/{p-e1780dba.entry.js.map → p-96354948.entry.js.map} +0 -0
- /package/dist/core/{p-2fe9d3ea.entry.js.map → p-a8b5ac68.entry.js.map} +0 -0
- /package/dist/core/{p-228da18e.entry.js.map → p-af42ea63.entry.js.map} +0 -0
- /package/dist/core/{p-88a78167.entry.js.map → p-c13ad31c.entry.js.map} +0 -0
- /package/dist/core/{p-28f39f69.entry.js.map → p-d6e6d683.entry.js.map} +0 -0
- /package/dist/core/{p-a7719b55.entry.js.map → p-e4ae862e.entry.js.map} +0 -0
- /package/dist/core/{p-89921159.entry.js.map → p-f069df4a.entry.js.map} +0 -0
- /package/dist/core/{p-0eb11cfc.entry.js.map → p-ff061e6b.entry.js.map} +0 -0
- /package/dist/types/components/gov-button/{default → button}/constants.d.ts +0 -0
- /package/dist/types/components/gov-button/{default → button}/gov-button.types.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-dropdown.entry.js","mappings":";;;;;;;;AACA,MAAM,2BAA2B,GAAG;AACpC,IAAI,aAAa,EAAE,OAAO;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,CAAC,CAAC;AAgCF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,2BAA2B,EAAE;AACtG,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAChD,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI;AAClD,QAAQ,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK;AACrD,YAAY,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC7E,SAAS,EAAE,KAAK,CAAC,CAAC;AAClB,KAAK,CAAC,CAAC;AACP,CAAC;AAWD,SAAS,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE;AAC9E,IAAI,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAChC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;AACzE,QAAQ,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACjC,KAAK;AACL,CAAC;AACD,SAAS,gBAAgB,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AAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAC1F,eAAa,EACb,WACC,GAAG,EAAE,EAAE,IAAI,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,EAClE,KAAK,EAAE,aAAa,CAAC,IAAI,EACzB,EAAE,EAAE,IAAI,CAAC,MAAM,qBACE,IAAI,CAAC,SAAS,iBAClB,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IAClB,YAAM,IAAI,EAAC,MAAM,GAAQ,CACpB,CACA,EACP;GACD;;;;EAMD,MAAM,QAAQ;IACb,OAAO,IAAI,CAAC,IAAI,CAAA;GAChB;;;;EAMD,MAAM,OAAO,CAAC,KAAc;IAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;GACjB;;;;;;;","names":[],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.scss?tag=gov-dropdown","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","/*\n * Dropdown\n */\n\n$class: \".gov-dropdown\";\n\n#{$class} {\n\tposition: relative;\n\n\t&__list {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tz-index: 100;\n\t}\n\tul {\n\t\tpadding: rem-calc(4);\n\t\tborder-radius: $border-radius;\n\t\tbackground-color: $dropdown-bg-color;\n\t\tbox-shadow: $dropdown-box-shadow;\n\t}\n\tli {\n\t\tmargin: 0;\n\t\twhite-space: nowrap;\n\t\t&::before {\n\t\t\tcontent: none;\n\t\t}\n\t\t> * {\n\t\t\twidth: 100%;\n\t\t}\n\t\t> * .element {\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\t&[position=\"right\"] {\n\t\t#{$class}__list {\n\t\t\tright: 0;\n\t\t\tleft: initial;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from \"@stencil/core\"\nimport { registerClickOutside } from \"stencil-click-outside\"\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { ButtonClass } from \"../default/constants\"\nimport { DropdownClass, Position, PositionType } from \"./constants\"\nimport { DropdownEvent } from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n\tstyleUrl: \"gov-dropdown.scss\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\t/**\n\t * Dropdown open state\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<DropdownEvent>\n\n\tcomponentWillLoad() {\n\t\tif (this.trigger) {\n\t\t\tthis.trigger.setAttribute(\"wcag-controls\", this.listId)\n\t\t\tthis.trigger.setAttribute(\"wcag-has-popup\", toBoolAttr(!!this.list))\n\t\t\tthis.trigger.setAttribute(\"identifier\", this.controlId)\n\n\t\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.open = !this.open\n\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\t\toriginalEvent: e,\n\t\t\t\t\topen: this.open,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: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a,EACb,WACC,GAAG,EAAE,EAAE,IAAI,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,EAClE,KAAK,EAAE,aAAa,CAAC,IAAI,EACzB,EAAE,EAAE,IAAI,CAAC,MAAM,qBACE,IAAI,CAAC,SAAS,iBAClB,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IAClB,YAAM,IAAI,EAAC,MAAM,GAAQ,CACpB,CACA,EACP;GACD;;;;EAMD,MAAM,QAAQ;IACb,OAAO,IAAI,CAAC,IAAI,CAAA;GAChB;;;;EAMD,MAAM,OAAO,CAAC,KAAc;IAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;GACjB;;;;;;;","names":[],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.scss?tag=gov-dropdown","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","/*\n * Dropdown\n */\n\n$class: \".gov-dropdown\";\n\n#{$class} {\n\tposition: relative;\n\n\t&__list {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tz-index: 100;\n\t}\n\tul {\n\t\tpadding: rem-calc(4);\n\t\tborder-radius: $border-radius;\n\t\tbackground-color: $dropdown-bg-color;\n\t\tbox-shadow: $dropdown-box-shadow;\n\t}\n\tli {\n\t\tmargin: 0;\n\t\twhite-space: nowrap;\n\t\t&::before {\n\t\t\tcontent: none;\n\t\t}\n\t\t> * {\n\t\t\twidth: 100%;\n\t\t}\n\t\t> * .element {\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\t&[position=\"right\"] {\n\t\t#{$class}__list {\n\t\t\tright: 0;\n\t\t\tleft: initial;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from \"@stencil/core\"\nimport { registerClickOutside } from \"stencil-click-outside\"\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { ButtonClass } from \"../button/constants\"\nimport { DropdownClass, Position, PositionType } from \"./constants\"\nimport { DropdownEvent } from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n\tstyleUrl: \"gov-dropdown.scss\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\t/**\n\t * Dropdown open state\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<DropdownEvent>\n\n\tcomponentWillLoad() {\n\t\tif (this.trigger) {\n\t\t\tthis.trigger.setAttribute(\"wcag-controls\", this.listId)\n\t\t\tthis.trigger.setAttribute(\"wcag-has-popup\", toBoolAttr(!!this.list))\n\t\t\tthis.trigger.setAttribute(\"identifier\", this.controlId)\n\n\t\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.open = !this.open\n\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\t\toriginalEvent: e,\n\t\t\t\t\topen: this.open,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: boolean) {\n\t\tthis.open = state\n\t}\n}\n"],"version":3}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
|
-
import { a as toBoolAttr } from './template-
|
|
2
|
+
import { a as toBoolAttr } from './template-df429738.js';
|
|
3
3
|
import { v as validateProp } from './props-789f7529.js';
|
|
4
4
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
5
5
|
import { d as delay, t as throttle, h as has } from './utils-c057a3fa.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
2
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
3
3
|
import { v as validateProp } from './props-789f7529.js';
|
|
4
|
-
import { g as govForm, F as FormCheckboxClass, a as FormCheckboxSizes } from './form-
|
|
5
|
-
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-
|
|
4
|
+
import { g as govForm, F as FormCheckboxClass, a as FormCheckboxSizes } from './form-39dc6896.js';
|
|
5
|
+
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
|
|
6
6
|
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
|
|
7
7
|
import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
|
|
8
8
|
import { d as delay } from './utils-c057a3fa.js';
|
|
@@ -14,7 +14,7 @@ import './constants-3df712e2.js';
|
|
|
14
14
|
import './constants-47d7a8bc.js';
|
|
15
15
|
import './constants-ebec7de8.js';
|
|
16
16
|
|
|
17
|
-
const govFormCheckboxCss = ".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-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:\"\";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=\"\"].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid=\"1\"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=\"\"].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid=\"1\"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=\"\"].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled=\"1\"].gov-form-checkbox{pointer-events:none}[disabled=\"\"].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled=\"1\"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=\"\"].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled=\"1\"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{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);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=\"\"] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid=\"1\"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=\"\"] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled=\"1\"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}";
|
|
17
|
+
const govFormCheckboxCss = ".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-checkbox{cursor:pointer}.gov-form-checkbox input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-checkbox input+span{position:relative;display:block;cursor:pointer}.gov-form-checkbox input+span::before{content:\"\";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-checkbox .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-checkbox input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=\"\"].gov-form-checkbox .gov-form-label__label,[invalid=true i].gov-form-checkbox .gov-form-label__label,[invalid=\"1\"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=\"\"].gov-form-checkbox input+span::before,[invalid=true i].gov-form-checkbox input+span::before,[invalid=\"1\"].gov-form-checkbox input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=\"\"].gov-form-checkbox,[disabled=true i].gov-form-checkbox,[disabled=\"1\"].gov-form-checkbox{pointer-events:none}[disabled=\"\"].gov-form-checkbox .gov-form-label__label,[disabled=true i].gov-form-checkbox .gov-form-label__label,[disabled=\"1\"].gov-form-checkbox .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=\"\"].gov-form-checkbox input+span::before,[disabled=true i].gov-form-checkbox input+span::before,[disabled=\"1\"].gov-form-checkbox input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-checkbox{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-checkbox{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-checkbox{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-checkbox{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);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-checkbox .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-checkbox input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-checkbox input+span::before{border-radius:var(--gov-border-radius, 0.1875rem)}.gov-form-checkbox__check{position:absolute;color:var(--gov-form-checkbox-check-color, var(--gov-color-neutral-white));opacity:0;transition:150ms linear opacity}.gov-form-checkbox__label{position:relative}.gov-form-checkbox input:checked+span::before{background:var(--gov-form-checkbox-indicator-bg, var(--gov-color-primary))}input:checked+span .gov-form-checkbox__check{opacity:1}.gov-form-checkbox[invalid=\"\"] input:checked+span::before,.gov-form-checkbox[invalid=true i] input:checked+span::before,.gov-form-checkbox[invalid=\"1\"] input:checked+span::before{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-checkbox[disabled=\"\"] input:checked+span::before,.gov-form-checkbox[disabled=true i] input:checked+span::before,.gov-form-checkbox[disabled=\"1\"] input:checked+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400));background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-checkbox[size=xs] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-check-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-xs-check-size, 0.75rem);height:var(--gov-form-checkbox-core-xs-check-size, 0.75rem)}.gov-form-checkbox[size=s] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-check-size, 0.825rem)) / 2);width:var(--gov-form-checkbox-core-s-check-size, 0.825rem);height:var(--gov-form-checkbox-core-s-check-size, 0.825rem)}.gov-form-checkbox[size=m] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-check-size, 0.9rem)) / 2);width:var(--gov-form-checkbox-core-m-check-size, 0.9rem);height:var(--gov-form-checkbox-core-m-check-size, 0.9rem)}.gov-form-checkbox[size=l] .gov-form-checkbox__check{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-check-size, 1.2rem)) / 2);width:var(--gov-form-checkbox-core-l-check-size, 1.2rem);height:var(--gov-form-checkbox-core-l-check-size, 1.2rem)}";
|
|
18
18
|
|
|
19
19
|
const GovFormCheckbox = class {
|
|
20
20
|
constructor(hostRef) {
|
|
@@ -63,7 +63,7 @@ const GovFormCheckbox = class {
|
|
|
63
63
|
render() {
|
|
64
64
|
const wrapCheckbox = (children) => {
|
|
65
65
|
if (this.noLabel) {
|
|
66
|
-
return (h("label",
|
|
66
|
+
return (h("label", { class: FormCheckboxClass.label }, children));
|
|
67
67
|
}
|
|
68
68
|
return children;
|
|
69
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-checkbox.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,68PAA68P;;MCkB39P,eAAe;EAO3B;;;;;;mBAekD,KAAK;oBAKlB,KAAK;oBAKL,KAAK;;gBAQM,GAAG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AC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChF,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACrG;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: $border-radius;\n\t\t}\n\t}\n\t&__check {\n\t\tposition: absolute;\n\t\tcolor: $form-checkbox-check-color;\n\t\topacity: 0;\n\t\ttransition: $t linear opacity;\n\t}\n\n\t// STATES\n\tinput:checked + span::before {\n\t\tbackground: $form-checkbox-indicator-bg;\n\t}\n\tinput:checked + span &__check {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput:checked + span::before {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::before {\n\t\t\tborder-color: $form-state-bg-disabled;\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__check {\n\t\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n\t\t\t\t\twidth: get(\"check-size\", $definitions);\n\t\t\t\t\theight: get(\"check-size\", $definitions);\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 { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormCheckboxEvent } from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-checkbox.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MA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I,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAClF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;IAChF,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACrG;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n @extend %form-checkbox-core;\n\n input + span {\n &::before {\n border-radius: $border-radius;\n }\n }\n\n &__check {\n position: absolute;\n color: $form-checkbox-check-color;\n opacity: 0;\n transition: $t linear opacity;\n }\n\n &__label {\n position: relative;\n }\n\n // STATES\n input:checked + span::before {\n background: $form-checkbox-indicator-bg;\n }\n\n input:checked + span &__check {\n opacity: 1;\n }\n\n @include parameter(\"invalid\") {\n input:checked + span::before {\n background: $form-state-color-error;\n }\n }\n @include parameter(\"disabled\") {\n input:checked + span::before {\n border-color: $form-state-bg-disabled;\n background-color: $form-state-bg-disabled;\n }\n }\n\n // VARIANTS\n @each $size, $definitions in $form-checkbox-core-sizes {\n &[size=\"#{$size}\"] {\n #{$class} {\n &__check {\n top: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n left: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n width: get(\"check-size\", $definitions);\n height: get(\"check-size\", $definitions);\n }\n }\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType } from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport { FormCheckboxEvent } from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: \"no-label\" }) readonly noLabel: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
|
-
import { g as govForm, b as FormControlClass } from './form-
|
|
3
|
-
import { g as govHost } from './template-
|
|
2
|
+
import { g as govForm, b as FormControlClass } from './form-39dc6896.js';
|
|
3
|
+
import { g as govHost } from './template-df429738.js';
|
|
4
4
|
import { c as createID, s as splitByWhitespace } from './string.utils-f268fc6b.js';
|
|
5
5
|
import './sizes-6c5943b4.js';
|
|
6
6
|
import './utils-c057a3fa.js';
|
|
@@ -92,7 +92,7 @@ const GovFormControl = class {
|
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
94
|
const Tag = this.fieldset ? "fieldset" : "div";
|
|
95
|
-
return (h(Host, { size: this.size, class: this.h.classes(FormControlClass.root) }, h(Tag, { class: FormControlClass.holder }, this.h.hasSlot("top") && h("slot", { name: "top" }), h("slot", null), this.h.hasSlot("bottom") && (h("div", { class: FormControlClass.bottom }, h("slot", { name: "bottom" }))))));
|
|
95
|
+
return (h(Host, { size: this.size, class: this.h.classes(FormControlClass.root) }, h(Tag, { class: FormControlClass.holder }, this.h.hasSlot("top") && h("slot", { name: "top" }), h("slot", null), (this.h.hasSlot("bottom") && !this.h.isSlotEmpty("bottom")) && (h("div", { class: FormControlClass.bottom }, h("slot", { name: "bottom" }))))));
|
|
96
96
|
}
|
|
97
97
|
get host() { return getElement(this); }
|
|
98
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-control.entry.js","mappings":";;;;;;;;;;;AAAA,MAAM,iBAAiB,GAAG,8qHAA8qH;;MCY3rH,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,kB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MAC1D,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}\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#{$class} {\n\t\t&__bottom {\n\t\t\tmargin: rem-calc(4 0 0);\n\t\t}\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} {\n\t\t\t&__bottom {\n\t\t\t\tmargin: rem-calc(8 0 0);\n\t\t\t}\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 {\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 {\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\") && !this.h.isSlotEmpty(\"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,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
2
|
import { c as createID } from './string.utils-f268fc6b.js';
|
|
3
|
-
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-
|
|
3
|
+
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
|
|
4
4
|
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
|
|
5
5
|
import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
|
|
6
6
|
import { d as delay } from './utils-c057a3fa.js';
|
|
7
|
-
import { g as govForm } from './form-
|
|
7
|
+
import { g as govForm } from './form-39dc6896.js';
|
|
8
8
|
import './gov.log-af905420.js';
|
|
9
9
|
import './sizes-6c5943b4.js';
|
|
10
10
|
import './variants-2b936d58.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
2
|
import { p as pick } from './utils-c057a3fa.js';
|
|
3
3
|
import { S as Sizes } from './sizes-6c5943b4.js';
|
|
4
|
-
import { g as govHost } from './template-
|
|
4
|
+
import { g as govHost } from './template-df429738.js';
|
|
5
5
|
import { v as validateProp } from './props-789f7529.js';
|
|
6
6
|
import './gov.log-af905420.js';
|
|
7
7
|
|
|
@@ -25,17 +25,26 @@ const GovFormGroup = class {
|
|
|
25
25
|
this.h = govHost(this.host);
|
|
26
26
|
}
|
|
27
27
|
validateGap(newValue) {
|
|
28
|
-
|
|
28
|
+
if (newValue) {
|
|
29
|
+
validateProp(FormGroupSizes, newValue, FormGroupClass.root);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
validateOrientation(newValue) {
|
|
33
|
+
if (newValue) {
|
|
34
|
+
validateProp(FormGroupOrientation, newValue, FormGroupClass.root);
|
|
35
|
+
}
|
|
29
36
|
}
|
|
30
37
|
componentWillLoad() {
|
|
31
38
|
this.validateGap(this.gap);
|
|
39
|
+
this.validateOrientation(this.orientation);
|
|
32
40
|
}
|
|
33
41
|
render() {
|
|
34
42
|
return (h(Host, { gap: this.gap, class: this.h.classes(FormGroupClass.root) }, h("slot", null)));
|
|
35
43
|
}
|
|
36
44
|
get host() { return getElement(this); }
|
|
37
45
|
static get watchers() { return {
|
|
38
|
-
"gap": ["validateGap"]
|
|
46
|
+
"gap": ["validateGap"],
|
|
47
|
+
"orientation": ["validateOrientation"]
|
|
39
48
|
}; }
|
|
40
49
|
};
|
|
41
50
|
GovFormGroup.style = govFormGroupCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-group.entry.js","mappings":";;;;;;;AAIO,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAG5E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;EAC/B,iDAAyB,CAAA;EACzB,6CAAqB,CAAA;AACtB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAGM,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB;;ACfD,MAAM,eAAe,GAAG,6zBAA6zB;;
|
|
1
|
+
{"file":"gov-form-group.entry.js","mappings":";;;;;;;AAIO,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAG5E,IAAY,oBAGX;AAHD,WAAY,oBAAoB;EAC/B,iDAAyB,CAAA;EACzB,6CAAqB,CAAA;AACtB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAGM,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB;;ACfD,MAAM,eAAe,GAAG,6zBAA6zB;;MCgBx0B,YAAY;EAGvB;;eAQ4C,SAAS;uBAIK,UAAU;IAXlE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC5B;EAaD,WAAW,CAAC,QAAgB;IAC1B,IAAI,QAAQ,EAAE;MACZ,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;KAC5D;GACF;EAGD,mBAAmB,CAAC,QAAgB;IAClC,IAAI,QAAQ,EAAE;MACZ,YAAY,CAAC,oBAAoB,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;KAClE;GACF;EAED,iBAAiB;IACf,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;GAC3C;EAED,MAAM;IACJ,QACE,EAAC,IAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC7D,eAAa,CACR,EACR;GACF;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/group/constants.ts","../../../packages/core/src/components/gov-form/group/gov-form-group.scss?tag=gov-form-group","../../../packages/core/src/components/gov-form/group/gov-form-group.tsx"],"sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport enum FormGroupOrientation {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type FormGroupOrientationType = `${ValueOf<typeof FormGroupOrientation>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n","$class: \".gov-form-group\";\n\n#{$class} {\n\t@include base(flex);\n\tflex-direction: column;\n\talign-items: flex-start;\n\t.gov-form-label__label {\n\t\tmargin: 0;\n\t}\n\n\t&[orientation=\"horizontal\"] {\n\t\tflex-direction: row;\n\t\tflex-wrap: wrap;\n\t\t.gov-form-label__label {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $gap, $definitions in $form-group-gaps {\n\t\t&[gap=\"#{$gap}\"] {\n\t\t\tgap: get($gap, $sizes);\n\t\t}\n\t}\n}\n","import {Component, Element, h, Host, Prop, Watch} from \"@stencil/core\"\nimport {\n FormGroupClass,\n FormGroupOrientation,\n FormGroupOrientationType,\n FormGroupSizes,\n FormGroupSizesType\n} from \"./constants\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govHost} from \"../../../helpers/Dom/template\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\n\n@Component({\n tag: \"gov-form-group\",\n styleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormGroup {\n private readonly h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovFormGroupElement\n /**\n * Gap's size.\n */\n @Prop() readonly gap?: FormGroupSizesType = undefined\n /**\n * Elements orientation\n */\n @Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\n @Watch(\"gap\")\n validateGap(newValue: string): void {\n if (newValue) {\n validateProp(FormGroupSizes, newValue, FormGroupClass.root)\n }\n }\n\n @Watch(\"orientation\")\n validateOrientation(newValue: string): void {\n if (newValue) {\n validateProp(FormGroupOrientation, newValue, FormGroupClass.root)\n }\n }\n\n componentWillLoad(): void {\n this.validateGap(this.gap)\n this.validateOrientation(this.orientation)\n }\n\n render() {\n return (\n <Host gap={this.gap} class={this.h.classes(FormGroupClass.root)}>\n <slot></slot>\n </Host>\n )\n }\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
|
-
import { g as govForm, k as FormInputClass, l as FormInputVariants, m as FormInputSizes } from './form-
|
|
3
|
-
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined, c as toOnOffAttrIfDefined } from './template-
|
|
2
|
+
import { g as govForm, k as FormInputClass, l as FormInputVariants, m as FormInputSizes } from './form-39dc6896.js';
|
|
3
|
+
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined, c as toOnOffAttrIfDefined } from './template-df429738.js';
|
|
4
4
|
import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
|
|
5
5
|
import { v as validateProp } from './props-789f7529.js';
|
|
6
6
|
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-input.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,oiZAAoiZ;;ACsB5jZ,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,uBAAe,CAAA;EACf,6BAAqB,CAAA;AACtB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,YAAY;EAMxB;;;;;;;;;mBAkBkD,WAAW;;gBAQhB,GAAG;;;;;oBAqBX,KAAK;oBAKL,KAAK;;;;;;;;;;qBAyCF,MAAM;;;;;;;;;IA5F7C,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAA;IACnC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;GACxB;EA8ID,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,iBAAiB,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC9D;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC3D;EAMD,aAAa;IACZ,IAAI,CAAC,gBAAgB,EAAE,CAAA;GACvB;EAEO,gBAAgB;IACvB,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3C,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC/D,IAAI,CAAC,CA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kB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7E,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAChE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport {\n\tFormInputClass,\n\tFormInputSizes,\n\tFormInputSizesType,\n\tFormInputVariants,\n\tFormInputVariantType,\n\tInputType,\n\tType,\n} from \"./constants\"\nimport { FormInputEvent } from \"./gov-form-input.types\"\nimport { Nullable } from \"../../../types/interfaces\"\n\nenum Tags {\n\tINPUT = \"input\",\n\tTEXTAREA = \"textarea\",\n}\n\n@Component({\n\ttag: \"gov-form-input\",\n\tstyleUrl: \"gov-form-input.scss\",\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID(\"GovInput\")\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType = \"secondary\"\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\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop() readonly inputType: InputType = \"text\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: Nullable<string>\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: \"wcag-autocomplete\" }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keyup\" }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keydown\" }) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\n\t\t\t\t{this.h.hasSlot(\"prefix\") && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"gov-form-input.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,oiZAAoiZ;;ACsB5jZ,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,uBAAe,CAAA;EACf,6BAAqB,CAAA;AACtB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;MAMY,YAAY;EAMxB;;;;;;;;;mBAkBkD,WAAW;;gBAQhB,GAAG;;;;;oBAqBX,KAAK;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,CAAC,MAA2B,CAAC,KAAK,CAAA;IACjD,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;MAClB,SAAS,EAAE,cAAc,CAAC,IAAI;MAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;MACjB,aAAa,EAAE,CAAC;KAChB,CAAC,CAAA;GACF;;;;EAMD,MAAM,QAAQ,CAAC,OAAsB;IACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;GACnC;;;;EAMD,MAAM,QAAQ,CAAC,KAAa;IAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;GAClB;;;;EAMD,MAAM,UAAU;IACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;IACf,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAA;GACxB;;;;EAMD,MAAM,MAAM;IACX,OAAO,IAAI,CAAC,QAAQ,CAAA;GACpB;;;;EAMD,MAAM,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC/E,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7E,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAChE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;GAC/F;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport {\n\tFormInputClass,\n\tFormInputSizes,\n\tFormInputSizesType,\n\tFormInputVariants,\n\tFormInputVariantType,\n\tInputType,\n\tType,\n} from \"./constants\"\nimport { FormInputEvent } from \"./gov-form-input.types\"\nimport { Nullable } from \"../../../types/interfaces\"\n\nenum Tags {\n\tINPUT = \"input\",\n\tTEXTAREA = \"textarea\",\n}\n\n@Component({\n\ttag: \"gov-form-input\",\n\tstyleUrl: \"gov-form-input.scss\",\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID(\"GovInput\")\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType = \"secondary\"\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\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop({ attribute: \"input-type\" }) readonly inputType: InputType = \"text\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: Nullable<string>\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: \"wcag-autocomplete\" }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keyup\" }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keydown\" }) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\n\t\t\t\t{this.h.hasSlot(\"prefix\") && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot(\"sufix\") && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ae3c50f1.js';
|
|
2
|
-
import { g as govForm, c as FormMultiSelectClass, d as FormMultiselectVariants, e as FormMultiselectSizes } from './form-
|
|
3
|
-
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-
|
|
2
|
+
import { g as govForm, c as FormMultiSelectClass, d as FormMultiselectVariants, e as FormMultiselectSizes } from './form-39dc6896.js';
|
|
3
|
+
import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './template-df429738.js';
|
|
4
4
|
import { c as canValidateWcagOnRender } from './win-0a50f66e.js';
|
|
5
5
|
import { v as validateProp } from './props-789f7529.js';
|
|
6
6
|
import { a as validateWcagRef, b as validateWcagLabelFor } from './wcag-06bd4d01.js';
|
|
@@ -6,7 +6,7 @@ const FormPasswordPowerClass = {
|
|
|
6
6
|
text: 'gov-form-password-power__text',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const govFormPasswordPowerCss = ".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-password-power{display:flex;align-items:center;gap:1.5rem;height:1.5rem}.gov-form-password-power__bar{display:flex;gap:0.25rem;width:100%}.gov-form-password-power__bar span{display:inline-block;width:100%;height:var(--gov-form-password-power-height, 0.25rem);border-radius:var(--gov-form-password-power-radius, 0.125rem);background-color:var(--gov-form-password-power-color, var(--gov-color-secondary-600))}.gov-form-password-power__text{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);text-align:right;flex-basis:3.5rem}.gov-form-password-power[power=\"1\"]{color:var(--gov-form-password-power-color-weak, var(--gov-color-error))}.gov-form-password-power[power=\"1\"] .gov-form-password-power__bar span:nth-child(1){background-color:var(--gov-form-password-power-color-weak, var(--gov-color-error))}.gov-form-password-power[power=\"2\"]{color:var(--gov-form-password-power-color-medium, var(--gov-color-warning-500))}.gov-form-password-power[power=\"2\"] .gov-form-password-power__bar span:nth-child(1),.gov-form-password-power[power=\"2\"] .gov-form-password-power__bar span:nth-child(2){background-color:var(--gov-form-password-power-color-medium, var(--gov-color-warning-500))}.gov-form-password-power[power=\"3\"]{color:var(--gov-form-password-power-color-strong, var(--gov-color-success))}.gov-form-password-power[power=\"3\"] .gov-form-password-power__bar span{background-color:var(--gov-form-password-power-color-strong, var(--gov-color-success))}";
|
|
9
|
+
const govFormPasswordPowerCss = ".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-password-power{display:flex;align-items:center;width:100%;gap:1.5rem;height:1.5rem}.gov-form-password-power__bar{display:flex;gap:0.25rem;width:100%}.gov-form-password-power__bar span{display:inline-block;width:100%;height:var(--gov-form-password-power-height, 0.25rem);border-radius:var(--gov-form-password-power-radius, 0.125rem);background-color:var(--gov-form-password-power-color, var(--gov-color-secondary-600))}.gov-form-password-power__text{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);text-align:right;flex-basis:3.5rem}.gov-form-password-power[power=\"1\"]{color:var(--gov-form-password-power-color-weak, var(--gov-color-error))}.gov-form-password-power[power=\"1\"] .gov-form-password-power__bar span:nth-child(1){background-color:var(--gov-form-password-power-color-weak, var(--gov-color-error))}.gov-form-password-power[power=\"2\"]{color:var(--gov-form-password-power-color-medium, var(--gov-color-warning-500))}.gov-form-password-power[power=\"2\"] .gov-form-password-power__bar span:nth-child(1),.gov-form-password-power[power=\"2\"] .gov-form-password-power__bar span:nth-child(2){background-color:var(--gov-form-password-power-color-medium, var(--gov-color-warning-500))}.gov-form-password-power[power=\"3\"]{color:var(--gov-form-password-power-color-strong, var(--gov-color-success-500))}.gov-form-password-power[power=\"3\"] .gov-form-password-power__bar span{background-color:var(--gov-form-password-power-color-strong, var(--gov-color-success-500))}";
|
|
10
10
|
|
|
11
11
|
const GovFormPasswordPower = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"gov-form-password-power.entry.js","mappings":";;AAAO,MAAM,sBAAsB,GAAG;EACrC,IAAI,EAAE,yBAAyB;EAC5B,GAAG,EAAE,8BAA8B;EACnC,IAAI,EAAE,+BAA+B;CACxC;;ACJD,MAAM,uBAAuB,GAAG,
|
|
1
|
+
{"file":"gov-form-password-power.entry.js","mappings":";;AAAO,MAAM,sBAAsB,GAAG;EACrC,IAAI,EAAE,yBAAyB;EAC5B,GAAG,EAAE,8BAA8B;EACnC,IAAI,EAAE,+BAA+B;CACxC;;ACJD,MAAM,uBAAuB,GAAG,85DAA85D;;MCOj7D,oBAAoB;;;;;EAMhC,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,sBAAsB,CAAC,IAAI,IACtC,YAAM,KAAK,EAAE,sBAAsB,CAAC,GAAG,IACrC,eAAa,EACb,eAAa,EACb,eAAa,CACR,EACP,YAAM,KAAK,EAAE,sBAAsB,CAAC,IAAI,IACtC,eAAO,CACF,CACF,EACP;GACD;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-form/password-power/constants.ts","../../../packages/core/src/components/gov-form/password-power/gov-form-password-power.scss?tag=gov-form-password-power","../../../packages/core/src/components/gov-form/password-power/gov-form-password-power.tsx"],"sourcesContent":["export const FormPasswordPowerClass = {\n\troot: 'gov-form-password-power',\n bar: 'gov-form-password-power__bar',\n text: 'gov-form-password-power__text',\n}\n","$class: \".gov-form-password-power\";\n\n#{$class} {\n display: flex;\n align-items: center;\n width: 100%;\n gap: rem-calc(24);\n height: rem-calc(24);\n &__bar {\n display: flex;\n gap: rem-calc(4);\n width: 100%;\n span {\n display: inline-block;\n width: 100%;\n height: $form-password-power-height;\n border-radius: $form-password-power-radius;\n background-color: $form-password-power-color;\n }\n }\n &__text {\n @include typography($font-size-s);\n text-align: right;\n flex-basis: rem-calc(56);\n }\n\n // STATES\n &[power=\"1\"] {\n color: $form-password-power-color-weak;\n #{$class}__bar {\n span:nth-child(1) {\n background-color: $form-password-power-color-weak;\n }\n }\n }\n &[power=\"2\"] {\n color: $form-password-power-color-medium;\n #{$class}__bar {\n span:nth-child(1),\n span:nth-child(2) {\n background-color: $form-password-power-color-medium;\n }\n }\n }\n &[power=\"3\"] {\n color: $form-password-power-color-strong;\n #{$class}__bar {\n span {\n background-color: $form-password-power-color-strong;\n }\n }\n }\n}\n","import {Component, h, Host, Prop} from '@stencil/core'\nimport {FormPasswordPowerClass} from './constants'\n\n@Component({\n\ttag: 'gov-form-password-power',\n\tstyleUrl: 'gov-form-password-power.scss',\n})\nexport class GovFormPasswordPower {\n\t/**\n\t * Password power: 0 - none, 1 - weak, 2 - medium, 3 - strong\n\t */\n\t@Prop({reflect: true}) readonly power: number\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormPasswordPowerClass.root}>\n\t\t\t\t\t<span class={FormPasswordPowerClass.bar}>\n\t\t\t\t\t\t\t<span></span>\n\t\t\t\t\t\t\t<span></span>\n\t\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class={FormPasswordPowerClass.text}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
|