@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,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { useId as l } from "react";
|
|
4
|
+
import { Field as C } from "../field/index.js";
|
|
5
|
+
import { Fieldset as N } from "../fieldset/index.js";
|
|
6
|
+
import f from "./form-checkbox.module.css.js";
|
|
7
|
+
const m = ({
|
|
8
|
+
id: e,
|
|
9
|
+
required: c,
|
|
10
|
+
field: o,
|
|
11
|
+
testingKey: t,
|
|
12
|
+
error: r
|
|
13
|
+
}) => {
|
|
14
|
+
const n = l();
|
|
15
|
+
return /* @__PURE__ */ i(
|
|
16
|
+
"input",
|
|
17
|
+
{
|
|
18
|
+
id: e ?? n,
|
|
19
|
+
type: "checkbox",
|
|
20
|
+
className: f.checkbox,
|
|
21
|
+
required: c,
|
|
22
|
+
"aria-describedby": `${r ? "error" : "helper-text"}-${e}`,
|
|
23
|
+
"data-testid": t,
|
|
24
|
+
...o
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
m.displayName = "CheckboxBase";
|
|
29
|
+
const p = ({
|
|
30
|
+
isInvalid: e,
|
|
31
|
+
isLoading: c,
|
|
32
|
+
isRequired: o,
|
|
33
|
+
isOptional: t,
|
|
34
|
+
id: r,
|
|
35
|
+
label: n,
|
|
36
|
+
helperText: s,
|
|
37
|
+
error: a,
|
|
38
|
+
field: b,
|
|
39
|
+
className: h,
|
|
40
|
+
testingKey: k,
|
|
41
|
+
...I
|
|
42
|
+
}) => {
|
|
43
|
+
const y = l(), d = r ?? y;
|
|
44
|
+
return /* @__PURE__ */ i(
|
|
45
|
+
C,
|
|
46
|
+
{
|
|
47
|
+
label: n,
|
|
48
|
+
helperText: s,
|
|
49
|
+
error: a,
|
|
50
|
+
isRequired: o,
|
|
51
|
+
isOptional: t,
|
|
52
|
+
id: d,
|
|
53
|
+
layout: "flag",
|
|
54
|
+
className: h,
|
|
55
|
+
children: /* @__PURE__ */ i(
|
|
56
|
+
m,
|
|
57
|
+
{
|
|
58
|
+
id: d,
|
|
59
|
+
required: o,
|
|
60
|
+
field: b,
|
|
61
|
+
testingKey: k,
|
|
62
|
+
error: a,
|
|
63
|
+
...I
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
p.displayName = "CheckboxField";
|
|
70
|
+
const u = ({
|
|
71
|
+
layout: e = "vertical",
|
|
72
|
+
legend: c,
|
|
73
|
+
helperText: o,
|
|
74
|
+
error: t,
|
|
75
|
+
isOptional: r,
|
|
76
|
+
isRequired: n,
|
|
77
|
+
children: s
|
|
78
|
+
}) => /* @__PURE__ */ i(
|
|
79
|
+
N,
|
|
80
|
+
{
|
|
81
|
+
layout: e,
|
|
82
|
+
legend: c,
|
|
83
|
+
helperText: o,
|
|
84
|
+
error: t,
|
|
85
|
+
isOptional: r,
|
|
86
|
+
isRequired: n,
|
|
87
|
+
children: s
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
u.displayName = "CheckboxGroupRoot";
|
|
91
|
+
const x = (e) => /* @__PURE__ */ i(
|
|
92
|
+
p,
|
|
93
|
+
{
|
|
94
|
+
className: e.className,
|
|
95
|
+
testingKey: e.testingKey,
|
|
96
|
+
...e
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
x.displayName = "CheckboxGroupInner";
|
|
100
|
+
const K = {
|
|
101
|
+
Root: u,
|
|
102
|
+
Inner: x
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
m as CheckboxBase,
|
|
106
|
+
p as CheckboxField,
|
|
107
|
+
K as CheckboxGroup
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/checkbox/index.tsx"],"sourcesContent":["'use client'\n\nimport {\n\tuseId,\n\ttype ComponentProps,\n\ttype HTMLProps,\n\ttype ReactNode,\n} from 'react'\nimport { Field } from '../field'\nimport { Fieldset } from '../fieldset'\nimport s from './form-checkbox.module.css'\n\ninterface CheckboxBaseProps {\n\tid?: string\n\trequired?: boolean\n\tfield: HTMLProps<HTMLInputElement>\n\ttestingKey?: string\n\terror?: ReactNode\n}\n\nconst CheckboxBase = ({\n\tid,\n\trequired,\n\tfield,\n\ttestingKey,\n\terror,\n}: CheckboxBaseProps) => {\n\tconst generatedId = useId()\n\tconst inputId = id ?? generatedId\n\n\treturn (\n\t\t<input\n\t\t\tid={inputId}\n\t\t\ttype=\"checkbox\"\n\t\t\tclassName={s.checkbox}\n\t\t\trequired={required}\n\t\t\taria-describedby={`${error ? 'error' : 'helper-text'}-${id}`}\n\t\t\tdata-testid={testingKey}\n\t\t\t{...field}\n\t\t/>\n\t)\n}\n\nCheckboxBase.displayName = 'CheckboxBase'\n\ninterface CheckboxFieldProps {\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<HTMLInputElement>\n\tclassName?: string\n\ttestingKey?: string\n\tdisabled?: boolean\n}\n\nconst CheckboxField = ({\n\tisInvalid,\n\tisLoading,\n\tisRequired,\n\tisOptional,\n\tid,\n\tlabel,\n\thelperText,\n\terror,\n\tfield,\n\tclassName,\n\ttestingKey,\n\t...rest\n}: CheckboxFieldProps) => {\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=\"flag\"\n\t\t\tclassName={className}\n\t\t>\n\t\t\t<CheckboxBase\n\t\t\t\tid={inputId}\n\t\t\t\trequired={isRequired}\n\t\t\t\tfield={field}\n\t\t\t\ttestingKey={testingKey}\n\t\t\t\terror={error}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</Field>\n\t)\n}\n\nCheckboxField.displayName = 'CheckboxField'\n\ninterface CheckboxGroupRootProps extends ComponentProps<typeof Fieldset> {\n\tchildren: ReactNode\n}\n\nconst CheckboxGroupRoot = ({\n\tlayout = 'vertical',\n\tlegend,\n\thelperText,\n\terror,\n\tisOptional,\n\tisRequired,\n\tchildren,\n}: CheckboxGroupRootProps) => {\n\treturn (\n\t\t<Fieldset\n\t\t\tlayout={layout}\n\t\t\tlegend={legend}\n\t\t\thelperText={helperText}\n\t\t\terror={error}\n\t\t\tisOptional={isOptional}\n\t\t\tisRequired={isRequired}\n\t\t>\n\t\t\t{children}\n\t\t</Fieldset>\n\t)\n}\n\nCheckboxGroupRoot.displayName = 'CheckboxGroupRoot'\n\nconst CheckboxGroupInner = (props: CheckboxFieldProps) => {\n\treturn (\n\t\t<CheckboxField\n\t\t\tclassName={props.className}\n\t\t\ttestingKey={props.testingKey}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n\nCheckboxGroupInner.displayName = 'CheckboxGroupInner'\n\nconst CheckboxGroup = {\n\tRoot: CheckboxGroupRoot,\n\tInner: CheckboxGroupInner,\n}\n\nexport { CheckboxGroup, CheckboxBase, CheckboxField }\n"],"names":["CheckboxBase","id","required","field","testingKey","error","generatedId","jsx","s","CheckboxField","isInvalid","isLoading","isRequired","isOptional","label","helperText","className","rest","Field","inputId","CheckboxGroupRoot","layout","legend","children","Fieldset","props","CheckboxGroupInner","CheckboxGroup"],"mappings":";;;;;;AAoBsB,MACrBA,IAAA,CAAA;AAAA,EACA,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACD,OAAAC;AACC,MAAA;AACA,QAAMC,MAAgB;AAGrB,SAAC,gBAAAC;AAAA,IAAA;AAAA,IAAA;AAAA,MAEA;MACA,MAAA;AAAA,MACA,WAAAC,EAAA;AAAA,MACA,UAAAN;AAAA,MACA,oBAAa,GAAAG,IAAA,UAAA,aAAA,IAAAJ,CAAA;AAAA,MACZ,eAAGG;AAAA,MAAA,GAAAD;AAAA,IACL;AAAA,EAEF;AAEA;AAiBAH,EAAM,cAAiB;AAAA,MACtBS,IAAA,CAAA;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,IAAAZ;AAAA,EACA,OAAAa;AAAA,EACA,YAAAC;AAAA,EACA,OAAAV;AAAA,EACA,OAAAF;AAAA,EACA,WAAAa;AAAA,EACA,YAAAZ;AAAA,EACD,GAAAa;AACC,MAAA;AACA,QAAMX,MAAgB;AAGrB,SAAC,gBAAAC;AAAA,IAAAW;AAAA,IAAA;AAAA,MAEA,OAAAJ;AAAA,MACA,YAAAC;AAAA,MACA,OAAAV;AAAA,MACA,YAAAO;AAAA,MACA,YAAAC;AAAA,MACA,IAAAM;AAAA,MACA,QAAA;AAAA,MAEA,WAAAH;AAAA,MAAA,UAAC,gBAAAT;AAAA,QAAAP;AAAA,QAAA;AAAA,UAEA,IAAAmB;AAAA,UACA,UAAAP;AAAA,UACA,OAAAT;AAAA,UACA,YAAAC;AAAA,UACC,OAAAC;AAAA,UAAG,GAAAY;AAAA,QAAA;AAAA,MACL;AAAA,IACD;AAAA,EAEF;AAEA;AAMAR,EAAM,cAAqB;AAAA,MAC1BW,IAAS,CAAA;AAAA,EACT,QAAAC,IAAA;AAAA,EACA,QAAAC;AAAA,EACA,YAAAP;AAAA,EACA,OAAAV;AAAA,EACA,YAAAQ;AAAA,EACA,YAAAD;AAAA,EACD,UAAAW;AACC,MACE,gBAAAhB;AAAA,EAAAiB;AAAA,EAAA;AAAA,IAEA,QAAAH;AAAA,IACA,QAAAC;AAAA,IACA,YAAAP;AAAA,IACA,OAAAV;AAAA,IACA,YAAAQ;AAAA,IAEC,YAAAD;AAAA,IAAA,UAAAW;AAAA,EACF;AAEF;AAIAH,EAAM,cAAsB;AAC3B,UACC,CAAAK,MAAC,gBAAAlB;AAAA,EAAAE;AAAA,EAAA;AAAA,IAEA,aAAY;AAAA,IACX,YAAGgB,EAAA;AAAA,IAAA,GAAAA;AAAA,EACL;AAEF;AAIAC,EAAM,cAAgB;AAAA,MACrBC,IAAM;AAAA,EACN,MAAAP;AAAA,EACD,OAAAM;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.error {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 8px;
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
color: var(--mds-form-error-color);
|
|
6
|
+
composes: mds-typography-legacy-body-100 from global;
|
|
7
|
+
composes: mds-typography-font-weight-medium from global;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.icon {
|
|
11
|
+
flex: none;
|
|
12
|
+
width: var(--mds-form-error-icon-size);
|
|
13
|
+
height: var(--mds-form-error-icon-size);
|
|
14
|
+
margin: 2px 0 2px 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content {
|
|
18
|
+
flex: 1 1 auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.message {
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const o = "error__UVBmH mds-typography-legacy-body-100 mds-typography-font-weight-medium", t = "icon__KOCmk", e = "content__tbSUM", n = "message__-Ljv-", s = {
|
|
2
|
+
error: o,
|
|
3
|
+
icon: t,
|
|
4
|
+
content: e,
|
|
5
|
+
message: n
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
e as content,
|
|
9
|
+
s as default,
|
|
10
|
+
o as error,
|
|
11
|
+
t as icon,
|
|
12
|
+
n as message
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=form-error.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-error.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ErrorMessageProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare const ErrorMessage: ({ children, ...rest }: ErrorMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
interface ErrorProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
controlId?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Error: {
|
|
12
|
+
({ children, className, controlId, ...rest }: ErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export type { ErrorProps, ErrorMessageProps };
|
|
16
|
+
export { Error, ErrorMessage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import c from "classnames";
|
|
3
|
+
import { IconAlertDiamondFill16 as t } from "@hashicorp/flight-icons/svg-react/alert-diamond-fill-16";
|
|
4
|
+
import s from "./form-error.module.css.js";
|
|
5
|
+
const l = ({ children: e, ...o }) => /* @__PURE__ */ r("p", { className: s.message, ...o, children: e }), n = ({ children: e, className: o, controlId: m, ...a }) => /* @__PURE__ */ i(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: c(s.error, o),
|
|
9
|
+
id: m ? `error-${m}` : void 0,
|
|
10
|
+
...a,
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ r(t, { className: s.icon }),
|
|
13
|
+
/* @__PURE__ */ r("div", { className: s.content, children: /* @__PURE__ */ r(l, { children: e }) })
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
n.displayName = "Error";
|
|
18
|
+
export {
|
|
19
|
+
n as Error,
|
|
20
|
+
l as ErrorMessage
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/error/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport type { ReactNode } from 'react'\nimport { IconAlertDiamondFill16 } from '@hashicorp/flight-icons/svg-react/alert-diamond-fill-16'\nimport s from './form-error.module.css'\n\ninterface ErrorMessageProps {\n\tchildren: ReactNode\n}\n\nconst ErrorMessage = ({ children, ...rest }: ErrorMessageProps) => {\n\treturn (\n\t\t<p className={s.message} {...rest}>\n\t\t\t{children}\n\t\t</p>\n\t)\n}\n\ninterface ErrorProps {\n\tchildren: ReactNode\n\tclassName?: string\n\tcontrolId?: string\n}\n\nconst Error = ({ children, className, controlId, ...rest }: ErrorProps) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(s.error, className)}\n\t\t\tid={controlId ? `error-${controlId}` : undefined}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<IconAlertDiamondFill16 className={s.icon} />\n\t\t\t<div className={s.content}>\n\t\t\t\t<ErrorMessage>{children}</ErrorMessage>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nError.displayName = 'Error'\n\nexport type { ErrorProps, ErrorMessageProps }\nexport { Error, ErrorMessage }\n"],"names":["ErrorMessage","children","rest","Error","className","controlId","jsxs","classNames","jsx","IconAlertDiamondFill16"],"mappings":";;;;AASA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,GAAGC,0BAElC,KAAA,EAAE,WAAW,EAAE,SAAU,GAAGA,GAC3B,UAAAD,GACF,GAUIE,IAAQ,CAAC,EAAE,UAAAF,GAAU,WAAAG,GAAW,WAAAC,GAAW,GAAGH,QAElD,gBAAAI;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC,EAAW,EAAE,OAAOH,CAAS;AAAA,IACxC,IAAIC,IAAY,SAASA,CAAS,KAAK;AAAA,IACtC,GAAGH;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAM,EAACC,GAAA,EAAuB,WAAW,EAAE,KAAA,CAAM;AAAA,MAC3C,gBAAAD,EAAC,SAAI,WAAW,EAAE,SACjB,UAAA,gBAAAA,EAACR,GAAA,EAAc,UAAAC,GAAS,EAAA,CACzB;AAAA,IAAA;AAAA,EAAA;AAAA;AAKHE,EAAM,cAAc;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* FORM > FIELD */
|
|
2
|
+
|
|
3
|
+
/* "VERTICAL" LAYOUT
|
|
4
|
+
* used for text-input, textarea, select
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.vertical {
|
|
8
|
+
display: grid;
|
|
9
|
+
justify-items: start;
|
|
10
|
+
width: 100%; /* we want the input element to fill the parent container */
|
|
11
|
+
|
|
12
|
+
& .label {
|
|
13
|
+
width: fit-content; /* needed to avoid extra invisible space since the <label> is interactive */
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
& .control {
|
|
17
|
+
display: flex; /* to avoid extra whitespace when the content is an <input>, <select>, or <textarea> (inline elements) */
|
|
18
|
+
justify-self: stretch; /* allows <input> and <textarea> to go full-width */
|
|
19
|
+
|
|
20
|
+
&:not(:first-child) {
|
|
21
|
+
margin-top: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:not(:last-child) {
|
|
25
|
+
margin-bottom: 8px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& .helper-text:not(:first-child) {
|
|
30
|
+
margin-top: 4px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& .helper-text + .helper-text {
|
|
34
|
+
margin-top: 2px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* "FLAG" LAYOUT
|
|
40
|
+
* used for checkbox, radio, toggle
|
|
41
|
+
* see https://codepen.io/didoo/pen/xxYPNeY
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
.flag {
|
|
45
|
+
display: grid;
|
|
46
|
+
grid-auto-flow: row;
|
|
47
|
+
grid-template-areas:
|
|
48
|
+
'control label'
|
|
49
|
+
'control helper-text'
|
|
50
|
+
'control error';
|
|
51
|
+
grid-template-rows: auto auto auto;
|
|
52
|
+
grid-template-columns: auto 1fr;
|
|
53
|
+
justify-items: start;
|
|
54
|
+
|
|
55
|
+
& .label {
|
|
56
|
+
grid-area: label;
|
|
57
|
+
width: fit-content; /* needed to avoid extra invisible space since the <label> is interactive */
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& .helper-text {
|
|
61
|
+
grid-area: helper-text;
|
|
62
|
+
margin-top: 4px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
& .control {
|
|
66
|
+
display: flex; /* to avoid extra whitespace when the content is an <input>, <select>, or <textarea> (inline elements) */
|
|
67
|
+
grid-area: control;
|
|
68
|
+
|
|
69
|
+
&:not(:only-child) {
|
|
70
|
+
margin-top: 2px; /* the line height of the label is bigger than the control size */
|
|
71
|
+
margin-right: 8px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
& .error {
|
|
76
|
+
grid-area: error;
|
|
77
|
+
margin-top: 4px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const l = "vertical__Ond75", t = "label__yNHVo", r = "control__fiVMP", e = "flag__9bLjU", o = "error__xwHck", c = {
|
|
2
|
+
vertical: l,
|
|
3
|
+
label: t,
|
|
4
|
+
control: r,
|
|
5
|
+
"helper-text": "helper-text__4l6Tt",
|
|
6
|
+
flag: e,
|
|
7
|
+
error: o
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
r as control,
|
|
11
|
+
c as default,
|
|
12
|
+
o as error,
|
|
13
|
+
e as flag,
|
|
14
|
+
t as label,
|
|
15
|
+
l as vertical
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=form-field.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface FieldProps {
|
|
3
|
+
badgeText?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
isRequired?: boolean;
|
|
6
|
+
isOptional?: boolean;
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
helperText?: ReactNode;
|
|
9
|
+
error?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
layout?: 'vertical' | 'flag';
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
declare const Field: {
|
|
15
|
+
({ badgeText, id, isRequired, isOptional, label, helperText, error, className, layout, children, ...rest }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export type { FieldProps };
|
|
19
|
+
export { Field };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as N, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import f from "classnames";
|
|
3
|
+
import { Label as h } from "../label/index.js";
|
|
4
|
+
import { HelperText as x } from "../helper-text/index.js";
|
|
5
|
+
import { Error as I } from "../error/index.js";
|
|
6
|
+
import r from "./form-field.module.css.js";
|
|
7
|
+
const j = ({
|
|
8
|
+
badgeText: a,
|
|
9
|
+
id: e,
|
|
10
|
+
isRequired: t,
|
|
11
|
+
isOptional: i,
|
|
12
|
+
label: m,
|
|
13
|
+
helperText: s,
|
|
14
|
+
error: l,
|
|
15
|
+
className: d,
|
|
16
|
+
layout: c,
|
|
17
|
+
children: n,
|
|
18
|
+
...p
|
|
19
|
+
}) => /* @__PURE__ */ N(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: f({ [r[`${c}`]]: c }, d),
|
|
23
|
+
...p,
|
|
24
|
+
children: [
|
|
25
|
+
m && /* @__PURE__ */ o(
|
|
26
|
+
h,
|
|
27
|
+
{
|
|
28
|
+
badgeText: a,
|
|
29
|
+
controlId: e,
|
|
30
|
+
isOptional: i,
|
|
31
|
+
isRequired: t,
|
|
32
|
+
className: r.label,
|
|
33
|
+
children: m
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
s && /* @__PURE__ */ o(x, { controlId: e, className: r["helper-text"], children: s }),
|
|
37
|
+
/* @__PURE__ */ o("div", { className: r.control, children: n }),
|
|
38
|
+
l && /* @__PURE__ */ o(I, { controlId: e, className: r.error, children: l })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
j.displayName = "Field";
|
|
43
|
+
export {
|
|
44
|
+
j as Field
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/field/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { Label } from '../label'\nimport { HelperText } from '../helper-text'\nimport { Error } from '../error'\nimport type { ReactNode } from 'react'\nimport s from './form-field.module.css'\n\ninterface FieldProps {\n\tbadgeText?: string\n\tid: string\n\tisRequired?: boolean\n\tisOptional?: boolean\n\tlabel?: ReactNode\n\thelperText?: ReactNode\n\terror?: ReactNode\n\tclassName?: string\n\tlayout?: 'vertical' | 'flag'\n\tchildren: ReactNode\n}\n\nconst Field = ({\n\tbadgeText,\n\tid,\n\tisRequired,\n\tisOptional,\n\tlabel,\n\thelperText,\n\terror,\n\tclassName,\n\tlayout,\n\tchildren,\n\t...rest\n}: FieldProps) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames({ [s[`${layout}`]]: layout }, className)}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{label && (\n\t\t\t\t<Label\n\t\t\t\t\tbadgeText={badgeText}\n\t\t\t\t\tcontrolId={id}\n\t\t\t\t\tisOptional={isOptional}\n\t\t\t\t\tisRequired={isRequired}\n\t\t\t\t\tclassName={s.label}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t)}\n\t\t\t{helperText && (\n\t\t\t\t<HelperText controlId={id} className={s['helper-text']}>\n\t\t\t\t\t{helperText}\n\t\t\t\t</HelperText>\n\t\t\t)}\n\t\t\t<div className={s.control}>{children}</div>\n\t\t\t{error && (\n\t\t\t\t<Error controlId={id} className={s.error}>\n\t\t\t\t\t{error}\n\t\t\t\t</Error>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nField.displayName = 'Field'\n\nexport type { FieldProps }\nexport { Field }\n"],"names":["Field","badgeText","id","isRequired","isOptional","label","helperText","error","className","layout","children","rest","jsxs","classNames","s","jsx","Label","HelperText","Error"],"mappings":";;;;;;AAoBA,MAAMA,IAAQ,CAAC;AAAA,EACd,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC,EAAW,EAAE,CAACC,EAAE,GAAGL,CAAM,EAAE,CAAC,GAAGA,EAAA,GAAUD,CAAS;AAAA,IAC5D,GAAGG;AAAA,IAEH,UAAA;AAAA,MAAAN,KACA,gBAAAU;AAAA,QAACC;AAAA,QAAA;AAAA,UACA,WAAAf;AAAA,UACA,WAAWC;AAAA,UACX,YAAAE;AAAA,UACA,YAAAD;AAAA,UACA,WAAWW,EAAE;AAAA,UAEZ,UAAAT;AAAA,QAAA;AAAA,MAAA;AAAA,MAGFC,uBACCW,GAAA,EAAW,WAAWf,GAAI,WAAWY,EAAE,aAAa,GACnD,UAAAR,EAAA,CACF;AAAA,MAED,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAE,SAAU,UAAAJ,GAAS;AAAA,MACpCH,uBACCW,GAAA,EAAM,WAAWhB,GAAI,WAAWY,EAAE,OACjC,UAAAP,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAAA;AAMJP,EAAM,cAAc;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FORM > GROUP
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
.group {
|
|
6
|
+
/* notice: this is a <fieldset> element */
|
|
7
|
+
display: block;
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
border: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.legend {
|
|
14
|
+
/* notice: this is a <legend> element */
|
|
15
|
+
margin: 0 0 8px 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* when the group contains a "legend", we reduce the visual weight of the "label" */
|
|
20
|
+
.has-legend {
|
|
21
|
+
& label {
|
|
22
|
+
font-weight: var(--mds-typography-font-weight-regular);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vertical {
|
|
27
|
+
& .control-fields-wrapper {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 12px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.horizontal {
|
|
35
|
+
& .control-fields-wrapper {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
gap: 4px 16px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.helper-text {
|
|
43
|
+
margin-bottom: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.error {
|
|
47
|
+
margin-top: 8px;
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const r = "group__4-G8T", e = "legend__Psn00", o = "vertical__nU8G5", n = "horizontal__nzPrB", t = "error__oiFxc", l = {
|
|
2
|
+
group: r,
|
|
3
|
+
legend: e,
|
|
4
|
+
"has-legend": "has-legend__CnvEd",
|
|
5
|
+
vertical: o,
|
|
6
|
+
"control-fields-wrapper": "control-fields-wrapper__ODpmr",
|
|
7
|
+
horizontal: n,
|
|
8
|
+
"helper-text": "helper-text__rPBCK",
|
|
9
|
+
error: t
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
l as default,
|
|
13
|
+
t as error,
|
|
14
|
+
r as group,
|
|
15
|
+
n as horizontal,
|
|
16
|
+
e as legend,
|
|
17
|
+
o as vertical
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=form-fieldset.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-fieldset.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface FieldsetProps {
|
|
3
|
+
isRequired?: boolean;
|
|
4
|
+
isOptional?: boolean;
|
|
5
|
+
legend?: ReactNode;
|
|
6
|
+
helperText?: ReactNode;
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
layout?: 'vertical' | 'horizontal';
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
id?: string;
|
|
12
|
+
testingKey?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Fieldset: {
|
|
15
|
+
({ isRequired, isOptional, legend, helperText, error, className, layout, children, id, testingKey, ...rest }: FieldsetProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export type { FieldsetProps };
|
|
19
|
+
export { Fieldset };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as I, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import m from "classnames";
|
|
3
|
+
import { useId as x } from "react";
|
|
4
|
+
import { Legend as g } from "../legend/index.js";
|
|
5
|
+
import { HelperText as u } from "../helper-text/index.js";
|
|
6
|
+
import { Error as j } from "../error/index.js";
|
|
7
|
+
import e from "./form-fieldset.module.css.js";
|
|
8
|
+
const F = ({
|
|
9
|
+
isRequired: i,
|
|
10
|
+
isOptional: a,
|
|
11
|
+
legend: s,
|
|
12
|
+
helperText: t,
|
|
13
|
+
error: l,
|
|
14
|
+
className: c,
|
|
15
|
+
layout: d,
|
|
16
|
+
children: n,
|
|
17
|
+
id: p,
|
|
18
|
+
testingKey: f,
|
|
19
|
+
...N
|
|
20
|
+
}) => {
|
|
21
|
+
const h = x(), o = p ?? h;
|
|
22
|
+
return /* @__PURE__ */ I(
|
|
23
|
+
"fieldset",
|
|
24
|
+
{
|
|
25
|
+
className: m(e.group, d ? e[d] : null, c),
|
|
26
|
+
id: o,
|
|
27
|
+
"data-testid": f,
|
|
28
|
+
...N,
|
|
29
|
+
children: [
|
|
30
|
+
s && /* @__PURE__ */ r(
|
|
31
|
+
g,
|
|
32
|
+
{
|
|
33
|
+
isOptional: a,
|
|
34
|
+
isRequired: i,
|
|
35
|
+
className: e.legend,
|
|
36
|
+
children: s
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
t && /* @__PURE__ */ r(
|
|
40
|
+
u,
|
|
41
|
+
{
|
|
42
|
+
controlId: `${o}-help`,
|
|
43
|
+
className: e["helper-text"],
|
|
44
|
+
children: t
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ r(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: m(e["control-fields-wrapper"], {
|
|
51
|
+
[e["has-legend"]]: s
|
|
52
|
+
}),
|
|
53
|
+
children: n
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
l && /* @__PURE__ */ r(j, { controlId: `${o}-error`, className: e.error, children: l })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
F.displayName = "Fieldset";
|
|
62
|
+
export {
|
|
63
|
+
F as Fieldset
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/fieldset/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useId } from 'react'\nimport { Legend } from '../legend'\nimport { HelperText } from '../helper-text'\nimport { Error } from '../error'\nimport type { ReactNode } from 'react'\nimport s from './form-fieldset.module.css'\n\ninterface FieldsetProps {\n\tisRequired?: boolean\n\tisOptional?: boolean\n\tlegend?: ReactNode\n\thelperText?: ReactNode\n\terror?: ReactNode\n\tclassName?: string\n\tlayout?: 'vertical' | 'horizontal'\n\tchildren: ReactNode\n\tid?: string\n\ttestingKey?: string\n}\n\nconst Fieldset = ({\n\tisRequired,\n\tisOptional,\n\tlegend,\n\thelperText,\n\terror,\n\tclassName,\n\tlayout,\n\tchildren,\n\tid,\n\ttestingKey,\n\t...rest\n}: FieldsetProps) => {\n\tconst generatedId = useId()\n\tconst fieldsetId = id ?? generatedId\n\n\treturn (\n\t\t<fieldset\n\t\t\tclassName={classNames(s.group, layout ? s[layout] : null, className)}\n\t\t\tid={fieldsetId}\n\t\t\tdata-testid={testingKey}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{legend && (\n\t\t\t\t<Legend\n\t\t\t\t\tisOptional={isOptional}\n\t\t\t\t\tisRequired={isRequired}\n\t\t\t\t\tclassName={s.legend}\n\t\t\t\t>\n\t\t\t\t\t{legend}\n\t\t\t\t</Legend>\n\t\t\t)}\n\t\t\t{helperText && (\n\t\t\t\t<HelperText\n\t\t\t\t\tcontrolId={`${fieldsetId}-help`}\n\t\t\t\t\tclassName={s['helper-text']}\n\t\t\t\t>\n\t\t\t\t\t{helperText}\n\t\t\t\t</HelperText>\n\t\t\t)}\n\t\t\t<div\n\t\t\t\tclassName={classNames(s['control-fields-wrapper'], {\n\t\t\t\t\t[s['has-legend']]: legend,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{error && (\n\t\t\t\t<Error controlId={`${fieldsetId}-error`} className={s.error}>\n\t\t\t\t\t{error}\n\t\t\t\t</Error>\n\t\t\t)}\n\t\t</fieldset>\n\t)\n}\n\nFieldset.displayName = 'Fieldset'\n\nexport type { FieldsetProps }\nexport { Fieldset }\n"],"names":["Fieldset","isRequired","isOptional","legend","helperText","error","className","layout","children","id","testingKey","rest","generatedId","useId","fieldsetId","jsxs","classNames","s","jsx","Legend","HelperText","Error"],"mappings":";;;;;;;AAqBA,MAAMA,IAAW,CAAC;AAAA,EACjB,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACJ,MAAqB;AACpB,QAAMC,IAAcC,EAAA,GACdC,IAAaL,KAAMG;AAEzB,SACC,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAWC,EAAWC,EAAE,OAAOV,IAASU,EAAEV,CAAM,IAAI,MAAMD,CAAS;AAAA,MACnE,IAAIQ;AAAA,MACJ,eAAaJ;AAAA,MACZ,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAR,KACA,gBAAAe;AAAA,UAACC;AAAA,UAAA;AAAA,YACA,YAAAjB;AAAA,YACA,YAAAD;AAAA,YACA,WAAWgB,EAAE;AAAA,YAEZ,UAAAd;AAAA,UAAA;AAAA,QAAA;AAAA,QAGFC,KACA,gBAAAc;AAAA,UAACE;AAAA,UAAA;AAAA,YACA,WAAW,GAAGN,CAAU;AAAA,YACxB,WAAWG,EAAE,aAAa;AAAA,YAEzB,UAAAb;AAAA,UAAA;AAAA,QAAA;AAAA,QAGH,gBAAAc;AAAA,UAAC;AAAA,UAAA;AAAA,YACA,WAAWF,EAAWC,EAAE,wBAAwB,GAAG;AAAA,cAClD,CAACA,EAAE,YAAY,CAAC,GAAGd;AAAA,YAAA,CACnB;AAAA,YAEA,UAAAK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEDH,KACA,gBAAAa,EAACG,GAAA,EAAM,WAAW,GAAGP,CAAU,UAAU,WAAWG,EAAE,OACpD,UAAAZ,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIJ;AAEAL,EAAS,cAAc;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@import '../../../styles/mixins/button.scss';
|
|
2
|
+
@import '../../../../../mds-tokens/src/helper-classes/typography';
|
|
3
|
+
|
|
4
|
+
.file-input {
|
|
5
|
+
@extend .mds-typography-legacy-body-200;
|
|
6
|
+
margin: -4px 0 -4px -4px; // offset shadow padding + default 1px spacing
|
|
7
|
+
padding: 3px 0 3px 3px; // add padding so button shadow is visible
|
|
8
|
+
color: var(--mds-color-foreground-primary);
|
|
9
|
+
|
|
10
|
+
&:focus,
|
|
11
|
+
&:focus-visible {
|
|
12
|
+
outline: none;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/::file-selector-button
|
|
17
|
+
// https://caniuse.com/?search=file-selector-button
|
|
18
|
+
|
|
19
|
+
// Button
|
|
20
|
+
.file-input::file-selector-button {
|
|
21
|
+
min-height: 36px;
|
|
22
|
+
margin-right: 16px;
|
|
23
|
+
padding: 7px 16px 7px 37px; // padding in code altered to match Figma visual design
|
|
24
|
+
color: var(--mds-color-foreground-primary);
|
|
25
|
+
font: inherit;
|
|
26
|
+
background-color: var(--mds-color-surface-faint);
|
|
27
|
+
// upload icon
|
|
28
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cg fill='%233b3d45'%3E%3Cpath d='M4.24 5.8a.75.75 0 001.06-.04l1.95-2.1v6.59a.75.75 0 001.5 0V3.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.101.001L4.2 4.74a.75.75 0 00.04 1.06z'/%3E%3Cpath d='M1.75 9a.75.75 0 01.75.75v3c0 .414.336.75.75.75h9.5a.75.75 0 00.75-.75v-3a.75.75 0 011.5 0v3A2.25 2.25 0 0112.75 15h-9.5A2.25 2.25 0 011 12.75v-3A.75.75 0 011.75 9z'/%3E%3C/g%3E%3C/svg%3E");
|
|
29
|
+
background-repeat: no-repeat;
|
|
30
|
+
background-position: 15px 50%;
|
|
31
|
+
background-size: var(--mds-form-text-input-background-image-size);
|
|
32
|
+
border: $hds-button-border-width solid var(--mds-color-border-strong);
|
|
33
|
+
border-radius: $hds-button-border-radius;
|
|
34
|
+
box-shadow: var(--mds-elevation-low-box-shadow);
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Button states
|
|
39
|
+
.file-input::file-selector-button:hover {
|
|
40
|
+
color: var(--mds-color-foreground-primary);
|
|
41
|
+
background-color: var(--mds-color-surface-primary);
|
|
42
|
+
border-color: var(--mds-color-border-strong);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.file-input:focus-within::file-selector-button {
|
|
46
|
+
color: var(--mds-color-foreground-primary);
|
|
47
|
+
background-color: var(--mds-color-surface-faint);
|
|
48
|
+
border-color: var(--mds-color-focus-action-internal);
|
|
49
|
+
outline: 3px solid var(--mds-color-focus-action-external);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Fix issue with button focus style which was displaying after button was activated
|
|
53
|
+
.file-input:not(:focus) {
|
|
54
|
+
&::file-selector-button {
|
|
55
|
+
border-color: var(--mds-color-border-strong);
|
|
56
|
+
outline: 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.file-input::file-selector-button:active {
|
|
61
|
+
color: var(--mds-color-foreground-primary);
|
|
62
|
+
background-color: var(--mds-color-surface-interactive-active);
|
|
63
|
+
border-color: var(--mds-color-border-strong);
|
|
64
|
+
box-shadow: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.hds-form-file-input {
|
|
68
|
+
&:disabled,
|
|
69
|
+
&[disabled],
|
|
70
|
+
&:disabled:focus,
|
|
71
|
+
&[disabled]:focus,
|
|
72
|
+
&:disabled:hover,
|
|
73
|
+
&[disabled]:hover {
|
|
74
|
+
color: var(--mds-color-foreground-disabled);
|
|
75
|
+
|
|
76
|
+
&::file-selector-button {
|
|
77
|
+
@include hds-button-state-disabled();
|
|
78
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cg fill='%238c909c'%3E%3Cpath d='M4.24 5.8a.75.75 0 001.06-.04l1.95-2.1v6.59a.75.75 0 001.5 0V3.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.101.001L4.2 4.74a.75.75 0 00.04 1.06z'/%3E%3Cpath d='M1.75 9a.75.75 0 01.75.75v3c0 .414.336.75.75.75h9.5a.75.75 0 00.75-.75v-3a.75.75 0 011.5 0v3A2.25 2.25 0 0112.75 15h-9.5A2.25 2.25 0 011 12.75v-3A.75.75 0 011.75 9z'/%3E%3C/g%3E%3C/svg%3E");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-file-input.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|