@cimpress-ui/react 1.1.0 → 1.3.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/dist/commonjs/components/checkbox/checkbox-group.d.ts +2 -2
- package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js +8 -1
- package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.d.ts +2 -2
- package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/commonjs/components/combo-box/combo-box.js +9 -5
- package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
- package/dist/commonjs/components/drawer/drawer.d.ts +19 -18
- package/dist/commonjs/components/drawer/drawer.d.ts.map +1 -1
- package/dist/commonjs/components/drawer/drawer.js +16 -21
- package/dist/commonjs/components/drawer/drawer.js.map +1 -1
- package/dist/commonjs/components/file-trigger.d.ts +6 -0
- package/dist/commonjs/components/file-trigger.d.ts.map +1 -0
- package/dist/commonjs/components/file-trigger.js +18 -0
- package/dist/commonjs/components/file-trigger.js.map +1 -0
- package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts +2 -1
- package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/commonjs/components/modal-dialog/modal-dialog.js +1 -1
- package/dist/commonjs/components/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/commonjs/components/radio/radio-group.d.ts +2 -2
- package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -1
- package/dist/commonjs/components/radio/radio-group.js +8 -1
- package/dist/commonjs/components/radio/radio-group.js.map +1 -1
- package/dist/commonjs/components/select/select.d.ts +2 -2
- package/dist/commonjs/components/select/select.d.ts.map +1 -1
- package/dist/commonjs/components/select/select.js +9 -5
- package/dist/commonjs/components/select/select.js.map +1 -1
- package/dist/commonjs/components/toast/toast-queue.d.ts +39 -0
- package/dist/commonjs/components/toast/toast-queue.d.ts.map +1 -0
- package/dist/commonjs/components/toast/toast-queue.js +53 -0
- package/dist/commonjs/components/toast/toast-queue.js.map +1 -0
- package/dist/commonjs/components/toast/toast-region.d.ts +5 -3
- package/dist/commonjs/components/toast/toast-region.d.ts.map +1 -1
- package/dist/commonjs/components/toast/toast-region.js +7 -15
- package/dist/commonjs/components/toast/toast-region.js.map +1 -1
- package/dist/commonjs/components/toast/toast.js +1 -1
- package/dist/commonjs/components/toast/toast.js.map +1 -1
- package/dist/commonjs/components/toast/types.d.ts +10 -2
- package/dist/commonjs/components/toast/types.d.ts.map +1 -1
- package/dist/commonjs/components/toast/types.js.map +1 -1
- package/dist/commonjs/components/types.d.ts +7 -0
- package/dist/commonjs/components/types.d.ts.map +1 -1
- package/dist/commonjs/components/types.js.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/en-US.js +1 -0
- package/dist/commonjs/i18n/messages/en-US.js.map +1 -1
- package/dist/commonjs/i18n/messages/types.d.ts +6 -0
- package/dist/commonjs/i18n/messages/types.d.ts.map +1 -1
- package/dist/commonjs/i18n/messages/types.js.map +1 -1
- package/dist/commonjs/icons/category-apparel.d.ts.map +1 -1
- package/dist/commonjs/icons/category-apparel.js +1 -1
- package/dist/commonjs/icons/category-apparel.js.map +1 -1
- package/dist/commonjs/icons/clock-user.d.ts +8 -0
- package/dist/commonjs/icons/clock-user.d.ts.map +1 -0
- package/dist/commonjs/icons/clock-user.js +24 -0
- package/dist/commonjs/icons/clock-user.js.map +1 -0
- package/dist/commonjs/icons/external-link.d.ts +8 -0
- package/dist/commonjs/icons/external-link.d.ts.map +1 -0
- package/dist/commonjs/icons/external-link.js +24 -0
- package/dist/commonjs/icons/external-link.js.map +1 -0
- package/dist/commonjs/icons/file-design.d.ts +8 -0
- package/dist/commonjs/icons/file-design.d.ts.map +1 -0
- package/dist/commonjs/icons/file-design.js +24 -0
- package/dist/commonjs/icons/file-design.js.map +1 -0
- package/dist/commonjs/icons/index.d.ts +11 -0
- package/dist/commonjs/icons/index.d.ts.map +1 -1
- package/dist/commonjs/icons/index.js +24 -2
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/icons/invoice.d.ts +8 -0
- package/dist/commonjs/icons/invoice.d.ts.map +1 -0
- package/dist/commonjs/icons/invoice.js +24 -0
- package/dist/commonjs/icons/invoice.js.map +1 -0
- package/dist/commonjs/icons/print.d.ts +8 -0
- package/dist/commonjs/icons/print.d.ts.map +1 -0
- package/dist/commonjs/icons/print.js +24 -0
- package/dist/commonjs/icons/print.js.map +1 -0
- package/dist/commonjs/icons/refresh.d.ts +8 -0
- package/dist/commonjs/icons/refresh.d.ts.map +1 -0
- package/dist/commonjs/icons/refresh.js +24 -0
- package/dist/commonjs/icons/refresh.js.map +1 -0
- package/dist/commonjs/icons/share-alt.d.ts +8 -0
- package/dist/commonjs/icons/share-alt.d.ts.map +1 -0
- package/dist/commonjs/icons/share-alt.js +24 -0
- package/dist/commonjs/icons/share-alt.js.map +1 -0
- package/dist/commonjs/icons/share.d.ts +8 -0
- package/dist/commonjs/icons/share.d.ts.map +1 -0
- package/dist/commonjs/icons/share.js +24 -0
- package/dist/commonjs/icons/share.js.map +1 -0
- package/dist/commonjs/icons/style-color.d.ts +8 -0
- package/dist/commonjs/icons/style-color.d.ts.map +1 -0
- package/dist/commonjs/icons/style-color.js +24 -0
- package/dist/commonjs/icons/style-color.js.map +1 -0
- package/dist/commonjs/icons/style-embroidery.d.ts +8 -0
- package/dist/commonjs/icons/style-embroidery.d.ts.map +1 -0
- package/dist/commonjs/icons/style-embroidery.js +24 -0
- package/dist/commonjs/icons/style-embroidery.js.map +1 -0
- package/dist/commonjs/icons/style-monochrome.d.ts +8 -0
- package/dist/commonjs/icons/style-monochrome.d.ts.map +1 -0
- package/dist/commonjs/icons/style-monochrome.js +24 -0
- package/dist/commonjs/icons/style-monochrome.js.map +1 -0
- package/dist/commonjs/index.d.ts +3 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +4 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.d.ts +2 -2
- package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -1
- package/dist/esm/components/checkbox/checkbox-group.js +8 -1
- package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
- package/dist/esm/components/combo-box/combo-box.d.ts +2 -2
- package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
- package/dist/esm/components/combo-box/combo-box.js +7 -3
- package/dist/esm/components/combo-box/combo-box.js.map +1 -1
- package/dist/esm/components/drawer/drawer.d.ts +19 -18
- package/dist/esm/components/drawer/drawer.d.ts.map +1 -1
- package/dist/esm/components/drawer/drawer.js +12 -17
- package/dist/esm/components/drawer/drawer.js.map +1 -1
- package/dist/esm/components/file-trigger.d.ts +6 -0
- package/dist/esm/components/file-trigger.d.ts.map +1 -0
- package/dist/esm/components/file-trigger.js +15 -0
- package/dist/esm/components/file-trigger.js.map +1 -0
- package/dist/esm/components/modal-dialog/modal-dialog.d.ts +2 -1
- package/dist/esm/components/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/esm/components/modal-dialog/modal-dialog.js +1 -1
- package/dist/esm/components/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/esm/components/radio/radio-group.d.ts +2 -2
- package/dist/esm/components/radio/radio-group.d.ts.map +1 -1
- package/dist/esm/components/radio/radio-group.js +8 -1
- package/dist/esm/components/radio/radio-group.js.map +1 -1
- package/dist/esm/components/select/select.d.ts +2 -2
- package/dist/esm/components/select/select.d.ts.map +1 -1
- package/dist/esm/components/select/select.js +7 -3
- package/dist/esm/components/select/select.js.map +1 -1
- package/dist/esm/components/toast/toast-queue.d.ts +39 -0
- package/dist/esm/components/toast/toast-queue.d.ts.map +1 -0
- package/dist/esm/components/toast/toast-queue.js +50 -0
- package/dist/esm/components/toast/toast-queue.js.map +1 -0
- package/dist/esm/components/toast/toast-region.d.ts +5 -3
- package/dist/esm/components/toast/toast-region.d.ts.map +1 -1
- package/dist/esm/components/toast/toast-region.js +8 -15
- package/dist/esm/components/toast/toast-region.js.map +1 -1
- package/dist/esm/components/toast/toast.js +1 -1
- package/dist/esm/components/toast/toast.js.map +1 -1
- package/dist/esm/components/toast/types.d.ts +10 -2
- package/dist/esm/components/toast/types.d.ts.map +1 -1
- package/dist/esm/components/toast/types.js.map +1 -1
- package/dist/esm/components/types.d.ts +7 -0
- package/dist/esm/components/types.d.ts.map +1 -1
- package/dist/esm/components/types.js.map +1 -1
- package/dist/esm/i18n/messages/en-US.d.ts.map +1 -1
- package/dist/esm/i18n/messages/en-US.js +1 -0
- package/dist/esm/i18n/messages/en-US.js.map +1 -1
- package/dist/esm/i18n/messages/types.d.ts +6 -0
- package/dist/esm/i18n/messages/types.d.ts.map +1 -1
- package/dist/esm/i18n/messages/types.js.map +1 -1
- package/dist/esm/icons/category-apparel.d.ts.map +1 -1
- package/dist/esm/icons/category-apparel.js +1 -1
- package/dist/esm/icons/category-apparel.js.map +1 -1
- package/dist/esm/icons/clock-user.d.ts +8 -0
- package/dist/esm/icons/clock-user.d.ts.map +1 -0
- package/dist/esm/icons/clock-user.js +19 -0
- package/dist/esm/icons/clock-user.js.map +1 -0
- package/dist/esm/icons/external-link.d.ts +8 -0
- package/dist/esm/icons/external-link.d.ts.map +1 -0
- package/dist/esm/icons/external-link.js +19 -0
- package/dist/esm/icons/external-link.js.map +1 -0
- package/dist/esm/icons/file-design.d.ts +8 -0
- package/dist/esm/icons/file-design.d.ts.map +1 -0
- package/dist/esm/icons/file-design.js +19 -0
- package/dist/esm/icons/file-design.js.map +1 -0
- package/dist/esm/icons/index.d.ts +11 -0
- package/dist/esm/icons/index.d.ts.map +1 -1
- package/dist/esm/icons/index.js +11 -0
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/icons/invoice.d.ts +8 -0
- package/dist/esm/icons/invoice.d.ts.map +1 -0
- package/dist/esm/icons/invoice.js +19 -0
- package/dist/esm/icons/invoice.js.map +1 -0
- package/dist/esm/icons/print.d.ts +8 -0
- package/dist/esm/icons/print.d.ts.map +1 -0
- package/dist/esm/icons/print.js +19 -0
- package/dist/esm/icons/print.js.map +1 -0
- package/dist/esm/icons/refresh.d.ts +8 -0
- package/dist/esm/icons/refresh.d.ts.map +1 -0
- package/dist/esm/icons/refresh.js +19 -0
- package/dist/esm/icons/refresh.js.map +1 -0
- package/dist/esm/icons/share-alt.d.ts +8 -0
- package/dist/esm/icons/share-alt.d.ts.map +1 -0
- package/dist/esm/icons/share-alt.js +19 -0
- package/dist/esm/icons/share-alt.js.map +1 -0
- package/dist/esm/icons/share.d.ts +8 -0
- package/dist/esm/icons/share.d.ts.map +1 -0
- package/dist/esm/icons/share.js +19 -0
- package/dist/esm/icons/share.js.map +1 -0
- package/dist/esm/icons/style-color.d.ts +8 -0
- package/dist/esm/icons/style-color.d.ts.map +1 -0
- package/dist/esm/icons/style-color.js +19 -0
- package/dist/esm/icons/style-color.js.map +1 -0
- package/dist/esm/icons/style-embroidery.d.ts +8 -0
- package/dist/esm/icons/style-embroidery.d.ts.map +1 -0
- package/dist/esm/icons/style-embroidery.js +19 -0
- package/dist/esm/icons/style-embroidery.js.map +1 -0
- package/dist/esm/icons/style-monochrome.d.ts +8 -0
- package/dist/esm/icons/style-monochrome.d.ts.map +1 -0
- package/dist/esm/icons/style-monochrome.js +19 -0
- package/dist/esm/icons/style-monochrome.js.map +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist-styles/core.css +1 -1
- package/dist-styles/styles.css +1 -1
- package/package.json +1 -1
|
@@ -9,11 +9,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
9
|
const clsx_1 = __importDefault(require("clsx"));
|
|
10
10
|
const react_aria_components_1 = require("react-aria-components");
|
|
11
11
|
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
12
|
+
const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
|
|
12
13
|
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
13
14
|
const form_field_js_1 = require("../internal/form-field/form-field.js");
|
|
14
15
|
const stack_js_1 = require("../spacing/stack/stack.js");
|
|
15
16
|
function RadioGroup({ label, description, error: errorMessage, direction = 'vertical', children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
|
|
16
|
-
|
|
17
|
+
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
18
|
+
(0, use_production_warning_js_1.useProductionWarning)(() => {
|
|
19
|
+
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
20
|
+
console.warn('RadioGroup requires one of label / aria-label / aria-labelledby for accessibility');
|
|
21
|
+
}
|
|
22
|
+
}, [label, ariaLabel, ariaLabelledBy]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.RadioGroup, { ...props, ref: ref, className: (0, clsx_1.default)('cim-radio-group', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsx)(stack_js_1.Stack, { gap: getGapFromDirection(direction), direction: direction, wrap: true, children: children }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description })] }));
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* Allows users to select a single item from a visible list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAAgH;AAChH,yDAAkD;AAClD,mEAA2D;AAC3D,wEAA4G;AAC5G,wDAAkD;AAoBlD,SAAS,UAAU,CACjB,EACE,KAA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,aAC3G,uBAAC,8BAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,uBAAC,gBAAK,IAAC,GAAG,EAAE,mBAAmB,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,kBACnE,QAAQ,GACH,EACR,uBAAC,8BAAc,cAAE,YAAY,GAAkB,EAC/C,uBAAC,oCAAoB,cAAE,WAAW,GAAwB,IAC5C,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEjD,iCAAU;AAElC,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 { useProductionWarning } from '../../utils/use-production-warning.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 } from '../types.js';\n\nexport interface RadioGroupProps\n extends CommonProps,\n FieldProps<string | null>,\n Pick<\n RACRadioGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue'\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 const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('RadioGroup requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadioGroup {...props} ref={ref} className={clsx('cim-radio-group', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <Stack gap={getGapFromDirection(direction)} direction={direction} wrap>\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> = { sm: direction.sm === '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,6 +1,6 @@
|
|
|
1
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>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
|
|
2
|
+
import type { AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
|
|
3
|
+
export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, AsyncItemLoadingProps, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
|
|
4
4
|
/**
|
|
5
5
|
* Whether the list of options should be virtualized. Use this as a performance optimization for large lists.
|
|
6
6
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,IAAI,eAAe,EASpC,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EAEnC,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAWrB,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACpE,SAAQ,WAAW,EACjB,UAAU,CAAC,GAAG,CAAC,EACf,eAAe,CAAC,CAAC,CAAC,EAClB,qBAAqB,EACrB,IAAI,CACF,cAAc,CAAC,CAAC,CAAC,EACf,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;IACtC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA+ED;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAlFG,CAAC,SAAS,cAAc,+JAkFoB,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,2CAA2C;IAC3C,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"}
|
|
@@ -11,20 +11,23 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
11
11
|
const clsx_1 = __importDefault(require("clsx"));
|
|
12
12
|
const react_aria_components_1 = require("react-aria-components");
|
|
13
13
|
const forward_ref_js_1 = require("../../forward-ref.js");
|
|
14
|
-
const index_js_1 = require("../../
|
|
14
|
+
const index_js_1 = require("../../i18n/index.js");
|
|
15
|
+
const index_js_2 = require("../../icons/index.js");
|
|
15
16
|
const is_production_js_1 = require("../../utils/is-production.js");
|
|
16
17
|
const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
|
|
17
18
|
const with_style_props_js_1 = require("../../with-style-props.js");
|
|
18
19
|
const collapsible_list_js_1 = require("../internal/collapsible-list/collapsible-list.js");
|
|
19
20
|
const form_field_js_1 = require("../internal/form-field/form-field.js");
|
|
21
|
+
const spinner_js_1 = require("../spinner/spinner.js");
|
|
20
22
|
const utils_js_1 = require("../typography/utils.js");
|
|
21
23
|
const VIRTUAL_LAYOUT_OPTIONS = {
|
|
22
24
|
rowHeight: 40,
|
|
23
25
|
headingHeight: 32,
|
|
26
|
+
loaderHeight: 40,
|
|
24
27
|
padding: 0,
|
|
25
28
|
gap: 0,
|
|
26
29
|
};
|
|
27
|
-
function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, isVirtualized = false, ...props }, ref) {
|
|
30
|
+
function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, isVirtualized = false, UNSTABLE_isLoading: isLoading, UNSTABLE_onLoadMore: onLoadMore, ...props }, ref) {
|
|
28
31
|
const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
|
|
29
32
|
(0, use_production_warning_js_1.useProductionWarning)(() => {
|
|
30
33
|
if (!label && !ariaLabel && !ariaLabelledBy) {
|
|
@@ -34,8 +37,9 @@ function Select({ children, items, label, description, error, UNSAFE_className,
|
|
|
34
37
|
if (!(0, is_production_js_1.isProduction)() && items != null && typeof children !== 'function') {
|
|
35
38
|
console.warn('`Select` requires `children` to be a function when using `items` prop');
|
|
36
39
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
40
|
+
const collectionMessages = (0, index_js_1.useLocalizedMessages)('UNSTABLE_collection');
|
|
41
|
+
const listBox = ((0, jsx_runtime_1.jsxs)(react_aria_components_1.ListBox, { className: "cim-select-listbox", onScroll: onScroll, renderEmptyState: () => isLoading ? (0, jsx_runtime_1.jsx)(spinner_js_1.Spinner, { "aria-label": collectionMessages.format('loading'), size: "small", marginY: 8 }) : null, children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children }), (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxLoadMoreItem, { onLoadMore: onLoadMore, isLoading: isLoading, children: (0, jsx_runtime_1.jsx)(spinner_js_1.Spinner, { "aria-label": collectionMessages.format('loadingMore'), size: "small", marginY: 8 }) })] }));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'body', alignment: 'start' })), children: ({ selectedText }) => selectedText }), (0, jsx_runtime_1.jsx)(index_js_2.IconChevronDown, {})] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Virtualizer, { layout: react_aria_components_1.ListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Allows users to select one item from a collapsible list.
|
|
@@ -47,7 +51,7 @@ exports.Select = _Select;
|
|
|
47
51
|
/** Renders a single list item within `Select`. */
|
|
48
52
|
function SelectItem({ children, ...props }) {
|
|
49
53
|
const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: "cim-select-item", textValue: textValue, children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: "cim-select-item", textValue: textValue, children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(index_js_2.IconCheck, {}), (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "label", className: (0, utils_js_1.textStyle)({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
|
|
51
55
|
}
|
|
52
56
|
SelectItem.displayName = 'SelectItem';
|
|
53
57
|
/** Groups list items within `Select` into a section. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AAiJb,gCAiBC;AAYD,sCAeC;;AA3LD,gDAAwB;AAExB,iEAgB+B;AAC/B,yDAAkD;AAClD,mDAAkE;AAClE,mEAA4D;AAC5D,qFAA6E;AAC7E,mEAA2D;AAC3D,0FAAmF;AACnF,wEAA4G;AAE5G,qDAAmD;AAEnD,MAAM,sBAAsB,GAAyB;IACnD,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,CAAC;IACV,GAAG,EAAE,CAAC;CACP,CAAC;AA6BF,SAAS,MAAM,CACb,EACE,QAAQ,EACR,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,GAAG,KAAK,EACO,EACjB,GAAiC;IAEjC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,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,CAAC,IAAA,+BAAY,GAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC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I,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,uBAAC,kCAAa,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 type { ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.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\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 40,\n headingHeight: 32,\n padding: 0,\n gap: 0,\n};\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n}\n\nfunction Select<T extends CollectionItem>(\n {\n children,\n items,\n label,\n description,\n error,\n UNSAFE_className,\n UNSAFE_style,\n onScroll,\n isVirtualized = false,\n ...props\n }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n const listBox = (\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\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: 'body', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\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 {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\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/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The content to display as the label. */\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 <IconCheck />\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 (!isProduction() && 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
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AA2Kb,gCAiBC;AAYD,sCAeC;;AArND,gDAAwB;AAExB,iEAiB+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAAkE;AAClE,mEAA4D;AAC5D,qFAA6E;AAC7E,mEAA2D;AAC3D,0FAA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OAAO,CACL,wBAAC,sCAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,uBAAC,8BAAS,IACR,SAAS,EAAE,IAAA,cAAI,EAAC,2BAA2B,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,uBAAC,kCAAa,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 type { ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxLoadMoreItem as RACListBoxLoadMoreItem,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.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 { Spinner } from '../spinner/spinner.js';\nimport type {\n AsyncItemLoadingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 40,\n headingHeight: 32,\n loaderHeight: 40,\n padding: 0,\n gap: 0,\n};\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n AsyncItemLoadingProps,\n Pick<\n RACSelectProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n}\n\nfunction Select<T extends CollectionItem>(\n {\n children,\n items,\n label,\n description,\n error,\n UNSAFE_className,\n UNSAFE_style,\n onScroll,\n isVirtualized = false,\n UNSTABLE_isLoading: isLoading,\n UNSTABLE_onLoadMore: onLoadMore,\n ...props\n }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n const collectionMessages = useLocalizedMessages('UNSTABLE_collection');\n\n const listBox = (\n <RACListBox\n className=\"cim-select-listbox\"\n onScroll={onScroll}\n renderEmptyState={() =>\n isLoading ? <Spinner aria-label={collectionMessages.format('loading')} size=\"small\" marginY={8} /> : null\n }\n >\n <RACCollection items={items}>{children}</RACCollection>\n <RACListBoxLoadMoreItem onLoadMore={onLoadMore} isLoading={isLoading}>\n <Spinner aria-label={collectionMessages.format('loadingMore')} size=\"small\" marginY={8} />\n </RACListBoxLoadMoreItem>\n </RACListBox>\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: 'body', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\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 {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\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/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The content to display as the label. */\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 <IconCheck />\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 (!isProduction() && 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"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UNSTABLE_ToastQueue as RACToastQueue } from 'react-aria-components';
|
|
2
|
+
import type { InternalToastContent, UNSTABLE_ToastOptions } from './types.js';
|
|
3
|
+
export declare const internalToastQueue: RACToastQueue<InternalToastContent>;
|
|
4
|
+
/**
|
|
5
|
+
* Manages the queue of toasts.
|
|
6
|
+
*/
|
|
7
|
+
export interface UNSTABLE_ToastQueue {
|
|
8
|
+
/**
|
|
9
|
+
* Add an info toast to the queue.
|
|
10
|
+
* @returns The ID of the toast
|
|
11
|
+
*/
|
|
12
|
+
info(message: string, options?: UNSTABLE_ToastOptions): string;
|
|
13
|
+
/**
|
|
14
|
+
* Add a success toast to the queue.
|
|
15
|
+
* @returns The ID of the toast
|
|
16
|
+
*/
|
|
17
|
+
success(message: string, options?: UNSTABLE_ToastOptions): string;
|
|
18
|
+
/**
|
|
19
|
+
* Add a warning toast to the queue.
|
|
20
|
+
* @returns The ID of the toast
|
|
21
|
+
*/
|
|
22
|
+
warning(message: string, options?: UNSTABLE_ToastOptions): string;
|
|
23
|
+
/**
|
|
24
|
+
* Add a critical toast to the queue.
|
|
25
|
+
* @returns The ID of the toast
|
|
26
|
+
*/
|
|
27
|
+
critical(message: string, options?: UNSTABLE_ToastOptions): string;
|
|
28
|
+
/**
|
|
29
|
+
* Close a toast.
|
|
30
|
+
* @param id The ID of the toast to close
|
|
31
|
+
*/
|
|
32
|
+
close(id: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Clear the queue.
|
|
35
|
+
*/
|
|
36
|
+
clear(): void;
|
|
37
|
+
}
|
|
38
|
+
export declare const UNSTABLE_toastQueue: UNSTABLE_ToastQueue;
|
|
39
|
+
//# sourceMappingURL=toast-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-queue.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/toast-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAwC,MAAM,uBAAuB,CAAC;AAEnH,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAM9E,eAAO,MAAM,kBAAkB,qCAU7B,CAAC;AAEH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IAClE;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IAClE;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAAC;IACnE;;;OAGG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,mBAAmB,EAAE,mBA2CjC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNSTABLE_toastQueue = exports.internalToastQueue = void 0;
|
|
4
|
+
const react_aria_components_1 = require("react-aria-components");
|
|
5
|
+
const react_dom_1 = require("react-dom");
|
|
6
|
+
const DEFAULT_TOAST_OPTIONS = {
|
|
7
|
+
timeout: 5000,
|
|
8
|
+
};
|
|
9
|
+
exports.internalToastQueue = new react_aria_components_1.UNSTABLE_ToastQueue({
|
|
10
|
+
wrapUpdate(fn) {
|
|
11
|
+
if ('startViewTransition' in document) {
|
|
12
|
+
document.startViewTransition(() => {
|
|
13
|
+
(0, react_dom_1.flushSync)(fn);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
fn();
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
exports.UNSTABLE_toastQueue = {
|
|
22
|
+
info(message, options) {
|
|
23
|
+
return exports.internalToastQueue.add({
|
|
24
|
+
message: message,
|
|
25
|
+
tone: 'info',
|
|
26
|
+
}, { ...DEFAULT_TOAST_OPTIONS, ...options });
|
|
27
|
+
},
|
|
28
|
+
success(message, options) {
|
|
29
|
+
return exports.internalToastQueue.add({
|
|
30
|
+
message: message,
|
|
31
|
+
tone: 'success',
|
|
32
|
+
}, { ...DEFAULT_TOAST_OPTIONS, ...options });
|
|
33
|
+
},
|
|
34
|
+
warning(message, options) {
|
|
35
|
+
return exports.internalToastQueue.add({
|
|
36
|
+
message: message,
|
|
37
|
+
tone: 'warning',
|
|
38
|
+
}, { ...DEFAULT_TOAST_OPTIONS, ...options });
|
|
39
|
+
},
|
|
40
|
+
critical(message, options) {
|
|
41
|
+
return exports.internalToastQueue.add({
|
|
42
|
+
message: message,
|
|
43
|
+
tone: 'critical',
|
|
44
|
+
}, { ...DEFAULT_TOAST_OPTIONS, ...options });
|
|
45
|
+
},
|
|
46
|
+
close(id) {
|
|
47
|
+
exports.internalToastQueue.close(id);
|
|
48
|
+
},
|
|
49
|
+
clear() {
|
|
50
|
+
exports.internalToastQueue.clear();
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=toast-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-queue.js","sourceRoot":"","sources":["../../../../src/components/toast/toast-queue.ts"],"names":[],"mappings":";;;AAAA,iEAAmH;AACnH,yCAAsC;AAGtC,MAAM,qBAAqB,GAAoB;IAC7C,OAAO,EAAE,IAAI;CACd,CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAI,2CAAa,CAAuB;IACxE,UAAU,CAAC,EAAE;QACX,IAAI,qBAAqB,IAAI,QAAQ,EAAE,CAAC;YACtC,QAAQ,CAAC,mBAAmB,CAAC,GAAG,EAAE;gBAChC,IAAA,qBAAS,EAAC,EAAE,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,EAAE,EAAE,CAAC;QACP,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAqCU,QAAA,mBAAmB,GAAwB;IACtD,IAAI,CAAC,OAAe,EAAE,OAA+B;QACnD,OAAO,0BAAkB,CAAC,GAAG,CAC3B;YACE,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,MAAM;SACb,EACD,EAAE,GAAG,qBAAqB,EAAE,GAAG,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,OAAe,EAAE,OAA+B;QACtD,OAAO,0BAAkB,CAAC,GAAG,CAC3B;YACE,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,SAAS;SAChB,EACD,EAAE,GAAG,qBAAqB,EAAE,GAAG,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,OAAe,EAAE,OAA+B;QACtD,OAAO,0BAAkB,CAAC,GAAG,CAC3B;YACE,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,SAAS;SAChB,EACD,EAAE,GAAG,qBAAqB,EAAE,GAAG,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IACD,QAAQ,CAAC,OAAe,EAAE,OAA+B;QACvD,OAAO,0BAAkB,CAAC,GAAG,CAC3B;YACE,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,UAAU;SACjB,EACD,EAAE,GAAG,qBAAqB,EAAE,GAAG,OAAO,EAAE,CACzC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,EAAU;QACd,0BAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK;QACH,0BAAkB,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACF,CAAC","sourcesContent":["import { UNSTABLE_ToastQueue as RACToastQueue, type ToastOptions as RACToastOptions } from 'react-aria-components';\nimport { flushSync } from 'react-dom';\nimport type { InternalToastContent, UNSTABLE_ToastOptions } from './types.js';\n\nconst DEFAULT_TOAST_OPTIONS: RACToastOptions = {\n timeout: 5000,\n};\n\nexport const internalToastQueue = new RACToastQueue<InternalToastContent>({\n wrapUpdate(fn) {\n if ('startViewTransition' in document) {\n document.startViewTransition(() => {\n flushSync(fn);\n });\n } else {\n fn();\n }\n },\n});\n\n/**\n * Manages the queue of toasts.\n */\nexport interface UNSTABLE_ToastQueue {\n /**\n * Add an info toast to the queue.\n * @returns The ID of the toast\n */\n info(message: string, options?: UNSTABLE_ToastOptions): string;\n /**\n * Add a success toast to the queue.\n * @returns The ID of the toast\n */\n success(message: string, options?: UNSTABLE_ToastOptions): string;\n /**\n * Add a warning toast to the queue.\n * @returns The ID of the toast\n */\n warning(message: string, options?: UNSTABLE_ToastOptions): string;\n /**\n * Add a critical toast to the queue.\n * @returns The ID of the toast\n */\n critical(message: string, options?: UNSTABLE_ToastOptions): string;\n /**\n * Close a toast.\n * @param id The ID of the toast to close\n */\n close(id: string): void;\n /**\n * Clear the queue.\n */\n clear(): void;\n}\n\nexport const UNSTABLE_toastQueue: UNSTABLE_ToastQueue = {\n info(message: string, options?: UNSTABLE_ToastOptions) {\n return internalToastQueue.add(\n {\n message: message,\n tone: 'info',\n },\n { ...DEFAULT_TOAST_OPTIONS, ...options },\n );\n },\n success(message: string, options?: UNSTABLE_ToastOptions) {\n return internalToastQueue.add(\n {\n message: message,\n tone: 'success',\n },\n { ...DEFAULT_TOAST_OPTIONS, ...options },\n );\n },\n warning(message: string, options?: UNSTABLE_ToastOptions) {\n return internalToastQueue.add(\n {\n message: message,\n tone: 'warning',\n },\n { ...DEFAULT_TOAST_OPTIONS, ...options },\n );\n },\n critical(message: string, options?: UNSTABLE_ToastOptions) {\n return internalToastQueue.add(\n {\n message: message,\n tone: 'critical',\n },\n { ...DEFAULT_TOAST_OPTIONS, ...options },\n );\n },\n close(id: string) {\n internalToastQueue.close(id);\n },\n clear() {\n internalToastQueue.clear();\n },\n};\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Displays toast notifications. Toast notifications are non-intrusive messages that appear briefly at the top of the page, overlaying content.
|
|
3
|
+
*
|
|
4
|
+
* See [toast usage guidelines](https://ui.cimpress.io/components/toast/).
|
|
5
|
+
*/
|
|
4
6
|
export declare function UNSTABLE_ToastRegion(): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
//# sourceMappingURL=toast-region.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-region.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/toast-region.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast-region.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/toast-region.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,oBAAoB,4CAMnC"}
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UNSTABLE_toastQueue = void 0;
|
|
4
3
|
exports.UNSTABLE_ToastRegion = UNSTABLE_ToastRegion;
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
5
|
const react_aria_components_1 = require("react-aria-components");
|
|
7
|
-
const
|
|
6
|
+
const toast_queue_js_1 = require("./toast-queue.js");
|
|
8
7
|
const toast_js_1 = require("./toast.js");
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
fn();
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
});
|
|
8
|
+
/**
|
|
9
|
+
* Displays toast notifications. Toast notifications are non-intrusive messages that appear briefly at the top of the page, overlaying content.
|
|
10
|
+
*
|
|
11
|
+
* See [toast usage guidelines](https://ui.cimpress.io/components/toast/).
|
|
12
|
+
*/
|
|
21
13
|
function UNSTABLE_ToastRegion() {
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.UNSTABLE_ToastRegion, { queue:
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(react_aria_components_1.UNSTABLE_ToastRegion, { queue: toast_queue_js_1.internalToastQueue, className: "cim-toast-region", "data-cim-style-root": true, children: ({ toast }) => (0, jsx_runtime_1.jsx)(toast_js_1.UNSTABLE_Toast, { toast: toast }) }));
|
|
23
15
|
}
|
|
24
16
|
//# sourceMappingURL=toast-region.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-region.js","sourceRoot":"","sources":["../../../../src/components/toast/toast-region.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast-region.js","sourceRoot":"","sources":["../../../../src/components/toast/toast-region.tsx"],"names":[],"mappings":";;AASA,oDAMC;;AAfD,iEAA+E;AAC/E,qDAAsD;AACtD,yCAA4C;AAE5C;;;;GAIG;AACH,SAAgB,oBAAoB;IAClC,OAAO,CACL,uBAAC,4CAAc,IAAC,KAAK,EAAE,mCAAkB,EAAE,SAAS,EAAC,kBAAkB,yCACpE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,uBAAC,yBAAc,IAAC,KAAK,EAAE,KAAK,GAAI,GACjC,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { UNSTABLE_ToastRegion as RACToastRegion } from 'react-aria-components';\nimport { internalToastQueue } from './toast-queue.js';\nimport { UNSTABLE_Toast } from './toast.js';\n\n/**\n * Displays toast notifications. Toast notifications are non-intrusive messages that appear briefly at the top of the page, overlaying content.\n *\n * See [toast usage guidelines](https://ui.cimpress.io/components/toast/).\n */\nexport function UNSTABLE_ToastRegion() {\n return (\n <RACToastRegion queue={internalToastQueue} className=\"cim-toast-region\" data-cim-style-root>\n {({ toast }) => <UNSTABLE_Toast toast={toast} />}\n </RACToastRegion>\n );\n}\n"]}
|
|
@@ -19,6 +19,6 @@ const iconMap = {
|
|
|
19
19
|
function UNSTABLE_Toast({ toast }) {
|
|
20
20
|
const Icon = iconMap[toast.content.tone];
|
|
21
21
|
const messages = (0, index_js_1.useLocalizedMessages)('common');
|
|
22
|
-
return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.UNSTABLE_Toast, { toast: toast, className: "cim-toast", style: { viewTransitionName: toast.key }, "data-cim-style-root": true, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-toast-icon", children: (0, jsx_runtime_1.jsx)(Icon, { size: 24, tone: toast.content.tone, "aria-hidden": true }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.UNSTABLE_ToastContent, { className: "cim-toast-content", children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { className: (0, utils_js_1.textStyle)({ variant: 'medium' }), children: toast.content.
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.UNSTABLE_Toast, { toast: toast, className: "cim-toast", style: { viewTransitionName: toast.key }, "data-cim-style-root": true, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-toast-icon", children: (0, jsx_runtime_1.jsx)(Icon, { size: 24, tone: toast.content.tone, "aria-hidden": true }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.UNSTABLE_ToastContent, { className: "cim-toast-content", children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { className: (0, utils_js_1.textStyle)({ variant: 'medium' }), children: toast.content.message }) }), (0, jsx_runtime_1.jsx)(x_button_js_1.XButton, { slot: "close", UNSAFE_className: "cim-toast-close", "aria-label": messages.format('dismiss') })] }));
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../../src/components/toast/toast.tsx"],"names":[],"mappings":";;AA6BA,wCAeC;;AA5CD,iEAK+B;AAC/B,kDAA2D;AAC3D,mDAA2G;AAC3G,kEAA2D;AAC3D,qDAAmD;AAGnD,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,yBAAc;IACpB,OAAO,EAAE,0BAAe;IACxB,OAAO,EAAE,sBAAW;IACpB,QAAQ,EAAE,gCAAqB;CAChC,CAAC;AASF;;GAEG;AACH,SAAgB,cAAc,CAAC,EAAE,KAAK,EAAuB;IAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO,CACL,wBAAC,sCAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,KAAK,CAAC,GAAG,EAAE,0CACpF,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,wBAAgB,GACpD,EACN,uBAAC,6CAAe,IAAC,SAAS,EAAC,mBAAmB,YAC5C,uBAAC,4BAAO,IAAC,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAG,KAAK,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../../src/components/toast/toast.tsx"],"names":[],"mappings":";;AA6BA,wCAeC;;AA5CD,iEAK+B;AAC/B,kDAA2D;AAC3D,mDAA2G;AAC3G,kEAA2D;AAC3D,qDAAmD;AAGnD,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,yBAAc;IACpB,OAAO,EAAE,0BAAe;IACxB,OAAO,EAAE,sBAAW;IACpB,QAAQ,EAAE,gCAAqB;CAChC,CAAC;AASF;;GAEG;AACH,SAAgB,cAAc,CAAC,EAAE,KAAK,EAAuB;IAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO,CACL,wBAAC,sCAAQ,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,KAAK,CAAC,GAAG,EAAE,0CACpF,gCAAK,SAAS,EAAC,gBAAgB,YAC7B,uBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,wBAAgB,GACpD,EACN,uBAAC,6CAAe,IAAC,SAAS,EAAC,mBAAmB,YAC5C,uBAAC,4BAAO,IAAC,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,YAAG,KAAK,CAAC,OAAO,CAAC,OAAO,GAAW,GACvE,EAClB,uBAAC,qBAAO,IAAC,IAAI,EAAC,OAAO,EAAC,gBAAgB,EAAC,iBAAiB,gBAAa,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,GAAI,IAC1F,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import {\n type QueuedToast as RACQueuedToast,\n Text as RACText,\n UNSTABLE_Toast as RACToast,\n UNSTABLE_ToastContent as RACToastContent,\n} from 'react-aria-components';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheckCircle, IconInfoCircle, IconWarning, IconWarningCircleFill } from '../../icons/index.js';\nimport { XButton } from '../internal/x-button/x-button.js';\nimport { textStyle } from '../typography/utils.js';\nimport type { InternalToastContent } from './types.js';\n\nconst iconMap = {\n info: IconInfoCircle,\n success: IconCheckCircle,\n warning: IconWarning,\n critical: IconWarningCircleFill,\n};\n\n/**\n * @internal\n */\ninterface UNSTABLE_ToastProps {\n toast: RACQueuedToast<InternalToastContent>;\n}\n\n/**\n * @internal\n */\nexport function UNSTABLE_Toast({ toast }: UNSTABLE_ToastProps) {\n const Icon = iconMap[toast.content.tone];\n const messages = useLocalizedMessages('common');\n\n return (\n <RACToast toast={toast} className=\"cim-toast\" style={{ viewTransitionName: toast.key }} data-cim-style-root>\n <div className=\"cim-toast-icon\">\n <Icon size={24} tone={toast.content.tone} aria-hidden />\n </div>\n <RACToastContent className=\"cim-toast-content\">\n <RACText className={textStyle({ variant: 'medium' })}>{toast.content.message}</RACText>\n </RACToastContent>\n <XButton slot=\"close\" UNSAFE_className=\"cim-toast-close\" aria-label={messages.format('dismiss')} />\n </RACToast>\n );\n}\n"]}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
|
|
1
|
+
export interface InternalToastContent {
|
|
2
|
+
message: string;
|
|
3
3
|
tone: 'info' | 'success' | 'warning' | 'critical';
|
|
4
4
|
}
|
|
5
|
+
export interface UNSTABLE_ToastOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The timeout to automatically close the toast after, in milliseconds.
|
|
8
|
+
* Setting this to `0` will prevent the toast from automatically closing.
|
|
9
|
+
* @default 5000
|
|
10
|
+
*/
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}
|
|
5
13
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;CACnD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface InternalToastContent {\n message: string;\n tone: 'info' | 'success' | 'warning' | 'critical';\n}\n\nexport interface UNSTABLE_ToastOptions {\n /**\n * The timeout to automatically close the toast after, in milliseconds.\n * Setting this to `0` will prevent the toast from automatically closing.\n * @default 5000\n */\n timeout?: number;\n}\n"]}
|
|
@@ -152,6 +152,13 @@ export interface CollectionProps<T extends CollectionItem> {
|
|
|
152
152
|
/** The items to display in the collection. */
|
|
153
153
|
items?: Iterable<T>;
|
|
154
154
|
}
|
|
155
|
+
/** Props available on components that support asynchronous loading of items. */
|
|
156
|
+
export interface AsyncItemLoadingProps {
|
|
157
|
+
/** Whether items are currently being loaded. */
|
|
158
|
+
UNSTABLE_isLoading?: boolean;
|
|
159
|
+
/** A callback function that is called when more items should be loaded. */
|
|
160
|
+
UNSTABLE_onLoadMore?: () => void;
|
|
161
|
+
}
|
|
155
162
|
/** Props available on icons. */
|
|
156
163
|
export interface IconProps extends CommonProps, Pick<AriaLabelingProps, 'aria-label' | 'aria-labelledby'> {
|
|
157
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SAAS,CAAC,CAAC;IAChD,8CAA8C;IAC9C,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACrB;AAED,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2EAA2E;IAC3E,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,gCAAgC;AAChC,MAAM,WAAW,SAAU,SAAQ,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,iBAAiB,CAAC;IACvG;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sCAAsC;IACtC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACpB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAClF,CAAC,QAAQ,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { focusSafely } from '@react-aria/focus';\nimport type { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport type {\n ButtonProps as RACButtonProps,\n LinkProps as RACLinkProps,\n PressEvent as RACPressEvent,\n ValidationResult as RACValidationResult,\n} from 'react-aria-components';\nimport type { ForegroundTone } from '../utils/style/types.js';\n\n/** Represents an identifier for a collection item. */\nexport type Key = string | number;\n\n/** Represents a selection of items in a collection. */\nexport type Selection = 'all' | Set<Key>;\n\n/** Represents a direction (vertical or horizontal). */\nexport type Direction = 'vertical' | 'horizontal';\n\n/**\n * Use this type when you want to restrict `children` to a string,\n * but also want to allow expressions that resolve to strings.\n */\nexport type StringLikeChildren = string | number | (string | number)[];\n\n// `FocusableElement` is not exported from any React Aria package\n/** Any focusable element, including both HTML and SVG elements. */\nexport type FocusableElement = Parameters<typeof focusSafely>[0];\n\n/**\n * A set of common props that are allowed on every component\n */\nexport interface CommonProps {\n /**\n * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n */\n id?: string;\n /**\n * Use this attribute to \"claim\" the component tree for exclusive Cimpress UI usage.\n */\n 'data-cim-style-root'?: boolean;\n /**\n * Sets the CSS className for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_className?: string;\n /**\n * Sets the CSS style for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_style?: CSSProperties;\n}\n\n/**\n * An event fired when a component is pressed.\n *\n * By default, press events stop propagation to parent elements.\n * In cases where a handler decides not to handle a specific event,\n * it can call `continuePropagation()` to allow a parent to handle it.\n */\nexport type PressEvent = RACPressEvent;\n\n// HoverEvent is not exported from react-aria-components\n/** An event fired when a component is hovered. */\nexport type HoverEvent = Parameters<NonNullable<RACButtonProps['onHoverStart']>>[0];\n\n/**\n * Props for components that require a label, which can be hidden if necessary.\n */\nexport interface LabellableProps extends AriaLabelingProps {\n /** The content to display as the label. */\n label?: string;\n}\n\n// Copied from AriaLabelingProps from @react-types/shared\nexport interface AriaLabelingProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string;\n\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string;\n\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string;\n\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string;\n}\n\n/** Provides details about the validation state of a form field. */\nexport type ValidationResult = RACValidationResult;\n\n/** Represents the error message(s) for a form field. */\nexport type FieldError =\n | string\n | string[]\n | undefined\n | ((validation: ValidationResult) => string | string[] | undefined);\n\n/** Props available on form field components. */\nexport interface FieldProps<T> extends LabellableProps {\n /**\n * The `<form>` element to associate the input with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).\n */\n form?: string;\n /**\n * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name).\n */\n name?: string;\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: string;\n /** An error message for the field. */\n error?: FieldError;\n /**\n * A function that returns an error message (or `true`) if a given value is invalid.\n * Validation errors are displayed to the user when the form is submitted.\n * For real-time validation, use the `error` prop instead.\n */\n validate?: (value: T) => string | string[] | true | undefined;\n}\n\n/** Props available on form field components with text inputs. */\nexport interface FieldWithPlaceholderProps<T> extends FieldProps<T> {\n /** The placeholder text displayed in the input field. */\n placeholder?: string;\n}\n\n/** Changes specified optional properties within the provided type to be required. */\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\n/**\n * This interface allows configuring navigation props with router options and type-safe URLs via TypeScript module augmentation.\n * By default, this is an empty interface. Extend with `href` and `routerOptions` properties to configure your router.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RouterConfig {}\n\n/**\n * Represents a URL for navigation components.\n * This type can be configured by augmenting `RouterConfig` with an `href` property.\n */\nexport type Href = RouterConfig extends { href: infer H } ? H : string;\n\n/**\n * Represents router options for navigation components.\n * This type can be configured by augmenting `RouterConfig` with a `routerOptions` property.\n */\nexport type RouterOptions = RouterConfig extends { routerOptions: infer O } ? O : never;\n\n/**\n * Props available on components that perform navigation.\n */\nexport interface NavigationProps\n extends Pick<RACLinkProps, 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy'> {\n /** A URL to link to. */\n href?: Href;\n /** Options for the configured client side router. */\n routerOptions?: RouterOptions;\n}\n\n/** Represents a minimal data shape of a dynamic item in collection components. */\nexport interface CollectionItem {\n /** Unique identifier for the item or group. */\n id: Key;\n}\n\n/** Props available on components that render collections. */\nexport interface CollectionProps<T extends CollectionItem> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode);\n /** The items to display in the collection. */\n items?: Iterable<T>;\n}\n\n/** Props available on icons. */\nexport interface IconProps extends CommonProps, Pick<AriaLabelingProps, 'aria-label' | 'aria-labelledby'> {\n /**\n * Whether the icon is hidden from assistive technologies.\n * @default true\n */\n 'aria-hidden'?: boolean;\n /** The size of the icon in pixels. */\n size?: 16 | 24 | 32;\n /** The tone of the icon. */\n tone?: ForegroundTone;\n}\n\n/** Props available on native HTML elements. */\nexport interface NativeElementProps<T extends HTMLElement> extends HTMLAttributes<T> {\n [dataProp: `data-${string}`]: string | number | boolean | undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { focusSafely } from '@react-aria/focus';\nimport type { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport type {\n ButtonProps as RACButtonProps,\n LinkProps as RACLinkProps,\n PressEvent as RACPressEvent,\n ValidationResult as RACValidationResult,\n} from 'react-aria-components';\nimport type { ForegroundTone } from '../utils/style/types.js';\n\n/** Represents an identifier for a collection item. */\nexport type Key = string | number;\n\n/** Represents a selection of items in a collection. */\nexport type Selection = 'all' | Set<Key>;\n\n/** Represents a direction (vertical or horizontal). */\nexport type Direction = 'vertical' | 'horizontal';\n\n/**\n * Use this type when you want to restrict `children` to a string,\n * but also want to allow expressions that resolve to strings.\n */\nexport type StringLikeChildren = string | number | (string | number)[];\n\n// `FocusableElement` is not exported from any React Aria package\n/** Any focusable element, including both HTML and SVG elements. */\nexport type FocusableElement = Parameters<typeof focusSafely>[0];\n\n/**\n * A set of common props that are allowed on every component\n */\nexport interface CommonProps {\n /**\n * The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n */\n id?: string;\n /**\n * Use this attribute to \"claim\" the component tree for exclusive Cimpress UI usage.\n */\n 'data-cim-style-root'?: boolean;\n /**\n * Sets the CSS className for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_className?: string;\n /**\n * Sets the CSS style for the element. Only use as a **last resort**. Use style props instead.\n *\n * See [styling guide](https://ui.cimpress.io/dev-guides/styling/).\n */\n UNSAFE_style?: CSSProperties;\n}\n\n/**\n * An event fired when a component is pressed.\n *\n * By default, press events stop propagation to parent elements.\n * In cases where a handler decides not to handle a specific event,\n * it can call `continuePropagation()` to allow a parent to handle it.\n */\nexport type PressEvent = RACPressEvent;\n\n// HoverEvent is not exported from react-aria-components\n/** An event fired when a component is hovered. */\nexport type HoverEvent = Parameters<NonNullable<RACButtonProps['onHoverStart']>>[0];\n\n/**\n * Props for components that require a label, which can be hidden if necessary.\n */\nexport interface LabellableProps extends AriaLabelingProps {\n /** The content to display as the label. */\n label?: string;\n}\n\n// Copied from AriaLabelingProps from @react-types/shared\nexport interface AriaLabelingProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string;\n\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string;\n\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string;\n\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string;\n}\n\n/** Provides details about the validation state of a form field. */\nexport type ValidationResult = RACValidationResult;\n\n/** Represents the error message(s) for a form field. */\nexport type FieldError =\n | string\n | string[]\n | undefined\n | ((validation: ValidationResult) => string | string[] | undefined);\n\n/** Props available on form field components. */\nexport interface FieldProps<T> extends LabellableProps {\n /**\n * The `<form>` element to associate the input with.\n * The value of this attribute must be the id of a `<form>` in the same document.\n * See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#form).\n */\n form?: string;\n /**\n * The name of the input element, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name).\n */\n name?: string;\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: string;\n /** An error message for the field. */\n error?: FieldError;\n /**\n * A function that returns an error message (or `true`) if a given value is invalid.\n * Validation errors are displayed to the user when the form is submitted.\n * For real-time validation, use the `error` prop instead.\n */\n validate?: (value: T) => string | string[] | true | undefined;\n}\n\n/** Props available on form field components with text inputs. */\nexport interface FieldWithPlaceholderProps<T> extends FieldProps<T> {\n /** The placeholder text displayed in the input field. */\n placeholder?: string;\n}\n\n/** Changes specified optional properties within the provided type to be required. */\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\n/**\n * This interface allows configuring navigation props with router options and type-safe URLs via TypeScript module augmentation.\n * By default, this is an empty interface. Extend with `href` and `routerOptions` properties to configure your router.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface RouterConfig {}\n\n/**\n * Represents a URL for navigation components.\n * This type can be configured by augmenting `RouterConfig` with an `href` property.\n */\nexport type Href = RouterConfig extends { href: infer H } ? H : string;\n\n/**\n * Represents router options for navigation components.\n * This type can be configured by augmenting `RouterConfig` with a `routerOptions` property.\n */\nexport type RouterOptions = RouterConfig extends { routerOptions: infer O } ? O : never;\n\n/**\n * Props available on components that perform navigation.\n */\nexport interface NavigationProps\n extends Pick<RACLinkProps, 'hrefLang' | 'target' | 'rel' | 'download' | 'ping' | 'referrerPolicy'> {\n /** A URL to link to. */\n href?: Href;\n /** Options for the configured client side router. */\n routerOptions?: RouterOptions;\n}\n\n/** Represents a minimal data shape of a dynamic item in collection components. */\nexport interface CollectionItem {\n /** Unique identifier for the item or group. */\n id: Key;\n}\n\n/** Props available on components that render collections. */\nexport interface CollectionProps<T extends CollectionItem> {\n /** The contents of the collection. */\n children?: ReactNode | ((item: T) => ReactNode);\n /** The items to display in the collection. */\n items?: Iterable<T>;\n}\n\n/** Props available on components that support asynchronous loading of items. */\nexport interface AsyncItemLoadingProps {\n /** Whether items are currently being loaded. */\n UNSTABLE_isLoading?: boolean;\n /** A callback function that is called when more items should be loaded. */\n UNSTABLE_onLoadMore?: () => void;\n}\n\n/** Props available on icons. */\nexport interface IconProps extends CommonProps, Pick<AriaLabelingProps, 'aria-label' | 'aria-labelledby'> {\n /**\n * Whether the icon is hidden from assistive technologies.\n * @default true\n */\n 'aria-hidden'?: boolean;\n /** The size of the icon in pixels. */\n size?: 16 | 24 | 32;\n /** The tone of the icon. */\n tone?: ForegroundTone;\n}\n\n/** Props available on native HTML elements. */\nexport interface NativeElementProps<T extends HTMLElement> extends HTMLAttributes<T> {\n [dataProp: `data-${string}`]: string | number | boolean | undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,+EAA+E;AAC/E,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,+EAA+E;AAC/E,eAAO,MAAM,IAAI,EAAE,iBAwClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../src/i18n/messages/en-US.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAId,+EAA+E;AAClE,QAAA,IAAI,GAAsB;IACrC,MAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;IAC9B,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE;IACjC,UAAU,EAAE;QACV,UAAU,EAAE,OAA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QAAQ;QACf,MAAM,EAAE,SAAS;QACjB,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,IAAI,CAAC,YAAY,EAAE;QACpE,WAAW,EAAE,cAAc;KAC5B;IACD,mBAAmB,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE;CACrF,CAAC","sourcesContent":["// @ts-nocheck\n\nimport type { LocalizedMessages } from './types.js';\n\n/** Strings used by Cimpress UI components, localized in the `en-US` locale. */\nexport const enUS: LocalizedMessages = {\n common: { dismiss: `Dismiss` },\n label: { required: `(required)` },\n datePicker: {\n clearValue: `Clear`,\n openCalendar: `Open calendar`,\n previousMonth: `Previous month`,\n nextMonth: `Next month`,\n switchToYearView: `Year view`,\n previousYear: `Previous year`,\n nextYear: `Next year`,\n switchToMultiYearView: `Multi-year view`,\n previousMultiYearSection: (args, formatter) => `Previous ${formatter.number(args.yearCount)} years`,\n nextMultiYearSection: (args, formatter) => `Next ${formatter.number(args.yearCount)} years`,\n },\n numberField: { decrement: `Decrement`, increment: `Increment` },\n pagination: {\n goToPage: (args, formatter) => `Page ${formatter.number(args.pageNumber)}`,\n previousPage: `Previous page`,\n nextPage: `Next page`,\n selectedPageAnnouncement: (args, formatter) => `Selected page: ${formatter.number(args.pageNumber)}`,\n },\n tagField: {\n itemsSelected: (args, formatter) =>\n `${formatter.plural(args.selectedItemCount, { one: () => `${formatter.number(args.selectedItemCount)} item selected`, other: () => `${formatter.number(args.selectedItemCount)} items selected` })}`,\n },\n filePicker: {\n chooseFile: `Choose file`,\n noFilesSelected: (args, formatter) =>\n `${formatter.select({ true: `No files selected`, other: `No file selected` }, args.allowsMultiple)}`,\n multipleFilesSelected: (args, formatter) => `${formatter.number(args.fileCount)} files`,\n },\n table: { toggleColumnSortOrder: `Toggle sort order of column:` },\n simpleAuthTool: {\n logIn: `Log in`,\n logOut: `Log out`,\n profileDetails: (args) => `Profile details for ${args.userFullName}`,\n unknownUser: `Unknown User`,\n },\n UNSTABLE_collection: { loading: `Loading items`, loadingMore: `Loading more items` },\n};\n"]}
|
|
@@ -78,5 +78,11 @@ export type LocalizedMessages = {
|
|
|
78
78
|
/** A name that's displayed when the current user's name is unknown. */
|
|
79
79
|
unknownUser: LocalizedString;
|
|
80
80
|
};
|
|
81
|
+
UNSTABLE_collection: {
|
|
82
|
+
/** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */
|
|
83
|
+
loading: LocalizedString;
|
|
84
|
+
/** An ARIA label for a spinner displayed when more items are being loaded into a collection. */
|
|
85
|
+
loadingMore: LocalizedString;
|
|
86
|
+
};
|
|
81
87
|
};
|
|
82
88
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,MAAM,GACN,CAAC,CACC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAChD,SAAS,CAAC,EAAE,wBAAwB,CAAC,MAAM,EAAE,eAAe,CAAC,KAC1D,MAAM,CAAC,CAAC;AAEjB,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE;QACN,uNAAuN;QACvN,OAAO,EAAE,eAAe,CAAC;KAC1B,CAAC;IACF,KAAK,EAAE;QACL,mKAAmK;QACnK,QAAQ,EAAE,eAAe,CAAC;KAC3B,CAAC;IACF,UAAU,EAAE;QACV,+EAA+E;QAC/E,UAAU,EAAE,eAAe,CAAC;QAC5B,qFAAqF;QACrF,YAAY,EAAE,eAAe,CAAC;QAC9B,8GAA8G;QAC9G,aAAa,EAAE,eAAe,CAAC;QAC/B,0GAA0G;QAC1G,SAAS,EAAE,eAAe,CAAC;QA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eAAe,CAAC;QAC9B,6GAA6G;QAC7G,QAAQ,EAAE,eAAe,CAAC;QAC1B,kHAAkH;QAClH,wBAAwB,EAAE,eAAe,CAAC;KAC3C,CAAC;IACF,QAAQ,EAAE;QACR,kGAAkG;QAClG,aAAa,EAAE,eAAe,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,uEAAuE;QACvE,UAAU,EAAE,eAAe,CAAC;QAC5B,8CAA8C;QAC9C,eAAe,EAAE,eAAe,CAAC;QACjC,oDAAoD;QACpD,qBAAqB,EAAE,eAAe,CAAC;KACxC,CAAC;IACF,KAAK,EAAE;QACL,0JAA0J;QAC1J,qBAAqB,EAAE,eAAe,CAAC;KACxC,CAAC;IACF,cAAc,EAAE;QACd,gEAAgE;QAChE,KAAK,EAAE,eAAe,CAAC;QACvB,gEAAgE;QAChE,MAAM,EAAE,eAAe,CAAC;QACxB,sFAAsF;QACtF,cAAc,EAAE,eAAe,CAAC;QAChC,uEAAuE;QACvE,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;IACF,mBAAmB,EAAE;QACnB,0GAA0G;QAC1G,OAAO,EAAE,eAAe,CAAC;QACzB,gGAAgG;QAChG,WAAW,EAAE,eAAe,CAAC;KAC9B,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/i18n/messages/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { LocalizedStringFormatter } from 'react-aria';\n\n/**\n * Represents a localized piece of text used within a component.\n * It can either be a plain string, or a function that returns a plain string based on provided context.\n */\nexport type LocalizedString =\n | string\n | ((\n args?: Record<string, string | number | boolean>,\n formatter?: LocalizedStringFormatter<string, LocalizedString>,\n ) => string);\n\n/** A collection of localized strings used by Cimpress UI components. */\nexport type LocalizedMessages = {\n common: {\n /** An ARIA label for a button that closes or dismisses an alert, a callout, a dialog, or other overlay component. Used for accessibility purposes to clearly indicate the button's function to screen reader users. */\n dismiss: LocalizedString;\n };\n label: {\n /** A visually hidden label that indicates a form field is required. This text is appended to the field's visible label and is only announced by screen readers. */\n required: LocalizedString;\n };\n datePicker: {\n /** An ARIA label for a button that clears the value of a date picker field. */\n clearValue: LocalizedString;\n /** An ARIA label for a button that opens a calendar popup. Part of a date picker. */\n openCalendar: LocalizedString;\n /** An ARIA label for a button that displays the previous month in a calendar popup. Part of a date picker. */\n previousMonth: LocalizedString;\n /** An ARIA label for a button that displays the next month in a calendar popup. Part of a date picker. */\n nextMonth: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a single-year view. Part of a date picker. */\n switchToYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous year in a calendar popup. Part of a date picker. */\n previousYear: LocalizedString;\n /** An ARIA label for a button that displays the next year in a calendar popup. Part of a date picker. */\n nextYear: LocalizedString;\n /** An ARIA label for a button that changes the calendar popup to a multi-year view. Part of a date picker. */\n switchToMultiYearView: LocalizedString;\n /** An ARIA label for a button that displays the previous section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n previousMultiYearSection: LocalizedString;\n /** An ARIA label for a button that displays the next section of a multi-year view in a calendar popup. Year count will always be larger than 1. Part of a date picker. */\n nextMultiYearSection: LocalizedString;\n };\n numberField: {\n /** An ARIA label for a button that decrements the value of a number field. */\n decrement: LocalizedString;\n /** An ARIA label for a button that increments the value of a number field. */\n increment: LocalizedString;\n };\n pagination: {\n /** An ARIA label for a button that navigates to a specific page. Part of a pagination navigation structure. */\n goToPage: LocalizedString;\n /** An ARIA label for a button that navigates to the previous page. Part of a pagination navigation structure. */\n previousPage: LocalizedString;\n /** An ARIA label for a button that navigates to the next page. Part of a pagination navigation structure. */\n nextPage: LocalizedString;\n /** A screen reader announcement for when the selected page changes. Part of a pagination navigation structure. */\n selectedPageAnnouncement: LocalizedString;\n };\n tagField: {\n /** A label displayed within a tag field to inform the user about the number of selected items. */\n itemsSelected: LocalizedString;\n };\n filePicker: {\n /** A label for the button that opens the native file picker dialog. */\n chooseFile: LocalizedString;\n /** A label for when no files are selected. */\n noFilesSelected: LocalizedString;\n /** A label for when multiple files are selected. */\n multipleFilesSelected: LocalizedString;\n };\n table: {\n /** An ARIA label for a button that toggles the sort order of a specific column in a data table. This label will be followed by the name of the column. */\n toggleColumnSortOrder: LocalizedString;\n };\n simpleAuthTool: {\n /** A label used for a button that redirects to a login flow. */\n logIn: LocalizedString;\n /** A label used for a button that logs the current user out. */\n logOut: LocalizedString;\n /** An ARIA label for a popover that contains information about the logged in user. */\n profileDetails: LocalizedString;\n /** A name that's displayed when the current user's name is unknown. */\n unknownUser: LocalizedString;\n };\n UNSTABLE_collection: {\n /** An ARIA label for a spinner displayed when the list of items is first being loaded in a collection. */\n loading: LocalizedString;\n /** An ARIA label for a spinner displayed when more items are being loaded into a collection. */\n loadingMore: LocalizedString;\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-apparel.d.ts","sourceRoot":"","sources":["../../../src/icons/category-apparel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,kBAAkB;yFAOrB,SAAS;;
|
|
1
|
+
{"version":3,"file":"category-apparel.d.ts","sourceRoot":"","sources":["../../../src/icons/category-apparel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,2BAA2B;AAC3B,QAAA,MAAM,kBAAkB;yFAOrB,SAAS;;CAgBX,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|