@hashicorp/mds-react 0.9.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/LICENSE +336 -0
- package/README.md +109 -0
- package/dist/components/accordion/index.d.ts +14 -0
- package/dist/components/accordion/index.js +9 -0
- package/dist/components/accordion/index.js.map +1 -0
- package/dist/components/accordion/item/button.d.ts +6 -0
- package/dist/components/accordion/item/button.js +44 -0
- package/dist/components/accordion/item/button.js.map +1 -0
- package/dist/components/accordion/item/index.d.ts +24 -0
- package/dist/components/accordion/item/index.js +59 -0
- package/dist/components/accordion/item/index.js.map +1 -0
- package/dist/components/accordion/style.module.scss +110 -0
- package/dist/components/accordion/style.module.scss.js +24 -0
- package/dist/components/accordion/style.module.scss.js.map +1 -0
- package/dist/components/alert/alert.module.scss +229 -0
- package/dist/components/alert/alert.module.scss.js +29 -0
- package/dist/components/alert/alert.module.scss.js.map +1 -0
- package/dist/components/alert/icon.d.ts +9 -0
- package/dist/components/alert/icon.js +34 -0
- package/dist/components/alert/icon.js.map +1 -0
- package/dist/components/alert/index.d.ts +62 -0
- package/dist/components/alert/index.js +97 -0
- package/dist/components/alert/index.js.map +1 -0
- package/dist/components/badge/index.d.ts +30 -0
- package/dist/components/badge/index.js +50 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/badge/style.module.scss +130 -0
- package/dist/components/badge/style.module.scss.js +22 -0
- package/dist/components/badge/style.module.scss.js.map +1 -0
- package/dist/components/badge-count/index.d.ts +16 -0
- package/dist/components/badge-count/index.js +29 -0
- package/dist/components/badge-count/index.js.map +1 -0
- package/dist/components/badge-count/style.module.scss +108 -0
- package/dist/components/badge-count/style.module.scss.js +15 -0
- package/dist/components/badge-count/style.module.scss.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +7 -0
- package/dist/components/breadcrumbs/index.js +38 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/breadcrumbs/item/index.d.ts +2 -0
- package/dist/components/breadcrumbs/item/index.js +32 -0
- package/dist/components/breadcrumbs/item/index.js.map +1 -0
- package/dist/components/breadcrumbs/style.module.scss +183 -0
- package/dist/components/breadcrumbs/style.module.scss.js +27 -0
- package/dist/components/breadcrumbs/style.module.scss.js.map +1 -0
- package/dist/components/breadcrumbs/truncation-button/index.d.ts +3 -0
- package/dist/components/breadcrumbs/truncation-button/index.js +25 -0
- package/dist/components/breadcrumbs/truncation-button/index.js.map +1 -0
- package/dist/components/breadcrumbs/types/index.d.ts +51 -0
- package/dist/components/button/index.d.ts +31 -0
- package/dist/components/button/index.js +119 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button/styles.module.scss +221 -0
- package/dist/components/button/styles.module.scss.js +32 -0
- package/dist/components/button/styles.module.scss.js.map +1 -0
- package/dist/components/card/card-thumbnail/card-thumbnail.module.css +10 -0
- package/dist/components/card/card-thumbnail/card-thumbnail.module.css.js +8 -0
- package/dist/components/card/card-thumbnail/card-thumbnail.module.css.js.map +1 -0
- package/dist/components/card/card-thumbnail/index.d.ts +2 -0
- package/dist/components/card/card-thumbnail/index.js +23 -0
- package/dist/components/card/card-thumbnail/index.js.map +1 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.js +157 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/card/styles.module.css +98 -0
- package/dist/components/card/styles.module.css.js +29 -0
- package/dist/components/card/styles.module.css.js.map +1 -0
- package/dist/components/card/types.d.ts +52 -0
- package/dist/components/code-block/code-block.module.scss +511 -0
- package/dist/components/code-block/code-block.module.scss.js +34 -0
- package/dist/components/code-block/code-block.module.scss.js.map +1 -0
- package/dist/components/code-block/code-lines/index.d.ts +12 -0
- package/dist/components/code-block/code-lines/index.js +59 -0
- package/dist/components/code-block/code-lines/index.js.map +1 -0
- package/dist/components/code-block/code-lines/utils/split-html-into-lines.d.ts +19 -0
- package/dist/components/code-block/code-lines/utils/split-html-into-lines.js +19 -0
- package/dist/components/code-block/code-lines/utils/split-html-into-lines.js.map +1 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts +21 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.js +31 -0
- package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -0
- package/dist/components/code-block/hidden-copy-content/index.d.ts +5 -0
- package/dist/components/code-block/hidden-copy-content/index.js +13 -0
- package/dist/components/code-block/hidden-copy-content/index.js.map +1 -0
- package/dist/components/code-block/index.d.ts +55 -0
- package/dist/components/code-block/index.js +88 -0
- package/dist/components/code-block/index.js.map +1 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.d.ts +2 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.js +39 -0
- package/dist/components/code-block/utils/parse-highlighted-lines.js.map +1 -0
- package/dist/components/code-block/utils/process-snippet.d.ts +12 -0
- package/dist/components/code-block/utils/process-snippet.js +20 -0
- package/dist/components/code-block/utils/process-snippet.js.map +1 -0
- package/dist/components/code-block/utils/shellwords.d.ts +14 -0
- package/dist/components/code-block/utils/shellwords.js +33 -0
- package/dist/components/code-block/utils/shellwords.js.map +1 -0
- package/dist/components/combo-box-primitive/index.d.ts +69 -0
- package/dist/components/combo-box-primitive/index.js +302 -0
- package/dist/components/combo-box-primitive/index.js.map +1 -0
- package/dist/components/dialog-primitive/dialog.module.scss +38 -0
- package/dist/components/dialog-primitive/dialog.module.scss.js +12 -0
- package/dist/components/dialog-primitive/dialog.module.scss.js.map +1 -0
- package/dist/components/dialog-primitive/index.d.ts +12 -0
- package/dist/components/dialog-primitive/index.js +15 -0
- package/dist/components/dialog-primitive/index.js.map +1 -0
- package/dist/components/disclosure-primitive/index.d.ts +19 -0
- package/dist/components/disclosure-primitive/index.js +57 -0
- package/dist/components/disclosure-primitive/index.js.map +1 -0
- package/dist/components/disclosure-primitive/styles.module.css +3 -0
- package/dist/components/disclosure-primitive/styles.module.css.js +7 -0
- package/dist/components/disclosure-primitive/styles.module.css.js.map +1 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.d.ts +11 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.js +17 -0
- package/dist/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -0
- package/dist/components/dismiss-button/index.d.ts +9 -0
- package/dist/components/dismiss-button/index.js +22 -0
- package/dist/components/dismiss-button/index.js.map +1 -0
- package/dist/components/dismiss-button/styles.module.scss +31 -0
- package/dist/components/dismiss-button/styles.module.scss.js +7 -0
- package/dist/components/dismiss-button/styles.module.scss.js.map +1 -0
- package/dist/components/dropdown/index.d.ts +72 -0
- package/dist/components/dropdown/index.js +79 -0
- package/dist/components/dropdown/index.js.map +1 -0
- package/dist/components/dropdown/list-item/custom.d.ts +10 -0
- package/dist/components/dropdown/list-item/custom.js +9 -0
- package/dist/components/dropdown/list-item/custom.js.map +1 -0
- package/dist/components/dropdown/list-item/index.d.ts +19 -0
- package/dist/components/dropdown/list-item/index.js +14 -0
- package/dist/components/dropdown/list-item/index.js.map +1 -0
- package/dist/components/dropdown/list-item/interactive.d.ts +29 -0
- package/dist/components/dropdown/list-item/interactive.js +49 -0
- package/dist/components/dropdown/list-item/interactive.js.map +1 -0
- package/dist/components/dropdown/list-item/separator.d.ts +8 -0
- package/dist/components/dropdown/list-item/separator.js +17 -0
- package/dist/components/dropdown/list-item/separator.js.map +1 -0
- package/dist/components/dropdown/list-item/styles.module.css +222 -0
- package/dist/components/dropdown/list-item/styles.module.css.js +26 -0
- package/dist/components/dropdown/list-item/styles.module.css.js.map +1 -0
- package/dist/components/dropdown/list-item/title.d.ts +10 -0
- package/dist/components/dropdown/list-item/title.js +9 -0
- package/dist/components/dropdown/list-item/title.js.map +1 -0
- package/dist/components/dropdown/styles.module.css +74 -0
- package/dist/components/dropdown/styles.module.css.js +24 -0
- package/dist/components/dropdown/styles.module.css.js.map +1 -0
- package/dist/components/dropdown/toggle-button/index.d.ts +30 -0
- package/dist/components/dropdown/toggle-button/index.js +54 -0
- package/dist/components/dropdown/toggle-button/index.js.map +1 -0
- package/dist/components/dropdown/toggle-button/styles.module.scss +54 -0
- package/dist/components/dropdown/toggle-button/styles.module.scss.js +14 -0
- package/dist/components/dropdown/toggle-button/styles.module.scss.js.map +1 -0
- package/dist/components/flight-icon/flight-icon.module.css +31 -0
- package/dist/components/flight-icon/flight-icon.module.css.js +12 -0
- package/dist/components/flight-icon/flight-icon.module.css.js.map +1 -0
- package/dist/components/flight-icon/index.d.ts +44 -0
- package/dist/components/flight-icon/index.js +58 -0
- package/dist/components/flight-icon/index.js.map +1 -0
- package/dist/components/form/checkbox/form-checkbox.module.css +88 -0
- package/dist/components/form/checkbox/form-checkbox.module.css.js +8 -0
- package/dist/components/form/checkbox/form-checkbox.module.css.js.map +1 -0
- package/dist/components/form/checkbox/index.d.ts +45 -0
- package/dist/components/form/checkbox/index.js +109 -0
- package/dist/components/form/checkbox/index.js.map +1 -0
- package/dist/components/form/error/form-error.module.css +23 -0
- package/dist/components/form/error/form-error.module.css.js +14 -0
- package/dist/components/form/error/form-error.module.css.js.map +1 -0
- package/dist/components/form/error/index.d.ts +16 -0
- package/dist/components/form/error/index.js +22 -0
- package/dist/components/form/error/index.js.map +1 -0
- package/dist/components/form/field/form-field.module.css +79 -0
- package/dist/components/form/field/form-field.module.css.js +17 -0
- package/dist/components/form/field/form-field.module.css.js.map +1 -0
- package/dist/components/form/field/index.d.ts +19 -0
- package/dist/components/form/field/index.js +46 -0
- package/dist/components/form/field/index.js.map +1 -0
- package/dist/components/form/fieldset/form-fieldset.module.css +48 -0
- package/dist/components/form/fieldset/form-fieldset.module.css.js +19 -0
- package/dist/components/form/fieldset/form-fieldset.module.css.js.map +1 -0
- package/dist/components/form/fieldset/index.d.ts +19 -0
- package/dist/components/form/fieldset/index.js +65 -0
- package/dist/components/form/fieldset/index.js.map +1 -0
- package/dist/components/form/file-input/form-file-input.module.scss +81 -0
- package/dist/components/form/file-input/form-file-input.module.scss.js +7 -0
- package/dist/components/form/file-input/form-file-input.module.scss.js.map +1 -0
- package/dist/components/form/file-input/index.d.ts +27 -0
- package/dist/components/form/file-input/index.js +68 -0
- package/dist/components/form/file-input/index.js.map +1 -0
- package/dist/components/form/helper-text/form-helper-text.module.css +10 -0
- package/dist/components/form/helper-text/form-helper-text.module.css.js +7 -0
- package/dist/components/form/helper-text/form-helper-text.module.css.js.map +1 -0
- package/dist/components/form/helper-text/index.d.ts +11 -0
- package/dist/components/form/helper-text/index.js +22 -0
- package/dist/components/form/helper-text/index.js.map +1 -0
- package/dist/components/form/indicator/form-indicator.module.css +10 -0
- package/dist/components/form/indicator/form-indicator.module.css.js +8 -0
- package/dist/components/form/indicator/form-indicator.module.css.js.map +1 -0
- package/dist/components/form/indicator/index.d.ts +9 -0
- package/dist/components/form/indicator/index.js +22 -0
- package/dist/components/form/indicator/index.js.map +1 -0
- package/dist/components/form/label/form-label.module.css +15 -0
- package/dist/components/form/label/form-label.module.css.js +10 -0
- package/dist/components/form/label/form-label.module.css.js.map +1 -0
- package/dist/components/form/label/index.d.ts +14 -0
- package/dist/components/form/label/index.js +33 -0
- package/dist/components/form/label/index.js.map +1 -0
- package/dist/components/form/legend/form-legend.module.css +17 -0
- package/dist/components/form/legend/form-legend.module.css.js +10 -0
- package/dist/components/form/legend/form-legend.module.css.js.map +1 -0
- package/dist/components/form/legend/index.d.ts +12 -0
- package/dist/components/form/legend/index.js +19 -0
- package/dist/components/form/legend/index.js.map +1 -0
- package/dist/components/form/radio/form-radio.module.scss +74 -0
- package/dist/components/form/radio/form-radio.module.scss.js +8 -0
- package/dist/components/form/radio/form-radio.module.scss.js.map +1 -0
- package/dist/components/form/radio/index.d.ts +44 -0
- package/dist/components/form/radio/index.js +100 -0
- package/dist/components/form/radio/index.js.map +1 -0
- package/dist/components/form/radio-card/description.d.ts +3 -0
- package/dist/components/form/radio-card/description.js +10 -0
- package/dist/components/form/radio-card/description.js.map +1 -0
- package/dist/components/form/radio-card/form-radio-card.module.css +153 -0
- package/dist/components/form/radio-card/form-radio-card.module.css.js +30 -0
- package/dist/components/form/radio-card/form-radio-card.module.css.js.map +1 -0
- package/dist/components/form/radio-card/group.d.ts +11 -0
- package/dist/components/form/radio-card/group.js +31 -0
- package/dist/components/form/radio-card/group.js.map +1 -0
- package/dist/components/form/radio-card/index.d.ts +48 -0
- package/dist/components/form/radio-card/index.js +67 -0
- package/dist/components/form/radio-card/index.js.map +1 -0
- package/dist/components/form/radio-card/label.d.ts +3 -0
- package/dist/components/form/radio-card/label.js +10 -0
- package/dist/components/form/radio-card/label.js.map +1 -0
- package/dist/components/form/select/form-select.module.css +89 -0
- package/dist/components/form/select/form-select.module.css.js +14 -0
- package/dist/components/form/select/form-select.module.css.js.map +1 -0
- package/dist/components/form/select/index.d.ts +21 -0
- package/dist/components/form/select/index.js +79 -0
- package/dist/components/form/select/index.js.map +1 -0
- package/dist/components/form/super-select/form-super-select.module.css +155 -0
- package/dist/components/form/super-select/form-super-select.module.css.js +22 -0
- package/dist/components/form/super-select/form-super-select.module.css.js.map +1 -0
- package/dist/components/form/super-select/index.d.ts +55 -0
- package/dist/components/form/super-select/index.js +170 -0
- package/dist/components/form/super-select/index.js.map +1 -0
- package/dist/components/form/text-input/index.d.ts +98 -0
- package/dist/components/form/text-input/index.js +91 -0
- package/dist/components/form/text-input/index.js.map +1 -0
- package/dist/components/form/text-input/styles.module.css +158 -0
- package/dist/components/form/text-input/styles.module.css.js +15 -0
- package/dist/components/form/text-input/styles.module.css.js.map +1 -0
- package/dist/components/form/textarea/form-textarea.module.css +88 -0
- package/dist/components/form/textarea/form-textarea.module.css.js +14 -0
- package/dist/components/form/textarea/form-textarea.module.css.js.map +1 -0
- package/dist/components/form/textarea/index.d.ts +19 -0
- package/dist/components/form/textarea/index.js +74 -0
- package/dist/components/form/textarea/index.js.map +1 -0
- package/dist/components/form/toggle/form-toggle.module.scss +164 -0
- package/dist/components/form/toggle/form-toggle.module.scss.js +12 -0
- package/dist/components/form/toggle/form-toggle.module.scss.js.map +1 -0
- package/dist/components/form/toggle/index.d.ts +78 -0
- package/dist/components/form/toggle/index.js +102 -0
- package/dist/components/form/toggle/index.js.map +1 -0
- package/dist/components/hds/wrappers/tooltip.d.ts +13 -0
- package/dist/components/hds/wrappers/tooltip.js +51 -0
- package/dist/components/hds/wrappers/tooltip.js.map +1 -0
- package/dist/components/icon-tile/index.d.ts +21 -0
- package/dist/components/icon-tile/index.js +50 -0
- package/dist/components/icon-tile/index.js.map +1 -0
- package/dist/components/icon-tile/style.module.scss +136 -0
- package/dist/components/icon-tile/style.module.scss.js +29 -0
- package/dist/components/icon-tile/style.module.scss.js.map +1 -0
- package/dist/components/index.d.ts +60 -0
- package/dist/components/index.js +119 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/inline-link/index.d.ts +40 -0
- package/dist/components/inline-link/index.js +33 -0
- package/dist/components/inline-link/index.js.map +1 -0
- package/dist/components/inline-link/inline-link.module.css +49 -0
- package/dist/components/inline-link/inline-link.module.css.js +11 -0
- package/dist/components/inline-link/inline-link.module.css.js.map +1 -0
- package/dist/components/interactive/index.d.ts +26 -0
- package/dist/components/interactive/index.js +59 -0
- package/dist/components/interactive/index.js.map +1 -0
- package/dist/components/legacy-button/index.d.ts +5 -0
- package/dist/components/legacy-button/index.js +65 -0
- package/dist/components/legacy-button/index.js.map +1 -0
- package/dist/components/legacy-button/types.d.ts +37 -0
- package/dist/components/legacy-button/utils.d.ts +9 -0
- package/dist/components/legacy-button/utils.js +39 -0
- package/dist/components/legacy-button/utils.js.map +1 -0
- package/dist/components/menu-primitive/index.d.ts +14 -0
- package/dist/components/menu-primitive/index.js +68 -0
- package/dist/components/menu-primitive/index.js.map +1 -0
- package/dist/components/menu-primitive/styles.module.css +16 -0
- package/dist/components/menu-primitive/styles.module.css.js +12 -0
- package/dist/components/menu-primitive/styles.module.css.js.map +1 -0
- package/dist/components/menu-primitive/use-menu-primitive.d.ts +9 -0
- package/dist/components/menu-primitive/use-menu-primitive.js +17 -0
- package/dist/components/menu-primitive/use-menu-primitive.js.map +1 -0
- package/dist/components/modal/index.d.ts +13 -0
- package/dist/components/modal/index.js +61 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/modal.module.css +22 -0
- package/dist/components/modal/modal.module.css.js +8 -0
- package/dist/components/modal/modal.module.css.js.map +1 -0
- package/dist/components/modal/use-modal.d.ts +8 -0
- package/dist/components/modal/use-modal.js +17 -0
- package/dist/components/modal/use-modal.js.map +1 -0
- package/dist/components/separator/index.d.ts +10 -0
- package/dist/components/separator/index.js +15 -0
- package/dist/components/separator/index.js.map +1 -0
- package/dist/components/separator/separator.module.css +15 -0
- package/dist/components/separator/separator.module.css.js +10 -0
- package/dist/components/separator/separator.module.css.js.map +1 -0
- package/dist/components/standalone-link/index.d.ts +23 -0
- package/dist/components/standalone-link/index.js +54 -0
- package/dist/components/standalone-link/index.js.map +1 -0
- package/dist/components/standalone-link/styles.module.scss +166 -0
- package/dist/components/standalone-link/styles.module.scss.js +17 -0
- package/dist/components/standalone-link/styles.module.scss.js.map +1 -0
- package/dist/components/table/index.d.ts +58 -0
- package/dist/components/table/index.js +52 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table.module.scss +192 -0
- package/dist/components/table/table.module.scss.js +33 -0
- package/dist/components/table/table.module.scss.js.map +1 -0
- package/dist/components/table/td.d.ts +17 -0
- package/dist/components/table/td.js +28 -0
- package/dist/components/table/td.js.map +1 -0
- package/dist/components/table/th-button-tooltip.d.ts +6 -0
- package/dist/components/table/th-button-tooltip.js +24 -0
- package/dist/components/table/th-button-tooltip.js.map +1 -0
- package/dist/components/table/th.d.ts +34 -0
- package/dist/components/table/th.js +43 -0
- package/dist/components/table/th.js.map +1 -0
- package/dist/components/table/tr.d.ts +12 -0
- package/dist/components/table/tr.js +9 -0
- package/dist/components/table/tr.js.map +1 -0
- package/dist/components/table/utils.d.ts +16 -0
- package/dist/components/table/utils.js +28 -0
- package/dist/components/table/utils.js.map +1 -0
- package/dist/components/tabs/index.d.ts +21 -0
- package/dist/components/tabs/index.js +117 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/tabs/tab-panel.d.ts +5 -0
- package/dist/components/tabs/tab-panel.js +35 -0
- package/dist/components/tabs/tab-panel.js.map +1 -0
- package/dist/components/tabs/tab.d.ts +24 -0
- package/dist/components/tabs/tab.js +70 -0
- package/dist/components/tabs/tab.js.map +1 -0
- package/dist/components/tabs/tabs.module.scss +163 -0
- package/dist/components/tabs/tabs.module.scss.js +22 -0
- package/dist/components/tabs/tabs.module.scss.js.map +1 -0
- package/dist/components/tabs/use-tabs-context.d.ts +15 -0
- package/dist/components/tabs/use-tabs-context.js +16 -0
- package/dist/components/tabs/use-tabs-context.js.map +1 -0
- package/dist/components/text/index.d.ts +44 -0
- package/dist/components/text/index.js +112 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text/style.module.scss +11 -0
- package/dist/components/text/style.module.scss.js +9 -0
- package/dist/components/text/style.module.scss.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.d.ts +8 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +62 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css +76 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js +20 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.d.ts +44 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.js +104 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.d.ts +10 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.js +13 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css +29 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js +14 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js.map +1 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css +76 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css.js +28 -0
- package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css.js.map +1 -0
- package/dist/components/visualizations/bar-chart/index.d.ts +13 -0
- package/dist/components/visualizations/bar-chart/index.js +37 -0
- package/dist/components/visualizations/bar-chart/index.js.map +1 -0
- package/dist/components/visualizations/bar-chart/style.module.css +39 -0
- package/dist/components/visualizations/bar-chart/style.module.css.js +12 -0
- package/dist/components/visualizations/bar-chart/style.module.css.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts +3 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.js +14 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css +14 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js +10 -0
- package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/index.d.ts +3 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/index.js +58 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/index.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css +32 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js +16 -0
- package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/index.d.ts +3 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts +3 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.js +42 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.js.map +1 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css +20 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js +14 -0
- package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js.map +1 -0
- package/dist/components/visualizations/donut-chart/index.d.ts +10 -0
- package/dist/components/visualizations/donut-chart/index.js +90 -0
- package/dist/components/visualizations/donut-chart/index.js.map +1 -0
- package/dist/components/visualizations/donut-chart/styles.module.css +73 -0
- package/dist/components/visualizations/donut-chart/styles.module.css.js +20 -0
- package/dist/components/visualizations/donut-chart/styles.module.css.js.map +1 -0
- package/dist/components/visualizations/donut-chart/types.d.ts +16 -0
- package/dist/hooks/use-media-query/index.js +16 -0
- package/dist/hooks/use-media-query/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +158 -0
- package/dist/index.js.map +1 -0
- package/dist/patterns/card/index.d.ts +5 -0
- package/dist/patterns/card/newsroom-card/index.d.ts +15 -0
- package/dist/patterns/card/newsroom-card/index.js +26 -0
- package/dist/patterns/card/newsroom-card/index.js.map +1 -0
- package/dist/patterns/card/newsroom-card/style.module.css +12 -0
- package/dist/patterns/card/newsroom-card/style.module.css.js +8 -0
- package/dist/patterns/card/newsroom-card/style.module.css.js.map +1 -0
- package/dist/patterns/card/partner-card/index.d.ts +18 -0
- package/dist/patterns/card/partner-card/index.js +42 -0
- package/dist/patterns/card/partner-card/index.js.map +1 -0
- package/dist/patterns/card/partner-card/style.module.css +24 -0
- package/dist/patterns/card/partner-card/style.module.css.js +12 -0
- package/dist/patterns/card/partner-card/style.module.css.js.map +1 -0
- package/dist/patterns/card/person-card/index.d.ts +15 -0
- package/dist/patterns/card/person-card/index.js +52 -0
- package/dist/patterns/card/person-card/index.js.map +1 -0
- package/dist/patterns/card/person-card/style.module.css +28 -0
- package/dist/patterns/card/person-card/style.module.css.js +12 -0
- package/dist/patterns/card/person-card/style.module.css.js.map +1 -0
- package/dist/patterns/card/primitives.d.ts +37 -0
- package/dist/patterns/card/primitives.js +77 -0
- package/dist/patterns/card/primitives.js.map +1 -0
- package/dist/patterns/card/promo-card/index.d.ts +18 -0
- package/dist/patterns/card/promo-card/index.js +36 -0
- package/dist/patterns/card/promo-card/index.js.map +1 -0
- package/dist/patterns/card/resource-card/index.d.ts +16 -0
- package/dist/patterns/card/resource-card/index.js +26 -0
- package/dist/patterns/card/resource-card/index.js.map +1 -0
- package/dist/patterns/card/style.module.css +121 -0
- package/dist/patterns/card/style.module.css.js +30 -0
- package/dist/patterns/card/style.module.css.js.map +1 -0
- package/dist/patterns/card/thumbnails/index.d.ts +13 -0
- package/dist/patterns/card/thumbnails/index.js +25 -0
- package/dist/patterns/card/thumbnails/index.js.map +1 -0
- package/dist/patterns/card/types.d.ts +41 -0
- package/dist/patterns/card/unified-card/index.d.ts +10 -0
- package/dist/patterns/card/unified-card/index.js +37 -0
- package/dist/patterns/card/unified-card/index.js.map +1 -0
- package/dist/patterns/copy-button/clipboard.d.ts +16 -0
- package/dist/patterns/copy-button/clipboard.js +78 -0
- package/dist/patterns/copy-button/clipboard.js.map +1 -0
- package/dist/patterns/copy-button/index.d.ts +19 -0
- package/dist/patterns/copy-button/index.js +57 -0
- package/dist/patterns/copy-button/index.js.map +1 -0
- package/dist/patterns/copy-button/style.module.css +23 -0
- package/dist/patterns/copy-button/style.module.css.js +13 -0
- package/dist/patterns/copy-button/style.module.css.js.map +1 -0
- package/dist/patterns/index.d.ts +15 -0
- package/dist/patterns/index.js +35 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/layout/index.d.ts +69 -0
- package/dist/patterns/layout/index.js +47 -0
- package/dist/patterns/layout/index.js.map +1 -0
- package/dist/patterns/layout/layout.module.css +72 -0
- package/dist/patterns/layout/layout.module.css.js +20 -0
- package/dist/patterns/layout/layout.module.css.js.map +1 -0
- package/dist/patterns/product-badge/index.d.ts +11 -0
- package/dist/patterns/product-badge/index.js +22 -0
- package/dist/patterns/product-badge/index.js.map +1 -0
- package/dist/patterns/product-badge/style.module.css +3 -0
- package/dist/patterns/product-badge/style.module.css.js +8 -0
- package/dist/patterns/product-badge/style.module.css.js.map +1 -0
- package/dist/patterns/product-logo/index.d.ts +48 -0
- package/dist/patterns/product-logo/index.js +130 -0
- package/dist/patterns/product-logo/index.js.map +1 -0
- package/dist/patterns/product-logo/product-logo.module.css +24 -0
- package/dist/patterns/product-logo/product-logo.module.css.js +13 -0
- package/dist/patterns/product-logo/product-logo.module.css.js.map +1 -0
- package/dist/patterns/related-content/index.d.ts +6 -0
- package/dist/patterns/related-content/index.js +65 -0
- package/dist/patterns/related-content/index.js.map +1 -0
- package/dist/patterns/related-content/style.module.css +74 -0
- package/dist/patterns/related-content/style.module.css.js +22 -0
- package/dist/patterns/related-content/style.module.css.js.map +1 -0
- package/dist/patterns/related-content/types.d.ts +14 -0
- package/dist/style.css +1 -0
- package/dist/styles/mixins/button.scss +284 -0
- package/dist/styles/mixins/focus-ring.scss +75 -0
- package/dist/utils/get-contrast-yiq.d.ts +20 -0
- package/dist/utils/get-contrast-yiq.js +13 -0
- package/dist/utils/get-contrast-yiq.js.map +1 -0
- package/dist/utils/hooks/use-screen-size.d.ts +5 -0
- package/dist/utils/hooks/use-screen-size.js +10 -0
- package/dist/utils/hooks/use-screen-size.js.map +1 -0
- package/dist/utils/i18n/index.d.ts +1 -0
- package/dist/utils/i18n/index.js +41 -0
- package/dist/utils/i18n/index.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/make-normalizer/index.d.ts +30 -0
- package/dist/utils/make-normalizer/index.js +34 -0
- package/dist/utils/make-normalizer/index.js.map +1 -0
- package/dist/utils/mds-context/index.d.ts +59 -0
- package/dist/utils/mds-context/index.js +85 -0
- package/dist/utils/mds-context/index.js.map +1 -0
- package/package.json +113 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const t = "breadcrumbs__qRWRC", n = "list__ex8fu", c = "sublist__sSjxU", s = "item__vAjEk", i = "truncation__Kmsae", o = "link__T7iXX", _ = "text__g0Z5V", r = "current__RtvDC", e = "icon__QZYpF", u = {
|
|
2
|
+
breadcrumbs: t,
|
|
3
|
+
list: n,
|
|
4
|
+
"items-can-wrap": "items-can-wrap__vfE8u",
|
|
5
|
+
sublist: c,
|
|
6
|
+
item: s,
|
|
7
|
+
truncation: i,
|
|
8
|
+
link: o,
|
|
9
|
+
text: _,
|
|
10
|
+
current: r,
|
|
11
|
+
icon: e,
|
|
12
|
+
"truncation-button": "truncation-button__3eNF8",
|
|
13
|
+
"truncation-content": "truncation-content__P-Vh1"
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
t as breadcrumbs,
|
|
17
|
+
r as current,
|
|
18
|
+
u as default,
|
|
19
|
+
e as icon,
|
|
20
|
+
s as item,
|
|
21
|
+
o as link,
|
|
22
|
+
n as list,
|
|
23
|
+
c as sublist,
|
|
24
|
+
_ as text,
|
|
25
|
+
i as truncation
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { IconMoreHorizontal16 as e } from "@hashicorp/flight-icons/svg-react/more-horizontal-16";
|
|
4
|
+
import { useMenuPrimitive as i } from "../../menu-primitive/use-menu-primitive.js";
|
|
5
|
+
import a from "../style.module.scss.js";
|
|
6
|
+
const l = ({
|
|
7
|
+
ariaLabel: t = "show more"
|
|
8
|
+
}) => {
|
|
9
|
+
const { isOpen: n, onClickToggle: r } = i();
|
|
10
|
+
return /* @__PURE__ */ o(
|
|
11
|
+
"button",
|
|
12
|
+
{
|
|
13
|
+
type: "button",
|
|
14
|
+
className: a["truncation-button"],
|
|
15
|
+
"aria-label": t,
|
|
16
|
+
"aria-expanded": n,
|
|
17
|
+
onClick: r,
|
|
18
|
+
children: /* @__PURE__ */ o(e, {})
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
l as TruncationButton
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/breadcrumbs/truncation-button/index.tsx"],"sourcesContent":["'use client'\n\nimport { IconMoreHorizontal16 } from '@hashicorp/flight-icons/svg-react/more-horizontal-16'\nimport { useMenuPrimitive } from '../../menu-primitive/use-menu-primitive'\nimport s from '../style.module.scss'\n\nexport const TruncationButton = ({\n\tariaLabel = 'show more',\n}: {\n\tariaLabel?: string\n}) => {\n\tconst { isOpen, onClickToggle } = useMenuPrimitive()\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={s['truncation-button']}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-expanded={isOpen}\n\t\t\tonClick={onClickToggle}\n\t\t>\n\t\t\t<IconMoreHorizontal16 />\n\t\t</button>\n\t)\n}\n"],"names":["ariaLabel","useMenuPrimitive","jsx","s","isOpen","IconMoreHorizontal16"],"mappings":";;;;;AAMiC,UACpB,CAAA;AAAA,EACb,WAAAA,IAEM;AACL,MAAA;AAEA,sCACC,IAAAC,EAAA;AAAA,SAAC,gBAAAC;AAAA,IAAA;AAAA,IAAA;AAAA,MAEA,MAAA;AAAA,MACA,WAAAC,qBAAY;AAAA,MACZ,cAAAH;AAAA,MACA,iBAASI;AAAA,MAET;MAAsB,UAAA,gBAAAF,EAAAG,GAAA,CAAA,CAAA;AAAA,IACvB;AAAA,EAEF;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes, LiHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* This controls if the Breadcrumb Items can wrap if they don’t fit within the container.
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
itemsCanWrap?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Accepts a localized string.
|
|
10
|
+
* @default 'breadcrumbs'
|
|
11
|
+
*/
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Array of Breadcrumb.Item and/or Breadcrumb.Truncation components.
|
|
15
|
+
*/
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface BreadcrumbItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
19
|
+
/**
|
|
20
|
+
* The URL to link to.
|
|
21
|
+
*/
|
|
22
|
+
url: string;
|
|
23
|
+
/**
|
|
24
|
+
* The text displayed within the item.
|
|
25
|
+
*/
|
|
26
|
+
text: string;
|
|
27
|
+
/**
|
|
28
|
+
* Use to show an flight icon.
|
|
29
|
+
*/
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Determines if an item is the last item in the Breadcrumb, in which case it doesn’t generate a link.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
current?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A parameter that can be applied to an "item" to limit its max-width
|
|
38
|
+
*/
|
|
39
|
+
maxWidth?: `${number}px` | `${number}em`;
|
|
40
|
+
}
|
|
41
|
+
export interface BreadcrumbTruncationProps extends HTMLAttributes<HTMLLIElement> {
|
|
42
|
+
/**
|
|
43
|
+
* Set on the truncation toggle button. Accepts a localized string.
|
|
44
|
+
* @default 'show more'
|
|
45
|
+
*/
|
|
46
|
+
ariaLabel?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Array of Breadcrumb.Item components.
|
|
49
|
+
*/
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
+
export declare const BUTTON_SIZES: readonly ["small", "medium", "large"];
|
|
3
|
+
export type ButtonSize = (typeof BUTTON_SIZES)[number];
|
|
4
|
+
export declare const BUTTON_ICON_POSITIONS: readonly ["leading", "trailing"];
|
|
5
|
+
export type ButtonIconPosition = (typeof BUTTON_ICON_POSITIONS)[number];
|
|
6
|
+
export declare const BUTTON_COLORS: readonly ["primary", "primary-black", "primary-white", "secondary", "secondary-high-contrast", "secondary-white", "secondary-black", "tertiary", "critical", "boundary", "consul", "nomad", "packer", "terraform", "vagrant", "vault", "waypoint", "hashicorp"];
|
|
7
|
+
export type ButtonColor = (typeof BUTTON_COLORS)[number];
|
|
8
|
+
declare const LEGACY_COLORS: readonly ["primary", "secondary", "tertiary", "critical", "custom"];
|
|
9
|
+
type LegacyButtonColor = (typeof LEGACY_COLORS)[number];
|
|
10
|
+
interface ButtonPrimitiveProps {
|
|
11
|
+
size?: ButtonSize;
|
|
12
|
+
color?: LegacyButtonColor;
|
|
13
|
+
isFullWidth?: boolean;
|
|
14
|
+
isIconOnly?: boolean;
|
|
15
|
+
icon?: string;
|
|
16
|
+
iconPosition?: ButtonIconPosition;
|
|
17
|
+
text?: string;
|
|
18
|
+
href?: string;
|
|
19
|
+
isHrefExternal?: boolean;
|
|
20
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
21
|
+
className?: string;
|
|
22
|
+
locale?: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
autoFocus?: boolean;
|
|
25
|
+
type?: 'button' | 'submit' | 'reset';
|
|
26
|
+
}
|
|
27
|
+
export interface ButtonProps extends Omit<ButtonPrimitiveProps, 'color'> {
|
|
28
|
+
color?: ButtonColor;
|
|
29
|
+
}
|
|
30
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as c, jsxs as I, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import y from "classnames";
|
|
4
|
+
import { Interactive as w } from "../interactive/index.js";
|
|
5
|
+
import { FlightIcon as b } from "../flight-icon/index.js";
|
|
6
|
+
import a from "./styles.module.scss.js";
|
|
7
|
+
const U = ["small", "medium", "large"], $ = ["leading", "trailing"], j = [
|
|
8
|
+
"primary",
|
|
9
|
+
"primary-black",
|
|
10
|
+
"primary-white",
|
|
11
|
+
"secondary",
|
|
12
|
+
// deprecated; maps to secondary-white
|
|
13
|
+
"secondary-high-contrast",
|
|
14
|
+
// alternates based on theme
|
|
15
|
+
"secondary-white",
|
|
16
|
+
"secondary-black",
|
|
17
|
+
"tertiary",
|
|
18
|
+
"critical",
|
|
19
|
+
"boundary",
|
|
20
|
+
"consul",
|
|
21
|
+
"nomad",
|
|
22
|
+
"packer",
|
|
23
|
+
"terraform",
|
|
24
|
+
"vagrant",
|
|
25
|
+
"vault",
|
|
26
|
+
"waypoint",
|
|
27
|
+
"hashicorp"
|
|
28
|
+
// alias to primary
|
|
29
|
+
], B = {
|
|
30
|
+
primary: "primary",
|
|
31
|
+
"primary-black": "custom",
|
|
32
|
+
"primary-white": "custom",
|
|
33
|
+
secondary: "custom",
|
|
34
|
+
"secondary-high-contrast": "custom",
|
|
35
|
+
"secondary-white": "custom",
|
|
36
|
+
"secondary-black": "custom",
|
|
37
|
+
tertiary: "tertiary",
|
|
38
|
+
critical: "critical",
|
|
39
|
+
boundary: "custom",
|
|
40
|
+
consul: "custom",
|
|
41
|
+
nomad: "custom",
|
|
42
|
+
packer: "custom",
|
|
43
|
+
terraform: "custom",
|
|
44
|
+
vagrant: "custom",
|
|
45
|
+
vault: "custom",
|
|
46
|
+
waypoint: "custom",
|
|
47
|
+
hashicorp: "primary"
|
|
48
|
+
}, C = {
|
|
49
|
+
small: 12,
|
|
50
|
+
medium: 16,
|
|
51
|
+
large: 24
|
|
52
|
+
}, p = u(
|
|
53
|
+
({
|
|
54
|
+
size: o = "medium",
|
|
55
|
+
color: t = "primary",
|
|
56
|
+
isFullWidth: m,
|
|
57
|
+
isIconOnly: i,
|
|
58
|
+
icon: r,
|
|
59
|
+
iconPosition: e = "leading",
|
|
60
|
+
text: s,
|
|
61
|
+
href: h,
|
|
62
|
+
isHrefExternal: g,
|
|
63
|
+
className: f,
|
|
64
|
+
locale: N,
|
|
65
|
+
...d
|
|
66
|
+
}, O) => {
|
|
67
|
+
const n = i && !!r, l = r && /* @__PURE__ */ c(b, { name: r, size: C[o] });
|
|
68
|
+
return /* @__PURE__ */ c(
|
|
69
|
+
w,
|
|
70
|
+
{
|
|
71
|
+
className: y(
|
|
72
|
+
a.button,
|
|
73
|
+
a[`size-${o}`],
|
|
74
|
+
{
|
|
75
|
+
[a["width-full"]]: m,
|
|
76
|
+
[a["icon-only"]]: n
|
|
77
|
+
},
|
|
78
|
+
t !== "custom" && a[`color-${t}`],
|
|
79
|
+
f
|
|
80
|
+
),
|
|
81
|
+
href: d.disabled ? "" : h,
|
|
82
|
+
isHrefExternal: g,
|
|
83
|
+
"aria-label": n ? s : void 0,
|
|
84
|
+
locale: N,
|
|
85
|
+
...d,
|
|
86
|
+
ref: O,
|
|
87
|
+
children: n && r ? l : /* @__PURE__ */ I(v, { children: [
|
|
88
|
+
r && e === "leading" && l,
|
|
89
|
+
/* @__PURE__ */ c("div", { className: a.text, children: s }),
|
|
90
|
+
r && e === "trailing" && l
|
|
91
|
+
] })
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
p.displayName = "ButtonPrimitive";
|
|
97
|
+
const T = u(({ color: o = "primary", className: t, ...m }, i) => {
|
|
98
|
+
const r = B[o], s = r === "custom" ? a[`color-${{
|
|
99
|
+
hashicorp: "primary",
|
|
100
|
+
secondary: "secondary-white"
|
|
101
|
+
}[o] ?? o}`] : void 0;
|
|
102
|
+
return /* @__PURE__ */ c(
|
|
103
|
+
p,
|
|
104
|
+
{
|
|
105
|
+
...m,
|
|
106
|
+
color: r,
|
|
107
|
+
className: y(s, t),
|
|
108
|
+
ref: i
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
T.displayName = "Button";
|
|
113
|
+
export {
|
|
114
|
+
j as BUTTON_COLORS,
|
|
115
|
+
$ as BUTTON_ICON_POSITIONS,
|
|
116
|
+
U as BUTTON_SIZES,
|
|
117
|
+
T as Button
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import type { ForwardRefExoticComponent } from 'react'\nimport { forwardRef } from 'react'\nimport classNames from 'classnames'\nimport { Interactive } from '../interactive'\nimport type { FlightIconSize } from '../flight-icon'\nimport { FlightIcon } from '../flight-icon'\nimport s from './styles.module.scss'\n\nexport const BUTTON_SIZES = ['small', 'medium', 'large'] as const\nexport type ButtonSize = (typeof BUTTON_SIZES)[number]\n\nexport const BUTTON_ICON_POSITIONS = ['leading', 'trailing'] as const\nexport type ButtonIconPosition = (typeof BUTTON_ICON_POSITIONS)[number]\n\nexport const BUTTON_COLORS = [\n\t'primary',\n\t'primary-black',\n\t'primary-white',\n\t'secondary', // deprecated; maps to secondary-white\n\t'secondary-high-contrast', // alternates based on theme\n\t'secondary-white',\n\t'secondary-black',\n\t'tertiary',\n\t'critical',\n\t'boundary',\n\t'consul',\n\t'nomad',\n\t'packer',\n\t'terraform',\n\t'vagrant',\n\t'vault',\n\t'waypoint',\n\t'hashicorp', // alias to primary\n] as const\nexport type ButtonColor = (typeof BUTTON_COLORS)[number]\n\n// These are the only “real” colors our legacy button knows about\nconst LEGACY_COLORS = [\n\t'primary',\n\t'secondary',\n\t'tertiary',\n\t'critical',\n\t'custom',\n] as const\ntype LegacyButtonColor = (typeof LEGACY_COLORS)[number]\n\n// map HDS “super-set” colors down to our legacy ones\nconst COLOR_MAP: Record<ButtonColor, LegacyButtonColor> = {\n\tprimary: 'primary',\n\t'primary-black': 'custom',\n\t'primary-white': 'custom',\n\tsecondary: 'custom',\n\t'secondary-high-contrast': 'custom',\n\t'secondary-white': 'custom',\n\t'secondary-black': 'custom',\n\ttertiary: 'tertiary',\n\tcritical: 'critical',\n\tboundary: 'custom',\n\tconsul: 'custom',\n\tnomad: 'custom',\n\tpacker: 'custom',\n\tterraform: 'custom',\n\tvagrant: 'custom',\n\tvault: 'custom',\n\twaypoint: 'custom',\n\thashicorp: 'primary',\n}\n\ninterface ButtonPrimitiveProps {\n\tsize?: ButtonSize\n\tcolor?: LegacyButtonColor\n\tisFullWidth?: boolean\n\tisIconOnly?: boolean\n\ticon?: string\n\ticonPosition?: ButtonIconPosition\n\ttext?: string\n\thref?: string\n\tisHrefExternal?: boolean\n\tonClick?: React.MouseEventHandler<HTMLButtonElement>\n\tclassName?: string\n\tlocale?: string\n\tdisabled?: boolean\n\tautoFocus?: boolean\n\ttype?: 'button' | 'submit' | 'reset'\n}\n\nconst ICON_SIZE_MAP = {\n\tsmall: 12,\n\tmedium: 16,\n\tlarge: 24,\n} as const satisfies Record<'small' | 'medium' | 'large', FlightIconSize>\n\nconst ButtonPrimitive = forwardRef<HTMLButtonElement, ButtonPrimitiveProps>(\n\t(\n\t\t{\n\t\t\tsize = 'medium',\n\t\t\tcolor = 'primary',\n\t\t\tisFullWidth,\n\t\t\tisIconOnly,\n\t\t\ticon,\n\t\t\ticonPosition = 'leading',\n\t\t\ttext,\n\t\t\thref,\n\t\t\tisHrefExternal,\n\t\t\tclassName,\n\t\t\tlocale,\n\t\t\t...rest\n\t\t},\n\t\tref\n\t) => {\n\t\tconst hasIcon = Boolean(icon)\n\t\tconst showIconOnly = isIconOnly && hasIcon\n\n\t\tconst iconElement = icon && (\n\t\t\t<FlightIcon name={icon} size={ICON_SIZE_MAP[size]} />\n\t\t)\n\n\t\treturn (\n\t\t\t<Interactive\n\t\t\t\tclassName={classNames(\n\t\t\t\t\ts.button,\n\t\t\t\t\ts[`size-${size}`],\n\t\t\t\t\t{\n\t\t\t\t\t\t[s['width-full']]: isFullWidth,\n\t\t\t\t\t\t[s['icon-only']]: showIconOnly,\n\t\t\t\t\t},\n\t\t\t\t\tcolor !== 'custom' && s[`color-${color}`],\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\thref={rest.disabled ? '' : href}\n\t\t\t\tisHrefExternal={isHrefExternal}\n\t\t\t\taria-label={showIconOnly ? text : undefined}\n\t\t\t\tlocale={locale}\n\t\t\t\t{...rest}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{showIconOnly && icon ? (\n\t\t\t\t\ticonElement\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{icon && iconPosition === 'leading' && iconElement}\n\t\t\t\t\t\t<div className={s.text}>{text}</div>\n\t\t\t\t\t\t{icon && iconPosition === 'trailing' && iconElement}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</Interactive>\n\t\t)\n\t}\n)\nButtonPrimitive.displayName = 'ButtonPrimitive'\n\nexport interface ButtonProps extends Omit<ButtonPrimitiveProps, 'color'> {\n\tcolor?: ButtonColor\n}\n\nexport const Button = forwardRef<\n\tHTMLAnchorElement | HTMLButtonElement,\n\tButtonProps\n>(({ color = 'primary', className, ...rest }, ref) => {\n\tconst legacyColor = COLOR_MAP[color]\n\n\tconst remappedColors: Partial<Record<ButtonColor, ButtonColor>> = {\n\t\thashicorp: 'primary',\n\t\tsecondary: 'secondary-white',\n\t}\n\n\tconst customClass =\n\t\tlegacyColor === 'custom'\n\t\t\t? s[`color-${remappedColors[color] ?? color}`]\n\t\t\t: undefined\n\n\treturn (\n\t\t<ButtonPrimitive\n\t\t\t{...rest}\n\t\t\tcolor={legacyColor}\n\t\t\tclassName={classNames(customClass, className)}\n\t\t\tref={ref as ForwardRefExoticComponent<HTMLButtonElement>}\n\t\t/>\n\t)\n})\n\nButton.displayName = 'Button'\n"],"names":["BUTTON_SIZES","BUTTON_ICON_POSITIONS","BUTTON_COLORS","COLOR_MAP","ICON_SIZE_MAP","ButtonPrimitive","forwardRef","size","color","isFullWidth","isIconOnly","icon","iconPosition","text","href","isHrefExternal","className","locale","rest","ref","showIconOnly","iconElement","jsx","FlightIcon","Interactive","classNames","s","jsxs","Fragment","Button","legacyColor","customClass"],"mappings":";;;;;;AAQO,MAAMA,IAAe,CAAC,SAAS,UAAU,OAAO,GAG1CC,IAAwB,CAAC,WAAW,UAAU,GAG9CC,IAAgB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACD,GAcMC,IAAoD;AAAA,EACzD,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,2BAA2B;AAAA,EAC3B,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AACZ,GAoBMC,IAAgB;AAAA,EACrB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACR,GAEMC,IAAkBC;AAAA,EACvB,CACC;AAAA,IACC,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEJC,MACI;AAEJ,UAAMC,IAAeV,KADL,EAAQC,GAGlBU,IAAcV,KACnB,gBAAAW,EAACC,GAAA,EAAW,MAAMZ,GAAM,MAAMP,EAAcG,CAAI,EAAA,CAAG;AAGpD,WACC,gBAAAe;AAAA,MAACE;AAAA,MAAA;AAAA,QACA,WAAWC;AAAA,UACVC,EAAE;AAAA,UACFA,EAAE,QAAQnB,CAAI,EAAE;AAAA,UAChB;AAAA,YACC,CAACmB,EAAE,YAAY,CAAC,GAAGjB;AAAA,YACnB,CAACiB,EAAE,WAAW,CAAC,GAAGN;AAAA,UAAA;AAAA,UAEnBZ,MAAU,YAAYkB,EAAE,SAASlB,CAAK,EAAE;AAAA,UACxCQ;AAAA,QAAA;AAAA,QAED,MAAME,EAAK,WAAW,KAAKJ;AAAA,QAC3B,gBAAAC;AAAA,QACA,cAAYK,IAAeP,IAAO;AAAA,QAClC,QAAAI;AAAA,QACC,GAAGC;AAAA,QACJ,KAAAC;AAAA,QAEC,UAAAC,KAAgBT,IAChBU,IAEA,gBAAAM,EAAAC,GAAA,EACE,UAAA;AAAA,UAAAjB,KAAQC,MAAiB,aAAaS;AAAA,UACvC,gBAAAC,EAAC,OAAA,EAAI,WAAWI,EAAE,MAAO,UAAAb,GAAK;AAAA,UAC7BF,KAAQC,MAAiB,cAAcS;AAAA,QAAA,EAAA,CACzC;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;AACAhB,EAAgB,cAAc;AAMvB,MAAMwB,IAASvB,EAGpB,CAAC,EAAE,OAAAE,IAAQ,WAAW,WAAAQ,GAAW,GAAGE,EAAA,GAAQC,MAAQ;AACrD,QAAMW,IAAc3B,EAAUK,CAAK,GAO7BuB,IACLD,MAAgB,WACbJ,EAAE,SAP4D;AAAA,IACjE,WAAW;AAAA,IACX,WAAW;AAAA,EAAA,EAKkBlB,CAAK,KAAKA,CAAK,EAAE,IAC3C;AAEJ,SACC,gBAAAc;AAAA,IAACjB;AAAA,IAAA;AAAA,MACC,GAAGa;AAAA,MACJ,OAAOY;AAAA,MACP,WAAWL,EAAWM,GAAaf,CAAS;AAAA,MAC5C,KAAAG;AAAA,IAAA;AAAA,EAAA;AAGH,CAAC;AAEDU,EAAO,cAAc;"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
@use 'styles/mixins/button' as *;
|
|
2
|
+
|
|
3
|
+
$button-border-width: 1px;
|
|
4
|
+
$button-focus-border-width: 3px;
|
|
5
|
+
$button-border-radius: 5px;
|
|
6
|
+
|
|
7
|
+
.button {
|
|
8
|
+
@include hds-button();
|
|
9
|
+
|
|
10
|
+
// the <a> element behaves differently than a <button>
|
|
11
|
+
@at-root a#{&} {
|
|
12
|
+
width: fit-content;
|
|
13
|
+
|
|
14
|
+
// for more background on the use of underlining as defined below read the following document: https://docs.google.com/document/d/1acLxdRqmy92vQ8ArShPxoBFmAV0StsbZrqEic6MVt20
|
|
15
|
+
&:hover,
|
|
16
|
+
&:focus,
|
|
17
|
+
&:active {
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// This covers all of the browsers and focus scenarios (due to the custom focus design).
|
|
23
|
+
//
|
|
24
|
+
// IMPORTANT: we need to use also the [disabled] selector because if the "disabled" attribute is applied to a "Button as link",
|
|
25
|
+
// the ":disabled" pseudo-selector is not applied to the element in the browser (rightly) because a link can't be disabled
|
|
26
|
+
// but from the product perspective there may be use cases where they need to have a "Button as link" that looks disabled anyway
|
|
27
|
+
//
|
|
28
|
+
&:disabled,
|
|
29
|
+
&[disabled],
|
|
30
|
+
&:disabled:focus,
|
|
31
|
+
&[disabled]:focus,
|
|
32
|
+
&:disabled:hover,
|
|
33
|
+
&[disabled]:hover {
|
|
34
|
+
@include hds-button-state-disabled();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.width-full {
|
|
38
|
+
width: 100%;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
|
|
41
|
+
.text {
|
|
42
|
+
flex: 0 0 auto;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:focus {
|
|
47
|
+
@include hds-button-state-focus();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.text {
|
|
52
|
+
flex: 1 0 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.color-primary {
|
|
56
|
+
@include hds-button-color-primary();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.color-secondary {
|
|
60
|
+
@include hds-button-color-secondary();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.color-tertiary {
|
|
64
|
+
@include hds-button-color-tertiary();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.color-critical {
|
|
68
|
+
@include hds-button-color-critical();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@mixin mds-button-color-product($product) {
|
|
72
|
+
color: var(--mds-color-#{$product}-button-foreground);
|
|
73
|
+
background-color: var(--mds-color-#{$product}-button-background);
|
|
74
|
+
border-color: var(
|
|
75
|
+
--mds-color-#{$product}-button-border,
|
|
76
|
+
var(--mds-color-border-primary)
|
|
77
|
+
);
|
|
78
|
+
box-shadow: var(--mds-elevation-low-box-shadow);
|
|
79
|
+
|
|
80
|
+
&:hover {
|
|
81
|
+
color: var(--mds-color-#{$product}-button-foreground);
|
|
82
|
+
background-color: var(--mds-color-#{$product}-button-background-hover);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:focus {
|
|
87
|
+
color: var(--mds-color-#{$product}-button-foreground);
|
|
88
|
+
background-color: var(--mds-color-#{$product}-button-background-focus);
|
|
89
|
+
|
|
90
|
+
&::before {
|
|
91
|
+
/* the position absolute of an element is computed from the inside of the border of the container
|
|
92
|
+
so we have to take in account the border width of the pseudo-element container itself
|
|
93
|
+
plus for the primary button we want to have a 2px gap between the button and the focus */
|
|
94
|
+
$shift: $button-border-width + $button-focus-border-width + 2px;
|
|
95
|
+
top: -$shift;
|
|
96
|
+
right: -$shift;
|
|
97
|
+
bottom: -$shift;
|
|
98
|
+
left: -$shift;
|
|
99
|
+
border-color: var(--mds-color-focus-action-external);
|
|
100
|
+
border-radius: $button-border-radius + $button-focus-border-width +
|
|
101
|
+
2px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:active {
|
|
106
|
+
color: var(--mds-color-#{$product}-button-foreground);
|
|
107
|
+
background-color: var(--mds-color-#{$product}-button-background-active);
|
|
108
|
+
box-shadow: none;
|
|
109
|
+
|
|
110
|
+
&::before {
|
|
111
|
+
border-color: transparent;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.color-primary-white {
|
|
117
|
+
@include mds-button-color-product('primary-white');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.color-primary-black {
|
|
121
|
+
@include mds-button-color-product('primary-black');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.color-secondary-white {
|
|
125
|
+
@include mds-button-color-product('secondary-white');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.color-secondary-black {
|
|
129
|
+
@include mds-button-color-product('secondary-black');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:global(.mds-dark-mode),
|
|
133
|
+
:global([data-theme='dark']) {
|
|
134
|
+
& .color-secondary-high-contrast {
|
|
135
|
+
@include mds-button-color-product('secondary-white');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.color-secondary-high-contrast {
|
|
140
|
+
@include mds-button-color-product('secondary-black');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.color-boundary {
|
|
144
|
+
@include mds-button-color-product('boundary');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.color-consul {
|
|
148
|
+
@include mds-button-color-product('consul');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.color-nomad {
|
|
152
|
+
@include mds-button-color-product('nomad');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.color-packer {
|
|
156
|
+
@include mds-button-color-product('packer');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.color-terraform {
|
|
160
|
+
@include mds-button-color-product('terraform');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.color-vagrant {
|
|
164
|
+
@include mds-button-color-product('vagrant');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.color-vault {
|
|
168
|
+
@include mds-button-color-product('vault');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.color-waypoint {
|
|
172
|
+
@include mds-button-color-product('waypoint');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.size-small {
|
|
176
|
+
min-height: 1.75rem;
|
|
177
|
+
padding: 0.375rem 0.6875rem;
|
|
178
|
+
|
|
179
|
+
& .text {
|
|
180
|
+
font-size: 0.8125rem;
|
|
181
|
+
line-height: 0.875rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&.icon-only {
|
|
185
|
+
min-width: 1.75rem;
|
|
186
|
+
padding-right: 0.375rem;
|
|
187
|
+
padding-left: 0.375rem;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.size-medium {
|
|
192
|
+
min-height: 2.25rem;
|
|
193
|
+
padding: 0.5625rem 0.9375rem;
|
|
194
|
+
|
|
195
|
+
& .text {
|
|
196
|
+
font-size: 0.875rem;
|
|
197
|
+
line-height: 1rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.icon-only {
|
|
201
|
+
min-width: 2.25rem;
|
|
202
|
+
padding-right: 0.5625rem;
|
|
203
|
+
padding-left: 0.5625rem;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.size-large {
|
|
208
|
+
min-height: 3rem;
|
|
209
|
+
padding: 0.6875rem 1.1875rem;
|
|
210
|
+
|
|
211
|
+
& .text {
|
|
212
|
+
font-size: 1rem;
|
|
213
|
+
line-height: 1.5rem;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&.icon-only {
|
|
217
|
+
min-width: 3rem;
|
|
218
|
+
padding-right: 0.6875rem;
|
|
219
|
+
padding-left: 0.6875rem;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const o = "button__gOWvd", r = "text__KbKvH", c = {
|
|
2
|
+
button: o,
|
|
3
|
+
"width-full": "width-full__juTUO",
|
|
4
|
+
text: r,
|
|
5
|
+
"color-primary": "color-primary__rWbwp",
|
|
6
|
+
"color-secondary": "color-secondary__-5Q4d",
|
|
7
|
+
"color-tertiary": "color-tertiary__rw4Ww",
|
|
8
|
+
"color-critical": "color-critical__-8hXs",
|
|
9
|
+
"color-primary-white": "color-primary-white__2JDoz",
|
|
10
|
+
"color-primary-black": "color-primary-black__zTF4n",
|
|
11
|
+
"color-secondary-white": "color-secondary-white__AseI0",
|
|
12
|
+
"color-secondary-black": "color-secondary-black__b-umt",
|
|
13
|
+
"color-secondary-high-contrast": "color-secondary-high-contrast__3bxg3",
|
|
14
|
+
"color-boundary": "color-boundary__xJtzy",
|
|
15
|
+
"color-consul": "color-consul__5lFsa",
|
|
16
|
+
"color-nomad": "color-nomad__HGWXf",
|
|
17
|
+
"color-packer": "color-packer__vbRu0",
|
|
18
|
+
"color-terraform": "color-terraform__DQMD5",
|
|
19
|
+
"color-vagrant": "color-vagrant__iNokw",
|
|
20
|
+
"color-vault": "color-vault__Q6Qbm",
|
|
21
|
+
"color-waypoint": "color-waypoint__8j-Oi",
|
|
22
|
+
"size-small": "size-small__kT0Jp",
|
|
23
|
+
"icon-only": "icon-only__5c-is",
|
|
24
|
+
"size-medium": "size-medium__HxMcm",
|
|
25
|
+
"size-large": "size-large__MEpK3"
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
o as button,
|
|
29
|
+
c as default,
|
|
30
|
+
r as text
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=styles.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-thumbnail.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useMDSImage as l } from "../../../utils/mds-context/index.js";
|
|
4
|
+
import o from "./card-thumbnail.module.css.js";
|
|
5
|
+
const u = ({
|
|
6
|
+
alt: r,
|
|
7
|
+
aspectRatio: m,
|
|
8
|
+
src: t
|
|
9
|
+
}) => {
|
|
10
|
+
const i = l();
|
|
11
|
+
return t ? /* @__PURE__ */ e(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: o.thumbnail,
|
|
15
|
+
style: { "--aspect-ratio": m },
|
|
16
|
+
children: /* @__PURE__ */ e(i, { fill: !0, alt: r, src: t })
|
|
17
|
+
}
|
|
18
|
+
) : null;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
u as CardThumbnail
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/card/card-thumbnail/index.tsx"],"sourcesContent":["'use client'\n\nimport { useMDSImage } from '../../../utils/mds-context'\nimport type { CardThumbnailProps } from '../types'\nimport s from './card-thumbnail.module.css'\n\nexport const CardThumbnail = ({\n\talt,\n\taspectRatio,\n\tsrc,\n}: CardThumbnailProps) => {\n\tconst Image = useMDSImage()\n\treturn src ? (\n\t\t<div\n\t\t\tclassName={s.thumbnail}\n\t\t\tstyle={{ ['--aspect-ratio' as string]: aspectRatio }}\n\t\t>\n\t\t\t<Image fill alt={alt} src={src} />\n\t\t</div>\n\t) : null\n}\n"],"names":["CardThumbnail","alt","aspectRatio","src","Image","useMDSImage","jsx","s"],"mappings":";;;;AAM8B,MAC7BA,IAAA,CAAA;AAAA,EACA,KAAAC;AAAA,EACA,aAAAC;AAAA,EACD,KAAAC;AACC,MAAA;AACA,QAAAC,IAAOC,EAAA;AACN,SAACF,IAAA,gBAAAG;AAAA,IAAA;AAAA,IAAA;AAAA,MAEA,WAAUC,EAAA;AAAA,MAEV,OAAA,EAAA,kBAAAL,EAAO;AAAA,MAAyB,UAAA,gBAAAI,EAAAF,GAAA,EAAA,MAAA,IAAA,KAAAH,GAAA,KAAAE,EAAA,CAAA;AAAA;EAGnC,IAAA;;"}
|