@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,50 @@
|
|
|
1
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import g from "classnames";
|
|
3
|
+
import { FlightIcon as u } from "../flight-icon/index.js";
|
|
4
|
+
import e from "./style.module.scss.js";
|
|
5
|
+
const S = ["small", "medium", "large"], _ = ["filled", "inverted", "outlined"], A = [
|
|
6
|
+
"neutral",
|
|
7
|
+
"neutral-dark-mode",
|
|
8
|
+
"highlight",
|
|
9
|
+
"success",
|
|
10
|
+
"warning",
|
|
11
|
+
"critical"
|
|
12
|
+
], p = {
|
|
13
|
+
small: 12,
|
|
14
|
+
medium: 16,
|
|
15
|
+
large: 16
|
|
16
|
+
}, h = ({
|
|
17
|
+
icon: l,
|
|
18
|
+
iconColor: m,
|
|
19
|
+
iconOnly: i,
|
|
20
|
+
text: r,
|
|
21
|
+
size: a = "medium",
|
|
22
|
+
type: o = "filled",
|
|
23
|
+
color: t = "neutral",
|
|
24
|
+
className: d,
|
|
25
|
+
...n
|
|
26
|
+
}) => /* @__PURE__ */ c(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: g(
|
|
30
|
+
e.badge,
|
|
31
|
+
e[`size-${a}`],
|
|
32
|
+
e[`type-${o}`],
|
|
33
|
+
e[`color-${t}`],
|
|
34
|
+
d
|
|
35
|
+
),
|
|
36
|
+
...n,
|
|
37
|
+
children: [
|
|
38
|
+
l && /* @__PURE__ */ s(u, { name: l, color: m, size: p[a] }),
|
|
39
|
+
i && l ? /* @__PURE__ */ s("span", { className: "sr-only", children: r }) : /* @__PURE__ */ s("div", { className: e.text, children: r })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
h.displayName = "Badge";
|
|
44
|
+
export {
|
|
45
|
+
A as BADGE_COLORS,
|
|
46
|
+
S as BADGE_SIZES,
|
|
47
|
+
_ as BADGE_TYPES,
|
|
48
|
+
h as Badge
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/badge/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport type { FlightIconName, FlightIconSize } from '../flight-icon'\nimport { FlightIcon } from '../flight-icon'\nimport s from './style.module.scss'\n\nconst BADGE_SIZES = ['small', 'medium', 'large'] as const\ntype BadgeSize = (typeof BADGE_SIZES)[number]\n\nconst BADGE_TYPES = ['filled', 'inverted', 'outlined'] as const\ntype BadgeType = (typeof BADGE_TYPES)[number]\n\nconst BADGE_COLORS = [\n\t'neutral',\n\t'neutral-dark-mode',\n\t'highlight',\n\t'success',\n\t'warning',\n\t'critical',\n] as const\ntype BadgeColor = (typeof BADGE_COLORS)[number]\n\nconst ICON_SIZE_MAP = {\n\tsmall: 12,\n\tmedium: 16,\n\tlarge: 16,\n} as const satisfies Record<'small' | 'medium' | 'large', FlightIconSize>\n\ninterface BadgeProps {\n\t/** Use this parameter to show an icon. */\n\ticon?: FlightIconName\n\n\t/**\n\t * The `iconColor` prop can be used to change the icon color. It works by setting\n\t * the value of the icon SVG’s fill property.\n\t */\n\ticonColor?: string\n\n\t/** This indicates if the button will only contain an icon. An internal check is in place to ensure that accessible text is still applied to the component. */\n\ticonOnly?: boolean\n\n\t/** The text of the Badge or value of the screen-reader only element if isIconOnly is set to true. If no text value is defined an error will be thrown. */\n\ttext: string\n\n\tsize?: BadgeSize\n\ttype?: BadgeType\n\tcolor?: BadgeColor\n\tclassName?: string\n}\n\nconst Badge = ({\n\ticon,\n\ticonColor,\n\ticonOnly,\n\ttext,\n\tsize = 'medium',\n\ttype = 'filled',\n\tcolor = 'neutral',\n\tclassName,\n\t...rest\n}: BadgeProps) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\ts.badge,\n\t\t\t\ts[`size-${size}`],\n\t\t\t\ts[`type-${type}`],\n\t\t\t\ts[`color-${color}`],\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{icon && (\n\t\t\t\t<FlightIcon name={icon} color={iconColor} size={ICON_SIZE_MAP[size]} />\n\t\t\t)}\n\t\t\t{iconOnly && icon ? (\n\t\t\t\t<span className=\"sr-only\">{text}</span>\n\t\t\t) : (\n\t\t\t\t<div className={s.text}>{text}</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nBadge.displayName = 'Badge'\n\nexport type { BadgeProps, BadgeColor, BadgeSize, BadgeType }\nexport { Badge, BADGE_COLORS, BADGE_SIZES, BADGE_TYPES }\n"],"names":["BADGE_SIZES","BADGE_TYPES","BADGE_COLORS","ICON_SIZE_MAP","Badge","icon","iconColor","iconOnly","text","size","type","color","className","rest","jsxs","classNames","s","jsx","FlightIcon"],"mappings":";;;;AAKA,MAAMA,IAAc,CAAC,SAAS,UAAU,OAAO,GAGzCC,IAAc,CAAC,UAAU,YAAY,UAAU,GAG/CC,IAAe;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAGMC,IAAgB;AAAA,EACrB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACR,GAwBMC,IAAQ,CAAC;AAAA,EACd,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC;AAAA,MACVC,EAAE;AAAA,MACFA,EAAE,QAAQP,CAAI,EAAE;AAAA,MAChBO,EAAE,QAAQN,CAAI,EAAE;AAAA,MAChBM,EAAE,SAASL,CAAK,EAAE;AAAA,MAClBC;AAAA,IAAA;AAAA,IAEA,GAAGC;AAAA,IAEH,UAAA;AAAA,MAAAR,KACA,gBAAAY,EAACC,KAAW,MAAMb,GAAM,OAAOC,GAAW,MAAMH,EAAcM,CAAI,EAAA,CAAG;AAAA,MAErEF,KAAYF,IACZ,gBAAAY,EAAC,QAAA,EAAK,WAAU,WAAW,UAAAT,EAAA,CAAK,IAEhC,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAE,MAAO,UAAAR,EAAA,CAAK;AAAA,IAAA;AAAA,EAAA;AAAA;AAMlCJ,EAAM,cAAc;"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
$colors: ('highlight', 'success', 'warning', 'critical');
|
|
2
|
+
$sizes: ('small', 'medium', 'large');
|
|
3
|
+
$border-width: 1px;
|
|
4
|
+
|
|
5
|
+
.badge {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
vertical-align: middle;
|
|
10
|
+
border: $border-width solid transparent;
|
|
11
|
+
border-radius: 5px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.text {
|
|
15
|
+
flex: 1 0 0;
|
|
16
|
+
font-weight: var(--mds-typography-font-weight-medium);
|
|
17
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// SIZE
|
|
21
|
+
|
|
22
|
+
// these values later may come from the design tokens
|
|
23
|
+
$size-props: (
|
|
24
|
+
'small': (
|
|
25
|
+
'font-size': 0.8125rem,
|
|
26
|
+
// 13px
|
|
27
|
+
'gap': 0.25rem,
|
|
28
|
+
'height': 1.25rem,
|
|
29
|
+
'line-height': 1.2308,
|
|
30
|
+
// 16px
|
|
31
|
+
'padding-vertical': 0.125rem,
|
|
32
|
+
'padding-horizontal': 0.375rem,
|
|
33
|
+
),
|
|
34
|
+
'medium': (
|
|
35
|
+
'font-size': 0.8125rem,
|
|
36
|
+
// 13px
|
|
37
|
+
'gap': 0.25rem,
|
|
38
|
+
'height': 1.5rem,
|
|
39
|
+
'line-height': 1.2308,
|
|
40
|
+
// 16px
|
|
41
|
+
'padding-vertical': 0.25rem,
|
|
42
|
+
'padding-horizontal': 0.5rem,
|
|
43
|
+
),
|
|
44
|
+
'large': (
|
|
45
|
+
'font-size': 1rem,
|
|
46
|
+
// 16px
|
|
47
|
+
'gap': 0.375rem,
|
|
48
|
+
'height': 2rem,
|
|
49
|
+
'line-height': 1.5,
|
|
50
|
+
// 24px
|
|
51
|
+
'padding-vertical': 0.25rem,
|
|
52
|
+
'padding-horizontal': 0.5rem,
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
@each $size in $sizes {
|
|
57
|
+
.size-#{$size} {
|
|
58
|
+
gap: map-get($size-props, $size, 'gap');
|
|
59
|
+
min-height: map-get($size-props, $size, 'height');
|
|
60
|
+
padding: calc(
|
|
61
|
+
#{map-get($size-props, $size, 'padding-vertical')} - #{$border-width}
|
|
62
|
+
)
|
|
63
|
+
calc(
|
|
64
|
+
#{map-get($size-props, $size, 'padding-horizontal')} - #{$border-width}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
.text {
|
|
68
|
+
font-size: map-get($size-props, $size, 'font-size');
|
|
69
|
+
line-height: map-get($size-props, $size, 'line-height');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// COLOR + TYPE COMBINATIONS
|
|
75
|
+
|
|
76
|
+
.color-neutral {
|
|
77
|
+
&.type-filled {
|
|
78
|
+
color: var(--mds-color-foreground-primary);
|
|
79
|
+
background-color: var(--mds-color-surface-strong);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.type-inverted {
|
|
83
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
84
|
+
background-color: var(--mds-color-foreground-faint);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.type-outlined {
|
|
88
|
+
color: var(--mds-color-foreground-primary);
|
|
89
|
+
background-color: transparent;
|
|
90
|
+
border-color: var(--mds-color-foreground-faint);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.color-neutral-dark-mode {
|
|
95
|
+
&.type-filled {
|
|
96
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
97
|
+
background-color: var(--mds-color-foreground-faint);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.type-inverted {
|
|
101
|
+
color: var(--mds-color-foreground-primary);
|
|
102
|
+
background-color: var(--mds-color-surface-faint);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.type-outlined {
|
|
106
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
border-color: var(--mds-color-palette-neutral-100);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@each $color in $colors {
|
|
113
|
+
.color-#{$color} {
|
|
114
|
+
&.type-filled {
|
|
115
|
+
color: var(--mds-color-foreground-#{$color}-on-surface);
|
|
116
|
+
background-color: var(--mds-color-surface-#{$color});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.type-inverted {
|
|
120
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
121
|
+
background-color: var(--mds-color-foreground-#{$color});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.type-outlined {
|
|
125
|
+
color: var(--mds-color-foreground-#{$color});
|
|
126
|
+
background-color: transparent;
|
|
127
|
+
border-color: currentColor;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const e = "badge__zns82", l = "text__WoM4W", o = {
|
|
2
|
+
badge: e,
|
|
3
|
+
text: l,
|
|
4
|
+
"size-small": "size-small__8xHdE",
|
|
5
|
+
"size-medium": "size-medium__xqCpO",
|
|
6
|
+
"size-large": "size-large__Pviip",
|
|
7
|
+
"color-neutral": "color-neutral__6Csf4",
|
|
8
|
+
"type-filled": "type-filled__ZaWsu",
|
|
9
|
+
"type-inverted": "type-inverted__A3554",
|
|
10
|
+
"type-outlined": "type-outlined__l0zjH",
|
|
11
|
+
"color-neutral-dark-mode": "color-neutral-dark-mode__C1TO4",
|
|
12
|
+
"color-highlight": "color-highlight__eWwJ5",
|
|
13
|
+
"color-success": "color-success__EuxKz",
|
|
14
|
+
"color-warning": "color-warning__gCbUY",
|
|
15
|
+
"color-critical": "color-critical__hV-l-"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
e as badge,
|
|
19
|
+
o as default,
|
|
20
|
+
l as text
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
interface BadgeCountProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
size?: 'small' | 'medium' | 'large';
|
|
4
|
+
type?: 'filled' | 'inverted' | 'outlined';
|
|
5
|
+
color?: 'neutral' | 'neutral-dark-mode';
|
|
6
|
+
/**
|
|
7
|
+
* Text value that renders in the Badge Count.
|
|
8
|
+
*/
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
declare const BadgeCount: {
|
|
12
|
+
({ text, size, type, color, className, ...rest }: BadgeCountProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export type { BadgeCountProps };
|
|
16
|
+
export { BadgeCount };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import d from "classnames";
|
|
3
|
+
import e from "./style.module.scss.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
text: o,
|
|
6
|
+
size: r = "medium",
|
|
7
|
+
type: m = "filled",
|
|
8
|
+
color: t = "neutral",
|
|
9
|
+
className: a,
|
|
10
|
+
...s
|
|
11
|
+
}) => /* @__PURE__ */ i(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: d(
|
|
15
|
+
e["badge-count"],
|
|
16
|
+
e[`size-${r}`],
|
|
17
|
+
e[`type-${m}`],
|
|
18
|
+
e[`color-${t}`],
|
|
19
|
+
a
|
|
20
|
+
),
|
|
21
|
+
...s,
|
|
22
|
+
children: o
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
l.displayName = "BadgeCount";
|
|
26
|
+
export {
|
|
27
|
+
l as BadgeCount
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/badge-count/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport type { HTMLAttributes } from 'react'\nimport s from './style.module.scss'\n\ninterface BadgeCountProps extends HTMLAttributes<HTMLDivElement> {\n\tsize?: 'small' | 'medium' | 'large'\n\ttype?: 'filled' | 'inverted' | 'outlined'\n\tcolor?: 'neutral' | 'neutral-dark-mode'\n\t/**\n\t * Text value that renders in the Badge Count.\n\t */\n\ttext: string\n}\n\nconst BadgeCount = ({\n\ttext,\n\tsize = 'medium',\n\ttype = 'filled',\n\tcolor = 'neutral',\n\tclassName,\n\t...rest\n}: BadgeCountProps) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\ts['badge-count'],\n\t\t\t\ts[`size-${size}`],\n\t\t\t\ts[`type-${type}`],\n\t\t\t\ts[`color-${color}`],\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{text}\n\t\t</div>\n\t)\n}\n\nBadgeCount.displayName = 'BadgeCount'\n\nexport type { BadgeCountProps }\nexport { BadgeCount }\n"],"names":["BadgeCount","text","size","type","color","className","rest","jsx","classNames","s"],"mappings":";;;AAcA,MAAMA,IAAa,CAAC;AAAA,EACnB,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC;AAAA,MACVC,EAAE,aAAa;AAAA,MACfA,EAAE,QAAQP,CAAI,EAAE;AAAA,MAChBO,EAAE,QAAQN,CAAI,EAAE;AAAA,MAChBM,EAAE,SAASL,CAAK,EAAE;AAAA,MAClBC;AAAA,IAAA;AAAA,IAEA,GAAGC;AAAA,IAEH,UAAAL;AAAA,EAAA;AAAA;AAKJD,EAAW,cAAc;"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// BADGE-COUNT COMPONENT
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
@use 'sass:math';
|
|
11
|
+
|
|
12
|
+
$sizes: ('small', 'medium', 'large');
|
|
13
|
+
$border-width: 1px;
|
|
14
|
+
|
|
15
|
+
.badge-count {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
font-weight: var(--mds-typography-font-weight-medium);
|
|
20
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
21
|
+
border: $border-width solid transparent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// SIZE
|
|
25
|
+
|
|
26
|
+
// these values later may come from the design tokens
|
|
27
|
+
$size-props: (
|
|
28
|
+
'small': (
|
|
29
|
+
'font-size': 0.8125rem,
|
|
30
|
+
// 13px
|
|
31
|
+
'height': 1.25rem,
|
|
32
|
+
'line-height': 1.2308,
|
|
33
|
+
// 16px
|
|
34
|
+
'padding-vertical': 0.125rem,
|
|
35
|
+
'padding-horizontal': 0.5rem,
|
|
36
|
+
),
|
|
37
|
+
'medium': (
|
|
38
|
+
'font-size': 0.8125rem,
|
|
39
|
+
// 13px
|
|
40
|
+
'height': 1.5rem,
|
|
41
|
+
'line-height': 1.2308,
|
|
42
|
+
// 16px
|
|
43
|
+
'padding-vertical': 0.25rem,
|
|
44
|
+
'padding-horizontal': 0.75rem,
|
|
45
|
+
),
|
|
46
|
+
'large': (
|
|
47
|
+
'font-size': 1rem,
|
|
48
|
+
// 16px
|
|
49
|
+
'height': 2rem,
|
|
50
|
+
'line-height': 1.5,
|
|
51
|
+
// 24px
|
|
52
|
+
'padding-vertical': 0.25rem,
|
|
53
|
+
'padding-horizontal': 0.875rem,
|
|
54
|
+
),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
@each $size in $sizes {
|
|
58
|
+
.size-#{$size} {
|
|
59
|
+
min-height: map-get($size-props, $size, 'height');
|
|
60
|
+
padding: calc(
|
|
61
|
+
#{map-get($size-props, $size, 'padding-vertical')} - #{$border-width}
|
|
62
|
+
)
|
|
63
|
+
calc(
|
|
64
|
+
#{map-get($size-props, $size, 'padding-horizontal')} - #{$border-width}
|
|
65
|
+
);
|
|
66
|
+
font-size: map-get($size-props, $size, 'font-size');
|
|
67
|
+
line-height: map-get($size-props, $size, 'line-height');
|
|
68
|
+
border-radius: math.div(map-get($size-props, $size, 'height'), 2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// COLOR + TYPE COMBINATIONS
|
|
73
|
+
|
|
74
|
+
.color-neutral {
|
|
75
|
+
&.type-filled {
|
|
76
|
+
color: var(--mds-color-foreground-primary);
|
|
77
|
+
background-color: var(--mds-color-surface-strong);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.type-inverted {
|
|
81
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
82
|
+
background-color: var(--mds-color-foreground-faint);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.type-outlined {
|
|
86
|
+
color: var(--mds-color-foreground-primary);
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
border-color: var(--mds-color-foreground-faint);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.color-neutral-dark-mode {
|
|
93
|
+
&.type-filled {
|
|
94
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
95
|
+
background-color: var(--mds-color-foreground-faint);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.type-inverted {
|
|
99
|
+
color: var(--mds-color-foreground-primary);
|
|
100
|
+
background-color: var(--mds-color-surface-faint);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.type-outlined {
|
|
104
|
+
color: var(--mds-color-foreground-high-contrast);
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
border-color: var(--mds-color-palette-neutral-100);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
"badge-count": "badge-count__9xA6z",
|
|
3
|
+
"size-small": "size-small__LxiPj",
|
|
4
|
+
"size-medium": "size-medium__emKOI",
|
|
5
|
+
"size-large": "size-large__M7RFP",
|
|
6
|
+
"color-neutral": "color-neutral__j2CVd",
|
|
7
|
+
"type-filled": "type-filled__tb7Yx",
|
|
8
|
+
"type-inverted": "type-inverted__Oc-mV",
|
|
9
|
+
"type-outlined": "type-outlined__V714E",
|
|
10
|
+
"color-neutral-dark-mode": "color-neutral-dark-mode__LLW-g"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
e as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=style.module.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BreadcrumbProps, BreadcrumbTruncationProps } from './types';
|
|
2
|
+
declare const Breadcrumbs: {
|
|
3
|
+
Root: ({ itemsCanWrap, ariaLabel, children, className, ...rest }: BreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Item: ({ maxWidth, current, icon, text, url, ...rest }: import('./types').BreadcrumbItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Truncation: ({ ariaLabel, children, ...rest }: BreadcrumbTruncationProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export { Breadcrumbs };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import s from "classnames";
|
|
3
|
+
import { Provider as m, Toggle as l, Content as u } from "../menu-primitive/index.js";
|
|
4
|
+
import { Item as d } from "./item/index.js";
|
|
5
|
+
import { TruncationButton as b } from "./truncation-button/index.js";
|
|
6
|
+
import t from "./style.module.scss.js";
|
|
7
|
+
const p = ({
|
|
8
|
+
itemsCanWrap: e = !0,
|
|
9
|
+
ariaLabel: o = "breadcrumbs",
|
|
10
|
+
children: a,
|
|
11
|
+
className: n,
|
|
12
|
+
...i
|
|
13
|
+
}) => /* @__PURE__ */ r(
|
|
14
|
+
"nav",
|
|
15
|
+
{
|
|
16
|
+
className: s(
|
|
17
|
+
t.breadcrumbs,
|
|
18
|
+
{
|
|
19
|
+
[t["items-can-wrap"]]: e
|
|
20
|
+
},
|
|
21
|
+
n
|
|
22
|
+
),
|
|
23
|
+
"aria-label": o,
|
|
24
|
+
...i,
|
|
25
|
+
children: /* @__PURE__ */ r("ol", { className: t.list, children: a })
|
|
26
|
+
}
|
|
27
|
+
), f = ({
|
|
28
|
+
ariaLabel: e,
|
|
29
|
+
children: o,
|
|
30
|
+
...a
|
|
31
|
+
}) => /* @__PURE__ */ r("li", { className: s(t.item, t.truncation), ...a, children: /* @__PURE__ */ c(m, { children: [
|
|
32
|
+
/* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(b, {}) }),
|
|
33
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r("div", { className: t["truncation-content"], children: /* @__PURE__ */ r("ol", { className: t.sublist, children: o }) }) })
|
|
34
|
+
] }) }), j = { Root: p, Item: d, Truncation: f };
|
|
35
|
+
export {
|
|
36
|
+
j as Breadcrumbs
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport * as MenuPrimitive from '../menu-primitive'\nimport { Item } from './item'\nimport { TruncationButton } from './truncation-button'\nimport type { BreadcrumbProps, BreadcrumbTruncationProps } from './types'\nimport s from './style.module.scss'\n\nconst Root = ({\n\titemsCanWrap = true,\n\tariaLabel = 'breadcrumbs',\n\tchildren,\n\tclassName,\n\t...rest\n}: BreadcrumbProps) => {\n\treturn (\n\t\t<nav\n\t\t\tclassName={classNames(\n\t\t\t\ts.breadcrumbs,\n\t\t\t\t{\n\t\t\t\t\t[s['items-can-wrap']]: itemsCanWrap,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\taria-label={ariaLabel}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<ol className={s.list}>{children}</ol>\n\t\t</nav>\n\t)\n}\n\nconst Truncation = ({\n\tariaLabel,\n\tchildren,\n\t...rest\n}: BreadcrumbTruncationProps) => {\n\treturn (\n\t\t<li className={classNames(s.item, s.truncation)} {...rest}>\n\t\t\t<MenuPrimitive.Provider>\n\t\t\t\t<MenuPrimitive.Toggle>\n\t\t\t\t\t<TruncationButton />\n\t\t\t\t</MenuPrimitive.Toggle>\n\t\t\t\t<MenuPrimitive.Content>\n\t\t\t\t\t<div className={s['truncation-content']}>\n\t\t\t\t\t\t<ol className={s.sublist}>{children}</ol>\n\t\t\t\t\t</div>\n\t\t\t\t</MenuPrimitive.Content>\n\t\t\t</MenuPrimitive.Provider>\n\t\t</li>\n\t)\n}\n\nconst Breadcrumbs = { Root, Item, Truncation }\n\nexport { Breadcrumbs }\n"],"names":["Root","itemsCanWrap","ariaLabel","children","className","rest","jsx","classNames","s","Truncation","jsxs","MenuPrimitive.Provider","MenuPrimitive.Toggle","TruncationButton","MenuPrimitive.Content","Breadcrumbs","Item"],"mappings":";;;;;;AAOA,MAAMA,IAAO,CAAC;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC;AAAA,MACVC,EAAE;AAAA,MACF;AAAA,QACC,CAACA,EAAE,gBAAgB,CAAC,GAAGP;AAAA,MAAA;AAAA,MAExBG;AAAA,IAAA;AAAA,IAED,cAAYF;AAAA,IACX,GAAGG;AAAA,IAEJ,UAAA,gBAAAC,EAAC,MAAA,EAAG,WAAWE,EAAE,MAAO,UAAAL,EAAA,CAAS;AAAA,EAAA;AAAA,GAK9BM,IAAa,CAAC;AAAA,EACnB,WAAAP;AAAA,EACA,UAAAC;AAAA,EACA,GAAGE;AACJ,MAEE,gBAAAC,EAAC,MAAA,EAAG,WAAWC,EAAWC,EAAE,MAAMA,EAAE,UAAU,GAAI,GAAGH,GACpD,UAAA,gBAAAK,EAACC,GAAA,EACA,UAAA;AAAA,EAAA,gBAAAL,EAACM,GAAA,EACA,UAAA,gBAAAN,EAACO,KAAiB,GACnB;AAAA,oBACCC,GAAA,EACA,UAAA,gBAAAR,EAAC,SAAI,WAAWE,EAAE,oBAAoB,GACrC,4BAAC,MAAA,EAAG,WAAWA,EAAE,SAAU,UAAAL,GAAS,GACrC,EAAA,CACD;AAAA,EAAA,CACD,EAAA,CACD,GAIIY,IAAc,EAAE,MAAAf,GAAM,MAAAgB,GAAM,YAAAP,EAAA;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e, jsxs as o, Fragment as d } from "react/jsx-runtime";
|
|
3
|
+
import { useMDSLink as h } from "../../../utils/mds-context/index.js";
|
|
4
|
+
import s from "../style.module.scss.js";
|
|
5
|
+
const i = ({ icon: r, text: n }) => /* @__PURE__ */ o(d, { children: [
|
|
6
|
+
r && /* @__PURE__ */ e("div", { className: s.icon, children: r }),
|
|
7
|
+
/* @__PURE__ */ e("span", { className: s.text, children: n })
|
|
8
|
+
] }), f = ({
|
|
9
|
+
maxWidth: r,
|
|
10
|
+
current: n,
|
|
11
|
+
icon: t,
|
|
12
|
+
text: c,
|
|
13
|
+
url: l,
|
|
14
|
+
...m
|
|
15
|
+
}) => {
|
|
16
|
+
const a = h();
|
|
17
|
+
return /* @__PURE__ */ e(
|
|
18
|
+
"li",
|
|
19
|
+
{
|
|
20
|
+
className: s.item,
|
|
21
|
+
style: {
|
|
22
|
+
...r && { maxWidth: r }
|
|
23
|
+
},
|
|
24
|
+
...m,
|
|
25
|
+
children: n ? /* @__PURE__ */ e("div", { className: s.current, children: /* @__PURE__ */ e(i, { icon: t, text: c }) }) : /* @__PURE__ */ e(a, { className: s.link, href: l, children: /* @__PURE__ */ e(i, { icon: t, text: c }) })
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
f as Item
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/breadcrumbs/item/index.tsx"],"sourcesContent":["'use client'\n\nimport { useMDSLink } from '../../../utils/mds-context'\nimport type { BreadcrumbItemProps } from '../types'\nimport s from '../style.module.scss'\n\ninterface ItemContentProps {\n\ttext: string\n\t/**\n\t * Use to show an flight icon.\n\t */\n\ticon?: React.ReactNode\n}\n\nconst ItemContent = ({ icon, text }: ItemContentProps) => {\n\treturn (\n\t\t<>\n\t\t\t{icon && <div className={s.icon}>{icon}</div>}\n\n\t\t\t<span className={s.text}>{text}</span>\n\t\t</>\n\t)\n}\n\nexport const Item = ({\n\tmaxWidth,\n\tcurrent,\n\ticon,\n\ttext,\n\turl,\n\t...rest\n}: BreadcrumbItemProps) => {\n\tconst Link = useMDSLink()\n\n\treturn (\n\t\t<li\n\t\t\tclassName={s.item}\n\t\t\tstyle={{\n\t\t\t\t...(maxWidth && { maxWidth }),\n\t\t\t}}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{current ? (\n\t\t\t\t<div className={s.current}>\n\t\t\t\t\t<ItemContent icon={icon} text={text} />\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\t<Link className={s.link} href={url}>\n\t\t\t\t\t<ItemContent icon={icon} text={text} />\n\t\t\t\t</Link>\n\t\t\t)}\n\t\t</li>\n\t)\n}\n"],"names":["text","jsxs","Fragment","icon","jsx","Item","maxWidth","current","url","rest","ItemContent","Link"],"mappings":";;;;AAeC,sBACC,MAAAA,QACE,gBAAAC,EAAQC,GAAC,EAAI,UAAW;AAAA,EAAcC,KAEtC,gBAAAC,EAAA,OAAK,EAAA,aAAoB,MAAA,UAAKD,EAAA,CAAA;AAAA,EAChC,gBAAAC,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,UAAAJ,EAAA,CAAA;AAEF,EAAA,CAAA,GAGCK,IAAA,CAAA;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAJ;AAAA,EACA,MAAAH;AAAA,EACA,KAAAQ;AAAA,EACD,GAAAC;AACC,MAAA;AAEA,cACC;AAAA,SAAC,gBAAAL;AAAA,IAAA;AAAA,IAAA;AAAA,MAEA,WAAO,EAAA;AAAA,MAAA,OACF;AAAA,QACL,GAAAE,KAAA,EAAA,UAAAA,EAAA;AAAA,MACC;AAAA,MAEA,GAAAG;AAAA,MAOA,UAAAF,IAAA,gBAAAH,EAAA,OAAA,EAAA,WAAA,EAAA,SAAA,UAAA,gBAAAA,EAAAM,GAAA,EAAA,MAAAP,GAAA,MAAAH,EAAA,CAAA,EAAA,CAAA,IAAA,gBAAAI,EAAAO,GAAA,EAAA,WAAA,EAAA,MAAA,MAAAH,GAAA,UAAA,gBAAAJ,EAAAM,GAAA,EAAA,MAAAP,GAAA,MAAAH,EAAA,CAAA,EAAA,CAAA;AAAA,IAEF;AAAA,EAEF;;"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
@use 'styles/mixins/focus-ring' as *;
|
|
2
|
+
|
|
3
|
+
$item-height: 28px;
|
|
4
|
+
$item-border-radius: 5px;
|
|
5
|
+
$item-visual-horizontal-padding: 4px;
|
|
6
|
+
|
|
7
|
+
// MAIN CONTAINER (NAV)
|
|
8
|
+
.breadcrumbs {
|
|
9
|
+
position: relative;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// LIST (OL)
|
|
13
|
+
|
|
14
|
+
.list {
|
|
15
|
+
display: flex;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
|
|
20
|
+
.items-can-wrap & {
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sublist {
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
list-style: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ITEM (LI)
|
|
32
|
+
|
|
33
|
+
.item {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
align-items: center;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
|
|
40
|
+
.list > & {
|
|
41
|
+
&:not(:last-child)::after {
|
|
42
|
+
padding: 0 8px;
|
|
43
|
+
color: var(--mds-color-palette-neutral-300);
|
|
44
|
+
content: '/';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.sublist > & + & {
|
|
49
|
+
margin-top: 4px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.truncation {
|
|
54
|
+
flex: none; // needed to avoid that the "flex" parent collapses the truncation element (it happens with very long strings and no-wrapping)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// LINK (A)
|
|
58
|
+
|
|
59
|
+
.link {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
margin: 0 (-$item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
|
|
65
|
+
padding: 0 $item-visual-horizontal-padding;
|
|
66
|
+
color: var(--mds-color-foreground-faint);
|
|
67
|
+
border-radius: $item-border-radius;
|
|
68
|
+
// notice: the text decoration is applied directly to the "text" container because of a bug in Safari (see https://github.com/hashicorp/design-system-components/issues/159)
|
|
69
|
+
text-decoration-color: transparent;
|
|
70
|
+
|
|
71
|
+
&:hover {
|
|
72
|
+
color: var(--mds-color-palette-neutral-600);
|
|
73
|
+
|
|
74
|
+
& > .text {
|
|
75
|
+
text-decoration-color: currentColor;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
80
|
+
@include hds-focus-ring-basic();
|
|
81
|
+
|
|
82
|
+
&:active {
|
|
83
|
+
& > .text {
|
|
84
|
+
text-decoration-color: currentColor;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// CURRENT
|
|
90
|
+
|
|
91
|
+
.current {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: row;
|
|
94
|
+
align-items: center;
|
|
95
|
+
min-width: 0;
|
|
96
|
+
margin: 0 (-$item-visual-horizontal-padding); // we use a negative horizontal margin to counter-balance the horizonal padding (used to shift the focus from the content)
|
|
97
|
+
padding: 0 $item-visual-horizontal-padding;
|
|
98
|
+
color: var(--mds-color-foreground-strong);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// SUB-ELEMENTS
|
|
102
|
+
|
|
103
|
+
.icon {
|
|
104
|
+
flex: none;
|
|
105
|
+
width: 13px;
|
|
106
|
+
height: 13px;
|
|
107
|
+
margin-right: 6px;
|
|
108
|
+
|
|
109
|
+
& svg {
|
|
110
|
+
display: block;
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.text {
|
|
117
|
+
// we use the extra vertical padding to force the height of the parent item to be exactly $item-height
|
|
118
|
+
padding: calc((#{$item-height} - 1rem) / 2) 0;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
font-size: 0.8125rem; // 13px
|
|
121
|
+
font-family: var(--mds-typography-font-stack-text);
|
|
122
|
+
line-height: 1rem; // 16px
|
|
123
|
+
white-space: nowrap;
|
|
124
|
+
text-decoration: underline;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
text-decoration-color: transparent;
|
|
127
|
+
|
|
128
|
+
.sublist & {
|
|
129
|
+
white-space: normal;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// TRUNCATION
|
|
134
|
+
|
|
135
|
+
.truncation-button {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex: none;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
width: $item-height;
|
|
141
|
+
height: $item-height;
|
|
142
|
+
margin: 0 (-$item-visual-horizontal-padding); // the horizontal negative margin applied here is for visual balance of the spacing between items
|
|
143
|
+
padding: 0;
|
|
144
|
+
color: var(--mds-color-foreground-faint);
|
|
145
|
+
background-color: transparent;
|
|
146
|
+
border: 1px solid transparent; // We need this to be transparent for a11y
|
|
147
|
+
border-radius: $item-border-radius;
|
|
148
|
+
outline: none; // TODO check with @melanie
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
|
|
151
|
+
&:hover {
|
|
152
|
+
color: var(--mds-color-foreground-faint);
|
|
153
|
+
border-color: var(--mds-color-border-strong);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// we apply the focus directly to the element, without using a pseudo-element
|
|
157
|
+
@include hds-focus-ring-basic();
|
|
158
|
+
|
|
159
|
+
&:focus {
|
|
160
|
+
background-color: transparent;
|
|
161
|
+
border: none; // important: we need to completely remove the border, of the inner box-shadow of the focus ring will be drawn inside the border
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:active {
|
|
165
|
+
color: var(--mds-color-foreground-primary);
|
|
166
|
+
background-color: var(--mds-color-surface-interactive-active);
|
|
167
|
+
border-color: var(--mds-color-border-strong);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.truncation-content {
|
|
172
|
+
position: absolute;
|
|
173
|
+
top: 100%;
|
|
174
|
+
left: -$item-visual-horizontal-padding;
|
|
175
|
+
z-index: 300; // this is the z-index used in Structure for this kind of things, I am reusing the same value
|
|
176
|
+
width: max-content;
|
|
177
|
+
max-width: 200px; // by design
|
|
178
|
+
margin-top: 4px;
|
|
179
|
+
padding: 6px 12px;
|
|
180
|
+
background-color: var(--mds-color-surface-primary);
|
|
181
|
+
border-radius: 6px;
|
|
182
|
+
box-shadow: var(--mds-surface-high-box-shadow);
|
|
183
|
+
}
|