@hashicorp/design-system-components 3.6.0 → 4.0.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/README.md +2 -0
- package/addon-main.js +7 -0
- package/dist/LICENSE.md +375 -0
- package/dist/README.md +69 -0
- package/dist/_app_/components/hds/accordion/index.js +1 -0
- package/dist/_app_/components/hds/accordion/item/button.js +1 -0
- package/dist/_app_/components/hds/accordion/item/index.js +1 -0
- package/dist/_app_/components/hds/alert/description.js +1 -0
- package/dist/_app_/components/hds/alert/index.js +1 -0
- package/dist/_app_/components/hds/alert/title.js +1 -0
- package/dist/_app_/components/hds/app-footer/copyright.js +1 -0
- package/dist/_app_/components/hds/app-footer/index.js +1 -0
- package/dist/_app_/components/hds/app-footer/item.js +1 -0
- package/dist/_app_/components/hds/app-footer/legal-links.js +1 -0
- package/dist/_app_/components/hds/app-footer/link.js +1 -0
- package/dist/_app_/components/hds/app-footer/status-link.js +1 -0
- package/dist/_app_/components/hds/app-frame/index.js +1 -0
- package/dist/_app_/components/hds/app-frame/parts/footer.js +1 -0
- package/dist/_app_/components/hds/app-frame/parts/header.js +1 -0
- package/dist/_app_/components/hds/app-frame/parts/main.js +1 -0
- package/dist/_app_/components/hds/app-frame/parts/modals.js +1 -0
- package/dist/_app_/components/hds/app-frame/parts/sidebar.js +1 -0
- package/dist/_app_/components/hds/application-state/body.js +1 -0
- package/dist/_app_/components/hds/application-state/footer.js +1 -0
- package/dist/_app_/components/hds/application-state/header.js +1 -0
- package/dist/_app_/components/hds/application-state/index.js +1 -0
- package/dist/_app_/components/hds/badge/index.js +1 -0
- package/dist/_app_/components/hds/badge-count/index.js +1 -0
- package/dist/_app_/components/hds/breadcrumb/index.js +1 -0
- package/dist/_app_/components/hds/breadcrumb/item.js +1 -0
- package/dist/_app_/components/hds/breadcrumb/truncation.js +1 -0
- package/dist/_app_/components/hds/button/index.js +1 -0
- package/dist/_app_/components/hds/button-set/index.js +1 -0
- package/dist/_app_/components/hds/card/container.js +1 -0
- package/dist/_app_/components/hds/code-block/copy-button.js +1 -0
- package/dist/_app_/components/hds/code-block/description.js +1 -0
- package/dist/_app_/components/hds/code-block/index.js +1 -0
- package/dist/_app_/components/hds/code-block/title.js +1 -0
- package/dist/_app_/components/hds/copy/button/index.js +1 -0
- package/dist/_app_/components/hds/copy/snippet/index.js +1 -0
- package/dist/_app_/components/hds/disclosure-primitive/index.js +1 -0
- package/dist/_app_/components/hds/dismiss-button/index.js +1 -0
- package/dist/_app_/components/hds/dropdown/footer.js +1 -0
- package/dist/_app_/components/hds/dropdown/header.js +1 -0
- package/dist/_app_/components/hds/dropdown/index.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/checkbox.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/checkmark.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/copy-item.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/description.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/generic.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/interactive.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/radio.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/separator.js +1 -0
- package/dist/_app_/components/hds/dropdown/list-item/title.js +1 -0
- package/dist/_app_/components/hds/dropdown/toggle/button.js +1 -0
- package/dist/_app_/components/hds/dropdown/toggle/chevron.js +1 -0
- package/dist/_app_/components/hds/dropdown/toggle/icon.js +1 -0
- package/dist/_app_/components/hds/flyout/body.js +1 -0
- package/dist/_app_/components/hds/flyout/description.js +1 -0
- package/dist/_app_/components/hds/flyout/footer.js +1 -0
- package/dist/_app_/components/hds/flyout/header.js +1 -0
- package/dist/_app_/components/hds/flyout/index.js +1 -0
- package/dist/_app_/components/hds/form/character-count/index.js +1 -0
- package/dist/_app_/components/hds/form/checkbox/base.js +1 -0
- package/dist/_app_/components/hds/form/checkbox/field.js +1 -0
- package/dist/_app_/components/hds/form/checkbox/group.js +1 -0
- package/dist/_app_/components/hds/form/error/index.js +1 -0
- package/dist/_app_/components/hds/form/error/message.js +1 -0
- package/dist/_app_/components/hds/form/field/index.js +1 -0
- package/dist/_app_/components/hds/form/fieldset/index.js +1 -0
- package/dist/_app_/components/hds/form/file-input/base.js +1 -0
- package/dist/_app_/components/hds/form/file-input/field.js +1 -0
- package/dist/_app_/components/hds/form/helper-text/index.js +1 -0
- package/dist/_app_/components/hds/form/indicator/index.js +1 -0
- package/dist/_app_/components/hds/form/label/index.js +1 -0
- package/dist/_app_/components/hds/form/legend/index.js +1 -0
- package/dist/_app_/components/hds/form/masked-input/base.js +1 -0
- package/dist/_app_/components/hds/form/masked-input/field.js +1 -0
- package/dist/_app_/components/hds/form/radio/base.js +1 -0
- package/dist/_app_/components/hds/form/radio/field.js +1 -0
- package/dist/_app_/components/hds/form/radio/group.js +1 -0
- package/dist/_app_/components/hds/form/radio-card/description.js +1 -0
- package/dist/_app_/components/hds/form/radio-card/group.js +1 -0
- package/dist/_app_/components/hds/form/radio-card/index.js +1 -0
- package/dist/_app_/components/hds/form/radio-card/label.js +1 -0
- package/dist/_app_/components/hds/form/select/base.js +1 -0
- package/dist/_app_/components/hds/form/select/field.js +1 -0
- package/dist/_app_/components/hds/form/text-input/base.js +1 -0
- package/dist/_app_/components/hds/form/text-input/field.js +1 -0
- package/dist/_app_/components/hds/form/textarea/base.js +1 -0
- package/dist/_app_/components/hds/form/textarea/field.js +1 -0
- package/dist/_app_/components/hds/form/toggle/base.js +1 -0
- package/dist/_app_/components/hds/form/toggle/field.js +1 -0
- package/dist/_app_/components/hds/form/toggle/group.js +1 -0
- package/dist/_app_/components/hds/form/visibility-toggle/index.js +1 -0
- package/dist/_app_/components/hds/icon-tile/index.js +1 -0
- package/dist/_app_/components/hds/interactive/index.js +1 -0
- package/dist/_app_/components/hds/link/inline.js +1 -0
- package/dist/_app_/components/hds/link/standalone.js +1 -0
- package/dist/_app_/components/hds/menu-primitive/index.js +1 -0
- package/dist/_app_/components/hds/modal/body.js +1 -0
- package/dist/_app_/components/hds/modal/footer.js +1 -0
- package/dist/_app_/components/hds/modal/header.js +1 -0
- package/dist/_app_/components/hds/modal/index.js +1 -0
- package/dist/_app_/components/hds/page-header/actions.js +1 -0
- package/dist/_app_/components/hds/page-header/badges.js +1 -0
- package/dist/_app_/components/hds/page-header/description.js +1 -0
- package/dist/_app_/components/hds/page-header/index.js +1 -0
- package/dist/_app_/components/hds/page-header/subtitle.js +1 -0
- package/dist/_app_/components/hds/page-header/title.js +1 -0
- package/dist/_app_/components/hds/pagination/compact/index.js +1 -0
- package/dist/_app_/components/hds/pagination/info/index.js +1 -0
- package/dist/_app_/components/hds/pagination/nav/arrow.js +1 -0
- package/dist/_app_/components/hds/pagination/nav/ellipsis.js +1 -0
- package/dist/_app_/components/hds/pagination/nav/number.js +1 -0
- package/dist/_app_/components/hds/pagination/numbered/index.js +1 -0
- package/dist/_app_/components/hds/pagination/size-selector/index.js +1 -0
- package/dist/_app_/components/hds/reveal/index.js +1 -0
- package/dist/_app_/components/hds/reveal/toggle/button.js +1 -0
- package/dist/_app_/components/hds/segmented-group/index.js +1 -0
- package/dist/_app_/components/hds/separator/index.js +1 -0
- package/dist/_app_/components/hds/side-nav/base.js +1 -0
- package/dist/_app_/components/hds/side-nav/header/home-link.js +1 -0
- package/dist/_app_/components/hds/side-nav/header/icon-button.js +1 -0
- package/dist/_app_/components/hds/side-nav/header/index.js +1 -0
- package/dist/_app_/components/hds/side-nav/index.js +1 -0
- package/dist/_app_/components/hds/side-nav/list/back-link.js +1 -0
- package/dist/_app_/components/hds/side-nav/list/index.js +1 -0
- package/dist/_app_/components/hds/side-nav/list/item.js +1 -0
- package/dist/_app_/components/hds/side-nav/list/link.js +1 -0
- package/dist/_app_/components/hds/side-nav/list/title.js +1 -0
- package/dist/_app_/components/hds/side-nav/portal/index.js +1 -0
- package/dist/_app_/components/hds/side-nav/portal/target.js +1 -0
- package/dist/_app_/components/hds/side-nav/toggle-button.js +1 -0
- package/dist/_app_/components/hds/stepper/step/indicator.js +1 -0
- package/dist/_app_/components/hds/stepper/task/indicator.js +1 -0
- package/dist/_app_/components/hds/table/index.js +1 -0
- package/dist/_app_/components/hds/table/td.js +1 -0
- package/dist/_app_/components/hds/table/th-button-sort.js +1 -0
- package/dist/_app_/components/hds/table/th-button-tooltip.js +1 -0
- package/dist/_app_/components/hds/table/th-selectable.js +1 -0
- package/dist/_app_/components/hds/table/th-sort.js +1 -0
- package/dist/_app_/components/hds/table/th.js +1 -0
- package/dist/_app_/components/hds/table/tr.js +1 -0
- package/dist/_app_/components/hds/tabs/index.js +1 -0
- package/dist/_app_/components/hds/tabs/panel.js +1 -0
- package/dist/_app_/components/hds/tabs/tab.js +1 -0
- package/dist/_app_/components/hds/tag/index.js +1 -0
- package/dist/_app_/components/hds/text/body.js +1 -0
- package/dist/_app_/components/hds/text/code.js +1 -0
- package/dist/_app_/components/hds/text/display.js +1 -0
- package/dist/_app_/components/hds/text/index.js +1 -0
- package/dist/_app_/components/hds/toast/index.js +1 -0
- package/dist/_app_/components/hds/tooltip-button/index.js +1 -0
- package/dist/_app_/components/hds/yield/index.js +1 -0
- package/dist/_app_/helpers/hds-link-to-models.js +1 -0
- package/dist/_app_/helpers/hds-link-to-query.js +1 -0
- package/dist/_app_/modifiers/hds-clipboard.js +1 -0
- package/dist/_app_/modifiers/hds-tooltip.js +1 -0
- package/dist/_rollupPluginBabelHelpers-lqPQKyNs.js +78 -0
- package/dist/_rollupPluginBabelHelpers-lqPQKyNs.js.map +1 -0
- package/dist/components/hds/accordion/index.js +10 -0
- package/dist/components/hds/accordion/index.js.map +1 -0
- package/dist/components/hds/accordion/item/button.js +36 -0
- package/dist/components/hds/accordion/item/button.js.map +1 -0
- package/dist/components/hds/accordion/item/index.js +62 -0
- package/dist/components/hds/accordion/item/index.js.map +1 -0
- package/dist/components/hds/alert/description.js +10 -0
- package/dist/components/hds/alert/description.js.map +1 -0
- package/dist/components/hds/alert/index.js +153 -0
- package/dist/components/hds/alert/index.js.map +1 -0
- package/dist/components/hds/alert/title.js +10 -0
- package/dist/components/hds/alert/title.js.map +1 -0
- package/dist/components/hds/app-footer/copyright.js +26 -0
- package/dist/components/hds/app-footer/copyright.js.map +1 -0
- package/dist/components/hds/app-footer/index.js +48 -0
- package/dist/components/hds/app-footer/index.js.map +1 -0
- package/dist/components/hds/app-footer/item.js +10 -0
- package/dist/components/hds/app-footer/item.js.map +1 -0
- package/dist/components/hds/app-footer/legal-links.js +70 -0
- package/dist/components/hds/app-footer/legal-links.js.map +1 -0
- package/dist/components/hds/app-footer/link.js +10 -0
- package/dist/components/hds/app-footer/link.js.map +1 -0
- package/dist/components/hds/app-footer/status-link.js +116 -0
- package/dist/components/hds/app-footer/status-link.js.map +1 -0
- package/dist/components/hds/app-frame/index.js +60 -0
- package/dist/components/hds/app-frame/index.js.map +1 -0
- package/dist/components/hds/app-frame/parts/footer.js +10 -0
- package/dist/components/hds/app-frame/parts/footer.js.map +1 -0
- package/dist/components/hds/app-frame/parts/header.js +10 -0
- package/dist/components/hds/app-frame/parts/header.js.map +1 -0
- package/dist/components/hds/app-frame/parts/main.js +10 -0
- package/dist/components/hds/app-frame/parts/main.js.map +1 -0
- package/dist/components/hds/app-frame/parts/modals.js +10 -0
- package/dist/components/hds/app-frame/parts/modals.js.map +1 -0
- package/dist/components/hds/app-frame/parts/sidebar.js +10 -0
- package/dist/components/hds/app-frame/parts/sidebar.js.map +1 -0
- package/dist/components/hds/application-state/body.js +10 -0
- package/dist/components/hds/application-state/body.js.map +1 -0
- package/dist/components/hds/application-state/footer.js +42 -0
- package/dist/components/hds/application-state/footer.js.map +1 -0
- package/dist/components/hds/application-state/header.js +10 -0
- package/dist/components/hds/application-state/header.js.map +1 -0
- package/dist/components/hds/application-state/index.js +10 -0
- package/dist/components/hds/application-state/index.js.map +1 -0
- package/dist/components/hds/badge/index.js +127 -0
- package/dist/components/hds/badge/index.js.map +1 -0
- package/dist/components/hds/badge-count/index.js +90 -0
- package/dist/components/hds/badge-count/index.js.map +1 -0
- package/dist/components/hds/breadcrumb/index.js +66 -0
- package/dist/components/hds/breadcrumb/index.js.map +1 -0
- package/dist/components/hds/breadcrumb/item.js +59 -0
- package/dist/components/hds/breadcrumb/item.js.map +1 -0
- package/dist/components/hds/breadcrumb/truncation.js +25 -0
- package/dist/components/hds/breadcrumb/truncation.js.map +1 -0
- package/dist/components/hds/button/index.js +157 -0
- package/dist/components/hds/button/index.js.map +1 -0
- package/dist/components/hds/button-set/index.js +10 -0
- package/dist/components/hds/button-set/index.js.map +1 -0
- package/dist/components/hds/card/container.js +130 -0
- package/dist/components/hds/card/container.js.map +1 -0
- package/dist/components/hds/code-block/copy-button.js +10 -0
- package/dist/components/hds/code-block/copy-button.js.map +1 -0
- package/dist/components/hds/code-block/description.js +10 -0
- package/dist/components/hds/code-block/description.js.map +1 -0
- package/dist/components/hds/code-block/index.js +160 -0
- package/dist/components/hds/code-block/index.js.map +1 -0
- package/dist/components/hds/code-block/title.js +10 -0
- package/dist/components/hds/code-block/title.js.map +1 -0
- package/dist/components/hds/copy/button/index.js +109 -0
- package/dist/components/hds/copy/button/index.js.map +1 -0
- package/dist/components/hds/copy/snippet/index.js +142 -0
- package/dist/components/hds/copy/snippet/index.js.map +1 -0
- package/dist/components/hds/disclosure-primitive/index.js +41 -0
- package/dist/components/hds/disclosure-primitive/index.js.map +1 -0
- package/dist/components/hds/dismiss-button/index.js +25 -0
- package/dist/components/hds/dismiss-button/index.js.map +1 -0
- package/dist/components/hds/dropdown/footer.js +10 -0
- package/dist/components/hds/dropdown/footer.js.map +1 -0
- package/dist/components/hds/dropdown/header.js +10 -0
- package/dist/components/hds/dropdown/header.js.map +1 -0
- package/dist/components/hds/dropdown/index.js +72 -0
- package/dist/components/hds/dropdown/index.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/checkbox.js +24 -0
- package/dist/components/hds/dropdown/list-item/checkbox.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/checkmark.js +31 -0
- package/dist/components/hds/dropdown/list-item/checkmark.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/copy-item.js +53 -0
- package/dist/components/hds/dropdown/list-item/copy-item.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/description.js +30 -0
- package/dist/components/hds/dropdown/list-item/description.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/generic.js +10 -0
- package/dist/components/hds/dropdown/list-item/generic.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/interactive.js +59 -0
- package/dist/components/hds/dropdown/list-item/interactive.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/radio.js +24 -0
- package/dist/components/hds/dropdown/list-item/radio.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/separator.js +10 -0
- package/dist/components/hds/dropdown/list-item/separator.js.map +1 -0
- package/dist/components/hds/dropdown/list-item/title.js +30 -0
- package/dist/components/hds/dropdown/list-item/title.js.map +1 -0
- package/dist/components/hds/dropdown/toggle/button.js +134 -0
- package/dist/components/hds/dropdown/toggle/button.js.map +1 -0
- package/dist/components/hds/dropdown/toggle/chevron.js +10 -0
- package/dist/components/hds/dropdown/toggle/chevron.js.map +1 -0
- package/dist/components/hds/dropdown/toggle/icon.js +116 -0
- package/dist/components/hds/dropdown/toggle/icon.js.map +1 -0
- package/dist/components/hds/flyout/body.js +10 -0
- package/dist/components/hds/flyout/body.js.map +1 -0
- package/dist/components/hds/flyout/description.js +10 -0
- package/dist/components/hds/flyout/description.js.map +1 -0
- package/dist/components/hds/flyout/footer.js +10 -0
- package/dist/components/hds/flyout/footer.js.map +1 -0
- package/dist/components/hds/flyout/header.js +10 -0
- package/dist/components/hds/flyout/header.js.map +1 -0
- package/dist/components/hds/flyout/index.js +156 -0
- package/dist/components/hds/flyout/index.js.map +1 -0
- package/dist/components/hds/form/character-count/index.js +149 -0
- package/dist/components/hds/form/character-count/index.js.map +1 -0
- package/dist/components/hds/form/checkbox/base.js +10 -0
- package/dist/components/hds/form/checkbox/base.js.map +1 -0
- package/dist/components/hds/form/checkbox/field.js +10 -0
- package/dist/components/hds/form/checkbox/field.js.map +1 -0
- package/dist/components/hds/form/checkbox/group.js +10 -0
- package/dist/components/hds/form/checkbox/group.js.map +1 -0
- package/dist/components/hds/form/error/index.js +68 -0
- package/dist/components/hds/form/error/index.js.map +1 -0
- package/dist/components/hds/form/error/message.js +10 -0
- package/dist/components/hds/form/error/message.js.map +1 -0
- package/dist/components/hds/form/field/index.js +107 -0
- package/dist/components/hds/form/field/index.js.map +1 -0
- package/dist/components/hds/form/fieldset/index.js +93 -0
- package/dist/components/hds/form/fieldset/index.js.map +1 -0
- package/dist/components/hds/form/file-input/base.js +10 -0
- package/dist/components/hds/form/file-input/base.js.map +1 -0
- package/dist/components/hds/form/file-input/field.js +10 -0
- package/dist/components/hds/form/file-input/field.js.map +1 -0
- package/dist/components/hds/form/helper-text/index.js +68 -0
- package/dist/components/hds/form/helper-text/index.js.map +1 -0
- package/dist/components/hds/form/indicator/index.js +30 -0
- package/dist/components/hds/form/indicator/index.js.map +1 -0
- package/dist/components/hds/form/label/index.js +36 -0
- package/dist/components/hds/form/label/index.js.map +1 -0
- package/dist/components/hds/form/legend/index.js +36 -0
- package/dist/components/hds/form/legend/index.js.map +1 -0
- package/dist/components/hds/form/masked-input/base.js +96 -0
- package/dist/components/hds/form/masked-input/base.js.map +1 -0
- package/dist/components/hds/form/masked-input/field.js +10 -0
- package/dist/components/hds/form/masked-input/field.js.map +1 -0
- package/dist/components/hds/form/radio/base.js +10 -0
- package/dist/components/hds/form/radio/base.js.map +1 -0
- package/dist/components/hds/form/radio/field.js +10 -0
- package/dist/components/hds/form/radio/field.js.map +1 -0
- package/dist/components/hds/form/radio/group.js +10 -0
- package/dist/components/hds/form/radio/group.js.map +1 -0
- package/dist/components/hds/form/radio-card/description.js +10 -0
- package/dist/components/hds/form/radio-card/description.js.map +1 -0
- package/dist/components/hds/form/radio-card/group.js +10 -0
- package/dist/components/hds/form/radio-card/group.js.map +1 -0
- package/dist/components/hds/form/radio-card/index.js +107 -0
- package/dist/components/hds/form/radio-card/index.js.map +1 -0
- package/dist/components/hds/form/radio-card/label.js +10 -0
- package/dist/components/hds/form/radio-card/label.js.map +1 -0
- package/dist/components/hds/form/select/base.js +34 -0
- package/dist/components/hds/form/select/base.js.map +1 -0
- package/dist/components/hds/form/select/field.js +10 -0
- package/dist/components/hds/form/select/field.js.map +1 -0
- package/dist/components/hds/form/text-input/base.js +62 -0
- package/dist/components/hds/form/text-input/base.js.map +1 -0
- package/dist/components/hds/form/text-input/field.js +85 -0
- package/dist/components/hds/form/text-input/field.js.map +1 -0
- package/dist/components/hds/form/textarea/base.js +34 -0
- package/dist/components/hds/form/textarea/base.js.map +1 -0
- package/dist/components/hds/form/textarea/field.js +10 -0
- package/dist/components/hds/form/textarea/field.js.map +1 -0
- package/dist/components/hds/form/toggle/base.js +10 -0
- package/dist/components/hds/form/toggle/base.js.map +1 -0
- package/dist/components/hds/form/toggle/field.js +10 -0
- package/dist/components/hds/form/toggle/field.js.map +1 -0
- package/dist/components/hds/form/toggle/group.js +10 -0
- package/dist/components/hds/form/toggle/group.js.map +1 -0
- package/dist/components/hds/form/visibility-toggle/index.js +10 -0
- package/dist/components/hds/form/visibility-toggle/index.js.map +1 -0
- package/dist/components/hds/icon-tile/index.js +158 -0
- package/dist/components/hds/icon-tile/index.js.map +1 -0
- package/dist/components/hds/interactive/index.js +41 -0
- package/dist/components/hds/interactive/index.js.map +1 -0
- package/dist/components/hds/link/inline.js +72 -0
- package/dist/components/hds/link/inline.js.map +1 -0
- package/dist/components/hds/link/standalone.js +132 -0
- package/dist/components/hds/link/standalone.js.map +1 -0
- package/dist/components/hds/menu-primitive/index.js +68 -0
- package/dist/components/hds/menu-primitive/index.js.map +1 -0
- package/dist/components/hds/modal/body.js +10 -0
- package/dist/components/hds/modal/body.js.map +1 -0
- package/dist/components/hds/modal/footer.js +10 -0
- package/dist/components/hds/modal/footer.js.map +1 -0
- package/dist/components/hds/modal/header.js +10 -0
- package/dist/components/hds/modal/header.js.map +1 -0
- package/dist/components/hds/modal/index.js +196 -0
- package/dist/components/hds/modal/index.js.map +1 -0
- package/dist/components/hds/page-header/actions.js +10 -0
- package/dist/components/hds/page-header/actions.js.map +1 -0
- package/dist/components/hds/page-header/badges.js +10 -0
- package/dist/components/hds/page-header/badges.js.map +1 -0
- package/dist/components/hds/page-header/description.js +10 -0
- package/dist/components/hds/page-header/description.js.map +1 -0
- package/dist/components/hds/page-header/index.js +10 -0
- package/dist/components/hds/page-header/index.js.map +1 -0
- package/dist/components/hds/page-header/subtitle.js +10 -0
- package/dist/components/hds/page-header/subtitle.js.map +1 -0
- package/dist/components/hds/page-header/title.js +10 -0
- package/dist/components/hds/page-header/title.js.map +1 -0
- package/dist/components/hds/pagination/compact/index.js +159 -0
- package/dist/components/hds/pagination/compact/index.js.map +1 -0
- package/dist/components/hds/pagination/info/index.js +25 -0
- package/dist/components/hds/pagination/info/index.js.map +1 -0
- package/dist/components/hds/pagination/nav/arrow.js +70 -0
- package/dist/components/hds/pagination/nav/arrow.js.map +1 -0
- package/dist/components/hds/pagination/nav/ellipsis.js +10 -0
- package/dist/components/hds/pagination/nav/ellipsis.js.map +1 -0
- package/dist/components/hds/pagination/nav/number.js +44 -0
- package/dist/components/hds/pagination/nav/number.js.map +1 -0
- package/dist/components/hds/pagination/numbered/index.js +305 -0
- package/dist/components/hds/pagination/numbered/index.js.map +1 -0
- package/dist/components/hds/pagination/size-selector/index.js +72 -0
- package/dist/components/hds/pagination/size-selector/index.js.map +1 -0
- package/dist/components/hds/reveal/index.js +36 -0
- package/dist/components/hds/reveal/index.js.map +1 -0
- package/dist/components/hds/reveal/toggle/button.js +31 -0
- package/dist/components/hds/reveal/toggle/button.js.map +1 -0
- package/dist/components/hds/segmented-group/index.js +10 -0
- package/dist/components/hds/segmented-group/index.js.map +1 -0
- package/dist/components/hds/separator/index.js +48 -0
- package/dist/components/hds/separator/index.js.map +1 -0
- package/dist/components/hds/side-nav/base.js +10 -0
- package/dist/components/hds/side-nav/base.js.map +1 -0
- package/dist/components/hds/side-nav/header/home-link.js +30 -0
- package/dist/components/hds/side-nav/header/home-link.js.map +1 -0
- package/dist/components/hds/side-nav/header/icon-button.js +30 -0
- package/dist/components/hds/side-nav/header/icon-button.js.map +1 -0
- package/dist/components/hds/side-nav/header/index.js +10 -0
- package/dist/components/hds/side-nav/header/index.js.map +1 -0
- package/dist/components/hds/side-nav/index.js +176 -0
- package/dist/components/hds/side-nav/index.js.map +1 -0
- package/dist/components/hds/side-nav/list/back-link.js +10 -0
- package/dist/components/hds/side-nav/list/back-link.js.map +1 -0
- package/dist/components/hds/side-nav/list/index.js +10 -0
- package/dist/components/hds/side-nav/list/index.js.map +1 -0
- package/dist/components/hds/side-nav/list/item.js +10 -0
- package/dist/components/hds/side-nav/list/item.js.map +1 -0
- package/dist/components/hds/side-nav/list/link.js +10 -0
- package/dist/components/hds/side-nav/list/link.js.map +1 -0
- package/dist/components/hds/side-nav/list/title.js +10 -0
- package/dist/components/hds/side-nav/list/title.js.map +1 -0
- package/dist/components/hds/side-nav/portal/index.js +10 -0
- package/dist/components/hds/side-nav/portal/index.js.map +1 -0
- package/dist/components/hds/side-nav/portal/target.js +173 -0
- package/dist/components/hds/side-nav/portal/target.js.map +1 -0
- package/dist/components/hds/side-nav/toggle-button.js +10 -0
- package/dist/components/hds/side-nav/toggle-button.js.map +1 -0
- package/dist/components/hds/stepper/step/indicator.js +59 -0
- package/dist/components/hds/stepper/step/indicator.js.map +1 -0
- package/dist/components/hds/stepper/task/indicator.js +74 -0
- package/dist/components/hds/stepper/task/indicator.js.map +1 -0
- package/dist/components/hds/table/index.js +269 -0
- package/dist/components/hds/table/index.js.map +1 -0
- package/dist/components/hds/table/td.js +48 -0
- package/dist/components/hds/table/td.js.map +1 -0
- package/dist/components/hds/table/th-button-sort.js +82 -0
- package/dist/components/hds/table/th-button-sort.js.map +1 -0
- package/dist/components/hds/table/th-button-tooltip.js +32 -0
- package/dist/components/hds/table/th-button-tooltip.js.map +1 -0
- package/dist/components/hds/table/th-selectable.js +81 -0
- package/dist/components/hds/table/th-selectable.js.map +1 -0
- package/dist/components/hds/table/th-sort.js +73 -0
- package/dist/components/hds/table/th-sort.js.map +1 -0
- package/dist/components/hds/table/th.js +54 -0
- package/dist/components/hds/table/th.js.map +1 -0
- package/dist/components/hds/table/tr.js +30 -0
- package/dist/components/hds/table/tr.js.map +1 -0
- package/dist/components/hds/tabs/index.js +242 -0
- package/dist/components/hds/tabs/index.js.map +1 -0
- package/dist/components/hds/tabs/panel.js +60 -0
- package/dist/components/hds/tabs/panel.js.map +1 -0
- package/dist/components/hds/tabs/tab.js +94 -0
- package/dist/components/hds/tabs/tab.js.map +1 -0
- package/dist/components/hds/tag/index.js +92 -0
- package/dist/components/hds/tag/index.js.map +1 -0
- package/dist/components/hds/text/body.js +63 -0
- package/dist/components/hds/text/body.js.map +1 -0
- package/dist/components/hds/text/code.js +63 -0
- package/dist/components/hds/text/code.js.map +1 -0
- package/dist/components/hds/text/display.js +76 -0
- package/dist/components/hds/text/display.js.map +1 -0
- package/dist/components/hds/text/index.js +131 -0
- package/dist/components/hds/text/index.js.map +1 -0
- package/dist/components/hds/toast/index.js +10 -0
- package/dist/components/hds/toast/index.js.map +1 -0
- package/dist/components/hds/tooltip-button/index.js +74 -0
- package/dist/components/hds/tooltip-button/index.js.map +1 -0
- package/dist/components/hds/yield/index.js +10 -0
- package/dist/components/hds/yield/index.js.map +1 -0
- package/dist/helpers/hds-link-to-models.js +34 -0
- package/dist/helpers/hds-link-to-models.js.map +1 -0
- package/dist/helpers/hds-link-to-query.js +29 -0
- package/dist/helpers/hds-link-to-query.js.map +1 -0
- package/dist/modifiers/hds-clipboard.js +152 -0
- package/dist/modifiers/hds-clipboard.js.map +1 -0
- package/dist/modifiers/hds-tooltip.js +153 -0
- package/dist/modifiers/hds-tooltip.js.map +1 -0
- package/dist/styles/@hashicorp/design-system-components.css +6600 -0
- package/dist/styles/@hashicorp/design-system-components.scss +67 -0
- package/dist/styles/@hashicorp/design-system-components.scss.map +1 -0
- package/dist/styles/components/flyout.scss +113 -0
- package/dist/styles/components/table.scss +277 -0
- package/dist/styles/components/tabs.scss +152 -0
- package/dist/template-registry.js +2 -0
- package/dist/template-registry.js.map +1 -0
- package/dist/utils/hds-get-element-id.js +22 -0
- package/dist/utils/hds-get-element-id.js.map +1 -0
- package/dist/utils/hds-set-aria-described-by.js +17 -0
- package/dist/utils/hds-set-aria-described-by.js.map +1 -0
- package/package.json +196 -62
- package/.stylelintignore +0 -26
- package/CHANGELOG-FIGMA-COMPONENTS.md +0 -191
- package/CHANGELOG-FIGMA-FOUNDATIONS.md +0 -13
- package/CHANGELOG.md +0 -1609
- package/HOW-TO-TEST-A-COMPONENT-IN-CLOUD-UI.md +0 -100
- package/NEW-COMPONENT-CHECKLIST.md +0 -166
- package/RELEASE.md +0 -40
- package/addon/components/hds/accordion/index.hbs +0 -8
- package/addon/components/hds/accordion/item/button.hbs +0 -16
- package/addon/components/hds/accordion/item/button.js +0 -31
- package/addon/components/hds/accordion/item/index.hbs +0 -41
- package/addon/components/hds/accordion/item/index.js +0 -58
- package/addon/components/hds/alert/description.hbs +0 -5
- package/addon/components/hds/alert/index.hbs +0 -38
- package/addon/components/hds/alert/index.js +0 -164
- package/addon/components/hds/alert/title.hbs +0 -5
- package/addon/components/hds/app-footer/copyright.hbs +0 -9
- package/addon/components/hds/app-footer/copyright.js +0 -18
- package/addon/components/hds/app-footer/index.hbs +0 -20
- package/addon/components/hds/app-footer/index.js +0 -41
- package/addon/components/hds/app-footer/item.hbs +0 -8
- package/addon/components/hds/app-footer/legal-links.hbs +0 -14
- package/addon/components/hds/app-footer/legal-links.js +0 -67
- package/addon/components/hds/app-footer/link.hbs +0 -22
- package/addon/components/hds/app-footer/status-link.hbs +0 -20
- package/addon/components/hds/app-footer/status-link.js +0 -121
- package/addon/components/hds/app-frame/index.hbs +0 -24
- package/addon/components/hds/app-frame/index.js +0 -52
- package/addon/components/hds/app-frame/parts/footer.hbs +0 -7
- package/addon/components/hds/app-frame/parts/header.hbs +0 -7
- package/addon/components/hds/app-frame/parts/main.hbs +0 -7
- package/addon/components/hds/app-frame/parts/modals.hbs +0 -6
- package/addon/components/hds/app-frame/parts/sidebar.hbs +0 -7
- package/addon/components/hds/application-state/body.hbs +0 -13
- package/addon/components/hds/application-state/footer.hbs +0 -7
- package/addon/components/hds/application-state/footer.js +0 -35
- package/addon/components/hds/application-state/header.hbs +0 -20
- package/addon/components/hds/application-state/index.hbs +0 -13
- package/addon/components/hds/badge/index.hbs +0 -18
- package/addon/components/hds/badge/index.js +0 -146
- package/addon/components/hds/badge-count/index.hbs +0 -7
- package/addon/components/hds/badge-count/index.js +0 -99
- package/addon/components/hds/breadcrumb/index.hbs +0 -9
- package/addon/components/hds/breadcrumb/index.js +0 -59
- package/addon/components/hds/breadcrumb/item.hbs +0 -50
- package/addon/components/hds/breadcrumb/item.js +0 -55
- package/addon/components/hds/breadcrumb/truncation.hbs +0 -26
- package/addon/components/hds/breadcrumb/truncation.js +0 -17
- package/addon/components/hds/button/index.hbs +0 -45
- package/addon/components/hds/button/index.ts +0 -199
- package/addon/components/hds/button-set/index.hbs +0 -7
- package/addon/components/hds/card/container.hbs +0 -7
- package/addon/components/hds/card/container.js +0 -161
- package/addon/components/hds/code-block/copy-button.hbs +0 -13
- package/addon/components/hds/code-block/description.hbs +0 -8
- package/addon/components/hds/code-block/index.hbs +0 -27
- package/addon/components/hds/code-block/index.js +0 -167
- package/addon/components/hds/code-block/title.hbs +0 -8
- package/addon/components/hds/copy/button/index.hbs +0 -16
- package/addon/components/hds/copy/button/index.js +0 -103
- package/addon/components/hds/copy/snippet/index.hbs +0 -15
- package/addon/components/hds/copy/snippet/index.js +0 -135
- package/addon/components/hds/disclosure-primitive/index.hbs +0 -14
- package/addon/components/hds/disclosure-primitive/index.js +0 -30
- package/addon/components/hds/dismiss-button/index.hbs +0 -7
- package/addon/components/hds/dismiss-button/index.js +0 -17
- package/addon/components/hds/dropdown/footer.hbs +0 -8
- package/addon/components/hds/dropdown/header.hbs +0 -8
- package/addon/components/hds/dropdown/index.hbs +0 -36
- package/addon/components/hds/dropdown/index.js +0 -80
- package/addon/components/hds/dropdown/list-item/checkbox.hbs +0 -20
- package/addon/components/hds/dropdown/list-item/checkbox.js +0 -16
- package/addon/components/hds/dropdown/list-item/checkmark.hbs +0 -46
- package/addon/components/hds/dropdown/list-item/checkmark.js +0 -28
- package/addon/components/hds/dropdown/list-item/copy-item.hbs +0 -16
- package/addon/components/hds/dropdown/list-item/copy-item.js +0 -51
- package/addon/components/hds/dropdown/list-item/description.hbs +0 -14
- package/addon/components/hds/dropdown/list-item/description.js +0 -25
- package/addon/components/hds/dropdown/list-item/generic.hbs +0 -7
- package/addon/components/hds/dropdown/list-item/interactive.hbs +0 -37
- package/addon/components/hds/dropdown/list-item/interactive.js +0 -64
- package/addon/components/hds/dropdown/list-item/radio.hbs +0 -25
- package/addon/components/hds/dropdown/list-item/radio.js +0 -16
- package/addon/components/hds/dropdown/list-item/separator.hbs +0 -10
- package/addon/components/hds/dropdown/list-item/title.hbs +0 -14
- package/addon/components/hds/dropdown/list-item/title.js +0 -25
- package/addon/components/hds/dropdown/toggle/button.hbs +0 -38
- package/addon/components/hds/dropdown/toggle/button.js +0 -134
- package/addon/components/hds/dropdown/toggle/chevron.hbs +0 -8
- package/addon/components/hds/dropdown/toggle/icon.hbs +0 -23
- package/addon/components/hds/dropdown/toggle/icon.js +0 -119
- package/addon/components/hds/flyout/body.hbs +0 -7
- package/addon/components/hds/flyout/description.hbs +0 -7
- package/addon/components/hds/flyout/footer.hbs +0 -7
- package/addon/components/hds/flyout/header.hbs +0 -18
- package/addon/components/hds/flyout/index.hbs +0 -20
- package/addon/components/hds/flyout/index.js +0 -168
- package/addon/components/hds/form/character-count/index.hbs +0 -28
- package/addon/components/hds/form/character-count/index.js +0 -178
- package/addon/components/hds/form/checkbox/base.hbs +0 -5
- package/addon/components/hds/form/checkbox/field.hbs +0 -24
- package/addon/components/hds/form/checkbox/group.hbs +0 -29
- package/addon/components/hds/form/error/index.hbs +0 -10
- package/addon/components/hds/form/error/index.js +0 -58
- package/addon/components/hds/form/error/message.hbs +0 -7
- package/addon/components/hds/form/field/index.hbs +0 -47
- package/addon/components/hds/form/field/index.js +0 -97
- package/addon/components/hds/form/fieldset/index.hbs +0 -33
- package/addon/components/hds/form/fieldset/index.js +0 -76
- package/addon/components/hds/form/file-input/base.hbs +0 -6
- package/addon/components/hds/form/file-input/field.hbs +0 -24
- package/addon/components/hds/form/helper-text/index.hbs +0 -15
- package/addon/components/hds/form/helper-text/index.js +0 -58
- package/addon/components/hds/form/indicator/index.hbs +0 -10
- package/addon/components/hds/form/indicator/index.js +0 -24
- package/addon/components/hds/form/label/index.hbs +0 -8
- package/addon/components/hds/form/label/index.js +0 -29
- package/addon/components/hds/form/legend/index.hbs +0 -8
- package/addon/components/hds/form/legend/index.js +0 -29
- package/addon/components/hds/form/masked-input/base.hbs +0 -40
- package/addon/components/hds/form/masked-input/base.js +0 -85
- package/addon/components/hds/form/masked-input/field.hbs +0 -33
- package/addon/components/hds/form/radio/base.hbs +0 -5
- package/addon/components/hds/form/radio/field.hbs +0 -24
- package/addon/components/hds/form/radio/group.hbs +0 -29
- package/addon/components/hds/form/radio-card/description.hbs +0 -10
- package/addon/components/hds/form/radio-card/group.hbs +0 -30
- package/addon/components/hds/form/radio-card/index.hbs +0 -24
- package/addon/components/hds/form/radio-card/index.js +0 -100
- package/addon/components/hds/form/radio-card/label.hbs +0 -11
- package/addon/components/hds/form/select/base.hbs +0 -7
- package/addon/components/hds/form/select/base.js +0 -27
- package/addon/components/hds/form/select/field.hbs +0 -30
- package/addon/components/hds/form/text-input/base.hbs +0 -5
- package/addon/components/hds/form/text-input/base.js +0 -72
- package/addon/components/hds/form/text-input/field.hbs +0 -41
- package/addon/components/hds/form/text-input/field.js +0 -59
- package/addon/components/hds/form/textarea/base.hbs +0 -6
- package/addon/components/hds/form/textarea/base.js +0 -27
- package/addon/components/hds/form/textarea/field.hbs +0 -28
- package/addon/components/hds/form/toggle/base.hbs +0 -8
- package/addon/components/hds/form/toggle/field.hbs +0 -23
- package/addon/components/hds/form/toggle/group.hbs +0 -21
- package/addon/components/hds/form/visibility-toggle/index.hbs +0 -8
- package/addon/components/hds/icon-tile/index.hbs +0 -23
- package/addon/components/hds/icon-tile/index.js +0 -189
- package/addon/components/hds/interactive/index.hbs +0 -32
- package/addon/components/hds/interactive/index.ts +0 -63
- package/addon/components/hds/link/inline.hbs +0 -22
- package/addon/components/hds/link/inline.js +0 -76
- package/addon/components/hds/link/standalone.hbs +0 -28
- package/addon/components/hds/link/standalone.js +0 -147
- package/addon/components/hds/menu-primitive/index.hbs +0 -22
- package/addon/components/hds/menu-primitive/index.js +0 -59
- package/addon/components/hds/modal/body.hbs +0 -7
- package/addon/components/hds/modal/footer.hbs +0 -7
- package/addon/components/hds/modal/header.hbs +0 -18
- package/addon/components/hds/modal/index.hbs +0 -19
- package/addon/components/hds/modal/index.js +0 -209
- package/addon/components/hds/page-header/actions.hbs +0 -5
- package/addon/components/hds/page-header/badges.hbs +0 -5
- package/addon/components/hds/page-header/description.hbs +0 -11
- package/addon/components/hds/page-header/index.hbs +0 -28
- package/addon/components/hds/page-header/subtitle.hbs +0 -11
- package/addon/components/hds/page-header/title.hbs +0 -11
- package/addon/components/hds/pagination/compact/index.hbs +0 -39
- package/addon/components/hds/pagination/compact/index.js +0 -163
- package/addon/components/hds/pagination/info/index.hbs +0 -11
- package/addon/components/hds/pagination/info/index.js +0 -17
- package/addon/components/hds/pagination/nav/arrow.hbs +0 -44
- package/addon/components/hds/pagination/nav/arrow.js +0 -77
- package/addon/components/hds/pagination/nav/ellipsis.hbs +0 -5
- package/addon/components/hds/pagination/nav/number.hbs +0 -17
- package/addon/components/hds/pagination/nav/number.js +0 -45
- package/addon/components/hds/pagination/numbered/index.hbs +0 -70
- package/addon/components/hds/pagination/numbered/index.js +0 -341
- package/addon/components/hds/pagination/size-selector/index.hbs +0 -16
- package/addon/components/hds/pagination/size-selector/index.js +0 -73
- package/addon/components/hds/reveal/index.hbs +0 -21
- package/addon/components/hds/reveal/index.js +0 -33
- package/addon/components/hds/reveal/toggle/button.hbs +0 -13
- package/addon/components/hds/reveal/toggle/button.js +0 -24
- package/addon/components/hds/segmented-group/index.hbs +0 -15
- package/addon/components/hds/separator/index.hbs +0 -5
- package/addon/components/hds/separator/index.js +0 -47
- package/addon/components/hds/side-nav/base.hbs +0 -19
- package/addon/components/hds/side-nav/header/home-link.hbs +0 -20
- package/addon/components/hds/side-nav/header/home-link.js +0 -25
- package/addon/components/hds/side-nav/header/icon-button.hbs +0 -20
- package/addon/components/hds/side-nav/header/icon-button.js +0 -25
- package/addon/components/hds/side-nav/header/index.hbs +0 -13
- package/addon/components/hds/side-nav/index.hbs +0 -42
- package/addon/components/hds/side-nav/index.js +0 -147
- package/addon/components/hds/side-nav/list/back-link.hbs +0 -24
- package/addon/components/hds/side-nav/list/index.hbs +0 -19
- package/addon/components/hds/side-nav/list/item.hbs +0 -8
- package/addon/components/hds/side-nav/list/link.hbs +0 -50
- package/addon/components/hds/side-nav/list/title.hbs +0 -8
- package/addon/components/hds/side-nav/portal/index.hbs +0 -12
- package/addon/components/hds/side-nav/portal/target.hbs +0 -14
- package/addon/components/hds/side-nav/portal/target.js +0 -162
- package/addon/components/hds/side-nav/toggle-button.hbs +0 -7
- package/addon/components/hds/stepper/step/indicator.hbs +0 -28
- package/addon/components/hds/stepper/step/indicator.js +0 -59
- package/addon/components/hds/stepper/task/indicator.hbs +0 -7
- package/addon/components/hds/stepper/task/indicator.js +0 -74
- package/addon/components/hds/table/index.hbs +0 -78
- package/addon/components/hds/table/index.js +0 -182
- package/addon/components/hds/table/td.hbs +0 -7
- package/addon/components/hds/table/td.js +0 -50
- package/addon/components/hds/table/th-sort.hbs +0 -18
- package/addon/components/hds/table/th-sort.js +0 -94
- package/addon/components/hds/table/th.hbs +0 -11
- package/addon/components/hds/table/th.js +0 -50
- package/addon/components/hds/table/tr.hbs +0 -7
- package/addon/components/hds/tabs/index.hbs +0 -47
- package/addon/components/hds/tabs/index.js +0 -211
- package/addon/components/hds/tabs/panel.hbs +0 -16
- package/addon/components/hds/tabs/panel.js +0 -59
- package/addon/components/hds/tabs/tab.hbs +0 -31
- package/addon/components/hds/tabs/tab.js +0 -98
- package/addon/components/hds/tag/index.hbs +0 -30
- package/addon/components/hds/tag/index.js +0 -91
- package/addon/components/hds/text/body.hbs +0 -13
- package/addon/components/hds/text/body.js +0 -73
- package/addon/components/hds/text/code.hbs +0 -13
- package/addon/components/hds/text/code.js +0 -73
- package/addon/components/hds/text/display.hbs +0 -13
- package/addon/components/hds/text/display.js +0 -85
- package/addon/components/hds/text/index.hbs +0 -10
- package/addon/components/hds/text/index.js +0 -146
- package/addon/components/hds/toast/index.hbs +0 -17
- package/addon/components/hds/tooltip-button/index.hbs +0 -11
- package/addon/components/hds/tooltip-button/index.js +0 -86
- package/addon/components/hds/yield/index.hbs +0 -6
- package/addon/helpers/hds-link-to-models.js +0 -35
- package/addon/helpers/hds-link-to-query.js +0 -26
- package/addon/modifiers/hds-clipboard.js +0 -163
- package/addon/modifiers/hds-tooltip.js +0 -164
- package/addon/template-registry.ts +0 -12
- package/addon/utils/hds-get-element-id.js +0 -19
- package/addon/utils/hds-set-aria-described-by.js +0 -15
- package/app/components/hds/accordion/index.js +0 -6
- package/app/components/hds/accordion/item/button.js +0 -6
- package/app/components/hds/accordion/item/index.js +0 -6
- package/app/components/hds/alert/description.js +0 -6
- package/app/components/hds/alert/index.js +0 -6
- package/app/components/hds/alert/title.js +0 -6
- package/app/components/hds/app-footer/copyright.js +0 -6
- package/app/components/hds/app-footer/index.js +0 -6
- package/app/components/hds/app-footer/item.js +0 -6
- package/app/components/hds/app-footer/legal-links.js +0 -6
- package/app/components/hds/app-footer/link.js +0 -6
- package/app/components/hds/app-footer/status-link.js +0 -6
- package/app/components/hds/app-frame/index.js +0 -6
- package/app/components/hds/app-frame/parts/footer.js +0 -6
- package/app/components/hds/app-frame/parts/header.js +0 -6
- package/app/components/hds/app-frame/parts/main.js +0 -6
- package/app/components/hds/app-frame/parts/modals.js +0 -6
- package/app/components/hds/app-frame/parts/sidebar.js +0 -6
- package/app/components/hds/application-state/body.js +0 -6
- package/app/components/hds/application-state/footer.js +0 -6
- package/app/components/hds/application-state/header.js +0 -6
- package/app/components/hds/application-state/index.js +0 -6
- package/app/components/hds/badge/index.js +0 -6
- package/app/components/hds/badge-count/index.js +0 -6
- package/app/components/hds/breadcrumb/index.js +0 -6
- package/app/components/hds/breadcrumb/item.js +0 -6
- package/app/components/hds/breadcrumb/truncation.js +0 -6
- package/app/components/hds/button/index.js +0 -6
- package/app/components/hds/button-set/index.js +0 -6
- package/app/components/hds/card/container.js +0 -6
- package/app/components/hds/code-block/copy-button.js +0 -6
- package/app/components/hds/code-block/description.js +0 -6
- package/app/components/hds/code-block/index.js +0 -6
- package/app/components/hds/code-block/title.js +0 -6
- package/app/components/hds/copy/button/index.js +0 -6
- package/app/components/hds/copy/snippet/index.js +0 -6
- package/app/components/hds/disclosure-primitive/index.js +0 -6
- package/app/components/hds/dismiss-button/index.js +0 -6
- package/app/components/hds/dropdown/footer.js +0 -6
- package/app/components/hds/dropdown/header.js +0 -6
- package/app/components/hds/dropdown/index.js +0 -6
- package/app/components/hds/dropdown/list-item/checkbox.js +0 -6
- package/app/components/hds/dropdown/list-item/checkmark.js +0 -6
- package/app/components/hds/dropdown/list-item/copy-item.js +0 -6
- package/app/components/hds/dropdown/list-item/description.js +0 -6
- package/app/components/hds/dropdown/list-item/generic.js +0 -6
- package/app/components/hds/dropdown/list-item/interactive.js +0 -6
- package/app/components/hds/dropdown/list-item/radio.js +0 -6
- package/app/components/hds/dropdown/list-item/separator.js +0 -6
- package/app/components/hds/dropdown/list-item/title.js +0 -6
- package/app/components/hds/dropdown/toggle/button.js +0 -6
- package/app/components/hds/dropdown/toggle/chevron.js +0 -6
- package/app/components/hds/dropdown/toggle/icon.js +0 -6
- package/app/components/hds/flyout/body.js +0 -6
- package/app/components/hds/flyout/description.js +0 -6
- package/app/components/hds/flyout/footer.js +0 -6
- package/app/components/hds/flyout/header.js +0 -6
- package/app/components/hds/flyout/index.js +0 -6
- package/app/components/hds/form/character-count/index.js +0 -6
- package/app/components/hds/form/checkbox/base.js +0 -6
- package/app/components/hds/form/checkbox/field.js +0 -6
- package/app/components/hds/form/checkbox/group.js +0 -6
- package/app/components/hds/form/error/index.js +0 -6
- package/app/components/hds/form/error/message.js +0 -6
- package/app/components/hds/form/field/index.js +0 -6
- package/app/components/hds/form/fieldset/index.js +0 -6
- package/app/components/hds/form/file-input/base.js +0 -6
- package/app/components/hds/form/file-input/field.js +0 -6
- package/app/components/hds/form/helper-text/index.js +0 -6
- package/app/components/hds/form/indicator/index.js +0 -6
- package/app/components/hds/form/label/index.js +0 -6
- package/app/components/hds/form/legend/index.js +0 -6
- package/app/components/hds/form/masked-input/base.js +0 -6
- package/app/components/hds/form/masked-input/field.js +0 -6
- package/app/components/hds/form/radio/base.js +0 -6
- package/app/components/hds/form/radio/field.js +0 -6
- package/app/components/hds/form/radio/group.js +0 -6
- package/app/components/hds/form/radio-card/description.js +0 -6
- package/app/components/hds/form/radio-card/group.js +0 -6
- package/app/components/hds/form/radio-card/index.js +0 -6
- package/app/components/hds/form/radio-card/label.js +0 -6
- package/app/components/hds/form/select/base.js +0 -6
- package/app/components/hds/form/select/field.js +0 -6
- package/app/components/hds/form/text-input/base.js +0 -6
- package/app/components/hds/form/text-input/field.js +0 -6
- package/app/components/hds/form/textarea/base.js +0 -6
- package/app/components/hds/form/textarea/field.js +0 -6
- package/app/components/hds/form/toggle/base.js +0 -6
- package/app/components/hds/form/toggle/field.js +0 -6
- package/app/components/hds/form/toggle/group.js +0 -6
- package/app/components/hds/form/visibility-toggle/index.js +0 -6
- package/app/components/hds/icon-tile/index.js +0 -6
- package/app/components/hds/interactive/index.js +0 -6
- package/app/components/hds/link/inline.js +0 -6
- package/app/components/hds/link/standalone.js +0 -6
- package/app/components/hds/menu-primitive/index.js +0 -6
- package/app/components/hds/modal/body.js +0 -6
- package/app/components/hds/modal/footer.js +0 -6
- package/app/components/hds/modal/header.js +0 -6
- package/app/components/hds/modal/index.js +0 -6
- package/app/components/hds/page-header/actions.js +0 -6
- package/app/components/hds/page-header/badges.js +0 -6
- package/app/components/hds/page-header/description.js +0 -6
- package/app/components/hds/page-header/index.js +0 -6
- package/app/components/hds/page-header/subtitle.js +0 -6
- package/app/components/hds/page-header/title.js +0 -6
- package/app/components/hds/pagination/compact/index.js +0 -6
- package/app/components/hds/pagination/info.js +0 -6
- package/app/components/hds/pagination/nav/arrow.js +0 -6
- package/app/components/hds/pagination/nav/ellipsis.js +0 -6
- package/app/components/hds/pagination/nav/number.js +0 -6
- package/app/components/hds/pagination/numbered/index.js +0 -6
- package/app/components/hds/pagination/size-selector.js +0 -6
- package/app/components/hds/reveal/index.js +0 -6
- package/app/components/hds/reveal/toggle/button.js +0 -6
- package/app/components/hds/segmented-group/index.js +0 -6
- package/app/components/hds/separator/index.js +0 -6
- package/app/components/hds/side-nav/base.js +0 -6
- package/app/components/hds/side-nav/header/home-link.js +0 -6
- package/app/components/hds/side-nav/header/icon-button.js +0 -6
- package/app/components/hds/side-nav/header/index.js +0 -6
- package/app/components/hds/side-nav/index.js +0 -6
- package/app/components/hds/side-nav/list/back-link.js +0 -6
- package/app/components/hds/side-nav/list/index.js +0 -6
- package/app/components/hds/side-nav/list/item.js +0 -6
- package/app/components/hds/side-nav/list/link.js +0 -6
- package/app/components/hds/side-nav/list/title.js +0 -6
- package/app/components/hds/side-nav/portal/index.js +0 -6
- package/app/components/hds/side-nav/portal/target.js +0 -6
- package/app/components/hds/side-nav/toggle-button.js +0 -6
- package/app/components/hds/stepper/step/indicator.js +0 -6
- package/app/components/hds/stepper/task/indicator.js +0 -6
- package/app/components/hds/table/index.js +0 -6
- package/app/components/hds/table/td.js +0 -6
- package/app/components/hds/table/th-sort.js +0 -6
- package/app/components/hds/table/th.js +0 -6
- package/app/components/hds/table/tr.js +0 -6
- package/app/components/hds/tabs/index.js +0 -6
- package/app/components/hds/tabs/panel.js +0 -6
- package/app/components/hds/tabs/tab.js +0 -6
- package/app/components/hds/tag/index.js +0 -6
- package/app/components/hds/text/body.js +0 -6
- package/app/components/hds/text/code.js +0 -6
- package/app/components/hds/text/display.js +0 -6
- package/app/components/hds/text/index.js +0 -6
- package/app/components/hds/toast/index.js +0 -6
- package/app/components/hds/tooltip-button/index.js +0 -6
- package/app/components/hds/yield/index.js +0 -6
- package/app/helpers/hds-link-to-models.js +0 -6
- package/app/helpers/hds-link-to-query.js +0 -6
- package/app/modifiers/hds-clipboard.js +0 -6
- package/app/modifiers/hds-tooltip.js +0 -6
- package/app/styles/@hashicorp/design-system-components.scss +0 -64
- package/app/styles/components/flyout.scss +0 -111
- package/app/styles/components/table.scss +0 -208
- package/app/styles/components/tabs.scss +0 -117
- package/blueprints/hds-component/files/addon/components/hds/__name__/index.hbs +0 -8
- package/blueprints/hds-component/files/addon/components/hds/__name__/index.js +0 -28
- package/blueprints/hds-component/files/app/components/hds/__name__/index.js +0 -6
- package/blueprints/hds-component/files/app/styles/components/__name__.scss +0 -12
- package/blueprints/hds-component/index.js +0 -65
- package/blueprints/hds-component-test/files/tests/acceptance/components/hds/__name__.js +0 -21
- package/blueprints/hds-component-test/files/tests/dummy/app/routes/components/__name__.js +0 -8
- package/blueprints/hds-component-test/files/tests/dummy/app/styles/showcase-pages/__dummyCSSFileName__.scss +0 -6
- package/blueprints/hds-component-test/files/tests/dummy/app/templates/components/__name__.hbs +0 -17
- package/blueprints/hds-component-test/files/tests/integration/components/hds/__name__/index-test.js +0 -25
- package/blueprints/hds-component-test/index.js +0 -151
- package/config/environment.js +0 -10
- package/index.js +0 -32
- package/tsconfig.declarations.json +0 -10
- package/tsconfig.json +0 -47
- package/types/dummy/index.d.ts +0 -7
- package/types/global.d.ts +0 -12
- package/vercel.json +0 -13
- /package/{app → dist}/styles/@hashicorp/design-system-power-select-overrides.scss +0 -0
- /package/{app → dist}/styles/components/accordion.scss +0 -0
- /package/{app → dist}/styles/components/alert.scss +0 -0
- /package/{app → dist}/styles/components/app-footer.scss +0 -0
- /package/{app → dist}/styles/components/app-frame.scss +0 -0
- /package/{app → dist}/styles/components/application-state.scss +0 -0
- /package/{app → dist}/styles/components/badge-count.scss +0 -0
- /package/{app → dist}/styles/components/badge.scss +0 -0
- /package/{app → dist}/styles/components/breadcrumb.scss +0 -0
- /package/{app → dist}/styles/components/button-set.scss +0 -0
- /package/{app → dist}/styles/components/button.scss +0 -0
- /package/{app → dist}/styles/components/card/container.scss +0 -0
- /package/{app → dist}/styles/components/card/index.scss +0 -0
- /package/{app → dist}/styles/components/code-block/index.scss +0 -0
- /package/{app → dist}/styles/components/code-block/theme.scss +0 -0
- /package/{app → dist}/styles/components/copy/button.scss +0 -0
- /package/{app → dist}/styles/components/copy/index.scss +0 -0
- /package/{app → dist}/styles/components/copy/snippet.scss +0 -0
- /package/{app → dist}/styles/components/disclosure-primitive.scss +0 -0
- /package/{app → dist}/styles/components/dismiss-button.scss +0 -0
- /package/{app → dist}/styles/components/dropdown.scss +0 -0
- /package/{app → dist}/styles/components/form/character-count.scss +0 -0
- /package/{app → dist}/styles/components/form/checkbox.scss +0 -0
- /package/{app → dist}/styles/components/form/error.scss +0 -0
- /package/{app → dist}/styles/components/form/field.scss +0 -0
- /package/{app → dist}/styles/components/form/file-input.scss +0 -0
- /package/{app → dist}/styles/components/form/group.scss +0 -0
- /package/{app → dist}/styles/components/form/helper-text.scss +0 -0
- /package/{app → dist}/styles/components/form/index.scss +0 -0
- /package/{app → dist}/styles/components/form/indicator.scss +0 -0
- /package/{app → dist}/styles/components/form/label.scss +0 -0
- /package/{app → dist}/styles/components/form/legend.scss +0 -0
- /package/{app → dist}/styles/components/form/masked-input.scss +0 -0
- /package/{app → dist}/styles/components/form/radio-card.scss +0 -0
- /package/{app → dist}/styles/components/form/radio.scss +0 -0
- /package/{app → dist}/styles/components/form/select.scss +0 -0
- /package/{app → dist}/styles/components/form/text-input.scss +0 -0
- /package/{app → dist}/styles/components/form/textarea.scss +0 -0
- /package/{app → dist}/styles/components/form/toggle.scss +0 -0
- /package/{app → dist}/styles/components/form/visibility-toggle.scss +0 -0
- /package/{app → dist}/styles/components/icon-tile.scss +0 -0
- /package/{app → dist}/styles/components/link/index.scss +0 -0
- /package/{app → dist}/styles/components/link/inline.scss +0 -0
- /package/{app → dist}/styles/components/link/standalone.scss +0 -0
- /package/{app → dist}/styles/components/menu-primitive.scss +0 -0
- /package/{app → dist}/styles/components/modal.scss +0 -0
- /package/{app → dist}/styles/components/page-header.scss +0 -0
- /package/{app → dist}/styles/components/pagination.scss +0 -0
- /package/{app → dist}/styles/components/reveal.scss +0 -0
- /package/{app → dist}/styles/components/segmented-group.scss +0 -0
- /package/{app → dist}/styles/components/separator.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/a11y-refocus.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/content.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/header.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/index.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/main.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/toggle-button.scss +0 -0
- /package/{app → dist}/styles/components/side-nav/vars.scss +0 -0
- /package/{app → dist}/styles/components/stepper/index.scss +0 -0
- /package/{app → dist}/styles/components/stepper/step-indicator.scss +0 -0
- /package/{app → dist}/styles/components/stepper/task-indicator.scss +0 -0
- /package/{app → dist}/styles/components/tag.scss +0 -0
- /package/{app → dist}/styles/components/text.scss +0 -0
- /package/{app → dist}/styles/components/toast.scss +0 -0
- /package/{app → dist}/styles/components/tooltip.scss +0 -0
- /package/{app → dist}/styles/mixins/_button.scss +0 -0
- /package/{app → dist}/styles/mixins/_focus-ring.scss +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { a as _applyDecoratedDescriptor, b as _initializerDefineProperty } from '../../../../_rollupPluginBabelHelpers-lqPQKyNs.js';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { assert } from '@ember/debug';
|
|
4
|
+
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
import { action } from '@ember/object';
|
|
6
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
+
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
|
|
9
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::Button\n class={{this.classNames}}\n @size={{this.size}}\n @isFullWidth={{@isFullWidth}}\n @text={{@text}}\n @icon={{this.icon}}\n @isIconOnly={{@isIconOnly}}\n @color=\"secondary\"\n @iconPosition=\"trailing\"\n {{hds-clipboard text=@textToCopy target=@targetToCopy onSuccess=this.onSuccess onError=this.onError}}\n ...attributes\n/>");
|
|
10
|
+
|
|
11
|
+
var _class, _descriptor, _descriptor2;
|
|
12
|
+
const DEFAULT_SIZE = 'medium';
|
|
13
|
+
const SIZES = ['small', 'medium'];
|
|
14
|
+
const DEFAULT_ICON = 'clipboard-copy';
|
|
15
|
+
const SUCCESS_ICON = 'clipboard-checked';
|
|
16
|
+
const ERROR_ICON = 'clipboard-x';
|
|
17
|
+
const DEFAULT_STATUS = 'idle';
|
|
18
|
+
let HdsCopyButtonComponent = (_class = class HdsCopyButtonComponent extends Component {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
_initializerDefineProperty(this, "status", _descriptor, this);
|
|
22
|
+
_initializerDefineProperty(this, "timer", _descriptor2, this);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @param icon
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @description The icon to be displayed for each status; automatically calculated based on the tracked property `status`.
|
|
28
|
+
*/
|
|
29
|
+
get icon() {
|
|
30
|
+
let icon = DEFAULT_ICON;
|
|
31
|
+
if (this.status === 'success') {
|
|
32
|
+
icon = SUCCESS_ICON;
|
|
33
|
+
} else if (this.status === 'error') {
|
|
34
|
+
icon = ERROR_ICON;
|
|
35
|
+
}
|
|
36
|
+
return icon;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @param size
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @default medium
|
|
43
|
+
* @description The size of the copy/button; acceptable values are `small` and `medium`
|
|
44
|
+
*/
|
|
45
|
+
get size() {
|
|
46
|
+
let {
|
|
47
|
+
size = DEFAULT_SIZE
|
|
48
|
+
} = this.args;
|
|
49
|
+
assert(`@size for "Hds::Copy::Button" must be one of the following: ${SIZES.join(', ')}; received: ${size}`, SIZES.includes(size));
|
|
50
|
+
return size;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get the class names to apply to the component.
|
|
55
|
+
* @method CopyButton#classNames
|
|
56
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
57
|
+
*/
|
|
58
|
+
get classNames() {
|
|
59
|
+
let classes = ['hds-copy-button'];
|
|
60
|
+
|
|
61
|
+
// add a class based on the @size argument
|
|
62
|
+
classes.push(`hds-button--size-${this.size}`);
|
|
63
|
+
classes.push(`hds-copy-button--status-${this.status}`);
|
|
64
|
+
return classes.join(' ');
|
|
65
|
+
}
|
|
66
|
+
onSuccess(args) {
|
|
67
|
+
this.status = 'success';
|
|
68
|
+
this.resetStatusDelayed();
|
|
69
|
+
let {
|
|
70
|
+
onSuccess
|
|
71
|
+
} = this.args;
|
|
72
|
+
if (typeof onSuccess === 'function') {
|
|
73
|
+
onSuccess(args);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
onError(args) {
|
|
77
|
+
this.status = 'error';
|
|
78
|
+
this.resetStatusDelayed();
|
|
79
|
+
let {
|
|
80
|
+
onError
|
|
81
|
+
} = this.args;
|
|
82
|
+
if (typeof onError === 'function') {
|
|
83
|
+
onError(args);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
resetStatusDelayed() {
|
|
87
|
+
clearTimeout(this.timer);
|
|
88
|
+
// make it fade back to the default state
|
|
89
|
+
this.timer = setTimeout(() => {
|
|
90
|
+
this.status = DEFAULT_STATUS;
|
|
91
|
+
}, 1500);
|
|
92
|
+
}
|
|
93
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "status", [tracked], {
|
|
94
|
+
configurable: true,
|
|
95
|
+
enumerable: true,
|
|
96
|
+
writable: true,
|
|
97
|
+
initializer: function () {
|
|
98
|
+
return DEFAULT_STATUS;
|
|
99
|
+
}
|
|
100
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "timer", [tracked], {
|
|
101
|
+
configurable: true,
|
|
102
|
+
enumerable: true,
|
|
103
|
+
writable: true,
|
|
104
|
+
initializer: null
|
|
105
|
+
}), _applyDecoratedDescriptor(_class.prototype, "onSuccess", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onSuccess"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onError", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onError"), _class.prototype)), _class);
|
|
106
|
+
setComponentTemplate(TEMPLATE, HdsCopyButtonComponent);
|
|
107
|
+
|
|
108
|
+
export { DEFAULT_ICON, DEFAULT_SIZE, DEFAULT_STATUS, ERROR_ICON, SIZES, SUCCESS_ICON, HdsCopyButtonComponent as default };
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/copy/button/index.hbs","../../../../../src/components/hds/copy/button/index.js"],"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::Button\\n class={{this.classNames}}\\n @size={{this.size}}\\n @isFullWidth={{@isFullWidth}}\\n @text={{@text}}\\n @icon={{this.icon}}\\n @isIconOnly={{@isIconOnly}}\\n @color=\\\"secondary\\\"\\n @iconPosition=\\\"trailing\\\"\\n {{hds-clipboard text=@textToCopy target=@targetToCopy onSuccess=this.onSuccess onError=this.onError}}\\n ...attributes\\n/>\")","/**\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 { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport const DEFAULT_SIZE = 'medium';\nexport const SIZES = ['small', 'medium'];\nexport const DEFAULT_ICON = 'clipboard-copy';\nexport const SUCCESS_ICON = 'clipboard-checked';\nexport const ERROR_ICON = 'clipboard-x';\nexport const DEFAULT_STATUS = 'idle';\n\nexport default class HdsCopyButtonComponent extends Component {\n @tracked status = DEFAULT_STATUS;\n @tracked timer;\n\n /**\n * @param icon\n * @type {string}\n * @description The icon to be displayed for each status; automatically calculated based on the tracked property `status`.\n */\n get icon() {\n let icon = DEFAULT_ICON;\n if (this.status === 'success') {\n icon = SUCCESS_ICON;\n } else if (this.status === 'error') {\n icon = ERROR_ICON;\n }\n return icon;\n }\n\n /**\n * @param size\n * @type {string}\n * @default medium\n * @description The size of the copy/button; acceptable values are `small` and `medium`\n */\n get size() {\n let { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Copy::Button\" 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 * Get the class names to apply to the component.\n * @method CopyButton#classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-copy-button'];\n\n // add a class based on the @size argument\n classes.push(`hds-button--size-${this.size}`);\n\n classes.push(`hds-copy-button--status-${this.status}`);\n\n return classes.join(' ');\n }\n\n @action\n onSuccess(args) {\n this.status = 'success';\n this.resetStatusDelayed();\n\n let { onSuccess } = this.args;\n\n if (typeof onSuccess === 'function') {\n onSuccess(args);\n }\n }\n\n @action\n onError(args) {\n this.status = 'error';\n this.resetStatusDelayed();\n\n let { onError } = this.args;\n\n if (typeof onError === 'function') {\n onError(args);\n }\n }\n\n resetStatusDelayed() {\n clearTimeout(this.timer);\n // make it fade back to the default state\n this.timer = setTimeout(() => {\n this.status = DEFAULT_STATUS;\n }, 1500);\n }\n}\n"],"names":["DEFAULT_SIZE","SIZES","DEFAULT_ICON","SUCCESS_ICON","ERROR_ICON","DEFAULT_STATUS","HdsCopyButtonComponent","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","icon","status","size","assert","join","includes","classNames","classes","push","onSuccess","resetStatusDelayed","onError","clearTimeout","timer","setTimeout","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":"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"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { a as _applyDecoratedDescriptor, b as _initializerDefineProperty } from '../../../../_rollupPluginBabelHelpers-lqPQKyNs.js';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { assert } from '@ember/debug';
|
|
4
|
+
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
import { action } from '@ember/object';
|
|
6
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
+
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
|
|
9
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<button\n type=\"button\"\n class={{this.classNames}}\n {{hds-clipboard text=@textToCopy onSuccess=this.onSuccess onError=this.onError}}\n ...attributes\n>\n <Hds::Text::Code class=\"hds-copy-snippet__text\" @tag=\"span\" @size=\"100\">\n {{@textToCopy}}\n </Hds::Text::Code>\n <FlightIcon @name={{this.icon}} class=\"hds-copy-snippet__icon\" />\n</button>");
|
|
10
|
+
|
|
11
|
+
var _class, _descriptor, _descriptor2;
|
|
12
|
+
const DEFAULT_COLOR = 'primary';
|
|
13
|
+
const COLORS = ['primary', 'secondary'];
|
|
14
|
+
const DEFAULT_ICON = 'clipboard-copy';
|
|
15
|
+
const SUCCESS_ICON = 'clipboard-checked';
|
|
16
|
+
const ERROR_ICON = 'clipboard-x';
|
|
17
|
+
const DEFAULT_STATUS = 'idle';
|
|
18
|
+
let HdsCopySnippetIndexComponent = (_class = class HdsCopySnippetIndexComponent extends Component {
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
super(...args);
|
|
21
|
+
_initializerDefineProperty(this, "status", _descriptor, this);
|
|
22
|
+
_initializerDefineProperty(this, "timer", _descriptor2, this);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @param icon
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @default DEFAULT_ICON
|
|
28
|
+
* @description Determines the icon to be used, based on the success state. Note that this is auto-tracked because it depends on a tracked property (status).
|
|
29
|
+
*/
|
|
30
|
+
get icon() {
|
|
31
|
+
let icon = DEFAULT_ICON;
|
|
32
|
+
if (this.status === 'success') {
|
|
33
|
+
icon = SUCCESS_ICON;
|
|
34
|
+
} else if (this.status === 'error') {
|
|
35
|
+
icon = ERROR_ICON;
|
|
36
|
+
}
|
|
37
|
+
return icon;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param color
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @default primary
|
|
44
|
+
* @description Determines the color of button to be used; acceptable values are `primary` and `secondary`
|
|
45
|
+
*/
|
|
46
|
+
get color() {
|
|
47
|
+
let {
|
|
48
|
+
color = DEFAULT_COLOR
|
|
49
|
+
} = this.args;
|
|
50
|
+
assert(`@color for "Hds::Copy::Snippet" must be one of the following: ${COLORS.join(', ')}; received: ${color}`, COLORS.includes(color));
|
|
51
|
+
return color;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param isFullWidth
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
* @default false
|
|
58
|
+
* @description Indicates that the component should take up the full width of the parent container.
|
|
59
|
+
*/
|
|
60
|
+
get isFullWidth() {
|
|
61
|
+
return this.args.isFullWidth ?? false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @param isTruncated
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
* @default false
|
|
68
|
+
* @description Indicates that the component should be truncated instead of wrapping text and using multiple lines.
|
|
69
|
+
*/
|
|
70
|
+
get isTruncated() {
|
|
71
|
+
return this.args.isTruncated ?? false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get the class names to apply to the component.
|
|
76
|
+
* @method CopySnippet#classNames
|
|
77
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
78
|
+
*/
|
|
79
|
+
get classNames() {
|
|
80
|
+
let classes = ['hds-copy-snippet'];
|
|
81
|
+
|
|
82
|
+
// add a class based on the @color argument
|
|
83
|
+
classes.push(`hds-copy-snippet--color-${this.color}`);
|
|
84
|
+
|
|
85
|
+
// add a class based on the tracked status (idle/success/error)
|
|
86
|
+
classes.push(`hds-copy-snippet--status-${this.status}`);
|
|
87
|
+
|
|
88
|
+
// add a class based on the @isTruncated argument
|
|
89
|
+
if (this.isTruncated) {
|
|
90
|
+
classes.push('hds-copy-snippet--is-truncated');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// add a class based on the @isFullWidth argument
|
|
94
|
+
if (this.isFullWidth) {
|
|
95
|
+
classes.push('hds-copy-snippet--width-full');
|
|
96
|
+
}
|
|
97
|
+
return classes.join(' ');
|
|
98
|
+
}
|
|
99
|
+
onSuccess(args) {
|
|
100
|
+
this.status = 'success';
|
|
101
|
+
this.resetStatusDelayed();
|
|
102
|
+
let {
|
|
103
|
+
onSuccess
|
|
104
|
+
} = this.args;
|
|
105
|
+
if (typeof onSuccess === 'function') {
|
|
106
|
+
onSuccess(args);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
onError(args) {
|
|
110
|
+
this.status = 'error';
|
|
111
|
+
this.resetStatusDelayed();
|
|
112
|
+
let {
|
|
113
|
+
onError
|
|
114
|
+
} = this.args;
|
|
115
|
+
if (typeof onError === 'function') {
|
|
116
|
+
onError(args);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
resetStatusDelayed() {
|
|
120
|
+
clearTimeout(this.timer);
|
|
121
|
+
// make it fade back to the default state
|
|
122
|
+
this.timer = setTimeout(() => {
|
|
123
|
+
this.status = DEFAULT_STATUS;
|
|
124
|
+
}, 1500);
|
|
125
|
+
}
|
|
126
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "status", [tracked], {
|
|
127
|
+
configurable: true,
|
|
128
|
+
enumerable: true,
|
|
129
|
+
writable: true,
|
|
130
|
+
initializer: function () {
|
|
131
|
+
return DEFAULT_STATUS;
|
|
132
|
+
}
|
|
133
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "timer", [tracked], {
|
|
134
|
+
configurable: true,
|
|
135
|
+
enumerable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
initializer: null
|
|
138
|
+
}), _applyDecoratedDescriptor(_class.prototype, "onSuccess", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onSuccess"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "onError", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onError"), _class.prototype)), _class);
|
|
139
|
+
setComponentTemplate(TEMPLATE, HdsCopySnippetIndexComponent);
|
|
140
|
+
|
|
141
|
+
export { COLORS, DEFAULT_COLOR, DEFAULT_ICON, DEFAULT_STATUS, ERROR_ICON, SUCCESS_ICON, HdsCopySnippetIndexComponent as default };
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/hds/copy/snippet/index.hbs","../../../../../src/components/hds/copy/snippet/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<button\\n type=\\\"button\\\"\\n class={{this.classNames}}\\n {{hds-clipboard text=@textToCopy onSuccess=this.onSuccess onError=this.onError}}\\n ...attributes\\n>\\n <Hds::Text::Code class=\\\"hds-copy-snippet__text\\\" @tag=\\\"span\\\" @size=\\\"100\\\">\\n {{@textToCopy}}\\n </Hds::Text::Code>\\n <FlightIcon @name={{this.icon}} class=\\\"hds-copy-snippet__icon\\\" />\\n</button>\")","/**\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 { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport const DEFAULT_COLOR = 'primary';\nexport const COLORS = ['primary', 'secondary'];\nexport const DEFAULT_ICON = 'clipboard-copy';\nexport const SUCCESS_ICON = 'clipboard-checked';\nexport const ERROR_ICON = 'clipboard-x';\nexport const DEFAULT_STATUS = 'idle';\n\nexport default class HdsCopySnippetIndexComponent extends Component {\n @tracked status = DEFAULT_STATUS;\n @tracked timer;\n\n /**\n * @param icon\n * @type {string}\n * @default DEFAULT_ICON\n * @description Determines the icon to be used, based on the success state. Note that this is auto-tracked because it depends on a tracked property (status).\n */\n get icon() {\n let icon = DEFAULT_ICON;\n if (this.status === 'success') {\n icon = SUCCESS_ICON;\n } else if (this.status === 'error') {\n icon = ERROR_ICON;\n }\n return icon;\n }\n\n /**\n * @param color\n * @type {string}\n * @default primary\n * @description Determines the color of button to be used; acceptable values are `primary` and `secondary`\n */\n get color() {\n let { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Copy::Snippet\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n /**\n * @param isFullWidth\n * @type {boolean}\n * @default false\n * @description Indicates that the component should take up the full width of the parent container.\n */\n get isFullWidth() {\n return this.args.isFullWidth ?? false;\n }\n\n /**\n * @param isTruncated\n * @type {boolean}\n * @default false\n * @description Indicates that the component should be truncated instead of wrapping text and using multiple lines.\n */\n get isTruncated() {\n return this.args.isTruncated ?? false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method CopySnippet#classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-copy-snippet'];\n\n // add a class based on the @color argument\n classes.push(`hds-copy-snippet--color-${this.color}`);\n\n // add a class based on the tracked status (idle/success/error)\n classes.push(`hds-copy-snippet--status-${this.status}`);\n\n // add a class based on the @isTruncated argument\n if (this.isTruncated) {\n classes.push('hds-copy-snippet--is-truncated');\n }\n\n // add a class based on the @isFullWidth argument\n if (this.isFullWidth) {\n classes.push('hds-copy-snippet--width-full');\n }\n\n return classes.join(' ');\n }\n\n @action\n onSuccess(args) {\n this.status = 'success';\n this.resetStatusDelayed();\n\n let { onSuccess } = this.args;\n\n if (typeof onSuccess === 'function') {\n onSuccess(args);\n }\n }\n\n @action\n onError(args) {\n this.status = 'error';\n this.resetStatusDelayed();\n\n let { onError } = this.args;\n\n if (typeof onError === 'function') {\n onError(args);\n }\n }\n\n resetStatusDelayed() {\n clearTimeout(this.timer);\n // make it fade back to the default state\n this.timer = setTimeout(() => {\n this.status = DEFAULT_STATUS;\n }, 1500);\n }\n}\n"],"names":["DEFAULT_COLOR","COLORS","DEFAULT_ICON","SUCCESS_ICON","ERROR_ICON","DEFAULT_STATUS","HdsCopySnippetIndexComponent","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","_descriptor2","icon","status","color","assert","join","includes","isFullWidth","isTruncated","classNames","classes","push","onSuccess","resetStatusDelayed","onError","clearTimeout","timer","setTimeout","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,8bAA8b;;;ACSzd,MAAMA,aAAa,GAAG,UAAS;MACzBC,MAAM,GAAG,CAAC,SAAS,EAAE,WAAW,EAAC;AACvC,MAAMC,YAAY,GAAG,iBAAgB;AACrC,MAAMC,YAAY,GAAG,oBAAmB;AACxC,MAAMC,UAAU,GAAG,cAAa;AAChC,MAAMC,cAAc,GAAG,OAAM;AAEfC,IAAAA,4BAA4B,IAAAC,MAAA,GAAlC,MAAMD,4BAA4B,SAASE,SAAS,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,iBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAAD,IAAAA,0BAAA,gBAAAE,YAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAIlE;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,IAAIA,GAAG;IACT,IAAIA,IAAI,GAAGZ,YAAY,CAAA;AACvB,IAAA,IAAI,IAAI,CAACa,MAAM,KAAK,SAAS,EAAE;AAC7BD,MAAAA,IAAI,GAAGX,YAAY,CAAA;AACrB,KAAC,MAAM,IAAI,IAAI,CAACY,MAAM,KAAK,OAAO,EAAE;AAClCD,MAAAA,IAAI,GAAGV,UAAU,CAAA;AACnB,KAAA;AACA,IAAA,OAAOU,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAIE,KAAKA,GAAG;IACV,IAAI;AAAEA,MAAAA,KAAK,GAAGhB,aAAAA;KAAe,GAAG,IAAI,CAACU,IAAI,CAAA;AAEzCO,IAAAA,MAAM,CACH,CAAgEhB,8DAAAA,EAAAA,MAAM,CAACiB,IAAI,CAC1E,IACF,CAAE,CAAA,YAAA,EAAcF,KAAM,CAAA,CAAC,EACvBf,MAAM,CAACkB,QAAQ,CAACH,KAAK,CACvB,CAAC,CAAA;AAED,IAAA,OAAOA,KAAK,CAAA;AACd,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAII,WAAWA,GAAG;AAChB,IAAA,OAAO,IAAI,CAACV,IAAI,CAACU,WAAW,IAAI,KAAK,CAAA;AACvC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,WAAWA,GAAG;AAChB,IAAA,OAAO,IAAI,CAACX,IAAI,CAACW,WAAW,IAAI,KAAK,CAAA;AACvC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,kBAAkB,CAAC,CAAA;;AAElC;IACAA,OAAO,CAACC,IAAI,CAAE,CAAA,wBAAA,EAA0B,IAAI,CAACR,KAAM,EAAC,CAAC,CAAA;;AAErD;IACAO,OAAO,CAACC,IAAI,CAAE,CAAA,yBAAA,EAA2B,IAAI,CAACT,MAAO,EAAC,CAAC,CAAA;;AAEvD;IACA,IAAI,IAAI,CAACM,WAAW,EAAE;AACpBE,MAAAA,OAAO,CAACC,IAAI,CAAC,gCAAgC,CAAC,CAAA;AAChD,KAAA;;AAEA;IACA,IAAI,IAAI,CAACJ,WAAW,EAAE;AACpBG,MAAAA,OAAO,CAACC,IAAI,CAAC,8BAA8B,CAAC,CAAA;AAC9C,KAAA;AAEA,IAAA,OAAOD,OAAO,CAACL,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;EAGAO,SAASA,CAACf,IAAI,EAAE;IACd,IAAI,CAACK,MAAM,GAAG,SAAS,CAAA;IACvB,IAAI,CAACW,kBAAkB,EAAE,CAAA;IAEzB,IAAI;AAAED,MAAAA,SAAAA;KAAW,GAAG,IAAI,CAACf,IAAI,CAAA;AAE7B,IAAA,IAAI,OAAOe,SAAS,KAAK,UAAU,EAAE;MACnCA,SAAS,CAACf,IAAI,CAAC,CAAA;AACjB,KAAA;AACF,GAAA;EAGAiB,OAAOA,CAACjB,IAAI,EAAE;IACZ,IAAI,CAACK,MAAM,GAAG,OAAO,CAAA;IACrB,IAAI,CAACW,kBAAkB,EAAE,CAAA;IAEzB,IAAI;AAAEC,MAAAA,OAAAA;KAAS,GAAG,IAAI,CAACjB,IAAI,CAAA;AAE3B,IAAA,IAAI,OAAOiB,OAAO,KAAK,UAAU,EAAE;MACjCA,OAAO,CAACjB,IAAI,CAAC,CAAA;AACf,KAAA;AACF,GAAA;AAEAgB,EAAAA,kBAAkBA,GAAG;AACnBE,IAAAA,YAAY,CAAC,IAAI,CAACC,KAAK,CAAC,CAAA;AACxB;AACA,IAAA,IAAI,CAACA,KAAK,GAAGC,UAAU,CAAC,MAAM;MAC5B,IAAI,CAACf,MAAM,GAAGV,cAAc,CAAA;KAC7B,EAAE,IAAI,CAAC,CAAA;AACV,GAAA;AACF,CAAC,GAAAO,WAAA,GAAAmB,yBAAA,CAAAxB,MAAA,CAAAyB,SAAA,EAAA,QAAA,EAAA,CApHEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAUhC,cAAc,CAAA;AAAA,GAAA;AAAA,CAAAQ,CAAAA,EAAAA,YAAA,GAAAkB,yBAAA,CAAAxB,MAAA,CAAAyB,SAAA,YAC/BC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAA,CAAA,EAAAN,yBAAA,CAAAxB,MAAA,CAAAyB,SAAA,EAAA,WAAA,EAAA,CAoFPM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAjC,MAAA,CAAAyB,SAAA,EAAAzB,WAAAA,CAAAA,EAAAA,MAAA,CAAAyB,SAAA,CAAA,EAAAD,yBAAA,CAAAxB,MAAA,CAAAyB,SAAA,cAYNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAjC,MAAA,CAAAyB,SAAA,EAAA,SAAA,CAAA,EAAAzB,MAAA,CAAAyB,SAAA,IAAAzB,MAAA,EAAA;AAlGwCkC,oBAAA,CAAAC,QAAA,EAAApC,4BAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { a as _applyDecoratedDescriptor, b as _initializerDefineProperty } from '../../../_rollupPluginBabelHelpers-lqPQKyNs.js';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { schedule } from '@ember/runloop';
|
|
6
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
|
+
import { setComponentTemplate } from '@ember/component';
|
|
8
|
+
|
|
9
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<div class=\"hds-disclosure-primitive\" ...attributes>\n <div class=\"hds-disclosure-primitive__toggle\">\n {{yield (hash onClickToggle=this.onClickToggle isOpen=this.isOpen) to=\"toggle\"}}\n </div>\n {{#if this.isOpen}}\n <div class=\"hds-disclosure-primitive__content\">\n {{yield (hash close=this.close) to=\"content\"}}\n </div>\n {{/if}}\n</div>");
|
|
10
|
+
|
|
11
|
+
var _class, _descriptor;
|
|
12
|
+
let HdsDisclosurePrimitiveComponent = (_class = class HdsDisclosurePrimitiveComponent extends Component {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
super(...args);
|
|
15
|
+
_initializerDefineProperty(this, "isOpen", _descriptor, this);
|
|
16
|
+
}
|
|
17
|
+
onClickToggle() {
|
|
18
|
+
this.isOpen = !this.isOpen;
|
|
19
|
+
}
|
|
20
|
+
close() {
|
|
21
|
+
// we schedule this afterRender to avoid an error in tests caused by updating `isOpen` multiple times in the same computation
|
|
22
|
+
schedule('afterRender', () => {
|
|
23
|
+
this.isOpen = false;
|
|
24
|
+
// we call the "onClose" callback if it exists (and is a function)
|
|
25
|
+
if (this.args.onClose && typeof this.args.onClose === 'function') {
|
|
26
|
+
this.args.onClose();
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "isOpen", [tracked], {
|
|
31
|
+
configurable: true,
|
|
32
|
+
enumerable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
initializer: function () {
|
|
35
|
+
return this.args.isOpen ?? false;
|
|
36
|
+
}
|
|
37
|
+
}), _applyDecoratedDescriptor(_class.prototype, "onClickToggle", [action], Object.getOwnPropertyDescriptor(_class.prototype, "onClickToggle"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "close", [action], Object.getOwnPropertyDescriptor(_class.prototype, "close"), _class.prototype)), _class);
|
|
38
|
+
setComponentTemplate(TEMPLATE, HdsDisclosurePrimitiveComponent);
|
|
39
|
+
|
|
40
|
+
export { HdsDisclosurePrimitiveComponent as default };
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/disclosure-primitive/index.hbs","../../../../src/components/hds/disclosure-primitive/index.js"],"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=\\\"hds-disclosure-primitive\\\" ...attributes>\\n <div class=\\\"hds-disclosure-primitive__toggle\\\">\\n {{yield (hash onClickToggle=this.onClickToggle isOpen=this.isOpen) to=\\\"toggle\\\"}}\\n </div>\\n {{#if this.isOpen}}\\n <div class=\\\"hds-disclosure-primitive__content\\\">\\n {{yield (hash close=this.close) to=\\\"content\\\"}}\\n </div>\\n {{/if}}\\n</div>\")","/**\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 { schedule } from '@ember/runloop';\n\nexport default class HdsDisclosurePrimitiveComponent extends Component {\n @tracked isOpen = this.args.isOpen ?? false;\n\n @action\n onClickToggle() {\n this.isOpen = !this.isOpen;\n }\n\n @action\n close() {\n // we schedule this afterRender to avoid an error in tests caused by updating `isOpen` multiple times in the same computation\n schedule('afterRender', () => {\n this.isOpen = false;\n // we call the \"onClose\" callback if it exists (and is a function)\n if (this.args.onClose && typeof this.args.onClose === 'function') {\n this.args.onClose();\n }\n });\n }\n}\n"],"names":["HdsDisclosurePrimitiveComponent","_class","Component","constructor","args","_initializerDefineProperty","_descriptor","onClickToggle","isOpen","close","schedule","onClose","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AACA,eAAe,kBAAkB,CAAC,icAAic;;;ACS9cA,IAAAA,+BAA+B,IAAAC,MAAA,GAArC,MAAMD,+BAA+B,SAASE,SAAS,CAAC;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,iBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAIrEC,EAAAA,aAAaA,GAAG;AACd,IAAA,IAAI,CAACC,MAAM,GAAG,CAAC,IAAI,CAACA,MAAM,CAAA;AAC5B,GAAA;AAGAC,EAAAA,KAAKA,GAAG;AACN;IACAC,QAAQ,CAAC,aAAa,EAAE,MAAM;MAC5B,IAAI,CAACF,MAAM,GAAG,KAAK,CAAA;AACnB;AACA,MAAA,IAAI,IAAI,CAACJ,IAAI,CAACO,OAAO,IAAI,OAAO,IAAI,CAACP,IAAI,CAACO,OAAO,KAAK,UAAU,EAAE;AAChE,QAAA,IAAI,CAACP,IAAI,CAACO,OAAO,EAAE,CAAA;AACrB,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAA;AACF,CAAC,GAAAL,WAAA,GAAAM,yBAAA,CAAAX,MAAA,CAAAY,SAAA,EAAA,QAAA,EAAA,CAlBEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;AAAAC,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAU,IAAI,CAACd,IAAI,CAACI,MAAM,IAAI,KAAK,CAAA;AAAA,GAAA;AAAA,CAAA,CAAA,EAAAI,yBAAA,CAAAX,MAAA,CAAAY,SAAA,EAAA,eAAA,EAAA,CAE1CM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAApB,MAAA,CAAAY,SAAA,EAAAZ,eAAAA,CAAAA,EAAAA,MAAA,CAAAY,SAAA,CAAA,EAAAD,yBAAA,CAAAX,MAAA,CAAAY,SAAA,YAKNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAApB,MAAA,CAAAY,SAAA,EAAA,OAAA,CAAA,EAAAZ,MAAA,CAAAY,SAAA,IAAAZ,MAAA,EAAA;AAR2CqB,oBAAA,CAAAC,QAAA,EAAAvB,+BAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<button class=\"hds-dismiss-button\" type=\"button\" aria-label={{this.ariaLabel}} ...attributes>\n <FlightIcon @name=\"x\" @size=\"16\" @isInlineBlock={{false}} />\n</button>");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
class HdsDismissButtonIndexComponent extends Component {
|
|
13
|
+
/**
|
|
14
|
+
* @param ariaLabel
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @default 'Dismiss'
|
|
17
|
+
*/
|
|
18
|
+
get ariaLabel() {
|
|
19
|
+
return this.args.ariaLabel ?? 'Dismiss';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
setComponentTemplate(TEMPLATE, HdsDismissButtonIndexComponent);
|
|
23
|
+
|
|
24
|
+
export { HdsDismissButtonIndexComponent as default };
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/dismiss-button/index.hbs","../../../../src/components/hds/dismiss-button/index.js"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<button class=\\\"hds-dismiss-button\\\" type=\\\"button\\\" aria-label={{this.ariaLabel}} ...attributes>\\n <FlightIcon @name=\\\"x\\\" @size=\\\"16\\\" @isInlineBlock={{false}} />\\n</button>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport default class HdsDismissButtonIndexComponent extends Component {\n /**\n * @param ariaLabel\n * @type {string}\n * @default 'Dismiss'\n */\n get ariaLabel() {\n return this.args.ariaLabel ?? 'Dismiss';\n }\n}\n"],"names":["HdsDismissButtonIndexComponent","Component","ariaLabel","args","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,gQAAgQ;;ACDlS;AACA;AACA;AACA;;AAIe,MAAMA,8BAA8B,SAASC,SAAS,CAAC;AACpE;AACF;AACA;AACA;AACA;EACE,IAAIC,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,SAAS,IAAI,SAAS,CAAA;AACzC,GAAA;AACF,CAAA;AAACE,oBAAA,CAAAC,QAAA,EAToBL,8BAA8B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import templateOnly from '@ember/component/template-only';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div class=\"hds-dropdown__footer {{if @hasDivider \'hds-dropdown__footer--with-divider\'}}\" ...attributes>\n {{yield}}\n</div>");
|
|
6
|
+
|
|
7
|
+
var footer = setComponentTemplate(TEMPLATE, templateOnly());
|
|
8
|
+
|
|
9
|
+
export { footer as default };
|
|
10
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/hds/dropdown/footer.hbs","../../../../src/components/hds/dropdown/footer.js"],"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<div class=\\\"hds-dropdown__footer {{if @hasDivider \\'hds-dropdown__footer--with-divider\\'}}\\\" ...attributes>\\n {{yield}}\\n</div>\")","import templateOnly from '@ember/component/template-only';\nexport default templateOnly();\n"],"names":["setComponentTemplate","TEMPLATE","templateOnly"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,mNAAmN;;ACArP,aAAAA,oBAAA,CAAAC,QAAA,EAAeC,YAAY,EAAE,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import templateOnly from '@ember/component/template-only';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div class=\"hds-dropdown__header {{if @hasDivider \'hds-dropdown__header--with-divider\'}}\" ...attributes>\n {{yield}}\n</div>");
|
|
6
|
+
|
|
7
|
+
var header = setComponentTemplate(TEMPLATE, templateOnly());
|
|
8
|
+
|
|
9
|
+
export { header as default };
|
|
10
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/hds/dropdown/header.hbs","../../../../src/components/hds/dropdown/header.js"],"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<div class=\\\"hds-dropdown__header {{if @hasDivider \\'hds-dropdown__header--with-divider\\'}}\\\" ...attributes>\\n {{yield}}\\n</div>\")","import templateOnly from '@ember/component/template-only';\nexport default templateOnly();\n"],"names":["setComponentTemplate","TEMPLATE","templateOnly"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,mNAAmN;;ACArP,aAAAA,oBAAA,CAAAC,QAAA,EAAeC,YAAY,EAAE,CAAA;;;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { a as _applyDecoratedDescriptor } from '../../../_rollupPluginBabelHelpers-lqPQKyNs.js';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import { action } from '@ember/object';
|
|
4
|
+
import { assert } from '@ember/debug';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<Hds::MenuPrimitive class={{this.classNames}} @onClose={{@onClose}} ...attributes>\n <:toggle as |t|>\n {{yield\n (hash\n ToggleButton=(component \"hds/dropdown/toggle/button\" isOpen=t.isOpen onClick=t.onClickToggle)\n ToggleIcon=(component \"hds/dropdown/toggle/icon\" isOpen=t.isOpen onClick=t.onClickToggle)\n )\n }}\n </:toggle>\n <:content as |c|>\n <div class={{this.classNamesContent}} {{style width=@width max-height=@height}}>\n {{yield (hash Header=(component \"hds/dropdown/header\"))}}\n <ul class=\"hds-dropdown__list\" {{did-insert this.didInsertList}}>\n {{yield\n (hash\n close=c.close\n Checkbox=(component \"hds/dropdown/list-item/checkbox\")\n Checkmark=(component \"hds/dropdown/list-item/checkmark\")\n CopyItem=(component \"hds/dropdown/list-item/copy-item\")\n Description=(component \"hds/dropdown/list-item/description\")\n Generic=(component \"hds/dropdown/list-item/generic\")\n Interactive=(component \"hds/dropdown/list-item/interactive\")\n Radio=(component \"hds/dropdown/list-item/radio\")\n Separator=(component \"hds/dropdown/list-item/separator\")\n Title=(component \"hds/dropdown/list-item/title\")\n )\n }}\n </ul>\n {{yield (hash close=c.close Footer=(component \"hds/dropdown/footer\"))}}\n </div>\n </:content>\n</Hds::MenuPrimitive>");
|
|
9
|
+
|
|
10
|
+
var _class;
|
|
11
|
+
const DEFAULT_POSITION = 'bottom-right';
|
|
12
|
+
const POSITIONS = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
|
|
13
|
+
let HdsDropdownIndexComponent = (_class = class HdsDropdownIndexComponent extends Component {
|
|
14
|
+
/**
|
|
15
|
+
* @param listPosition
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @default bottom-right
|
|
18
|
+
* @description Determines the position of the "list"
|
|
19
|
+
*/
|
|
20
|
+
get listPosition() {
|
|
21
|
+
let {
|
|
22
|
+
listPosition = DEFAULT_POSITION
|
|
23
|
+
} = this.args;
|
|
24
|
+
assert(`@listPosition for "Hds::Dropdown::Index" must be one of the following: ${POSITIONS.join(', ')}; received: ${listPosition}`, POSITIONS.includes(listPosition));
|
|
25
|
+
return listPosition;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get the class names to apply to the element
|
|
30
|
+
* @method classNames
|
|
31
|
+
* @return {string} The "class" attribute to apply to the root element
|
|
32
|
+
*/
|
|
33
|
+
get classNames() {
|
|
34
|
+
let classes = ['hds-dropdown'];
|
|
35
|
+
|
|
36
|
+
// add a class based on the @isInline argument
|
|
37
|
+
if (this.args.isInline) {
|
|
38
|
+
classes.push('hds-dropdown--is-inline');
|
|
39
|
+
}
|
|
40
|
+
return classes.join(' ');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Get the class names to apply to the content
|
|
45
|
+
* @method classNamesContent
|
|
46
|
+
* @return {string} The "class" attribute to apply to the disclosed content
|
|
47
|
+
*/
|
|
48
|
+
get classNamesContent() {
|
|
49
|
+
let classes = ['hds-dropdown__content'];
|
|
50
|
+
|
|
51
|
+
// add a class based on the @listPosition argument
|
|
52
|
+
classes.push(`hds-dropdown__content--position-${this.listPosition}`);
|
|
53
|
+
|
|
54
|
+
// add a class based on the @width argument
|
|
55
|
+
if (this.args.width) {
|
|
56
|
+
classes.push('hds-dropdown__content--fixed-width');
|
|
57
|
+
}
|
|
58
|
+
return classes.join(' ');
|
|
59
|
+
}
|
|
60
|
+
didInsertList(element) {
|
|
61
|
+
const checkmarkItems = element.querySelectorAll(`[role="option"]`);
|
|
62
|
+
if (checkmarkItems.length) {
|
|
63
|
+
const toggleButtonId = element.closest('.hds-dropdown')?.querySelector('.hds-dropdown-toggle-button')?.getAttribute('id');
|
|
64
|
+
element.setAttribute('role', 'listbox');
|
|
65
|
+
element.setAttribute('aria-labelledby', toggleButtonId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, (_applyDecoratedDescriptor(_class.prototype, "didInsertList", [action], Object.getOwnPropertyDescriptor(_class.prototype, "didInsertList"), _class.prototype)), _class);
|
|
69
|
+
setComponentTemplate(TEMPLATE, HdsDropdownIndexComponent);
|
|
70
|
+
|
|
71
|
+
export { DEFAULT_POSITION, POSITIONS, HdsDropdownIndexComponent as default };
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/dropdown/index.hbs","../../../../src/components/hds/dropdown/index.js"],"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::MenuPrimitive class={{this.classNames}} @onClose={{@onClose}} ...attributes>\\n <:toggle as |t|>\\n {{yield\\n (hash\\n ToggleButton=(component \\\"hds/dropdown/toggle/button\\\" isOpen=t.isOpen onClick=t.onClickToggle)\\n ToggleIcon=(component \\\"hds/dropdown/toggle/icon\\\" isOpen=t.isOpen onClick=t.onClickToggle)\\n )\\n }}\\n </:toggle>\\n <:content as |c|>\\n <div class={{this.classNamesContent}} {{style width=@width max-height=@height}}>\\n {{yield (hash Header=(component \\\"hds/dropdown/header\\\"))}}\\n <ul class=\\\"hds-dropdown__list\\\" {{did-insert this.didInsertList}}>\\n {{yield\\n (hash\\n close=c.close\\n Checkbox=(component \\\"hds/dropdown/list-item/checkbox\\\")\\n Checkmark=(component \\\"hds/dropdown/list-item/checkmark\\\")\\n CopyItem=(component \\\"hds/dropdown/list-item/copy-item\\\")\\n Description=(component \\\"hds/dropdown/list-item/description\\\")\\n Generic=(component \\\"hds/dropdown/list-item/generic\\\")\\n Interactive=(component \\\"hds/dropdown/list-item/interactive\\\")\\n Radio=(component \\\"hds/dropdown/list-item/radio\\\")\\n Separator=(component \\\"hds/dropdown/list-item/separator\\\")\\n Title=(component \\\"hds/dropdown/list-item/title\\\")\\n )\\n }}\\n </ul>\\n {{yield (hash close=c.close Footer=(component \\\"hds/dropdown/footer\\\"))}}\\n </div>\\n </:content>\\n</Hds::MenuPrimitive>\")","/**\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 { assert } from '@ember/debug';\n\nexport const DEFAULT_POSITION = 'bottom-right';\nexport const POSITIONS = [\n 'bottom-left',\n 'bottom-right',\n 'top-left',\n 'top-right',\n];\n\nexport default class HdsDropdownIndexComponent extends Component {\n /**\n * @param listPosition\n * @type {string}\n * @default bottom-right\n * @description Determines the position of the \"list\"\n */\n get listPosition() {\n let { listPosition = DEFAULT_POSITION } = this.args;\n\n assert(\n `@listPosition for \"Hds::Dropdown::Index\" must be one of the following: ${POSITIONS.join(\n ', '\n )}; received: ${listPosition}`,\n POSITIONS.includes(listPosition)\n );\n\n return listPosition;\n }\n\n /**\n * Get the class names to apply to the element\n * @method classNames\n * @return {string} The \"class\" attribute to apply to the root element\n */\n get classNames() {\n let classes = ['hds-dropdown'];\n\n // add a class based on the @isInline argument\n if (this.args.isInline) {\n classes.push('hds-dropdown--is-inline');\n }\n\n return classes.join(' ');\n }\n\n /**\n * Get the class names to apply to the content\n * @method classNamesContent\n * @return {string} The \"class\" attribute to apply to the disclosed content\n */\n get classNamesContent() {\n let classes = ['hds-dropdown__content'];\n\n // add a class based on the @listPosition argument\n classes.push(`hds-dropdown__content--position-${this.listPosition}`);\n\n // add a class based on the @width argument\n if (this.args.width) {\n classes.push('hds-dropdown__content--fixed-width');\n }\n\n return classes.join(' ');\n }\n\n @action\n didInsertList(element) {\n const checkmarkItems = element.querySelectorAll(`[role=\"option\"]`);\n if (checkmarkItems.length) {\n const toggleButtonId = element\n .closest('.hds-dropdown')\n ?.querySelector('.hds-dropdown-toggle-button')\n ?.getAttribute('id');\n element.setAttribute('role', 'listbox');\n element.setAttribute('aria-labelledby', toggleButtonId);\n }\n }\n}\n"],"names":["DEFAULT_POSITION","POSITIONS","HdsDropdownIndexComponent","_class","Component","listPosition","args","assert","join","includes","classNames","classes","isInline","push","classNamesContent","width","didInsertList","element","checkmarkItems","querySelectorAll","length","toggleButtonId","closest","querySelector","getAttribute","setAttribute","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;AACA,eAAe,kBAAkB,CAAC,qhDAAqhD;;;ACQhjD,MAAMA,gBAAgB,GAAG,eAAc;AACvC,MAAMC,SAAS,GAAG,CACvB,aAAa,EACb,cAAc,EACd,UAAU,EACV,WAAW,EACZ;AAEoBC,IAAAA,yBAAyB,IAAAC,MAAA,GAA/B,MAAMD,yBAAyB,SAASE,SAAS,CAAC;AAC/D;AACF;AACA;AACA;AACA;AACA;EACE,IAAIC,YAAYA,GAAG;IACjB,IAAI;AAAEA,MAAAA,YAAY,GAAGL,gBAAAA;KAAkB,GAAG,IAAI,CAACM,IAAI,CAAA;AAEnDC,IAAAA,MAAM,CACH,CAAyEN,uEAAAA,EAAAA,SAAS,CAACO,IAAI,CACtF,IACF,CAAE,CAAA,YAAA,EAAcH,YAAa,CAAA,CAAC,EAC9BJ,SAAS,CAACQ,QAAQ,CAACJ,YAAY,CACjC,CAAC,CAAA;AAED,IAAA,OAAOA,YAAY,CAAA;AACrB,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIK,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,cAAc,CAAC,CAAA;;AAE9B;AACA,IAAA,IAAI,IAAI,CAACL,IAAI,CAACM,QAAQ,EAAE;AACtBD,MAAAA,OAAO,CAACE,IAAI,CAAC,yBAAyB,CAAC,CAAA;AACzC,KAAA;AAEA,IAAA,OAAOF,OAAO,CAACH,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIM,iBAAiBA,GAAG;AACtB,IAAA,IAAIH,OAAO,GAAG,CAAC,uBAAuB,CAAC,CAAA;;AAEvC;IACAA,OAAO,CAACE,IAAI,CAAE,CAAA,gCAAA,EAAkC,IAAI,CAACR,YAAa,EAAC,CAAC,CAAA;;AAEpE;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACS,KAAK,EAAE;AACnBJ,MAAAA,OAAO,CAACE,IAAI,CAAC,oCAAoC,CAAC,CAAA;AACpD,KAAA;AAEA,IAAA,OAAOF,OAAO,CAACH,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;EAGAQ,aAAaA,CAACC,OAAO,EAAE;AACrB,IAAA,MAAMC,cAAc,GAAGD,OAAO,CAACE,gBAAgB,CAAE,iBAAgB,CAAC,CAAA;IAClE,IAAID,cAAc,CAACE,MAAM,EAAE;AACzB,MAAA,MAAMC,cAAc,GAAGJ,OAAO,CAC3BK,OAAO,CAAC,eAAe,CAAC,EACvBC,aAAa,CAAC,6BAA6B,CAAC,EAC5CC,YAAY,CAAC,IAAI,CAAC,CAAA;AACtBP,MAAAA,OAAO,CAACQ,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AACvCR,MAAAA,OAAO,CAACQ,YAAY,CAAC,iBAAiB,EAAEJ,cAAc,CAAC,CAAA;AACzD,KAAA;AACF,GAAA;AACF,CAAC,GAAAK,yBAAA,CAAAvB,MAAA,CAAAwB,SAAA,EAAA,eAAA,EAAA,CAZEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAA3B,MAAA,CAAAwB,SAAA,oBAAAxB,MAAA,CAAAwB,SAAA,CAAA,GAAAxB,MAAA,EAAA;AAvDqC4B,oBAAA,CAAAC,QAAA,EAAA9B,yBAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { getElementId } from '../../../../utils/hds-get-element-id.js';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<li class=\"hds-dropdown-list-item hds-dropdown-list-item--variant-checkbox\">\n <label class=\"hds-dropdown-list-item__label hds-typography-body-200\" for={{this.id}}>\n <Hds::Form::Checkbox::Base class=\"hds-dropdown-list-item__control\" id={{this.id}} @value={{@value}} ...attributes />\n {{#if @icon}}\n <span class=\"hds-dropdown-list-item__icon\">\n <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />\n </span>\n {{/if}}\n <span class=\"hds-dropdown-list-item__text-content\">{{yield}}</span>\n\n {{#if @count}}\n <span class=\"hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium\">{{@count}}</span>\n {{/if}}\n </label>\n</li>");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) HashiCorp, Inc.
|
|
10
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
class HdsDropdownListItemCheckboxComponent extends Component {
|
|
14
|
+
/**
|
|
15
|
+
* Determines the unique ID to assign to the checkbox control
|
|
16
|
+
*/
|
|
17
|
+
get id() {
|
|
18
|
+
return getElementId(this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
setComponentTemplate(TEMPLATE, HdsDropdownListItemCheckboxComponent);
|
|
22
|
+
|
|
23
|
+
export { HdsDropdownListItemCheckboxComponent as default };
|
|
24
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../../../src/components/hds/dropdown/list-item/checkbox.hbs","../../../../../src/components/hds/dropdown/list-item/checkbox.js"],"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<li class=\\\"hds-dropdown-list-item hds-dropdown-list-item--variant-checkbox\\\">\\n <label class=\\\"hds-dropdown-list-item__label hds-typography-body-200\\\" for={{this.id}}>\\n <Hds::Form::Checkbox::Base class=\\\"hds-dropdown-list-item__control\\\" id={{this.id}} @value={{@value}} ...attributes />\\n {{#if @icon}}\\n <span class=\\\"hds-dropdown-list-item__icon\\\">\\n <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />\\n </span>\\n {{/if}}\\n <span class=\\\"hds-dropdown-list-item__text-content\\\">{{yield}}</span>\\n\\n {{#if @count}}\\n <span class=\\\"hds-dropdown-list-item__count hds-typography-body-100 hds-font-weight-medium\\\">{{@count}}</span>\\n {{/if}}\\n </label>\\n</li>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { getElementId } from '../../../../utils/hds-get-element-id';\n\nexport default class HdsDropdownListItemCheckboxComponent extends Component {\n /**\n * Determines the unique ID to assign to the checkbox control\n */\n get id() {\n return getElementId(this);\n }\n}\n"],"names":["HdsDropdownListItemCheckboxComponent","Component","id","getElementId","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,mxBAAmxB;;ACDrzB;AACA;AACA;AACA;;AAKe,MAAMA,oCAAoC,SAASC,SAAS,CAAC;AAC1E;AACF;AACA;EACE,IAAIC,EAAEA,GAAG;IACP,OAAOC,YAAY,CAAC,IAAI,CAAC,CAAA;AAC3B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EAPoBL,oCAAoC,CAAA;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
|
|
5
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n{{! template-lint-disable no-invalid-role require-context-role require-presentational-children }}\n<li class={{this.classNames}} role=\"none\">\n <Hds::Interactive\n @current-when={{@current-when}}\n @models={{hds-link-to-models @model @models}}\n @query={{hds-link-to-query @query}}\n @replace={{@replace}}\n @route={{@route}}\n @isRouteExternal={{@isRouteExternal}}\n @href={{@href}}\n @isHrefExternal={{@isHrefExternal}}\n class=\"hds-dropdown-list-item__interactive\"\n ...attributes\n role=\"option\"\n aria-selected={{if @selected \"true\" \"false\"}}\n >\n {{#if @icon}}\n <span class=\"hds-dropdown-list-item__interactive-icon\">\n <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />\n </span>\n {{/if}}\n <Hds::Text::Body @tag=\"span\" @size=\"200\" @weight=\"medium\" class=\"hds-dropdown-list-item__interactive-text\">\n {{yield}}\n </Hds::Text::Body>\n {{#if @count}}\n <Hds::Text::Body\n class=\"hds-dropdown-list-item__count\"\n @tag=\"span\"\n @size=\"100\"\n @weight=\"medium\"\n @color=\"faint\"\n >{{@count}}</Hds::Text::Body>\n {{/if}}\n <span class=\"hds-dropdown-list-item__checkmark\">\n {{#if @selected}}\n <FlightIcon class=\"hds-dropdown-list-item__checkmark-icon\" @name=\"check\" @isInlineBlock={{false}} />\n {{/if}}\n </span>\n </Hds::Interactive>\n</li>\n{{! template-lint-enable no-invalid-role require-context-role require-presentational-children }}");
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright (c) HashiCorp, Inc.
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
class HdsDropdownListItemCheckmarkComponent extends Component {
|
|
13
|
+
/**
|
|
14
|
+
* Get the class names to apply to the component.
|
|
15
|
+
* @method classNames
|
|
16
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
17
|
+
*/
|
|
18
|
+
get classNames() {
|
|
19
|
+
let classes = ['hds-dropdown-list-item', 'hds-dropdown-list-item--color-action', 'hds-dropdown-list-item--variant-checkmark'];
|
|
20
|
+
|
|
21
|
+
// add a class based on the @selected argument
|
|
22
|
+
if (this.args.selected) {
|
|
23
|
+
classes.push('hds-dropdown-list-item--variant-checkmark-selected');
|
|
24
|
+
}
|
|
25
|
+
return classes.join(' ');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
setComponentTemplate(TEMPLATE, HdsDropdownListItemCheckmarkComponent);
|
|
29
|
+
|
|
30
|
+
export { HdsDropdownListItemCheckmarkComponent as default };
|
|
31
|
+
//# sourceMappingURL=checkmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkmark.js","sources":["../../../../../src/components/hds/dropdown/list-item/checkmark.hbs","../../../../../src/components/hds/dropdown/list-item/checkmark.js"],"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{{! template-lint-disable no-invalid-role require-context-role require-presentational-children }}\\n<li class={{this.classNames}} role=\\\"none\\\">\\n <Hds::Interactive\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n @isRouteExternal={{@isRouteExternal}}\\n @href={{@href}}\\n @isHrefExternal={{@isHrefExternal}}\\n class=\\\"hds-dropdown-list-item__interactive\\\"\\n ...attributes\\n role=\\\"option\\\"\\n aria-selected={{if @selected \\\"true\\\" \\\"false\\\"}}\\n >\\n {{#if @icon}}\\n <span class=\\\"hds-dropdown-list-item__interactive-icon\\\">\\n <FlightIcon @name={{@icon}} @isInlineBlock={{false}} />\\n </span>\\n {{/if}}\\n <Hds::Text::Body @tag=\\\"span\\\" @size=\\\"200\\\" @weight=\\\"medium\\\" class=\\\"hds-dropdown-list-item__interactive-text\\\">\\n {{yield}}\\n </Hds::Text::Body>\\n {{#if @count}}\\n <Hds::Text::Body\\n class=\\\"hds-dropdown-list-item__count\\\"\\n @tag=\\\"span\\\"\\n @size=\\\"100\\\"\\n @weight=\\\"medium\\\"\\n @color=\\\"faint\\\"\\n >{{@count}}</Hds::Text::Body>\\n {{/if}}\\n <span class=\\\"hds-dropdown-list-item__checkmark\\\">\\n {{#if @selected}}\\n <FlightIcon class=\\\"hds-dropdown-list-item__checkmark-icon\\\" @name=\\\"check\\\" @isInlineBlock={{false}} />\\n {{/if}}\\n </span>\\n </Hds::Interactive>\\n</li>\\n{{! template-lint-enable no-invalid-role require-context-role require-presentational-children }}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport default class HdsDropdownListItemCheckmarkComponent extends Component {\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() {\n let classes = [\n 'hds-dropdown-list-item',\n 'hds-dropdown-list-item--color-action',\n 'hds-dropdown-list-item--variant-checkmark',\n ];\n\n // add a class based on the @selected argument\n if (this.args.selected) {\n classes.push('hds-dropdown-list-item--variant-checkmark-selected');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["HdsDropdownListItemCheckmarkComponent","Component","classNames","classes","args","selected","push","join","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,8kDAA8kD;;ACDhnD;AACA;AACA;AACA;;AAIe,MAAMA,qCAAqC,SAASC,SAAS,CAAC;AAC3E;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;IACf,IAAIC,OAAO,GAAG,CACZ,wBAAwB,EACxB,sCAAsC,EACtC,2CAA2C,CAC5C,CAAA;;AAED;AACA,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;AACtBF,MAAAA,OAAO,CAACG,IAAI,CAAC,oDAAoD,CAAC,CAAA;AACpE,KAAA;AAEA,IAAA,OAAOH,OAAO,CAACI,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACC,oBAAA,CAAAC,QAAA,EApBoBT,qCAAqC,CAAA;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { assert } from '@ember/debug';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n<li class={{this.classNames}} ...attributes>\n {{#if @copyItemTitle}}\n <Hds::Text::Body\n class=\"hds-dropdown-list-item__copy-item-title\"\n @tag=\"div\"\n @size=\"100\"\n @weight=\"semibold\"\n @color=\"faint\"\n >{{@copyItemTitle}}</Hds::Text::Body>\n {{/if}}\n <Hds::Copy::Snippet @color=\"secondary\" @textToCopy={{this.text}} @isTruncated={{this.isTruncated}} />\n</li>");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) HashiCorp, Inc.
|
|
10
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
class HdsDropdownListItemCopyItemComponent extends Component {
|
|
14
|
+
/**
|
|
15
|
+
* @param text
|
|
16
|
+
* @type {string}
|
|
17
|
+
* @description The text of the item. If no text value is defined an error will be thrown
|
|
18
|
+
*/
|
|
19
|
+
get text() {
|
|
20
|
+
let {
|
|
21
|
+
text
|
|
22
|
+
} = this.args;
|
|
23
|
+
assert('@text for "Hds::Dropdown::ListItem::CopyItem" must have a valid value', text !== undefined);
|
|
24
|
+
return text;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param isTruncated
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
* @default true
|
|
31
|
+
* @description Indicates that the text should be truncated instead of wrapping and using multiple lines.
|
|
32
|
+
*/
|
|
33
|
+
get isTruncated() {
|
|
34
|
+
let {
|
|
35
|
+
isTruncated = true
|
|
36
|
+
} = this.args;
|
|
37
|
+
return isTruncated;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get the class names to apply to the component.
|
|
42
|
+
* @method classNames
|
|
43
|
+
* @return {string} The "class" attribute to apply to the component.
|
|
44
|
+
*/
|
|
45
|
+
get classNames() {
|
|
46
|
+
let classes = ['hds-dropdown-list-item', 'hds-dropdown-list-item--variant-copy-item'];
|
|
47
|
+
return classes.join(' ');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
setComponentTemplate(TEMPLATE, HdsDropdownListItemCopyItemComponent);
|
|
51
|
+
|
|
52
|
+
export { HdsDropdownListItemCopyItemComponent as default };
|
|
53
|
+
//# sourceMappingURL=copy-item.js.map
|