@cimpress-ui/react 0.4.0 → 1.0.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 (226) hide show
  1. package/README.md +0 -2
  2. package/dist/commonjs/components/app-header/app-header.d.ts +20 -0
  3. package/dist/commonjs/components/app-header/app-header.d.ts.map +1 -0
  4. package/dist/commonjs/components/app-header/app-header.js +26 -0
  5. package/dist/commonjs/components/app-header/app-header.js.map +1 -0
  6. package/dist/commonjs/components/app-header/cimpress-logo.d.ts.map +1 -0
  7. package/dist/commonjs/components/app-header/cimpress-logo.js.map +1 -0
  8. package/dist/commonjs/components/app-header/simple-auth-tool.d.ts +29 -0
  9. package/dist/commonjs/components/app-header/simple-auth-tool.d.ts.map +1 -0
  10. package/dist/commonjs/components/app-header/simple-auth-tool.js +31 -0
  11. package/dist/commonjs/components/app-header/simple-auth-tool.js.map +1 -0
  12. package/dist/commonjs/components/card/card.d.ts +41 -13
  13. package/dist/commonjs/components/card/card.d.ts.map +1 -1
  14. package/dist/commonjs/components/card/card.js +15 -15
  15. package/dist/commonjs/components/card/card.js.map +1 -1
  16. package/dist/commonjs/components/checkbox/checkbox.js +1 -1
  17. package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
  18. package/dist/commonjs/components/combo-box/combo-box.d.ts +5 -0
  19. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
  20. package/dist/commonjs/components/combo-box/combo-box.js +10 -3
  21. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
  22. package/dist/commonjs/components/date-picker/date-picker.js +1 -1
  23. package/dist/commonjs/components/date-picker/date-picker.js.map +1 -1
  24. package/dist/commonjs/components/drawer/drawer.d.ts +81 -0
  25. package/dist/commonjs/components/drawer/drawer.d.ts.map +1 -0
  26. package/dist/commonjs/components/drawer/drawer.js +59 -0
  27. package/dist/commonjs/components/drawer/drawer.js.map +1 -0
  28. package/dist/commonjs/components/file-picker/file-picker.d.ts.map +1 -1
  29. package/dist/commonjs/components/file-picker/file-picker.js +2 -2
  30. package/dist/commonjs/components/file-picker/file-picker.js.map +1 -1
  31. package/dist/commonjs/components/link-tabs/context.d.ts +2 -0
  32. package/dist/commonjs/components/link-tabs/context.d.ts.map +1 -0
  33. package/dist/commonjs/components/link-tabs/context.js +7 -0
  34. package/dist/commonjs/components/link-tabs/context.js.map +1 -0
  35. package/dist/commonjs/components/link-tabs/link-tabs.d.ts +36 -0
  36. package/dist/commonjs/components/link-tabs/link-tabs.d.ts.map +1 -0
  37. package/dist/commonjs/components/link-tabs/link-tabs.js +54 -0
  38. package/dist/commonjs/components/link-tabs/link-tabs.js.map +1 -0
  39. package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts +3 -3
  40. package/dist/commonjs/components/modal-dialog/modal-dialog.d.ts.map +1 -1
  41. package/dist/commonjs/components/modal-dialog/modal-dialog.js +1 -5
  42. package/dist/commonjs/components/modal-dialog/modal-dialog.js.map +1 -1
  43. package/dist/commonjs/components/number-field/number-field.js +1 -1
  44. package/dist/commonjs/components/number-field/number-field.js.map +1 -1
  45. package/dist/commonjs/components/radio/radio.js +1 -1
  46. package/dist/commonjs/components/radio/radio.js.map +1 -1
  47. package/dist/commonjs/components/select/select.d.ts +5 -0
  48. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  49. package/dist/commonjs/components/select/select.js +9 -2
  50. package/dist/commonjs/components/select/select.js.map +1 -1
  51. package/dist/commonjs/components/tabs/tabs.d.ts +53 -0
  52. package/dist/commonjs/components/tabs/tabs.d.ts.map +1 -0
  53. package/dist/commonjs/components/tabs/tabs.js +69 -0
  54. package/dist/commonjs/components/tabs/tabs.js.map +1 -0
  55. package/dist/commonjs/components/tag-field/tag-field-input.js +1 -2
  56. package/dist/commonjs/components/tag-field/tag-field-input.js.map +1 -1
  57. package/dist/commonjs/components/tag-field/tag-field-list-box.js +9 -2
  58. package/dist/commonjs/components/tag-field/tag-field-list-box.js.map +1 -1
  59. package/dist/commonjs/components/tag-field/tag-field-tags.js +6 -4
  60. package/dist/commonjs/components/tag-field/tag-field-tags.js.map +1 -1
  61. package/dist/commonjs/components/tag-field/tag-field.d.ts +19 -11
  62. package/dist/commonjs/components/tag-field/tag-field.d.ts.map +1 -1
  63. package/dist/commonjs/components/tag-field/tag-field.js +16 -16
  64. package/dist/commonjs/components/tag-field/tag-field.js.map +1 -1
  65. package/dist/commonjs/components/text-inputs/text-area.js +1 -1
  66. package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
  67. package/dist/commonjs/components/text-inputs/text-field.js +1 -1
  68. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
  69. package/dist/commonjs/components/toggle/toggle.js +1 -1
  70. package/dist/commonjs/components/toggle/toggle.js.map +1 -1
  71. package/dist/commonjs/components/toggle-button/toggle-button-group.d.ts +15 -0
  72. package/dist/commonjs/components/toggle-button/toggle-button-group.d.ts.map +1 -0
  73. package/dist/commonjs/components/toggle-button/toggle-button-group.js +30 -0
  74. package/dist/commonjs/components/toggle-button/toggle-button-group.js.map +1 -0
  75. package/dist/commonjs/components/toggle-button/toggle-button.d.ts +16 -0
  76. package/dist/commonjs/components/toggle-button/toggle-button.d.ts.map +1 -0
  77. package/dist/commonjs/components/toggle-button/toggle-button.js +24 -0
  78. package/dist/commonjs/components/toggle-button/toggle-button.js.map +1 -0
  79. package/dist/commonjs/components/toggle-button/toggle-icon-button.d.ts +14 -0
  80. package/dist/commonjs/components/toggle-button/toggle-icon-button.d.ts.map +1 -0
  81. package/dist/commonjs/components/toggle-button/toggle-icon-button.js +24 -0
  82. package/dist/commonjs/components/toggle-button/toggle-icon-button.js.map +1 -0
  83. package/dist/commonjs/i18n/messages/en-US.d.ts.map +1 -1
  84. package/dist/commonjs/i18n/messages/en-US.js +6 -0
  85. package/dist/commonjs/i18n/messages/en-US.js.map +1 -1
  86. package/dist/commonjs/i18n/messages/types.d.ts +10 -0
  87. package/dist/commonjs/i18n/messages/types.d.ts.map +1 -1
  88. package/dist/commonjs/i18n/messages/types.js.map +1 -1
  89. package/dist/commonjs/icons/index.d.ts +1 -0
  90. package/dist/commonjs/icons/index.d.ts.map +1 -1
  91. package/dist/commonjs/icons/index.js +3 -1
  92. package/dist/commonjs/icons/index.js.map +1 -1
  93. package/dist/commonjs/icons/rating-star.d.ts +8 -0
  94. package/dist/commonjs/icons/rating-star.d.ts.map +1 -0
  95. package/dist/commonjs/icons/rating-star.js +24 -0
  96. package/dist/commonjs/icons/rating-star.js.map +1 -0
  97. package/dist/commonjs/index.d.ts +10 -4
  98. package/dist/commonjs/index.d.ts.map +1 -1
  99. package/dist/commonjs/index.js +10 -4
  100. package/dist/commonjs/index.js.map +1 -1
  101. package/dist/esm/components/app-header/app-header.d.ts +20 -0
  102. package/dist/esm/components/app-header/app-header.d.ts.map +1 -0
  103. package/dist/esm/components/app-header/app-header.js +20 -0
  104. package/dist/esm/components/app-header/app-header.js.map +1 -0
  105. package/dist/esm/components/app-header/cimpress-logo.d.ts.map +1 -0
  106. package/dist/esm/components/app-header/cimpress-logo.js.map +1 -0
  107. package/dist/esm/components/app-header/simple-auth-tool.d.ts +29 -0
  108. package/dist/esm/components/app-header/simple-auth-tool.d.ts.map +1 -0
  109. package/dist/esm/components/app-header/simple-auth-tool.js +28 -0
  110. package/dist/esm/components/app-header/simple-auth-tool.js.map +1 -0
  111. package/dist/esm/components/card/card.d.ts +41 -13
  112. package/dist/esm/components/card/card.d.ts.map +1 -1
  113. package/dist/esm/components/card/card.js +12 -12
  114. package/dist/esm/components/card/card.js.map +1 -1
  115. package/dist/esm/components/checkbox/checkbox.js +1 -1
  116. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  117. package/dist/esm/components/combo-box/combo-box.d.ts +5 -0
  118. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
  119. package/dist/esm/components/combo-box/combo-box.js +11 -4
  120. package/dist/esm/components/combo-box/combo-box.js.map +1 -1
  121. package/dist/esm/components/date-picker/date-picker.js +1 -1
  122. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  123. package/dist/esm/components/drawer/drawer.d.ts +81 -0
  124. package/dist/esm/components/drawer/drawer.d.ts.map +1 -0
  125. package/dist/esm/components/drawer/drawer.js +50 -0
  126. package/dist/esm/components/drawer/drawer.js.map +1 -0
  127. package/dist/esm/components/file-picker/file-picker.d.ts.map +1 -1
  128. package/dist/esm/components/file-picker/file-picker.js +2 -2
  129. package/dist/esm/components/file-picker/file-picker.js.map +1 -1
  130. package/dist/esm/components/link-tabs/context.d.ts +2 -0
  131. package/dist/esm/components/link-tabs/context.d.ts.map +1 -0
  132. package/dist/esm/components/link-tabs/context.js +4 -0
  133. package/dist/esm/components/link-tabs/context.js.map +1 -0
  134. package/dist/esm/components/link-tabs/link-tabs.d.ts +36 -0
  135. package/dist/esm/components/link-tabs/link-tabs.d.ts.map +1 -0
  136. package/dist/esm/components/link-tabs/link-tabs.js +47 -0
  137. package/dist/esm/components/link-tabs/link-tabs.js.map +1 -0
  138. package/dist/esm/components/modal-dialog/modal-dialog.d.ts +3 -3
  139. package/dist/esm/components/modal-dialog/modal-dialog.d.ts.map +1 -1
  140. package/dist/esm/components/modal-dialog/modal-dialog.js +1 -5
  141. package/dist/esm/components/modal-dialog/modal-dialog.js.map +1 -1
  142. package/dist/esm/components/number-field/number-field.js +1 -1
  143. package/dist/esm/components/number-field/number-field.js.map +1 -1
  144. package/dist/esm/components/radio/radio.js +1 -1
  145. package/dist/esm/components/radio/radio.js.map +1 -1
  146. package/dist/esm/components/select/select.d.ts +5 -0
  147. package/dist/esm/components/select/select.d.ts.map +1 -1
  148. package/dist/esm/components/select/select.js +10 -3
  149. package/dist/esm/components/select/select.js.map +1 -1
  150. package/dist/esm/components/tabs/tabs.d.ts +53 -0
  151. package/dist/esm/components/tabs/tabs.d.ts.map +1 -0
  152. package/dist/esm/components/tabs/tabs.js +59 -0
  153. package/dist/esm/components/tabs/tabs.js.map +1 -0
  154. package/dist/esm/components/tag-field/tag-field-input.js +1 -2
  155. package/dist/esm/components/tag-field/tag-field-input.js.map +1 -1
  156. package/dist/esm/components/tag-field/tag-field-list-box.js +10 -3
  157. package/dist/esm/components/tag-field/tag-field-list-box.js.map +1 -1
  158. package/dist/esm/components/tag-field/tag-field-tags.js +6 -4
  159. package/dist/esm/components/tag-field/tag-field-tags.js.map +1 -1
  160. package/dist/esm/components/tag-field/tag-field.d.ts +19 -11
  161. package/dist/esm/components/tag-field/tag-field.d.ts.map +1 -1
  162. package/dist/esm/components/tag-field/tag-field.js +13 -13
  163. package/dist/esm/components/tag-field/tag-field.js.map +1 -1
  164. package/dist/esm/components/text-inputs/text-area.js +1 -1
  165. package/dist/esm/components/text-inputs/text-area.js.map +1 -1
  166. package/dist/esm/components/text-inputs/text-field.js +1 -1
  167. package/dist/esm/components/text-inputs/text-field.js.map +1 -1
  168. package/dist/esm/components/toggle/toggle.js +1 -1
  169. package/dist/esm/components/toggle/toggle.js.map +1 -1
  170. package/dist/esm/components/toggle-button/toggle-button-group.d.ts +15 -0
  171. package/dist/esm/components/toggle-button/toggle-button-group.d.ts.map +1 -0
  172. package/dist/esm/components/toggle-button/toggle-button-group.js +24 -0
  173. package/dist/esm/components/toggle-button/toggle-button-group.js.map +1 -0
  174. package/dist/esm/components/toggle-button/toggle-button.d.ts +16 -0
  175. package/dist/esm/components/toggle-button/toggle-button.d.ts.map +1 -0
  176. package/dist/esm/components/toggle-button/toggle-button.js +18 -0
  177. package/dist/esm/components/toggle-button/toggle-button.js.map +1 -0
  178. package/dist/esm/components/toggle-button/toggle-icon-button.d.ts +14 -0
  179. package/dist/esm/components/toggle-button/toggle-icon-button.d.ts.map +1 -0
  180. package/dist/esm/components/toggle-button/toggle-icon-button.js +18 -0
  181. package/dist/esm/components/toggle-button/toggle-icon-button.js.map +1 -0
  182. package/dist/esm/i18n/messages/en-US.d.ts.map +1 -1
  183. package/dist/esm/i18n/messages/en-US.js +6 -0
  184. package/dist/esm/i18n/messages/en-US.js.map +1 -1
  185. package/dist/esm/i18n/messages/types.d.ts +10 -0
  186. package/dist/esm/i18n/messages/types.d.ts.map +1 -1
  187. package/dist/esm/i18n/messages/types.js.map +1 -1
  188. package/dist/esm/icons/index.d.ts +1 -0
  189. package/dist/esm/icons/index.d.ts.map +1 -1
  190. package/dist/esm/icons/index.js +1 -0
  191. package/dist/esm/icons/index.js.map +1 -1
  192. package/dist/esm/icons/rating-star.d.ts +8 -0
  193. package/dist/esm/icons/rating-star.d.ts.map +1 -0
  194. package/dist/esm/icons/rating-star.js +19 -0
  195. package/dist/esm/icons/rating-star.js.map +1 -0
  196. package/dist/esm/index.d.ts +10 -4
  197. package/dist/esm/index.d.ts.map +1 -1
  198. package/dist/esm/index.js +10 -4
  199. package/dist/esm/index.js.map +1 -1
  200. package/dist-styles/core.css +1 -1
  201. package/dist-styles/styles.css +1 -1
  202. package/package.json +1 -1
  203. package/dist/commonjs/components/header/cimpress-logo.d.ts.map +0 -1
  204. package/dist/commonjs/components/header/cimpress-logo.js.map +0 -1
  205. package/dist/commonjs/components/header/header.d.ts +0 -10
  206. package/dist/commonjs/components/header/header.d.ts.map +0 -1
  207. package/dist/commonjs/components/header/header.js +0 -19
  208. package/dist/commonjs/components/header/header.js.map +0 -1
  209. package/dist/commonjs/components/nav-tabs/nav-tabs.d.ts +0 -23
  210. package/dist/commonjs/components/nav-tabs/nav-tabs.d.ts.map +0 -1
  211. package/dist/commonjs/components/nav-tabs/nav-tabs.js +0 -27
  212. package/dist/commonjs/components/nav-tabs/nav-tabs.js.map +0 -1
  213. package/dist/esm/components/header/cimpress-logo.d.ts.map +0 -1
  214. package/dist/esm/components/header/cimpress-logo.js.map +0 -1
  215. package/dist/esm/components/header/header.d.ts +0 -10
  216. package/dist/esm/components/header/header.d.ts.map +0 -1
  217. package/dist/esm/components/header/header.js +0 -13
  218. package/dist/esm/components/header/header.js.map +0 -1
  219. package/dist/esm/components/nav-tabs/nav-tabs.d.ts +0 -23
  220. package/dist/esm/components/nav-tabs/nav-tabs.d.ts.map +0 -1
  221. package/dist/esm/components/nav-tabs/nav-tabs.js +0 -20
  222. package/dist/esm/components/nav-tabs/nav-tabs.js.map +0 -1
  223. /package/dist/commonjs/components/{header → app-header}/cimpress-logo.d.ts +0 -0
  224. /package/dist/commonjs/components/{header → app-header}/cimpress-logo.js +0 -0
  225. /package/dist/esm/components/{header → app-header}/cimpress-logo.d.ts +0 -0
  226. /package/dist/esm/components/{header → app-header}/cimpress-logo.js +0 -0
@@ -19,7 +19,7 @@ function Radio({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
19
19
  console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');
20
20
  }
21
21
  }, [children, ariaLabel, ariaLabelledBy]);
22
- return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Radio, { ...props, className: (0, clsx_1.default)('cim-radio', UNSAFE_className), style: UNSAFE_style, ref: ref, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-wrapper", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-inner" }) }) }), children && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "span", variant: "body", children: children }))] }));
22
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Radio, { ...props, className: (0, clsx_1.default)('cim-radio', UNSAFE_className), style: UNSAFE_style, ref: ref, children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-wrapper", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-radio-toggle-inner" }) }) }), children && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "span", variant: "medium", children: children }))] }));
23
23
  }
24
24
  /**
25
25
  * Renders a single option within `RadioGroup`.
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAA4F;AAC5F,yDAAkD;AAClD,qFAA6E;AAC7E,mEAA2D;AAE3D,mDAA6C;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,wBAAC,6BAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,gCAAK,SAAS,EAAC,0BAA0B,YACvC,gCAAK,SAAS,EAAC,kBAAkB,YAC/B,gCAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,uBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEvC,uBAAK","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } 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 type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<RACRadioProps, 'value' | 'isDisabled' | 'autoFocus'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAA4F;AAC5F,yDAAkD;AAClD,qFAA6E;AAC7E,mEAA2D;AAE3D,mDAA6C;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,wBAAC,6BAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,gCAAK,SAAS,EAAC,0BAA0B,YACvC,gCAAK,SAAS,EAAC,kBAAkB,YAC/B,gCAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,uBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,YAC7B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEvC,uBAAK","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } 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 type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface RadioProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<RACRadioProps, 'value' | 'isDisabled' | 'autoFocus'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"medium\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
@@ -1,6 +1,11 @@
1
1
  import { type ListBoxProps as RACListBoxProps, type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
2
2
  import type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
3
3
  export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
4
+ /**
5
+ * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.
6
+ * @default false
7
+ */
8
+ isVirtualized?: boolean;
4
9
  }
5
10
  /**
6
11
  * Allows users to select one item from a collapsible list.
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"A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E,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBjE;yBAjBe,UAAU;;;AAqB1B,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACtF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAelH;yBAfe,aAAa"}
@@ -18,7 +18,13 @@ const with_style_props_js_1 = require("../../with-style-props.js");
18
18
  const collapsible_list_js_1 = require("../internal/collapsible-list/collapsible-list.js");
19
19
  const form_field_js_1 = require("../internal/form-field/form-field.js");
20
20
  const utils_js_1 = require("../typography/utils.js");
21
- function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }, ref) {
21
+ const VIRTUAL_LAYOUT_OPTIONS = {
22
+ rowHeight: 40,
23
+ headingHeight: 32,
24
+ padding: 0,
25
+ gap: 0,
26
+ };
27
+ function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, isVirtualized = false, ...props }, ref) {
22
28
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
23
29
  (0, use_production_warning_js_1.useProductionWarning)(() => {
24
30
  if (!label && !ariaLabel && !ariaLabelledBy) {
@@ -28,7 +34,8 @@ function Select({ children, items, label, description, error, UNSAFE_className,
28
34
  if (!(0, is_production_js_1.isProduction)() && items != null && typeof children !== 'function') {
29
35
  console.warn('`Select` requires `children` to be a function when using `items` prop');
30
36
  }
31
- return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), (0, jsx_runtime_1.jsx)(index_js_1.IconChevronDown, {})] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-select-listbox", onScroll: onScroll, items: items, children: children }) })] }));
37
+ const listBox = ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-select-listbox", onScroll: onScroll, items: items, children: children }));
38
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'body', alignment: 'start' })), children: ({ selectedText }) => selectedText }), (0, jsx_runtime_1.jsx)(index_js_1.IconChevronDown, {})] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Virtualizer, { layout: react_aria_components_1.ListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
32
39
  }
33
40
  /**
34
41
  * Allows users to select one item from a collapsible list.
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AA4Gb,gCAiBC;AAYD,sCAeC;;AAtJD,gDAAwB;AAExB,iEAa+B;AAC/B,yDAAkD;AAClD,mDAAkE;AAClE,mEAA4D;AAC5D,qFAA6E;AAC7E,mEAA2D;AAC3D,0FAAmF;AACnF,wEAA4G;AAE5G,qDAAmD;AAuBnD,SAAS,MAAM,CACb,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB,EAClH,GAAiC;IAEjC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;QAChG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,IAAI,CAAC,IAAA,+BAAY,GAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,CACL,wBAAC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type { ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheck />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AAiJb,gCAiBC;AAYD,sCAeC;;AA3LD,gDAAwB;AAExB,iEAgB+B;AAC/B,yDAAkD;AAClD,mDAAkE;AAClE,mEAA4D;AAC5D,qFAA6E;AAC7E,mEAA2D;AAC3D,0FAAmF;AACnF,wEAA4G;AAE5G,qDAAmD;AAEnD,MAAM,sBAAsB,GAAyB;IACnD,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,CAAC;IACV,GAAG,EAAE,CAAC;CACP,CAAC;AA6BF,SAAS,MAAM,CACb,EACE,QAAQ,EACR,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,aAAa,GAAG,KAAK,EACrB,GAAG,KAAK,EACO,EACjB,GAAiC;IAEjC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;QAChG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,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BAAC,sCAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,uBAAC,8BAAS,IACR,SAAS,EAAE,IAAA,cAAI,EAAC,2BAA2B,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,uBAAC,kCAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 40,\n headingHeight: 32,\n padding: 0,\n gap: 0,\n};\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n}\n\nfunction Select<T extends CollectionItem>(\n {\n children,\n items,\n label,\n description,\n error,\n UNSAFE_className,\n UNSAFE_style,\n onScroll,\n isVirtualized = false,\n ...props\n }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n const listBox = (\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n );\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'body', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheck />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
@@ -0,0 +1,53 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type TabsProps as RACTabsProps, type TabProps as RACTabProps } from 'react-aria-components';
3
+ import type { AriaLabelingProps, CollectionItem, CollectionProps, CommonProps, Key, StringLikeChildren } from '../types.js';
4
+ export interface TabsProps extends CommonProps, AriaLabelingProps, Pick<RACTabsProps, 'selectedKey' | 'defaultSelectedKey' | 'disabledKeys' | 'onSelectionChange'> {
5
+ /** The children of the `<Tabs>` element. Should include `<TabList>` and `<TabPanels>` elements. */
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * Organizes content into multiple sections that users can switch between.
10
+ *
11
+ * See [tabs usage guidelines](https://ui.cimpress.io/components/tabs/).
12
+ */
13
+ declare const _Tabs: (props: TabsProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
14
+ export { _Tabs as Tabs };
15
+ export interface TabListProps<T extends CollectionItem> extends CollectionProps<T> {
16
+ }
17
+ /** Renders a collection of `Tab` components within `Tabs`. */
18
+ export declare function TabList<T extends CollectionItem>({ children, ...props }: TabListProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export declare namespace TabList {
20
+ var displayName: string;
21
+ }
22
+ export interface TabProps extends Pick<RACTabProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
23
+ /** The text to display as the tab title. */
24
+ children: StringLikeChildren;
25
+ /** An icon displayed before the tab title. */
26
+ iconStart?: ReactNode;
27
+ /** A badge displayed after the tab title. */
28
+ badge?: ReactNode;
29
+ }
30
+ /** Renders a single tab within `TabList`. */
31
+ export declare function Tab({ children, iconStart, badge, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare namespace Tab {
33
+ var displayName: string;
34
+ }
35
+ export interface TabPanelsProps<T extends CollectionItem> extends CollectionProps<T> {
36
+ }
37
+ /** Renders a collection of `TabPanel` components within `Tabs`. */
38
+ export declare function TabPanels<T extends CollectionItem>({ ...props }: TabPanelsProps<T>): import("react/jsx-runtime").JSX.Element;
39
+ export declare namespace TabPanels {
40
+ var displayName: string;
41
+ }
42
+ export interface TabPanelProps {
43
+ /** The content to display in the tab panel. */
44
+ children: ReactNode;
45
+ /** The unique id of the associated tab. */
46
+ id?: Key;
47
+ }
48
+ /** Renders a single tab panel within `TabPanels`. */
49
+ export declare function TabPanel({ children, id, ...props }: TabPanelProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare namespace TabPanel {
51
+ var displayName: string;
52
+ }
53
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAML,KAAK,SAAS,IAAI,YAAY,EAC9B,KAAK,QAAQ,IAAI,WAAW,EAC7B,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,WAAW,EACX,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AASrB,MAAM,WAAW,SACf,SAAQ,WAAW,EACjB,iBAAiB,EACjB,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,oBAAoB,GAAG,cAAc,GAAG,mBAAmB,CAAC;IACjG,mGAAmG;IACnG,QAAQ,EAAE,SAAS,CAAC;CACrB;AAgDD;;;;GAIG;AACH,QAAA,MAAM,KAAK,2JAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;AAEzB,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;CAAG;AAErF,8DAA8D;AAC9D,wBAAgB,OAAO,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,2CAqBxF;yBArBe,OAAO;;;AAyBvB,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACtG,4CAA4C;IAC5C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,6CAA6C;AAC7C,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAUrE;yBAVe,GAAG;;;AAcnB,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;CAAG;AAEvF,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,2CAElF;yBAFe,SAAS;;;AAMzB,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,2CAA2C;IAG3C,EAAE,CAAC,EAAE,GAAG,CAAC;CACV;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAWjE;yBAXe,QAAQ"}
@@ -0,0 +1,69 @@
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.Tabs = void 0;
8
+ exports.TabList = TabList;
9
+ exports.Tab = Tab;
10
+ exports.TabPanels = TabPanels;
11
+ exports.TabPanel = TabPanel;
12
+ const jsx_runtime_1 = require("react/jsx-runtime");
13
+ const clsx_1 = __importDefault(require("clsx"));
14
+ const react_1 = require("react");
15
+ const react_aria_components_1 = require("react-aria-components");
16
+ const forward_ref_js_1 = require("../../forward-ref.js");
17
+ const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
18
+ const with_style_props_js_1 = require("../../with-style-props.js");
19
+ const text_js_1 = require("../typography/text.js");
20
+ const TabsContext = (0, react_1.createContext)({});
21
+ function Tabs({ children, UNSAFE_className, UNSAFE_style,
22
+ // Aria labeling props
23
+ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-details': ariaDetails, ...props }, ref) {
24
+ (0, use_production_warning_js_1.useProductionWarning)(() => {
25
+ if (!ariaLabel && !ariaLabelledBy) {
26
+ console.warn('Tabs requires one of aria-label / aria-labelledby for accessibility');
27
+ }
28
+ }, [ariaLabel, ariaLabelledBy]);
29
+ return ((0, jsx_runtime_1.jsx)(TabsContext.Provider, { value: {
30
+ tabsProps: {
31
+ 'aria-label': ariaLabel,
32
+ 'aria-labelledby': ariaLabelledBy,
33
+ 'aria-describedby': ariaDescribedBy,
34
+ 'aria-details': ariaDetails,
35
+ },
36
+ }, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Tabs, { ...props, ref: ref, className: (0, clsx_1.default)('cim-tabs', UNSAFE_className), style: UNSAFE_style, keyboardActivation: "manual", children: children }) }));
37
+ }
38
+ /**
39
+ * Organizes content into multiple sections that users can switch between.
40
+ *
41
+ * See [tabs usage guidelines](https://ui.cimpress.io/components/tabs/).
42
+ */
43
+ const _Tabs = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(Tabs), 'Tabs');
44
+ exports.Tabs = _Tabs;
45
+ /** Renders a collection of `Tab` components within `Tabs`. */
46
+ function TabList({ children, ...props }) {
47
+ const { tabsProps } = (0, react_1.useContext)(TabsContext);
48
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-details': ariaDetails, } = tabsProps ?? {};
49
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.TabList, { ...props, className: "cim-tab-list", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-details": ariaDetails, children: children }));
50
+ }
51
+ TabList.displayName = 'TabList';
52
+ /** Renders a single tab within `TabList`. */
53
+ function Tab({ children, iconStart, badge, ...props }) {
54
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Tab, { ...props, className: "cim-tab-item", children: [iconStart, (0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "span", variant: "medium-semibold", alignment: "center", children: children }), badge] }));
55
+ }
56
+ Tab.displayName = 'Tab';
57
+ /** Renders a collection of `TabPanel` components within `Tabs`. */
58
+ function TabPanels({ ...props }) {
59
+ return (0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { ...props });
60
+ }
61
+ TabPanels.displayName = 'TabPanels';
62
+ /** Renders a single tab panel within `TabPanels`. */
63
+ function TabPanel({ children, id, ...props }) {
64
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.TabPanel, { ...props, className: "cim-tab-panel",
65
+ // @ts-expect-error -- https://github.com/adobe/react-spectrum/issues/8422
66
+ id: id, children: children }));
67
+ }
68
+ TabPanel.displayName = 'TabPanel';
69
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AAkGb,0BAqBC;AAcD,kBAUC;AAOD,8BAEC;AAcD,4BAWC;;AA/KD,gDAAwB;AACxB,iCAAqF;AACrF,iEAQ+B;AAC/B,yDAAkD;AAClD,qFAA6E;AAC7E,mEAA2D;AAS3D,mDAA6C;AAM7C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAAmB,EAAE,CAAC,CAAC;AAUxD,SAAS,IAAI,CACX,EACE,QAAQ,EACR,gBAAgB,EAChB,YAAY;AAEZ,sBAAsB;AACtB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,e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nB,WAAW,YAExB,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAWhC,6CAA6C;AAC7C,SAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAY;IACpE,OAAO,CACL,wBAAC,2BAAM,OAAK,KAAK,EAAE,SAAS,EAAC,cAAc,aACxC,SAAS,EACV,uBAAC,cAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,iBAAiB,EAAC,SAAS,EAAC,QAAQ,YACzD,QAAQ,GACJ,EACN,KAAK,IACC,CACV,CAAC;AACJ,CAAC;AAED,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;AAIxB,mEAAmE;AACnE,SAAgB,SAAS,CAA2B,EAAE,GAAG,KAAK,EAAqB;IACjF,OAAO,uBAAC,kCAAa,OAAK,KAAK,GAAI,CAAC;AACtC,CAAC;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAWpC,qDAAqD;AACrD,SAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EAAiB;IAChE,OAAO,CACL,uBAAC,gCAAW,OACN,KAAK,EACT,SAAS,EAAC,eAAe;QACzB,0EAA0E;QAC1E,EAAE,EAAE,EAAE,YAEL,QAAQ,GACG,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { createContext, useContext, type ForwardedRef, type ReactNode } from 'react';\nimport {\n Collection as RACCollection,\n Tab as RACTab,\n TabList as RACTabList,\n TabPanel as RACTabPanel,\n Tabs as RACTabs,\n type TabsProps as RACTabsProps,\n type TabProps as RACTabProps,\n} 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 type {\n AriaLabelingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { Text } from '../typography/text.js';\n\ninterface TabsContextValue {\n tabsProps?: AriaLabelingProps;\n}\n\nconst TabsContext = createContext<TabsContextValue>({});\n\nexport interface TabsProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<RACTabsProps, 'selectedKey' | 'defaultSelectedKey' | 'disabledKeys' | 'onSelectionChange'> {\n /** The children of the `<Tabs>` element. Should include `<TabList>` and `<TabPanels>` elements. */\n children: ReactNode;\n}\n\nfunction Tabs(\n {\n children,\n UNSAFE_className,\n UNSAFE_style,\n\n // Aria labeling props\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-details': ariaDetails,\n\n ...props\n }: TabsProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n useProductionWarning(() => {\n if (!ariaLabel && !ariaLabelledBy) {\n console.warn('Tabs requires one of aria-label / aria-labelledby for accessibility');\n }\n }, [ariaLabel, ariaLabelledBy]);\n\n return (\n <TabsContext.Provider\n value={{\n tabsProps: {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-details': ariaDetails,\n },\n }}\n >\n <RACTabs\n {...props}\n ref={ref}\n className={clsx('cim-tabs', UNSAFE_className)}\n style={UNSAFE_style}\n keyboardActivation=\"manual\"\n >\n {children}\n </RACTabs>\n </TabsContext.Provider>\n );\n}\n\n/**\n * Organizes content into multiple sections that users can switch between.\n *\n * See [tabs usage guidelines](https://ui.cimpress.io/components/tabs/).\n */\nconst _Tabs = withStyleProps(forwardRef(Tabs), 'Tabs');\n\nexport { _Tabs as Tabs };\n\nexport interface TabListProps<T extends CollectionItem> extends CollectionProps<T> {}\n\n/** Renders a collection of `Tab` components within `Tabs`. */\nexport function TabList<T extends CollectionItem>({ children, ...props }: TabListProps<T>) {\n const { tabsProps } = useContext(TabsContext);\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-details': ariaDetails,\n } = tabsProps ?? {};\n\n return (\n <RACTabList\n {...props}\n className=\"cim-tab-list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-details={ariaDetails}\n >\n {children}\n </RACTabList>\n );\n}\n\nTabList.displayName = 'TabList';\n\nexport interface TabProps extends Pick<RACTabProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The text to display as the tab title. */\n children: StringLikeChildren;\n /** An icon displayed before the tab title. */\n iconStart?: ReactNode;\n /** A badge displayed after the tab title. */\n badge?: ReactNode;\n}\n\n/** Renders a single tab within `TabList`. */\nexport function Tab({ children, iconStart, badge, ...props }: TabProps) {\n return (\n <RACTab {...props} className=\"cim-tab-item\">\n {iconStart}\n <Text as=\"span\" variant=\"medium-semibold\" alignment=\"center\">\n {children}\n </Text>\n {badge}\n </RACTab>\n );\n}\n\nTab.displayName = 'Tab';\n\nexport interface TabPanelsProps<T extends CollectionItem> extends CollectionProps<T> {}\n\n/** Renders a collection of `TabPanel` components within `Tabs`. */\nexport function TabPanels<T extends CollectionItem>({ ...props }: TabPanelsProps<T>) {\n return <RACCollection {...props} />;\n}\n\nTabPanels.displayName = 'TabPanels';\n\nexport interface TabPanelProps {\n /** The content to display in the tab panel. */\n children: ReactNode;\n /** The unique id of the associated tab. */\n // `id` is not typed correctly in `react-aria-components`\n // https://github.com/adobe/react-spectrum/issues/8422\n id?: Key;\n}\n\n/** Renders a single tab panel within `TabPanels`. */\nexport function TabPanel({ children, id, ...props }: TabPanelProps) {\n return (\n <RACTabPanel\n {...props}\n className=\"cim-tab-panel\"\n // @ts-expect-error -- https://github.com/adobe/react-spectrum/issues/8422\n id={id}\n >\n {children}\n </RACTabPanel>\n );\n}\n\nTabPanel.displayName = 'TabPanel';\n"]}
@@ -18,12 +18,11 @@ function TagFieldInput({ isReadOnly, isRequired, isInvalid, placeholder, onFocus
18
18
  const { id: errorMessageId } = (0, react_aria_components_1.useSlottedContext)(react_aria_components_1.TextContext, 'errorMessage');
19
19
  return ((0, jsx_runtime_1.jsx)(react_aria_components_1.InputContext.Provider, { value: {
20
20
  ...inputContext,
21
- // name: undefined,
22
21
  // Change `required` to `aria-required` so that form submission isn't blocked, but required state is still announced by screen readers
23
22
  required: false,
24
23
  'aria-required': isRequired,
25
24
  'aria-invalid': isInvalid || undefined,
26
- }, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { className: (0, clsx_1.default)('cim-combo-box-input', (0, utils_js_1.textStyle)({ variant: 'medium' })),
25
+ }, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { className: (0, clsx_1.default)('cim-combo-box-input', (0, utils_js_1.textStyle)({ variant: 'body' })),
27
26
  // Ensure the popover opens when the input is clicked.
28
27
  // By default, React Aria only opens the popover when the input is focused.
29
28
  onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder, onFocus: () => onFocusChange(true), onBlur: () => onFocusChange(false), "aria-describedby": [descriptionId, errorMessageId, ariaDescribedby].filter(Boolean).join(' ') || undefined }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field-input.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-input.tsx"],"names":[],"mappings":";;;;;AAYA,sCA6CC;;AAzDD,gDAAwB;AACxB,iCAAmC;AACnC,iEAM+B;AAC/B,qDAAmD;AAEnD,gBAAgB;AAChB,SAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EAAE,eAAe,GAQpC;IACC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,4CAAuB,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,oCAAe,CAAC,CAAC;IAEjD,uGAAuG;IACvG,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,aAAa,CAAE,CAAC;IAChF,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,cAAc,CAAE,CAAC;IAElF,OAAO,CACL,uBAAC,oCAAe,CAAC,QAAQ,IACvB,KAAK,EAAE;YACL,GAAG,YAAY;YACf,mBAAmB;YACnB,sIAAsI;YACtI,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,SAAS,IAAI,SAAS;SACvC,YAED,uBAAC,6BAAQ,IACP,SAAS,EAAE,IAAA,cAAI,EAAC,qBAAqB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;YACxE,sDAAsD;YACtD,2EAA2E;YAC3E,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,aAAc,CAAC,IAAI,EAAE,EACnD,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,sBAChB,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,GACzG,GACuB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext } from 'react';\nimport {\n ComboBoxStateContext as RACComboBoxStateContext,\n Input as RACInput,\n InputContext as RACInputContext,\n TextContext as RACTextContext,\n useSlottedContext,\n} from 'react-aria-components';\nimport { textStyle } from '../typography/utils.js';\n\n/** @internal */\nexport function TagFieldInput({\n isReadOnly,\n isRequired,\n isInvalid,\n placeholder,\n onFocusChange,\n 'aria-describedby': ariaDescribedby,\n}: {\n isReadOnly: boolean | undefined;\n isRequired: boolean | undefined;\n isInvalid: boolean | undefined;\n placeholder: string | undefined;\n onFocusChange: (isFocused: boolean) => void;\n 'aria-describedby': string | undefined;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const inputContext = useContext(RACInputContext);\n\n // We use custom IDs for description and error message, so we need to manually attach them to the input\n const { id: descriptionId } = useSlottedContext(RACTextContext, 'description')!;\n const { id: errorMessageId } = useSlottedContext(RACTextContext, 'errorMessage')!;\n\n return (\n <RACInputContext.Provider\n value={{\n ...inputContext,\n // name: undefined,\n // Change `required` to `aria-required` so that form submission isn't blocked, but required state is still announced by screen readers\n required: false,\n 'aria-required': isRequired,\n 'aria-invalid': isInvalid || undefined,\n }}\n >\n <RACInput\n className={clsx('cim-combo-box-input', textStyle({ variant: 'medium' }))}\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 onFocus={() => onFocusChange(true)}\n onBlur={() => onFocusChange(false)}\n aria-describedby={[descriptionId, errorMessageId, ariaDescribedby].filter(Boolean).join(' ') || undefined}\n />\n </RACInputContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"tag-field-input.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-input.tsx"],"names":[],"mappings":";;;;;AAYA,sCA4CC;;AAxDD,gDAAwB;AACxB,iCAAmC;AACnC,iEAM+B;AAC/B,qDAAmD;AAEnD,gBAAgB;AAChB,SAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EAAE,eAAe,GAQpC;IACC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,4CAAuB,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,oCAAe,CAAC,CAAC;IAEjD,uGAAuG;IACvG,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,aAAa,CAAE,CAAC;IAChF,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,IAAA,yCAAiB,EAAC,mCAAc,EAAE,cAAc,CAAE,CAAC;IAElF,OAAO,CACL,uBAAC,oCAAe,CAAC,QAAQ,IACvB,KAAK,EAAE;YACL,GAAG,YAAY;YACf,sIAAsI;YACtI,QAAQ,EAAE,KAAK;YACf,eAAe,EAAE,UAAU;YAC3B,cAAc,EAAE,SAAS,IAAI,SAAS;SACvC,YAED,uBAAC,6BAAQ,IACP,SAAS,EAAE,IAAA,cAAI,EAAC,qBAAqB,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YACtE,sDAAsD;YACtD,2EAA2E;YAC3E,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,aAAc,CAAC,IAAI,EAAE,EACnD,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,sBAChB,CAAC,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,GACzG,GACuB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext } from 'react';\nimport {\n ComboBoxStateContext as RACComboBoxStateContext,\n Input as RACInput,\n InputContext as RACInputContext,\n TextContext as RACTextContext,\n useSlottedContext,\n} from 'react-aria-components';\nimport { textStyle } from '../typography/utils.js';\n\n/** @internal */\nexport function TagFieldInput({\n isReadOnly,\n isRequired,\n isInvalid,\n placeholder,\n onFocusChange,\n 'aria-describedby': ariaDescribedby,\n}: {\n isReadOnly: boolean | undefined;\n isRequired: boolean | undefined;\n isInvalid: boolean | undefined;\n placeholder: string | undefined;\n onFocusChange: (isFocused: boolean) => void;\n 'aria-describedby': string | undefined;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n const inputContext = useContext(RACInputContext);\n\n // We use custom IDs for description and error message, so we need to manually attach them to the input\n const { id: descriptionId } = useSlottedContext(RACTextContext, 'description')!;\n const { id: errorMessageId } = useSlottedContext(RACTextContext, 'errorMessage')!;\n\n return (\n <RACInputContext.Provider\n value={{\n ...inputContext,\n // Change `required` to `aria-required` so that form submission isn't blocked, but required state is still announced by screen readers\n required: false,\n 'aria-required': isRequired,\n 'aria-invalid': isInvalid || undefined,\n }}\n >\n <RACInput\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 onFocus={() => onFocusChange(true)}\n onBlur={() => onFocusChange(false)}\n aria-describedby={[descriptionId, errorMessageId, ariaDescribedby].filter(Boolean).join(' ') || undefined}\n />\n </RACInputContext.Provider>\n );\n}\n"]}
@@ -4,8 +4,14 @@ exports.TagFieldListBox = TagFieldListBox;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_aria_components_1 = require("react-aria-components");
7
+ const VIRTUAL_LAYOUT_OPTIONS = {
8
+ rowHeight: 36,
9
+ headingHeight: 32,
10
+ padding: 0,
11
+ gap: 0,
12
+ };
7
13
  /** @internal */
8
- function TagFieldListBox({ children, selectedKeys, setSelectedKeys, items, onScroll, }) {
14
+ function TagFieldListBox({ children, selectedKeys, setSelectedKeys, items, onScroll, isVirtualized, }) {
9
15
  const listState = (0, react_1.useContext)(react_aria_components_1.ListStateContext);
10
16
  // Override RACListStateContext to allow multiple selection within the list
11
17
  const updatedListState = (0, react_1.useMemo)(() => {
@@ -26,6 +32,7 @@ function TagFieldListBox({ children, selectedKeys, setSelectedKeys, items, onScr
26
32
  ...listState,
27
33
  };
28
34
  }, [listState, selectedKeys, setSelectedKeys]);
29
- return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListStateContext.Provider, { value: updatedListState, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-combo-box-listbox", onScroll: onScroll, items: items, children: children }) }));
35
+ const listBox = ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBox, { className: "cim-combo-box-listbox", onScroll: onScroll, items: items, children: children }));
36
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListStateContext.Provider, { value: updatedListState, children: isVirtualized ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Virtualizer, { layout: react_aria_components_1.ListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) }));
30
37
  }
31
38
  //# sourceMappingURL=tag-field-list-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field-list-box.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-list-box.tsx"],"names":[],"mappings":";;AAMA,0CAyCC;;AA/CD,iCAA4C;AAC5C,iEAAuG;AAIvG,gBAAgB;AAChB,SAAgB,eAAe,CAA2B,EACxD,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,KAAK,EACL,QAAQ,GAIT;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,2EAA2E;IAC3E,MAAM,gBAAgB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACpC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,uDAAuD;QACvD,wEAAwE;QACxE,sDAAsD;QACtD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC;QAC5D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAC7D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;QACnE,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;QAEhE,OAAO;YACL,GAAG,SAAS;SACb,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,wCAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,YACnD,uBAAC,+BAAU,IAAC,SAAS,EAAC,uBAAuB,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,YAC3E,QAAQ,GACE,GACgB,CAChC,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport { ListBox as RACListBox, ListStateContext as RACListStateContext } from 'react-aria-components';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { UNSTABLE_TagFieldProps } from './tag-field.js';\n\n/** @internal */\nexport function TagFieldListBox<T extends CollectionItem>({\n children,\n selectedKeys,\n setSelectedKeys,\n items,\n onScroll,\n}: Pick<UNSTABLE_TagFieldProps<T>, 'children' | 'items' | 'onScroll'> & {\n selectedKeys: Set<Key>;\n setSelectedKeys: (keys: Set<Key>) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n // Override RACListStateContext to allow multiple selection within the list\n const updatedListState = useMemo(() => {\n if (!listState || !listState.selectionManager) {\n return listState;\n }\n\n // @ts-expect-error `selectionManager.state` is private\n // This is a temporary mutation before a context update, so this is fine\n // eslint-disable-next-line react-hooks/react-compiler\n listState.selectionManager.state.selectionMode = 'multiple';\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.selectedKeys = selectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.setSelectedKeys = setSelectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.disallowEmptySelection = false;\n\n return {\n ...listState,\n };\n }, [listState, selectedKeys, setSelectedKeys]);\n\n return (\n <RACListStateContext.Provider value={updatedListState}>\n <RACListBox className=\"cim-combo-box-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </RACListStateContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"tag-field-list-box.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-list-box.tsx"],"names":[],"mappings":";;AAmBA,0CAoDC;;AAvED,iCAA4C;AAC5C,iEAM+B;AAI/B,MAAM,sBAAsB,GAAyB;IACnD,SAAS,EAAE,EAAE;IACb,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,CAAC;IACV,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,gBAAgB;AAChB,SAAgB,eAAe,CAA2B,EACxD,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,KAAK,EACL,QAAQ,EACR,aAAa,GAId;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,2EAA2E;IAC3E,MAAM,gBAAgB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACpC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YAC9C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,uDAAuD;QACvD,wEAAwE;QACxE,sDAAsD;QACtD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC;QAC5D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;QAC7D,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;QACnE,uDAAuD;QACvD,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;QAEhE,OAAO;YACL,GAAG,SAAS;SACb,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;IAE/C,MAAM,OAAO,GAAG,CACd,uBAAC,+BAAU,IAAC,SAAS,EAAC,uBAAuB,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,YAC3E,QAAQ,GACE,CACd,CAAC;IAEF,OAAO,CACL,uBAAC,wCAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,YAClD,aAAa,CAAC,CAAC,CAAC,CACf,uBAAC,mCAAc,IAAC,MAAM,EAAE,kCAAa,EAAE,aAAa,EAAE,sBAAsB,YACzE,OAAO,GACO,CAClB,CAAC,CAAC,CAAC,CACF,OAAO,CACR,GAC4B,CAChC,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport {\n ListBox as RACListBox,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n ListStateContext as RACListStateContext,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { TagFieldProps } from './tag-field.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 36,\n headingHeight: 32,\n padding: 0,\n gap: 0,\n};\n\n/** @internal */\nexport function TagFieldListBox<T extends CollectionItem>({\n children,\n selectedKeys,\n setSelectedKeys,\n items,\n onScroll,\n isVirtualized,\n}: Pick<TagFieldProps<T>, 'children' | 'items' | 'onScroll' | 'isVirtualized'> & {\n selectedKeys: Set<Key>;\n setSelectedKeys: (keys: Set<Key>) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n // Override RACListStateContext to allow multiple selection within the list\n const updatedListState = useMemo(() => {\n if (!listState || !listState.selectionManager) {\n return listState;\n }\n\n // @ts-expect-error `selectionManager.state` is private\n // This is a temporary mutation before a context update, so this is fine\n // eslint-disable-next-line react-hooks/react-compiler\n listState.selectionManager.state.selectionMode = 'multiple';\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.selectedKeys = selectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.setSelectedKeys = setSelectedKeys;\n // @ts-expect-error `selectionManager.state` is private\n listState.selectionManager.state.disallowEmptySelection = false;\n\n return {\n ...listState,\n };\n }, [listState, selectedKeys, setSelectedKeys]);\n\n const listBox = (\n <RACListBox className=\"cim-combo-box-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n );\n\n return (\n <RACListStateContext.Provider value={updatedListState}>\n {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\n </RACListStateContext.Provider>\n );\n}\n"]}
@@ -7,7 +7,7 @@ const react_aria_components_1 = require("react-aria-components");
7
7
  const tag_group_js_1 = require("../tag/tag-group.js");
8
8
  const tag_js_1 = require("../tag/tag.js");
9
9
  /** @internal */
10
- function TagFieldTags({ inputId, selectedKeys, isDisabled, renderEmptyState, onRemove, }) {
10
+ function TagFieldTags({ inputId, selectedKeys, isDisabled, isReadOnly, renderEmptyState, onRemove, }) {
11
11
  const listState = (0, react_1.useContext)(react_aria_components_1.ListStateContext);
12
12
  const selectedItems = (0, react_1.useMemo)(() => {
13
13
  return [...selectedKeys.values()]
@@ -20,8 +20,10 @@ function TagFieldTags({ inputId, selectedKeys, isDisabled, renderEmptyState, onR
20
20
  [react_aria_components_1.ButtonContext, null],
21
21
  [react_aria_components_1.TextContext, null],
22
22
  [react_aria_components_1.ListStateContext, null],
23
- ], children: (0, jsx_runtime_1.jsx)(tag_group_js_1.TagGroup, { "aria-labelledby": inputId, disabledKeys: isDisabled ? selectedKeys : undefined, renderEmptyState: renderEmptyState, onRemove: (keys) => {
24
- keys.forEach(onRemove);
25
- }, children: selectedItems.map((item) => ((0, jsx_runtime_1.jsx)(tag_js_1.Tag, { id: item.key, isDisabled: item.props.isDisabled, children: item.textValue }, item.key))) }) }));
23
+ ], children: (0, jsx_runtime_1.jsx)(tag_group_js_1.TagGroup, { "aria-labelledby": inputId, disabledKeys: isDisabled ? selectedKeys : undefined, renderEmptyState: renderEmptyState, onRemove: isReadOnly
24
+ ? undefined
25
+ : (keys) => {
26
+ keys.forEach(onRemove);
27
+ }, children: selectedItems.map((item) => ((0, jsx_runtime_1.jsx)(tag_js_1.Tag, { id: item.key, isDisabled: item.props.isDisabled, children: item.textValue }, item.key))) }) }));
26
28
  }
27
29
  //# sourceMappingURL=tag-field-tags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field-tags.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-tags.tsx"],"names":[],"mappings":";;AAcA,oCA6CC;;AA3DD,iCAA4C;AAC5C,iEAM+B;AAC/B,sDAA+C;AAC/C,0CAAmD;AAInD,gBAAgB;AAChB,SAAgB,YAAY,CAA2B,EACrD,OAAO,EACP,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,QAAQ,GAKT;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACjC,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;aAC9B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;aACjE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3D,OAAO,CACL,uBAAC,gCAAW,IACV,MAAM,EAAE;YACN,4EAA4E;YAC5E,CAAC,oCAAe,EAAE,IAAI,CAAC;YACvB,CAAC,qCAAgB,EAAE,IAAI,CAAC;YACxB,CAAC,mCAAc,EAAE,IAAI,CAAC;YACtB,CAAC,wCAAmB,EAAE,IAAI,CAAC;SAC5B,YAED,uBAAC,uBAAQ,uBACU,OAAO,EACxB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACnD,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACzB,CAAC,YAEA,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,uBAAC,YAAG,IAAgB,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,EAAG,IAAI,CAAC,KAAkB,CAAC,UAAU,YAC9E,IAAI,CAAC,SAAS,IADP,IAAI,CAAC,GAAG,CAEZ,CACP,CAAC,GACO,GACC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport {\n ButtonContext as RACButtonContext,\n LabelContext as RACLabelContext,\n ListStateContext as RACListStateContext,\n Provider as RACProvider,\n TextContext as RACTextContext,\n} from 'react-aria-components';\nimport { TagGroup } from '../tag/tag-group.js';\nimport { Tag, type TagProps } from '../tag/tag.js';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { UNSTABLE_TagFieldProps } from './tag-field.js';\n\n/** @internal */\nexport function TagFieldTags<T extends CollectionItem>({\n inputId,\n selectedKeys,\n isDisabled,\n renderEmptyState,\n onRemove,\n}: Pick<UNSTABLE_TagFieldProps<T>, 'isDisabled' | 'renderEmptyState'> & {\n inputId: string;\n selectedKeys: Set<Key>;\n onRemove: (key: Key) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n const selectedItems = useMemo(() => {\n return [...selectedKeys.values()]\n .map((key) => listState?.selectionManager.collection.getItem(key))\n .filter((value) => !!value);\n }, [selectedKeys, listState?.selectionManager.collection]);\n\n return (\n <RACProvider\n values={[\n // Reset contexts so that TagGroup doesn't inherit any data from RACComboBox\n [RACLabelContext, null],\n [RACButtonContext, null],\n [RACTextContext, null],\n [RACListStateContext, null],\n ]}\n >\n <TagGroup\n aria-labelledby={inputId}\n disabledKeys={isDisabled ? selectedKeys : undefined}\n renderEmptyState={renderEmptyState}\n onRemove={(keys) => {\n keys.forEach(onRemove);\n }}\n >\n {selectedItems.map((item) => (\n <Tag key={item.key} id={item.key} isDisabled={(item.props as TagProps).isDisabled}>\n {item.textValue}\n </Tag>\n ))}\n </TagGroup>\n </RACProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"tag-field-tags.js","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field-tags.tsx"],"names":[],"mappings":";;AAcA,oCAkDC;;AAhED,iCAA4C;AAC5C,iEAM+B;AAC/B,sDAA+C;AAC/C,0CAAmD;AAInD,gBAAgB;AAChB,SAAgB,YAAY,CAA2B,EACrD,OAAO,EACP,YAAY,EACZ,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,GAKT;IACC,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,wCAAmB,CAAC,CAAC;IAElD,MAAM,aAAa,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACjC,OAAO,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;aAC9B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;aACjE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3D,OAAO,CACL,uBAAC,gCAAW,IACV,MAAM,EAAE;YACN,4EAA4E;YAC5E,CAAC,oCAAe,EAAE,IAAI,CAAC;YACvB,CAAC,qCAAgB,EAAE,IAAI,CAAC;YACxB,CAAC,mCAAc,EAAE,IAAI,CAAC;YACtB,CAAC,wCAAmB,EAAE,IAAI,CAAC;SAC5B,YAED,uBAAC,uBAAQ,uBACU,OAAO,EACxB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACnD,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EACN,UAAU;gBACR,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;oBACP,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACzB,CAAC,YAGN,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC3B,uBAAC,YAAG,IAAgB,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,EAAG,IAAI,CAAC,KAAkB,CAAC,UAAU,YAC9E,IAAI,CAAC,SAAS,IADP,IAAI,CAAC,GAAG,CAEZ,CACP,CAAC,GACO,GACC,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { useContext, useMemo } from 'react';\nimport {\n ButtonContext as RACButtonContext,\n LabelContext as RACLabelContext,\n ListStateContext as RACListStateContext,\n Provider as RACProvider,\n TextContext as RACTextContext,\n} from 'react-aria-components';\nimport { TagGroup } from '../tag/tag-group.js';\nimport { Tag, type TagProps } from '../tag/tag.js';\nimport type { CollectionItem, Key } from '../types.js';\nimport type { TagFieldProps } from './tag-field.js';\n\n/** @internal */\nexport function TagFieldTags<T extends CollectionItem>({\n inputId,\n selectedKeys,\n isDisabled,\n isReadOnly,\n renderEmptyState,\n onRemove,\n}: Pick<TagFieldProps<T>, 'isDisabled' | 'isReadOnly' | 'renderEmptyState'> & {\n inputId: string;\n selectedKeys: Set<Key>;\n onRemove: (key: Key) => void;\n}) {\n const listState = useContext(RACListStateContext);\n\n const selectedItems = useMemo(() => {\n return [...selectedKeys.values()]\n .map((key) => listState?.selectionManager.collection.getItem(key))\n .filter((value) => !!value);\n }, [selectedKeys, listState?.selectionManager.collection]);\n\n return (\n <RACProvider\n values={[\n // Reset contexts so that TagGroup doesn't inherit any data from RACComboBox\n [RACLabelContext, null],\n [RACButtonContext, null],\n [RACTextContext, null],\n [RACListStateContext, null],\n ]}\n >\n <TagGroup\n aria-labelledby={inputId}\n disabledKeys={isDisabled ? selectedKeys : undefined}\n renderEmptyState={renderEmptyState}\n onRemove={\n isReadOnly\n ? undefined\n : (keys) => {\n keys.forEach(onRemove);\n }\n }\n >\n {selectedItems.map((item) => (\n <Tag key={item.key} id={item.key} isDisabled={(item.props as TagProps).isDisabled}>\n {item.textValue}\n </Tag>\n ))}\n </TagGroup>\n </RACProvider>\n );\n}\n"]}
@@ -2,42 +2,50 @@ import { type ListBoxProps as RACListBoxProps, type ComboBoxProps as RACComboBox
2
2
  import type { TagGroupProps } from '../tag/tag-group.js';
3
3
  import type { CollectionItem, CollectionProps, CommonProps, FieldWithPlaceholderProps, Key, StringLikeChildren } from '../types.js';
4
4
  /** Represents the state of the `TagField` component for validation purposes. */
5
- export interface UNSTABLE_TagFieldValidationValue {
5
+ export interface TagFieldValidationValue {
6
6
  /** The selected keys in the TagField. */
7
7
  selectedKeys: Set<Key> | null;
8
8
  /** The value of the TagField input. */
9
9
  inputValue: string;
10
10
  }
11
- export interface UNSTABLE_TagFieldProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldWithPlaceholderProps<UNSTABLE_TagFieldValidationValue>, CollectionProps<T>, Pick<RACComboBoxProps<T>, 'isRequired' | 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onInputChange' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'>, Pick<TagGroupProps<T>, 'renderEmptyState'> {
11
+ export interface TagFieldProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldWithPlaceholderProps<TagFieldValidationValue>, CollectionProps<T>, Pick<RACComboBoxProps<T>, 'isRequired' | 'isDisabled' | 'isInvalid' | 'isReadOnly' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onInputChange' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'>, Pick<TagGroupProps<T>, 'renderEmptyState'> {
12
+ /** The currently selected keys in the collection (controlled). */
12
13
  selectedKeys?: Iterable<Key>;
14
+ /** The initial selected keys in the collection (uncontrolled). */
13
15
  defaultSelectedKeys?: Iterable<Key>;
16
+ /** Handler that is called when the selection changes. */
14
17
  onSelectionChange?: (keys: Set<Key>) => void;
18
+ /**
19
+ * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.
20
+ * @default false
21
+ */
22
+ isVirtualized?: boolean;
15
23
  }
16
24
  /**
17
25
  * Allows users to filter a collapsible list and select multiple items from it.
18
26
  *
19
- * See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field)
27
+ * See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field).
20
28
  */
21
- declare const _UNSTABLE_TagField: <T extends CollectionItem>(props: UNSTABLE_TagFieldProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
22
- export { _UNSTABLE_TagField as UNSTABLE_TagField };
23
- export interface UNSTABLE_TagFieldItemProps<T extends CollectionItem> extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
29
+ declare const _TagField: <T extends CollectionItem>(props: TagFieldProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
30
+ export { _TagField as TagField };
31
+ export interface TagFieldItemProps<T extends CollectionItem> extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
24
32
  /** The content to display as the label. */
25
33
  children: StringLikeChildren;
26
34
  }
27
35
  /** Renders a single list item within `TagField`. */
28
- export declare function UNSTABLE_TagFieldItem<T extends CollectionItem>({ children, ...props }: UNSTABLE_TagFieldItemProps<T>): import("react/jsx-runtime").JSX.Element;
29
- export declare namespace UNSTABLE_TagFieldItem {
36
+ export declare function TagFieldItem<T extends CollectionItem>({ children, ...props }: TagFieldItemProps<T>): import("react/jsx-runtime").JSX.Element;
37
+ export declare namespace TagFieldItem {
30
38
  var displayName: string;
31
39
  }
32
- export interface UNSTABLE_TagFieldSectionProps<T extends CollectionItem> extends CollectionProps<T> {
40
+ export interface TagFieldSectionProps<T extends CollectionItem> extends CollectionProps<T> {
33
41
  /** The ID of the section. Has to be unique across all sections and items. */
34
42
  id?: Key;
35
43
  /** The content to display as the section title. */
36
44
  title: string;
37
45
  }
38
46
  /** Groups list items within `TagField` into a section. */
39
- export declare function UNSTABLE_TagFieldSection<T extends CollectionItem>({ title, children, items, ...props }: UNSTABLE_TagFieldSectionProps<T>): import("react/jsx-runtime").JSX.Element;
40
- export declare namespace UNSTABLE_TagFieldSection {
47
+ export declare function TagFieldSection<T extends CollectionItem>({ title, children, items, ...props }: TagFieldSectionProps<T>): import("react/jsx-runtime").JSX.Element;
48
+ export declare namespace TagFieldSection {
41
49
  var displayName: string;
42
50
  }
43
51
  //# sourceMappingURL=tag-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAQA,OAAO,EAOL,KAAK,YAAY,IAAI,eAAe,EAIpC,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,gBAAgB,IAAI,mBAAmB,EAK7C,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,yBAAyB,EACzB,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAOrB,gFAAgF;AAChF,MAAM,WAAW,gCAAgC;IAC/C,yCAAyC;IACzC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC9B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;C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AE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACjG,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,cAAc,EAAE,EACjE,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,6BAA6B,CAAC,CAAC,CAAC,2CAelC;yBApBe,wBAAwB"}
1
+ {"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../../src/components/tag-field/tag-field.tsx"],"names":[],"mappings":"AAQA,OAAO,EAOL,KAAK,YAAY,IAAI,eAAe,EAIpC,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,gBAAgB,IAAI,mBAAmB,EAK7C,MAAM,uBAAuB,CAAC;AAS/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,yBAAyB,EACzB,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAMrB,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC9B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACtE,SAAQ,WAAW,EACjB,yBAAyB,CAAC,uBAAuB,CAAC,EAClD,eAAe,CAAC,CAAC,CAAC,EAClB,IAAI,CACF,gBAAgB,CAAC,CAAC,CAAC,EACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,CACjB,EACD,IAAI,CAAC,eAAe,CAAC,C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AC,CAAC,2CAezB;yBApBe,eAAe"}
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.UNSTABLE_TagField = void 0;
8
- exports.UNSTABLE_TagFieldItem = UNSTABLE_TagFieldItem;
9
- exports.UNSTABLE_TagFieldSection = UNSTABLE_TagFieldSection;
7
+ exports.TagField = void 0;
8
+ exports.TagFieldItem = TagFieldItem;
9
+ exports.TagFieldSection = TagFieldSection;
10
10
  const jsx_runtime_1 = require("react/jsx-runtime");
11
11
  const form_1 = require("@react-aria/form");
12
12
  const utils_1 = require("@react-aria/utils");
@@ -23,13 +23,11 @@ const use_production_warning_js_1 = require("../../utils/use-production-warning.
23
23
  const with_style_props_js_1 = require("../../with-style-props.js");
24
24
  const collapsible_list_js_1 = require("../internal/collapsible-list/collapsible-list.js");
25
25
  const form_field_js_1 = require("../internal/form-field/form-field.js");
26
- const stack_js_1 = require("../spacing/stack/stack.js");
27
- const text_js_1 = require("../typography/text.js");
28
26
  const utils_js_1 = require("../typography/utils.js");
29
27
  const tag_field_input_js_1 = require("./tag-field-input.js");
30
28
  const tag_field_list_box_js_1 = require("./tag-field-list-box.js");
31
29
  const tag_field_tags_js_1 = require("./tag-field-tags.js");
32
- function UNSTABLE_TagField({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, inputValue: consumerInputValue, defaultInputValue: defaultConsumerInputValue, onInputChange, name, validate, onScroll, selectedKeys: consumerSelectedKeys, defaultSelectedKeys: defaultConsumerSelectedKeys, onSelectionChange, id, renderEmptyState = () => ((0, jsx_runtime_1.jsx)(stack_js_1.Stack, { gap: 0, justify: "center", UNSAFE_style: { height: 24 }, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "p", variant: "medium", tone: "base", children: "No items selected." }) })), ...props }, ref) {
30
+ function TagField({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, inputValue: consumerInputValue, defaultInputValue: defaultConsumerInputValue, onInputChange, name, validate, onScroll, selectedKeys: consumerSelectedKeys, defaultSelectedKeys: defaultConsumerSelectedKeys, onSelectionChange, id, renderEmptyState, isVirtualized = false, ...props }, ref) {
33
31
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, isRequired, isDisabled, isInvalid } = props;
34
32
  (0, use_production_warning_js_1.useProductionWarning)(() => {
35
33
  if (!label && !ariaLabel && !ariaLabelledBy) {
@@ -91,6 +89,8 @@ function UNSTABLE_TagField({ label, description, error, items, children, placeho
91
89
  };
92
90
  const onItemSelectionChange = (key) => {
93
91
  if (selectedSet.has(key)) {
92
+ // This is a temporary mutation followed immediately by a state update, so this is fine
93
+ // eslint-disable-next-line react-hooks/react-compiler
94
94
  selectedSet.delete(key);
95
95
  }
96
96
  else {
@@ -115,29 +115,29 @@ function UNSTABLE_TagField({ label, description, error, items, children, placeho
115
115
  [react_aria_components_1.TextContext, { slots: { description: { id: descriptionId }, errorMessage: { id: errorMessageId } } }],
116
116
  [react_aria_components_1.GroupContext, { isInvalid: validationState.displayValidation.isInvalid, isDisabled }],
117
117
  [react_aria_components_1.FieldErrorContext, validationState.displayValidation],
118
- ], children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: isRequired, isDisabled: isDisabled, children: label }), (0, jsx_runtime_1.jsx)(tag_field_tags_js_1.TagFieldTags, { inputId: inputId, selectedKeys: selectedSet, isDisabled: isDisabled || isReadOnly, renderEmptyState: renderEmptyState, onRemove: onItemSelectionChange }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Group, { className: "cim-combo-box-input-group", children: [(0, jsx_runtime_1.jsx)(tag_field_input_js_1.TagFieldInput, { "aria-describedby": props['aria-describedby'], isReadOnly: isReadOnly, isRequired: isRequired, isInvalid: validationState.displayValidation.isInvalid, placeholder: selectedSet.size === 0 && placeholder
118
+ ], children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: isRequired, isDisabled: isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Group, { className: "cim-combo-box-input-group", children: [(0, jsx_runtime_1.jsx)(tag_field_input_js_1.TagFieldInput, { "aria-describedby": props['aria-describedby'], isReadOnly: isReadOnly, isRequired: isRequired, isInvalid: validationState.displayValidation.isInvalid, placeholder: selectedSet.size === 0 && placeholder
119
119
  ? placeholder
120
- : messages.format('itemsSelected', { selectedItemCount: selectedSet.size }), onFocusChange: onFocusChange }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-combo-box-button", children: (0, jsx_runtime_1.jsx)(index_js_1.IconChevronDown, {}) })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: (0, jsx_runtime_1.jsx)(tag_field_list_box_js_1.TagFieldListBox, { items: items, selectedKeys: selectedSet, setSelectedKeys: setSelectedKeys, onScroll: onScroll, children: children }) })] }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { ref: formInputRef, style: { display: 'none' }, value: selectedSet.size || '', required: isRequired, "aria-invalid": validationState.displayValidation.isInvalid || undefined, onChange: () => { } }), name && [...selectedSet].map((value) => (0, jsx_runtime_1.jsx)("input", { type: "hidden", name: name, value: value }, value))] }));
120
+ : messages.format('itemsSelected', { selectedItemCount: selectedSet.size }), onFocusChange: onFocusChange }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Button, { className: "cim-combo-box-button", children: (0, jsx_runtime_1.jsx)(index_js_1.IconChevronDown, {}) })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(tag_field_tags_js_1.TagFieldTags, { inputId: inputId, selectedKeys: selectedSet, isDisabled: isDisabled, isReadOnly: isReadOnly, renderEmptyState: renderEmptyState, onRemove: onItemSelectionChange }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: (0, jsx_runtime_1.jsx)(tag_field_list_box_js_1.TagFieldListBox, { items: items, selectedKeys: selectedSet, setSelectedKeys: setSelectedKeys, onScroll: onScroll, isVirtualized: isVirtualized, children: children }) })] }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { ref: formInputRef, style: { display: 'none' }, value: selectedSet.size || '', required: isRequired, "aria-invalid": validationState.displayValidation.isInvalid || undefined, onChange: () => { } }), name && [...selectedSet].map((value) => (0, jsx_runtime_1.jsx)("input", { type: "hidden", name: name, value: value }, value))] }));
121
121
  }
122
122
  /**
123
123
  * Allows users to filter a collapsible list and select multiple items from it.
124
124
  *
125
- * See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field)
125
+ * See [tag field usage guidelines](https://ui.cimpress.com/components/tag-field).
126
126
  */
127
- const _UNSTABLE_TagField = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(UNSTABLE_TagField), 'TagField');
128
- exports.UNSTABLE_TagField = _UNSTABLE_TagField;
127
+ const _TagField = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(TagField), 'TagField');
128
+ exports.TagField = _TagField;
129
129
  /** Renders a single list item within `TagField`. */
130
- function UNSTABLE_TagFieldItem({ children, ...props }) {
130
+ function TagFieldItem({ children, ...props }) {
131
131
  const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
132
- return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: "cim-combo-box-item cim-tag-field-item cim-checkbox", textValue: textValue, children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle-wrapper", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle", children: (0, jsx_runtime_1.jsx)(index_js_1.IconCheckBold, {}) }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "label", className: (0, utils_js_1.textStyle)({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
132
+ return ((0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxItem, { ...props, className: "cim-tag-field-item cim-checkbox", textValue: textValue, children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle-wrapper", "aria-hidden": true, children: (0, jsx_runtime_1.jsx)("div", { className: "cim-checkbox-toggle", children: (0, jsx_runtime_1.jsx)(index_js_1.IconCheckBold, {}) }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Text, { slot: "label", className: (0, utils_js_1.textStyle)({ variant: 'medium', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
133
133
  }
134
- UNSTABLE_TagFieldItem.displayName = 'TagFieldItem';
134
+ TagFieldItem.displayName = 'TagFieldItem';
135
135
  /** Groups list items within `TagField` into a section. */
136
- function UNSTABLE_TagFieldSection({ title, children, items, ...props }) {
136
+ function TagFieldSection({ title, children, items, ...props }) {
137
137
  if (!(0, is_production_js_1.isProduction)() && items != null && typeof children !== 'function') {
138
138
  console.warn('`TagFieldSection` requires `children` to be a function when using `items` prop');
139
139
  }
140
140
  return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.ListBoxSection, { ...props, className: "cim-combo-box-section", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Header, { className: (0, clsx_1.default)('cim-combo-box-section-header', (0, utils_js_1.textStyle)({ variant: 'small-semibold', tone: 'subtle' })), children: title }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children })] }));
141
141
  }
142
- UNSTABLE_TagFieldSection.displayName = 'TagFieldSection';
142
+ TagFieldSection.displayName = 'TagFieldSection';
143
143
  //# sourceMappingURL=tag-field.js.map