@cimpress-ui/react 1.19.1 → 1.20.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.
Files changed (47) hide show
  1. package/dist/commonjs/components/nav-list/nav-list.d.ts +34 -0
  2. package/dist/commonjs/components/nav-list/nav-list.d.ts.map +1 -0
  3. package/dist/commonjs/components/nav-list/nav-list.js +44 -0
  4. package/dist/commonjs/components/nav-list/nav-list.js.map +1 -0
  5. package/dist/commonjs/components/switch/switch.d.ts +26 -0
  6. package/dist/commonjs/components/switch/switch.d.ts.map +1 -0
  7. package/dist/commonjs/components/switch/switch.js +36 -0
  8. package/dist/commonjs/components/switch/switch.js.map +1 -0
  9. package/dist/commonjs/components/text-inputs/search-field.d.ts.map +1 -1
  10. package/dist/commonjs/components/text-inputs/search-field.js +1 -1
  11. package/dist/commonjs/components/text-inputs/search-field.js.map +1 -1
  12. package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
  13. package/dist/commonjs/components/text-inputs/text-field.js +1 -1
  14. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
  15. package/dist/commonjs/index.d.ts +2 -1
  16. package/dist/commonjs/index.d.ts.map +1 -1
  17. package/dist/commonjs/index.js +2 -1
  18. package/dist/commonjs/index.js.map +1 -1
  19. package/dist/esm/components/nav-list/nav-list.d.ts +34 -0
  20. package/dist/esm/components/nav-list/nav-list.d.ts.map +1 -0
  21. package/dist/esm/components/nav-list/nav-list.js +36 -0
  22. package/dist/esm/components/nav-list/nav-list.js.map +1 -0
  23. package/dist/esm/components/switch/switch.d.ts +26 -0
  24. package/dist/esm/components/switch/switch.d.ts.map +1 -0
  25. package/dist/esm/components/switch/switch.js +30 -0
  26. package/dist/esm/components/switch/switch.js.map +1 -0
  27. package/dist/esm/components/text-inputs/search-field.d.ts.map +1 -1
  28. package/dist/esm/components/text-inputs/search-field.js +1 -1
  29. package/dist/esm/components/text-inputs/search-field.js.map +1 -1
  30. package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
  31. package/dist/esm/components/text-inputs/text-field.js +1 -1
  32. package/dist/esm/components/text-inputs/text-field.js.map +1 -1
  33. package/dist/esm/index.d.ts +2 -1
  34. package/dist/esm/index.d.ts.map +1 -1
  35. package/dist/esm/index.js +2 -1
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist-styles/core.css +1 -1
  38. package/dist-styles/styles.css +1 -1
  39. package/package.json +1 -1
  40. package/dist/commonjs/components/toggle/toggle.d.ts +0 -14
  41. package/dist/commonjs/components/toggle/toggle.d.ts.map +0 -1
  42. package/dist/commonjs/components/toggle/toggle.js +0 -32
  43. package/dist/commonjs/components/toggle/toggle.js.map +0 -1
  44. package/dist/esm/components/toggle/toggle.d.ts +0 -14
  45. package/dist/esm/components/toggle/toggle.d.ts.map +0 -1
  46. package/dist/esm/components/toggle/toggle.js +0 -26
  47. package/dist/esm/components/toggle/toggle.js.map +0 -1
@@ -1,32 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.UNSTABLE_Toggle = void 0;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const clsx_1 = __importDefault(require("clsx"));
10
- const react_aria_components_1 = require("react-aria-components");
11
- const forward_ref_js_1 = require("../../forward-ref.js");
12
- const index_js_1 = require("../../icons/index.js");
13
- const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
14
- const with_style_props_js_1 = require("../../with-style-props.js");
15
- const text_js_1 = require("../typography/text.js");
16
- function UNSTABLE_Toggle({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
17
- const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
18
- (0, use_production_warning_js_1.useProductionWarning)(() => {
19
- if (!children && !ariaLabel && !ariaLabelledBy) {
20
- console.warn('Toggle requires one of children / aria-label / aria-labelledby for accessibility');
21
- }
22
- }, [children, ariaLabel, ariaLabelledBy]);
23
- return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Switch, { ...props, ref: ref, className: (0, clsx_1.default)('cim-toggle', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-toggle-track-wrapper", "aria-hidden": true, children: (0, jsx_runtime_1.jsxs)("div", { className: "cim-toggle-track", children: [(0, jsx_runtime_1.jsx)(index_js_1.IconCheckBold, {}), (0, jsx_runtime_1.jsx)(index_js_1.IconCloseBold, {}), (0, jsx_runtime_1.jsx)("div", { className: "cim-toggle-track-head" })] }) }), children && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "span", variant: "medium", children: children }))] }));
24
- }
25
- /**
26
- * Allows users to turn a setting on or off.
27
- *
28
- * See [toggle usage guidelines](https://ui.cimpress.io/components/toggle/).
29
- */
30
- const _UNSTABLE_Toggle = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(UNSTABLE_Toggle), 'Toggle');
31
- exports.UNSTABLE_Toggle = _UNSTABLE_Toggle;
32
- //# sourceMappingURL=toggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAAgG;AAChG,yDAAkD;AAClD,mDAAoE;AACpE,qFAA6E;AAC7E,mEAA2D;AAE3D,mDAA6C;AAsB7C,SAAS,eAAe,CACtB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAwB,EAC5E,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,kFAAkF,CAAC,CAAC;QACnG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,wBAAC,8BAAS,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,YAAY,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAClG,gCAAK,SAAS,EAAC,0BAA0B,iCACvC,iCAAK,SAAS,EAAC,kBAAkB,aAC/B,uBAAC,wBAAa,KAAG,EACjB,uBAAC,wBAAa,KAAG,EACjB,gCAAK,SAAS,EAAC,uBAAuB,GAAG,IACrC,GACF,EACL,QAAQ,IAAI,CACX,uBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,YAC7B,QAAQ,GACJ,CACR,IACS,CACb,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,CAAC;AAElD,2CAAe","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Switch as RACSwitch, type SwitchProps as RACSwitchProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckBold, IconCloseBold } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface UNSTABLE_ToggleProps\n extends\n CommonProps,\n AriaLabelingProps,\n Pick<\n RACSwitchProps,\n | 'onChange'\n | 'isSelected'\n | 'isDisabled'\n | 'isReadOnly'\n | 'defaultSelected'\n | 'autoFocus'\n | 'form'\n | 'name'\n | 'value'\n > {\n /** The label rendered next to the toggle. */\n children?: StringLikeChildren;\n}\n\nfunction UNSTABLE_Toggle(\n { children, UNSAFE_className, UNSAFE_style, ...props }: UNSTABLE_ToggleProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Toggle requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACSwitch {...props} ref={ref} className={clsx('cim-toggle', UNSAFE_className)} style={UNSAFE_style}>\n <div className=\"cim-toggle-track-wrapper\" aria-hidden>\n <div className=\"cim-toggle-track\">\n <IconCheckBold />\n <IconCloseBold />\n <div className=\"cim-toggle-track-head\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"medium\">\n {children}\n </Text>\n )}\n </RACSwitch>\n );\n}\n\n/**\n * Allows users to turn a setting on or off.\n *\n * See [toggle usage guidelines](https://ui.cimpress.io/components/toggle/).\n */\nconst _UNSTABLE_Toggle = withStyleProps(forwardRef(UNSTABLE_Toggle), 'Toggle');\n\nexport { _UNSTABLE_Toggle as UNSTABLE_Toggle };\n"]}
@@ -1,14 +0,0 @@
1
- import { type SwitchProps as RACSwitchProps } from 'react-aria-components';
2
- import type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';
3
- export interface UNSTABLE_ToggleProps extends CommonProps, AriaLabelingProps, Pick<RACSwitchProps, 'onChange' | 'isSelected' | 'isDisabled' | 'isReadOnly' | 'defaultSelected' | 'autoFocus' | 'form' | 'name' | 'value'> {
4
- /** The label rendered next to the toggle. */
5
- children?: StringLikeChildren;
6
- }
7
- /**
8
- * Allows users to turn a setting on or off.
9
- *
10
- * See [toggle usage guidelines](https://ui.cimpress.io/components/toggle/).
11
- */
12
- declare const _UNSTABLE_Toggle: (props: UNSTABLE_ToggleProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
13
- export { _UNSTABLE_Toggle as UNSTABLE_Toggle };
14
- //# sourceMappingURL=toggle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../src/components/toggle/toggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,WAAW,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtF,MAAM,WAAW,oBACf,SACE,WAAW,EACX,iBAAiB,EACjB,IAAI,CACF,cAAc,EACZ,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,MAAM,GACN,OAAO,CACV;IACH,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAgCD;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,wKAAwD,CAAC;AAE/E,OAAO,EAAE,gBAAgB,IAAI,eAAe,EAAE,CAAC"}
@@ -1,26 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import clsx from 'clsx';
4
- import { Switch as RACSwitch } from 'react-aria-components';
5
- import { forwardRef } from '../../forward-ref.js';
6
- import { IconCheckBold, IconCloseBold } from '../../icons/index.js';
7
- import { useProductionWarning } from '../../utils/use-production-warning.js';
8
- import { withStyleProps } from '../../with-style-props.js';
9
- import { Text } from '../typography/text.js';
10
- function UNSTABLE_Toggle({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
11
- const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
12
- useProductionWarning(() => {
13
- if (!children && !ariaLabel && !ariaLabelledBy) {
14
- console.warn('Toggle requires one of children / aria-label / aria-labelledby for accessibility');
15
- }
16
- }, [children, ariaLabel, ariaLabelledBy]);
17
- return (_jsxs(RACSwitch, { ...props, ref: ref, className: clsx('cim-toggle', UNSAFE_className), style: UNSAFE_style, children: [_jsx("div", { className: "cim-toggle-track-wrapper", "aria-hidden": true, children: _jsxs("div", { className: "cim-toggle-track", children: [_jsx(IconCheckBold, {}), _jsx(IconCloseBold, {}), _jsx("div", { className: "cim-toggle-track-head" })] }) }), children && (_jsx(Text, { as: "span", variant: "medium", children: children }))] }));
18
- }
19
- /**
20
- * Allows users to turn a setting on or off.
21
- *
22
- * See [toggle usage guidelines](https://ui.cimpress.io/components/toggle/).
23
- */
24
- const _UNSTABLE_Toggle = withStyleProps(forwardRef(UNSTABLE_Toggle), 'Toggle');
25
- export { _UNSTABLE_Toggle as UNSTABLE_Toggle };
26
- //# sourceMappingURL=toggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,IAAI,SAAS,EAAsC,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAsB7C,SAAS,eAAe,CACtB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAwB,EAC5E,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,oBAAoB,CAAC,GAAG,EAAE;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,kFAAkF,CAAC,CAAC;QACnG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,MAAC,SAAS,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAClG,cAAK,SAAS,EAAC,0BAA0B,iCACvC,eAAK,SAAS,EAAC,kBAAkB,aAC/B,KAAC,aAAa,KAAG,EACjB,KAAC,aAAa,KAAG,EACjB,cAAK,SAAS,EAAC,uBAAuB,GAAG,IACrC,GACF,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,YAC7B,QAAQ,GACJ,CACR,IACS,CACb,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,cAAc,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,IAAI,eAAe,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Switch as RACSwitch, type SwitchProps as RACSwitchProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckBold, IconCloseBold } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface UNSTABLE_ToggleProps\n extends\n CommonProps,\n AriaLabelingProps,\n Pick<\n RACSwitchProps,\n | 'onChange'\n | 'isSelected'\n | 'isDisabled'\n | 'isReadOnly'\n | 'defaultSelected'\n | 'autoFocus'\n | 'form'\n | 'name'\n | 'value'\n > {\n /** The label rendered next to the toggle. */\n children?: StringLikeChildren;\n}\n\nfunction UNSTABLE_Toggle(\n { children, UNSAFE_className, UNSAFE_style, ...props }: UNSTABLE_ToggleProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Toggle requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACSwitch {...props} ref={ref} className={clsx('cim-toggle', UNSAFE_className)} style={UNSAFE_style}>\n <div className=\"cim-toggle-track-wrapper\" aria-hidden>\n <div className=\"cim-toggle-track\">\n <IconCheckBold />\n <IconCloseBold />\n <div className=\"cim-toggle-track-head\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"medium\">\n {children}\n </Text>\n )}\n </RACSwitch>\n );\n}\n\n/**\n * Allows users to turn a setting on or off.\n *\n * See [toggle usage guidelines](https://ui.cimpress.io/components/toggle/).\n */\nconst _UNSTABLE_Toggle = withStyleProps(forwardRef(UNSTABLE_Toggle), 'Toggle');\n\nexport { _UNSTABLE_Toggle as UNSTABLE_Toggle };\n"]}