@cimpress-ui/react 1.23.0 → 1.25.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 (129) hide show
  1. package/dist/commonjs/components/app-header/side-nav.d.ts +1 -9
  2. package/dist/commonjs/components/app-header/side-nav.d.ts.map +1 -1
  3. package/dist/commonjs/components/app-header/side-nav.js +3 -3
  4. package/dist/commonjs/components/app-header/side-nav.js.map +1 -1
  5. package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -1
  6. package/dist/commonjs/components/checkbox/checkbox.js +1 -1
  7. package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
  8. package/dist/commonjs/components/code/code.d.ts +14 -0
  9. package/dist/commonjs/components/code/code.d.ts.map +1 -0
  10. package/dist/commonjs/components/code/code.js +22 -0
  11. package/dist/commonjs/components/code/code.js.map +1 -0
  12. package/dist/commonjs/components/code-block/code-block.d.ts +13 -0
  13. package/dist/commonjs/components/code-block/code-block.d.ts.map +1 -0
  14. package/dist/commonjs/components/code-block/code-block.js +50 -0
  15. package/dist/commonjs/components/code-block/code-block.js.map +1 -0
  16. package/dist/commonjs/components/combo-box/combo-box.d.ts +1 -0
  17. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
  18. package/dist/commonjs/components/combo-box/combo-box.js +23 -5
  19. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
  20. package/dist/commonjs/components/internal/checkbox-indicator/checkbox-indicator.js +2 -4
  21. package/dist/commonjs/components/internal/checkbox-indicator/checkbox-indicator.js.map +1 -1
  22. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js.map +1 -1
  23. package/dist/commonjs/components/menu/menu.d.ts +14 -1
  24. package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
  25. package/dist/commonjs/components/menu/menu.js +16 -2
  26. package/dist/commonjs/components/menu/menu.js.map +1 -1
  27. package/dist/commonjs/components/select/select.d.ts +1 -1
  28. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  29. package/dist/commonjs/components/select/select.js +3 -2
  30. package/dist/commonjs/components/select/select.js.map +1 -1
  31. package/dist/commonjs/components/slider/slider.d.ts +15 -7
  32. package/dist/commonjs/components/slider/slider.d.ts.map +1 -1
  33. package/dist/commonjs/components/slider/slider.js +18 -20
  34. package/dist/commonjs/components/slider/slider.js.map +1 -1
  35. package/dist/commonjs/components/tag-field/tag-field.js +1 -1
  36. package/dist/commonjs/components/tag-field/tag-field.js.map +1 -1
  37. package/dist/commonjs/components/toast/toast-queue.d.ts +9 -7
  38. package/dist/commonjs/components/toast/toast-queue.d.ts.map +1 -1
  39. package/dist/commonjs/components/toast/toast-queue.js +6 -5
  40. package/dist/commonjs/components/toast/toast-queue.js.map +1 -1
  41. package/dist/commonjs/components/toast/toast-region.d.ts +1 -1
  42. package/dist/commonjs/components/toast/toast-region.d.ts.map +1 -1
  43. package/dist/commonjs/components/toast/toast-region.js +3 -3
  44. package/dist/commonjs/components/toast/toast-region.js.map +1 -1
  45. package/dist/commonjs/components/toast/toast.js +3 -3
  46. package/dist/commonjs/components/toast/toast.js.map +1 -1
  47. package/dist/commonjs/components/toast/types.d.ts +1 -1
  48. package/dist/commonjs/components/toast/types.d.ts.map +1 -1
  49. package/dist/commonjs/components/toast/types.js.map +1 -1
  50. package/dist/commonjs/components/typography/list.d.ts +31 -0
  51. package/dist/commonjs/components/typography/list.d.ts.map +1 -0
  52. package/dist/commonjs/components/typography/list.js +39 -0
  53. package/dist/commonjs/components/typography/list.js.map +1 -0
  54. package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -1
  55. package/dist/commonjs/i18n/messages/en-US.js +1 -0
  56. package/dist/commonjs/i18n/messages/en-US.js.map +1 -1
  57. package/dist/commonjs/i18n/messages/types.d.ts +6 -0
  58. package/dist/commonjs/i18n/messages/types.d.ts.map +1 -1
  59. package/dist/commonjs/i18n/messages/types.js.map +1 -1
  60. package/dist/commonjs/index.d.ts +6 -3
  61. package/dist/commonjs/index.d.ts.map +1 -1
  62. package/dist/commonjs/index.js +7 -4
  63. package/dist/commonjs/index.js.map +1 -1
  64. package/dist/esm/components/app-header/side-nav.d.ts +1 -9
  65. package/dist/esm/components/app-header/side-nav.d.ts.map +1 -1
  66. package/dist/esm/components/app-header/side-nav.js +3 -3
  67. package/dist/esm/components/app-header/side-nav.js.map +1 -1
  68. package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
  69. package/dist/esm/components/checkbox/checkbox.js +1 -1
  70. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  71. package/dist/esm/components/code/code.d.ts +14 -0
  72. package/dist/esm/components/code/code.d.ts.map +1 -0
  73. package/dist/esm/components/code/code.js +16 -0
  74. package/dist/esm/components/code/code.js.map +1 -0
  75. package/dist/esm/components/code-block/code-block.d.ts +13 -0
  76. package/dist/esm/components/code-block/code-block.d.ts.map +1 -0
  77. package/dist/esm/components/code-block/code-block.js +44 -0
  78. package/dist/esm/components/code-block/code-block.js.map +1 -0
  79. package/dist/esm/components/combo-box/combo-box.d.ts +1 -0
  80. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
  81. package/dist/esm/components/combo-box/combo-box.js +24 -6
  82. package/dist/esm/components/combo-box/combo-box.js.map +1 -1
  83. package/dist/esm/components/internal/checkbox-indicator/checkbox-indicator.js +2 -4
  84. package/dist/esm/components/internal/checkbox-indicator/checkbox-indicator.js.map +1 -1
  85. package/dist/esm/components/internal/collapsible-list/collapsible-list.js.map +1 -1
  86. package/dist/esm/components/menu/menu.d.ts +14 -1
  87. package/dist/esm/components/menu/menu.d.ts.map +1 -1
  88. package/dist/esm/components/menu/menu.js +17 -4
  89. package/dist/esm/components/menu/menu.js.map +1 -1
  90. package/dist/esm/components/select/select.d.ts +1 -1
  91. package/dist/esm/components/select/select.d.ts.map +1 -1
  92. package/dist/esm/components/select/select.js +4 -3
  93. package/dist/esm/components/select/select.js.map +1 -1
  94. package/dist/esm/components/slider/slider.d.ts +15 -7
  95. package/dist/esm/components/slider/slider.d.ts.map +1 -1
  96. package/dist/esm/components/slider/slider.js +17 -19
  97. package/dist/esm/components/slider/slider.js.map +1 -1
  98. package/dist/esm/components/tag-field/tag-field.js +1 -1
  99. package/dist/esm/components/tag-field/tag-field.js.map +1 -1
  100. package/dist/esm/components/toast/toast-queue.d.ts +9 -7
  101. package/dist/esm/components/toast/toast-queue.d.ts.map +1 -1
  102. package/dist/esm/components/toast/toast-queue.js +5 -4
  103. package/dist/esm/components/toast/toast-queue.js.map +1 -1
  104. package/dist/esm/components/toast/toast-region.d.ts +1 -1
  105. package/dist/esm/components/toast/toast-region.d.ts.map +1 -1
  106. package/dist/esm/components/toast/toast-region.js +3 -3
  107. package/dist/esm/components/toast/toast-region.js.map +1 -1
  108. package/dist/esm/components/toast/toast.js +2 -2
  109. package/dist/esm/components/toast/toast.js.map +1 -1
  110. package/dist/esm/components/toast/types.d.ts +1 -1
  111. package/dist/esm/components/toast/types.d.ts.map +1 -1
  112. package/dist/esm/components/toast/types.js.map +1 -1
  113. package/dist/esm/components/typography/list.d.ts +31 -0
  114. package/dist/esm/components/typography/list.d.ts.map +1 -0
  115. package/dist/esm/components/typography/list.js +31 -0
  116. package/dist/esm/components/typography/list.js.map +1 -0
  117. package/dist/esm/i18n/messages/en-US.d.ts.map +1 -1
  118. package/dist/esm/i18n/messages/en-US.js +1 -0
  119. package/dist/esm/i18n/messages/en-US.js.map +1 -1
  120. package/dist/esm/i18n/messages/types.d.ts +6 -0
  121. package/dist/esm/i18n/messages/types.d.ts.map +1 -1
  122. package/dist/esm/i18n/messages/types.js.map +1 -1
  123. package/dist/esm/index.d.ts +6 -3
  124. package/dist/esm/index.d.ts.map +1 -1
  125. package/dist/esm/index.js +5 -2
  126. package/dist/esm/index.js.map +1 -1
  127. package/dist-styles/core.css +1 -1
  128. package/dist-styles/styles.css +1 -1
  129. package/package.json +6 -6
@@ -14,7 +14,7 @@ function Checkbox({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
14
14
  console.warn('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');
15
15
  }
16
16
  }, [children, ariaLabel, ariaLabelledBy]);
17
- return (_jsx(RACCheckbox, { ...props, ref: ref, className: clsx('cim-checkbox', 'cim-checkbox-indicator-wrapper', UNSAFE_className), style: UNSAFE_style, children: ({ isIndeterminate, isSelected }) => (_jsxs(_Fragment, { children: [_jsx(CheckboxIndicator, { isIndeterminate: isIndeterminate, isSelected: isSelected }), children && (_jsx(Text, { as: "span", variant: "medium", children: children }))] })) }));
17
+ return (_jsx(RACCheckbox, { ...props, ref: ref, className: clsx('cim-checkbox', UNSAFE_className), style: UNSAFE_style, children: ({ isIndeterminate, isSelected, isDisabled, isReadOnly, isInvalid, isHovered, isPressed, isFocusVisible }) => (_jsxs(_Fragment, { children: [_jsx(CheckboxIndicator, { isIndeterminate: isIndeterminate, isSelected: isSelected, isDisabled: isDisabled, isReadOnly: isReadOnly, isInvalid: isInvalid, isHovered: isHovered, isPressed: isPressed, isFocusVisible: isFocusVisible }), children && (_jsx(Text, { as: "span", variant: "medium", children: children }))] })) }));
18
18
  }
19
19
  /**
20
20
  * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,IAAI,WAAW,EAA0C,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAEzF,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAyB7C,SAAS,QAAQ,CACf,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAiB,EACrE,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,oFAAoF,CAAC,CAAC;QACrG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,KAAC,WAAW,OACN,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gCAAgC,EAAE,gBAAgB,CAAC,EACnF,KAAK,EAAE,YAAY,YAElB,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACpC,8BACE,KAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAI,EAC9E,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,YAC7B,QAAQ,GACJ,CACR,IACA,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Checkbox as RACCheckbox, type CheckboxProps as RACCheckboxProps } 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 { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface CheckboxProps\n extends\n CommonProps,\n AriaLabelingProps,\n Pick<\n RACCheckboxProps,\n | 'onChange'\n | 'isSelected'\n | 'isIndeterminate'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isRequired'\n | 'isInvalid'\n | 'form'\n | 'name'\n | 'value'\n | 'defaultSelected'\n | 'autoFocus'\n > {\n /** The label rendered next to the checkbox. */\n children?: StringLikeChildren;\n}\n\nfunction Checkbox(\n { children, UNSAFE_className, UNSAFE_style, ...props }: CheckboxProps,\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('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACCheckbox\n {...props}\n ref={ref}\n className={clsx('cim-checkbox', 'cim-checkbox-indicator-wrapper', UNSAFE_className)}\n style={UNSAFE_style}\n >\n {({ isIndeterminate, isSelected }) => (\n <>\n <CheckboxIndicator isIndeterminate={isIndeterminate} isSelected={isSelected} />\n {children && (\n <Text as=\"span\" variant=\"medium\">\n {children}\n </Text>\n )}\n </>\n )}\n </RACCheckbox>\n );\n}\n\n/**\n * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.\n *\n * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).\n */\nconst _Checkbox = withStyleProps(forwardRef(Checkbox), 'Checkbox');\n\nexport { _Checkbox as Checkbox };\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAA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,EAAE,cAAc,GAC9B,EACD,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,YAC7B,QAAQ,GACJ,CACR,IACA,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Checkbox as RACCheckbox, type CheckboxProps as RACCheckboxProps } 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 { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface CheckboxProps\n extends\n CommonProps,\n AriaLabelingProps,\n Pick<\n RACCheckboxProps,\n | 'onChange'\n | 'isSelected'\n | 'isIndeterminate'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isRequired'\n | 'isInvalid'\n | 'form'\n | 'name'\n | 'value'\n | 'defaultSelected'\n | 'autoFocus'\n > {\n /** The label rendered next to the checkbox. */\n children?: StringLikeChildren;\n}\n\nfunction Checkbox(\n { children, UNSAFE_className, UNSAFE_style, ...props }: CheckboxProps,\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('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACCheckbox {...props} ref={ref} className={clsx('cim-checkbox', UNSAFE_className)} style={UNSAFE_style}>\n {({ isIndeterminate, isSelected, isDisabled, isReadOnly, isInvalid, isHovered, isPressed, isFocusVisible }) => (\n <>\n <CheckboxIndicator\n isIndeterminate={isIndeterminate}\n isSelected={isSelected}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n isHovered={isHovered}\n isPressed={isPressed}\n isFocusVisible={isFocusVisible}\n />\n {children && (\n <Text as=\"span\" variant=\"medium\">\n {children}\n </Text>\n )}\n </>\n )}\n </RACCheckbox>\n );\n}\n\n/**\n * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.\n *\n * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).\n */\nconst _Checkbox = withStyleProps(forwardRef(Checkbox), 'Checkbox');\n\nexport { _Checkbox as Checkbox };\n"]}
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CommonProps } from '../types.js';
3
+ export interface CodeProps extends CommonProps {
4
+ /** The inline code content to display. */
5
+ children: ReactNode;
6
+ }
7
+ /**
8
+ * Displays short, inline code snippets.
9
+ *
10
+ * See [code usage guidelines](https://ui.cimpress.io/components/code).
11
+ */
12
+ declare const _Code: (props: CodeProps & import("react").RefAttributes<HTMLElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
13
+ export { _Code as Code };
14
+ //# sourceMappingURL=code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../../src/components/code/code.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,0CAA0C;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD;;;;GAIG;AACH,QAAA,MAAM,KAAK,wJAA2C,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from '../../forward-ref.js';
5
+ import { withStyleProps } from '../../with-style-props.js';
6
+ function Code({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
7
+ return (_jsx("code", { ...props, ref: ref, className: clsx('cim-code', UNSAFE_className), style: UNSAFE_style, children: children }));
8
+ }
9
+ /**
10
+ * Displays short, inline code snippets.
11
+ *
12
+ * See [code usage guidelines](https://ui.cimpress.io/components/code).
13
+ */
14
+ const _Code = withStyleProps(forwardRef(Code), 'Code');
15
+ export { _Code as Code };
16
+ //# sourceMappingURL=code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.js","sourceRoot":"","sources":["../../../../src/components/code/code.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,SAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAa,EAAE,GAA8B;IAC7G,OAAO,CACL,kBAAU,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,YAC1F,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps } from '../types.js';\n\nexport interface CodeProps extends CommonProps {\n /** The inline code content to display. */\n children: ReactNode;\n}\n\nfunction Code({ children, UNSAFE_className, UNSAFE_style, ...props }: CodeProps, ref: ForwardedRef<HTMLElement>) {\n return (\n <code {...props} ref={ref} className={clsx('cim-code', UNSAFE_className)} style={UNSAFE_style}>\n {children}\n </code>\n );\n}\n\n/**\n * Displays short, inline code snippets.\n *\n * See [code usage guidelines](https://ui.cimpress.io/components/code).\n */\nconst _Code = withStyleProps(forwardRef(Code), 'Code');\nexport { _Code as Code };\n"]}
@@ -0,0 +1,13 @@
1
+ import type { CommonProps } from '../types.js';
2
+ export interface CodeBlockProps extends CommonProps {
3
+ /** The code content to display. */
4
+ code: string;
5
+ }
6
+ /**
7
+ * Displays preformatted code content in a styled container.
8
+ *
9
+ * See [code block usage guidelines](https://ui.cimpress.io/components/code-block).
10
+ */
11
+ declare const _CodeBlock: (props: CodeBlockProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
12
+ export { _CodeBlock as CodeBlock };
13
+ //# sourceMappingURL=code-block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../src/components/code-block/code-block.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CACd;AAqDD;;;;GAIG;AACH,QAAA,MAAM,UAAU,gKAAqD,CAAC;AACtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useFocusRing } from '@react-aria/focus';
4
+ import { useLayoutEffect } from '@react-aria/utils';
5
+ import clsx from 'clsx';
6
+ import { useRef, useState } from 'react';
7
+ import { forwardRef } from '../../forward-ref.js';
8
+ import { withStyleProps } from '../../with-style-props.js';
9
+ function CodeBlock({ code, UNSAFE_className, UNSAFE_style, ...props }, ref) {
10
+ // Most of the scrollable logic is copied from `FocusableContainer`, but the scrollable element is a child of the container, not the container itself.
11
+ const [isScrollable, setIsScrollable] = useState(false);
12
+ const scrollableRef = useRef(null);
13
+ const { focusProps, isFocusVisible } = useFocusRing();
14
+ useLayoutEffect(() => {
15
+ const scrollableElement = scrollableRef.current;
16
+ const isSSR = typeof window === 'undefined';
17
+ let scrollableResizeObserver;
18
+ if (scrollableElement && !isSSR) {
19
+ scrollableResizeObserver = new window.ResizeObserver((entries) => {
20
+ if (entries[0]) {
21
+ const { target } = entries[0];
22
+ const isScrollableHorizontal = target.scrollWidth > target.clientWidth;
23
+ const isScrollableVertical = target.scrollHeight > target.clientHeight;
24
+ setIsScrollable(isScrollableHorizontal || isScrollableVertical);
25
+ }
26
+ });
27
+ scrollableResizeObserver.observe(scrollableElement);
28
+ }
29
+ return () => {
30
+ if (scrollableElement && scrollableResizeObserver) {
31
+ scrollableResizeObserver.unobserve(scrollableElement);
32
+ }
33
+ };
34
+ }, [scrollableRef]);
35
+ return (_jsx("div", { ...props, ref: ref, className: clsx('cim-code-block', UNSAFE_className), style: UNSAFE_style, "data-focus-visible": isFocusVisible || undefined, children: _jsx("pre", { ...focusProps, ref: scrollableRef, tabIndex: isScrollable ? 0 : -1, children: _jsx("code", { children: code }) }) }));
36
+ }
37
+ /**
38
+ * Displays preformatted code content in a styled container.
39
+ *
40
+ * See [code block usage guidelines](https://ui.cimpress.io/components/code-block).
41
+ */
42
+ const _CodeBlock = withStyleProps(forwardRef(CodeBlock), 'CodeBlock');
43
+ export { _CodeBlock as CodeBlock };
44
+ //# sourceMappingURL=code-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block.js","sourceRoot":"","sources":["../../../../src/components/code-block/code-block.tsx"],"names":[],"mappings":"AAAA,Y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BAAoB,CAAC,CAAC;gBAClE,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,wBAAwB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,iBAAiB,IAAI,wBAAwB,EAAE,CAAC;gBAClD,wBAAwB,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACnD,KAAK,EAAE,YAAY,wBACC,cAAc,IAAI,SAAS,YAE/C,iBAAS,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YACtE,yBAAO,IAAI,GAAQ,GACf,GACF,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC;AACtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useFocusRing } from '@react-aria/focus';\nimport { useLayoutEffect } from '@react-aria/utils';\nimport clsx from 'clsx';\nimport { useRef, useState, type ForwardedRef } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps } from '../types.js';\n\nexport interface CodeBlockProps extends CommonProps {\n /** The code content to display. */\n code: string;\n}\n\nfunction CodeBlock(\n { code, UNSAFE_className, UNSAFE_style, ...props }: CodeBlockProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n // Most of the scrollable logic is copied from `FocusableContainer`, but the scrollable element is a child of the container, not the container itself.\n const [isScrollable, setIsScrollable] = useState(false);\n const scrollableRef = useRef<HTMLPreElement>(null);\n const { focusProps, isFocusVisible } = useFocusRing();\n\n useLayoutEffect(() => {\n const scrollableElement = scrollableRef.current;\n const isSSR = typeof window === 'undefined';\n\n let scrollableResizeObserver: ResizeObserver | undefined;\n\n if (scrollableElement && !isSSR) {\n scrollableResizeObserver = new window.ResizeObserver((entries) => {\n if (entries[0]) {\n const { target } = entries[0];\n const isScrollableHorizontal = target.scrollWidth > target.clientWidth;\n const isScrollableVertical = target.scrollHeight > target.clientHeight;\n\n setIsScrollable(isScrollableHorizontal || isScrollableVertical);\n }\n });\n\n scrollableResizeObserver.observe(scrollableElement);\n }\n\n return () => {\n if (scrollableElement && scrollableResizeObserver) {\n scrollableResizeObserver.unobserve(scrollableElement);\n }\n };\n }, [scrollableRef]);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-code-block', UNSAFE_className)}\n style={UNSAFE_style}\n data-focus-visible={isFocusVisible || undefined}\n >\n <pre {...focusProps} ref={scrollableRef} tabIndex={isScrollable ? 0 : -1}>\n <code>{code}</code>\n </pre>\n </div>\n );\n}\n\n/**\n * Displays preformatted code content in a styled container.\n *\n * See [code block usage guidelines](https://ui.cimpress.io/components/code-block).\n */\nconst _CodeBlock = withStyleProps(forwardRef(CodeBlock), 'CodeBlock');\nexport { _CodeBlock as CodeBlock };\n"]}
@@ -22,6 +22,7 @@ export interface ComboBoxProps<T extends CollectionItem = CollectionItem> extend
22
22
  isVirtualized?: boolean;
23
23
  /** Handler that is called when the list of items is scrolled. */
24
24
  onScroll?: UIEventHandler<HTMLDivElement>;
25
+ UNSTABLE_isClearable?: boolean;
25
26
  }
26
27
  /** The imperative API exposed by the `ComboBox` component. */
27
28
  export interface ComboBoxApi {
@@ -1 +1 @@
1
- {"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,cAAc,EAIpB,MAAM,OAAO,CA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IAAI,QAAQ,EAAE,CAAC;AAsFjC,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,IAAI,CACvE,mBAAmB,CAAC,CAAC,CAAC,EACtB,YAAY,GAAG,cAAc,GAAG,YAAY,CAC7C;IACC,0EAA0E;IAC1E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiBlG;yBAjBe,YAAY;;;AAqB5B,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACxF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAezB;yBApBe,eAAe"}
@@ -6,12 +6,13 @@ import { usePreventScroll } from 'react-aria';
6
6
  import { Button as RACButton, Collection as RACCollection, ComboBox as RACComboBox, ComboBoxStateContext as RACComboBoxStateContext, Group as RACGroup, Header as RACHeader, Input as RACInput, ListBox as RACListBox, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxItem as RACListBoxItem, ListBoxSection as RACListBoxSection, ListLayout as RACListLayout, Text as RACText, Virtualizer as RACVirtualizer, } from 'react-aria-components';
7
7
  import { forwardRef } from '../../forward-ref.js';
8
8
  import { useLocalizedMessages } from '../../i18n/index.js';
9
- import { IconCheck, IconChevronDown } from '../../icons/index.js';
9
+ import { IconCheckBold, IconChevronDown } from '../../icons/index.js';
10
10
  import { isProduction } from '../../utils/is-production.js';
11
11
  import { useProductionWarning } from '../../utils/use-production-warning.js';
12
12
  import { withStyleProps } from '../../with-style-props.js';
13
13
  import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
14
14
  import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
15
+ import { XButton } from '../internal/x-button/x-button.js';
15
16
  import { Spinner } from '../spinner/spinner.js';
16
17
  import { textStyle } from '../typography/utils.js';
17
18
  const VIRTUAL_LAYOUT_OPTIONS = {
@@ -21,7 +22,7 @@ const VIRTUAL_LAYOUT_OPTIONS = {
21
22
  padding: 0,
22
23
  gap: 0,
23
24
  };
24
- function ComboBox({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, onScroll, isVirtualized = false, UNSTABLE_isLoading: isLoading, UNSTABLE_onLoadMore: onLoadMore, apiRef, selectedKey, defaultSelectedKey, onSelectionChange, validate, ...props }, ref) {
25
+ function ComboBox({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, onScroll, isVirtualized = false, UNSTABLE_isLoading: isLoading, UNSTABLE_onLoadMore: onLoadMore, UNSTABLE_isClearable: isClearable = false, apiRef, selectedKey, defaultSelectedKey, onSelectionChange, validate, ...props }, ref) {
25
26
  const inputRef = useRef(null);
26
27
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
27
28
  useProductionWarning(() => {
@@ -36,12 +37,13 @@ function ComboBox({ label, description, error, items, children, placeholder, UNS
36
37
  focus: () => inputRef.current?.focus(),
37
38
  select: () => inputRef.current?.select(),
38
39
  }), []);
40
+ const isFieldClearable = isClearable && !props.isDisabled && !isReadOnly;
39
41
  const listBox = (_jsx(ComboBoxList, { items: items, isLoading: isLoading, onLoadMore: onLoadMore, onScroll: onScroll, children: children }));
40
42
  return (_jsxs(RACComboBox, { ...props, ref: ref, className: clsx('cim-combo-box', UNSAFE_className), style: UNSAFE_style, selectionMode: "single", value: selectedKey, defaultValue: defaultSelectedKey, onChange: onSelectionChange, menuTrigger: "focus", isReadOnly: isReadOnly, "data-readonly": isReadOnly ? true : undefined, validate: validate
41
43
  ? ({ inputValue, value }) => {
42
44
  return validate({ inputValue, selectedKey: value });
43
45
  }
44
- : undefined, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-combo-box-input-group", children: [_jsx(ComboBoxInput, { inputRef: inputRef, isReadOnly: isReadOnly, placeholder: placeholder }), _jsx(RACButton, { className: "cim-combo-box-button", children: _jsx(IconChevronDown, {}) })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? (_jsx(RACVirtualizer, { layout: RACListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
46
+ : undefined, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-combo-box-input-group", children: [_jsx(ComboBoxInput, { inputRef: inputRef, isReadOnly: isReadOnly, placeholder: placeholder, isClearable: isFieldClearable }), isFieldClearable && _jsx(ComboBoxClearButton, {}), _jsx(RACButton, { className: "cim-combo-box-button", children: _jsx(IconChevronDown, {}) })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? (_jsx(RACVirtualizer, { layout: RACListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
45
47
  }
46
48
  /**
47
49
  * Allows users to filter a collapsible list and select one item from it.
@@ -50,12 +52,28 @@ function ComboBox({ label, description, error, items, children, placeholder, UNS
50
52
  */
51
53
  const _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');
52
54
  export { _ComboBox as ComboBox };
53
- function ComboBoxInput({ inputRef, isReadOnly, placeholder, }) {
55
+ function ComboBoxClearButton() {
56
+ const comboBoxState = useContext(RACComboBoxStateContext);
57
+ const inputValue = comboBoxState?.inputValue;
58
+ if (!comboBoxState || inputValue === '') {
59
+ return null;
60
+ }
61
+ return (_jsx(XButton, { onPress: () => {
62
+ comboBoxState?.setValue(null);
63
+ }, iconType: "circled", "aria-label": "Clear selection",
64
+ // Prevent this button from acting as a trigger for opening/closing the ComboBox
65
+ slot: null, excludeFromTabOrder: true }));
66
+ }
67
+ function ComboBoxInput({ inputRef, isReadOnly, placeholder, isClearable, }) {
54
68
  const comboBoxState = useContext(RACComboBoxStateContext);
55
69
  return (_jsx(RACInput, { ref: inputRef, className: clsx('cim-combo-box-input', textStyle({ variant: 'body' })),
56
70
  // Ensure the popover opens when the input is clicked.
57
71
  // By default, React Aria only opens the popover when the input is focused.
58
- onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder }));
72
+ onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder, onKeyDown: (e) => {
73
+ if (e.key === 'Escape' && !comboBoxState?.isOpen && isClearable) {
74
+ comboBoxState?.setValue(null);
75
+ }
76
+ } }));
59
77
  }
60
78
  function ComboBoxList({ items, children, isLoading, onLoadMore, onScroll, }) {
61
79
  const comboBoxState = useContext(RACComboBoxStateContext);
@@ -66,7 +84,7 @@ function ComboBoxList({ items, children, isLoading, onLoadMore, onScroll, }) {
66
84
  /** Renders a single list item within `ComboBox`. */
67
85
  export function ComboBoxItem({ children, ...props }) {
68
86
  const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
69
- return (_jsx(RACListBoxItem, { ...props, className: "cim-combo-box-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(IconCheck, {}), _jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
87
+ return (_jsx(RACListBoxItem, { ...props, className: "cim-combo-box-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(IconCheckBold, {}), _jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
70
88
  }
71
89
  ComboBoxItem.displayName = 'ComboBoxItem';
72
90
  /** Groups list items within `ComboBox` into a section. */
@@ -1 +1 @@
1
- {"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAIL,UAAU,EACV,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,oBAAoB,IAAI,uBAAuB,EAC/C,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,QAAQ,EACjB,OAAO,IAAI,UAAU,EACrB,mBAAmB,IAAI,sBAAsB,EAC7C,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,UAAU,IAAI,aAAa,EAE3B,IAAI,IAAI,OAAO,EAGf,WAAW,IAAI,cAAc,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,E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C,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,IACT,CACJ,GACc,CAClB,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAS1C,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAA2B,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACgB;IACxB,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport {\n type ForwardedRef,\n type MutableRefObject,\n type UIEventHandler,\n useContext,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { usePreventScroll } from 'react-aria';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n ComboBoxStateContext as RACComboBoxStateContext,\n Group as RACGroup,\n Header as RACHeader,\n Input as RACInput,\n ListBox as RACListBox,\n ListBoxLoadMoreItem as RACListBoxLoadMoreItem,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Text as RACText,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\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 ApiProps,\n AsyncItemLoadingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n estimatedRowHeight: 40,\n estimatedHeadingHeight: 32,\n loaderHeight: 40,\n padding: 0,\n gap: 0,\n};\n\n/** Represents the state of the `ComboBox` component for validation purposes. */\nexport interface ComboBoxValidationValue {\n /** The selected key in the ComboBox. */\n selectedKey: Key | null;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T extends CollectionItem = CollectionItem>\n extends\n CommonProps,\n FieldWithPlaceholderProps<ComboBoxValidationValue>,\n CollectionProps<T>,\n AsyncItemLoadingProps,\n ApiProps<ComboBoxApi>,\n Pick<\n RACComboBoxProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onInputChange'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n > {\n /** The currently selected key in the collection (controlled). */\n selectedKey?: Key | null;\n /** The initial selected key in the collection (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (key: Key | null) => void;\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 /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** The imperative API exposed by the `ComboBox` component. */\nexport interface ComboBoxApi {\n /** Focuses the input field and opens the list of items. */\n focus: () => void;\n /** Selects the contents of the input field. */\n select: () => void;\n}\n\nfunction ComboBox<T extends CollectionItem>(\n {\n label,\n description,\n error,\n items,\n children,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n isReadOnly,\n onScroll,\n isVirtualized = false,\n UNSTABLE_isLoading: isLoading,\n UNSTABLE_onLoadMore: onLoadMore,\n apiRef,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n validate,\n ...props\n }: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('ComboBox 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('`ComboBox` requires `children` to be a function when using `items` prop');\n }\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n select: () => inputRef.current?.select(),\n }),\n [],\n );\n\n const listBox = (\n <ComboBoxList<T> items={items} isLoading={isLoading} onLoadMore={onLoadMore} onScroll={onScroll}>\n {children}\n </ComboBoxList>\n );\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', UNSAFE_className)}\n style={UNSAFE_style}\n selectionMode=\"single\"\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n onChange={onSelectionChange}\n menuTrigger=\"focus\"\n isReadOnly={isReadOnly}\n data-readonly={isReadOnly ? true : undefined}\n validate={\n validate\n ? ({ inputValue, value }) => {\n return validate({ inputValue, selectedKey: value });\n }\n : undefined\n }\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-combo-box-input-group\">\n <ComboBoxInput inputRef={inputRef} isReadOnly={isReadOnly} placeholder={placeholder} />\n <RACButton className=\"cim-combo-box-button\">\n <IconChevronDown />\n </RACButton>\n </RACGroup>\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 </RACComboBox>\n );\n}\n\n/**\n * Allows users to filter a collapsible list and select one item from it.\n *\n * See [combo box usage guidelines](https://ui.cimpress.io/components/combo-box)\n */\nconst _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');\n\nexport { _ComboBox as ComboBox };\n\nfunction ComboBoxInput({\n inputRef,\n isReadOnly,\n placeholder,\n}: {\n inputRef: MutableRefObject<HTMLInputElement | null>;\n isReadOnly: boolean | undefined;\n placeholder: string | undefined;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n\n return (\n <RACInput\n ref={inputRef}\n className={clsx('cim-combo-box-input', textStyle({ variant: 'body' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState!.open()}\n placeholder={placeholder}\n />\n );\n}\n\nfunction ComboBoxList<T extends CollectionItem = CollectionItem>({\n items,\n children,\n isLoading,\n onLoadMore,\n onScroll,\n}: Pick<ComboBoxProps<T>, 'items' | 'children' | 'onScroll'> & {\n isLoading: ComboBoxProps['UNSTABLE_isLoading'];\n onLoadMore: ComboBoxProps['UNSTABLE_onLoadMore'];\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const collectionMessages = useLocalizedMessages('UNSTABLE_collection');\n\n usePreventScroll({ isDisabled: !comboBoxState?.isOpen });\n\n return (\n <RACListBox\n className=\"cim-combo-box-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\nexport interface ComboBoxItemProps<T extends CollectionItem> extends Pick<\n RACListBoxItemProps<T>,\n 'isDisabled' | 'onHoverStart' | 'onHoverEnd'\n> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `ComboBox`. */\nexport function ComboBoxItem<T extends CollectionItem>({ children, ...props }: ComboBoxItemProps<T>) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-combo-box-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\nComboBoxItem.displayName = 'ComboBoxItem';\n\nexport interface ComboBoxSectionProps<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 `ComboBox` into a section. */\nexport function ComboBoxSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: ComboBoxSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`ComboBoxSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-combo-box-section\">\n <RACHeader\n className={clsx('cim-combo-box-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nComboBoxSection.displayName = 'ComboBoxSection';\n"]}
1
+ {"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAIL,UAAU,EACV,mBAAmB,EACnB,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,oBAAoB,IAAI,uBAAuB,EAC/C,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,QAAQ,EACjB,OAAO,IAAI,UAAU,EACrB,mBAAmB,IAAI,sBAAsB,EAC7C,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,UAAU,IAAI,aAAa,EAE3B,IAAI,IAAI,OAAO,EAGf,WAAW,IAAI,cAAc,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CA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EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport {\n type ForwardedRef,\n type MutableRefObject,\n type UIEventHandler,\n useContext,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { usePreventScroll } from 'react-aria';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n ComboBoxStateContext as RACComboBoxStateContext,\n Group as RACGroup,\n Header as RACHeader,\n Input as RACInput,\n ListBox as RACListBox,\n ListBoxLoadMoreItem as RACListBoxLoadMoreItem,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Text as RACText,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheckBold, 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 { XButton } from '../internal/x-button/x-button.js';\nimport { Spinner } from '../spinner/spinner.js';\nimport type {\n ApiProps,\n AsyncItemLoadingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n estimatedRowHeight: 40,\n estimatedHeadingHeight: 32,\n loaderHeight: 40,\n padding: 0,\n gap: 0,\n};\n\n/** Represents the state of the `ComboBox` component for validation purposes. */\nexport interface ComboBoxValidationValue {\n /** The selected key in the ComboBox. */\n selectedKey: Key | null;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T extends CollectionItem = CollectionItem>\n extends\n CommonProps,\n FieldWithPlaceholderProps<ComboBoxValidationValue>,\n CollectionProps<T>,\n AsyncItemLoadingProps,\n ApiProps<ComboBoxApi>,\n Pick<\n RACComboBoxProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onInputChange'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n > {\n /** The currently selected key in the collection (controlled). */\n selectedKey?: Key | null;\n /** The initial selected key in the collection (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (key: Key | null) => void;\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 /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n UNSTABLE_isClearable?: boolean;\n}\n\n/** The imperative API exposed by the `ComboBox` component. */\nexport interface ComboBoxApi {\n /** Focuses the input field and opens the list of items. */\n focus: () => void;\n /** Selects the contents of the input field. */\n select: () => void;\n}\n\nfunction ComboBox<T extends CollectionItem>(\n {\n label,\n description,\n error,\n items,\n children,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n isReadOnly,\n onScroll,\n isVirtualized = false,\n UNSTABLE_isLoading: isLoading,\n UNSTABLE_onLoadMore: onLoadMore,\n UNSTABLE_isClearable: isClearable = false,\n apiRef,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n validate,\n ...props\n }: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('ComboBox 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('`ComboBox` requires `children` to be a function when using `items` prop');\n }\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n select: () => inputRef.current?.select(),\n }),\n [],\n );\n\n const isFieldClearable = isClearable && !props.isDisabled && !isReadOnly;\n\n const listBox = (\n <ComboBoxList<T> items={items} isLoading={isLoading} onLoadMore={onLoadMore} onScroll={onScroll}>\n {children}\n </ComboBoxList>\n );\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', UNSAFE_className)}\n style={UNSAFE_style}\n selectionMode=\"single\"\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n onChange={onSelectionChange}\n menuTrigger=\"focus\"\n isReadOnly={isReadOnly}\n data-readonly={isReadOnly ? true : undefined}\n validate={\n validate\n ? ({ inputValue, value }) => {\n return validate({ inputValue, selectedKey: value });\n }\n : undefined\n }\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-combo-box-input-group\">\n <ComboBoxInput\n inputRef={inputRef}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n isClearable={isFieldClearable}\n />\n {isFieldClearable && <ComboBoxClearButton />}\n <RACButton className=\"cim-combo-box-button\">\n <IconChevronDown />\n </RACButton>\n </RACGroup>\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 </RACComboBox>\n );\n}\n\n/**\n * Allows users to filter a collapsible list and select one item from it.\n *\n * See [combo box usage guidelines](https://ui.cimpress.io/components/combo-box)\n */\nconst _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');\n\nexport { _ComboBox as ComboBox };\n\nfunction ComboBoxClearButton() {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const inputValue = comboBoxState?.inputValue;\n\n if (!comboBoxState || inputValue === '') {\n return null;\n }\n\n return (\n <XButton\n onPress={() => {\n comboBoxState?.setValue(null);\n }}\n iconType=\"circled\"\n // TODO: i18n once stabilized\n aria-label=\"Clear selection\"\n // Prevent this button from acting as a trigger for opening/closing the ComboBox\n slot={null}\n excludeFromTabOrder\n />\n );\n}\n\nfunction ComboBoxInput({\n inputRef,\n isReadOnly,\n placeholder,\n isClearable,\n}: {\n inputRef: MutableRefObject<HTMLInputElement | null>;\n isReadOnly: boolean | undefined;\n placeholder: string | undefined;\n isClearable: boolean;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n\n return (\n <RACInput\n ref={inputRef}\n className={clsx('cim-combo-box-input', textStyle({ variant: 'body' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState!.open()}\n placeholder={placeholder}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && !comboBoxState?.isOpen && isClearable) {\n comboBoxState?.setValue(null);\n }\n }}\n />\n );\n}\n\nfunction ComboBoxList<T extends CollectionItem = CollectionItem>({\n items,\n children,\n isLoading,\n onLoadMore,\n onScroll,\n}: Pick<ComboBoxProps<T>, 'items' | 'children' | 'onScroll'> & {\n isLoading: ComboBoxProps['UNSTABLE_isLoading'];\n onLoadMore: ComboBoxProps['UNSTABLE_onLoadMore'];\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const collectionMessages = useLocalizedMessages('UNSTABLE_collection');\n\n usePreventScroll({ isDisabled: !comboBoxState?.isOpen });\n\n return (\n <RACListBox\n className=\"cim-combo-box-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\nexport interface ComboBoxItemProps<T extends CollectionItem> extends Pick<\n RACListBoxItemProps<T>,\n 'isDisabled' | 'onHoverStart' | 'onHoverEnd'\n> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `ComboBox`. */\nexport function ComboBoxItem<T extends CollectionItem>({ children, ...props }: ComboBoxItemProps<T>) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-combo-box-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckBold />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nComboBoxItem.displayName = 'ComboBoxItem';\n\nexport interface ComboBoxSectionProps<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 `ComboBox` into a section. */\nexport function ComboBoxSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: ComboBoxSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`ComboBoxSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-combo-box-section\">\n <RACHeader\n className={clsx('cim-combo-box-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nComboBoxSection.displayName = 'ComboBoxSection';\n"]}
@@ -1,15 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import clsx from 'clsx';
3
3
  import { IconCheckBold, IconSubtractBold } from '../../../icons/index.js';
4
- // TODO: refactor so that state is accepted through props/context instead of a parent className
5
4
  /**
6
5
  * Displays a non-interactive, purely visual checkbox indicator.
7
- * Requires adding a `cim-checkbox-indicator-wrapper` className to the parent element.
8
6
  *
9
7
  * @internal
10
8
  */
11
- export function CheckboxIndicator({ isSelected, isIndeterminate, UNSAFE_className, UNSAFE_style, ...props }) {
12
- return (_jsx("div", { ...props, className: clsx('cim-checkbox-indicator', UNSAFE_className), style: UNSAFE_style, "data-selected": isSelected, "aria-hidden": true, children: _jsx("div", { className: "cim-checkbox-indicator-icon", children: isIndeterminate ? _jsx(IconSubtractBold, {}) : _jsx(IconCheckBold, {}) }) }));
9
+ export function CheckboxIndicator({ isSelected, isIndeterminate, isDisabled, isReadOnly, isInvalid, isHovered, isPressed, isFocusVisible, UNSAFE_className, UNSAFE_style, ...props }) {
10
+ return (_jsx("div", { ...props, className: clsx('cim-checkbox-indicator', UNSAFE_className), style: UNSAFE_style, "data-selected": isSelected || undefined, "data-indeterminate": isIndeterminate || undefined, "data-disabled": isDisabled || undefined, "data-readonly": isReadOnly || undefined, "data-invalid": isInvalid || undefined, "data-hovered": isHovered || undefined, "data-pressed": isPressed || undefined, "data-focus-visible": isFocusVisible || undefined, "aria-hidden": true, children: _jsx("div", { className: "cim-checkbox-indicator-icon", children: isIndeterminate ? _jsx(IconSubtractBold, {}) : _jsx(IconCheckBold, {}) }) }));
13
11
  }
14
12
  CheckboxIndicator.displayName = 'CheckboxIndicator';
15
13
  //# sourceMappingURL=checkbox-indicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-indicator.js","sourceRoot":"","sources":["../../../../../src/components/internal/checkbox-indicator/checkbox-indicator.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK1E,+FAA+F;AAC/F;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACe;IACvB,OAAO,CACL,iBACM,KAAK,EACT,SAAS,EAAE,IAAI,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,EAC3D,KAAK,EAAE,YAAY,mBACJ,UAAU,iCAGzB,cAAK,SAAS,EAAC,6BAA6B,YAAE,eAAe,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,GAAO,GAC3G,CACP,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { CheckboxProps as RACCheckboxProps } from 'react-aria-components';\nimport { IconCheckBold, IconSubtractBold } from '../../../icons/index.js';\nimport type { CommonProps } from '../../types.js';\n\ninterface CheckboxIndicatorProps extends CommonProps, Pick<RACCheckboxProps, 'isSelected' | 'isIndeterminate'> {}\n\n// TODO: refactor so that state is accepted through props/context instead of a parent className\n/**\n * Displays a non-interactive, purely visual checkbox indicator.\n * Requires adding a `cim-checkbox-indicator-wrapper` className to the parent element.\n *\n * @internal\n */\nexport function CheckboxIndicator({\n isSelected,\n isIndeterminate,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n}: CheckboxIndicatorProps) {\n return (\n <div\n {...props}\n className={clsx('cim-checkbox-indicator', UNSAFE_className)}\n style={UNSAFE_style}\n data-selected={isSelected}\n aria-hidden\n >\n <div className=\"cim-checkbox-indicator-icon\">{isIndeterminate ? <IconSubtractBold /> : <IconCheckBold />}</div>\n </div>\n );\n}\n\nCheckboxIndicator.displayName = 'CheckboxIndicator';\n"]}
1
+ {"version":3,"file":"checkbox-indicator.js","sourceRoot":"","sources":["../../../../../src/components/internal/checkbox-indicator/checkbox-indicator.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAc1E;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,UAAU,EACV,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACe;IACvB,OAAO,CACL,iBACM,KAAK,EACT,SAAS,EAAE,IAAI,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,EAC3D,KAAK,EAAE,YAAY,mBACJ,UAAU,IAAI,SAAS,wBAClB,eAAe,IAAI,SAAS,mBACjC,UAAU,IAAI,SAAS,mBACvB,UAAU,IAAI,SAAS,kBACxB,SAAS,IAAI,SAAS,kBACtB,SAAS,IAAI,SAAS,kBACtB,SAAS,IAAI,SAAS,wBAChB,cAAc,IAAI,SAAS,iCAG/C,cAAK,SAAS,EAAC,6BAA6B,YAAE,eAAe,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,GAAO,GAC3G,CACP,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { IconCheckBold, IconSubtractBold } from '../../../icons/index.js';\nimport type { CommonProps } from '../../types.js';\n\ninterface CheckboxIndicatorProps extends CommonProps {\n isSelected?: boolean;\n isIndeterminate?: boolean;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n isHovered?: boolean;\n isPressed?: boolean;\n isFocusVisible?: boolean;\n}\n\n/**\n * Displays a non-interactive, purely visual checkbox indicator.\n *\n * @internal\n */\nexport function CheckboxIndicator({\n isSelected,\n isIndeterminate,\n isDisabled,\n isReadOnly,\n isInvalid,\n isHovered,\n isPressed,\n isFocusVisible,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n}: CheckboxIndicatorProps) {\n return (\n <div\n {...props}\n className={clsx('cim-checkbox-indicator', UNSAFE_className)}\n style={UNSAFE_style}\n data-selected={isSelected || undefined}\n data-indeterminate={isIndeterminate || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n data-invalid={isInvalid || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n aria-hidden\n >\n <div className=\"cim-checkbox-indicator-icon\">{isIndeterminate ? <IconSubtractBold /> : <IconCheckBold />}</div>\n </div>\n );\n}\n\nCheckboxIndicator.displayName = 'CheckboxIndicator';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible-list.js","sourceRoot":"","sources":["../../../../../src/components/internal/collapsible-list/collapsible-list.tsx"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAwC,MAAM,uBAAuB,CAAC;AAOpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAuC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC/G,KAAC,UAAU,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,sBAAsB,EAAC,gBAAgB,EAAE,EAAE,yCACnF,QAAQ,GACE,CACd,CAAC,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { forwardRef } from 'react';\nimport { Popover as RACPopover, type PopoverProps as RACPopoverProps } from 'react-aria-components';\n\ninterface CollapsibleListProps extends Pick<\n RACPopoverProps,\n 'placement' | 'offset' | 'maxHeight' | 'children' | 'triggerRef' | 'isNonModal'\n> {}\n\n/**\n * Displays a collapsible list activated via a trigger element.\n *\n * @internal\n */\nexport const CollapsibleList = forwardRef<HTMLDivElement, CollapsibleListProps>(({ children, ...props }, ref) => (\n <RACPopover {...props} ref={ref} className=\"cim-collapsible-list\" containerPadding={16} data-cim-style-root>\n {children}\n </RACPopover>\n));\n\nCollapsibleList.displayName = 'CollapsibleList';\n"]}
1
+ {"version":3,"file":"collapsible-list.js","sourceRoot":"","sources":["../../../../../src/components/internal/collapsible-list/collapsible-list.tsx"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAwC,MAAM,uBAAuB,CAAC;AAOpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAuC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC/G,KAAC,UAAU,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,sBAAsB,EAAC,gBAAgB,EAAE,EAAE,yCACnF,QAAQ,GACE,CACd,CAAC,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["// eslint-disable-next-line no-restricted-imports\nimport { forwardRef } from 'react';\nimport { Popover as RACPopover, type PopoverProps as RACPopoverProps } from 'react-aria-components';\n\ninterface CollapsibleListProps extends Pick<\n RACPopoverProps,\n 'placement' | 'offset' | 'crossOffset' | 'maxHeight' | 'children' | 'triggerRef' | 'isNonModal'\n> {}\n\n/**\n * Displays a collapsible list activated via a trigger element.\n *\n * @internal\n */\nexport const CollapsibleList = forwardRef<HTMLDivElement, CollapsibleListProps>(({ children, ...props }, ref) => (\n <RACPopover {...props} ref={ref} className=\"cim-collapsible-list\" containerPadding={16} data-cim-style-root>\n {children}\n </RACPopover>\n));\n\nCollapsibleList.displayName = 'CollapsibleList';\n"]}
@@ -1,4 +1,4 @@
1
- import type { ReactNode, UIEventHandler } from 'react';
1
+ import { type ReactElement, type ReactNode, type UIEventHandler } from 'react';
2
2
  import { type MenuProps as RACMenuProps, type MenuItemProps as RACMenuItemProps, type MenuSectionProps as RACMenuSectionProps, type MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';
3
3
  import type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';
4
4
  export interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {
@@ -14,6 +14,19 @@ export declare function MenuRoot(props: MenuRootProps): import("react/jsx-runtim
14
14
  export declare namespace MenuRoot {
15
15
  var displayName: string;
16
16
  }
17
+ export interface SubmenuRootProps {
18
+ /** The submenu trigger with its associated menu. Provide the item trigger as the first child, and the menu as the second child. */
19
+ children: ReactElement[];
20
+ }
21
+ /**
22
+ * Encapsulates a submenu trigger and its associated menu. The trigger must be a `MenuItem`, and the menu will be displayed when the trigger is hovered or focused.
23
+ *
24
+ * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).
25
+ */
26
+ export declare function SubmenuRoot({ children, ...props }: SubmenuRootProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare namespace SubmenuRoot {
28
+ var displayName: string;
29
+ }
17
30
  export interface MenuProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T>, Pick<RACMenuProps<T>, 'selectedKeys' | 'onSelectionChange' | 'selectionMode'> {
18
31
  /**
19
32
  * The alignment of the menu overlay relative to its trigger.
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAIL,KAAK,SAAS,IAAI,YAAY,EAE9B,KAAK,aAAa,IAAI,gBAAgB,EAEtC,KAAK,gBAAgB,IAAI,mBAAmB,EAE5C,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG7G,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,QAAQ,GAAG,aAAa,CAAC;IACzG,2HAA2H;IAC3H,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAE5C;yBAFe,QAAQ;;;AAMxB,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAClE,SAAQ,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,cAAc,GAAG,mBAAmB,GAAG,eAAe,CAAC;IACzG;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,wHAAwH;IACxH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C;AAED,qFAAqF;AACrF,wBAAg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AAE,SAAS,CAAC,CAAC,CAAC,2CAiBzF;yBAjBe,IAAI;;;AAqBpB,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACzE,SAAQ,eAAe,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,cAAc,GAAG,mBAAmB,GAAG,eAAe,CAAC;IAChH,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAa9G;yBAbe,WAAW;;;AAiB3B,MAAM,WAAW,aACf,SAAQ,eAAe,EAAE,IAAI,CAAC,gBAAgB,EAAE,YAAY,GAAG,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC;IAC1G,0EAA0E;IAC1E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,gDAAgD;AAChD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAiChF;yBAjCe,QAAQ"}
@@ -1,12 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import clsx from 'clsx';
4
- import { Collection as RACCollection, Header as RACHeader, Menu as RACMenu, MenuItem as RACMenuItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Text as RACText, } from 'react-aria-components';
5
- import { IconCheckBold } from '../../icons/index.js';
4
+ import { Children, createContext, useContext } from 'react';
5
+ import { Collection as RACCollection, Header as RACHeader, Menu as RACMenu, MenuItem as RACMenuItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, SubmenuTrigger as RACSubmenuTrigger, Text as RACText, } from 'react-aria-components';
6
+ import { IconCheckBold, IconChevronRight } from '../../icons/index.js';
6
7
  import { isProduction } from '../../utils/is-production.js';
7
8
  import { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';
8
9
  import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
9
10
  import { textStyle } from '../typography/utils.js';
11
+ const SubmenuContext = createContext(false);
10
12
  /**
11
13
  * Encapsulates a menu trigger and its associated menu. The trigger can be any Cimpress UI button, and the menu will be displayed when the trigger is activated.
12
14
  *
@@ -16,12 +18,23 @@ export function MenuRoot(props) {
16
18
  return _jsx(RACMenuTrigger, { ...props });
17
19
  }
18
20
  MenuRoot.displayName = 'MenuRoot';
21
+ /**
22
+ * Encapsulates a submenu trigger and its associated menu. The trigger must be a `MenuItem`, and the menu will be displayed when the trigger is hovered or focused.
23
+ *
24
+ * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).
25
+ */
26
+ export function SubmenuRoot({ children, ...props }) {
27
+ const [trigger, menu] = Children.toArray(children);
28
+ return (_jsxs(RACSubmenuTrigger, { ...props, delay: 0, children: [trigger, _jsx(SubmenuContext.Provider, { value: true, children: menu })] }));
29
+ }
30
+ SubmenuRoot.displayName = 'SubmenuRoot';
19
31
  /** Displays a collapsible list of options and actions that users can choose from. */
20
32
  export function Menu({ align = 'start', ...props }) {
21
33
  if (!isProduction() && props.items != null && typeof props.children !== 'function') {
22
34
  console.warn('`Menu` requires `children` to be a function when using `items` prop');
23
35
  }
24
- return (_jsx(CollapsibleList, { placement: `bottom ${align}`, offset: 5, maxHeight: 315, children: _jsx(RACMenu, { ...props, className: "cim-menu" }) }));
36
+ const isSubmenu = useContext(SubmenuContext);
37
+ return (_jsx(CollapsibleList, { placement: isSubmenu ? 'end top' : `bottom ${align}`, offset: isSubmenu ? -1 : 5, crossOffset: isSubmenu ? -8 : undefined, maxHeight: 315, children: _jsx(RACMenu, { ...props, className: "cim-menu" }) }));
25
38
  }
26
39
  Menu.displayName = 'Menu';
27
40
  /** Groups list items within `Menu` into a section. */
@@ -35,7 +48,7 @@ MenuSection.displayName = 'MenuSection';
35
48
  /** Renders a single list item within `Menu`. */
36
49
  export function MenuItem({ children, description, icon, ...props }) {
37
50
  const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
38
- return (_jsx(RACMenuItem, { ...props, className: "cim-menu-item cim-checkbox-indicator-wrapper", textValue: textValue, children: ({ isDisabled, isSelected, selectionMode }) => (_jsxs(_Fragment, { children: [selectionMode === 'single' && _jsx(IconCheckBold, { UNSAFE_className: "cim-menu-item-selection-indicator" }), selectionMode === 'multiple' && _jsx(CheckboxIndicator, { isSelected: isSelected }), icon, _jsxs("div", { className: "cim-menu-item-text", children: [_jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children }), description && (_jsx(RACText, { slot: "description", className: textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' }), children: description }))] })] })) }));
51
+ return (_jsx(RACMenuItem, { ...props, className: "cim-menu-item", textValue: textValue, children: ({ isDisabled, isSelected, selectionMode, hasSubmenu }) => (_jsxs(_Fragment, { children: [selectionMode === 'single' && _jsx(IconCheckBold, { UNSAFE_className: "cim-menu-item-selection-indicator" }), selectionMode === 'multiple' && _jsx(CheckboxIndicator, { isSelected: isSelected, isDisabled: isDisabled }), icon, _jsxs("div", { className: "cim-menu-item-text", children: [_jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children }), description && (_jsx(RACText, { slot: "description", className: textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' }), children: description }))] }), hasSubmenu && _jsx(IconChevronRight, { size: 24, UNSAFE_className: "cim-menu-item-submenu-indicator" })] })) }));
39
52
  }
40
53
  MenuItem.displayName = 'MenuItem';
41
54
  //# sourceMappingURL=menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EAEf,QAAQ,IAAI,WAAW,EAEvB,WAAW,IAAI,cAAc,EAE7B,WAAW,IAAI,cAAc,EAE7B,IAAI,IAAI,OAAO,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOnD;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,KAAC,cAAc,OAAK,KAAK,GAAI,CAAC;AACvC,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAelC,qFAAqF;AACrF,MAAM,UAAU,IAAI,CAA2B,EAAE,KAAK,GAAG,OAAO,EAAE,GAAG,KAAK,EAAgB;IACxF,IAAI,CAAC,YAAY,EAAE,IAAI,KAAK,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnF,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,CACL,KAAC,eAAe,IACd,SAAS,EAAE,UAAU,KAAK,EAAE,E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E,SAAS,YAClG,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAC9C,8BACG,aAAa,KAAK,QAAQ,IAAI,KAAC,aAAa,IAAC,gBAAgB,EAAC,mCAAmC,GAAG,EACpG,aAAa,KAAK,UAAU,IAAI,KAAC,iBAAiB,IAAC,UAAU,EAAE,UAAU,GAAI,EAE7E,IAAI,EAEL,eAAK,SAAS,EAAC,oBAAoB,aACjC,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,EAET,WAAW,IAAI,CACd,KAAC,OAAO,IACN,IAAI,EAAC,aAAa,EAClB,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,YAEhF,WAAW,GACJ,CACX,IACG,IACL,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode, UIEventHandler } from 'react';\nimport {\n Collection as RACCollection,\n Header as RACHeader,\n Menu as RACMenu,\n type MenuProps as RACMenuProps,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuSection as RACMenuSection,\n type MenuSectionProps as RACMenuSectionProps,\n MenuTrigger as RACMenuTrigger,\n type MenuTriggerProps as RACMenuTriggerProps,\n Text as RACText,\n} from 'react-aria-components';\nimport { IconCheckBold } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {\n /** The menu trigger with its associated menu. Provide the trigger as the first child, and the menu as the second child. */\n children: ReactNode;\n}\n\n/**\n * Encapsulates a menu trigger and its associated menu. The trigger can be any Cimpress UI button, and the menu will be displayed when the trigger is activated.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nexport function MenuRoot(props: MenuRootProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nMenuRoot.displayName = 'MenuRoot';\n\nexport interface MenuProps<T extends CollectionItem = CollectionItem>\n extends CollectionProps<T>, Pick<RACMenuProps<T>, 'selectedKeys' | 'onSelectionChange' | 'selectionMode'> {\n /**\n * The alignment of the menu overlay relative to its trigger.\n * @default 'start'\n */\n align?: 'start' | 'end';\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** Displays a collapsible list of options and actions that users can choose from. */\nexport function Menu<T extends CollectionItem>({ align = 'start', ...props }: MenuProps<T>) {\n if (!isProduction() && props.items != null && typeof props.children !== 'function') {\n console.warn('`Menu` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <CollapsibleList\n placement={`bottom ${align}`}\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACMenu {...props} className=\"cim-menu\" />\n </CollapsibleList>\n );\n}\n\nMenu.displayName = 'Menu';\n\nexport interface MenuSectionProps<T extends CollectionItem = CollectionItem>\n extends CollectionProps<T>, Pick<RACMenuSectionProps<T>, 'selectedKeys' | 'onSelectionChange' | 'selectionMode'> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Menu` into a section. */\nexport function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`MenuSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACMenuSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends NavigationProps, Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** Additional description for the menu item. */\n description?: string;\n /** An icon representing the menu item. */\n icon?: ReactNode;\n}\n\n/** Renders a single list item within `Menu`. */\nexport function MenuItem({ children, description, icon, ...props }: MenuItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACMenuItem {...props} className=\"cim-menu-item cim-checkbox-indicator-wrapper\" textValue={textValue}>\n {({ isDisabled, isSelected, selectionMode }) => (\n <>\n {selectionMode === 'single' && <IconCheckBold UNSAFE_className=\"cim-menu-item-selection-indicator\" />}\n {selectionMode === 'multiple' && <CheckboxIndicator isSelected={isSelected} />}\n\n {icon}\n\n <div className=\"cim-menu-item-text\">\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n\n {description && (\n <RACText\n slot=\"description\"\n className={textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' })}\n >\n {description}\n </RACText>\n )}\n </div>\n </>\n )}\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n"]}
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/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EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,YAEhF,WAAW,GACJ,CACX,IACG,EAEL,UAAU,IAAI,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,gBAAgB,EAAC,iCAAiC,GAAG,IAC/F,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { Children, createContext, useContext, type ReactElement, type ReactNode, type UIEventHandler } from 'react';\nimport {\n Collection as RACCollection,\n Header as RACHeader,\n Menu as RACMenu,\n type MenuProps as RACMenuProps,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuSection as RACMenuSection,\n type MenuSectionProps as RACMenuSectionProps,\n MenuTrigger as RACMenuTrigger,\n type MenuTriggerProps as RACMenuTriggerProps,\n SubmenuTrigger as RACSubmenuTrigger,\n Text as RACText,\n} from 'react-aria-components';\nimport { IconCheckBold, IconChevronRight } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { CheckboxIndicator } from '../internal/checkbox-indicator/checkbox-indicator.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst SubmenuContext = createContext(false);\n\nexport interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {\n /** The menu trigger with its associated menu. Provide the trigger as the first child, and the menu as the second child. */\n children: ReactNode;\n}\n\n/**\n * Encapsulates a menu trigger and its associated menu. The trigger can be any Cimpress UI button, and the menu will be displayed when the trigger is activated.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nexport function MenuRoot(props: MenuRootProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nMenuRoot.displayName = 'MenuRoot';\n\nexport interface SubmenuRootProps {\n /** The submenu trigger with its associated menu. Provide the item trigger as the first child, and the menu as the second child. */\n children: ReactElement[];\n}\n\n/**\n * Encapsulates a submenu trigger and its associated menu. The trigger must be a `MenuItem`, and the menu will be displayed when the trigger is hovered or focused.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nexport function SubmenuRoot({ children, ...props }: SubmenuRootProps) {\n const [trigger, menu] = Children.toArray(children) as ReactElement[];\n\n return (\n <RACSubmenuTrigger {...props} delay={0}>\n {trigger!}\n <SubmenuContext.Provider value={true}>{menu!}</SubmenuContext.Provider>\n </RACSubmenuTrigger>\n );\n}\n\nSubmenuRoot.displayName = 'SubmenuRoot';\n\nexport interface MenuProps<T extends CollectionItem = CollectionItem>\n extends CollectionProps<T>, Pick<RACMenuProps<T>, 'selectedKeys' | 'onSelectionChange' | 'selectionMode'> {\n /**\n * The alignment of the menu overlay relative to its trigger.\n * @default 'start'\n */\n align?: 'start' | 'end';\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** Displays a collapsible list of options and actions that users can choose from. */\nexport function Menu<T extends CollectionItem>({ align = 'start', ...props }: MenuProps<T>) {\n if (!isProduction() && props.items != null && typeof props.children !== 'function') {\n console.warn('`Menu` requires `children` to be a function when using `items` prop');\n }\n\n const isSubmenu = useContext(SubmenuContext);\n\n return (\n <CollapsibleList\n placement={isSubmenu ? 'end top' : `bottom ${align}`}\n offset={isSubmenu ? -1 : 5} // 1px border + 4px actual offset\n crossOffset={isSubmenu ? -8 : undefined}\n maxHeight={315}\n >\n <RACMenu {...props} className=\"cim-menu\" />\n </CollapsibleList>\n );\n}\n\nMenu.displayName = 'Menu';\n\nexport interface MenuSectionProps<T extends CollectionItem = CollectionItem>\n extends CollectionProps<T>, Pick<RACMenuSectionProps<T>, 'selectedKeys' | 'onSelectionChange' | 'selectionMode'> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Menu` into a section. */\nexport function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`MenuSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACMenuSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends NavigationProps, Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** Additional description for the menu item. */\n description?: string;\n /** An icon representing the menu item. */\n icon?: ReactNode;\n}\n\n/** Renders a single list item within `Menu`. */\nexport function MenuItem({ children, description, icon, ...props }: MenuItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={textValue}>\n {({ isDisabled, isSelected, selectionMode, hasSubmenu }) => (\n <>\n {selectionMode === 'single' && <IconCheckBold UNSAFE_className=\"cim-menu-item-selection-indicator\" />}\n {selectionMode === 'multiple' && <CheckboxIndicator isSelected={isSelected} isDisabled={isDisabled} />}\n\n {icon}\n\n <div className=\"cim-menu-item-text\">\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n\n {description && (\n <RACText\n slot=\"description\"\n className={textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' })}\n >\n {description}\n </RACText>\n )}\n </div>\n\n {hasSubmenu && <IconChevronRight size={24} UNSAFE_className=\"cim-menu-item-submenu-indicator\" />}\n </>\n )}\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n"]}
@@ -31,7 +31,7 @@ export interface SelectProps<T extends CollectionItem = CollectionItem, M extend
31
31
  * How the selected value is displayed.
32
32
  * @default 'text'
33
33
  */
34
- UNSTABLE_valueDisplay?: 'text' | 'tags';
34
+ UNSTABLE_valueDisplay?: 'text' | 'tags' | 'count';
35
35
  /**
36
36
  * Whether the list of options should be filterable.
37
37
  * @default false
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAEf,OAAO,EAQL,KAAK,gBAAgB,IAAI,mBAAmB,EAO5C,KAAK,WAAW,IAAI,cAAc,EAMnC,MAAM,uBAAuB,CAAC;AAe/B,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAKrB,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,UAAU,CAAC;AAUjE,MAAM,WAAW,WAAW,CAC1B,CAAC,SAAS,cAAc,GAAG,cAAc,EACzC,CAAC,SAAS,4BAA4B,GAAG,QAAQ,CAEjD,SACE,WAAW,EACX,UAAU,CAAC,CAAC,SAAS,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC,EAC5C,eAAe,CAAC,CAAC,CAAC,EAClB,qBAAqB,EACrB,QAAQ,CAAC,SAAS,CAAC,EACnB,IAAI,CACF,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,EAClB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,cAAc,GACd,WAAW,GACX,aAAa,GACb,SAAS,GACT,Q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