@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,158 @@
|
|
|
1
|
+
.text-input {
|
|
2
|
+
composes: mds-typography-font-weight-regular from global;
|
|
3
|
+
width: 100%;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
padding: var(--mds-form-control-padding);
|
|
6
|
+
color: var(--mds-form-control-base-foreground-value-color);
|
|
7
|
+
background-color: var(--mds-form-control-base-surface-color-default);
|
|
8
|
+
border: var(--mds-form-control-border-width) solid
|
|
9
|
+
var(--mds-form-control-base-border-color-default);
|
|
10
|
+
border-radius: var(--mds-form-control-border-radius);
|
|
11
|
+
box-shadow: var(--mds-elevation-inset-box-shadow);
|
|
12
|
+
|
|
13
|
+
/* PLACEHOLDER */
|
|
14
|
+
|
|
15
|
+
&::placeholder {
|
|
16
|
+
color: var(--mds-form-control-base-foreground-placeholder-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* STATUS */
|
|
20
|
+
|
|
21
|
+
&:hover,
|
|
22
|
+
&.mock-hover {
|
|
23
|
+
border-color: var(--mds-form-control-base-border-color-hover);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* focus (same for all the states) */
|
|
27
|
+
|
|
28
|
+
&:focus,
|
|
29
|
+
&.mock-focus {
|
|
30
|
+
border-color: var(--mds-color-focus-action-internal);
|
|
31
|
+
outline: 3px solid var(--mds-color-focus-action-external);
|
|
32
|
+
outline-offset: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* READONLY */
|
|
36
|
+
|
|
37
|
+
&:read-only {
|
|
38
|
+
color: var(--mds-form-control-readonly-foreground-color);
|
|
39
|
+
background-color: var(--mds-form-control-readonly-surface-color);
|
|
40
|
+
border-color: var(--mds-form-control-readonly-border-color);
|
|
41
|
+
box-shadow: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* DISABLED */
|
|
45
|
+
|
|
46
|
+
&:disabled {
|
|
47
|
+
color: var(--mds-form-control-disabled-foreground-color);
|
|
48
|
+
background-color: var(--mds-form-control-disabled-surface-color);
|
|
49
|
+
border-color: var(--mds-form-control-disabled-border-color);
|
|
50
|
+
box-shadow: none;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* INVALID */
|
|
55
|
+
|
|
56
|
+
&.invalid {
|
|
57
|
+
border-color: var(--mds-form-control-invalid-border-color-default);
|
|
58
|
+
|
|
59
|
+
&:hover,
|
|
60
|
+
&.mock-hover {
|
|
61
|
+
border-color: var(--mds-form-control-invalid-border-color-hover);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus,
|
|
65
|
+
&.mock-focus {
|
|
66
|
+
border-color: var(--mds-color-focus-critical-internal);
|
|
67
|
+
outline-color: var(--mds-color-focus-critical-external);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* DATE/TIME */
|
|
72
|
+
&[type='month'],
|
|
73
|
+
&[type='date'],
|
|
74
|
+
&[type='time'],
|
|
75
|
+
&[type='datetime-local'] {
|
|
76
|
+
/* browsers set a specific width for these controls, we want to keep it */
|
|
77
|
+
width: initial;
|
|
78
|
+
|
|
79
|
+
/* show the native icon dimmed if disabled (hidden in Chrome) */
|
|
80
|
+
&:disabled::-webkit-calendar-picker-indicator {
|
|
81
|
+
visibility: visible;
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* show the icon if readonly
|
|
86
|
+
notice: don't change the "[readonly]" selector to ":readonly" because it's needed to overwrite the specificity in Chrome */
|
|
87
|
+
&[readonly]::-webkit-calendar-picker-indicator {
|
|
88
|
+
visibility: visible;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* we override the default icon with the Flight corresponding one
|
|
93
|
+
notice: the original in Chrome has two assets, one for light and one for dark mode, and uses a special syntax, but apparently it doesn't work if used in a stylesheet */
|
|
94
|
+
&[type='month'],
|
|
95
|
+
&[type='date'],
|
|
96
|
+
&[type='datetime-local'] {
|
|
97
|
+
&::-webkit-calendar-picker-indicator {
|
|
98
|
+
background-image: var(
|
|
99
|
+
--mds-form-text-input-background-image-data-url-date
|
|
100
|
+
);
|
|
101
|
+
background-position: center center;
|
|
102
|
+
background-size: var(--mds-form-text-input-background-image-size);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&[type='time'] {
|
|
107
|
+
&::-webkit-calendar-picker-indicator {
|
|
108
|
+
background-image: var(
|
|
109
|
+
--mds-form-text-input-background-image-data-url-time
|
|
110
|
+
);
|
|
111
|
+
background-position: center center;
|
|
112
|
+
background-size: var(--mds-form-text-input-background-image-size);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* SEARCH */
|
|
117
|
+
&[type='search'] {
|
|
118
|
+
padding-left: calc(var(--mds-form-control-padding) + 24px);
|
|
119
|
+
background-image: var(
|
|
120
|
+
--mds-form-text-input-background-image-data-url-search
|
|
121
|
+
);
|
|
122
|
+
background-repeat: no-repeat;
|
|
123
|
+
background-position: var(
|
|
124
|
+
--mds-form-text-input-background-image-position-x
|
|
125
|
+
)
|
|
126
|
+
50%;
|
|
127
|
+
background-size: var(--mds-form-text-input-background-image-size);
|
|
128
|
+
|
|
129
|
+
&::-webkit-search-cancel-button {
|
|
130
|
+
width: var(--mds-form-text-input-background-image-size);
|
|
131
|
+
height: var(--mds-form-text-input-background-image-size);
|
|
132
|
+
background-image: var(
|
|
133
|
+
--mds-form-text-input-background-image-data-url-search-cancel
|
|
134
|
+
);
|
|
135
|
+
background-position: center center;
|
|
136
|
+
background-size: var(--mds-form-text-input-background-image-size);
|
|
137
|
+
-webkit-appearance: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.loading {
|
|
141
|
+
background-image: var(
|
|
142
|
+
--mds-form-text-input-background-image-data-url-search-loading
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* this is essentially a no-op since the base styles are already medium-sized */
|
|
149
|
+
.size-medium {
|
|
150
|
+
composes: mds-typography-legacy-body-200 from global;
|
|
151
|
+
padding: var(--mds-form-control-padding);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.size-large {
|
|
155
|
+
composes: mds-typography-legacy-body-300 from global;
|
|
156
|
+
padding: 11px;
|
|
157
|
+
min-height: 3rem;
|
|
158
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const o = "invalid__rrYph", e = "loading__O7Vv0", i = {
|
|
2
|
+
"text-input": "text-input__Xudum mds-typography-font-weight-regular",
|
|
3
|
+
"mock-hover": "mock-hover__-ItMX",
|
|
4
|
+
"mock-focus": "mock-focus__S6jof",
|
|
5
|
+
invalid: o,
|
|
6
|
+
loading: e,
|
|
7
|
+
"size-medium": "size-medium__-UzIQ mds-typography-legacy-body-200",
|
|
8
|
+
"size-large": "size-large__Hceu2 mds-typography-legacy-body-300"
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
i as default,
|
|
12
|
+
o as invalid,
|
|
13
|
+
e as loading
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=styles.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* FORM > TEXTAREA
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* "BASE" CONTROL */
|
|
6
|
+
|
|
7
|
+
.textarea {
|
|
8
|
+
composes: mds-typography-font-weight-regular from global;
|
|
9
|
+
width: 100%;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
min-height: 36px;
|
|
12
|
+
padding: var(--mds-form-control-padding);
|
|
13
|
+
color: var(--mds-form-control-base-foreground-value-color);
|
|
14
|
+
background-color: var(--mds-form-control-base-surface-color-default);
|
|
15
|
+
border: var(--mds-form-control-border-width) solid
|
|
16
|
+
var(--mds-form-control-base-border-color-default);
|
|
17
|
+
border-radius: var(--mds-form-control-border-radius);
|
|
18
|
+
box-shadow: var(--mds-elevation-inset-box-shadow);
|
|
19
|
+
resize: vertical;
|
|
20
|
+
|
|
21
|
+
/* PLACEHOLDER */
|
|
22
|
+
|
|
23
|
+
&::placeholder {
|
|
24
|
+
color: var(--mds-form-control-base-foreground-placeholder-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* STATUS */
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
border-color: var(--mds-form-control-base-border-color-hover);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* focus (same for all the states) */
|
|
34
|
+
|
|
35
|
+
&:focus {
|
|
36
|
+
border-color: var(--mds-color-focus-action-internal);
|
|
37
|
+
|
|
38
|
+
/* Notice: Safari doesn't apply a rounded border */
|
|
39
|
+
outline: 3px solid var(--mds-color-focus-action-external);
|
|
40
|
+
outline-offset: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* READONLY */
|
|
44
|
+
|
|
45
|
+
&:read-only {
|
|
46
|
+
color: var(--mds-form-control-readonly-foreground-color);
|
|
47
|
+
background-color: var(--mds-form-control-readonly-surface-color);
|
|
48
|
+
border-color: var(--mds-form-control-readonly-border-color);
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* DISABLED */
|
|
53
|
+
|
|
54
|
+
&:disabled {
|
|
55
|
+
color: var(--mds-form-control-disabled-foreground-color);
|
|
56
|
+
background-color: var(--mds-form-control-disabled-surface-color);
|
|
57
|
+
border-color: var(--mds-form-control-disabled-border-color);
|
|
58
|
+
box-shadow: none;
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* INVALID */
|
|
63
|
+
|
|
64
|
+
&.invalid {
|
|
65
|
+
border-color: var(--mds-form-control-invalid-border-color-default);
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
border-color: var(--mds-form-control-invalid-border-color-hover);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:focus {
|
|
72
|
+
border-color: var(--mds-color-focus-critical-internal);
|
|
73
|
+
outline-color: var(--mds-color-focus-critical-external);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* this is essentially a no-op since the base styles are already medium-sized */
|
|
79
|
+
.medium {
|
|
80
|
+
composes: mds-typography-legacy-body-200 from global;
|
|
81
|
+
padding: var(--mds-form-control-padding);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.large {
|
|
85
|
+
composes: mds-typography-legacy-body-300 from global;
|
|
86
|
+
padding: 11px;
|
|
87
|
+
min-height: 5rem;
|
|
88
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const a = "textarea__3MZYV mds-typography-font-weight-regular", e = "invalid__Q80EM", t = "medium__G2gPs mds-typography-legacy-body-200", d = "large__0Y-7C mds-typography-legacy-body-300", o = {
|
|
2
|
+
textarea: a,
|
|
3
|
+
invalid: e,
|
|
4
|
+
medium: t,
|
|
5
|
+
large: d
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as default,
|
|
9
|
+
e as invalid,
|
|
10
|
+
d as large,
|
|
11
|
+
t as medium,
|
|
12
|
+
a as textarea
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=form-textarea.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-textarea.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
2
|
+
interface TextAreaFieldProps {
|
|
3
|
+
isInvalid?: boolean;
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
isRequired?: boolean;
|
|
6
|
+
isOptional?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
label?: ReactNode;
|
|
9
|
+
helperText?: ReactNode;
|
|
10
|
+
error?: ReactNode;
|
|
11
|
+
field: HTMLProps<HTMLTextAreaElement>;
|
|
12
|
+
size?: 'medium' | 'large';
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const TextAreaField: {
|
|
16
|
+
({ isInvalid, isLoading, isRequired, isOptional, id, label, helperText, error, field, size, ...rest }: TextAreaFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export { TextAreaField };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import f from "classnames";
|
|
3
|
+
import { useId as y } from "react";
|
|
4
|
+
import { Field as A } from "../field/index.js";
|
|
5
|
+
import m from "./form-textarea.module.css.js";
|
|
6
|
+
const F = ({
|
|
7
|
+
isInvalid: t,
|
|
8
|
+
isLoading: l,
|
|
9
|
+
className: e,
|
|
10
|
+
id: r,
|
|
11
|
+
field: a,
|
|
12
|
+
size: i,
|
|
13
|
+
error: o,
|
|
14
|
+
...d
|
|
15
|
+
}) => /* @__PURE__ */ s(
|
|
16
|
+
"textarea",
|
|
17
|
+
{
|
|
18
|
+
id: r,
|
|
19
|
+
className: f(
|
|
20
|
+
m.textarea,
|
|
21
|
+
m[i],
|
|
22
|
+
{
|
|
23
|
+
[m.invalid]: t
|
|
24
|
+
},
|
|
25
|
+
e
|
|
26
|
+
),
|
|
27
|
+
"aria-describedby": `${o ? "error" : "helper-text"}-${r}`,
|
|
28
|
+
...a,
|
|
29
|
+
...d
|
|
30
|
+
}
|
|
31
|
+
), I = ({
|
|
32
|
+
isInvalid: t,
|
|
33
|
+
isLoading: l,
|
|
34
|
+
isRequired: e,
|
|
35
|
+
isOptional: r,
|
|
36
|
+
id: a,
|
|
37
|
+
label: i,
|
|
38
|
+
helperText: o,
|
|
39
|
+
error: d,
|
|
40
|
+
field: c,
|
|
41
|
+
size: p = "medium",
|
|
42
|
+
...x
|
|
43
|
+
}) => {
|
|
44
|
+
const u = y(), n = a ?? u;
|
|
45
|
+
return /* @__PURE__ */ s(
|
|
46
|
+
A,
|
|
47
|
+
{
|
|
48
|
+
label: i,
|
|
49
|
+
helperText: o,
|
|
50
|
+
error: d,
|
|
51
|
+
isRequired: e,
|
|
52
|
+
isOptional: r,
|
|
53
|
+
id: n,
|
|
54
|
+
layout: "vertical",
|
|
55
|
+
children: /* @__PURE__ */ s(
|
|
56
|
+
F,
|
|
57
|
+
{
|
|
58
|
+
id: n,
|
|
59
|
+
isInvalid: t,
|
|
60
|
+
isLoading: l,
|
|
61
|
+
required: e,
|
|
62
|
+
field: c,
|
|
63
|
+
size: p,
|
|
64
|
+
...x
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
I.displayName = "TextAreaField";
|
|
71
|
+
export {
|
|
72
|
+
I as TextAreaField
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/textarea/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useId } from 'react'\nimport { Field } from '../field'\nimport type { HTMLProps, ReactNode } from 'react'\nimport s from './form-textarea.module.css'\n\ninterface TextAreaBaseProps {\n\tisInvalid?: boolean\n\tisLoading?: boolean\n\trequired?: boolean\n\tclassName?: string\n\tid: string\n\tfield: HTMLProps<HTMLTextAreaElement>\n\tsize: 'medium' | 'large'\n\terror?: ReactNode\n\tdisabled?: boolean\n}\n\nconst TextAreaBase = ({\n\tisInvalid,\n\tisLoading,\n\tclassName,\n\tid,\n\tfield,\n\tsize,\n\terror,\n\t...rest\n}: TextAreaBaseProps) => {\n\treturn (\n\t\t<textarea\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\ts.textarea,\n\t\t\t\ts[size],\n\t\t\t\t{\n\t\t\t\t\t[s.invalid]: isInvalid,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\taria-describedby={`${error ? 'error' : 'helper-text'}-${id}`}\n\t\t\t{...field}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n\ninterface TextAreaFieldProps {\n\tisInvalid?: boolean\n\tisLoading?: boolean\n\tisRequired?: boolean\n\tisOptional?: boolean\n\tid?: string\n\tlabel?: ReactNode\n\thelperText?: ReactNode\n\terror?: ReactNode\n\tfield: HTMLProps<HTMLTextAreaElement>\n\tsize?: 'medium' | 'large'\n\tdisabled?: boolean\n}\n\nconst TextAreaField = ({\n\tisInvalid,\n\tisLoading,\n\tisRequired,\n\tisOptional,\n\tid,\n\tlabel,\n\thelperText,\n\terror,\n\tfield,\n\tsize = 'medium',\n\t...rest\n}: TextAreaFieldProps) => {\n\tconst generatedId = useId()\n\tconst inputId = id ?? generatedId\n\n\treturn (\n\t\t<Field\n\t\t\tlabel={label}\n\t\t\thelperText={helperText}\n\t\t\terror={error}\n\t\t\tisRequired={isRequired}\n\t\t\tisOptional={isOptional}\n\t\t\tid={inputId}\n\t\t\tlayout=\"vertical\"\n\t\t>\n\t\t\t<TextAreaBase\n\t\t\t\tid={inputId}\n\t\t\t\tisInvalid={isInvalid}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\trequired={isRequired}\n\t\t\t\tfield={field}\n\t\t\t\tsize={size}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</Field>\n\t)\n}\n\nTextAreaField.displayName = 'TextAreaField'\n\nexport { TextAreaField }\n"],"names":["TextAreaBase","isInvalid","isLoading","className","id","field","size","error","rest","jsx","classNames","s","TextAreaField","isRequired","isOptional","label","helperText","generatedId","useId","inputId","Field"],"mappings":";;;;;AAkBA,MAAMA,IAAe,CAAC;AAAA,EACrB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,IAAAL;AAAA,IACA,WAAWM;AAAA,MACVC,EAAE;AAAA,MACFA,EAAEL,CAAI;AAAA,MACN;AAAA,QACC,CAACK,EAAE,OAAO,GAAGV;AAAA,MAAA;AAAA,MAEdE;AAAA,IAAA;AAAA,IAED,oBAAkB,GAAGI,IAAQ,UAAU,aAAa,IAAIH,CAAE;AAAA,IACzD,GAAGC;AAAA,IACH,GAAGG;AAAA,EAAA;AAAA,GAmBDI,IAAgB,CAAC;AAAA,EACtB,WAAAX;AAAA,EACA,WAAAC;AAAA,EACA,YAAAW;AAAA,EACA,YAAAC;AAAA,EACA,IAAAV;AAAA,EACA,OAAAW;AAAA,EACA,YAAAC;AAAA,EACA,OAAAT;AAAA,EACA,OAAAF;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGE;AACJ,MAA0B;AACzB,QAAMS,IAAcC,EAAA,GACdC,IAAUf,KAAMa;AAEtB,SACC,gBAAAR;AAAA,IAACW;AAAA,IAAA;AAAA,MACA,OAAAL;AAAA,MACA,YAAAC;AAAA,MACA,OAAAT;AAAA,MACA,YAAAM;AAAA,MACA,YAAAC;AAAA,MACA,IAAIK;AAAA,MACJ,QAAO;AAAA,MAEP,UAAA,gBAAAV;AAAA,QAACT;AAAA,QAAA;AAAA,UACA,IAAImB;AAAA,UACJ,WAAAlB;AAAA,UACA,WAAAC;AAAA,UACA,UAAUW;AAAA,UACV,OAAAR;AAAA,UACA,MAAAC;AAAA,UACC,GAAGE;AAAA,QAAA;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAI,EAAc,cAAc;"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
//
|
|
7
|
+
// FORM > TOGGLE
|
|
8
|
+
//
|
|
9
|
+
|
|
10
|
+
// "BASE" CONTROL
|
|
11
|
+
|
|
12
|
+
.toggle {
|
|
13
|
+
position: relative;
|
|
14
|
+
display: inline-block; // we emulate the behaviour of a checkbox/radiobutton control
|
|
15
|
+
isolation: isolate; // used to create a new stacking context
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// control (hidden)
|
|
19
|
+
|
|
20
|
+
.control {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
right: 0;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
display: block;
|
|
28
|
+
height: 100%;
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
color: transparent;
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
border: none;
|
|
34
|
+
outline: none;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
appearance: none;
|
|
38
|
+
|
|
39
|
+
&:disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// facade (visible)
|
|
45
|
+
|
|
46
|
+
.facade {
|
|
47
|
+
position: relative;
|
|
48
|
+
display: block;
|
|
49
|
+
width: var(--mds-form-toggle-width);
|
|
50
|
+
height: var(--mds-form-toggle-height);
|
|
51
|
+
background-image: var(--mds-form-toggle-background-image-data-url);
|
|
52
|
+
background-repeat: no-repeat;
|
|
53
|
+
background-position: var(--mds-form-toggle-background-image-position-x) 50%;
|
|
54
|
+
background-size: var(--mds-form-toggle-background-image-size)
|
|
55
|
+
var(--mds-form-toggle-background-image-size);
|
|
56
|
+
// notice: we want to share the border color between the "thumb" and the "track" so we use a local CSS prop for this
|
|
57
|
+
border: var(--mds-form-radio-border-width) solid var(--border-color);
|
|
58
|
+
border-radius: calc(var(--mds-form-toggle-height) / 2);
|
|
59
|
+
|
|
60
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
61
|
+
transition-timing-function: var(
|
|
62
|
+
--mds-form-toggle-transition-timing-function
|
|
63
|
+
);
|
|
64
|
+
transition-duration: var(--mds-form-toggle-transition-duration);
|
|
65
|
+
transition-property: all;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// used for the "thumb"
|
|
69
|
+
|
|
70
|
+
&::after {
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: calc(var(--mds-form-radio-border-width) * -1);
|
|
73
|
+
left: calc(var(--mds-form-radio-border-width) * -1);
|
|
74
|
+
width: var(--mds-form-toggle-thumb-size);
|
|
75
|
+
height: var(--mds-form-toggle-thumb-size);
|
|
76
|
+
background-color: var(--mds-form-control-base-surface-color-default);
|
|
77
|
+
border: var(--mds-form-radio-border-width) solid var(--border-color);
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
transform: translate3d(0, 0, 0);
|
|
80
|
+
content: '';
|
|
81
|
+
|
|
82
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
83
|
+
transition-timing-function: var(
|
|
84
|
+
--mds-form-toggle-transition-timing-function
|
|
85
|
+
);
|
|
86
|
+
transition-duration: var(--mds-form-toggle-transition-duration);
|
|
87
|
+
transition-property: all;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// used for the focus
|
|
92
|
+
|
|
93
|
+
&::before {
|
|
94
|
+
// notice: to avoid too many nested calc() operation, we have decided to compute directly the values in Sass
|
|
95
|
+
$outline-width: 3px;
|
|
96
|
+
$outline-offset: 1px;
|
|
97
|
+
$shift: $outline-width + $outline-offset + 1px; // here 1px refers to "--mds-form-radio-border-width"
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: -$shift;
|
|
100
|
+
right: -$shift;
|
|
101
|
+
bottom: -$shift;
|
|
102
|
+
left: -$shift;
|
|
103
|
+
margin: auto;
|
|
104
|
+
border-width: $outline-width;
|
|
105
|
+
border-radius: calc(
|
|
106
|
+
var(--mds-form-toggle-height) / 2 + $outline-width + $outline-offset
|
|
107
|
+
);
|
|
108
|
+
content: '';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// STATUS
|
|
112
|
+
|
|
113
|
+
// base (default)
|
|
114
|
+
|
|
115
|
+
:not(:checked) + & {
|
|
116
|
+
--border-color: var(--mds-form-control-base-border-color-default);
|
|
117
|
+
background-color: var(
|
|
118
|
+
--mds-form-toggle-base-surface-color-default
|
|
119
|
+
); // this is specific for "toggle", is not like the other controls!
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:checked + & {
|
|
123
|
+
--border-color: var(--mds-form-control-checked-border-color-default);
|
|
124
|
+
background-color: var(--mds-form-control-checked-surface-color-default);
|
|
125
|
+
|
|
126
|
+
&::after {
|
|
127
|
+
$translation: calc(
|
|
128
|
+
var(--mds-form-toggle-width) - var(--mds-form-toggle-thumb-size)
|
|
129
|
+
);
|
|
130
|
+
transform: translate3d($translation, 0, 0);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// hover
|
|
135
|
+
|
|
136
|
+
:hover:not(:checked) + & {
|
|
137
|
+
--border-color: var(--mds-form-control-base-border-color-hover);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:hover:checked + & {
|
|
141
|
+
--border-color: var(--mds-form-control-checked-border-color-hover);
|
|
142
|
+
background-color: var(--mds-form-control-checked-border-color-default);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// focus (same for all the states)
|
|
146
|
+
|
|
147
|
+
:focus + & {
|
|
148
|
+
&::before {
|
|
149
|
+
border-color: var(--mds-color-focus-action-external);
|
|
150
|
+
border-style: solid;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// DISABLED
|
|
155
|
+
|
|
156
|
+
:disabled:not(:checked) + &,
|
|
157
|
+
:disabled:checked + & {
|
|
158
|
+
--border-color: var(--mds-form-control-disabled-border-color);
|
|
159
|
+
background-color: var(--mds-form-control-disabled-surface-color);
|
|
160
|
+
background-image: var(
|
|
161
|
+
--mds-form-toggle-background-image-data-url-disabled
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-toggle.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ReactNode, HTMLProps, ComponentProps } from 'react';
|
|
2
|
+
import { Fieldset } from '../fieldset';
|
|
3
|
+
interface ToggleBaseProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Can be used to supply any props that the native `<input>` element supports (such as `value`, `placeholder`, in addition to events like `onChange` and `onBlur`)
|
|
7
|
+
*/
|
|
8
|
+
field: HTMLProps<HTMLInputElement>;
|
|
9
|
+
toggleOnEnter?: boolean;
|
|
10
|
+
testingKey?: string;
|
|
11
|
+
error?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const ToggleBase: {
|
|
14
|
+
({ id, field, toggleOnEnter, testingKey, error, ...rest }: ToggleBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
interface ToggleFieldProps {
|
|
18
|
+
/**
|
|
19
|
+
* Applies an “invalid” appearance to the control but doesn’t modify its logical validity.
|
|
20
|
+
*/
|
|
21
|
+
isInvalid?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Appends a `Required` indicator next to the label text and sets the `required` attribute on the control when user input is required.
|
|
24
|
+
*/
|
|
25
|
+
isRequired?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Appends an `Optional` indicator next to the label text when user input is optional.
|
|
28
|
+
*/
|
|
29
|
+
isOptional?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Input control’s ID attribute.
|
|
32
|
+
*
|
|
33
|
+
* By default, the ID is automatically generated by the component. Use this argument to pass a custom ID.
|
|
34
|
+
*/
|
|
35
|
+
id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Container that renders its content inside the `<label>` element. The content can be a simple string or a `ReactNode`, in which case it inherits the text style.
|
|
38
|
+
*
|
|
39
|
+
* The `for` attribute of the label is automatically generated using the `controlId` value of the control.
|
|
40
|
+
*/
|
|
41
|
+
label?: ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Container that renders its content inside the "helper text" block. The content can be a simple string or a `ReactNode`, in which case it inherits the text style.
|
|
44
|
+
*
|
|
45
|
+
* The `id` attribute of the message is automatically generated using the `controlId` value of the control.
|
|
46
|
+
*/
|
|
47
|
+
helperText?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Container that renders its content inside the "error" block. The content can be a simple string or a `ReactNode`, in which case it inherits the text style.
|
|
50
|
+
*
|
|
51
|
+
* The `id` attribute of the error message is automatically generated using the `controlId` value of the control.
|
|
52
|
+
*/
|
|
53
|
+
error?: ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Can be used to supply any props that the native `<input>` element supports (such as `value`, `placeholder`, in addition to events like `onChange` and `onBlur`)
|
|
56
|
+
*/
|
|
57
|
+
field: HTMLProps<HTMLInputElement>;
|
|
58
|
+
className?: string;
|
|
59
|
+
testingKey?: string;
|
|
60
|
+
}
|
|
61
|
+
declare const ToggleField: {
|
|
62
|
+
({ isInvalid, isRequired, isOptional, id, label, helperText, error, field, className, testingKey, ...rest }: ToggleFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
interface ToggleGroupProps extends ComponentProps<typeof Fieldset> {
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
declare const ToggleGroup: {
|
|
69
|
+
Root: {
|
|
70
|
+
({ layout, legend, isOptional, isRequired, children, }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
Field: {
|
|
74
|
+
(props: ToggleFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export { ToggleBase, ToggleField, ToggleGroup };
|