@hashicorp/mds-react 0.9.2 → 0.9.4
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/components/accordion/index.d.ts +1 -1
- package/components/accordion/index.js +9 -0
- package/components/accordion/index.js.map +1 -0
- package/components/accordion/item/button.js +44 -0
- package/components/accordion/item/button.js.map +1 -0
- package/components/accordion/item/index.d.ts +1 -1
- package/components/accordion/item/index.js +59 -0
- package/components/accordion/item/index.js.map +1 -0
- package/components/accordion/style.module.scss.js +24 -0
- package/components/accordion/style.module.scss.js.map +1 -0
- package/components/alert/alert.module.scss.js +29 -0
- package/components/alert/alert.module.scss.js.map +1 -0
- package/components/alert/icon.d.ts +2 -2
- package/components/alert/icon.js +34 -0
- package/components/alert/icon.js.map +1 -0
- package/components/alert/index.d.ts +6 -6
- package/components/alert/index.js +97 -0
- package/components/alert/index.js.map +1 -0
- package/components/badge/index.d.ts +1 -1
- package/components/badge/index.js +50 -0
- package/components/badge/index.js.map +1 -0
- package/components/badge/style.module.scss.js +22 -0
- package/components/badge/style.module.scss.js.map +1 -0
- package/components/badge-count/index.d.ts +1 -1
- package/components/badge-count/index.js +29 -0
- package/components/badge-count/index.js.map +1 -0
- package/components/badge-count/style.module.scss.js +15 -0
- package/components/badge-count/style.module.scss.js.map +1 -0
- package/components/breadcrumbs/index.d.ts +2 -2
- package/components/breadcrumbs/index.js +38 -0
- package/components/breadcrumbs/index.js.map +1 -0
- package/components/breadcrumbs/item/index.d.ts +1 -1
- package/components/breadcrumbs/item/index.js +32 -0
- package/components/breadcrumbs/item/index.js.map +1 -0
- package/components/breadcrumbs/style.module.scss.js +27 -0
- package/components/breadcrumbs/style.module.scss.js.map +1 -0
- package/components/breadcrumbs/truncation-button/index.d.ts +1 -1
- package/components/breadcrumbs/truncation-button/index.js +25 -0
- package/components/breadcrumbs/truncation-button/index.js.map +1 -0
- package/components/breadcrumbs/types/index.d.ts +1 -1
- package/components/button/index.d.ts +4 -3
- package/components/button/index.js +119 -0
- package/components/button/index.js.map +1 -0
- package/components/button/styles.module.scss.js +32 -0
- package/components/button/styles.module.scss.js.map +1 -0
- package/components/card/card-thumbnail/card-thumbnail.module.css.js +8 -0
- package/components/card/card-thumbnail/card-thumbnail.module.css.js.map +1 -0
- package/components/card/card-thumbnail/index.d.ts +1 -1
- package/components/card/card-thumbnail/index.js +23 -0
- package/components/card/card-thumbnail/index.js.map +1 -0
- package/components/card/index.d.ts +3 -2
- package/components/card/index.js +160 -0
- package/components/card/index.js.map +1 -0
- package/components/card/styles.module.css.js +29 -0
- package/components/card/styles.module.css.js.map +1 -0
- package/components/card/types.d.ts +4 -3
- package/components/code-block/code-block.module.scss.js +34 -0
- package/components/code-block/code-block.module.scss.js.map +1 -0
- package/components/code-block/code-lines/index.d.ts +1 -8
- package/components/code-block/code-lines/index.js +59 -0
- package/components/code-block/code-lines/index.js.map +1 -0
- package/components/code-block/code-lines/utils/split-html-into-lines.d.ts +1 -1
- package/components/code-block/code-lines/utils/split-html-into-lines.js +19 -0
- package/components/code-block/code-lines/utils/split-html-into-lines.js.map +1 -0
- package/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts +1 -1
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js +31 -0
- package/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -0
- package/components/code-block/hidden-copy-content/index.d.ts +3 -3
- package/components/code-block/hidden-copy-content/index.js +13 -0
- package/components/code-block/hidden-copy-content/index.js.map +1 -0
- package/components/code-block/index.d.ts +1 -1
- package/components/code-block/index.js +88 -0
- package/components/code-block/index.js.map +1 -0
- package/components/code-block/utils/parse-highlighted-lines.js +39 -0
- package/components/code-block/utils/parse-highlighted-lines.js.map +1 -0
- package/components/code-block/utils/process-snippet.js +20 -0
- package/components/code-block/utils/process-snippet.js.map +1 -0
- package/components/code-block/utils/shellwords.js +33 -0
- package/components/code-block/utils/shellwords.js.map +1 -0
- package/components/combo-box-primitive/index.d.ts +1 -0
- package/components/combo-box-primitive/index.js +302 -0
- package/components/combo-box-primitive/index.js.map +1 -0
- package/components/dialog-primitive/dialog.module.scss.js +12 -0
- package/components/dialog-primitive/dialog.module.scss.js.map +1 -0
- package/components/dialog-primitive/index.d.ts +1 -1
- package/components/dialog-primitive/index.js +15 -0
- package/components/dialog-primitive/index.js.map +1 -0
- package/components/disclosure-primitive/index.d.ts +1 -2
- package/components/disclosure-primitive/index.js +57 -0
- package/components/disclosure-primitive/index.js.map +1 -0
- package/components/disclosure-primitive/styles.module.css.js +7 -0
- package/components/disclosure-primitive/styles.module.css.js.map +1 -0
- package/components/disclosure-primitive/use-disclosure-primitive.d.ts +2 -2
- package/components/disclosure-primitive/use-disclosure-primitive.js +17 -0
- package/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -0
- package/components/dismiss-button/index.d.ts +1 -0
- package/components/dismiss-button/index.js +22 -0
- package/components/dismiss-button/index.js.map +1 -0
- package/components/dismiss-button/styles.module.scss.js +7 -0
- package/components/dismiss-button/styles.module.scss.js.map +1 -0
- package/components/dropdown/index.d.ts +6 -6
- package/components/dropdown/index.js +79 -0
- package/components/dropdown/index.js.map +1 -0
- package/components/dropdown/list-item/custom.d.ts +1 -1
- package/components/dropdown/list-item/custom.js +9 -0
- package/components/dropdown/list-item/custom.js.map +1 -0
- package/components/dropdown/list-item/index.d.ts +4 -4
- package/components/dropdown/list-item/index.js +14 -0
- package/components/dropdown/list-item/index.js.map +1 -0
- package/components/dropdown/list-item/interactive.d.ts +1 -1
- package/components/dropdown/list-item/interactive.js +49 -0
- package/components/dropdown/list-item/interactive.js.map +1 -0
- package/components/dropdown/list-item/separator.d.ts +1 -1
- package/components/dropdown/list-item/separator.js +17 -0
- package/components/dropdown/list-item/separator.js.map +1 -0
- package/components/dropdown/list-item/styles.module.css.js +26 -0
- package/components/dropdown/list-item/styles.module.css.js.map +1 -0
- package/components/dropdown/list-item/title.d.ts +1 -1
- package/components/dropdown/list-item/title.js +9 -0
- package/components/dropdown/list-item/title.js.map +1 -0
- package/components/dropdown/styles.module.css.js +24 -0
- package/components/dropdown/styles.module.css.js.map +1 -0
- package/components/dropdown/toggle-button/index.d.ts +2 -2
- package/components/dropdown/toggle-button/index.js +54 -0
- package/components/dropdown/toggle-button/index.js.map +1 -0
- package/components/dropdown/toggle-button/styles.module.scss.js +14 -0
- package/components/dropdown/toggle-button/styles.module.scss.js.map +1 -0
- package/components/flight-icon/flight-icon.module.css.js +12 -0
- package/components/flight-icon/flight-icon.module.css.js.map +1 -0
- package/components/flight-icon/index.d.ts +2 -2
- package/components/flight-icon/index.js +58 -0
- package/components/flight-icon/index.js.map +1 -0
- package/components/form/checkbox/form-checkbox.module.css.js +8 -0
- package/components/form/checkbox/form-checkbox.module.css.js.map +1 -0
- package/components/form/checkbox/index.d.ts +1 -1
- package/components/form/checkbox/index.js +109 -0
- package/components/form/checkbox/index.js.map +1 -0
- package/components/form/error/form-error.module.css.js +14 -0
- package/components/form/error/form-error.module.css.js.map +1 -0
- package/components/form/error/index.d.ts +1 -1
- package/components/form/error/index.js +22 -0
- package/components/form/error/index.js.map +1 -0
- package/components/form/field/form-field.module.css.js +17 -0
- package/components/form/field/form-field.module.css.js.map +1 -0
- package/components/form/field/index.d.ts +1 -1
- package/components/form/field/index.js +46 -0
- package/components/form/field/index.js.map +1 -0
- package/components/form/fieldset/form-fieldset.module.css.js +19 -0
- package/components/form/fieldset/form-fieldset.module.css.js.map +1 -0
- package/components/form/fieldset/index.d.ts +1 -1
- package/components/form/fieldset/index.js +65 -0
- package/components/form/fieldset/index.js.map +1 -0
- package/components/form/file-input/form-file-input.module.scss.js +7 -0
- package/components/form/file-input/form-file-input.module.scss.js.map +1 -0
- package/components/form/file-input/index.d.ts +1 -1
- package/components/form/file-input/index.js +68 -0
- package/components/form/file-input/index.js.map +1 -0
- package/components/form/helper-text/form-helper-text.module.css.js +7 -0
- package/components/form/helper-text/form-helper-text.module.css.js.map +1 -0
- package/components/form/helper-text/index.d.ts +1 -1
- package/components/form/helper-text/index.js +22 -0
- package/components/form/helper-text/index.js.map +1 -0
- package/components/form/indicator/form-indicator.module.css.js +8 -0
- package/components/form/indicator/form-indicator.module.css.js.map +1 -0
- package/components/form/indicator/index.js +23 -0
- package/components/form/indicator/index.js.map +1 -0
- package/components/form/label/form-label.module.css.js +10 -0
- package/components/form/label/form-label.module.css.js.map +1 -0
- package/components/form/label/index.d.ts +1 -1
- package/components/form/label/index.js +33 -0
- package/components/form/label/index.js.map +1 -0
- package/components/form/legend/form-legend.module.css.js +10 -0
- package/components/form/legend/form-legend.module.css.js.map +1 -0
- package/components/form/legend/index.d.ts +1 -1
- package/components/form/legend/index.js +19 -0
- package/components/form/legend/index.js.map +1 -0
- package/components/form/radio/form-radio.module.scss.js +8 -0
- package/components/form/radio/form-radio.module.scss.js.map +1 -0
- package/components/form/radio/index.d.ts +1 -1
- package/components/form/radio/index.js +100 -0
- package/components/form/radio/index.js.map +1 -0
- package/components/form/radio-card/description.js +10 -0
- package/components/form/radio-card/description.js.map +1 -0
- package/components/form/radio-card/form-radio-card.module.css.js +30 -0
- package/components/form/radio-card/form-radio-card.module.css.js.map +1 -0
- package/components/form/radio-card/group.d.ts +1 -1
- package/components/form/radio-card/group.js +31 -0
- package/components/form/radio-card/group.js.map +1 -0
- package/components/form/radio-card/index.d.ts +2 -2
- package/components/form/radio-card/index.js +67 -0
- package/components/form/radio-card/index.js.map +1 -0
- package/components/form/radio-card/label.js +10 -0
- package/components/form/radio-card/label.js.map +1 -0
- package/components/form/select/form-select.module.css.js +14 -0
- package/components/form/select/form-select.module.css.js.map +1 -0
- package/components/form/select/index.d.ts +1 -1
- package/components/form/select/index.js +79 -0
- package/components/form/select/index.js.map +1 -0
- package/components/form/super-select/form-super-select.module.css.js +22 -0
- package/components/form/super-select/form-super-select.module.css.js.map +1 -0
- package/components/form/super-select/index.d.ts +2 -2
- package/components/form/super-select/index.js +170 -0
- package/components/form/super-select/index.js.map +1 -0
- package/components/form/text-input/index.d.ts +1 -1
- package/components/form/text-input/index.js +91 -0
- package/components/form/text-input/index.js.map +1 -0
- package/components/form/text-input/styles.module.css.js +15 -0
- package/components/form/text-input/styles.module.css.js.map +1 -0
- package/components/form/textarea/form-textarea.module.css.js +14 -0
- package/components/form/textarea/form-textarea.module.css.js.map +1 -0
- package/components/form/textarea/index.d.ts +1 -1
- package/components/form/textarea/index.js +74 -0
- package/components/form/textarea/index.js.map +1 -0
- package/components/form/toggle/form-toggle.module.scss.js +12 -0
- package/components/form/toggle/form-toggle.module.scss.js.map +1 -0
- package/components/form/toggle/index.d.ts +1 -1
- package/components/form/toggle/index.js +102 -0
- package/components/form/toggle/index.js.map +1 -0
- package/components/hds/wrappers/tooltip.d.ts +3 -4
- package/components/hds/wrappers/tooltip.js +51 -0
- package/components/hds/wrappers/tooltip.js.map +1 -0
- package/components/icon-tile/index.d.ts +1 -1
- package/components/icon-tile/index.js +50 -0
- package/components/icon-tile/index.js.map +1 -0
- package/components/icon-tile/style.module.scss.js +29 -0
- package/components/icon-tile/style.module.scss.js.map +1 -0
- package/components/index.d.ts +1 -1
- package/components/index.js +116 -73
- package/components/index.js.map +1 -1
- package/components/inline-link/index.d.ts +1 -1
- package/components/inline-link/index.js +33 -0
- package/components/inline-link/index.js.map +1 -0
- package/components/inline-link/inline-link.module.css.js +11 -0
- package/components/inline-link/inline-link.module.css.js.map +1 -0
- package/components/interactive/index.d.ts +3 -4
- package/components/interactive/index.js +59 -0
- package/components/interactive/index.js.map +1 -0
- package/components/legacy-button/index.d.ts +3 -3
- package/components/legacy-button/index.js +65 -0
- package/components/legacy-button/index.js.map +1 -0
- package/components/legacy-button/types.d.ts +1 -1
- package/components/legacy-button/utils.d.ts +1 -1
- package/components/legacy-button/utils.js +39 -0
- package/components/legacy-button/utils.js.map +1 -0
- package/components/menu-primitive/index.d.ts +1 -1
- package/components/menu-primitive/index.js +68 -0
- package/components/menu-primitive/index.js.map +1 -0
- package/components/menu-primitive/styles.module.css.js +12 -0
- package/components/menu-primitive/styles.module.css.js.map +1 -0
- package/components/menu-primitive/use-menu-primitive.d.ts +2 -2
- package/components/menu-primitive/use-menu-primitive.js +17 -0
- package/components/menu-primitive/use-menu-primitive.js.map +1 -0
- package/components/modal/index.d.ts +1 -1
- package/components/modal/index.js +61 -0
- package/components/modal/index.js.map +1 -0
- package/components/modal/modal.module.css.js +8 -0
- package/components/modal/modal.module.css.js.map +1 -0
- package/components/modal/use-modal.d.ts +2 -2
- package/components/modal/use-modal.js +17 -0
- package/components/modal/use-modal.js.map +1 -0
- package/components/separator/index.d.ts +1 -1
- package/components/separator/index.js +15 -0
- package/components/separator/index.js.map +1 -0
- package/components/separator/separator.module.css.js +10 -0
- package/components/separator/separator.module.css.js.map +1 -0
- package/components/standalone-link/index.d.ts +2 -2
- package/components/standalone-link/index.js +54 -0
- package/components/standalone-link/index.js.map +1 -0
- package/components/standalone-link/styles.module.scss.js +17 -0
- package/components/standalone-link/styles.module.scss.js.map +1 -0
- package/components/table/index.d.ts +5 -5
- package/components/table/index.js +52 -0
- package/components/table/index.js.map +1 -0
- package/components/table/table.module.scss.js +33 -0
- package/components/table/table.module.scss.js.map +1 -0
- package/components/table/td.d.ts +2 -2
- package/components/table/td.js +28 -0
- package/components/table/td.js.map +1 -0
- package/components/table/th-button-tooltip.js +24 -0
- package/components/table/th-button-tooltip.js.map +1 -0
- package/components/table/th.d.ts +2 -2
- package/components/table/th.js +43 -0
- package/components/table/th.js.map +1 -0
- package/components/table/tr.d.ts +1 -1
- package/components/table/tr.js +9 -0
- package/components/table/tr.js.map +1 -0
- package/components/table/utils.js +28 -0
- package/components/table/utils.js.map +1 -0
- package/components/tabs/index.d.ts +3 -3
- package/components/tabs/index.js +117 -0
- package/components/tabs/index.js.map +1 -0
- package/components/tabs/tab-panel.d.ts +1 -1
- package/components/tabs/tab-panel.js +35 -0
- package/components/tabs/tab-panel.js.map +1 -0
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tab.js +70 -0
- package/components/tabs/tab.js.map +1 -0
- package/components/tabs/tabs.module.scss.js +22 -0
- package/components/tabs/tabs.module.scss.js.map +1 -0
- package/components/tabs/use-tabs-context.d.ts +2 -2
- package/components/tabs/use-tabs-context.js +16 -0
- package/components/tabs/use-tabs-context.js.map +1 -0
- package/components/text/index.d.ts +6 -6
- package/components/text/index.js +112 -0
- package/components/text/index.js.map +1 -0
- package/components/text/style.module.scss.js +9 -0
- package/components/text/style.module.scss.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +62 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js +20 -0
- package/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/index.d.ts +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/index.js +104 -0
- package/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/index.js +13 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/index.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js +14 -0
- package/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css.js +28 -0
- package/components/visualizations/bar-chart/horizontal-chart/style.module.css.js.map +1 -0
- package/components/visualizations/bar-chart/index.d.ts +1 -1
- package/components/visualizations/bar-chart/index.js +37 -0
- package/components/visualizations/bar-chart/index.js.map +1 -0
- package/components/visualizations/bar-chart/style.module.css.js +12 -0
- package/components/visualizations/bar-chart/style.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts +2 -2
- package/components/visualizations/donut-chart/components/arc-tooltip/index.js +14 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js +10 -0
- package/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/external-arc-label/index.d.ts +2 -2
- package/components/visualizations/donut-chart/components/external-arc-label/index.js +58 -0
- package/components/visualizations/donut-chart/components/external-arc-label/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js +16 -0
- package/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts +2 -2
- package/components/visualizations/donut-chart/components/internal-arc-label/index.js +42 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/index.js.map +1 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js +14 -0
- package/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js.map +1 -0
- package/components/visualizations/donut-chart/index.d.ts +1 -1
- package/components/visualizations/donut-chart/index.js +90 -0
- package/components/visualizations/donut-chart/index.js.map +1 -0
- package/components/visualizations/donut-chart/styles.module.css.js +20 -0
- package/components/visualizations/donut-chart/styles.module.css.js.map +1 -0
- package/hooks/use-media-query/index.js +16 -0
- package/hooks/use-media-query/index.js.map +1 -0
- package/index.js +155 -101
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/patterns/card/newsroom-card/index.d.ts +1 -1
- package/patterns/card/newsroom-card/index.js +26 -0
- package/patterns/card/newsroom-card/index.js.map +1 -0
- package/patterns/card/newsroom-card/style.module.css.js +8 -0
- package/patterns/card/newsroom-card/style.module.css.js.map +1 -0
- package/patterns/card/partner-card/index.d.ts +2 -2
- package/patterns/card/partner-card/index.js +42 -0
- package/patterns/card/partner-card/index.js.map +1 -0
- package/patterns/card/partner-card/style.module.css.js +12 -0
- package/patterns/card/partner-card/style.module.css.js.map +1 -0
- package/patterns/card/person-card/index.d.ts +1 -1
- package/patterns/card/person-card/index.js +52 -0
- package/patterns/card/person-card/index.js.map +1 -0
- package/patterns/card/person-card/style.module.css.js +12 -0
- package/patterns/card/person-card/style.module.css.js.map +1 -0
- package/patterns/card/primitives.d.ts +5 -5
- package/patterns/card/primitives.js +77 -0
- package/patterns/card/primitives.js.map +1 -0
- package/patterns/card/promo-card/index.d.ts +1 -1
- package/patterns/card/promo-card/index.js +36 -0
- package/patterns/card/promo-card/index.js.map +1 -0
- package/patterns/card/resource-card/index.d.ts +1 -1
- package/patterns/card/resource-card/index.js +26 -0
- package/patterns/card/resource-card/index.js.map +1 -0
- package/patterns/card/style.module.css.js +30 -0
- package/patterns/card/style.module.css.js.map +1 -0
- package/patterns/card/thumbnails/index.d.ts +1 -1
- package/patterns/card/thumbnails/index.js +25 -0
- package/patterns/card/thumbnails/index.js.map +1 -0
- package/patterns/card/types.d.ts +6 -6
- package/patterns/card/unified-card/index.d.ts +1 -1
- package/patterns/card/unified-card/index.js +37 -0
- package/patterns/card/unified-card/index.js.map +1 -0
- package/patterns/copy-button/clipboard.d.ts +1 -1
- package/patterns/copy-button/clipboard.js +78 -0
- package/patterns/copy-button/clipboard.js.map +1 -0
- package/patterns/copy-button/index.d.ts +1 -1
- package/patterns/copy-button/index.js +57 -0
- package/patterns/copy-button/index.js.map +1 -0
- package/patterns/copy-button/style.module.css.js +13 -0
- package/patterns/copy-button/style.module.css.js.map +1 -0
- package/patterns/index.js +32 -22
- package/patterns/index.js.map +1 -1
- package/patterns/layout/index.d.ts +20 -20
- package/patterns/layout/index.js +47 -0
- package/patterns/layout/index.js.map +1 -0
- package/patterns/layout/layout.module.css.js +20 -0
- package/patterns/layout/layout.module.css.js.map +1 -0
- package/patterns/product-badge/index.js +22 -0
- package/patterns/product-badge/index.js.map +1 -0
- package/patterns/product-badge/style.module.css.js +8 -0
- package/patterns/product-badge/style.module.css.js.map +1 -0
- package/patterns/product-logo/index.d.ts +15 -15
- package/patterns/product-logo/index.js +130 -0
- package/patterns/product-logo/index.js.map +1 -0
- package/patterns/product-logo/product-logo.module.css.js +13 -0
- package/patterns/product-logo/product-logo.module.css.js.map +1 -0
- package/patterns/related-content/index.d.ts +1 -1
- package/patterns/related-content/index.js +65 -0
- package/patterns/related-content/index.js.map +1 -0
- package/patterns/related-content/style.module.css.js +22 -0
- package/patterns/related-content/style.module.css.js.map +1 -0
- package/patterns/related-content/types.d.ts +1 -1
- package/style.css +1 -1
- package/styles/mixins/button.scss +1 -6
- package/utils/get-contrast-yiq.js +13 -0
- package/utils/get-contrast-yiq.js.map +1 -0
- package/utils/hooks/use-screen-size.js +10 -0
- package/utils/hooks/use-screen-size.js.map +1 -0
- package/utils/i18n/constants/index.js +98 -0
- package/utils/i18n/constants/index.js.map +1 -0
- package/utils/i18n/helpers/locale-provider.js +9 -0
- package/utils/i18n/helpers/locale-provider.js.map +1 -0
- package/utils/i18n/helpers/to-smart-sentence-case.js +12 -0
- package/utils/i18n/helpers/to-smart-sentence-case.js.map +1 -0
- package/utils/i18n/helpers/to-smart-title-case.js +10 -0
- package/utils/i18n/helpers/to-smart-title-case.js.map +1 -0
- package/utils/i18n/helpers/use-locale.js +14 -0
- package/utils/i18n/helpers/use-locale.js.map +1 -0
- package/utils/i18n/index.d.ts +1 -1
- package/utils/i18n/index.js +41 -0
- package/utils/i18n/index.js.map +1 -0
- package/utils/i18n/index2.js +33 -0
- package/utils/i18n/index2.js.map +1 -0
- package/utils/index.js +7 -7
- package/utils/make-normalizer/index.d.ts +6 -6
- package/utils/make-normalizer/index.js +34 -0
- package/utils/make-normalizer/index.js.map +1 -0
- package/utils/mds-context/index.d.ts +1 -1
- package/{index-DBjAbGt7.js → utils/mds-context/index.js} +20 -19
- package/utils/mds-context/index.js.map +1 -0
- package/index-B9mPJh9w.js +0 -579
- package/index-B9mPJh9w.js.map +0 -1
- package/index-BHBlMMNF.js +0 -16
- package/index-BHBlMMNF.js.map +0 -1
- package/index-C4GBbW3N.js +0 -3567
- package/index-C4GBbW3N.js.map +0 -1
- package/index-DBjAbGt7.js.map +0 -1
- package/index-WkGIywHj.js +0 -767
- package/index-WkGIywHj.js.map +0 -1
- package/use-screen-size-BOnkX_K-.js +0 -9
- package/use-screen-size-BOnkX_K-.js.map +0 -1
|
@@ -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,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,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,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,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,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,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 @@
|
|
|
1
|
+
{"version":3,"file":"form-file-input.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useId as a } from "react";
|
|
3
|
+
import { Field as I } from "../field/index.js";
|
|
4
|
+
import F from "./form-file-input.module.scss.js";
|
|
5
|
+
const u = ({
|
|
6
|
+
isRequired: i,
|
|
7
|
+
className: l,
|
|
8
|
+
id: e,
|
|
9
|
+
field: r,
|
|
10
|
+
error: n,
|
|
11
|
+
...d
|
|
12
|
+
}) => {
|
|
13
|
+
const t = a();
|
|
14
|
+
return /* @__PURE__ */ p(
|
|
15
|
+
"input",
|
|
16
|
+
{
|
|
17
|
+
type: "file",
|
|
18
|
+
required: i,
|
|
19
|
+
id: e ?? t,
|
|
20
|
+
className: F["file-input"],
|
|
21
|
+
"aria-describedby": `${n ? "error" : "helper-text"}-${e}`,
|
|
22
|
+
...r,
|
|
23
|
+
...d
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
u.displayName = "FileInputBase";
|
|
28
|
+
const f = ({
|
|
29
|
+
id: i,
|
|
30
|
+
label: l,
|
|
31
|
+
helperText: e,
|
|
32
|
+
error: r,
|
|
33
|
+
field: n,
|
|
34
|
+
className: d,
|
|
35
|
+
isRequired: t,
|
|
36
|
+
isOptional: o,
|
|
37
|
+
...m
|
|
38
|
+
}) => {
|
|
39
|
+
const c = a(), s = i ?? c;
|
|
40
|
+
return /* @__PURE__ */ p(
|
|
41
|
+
I,
|
|
42
|
+
{
|
|
43
|
+
label: l,
|
|
44
|
+
helperText: e,
|
|
45
|
+
error: r,
|
|
46
|
+
isRequired: t,
|
|
47
|
+
isOptional: o,
|
|
48
|
+
id: s,
|
|
49
|
+
layout: "vertical",
|
|
50
|
+
className: d,
|
|
51
|
+
children: /* @__PURE__ */ p(
|
|
52
|
+
u,
|
|
53
|
+
{
|
|
54
|
+
id: s,
|
|
55
|
+
isRequired: t,
|
|
56
|
+
field: n,
|
|
57
|
+
...m
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
f.displayName = "FileInputField";
|
|
64
|
+
export {
|
|
65
|
+
u as FileInputBase,
|
|
66
|
+
f as FileInputField
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/file-input/index.tsx"],"sourcesContent":["import type { HTMLProps, ReactNode } from 'react'\nimport { useId } from 'react'\nimport { Field } from '../field'\nimport s from './form-file-input.module.scss'\n\ninterface FileInputBaseProps {\n\tisRequired?: boolean\n\tclassName?: string\n\tid?: string\n\n\t/**\n\t * Can be used to supply any props that the native `<input>` element supports.\n\t * Since this is for file input, we omit `type`, see here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file\n\t */\n\tfield: Omit<HTMLProps<HTMLInputElement>, 'type' | 'id'>\n\terror?: ReactNode\n}\n\nconst FileInputBase = ({\n\tisRequired,\n\tclassName,\n\tid,\n\tfield,\n\terror,\n\t...rest\n}: FileInputBaseProps) => {\n\tconst generatedId = useId()\n\tconst inputId = id ?? generatedId\n\n\treturn (\n\t\t<input\n\t\t\ttype=\"file\"\n\t\t\trequired={isRequired}\n\t\t\tid={inputId}\n\t\t\tclassName={s['file-input']}\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\nFileInputBase.displayName = 'FileInputBase'\n\ninterface FileInputFieldProps extends FileInputBaseProps {\n\tlabel?: ReactNode\n\thelperText?: ReactNode\n\terror?: ReactNode\n\tisOptional?: boolean\n}\n\nconst FileInputField = ({\n\tid,\n\tlabel,\n\thelperText,\n\terror,\n\tfield,\n\tclassName,\n\tisRequired,\n\tisOptional,\n\t...rest\n}: FileInputFieldProps) => {\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\tclassName={className}\n\t\t>\n\t\t\t<FileInputBase\n\t\t\t\tid={inputId}\n\t\t\t\tisRequired={isRequired}\n\t\t\t\tfield={field}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</Field>\n\t)\n}\n\nFileInputField.displayName = 'FileInputField'\n\nexport { FileInputBase, FileInputField }\n"],"names":["FileInputBase","isRequired","className","id","field","error","rest","generatedId","useId","jsx","s","FileInputField","label","helperText","isOptional","inputId","Field"],"mappings":";;;;AAkBA,MAAMA,IAAgB,CAAC;AAAA,EACtB,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACJ,MAA0B;AACzB,QAAMC,IAAcC,EAAA;AAGpB,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,MAAK;AAAA,MACL,UAAUR;AAAA,MACV,IANcE,KAAMI;AAAA,MAOpB,WAAWG,EAAE,YAAY;AAAA,MACzB,oBAAkB,GAAGL,IAAQ,UAAU,aAAa,IAAIF,CAAE;AAAA,MACzD,GAAGC;AAAA,MACH,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAN,EAAc,cAAc;AAS5B,MAAMW,IAAiB,CAAC;AAAA,EACvB,IAAAR;AAAA,EACA,OAAAS;AAAA,EACA,YAAAC;AAAA,EACA,OAAAR;AAAA,EACA,OAAAD;AAAA,EACA,WAAAF;AAAA,EACA,YAAAD;AAAA,EACA,YAAAa;AAAA,EACA,GAAGR;AACJ,MAA2B;AAC1B,QAAMC,IAAcC,EAAA,GACdO,IAAUZ,KAAMI;AAEtB,SACC,gBAAAE;AAAA,IAACO;AAAA,IAAA;AAAA,MACA,OAAAJ;AAAA,MACA,YAAAC;AAAA,MACA,OAAAR;AAAA,MACA,YAAAJ;AAAA,MACA,YAAAa;AAAA,MACA,IAAIC;AAAA,MACJ,QAAO;AAAA,MACP,WAAAb;AAAA,MAEA,UAAA,gBAAAO;AAAA,QAACT;AAAA,QAAA;AAAA,UACA,IAAIe;AAAA,UACJ,YAAAd;AAAA,UACA,OAAAG;AAAA,UACC,GAAGE;AAAA,QAAA;AAAA,MAAA;AAAA,IACL;AAAA,EAAA;AAGH;AAEAK,EAAe,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-helper-text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import s from "classnames";
|
|
3
|
+
import i from "./form-helper-text.module.css.js";
|
|
4
|
+
const o = ({
|
|
5
|
+
children: r,
|
|
6
|
+
className: t,
|
|
7
|
+
controlId: e,
|
|
8
|
+
...m
|
|
9
|
+
}) => /* @__PURE__ */ p(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: s(i["helper-text"], t),
|
|
13
|
+
id: e ? `helper-text-${e}` : void 0,
|
|
14
|
+
...m,
|
|
15
|
+
children: r
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
o.displayName = "HelperText";
|
|
19
|
+
export {
|
|
20
|
+
o as HelperText
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/helper-text/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport type { ReactNode } from 'react'\nimport s from './form-helper-text.module.css'\n\ninterface HelperTextProps {\n\tchildren: ReactNode\n\tclassName?: string\n\tcontrolId?: string\n}\n\nconst HelperText = ({\n\tchildren,\n\tclassName,\n\tcontrolId,\n\t...rest\n}: HelperTextProps) => {\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(s['helper-text'], className)}\n\t\t\tid={controlId ? `helper-text-${controlId}` : undefined}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t)\n}\n\nHelperText.displayName = 'HelperText'\n\nexport { HelperText }\n"],"names":["HelperText","children","className","controlId","rest","jsx","classNames","s"],"mappings":";;;AAUA,MAAMA,IAAa,CAAC;AAAA,EACnB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC,EAAWC,EAAE,aAAa,GAAGL,CAAS;AAAA,IACjD,IAAIC,IAAY,eAAeA,CAAS,KAAK;AAAA,IAC5C,GAAGC;AAAA,IAEH,UAAAH;AAAA,EAAA;AAAA;AAKJD,EAAW,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-indicator.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as a } from "../../badge/index.js";
|
|
3
|
+
import { localize as i } from "../../../utils/i18n/index.js";
|
|
4
|
+
import "../../../utils/i18n/helpers/locale-provider.js";
|
|
5
|
+
import { useLocale as n } from "../../../utils/i18n/helpers/use-locale.js";
|
|
6
|
+
import m from "./form-indicator.module.css.js";
|
|
7
|
+
const s = ({ isOptional: r, isRequired: l }) => {
|
|
8
|
+
const e = n(), t = r ? m.optional : null;
|
|
9
|
+
return r ? /* @__PURE__ */ o("span", { "aria-hidden": "true", className: t, children: `(${i("optional", e, "title")})` }) : l ? /* @__PURE__ */ o(
|
|
10
|
+
a,
|
|
11
|
+
{
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
className: t,
|
|
14
|
+
size: "small",
|
|
15
|
+
text: i("required", e, "title")
|
|
16
|
+
}
|
|
17
|
+
) : null;
|
|
18
|
+
};
|
|
19
|
+
s.displayName = "Indicator";
|
|
20
|
+
export {
|
|
21
|
+
s as Indicator
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/indicator/index.tsx"],"sourcesContent":["import { Badge } from '../../badge'\nimport { localize } from '../../../utils/i18n'\nimport { useLocale } from '@web/utils/i18n/helpers'\nimport s from './form-indicator.module.css'\n\ninterface IndicatorProps {\n\tisOptional?: boolean\n\tisRequired?: boolean\n}\n\nconst Indicator = ({ isOptional, isRequired }: IndicatorProps) => {\n\tconst locale = useLocale()\n\n\tconst className = isOptional ? s.optional : null\n\n\tif (isOptional) {\n\t\treturn (\n\t\t\t<span aria-hidden=\"true\" className={className}>\n\t\t\t\t{`(${localize('optional', locale, 'title')})`}\n\t\t\t</span>\n\t\t)\n\t} else if (isRequired) {\n\t\treturn (\n\t\t\t<Badge\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={className}\n\t\t\t\tsize=\"small\"\n\t\t\t\ttext={localize('required', locale, 'title')}\n\t\t\t/>\n\t\t)\n\t}\n\n\treturn null\n}\n\nIndicator.displayName = 'Indicator'\n\nexport { Indicator }\n"],"names":["Indicator","isOptional","isRequired","locale","useLocale","className","s","jsx","localize","Badge"],"mappings":";;;;;;AAUA,MAAMA,IAAY,CAAC,EAAE,YAAAC,GAAY,YAAAC,QAAiC;AACjE,QAAMC,IAASC,EAAA,GAETC,IAAYJ,IAAaK,EAAE,WAAW;AAE5C,SAAIL,IAEF,gBAAAM,EAAC,QAAA,EAAK,eAAY,QAAO,WAAAF,GACvB,UAAA,IAAIG,EAAS,YAAYL,GAAQ,OAAO,CAAC,KAC3C,IAESD,IAET,gBAAAK;AAAA,IAACE;AAAA,IAAA;AAAA,MACA,eAAY;AAAA,MACZ,WAAAJ;AAAA,MACA,MAAK;AAAA,MACL,MAAMG,EAAS,YAAYL,GAAQ,OAAO;AAAA,IAAA;AAAA,EAAA,IAKtC;AACR;AAEAH,EAAU,cAAc;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const a = "badges__fd5n1", e = "label__p8mfL mds-typography-legacy-body-200 mds-typography-font-weight-semibold", s = {
|
|
2
|
+
badges: a,
|
|
3
|
+
label: e
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
a as badges,
|
|
7
|
+
s as default,
|
|
8
|
+
e as label
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=form-label.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-label.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as a, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import c from "classnames";
|
|
3
|
+
import { Indicator as i } from "../indicator/index.js";
|
|
4
|
+
import { Badge as f } from "../../badge/index.js";
|
|
5
|
+
import o from "./form-label.module.css.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
badgeText: l,
|
|
8
|
+
className: e,
|
|
9
|
+
controlId: t,
|
|
10
|
+
children: n,
|
|
11
|
+
isRequired: r,
|
|
12
|
+
isOptional: s,
|
|
13
|
+
...p
|
|
14
|
+
}) => /* @__PURE__ */ a(
|
|
15
|
+
"label",
|
|
16
|
+
{
|
|
17
|
+
className: c(o.label, e),
|
|
18
|
+
htmlFor: t,
|
|
19
|
+
...p,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ m("span", { children: n }),
|
|
22
|
+
s || r || l ? /* @__PURE__ */ a("span", { className: o.badges, children: [
|
|
23
|
+
l ? /* @__PURE__ */ m(f, { size: "small", text: l }) : null,
|
|
24
|
+
/* @__PURE__ */ m(i, { isRequired: r, isOptional: s })
|
|
25
|
+
] }) : null
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
N.displayName = "Label";
|
|
30
|
+
export {
|
|
31
|
+
N as Label
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/form/label/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { Indicator } from '../indicator'\nimport { Badge } from '../../badge'\nimport type { ReactNode } from 'react'\nimport s from './form-label.module.css'\n\ninterface LabelProps {\n\tbadgeText?: string\n\tclassName?: string\n\tcontrolId: string\n\tchildren: ReactNode\n\tisRequired?: boolean\n\tisOptional?: boolean\n}\n\nconst Label = ({\n\tbadgeText,\n\tclassName,\n\tcontrolId,\n\tchildren,\n\tisRequired,\n\tisOptional,\n\t...rest\n}: LabelProps) => {\n\treturn (\n\t\t<label\n\t\t\tclassName={classNames(s.label, className)}\n\t\t\thtmlFor={controlId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<span>{children}</span>\n\t\t\t{isOptional || isRequired || badgeText ? (\n\t\t\t\t<span className={s.badges}>\n\t\t\t\t\t{badgeText ? <Badge size=\"small\" text={badgeText} /> : null}\n\t\t\t\t\t<Indicator isRequired={isRequired} isOptional={isOptional} />\n\t\t\t\t</span>\n\t\t\t) : null}\n\t\t</label>\n\t)\n}\n\nLabel.displayName = 'Label'\n\nexport { Label }\n"],"names":["Label","badgeText","className","controlId","children","isRequired","isOptional","rest","jsxs","classNames","s","jsx","Badge","Indicator"],"mappings":";;;;;AAeA,MAAMA,IAAQ,CAAC;AAAA,EACd,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACJ,MAEE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,WAAWC,EAAWC,EAAE,OAAOR,CAAS;AAAA,IACxC,SAASC;AAAA,IACR,GAAGI;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAI,EAAC,UAAM,UAAAP,GAAS;AAAA,MACfE,KAAcD,KAAcJ,sBAC3B,QAAA,EAAK,WAAWS,EAAE,QACjB,UAAA;AAAA,QAAAT,sBAAaW,GAAA,EAAM,MAAK,SAAQ,MAAMX,GAAW,IAAK;AAAA,QACvD,gBAAAU,EAACE,GAAA,EAAU,YAAAR,GAAwB,YAAAC,EAAA,CAAwB;AAAA,MAAA,EAAA,CAC5D,IACG;AAAA,IAAA;AAAA,EAAA;AAAA;AAKPN,EAAM,cAAc;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const e = "legend__O8-rs mds-typography-legacy-body-200 mds-typography-font-weight-semibold", d = "badge__rqzw5", g = {
|
|
2
|
+
legend: e,
|
|
3
|
+
badge: d
|
|
4
|
+
};
|
|
5
|
+
export {
|
|
6
|
+
d as badge,
|
|
7
|
+
g as default,
|
|
8
|
+
e as legend
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=form-legend.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-legend.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|