@hashicorp/design-system-components 4.14.0 → 4.16.0
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/declarations/components/hds/accordion/item/index.d.ts +3 -3
- package/declarations/components/hds/accordion/item/index.d.ts.map +1 -1
- package/declarations/components/hds/advanced-table/expandable-tr-group.d.ts +44 -0
- package/declarations/components/hds/advanced-table/expandable-tr-group.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/helpers.d.ts +11 -0
- package/declarations/components/hds/advanced-table/helpers.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/index.d.ts +84 -0
- package/declarations/components/hds/advanced-table/index.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/td.d.ts +36 -0
- package/declarations/components/hds/advanced-table/td.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th-button-expand.d.ts +22 -0
- package/declarations/components/hds/advanced-table/th-button-expand.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th-button-sort.d.ts +23 -0
- package/declarations/components/hds/advanced-table/th-button-sort.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th-button-tooltip.d.ts +18 -0
- package/declarations/components/hds/advanced-table/th-button-tooltip.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th-selectable.d.ts +36 -0
- package/declarations/components/hds/advanced-table/th-selectable.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th-sort.d.ts +40 -0
- package/declarations/components/hds/advanced-table/th-sort.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/th.d.ts +49 -0
- package/declarations/components/hds/advanced-table/th.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/tr.d.ts +44 -0
- package/declarations/components/hds/advanced-table/tr.d.ts.map +1 -0
- package/declarations/components/hds/advanced-table/types.d.ts +85 -0
- package/declarations/components/hds/advanced-table/types.d.ts.map +1 -0
- package/declarations/components/hds/alert/description.d.ts +0 -1
- package/declarations/components/hds/alert/description.d.ts.map +1 -1
- package/declarations/components/hds/alert/index.d.ts +2 -2
- package/declarations/components/hds/alert/index.d.ts.map +1 -1
- package/declarations/components/hds/app-footer/item.d.ts +0 -1
- package/declarations/components/hds/app-footer/item.d.ts.map +1 -1
- package/declarations/components/hds/app-footer/link.d.ts +0 -1
- package/declarations/components/hds/app-footer/link.d.ts.map +1 -1
- package/declarations/components/hds/app-footer/status-link.d.ts +1 -1
- package/declarations/components/hds/app-footer/status-link.d.ts.map +1 -1
- package/declarations/components/hds/app-frame/parts/footer.d.ts +0 -1
- package/declarations/components/hds/app-frame/parts/footer.d.ts.map +1 -1
- package/declarations/components/hds/app-frame/parts/header.d.ts +0 -1
- package/declarations/components/hds/app-frame/parts/header.d.ts.map +1 -1
- package/declarations/components/hds/app-frame/parts/main.d.ts +0 -1
- package/declarations/components/hds/app-frame/parts/main.d.ts.map +1 -1
- package/declarations/components/hds/app-frame/parts/modals.d.ts +0 -1
- package/declarations/components/hds/app-frame/parts/modals.d.ts.map +1 -1
- package/declarations/components/hds/app-frame/parts/sidebar.d.ts +0 -1
- package/declarations/components/hds/app-frame/parts/sidebar.d.ts.map +1 -1
- package/declarations/components/hds/app-header/index.d.ts +7 -7
- package/declarations/components/hds/app-header/index.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/index.d.ts +8 -8
- package/declarations/components/hds/app-side-nav/index.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/list/back-link.d.ts +0 -1
- package/declarations/components/hds/app-side-nav/list/back-link.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/list/index.d.ts +1 -1
- package/declarations/components/hds/app-side-nav/list/index.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/list/item.d.ts +0 -1
- package/declarations/components/hds/app-side-nav/list/item.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/list/link.d.ts +0 -1
- package/declarations/components/hds/app-side-nav/list/link.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/list/title.d.ts +1 -1
- package/declarations/components/hds/app-side-nav/list/title.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/portal/index.d.ts +0 -1
- package/declarations/components/hds/app-side-nav/portal/index.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/portal/target.d.ts +3 -3
- package/declarations/components/hds/app-side-nav/portal/target.d.ts.map +1 -1
- package/declarations/components/hds/app-side-nav/toggle-button.d.ts +0 -1
- package/declarations/components/hds/app-side-nav/toggle-button.d.ts.map +1 -1
- package/declarations/components/hds/application-state/body.d.ts +0 -1
- package/declarations/components/hds/application-state/body.d.ts.map +1 -1
- package/declarations/components/hds/application-state/footer.d.ts +0 -1
- package/declarations/components/hds/application-state/footer.d.ts.map +1 -1
- package/declarations/components/hds/application-state/media.d.ts +0 -1
- package/declarations/components/hds/application-state/media.d.ts.map +1 -1
- package/declarations/components/hds/button-set/index.d.ts +0 -1
- package/declarations/components/hds/button-set/index.d.ts.map +1 -1
- package/declarations/components/hds/code-block/copy-button.d.ts +0 -1
- package/declarations/components/hds/code-block/copy-button.d.ts.map +1 -1
- package/declarations/components/hds/code-block/description.d.ts +0 -1
- package/declarations/components/hds/code-block/description.d.ts.map +1 -1
- package/declarations/components/hds/code-block/index.d.ts +3 -4
- package/declarations/components/hds/code-block/index.d.ts.map +1 -1
- package/declarations/components/hds/code-editor/description.d.ts +22 -0
- package/declarations/components/hds/code-editor/description.d.ts.map +1 -0
- package/declarations/components/hds/code-editor/full-screen-button.d.ts +18 -0
- package/declarations/components/hds/code-editor/full-screen-button.d.ts.map +1 -0
- package/declarations/components/hds/code-editor/generic.d.ts +13 -0
- package/declarations/components/hds/code-editor/generic.d.ts.map +1 -0
- package/declarations/components/hds/code-editor/index.d.ts +50 -0
- package/declarations/components/hds/code-editor/index.d.ts.map +1 -0
- package/declarations/components/hds/code-editor/title.d.ts +24 -0
- package/declarations/components/hds/code-editor/title.d.ts.map +1 -0
- package/declarations/components/hds/copy/button/index.d.ts +2 -2
- package/declarations/components/hds/copy/button/index.d.ts.map +1 -1
- package/declarations/components/hds/copy/snippet/index.d.ts +2 -2
- package/declarations/components/hds/copy/snippet/index.d.ts.map +1 -1
- package/declarations/components/hds/dialog-primitive/body.d.ts +0 -1
- package/declarations/components/hds/dialog-primitive/body.d.ts.map +1 -1
- package/declarations/components/hds/dialog-primitive/description.d.ts +0 -1
- package/declarations/components/hds/dialog-primitive/description.d.ts.map +1 -1
- package/declarations/components/hds/dialog-primitive/overlay.d.ts +0 -1
- package/declarations/components/hds/dialog-primitive/overlay.d.ts.map +1 -1
- package/declarations/components/hds/dialog-primitive/wrapper.d.ts +0 -1
- package/declarations/components/hds/dialog-primitive/wrapper.d.ts.map +1 -1
- package/declarations/components/hds/disclosure-primitive/index.d.ts +2 -2
- package/declarations/components/hds/disclosure-primitive/index.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/footer.d.ts +0 -1
- package/declarations/components/hds/dropdown/footer.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/header.d.ts +0 -1
- package/declarations/components/hds/dropdown/header.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/list-item/generic.d.ts +0 -1
- package/declarations/components/hds/dropdown/list-item/generic.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/list-item/separator.d.ts +0 -1
- package/declarations/components/hds/dropdown/list-item/separator.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/toggle/button.d.ts +2 -2
- package/declarations/components/hds/dropdown/toggle/button.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/toggle/chevron.d.ts +0 -1
- package/declarations/components/hds/dropdown/toggle/chevron.d.ts.map +1 -1
- package/declarations/components/hds/dropdown/toggle/icon.d.ts +1 -1
- package/declarations/components/hds/dropdown/toggle/icon.d.ts.map +1 -1
- package/declarations/components/hds/flyout/index.d.ts +3 -3
- package/declarations/components/hds/flyout/index.d.ts.map +1 -1
- package/declarations/components/hds/form/checkbox/base.d.ts +0 -1
- package/declarations/components/hds/form/checkbox/base.d.ts.map +1 -1
- package/declarations/components/hds/form/checkbox/field.d.ts +0 -1
- package/declarations/components/hds/form/checkbox/field.d.ts.map +1 -1
- package/declarations/components/hds/form/checkbox/group.d.ts +0 -1
- package/declarations/components/hds/form/checkbox/group.d.ts.map +1 -1
- package/declarations/components/hds/form/error/message.d.ts +0 -1
- package/declarations/components/hds/form/error/message.d.ts.map +1 -1
- package/declarations/components/hds/form/file-input/base.d.ts +0 -1
- package/declarations/components/hds/form/file-input/base.d.ts.map +1 -1
- package/declarations/components/hds/form/file-input/field.d.ts +0 -1
- package/declarations/components/hds/form/file-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/masked-input/field.d.ts +0 -1
- package/declarations/components/hds/form/masked-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/radio/base.d.ts +0 -1
- package/declarations/components/hds/form/radio/base.d.ts.map +1 -1
- package/declarations/components/hds/form/radio/field.d.ts +0 -1
- package/declarations/components/hds/form/radio/field.d.ts.map +1 -1
- package/declarations/components/hds/form/radio/group.d.ts +0 -1
- package/declarations/components/hds/form/radio/group.d.ts.map +1 -1
- package/declarations/components/hds/form/radio-card/description.d.ts +0 -1
- package/declarations/components/hds/form/radio-card/description.d.ts.map +1 -1
- package/declarations/components/hds/form/radio-card/group.d.ts +0 -1
- package/declarations/components/hds/form/radio-card/group.d.ts.map +1 -1
- package/declarations/components/hds/form/radio-card/label.d.ts +0 -1
- package/declarations/components/hds/form/radio-card/label.d.ts.map +1 -1
- package/declarations/components/hds/form/select/field.d.ts +0 -1
- package/declarations/components/hds/form/select/field.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/after-options.d.ts +0 -1
- package/declarations/components/hds/form/super-select/after-options.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/multiple/base.d.ts +3 -3
- package/declarations/components/hds/form/super-select/multiple/base.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/option-group.d.ts +2 -1
- package/declarations/components/hds/form/super-select/option-group.d.ts.map +1 -1
- package/declarations/components/hds/form/super-select/placeholder.d.ts +0 -1
- package/declarations/components/hds/form/super-select/placeholder.d.ts.map +1 -1
- package/declarations/components/hds/form/text-input/field.d.ts +1 -1
- package/declarations/components/hds/form/text-input/field.d.ts.map +1 -1
- package/declarations/components/hds/form/textarea/field.d.ts +0 -1
- package/declarations/components/hds/form/textarea/field.d.ts.map +1 -1
- package/declarations/components/hds/form/toggle/base.d.ts +0 -1
- package/declarations/components/hds/form/toggle/base.d.ts.map +1 -1
- package/declarations/components/hds/form/toggle/field.d.ts +0 -1
- package/declarations/components/hds/form/toggle/field.d.ts.map +1 -1
- package/declarations/components/hds/form/toggle/group.d.ts +0 -1
- package/declarations/components/hds/form/toggle/group.d.ts.map +1 -1
- package/declarations/components/hds/form/visibility-toggle/index.d.ts +0 -1
- package/declarations/components/hds/form/visibility-toggle/index.d.ts.map +1 -1
- package/declarations/components/hds/icon/index.d.ts +2 -2
- package/declarations/components/hds/icon/index.d.ts.map +1 -1
- package/declarations/components/hds/modal/index.d.ts +4 -4
- package/declarations/components/hds/modal/index.d.ts.map +1 -1
- package/declarations/components/hds/page-header/actions.d.ts +0 -1
- package/declarations/components/hds/page-header/actions.d.ts.map +1 -1
- package/declarations/components/hds/page-header/badges.d.ts +0 -1
- package/declarations/components/hds/page-header/badges.d.ts.map +1 -1
- package/declarations/components/hds/page-header/description.d.ts +0 -1
- package/declarations/components/hds/page-header/description.d.ts.map +1 -1
- package/declarations/components/hds/page-header/index.d.ts +0 -1
- package/declarations/components/hds/page-header/index.d.ts.map +1 -1
- package/declarations/components/hds/page-header/subtitle.d.ts +0 -1
- package/declarations/components/hds/page-header/subtitle.d.ts.map +1 -1
- package/declarations/components/hds/page-header/title.d.ts +0 -1
- package/declarations/components/hds/page-header/title.d.ts.map +1 -1
- package/declarations/components/hds/pagination/compact/index.d.ts +2 -2
- package/declarations/components/hds/pagination/compact/index.d.ts.map +1 -1
- package/declarations/components/hds/pagination/nav/ellipsis.d.ts +0 -1
- package/declarations/components/hds/pagination/nav/ellipsis.d.ts.map +1 -1
- package/declarations/components/hds/pagination/numbered/index.d.ts +3 -3
- package/declarations/components/hds/pagination/numbered/index.d.ts.map +1 -1
- package/declarations/components/hds/pagination/size-selector/index.d.ts +1 -1
- package/declarations/components/hds/pagination/size-selector/index.d.ts.map +1 -1
- package/declarations/components/hds/popover-primitive/index.d.ts +8 -8
- package/declarations/components/hds/popover-primitive/index.d.ts.map +1 -1
- package/declarations/components/hds/reveal/index.d.ts +2 -2
- package/declarations/components/hds/reveal/index.d.ts.map +1 -1
- package/declarations/components/hds/rich-tooltip/index.d.ts +3 -3
- package/declarations/components/hds/rich-tooltip/index.d.ts.map +1 -1
- package/declarations/components/hds/rich-tooltip/toggle.d.ts.map +1 -1
- package/declarations/components/hds/segmented-group/index.d.ts +0 -1
- package/declarations/components/hds/segmented-group/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/base.d.ts +0 -1
- package/declarations/components/hds/side-nav/base.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/header/index.d.ts +0 -1
- package/declarations/components/hds/side-nav/header/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/list/back-link.d.ts +0 -1
- package/declarations/components/hds/side-nav/list/back-link.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/list/item.d.ts +0 -1
- package/declarations/components/hds/side-nav/list/item.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/list/link.d.ts +0 -1
- package/declarations/components/hds/side-nav/list/link.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/portal/index.d.ts +0 -1
- package/declarations/components/hds/side-nav/portal/index.d.ts.map +1 -1
- package/declarations/components/hds/side-nav/toggle-button.d.ts +0 -1
- package/declarations/components/hds/side-nav/toggle-button.d.ts.map +1 -1
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components/hds/stepper/task/indicator.d.ts.map +1 -1
- package/declarations/components/hds/table/index.d.ts +5 -4
- package/declarations/components/hds/table/index.d.ts.map +1 -1
- package/declarations/components/hds/table/th-button-sort.d.ts +2 -2
- package/declarations/components/hds/table/th-button-sort.d.ts.map +1 -1
- package/declarations/components/hds/table/th-button-tooltip.d.ts +1 -1
- package/declarations/components/hds/table/th-button-tooltip.d.ts.map +1 -1
- package/declarations/components/hds/table/th-selectable.d.ts +3 -3
- package/declarations/components/hds/table/th-selectable.d.ts.map +1 -1
- package/declarations/components/hds/table/th-sort.d.ts +2 -2
- package/declarations/components/hds/table/th-sort.d.ts.map +1 -1
- package/declarations/components/hds/table/th.d.ts +2 -2
- package/declarations/components/hds/table/th.d.ts.map +1 -1
- package/declarations/components/hds/tabs/index.d.ts +8 -8
- package/declarations/components/hds/tabs/index.d.ts.map +1 -1
- package/declarations/components/hds/tabs/panel.d.ts +3 -2
- package/declarations/components/hds/tabs/panel.d.ts.map +1 -1
- package/declarations/components/hds/tabs/tab.d.ts +9 -2
- package/declarations/components/hds/tabs/tab.d.ts.map +1 -1
- package/declarations/components/hds/time/index.d.ts +35 -0
- package/declarations/components/hds/time/index.d.ts.map +1 -0
- package/declarations/components/hds/time/range.d.ts +35 -0
- package/declarations/components/hds/time/range.d.ts.map +1 -0
- package/declarations/components/hds/time/single.d.ts +18 -0
- package/declarations/components/hds/time/single.d.ts.map +1 -0
- package/declarations/components/hds/toast/index.d.ts +0 -1
- package/declarations/components/hds/toast/index.d.ts.map +1 -1
- package/declarations/components/hds/yield/index.d.ts +0 -1
- package/declarations/components/hds/yield/index.d.ts.map +1 -1
- package/declarations/components.d.ts +19 -0
- package/declarations/components.d.ts.map +1 -1
- package/declarations/helpers/hds-format-date.d.ts +18 -0
- package/declarations/helpers/hds-format-date.d.ts.map +1 -0
- package/declarations/helpers/hds-format-relative.d.ts +11 -0
- package/declarations/helpers/hds-format-relative.d.ts.map +1 -0
- package/declarations/modifiers/hds-anchored-position.d.ts +1 -1
- package/declarations/modifiers/hds-anchored-position.d.ts.map +1 -1
- package/declarations/modifiers/hds-clipboard.d.ts +4 -4
- package/declarations/modifiers/hds-clipboard.d.ts.map +1 -1
- package/declarations/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.d.ts +8 -0
- package/declarations/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.d.ts.map +1 -0
- package/declarations/modifiers/hds-code-editor/languages/sentinel.d.ts +44 -0
- package/declarations/modifiers/hds-code-editor/languages/sentinel.d.ts.map +1 -0
- package/declarations/modifiers/hds-code-editor/palettes/hds-dark-palette.d.ts +21 -0
- package/declarations/modifiers/hds-code-editor/palettes/hds-dark-palette.d.ts.map +1 -0
- package/declarations/modifiers/hds-code-editor/themes/hds-dark-theme.d.ts +7 -0
- package/declarations/modifiers/hds-code-editor/themes/hds-dark-theme.d.ts.map +1 -0
- package/declarations/modifiers/hds-code-editor/types.d.ts +16 -0
- package/declarations/modifiers/hds-code-editor/types.d.ts.map +1 -0
- package/declarations/modifiers/hds-code-editor.d.ts +43 -0
- package/declarations/modifiers/hds-code-editor.d.ts.map +1 -0
- package/declarations/modifiers/hds-register-event.d.ts +1 -1
- package/declarations/modifiers/hds-register-event.d.ts.map +1 -1
- package/declarations/modifiers/hds-tooltip.d.ts +4 -4
- package/declarations/modifiers/hds-tooltip.d.ts.map +1 -1
- package/declarations/services/hds-time-types.d.ts +31 -0
- package/declarations/services/hds-time-types.d.ts.map +1 -0
- package/declarations/services/hds-time.d.ts +80 -0
- package/declarations/services/hds-time.d.ts.map +1 -0
- package/declarations/services.d.ts +5 -0
- package/declarations/services.d.ts.map +1 -0
- package/declarations/template-registry.d.ts +60 -0
- package/declarations/template-registry.d.ts.map +1 -1
- package/dist/_app_/components/hds/advanced-table/expandable-tr-group.js +1 -0
- package/dist/_app_/components/hds/advanced-table/helpers.js +1 -0
- package/dist/_app_/components/hds/advanced-table/index.js +1 -0
- package/dist/_app_/components/hds/advanced-table/td.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-button-expand.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-button-sort.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-button-tooltip.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-selectable.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th-sort.js +1 -0
- package/dist/_app_/components/hds/advanced-table/th.js +1 -0
- package/dist/_app_/components/hds/advanced-table/tr.js +1 -0
- package/dist/_app_/components/hds/code-editor/description.js +1 -0
- package/dist/_app_/components/hds/code-editor/full-screen-button.js +1 -0
- package/dist/_app_/components/hds/code-editor/generic.js +1 -0
- package/dist/_app_/components/hds/code-editor/index.js +1 -0
- package/dist/_app_/components/hds/code-editor/title.js +1 -0
- package/dist/_app_/components/hds/time/index.js +1 -0
- package/dist/_app_/components/hds/time/range.js +1 -0
- package/dist/_app_/components/hds/time/single.js +1 -0
- package/dist/_app_/helpers/hds-format-date.js +1 -0
- package/dist/_app_/helpers/hds-format-relative.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor/languages/sentinel.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor/palettes/hds-dark-palette.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor/themes/hds-dark-theme.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor/types.js +1 -0
- package/dist/_app_/modifiers/hds-code-editor.js +1 -0
- package/dist/_app_/services/hds-time.js +1 -0
- package/dist/{_rollupPluginBabelHelpers-KIi_qCIU.js → _rollupPluginBabelHelpers-C_TsMG3M.js} +15 -9
- package/dist/_rollupPluginBabelHelpers-C_TsMG3M.js.map +1 -0
- package/dist/components/hds/accordion/index.js.map +1 -1
- package/dist/components/hds/accordion/item/button.js +2 -2
- package/dist/components/hds/accordion/item/button.js.map +1 -1
- package/dist/components/hds/accordion/item/index.js +6 -6
- package/dist/components/hds/accordion/item/index.js.map +1 -1
- package/dist/components/hds/accordion/types.js.map +1 -1
- package/dist/components/hds/advanced-table/expandable-tr-group.js +70 -0
- package/dist/components/hds/advanced-table/expandable-tr-group.js.map +1 -0
- package/dist/components/hds/advanced-table/helpers.js +144 -0
- package/dist/components/hds/advanced-table/helpers.js.map +1 -0
- package/dist/components/hds/advanced-table/index.js +312 -0
- package/dist/components/hds/advanced-table/index.js.map +1 -0
- package/dist/components/hds/advanced-table/td.js +95 -0
- package/dist/components/hds/advanced-table/td.js.map +1 -0
- package/dist/components/hds/advanced-table/th-button-expand.js +49 -0
- package/dist/components/hds/advanced-table/th-button-expand.js.map +1 -0
- package/dist/components/hds/advanced-table/th-button-sort.js +57 -0
- package/dist/components/hds/advanced-table/th-button-sort.js.map +1 -0
- package/dist/components/hds/advanced-table/th-button-tooltip.js +28 -0
- package/dist/components/hds/advanced-table/th-button-tooltip.js.map +1 -0
- package/dist/components/hds/advanced-table/th-selectable.js +92 -0
- package/dist/components/hds/advanced-table/th-selectable.js.map +1 -0
- package/dist/components/hds/advanced-table/th-sort.js +95 -0
- package/dist/components/hds/advanced-table/th-sort.js.map +1 -0
- package/dist/components/hds/advanced-table/th.js +112 -0
- package/dist/components/hds/advanced-table/th.js.map +1 -0
- package/dist/components/hds/advanced-table/tr.js +39 -0
- package/dist/components/hds/advanced-table/tr.js.map +1 -0
- package/dist/components/hds/advanced-table/types.js +54 -0
- package/dist/components/hds/advanced-table/types.js.map +1 -0
- package/dist/components/hds/alert/description.js.map +1 -1
- package/dist/components/hds/alert/index.js +10 -10
- package/dist/components/hds/alert/index.js.map +1 -1
- package/dist/components/hds/alert/title.js.map +1 -1
- package/dist/components/hds/alert/types.js.map +1 -1
- package/dist/components/hds/app-footer/copyright.js.map +1 -1
- package/dist/components/hds/app-footer/index.js.map +1 -1
- package/dist/components/hds/app-footer/item.js.map +1 -1
- package/dist/components/hds/app-footer/legal-links.js.map +1 -1
- package/dist/components/hds/app-footer/link.js.map +1 -1
- package/dist/components/hds/app-footer/status-link.js.map +1 -1
- package/dist/components/hds/app-footer/types.js.map +1 -1
- package/dist/components/hds/app-frame/index.js.map +1 -1
- package/dist/components/hds/app-frame/parts/footer.js.map +1 -1
- package/dist/components/hds/app-frame/parts/header.js.map +1 -1
- package/dist/components/hds/app-frame/parts/main.js.map +1 -1
- package/dist/components/hds/app-frame/parts/modals.js.map +1 -1
- package/dist/components/hds/app-frame/parts/sidebar.js.map +1 -1
- package/dist/components/hds/app-header/home-link.js.map +1 -1
- package/dist/components/hds/app-header/index.js +27 -27
- package/dist/components/hds/app-header/index.js.map +1 -1
- package/dist/components/hds/app-header/menu-button.js +2 -2
- package/dist/components/hds/app-header/menu-button.js.map +1 -1
- package/dist/components/hds/app-side-nav/index.js +48 -48
- package/dist/components/hds/app-side-nav/index.js.map +1 -1
- package/dist/components/hds/app-side-nav/list/back-link.js.map +1 -1
- package/dist/components/hds/app-side-nav/list/index.js +3 -3
- package/dist/components/hds/app-side-nav/list/index.js.map +1 -1
- package/dist/components/hds/app-side-nav/list/item.js.map +1 -1
- package/dist/components/hds/app-side-nav/list/link.js.map +1 -1
- package/dist/components/hds/app-side-nav/list/title.js +4 -4
- package/dist/components/hds/app-side-nav/list/title.js.map +1 -1
- package/dist/components/hds/app-side-nav/portal/index.js.map +1 -1
- package/dist/components/hds/app-side-nav/portal/target.js +14 -14
- package/dist/components/hds/app-side-nav/portal/target.js.map +1 -1
- package/dist/components/hds/app-side-nav/toggle-button.js.map +1 -1
- package/dist/components/hds/application-state/body.js.map +1 -1
- package/dist/components/hds/application-state/footer.js.map +1 -1
- package/dist/components/hds/application-state/header.js.map +1 -1
- package/dist/components/hds/application-state/index.js.map +1 -1
- package/dist/components/hds/application-state/media.js.map +1 -1
- package/dist/components/hds/application-state/types.js.map +1 -1
- package/dist/components/hds/badge/index.js.map +1 -1
- package/dist/components/hds/badge/types.js.map +1 -1
- package/dist/components/hds/badge-count/index.js.map +1 -1
- package/dist/components/hds/badge-count/types.js.map +1 -1
- package/dist/components/hds/breadcrumb/index.js.map +1 -1
- package/dist/components/hds/breadcrumb/item.js.map +1 -1
- package/dist/components/hds/breadcrumb/truncation.js.map +1 -1
- package/dist/components/hds/button/index.js.map +1 -1
- package/dist/components/hds/button/types.js.map +1 -1
- package/dist/components/hds/button-set/index.js.map +1 -1
- package/dist/components/hds/card/container.js.map +1 -1
- package/dist/components/hds/card/types.js.map +1 -1
- package/dist/components/hds/code-block/copy-button.js.map +1 -1
- package/dist/components/hds/code-block/description.js.map +1 -1
- package/dist/components/hds/code-block/index.js +9 -9
- package/dist/components/hds/code-block/index.js.map +1 -1
- package/dist/components/hds/code-block/title.js.map +1 -1
- package/dist/components/hds/code-block/types.js.map +1 -1
- package/dist/components/hds/code-editor/description.js +17 -0
- package/dist/components/hds/code-editor/description.js.map +1 -0
- package/dist/components/hds/code-editor/full-screen-button.js +26 -0
- package/dist/components/hds/code-editor/full-screen-button.js.map +1 -0
- package/dist/components/hds/code-editor/generic.js +16 -0
- package/dist/components/hds/code-editor/generic.js.map +1 -0
- package/dist/components/hds/code-editor/index.js +120 -0
- package/dist/components/hds/code-editor/index.js.map +1 -0
- package/dist/components/hds/code-editor/title.js +20 -0
- package/dist/components/hds/code-editor/title.js.map +1 -0
- package/dist/components/hds/copy/button/index.js +14 -14
- package/dist/components/hds/copy/button/index.js.map +1 -1
- package/dist/components/hds/copy/button/types.js.map +1 -1
- package/dist/components/hds/copy/snippet/index.js +14 -14
- package/dist/components/hds/copy/snippet/index.js.map +1 -1
- package/dist/components/hds/copy/snippet/types.js.map +1 -1
- package/dist/components/hds/dialog-primitive/body.js.map +1 -1
- package/dist/components/hds/dialog-primitive/description.js.map +1 -1
- package/dist/components/hds/dialog-primitive/footer.js.map +1 -1
- package/dist/components/hds/dialog-primitive/header.js.map +1 -1
- package/dist/components/hds/dialog-primitive/overlay.js.map +1 -1
- package/dist/components/hds/dialog-primitive/types.js.map +1 -1
- package/dist/components/hds/dialog-primitive/wrapper.js.map +1 -1
- package/dist/components/hds/disclosure-primitive/index.js +3 -3
- package/dist/components/hds/disclosure-primitive/index.js.map +1 -1
- package/dist/components/hds/dismiss-button/index.js.map +1 -1
- package/dist/components/hds/dropdown/footer.js.map +1 -1
- package/dist/components/hds/dropdown/header.js.map +1 -1
- package/dist/components/hds/dropdown/index.js +2 -2
- package/dist/components/hds/dropdown/index.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/checkbox.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/checkmark.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/copy-item.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/description.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/generic.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/interactive.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/radio.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/separator.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/title.js.map +1 -1
- package/dist/components/hds/dropdown/list-item/types.js.map +1 -1
- package/dist/components/hds/dropdown/toggle/button.js +4 -4
- package/dist/components/hds/dropdown/toggle/button.js.map +1 -1
- package/dist/components/hds/dropdown/toggle/chevron.js.map +1 -1
- package/dist/components/hds/dropdown/toggle/icon.js +7 -7
- package/dist/components/hds/dropdown/toggle/icon.js.map +1 -1
- package/dist/components/hds/dropdown/toggle/types.js.map +1 -1
- package/dist/components/hds/dropdown/types.js.map +1 -1
- package/dist/components/hds/flyout/body.js.map +1 -1
- package/dist/components/hds/flyout/description.js.map +1 -1
- package/dist/components/hds/flyout/footer.js.map +1 -1
- package/dist/components/hds/flyout/header.js.map +1 -1
- package/dist/components/hds/flyout/index.js +22 -20
- package/dist/components/hds/flyout/index.js.map +1 -1
- package/dist/components/hds/flyout/types.js.map +1 -1
- package/dist/components/hds/form/character-count/index.js.map +1 -1
- package/dist/components/hds/form/checkbox/base.js.map +1 -1
- package/dist/components/hds/form/checkbox/field.js.map +1 -1
- package/dist/components/hds/form/checkbox/group.js.map +1 -1
- package/dist/components/hds/form/error/index.js.map +1 -1
- package/dist/components/hds/form/error/message.js.map +1 -1
- package/dist/components/hds/form/field/index.js +2 -2
- package/dist/components/hds/form/field/index.js.map +1 -1
- package/dist/components/hds/form/field/types.js.map +1 -1
- package/dist/components/hds/form/fieldset/index.js +2 -2
- package/dist/components/hds/form/fieldset/index.js.map +1 -1
- package/dist/components/hds/form/fieldset/types.js.map +1 -1
- package/dist/components/hds/form/file-input/base.js.map +1 -1
- package/dist/components/hds/form/file-input/field.js.map +1 -1
- package/dist/components/hds/form/helper-text/index.js.map +1 -1
- package/dist/components/hds/form/indicator/index.js.map +1 -1
- package/dist/components/hds/form/label/index.js.map +1 -1
- package/dist/components/hds/form/legend/index.js.map +1 -1
- package/dist/components/hds/form/masked-input/base.js +3 -3
- package/dist/components/hds/form/masked-input/base.js.map +1 -1
- package/dist/components/hds/form/masked-input/field.js.map +1 -1
- package/dist/components/hds/form/radio/base.js.map +1 -1
- package/dist/components/hds/form/radio/field.js.map +1 -1
- package/dist/components/hds/form/radio/group.js.map +1 -1
- package/dist/components/hds/form/radio-card/description.js.map +1 -1
- package/dist/components/hds/form/radio-card/group.js.map +1 -1
- package/dist/components/hds/form/radio-card/index.js.map +1 -1
- package/dist/components/hds/form/radio-card/label.js.map +1 -1
- package/dist/components/hds/form/radio-card/types.js.map +1 -1
- package/dist/components/hds/form/select/base.js.map +1 -1
- package/dist/components/hds/form/select/field.js.map +1 -1
- package/dist/components/hds/form/super-select/after-options.js.map +1 -1
- package/dist/components/hds/form/super-select/multiple/base.js +20 -20
- package/dist/components/hds/form/super-select/multiple/base.js.map +1 -1
- package/dist/components/hds/form/super-select/multiple/field.js +1 -1
- package/dist/components/hds/form/super-select/multiple/field.js.map +1 -1
- package/dist/components/hds/form/super-select/option-group.js +4 -3
- package/dist/components/hds/form/super-select/option-group.js.map +1 -1
- package/dist/components/hds/form/super-select/placeholder.js.map +1 -1
- package/dist/components/hds/form/super-select/single/base.js +4 -4
- package/dist/components/hds/form/super-select/single/base.js.map +1 -1
- package/dist/components/hds/form/super-select/single/field.js +1 -1
- package/dist/components/hds/form/super-select/single/field.js.map +1 -1
- package/dist/components/hds/form/super-select/types.js.map +1 -1
- package/dist/components/hds/form/text-input/base.js.map +1 -1
- package/dist/components/hds/form/text-input/field.js +9 -9
- package/dist/components/hds/form/text-input/field.js.map +1 -1
- package/dist/components/hds/form/text-input/types.js.map +1 -1
- package/dist/components/hds/form/textarea/base.js.map +1 -1
- package/dist/components/hds/form/textarea/field.js.map +1 -1
- package/dist/components/hds/form/toggle/base.js.map +1 -1
- package/dist/components/hds/form/toggle/field.js.map +1 -1
- package/dist/components/hds/form/toggle/group.js.map +1 -1
- package/dist/components/hds/form/visibility-toggle/index.js.map +1 -1
- package/dist/components/hds/icon/index.js +5 -5
- package/dist/components/hds/icon/index.js.map +1 -1
- package/dist/components/hds/icon/types.js.map +1 -1
- package/dist/components/hds/icon-tile/index.js.map +1 -1
- package/dist/components/hds/icon-tile/types.js.map +1 -1
- package/dist/components/hds/interactive/index.js +2 -2
- package/dist/components/hds/interactive/index.js.map +1 -1
- package/dist/components/hds/link/inline.js.map +1 -1
- package/dist/components/hds/link/standalone.js.map +1 -1
- package/dist/components/hds/link/types.js.map +1 -1
- package/dist/components/hds/menu-primitive/index.js +3 -3
- package/dist/components/hds/menu-primitive/index.js.map +1 -1
- package/dist/components/hds/modal/body.js.map +1 -1
- package/dist/components/hds/modal/footer.js.map +1 -1
- package/dist/components/hds/modal/header.js.map +1 -1
- package/dist/components/hds/modal/index.js +32 -32
- package/dist/components/hds/modal/index.js.map +1 -1
- package/dist/components/hds/modal/types.js.map +1 -1
- package/dist/components/hds/page-header/actions.js.map +1 -1
- package/dist/components/hds/page-header/badges.js.map +1 -1
- package/dist/components/hds/page-header/description.js.map +1 -1
- package/dist/components/hds/page-header/index.js.map +1 -1
- package/dist/components/hds/page-header/subtitle.js.map +1 -1
- package/dist/components/hds/page-header/title.js.map +1 -1
- package/dist/components/hds/pagination/compact/index.js +11 -11
- package/dist/components/hds/pagination/compact/index.js.map +1 -1
- package/dist/components/hds/pagination/info/index.js.map +1 -1
- package/dist/components/hds/pagination/nav/arrow.js +2 -2
- package/dist/components/hds/pagination/nav/arrow.js.map +1 -1
- package/dist/components/hds/pagination/nav/ellipsis.js.map +1 -1
- package/dist/components/hds/pagination/nav/number.js +2 -2
- package/dist/components/hds/pagination/nav/number.js.map +1 -1
- package/dist/components/hds/pagination/numbered/index.js +15 -15
- package/dist/components/hds/pagination/numbered/index.js.map +1 -1
- package/dist/components/hds/pagination/size-selector/index.js +4 -4
- package/dist/components/hds/pagination/size-selector/index.js.map +1 -1
- package/dist/components/hds/pagination/types.js.map +1 -1
- package/dist/components/hds/popover-primitive/index.js +61 -57
- package/dist/components/hds/popover-primitive/index.js.map +1 -1
- package/dist/components/hds/reveal/index.js +4 -4
- package/dist/components/hds/reveal/index.js.map +1 -1
- package/dist/components/hds/reveal/toggle/button.js.map +1 -1
- package/dist/components/hds/rich-tooltip/bubble.js.map +1 -1
- package/dist/components/hds/rich-tooltip/index.js +5 -5
- package/dist/components/hds/rich-tooltip/index.js.map +1 -1
- package/dist/components/hds/rich-tooltip/toggle.js +1 -1
- package/dist/components/hds/rich-tooltip/toggle.js.map +1 -1
- package/dist/components/hds/rich-tooltip/types.js.map +1 -1
- package/dist/components/hds/segmented-group/index.js.map +1 -1
- package/dist/components/hds/separator/index.js.map +1 -1
- package/dist/components/hds/separator/types.js.map +1 -1
- package/dist/components/hds/side-nav/base.js.map +1 -1
- package/dist/components/hds/side-nav/header/home-link.js.map +1 -1
- package/dist/components/hds/side-nav/header/icon-button.js.map +1 -1
- package/dist/components/hds/side-nav/header/index.js.map +1 -1
- package/dist/components/hds/side-nav/index.js +5 -5
- package/dist/components/hds/side-nav/index.js.map +1 -1
- package/dist/components/hds/side-nav/list/back-link.js.map +1 -1
- package/dist/components/hds/side-nav/list/index.js +3 -3
- package/dist/components/hds/side-nav/list/index.js.map +1 -1
- package/dist/components/hds/side-nav/list/item.js.map +1 -1
- package/dist/components/hds/side-nav/list/link.js.map +1 -1
- package/dist/components/hds/side-nav/list/title.js +2 -2
- package/dist/components/hds/side-nav/list/title.js.map +1 -1
- package/dist/components/hds/side-nav/portal/index.js.map +1 -1
- package/dist/components/hds/side-nav/portal/target.js +3 -3
- package/dist/components/hds/side-nav/portal/target.js.map +1 -1
- package/dist/components/hds/side-nav/toggle-button.js.map +1 -1
- package/dist/components/hds/stepper/step/indicator.js.map +1 -1
- package/dist/components/hds/stepper/task/indicator.js.map +1 -1
- package/dist/components/hds/stepper/types.js.map +1 -1
- package/dist/components/hds/table/index.js +26 -26
- package/dist/components/hds/table/index.js.map +1 -1
- package/dist/components/hds/table/td.js.map +1 -1
- package/dist/components/hds/table/th-button-sort.js +4 -4
- package/dist/components/hds/table/th-button-sort.js.map +1 -1
- package/dist/components/hds/table/th-button-tooltip.js +3 -3
- package/dist/components/hds/table/th-button-tooltip.js.map +1 -1
- package/dist/components/hds/table/th-selectable.js +9 -14
- package/dist/components/hds/table/th-selectable.js.map +1 -1
- package/dist/components/hds/table/th-sort.js +4 -4
- package/dist/components/hds/table/th-sort.js.map +1 -1
- package/dist/components/hds/table/th.js +4 -4
- package/dist/components/hds/table/th.js.map +1 -1
- package/dist/components/hds/table/tr.js.map +1 -1
- package/dist/components/hds/table/types.js.map +1 -1
- package/dist/components/hds/tabs/index.js +40 -40
- package/dist/components/hds/tabs/index.js.map +1 -1
- package/dist/components/hds/tabs/panel.js +9 -8
- package/dist/components/hds/tabs/panel.js.map +1 -1
- package/dist/components/hds/tabs/tab.js +14 -5
- package/dist/components/hds/tabs/tab.js.map +1 -1
- package/dist/components/hds/tabs/types.js.map +1 -1
- package/dist/components/hds/tag/index.js.map +1 -1
- package/dist/components/hds/tag/types.js.map +1 -1
- package/dist/components/hds/text/body.js.map +1 -1
- package/dist/components/hds/text/code.js.map +1 -1
- package/dist/components/hds/text/display.js.map +1 -1
- package/dist/components/hds/text/index.js.map +1 -1
- package/dist/components/hds/text/types.js.map +1 -1
- package/dist/components/hds/time/index.js +128 -0
- package/dist/components/hds/time/index.js.map +1 -0
- package/dist/components/hds/time/range.js +66 -0
- package/dist/components/hds/time/range.js.map +1 -0
- package/dist/components/hds/time/single.js +16 -0
- package/dist/components/hds/time/single.js.map +1 -0
- package/dist/components/hds/toast/index.js.map +1 -1
- package/dist/components/hds/tooltip-button/index.js.map +1 -1
- package/dist/components/hds/tooltip-button/types.js.map +1 -1
- package/dist/components/hds/yield/index.js.map +1 -1
- package/dist/components.js +18 -0
- package/dist/components.js.map +1 -1
- package/dist/helpers/hds-format-date.js +29 -0
- package/dist/helpers/hds-format-date.js.map +1 -0
- package/dist/helpers/hds-format-relative.js +29 -0
- package/dist/helpers/hds-format-relative.js.map +1 -0
- package/dist/helpers/hds-link-to-models.js.map +1 -1
- package/dist/helpers/hds-link-to-query.js.map +1 -1
- package/dist/instance-initializers/load-sprite.js.map +1 -1
- package/dist/modifiers/hds-anchored-position.js +12 -8
- package/dist/modifiers/hds-anchored-position.js.map +1 -1
- package/dist/modifiers/hds-clipboard.js.map +1 -1
- package/dist/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.js +80 -0
- package/dist/modifiers/hds-code-editor/highlight-styles/hds-dark-highlight-style.js.map +1 -0
- package/dist/modifiers/hds-code-editor/languages/sentinel.js +143 -0
- package/dist/modifiers/hds-code-editor/languages/sentinel.js.map +1 -0
- package/dist/modifiers/hds-code-editor/palettes/hds-dark-palette.js +24 -0
- package/dist/modifiers/hds-code-editor/palettes/hds-dark-palette.js.map +1 -0
- package/dist/modifiers/hds-code-editor/themes/hds-dark-theme.js +62 -0
- package/dist/modifiers/hds-code-editor/themes/hds-dark-theme.js.map +1 -0
- package/dist/modifiers/hds-code-editor/types.js +19 -0
- package/dist/modifiers/hds-code-editor/types.js.map +1 -0
- package/dist/modifiers/hds-code-editor.js +266 -0
- package/dist/modifiers/hds-code-editor.js.map +1 -0
- package/dist/modifiers/hds-register-event.js +4 -4
- package/dist/modifiers/hds-register-event.js.map +1 -1
- package/dist/modifiers/hds-tooltip.js +19 -19
- package/dist/modifiers/hds-tooltip.js.map +1 -1
- package/dist/services/hds-time-types.js +2 -0
- package/dist/services/hds-time-types.js.map +1 -0
- package/dist/services/hds-time.js +215 -0
- package/dist/services/hds-time.js.map +1 -0
- package/dist/services.js +2 -0
- package/dist/services.js.map +1 -0
- package/dist/styles/@hashicorp/design-system-components.css +565 -174
- package/dist/styles/@hashicorp/design-system-components.scss +3 -0
- package/dist/styles/@hashicorp/design-system-power-select-overrides.scss +3 -3
- package/dist/styles/components/accordion.scss +1 -1
- package/dist/styles/components/advanced-table.scss +349 -0
- package/dist/styles/components/alert.scss +2 -3
- package/dist/styles/components/app-header.scss +1 -1
- package/dist/styles/components/app-side-nav/index.scss +4 -4
- package/dist/styles/components/badge-count.scss +6 -5
- package/dist/styles/components/badge.scss +12 -10
- package/dist/styles/components/breadcrumb.scss +2 -2
- package/dist/styles/components/card/container.scss +1 -1
- package/dist/styles/components/code-block/index.scss +2 -2
- package/dist/styles/components/code-editor/index.scss +113 -0
- package/dist/styles/components/code-editor/theme.scss +20 -0
- package/dist/styles/components/copy/index.scss +2 -2
- package/dist/styles/components/copy/snippet.scss +1 -1
- package/dist/styles/components/dropdown.scss +18 -10
- package/dist/styles/components/form/select.scss +1 -1
- package/dist/styles/components/icon-tile.scss +20 -24
- package/dist/styles/components/link/index.scss +2 -2
- package/dist/styles/components/link/standalone.scss +6 -5
- package/dist/styles/components/modal.scss +1 -1
- package/dist/styles/components/page-header.scss +4 -1
- package/dist/styles/components/rich-tooltip.scss +1 -1
- package/dist/styles/components/side-nav/a11y-refocus.scss +1 -1
- package/dist/styles/components/side-nav/index.scss +6 -6
- package/dist/styles/components/stepper/index.scss +2 -2
- package/dist/styles/components/stepper/step-indicator.scss +14 -12
- package/dist/styles/components/stepper/task-indicator.scss +5 -3
- package/dist/styles/components/table.scss +10 -33
- package/dist/styles/components/tabs.scss +4 -3
- package/dist/styles/components/time.scss +13 -0
- package/dist/styles/mixins/_button.scss +14 -12
- package/dist/utils/hds-aria-described-by.js +3 -3
- package/dist/utils/hds-aria-described-by.js.map +1 -1
- package/dist/utils/hds-get-element-id.js.map +1 -1
- package/package.json +90 -50
- package/dist/_rollupPluginBabelHelpers-KIi_qCIU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description.js","sources":["../../../../src/components/hds/flyout/description.hbs","../../../../src/components/hds/flyout/description.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<Hds::Text::Body class=\\\"hds-flyout__description\\\" @tag=\\\"div\\\" @size=\\\"200\\\" @color=\\\"primary\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport type { HdsTextBodySignature } from '../text/body';\n\nexport interface HdsFlyoutDescriptionSignature {\n Args: never;\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFlyoutDescription extends Component<HdsFlyoutDescriptionSignature> {\n constructor(owner: unknown, args: HdsFlyoutDescriptionSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Description` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Description` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.description',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutDescription","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,gRAAgR;;ACDlT;AACA;AACA;AACA;;AAce,MAAMA,oBAAoB,SAASC,SAAS,CAAgC;AACzFC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAA2C,EAAE;AACvE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"description.js","sources":["../../../../src/components/hds/flyout/description.hbs","../../../../src/components/hds/flyout/description.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<Hds::Text::Body class=\\\"hds-flyout__description\\\" @tag=\\\"div\\\" @size=\\\"200\\\" @color=\\\"primary\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport type { HdsTextBodySignature } from '../text/body';\n\nexport interface HdsFlyoutDescriptionSignature {\n Args: never;\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFlyoutDescription extends Component<HdsFlyoutDescriptionSignature> {\n constructor(owner: unknown, args: HdsFlyoutDescriptionSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Description` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Description` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.description',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutDescription","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,gRAAgR;;ACDlT;AACA;AACA;AACA;;AAce,MAAMA,oBAAoB,SAASC,SAAS,CAAgC;AACzFC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAA2C,EAAE;AACvE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC;AAElBC,IAAAA,SAAS,CACP,2NAA2N,EAC3N,KAAK,EACL;AACEC,MAAAA,EAAE,EAAE,mCAAmC;AACvCC,MAAAA,KAAK,EAAE,OAAO;AACdC,MAAAA,GAAG,EAAE,6EAA6E;AAClFC,MAAAA,GAAG,EAAE,qCAAqC;AAC1CC,MAAAA,KAAK,EAAE;AACLC,QAAAA,OAAO,EAAE;AACX;AACF,KACF,CAAC;AACH;AACF;AAACC,oBAAA,CAAAC,QAAA,EAlBoBb,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../../src/components/hds/flyout/footer.hbs","../../../../src/components/hds/flyout/footer.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-flyout__footer\\\" ...attributes>\\n {{yield (hash close=@onDismiss)}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\n\nexport interface HdsFlyoutFooterSignature {\n Args: {\n onDismiss?: (event: MouseEvent) => void;\n };\n Blocks: {\n default: [{ close?: (event: MouseEvent) => void }];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFlyoutFooter extends Component<HdsFlyoutFooterSignature> {\n constructor(owner: unknown, args: HdsFlyoutFooterSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Footer` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Footer` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.footer',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutFooter","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,6NAA6N;;ACD/P;AACA;AACA;AACA;;AAee,MAAMA,eAAe,SAASC,SAAS,CAA2B;AAC/EC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAAsC,EAAE;AAClE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/hds/flyout/footer.hbs","../../../../src/components/hds/flyout/footer.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-flyout__footer\\\" ...attributes>\\n {{yield (hash close=@onDismiss)}}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\n\nexport interface HdsFlyoutFooterSignature {\n Args: {\n onDismiss?: (event: MouseEvent) => void;\n };\n Blocks: {\n default: [{ close?: (event: MouseEvent) => void }];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFlyoutFooter extends Component<HdsFlyoutFooterSignature> {\n constructor(owner: unknown, args: HdsFlyoutFooterSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Footer` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Footer` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.footer',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutFooter","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,6NAA6N;;ACD/P;AACA;AACA;AACA;;AAee,MAAMA,eAAe,SAASC,SAAS,CAA2B;AAC/EC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAAsC,EAAE;AAClE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC;AAElBC,IAAAA,SAAS,CACP,iNAAiN,EACjN,KAAK,EACL;AACEC,MAAAA,EAAE,EAAE,8BAA8B;AAClCC,MAAAA,KAAK,EAAE,OAAO;AACdC,MAAAA,GAAG,EAAE,6EAA6E;AAClFC,MAAAA,GAAG,EAAE,qCAAqC;AAC1CC,MAAAA,KAAK,EAAE;AACLC,QAAAA,OAAO,EAAE;AACX;AACF,KACF,CAAC;AACH;AACF;AAACC,oBAAA,CAAAC,QAAA,EAlBoBb,eAAe,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sources":["../../../../src/components/hds/flyout/header.hbs","../../../../src/components/hds/flyout/header.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-flyout__header\\\" ...attributes>\\n {{#if @icon}}\\n <Hds::Icon class=\\\"hds-flyout__icon\\\" @name={{@icon}} @size=\\\"24\\\" />\\n {{/if}}\\n <Hds::Text::Display class=\\\"hds-flyout__title\\\" @tag=\\\"div\\\" @size=\\\"300\\\" @weight=\\\"semibold\\\" id={{@id}}>\\n {{#if @tagline}}\\n <Hds::Text::Body class=\\\"hds-flyout__tagline\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"regular\\\" @color=\\\"faint\\\">\\n {{@tagline}}\\n </Hds::Text::Body>\\n {{/if}}\\n {{yield}}\\n </Hds::Text::Display>\\n <Hds::DismissButton class=\\\"hds-flyout__dismiss\\\" {{on \\\"click\\\" @onDismiss}} />\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport type { HdsIconSignature } from '../icon';\n\nexport interface HdsFlyoutHeaderSignature {\n Args: {\n id?: string;\n tagline?: string;\n onDismiss: (event: MouseEvent) => void;\n icon?: HdsIconSignature['Args']['name'];\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFlyoutHeader extends Component<HdsFlyoutHeaderSignature> {\n constructor(owner: unknown, args: HdsFlyoutHeaderSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Header` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Header` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.header',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutHeader","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,otBAAotB;;ACDtvB;AACA;AACA;AACA;;AAmBe,MAAMA,eAAe,SAASC,SAAS,CAA2B;AAC/EC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAAsC,EAAE;AAClE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/hds/flyout/header.hbs","../../../../src/components/hds/flyout/header.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{!\\n THIS SUBCOMPONENT IS NOW DEPRECATED\\n}}\\n<div class=\\\"hds-flyout__header\\\" ...attributes>\\n {{#if @icon}}\\n <Hds::Icon class=\\\"hds-flyout__icon\\\" @name={{@icon}} @size=\\\"24\\\" />\\n {{/if}}\\n <Hds::Text::Display class=\\\"hds-flyout__title\\\" @tag=\\\"div\\\" @size=\\\"300\\\" @weight=\\\"semibold\\\" id={{@id}}>\\n {{#if @tagline}}\\n <Hds::Text::Body class=\\\"hds-flyout__tagline\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"regular\\\" @color=\\\"faint\\\">\\n {{@tagline}}\\n </Hds::Text::Body>\\n {{/if}}\\n {{yield}}\\n </Hds::Text::Display>\\n <Hds::DismissButton class=\\\"hds-flyout__dismiss\\\" {{on \\\"click\\\" @onDismiss}} />\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport type { HdsIconSignature } from '../icon';\n\nexport interface HdsFlyoutHeaderSignature {\n Args: {\n id?: string;\n tagline?: string;\n onDismiss: (event: MouseEvent) => void;\n icon?: HdsIconSignature['Args']['name'];\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFlyoutHeader extends Component<HdsFlyoutHeaderSignature> {\n constructor(owner: unknown, args: HdsFlyoutHeaderSignature['Args']) {\n super(owner, args);\n\n deprecate(\n 'The `Hds::Flyout::Header` sub-component is now deprecated and will be removed in the next major version of `@hashicorp/design-system-components`. Use `Hds::DialogPrimitive::Header` as one-to-one replacement.',\n false,\n {\n id: 'hds.components.flyout.header',\n until: '5.0.0',\n url: 'https://helios.hashicorp.design/components/flyout?tab=version%20history#460',\n for: '@hashicorp/design-system-components',\n since: {\n enabled: '4.6.0',\n },\n }\n );\n }\n}\n"],"names":["HdsFlyoutHeader","Component","constructor","owner","args","deprecate","id","until","url","for","since","enabled","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,otBAAotB;;ACDtvB;AACA;AACA;AACA;;AAmBe,MAAMA,eAAe,SAASC,SAAS,CAA2B;AAC/EC,EAAAA,WAAWA,CAACC,KAAc,EAAEC,IAAsC,EAAE;AAClE,IAAA,KAAK,CAACD,KAAK,EAAEC,IAAI,CAAC;AAElBC,IAAAA,SAAS,CACP,iNAAiN,EACjN,KAAK,EACL;AACEC,MAAAA,EAAE,EAAE,8BAA8B;AAClCC,MAAAA,KAAK,EAAE,OAAO;AACdC,MAAAA,GAAG,EAAE,6EAA6E;AAClFC,MAAAA,GAAG,EAAE,qCAAqC;AAC1CC,MAAAA,KAAK,EAAE;AACLC,QAAAA,OAAO,EAAE;AACX;AACF,KACF,CAAC;AACH;AACF;AAACC,oBAAA,CAAAC,QAAA,EAlBoBb,eAAe,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _applyDecoratedDescriptor, b as _initializerDefineProperty, a as _defineProperty } from '../../../_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _applyDecoratedDescriptor, b as _initializerDefineProperty, a as _defineProperty } from '../../../_rollupPluginBabelHelpers-C_TsMG3M.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
@@ -13,7 +13,7 @@ import '../dialog-primitive/header.js';
|
|
|
13
13
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
14
14
|
import { setComponentTemplate } from '@ember/component';
|
|
15
15
|
|
|
16
|
-
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::DialogPrimitive::Wrapper\n class={{this.classNames}}\n ...attributes\n aria-labelledby={{this.id}}\n {{did-insert this.didInsert}}\n {{will-destroy this.willDestroyNode}}\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\n {{focus-trap isActive=this.
|
|
16
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::DialogPrimitive::Wrapper\n class={{this.classNames}}\n ...attributes\n aria-labelledby={{this.id}}\n {{did-insert this.didInsert}}\n {{will-destroy this.willDestroyNode}}\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\n {{focus-trap isActive=this._isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\n>\n <:header>\n {{yield\n (hash\n Header=(component\n \"hds/dialog-primitive/header\"\n id=this.id\n onDismiss=this.onDismiss\n contextualClassPrefix=\"hds-flyout\"\n titleTag=\"h1\"\n )\n Description=(component \"hds/dialog-primitive/description\" contextualClass=\"hds-flyout__description\")\n )\n }}\n </:header>\n <:body>\n {{yield (hash Body=(component \"hds/dialog-primitive/body\" contextualClass=\"hds-flyout__body\"))}}\n </:body>\n <:footer>\n {{yield\n (hash\n Footer=(component \"hds/dialog-primitive/footer\" onDismiss=this.onDismiss contextualClass=\"hds-flyout__footer\")\n )\n }}\n </:footer>\n</Hds::DialogPrimitive::Wrapper>\n\n{{#if this._isOpen}}\n <Hds::DialogPrimitive::Overlay @contextualClass=\"hds-flyout__overlay\" />\n{{/if}}");
|
|
17
17
|
|
|
18
18
|
var _class, _descriptor;
|
|
19
19
|
const waiter = buildWaiter('@hashicorp/design-system-components:flyout');
|
|
@@ -23,10 +23,12 @@ const SIZES = Object.values(HdsFlyoutSizesValues);
|
|
|
23
23
|
let HdsFlyout = (_class = class HdsFlyout extends Component {
|
|
24
24
|
constructor(...args) {
|
|
25
25
|
super(...args);
|
|
26
|
-
_initializerDefineProperty(this, "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
_defineProperty(this, "
|
|
26
|
+
_initializerDefineProperty(this, "_isOpen", _descriptor, this);
|
|
27
|
+
// TODO: make this property private; currently blocked by our consumers relying on it despite not being part of the public API: https://github.com/hashicorp/cloud-ui/blob/main/engines/waypoint/addon/components/preview-pane.ts#L15
|
|
28
|
+
// private _element!: HTMLDialogElement;
|
|
29
|
+
_defineProperty(this, "element", undefined);
|
|
30
|
+
_defineProperty(this, "_body", undefined);
|
|
31
|
+
_defineProperty(this, "_bodyInitialOverflowValue", '');
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* Sets the size of the flyout
|
|
@@ -67,15 +69,15 @@ let HdsFlyout = (_class = class HdsFlyout extends Component {
|
|
|
67
69
|
if (this.args.onClose && typeof this.args.onClose === 'function') {
|
|
68
70
|
this.args.onClose(event);
|
|
69
71
|
}
|
|
70
|
-
this.
|
|
72
|
+
this._isOpen = false;
|
|
71
73
|
}
|
|
72
74
|
didInsert(element) {
|
|
73
75
|
// Store references of `<dialog>` and `<body>` elements
|
|
74
76
|
this.element = element;
|
|
75
|
-
this.
|
|
76
|
-
if (this.
|
|
77
|
+
this._body = document.body;
|
|
78
|
+
if (this._body) {
|
|
77
79
|
// Store the initial `overflow` value of `<body>` so we can reset to it
|
|
78
|
-
this.
|
|
80
|
+
this._bodyInitialOverflowValue = this._body.style.getPropertyValue('overflow');
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
// Register "onClose" callback function to be called when a native 'close' event is dispatched
|
|
@@ -94,10 +96,10 @@ let HdsFlyout = (_class = class HdsFlyout extends Component {
|
|
|
94
96
|
open() {
|
|
95
97
|
// Make flyout dialog visible using the native `showModal` method
|
|
96
98
|
this.element.showModal();
|
|
97
|
-
this.
|
|
99
|
+
this._isOpen = true;
|
|
98
100
|
|
|
99
101
|
// Prevent page from scrolling when the dialog is open
|
|
100
|
-
if (this.
|
|
102
|
+
if (this._body) this._body.style.setProperty('overflow', 'hidden');
|
|
101
103
|
|
|
102
104
|
// Call "onOpen" callback function
|
|
103
105
|
if (this.args.onOpen && typeof this.args.onOpen === 'function') {
|
|
@@ -121,14 +123,14 @@ let HdsFlyout = (_class = class HdsFlyout extends Component {
|
|
|
121
123
|
this.element.close();
|
|
122
124
|
|
|
123
125
|
// Reset page `overflow` property
|
|
124
|
-
if (this.
|
|
125
|
-
this.
|
|
126
|
-
if (this.
|
|
127
|
-
if (this.
|
|
128
|
-
this.
|
|
126
|
+
if (this._body) {
|
|
127
|
+
this._body.style.removeProperty('overflow');
|
|
128
|
+
if (this._bodyInitialOverflowValue === '') {
|
|
129
|
+
if (this._body.style.length === 0) {
|
|
130
|
+
this._body.removeAttribute('style');
|
|
129
131
|
}
|
|
130
132
|
} else {
|
|
131
|
-
this.
|
|
133
|
+
this._body.style.setProperty('overflow', this._bodyInitialOverflowValue);
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
|
|
@@ -140,14 +142,14 @@ let HdsFlyout = (_class = class HdsFlyout extends Component {
|
|
|
140
142
|
}
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
|
-
},
|
|
145
|
+
}, _descriptor = _applyDecoratedDescriptor(_class.prototype, "_isOpen", [tracked], {
|
|
144
146
|
configurable: true,
|
|
145
147
|
enumerable: true,
|
|
146
148
|
writable: true,
|
|
147
149
|
initializer: function () {
|
|
148
150
|
return false;
|
|
149
151
|
}
|
|
150
|
-
}), _applyDecoratedDescriptor(_class.prototype, "registerOnCloseCallback", [action], Object.getOwnPropertyDescriptor(_class.prototype, "registerOnCloseCallback"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "didInsert", [action], Object.getOwnPropertyDescriptor(_class.prototype, "didInsert"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "willDestroyNode", [action], Object.getOwnPropertyDescriptor(_class.prototype, "willDestroyNode"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "open", [action], Object.getOwnPropertyDescriptor(_class.prototype, "open"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onDismiss", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onDismiss"), _class.prototype)
|
|
152
|
+
}), _applyDecoratedDescriptor(_class.prototype, "registerOnCloseCallback", [action], Object.getOwnPropertyDescriptor(_class.prototype, "registerOnCloseCallback"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "didInsert", [action], Object.getOwnPropertyDescriptor(_class.prototype, "didInsert"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "willDestroyNode", [action], Object.getOwnPropertyDescriptor(_class.prototype, "willDestroyNode"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "open", [action], Object.getOwnPropertyDescriptor(_class.prototype, "open"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onDismiss", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onDismiss"), _class.prototype), _class);
|
|
151
153
|
setComponentTemplate(TEMPLATE, HdsFlyout);
|
|
152
154
|
|
|
153
155
|
export { DEFAULT_HAS_OVERLAY, DEFAULT_SIZE, SIZES, HdsFlyout as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/flyout/index.hbs","../../../../src/components/hds/flyout/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::DialogPrimitive::Wrapper\\n class={{this.classNames}}\\n ...attributes\\n aria-labelledby={{this.id}}\\n {{did-insert this.didInsert}}\\n {{will-destroy this.willDestroyNode}}\\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\\n {{focus-trap isActive=this.isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\\n>\\n <:header>\\n {{yield\\n (hash\\n Header=(component\\n \\\"hds/dialog-primitive/header\\\"\\n id=this.id\\n onDismiss=this.onDismiss\\n contextualClassPrefix=\\\"hds-flyout\\\"\\n titleTag=\\\"h1\\\"\\n )\\n Description=(component \\\"hds/dialog-primitive/description\\\" contextualClass=\\\"hds-flyout__description\\\")\\n )\\n }}\\n </:header>\\n <:body>\\n {{yield (hash Body=(component \\\"hds/dialog-primitive/body\\\" contextualClass=\\\"hds-flyout__body\\\"))}}\\n </:body>\\n <:footer>\\n {{yield\\n (hash\\n Footer=(component \\\"hds/dialog-primitive/footer\\\" onDismiss=this.onDismiss contextualClass=\\\"hds-flyout__footer\\\")\\n )\\n }}\\n </:footer>\\n</Hds::DialogPrimitive::Wrapper>\\n\\n{{#if this.isOpen}}\\n <Hds::DialogPrimitive::Overlay @contextualClass=\\\"hds-flyout__overlay\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { getElementId } from '../../../utils/hds-get-element-id.ts';\nimport { buildWaiter } from '@ember/test-waiters';\nimport type { WithBoundArgs } from '@glint/template';\n\nimport type { HdsFlyoutSizes } from './types.ts';\n\nimport { HdsFlyoutSizesValues } from './types.ts';\nimport HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';\nimport HdsDialogPrimitiveDescriptionComponent from '../dialog-primitive/description.ts';\nimport HdsDialogPrimitiveFooterComponent from '../dialog-primitive/footer.ts';\nimport HdsDialogPrimitiveHeaderComponent from '../dialog-primitive/header.ts';\n\nconst waiter = buildWaiter('@hashicorp/design-system-components:flyout');\n\nexport const DEFAULT_SIZE = HdsFlyoutSizesValues.Medium;\nexport const DEFAULT_HAS_OVERLAY = true;\nexport const SIZES: string[] = Object.values(HdsFlyoutSizesValues);\n\nexport interface HdsFlyoutSignature {\n Args: {\n size?: HdsFlyoutSizes;\n returnFocusTo?: string;\n onOpen?: () => void;\n onClose?: (event: Event) => void;\n };\n Blocks: {\n default: [\n {\n Header?: WithBoundArgs<\n typeof HdsDialogPrimitiveHeaderComponent,\n 'id' | 'onDismiss' | 'contextualClassPrefix'\n >;\n Description?: WithBoundArgs<\n typeof HdsDialogPrimitiveDescriptionComponent,\n 'contextualClass'\n >;\n Body?: WithBoundArgs<\n typeof HdsDialogPrimitiveBodyComponent,\n 'contextualClass'\n >;\n Footer?: WithBoundArgs<\n typeof HdsDialogPrimitiveFooterComponent,\n 'onDismiss' | 'contextualClass'\n >;\n },\n ];\n };\n Element: HTMLDialogElement;\n}\n\nexport default class HdsFlyout extends Component<HdsFlyoutSignature> {\n @tracked isOpen = false;\n element!: HTMLDialogElement;\n body!: HTMLElement;\n bodyInitialOverflowValue = '';\n\n /**\n * Sets the size of the flyout\n * Accepted values: medium, large\n *\n * @param size\n * @type {string}\n * @default 'medium'\n */\n get size(): HdsFlyoutSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Flyout\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n /**\n * Calculates the unique ID to assign to the title\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-flyout'];\n\n // add a class based on the @size argument\n classes.push(`hds-flyout--size-${this.size}`);\n\n return classes.join(' ');\n }\n\n @action registerOnCloseCallback(event: Event) {\n if (this.args.onClose && typeof this.args.onClose === 'function') {\n this.args.onClose(event);\n }\n\n this.isOpen = false;\n }\n\n @action\n didInsert(element: HTMLDialogElement): void {\n // Store references of `<dialog>` and `<body>` elements\n this.element = element;\n this.body = document.body;\n\n if (this.body) {\n // Store the initial `overflow` value of `<body>` so we can reset to it\n this.bodyInitialOverflowValue =\n this.body.style.getPropertyValue('overflow');\n }\n\n // Register \"onClose\" callback function to be called when a native 'close' event is dispatched\n this.element.addEventListener('close', this.registerOnCloseCallback, true);\n\n // If the flyout dialog is not already open\n if (!this.element.open) {\n this.open();\n }\n }\n\n @action\n willDestroyNode(): void {\n if (this.element) {\n this.element.removeEventListener(\n 'close',\n this.registerOnCloseCallback,\n true\n );\n }\n }\n\n @action\n open(): void {\n // Make flyout dialog visible using the native `showModal` method\n this.element.showModal();\n this.isOpen = true;\n\n // Prevent page from scrolling when the dialog is open\n if (this.body) this.body.style.setProperty('overflow', 'hidden');\n\n // Call \"onOpen\" callback function\n if (this.args.onOpen && typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n }\n\n @action\n async onDismiss(): Promise<void> {\n // allow ember test helpers to be aware of when the `close` event fires\n // when using `click` or other helpers from '@ember/test-helpers'\n // Notice: this code will get stripped out in production builds (DEBUG evaluates to `true` in dev/test builds, but `false` in prod builds)\n if (this.element.open) {\n const token = waiter.beginAsync();\n const listener = () => {\n waiter.endAsync(token);\n this.element.removeEventListener('close', listener);\n };\n this.element.addEventListener('close', listener);\n }\n\n // Make flyout dialog invisible using the native `close` method\n this.element.close();\n\n // Reset page `overflow` property\n if (this.body) {\n this.body.style.removeProperty('overflow');\n if (this.bodyInitialOverflowValue === '') {\n if (this.body.style.length === 0) {\n this.body.removeAttribute('style');\n }\n } else {\n this.body.style.setProperty('overflow', this.bodyInitialOverflowValue);\n }\n }\n\n // Return focus to a specific element (if provided)\n if (this.args.returnFocusTo) {\n const initiator = document.getElementById(this.args.returnFocusTo);\n if (initiator) {\n initiator.focus();\n }\n }\n }\n}\n"],"names":["waiter","buildWaiter","DEFAULT_SIZE","HdsFlyoutSizesValues","Medium","DEFAULT_HAS_OVERLAY","SIZES","Object","values","HdsFlyout","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","size","assert","join","includes","id","getElementId","classNames","classes","push","registerOnCloseCallback","event","onClose","isOpen","didInsert","element","body","document","bodyInitialOverflowValue","style","getPropertyValue","addEventListener","open","willDestroyNode","removeEventListener","showModal","setProperty","onOpen","onDismiss","token","beginAsync","listener","endAsync","close","removeProperty","length","removeAttribute","returnFocusTo","initiator","getElementById","focus","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/flyout/index.hbs","../../../../src/components/hds/flyout/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::DialogPrimitive::Wrapper\\n class={{this.classNames}}\\n ...attributes\\n aria-labelledby={{this.id}}\\n {{did-insert this.didInsert}}\\n {{will-destroy this.willDestroyNode}}\\n {{! @glint-expect-error - https://github.com/josemarluedke/ember-focus-trap/issues/86 }}\\n {{focus-trap isActive=this._isOpen focusTrapOptions=(hash onDeactivate=this.onDismiss clickOutsideDeactivates=true)}}\\n>\\n <:header>\\n {{yield\\n (hash\\n Header=(component\\n \\\"hds/dialog-primitive/header\\\"\\n id=this.id\\n onDismiss=this.onDismiss\\n contextualClassPrefix=\\\"hds-flyout\\\"\\n titleTag=\\\"h1\\\"\\n )\\n Description=(component \\\"hds/dialog-primitive/description\\\" contextualClass=\\\"hds-flyout__description\\\")\\n )\\n }}\\n </:header>\\n <:body>\\n {{yield (hash Body=(component \\\"hds/dialog-primitive/body\\\" contextualClass=\\\"hds-flyout__body\\\"))}}\\n </:body>\\n <:footer>\\n {{yield\\n (hash\\n Footer=(component \\\"hds/dialog-primitive/footer\\\" onDismiss=this.onDismiss contextualClass=\\\"hds-flyout__footer\\\")\\n )\\n }}\\n </:footer>\\n</Hds::DialogPrimitive::Wrapper>\\n\\n{{#if this._isOpen}}\\n <Hds::DialogPrimitive::Overlay @contextualClass=\\\"hds-flyout__overlay\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { assert } from '@ember/debug';\nimport { getElementId } from '../../../utils/hds-get-element-id.ts';\nimport { buildWaiter } from '@ember/test-waiters';\nimport type { WithBoundArgs } from '@glint/template';\n\nimport type { HdsFlyoutSizes } from './types.ts';\n\nimport { HdsFlyoutSizesValues } from './types.ts';\nimport HdsDialogPrimitiveBodyComponent from '../dialog-primitive/body.ts';\nimport HdsDialogPrimitiveDescriptionComponent from '../dialog-primitive/description.ts';\nimport HdsDialogPrimitiveFooterComponent from '../dialog-primitive/footer.ts';\nimport HdsDialogPrimitiveHeaderComponent from '../dialog-primitive/header.ts';\n\nconst waiter = buildWaiter('@hashicorp/design-system-components:flyout');\n\nexport const DEFAULT_SIZE = HdsFlyoutSizesValues.Medium;\nexport const DEFAULT_HAS_OVERLAY = true;\nexport const SIZES: string[] = Object.values(HdsFlyoutSizesValues);\n\nexport interface HdsFlyoutSignature {\n Args: {\n size?: HdsFlyoutSizes;\n returnFocusTo?: string;\n onOpen?: () => void;\n onClose?: (event: Event) => void;\n };\n Blocks: {\n default: [\n {\n Header?: WithBoundArgs<\n typeof HdsDialogPrimitiveHeaderComponent,\n 'id' | 'onDismiss' | 'contextualClassPrefix'\n >;\n Description?: WithBoundArgs<\n typeof HdsDialogPrimitiveDescriptionComponent,\n 'contextualClass'\n >;\n Body?: WithBoundArgs<\n typeof HdsDialogPrimitiveBodyComponent,\n 'contextualClass'\n >;\n Footer?: WithBoundArgs<\n typeof HdsDialogPrimitiveFooterComponent,\n 'onDismiss' | 'contextualClass'\n >;\n },\n ];\n };\n Element: HTMLDialogElement;\n}\n\nexport default class HdsFlyout extends Component<HdsFlyoutSignature> {\n @tracked private _isOpen = false;\n // TODO: make this property private; currently blocked by our consumers relying on it despite not being part of the public API: https://github.com/hashicorp/cloud-ui/blob/main/engines/waypoint/addon/components/preview-pane.ts#L15\n // private _element!: HTMLDialogElement;\n element!: HTMLDialogElement;\n private _body!: HTMLElement;\n private _bodyInitialOverflowValue = '';\n\n /**\n * Sets the size of the flyout\n * Accepted values: medium, large\n *\n * @param size\n * @type {string}\n * @default 'medium'\n */\n get size(): HdsFlyoutSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Flyout\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n /**\n * Calculates the unique ID to assign to the title\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-flyout'];\n\n // add a class based on the @size argument\n classes.push(`hds-flyout--size-${this.size}`);\n\n return classes.join(' ');\n }\n\n @action registerOnCloseCallback(event: Event) {\n if (this.args.onClose && typeof this.args.onClose === 'function') {\n this.args.onClose(event);\n }\n\n this._isOpen = false;\n }\n\n @action\n didInsert(element: HTMLDialogElement): void {\n // Store references of `<dialog>` and `<body>` elements\n this.element = element;\n this._body = document.body;\n\n if (this._body) {\n // Store the initial `overflow` value of `<body>` so we can reset to it\n this._bodyInitialOverflowValue =\n this._body.style.getPropertyValue('overflow');\n }\n\n // Register \"onClose\" callback function to be called when a native 'close' event is dispatched\n this.element.addEventListener('close', this.registerOnCloseCallback, true);\n\n // If the flyout dialog is not already open\n if (!this.element.open) {\n this.open();\n }\n }\n\n @action\n willDestroyNode(): void {\n if (this.element) {\n this.element.removeEventListener(\n 'close',\n this.registerOnCloseCallback,\n true\n );\n }\n }\n\n @action\n open(): void {\n // Make flyout dialog visible using the native `showModal` method\n this.element.showModal();\n this._isOpen = true;\n\n // Prevent page from scrolling when the dialog is open\n if (this._body) this._body.style.setProperty('overflow', 'hidden');\n\n // Call \"onOpen\" callback function\n if (this.args.onOpen && typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n }\n\n @action\n async onDismiss(): Promise<void> {\n // allow ember test helpers to be aware of when the `close` event fires\n // when using `click` or other helpers from '@ember/test-helpers'\n // Notice: this code will get stripped out in production builds (DEBUG evaluates to `true` in dev/test builds, but `false` in prod builds)\n if (this.element.open) {\n const token = waiter.beginAsync();\n const listener = () => {\n waiter.endAsync(token);\n this.element.removeEventListener('close', listener);\n };\n this.element.addEventListener('close', listener);\n }\n\n // Make flyout dialog invisible using the native `close` method\n this.element.close();\n\n // Reset page `overflow` property\n if (this._body) {\n this._body.style.removeProperty('overflow');\n if (this._bodyInitialOverflowValue === '') {\n if (this._body.style.length === 0) {\n this._body.removeAttribute('style');\n }\n } else {\n this._body.style.setProperty(\n 'overflow',\n this._bodyInitialOverflowValue\n );\n }\n }\n\n // Return focus to a specific element (if provided)\n if (this.args.returnFocusTo) {\n const initiator = document.getElementById(this.args.returnFocusTo);\n if (initiator) {\n initiator.focus();\n }\n }\n }\n}\n"],"names":["waiter","buildWaiter","DEFAULT_SIZE","HdsFlyoutSizesValues","Medium","DEFAULT_HAS_OVERLAY","SIZES","Object","values","HdsFlyout","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","size","assert","join","includes","id","getElementId","classNames","classes","push","registerOnCloseCallback","event","onClose","_isOpen","didInsert","element","_body","document","body","_bodyInitialOverflowValue","style","getPropertyValue","addEventListener","open","willDestroyNode","removeEventListener","showModal","setProperty","onOpen","onDismiss","token","beginAsync","listener","endAsync","close","removeProperty","length","removeAttribute","returnFocusTo","initiator","getElementById","focus","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/components/hds/flyout/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFlyoutSizesValues {\n Medium = 'medium',\n Large = 'large',\n}\n\nexport type HdsFlyoutSizes = `${HdsFlyoutSizesValues}`;\n"],"names":["HdsFlyoutSizesValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,oBAAoB,0BAApBA,oBAAoB,EAAA;EAApBA,oBAAoB,CAAA,QAAA,CAAA,GAAA,QAAA
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/components/hds/flyout/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFlyoutSizesValues {\n Medium = 'medium',\n Large = 'large',\n}\n\nexport type HdsFlyoutSizes = `${HdsFlyoutSizesValues}`;\n"],"names":["HdsFlyoutSizesValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,oBAAoB,0BAApBA,oBAAoB,EAAA;EAApBA,oBAAoB,CAAA,QAAA,CAAA,GAAA,QAAA;EAApBA,oBAAoB,CAAA,OAAA,CAAA,GAAA,OAAA;AAAA,EAAA,OAApBA,oBAAoB;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/character-count/index.hbs","../../../../../src/components/hds/form/character-count/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n class={{this.classNames}}\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n aria-live=\\\"polite\\\"\\n>\\n {{#if (has-block)}}\\n {{yield\\n (hash\\n minLength=this.minLength\\n maxLength=this.maxLength\\n currentLength=this.currentLength\\n remaining=this.remaining\\n shortfall=this.shortfall\\n )\\n }}\\n {{else}}\\n {{this.message}}\\n {{/if}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\n\nconst ID_PREFIX = 'character-count-';\nconst NOOP = (): void => {};\n\nexport interface HdsFormCharacterCountSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n maxLength?: number | string;\n minLength?: number | string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n value?: string;\n };\n Blocks: {\n default?: [\n {\n minLength?: number;\n maxLength?: number;\n currentLength?: number;\n remaining?: number;\n shortfall?: number;\n },\n ];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFormCharacterCount extends Component<HdsFormCharacterCountSignature> {\n // The current number of characters in @value\n get currentLength(): number {\n const { value } = this.args;\n return value ? value.length : 0;\n }\n\n // Inflector utility function to determine plural or singular for 'character' noun\n private _pluralize(\n count?: number,\n prefix = '',\n noun = 'character',\n suffix = 's'\n ): string {\n return `${count}${prefix ? ' ' + prefix : ''} ${noun}${\n count !== 1 ? suffix : ''\n }`;\n }\n\n /**\n * @param maxLength\n * @type {number}\n * @default null\n * @description The maximum number of characters allowed.\n */\n get maxLength(): number | undefined {\n const { maxLength } = this.args;\n if (maxLength) {\n return typeof maxLength === 'number' ? maxLength : parseInt(maxLength);\n }\n }\n\n /**\n * @param minLength\n * @type {number}\n * @default null\n * @description The minimum number of characters allowed.\n */\n get minLength(): number | undefined {\n const { minLength } = this.args;\n if (minLength) {\n return typeof minLength === 'number' ? minLength : parseInt(minLength);\n }\n }\n\n /**\n * @param remaining\n * @type {number}\n * @default null\n * @description The remaining number of characters.\n */\n get remaining(): number | undefined {\n return this.maxLength ? this.maxLength - this.currentLength : undefined;\n }\n\n /**\n * @param shortfall\n * @type {number}\n * @default null\n * @description The number of characters the content is falling short of.\n */\n get shortfall(): number | undefined {\n return this.minLength ? this.minLength - this.currentLength : undefined;\n }\n\n /**\n * @param message\n * @type {string}\n * @default null\n * @description The character count message presented to users\n */\n get message(): string {\n let messageText = '';\n if (this.minLength && this.currentLength === 0) {\n messageText = `${this._pluralize(this.minLength)} required`;\n } else if (this.minLength && this.currentLength < this.minLength) {\n messageText = `${this._pluralize(this.shortfall, 'more')} required`;\n } else if (this.maxLength && this.currentLength === 0) {\n messageText = `${this._pluralize(this.maxLength)} allowed`;\n } else if (this.maxLength && this.currentLength <= this.maxLength) {\n messageText = `${this._pluralize(this.remaining)} remaining`;\n } else if (\n this.maxLength &&\n this.remaining &&\n this.currentLength > this.maxLength\n ) {\n messageText = `Exceeded by ${this._pluralize(-this.remaining)}`;\n } else {\n messageText = `${this._pluralize(this.currentLength)} entered`;\n }\n return messageText;\n }\n\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-character-count'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormCharacterCount","Component","currentLength","value","args","length","_pluralize","count","prefix","noun","suffix","maxLength","parseInt","minLength","remaining","undefined","shortfall","message","messageText","id","controlId","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,ijBAAijB;;ACDnlB;AACA;AACA;AACA;;AAKA,MAAMA,SAAS,GAAG,kBAAkB
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/character-count/index.hbs","../../../../../src/components/hds/form/character-count/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n class={{this.classNames}}\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n aria-live=\\\"polite\\\"\\n>\\n {{#if (has-block)}}\\n {{yield\\n (hash\\n minLength=this.minLength\\n maxLength=this.maxLength\\n currentLength=this.currentLength\\n remaining=this.remaining\\n shortfall=this.shortfall\\n )\\n }}\\n {{else}}\\n {{this.message}}\\n {{/if}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\n\nconst ID_PREFIX = 'character-count-';\nconst NOOP = (): void => {};\n\nexport interface HdsFormCharacterCountSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n maxLength?: number | string;\n minLength?: number | string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n value?: string;\n };\n Blocks: {\n default?: [\n {\n minLength?: number;\n maxLength?: number;\n currentLength?: number;\n remaining?: number;\n shortfall?: number;\n },\n ];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFormCharacterCount extends Component<HdsFormCharacterCountSignature> {\n // The current number of characters in @value\n get currentLength(): number {\n const { value } = this.args;\n return value ? value.length : 0;\n }\n\n // Inflector utility function to determine plural or singular for 'character' noun\n private _pluralize(\n count?: number,\n prefix = '',\n noun = 'character',\n suffix = 's'\n ): string {\n return `${count}${prefix ? ' ' + prefix : ''} ${noun}${\n count !== 1 ? suffix : ''\n }`;\n }\n\n /**\n * @param maxLength\n * @type {number}\n * @default null\n * @description The maximum number of characters allowed.\n */\n get maxLength(): number | undefined {\n const { maxLength } = this.args;\n if (maxLength) {\n return typeof maxLength === 'number' ? maxLength : parseInt(maxLength);\n }\n }\n\n /**\n * @param minLength\n * @type {number}\n * @default null\n * @description The minimum number of characters allowed.\n */\n get minLength(): number | undefined {\n const { minLength } = this.args;\n if (minLength) {\n return typeof minLength === 'number' ? minLength : parseInt(minLength);\n }\n }\n\n /**\n * @param remaining\n * @type {number}\n * @default null\n * @description The remaining number of characters.\n */\n get remaining(): number | undefined {\n return this.maxLength ? this.maxLength - this.currentLength : undefined;\n }\n\n /**\n * @param shortfall\n * @type {number}\n * @default null\n * @description The number of characters the content is falling short of.\n */\n get shortfall(): number | undefined {\n return this.minLength ? this.minLength - this.currentLength : undefined;\n }\n\n /**\n * @param message\n * @type {string}\n * @default null\n * @description The character count message presented to users\n */\n get message(): string {\n let messageText = '';\n if (this.minLength && this.currentLength === 0) {\n messageText = `${this._pluralize(this.minLength)} required`;\n } else if (this.minLength && this.currentLength < this.minLength) {\n messageText = `${this._pluralize(this.shortfall, 'more')} required`;\n } else if (this.maxLength && this.currentLength === 0) {\n messageText = `${this._pluralize(this.maxLength)} allowed`;\n } else if (this.maxLength && this.currentLength <= this.maxLength) {\n messageText = `${this._pluralize(this.remaining)} remaining`;\n } else if (\n this.maxLength &&\n this.remaining &&\n this.currentLength > this.maxLength\n ) {\n messageText = `Exceeded by ${this._pluralize(-this.remaining)}`;\n } else {\n messageText = `${this._pluralize(this.currentLength)} entered`;\n }\n return messageText;\n }\n\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-character-count'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormCharacterCount","Component","currentLength","value","args","length","_pluralize","count","prefix","noun","suffix","maxLength","parseInt","minLength","remaining","undefined","shortfall","message","messageText","id","controlId","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/checkbox/base.hbs","../../../../../src/components/hds/form/checkbox/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<input type=\\\"checkbox\\\" class=\\\"hds-form-checkbox\\\" ...attributes value={{@value}} />\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormCheckboxBaseSignature {\n Args: {\n value?: string;\n };\n Element: HTMLInputElement;\n}\n\nconst HdsFormCheckboxBase =\n templateOnlyComponent<HdsFormCheckboxBaseSignature>();\n\nexport default HdsFormCheckboxBase;\n"],"names":["HdsFormCheckboxBase","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,sKAAsK;;ACDxM;AACA;AACA;AACA;;AAWA,MAAMA,mBAAmB,GACvBC,qBAAqB,EAAgC
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/checkbox/base.hbs","../../../../../src/components/hds/form/checkbox/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<input type=\\\"checkbox\\\" class=\\\"hds-form-checkbox\\\" ...attributes value={{@value}} />\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormCheckboxBaseSignature {\n Args: {\n value?: string;\n };\n Element: HTMLInputElement;\n}\n\nconst HdsFormCheckboxBase =\n templateOnlyComponent<HdsFormCheckboxBaseSignature>();\n\nexport default HdsFormCheckboxBase;\n"],"names":["HdsFormCheckboxBase","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,sKAAsK;;ACDxM;AACA;AACA;AACA;;AAWA,MAAMA,mBAAmB,GACvBC,qBAAqB,EAAgC;AAEvD,WAAAC,oBAAA,CAAAC,QAAA,EAAeH,mBAAmB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/checkbox/field.hbs","../../../../../src/components/hds/form/checkbox/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"flag\\\"\\n @contextualClass={{@contextualClass}}\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::Checkbox::Base\\n @value={{@value}}\\n name={{@name}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormCheckboxFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'isOptional'> & {\n value?: string;\n name?: string;\n };\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormCheckboxField =\n templateOnlyComponent<HdsFormCheckboxFieldSignature>();\n\nexport default HdsFormCheckboxField;\n"],"names":["HdsFormCheckboxField","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,yrBAAyrB;;ACD3tB;AACA;AACA;AACA;;AA0BA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/checkbox/field.hbs","../../../../../src/components/hds/form/checkbox/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"flag\\\"\\n @contextualClass={{@contextualClass}}\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::Checkbox::Base\\n @value={{@value}}\\n name={{@name}}\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormCheckboxFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'isOptional'> & {\n value?: string;\n name?: string;\n };\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormCheckboxField =\n templateOnlyComponent<HdsFormCheckboxFieldSignature>();\n\nexport default HdsFormCheckboxField;\n"],"names":["HdsFormCheckboxField","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,yrBAAyrB;;ACD3tB;AACA;AACA;AACA;;AA0BA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC;AAExD,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sources":["../../../../../src/components/hds/form/checkbox/group.hbs","../../../../../src/components/hds/form/checkbox/group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Fieldset @layout={{@layout}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} ...attributes as |F|>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Fieldset\\\" component level }}\\n {{yield (hash Legend=F.Legend HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{yield\\n (hash\\n CheckboxField=(component\\n \\\"hds/form/checkbox/field\\\"\\n contextualClass=\\\"hds-form-group__control-field\\\"\\n isRequired=@isRequired\\n name=@name\\n extraAriaDescribedBy=F.ariaDescribedBy\\n )\\n )\\n }}\\n </F.Control>\\n</Hds::Form::Fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldsetSignature } from '../fieldset';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLegendSignature } from '../legend';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormCheckboxFieldSignature } from './field';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormCheckboxGroupSignature {\n Args: HdsFormFieldsetSignature['Args'] & {\n name?: string;\n };\n Blocks: {\n default: [\n {\n Legend?: ComponentLike<HdsFormLegendSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n CheckboxField?: ComponentLike<HdsFormCheckboxFieldSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldsetSignature['Element'];\n}\n\nconst HdsFormCheckboxGroup =\n templateOnlyComponent<HdsFormCheckboxGroupSignature>();\n\nexport default HdsFormCheckboxGroup;\n"],"names":["HdsFormCheckboxGroup","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,mvBAAmvB;;ACDrxB;AACA;AACA;AACA;;AA2BA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC
|
|
1
|
+
{"version":3,"file":"group.js","sources":["../../../../../src/components/hds/form/checkbox/group.hbs","../../../../../src/components/hds/form/checkbox/group.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Fieldset @layout={{@layout}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} ...attributes as |F|>\\n {{! Notice: the order of the elements is not relevant here, because it\\'s controlled at \\\"Hds::Form::Fieldset\\\" component level }}\\n {{yield (hash Legend=F.Legend HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n {{yield\\n (hash\\n CheckboxField=(component\\n \\\"hds/form/checkbox/field\\\"\\n contextualClass=\\\"hds-form-group__control-field\\\"\\n isRequired=@isRequired\\n name=@name\\n extraAriaDescribedBy=F.ariaDescribedBy\\n )\\n )\\n }}\\n </F.Control>\\n</Hds::Form::Fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { HdsFormFieldsetSignature } from '../fieldset';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormLegendSignature } from '../legend';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormCheckboxFieldSignature } from './field';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormCheckboxGroupSignature {\n Args: HdsFormFieldsetSignature['Args'] & {\n name?: string;\n };\n Blocks: {\n default: [\n {\n Legend?: ComponentLike<HdsFormLegendSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n CheckboxField?: ComponentLike<HdsFormCheckboxFieldSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldsetSignature['Element'];\n}\n\nconst HdsFormCheckboxGroup =\n templateOnlyComponent<HdsFormCheckboxGroupSignature>();\n\nexport default HdsFormCheckboxGroup;\n"],"names":["HdsFormCheckboxGroup","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,mvBAAmvB;;ACDrxB;AACA;AACA;AACA;;AA2BA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC;AAExD,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/error/index.hbs","../../../../../src/components/hds/form/error/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} {{will-destroy this.onRemove}} ...attributes>\\n <Hds::Icon class=\\\"hds-form-error__icon\\\" @name=\\\"alert-diamond-fill\\\" />\\n <Hds::Text::Body class=\\\"hds-form-error__content\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\">\\n {{yield (hash Message=(component \\\"hds/form/error/message\\\"))}}\\n </Hds::Text::Body>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorMessageSignature } from './message';\n\nexport const ID_PREFIX = 'error-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormErrorSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onRemove?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [\n {\n Message?: ComponentLike<HdsFormErrorMessageSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFormError extends Component<HdsFormErrorSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * @param onRemove\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onRemove(): (element: HTMLElement, ...args: any[]) => void {\n const { onRemove } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onRemove === 'function') {\n return onRemove;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-error'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormError","Component","id","controlId","args","onInsert","onRemove","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,6dAA6d;;ACD/f;AACA;AACA;AACA;;AAMO,MAAMA,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/error/index.hbs","../../../../../src/components/hds/form/error/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} id={{this.id}} {{did-insert this.onInsert}} {{will-destroy this.onRemove}} ...attributes>\\n <Hds::Icon class=\\\"hds-form-error__icon\\\" @name=\\\"alert-diamond-fill\\\" />\\n <Hds::Text::Body class=\\\"hds-form-error__content\\\" @tag=\\\"div\\\" @size=\\\"100\\\" @weight=\\\"medium\\\">\\n {{yield (hash Message=(component \\\"hds/form/error/message\\\"))}}\\n </Hds::Text::Body>\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormErrorMessageSignature } from './message';\n\nexport const ID_PREFIX = 'error-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormErrorSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onRemove?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [\n {\n Message?: ComponentLike<HdsFormErrorMessageSignature>;\n },\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class HdsFormError extends Component<HdsFormErrorSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * @param onRemove\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onRemove(): (element: HTMLElement, ...args: any[]) => void {\n const { onRemove } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onRemove === 'function') {\n return onRemove;\n } else {\n return NOOP;\n }\n }\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-error'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormError","Component","id","controlId","args","onInsert","onRemove","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,6dAA6d;;ACD/f;AACA;AACA;AACA;;AAMO,MAAMA,SAAS,GAAG;AAEzB,MAAMC,IAAI,GAAGA,MAAY,EAAE;AAqBZ,MAAMC,YAAY,SAASC,SAAS,CAAwB;AACzE;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAkB;IACtB,MAAM;AAAEC,MAAAA;KAAW,GAAG,IAAI,CAACC,IAAI;AAC/B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA;AACnC;AACA,IAAA,OAAO,IAAI;AACb;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIE,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA;KAAU,GAAG,IAAI,CAACD,IAAI;;AAE9B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI;AACb;AACF;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIO,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA;KAAU,GAAG,IAAI,CAACF,IAAI;;AAE9B;AACA,IAAA,IAAI,OAAOE,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ;AACjB,KAAC,MAAM;AACL,MAAA,OAAOP,IAAI;AACb;AACF;AACA;AACF;AACA;AACA;AACA;EACE,IAAIQ,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,gBAAgB,CAAC;;AAElC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACN,IAAI,CAACK,eAAe,CAAC;AACzC;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAhEoBb,YAAY,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sources":["../../../../../src/components/hds/form/error/message.hbs","../../../../../src/components/hds/form/error/message.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-form-error__message\\\" @tag=\\\"p\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport interface HdsFormErrorMessageSignature {\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nconst HdsFormErrorMessage =\n templateOnlyComponent<HdsFormErrorMessageSignature>();\n\nexport default HdsFormErrorMessage;\n"],"names":["HdsFormErrorMessage","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8NAA8N;;ACDhQ;AACA;AACA;AACA;;AAaA,MAAMA,mBAAmB,GACvBC,qBAAqB,EAAgC
|
|
1
|
+
{"version":3,"file":"message.js","sources":["../../../../../src/components/hds/form/error/message.hbs","../../../../../src/components/hds/form/error/message.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body class=\\\"hds-form-error__message\\\" @tag=\\\"p\\\" @size=\\\"100\\\" @weight=\\\"medium\\\" ...attributes>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport interface HdsFormErrorMessageSignature {\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nconst HdsFormErrorMessage =\n templateOnlyComponent<HdsFormErrorMessageSignature>();\n\nexport default HdsFormErrorMessage;\n"],"names":["HdsFormErrorMessage","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8NAA8N;;ACDhQ;AACA;AACA;AACA;;AAaA,MAAMA,mBAAmB,GACvBC,qBAAqB,EAAgC;AAEvD,cAAAC,oBAAA,CAAAC,QAAA,EAAeH,mBAAmB,CAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _applyDecoratedDescriptor } from '../../../../_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _applyDecoratedDescriptor } from '../../../../_rollupPluginBabelHelpers-C_TsMG3M.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { assert } from '@ember/debug';
|
|
4
4
|
import { action } from '@ember/object';
|
|
@@ -82,7 +82,7 @@ let HdsFormField = c((_class = class HdsFormField extends Component {
|
|
|
82
82
|
removeDescriptor(element) {
|
|
83
83
|
unregisterAriaDescriptionElement(this, element);
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, _applyDecoratedDescriptor(_class.prototype, "appendDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "appendDescriptor"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "removeDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "removeDescriptor"), _class.prototype), _class), [ariaDescribedBy]);
|
|
86
86
|
setComponentTemplate(TEMPLATE, HdsFormField);
|
|
87
87
|
|
|
88
88
|
export { LAYOUT_TYPES, HdsFormField as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/field/index.hbs","../../../../../src/components/hds/form/field/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} ...attributes>\\n {{yield\\n (hash\\n Label=(component\\n \\\"hds/form/label\\\"\\n controlId=this.id\\n isRequired=this.isRequired\\n isOptional=this.isOptional\\n contextualClass=\\\"hds-form-field__label\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-field__control\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n CharacterCount=(component\\n \\\"hds/form/character-count\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__character-count\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-field__error\\\"\\n )\\n )\\n }}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldLayoutValues } from './types.ts';\nimport HdsFormLabelComponent from '../label/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormCharacterCountComponent from '../character-count/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { HdsFormFieldLayouts } from './types.ts';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\nimport type { AriaDescribedByComponent } from '../../../../utils/hds-aria-described-by.ts';\n\nexport const LAYOUT_TYPES = Object.values(HdsFormFieldLayoutValues);\n\nexport interface HdsFormFieldSignature {\n Args: {\n id?: string;\n extraAriaDescribedBy?: string;\n contextualClass?: string;\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldLayouts;\n };\n Blocks: {\n default: [\n {\n Label?: WithBoundArgs<\n typeof HdsFormLabelComponent,\n 'contextualClass' | 'controlId' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n CharacterCount?: WithBoundArgs<\n typeof HdsFormCharacterCountComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedBy>' is not assignable to 'typeof HdsFormField'\n@ariaDescribedBy\nexport default class HdsFormField extends Component<HdsFormFieldSignature> {\n /**\n * Sets the layout of the field\n *\n * @param layout\n * @type {string}\n */\n get layout(): HdsFormFieldLayouts | undefined {\n const { layout } = this.args;\n\n assert(\n `@layout for \"Hds::Form::Field\" must be one of the following: ${LAYOUT_TYPES.join(\n ', '\n )}; received: ${layout}`,\n LAYOUT_TYPES.includes(layout as HdsFormFieldLayoutValues)\n );\n\n return layout;\n }\n\n /**\n * Calculates the unique ID to assign to the form control\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes: string[] = [];\n\n if (this.args.layout) {\n classes.push(`hds-form-field--layout-${this.layout}`);\n }\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n}\n"],"names":["LAYOUT_TYPES","Object","values","HdsFormFieldLayoutValues","HdsFormField","c","_class","Component","layout","args","assert","join","includes","id","getElementId","isRequired","isOptional","classNames","classes","push","contextualClass","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,gxCAAgxC;;;ACwB3yC,MAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/field/index.hbs","../../../../../src/components/hds/form/field/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<div class={{this.classNames}} ...attributes>\\n {{yield\\n (hash\\n Label=(component\\n \\\"hds/form/label\\\"\\n controlId=this.id\\n isRequired=this.isRequired\\n isOptional=this.isOptional\\n contextualClass=\\\"hds-form-field__label\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-field__control\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") id=this.id ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n CharacterCount=(component\\n \\\"hds/form/character-count\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-field__character-count\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-field__error\\\"\\n )\\n )\\n }}\\n</div>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldLayoutValues } from './types.ts';\nimport HdsFormLabelComponent from '../label/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormCharacterCountComponent from '../character-count/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { HdsFormFieldLayouts } from './types.ts';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\nimport type { AriaDescribedByComponent } from '../../../../utils/hds-aria-described-by.ts';\n\nexport const LAYOUT_TYPES = Object.values(HdsFormFieldLayoutValues);\n\nexport interface HdsFormFieldSignature {\n Args: {\n id?: string;\n extraAriaDescribedBy?: string;\n contextualClass?: string;\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldLayouts;\n };\n Blocks: {\n default: [\n {\n Label?: WithBoundArgs<\n typeof HdsFormLabelComponent,\n 'contextualClass' | 'controlId' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n CharacterCount?: WithBoundArgs<\n typeof HdsFormCharacterCountComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedBy>' is not assignable to 'typeof HdsFormField'\n@ariaDescribedBy\nexport default class HdsFormField extends Component<HdsFormFieldSignature> {\n /**\n * Sets the layout of the field\n *\n * @param layout\n * @type {string}\n */\n get layout(): HdsFormFieldLayouts | undefined {\n const { layout } = this.args;\n\n assert(\n `@layout for \"Hds::Form::Field\" must be one of the following: ${LAYOUT_TYPES.join(\n ', '\n )}; received: ${layout}`,\n LAYOUT_TYPES.includes(layout as HdsFormFieldLayoutValues)\n );\n\n return layout;\n }\n\n /**\n * Calculates the unique ID to assign to the form control\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes: string[] = [];\n\n if (this.args.layout) {\n classes.push(`hds-form-field--layout-${this.layout}`);\n }\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n}\n"],"names":["LAYOUT_TYPES","Object","values","HdsFormFieldLayoutValues","HdsFormField","c","_class","Component","layout","args","assert","join","includes","id","getElementId","isRequired","isOptional","classNames","classes","push","contextualClass","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,gxCAAgxC;;;ACwB3yC,MAAMA,YAAY,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB;AAuClE;AAEqBC,IAAAA,YAAY,GAAAC,CAAA,EAAAC,MAAA,GADjC,MACqBF,YAAY,SAASG,SAAS,CAAwB;AACzE;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,MAAMA,GAAoC;IAC5C,MAAM;AAAEA,MAAAA;KAAQ,GAAG,IAAI,CAACC,IAAI;AAE5BC,IAAAA,MAAM,CACJ,CAAgEV,6DAAAA,EAAAA,YAAY,CAACW,IAAI,CAC/E,IACF,CAAC,CAAA,YAAA,EAAeH,MAAM,CAAA,CAAE,EACxBR,YAAY,CAACY,QAAQ,CAACJ,MAAkC,CAC1D,CAAC;AAED,IAAA,OAAOA,MAAM;AACf;;AAEA;AACF;AACA;EACE,IAAIK,EAAEA,GAAW;IACf,OAAOC,YAAY,CAAC,IAAI,CAAC;AAC3B;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACM,UAAU,IAAI,KAAK;AACtC;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,UAAU,IAAI,KAAK;AACtC;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;IACvB,MAAMC,OAAiB,GAAG,EAAE;AAE5B,IAAA,IAAI,IAAI,CAACT,IAAI,CAACD,MAAM,EAAE;MACpBU,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACX,MAAM,EAAE,CAAC;AACvD;;AAEA;AACA;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACW,eAAe,EAAE;MAC7BF,OAAO,CAACC,IAAI,CAAC,IAAI,CAACV,IAAI,CAACW,eAAe,CAAC;AACzC;AAEA,IAAA,OAAOF,OAAO,CAACP,IAAI,CAAC,GAAG,CAAC;AAC1B;EAGAU,gBAAgBA,CAACC,OAAoB,EAAQ;AAC3CC,IAAAA,8BAA8B,CAAC,IAAI,EAA8BD,OAAO,CAAC;AAC3E;EAEQE,gBAAgBA,CAACF,OAAoB,EAAQ;AACnDG,IAAAA,gCAAgC,CAAC,IAAI,EAA8BH,OAAO,CAAC;AAC7E;AACF,CAAC,EAAAI,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,uBAREC,MAAM,CAAA,EAAA3B,MAAA,CAAA4B,wBAAA,CAAAvB,MAAA,CAAAqB,SAAA,EAAArB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAqB,SAAA,CAAA,EAAAD,yBAAA,CAAApB,MAAA,CAAAqB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAA3B,EAAAA,MAAA,CAAA4B,wBAAA,CAAAvB,MAAA,CAAAqB,SAAA,uBAAArB,MAAA,CAAAqB,SAAA,CAAArB,EAAAA,MAAA,IAxERwB,eAAe,CAAA;AACiBC,oBAAA,CAAAC,QAAA,EAAZ5B,YAAY,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/field/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldLayoutValues {\n Vertical = 'vertical',\n Flag = 'flag',\n}\n\nexport type HdsFormFieldLayouts = `${HdsFormFieldLayoutValues}`;\n"],"names":["HdsFormFieldLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,wBAAwB,0BAAxBA,wBAAwB,EAAA;EAAxBA,wBAAwB,CAAA,UAAA,CAAA,GAAA,UAAA
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/field/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldLayoutValues {\n Vertical = 'vertical',\n Flag = 'flag',\n}\n\nexport type HdsFormFieldLayouts = `${HdsFormFieldLayoutValues}`;\n"],"names":["HdsFormFieldLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,wBAAwB,0BAAxBA,wBAAwB,EAAA;EAAxBA,wBAAwB,CAAA,UAAA,CAAA,GAAA,UAAA;EAAxBA,wBAAwB,CAAA,MAAA,CAAA,GAAA,MAAA;AAAA,EAAA,OAAxBA,wBAAwB;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as _applyDecoratedDescriptor } from '../../../../_rollupPluginBabelHelpers-
|
|
1
|
+
import { _ as _applyDecoratedDescriptor } from '../../../../_rollupPluginBabelHelpers-C_TsMG3M.js';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { getElementId } from '../../../../utils/hds-get-element-id.js';
|
|
@@ -71,7 +71,7 @@ let HdsFormFieldset = c((_class = class HdsFormFieldset extends Component {
|
|
|
71
71
|
removeDescriptor(element) {
|
|
72
72
|
unregisterAriaDescriptionElement(this, element);
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, _applyDecoratedDescriptor(_class.prototype, "appendDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "appendDescriptor"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "removeDescriptor", [action], Object.getOwnPropertyDescriptor(_class.prototype, "removeDescriptor"), _class.prototype), _class), [ariaDescribedBy]);
|
|
75
75
|
setComponentTemplate(TEMPLATE, HdsFormFieldset);
|
|
76
76
|
|
|
77
77
|
export { HdsFormFieldset as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/fieldset/index.hbs","../../../../../src/components/hds/form/fieldset/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\\n {{yield\\n (hash\\n Legend=(component\\n \\\"hds/form/legend\\\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\\\"hds-form-group__legend\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-group__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-group__control-fields-wrapper\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-group__error\\\"\\n )\\n )\\n }}\\n</fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldsetLayoutValues } from './types.ts';\nimport HdsFormLegendComponent from '../legend/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormFieldsetLayouts } from './types.ts';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\nimport type { AriaDescribedByComponent } from '../../../../utils/hds-aria-described-by.ts';\n\nexport interface HdsFormFieldsetSignature {\n Args: {\n extraAriaDescribedBy?: string;\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldsetLayouts;\n };\n Blocks: {\n default: [\n {\n Legend?: WithBoundArgs<\n typeof HdsFormLegendComponent,\n 'contextualClass' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'\n@ariaDescribedBy\nexport default class HdsFormFieldset extends Component<HdsFormFieldsetSignature> {\n /**\n * Sets the layout of the group\n *\n * @param layout\n * @type {enum}\n * @default 'vertical'\n */\n get layout(): HdsFormFieldsetLayouts {\n return this.args.layout ?? HdsFormFieldsetLayoutValues.Vertical;\n }\n\n /**\n * Calculates the unique ID to assign to the fieldset\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n // we just need a class for the layout\n const classes = ['hds-form-group'];\n\n // add a class based on the @layout argument\n classes.push(`hds-form-group--layout-${this.layout}`);\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n}\n"],"names":["HdsFormFieldset","c","_class","Component","layout","args","HdsFormFieldsetLayoutValues","Vertical","id","getElementId","isRequired","isOptional","classNames","classes","push","join","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,ugCAAugC;;;ACqDziC;AAEqBA,IAAAA,eAAe,GAAAC,CAAA,EAAAC,MAAA,GADpC,MACqBF,eAAe,SAASG,SAAS,CAA2B;AAC/E;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,MAAMA,GAA2B;IACnC,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAIE,2BAA2B,CAACC,QAAQ
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/fieldset/index.hbs","../../../../../src/components/hds/form/fieldset/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<fieldset class={{this.classNames}} id={{this.id}} ...attributes>\\n {{yield\\n (hash\\n Legend=(component\\n \\\"hds/form/legend\\\" isRequired=this.isRequired isOptional=this.isOptional contextualClass=\\\"hds-form-group__legend\\\"\\n )\\n )\\n }}\\n {{yield\\n (hash\\n HelperText=(component\\n \\\"hds/form/helper-text\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n contextualClass=\\\"hds-form-group__helper-text\\\"\\n )\\n )\\n }}\\n <div class=\\\"hds-form-group__control-fields-wrapper\\\">\\n {{! @glint-expect-error }}\\n {{yield (hash Control=(component \\\"hds/yield\\\") ariaDescribedBy=this.ariaDescribedBy)}}\\n </div>\\n {{yield\\n (hash\\n Error=(component\\n \\\"hds/form/error\\\"\\n controlId=this.id\\n onInsert=this.appendDescriptor\\n onRemove=this.removeDescriptor\\n contextualClass=\\\"hds-form-group__error\\\"\\n )\\n )\\n }}\\n</fieldset>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getElementId } from '../../../../utils/hds-get-element-id.ts';\nimport {\n ariaDescribedBy,\n registerAriaDescriptionElement,\n unregisterAriaDescriptionElement,\n} from '../../../../utils/hds-aria-described-by.ts';\nimport { HdsFormFieldsetLayoutValues } from './types.ts';\nimport HdsFormLegendComponent from '../legend/index.ts';\nimport HdsFormHelperTextComponent from '../helper-text/index.ts';\nimport HdsFormErrorComponent from '../error/index.ts';\n\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\nimport type { HdsFormFieldsetLayouts } from './types.ts';\nimport type { HdsYieldSignature } from '../../yield/index.ts';\nimport type { AriaDescribedByComponent } from '../../../../utils/hds-aria-described-by.ts';\n\nexport interface HdsFormFieldsetSignature {\n Args: {\n extraAriaDescribedBy?: string;\n isOptional?: boolean;\n isRequired?: boolean;\n layout?: HdsFormFieldsetLayouts;\n };\n Blocks: {\n default: [\n {\n Legend?: WithBoundArgs<\n typeof HdsFormLegendComponent,\n 'contextualClass' | 'isRequired' | 'isOptional'\n >;\n HelperText?: WithBoundArgs<\n typeof HdsFormHelperTextComponent,\n 'contextualClass' | 'controlId' | 'onInsert'\n >;\n Control?: ComponentLike<HdsYieldSignature>;\n Error?: WithBoundArgs<\n typeof HdsFormErrorComponent,\n 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'\n >;\n id?: string;\n ariaDescribedBy?: string;\n },\n ];\n };\n Element: HTMLElement;\n}\n\n// @ts-expect-error: decorator function return type 'ClassOf<AriaDescribedByComponent>' is not assignable to 'typeof HdsFormFieldComponent'\n@ariaDescribedBy\nexport default class HdsFormFieldset extends Component<HdsFormFieldsetSignature> {\n /**\n * Sets the layout of the group\n *\n * @param layout\n * @type {enum}\n * @default 'vertical'\n */\n get layout(): HdsFormFieldsetLayouts {\n return this.args.layout ?? HdsFormFieldsetLayoutValues.Vertical;\n }\n\n /**\n * Calculates the unique ID to assign to the fieldset\n */\n get id(): string {\n return getElementId(this);\n }\n\n /**\n * @param isRequired\n * @type {boolean}\n * @default false\n */\n get isRequired(): boolean {\n return this.args.isRequired || false;\n }\n\n /**\n * @param isOptional\n * @type {boolean}\n * @default false\n */\n get isOptional(): boolean {\n return this.args.isOptional || false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n // we just need a class for the layout\n const classes = ['hds-form-group'];\n\n // add a class based on the @layout argument\n classes.push(`hds-form-group--layout-${this.layout}`);\n\n return classes.join(' ');\n }\n\n @action\n appendDescriptor(element: HTMLElement): void {\n registerAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n\n @action removeDescriptor(element: HTMLElement): void {\n unregisterAriaDescriptionElement(this as AriaDescribedByComponent, element);\n }\n}\n"],"names":["HdsFormFieldset","c","_class","Component","layout","args","HdsFormFieldsetLayoutValues","Vertical","id","getElementId","isRequired","isOptional","classNames","classes","push","join","appendDescriptor","element","registerAriaDescriptionElement","removeDescriptor","unregisterAriaDescriptionElement","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","ariaDescribedBy","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;;;;;;AACA,eAAe,kBAAkB,CAAC,ugCAAugC;;;ACqDziC;AAEqBA,IAAAA,eAAe,GAAAC,CAAA,EAAAC,MAAA,GADpC,MACqBF,eAAe,SAASG,SAAS,CAA2B;AAC/E;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,MAAMA,GAA2B;IACnC,OAAO,IAAI,CAACC,IAAI,CAACD,MAAM,IAAIE,2BAA2B,CAACC,QAAQ;AACjE;;AAEA;AACF;AACA;EACE,IAAIC,EAAEA,GAAW;IACf,OAAOC,YAAY,CAAC,IAAI,CAAC;AAC3B;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACL,IAAI,CAACK,UAAU,IAAI,KAAK;AACtC;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAY;AACxB,IAAA,OAAO,IAAI,CAACN,IAAI,CAACM,UAAU,IAAI,KAAK;AACtC;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB;AACA,IAAA,MAAMC,OAAO,GAAG,CAAC,gBAAgB,CAAC;;AAElC;IACAA,OAAO,CAACC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACV,MAAM,EAAE,CAAC;AAErD,IAAA,OAAOS,OAAO,CAACE,IAAI,CAAC,GAAG,CAAC;AAC1B;EAGAC,gBAAgBA,CAACC,OAAoB,EAAQ;AAC3CC,IAAAA,8BAA8B,CAAC,IAAI,EAA8BD,OAAO,CAAC;AAC3E;EAEQE,gBAAgBA,CAACF,OAAoB,EAAQ;AACnDG,IAAAA,gCAAgC,CAAC,IAAI,EAA8BH,OAAO,CAAC;AAC7E;AACF,CAAC,EAAAI,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,uBAREC,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAvB,MAAA,CAAAoB,SAAA,EAAApB,kBAAAA,CAAAA,EAAAA,MAAA,CAAAoB,SAAA,CAAA,EAAAD,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,EAAA,kBAAA,EAAA,CAKNC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAvB,MAAA,CAAAoB,SAAA,uBAAApB,MAAA,CAAAoB,SAAA,CAAApB,EAAAA,MAAA,IA1DRwB,eAAe,CAAA;AACoBC,oBAAA,CAAAC,QAAA,EAAf5B,eAAe,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/fieldset/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldsetLayoutValues {\n Vertical = 'vertical',\n Horizontal = 'horizontal',\n}\n\nexport type HdsFormFieldsetLayouts = `${HdsFormFieldsetLayoutValues}`;\n"],"names":["HdsFormFieldsetLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,2BAA2B,0BAA3BA,2BAA2B,EAAA;EAA3BA,2BAA2B,CAAA,UAAA,CAAA,GAAA,UAAA
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../src/components/hds/form/fieldset/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsFormFieldsetLayoutValues {\n Vertical = 'vertical',\n Horizontal = 'horizontal',\n}\n\nexport type HdsFormFieldsetLayouts = `${HdsFormFieldsetLayoutValues}`;\n"],"names":["HdsFormFieldsetLayoutValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,2BAA2B,0BAA3BA,2BAA2B,EAAA;EAA3BA,2BAA2B,CAAA,UAAA,CAAA,GAAA,UAAA;EAA3BA,2BAA2B,CAAA,YAAA,CAAA,GAAA,YAAA;AAAA,EAAA,OAA3BA,2BAA2B;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/file-input/base.hbs","../../../../../src/components/hds/form/file-input/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<input class=\\\"hds-form-file-input hds-typography-body-200\\\" ...attributes type=\\\"file\\\" />\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormFileInputBaseSignature {\n Element: HTMLInputElement;\n}\n\nconst HdsFormFileInputBase =\n templateOnlyComponent<HdsFormFileInputBaseSignature>();\n\nexport default HdsFormFileInputBase;\n"],"names":["HdsFormFileInputBase","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,2KAA2K;;ACD7M;AACA;AACA;AACA;;AAQA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/file-input/base.hbs","../../../../../src/components/hds/form/file-input/base.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<input class=\\\"hds-form-file-input hds-typography-body-200\\\" ...attributes type=\\\"file\\\" />\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\n\nexport interface HdsFormFileInputBaseSignature {\n Element: HTMLInputElement;\n}\n\nconst HdsFormFileInputBase =\n templateOnlyComponent<HdsFormFileInputBaseSignature>();\n\nexport default HdsFormFileInputBase;\n"],"names":["HdsFormFileInputBase","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,2KAA2K;;ACD7M;AACA;AACA;AACA;;AAQA,MAAMA,oBAAoB,GACxBC,qBAAqB,EAAiC;AAExD,WAAAC,oBAAA,CAAAC,QAAA,EAAeH,oBAAoB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/file-input/field.hbs","../../../../../src/components/hds/form/file-input/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::FileInput::Base\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormFileInputFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'>;\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormFileInputField =\n templateOnlyComponent<HdsFormFileInputFieldSignature>();\n\nexport default HdsFormFileInputField;\n"],"names":["HdsFormFileInputField","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iqBAAiqB;;ACDnsB;AACA;AACA;AACA;;AAuBA,MAAMA,qBAAqB,GACzBC,qBAAqB,EAAkC
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/file-input/field.hbs","../../../../../src/components/hds/form/file-input/field.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Form::Field\\n @layout=\\\"vertical\\\"\\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\\n @isRequired={{@isRequired}}\\n @isOptional={{@isOptional}}\\n @id={{@id}}\\n as |F|\\n>\\n {{! Notice: the order of the elements is not relevant here, because is controlled at \\\"Hds::Form::Field\\\" component level }}\\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\\n <F.Control>\\n <Hds::Form::FileInput::Base\\n required={{@isRequired}}\\n ...attributes\\n id={{F.id}}\\n aria-describedby={{F.ariaDescribedBy}}\\n />\\n </F.Control>\\n</Hds::Form::Field>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport templateOnlyComponent from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsFormFieldSignature } from '../field';\nimport type { HdsFormLabelSignature } from '../label';\nimport type { HdsFormHelperTextSignature } from '../helper-text';\nimport type { HdsFormErrorSignature } from '../error';\n\nexport interface HdsFormFileInputFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'>;\n Blocks: {\n default: [\n {\n Label?: ComponentLike<HdsFormLabelSignature>;\n HelperText?: ComponentLike<HdsFormHelperTextSignature>;\n Error?: ComponentLike<HdsFormErrorSignature>;\n },\n ];\n };\n Element: HdsFormFieldSignature['Element'];\n}\n\nconst HdsFormFileInputField =\n templateOnlyComponent<HdsFormFileInputFieldSignature>();\n\nexport default HdsFormFileInputField;\n"],"names":["HdsFormFileInputField","templateOnlyComponent","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iqBAAiqB;;ACDnsB;AACA;AACA;AACA;;AAuBA,MAAMA,qBAAqB,GACzBC,qBAAqB,EAAkC;AAEzD,YAAAC,oBAAA,CAAAC,QAAA,EAAeH,qBAAqB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/helper-text/index.hbs","../../../../../src/components/hds/form/helper-text/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n class={{this.classNames}}\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"regular\\\"\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport const ID_PREFIX = 'helper-text-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormHelperTextSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFormHelperText extends Component<HdsFormHelperTextSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-helper-text'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormHelperText","Component","id","controlId","args","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,4RAA4R;;ACD9T;AACA;AACA;AACA;;AAKO,MAAMA,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/helper-text/index.hbs","../../../../../src/components/hds/form/helper-text/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Text::Body\\n class={{this.classNames}}\\n @tag=\\\"div\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"regular\\\"\\n id={{this.id}}\\n {{did-insert this.onInsert}}\\n ...attributes\\n>\\n {{yield}}\\n</Hds::Text::Body>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\n\nexport const ID_PREFIX = 'helper-text-';\n\nconst NOOP = (): void => {};\n\nexport interface HdsFormHelperTextSignature {\n Args: {\n contextualClass?: string;\n controlId?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onInsert?: (element: HTMLElement, ...args: any[]) => void;\n };\n Blocks: {\n default: [];\n };\n Element: HdsTextBodySignature['Element'];\n}\n\nexport default class HdsFormHelperText extends Component<HdsFormHelperTextSignature> {\n /**\n * Determines the unique ID to assign to the element\n * @method id\n * @return {(string|null)} The \"id\" attribute to apply to the element or null, if no controlId is provided\n */\n get id(): string | null {\n const { controlId } = this.args;\n if (controlId) {\n return `${ID_PREFIX}${controlId}`;\n }\n return null;\n }\n\n /**\n * @param onInsert\n * @type {function}\n * @default () => {}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get onInsert(): (element: HTMLElement, ...args: any[]) => void {\n const { onInsert } = this.args;\n\n // notice: this is a guard used to prevent triggering an error when the component is used as standalone element\n if (typeof onInsert === 'function') {\n return onInsert;\n } else {\n return NOOP;\n }\n }\n\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-helper-text'];\n\n // add a class based on the @contextualClass argument\n // notice: this will *not* be documented for public use\n // the reason for this is that the contextual component declarations don't pass attributes to the component\n if (this.args.contextualClass) {\n classes.push(this.args.contextualClass);\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ID_PREFIX","NOOP","HdsFormHelperText","Component","id","controlId","args","onInsert","classNames","classes","contextualClass","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,4RAA4R;;ACD9T;AACA;AACA;AACA;;AAKO,MAAMA,SAAS,GAAG;AAEzB,MAAMC,IAAI,GAAGA,MAAY,EAAE;AAeZ,MAAMC,iBAAiB,SAASC,SAAS,CAA6B;AACnF;AACF;AACA;AACA;AACA;EACE,IAAIC,EAAEA,GAAkB;IACtB,MAAM;AAAEC,MAAAA;KAAW,GAAG,IAAI,CAACC,IAAI;AAC/B,IAAA,IAAID,SAAS,EAAE;AACb,MAAA,OAAO,CAAGL,EAAAA,SAAS,CAAGK,EAAAA,SAAS,CAAE,CAAA;AACnC;AACA,IAAA,OAAO,IAAI;AACb;;AAEA;AACF;AACA;AACA;AACA;AACE;EACA,IAAIE,QAAQA,GAAmD;IAC7D,MAAM;AAAEA,MAAAA;KAAU,GAAG,IAAI,CAACD,IAAI;;AAE9B;AACA,IAAA,IAAI,OAAOC,QAAQ,KAAK,UAAU,EAAE;AAClC,MAAA,OAAOA,QAAQ;AACjB,KAAC,MAAM;AACL,MAAA,OAAON,IAAI;AACb;AACF;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIO,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,sBAAsB,CAAC;;AAExC;AACA;AACA;AACA,IAAA,IAAI,IAAI,CAACH,IAAI,CAACI,eAAe,EAAE;MAC7BD,OAAO,CAACE,IAAI,CAAC,IAAI,CAACL,IAAI,CAACI,eAAe,CAAC;AACzC;AAEA,IAAA,OAAOD,OAAO,CAACG,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAhDoBZ,iBAAiB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/indicator/index.hbs","../../../../../src/components/hds/form/indicator/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @isOptional}}\\n <Hds::Text::Body class={{this.classNames}} tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"regular\\\">(Optional)</Hds::Text::Body>\\n{{/if}}\\n{{#if @isRequired}}\\n <Hds::Badge aria-hidden=\\\"true\\\" class={{this.classNames}} @size=\\\"small\\\" @color=\\\"neutral\\\" @text=\\\"Required\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\nimport type { HdsBadgeSignature } from '../../badge';\n\nexport interface HdsFormIndicatorSignature {\n Args: {\n isOptional?: boolean;\n isRequired?: boolean;\n };\n Element: HdsTextBodySignature['Element'] | HdsBadgeSignature['Element'];\n}\n\nexport default class HdsFormIndicator extends Component<HdsFormIndicatorSignature> {\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-indicator'];\n\n if (this.args.isOptional) {\n // add speficic class for \"optional\" indicator\n classes.push('hds-form-indicator--optional');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormIndicator","Component","classNames","classes","args","isOptional","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iYAAiY;;ACDna;AACA;AACA;AACA;;AAce,MAAMA,gBAAgB,SAASC,SAAS,CAA4B;AACjF;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,oBAAoB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/form/indicator/index.hbs","../../../../../src/components/hds/form/indicator/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n{{#if @isOptional}}\\n <Hds::Text::Body class={{this.classNames}} tag=\\\"span\\\" @size=\\\"100\\\" @weight=\\\"regular\\\">(Optional)</Hds::Text::Body>\\n{{/if}}\\n{{#if @isRequired}}\\n <Hds::Badge aria-hidden=\\\"true\\\" class={{this.classNames}} @size=\\\"small\\\" @color=\\\"neutral\\\" @text=\\\"Required\\\" />\\n{{/if}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport type { HdsTextBodySignature } from '../../text/body';\nimport type { HdsBadgeSignature } from '../../badge';\n\nexport interface HdsFormIndicatorSignature {\n Args: {\n isOptional?: boolean;\n isRequired?: boolean;\n };\n Element: HdsTextBodySignature['Element'] | HdsBadgeSignature['Element'];\n}\n\nexport default class HdsFormIndicator extends Component<HdsFormIndicatorSignature> {\n /**\n * Get the class names to apply to the component.\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames(): string {\n const classes = ['hds-form-indicator'];\n\n if (this.args.isOptional) {\n // add speficic class for \"optional\" indicator\n classes.push('hds-form-indicator--optional');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsFormIndicator","Component","classNames","classes","args","isOptional","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,iYAAiY;;ACDna;AACA;AACA;AACA;;AAce,MAAMA,gBAAgB,SAASC,SAAS,CAA4B;AACjF;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAW;AACvB,IAAA,MAAMC,OAAO,GAAG,CAAC,oBAAoB,CAAC;AAEtC,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,UAAU,EAAE;AACxB;AACAF,MAAAA,OAAO,CAACG,IAAI,CAAC,8BAA8B,CAAC;AAC9C;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACC,oBAAA,CAAAC,QAAA,EAhBoBT,gBAAgB,CAAA;;;;"}
|