@cimpress-ui/react 0.0.0 → 0.1.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/README.md +6 -2
- package/dist/commonjs/components/button/button.d.ts +6 -1
- package/dist/commonjs/components/button/button.d.ts.map +1 -1
- package/dist/commonjs/components/button/button.js +16 -3
- package/dist/commonjs/components/button/button.js.map +1 -1
- package/dist/commonjs/components/button/constants.d.ts +3 -0
- package/dist/commonjs/components/button/constants.d.ts.map +1 -0
- package/dist/commonjs/components/button/constants.js +9 -0
- package/dist/commonjs/components/button/constants.js.map +1 -0
- package/dist/commonjs/components/button/icon-button.d.ts +6 -1
- package/dist/commonjs/components/button/icon-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/icon-button.js +16 -3
- package/dist/commonjs/components/button/icon-button.js.map +1 -1
- package/dist/commonjs/components/button/icon-link-button.d.ts +9 -3
- package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/icon-link-button.js +6 -0
- package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
- package/dist/commonjs/components/button/link-button.d.ts +9 -3
- package/dist/commonjs/components/button/link-button.d.ts.map +1 -1
- package/dist/commonjs/components/button/link-button.js +6 -0
- package/dist/commonjs/components/button/link-button.js.map +1 -1
- package/dist/commonjs/components/button/types.d.ts +12 -6
- package/dist/commonjs/components/button/types.d.ts.map +1 -1
- package/dist/commonjs/components/button/types.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts +14 -4
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js +16 -10
- package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox.d.ts +9 -4
- package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox.js +7 -1
- package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts +25 -24
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.js +31 -16
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
- package/dist/commonjs/components/form/form.d.ts +8 -3
- package/dist/commonjs/components/form/form.d.ts.map +1 -1
- package/dist/commonjs/components/form/form.js +6 -0
- package/dist/commonjs/components/form/form.js.map +1 -1
- package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts +16 -0
- package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -0
- package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js +17 -0
- package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js.map +1 -0
- package/dist/commonjs/components/internal/form-field/form-field.d.ts +29 -0
- package/dist/commonjs/components/internal/form-field/form-field.d.ts.map +1 -0
- package/dist/commonjs/components/internal/form-field/form-field.js +56 -0
- package/dist/commonjs/components/internal/form-field/form-field.js.map +1 -0
- package/dist/commonjs/components/internal/spinner/spinner.d.ts +18 -0
- package/dist/commonjs/components/internal/spinner/spinner.d.ts.map +1 -0
- package/dist/commonjs/components/internal/spinner/spinner.js +19 -0
- package/dist/commonjs/components/internal/spinner/spinner.js.map +1 -0
- package/dist/commonjs/components/menu/menu.d.ts +26 -15
- package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
- package/dist/commonjs/components/menu/menu.js +38 -15
- package/dist/commonjs/components/menu/menu.js.map +1 -1
- package/dist/commonjs/components/radio/radio-group.d.ts +14 -4
- package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -1
- package/dist/commonjs/components/radio/radio-group.js +16 -10
- package/dist/commonjs/components/radio/radio-group.js.map +1 -1
- package/dist/commonjs/components/radio/radio.d.ts +9 -4
- package/dist/commonjs/components/radio/radio.d.ts.map +1 -1
- package/dist/commonjs/components/radio/radio.js +6 -0
- package/dist/commonjs/components/radio/radio.js.map +1 -1
- package/dist/commonjs/components/select/select.d.ts +27 -24
- package/dist/commonjs/components/select/select.d.ts.map +1 -1
- package/dist/commonjs/components/select/select.js +33 -14
- package/dist/commonjs/components/select/select.js.map +1 -1
- package/dist/commonjs/components/spacing/box/box.d.ts +5 -3
- package/dist/commonjs/components/spacing/box/box.d.ts.map +1 -1
- package/dist/commonjs/components/spacing/box/box.js +2 -0
- package/dist/commonjs/components/spacing/box/box.js.map +1 -1
- package/dist/commonjs/components/spacing/stack/stack.d.ts +28 -4
- package/dist/commonjs/components/spacing/stack/stack.d.ts.map +1 -1
- package/dist/commonjs/components/spacing/stack/stack.js +11 -3
- package/dist/commonjs/components/spacing/stack/stack.js.map +1 -1
- package/dist/commonjs/components/spacing/types.d.ts +9 -0
- package/dist/commonjs/components/spacing/types.d.ts.map +1 -1
- package/dist/commonjs/components/spacing/types.js +6 -0
- package/dist/commonjs/components/spacing/types.js.map +1 -1
- package/dist/commonjs/components/spinner/spinner.d.ts +12 -5
- package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
- package/dist/commonjs/components/spinner/spinner.js +26 -14
- package/dist/commonjs/components/spinner/spinner.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-area.d.ts +4 -3
- package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-area.js +13 -3
- package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.d.ts +8 -3
- package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/commonjs/components/text-inputs/text-field.js +14 -1
- package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
- package/dist/commonjs/components/types.d.ts +80 -12
- package/dist/commonjs/components/types.d.ts.map +1 -1
- package/dist/commonjs/components/types.js.map +1 -1
- package/dist/commonjs/components/typography/link.d.ts +8 -3
- package/dist/commonjs/components/typography/link.d.ts.map +1 -1
- package/dist/commonjs/components/typography/link.js +9 -1
- package/dist/commonjs/components/typography/link.js.map +1 -1
- package/dist/commonjs/components/typography/text.d.ts +7 -2
- package/dist/commonjs/components/typography/text.d.ts.map +1 -1
- package/dist/commonjs/components/typography/text.js +6 -0
- package/dist/commonjs/components/typography/text.js.map +1 -1
- package/dist/commonjs/components/typography/types.d.ts +4 -3
- package/dist/commonjs/components/typography/types.d.ts.map +1 -1
- package/dist/commonjs/components/typography/types.js.map +1 -1
- package/dist/commonjs/components/typography/utils.d.ts +1 -0
- package/dist/commonjs/components/typography/utils.d.ts.map +1 -1
- package/dist/commonjs/components/typography/utils.js +1 -0
- package/dist/commonjs/components/typography/utils.js.map +1 -1
- package/dist/commonjs/forward-ref.d.ts +2 -2
- package/dist/commonjs/forward-ref.d.ts.map +1 -1
- package/dist/commonjs/forward-ref.js +1 -0
- package/dist/commonjs/forward-ref.js.map +1 -1
- package/dist/commonjs/icons/accounting-document.d.ts +8 -0
- package/dist/commonjs/icons/accounting-document.d.ts.map +1 -0
- package/dist/commonjs/icons/accounting-document.js +22 -0
- package/dist/commonjs/icons/accounting-document.js.map +1 -0
- package/dist/commonjs/icons/add-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/add-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/add-circle-fill.js +22 -0
- package/dist/commonjs/icons/add-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/add-circle.d.ts +8 -0
- package/dist/commonjs/icons/add-circle.d.ts.map +1 -0
- package/dist/commonjs/icons/add-circle.js +22 -0
- package/dist/commonjs/icons/add-circle.js.map +1 -0
- package/dist/commonjs/icons/add.d.ts +3 -2
- package/dist/commonjs/icons/add.d.ts.map +1 -1
- package/dist/commonjs/icons/add.js +17 -2
- package/dist/commonjs/icons/add.js.map +1 -1
- package/dist/commonjs/icons/alert-triangle.d.ts +3 -2
- package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -1
- package/dist/commonjs/icons/alert-triangle.js +17 -2
- package/dist/commonjs/icons/alert-triangle.js.map +1 -1
- package/dist/commonjs/icons/calculator-alt.d.ts +8 -0
- package/dist/commonjs/icons/calculator-alt.d.ts.map +1 -0
- package/dist/commonjs/icons/calculator-alt.js +22 -0
- package/dist/commonjs/icons/calculator-alt.js.map +1 -0
- package/dist/commonjs/icons/calculator.d.ts +8 -0
- package/dist/commonjs/icons/calculator.d.ts.map +1 -0
- package/dist/commonjs/icons/calculator.js +22 -0
- package/dist/commonjs/icons/calculator.js.map +1 -0
- package/dist/commonjs/icons/checkmark-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/checkmark-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/checkmark-circle-fill.js +22 -0
- package/dist/commonjs/icons/checkmark-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/checkmark-circle.d.ts +8 -0
- package/dist/commonjs/icons/checkmark-circle.d.ts.map +1 -0
- package/dist/commonjs/icons/checkmark-circle.js +22 -0
- package/dist/commonjs/icons/checkmark-circle.js.map +1 -0
- package/dist/commonjs/icons/checkmark-small.d.ts +3 -2
- package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -1
- package/dist/commonjs/icons/checkmark-small.js +17 -2
- package/dist/commonjs/icons/checkmark-small.js.map +1 -1
- package/dist/commonjs/icons/checkmark.d.ts +8 -0
- package/dist/commonjs/icons/checkmark.d.ts.map +1 -0
- package/dist/commonjs/icons/checkmark.js +22 -0
- package/dist/commonjs/icons/checkmark.js.map +1 -0
- package/dist/commonjs/icons/chevron-down-fill.d.ts +8 -0
- package/dist/commonjs/icons/chevron-down-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/chevron-down-fill.js +22 -0
- package/dist/commonjs/icons/chevron-down-fill.js.map +1 -0
- package/dist/commonjs/icons/error-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/error-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/error-circle-fill.js +22 -0
- package/dist/commonjs/icons/error-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/index.d.ts +13 -0
- package/dist/commonjs/icons/index.d.ts.map +1 -1
- package/dist/commonjs/icons/index.js +25 -1
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/icons/info-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/info-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/info-circle-fill.js +22 -0
- package/dist/commonjs/icons/info-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/minus-small.d.ts +3 -2
- package/dist/commonjs/icons/minus-small.d.ts.map +1 -1
- package/dist/commonjs/icons/minus-small.js +17 -2
- package/dist/commonjs/icons/minus-small.js.map +1 -1
- package/dist/commonjs/icons/warning-circle-fill.d.ts +8 -0
- package/dist/commonjs/icons/warning-circle-fill.d.ts.map +1 -0
- package/dist/commonjs/icons/warning-circle-fill.js +22 -0
- package/dist/commonjs/icons/warning-circle-fill.js.map +1 -0
- package/dist/commonjs/index.d.ts +13 -11
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +11 -10
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/providers/router/router-provider.d.ts +20 -0
- package/dist/commonjs/providers/router/router-provider.d.ts.map +1 -0
- package/dist/commonjs/providers/router/router-provider.js +15 -0
- package/dist/commonjs/providers/router/router-provider.js.map +1 -0
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts +7 -3
- package/dist/commonjs/providers/ssr/ssr-provider.d.ts.map +1 -1
- package/dist/commonjs/providers/ssr/ssr-provider.js +3 -1
- package/dist/commonjs/providers/ssr/ssr-provider.js.map +1 -1
- package/dist/commonjs/with-style-props.d.ts +17 -11
- package/dist/commonjs/with-style-props.d.ts.map +1 -1
- package/dist/commonjs/with-style-props.js.map +1 -1
- package/dist/esm/components/button/button.d.ts +6 -1
- package/dist/esm/components/button/button.d.ts.map +1 -1
- package/dist/esm/components/button/button.js +16 -3
- package/dist/esm/components/button/button.js.map +1 -1
- package/dist/esm/components/button/constants.d.ts +3 -0
- package/dist/esm/components/button/constants.d.ts.map +1 -0
- package/dist/esm/components/button/constants.js +6 -0
- package/dist/esm/components/button/constants.js.map +1 -0
- package/dist/esm/components/button/icon-button.d.ts +6 -1
- package/dist/esm/components/button/icon-button.d.ts.map +1 -1
- package/dist/esm/components/button/icon-button.js +16 -3
- package/dist/esm/components/button/icon-button.js.map +1 -1
- package/dist/esm/components/button/icon-link-button.d.ts +9 -3
- package/dist/esm/components/button/icon-link-button.d.ts.map +1 -1
- package/dist/esm/components/button/icon-link-button.js +6 -0
- package/dist/esm/components/button/icon-link-button.js.map +1 -1
- package/dist/esm/components/button/link-button.d.ts +9 -3
- package/dist/esm/components/button/link-button.d.ts.map +1 -1
- package/dist/esm/components/button/link-button.js +6 -0
- package/dist/esm/components/button/link-button.js.map +1 -1
- package/dist/esm/components/button/types.d.ts +12 -6
- package/dist/esm/components/button/types.d.ts.map +1 -1
- package/dist/esm/components/button/types.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.d.ts +14 -4
- package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js +16 -10
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox.d.ts +9 -4
- package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox.js +7 -1
- package/dist/esm/components/checkbox/checkbox.js.map +1 -1
- package/dist/esm/components/combo-box/combo-box.d.ts +25 -24
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/esm/components/combo-box/combo-box.js +35 -22
- package/dist/esm/components/combo-box/combo-box.js.map +1 -1
- package/dist/esm/components/form/form.d.ts +8 -3
- package/dist/esm/components/form/form.d.ts.map +1 -1
- package/dist/esm/components/form/form.js +6 -0
- package/dist/esm/components/form/form.js.map +1 -1
- package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts +16 -0
- package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -0
- package/dist/esm/components/internal/collapsible-list/collapsible-list.js +14 -0
- package/dist/esm/components/internal/collapsible-list/collapsible-list.js.map +1 -0
- package/dist/esm/components/internal/form-field/form-field.d.ts +29 -0
- package/dist/esm/components/internal/form-field/form-field.d.ts.map +1 -0
- package/dist/esm/components/internal/form-field/form-field.js +48 -0
- package/dist/esm/components/internal/form-field/form-field.js.map +1 -0
- package/dist/esm/components/internal/spinner/spinner.d.ts +18 -0
- package/dist/esm/components/internal/spinner/spinner.d.ts.map +1 -0
- package/dist/esm/components/internal/spinner/spinner.js +14 -0
- package/dist/esm/components/internal/spinner/spinner.js.map +1 -0
- package/dist/esm/components/menu/menu.d.ts +26 -15
- package/dist/esm/components/menu/menu.d.ts.map +1 -1
- package/dist/esm/components/menu/menu.js +39 -16
- package/dist/esm/components/menu/menu.js.map +1 -1
- package/dist/esm/components/radio/radio-group.d.ts +14 -4
- package/dist/esm/components/radio/radio-group.d.ts.map +1 -1
- package/dist/esm/components/radio/radio-group.js +16 -10
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/radio/radio.d.ts +9 -4
- package/dist/esm/components/radio/radio.d.ts.map +1 -1
- package/dist/esm/components/radio/radio.js +6 -0
- package/dist/esm/components/radio/radio.js.map +1 -1
- package/dist/esm/components/select/select.d.ts +27 -24
- package/dist/esm/components/select/select.d.ts.map +1 -1
- package/dist/esm/components/select/select.js +35 -18
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/spacing/box/box.d.ts +5 -3
- package/dist/esm/components/spacing/box/box.d.ts.map +1 -1
- package/dist/esm/components/spacing/box/box.js +2 -0
- package/dist/esm/components/spacing/box/box.js.map +1 -1
- package/dist/esm/components/spacing/stack/stack.d.ts +28 -4
- package/dist/esm/components/spacing/stack/stack.d.ts.map +1 -1
- package/dist/esm/components/spacing/stack/stack.js +11 -3
- package/dist/esm/components/spacing/stack/stack.js.map +1 -1
- package/dist/esm/components/spacing/types.d.ts +9 -0
- package/dist/esm/components/spacing/types.d.ts.map +1 -1
- package/dist/esm/components/spacing/types.js +6 -0
- package/dist/esm/components/spacing/types.js.map +1 -1
- package/dist/esm/components/spinner/spinner.d.ts +12 -5
- package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner/spinner.js +28 -13
- package/dist/esm/components/spinner/spinner.js.map +1 -1
- package/dist/esm/components/text-inputs/text-area.d.ts +4 -3
- package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-area.js +13 -3
- package/dist/esm/components/text-inputs/text-area.js.map +1 -1
- package/dist/esm/components/text-inputs/text-field.d.ts +8 -3
- package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-inputs/text-field.js +14 -1
- package/dist/esm/components/text-inputs/text-field.js.map +1 -1
- package/dist/esm/components/types.d.ts +80 -12
- package/dist/esm/components/types.d.ts.map +1 -1
- package/dist/esm/components/types.js.map +1 -1
- package/dist/esm/components/typography/link.d.ts +8 -3
- package/dist/esm/components/typography/link.d.ts.map +1 -1
- package/dist/esm/components/typography/link.js +10 -2
- package/dist/esm/components/typography/link.js.map +1 -1
- package/dist/esm/components/typography/text.d.ts +7 -2
- package/dist/esm/components/typography/text.d.ts.map +1 -1
- package/dist/esm/components/typography/text.js +6 -0
- package/dist/esm/components/typography/text.js.map +1 -1
- package/dist/esm/components/typography/types.d.ts +4 -3
- package/dist/esm/components/typography/types.d.ts.map +1 -1
- package/dist/esm/components/typography/types.js.map +1 -1
- package/dist/esm/components/typography/utils.d.ts +1 -0
- package/dist/esm/components/typography/utils.d.ts.map +1 -1
- package/dist/esm/components/typography/utils.js +1 -0
- package/dist/esm/components/typography/utils.js.map +1 -1
- package/dist/esm/forward-ref.d.ts +2 -2
- package/dist/esm/forward-ref.d.ts.map +1 -1
- package/dist/esm/forward-ref.js +1 -0
- package/dist/esm/forward-ref.js.map +1 -1
- package/dist/esm/icons/accounting-document.d.ts +8 -0
- package/dist/esm/icons/accounting-document.d.ts.map +1 -0
- package/dist/esm/icons/accounting-document.js +17 -0
- package/dist/esm/icons/accounting-document.js.map +1 -0
- package/dist/esm/icons/add-circle-fill.d.ts +8 -0
- package/dist/esm/icons/add-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/add-circle-fill.js +17 -0
- package/dist/esm/icons/add-circle-fill.js.map +1 -0
- package/dist/esm/icons/add-circle.d.ts +8 -0
- package/dist/esm/icons/add-circle.d.ts.map +1 -0
- package/dist/esm/icons/add-circle.js +17 -0
- package/dist/esm/icons/add-circle.js.map +1 -0
- package/dist/esm/icons/add.d.ts +3 -2
- package/dist/esm/icons/add.d.ts.map +1 -1
- package/dist/esm/icons/add.js +15 -3
- package/dist/esm/icons/add.js.map +1 -1
- package/dist/esm/icons/alert-triangle.d.ts +3 -2
- package/dist/esm/icons/alert-triangle.d.ts.map +1 -1
- package/dist/esm/icons/alert-triangle.js +14 -2
- package/dist/esm/icons/alert-triangle.js.map +1 -1
- package/dist/esm/icons/calculator-alt.d.ts +8 -0
- package/dist/esm/icons/calculator-alt.d.ts.map +1 -0
- package/dist/esm/icons/calculator-alt.js +17 -0
- package/dist/esm/icons/calculator-alt.js.map +1 -0
- package/dist/esm/icons/calculator.d.ts +8 -0
- package/dist/esm/icons/calculator.d.ts.map +1 -0
- package/dist/esm/icons/calculator.js +17 -0
- package/dist/esm/icons/calculator.js.map +1 -0
- package/dist/esm/icons/checkmark-circle-fill.d.ts +8 -0
- package/dist/esm/icons/checkmark-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/checkmark-circle-fill.js +17 -0
- package/dist/esm/icons/checkmark-circle-fill.js.map +1 -0
- package/dist/esm/icons/checkmark-circle.d.ts +8 -0
- package/dist/esm/icons/checkmark-circle.d.ts.map +1 -0
- package/dist/esm/icons/checkmark-circle.js +17 -0
- package/dist/esm/icons/checkmark-circle.js.map +1 -0
- package/dist/esm/icons/checkmark-small.d.ts +3 -2
- package/dist/esm/icons/checkmark-small.d.ts.map +1 -1
- package/dist/esm/icons/checkmark-small.js +14 -2
- package/dist/esm/icons/checkmark-small.js.map +1 -1
- package/dist/esm/icons/checkmark.d.ts +8 -0
- package/dist/esm/icons/checkmark.d.ts.map +1 -0
- package/dist/esm/icons/checkmark.js +17 -0
- package/dist/esm/icons/checkmark.js.map +1 -0
- package/dist/esm/icons/chevron-down-fill.d.ts +8 -0
- package/dist/esm/icons/chevron-down-fill.d.ts.map +1 -0
- package/dist/esm/icons/chevron-down-fill.js +17 -0
- package/dist/esm/icons/chevron-down-fill.js.map +1 -0
- package/dist/esm/icons/error-circle-fill.d.ts +8 -0
- package/dist/esm/icons/error-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/error-circle-fill.js +17 -0
- package/dist/esm/icons/error-circle-fill.js.map +1 -0
- package/dist/esm/icons/index.d.ts +13 -0
- package/dist/esm/icons/index.d.ts.map +1 -1
- package/dist/esm/icons/index.js +12 -0
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/icons/info-circle-fill.d.ts +8 -0
- package/dist/esm/icons/info-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/info-circle-fill.js +17 -0
- package/dist/esm/icons/info-circle-fill.js.map +1 -0
- package/dist/esm/icons/minus-small.d.ts +3 -2
- package/dist/esm/icons/minus-small.d.ts.map +1 -1
- package/dist/esm/icons/minus-small.js +14 -2
- package/dist/esm/icons/minus-small.js.map +1 -1
- package/dist/esm/icons/warning-circle-fill.d.ts +8 -0
- package/dist/esm/icons/warning-circle-fill.d.ts.map +1 -0
- package/dist/esm/icons/warning-circle-fill.js +17 -0
- package/dist/esm/icons/warning-circle-fill.js.map +1 -0
- package/dist/esm/index.d.ts +13 -11
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/providers/router/router-provider.d.ts +20 -0
- package/dist/esm/providers/router/router-provider.d.ts.map +1 -0
- package/dist/esm/providers/router/router-provider.js +12 -0
- package/dist/esm/providers/router/router-provider.js.map +1 -0
- package/dist/esm/providers/ssr/ssr-provider.d.ts +7 -3
- package/dist/esm/providers/ssr/ssr-provider.d.ts.map +1 -1
- package/dist/esm/providers/ssr/ssr-provider.js +3 -1
- package/dist/esm/providers/ssr/ssr-provider.js.map +1 -1
- package/dist/esm/with-style-props.d.ts +17 -11
- package/dist/esm/with-style-props.d.ts.map +1 -1
- package/dist/esm/with-style-props.js.map +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +71 -26
- package/dist/commonjs/components/form-field/form-field.d.ts +0 -13
- package/dist/commonjs/components/form-field/form-field.d.ts.map +0 -1
- package/dist/commonjs/components/form-field/form-field.js +0 -36
- package/dist/commonjs/components/form-field/form-field.js.map +0 -1
- package/dist/commonjs/components/sr-only/sr-only.d.ts +0 -8
- package/dist/commonjs/components/sr-only/sr-only.d.ts.map +0 -1
- package/dist/commonjs/components/sr-only/sr-only.js +0 -10
- package/dist/commonjs/components/sr-only/sr-only.js.map +0 -1
- package/dist/esm/components/form-field/form-field.d.ts +0 -13
- package/dist/esm/components/form-field/form-field.d.ts.map +0 -1
- package/dist/esm/components/form-field/form-field.js +0 -28
- package/dist/esm/components/form-field/form-field.js.map +0 -1
- package/dist/esm/components/sr-only/sr-only.d.ts +0 -8
- package/dist/esm/components/sr-only/sr-only.d.ts.map +0 -1
- package/dist/esm/components/sr-only/sr-only.js +0 -7
- package/dist/esm/components/sr-only/sr-only.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FieldError } from '../../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a label for a form field.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare function FormFieldLabel({ children, isRequired, isDisabled, }: {
|
|
7
|
+
children: string | undefined;
|
|
8
|
+
isRequired: boolean | undefined;
|
|
9
|
+
isDisabled?: boolean | undefined;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
/**
|
|
12
|
+
* Renders a description for a form field.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function FormFieldDescription({ children }: {
|
|
16
|
+
children: string | undefined;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
/**
|
|
19
|
+
* Renders an error message for a form field.
|
|
20
|
+
*
|
|
21
|
+
* Must be rendered unconditionally, as it can be populated with browser validation errors
|
|
22
|
+
* even if an explicit error message isn't provided.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare function FormFieldError({ children }: {
|
|
27
|
+
children: FieldError;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=form-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../../../../src/components/internal/form-field/form-field.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClC,kDAiBA;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,kDAalF;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,UAAU,CAAA;CAAE,2CAMpE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Label as RACLabel, Text as RACText, FieldError as RACFieldError, } from 'react-aria-components';
|
|
4
|
+
import { IconAlertTriangle } from '../../../icons/index.js';
|
|
5
|
+
import { Text } from '../../typography/text.js';
|
|
6
|
+
import { textStyle } from '../../typography/utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Renders a label for a form field.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function FormFieldLabel({ children, isRequired, isDisabled, }) {
|
|
12
|
+
if (!children) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs(RACLabel, { className: clsx('cim-form-field-label', textStyle({ variant: 'medium', tone: isDisabled ? 'muted' : 'base' })), children: [children, isRequired && (_jsx(Text, { tone: "critical", as: "span", "aria-hidden": true, children: "*" }))] }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a description for a form field.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export function FormFieldDescription({ children }) {
|
|
22
|
+
if (!children) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return (_jsx(RACText, { slot: "description", className: clsx('cim-form-field-description', textStyle({ variant: 'small', tone: 'subtle' })), children: children }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Renders an error message for a form field.
|
|
29
|
+
*
|
|
30
|
+
* Must be rendered unconditionally, as it can be populated with browser validation errors
|
|
31
|
+
* even if an explicit error message isn't provided.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export function FormFieldError({ children }) {
|
|
36
|
+
return (_jsx(RACFieldError, { className: clsx('cim-form-field-error', textStyle({ variant: 'small', tone: 'critical' })), children: (validation) => renderFieldError(children, validation) }));
|
|
37
|
+
}
|
|
38
|
+
function renderFieldError(fieldError, validation) {
|
|
39
|
+
const errors = typeof fieldError === 'function' ? fieldError(validation) : (fieldError ?? validation.validationErrors);
|
|
40
|
+
if (!errors || !errors.length) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return typeof errors === 'object' ? (errors.map((error) => _jsx(ErrorMessage, { message: error }, error))) : (_jsx(ErrorMessage, { message: errors }));
|
|
44
|
+
}
|
|
45
|
+
function ErrorMessage({ message }) {
|
|
46
|
+
return (_jsxs("div", { className: "cim-form-field-error-message", children: [_jsx("div", { className: "cim-form-field-error-icon-wrapper", "aria-hidden": true, children: _jsx(IconAlertTriangle, {}) }), message] }));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=form-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field.js","sourceRoot":"","sources":["../../../../../src/components/internal/form-field/form-field.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,KAAK,IAAI,QAAQ,EACjB,IAAI,IAAI,OAAO,EACf,UAAU,IAAI,aAAa,GAE5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,UAAU,EACV,UAAU,GAKX;IACC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,MAAC,QAAQ,IACP,SAAS,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,aAE7G,QAAQ,EACR,UAAU,IAAI,CACb,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,EAAE,EAAC,MAAM,uCAExB,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAA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AAE,OAAO,EAAuB;IACpD,OAAO,CACL,eAAK,SAAS,EAAC,8BAA8B,aAC3C,cAAK,SAAS,EAAC,mCAAmC,iCAChD,KAAC,iBAAiB,KAAG,GACjB,EACL,OAAO,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n Label as RACLabel,\n Text as RACText,\n FieldError as RACFieldError,\n type ValidationResult as RACValidationResult,\n} from 'react-aria-components';\nimport { IconAlertTriangle } from '../../../icons/index.js';\nimport type { FieldError } from '../../types.js';\nimport { Text } from '../../typography/text.js';\nimport { textStyle } from '../../typography/utils.js';\n\n/**\n * Renders a label for a form field.\n * @internal\n */\nexport function FormFieldLabel({\n children,\n isRequired,\n isDisabled,\n}: {\n children: string | undefined;\n isRequired: boolean | undefined;\n isDisabled?: boolean | undefined;\n}) {\n if (!children) {\n return null;\n }\n\n return (\n <RACLabel\n className={clsx('cim-form-field-label', textStyle({ variant: 'medium', tone: isDisabled ? 'muted' : 'base' }))}\n >\n {children}\n {isRequired && (\n <Text tone=\"critical\" as=\"span\" aria-hidden>\n *\n </Text>\n )}\n </RACLabel>\n );\n}\n\n/**\n * Renders a description for a form field.\n * @internal\n */\nexport function FormFieldDescription({ children }: { children: string | undefined }) {\n if (!children) {\n return null;\n }\n\n return (\n <RACText\n slot=\"description\"\n className={clsx('cim-form-field-description', textStyle({ variant: 'small', tone: 'subtle' }))}\n >\n {children}\n </RACText>\n );\n}\n\n/**\n * Renders an error message for a form field.\n *\n * Must be rendered unconditionally, as it can be populated with browser validation errors\n * even if an explicit error message isn't provided.\n *\n * @internal\n */\nexport function FormFieldError({ children }: { children: FieldError }) {\n return (\n <RACFieldError className={clsx('cim-form-field-error', textStyle({ variant: 'small', tone: 'critical' }))}>\n {(validation) => renderFieldError(children, validation)}\n </RACFieldError>\n );\n}\n\nfunction renderFieldError(fieldError: FieldError, validation: RACValidationResult): string | ReactNode | undefined {\n const errors =\n typeof fieldError === 'function' ? fieldError(validation) : (fieldError ?? validation.validationErrors);\n\n if (!errors || !errors.length) {\n return null;\n }\n\n return typeof errors === 'object' ? (\n errors.map((error) => <ErrorMessage key={error} message={error} />)\n ) : (\n <ErrorMessage message={errors} />\n );\n}\n\nfunction ErrorMessage({ message }: { message: string }) {\n return (\n <div className=\"cim-form-field-error-message\">\n <div className=\"cim-form-field-error-icon-wrapper\" aria-hidden>\n <IconAlertTriangle />\n </div>\n {message}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
import type { CommonProps, LabellableProps } from '../../types.js';
|
|
3
|
+
interface SpinnerProps extends CommonProps, Omit<LabellableProps, 'label'> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
spinnerRef?: Ref<HTMLDivElement>;
|
|
6
|
+
size: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Displays a variable-size loading indicator to represent an ongoing operation.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
declare function Spinner({ children, spinnerRef, size, UNSAFE_className, UNSAFE_style, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare namespace Spinner {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
export { Spinner as InternalSpinner };
|
|
18
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../../src/components/internal/spinner/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE,UAAU,YAAa,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAuBtG;kBAvBQ,OAAO;;;AA2BhB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { ProgressBar as RACProgressBar } from 'react-aria-components';
|
|
4
|
+
/**
|
|
5
|
+
* Displays a variable-size loading indicator to represent an ongoing operation.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function Spinner({ children, spinnerRef, size, UNSAFE_className, UNSAFE_style, ...props }) {
|
|
10
|
+
return (_jsxs(RACProgressBar, { ...props, isIndeterminate: true, ref: spinnerRef, className: clsx('cim-spinner', UNSAFE_className), style: UNSAFE_style, children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 80 80", width: size, height: size, preserveAspectRatio: "xMidYMid", "aria-hidden": true, children: [_jsx("circle", { className: "cim-spinner-ring-bg", cx: "40", cy: "40", r: "35" }), _jsx("circle", { className: "cim-spinner-ring-fg", cx: "40", cy: "40", r: "35" })] }), children] }));
|
|
11
|
+
}
|
|
12
|
+
Spinner.displayName = 'Spinner';
|
|
13
|
+
export { Spinner as InternalSpinner };
|
|
14
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../../src/components/internal/spinner/spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAStE;;;;GAIG;AACH,SAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAgB;IACrG,OAAO,CACL,MAAC,cAAc,OACT,KAAK,EACT,eAAe,QACf,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,gBAAgB,CAAC,EAChD,KAAK,EAAE,YAAY,aAEnB,eACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,mBAAmB,EAAC,UAAU,kCAG9B,iBAAQ,SAAS,EAAC,qBAAqB,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,EACjE,iBAAQ,SAAS,EAAC,qBAAqB,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,GAAG,IAC7D,EACL,QAAQ,IACM,CAClB,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, Ref } from 'react';\nimport { ProgressBar as RACProgressBar } from 'react-aria-components';\nimport type { CommonProps, LabellableProps } from '../../types.js';\n\ninterface SpinnerProps extends CommonProps, Omit<LabellableProps, 'label'> {\n children?: ReactNode;\n spinnerRef?: Ref<HTMLDivElement>;\n size: string;\n}\n\n/**\n * Displays a variable-size loading indicator to represent an ongoing operation.\n *\n * @internal\n */\nfunction Spinner({ children, spinnerRef, size, UNSAFE_className, UNSAFE_style, ...props }: SpinnerProps) {\n return (\n <RACProgressBar\n {...props}\n isIndeterminate\n ref={spinnerRef}\n className={clsx('cim-spinner', UNSAFE_className)}\n style={UNSAFE_style}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 80 80\"\n width={size}\n height={size}\n preserveAspectRatio=\"xMidYMid\"\n aria-hidden\n >\n <circle className=\"cim-spinner-ring-bg\" cx=\"40\" cy=\"40\" r=\"35\" />\n <circle className=\"cim-spinner-ring-fg\" cx=\"40\" cy=\"40\" r=\"35\" />\n </svg>\n {children}\n </RACProgressBar>\n );\n}\n\nSpinner.displayName = 'Spinner';\n\nexport { Spinner as InternalSpinner };\n"]}
|
|
@@ -1,38 +1,49 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type MenuItemProps as RACMenuItemProps } from 'react-aria-components';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { type MenuProps as RACMenuProps, type MenuItemProps as RACMenuItemProps, type MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';
|
|
3
|
+
import type { ActionButtonProps } from '../button/types.js';
|
|
4
|
+
import type { CommonProps, Key, LabellableProps, NavigationProps, CollectionProps, CollectionItem, StringLikeChildren } from '../types.js';
|
|
5
|
+
export interface MenuProps<T extends CollectionItem = CollectionItem> extends CommonProps, CollectionProps<T>, LabellableProps, Pick<RACMenuTriggerProps, 'onOpenChange'>, Pick<RACMenuProps<T>, 'onScroll'>, Pick<ActionButtonProps, 'onHoverStart' | 'onHoverEnd'> {
|
|
6
|
+
/** Whether the menu trigger is disabled. */
|
|
7
|
+
isDisabled?: boolean;
|
|
7
8
|
/** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */
|
|
8
9
|
onAction?: (key: Key) => void;
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Displays a collapsible list of options and actions that users can choose from.
|
|
13
|
+
*
|
|
14
|
+
* See [menu usage guidelines](https://ui.cimpress.io/components/menu/).
|
|
15
|
+
*/
|
|
16
|
+
declare const _Menu: <T extends CollectionItem>(props: MenuProps<T> & import("react").RefAttributes<HTMLButtonElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
11
17
|
export { _Menu as Menu };
|
|
12
|
-
export interface MenuSectionProps {
|
|
18
|
+
export interface MenuSectionProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T> {
|
|
13
19
|
/** The ID of the section. Has to be unique across all sections and items. */
|
|
14
20
|
id?: Key;
|
|
15
21
|
/** The content to display as the section title. */
|
|
16
22
|
title: string;
|
|
17
|
-
/** The contents of the section. */
|
|
18
|
-
children: ReactNode;
|
|
19
23
|
}
|
|
20
|
-
|
|
24
|
+
/** Groups list items within `Menu` into a section. */
|
|
25
|
+
export declare function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
26
|
export declare namespace MenuSection {
|
|
22
27
|
var displayName: string;
|
|
23
28
|
}
|
|
24
|
-
export interface MenuItemProps extends Pick<RACMenuItemProps, 'isDisabled' | '
|
|
29
|
+
export interface MenuItemProps extends NavigationProps, Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {
|
|
25
30
|
/** The ID of the item. Has to be unique across all sections and items. */
|
|
26
31
|
id?: Key;
|
|
27
32
|
/** The content to display as the label. */
|
|
28
|
-
|
|
33
|
+
children: StringLikeChildren;
|
|
34
|
+
/** Additional description for the menu item. */
|
|
35
|
+
description?: string;
|
|
36
|
+
/** An icon representing the menu item. */
|
|
37
|
+
icon?: ReactNode;
|
|
29
38
|
}
|
|
30
|
-
|
|
39
|
+
/** Renders a single list item within `Menu`. */
|
|
40
|
+
export declare function MenuItem({ children, description, icon, ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
31
41
|
export declare namespace MenuItem {
|
|
32
42
|
var displayName: string;
|
|
33
43
|
}
|
|
34
|
-
|
|
35
|
-
export declare
|
|
44
|
+
/** Renders a horizontal divider between list items within `Menu`. */
|
|
45
|
+
export declare function MenuDivider(): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare namespace MenuDivider {
|
|
36
47
|
var displayName: string;
|
|
37
48
|
}
|
|
38
49
|
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,OAAO,CAAC;AAC/E,OAAO,EAGL,KAAK,SAAS,IAAI,YAAY,EAE9B,KAAK,aAAa,IAAI,gBAAgB,EAEtC,KAAK,gBAAgB,IAAI,mBAAmB,EAK7C,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EACV,WAAW,EACX,GAAG,EACH,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAClE,SAAQ,WAAW,EACjB,eAAe,CAAC,CAAC,CAAC,EAClB,eAAe,EACf,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,EACzC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EACjC,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,YAAY,CAAC;IACxD,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wHAAwH;IACxH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B;AAkCD;;;;GAIG;AACH,QAAA,MAAM,KAAK,GArCG,CAAC,SAAS,cAAc,gKAqCgB,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;AAsCzB,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACrG,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAa9G;yBAbe,WAAW;;;AAiB3B,MAAM,WAAW,aACf,SAAQ,eAAe,EACrB,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IACnF,0EAA0E;IAC1E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,gDAAgD;AAChD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CA4BhF;yBA5Be,QAAQ;;;AAgCxB,qEAAqE;AACrE,wBAAgB,WAAW,4CAE1B;yBAFe,WAAW"}
|
|
@@ -1,34 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { useEffect } from 'react';
|
|
4
|
-
import {
|
|
5
|
+
import { Header as RACHeader, Menu as RACMenu, MenuItem as RACMenuItem, MenuTrigger as RACMenuTrigger, MenuSection as RACMenuSection, Separator as RACSeparator, Collection as RACCollection, Text as RACText, } from 'react-aria-components';
|
|
5
6
|
import { forwardRef } from '../../forward-ref.js';
|
|
7
|
+
import { IconChevronDownFill } from '../../icons/index.js';
|
|
6
8
|
import { withStyleProps } from '../../with-style-props.js';
|
|
9
|
+
import { Button } from '../button/button.js';
|
|
10
|
+
import { IconButton } from '../button/icon-button.js';
|
|
11
|
+
import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
|
|
7
12
|
import { textStyle } from '../typography/utils.js';
|
|
8
|
-
function Menu({
|
|
9
|
-
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
13
|
+
function Menu({ children, isDisabled, onAction, items, onOpenChange, onScroll, ...props }, ref) {
|
|
14
|
+
const { label, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
10
15
|
useEffect(() => {
|
|
11
16
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
12
|
-
console.warn('Menu requires one of label / aria-label / aria-labelledby for accessibility');
|
|
17
|
+
console.warn('`Menu` requires one of `label` / `aria-label` / `aria-labelledby` for accessibility');
|
|
13
18
|
}
|
|
14
19
|
}, [label, ariaLabel, ariaLabelledBy]);
|
|
15
|
-
|
|
20
|
+
if (items != null && typeof children !== 'function') {
|
|
21
|
+
console.warn('`Menu` requires `children` to be a function when using `items` prop');
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs(RACMenuTrigger, { onOpenChange: onOpenChange, children: [_jsx(MenuTrigger, { ...props, triggerRef: ref, isDisabled: isDisabled }), _jsx(CollapsibleList, { placement: "bottom start", offset: 5, maxHeight: 315, children: _jsx(RACMenu, { className: "cim-menu", onAction: onAction, onScroll: onScroll, items: items, children: children }) })] }));
|
|
16
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Displays a collapsible list of options and actions that users can choose from.
|
|
27
|
+
*
|
|
28
|
+
* See [menu usage guidelines](https://ui.cimpress.io/components/menu/).
|
|
29
|
+
*/
|
|
17
30
|
const _Menu = withStyleProps(forwardRef(Menu), 'Menu');
|
|
18
31
|
export { _Menu as Menu };
|
|
19
|
-
|
|
20
|
-
|
|
32
|
+
function MenuTrigger({ label, triggerRef, ...props }) {
|
|
33
|
+
if (label) {
|
|
34
|
+
return (_jsx(Button, { ...props, variant: "secondary", size: "medium", ref: triggerRef, iconEnd: _jsx(IconChevronDownFill, { UNSAFE_className: "cim-menu-trigger-icon" }), children: label }));
|
|
35
|
+
}
|
|
36
|
+
return (_jsx(IconButton, { ...props, "aria-label": props['aria-label'] ?? '', variant: "secondary", size: "medium", ref: triggerRef, icon: _jsx(IconChevronDownFill, { UNSAFE_className: "cim-menu-trigger-icon" }) }));
|
|
37
|
+
}
|
|
38
|
+
/** Groups list items within `Menu` into a section. */
|
|
39
|
+
export function MenuSection({ title, children, items, ...props }) {
|
|
40
|
+
if (items != null && typeof children !== 'function') {
|
|
41
|
+
console.warn('`MenuSection` requires `children` to be a function when using `items` prop');
|
|
42
|
+
}
|
|
43
|
+
return (_jsxs(RACMenuSection, { ...props, className: "cim-menu-section", children: [_jsx(RACHeader, { className: clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
|
|
21
44
|
}
|
|
22
45
|
MenuSection.displayName = 'MenuSection';
|
|
23
|
-
|
|
24
|
-
|
|
46
|
+
/** Renders a single list item within `Menu`. */
|
|
47
|
+
export function MenuItem({ children, description, icon, ...props }) {
|
|
48
|
+
const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
|
|
49
|
+
return (_jsx(RACMenuItem, { ...props, className: "cim-menu-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [icon, _jsxs("div", { className: "cim-menu-item-text", children: [_jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children }), description && (_jsx(RACText, { slot: "description", className: textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' }), children: description }))] })] })) }));
|
|
25
50
|
}
|
|
26
51
|
MenuItem.displayName = 'MenuItem';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
MenuSeparator.displayName = 'MenuSeparator';
|
|
31
|
-
function ChevronDownIcon(props) {
|
|
32
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", "data-icon": true, ...props, children: _jsx("path", { d: "M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z" }) }));
|
|
52
|
+
/** Renders a horizontal divider between list items within `Menu`. */
|
|
53
|
+
export function MenuDivider() {
|
|
54
|
+
return _jsx(RACSeparator, { className: "cim-menu-divider" });
|
|
33
55
|
}
|
|
56
|
+
MenuDivider.displayName = 'MenuDivider';
|
|
34
57
|
//# sourceMappingURL=menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAyD,SAAS,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EACf,QAAQ,IAAI,WAAW,EAEvB,WAAW,IAAI,cAAc,EAC7B,OAAO,IAAI,UAAU,EACrB,OAAO,IAAI,UAAU,EACrB,SAAS,IAAI,YAAY,EACzB,IAAI,IAAI,OAAO,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACl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EAAoB;IACzE,OAAO,CACL,MAAC,UAAU,OAAK,KAAK,EAAE,SAAS,EAAC,kBAAkB,aACjD,KAAC,SAAS,IAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAC5G,KAAK,GACI,EACX,QAAQ,IACE,CACd,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAsBxC,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAiB;IACzD,OAAO,CACL,KAAC,WAAW,OAAK,KAAK,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAE,KAAK,YAChE,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,YACzF,KAAK,GACE,GACE,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAC,YAAY,IAAC,SAAS,EAAC,oBAAoB,GAAG,CAAC;AACzD,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,SAAS,eAAe,CAAC,KAAmC;IAC1D,OAAO,CACL,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,wBAAe,KAAK,YACjG,eAAM,CAAC,EAAC,4OAA4O,GAAG,GACnP,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { type ReactNode, type SVGAttributes, type ForwardedRef, useEffect } from 'react';\nimport {\n Button as RACButton,\n Header as RACHeader,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuTrigger as RACMenuTrigger,\n Section as RACSection,\n Popover as RACPopover,\n Separator as RACSeparator,\n Text as RACText,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, Key, LabellableProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\n// TODO: document that when creating the items dynamically, all items must have `key` and `id` defined\n\nexport interface MenuProps extends DOMProps, LabellableProps {\n /** The contents of the menu. */\n children?: ReactNode;\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n}\n\nfunction Menu(\n { label, children, onAction, UNSAFE_className, UNSAFE_style, ...props }: MenuProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Menu requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACMenuTrigger>\n <RACButton {...props} ref={ref} className={clsx('cim-menu-button', UNSAFE_className)} style={UNSAFE_style}>\n {label}\n <ChevronDownIcon height={12} width={12} aria-hidden />\n </RACButton>\n <RACPopover className=\"cim-menu-popover\" offset={2} maxHeight={315} data-experimental-cim-style-root>\n <RACMenu className=\"cim-menu\" onAction={onAction}>\n {children}\n </RACMenu>\n </RACPopover>\n </RACMenuTrigger>\n );\n}\n\nconst _Menu = withStyleProps(forwardRef(Menu), 'Menu');\n\nexport { _Menu as Menu };\n\nexport interface MenuSectionProps {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n /** The contents of the section. */\n children: ReactNode;\n}\n\nexport function MenuSection({ title, children, ...props }: MenuSectionProps) {\n return (\n <RACSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n {children}\n </RACSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends Pick<\n RACMenuItemProps,\n | 'isDisabled'\n | 'href'\n | 'hrefLang'\n | 'target'\n | 'rel'\n | 'download'\n | 'ping'\n | 'referrerPolicy'\n | 'routerOptions'\n | 'onAction'\n > {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n label: string;\n}\n\nexport function MenuItem({ label, ...props }: MenuItemProps) {\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={label}>\n <RACText slot=\"label\" className={clsx('cim-menu-item-label', textStyle({ variant: 'body' }))}>\n {label}\n </RACText>\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n\nexport function MenuSeparator() {\n return <RACSeparator className=\"cim-menu-separator\" />;\n}\n\nMenuSeparator.displayName = 'MenuSeparator';\n\nfunction ChevronDownIcon(props: SVGAttributes<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" fill=\"currentColor\" data-icon {...props}>\n <path d=\"M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z\" />\n </svg>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAqC,SAAS,EAAY,MAAM,OAAO,CAAC;AAC/E,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EAEf,QAAQ,IAAI,WAAW,EAEvB,WAAW,IAAI,cAAc,EAE7B,W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,CAAC,CAAC,QAAQ,EAAE,CAAC,YAEhF,WAAW,GACJ,CACX,IACG,IACL,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,qEAAqE;AACrE,MAAM,UAAU,WAAW;IACzB,OAAO,KAAC,YAAY,IAAC,SAAS,EAAC,kBAAkB,GAAG,CAAC;AACvD,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type ReactNode, type ForwardedRef, useEffect, type Ref } from 'react';\nimport {\n Header as RACHeader,\n Menu as RACMenu,\n type MenuProps as RACMenuProps,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuTrigger as RACMenuTrigger,\n type MenuTriggerProps as RACMenuTriggerProps,\n MenuSection as RACMenuSection,\n Separator as RACSeparator,\n Collection as RACCollection,\n Text as RACText,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { ActionButtonProps } from '../button/types.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport type {\n CommonProps,\n Key,\n LabellableProps,\n NavigationProps,\n CollectionProps,\n CollectionItem,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface MenuProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n CollectionProps<T>,\n LabellableProps,\n Pick<RACMenuTriggerProps, 'onOpenChange'>,\n Pick<RACMenuProps<T>, 'onScroll'>,\n Pick<ActionButtonProps, 'onHoverStart' | 'onHoverEnd'> {\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n}\n\nfunction Menu<T extends CollectionItem>(\n { children, isDisabled, onAction, items, onOpenChange, onScroll, ...props }: MenuProps<T>,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const { label, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('`Menu` requires one of `label` / `aria-label` / `aria-labelledby` for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (items != null && typeof children !== 'function') {\n console.warn('`Menu` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuTrigger onOpenChange={onOpenChange}>\n <MenuTrigger {...props} triggerRef={ref} isDisabled={isDisabled} />\n <CollapsibleList\n placement=\"bottom start\"\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACMenu className=\"cim-menu\" onAction={onAction} onScroll={onScroll} items={items}>\n {children}\n </RACMenu>\n </CollapsibleList>\n </RACMenuTrigger>\n );\n}\n\n/**\n * Displays a collapsible list of options and actions that users can choose from.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nconst _Menu = withStyleProps(forwardRef(Menu), 'Menu');\n\nexport { _Menu as Menu };\n\ninterface MenuTriggerProps\n extends CommonProps,\n LabellableProps,\n Pick<ActionButtonProps, 'onHoverStart' | 'onHoverEnd'> {\n triggerRef: Ref<HTMLButtonElement>;\n isDisabled?: boolean;\n}\n\nfunction MenuTrigger({ label, triggerRef, ...props }: MenuTriggerProps) {\n if (label) {\n return (\n <Button\n {...props}\n variant=\"secondary\"\n size=\"medium\"\n ref={triggerRef}\n iconEnd={<IconChevronDownFill UNSAFE_className=\"cim-menu-trigger-icon\" />}\n >\n {label}\n </Button>\n );\n }\n\n return (\n <IconButton\n {...props}\n // The warning for missing aria-label would have been already emitted in the <Menu> component, so this is fine\n aria-label={props['aria-label'] ?? ''}\n variant=\"secondary\"\n size=\"medium\"\n ref={triggerRef}\n icon={<IconChevronDownFill UNSAFE_className=\"cim-menu-trigger-icon\" />}\n />\n );\n}\n\nexport interface MenuSectionProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Menu` into a section. */\nexport function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`MenuSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACMenuSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends NavigationProps,\n Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** Additional description for the menu item. */\n description?: string;\n /** An icon representing the menu item. */\n icon?: ReactNode;\n}\n\n/** Renders a single list item within `Menu`. */\nexport function MenuItem({ children, description, icon, ...props }: MenuItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n {icon}\n\n <div className=\"cim-menu-item-text\">\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n\n {description && (\n <RACText\n slot=\"description\"\n className={textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' })}\n >\n {description}\n </RACText>\n )}\n </div>\n </>\n )}\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n\n/** Renders a horizontal divider between list items within `Menu`. */\nexport function MenuDivider() {\n return <RACSeparator className=\"cim-menu-divider\" />;\n}\n\nMenuDivider.displayName = 'MenuDivider';\n"]}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type RadioGroupProps as RACRadioGroupProps } from 'react-aria-components';
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
export interface RadioGroupProps extends
|
|
3
|
+
import type { Responsive } from '../spacing/types.js';
|
|
4
|
+
import type { Direction, CommonProps, FieldProps, WithRequired } from '../types.js';
|
|
5
|
+
export interface RadioGroupProps extends CommonProps, WithRequired<FieldProps<string | null>, 'label'>, Pick<RACRadioGroupProps, 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'> {
|
|
6
6
|
/** Radio buttons belonging to the group. */
|
|
7
7
|
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Determines the direction in which radio buttons will be stacked.
|
|
10
|
+
* @default 'vertical'
|
|
11
|
+
*/
|
|
12
|
+
direction?: Responsive<Direction>;
|
|
8
13
|
}
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Allows users to select a single item from a visible list.
|
|
16
|
+
*
|
|
17
|
+
* See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
|
|
18
|
+
*/
|
|
19
|
+
declare const _RadioGroup: (props: RadioGroupProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
10
20
|
export { _RadioGroup as RadioGroup };
|
|
11
21
|
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAA+B,KAAK,eAAe,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhH,OAAO,KAAK,EAAc,UAAU,EAAW,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,WAAW,eACf,SAAQ,WAAW,EACjB,YAAY,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,EAChD,IAAI,CACF,kBAAkB,EAClB,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,CAC1G;IACH,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACnC;AA2BD;;;;GAIG;AACH,QAAA,MAAM,WAAW,iKAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { RadioGroup as RACRadioGroup } from 'react-aria-components';
|
|
4
5
|
import { forwardRef } from '../../forward-ref.js';
|
|
5
6
|
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
-
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
|
|
7
|
+
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
|
|
7
8
|
import { Stack } from '../spacing/stack/stack.js';
|
|
8
|
-
function RadioGroup({ label, description, error: errorMessage,
|
|
9
|
-
return (_jsxs(RACRadioGroup, { ...props, ref: ref, className: clsx('cim-radio-group', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsx(Stack, { gap:
|
|
9
|
+
function RadioGroup({ label, description, error: errorMessage, direction = 'vertical', children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
10
|
+
return (_jsxs(RACRadioGroup, { ...props, ref: ref, className: clsx('cim-radio-group', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsx(Stack, { gap: getGapFromDirection(direction), direction: direction, children: children }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
|
|
10
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Allows users to select a single item from a visible list.
|
|
14
|
+
*
|
|
15
|
+
* See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
|
|
16
|
+
*/
|
|
11
17
|
const _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');
|
|
12
18
|
export { _RadioGroup as RadioGroup };
|
|
13
|
-
// Make sure that radio buttons are spaced by 16px when stacked
|
|
14
|
-
function
|
|
15
|
-
if (typeof
|
|
16
|
-
const gap = { xs:
|
|
17
|
-
Object.entries(
|
|
18
|
-
gap[curr[0]] = curr[1] ? 16 :
|
|
19
|
+
// Make sure that radio buttons are spaced by 16px when stacked horizontally, and 8px otherwise.
|
|
20
|
+
function getGapFromDirection(direction) {
|
|
21
|
+
if (typeof direction === 'object') {
|
|
22
|
+
const gap = { xs: direction.xs === 'horizontal' ? 16 : 8 };
|
|
23
|
+
Object.entries(direction).reduce((acc, curr) => {
|
|
24
|
+
gap[curr[0]] = curr[1] === 'horizontal' ? 16 : 8;
|
|
19
25
|
return acc;
|
|
20
26
|
}, gap);
|
|
21
27
|
return gap;
|
|
22
28
|
}
|
|
23
|
-
return
|
|
29
|
+
return direction === 'horizontal' ? 16 : 8;
|
|
24
30
|
}
|
|
25
31
|
//# sourceMappingURL=radio-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,IAAI,aAAa,EAA8C,MAAM,uBAAuB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAC5G,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAoBlD,SAAS,UAAU,CACjB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,GAAG,UAAU,EACtB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAiC;IAEjC,OAAO,CACL,MAAC,aAAa,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAC3G,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,YAAG,KAAK,GAAkB,EACtE,KAAC,KAAK,IAAC,GAAG,EAAE,mBAAmB,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,YAC7D,QAAQ,GACH,EACR,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC5C,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC;AAErC,gGAAgG;AAChG,SAAS,mBAAmB,CAAC,SAAgC;IAC3D,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,GAAG,GAAwB,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/E,MAAM,CAAC,OAAO,CAAC,SAAS,CAA+B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5E,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { RadioGroup as RACRadioGroup, type RadioGroupProps as RACRadioGroupProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport { Stack } from '../spacing/stack/stack.js';\nimport type { Breakpoint, Responsive, Spacing } from '../spacing/types.js';\nimport type { Direction, CommonProps, FieldProps, WithRequired } from '../types.js';\n\nexport interface RadioGroupProps\n extends CommonProps,\n WithRequired<FieldProps<string | null>, 'label'>,\n Pick<\n RACRadioGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n > {\n /** Radio buttons belonging to the group. */\n children: ReactNode;\n /**\n * Determines the direction in which radio buttons will be stacked.\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n}\n\nfunction RadioGroup(\n {\n label,\n description,\n error: errorMessage,\n direction = 'vertical',\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACRadioGroup {...props} ref={ref} className={clsx('cim-radio-group', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <Stack gap={getGapFromDirection(direction)} direction={direction}>\n {children}\n </Stack>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACRadioGroup>\n );\n}\n\n/**\n * Allows users to select a single item from a visible list.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');\n\nexport { _RadioGroup as RadioGroup };\n\n// Make sure that radio buttons are spaced by 16px when stacked horizontally, and 8px otherwise.\nfunction getGapFromDirection(direction: Responsive<Direction>): Responsive<Spacing> {\n if (typeof direction === 'object') {\n const gap: Responsive<Spacing> = { xs: direction.xs === 'horizontal' ? 16 : 8 };\n\n (Object.entries(direction) as [Breakpoint, Direction][]).reduce((acc, curr) => {\n gap[curr[0]] = curr[1] === 'horizontal' ? 16 : 8;\n return acc;\n }, gap);\n\n return gap;\n }\n\n return direction === 'horizontal' ? 16 : 8;\n}\n"]}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type RadioProps as RACRadioProps } from 'react-aria-components';
|
|
2
|
-
import type {
|
|
3
|
-
export interface RadioProps extends
|
|
2
|
+
import type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';
|
|
3
|
+
export interface RadioProps extends CommonProps, Omit<LabellableProps, 'label'>, Pick<RACRadioProps, 'value' | 'isDisabled'> {
|
|
4
4
|
/** The label rendered next to the radio. */
|
|
5
|
-
children?:
|
|
5
|
+
children?: StringLikeChildren;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Renders a single option within `RadioGroup`.
|
|
9
|
+
*
|
|
10
|
+
* See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
|
|
11
|
+
*/
|
|
12
|
+
declare const _Radio: (props: RadioProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
8
13
|
export { _Radio as Radio };
|
|
9
14
|
//# sourceMappingURL=radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpF,MAAM,WAAW,UACf,SAAQ,WAAW,EACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY,CAAC;IAC7C,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AA8BD;;;;GAIG;AACH,QAAA,MAAM,MAAM,8JAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { useEffect } from 'react';
|
|
@@ -14,6 +15,11 @@ function Radio({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
|
14
15
|
}, [children, ariaLabel, ariaLabelledBy]);
|
|
15
16
|
return (_jsxs(RACRadio, { ...props, className: clsx('cim-radio', UNSAFE_className), style: UNSAFE_style, ref: ref, children: [_jsx("div", { className: "cim-radio-toggle-wrapper", children: _jsx("div", { className: "cim-radio-toggle", children: _jsx("div", { className: "cim-radio-toggle-inner" }) }) }), children && (_jsx(Text, { as: "span", variant: "body", children: children }))] }));
|
|
16
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders a single option within `RadioGroup`.
|
|
20
|
+
*
|
|
21
|
+
* See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
|
|
22
|
+
*/
|
|
17
23
|
const _Radio = withStyleProps(forwardRef(Radio), 'Radio');
|
|
18
24
|
export { _Radio as Radio };
|
|
19
25
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAoC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,MAAC,QAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,kBAAkB,YAC/B,cAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface SelectOption {
|
|
5
|
-
/** The unique id of the item. When integrated with a form, this will be the value of the option. */
|
|
6
|
-
id: string;
|
|
7
|
-
/** The content to display as the label of the option. */
|
|
8
|
-
label: string;
|
|
9
|
-
/** Whether the option is disabled. */
|
|
10
|
-
isDisabled?: boolean;
|
|
1
|
+
import { type ListBoxProps as RACListBoxProps, type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
|
|
2
|
+
import type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
|
|
3
|
+
export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
|
|
11
4
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Allows users to select one item from a collapsible list.
|
|
7
|
+
*
|
|
8
|
+
* See [select usage guidelines](https://ui.cimpress.io/components/select/).
|
|
9
|
+
*/
|
|
10
|
+
declare const _Select: <T extends CollectionItem>(props: SelectProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
11
|
+
export { _Select as Select };
|
|
12
|
+
export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
|
|
13
|
+
children: StringLikeChildren;
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
/** Renders a single list item within `Select`. */
|
|
16
|
+
export declare function SelectItem({ children, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace SelectItem {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {
|
|
21
|
+
/** The ID of the section. Has to be unique across all sections and items. */
|
|
22
|
+
id?: Key;
|
|
23
|
+
/** The content to display as the section title. */
|
|
24
|
+
title: string;
|
|
25
|
+
}
|
|
26
|
+
/** Groups list items within `Select` into a section. */
|
|
27
|
+
export declare function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace SelectSection {
|
|
29
|
+
var displayName: string;
|
|
25
30
|
}
|
|
26
|
-
declare const _Select: (props: SelectProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
|
|
27
|
-
export { _Select as Select };
|
|
28
31
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,IAAI,eAAe,EAMpC,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGrH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACpE,SAAQ,WAAW,EACjB,UAAU,CAAC,GAAG,CAAC,EACf,eAAe,CAAC,CAAC,CAAC,EAClB,IAAI,CACF,cAAc,CAAC,CAAC,CAAC,EACf,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,aAAa,GACb,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,mBAAmB,GACnB,aAAa,GACb,SAAS,GACT,QAAQ,GACR,cAAc,CACjB,EACD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;CAAG;AA6C3C;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAhDG,CAAC,SAAS,cAAc,+JAgDoB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACtF,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBjE;yB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