@cimpress-ui/react 0.0.0 → 0.0.1
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 +1 -1
- 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 +11 -5
- 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 +24 -14
- 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 +8 -5
- package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
- package/dist/commonjs/components/spinner/spinner.js +23 -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 +67 -11
- 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 +4 -3
- package/dist/commonjs/components/typography/link.d.ts.map +1 -1
- package/dist/commonjs/components/typography/link.js +6 -1
- package/dist/commonjs/components/typography/link.js.map +1 -1
- package/dist/commonjs/components/typography/text.d.ts +3 -2
- package/dist/commonjs/components/typography/text.d.ts.map +1 -1
- package/dist/commonjs/components/typography/text.js +3 -0
- package/dist/commonjs/components/typography/text.js.map +1 -1
- package/dist/commonjs/components/typography/types.d.ts +3 -2
- 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/add.d.ts +3 -2
- package/dist/commonjs/icons/add.d.ts.map +1 -1
- package/dist/commonjs/icons/add.js +16 -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 +16 -2
- package/dist/commonjs/icons/alert-triangle.js.map +1 -1
- 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 +21 -0
- package/dist/commonjs/icons/checkmark-circle-fill.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 +16 -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 +21 -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 +21 -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 +21 -0
- package/dist/commonjs/icons/error-circle-fill.js.map +1 -0
- package/dist/commonjs/icons/index.d.ts +5 -0
- package/dist/commonjs/icons/index.d.ts.map +1 -1
- package/dist/commonjs/icons/index.js +9 -1
- package/dist/commonjs/icons/index.js.map +1 -1
- 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 +16 -2
- package/dist/commonjs/icons/minus-small.js.map +1 -1
- 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 +11 -5
- 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 +24 -14
- 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 +8 -5
- package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner/spinner.js +25 -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 +67 -11
- 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 +4 -3
- package/dist/esm/components/typography/link.d.ts.map +1 -1
- package/dist/esm/components/typography/link.js +7 -2
- package/dist/esm/components/typography/link.js.map +1 -1
- package/dist/esm/components/typography/text.d.ts +3 -2
- package/dist/esm/components/typography/text.d.ts.map +1 -1
- package/dist/esm/components/typography/text.js +3 -0
- package/dist/esm/components/typography/text.js.map +1 -1
- package/dist/esm/components/typography/types.d.ts +3 -2
- 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/add.d.ts +3 -2
- package/dist/esm/icons/add.d.ts.map +1 -1
- package/dist/esm/icons/add.js +14 -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 +13 -2
- package/dist/esm/icons/alert-triangle.js.map +1 -1
- 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 +16 -0
- package/dist/esm/icons/checkmark-circle-fill.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 +13 -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 +16 -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 +16 -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 +16 -0
- package/dist/esm/icons/error-circle-fill.js.map +1 -0
- package/dist/esm/icons/index.d.ts +5 -0
- package/dist/esm/icons/index.d.ts.map +1 -1
- package/dist/esm/icons/index.js +4 -0
- package/dist/esm/icons/index.js.map +1 -1
- 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 +13 -2
- package/dist/esm/icons/minus-small.js.map +1 -1
- 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 +74 -29
- package/LICENSE +0 -201
- 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
|
@@ -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 usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).
|
|
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 usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).\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 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'> {
|
|
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/usage-guidelines/).
|
|
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'> {
|
|
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,EAUL,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,CAChB;CAAG;AA6CR;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAhDG,CAAC,SAAS,cAAc,+JAgDoB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACrF,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBjE;yBAjBe,UAAU;;;AAqB1B,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACtF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAelH;yBAfe,aAAa"}
|
|
@@ -1,28 +1,45 @@
|
|
|
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
|
-
import {
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { Button as RACButton, Collection as RACCollection, Header as RACHeader, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxSection as RACListBoxSection, Select as RACSelect, SelectValue as RACSelectValue, Text as RACText, } from 'react-aria-components';
|
|
4
6
|
import { forwardRef } from '../../forward-ref.js';
|
|
7
|
+
import { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';
|
|
5
8
|
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
-
import {
|
|
9
|
+
import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
|
|
10
|
+
import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
|
|
7
11
|
import { textStyle } from '../typography/utils.js';
|
|
8
|
-
function Select({ label, description, error,
|
|
9
|
-
|
|
12
|
+
function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
13
|
+
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
16
|
+
console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');
|
|
17
|
+
}
|
|
18
|
+
}, [label, ariaLabel, ariaLabelledBy]);
|
|
19
|
+
if (items != null && typeof children !== 'function') {
|
|
20
|
+
console.warn('`Select` requires `children` to be a function when using `items` prop');
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", items: items, children: children }) })] }));
|
|
10
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Allows users to select one item from a collapsible list.
|
|
26
|
+
*
|
|
27
|
+
* See [select usage guidelines](https://ui.cimpress.io/components/select/usage-guidelines/).
|
|
28
|
+
*/
|
|
11
29
|
const _Select = withStyleProps(forwardRef(Select), 'Select');
|
|
12
30
|
export { _Select as Select };
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return (_jsx(SelectItem, { id: item.id, isDisabled: item.isDisabled, children: item.label }));
|
|
18
|
-
}
|
|
19
|
-
function SelectItem({ children, ...props }) {
|
|
20
|
-
return (_jsx(RACListBoxItem, { ...props, className: clsx('cim-select-item', textStyle({ variant: 'medium' })), children: children }));
|
|
31
|
+
/** Renders a single list item within `Select`. */
|
|
32
|
+
export function SelectItem({ children, ...props }) {
|
|
33
|
+
const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
|
|
34
|
+
return (_jsx(RACListBoxItem, { ...props, className: "cim-select-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(IconCheckmark, {}), _jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
|
|
21
35
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
SelectItem.displayName = 'SelectItem';
|
|
37
|
+
/** Groups list items within `Select` into a section. */
|
|
38
|
+
export function SelectSection({ title, children, items, ...props }) {
|
|
39
|
+
if (items != null && typeof children !== 'function') {
|
|
40
|
+
console.warn('`SelectSection` requires `children` to be a function when using `items` prop');
|
|
41
|
+
}
|
|
42
|
+
return (_jsxs(RACListBoxSection, { ...props, className: "cim-select-section", children: [_jsx(RACHeader, { className: clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
|
|
27
43
|
}
|
|
44
|
+
SelectSection.displayName = 'SelectSection';
|
|
28
45
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,UAAU,EACrB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,MAAM,IAAI,SAAS,EACnB,WAAW,IAAI,cAAc,EAC7B,IAAI,IAAI,OAAO,GAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAoBnD,SAAS,MAAM,CACb,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAkB,EACxG,GAAiC;IAEjC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;QAChG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,CACL,MAAC,SAAS,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAClG,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,MAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,aACtC,KAAC,cAAc,IACb,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,YAEzG,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,YAAY,GACpB,EACjB,KAAC,mBAAmB,KAAG,IACb,EACZ,KAAC,cAAc,cAAE,KAAK,GAAkB,EACxC,KAAC,oBAAoB,cAAE,WAAW,GAAwB,EAC1D,KAAC,eAAe,IACd,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,GAAG,YAEd,KAAC,UAAU,IAAC,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,KAAK,YACpD,QAAQ,GACE,GACG,IACR,CACb,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAM7B,kDAAkD;AAClD,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAChE,MAAM,SAAS,GACb,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhH,OAAO,CACL,KAAC,cAAc,OAAK,KAAK,EAAE,SAAS,EAAC,iBAAiB,EAAC,SAAS,EAAE,SAAS,YACxE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACnB,8BACE,KAAC,aAAa,KAAG,EAEjB,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,IACT,CACJ,GACc,CAClB,CAAC;AACJ,CAAC;AAED,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAStC,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAyB;IACjH,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n > {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select 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('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDownFill />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/usage-guidelines/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckmark />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends 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 `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export interface BoxProps extends
|
|
2
|
+
import type { CommonProps } from '../../types.js';
|
|
3
|
+
export interface BoxProps extends CommonProps {
|
|
4
|
+
/** The contents of the box. */
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
+
/** A primitive layout component that exposes style props. */
|
|
8
|
+
declare const _Box: (props: BoxProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
7
9
|
export { _Box as Box };
|
|
8
10
|
//# sourceMappingURL=box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C,+BAA+B;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD,6DAA6D;AAC7D,QAAA,MAAM,IAAI,6JAAyC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { forwardRef } from '../../../forward-ref.js';
|
|
3
4
|
import { withStyleProps } from '../../../with-style-props.js';
|
|
4
5
|
function Box({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
5
6
|
return (_jsx("div", { ...props, ref: ref, className: UNSAFE_className, style: UNSAFE_style, role: "presentation", children: children }));
|
|
6
7
|
}
|
|
8
|
+
/** A primitive layout component that exposes style props. */
|
|
7
9
|
const _Box = withStyleProps(forwardRef(Box), 'Box');
|
|
8
10
|
export { _Box as Box };
|
|
9
11
|
//# sourceMappingURL=box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQ9D,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAY,EAAE,GAAiC;IAC9G,OAAO,CACL,iBAAS,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAC,cAAc,YAC5F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC","sourcesContent":["'use client';\n\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { CommonProps } from '../../types.js';\n\nexport interface BoxProps extends CommonProps {\n /** The contents of the box. */\n children: ReactNode;\n}\n\nfunction Box({ children, UNSAFE_className, UNSAFE_style, ...props }: BoxProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <div {...props} ref={ref} className={UNSAFE_className} style={UNSAFE_style} role=\"presentation\">\n {children}\n </div>\n );\n}\n\n/** A primitive layout component that exposes style props. */\nconst _Box = withStyleProps(forwardRef(Box), 'Box');\n\nexport { _Box as Box };\n"]}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Direction, CommonProps } from '../../types.js';
|
|
3
3
|
import { type Responsive, type Spacing } from '../types.js';
|
|
4
|
-
export
|
|
4
|
+
export type Alignment = 'start' | 'center' | 'end' | 'stretch';
|
|
5
|
+
export type Justify = 'start' | 'center' | 'end' | 'space-around' | 'space-between' | 'space-evenly';
|
|
6
|
+
export interface StackProps extends CommonProps {
|
|
7
|
+
/** The items to stack. */
|
|
5
8
|
children: ReactNode;
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Determines the stacking direction (ie. which direction is the primary axis)
|
|
11
|
+
* @default 'vertical'
|
|
12
|
+
*/
|
|
13
|
+
direction?: Responsive<Direction>;
|
|
14
|
+
/** The amount of space between items. */
|
|
7
15
|
gap: Responsive<Spacing>;
|
|
16
|
+
/**
|
|
17
|
+
* Determines how items are distributed along the primary axis.
|
|
18
|
+
* @default 'start'
|
|
19
|
+
*/
|
|
20
|
+
justify?: Responsive<Justify>;
|
|
21
|
+
/**
|
|
22
|
+
* Determines how each item is aligned along the cross axis.
|
|
23
|
+
* @default 'stretch'
|
|
24
|
+
*/
|
|
25
|
+
align?: Responsive<Alignment>;
|
|
26
|
+
/**
|
|
27
|
+
* Determines whether items will wrap to a new line if stack size is too small.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
wrap?: Responsive<boolean>;
|
|
8
31
|
}
|
|
9
|
-
|
|
32
|
+
/** Stacks its children with a specified amount of space between them. */
|
|
33
|
+
declare const _Stack: (props: StackProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
10
34
|
export { _Stack as Stack };
|
|
11
35
|
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAC/D,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,CAAC;AAErG,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAClC,yCAAyC;IACzC,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC5B;AA0CD,yEAAyE;AACzE,QAAA,MAAM,MAAM,+JAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { forwardRef } from '../../../forward-ref.js';
|
|
4
5
|
import { withStyleProps } from '../../../with-style-props.js';
|
|
5
6
|
import { getResponsiveVariables } from '../types.js';
|
|
6
|
-
function Stack({ children,
|
|
7
|
+
function Stack({ children, direction: responsiveDirection, gap: responsiveGap, justify: responsiveJustify, align: responsiveAlign, wrap: responsiveWrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
7
8
|
const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);
|
|
8
|
-
const
|
|
9
|
+
const direction = getResponsiveVariables('stack-fd', 'stack-direction', responsiveDirection, 'vertical');
|
|
10
|
+
const justify = getResponsiveVariables('stack-jc', 'stack-justify', responsiveJustify, 'start');
|
|
11
|
+
const align = getResponsiveVariables('stack-ai', 'stack-align', responsiveAlign, 'stretch');
|
|
12
|
+
const wrap = getResponsiveVariables('stack-fw', 'stack-wrap', responsiveWrap, true);
|
|
9
13
|
return (_jsx("div", { ...props, ref: ref, className: clsx('cim-stack', UNSAFE_className), style: {
|
|
10
14
|
...UNSAFE_style,
|
|
11
15
|
...gap,
|
|
12
|
-
...
|
|
16
|
+
...direction,
|
|
17
|
+
...justify,
|
|
18
|
+
...align,
|
|
19
|
+
...wrap,
|
|
13
20
|
}, role: "presentation", children: children }));
|
|
14
21
|
}
|
|
22
|
+
/** Stacks its children with a specified amount of space between them. */
|
|
15
23
|
const _Stack = withStyleProps(forwardRef(Stack), 'Stack');
|
|
16
24
|
export { _Stack as Stack };
|
|
17
25
|
//# sourceMappingURL=stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAiC,MAAM,aAAa,CAAC;AAgCpF,SAAS,KAAK,CACZ,EACE,QAAQ,EACR,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACG,EACb,GAAiC;IAEjC,MAAM,GAAG,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;IACzG,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAChG,MAAM,KAAK,GAAG,sBAAsB,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAC5F,MAAM,IAAI,GAAG,sBAAsB,CAAC,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAEpF,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAC9C,KAAK,EAAE;YACL,GAAG,YAAY;YACf,GAAG,GAAG;YACN,GAAG,SAAS;YACZ,GAAG,OAAO;YACV,GAAG,KAAK;YACR,GAAG,IAAI;SACR,EACD,IAAI,EAAC,cAAc,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,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 type { ReactNode, ForwardedRef } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { Direction, CommonProps } from '../../types.js';\nimport { getResponsiveVariables, type Responsive, type Spacing } from '../types.js';\n\nexport type Alignment = 'start' | 'center' | 'end' | 'stretch';\nexport type Justify = 'start' | 'center' | 'end' | 'space-around' | 'space-between' | 'space-evenly';\n\nexport interface StackProps extends CommonProps {\n /** The items to stack. */\n children: ReactNode;\n /**\n * Determines the stacking direction (ie. which direction is the primary axis)\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n /** The amount of space between items. */\n gap: Responsive<Spacing>;\n /**\n * Determines how items are distributed along the primary axis.\n * @default 'start'\n */\n justify?: Responsive<Justify>;\n /**\n * Determines how each item is aligned along the cross axis.\n * @default 'stretch'\n */\n align?: Responsive<Alignment>;\n /**\n * Determines whether items will wrap to a new line if stack size is too small.\n * @default true\n */\n wrap?: Responsive<boolean>;\n}\n\nfunction Stack(\n {\n children,\n direction: responsiveDirection,\n gap: responsiveGap,\n justify: responsiveJustify,\n align: responsiveAlign,\n wrap: responsiveWrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: StackProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);\n const direction = getResponsiveVariables('stack-fd', 'stack-direction', responsiveDirection, 'vertical');\n const justify = getResponsiveVariables('stack-jc', 'stack-justify', responsiveJustify, 'start');\n const align = getResponsiveVariables('stack-ai', 'stack-align', responsiveAlign, 'stretch');\n const wrap = getResponsiveVariables('stack-fw', 'stack-wrap', responsiveWrap, true);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-stack', UNSAFE_className)}\n style={{\n ...UNSAFE_style,\n ...gap,\n ...direction,\n ...justify,\n ...align,\n ...wrap,\n }}\n role=\"presentation\"\n >\n {children}\n </div>\n );\n}\n\n/** Stacks its children with a specified amount of space between them. */\nconst _Stack = withStyleProps(forwardRef(Stack), 'Stack');\n\nexport { _Stack as Stack };\n"]}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/** Represents a valid spacing amount within the design system. */
|
|
1
2
|
export type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;
|
|
3
|
+
/** Represents a screen size breakpoint for responsive design. */
|
|
2
4
|
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
/** Represents a primitive value that can change based on screen size. */
|
|
3
6
|
export type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;
|
|
4
7
|
/**
|
|
5
8
|
* Given params like so:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
6
11
|
* (
|
|
7
12
|
* 'box-ml',
|
|
8
13
|
* 'space',
|
|
@@ -11,12 +16,16 @@ export type Responsive<T extends string | number | boolean> = T | Partial<Record
|
|
|
11
16
|
* lg: 6,
|
|
12
17
|
* }
|
|
13
18
|
* )
|
|
19
|
+
* ```
|
|
14
20
|
*
|
|
15
21
|
* Creates an object like so:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
16
24
|
* {
|
|
17
25
|
* '--cim-box-ml-sm': 'var(--cim-space-4)',
|
|
18
26
|
* '--cim-box-ml-lg': 'var(--cim-space-6)',
|
|
19
27
|
* }
|
|
28
|
+
* ```
|
|
20
29
|
*
|
|
21
30
|
*/
|
|
22
31
|
export declare function getResponsiveVariables<T extends string | number | boolean>(targetTokenGroup: string, sourceTokenGroup: string, data?: Responsive<T>, defaultValue?: T): Record<string, string> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5E,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,yEAAyE;AACzE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EACxE,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAqBpC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Given params like so:
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
3
5
|
* (
|
|
4
6
|
* 'box-ml',
|
|
5
7
|
* 'space',
|
|
@@ -8,12 +10,16 @@
|
|
|
8
10
|
* lg: 6,
|
|
9
11
|
* }
|
|
10
12
|
* )
|
|
13
|
+
* ```
|
|
11
14
|
*
|
|
12
15
|
* Creates an object like so:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
13
18
|
* {
|
|
14
19
|
* '--cim-box-ml-sm': 'var(--cim-space-4)',
|
|
15
20
|
* '--cim-box-ml-lg': 'var(--cim-space-6)',
|
|
16
21
|
* }
|
|
22
|
+
* ```
|
|
17
23
|
*
|
|
18
24
|
*/
|
|
19
25
|
export function getResponsiveVariables(targetTokenGroup, sourceTokenGroup, data, defaultValue) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAwB,EACxB,gBAAwB,EACxB,IAAoB,EACpB,YAAgB;IAEhB,IAAI,IAAI,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO;YACL,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,IAAI,IAAI,YAAY,GAAG;SAC3F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAA2B;QACrC,8DAA8D;QAC9D,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,YAAY,GAAG;KACnF,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,MAAM,CAAC,SAAS,gBAAgB,IAAI,UAAU,EAAE,CAAC,GAAG,aAAa,gBAAgB,IAAI,KAAK,GAAG,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/** Represents a valid spacing amount within the design system. */\nexport type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;\n\n/** Represents a screen size breakpoint for responsive design. */\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Represents a primitive value that can change based on screen size. */\nexport type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;\n\n/**\n * Given params like so:\n *\n * ```ts\n * (\n * 'box-ml',\n * 'space',\n * {\n * sm: 4,\n * lg: 6,\n * }\n * )\n * ```\n *\n * Creates an object like so:\n *\n * ```ts\n * {\n * '--cim-box-ml-sm': 'var(--cim-space-4)',\n * '--cim-box-ml-lg': 'var(--cim-space-6)',\n * }\n * ```\n *\n */\nexport function getResponsiveVariables<T extends string | number | boolean>(\n targetTokenGroup: string,\n sourceTokenGroup: string,\n data?: Responsive<T>,\n defaultValue?: T,\n): Record<string, string> | undefined {\n if (data === undefined && defaultValue === undefined) {\n return undefined;\n }\n\n if (typeof data !== 'object') {\n return {\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${data ?? defaultValue})`,\n };\n }\n\n const result: Record<string, string> = {\n // Default value in case the smallest breakpoint isn't defined\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${defaultValue})`,\n };\n\n Object.entries(data).forEach(([breakpoint, value]) => {\n result[`--cim-${targetTokenGroup}-${breakpoint}`] = `var(--cim-${sourceTokenGroup}-${value})`;\n });\n\n return result;\n}\n"]}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
interface SpinnerProps extends
|
|
1
|
+
import type { CommonProps, LabellableProps } from '../types.js';
|
|
2
|
+
export interface SpinnerProps extends CommonProps, LabellableProps {
|
|
3
|
+
/**
|
|
4
|
+
* Determines the size of the spinner.
|
|
5
|
+
* @default 'medium'
|
|
6
|
+
*/
|
|
3
7
|
size?: 'small' | 'medium' | 'large';
|
|
4
|
-
/** A string value that identifies the spinner's purpose for assistive technologies. */
|
|
5
|
-
'aria-label': string;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
/** Displays a loading indicator to represent an ongoing operation. */
|
|
10
|
+
declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
8
11
|
export { _Spinner as Spinner };
|
|
9
12
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AA+BD,sEAAsE;AACtE,QAAA,MAAM,QAAQ,8JAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { Label as RACLabel } from 'react-aria-components';
|
|
4
5
|
import { forwardRef } from '../../forward-ref.js';
|
|
5
6
|
import { withStyleProps } from '../../with-style-props.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import { InternalSpinner } from '../internal/spinner/spinner.js';
|
|
8
|
+
import { textStyle } from '../typography/utils.js';
|
|
9
|
+
const ringSizes = {
|
|
10
|
+
small: '24px',
|
|
11
|
+
medium: '48px',
|
|
12
|
+
large: '80px',
|
|
10
13
|
};
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const labelVariants = {
|
|
15
|
+
small: 'small',
|
|
16
|
+
medium: 'medium',
|
|
17
|
+
large: 'body',
|
|
18
|
+
};
|
|
19
|
+
function Spinner({ size = 'medium', label, ...props }, ref) {
|
|
20
|
+
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
23
|
+
console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');
|
|
24
|
+
}
|
|
25
|
+
}, [label, ariaLabel, ariaLabelledBy]);
|
|
26
|
+
return (_jsx(InternalSpinner, { ...props, size: ringSizes[size], spinnerRef: ref, children: label && _jsx(RACLabel, { className: textStyle({ variant: labelVariants[size], tone: 'title' }), children: label }) }));
|
|
17
27
|
}
|
|
28
|
+
// TODO: add link to usage guidelines
|
|
29
|
+
/** Displays a loading indicator to represent an ongoing operation. */
|
|
18
30
|
const _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');
|
|
19
31
|
export { _Spinner as Spinner };
|
|
20
32
|
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUnD,MAAM,SAAS,GAAsD;IACnE,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,aAAa,GAA2E;IAC5F,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,SAAS,OAAO,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB,EAAE,GAAiC;IACpG,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;QACjG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,OAAO,CACL,KAAC,eAAe,OAAK,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,YAC/D,KAAK,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,YAAG,KAAK,GAAY,GAC7F,CACnB,CAAC;AACJ,CAAC;AAED,qCAAqC;AACrC,sEAAsE;AACtE,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Label as RACLabel } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { InternalSpinner } from '../internal/spinner/spinner.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\nimport type { TextStyleOptions } from '../typography/types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SpinnerProps extends CommonProps, LabellableProps {\n /**\n * Determines the size of the spinner.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n}\n\nconst ringSizes: Record<NonNullable<SpinnerProps['size']>, string> = {\n small: '24px',\n medium: '48px',\n large: '80px',\n};\n\nconst labelVariants: Record<NonNullable<SpinnerProps['size']>, TextStyleOptions['variant']> = {\n small: 'small',\n medium: 'medium',\n large: 'body',\n};\n\nfunction Spinner({ size = 'medium', label, ...props }: SpinnerProps, ref: ForwardedRef<HTMLDivElement>) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <InternalSpinner {...props} size={ringSizes[size]} spinnerRef={ref}>\n {label && <RACLabel className={textStyle({ variant: labelVariants[size], tone: 'title' })}>{label}</RACLabel>}\n </InternalSpinner>\n );\n}\n\n// TODO: add link to usage guidelines\n/** Displays a loading indicator to represent an ongoing operation. */\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type TextAreaProps as RACTextAreaProps, type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
|
|
2
|
-
import type {
|
|
3
|
-
export interface TextAreaProps extends
|
|
2
|
+
import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
|
|
3
|
+
export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
/** Allows users to enter multiple lines of text with a keyboard. */
|
|
6
|
+
declare const _TextArea: (props: TextAreaProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
|
|
6
7
|
export { _TextArea as TextArea };
|
|
7
8
|
//# sourceMappingURL=text-area.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,CACd,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAgDhG,oEAAoE;AACpE,QAAA,MAAM,SAAS,+JAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
|