@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
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { govHost } from "../../helpers/Dom/template";
|
|
3
|
+
import { validateProp } from "../../helpers/Validate/props";
|
|
4
|
+
import { ButtonSizes, ButtonVariants } from "../gov-button/button/constants";
|
|
5
|
+
import { TagClass } from "./constants";
|
|
6
|
+
export class GovTag {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.inverse = false;
|
|
9
|
+
this.size = ButtonSizes._S;
|
|
10
|
+
this.variant = ButtonVariants.PRIMARY;
|
|
11
|
+
this.h = govHost(this.host);
|
|
12
|
+
}
|
|
13
|
+
validateVariant(newValue) {
|
|
14
|
+
validateProp(ButtonVariants, newValue, TagClass.root);
|
|
15
|
+
}
|
|
16
|
+
validateSize(newValue) {
|
|
17
|
+
validateProp(ButtonSizes, newValue, TagClass.root);
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this.validateVariant(this.variant);
|
|
21
|
+
this.validateSize(this.size);
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return (h(Host, { class: this.h.classes(TagClass.root), variant: this.variant, type: this.inverse ? undefined : 'solid', size: this.size, inverse: this.inverse }, h("span", { class: "element" }, this.h.hasSlot('left-icon') && h("slot", { name: "left-icon" }), h("slot", null), this.h.hasSlot('right-icon') && h("slot", { name: "right-icon" }))));
|
|
25
|
+
}
|
|
26
|
+
static get is() { return "gov-tag"; }
|
|
27
|
+
static get originalStyleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["gov-tag.scss"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styleUrls() {
|
|
33
|
+
return {
|
|
34
|
+
"$": ["gov-tag.css"]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static get properties() {
|
|
38
|
+
return {
|
|
39
|
+
"inverse": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"mutable": false,
|
|
42
|
+
"complexType": {
|
|
43
|
+
"original": "boolean",
|
|
44
|
+
"resolved": "boolean",
|
|
45
|
+
"references": {}
|
|
46
|
+
},
|
|
47
|
+
"required": false,
|
|
48
|
+
"optional": false,
|
|
49
|
+
"docs": {
|
|
50
|
+
"tags": [],
|
|
51
|
+
"text": "Determine if component should have inverse colors to be used on dark background"
|
|
52
|
+
},
|
|
53
|
+
"attribute": "inverse",
|
|
54
|
+
"reflect": false,
|
|
55
|
+
"defaultValue": "false"
|
|
56
|
+
},
|
|
57
|
+
"size": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"mutable": false,
|
|
60
|
+
"complexType": {
|
|
61
|
+
"original": "ButtonSizesType",
|
|
62
|
+
"resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
|
|
63
|
+
"references": {
|
|
64
|
+
"ButtonSizesType": {
|
|
65
|
+
"location": "import",
|
|
66
|
+
"path": "../gov-button/button/constants",
|
|
67
|
+
"id": "../../../packages/core/src/components/gov-button/button/constants.ts::ButtonSizesType"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"optional": false,
|
|
73
|
+
"docs": {
|
|
74
|
+
"tags": [],
|
|
75
|
+
"text": "Tag\u2019s size."
|
|
76
|
+
},
|
|
77
|
+
"attribute": "size",
|
|
78
|
+
"reflect": true,
|
|
79
|
+
"defaultValue": "ButtonSizes._S"
|
|
80
|
+
},
|
|
81
|
+
"variant": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "ButtonVariantType",
|
|
86
|
+
"resolved": "\"error\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
87
|
+
"references": {
|
|
88
|
+
"ButtonVariantType": {
|
|
89
|
+
"location": "import",
|
|
90
|
+
"path": "../gov-button/button/constants",
|
|
91
|
+
"id": "../../../packages/core/src/components/gov-button/button/constants.ts::ButtonVariantType"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"optional": false,
|
|
97
|
+
"docs": {
|
|
98
|
+
"tags": [],
|
|
99
|
+
"text": "Style variation of the tag."
|
|
100
|
+
},
|
|
101
|
+
"attribute": "variant",
|
|
102
|
+
"reflect": true,
|
|
103
|
+
"defaultValue": "ButtonVariants.PRIMARY"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
static get elementRef() { return "host"; }
|
|
108
|
+
static get watchers() {
|
|
109
|
+
return [{
|
|
110
|
+
"propName": "variant",
|
|
111
|
+
"methodName": "validateVariant"
|
|
112
|
+
}, {
|
|
113
|
+
"propName": "size",
|
|
114
|
+
"methodName": "validateSize"
|
|
115
|
+
}];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=gov-tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gov-tag.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tag/gov-tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACtE,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAC,WAAW,EAAmB,cAAc,EAAoB,MAAM,gCAAgC,CAAA;AAC9G,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAMpC,MAAM,OAAO,MAAM;EAGlB;mBASoC,KAAK;gBAIe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'../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType} from '../gov-button/button/constants'\nimport {TagClass} from './constants'\n\n@Component({\n\ttag: 'gov-tag',\n\tstyleUrl: 'gov-tag.scss',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: ButtonSizesType = ButtonSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\ttype={this.inverse ? undefined : 'solid'}\n\t\t\t\t\t\tsize={this.size} inverse={this.inverse}>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot('left-icon') && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{this.h.hasSlot('right-icon') && <slot name=\"right-icon\"></slot>}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
/* stylelint-disable order/order */
|
|
50
50
|
/* stylelint-enable order/order */
|
|
51
51
|
/**
|
|
52
|
-
* Generates CSS3 var with
|
|
52
|
+
* Generates CSS3 var with button value
|
|
53
53
|
*/
|
|
54
54
|
/*
|
|
55
55
|
- Variables - General
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
- Variables - Backdrop
|
|
81
81
|
*/
|
|
82
82
|
/*
|
|
83
|
-
- Variables - Buttons (&&
|
|
83
|
+
- Variables - Buttons (&& Chips)
|
|
84
84
|
*/
|
|
85
85
|
/*
|
|
86
86
|
- Variables - Breadcrumbs
|
|
@@ -200,6 +200,9 @@
|
|
|
200
200
|
/*
|
|
201
201
|
- Variables - Layout
|
|
202
202
|
*/
|
|
203
|
+
/*
|
|
204
|
+
- Variables - Tag
|
|
205
|
+
*/
|
|
203
206
|
.gov-spin-animation,
|
|
204
207
|
.gov-pseudo-spin-animation::before {
|
|
205
208
|
animation: spin 4s linear infinite;
|
|
@@ -44,7 +44,7 @@ export class GovTile {
|
|
|
44
44
|
"text": "Link on whole tile"
|
|
45
45
|
},
|
|
46
46
|
"attribute": "href",
|
|
47
|
-
"reflect":
|
|
47
|
+
"reflect": true
|
|
48
48
|
},
|
|
49
49
|
"target": {
|
|
50
50
|
"type": "string",
|
|
@@ -55,8 +55,8 @@ export class GovTile {
|
|
|
55
55
|
"references": {
|
|
56
56
|
"ButtonTargetType": {
|
|
57
57
|
"location": "import",
|
|
58
|
-
"path": "../gov-button/
|
|
59
|
-
"id": "../../../packages/core/src/components/gov-button/
|
|
58
|
+
"path": "../gov-button/button/constants",
|
|
59
|
+
"id": "../../../packages/core/src/components/gov-button/button/constants.ts::ButtonTargetType"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-tile.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tile/gov-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAQpD,MAAM,OAAO,OAAO;EAInB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IACzC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACZ,SACC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,SAAS,CAAC,IAAI,EACrB,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,EAAuC,CAAC;MACrE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAC1B,YAAM,KAAK,EAAE,SAAS,CAAC,IAAI;QAC1B,YAAM,IAAI,EAAC,MAAM,GAAG,CACd,CACP;MACA,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAC3B,YAAM,KAAK,EAAE,SAAS,CAAC,KAAK;QAC3B,YAAM,IAAI,EAAC,OAAO,GAAG;QACrB,gBAAU,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,IAAI,EAAC,eAAe,GAAY,CAC5D,CACP;MACD,WAAK,KAAK,EAAE,SAAS,CAAC,OAAO;QAC5B,eAAQ,CACH,CACH,CACJ,CAAC,CAAC,CAAC,CACH;MACE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAC1B,YAAM,KAAK,EAAE,SAAS,CAAC,IAAI;QAC1B,YAAM,IAAI,EAAC,MAAM,GAAG,CACd,CACP;MACA,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAC3B,YAAM,KAAK,EAAE,SAAS,CAAC,KAAK;QAC3B,YAAM,IAAI,EAAC,OAAO,GAAG,CACf,CACP;MACD,WAAK,KAAK,EAAE,SAAS,CAAC,OAAO;QAC5B,eAAQ,CACH,CACA,CACP,CACK,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop } from \"@stencil/core\"\nimport { TileClass } from \"./constants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { ButtonTargetType } from \"../gov-button/
|
|
1
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;MACE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAC1B,YAAM,KAAK,EAAE,SAAS,CAAC,IAAI;QAC1B,YAAM,IAAI,EAAC,MAAM,GAAG,CACd,CACP;MACA,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAC3B,YAAM,KAAK,EAAE,SAAS,CAAC,KAAK;QAC3B,YAAM,IAAI,EAAC,OAAO,GAAG,CACf,CACP;MACD,WAAK,KAAK,EAAE,SAAS,CAAC,OAAO;QAC5B,eAAQ,CACH,CACA,CACP,CACK,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop } from \"@stencil/core\"\nimport { TileClass } from \"./constants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { ButtonTargetType } from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n\tstyleUrl: \"gov-tile.scss\",\n})\nexport class GovTile {\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}>\n\t\t\t\t{this.href ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.h.hasSlot(\"title\") && (\n\t\t\t\t\t\t\t<span class={TileClass.title}>\n\t\t\t\t\t\t\t\t<slot name=\"title\" />\n\t\t\t\t\t\t\t\t<gov-icon class={TileClass.arrow} name=\"chevron-right\"></gov-icon>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.h.hasSlot(\"title\") && (\n\t\t\t\t\t\t\t<span class={TileClass.title}>\n\t\t\t\t\t\t\t\t<slot name=\"title\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"]}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|
|
@@ -260,6 +263,9 @@
|
|
|
260
263
|
right: 0;
|
|
261
264
|
top: 0;
|
|
262
265
|
}
|
|
266
|
+
.gov-tooltip-content[persist=""], .gov-tooltip-content[persist=true i], .gov-tooltip-content[persist="1"] {
|
|
267
|
+
padding-right: 3.25rem;
|
|
268
|
+
}
|
|
263
269
|
.gov-tooltip-content[is-visible=""], .gov-tooltip-content[is-visible=true i], .gov-tooltip-content[is-visible="1"] {
|
|
264
270
|
opacity: 1;
|
|
265
271
|
}
|
|
@@ -288,6 +294,9 @@
|
|
|
288
294
|
line-height: var(--gov-text-s-line-height);
|
|
289
295
|
letter-spacing: var(--gov-text-s-letter-spacing);
|
|
290
296
|
}
|
|
297
|
+
.gov-tooltip-content[size=s][persist=true i] {
|
|
298
|
+
padding-right: var(--gov-tooltip-s-persist-space, 3rem);
|
|
299
|
+
}
|
|
291
300
|
.gov-tooltip-content[size=l] {
|
|
292
301
|
--gov-tooltip-content-padding: var(--gov-tooltip-l-padding, 1rem);
|
|
293
302
|
--gov-tooltip-content-arrow-size: var(--gov-tooltip-l-arrow-size, 0.875rem);
|
|
@@ -297,6 +306,9 @@
|
|
|
297
306
|
line-height: var(--gov-text-xl-line-height);
|
|
298
307
|
letter-spacing: var(--gov-text-xl-letter-spacing);
|
|
299
308
|
}
|
|
309
|
+
.gov-tooltip-content[size=l][persist=true i] {
|
|
310
|
+
padding-right: var(--gov-tooltip-s-persist-space, 4rem);
|
|
311
|
+
}
|
|
300
312
|
.gov-tooltip-content[position=top]::before {
|
|
301
313
|
left: 50%;
|
|
302
314
|
transform: translateX(-50%);
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|
|
@@ -229,7 +232,7 @@
|
|
|
229
232
|
*/
|
|
230
233
|
.gov-tooltip {
|
|
231
234
|
position: relative;
|
|
232
|
-
display: inline;
|
|
235
|
+
display: inline-block;
|
|
233
236
|
border-bottom: 1px dashed currentcolor;
|
|
234
237
|
color: var(--gov-color-primary);
|
|
235
238
|
cursor: help;
|
|
@@ -48,6 +48,10 @@ export class GovTooltip {
|
|
|
48
48
|
this.content.innerHTML = this.message;
|
|
49
49
|
this.host.appendChild(this.content);
|
|
50
50
|
}
|
|
51
|
+
const trigger = this.host.getBoundingClientRect();
|
|
52
|
+
this.content.style.left = trigger.left + 'px';
|
|
53
|
+
this.content.style.top = trigger.top + 'px';
|
|
54
|
+
this.content.style.visibility = 'hidden';
|
|
51
55
|
this.content.setAttribute("id", (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId);
|
|
52
56
|
this.content.setAttribute("parent-id", this.tooltipId);
|
|
53
57
|
this.content.setAttribute("variant", this.variant);
|
|
@@ -83,6 +87,7 @@ export class GovTooltip {
|
|
|
83
87
|
}
|
|
84
88
|
verifyPositionSpace() {
|
|
85
89
|
const offset = 12;
|
|
90
|
+
const windowWidth = window.innerWidth;
|
|
86
91
|
const trigger = this.host.getBoundingClientRect();
|
|
87
92
|
const trgWidth = this.host.offsetWidth;
|
|
88
93
|
const trgHeight = this.host.offsetHeight;
|
|
@@ -92,9 +97,21 @@ export class GovTooltip {
|
|
|
92
97
|
left: trigger.left + document.documentElement.scrollLeft,
|
|
93
98
|
top: trigger.top + document.documentElement.scrollTop,
|
|
94
99
|
};
|
|
95
|
-
|
|
100
|
+
const isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;
|
|
101
|
+
const isLeftSpace = triggerPos.left > contentWidth;
|
|
102
|
+
// LEFT/RIGHT
|
|
96
103
|
if (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {
|
|
97
104
|
this.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + "px";
|
|
105
|
+
if (isRightSpace === false && isLeftSpace === false) {
|
|
106
|
+
this.position = TooltipPosition.TOP;
|
|
107
|
+
this.content.setAttribute("position", TooltipPosition.TOP);
|
|
108
|
+
}
|
|
109
|
+
if (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {
|
|
110
|
+
this.position = TooltipPosition.LEFT;
|
|
111
|
+
}
|
|
112
|
+
if (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {
|
|
113
|
+
this.position = TooltipPosition.RIGHT;
|
|
114
|
+
}
|
|
98
115
|
}
|
|
99
116
|
if (this.position === TooltipPosition.RIGHT) {
|
|
100
117
|
this.content.setAttribute("position", TooltipPosition.RIGHT);
|
|
@@ -104,12 +121,30 @@ export class GovTooltip {
|
|
|
104
121
|
this.content.setAttribute("position", TooltipPosition.LEFT);
|
|
105
122
|
this.content.style.left = (triggerPos.left - (contentWidth + offset)) + "px";
|
|
106
123
|
}
|
|
124
|
+
// LEFT/RIGHT FOR TOP/BOTTOM
|
|
107
125
|
if (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {
|
|
108
126
|
if (contentWidth > trgWidth) {
|
|
109
|
-
|
|
127
|
+
let leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));
|
|
128
|
+
const isNotLeftSpace = leftPosition < 0;
|
|
129
|
+
const isNotRightSpace = (leftPosition + contentWidth) > windowWidth;
|
|
130
|
+
if (isNotLeftSpace && isNotRightSpace) {
|
|
131
|
+
this.content.style.width = "auto";
|
|
132
|
+
this.content.style.left = offset + "px";
|
|
133
|
+
this.content.style.right = offset + "px";
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
if (isNotLeftSpace) {
|
|
137
|
+
leftPosition = offset;
|
|
138
|
+
}
|
|
139
|
+
if (isNotRightSpace) {
|
|
140
|
+
leftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1);
|
|
141
|
+
}
|
|
142
|
+
this.content.style.left = leftPosition + "px";
|
|
143
|
+
}
|
|
110
144
|
}
|
|
111
145
|
else {
|
|
112
|
-
|
|
146
|
+
const leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2));
|
|
147
|
+
this.content.style.left = leftPosition + "px";
|
|
113
148
|
}
|
|
114
149
|
}
|
|
115
150
|
if (this.position === TooltipPosition.TOP) {
|
|
@@ -222,7 +257,7 @@ export class GovTooltip {
|
|
|
222
257
|
},
|
|
223
258
|
"position": {
|
|
224
259
|
"type": "string",
|
|
225
|
-
"mutable":
|
|
260
|
+
"mutable": true,
|
|
226
261
|
"complexType": {
|
|
227
262
|
"original": "TooltipPositionType",
|
|
228
263
|
"resolved": "\"bottom\" | \"left\" | \"right\" | \"top\"",
|
|
@@ -294,7 +329,7 @@ export class GovTooltip {
|
|
|
294
329
|
"text": "Trigger is just an icon"
|
|
295
330
|
},
|
|
296
331
|
"attribute": "icon",
|
|
297
|
-
"reflect":
|
|
332
|
+
"reflect": true,
|
|
298
333
|
"defaultValue": "undefined"
|
|
299
334
|
}
|
|
300
335
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,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I,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;MAChD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;KAC7C;EACF,CAAC;EAEO,aAAa;IACpB,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAChE,IAAI,SAAS,EAAE;MACd,SAAS,CAAC,MAAM,EAAE,CAAA;KAClB;EACF,CAAC;EAED,MAAM;;IACL,OAAO,CACN,EAAC,IAAI,IACJ,EAAE,EAAE,IAAI,CAAC,SAAS,EAClB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,CAAC,sBACO,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC,gBAAgB;MAC1D,eAAQ,CACF,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACpB,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-tooltip\",\n\tstyleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop() position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({ attribute: \"icon\" }) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tthis.content.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tthis.content.setAttribute(\"parent-id\", this.tooltipId)\n\t\tthis.content.setAttribute(\"variant\", this.variant)\n\t\tthis.content.setAttribute(\"size\", this.size)\n\t\tdocument.body.appendChild(this.content)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"focus\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"blur\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.content.offsetWidth\n\t\tconst contentHeight = this.content.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\t\t// @TODO check space for displaying tooltip\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.content.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.content.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tthis.content.style.left = (triggerPos.left - ((contentWidth - trgWidth) / 2)) + \"px\"\n\t\t\t} else {\n\t\t\t\tthis.content.style.left = (triggerPos.left + ((trgWidth - contentWidth) / 2)) + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.content.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.content.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.verifyPositionSpace()\n\t\t\tthis.content.setAttribute(\"is-visible\", \"true\")\n\t\t\tif (this.persist) {\n\t\t\t\tthis.content.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.content.setAttribute(\"persist\", \"false\")\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-tooltip.js","sourceRoot":"","sources":["../../../../../../src/components/gov-tooltip/gov-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AACrF,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EAEf,WAAW,EAEX,cAAc,GAEf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAC,QAAQ,EAAC,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAOlD,MAAM,OAAO,UAAU;EAMrB;IAHiB,qBAAgB,GAAG,SAAS,CAAA;IAC5B,cAAS,GAAG,SAAS,CAAA;mB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;;;;;;;;;;;;CACF","sourcesContent":["import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n TooltipClass,\n TooltipContentClass,\n TooltipPosition,\n TooltipPositionType,\n TooltipSize,\n TooltipSizeType,\n TooltipVariant,\n TooltipVariantType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\n\n@Component({\n tag: \"gov-tooltip\",\n styleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n private h: GovHost\n private content: HTMLGovTooltipContentElement\n private readonly tooltipContentId = undefined\n private readonly tooltipId = undefined\n\n constructor() {\n this.h = govHost(this.host)\n this.tooltipId = createID(\"GovTooltip\")\n this.tooltipContentId = createID(\"GovContentTooltip\")\n }\n\n @Element() host: HTMLGovTooltipElement\n /**\n * Style variation of the tooltip\n */\n @Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n /**\n * Tooltip’s size.\n */\n @Prop() readonly size?: TooltipSizeType = TooltipSize._M\n /**\n * Tooltip display position\n */\n @Prop({mutable: true}) position: TooltipPositionType = \"right\"\n /**\n * Information contained in the tooltip\n */\n @Prop() readonly message: string = undefined\n /**\n * Custom tooltip identifier.\n */\n @Prop({attribute: \"identifier\"}) readonly identifier: string\n /**\n * Trigger is just an icon\n */\n @Prop({reflect: true}) readonly icon: boolean = undefined\n\n @State() persist = false\n\n @Watch(\"variant\")\n validateVariant(newValue: string): void {\n validateProp(TooltipVariant, newValue, TooltipClass.root)\n }\n\n @Watch(\"size\")\n validateSize(newValue: string): void {\n validateProp(TooltipSize, newValue, TooltipClass.root)\n }\n\n @Watch(\"position\")\n validatePosition(newValue: string): void {\n validateProp(TooltipPosition, newValue, TooltipClass.root)\n }\n\n componentWillLoad(): void {\n this.validateVariant(this.variant)\n this.validateSize(this.size)\n this.validatePosition(this.position)\n\n this.createContentWrapper()\n this.registerListeners()\n }\n\n disconnectedCallback() {\n this.removeContent()\n }\n\n private createContentWrapper() {\n const hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n if (hasContentInside) {\n this.content = hasContentInside\n } else {\n this.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n this.content.innerHTML = this.message\n this.host.appendChild(this.content)\n }\n\n const trigger = this.host.getBoundingClientRect()\n this.content.style.left = trigger.left + 'px'\n this.content.style.top = trigger.top + 'px'\n this.content.style.visibility = 'hidden'\n\n this.content.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n this.content.setAttribute(\"parent-id\", this.tooltipId)\n this.content.setAttribute(\"variant\", this.variant)\n this.content.setAttribute(\"size\", this.size)\n document.body.appendChild(this.content)\n }\n\n private registerListeners() {\n this.host.addEventListener(\"click\", e => {\n e.preventDefault()\n this.persist = true\n this.showTooltip()\n })\n this.host.addEventListener(\"focus\", e => {\n e.preventDefault()\n this.showTooltip()\n })\n this.host.addEventListener(\"blur\", e => {\n e.preventDefault()\n if (this.persist === false) {\n this.hideTooltip()\n }\n })\n this.host.addEventListener(\"mouseenter\", e => {\n e.preventDefault()\n this.showTooltip()\n })\n this.host.addEventListener(\"mouseleave\", e => {\n e.preventDefault()\n if (this.persist === false) {\n this.hideTooltip()\n }\n })\n }\n\n private verifyPositionSpace() {\n const offset = 12\n const windowWidth = window.innerWidth\n const trigger = this.host.getBoundingClientRect()\n const trgWidth = this.host.offsetWidth\n const trgHeight = this.host.offsetHeight\n const contentWidth = this.content.offsetWidth\n const contentHeight = this.content.offsetHeight\n const triggerPos = {\n left: trigger.left + document.documentElement.scrollLeft,\n top: trigger.top + document.documentElement.scrollTop,\n }\n\n const isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n const isLeftSpace = triggerPos.left > contentWidth;\n\n // LEFT/RIGHT\n if (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n this.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n if (isRightSpace === false && isLeftSpace === false) {\n this.position = TooltipPosition.TOP\n this.content.setAttribute(\"position\", TooltipPosition.TOP)\n }\n if (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n this.position = TooltipPosition.LEFT\n }\n if (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n this.position = TooltipPosition.RIGHT\n }\n }\n if (this.position === TooltipPosition.RIGHT) {\n this.content.setAttribute(\"position\", TooltipPosition.RIGHT)\n this.content.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n }\n if (this.position === TooltipPosition.LEFT) {\n this.content.setAttribute(\"position\", TooltipPosition.LEFT)\n this.content.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n }\n\n // LEFT/RIGHT FOR TOP/BOTTOM\n if (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n if (contentWidth > trgWidth) {\n let leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n const isNotLeftSpace = leftPosition < 0;\n const isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n if (isNotLeftSpace && isNotRightSpace) {\n this.content.style.width = \"auto\";\n this.content.style.left = offset + \"px\";\n this.content.style.right = offset + \"px\";\n } else {\n if (isNotLeftSpace) {\n leftPosition = offset\n }\n if (isNotRightSpace) {\n leftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n }\n this.content.style.left = leftPosition + \"px\"\n }\n } else {\n const leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n this.content.style.left = leftPosition + \"px\"\n }\n }\n if (this.position === TooltipPosition.TOP) {\n this.content.setAttribute(\"position\", TooltipPosition.TOP)\n this.content.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n }\n if (this.position === TooltipPosition.BOTTOM) {\n this.content.setAttribute(\"position\", TooltipPosition.BOTTOM)\n this.content.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n }\n }\n\n private showTooltip() {\n if (this.content) {\n this.verifyPositionSpace()\n this.content.setAttribute(\"is-visible\", \"true\")\n if (this.persist) {\n this.content.setAttribute(\"persist\", \"true\")\n }\n }\n }\n\n private hideTooltip() {\n if (this.content) {\n this.content.setAttribute(\"is-visible\", \"false\")\n this.content.setAttribute(\"persist\", \"false\")\n }\n }\n\n private removeContent() {\n const contentEl = document.getElementById(this.tooltipContentId)\n if (contentEl) {\n contentEl.remove()\n }\n }\n\n render() {\n return (\n <Host\n id={this.tooltipId}\n class={this.h.classes(TooltipClass.root)}\n position={this.position}\n tabindex={0}\n aria-describedby={this.identifier ?? this.tooltipContentId}>\n <slot/>\n </Host>\n )\n }\n\n /**\n * Showing the modal\n */\n @Method()\n async show(): Promise<void> {\n this.showTooltip()\n }\n\n /**\n * Hiding the modal\n */\n @Method()\n async hide(): Promise<void> {\n this.persist = false\n this.hideTooltip()\n }\n}\n"]}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|
|
@@ -248,7 +248,7 @@ export class GovWizardItem {
|
|
|
248
248
|
"optional": false,
|
|
249
249
|
"docs": {
|
|
250
250
|
"tags": [],
|
|
251
|
-
"text": "Defines whether the accordion is open or closed by
|
|
251
|
+
"text": "Defines whether the accordion is open or closed by button"
|
|
252
252
|
},
|
|
253
253
|
"attribute": "is-expanded",
|
|
254
254
|
"reflect": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gov-wizard-item.js","sourceRoot":"","sources":["../../../../../../src/components/gov-wizard/gov-wizard-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAmB,cAAc,EAAsB,eAAe,EAAE,MAAM,aAAa,CAAA;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAGxF,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAE7C,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,mBAAW,CAAA;EACX,yBAAiB,CAAA;AAClB,CAAC,EAHI,IAAI,KAAJ,IAAI,QAGR;AAMD,MAAM,OAAO,aAAa;EAKzB;mBAUgD,SAAS;gBAIf,GAAG;;uBAQL,KAAK;;;oBAYR,KAAK;sBAIsB,KAAK;oBAIP,IAAI;IAzCjE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAA;IAC1C,IAAI,CAAC,SAAS,GAAG,QAAQ,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { WizardSizesType, WizardVariants, WizardVariantsType, WizardItemClass } from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { WizardItemEvent } from \"./gov-wizard-item.types\"\nimport Fragment from \"../../helpers/Fragment\"\n\nenum Tags {\n\tDIV = \"div\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-wizard-item\",\n\tstyleUrl: \"gov-wizard-item.scss\",\n})\nexport class GovWizardItem {\n\tprivate h: GovHost\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovWizardItem\")\n\t\tthis.contentId = createID(\"GovWizardContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovWizardItemElement\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: WizardVariantsType = \"primary\"\n\t/**\n\t * Size of wizard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Custom wizard item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Defines weather the wizard item can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Item annotation of the wizard\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Item label of the wizard\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Makes the wizard component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by default\n\t */\n\t@Prop({ attribute: \"is-expanded\", mutable: true }) isExpanded = false\n\t/**\n\t * Used to change the HTML tag in the accordion trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: \"label-tag\" }) readonly labelTag: string = \"h3\"\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<WizardItemEvent>\n\n\t@Watch(\"label\")\n\tprivate validateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${WizardItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch(\"labelTag\")\n\tprivate validateTriggerTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"span\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${WizardItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"variant\")\n\tprivate validateVariant(newValue: string): void {\n\t\tvalidateProp(WizardVariants, newValue, WizardItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ expanded: this.isExpanded, component: WizardItemClass.root })\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.labelTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst LabelTag = this.labelTag\n\t\tconst Tag = this.collapsible ? Tags.BUTTON : Tags.DIV\n\t\tconst prefixSlot = this.h.hasSlot(\"prefix\") && (<span class={WizardItemClass.prefix}><slot name=\"prefix\" /></span>)\n\n\t\tconst label = (\n\t\t\t<LabelTag class={WizardItemClass.title}>\n\t\t\t\t<span class={WizardItemClass.name}>\n\t\t\t\t\t<span class={WizardItemClass.label}>\n\t\t\t\t\t\t<span>{this.label}</span>\n\t\t\t\t\t\t{this.collapsible && <gov-icon class={WizardItemClass.arrow} name=\"chevron-down\"></gov-icon>}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.annotation && <span class={WizardItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t</span>\n\t\t\t</LabelTag>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(WizardItemClass.root)} is-expanded={this.isExpanded} variant={this.variant} size={this.size} role=\"listitem\" collapsible={this.collapsible}>\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\tid={triggerId}\n\t\t\t\t\t\t\tclass={WizardItemClass.header}\n\t\t\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\t\t\taria-controls={this.contentId}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\tthis.collapsible ? this.toggle() : false\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Tag>\n\t\t\t\t\t</Fragment>\n\t\t\t\t) : (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<div class={WizardItemClass.header}>{label}</div>\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={WizardItemClass.content}\n\t\t\t\t\t\tid={this.contentId}\n\t\t\t\t\t\taria-hidden={booleanString(!this.isExpanded)}\n\t\t\t\t\t\thidden={!this.isExpanded}\n\t\t\t\t\t\taria-labelledby={triggerId}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div class={WizardItemClass.content} aria-hidden={booleanString(!this.isExpanded)} hidden={!this.isExpanded}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Opening the Wizard\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpanded = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the Wizard\n\t */\n\t@Method()\n\tpublic async close(): Promise<void> {\n\t\tthis.isExpanded = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Wizard switch\n\t */\n\t@Method()\n\tpublic async toggle(): Promise<void> {\n\t\tthis.isExpanded = !this.isExpanded\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tpublic async currentState(): Promise<boolean> {\n\t\treturn this.isExpanded\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gov-wizard-item.js","sourceRoot":"","sources":["../../../../../../src/components/gov-wizard/gov-wizard-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAmB,cAAc,EAAsB,eA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,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU;QAC1G,eAAQ,CACH,CACN,CACK,CACP,CAAA;EACF,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACtB,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEI,KAAK,CAAC,KAAK;IACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;IACvB,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEI,KAAK,CAAC,MAAM;IAClB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAA;IAClC,IAAI,CAAC,WAAW,EAAE,CAAA;EACnB,CAAC;EAED;;KAEG;EAEI,KAAK,CAAC,YAAY;IACxB,OAAO,IAAI,CAAC,UAAU,CAAA;EACvB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { WizardSizesType, WizardVariants, WizardVariantsType, WizardItemClass } from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { WizardItemEvent } from \"./gov-wizard-item.types\"\nimport Fragment from \"../../helpers/Fragment\"\n\nenum Tags {\n\tDIV = \"div\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-wizard-item\",\n\tstyleUrl: \"gov-wizard-item.scss\",\n})\nexport class GovWizardItem {\n\tprivate h: GovHost\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovWizardItem\")\n\t\tthis.contentId = createID(\"GovWizardContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovWizardItemElement\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant?: WizardVariantsType = \"primary\"\n\t/**\n\t * Size of wizard\n\t */\n\t@Prop() readonly size?: WizardSizesType = \"m\"\n\t/**\n\t * Custom wizard item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Defines weather the wizard item can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Item annotation of the wizard\n\t */\n\t@Prop() readonly annotation: string\n\t/**\n\t * Item label of the wizard\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Makes the wizard component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by button\n\t */\n\t@Prop({ attribute: \"is-expanded\", mutable: true }) isExpanded = false\n\t/**\n\t * Used to change the HTML tag in the accordion trigger for correct semantic structure\n\t */\n\t@Prop({ attribute: \"label-tag\" }) readonly labelTag: string = \"h3\"\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<WizardItemEvent>\n\n\t@Watch(\"label\")\n\tprivate validateLabel(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${WizardItemClass.root}]: Parameter label is required.`)\n\t\t}\n\t}\n\n\t@Watch(\"labelTag\")\n\tprivate validateTriggerTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"span\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${WizardItemClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"variant\")\n\tprivate validateVariant(newValue: string): void {\n\t\tvalidateProp(WizardVariants, newValue, WizardItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({ expanded: this.isExpanded, component: WizardItemClass.root })\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateLabel(this.label)\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateTriggerTag(this.labelTag)\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst LabelTag = this.labelTag\n\t\tconst Tag = this.collapsible ? Tags.BUTTON : Tags.DIV\n\t\tconst prefixSlot = this.h.hasSlot(\"prefix\") && (<span class={WizardItemClass.prefix}><slot name=\"prefix\" /></span>)\n\n\t\tconst label = (\n\t\t\t<LabelTag class={WizardItemClass.title}>\n\t\t\t\t<span class={WizardItemClass.name}>\n\t\t\t\t\t<span class={WizardItemClass.label}>\n\t\t\t\t\t\t<span>{this.label}</span>\n\t\t\t\t\t\t{this.collapsible && <gov-icon class={WizardItemClass.arrow} name=\"chevron-down\"></gov-icon>}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.annotation && <span class={WizardItemClass.annot}>{this.annotation}</span>}\n\t\t\t\t</span>\n\t\t\t</LabelTag>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(WizardItemClass.root)} is-expanded={this.isExpanded} variant={this.variant} size={this.size} role=\"listitem\" collapsible={this.collapsible}>\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\tid={triggerId}\n\t\t\t\t\t\t\tclass={WizardItemClass.header}\n\t\t\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\t\t\taria-controls={this.contentId}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\t\tthis.collapsible ? this.toggle() : false\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Tag>\n\t\t\t\t\t</Fragment>\n\t\t\t\t) : (\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t{prefixSlot}\n\t\t\t\t\t\t<div class={WizardItemClass.header}>{label}</div>\n\t\t\t\t\t</Fragment>\n\t\t\t\t)}\n\t\t\t\t{this.collapsible ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass={WizardItemClass.content}\n\t\t\t\t\t\tid={this.contentId}\n\t\t\t\t\t\taria-hidden={booleanString(!this.isExpanded)}\n\t\t\t\t\t\thidden={!this.isExpanded}\n\t\t\t\t\t\taria-labelledby={triggerId}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div class={WizardItemClass.content} aria-hidden={booleanString(!this.isExpanded)} hidden={!this.isExpanded}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Opening the Wizard\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpanded = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the Wizard\n\t */\n\t@Method()\n\tpublic async close(): Promise<void> {\n\t\tthis.isExpanded = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Wizard switch\n\t */\n\t@Method()\n\tpublic async toggle(): Promise<void> {\n\t\tthis.isExpanded = !this.isExpanded\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tpublic async currentState(): Promise<boolean> {\n\t\treturn this.isExpanded\n\t}\n}\n"]}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
/* stylelint-disable order/order */
|
|
40
40
|
/* stylelint-enable order/order */
|
|
41
41
|
/**
|
|
42
|
-
* Generates CSS3 var with
|
|
42
|
+
* Generates CSS3 var with button value
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
- Variables - General
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
- Variables - Backdrop
|
|
71
71
|
*/
|
|
72
72
|
/*
|
|
73
|
-
- Variables - Buttons (&&
|
|
73
|
+
- Variables - Buttons (&& Chips)
|
|
74
74
|
*/
|
|
75
75
|
/*
|
|
76
76
|
- Variables - Breadcrumbs
|
|
@@ -190,6 +190,9 @@
|
|
|
190
190
|
/*
|
|
191
191
|
- Variables - Layout
|
|
192
192
|
*/
|
|
193
|
+
/*
|
|
194
|
+
- Variables - Tag
|
|
195
|
+
*/
|
|
193
196
|
.gov-spin-animation,
|
|
194
197
|
.gov-pseudo-spin-animation::before {
|
|
195
198
|
animation: spin 4s linear infinite;
|