@cimpress-ui/react 1.7.1 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/commonjs/components/app-header/app-header.d.ts.map +1 -1
  2. package/dist/commonjs/components/app-header/app-header.js +1 -1
  3. package/dist/commonjs/components/app-header/app-header.js.map +1 -1
  4. package/dist/commonjs/components/app-header/side-nav.d.ts +4 -5
  5. package/dist/commonjs/components/app-header/side-nav.d.ts.map +1 -1
  6. package/dist/commonjs/components/app-header/side-nav.js +3 -2
  7. package/dist/commonjs/components/app-header/side-nav.js.map +1 -1
  8. package/dist/commonjs/components/combo-box/combo-box.d.ts +16 -4
  9. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
  10. package/dist/commonjs/components/combo-box/combo-box.js +9 -4
  11. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
  12. package/dist/commonjs/components/copy/copy-button.d.ts +20 -0
  13. package/dist/commonjs/components/copy/copy-button.d.ts.map +1 -0
  14. package/dist/commonjs/components/copy/copy-button.js +68 -0
  15. package/dist/commonjs/components/copy/copy-button.js.map +1 -0
  16. package/dist/commonjs/components/copy/inline-copy.d.ts +12 -0
  17. package/dist/commonjs/components/copy/inline-copy.d.ts.map +1 -0
  18. package/dist/commonjs/components/copy/inline-copy.js +33 -0
  19. package/dist/commonjs/components/copy/inline-copy.js.map +1 -0
  20. package/dist/commonjs/components/copy/use-copy.d.ts +10 -0
  21. package/dist/commonjs/components/copy/use-copy.d.ts.map +1 -0
  22. package/dist/commonjs/components/copy/use-copy.js +30 -0
  23. package/dist/commonjs/components/copy/use-copy.js.map +1 -0
  24. package/dist/commonjs/components/date-picker/date-picker.d.ts +7 -2
  25. package/dist/commonjs/components/date-picker/date-picker.d.ts.map +1 -1
  26. package/dist/commonjs/components/date-picker/date-picker.js +6 -2
  27. package/dist/commonjs/components/date-picker/date-picker.js.map +1 -1
  28. package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js +4 -7
  29. package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -1
  30. package/dist/commonjs/components/disclosure/disclosure-group.d.ts +4 -2
  31. package/dist/commonjs/components/disclosure/disclosure-group.d.ts.map +1 -1
  32. package/dist/commonjs/components/disclosure/disclosure-group.js.map +1 -1
  33. package/dist/commonjs/components/disclosure/disclosure.d.ts +4 -2
  34. package/dist/commonjs/components/disclosure/disclosure.d.ts.map +1 -1
  35. package/dist/commonjs/components/disclosure/disclosure.js.map +1 -1
  36. package/dist/commonjs/components/link-tabs/link-tabs.d.ts.map +1 -1
  37. package/dist/commonjs/components/link-tabs/link-tabs.js +1 -1
  38. package/dist/commonjs/components/link-tabs/link-tabs.js.map +1 -1
  39. package/dist/commonjs/components/menu/menu.d.ts +5 -3
  40. package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
  41. package/dist/commonjs/components/menu/menu.js.map +1 -1
  42. package/dist/commonjs/components/number-field/number-field.d.ts +9 -2
  43. package/dist/commonjs/components/number-field/number-field.d.ts.map +1 -1
  44. package/dist/commonjs/components/number-field/number-field.js +8 -2
  45. package/dist/commonjs/components/number-field/number-field.js.map +1 -1
  46. package/dist/commonjs/components/select/select.d.ts +20 -4
  47. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  48. package/dist/commonjs/components/select/select.js +9 -3
  49. package/dist/commonjs/components/select/select.js.map +1 -1
  50. package/dist/commonjs/components/spacing/types.d.ts.map +1 -1
  51. package/dist/commonjs/components/spacing/types.js +6 -4
  52. package/dist/commonjs/components/spacing/types.js.map +1 -1
  53. package/dist/commonjs/components/stepper/context.d.ts +2 -0
  54. package/dist/commonjs/components/stepper/context.d.ts.map +1 -1
  55. package/dist/commonjs/components/stepper/context.js +2 -0
  56. package/dist/commonjs/components/stepper/context.js.map +1 -1
  57. package/dist/commonjs/components/stepper/stepper-item.d.ts.map +1 -1
  58. package/dist/commonjs/components/stepper/stepper-item.js +3 -2
  59. package/dist/commonjs/components/stepper/stepper-item.js.map +1 -1
  60. package/dist/commonjs/components/stepper/stepper.d.ts.map +1 -1
  61. package/dist/commonjs/components/stepper/stepper.js +14 -8
  62. package/dist/commonjs/components/stepper/stepper.js.map +1 -1
  63. package/dist/commonjs/components/table/contexts/column-collection.d.ts.map +1 -1
  64. package/dist/commonjs/components/table/contexts/column-collection.js +0 -1
  65. package/dist/commonjs/components/table/contexts/column-collection.js.map +1 -1
  66. package/dist/commonjs/components/table/contexts/row-state.js.map +1 -1
  67. package/dist/commonjs/components/table/contexts/table-state.js.map +1 -1
  68. package/dist/commonjs/components/table/hooks/use-table-cell.js.map +1 -1
  69. package/dist/commonjs/components/tabs/tabs.d.ts +3 -1
  70. package/dist/commonjs/components/tabs/tabs.d.ts.map +1 -1
  71. package/dist/commonjs/components/tabs/tabs.js.map +1 -1
  72. package/dist/commonjs/components/tag-field/tag-field-input.js +2 -2
  73. package/dist/commonjs/components/tag-field/tag-field-input.js.map +1 -1
  74. package/dist/commonjs/components/tag-field/tag-field-list-box.js +5 -2
  75. package/dist/commonjs/components/tag-field/tag-field-list-box.js.map +1 -1
  76. package/dist/commonjs/components/tag-field/tag-field-tags.js +2 -0
  77. package/dist/commonjs/components/tag-field/tag-field-tags.js.map +1 -1
  78. package/dist/commonjs/components/tag-field/tag-field.d.ts +14 -4
  79. package/dist/commonjs/components/tag-field/tag-field.d.ts.map +1 -1
  80. package/dist/commonjs/components/tag-field/tag-field.js +7 -3
  81. package/dist/commonjs/components/tag-field/tag-field.js.map +1 -1
  82. package/dist/commonjs/components/text-inputs/search-field.d.ts +9 -2
  83. package/dist/commonjs/components/text-inputs/search-field.d.ts.map +1 -1
  84. package/dist/commonjs/components/text-inputs/search-field.js +5 -1
  85. package/dist/commonjs/components/text-inputs/search-field.js.map +1 -1
  86. package/dist/commonjs/components/text-inputs/text-area.d.ts +15 -5
  87. package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
  88. package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
  89. package/dist/commonjs/components/text-inputs/text-field.d.ts +2 -5
  90. package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
  91. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
  92. package/dist/commonjs/components/toggle-button/internal-toggle-button.js +7 -7
  93. package/dist/commonjs/components/toggle-button/internal-toggle-button.js.map +1 -1
  94. package/dist/commonjs/components/toggle-button/toggle-button-group.d.ts.map +1 -1
  95. package/dist/commonjs/components/toggle-button/toggle-button-group.js +3 -0
  96. package/dist/commonjs/components/toggle-button/toggle-button-group.js.map +1 -1
  97. package/dist/commonjs/components/top-nav/top-nav.d.ts +12 -0
  98. package/dist/commonjs/components/top-nav/top-nav.d.ts.map +1 -0
  99. package/dist/commonjs/components/top-nav/top-nav.js +18 -0
  100. package/dist/commonjs/components/top-nav/top-nav.js.map +1 -0
  101. package/dist/commonjs/components/types.d.ts +6 -1
  102. package/dist/commonjs/components/types.d.ts.map +1 -1
  103. package/dist/commonjs/components/types.js.map +1 -1
  104. package/dist/commonjs/index.d.ts +3 -0
  105. package/dist/commonjs/index.d.ts.map +1 -1
  106. package/dist/commonjs/index.js +3 -0
  107. package/dist/commonjs/index.js.map +1 -1
  108. package/dist/commonjs/utils/string-like-children-to-string.d.ts +3 -0
  109. package/dist/commonjs/utils/string-like-children-to-string.d.ts.map +1 -0
  110. package/dist/commonjs/utils/string-like-children-to-string.js +7 -0
  111. package/dist/commonjs/utils/string-like-children-to-string.js.map +1 -0
  112. package/dist/esm/components/app-header/app-header.d.ts.map +1 -1
  113. package/dist/esm/components/app-header/app-header.js +1 -1
  114. package/dist/esm/components/app-header/app-header.js.map +1 -1
  115. package/dist/esm/components/app-header/side-nav.d.ts +4 -5
  116. package/dist/esm/components/app-header/side-nav.d.ts.map +1 -1
  117. package/dist/esm/components/app-header/side-nav.js +3 -2
  118. package/dist/esm/components/app-header/side-nav.js.map +1 -1
  119. package/dist/esm/components/combo-box/combo-box.d.ts +16 -4
  120. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
  121. package/dist/esm/components/combo-box/combo-box.js +10 -5
  122. package/dist/esm/components/combo-box/combo-box.js.map +1 -1
  123. package/dist/esm/components/copy/copy-button.d.ts +20 -0
  124. package/dist/esm/components/copy/copy-button.d.ts.map +1 -0
  125. package/dist/esm/components/copy/copy-button.js +65 -0
  126. package/dist/esm/components/copy/copy-button.js.map +1 -0
  127. package/dist/esm/components/copy/inline-copy.d.ts +12 -0
  128. package/dist/esm/components/copy/inline-copy.d.ts.map +1 -0
  129. package/dist/esm/components/copy/inline-copy.js +27 -0
  130. package/dist/esm/components/copy/inline-copy.js.map +1 -0
  131. package/dist/esm/components/copy/use-copy.d.ts +10 -0
  132. package/dist/esm/components/copy/use-copy.d.ts.map +1 -0
  133. package/dist/esm/components/copy/use-copy.js +27 -0
  134. package/dist/esm/components/copy/use-copy.js.map +1 -0
  135. package/dist/esm/components/date-picker/date-picker.d.ts +7 -2
  136. package/dist/esm/components/date-picker/date-picker.d.ts.map +1 -1
  137. package/dist/esm/components/date-picker/date-picker.js +7 -3
  138. package/dist/esm/components/date-picker/date-picker.js.map +1 -1
  139. package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js +4 -7
  140. package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -1
  141. package/dist/esm/components/disclosure/disclosure-group.d.ts +4 -2
  142. package/dist/esm/components/disclosure/disclosure-group.d.ts.map +1 -1
  143. package/dist/esm/components/disclosure/disclosure-group.js.map +1 -1
  144. package/dist/esm/components/disclosure/disclosure.d.ts +4 -2
  145. package/dist/esm/components/disclosure/disclosure.d.ts.map +1 -1
  146. package/dist/esm/components/disclosure/disclosure.js.map +1 -1
  147. package/dist/esm/components/link-tabs/link-tabs.d.ts.map +1 -1
  148. package/dist/esm/components/link-tabs/link-tabs.js +1 -1
  149. package/dist/esm/components/link-tabs/link-tabs.js.map +1 -1
  150. package/dist/esm/components/menu/menu.d.ts +5 -3
  151. package/dist/esm/components/menu/menu.d.ts.map +1 -1
  152. package/dist/esm/components/menu/menu.js.map +1 -1
  153. package/dist/esm/components/number-field/number-field.d.ts +9 -2
  154. package/dist/esm/components/number-field/number-field.d.ts.map +1 -1
  155. package/dist/esm/components/number-field/number-field.js +8 -2
  156. package/dist/esm/components/number-field/number-field.js.map +1 -1
  157. package/dist/esm/components/select/select.d.ts +20 -4
  158. package/dist/esm/components/select/select.d.ts.map +1 -1
  159. package/dist/esm/components/select/select.js +9 -3
  160. package/dist/esm/components/select/select.js.map +1 -1
  161. package/dist/esm/components/spacing/types.d.ts.map +1 -1
  162. package/dist/esm/components/spacing/types.js +6 -4
  163. package/dist/esm/components/spacing/types.js.map +1 -1
  164. package/dist/esm/components/stepper/context.d.ts +2 -0
  165. package/dist/esm/components/stepper/context.d.ts.map +1 -1
  166. package/dist/esm/components/stepper/context.js +2 -0
  167. package/dist/esm/components/stepper/context.js.map +1 -1
  168. package/dist/esm/components/stepper/stepper-item.d.ts.map +1 -1
  169. package/dist/esm/components/stepper/stepper-item.js +3 -2
  170. package/dist/esm/components/stepper/stepper-item.js.map +1 -1
  171. package/dist/esm/components/stepper/stepper.d.ts.map +1 -1
  172. package/dist/esm/components/stepper/stepper.js +15 -9
  173. package/dist/esm/components/stepper/stepper.js.map +1 -1
  174. package/dist/esm/components/table/contexts/column-collection.d.ts.map +1 -1
  175. package/dist/esm/components/table/contexts/column-collection.js +0 -1
  176. package/dist/esm/components/table/contexts/column-collection.js.map +1 -1
  177. package/dist/esm/components/table/contexts/row-state.js +2 -2
  178. package/dist/esm/components/table/contexts/row-state.js.map +1 -1
  179. package/dist/esm/components/table/contexts/table-state.js +2 -2
  180. package/dist/esm/components/table/contexts/table-state.js.map +1 -1
  181. package/dist/esm/components/table/hooks/use-table-cell.js +2 -2
  182. package/dist/esm/components/table/hooks/use-table-cell.js.map +1 -1
  183. package/dist/esm/components/tabs/tabs.d.ts +3 -1
  184. package/dist/esm/components/tabs/tabs.d.ts.map +1 -1
  185. package/dist/esm/components/tabs/tabs.js.map +1 -1
  186. package/dist/esm/components/tag-field/tag-field-input.js +2 -2
  187. package/dist/esm/components/tag-field/tag-field-input.js.map +1 -1
  188. package/dist/esm/components/tag-field/tag-field-list-box.js +5 -2
  189. package/dist/esm/components/tag-field/tag-field-list-box.js.map +1 -1
  190. package/dist/esm/components/tag-field/tag-field-tags.js +2 -0
  191. package/dist/esm/components/tag-field/tag-field-tags.js.map +1 -1
  192. package/dist/esm/components/tag-field/tag-field.d.ts +14 -4
  193. package/dist/esm/components/tag-field/tag-field.d.ts.map +1 -1
  194. package/dist/esm/components/tag-field/tag-field.js +8 -4
  195. package/dist/esm/components/tag-field/tag-field.js.map +1 -1
  196. package/dist/esm/components/text-inputs/search-field.d.ts +9 -2
  197. package/dist/esm/components/text-inputs/search-field.d.ts.map +1 -1
  198. package/dist/esm/components/text-inputs/search-field.js +6 -2
  199. package/dist/esm/components/text-inputs/search-field.js.map +1 -1
  200. package/dist/esm/components/text-inputs/text-area.d.ts +15 -5
  201. package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
  202. package/dist/esm/components/text-inputs/text-area.js +1 -1
  203. package/dist/esm/components/text-inputs/text-area.js.map +1 -1
  204. package/dist/esm/components/text-inputs/text-field.d.ts +2 -5
  205. package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
  206. package/dist/esm/components/text-inputs/text-field.js.map +1 -1
  207. package/dist/esm/components/toggle-button/internal-toggle-button.js +7 -7
  208. package/dist/esm/components/toggle-button/internal-toggle-button.js.map +1 -1
  209. package/dist/esm/components/toggle-button/toggle-button-group.d.ts.map +1 -1
  210. package/dist/esm/components/toggle-button/toggle-button-group.js +3 -0
  211. package/dist/esm/components/toggle-button/toggle-button-group.js.map +1 -1
  212. package/dist/esm/components/top-nav/top-nav.d.ts +12 -0
  213. package/dist/esm/components/top-nav/top-nav.d.ts.map +1 -0
  214. package/dist/esm/components/top-nav/top-nav.js +11 -0
  215. package/dist/esm/components/top-nav/top-nav.js.map +1 -0
  216. package/dist/esm/components/types.d.ts +6 -1
  217. package/dist/esm/components/types.d.ts.map +1 -1
  218. package/dist/esm/components/types.js.map +1 -1
  219. package/dist/esm/index.d.ts +3 -0
  220. package/dist/esm/index.d.ts.map +1 -1
  221. package/dist/esm/index.js +3 -0
  222. package/dist/esm/index.js.map +1 -1
  223. package/dist/esm/utils/string-like-children-to-string.d.ts +3 -0
  224. package/dist/esm/utils/string-like-children-to-string.d.ts.map +1 -0
  225. package/dist/esm/utils/string-like-children-to-string.js +4 -0
  226. package/dist/esm/utils/string-like-children-to-string.js.map +1 -0
  227. package/dist-styles/core.css +1 -1
  228. package/dist-styles/normalize.css +1 -1
  229. package/dist-styles/styles.css +1 -1
  230. package/package.json +17 -17
@@ -18,7 +18,8 @@ const icon_button_js_1 = require("../button/icon-button.js");
18
18
  const form_field_js_1 = require("../internal/form-field/form-field.js");
19
19
  const utils_js_1 = require("../typography/utils.js");
20
20
  const date_picker_calendar_js_1 = require("./date-picker-calendar.js");
21
- function DatePicker({ label, description, error: errorMessage, focusedValue, defaultFocusedValue, UNSAFE_className, UNSAFE_style, ...props }, ref) {
21
+ function DatePicker({ label, description, error: errorMessage, focusedValue, defaultFocusedValue, UNSAFE_className, UNSAFE_style, apiRef, ...props }, ref) {
22
+ const inputRef = (0, react_1.useRef)(null);
22
23
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
23
24
  (0, use_production_warning_js_1.useProductionWarning)(() => {
24
25
  if (!label && !ariaLabel && !ariaLabelledBy) {
@@ -26,7 +27,10 @@ function DatePicker({ label, description, error: errorMessage, focusedValue, def
26
27
  }
27
28
  }, [label, ariaLabel, ariaLabelledBy]);
28
29
  const messages = (0, index_js_1.useLocalizedMessages)('datePicker');
29
- return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.DatePicker, { ...props, ref: ref, className: (0, clsx_1.default)('cim-date-picker', 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.Group, { className: "cim-date-picker-input-group", "data-readonly": props.isReadOnly || undefined, children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.DateInput, { className: (0, clsx_1.default)('cim-date-picker-input', (0, utils_js_1.textStyle)({ variant: 'body' })), children: (segment) => ((0, jsx_runtime_1.jsx)("span", { className: "cim-date-picker-segment-wrapper", children: (0, jsx_runtime_1.jsx)(react_aria_components_1.DateSegment, { segment: segment }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-date-picker-input-controls", children: [(0, jsx_runtime_1.jsx)(DatePickerClearButton, { isDisabled: props.isDisabled || props.isReadOnly }), (0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { icon: (0, jsx_runtime_1.jsx)(index_js_2.IconCalendarEmpty, {}), "aria-label": messages.format('openCalendar'), variant: "tertiary", size: "small" })] })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Popover, { className: "cim-date-picker-popover", placement: "bottom end", offset: 5, containerPadding: 16, "data-cim-style-root": true, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Dialog, { children: (0, jsx_runtime_1.jsx)(date_picker_calendar_js_1.DatePickerCalendar, { focusedValue: focusedValue, defaultFocusedValue: defaultFocusedValue, placeholderValue: props.placeholderValue }) }) })] }));
30
+ (0, react_1.useImperativeHandle)(apiRef, () => ({
31
+ focus: () => inputRef.current?.querySelector('[role=spinbutton]:not([data-disabled])')?.focus(),
32
+ }), []);
33
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.DatePicker, { ...props, ref: ref, className: (0, clsx_1.default)('cim-date-picker', 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.Group, { className: "cim-date-picker-input-group", "data-readonly": props.isReadOnly || undefined, children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.DateInput, { ref: inputRef, className: (0, clsx_1.default)('cim-date-picker-input', (0, utils_js_1.textStyle)({ variant: 'body' })), children: (segment) => ((0, jsx_runtime_1.jsx)("span", { className: "cim-date-picker-segment-wrapper", children: (0, jsx_runtime_1.jsx)(react_aria_components_1.DateSegment, { segment: segment }) })) }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-date-picker-input-controls", children: [(0, jsx_runtime_1.jsx)(DatePickerClearButton, { isDisabled: props.isDisabled || props.isReadOnly }), (0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { icon: (0, jsx_runtime_1.jsx)(index_js_2.IconCalendarEmpty, {}), "aria-label": messages.format('openCalendar'), variant: "tertiary", size: "small" })] })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Popover, { className: "cim-date-picker-popover", placement: "bottom end", offset: 5, containerPadding: 16, "data-cim-style-root": true, children: (0, jsx_runtime_1.jsx)(react_aria_components_1.Dialog, { children: (0, jsx_runtime_1.jsx)(date_picker_calendar_js_1.DatePickerCalendar, { focusedValue: focusedValue, defaultFocusedValue: defaultFocusedValue, placeholderValue: props.placeholderValue }) }) })] }));
30
34
  }
31
35
  /**
32
36
  * Allows users to enter or select a date and time value.
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../../src/components/date-picker/date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAGb,gDAAwB;AACxB,iCAAsD;AACtD,iEAU+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAAyD;AACzD,qFAA6E;AAC7E,m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Y,CAAC,EACzC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC7C,IAAI,EAAE,uBAAC,iBAAiB,KAAG,EAC3B,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,SAAS,iBAAiB;IACxB,OAAO,CACL,gCAAK,OAAO,EAAC,WAAW,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,cAAc,+BAClG,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,2hBAA2hB,GAC7hB,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { CalendarDate, CalendarDateTime, ZonedDateTime } from '@internationalized/date';\nimport clsx from 'clsx';\nimport { useContext, type ForwardedRef } from 'react';\nimport {\n type CalendarProps as RACCalendarProps,\n DateInput as RACDateInput,\n DatePicker as RACDatePicker,\n type DatePickerProps as RACDatePickerProps,\n DatePickerStateContext as RACDatePickerStateContext,\n DateSegment as RACDateSegment,\n Dialog as RACDialog,\n Group as RACGroup,\n Popover as RACPopover,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCalendarEmpty } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\nimport { DatePickerCalendar } from './date-picker-calendar.js';\n\n/** Represents a date with optional time and timezone components. */\nexport type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;\n\n/** Maps a date value to a specific subtype depending on which components it contains. */\nexport type MappedDateValue<T> = T extends ZonedDateTime\n ? ZonedDateTime\n : T extends CalendarDateTime\n ? CalendarDateTime\n : T extends CalendarDate\n ? CalendarDate\n : never;\n\nexport interface DatePickerProps<T extends DateValue>\n extends CommonProps,\n FieldProps<MappedDateValue<T>>,\n Pick<\n RACDatePickerProps<T>,\n | 'value'\n | 'defaultValue'\n | 'placeholderValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'autoFocus'\n | 'onFocus'\n | 'onBlur'\n | 'isOpen'\n | 'defaultOpen'\n | 'onOpenChange'\n | 'minValue'\n | 'maxValue'\n | 'isDateUnavailable'\n | 'granularity'\n | 'firstDayOfWeek'\n | 'autoComplete'\n >,\n Pick<RACCalendarProps<T>, 'focusedValue' | 'defaultFocusedValue'> {}\n\nfunction DatePicker<T extends DateValue>(\n {\n label,\n description,\n error: errorMessage,\n focusedValue,\n defaultFocusedValue,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: DatePickerProps<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('DatePicker requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const messages = useLocalizedMessages('datePicker');\n\n return (\n <RACDatePicker {...props} ref={ref} className={clsx('cim-date-picker', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-date-picker-input-group\" data-readonly={props.isReadOnly || undefined}>\n <RACDateInput className={clsx('cim-date-picker-input', textStyle({ variant: 'body' }))}>\n {(segment) => (\n <span className=\"cim-date-picker-segment-wrapper\">\n <RACDateSegment segment={segment} />\n </span>\n )}\n </RACDateInput>\n <div className=\"cim-date-picker-input-controls\">\n <DatePickerClearButton isDisabled={props.isDisabled || props.isReadOnly} />\n <IconButton\n icon={<IconCalendarEmpty />}\n aria-label={messages.format('openCalendar')}\n variant=\"tertiary\"\n size=\"small\"\n />\n </div>\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover\n className=\"cim-date-picker-popover\"\n placement=\"bottom end\"\n offset={5} // 1px border + 4px actual offset\n containerPadding={16}\n data-cim-style-root\n >\n <RACDialog>\n <DatePickerCalendar<T>\n focusedValue={focusedValue}\n defaultFocusedValue={defaultFocusedValue}\n placeholderValue={props.placeholderValue}\n />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>\n );\n}\n\n/**\n * Allows users to enter or select a date and time value.\n *\n * See [date picker usage guidelines](https://ui.cimpress.io/components/date-picker/).\n */\nconst _DatePicker = withStyleProps(forwardRef(DatePicker), 'DatePicker');\n\nexport { _DatePicker as DatePicker };\n\nfunction DatePickerClearButton({ isDisabled }: { isDisabled: boolean | undefined }) {\n const datePickerState = useContext(RACDatePickerStateContext)!;\n const messages = useLocalizedMessages('datePicker');\n\n if (!datePickerState.value) {\n return null;\n }\n\n return (\n <IconButton\n // Don't inherit default Button behavior from DatePicker\n slot={null}\n UNSAFE_className=\"cim-date-picker-clear\"\n aria-label={messages.format('clearValue')}\n onPress={() => datePickerState.setValue(null)}\n icon={<IconCloseDetached />}\n variant=\"tertiary\"\n size=\"small\"\n isDisabled={isDisabled}\n />\n );\n}\n\n// TODO: use one of our standard icons instead of this custom one\nfunction IconCloseDetached() {\n return (\n <svg viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\" className=\"cim-icon\" fill=\"currentcolor\" data-icon>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.21967 0.21967C0.512563 -0.0732233 0.987437 -0.0732233 1.28033 0.21967L6 4.93934L10.7197 0.21967C11.0126 -0.0732233 11.4874 -0.0732233 11.7803 0.21967C12.0732 0.512563 12.0732 0.987437 11.7803 1.28033L7.06066 6L11.7803 10.7197C12.0732 11.0126 12.0732 11.4874 11.7803 11.7803C11.4874 12.0732 11.0126 12.0732 10.7197 11.7803L6 7.06066L1.28033 11.7803C0.987437 12.0732 0.512563 12.0732 0.21967 11.7803C-0.0732233 11.4874 -0.0732233 11.0126 0.21967 10.7197L4.93934 6L0.21967 1.28033C-0.0732233 0.987437 -0.0732233 0.512563 0.21967 0.21967Z\"\n />\n </svg>\n );\n}\n"]}
1
+ {"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../../src/components/date-picker/date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAGb,gDAAwB;AACxB,iCAAmF;AACnF,iEAU+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAAyD;AACzD,qFAA6E;AAC7E,mEAA2D;AAC3D,6DAAsD;AACtD,wEAA4G;AAE5G,qDAAmD;AACnD,uEAA+D;AAiD/D,SAAS,UAAU,CACjB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,GAAG,KAAK,EACW,EACrB,GAAiC;IAEjC,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAE9C,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,mFAAmF,CAAC,CAAC;QACpG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,YAAY,C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AQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,2hBAA2hB,GAC7hB,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { CalendarDate, CalendarDateTime, ZonedDateTime } from '@internationalized/date';\nimport clsx from 'clsx';\nimport { type ForwardedRef, useContext, useImperativeHandle, useRef } from 'react';\nimport {\n type CalendarProps as RACCalendarProps,\n DateInput as RACDateInput,\n DatePicker as RACDatePicker,\n type DatePickerProps as RACDatePickerProps,\n DatePickerStateContext as RACDatePickerStateContext,\n DateSegment as RACDateSegment,\n Dialog as RACDialog,\n Group as RACGroup,\n Popover as RACPopover,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCalendarEmpty } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { ApiProps, CommonProps, FieldProps, FocusableElement } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\nimport { DatePickerCalendar } from './date-picker-calendar.js';\n\n/** Represents a date with optional time and timezone components. */\nexport type DateValue = CalendarDate | CalendarDateTime | ZonedDateTime;\n\n/** Maps a date value to a specific subtype depending on which components it contains. */\nexport type MappedDateValue<T> = T extends ZonedDateTime\n ? ZonedDateTime\n : T extends CalendarDateTime\n ? CalendarDateTime\n : T extends CalendarDate\n ? CalendarDate\n : never;\n\nexport interface DatePickerProps<T extends DateValue>\n extends CommonProps,\n FieldProps<MappedDateValue<T>>,\n ApiProps<DatePickerApi>,\n Pick<\n RACDatePickerProps<T>,\n | 'value'\n | 'defaultValue'\n | 'placeholderValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'autoFocus'\n | 'onFocus'\n | 'onBlur'\n | 'isOpen'\n | 'defaultOpen'\n | 'onOpenChange'\n | 'minValue'\n | 'maxValue'\n | 'isDateUnavailable'\n | 'granularity'\n | 'firstDayOfWeek'\n | 'autoComplete'\n >,\n Pick<RACCalendarProps<T>, 'focusedValue' | 'defaultFocusedValue'> {}\n\n/** The imperative API exposed by the `DatePicker` component. */\nexport interface DatePickerApi {\n /** Focuses the first editable segment in the input field. */\n focus: () => void;\n}\n\nfunction DatePicker<T extends DateValue>(\n {\n label,\n description,\n error: errorMessage,\n focusedValue,\n defaultFocusedValue,\n UNSAFE_className,\n UNSAFE_style,\n apiRef,\n ...props\n }: DatePickerProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLDivElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('DatePicker requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const messages = useLocalizedMessages('datePicker');\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () =>\n (inputRef.current?.querySelector('[role=spinbutton]:not([data-disabled])') as FocusableElement | null)?.focus(),\n }),\n [],\n );\n\n return (\n <RACDatePicker {...props} ref={ref} className={clsx('cim-date-picker', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-date-picker-input-group\" data-readonly={props.isReadOnly || undefined}>\n <RACDateInput ref={inputRef} className={clsx('cim-date-picker-input', textStyle({ variant: 'body' }))}>\n {(segment) => (\n <span className=\"cim-date-picker-segment-wrapper\">\n <RACDateSegment segment={segment} />\n </span>\n )}\n </RACDateInput>\n <div className=\"cim-date-picker-input-controls\">\n <DatePickerClearButton isDisabled={props.isDisabled || props.isReadOnly} />\n <IconButton\n icon={<IconCalendarEmpty />}\n aria-label={messages.format('openCalendar')}\n variant=\"tertiary\"\n size=\"small\"\n />\n </div>\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover\n className=\"cim-date-picker-popover\"\n placement=\"bottom end\"\n offset={5} // 1px border + 4px actual offset\n containerPadding={16}\n data-cim-style-root\n >\n <RACDialog>\n <DatePickerCalendar<T>\n focusedValue={focusedValue}\n defaultFocusedValue={defaultFocusedValue}\n placeholderValue={props.placeholderValue}\n />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>\n );\n}\n\n/**\n * Allows users to enter or select a date and time value.\n *\n * See [date picker usage guidelines](https://ui.cimpress.io/components/date-picker/).\n */\nconst _DatePicker = withStyleProps(forwardRef(DatePicker), 'DatePicker');\n\nexport { _DatePicker as DatePicker };\n\nfunction DatePickerClearButton({ isDisabled }: { isDisabled: boolean | undefined }) {\n const datePickerState = useContext(RACDatePickerStateContext)!;\n const messages = useLocalizedMessages('datePicker');\n\n if (!datePickerState.value) {\n return null;\n }\n\n return (\n <IconButton\n // Don't inherit default Button behavior from DatePicker\n slot={null}\n UNSAFE_className=\"cim-date-picker-clear\"\n aria-label={messages.format('clearValue')}\n onPress={() => datePickerState.setValue(null)}\n icon={<IconCloseDetached />}\n variant=\"tertiary\"\n size=\"small\"\n isDisabled={isDisabled}\n />\n );\n}\n\n// TODO: use one of our standard icons instead of this custom one\nfunction IconCloseDetached() {\n return (\n <svg viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg\" className=\"cim-icon\" fill=\"currentcolor\" data-icon>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.21967 0.21967C0.512563 -0.0732233 0.987437 -0.0732233 1.28033 0.21967L6 4.93934L10.7197 0.21967C11.0126 -0.0732233 11.4874 -0.0732233 11.7803 0.21967C12.0732 0.512563 12.0732 0.987437 11.7803 1.28033L7.06066 6L11.7803 10.7197C12.0732 11.0126 12.0732 11.4874 11.7803 11.7803C11.4874 12.0732 11.0126 12.0732 10.7197 11.7803L6 7.06066L1.28033 11.7803C0.987437 12.0732 0.512563 12.0732 0.21967 11.7803C-0.0732233 11.4874 -0.0732233 11.0126 0.21967 10.7197L4.93934 6L0.21967 1.28033C-0.0732233 0.987437 -0.0732233 0.512563 0.21967 0.21967Z\"\n />\n </svg>\n );\n}\n"]}
@@ -24,16 +24,13 @@ function useMultiYearViewState() {
24
24
  calendar: focusedDate.calendar.identifier,
25
25
  timeZone: calendarState.timeZone,
26
26
  });
27
- let startYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;
28
- let endYear = startYear + YEARS_PER_SECTION - 1;
27
+ const lowerYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;
28
+ const higherYear = lowerYear + YEARS_PER_SECTION - 1;
29
29
  // Years are always represented by positive numbers.
30
30
  // If era implies negative years, flip start and end.
31
31
  const isNegativeEra = focusedDate.era === 'BC';
32
- if (isNegativeEra) {
33
- const temp = startYear;
34
- startYear = endYear;
35
- endYear = temp;
36
- }
32
+ const startYear = isNegativeEra ? higherYear : lowerYear;
33
+ const endYear = isNegativeEra ? lowerYear : higherYear;
37
34
  const data = (0, react_1.useMemo)(() => {
38
35
  const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);
39
36
  const result = new Array(rowCount);
@@ -1 +1 @@
1
- {"version":3,"file":"use-multi-year-view-state.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/views/multi-year/use-multi-year-view-state.ts"],"names":[],"mappings":";;AAcA,sDA2IC;AAzJD,kDAAkH;AAClH,iCAAsD;AACtD,2CAA8C;AAC9C,iEAAwF;AACxF,wDAAiE;AACjE,6CAA6E;AAE7E,0DAAwD;AAExD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC;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AAW,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YAEtC,OAAO,CACL,IAAA,wBAAa,EAAC,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC;gBACtE,IAAA,wBAAa,EAAC,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC;gBACnE,IAAA,gBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CACzB,CAAC;QACJ,CAAC;QACD,iBAAiB;YACf,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,CACL,IAAA,wBAAa,EAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC;gBAC5D,IAAA,wBAAa,EAAC,IAAA,kBAAW,EAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAC/D,CAAC;QACJ,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,aAAa,CAAC,KAAK,KAAK,IAAI,IAAI,IAAA,iBAAU,EAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/E,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,IAAA,iBAAU,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { endOfYear, isSameDay, isSameYear, startOfYear, today, type CalendarDate } from '@internationalized/date';\nimport { useContext, useMemo, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { CalendarStateContext as RACCalendarStateContext } from 'react-aria-components';\nimport { useLocalizedMessages } from '../../../../i18n/index.js';\nimport { constrainValue, getEraFormat, isDateInvalid } from '../../utils.js';\nimport type { ViewGridCellData, ViewGridState } from '../types.js';\nimport { useDatePickerView } from '../view-provider.js';\n\nconst ITEMS_PER_ROW = 4;\nconst YEARS_PER_SECTION = 20;\nconst YEARS_SKIP_AMOUNT = 100;\n\n/** @internal */\nexport function useMultiYearViewState(): ViewGridState {\n const calendarState = useContext(RACCalendarStateContext)!;\n const { switchToView, focusedDate, setFocusedDate } = useDatePickerView();\n const messages = useLocalizedMessages('datePicker');\n const [isFocused, setIsFocused] = useState(true);\n\n const currentDate = useMemo(() => today(calendarState.timeZone), [calendarState.timeZone]);\n\n const yearFormatter = useDateFormatter({\n year: 'numeric',\n era: getEraFormat(focusedDate),\n calendar: focusedDate.calendar.identifier,\n timeZone: calendarState.timeZone,\n });\n\n let startYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;\n let endYear = startYear + YEARS_PER_SECTION - 1;\n\n // Years are always represented by positive numbers.\n // If era implies negative years, flip start and end.\n const isNegativeEra = focusedDate.era === 'BC';\n if (isNegativeEra) {\n const temp = startYear;\n startYear = endYear;\n endYear = temp;\n }\n\n const data: (ViewGridCellData | null)[][] = useMemo(() => {\n const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);\n const result: (ViewGridCellData | null)[][] = new Array(rowCount);\n\n for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {\n result[rowIdx] = new Array(ITEMS_PER_ROW).fill(null);\n }\n\n for (let yearIdx = 0; yearIdx < YEARS_PER_SECTION; yearIdx++) {\n const rowIdx = Math.floor(yearIdx / ITEMS_PER_ROW);\n const colIdx = yearIdx % ITEMS_PER_ROW;\n\n const yearToSet = startYear + (isNegativeEra ? -yearIdx : yearIdx);\n const date = focusedDate.set({ year: yearToSet });\n\n if (date.year !== yearToSet) {\n // Reached minimum/maximum date\n continue;\n }\n\n const content = yearFormatter.format(date.toDate(calendarState.timeZone));\n\n result[rowIdx]![colIdx] = {\n date,\n content,\n ariaLabel: content,\n isCurrent: isSameYear(date, currentDate),\n };\n }\n\n return result;\n }, [startYear, calendarState.timeZone, focusedDate, yearFormatter, isNegativeEra, currentDate]);\n\n const focusCell = (date: CalendarDate) => {\n setFocusedDate(constrainValue(date, calendarState.minValue, calendarState.maxValue));\n };\n\n return {\n header: yearFormatter.formatRange(\n focusedDate.set({ year: startYear }).toDate(calendarState.timeZone),\n focusedDate.set({ year: endYear }).toDate(calendarState.timeZone),\n ),\n previousLabel: messages.format('previousMultiYearSection', { yearCount: 20 }),\n nextLabel: messages.format('nextMultiYearSection', { yearCount: 20 }),\n data,\n isReadOnly: calendarState.isReadOnly,\n isDisabled: calendarState.isDisabled,\n isFocused,\n setIsFocused,\n focusedDate,\n setFocusedDate,\n timeZone: calendarState.timeZone,\n focusPreviousItem() {\n focusCell(focusedDate.subtract({ years: 1 }));\n },\n focusNextItem() {\n focusCell(focusedDate.add({ years: 1 }));\n },\n focusPreviousRow() {\n focusCell(focusedDate.subtract({ years: ITEMS_PER_ROW }));\n },\n focusNextRow() {\n focusCell(focusedDate.add({ years: ITEMS_PER_ROW }));\n },\n focusSectionStart() {\n focusCell(focusedDate.set({ year: startYear }));\n },\n focusSectionEnd() {\n focusCell(focusedDate.set({ year: endYear }));\n },\n focusPreviousSection(shouldSkip) {\n focusCell(focusedDate.subtract({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n focusNextSection(shouldSkip) {\n focusCell(focusedDate.add({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n isPreviousSectionInvalid() {\n const current = startOfYear(focusedDate.set({ year: startYear }));\n const prev = current.subtract({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(prev, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(prev, current)\n );\n },\n isNextSectionInvalid() {\n const current = endOfYear(focusedDate.set({ year: endYear }));\n const next = current.add({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(next, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(next, current)\n );\n },\n selectFocusedDate() {\n switchToView('year');\n },\n isCellDisabled(date) {\n return (\n isDateInvalid(endOfYear(date), calendarState.minValue, null) ||\n isDateInvalid(startOfYear(date), null, calendarState.maxValue)\n );\n },\n isCellSelected(date) {\n return calendarState.value !== null && isSameYear(date, calendarState.value);\n },\n isCellTabbable(date) {\n return isSameYear(date, focusedDate);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"use-multi-year-view-state.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/views/multi-year/use-multi-year-view-state.ts"],"names":[],"mappings":";;AAcA,sDAwIC;AAtJD,kDAAkH;AAClH,iCAAsD;AACtD,2CAA8C;AAC9C,iEAAwF;AACxF,wDAAiE;AACjE,6CAA6E;AAE7E,0DAAwD;AAExD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,gBAAgB;AAChB,SAAgB,qBAAqB;IACnC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,4CAAuB,CAAE,CAAC;IAC3D,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAA,oCAAiB,GAAE,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,YAAY,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,WAAW,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,YAAK,EAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE3F,MAAM,aAAa,GAAG,IAAA,6BAAgB,EAAC;QACrC,IAAI,EAAE,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AA,wBAAa,EAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC;gBAC5D,IAAA,wBAAa,EAAC,IAAA,kBAAW,EAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAC/D,CAAC;QACJ,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,aAAa,CAAC,KAAK,KAAK,IAAI,IAAI,IAAA,iBAAU,EAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/E,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,IAAA,iBAAU,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { endOfYear, isSameDay, isSameYear, startOfYear, today, type CalendarDate } from '@internationalized/date';\nimport { useContext, useMemo, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { CalendarStateContext as RACCalendarStateContext } from 'react-aria-components';\nimport { useLocalizedMessages } from '../../../../i18n/index.js';\nimport { constrainValue, getEraFormat, isDateInvalid } from '../../utils.js';\nimport type { ViewGridCellData, ViewGridState } from '../types.js';\nimport { useDatePickerView } from '../view-provider.js';\n\nconst ITEMS_PER_ROW = 4;\nconst YEARS_PER_SECTION = 20;\nconst YEARS_SKIP_AMOUNT = 100;\n\n/** @internal */\nexport function useMultiYearViewState(): ViewGridState {\n const calendarState = useContext(RACCalendarStateContext)!;\n const { switchToView, focusedDate, setFocusedDate } = useDatePickerView();\n const messages = useLocalizedMessages('datePicker');\n const [isFocused, setIsFocused] = useState(true);\n\n const currentDate = useMemo(() => today(calendarState.timeZone), [calendarState.timeZone]);\n\n const yearFormatter = useDateFormatter({\n year: 'numeric',\n era: getEraFormat(focusedDate),\n calendar: focusedDate.calendar.identifier,\n timeZone: calendarState.timeZone,\n });\n\n const lowerYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;\n const higherYear = lowerYear + YEARS_PER_SECTION - 1;\n\n // Years are always represented by positive numbers.\n // If era implies negative years, flip start and end.\n const isNegativeEra = focusedDate.era === 'BC';\n const startYear = isNegativeEra ? higherYear : lowerYear;\n const endYear = isNegativeEra ? lowerYear : higherYear;\n\n const data: (ViewGridCellData | null)[][] = useMemo(() => {\n const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);\n const result: (ViewGridCellData | null)[][] = new Array(rowCount);\n\n for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {\n result[rowIdx] = new Array(ITEMS_PER_ROW).fill(null);\n }\n\n for (let yearIdx = 0; yearIdx < YEARS_PER_SECTION; yearIdx++) {\n const rowIdx = Math.floor(yearIdx / ITEMS_PER_ROW);\n const colIdx = yearIdx % ITEMS_PER_ROW;\n\n const yearToSet = startYear + (isNegativeEra ? -yearIdx : yearIdx);\n const date = focusedDate.set({ year: yearToSet });\n\n if (date.year !== yearToSet) {\n // Reached minimum/maximum date\n continue;\n }\n\n const content = yearFormatter.format(date.toDate(calendarState.timeZone));\n\n result[rowIdx]![colIdx] = {\n date,\n content,\n ariaLabel: content,\n isCurrent: isSameYear(date, currentDate),\n };\n }\n\n return result;\n }, [startYear, calendarState.timeZone, focusedDate, yearFormatter, isNegativeEra, currentDate]);\n\n const focusCell = (date: CalendarDate) => {\n setFocusedDate(constrainValue(date, calendarState.minValue, calendarState.maxValue));\n };\n\n return {\n header: yearFormatter.formatRange(\n focusedDate.set({ year: startYear }).toDate(calendarState.timeZone),\n focusedDate.set({ year: endYear }).toDate(calendarState.timeZone),\n ),\n previousLabel: messages.format('previousMultiYearSection', { yearCount: 20 }),\n nextLabel: messages.format('nextMultiYearSection', { yearCount: 20 }),\n data,\n isReadOnly: calendarState.isReadOnly,\n isDisabled: calendarState.isDisabled,\n isFocused,\n setIsFocused,\n focusedDate,\n setFocusedDate,\n timeZone: calendarState.timeZone,\n focusPreviousItem() {\n focusCell(focusedDate.subtract({ years: 1 }));\n },\n focusNextItem() {\n focusCell(focusedDate.add({ years: 1 }));\n },\n focusPreviousRow() {\n focusCell(focusedDate.subtract({ years: ITEMS_PER_ROW }));\n },\n focusNextRow() {\n focusCell(focusedDate.add({ years: ITEMS_PER_ROW }));\n },\n focusSectionStart() {\n focusCell(focusedDate.set({ year: startYear }));\n },\n focusSectionEnd() {\n focusCell(focusedDate.set({ year: endYear }));\n },\n focusPreviousSection(shouldSkip) {\n focusCell(focusedDate.subtract({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n focusNextSection(shouldSkip) {\n focusCell(focusedDate.add({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n isPreviousSectionInvalid() {\n const current = startOfYear(focusedDate.set({ year: startYear }));\n const prev = current.subtract({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(prev, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(prev, current)\n );\n },\n isNextSectionInvalid() {\n const current = endOfYear(focusedDate.set({ year: endYear }));\n const next = current.add({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(next, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(next, current)\n );\n },\n selectFocusedDate() {\n switchToView('year');\n },\n isCellDisabled(date) {\n return (\n isDateInvalid(endOfYear(date), calendarState.minValue, null) ||\n isDateInvalid(startOfYear(date), null, calendarState.maxValue)\n );\n },\n isCellSelected(date) {\n return calendarState.value !== null && isSameYear(date, calendarState.value);\n },\n isCellTabbable(date) {\n return isSameYear(date, focusedDate);\n },\n };\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type DisclosureGroupProps as RACDisclosureGroupProps } from 'react-aria-components';
3
- import type { CommonProps } from '../types.js';
3
+ import type { CommonProps, Key } from '../types.js';
4
4
  import { type DisclosureSize, type DisclosureVariant } from './context.js';
5
- export interface DisclosureGroupProps extends CommonProps, Pick<RACDisclosureGroupProps, 'isDisabled' | 'allowsMultipleExpanded' | 'defaultExpandedKeys' | 'expandedKeys' | 'onExpandedChange'> {
5
+ export interface DisclosureGroupProps extends CommonProps, Pick<RACDisclosureGroupProps, 'isDisabled' | 'allowsMultipleExpanded' | 'defaultExpandedKeys' | 'expandedKeys'> {
6
6
  /** The disclosures to group together. */
7
7
  children: ReactNode;
8
8
  /**
@@ -15,6 +15,8 @@ export interface DisclosureGroupProps extends CommonProps, Pick<RACDisclosureGro
15
15
  * @default 'medium'
16
16
  */
17
17
  size?: DisclosureSize;
18
+ /** Handler that is called when any disclosure in this group is expanded or collapsed. */
19
+ onExpandedChange?: (keys: Set<Key>) => void;
18
20
  }
19
21
  /**
20
22
  * Displays a grouping of related disclosures.
@@ -1 +1 @@
1
- {"version":3,"file":"disclosure-group.d.ts","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure-group.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAEL,KAAK,oBAAoB,IAAI,uBAAuB,EACrD,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,oBACf,SAAQ,WAAW,EACjB,IAAI,CACF,uBAAuB,EACvB,YAAY,GAAG,wBAAwB,GAAG,qBAAqB,GAAG,cAAc,GAAG,kBAAkB,CACtG;IACH,yCAAyC;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AA4BD;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,sKAAiE,CAAC;AAExF,OAAO,EAAE,gBAAgB,IAAI,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"disclosure-group.d.ts","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure-group.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAEL,KAAK,oBAAoB,IAAI,uBAAuB,EACrD,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,oBACf,SAAQ,WAAW,EACjB,IAAI,CAAC,uBAAuB,EAAE,YAAY,GAAG,wBAAwB,GAAG,qBAAqB,GAAG,cAAc,CAAC;IACjH,yCAAyC;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CAC7C;AA4BD;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,sKAAiE,CAAC;AAExF,OAAO,EAAE,gBAAgB,IAAI,eAAe,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"disclosure-group.js","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAmE;AACnE,iEAG+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAE3D,6CAKsB;AAsBtB,SAAS,eAAe,CACtB,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,GAAG,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAwB,EAC/G,GAAiC;IAEjC,MAAM,iBAAiB,GAA2B,IAAA,eAAO,EACvD,GAAG,EAAE,CAAC,CAAC;QACL,OAAO;QACP,IAAI;KACL,CAAC,EACF,CAAC,OAAO,EAAE,IAAI,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uBAAC,uCAAkB,OACb,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,sBAAsB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,YAEf,uBAAC,8BAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,YAAG,QAAQ,GAA8B,GAC1E,CACtB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE3D,2CAAe","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useMemo, type ForwardedRef, type ReactNode } from 'react';\nimport {\n DisclosureGroup as RACDisclosureGroup,\n type DisclosureGroupProps as RACDisclosureGroupProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps } from '../types.js';\nimport {\n DisclosureContext,\n type DisclosureContextValue,\n type DisclosureSize,\n type DisclosureVariant,\n} from './context.js';\n\nexport interface DisclosureGroupProps\n extends CommonProps,\n Pick<\n RACDisclosureGroupProps,\n 'isDisabled' | 'allowsMultipleExpanded' | 'defaultExpandedKeys' | 'expandedKeys' | 'onExpandedChange'\n > {\n /** The disclosures to group together. */\n children: ReactNode;\n /**\n * Determines the visual appearance of disclosures within this group.\n * @default 'base'\n */\n variant?: DisclosureVariant;\n /**\n * Determines the size of disclosures within this group.\n * @default 'medium'\n */\n size?: DisclosureSize;\n}\n\nfunction DisclosureGroup(\n { children, variant = 'base', size = 'medium', UNSAFE_className, UNSAFE_style, ...props }: DisclosureGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const disclosureContext: DisclosureContextValue = useMemo(\n () => ({\n variant,\n size,\n }),\n [variant, size],\n );\n\n return (\n <RACDisclosureGroup\n {...props}\n ref={ref}\n className={clsx('cim-disclosure-group', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-size={size}\n >\n <DisclosureContext.Provider value={disclosureContext}>{children}</DisclosureContext.Provider>\n </RACDisclosureGroup>\n );\n}\n\n/**\n * Displays a grouping of related disclosures.\n *\n * See [disclosure usage guidelines](https://ui.cimpress.io/components/disclosure/).\n */\nconst _DisclosureGroup = withStyleProps(forwardRef(DisclosureGroup), 'DisclosureGroup');\n\nexport { _DisclosureGroup as DisclosureGroup };\n"]}
1
+ {"version":3,"file":"disclosure-group.js","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAmE;AACnE,iEAG+B;AAC/B,yDAAkD;AAClD,mEAA2D;AAE3D,6CAKsB;AAqBtB,SAAS,eAAe,CACtB,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,IAAI,GAAG,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAwB,EAC/G,GAAiC;IAEjC,MAAM,iBAAiB,GAA2B,IAAA,eAAO,EACvD,GAAG,EAAE,CAAC,CAAC;QACL,OAAO;QACP,IAAI;KACL,CAAC,EACF,CAAC,OAAO,EAAE,IAAI,CAAC,CAChB,CAAC;IAEF,OAAO,CACL,uBAAC,uCAAkB,OACb,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,sBAAsB,EAAE,gBAAgB,CAAC,EACzD,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,YAEf,uBAAC,8BAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,iBAAiB,YAAG,QAAQ,GAA8B,GAC1E,CACtB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,eAAe,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAE3D,2CAAe","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useMemo, type ForwardedRef, type ReactNode } from 'react';\nimport {\n DisclosureGroup as RACDisclosureGroup,\n type DisclosureGroupProps as RACDisclosureGroupProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, Key } from '../types.js';\nimport {\n DisclosureContext,\n type DisclosureContextValue,\n type DisclosureSize,\n type DisclosureVariant,\n} from './context.js';\n\nexport interface DisclosureGroupProps\n extends CommonProps,\n Pick<RACDisclosureGroupProps, 'isDisabled' | 'allowsMultipleExpanded' | 'defaultExpandedKeys' | 'expandedKeys'> {\n /** The disclosures to group together. */\n children: ReactNode;\n /**\n * Determines the visual appearance of disclosures within this group.\n * @default 'base'\n */\n variant?: DisclosureVariant;\n /**\n * Determines the size of disclosures within this group.\n * @default 'medium'\n */\n size?: DisclosureSize;\n /** Handler that is called when any disclosure in this group is expanded or collapsed. */\n onExpandedChange?: (keys: Set<Key>) => void;\n}\n\nfunction DisclosureGroup(\n { children, variant = 'base', size = 'medium', UNSAFE_className, UNSAFE_style, ...props }: DisclosureGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const disclosureContext: DisclosureContextValue = useMemo(\n () => ({\n variant,\n size,\n }),\n [variant, size],\n );\n\n return (\n <RACDisclosureGroup\n {...props}\n ref={ref}\n className={clsx('cim-disclosure-group', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-size={size}\n >\n <DisclosureContext.Provider value={disclosureContext}>{children}</DisclosureContext.Provider>\n </RACDisclosureGroup>\n );\n}\n\n/**\n * Displays a grouping of related disclosures.\n *\n * See [disclosure usage guidelines](https://ui.cimpress.io/components/disclosure/).\n */\nconst _DisclosureGroup = withStyleProps(forwardRef(DisclosureGroup), 'DisclosureGroup');\n\nexport { _DisclosureGroup as DisclosureGroup };\n"]}
@@ -1,8 +1,10 @@
1
1
  import { type JSX, type ReactNode } from 'react';
2
2
  import { type DisclosureProps as RACDisclosureProps } from 'react-aria-components';
3
- import type { CommonProps } from '../types.js';
3
+ import type { CommonProps, Key } from '../types.js';
4
4
  import { type DisclosureSize, type DisclosureVariant } from './context.js';
5
- export interface DisclosureProps extends Omit<CommonProps, 'id'>, Pick<RACDisclosureProps, 'id' | 'isDisabled' | 'defaultExpanded' | 'isExpanded' | 'onExpandedChange'> {
5
+ export interface DisclosureProps extends Omit<CommonProps, 'id'>, Pick<RACDisclosureProps, 'isDisabled' | 'defaultExpanded' | 'isExpanded' | 'onExpandedChange'> {
6
+ /** A unique ID for the disclosure when used within a `DisclosureGroup`. */
7
+ id?: Key;
6
8
  /** The content to display when the disclosure is expanded. */
7
9
  children: ReactNode;
8
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,GAAG,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAKL,KAAK,eAAe,IAAI,kBAAkB,EAC3C,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAO9F,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC7B,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,YAAY,GAAG,iBAAiB,GAAG,YAAY,GAAG,kBAAkB,CAAC;IACvG,8DAA8D;IAC9D,QA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ACjE,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AA8DD;;;;GAIG;AACH,QAAA,MAAM,WAAW,iJAAuD,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"disclosure.js","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAgF;AAChF,iEAM+B;AAC/B,yDAAkD;AAClD,mDAA8E;AAC9E,mEAA2D;AAE3D,mDAA6C;AAC7C,6CAA8F;AAE9F,MAAM,OAAO,GAA8D;IACzE,MAAM,EAAE,2BAAgB;IACxB,KAAK,EAAE,+BAAoB;CAC5B,CAAC;AA2CF,SAAS,UAAU,CACjB,EACE,QAAQ,EACR,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,KAAK,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAiC;IAEjC,MAAM,iBAAiB,GAAG,IAAA,kBAAU,EAAC,8BAAiB,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,iBAAiB,EAAE,OAAO,IAAI,UAAU,CAAC;IACzD,MAAM,IAAI,GAAG,iBAAiB,EAAE,IAAI,IAAI,OAAO,CAAC;IAChD,MAAM,YAAY,GAAG,IAAI,KAAK,QAAQ,CAAC;IAEvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B,OAAO,CACL,wBAAC,kCAAa,OACR,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAI,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EACnD,KAAK,EAAE,YAAY,kBACL,OAAO,eACV,IAAI,aAEf,iCAAK,SAAS,EAAC,gCAAgC,aAC7C,uBAAC,+BAAU,IAAC,SAAS,EAAC,wBAAwB,YAC5C,wBAAC,8BAAS,IAAC,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAC,SAAS,aACzD,uBAAC,IAAI,IAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,gBAAgB,EAAC,qBAAqB,GAAG,EAE5E,YAAY,IAAI,SAAS,EAC1B,uBAAC,cAAI,IAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,YACpD,KAAK,GACD,EACN,YAAY,IAAI,OAAO,EAEvB,YAAY,IAAI,KAAK,IAAI,gCAAK,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAO,IACnE,GACD,EAEZ,OAAO,IAAI,gCAAK,SAAS,EAAC,wBAAwB,YAAE,OAAO,GAAO,IAC/D,EAEN,uBAAC,uCAAkB,IAAC,SAAS,EAAC,sBAAsB,YAClD,gCAAK,SAAS,EAAC,8BAA8B,YAE3C,uBAAC,8BAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,QAAQ,GAA8B,GAC5E,GACa,IACP,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEjD,iCAAU","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type JSX, useContext, type ForwardedRef, type ReactNode } from 'react';\nimport {\n Disclosure as RACDisclosure,\n Button as RACButton,\n Heading as RACHeading,\n DisclosurePanel as RACDisclosurePanel,\n type DisclosureProps as RACDisclosureProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconChevronRight, IconChevronRightBold } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, IconProps } from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { DisclosureContext, type DisclosureSize, type DisclosureVariant } from './context.js';\n\nconst iconMap: Record<DisclosureSize, (props: IconProps) => JSX.Element> = {\n medium: IconChevronRight,\n small: IconChevronRightBold,\n};\n\nexport interface DisclosureProps\n extends Omit<CommonProps, 'id'>,\n Pick<RACDisclosureProps, 'id' | 'isDisabled' | 'defaultExpanded' | 'isExpanded' | 'onExpandedChange'> {\n /** The content to display when the disclosure is expanded. */\n children: ReactNode;\n /**\n * Determines the visual appearance of the disclosure.\n * If the disclosure is part of a group, this prop has no effect - provide `variant` to `DisclosureGroup` instead.\n * @default 'base'\n */\n variant?: DisclosureVariant;\n /**\n * Determines the size of the disclosure.\n * If the disclosure is part of a group, this prop has no effect - provide `size` to `DisclosureGroup` instead.\n * @default 'medium'\n */\n size?: DisclosureSize;\n /** The title that is always visible in the disclosure header. */\n title: string;\n /**\n * An icon displayed before the disclosure title.\n *\n * Should not be used when size is set to `'small'` as icons won't be displayed at this size.\n */\n iconStart?: ReactNode;\n /**\n * An icon displayed after the disclosure title.\n *\n * Should not be used when size is set to `'small'` as icons won't be displayed at this size.\n */\n iconEnd?: ReactNode;\n /**\n * The badge displayed in the disclosure header.\n *\n * Should not be used when size is set to `'small'` as the badge won't be displayed at this size.\n */\n badge?: ReactNode;\n /** The actions displayed in the disclosure header. */\n actions?: ReactNode;\n}\n\nfunction Disclosure(\n {\n children,\n variant: ownVariant = 'base',\n size: ownSize = 'medium',\n title,\n iconStart,\n iconEnd,\n badge,\n actions,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: DisclosureProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const disclosureContext = useContext(DisclosureContext);\n const variant = disclosureContext?.variant ?? ownVariant;\n const size = disclosureContext?.size ?? ownSize;\n const isMediumSize = size === 'medium';\n\n const Icon = iconMap[size];\n\n return (\n <RACDisclosure\n {...props}\n ref={ref}\n className={clsx('cim-disclosure', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-size={size}\n >\n <div className=\"cim-disclosure-heading-wrapper\">\n <RACHeading className=\"cim-disclosure-heading\">\n <RACButton className=\"cim-disclosure-button\" slot=\"trigger\">\n <Icon size={isMediumSize ? 32 : 16} UNSAFE_className=\"cim-disclosure-icon\" />\n\n {isMediumSize && iconStart}\n <Text as=\"h3\" variant={isMediumSize ? 'body' : 'medium'}>\n {title}\n </Text>\n {isMediumSize && iconEnd}\n\n {isMediumSize && badge && <div className=\"cim-disclosure-badge\">{badge}</div>}\n </RACButton>\n </RACHeading>\n\n {actions && <div className=\"cim-disclosure-actions\">{actions}</div>}\n </div>\n\n <RACDisclosurePanel className=\"cim-disclosure-panel\">\n <div className=\"cim-disclosure-panel-content\">\n {/* Reset disclosure context to allow nesting disclosures */}\n <DisclosureContext.Provider value={null}>{children}</DisclosureContext.Provider>\n </div>\n </RACDisclosurePanel>\n </RACDisclosure>\n );\n}\n\n/**\n * Displays a collapsible section of content.\n *\n * See [disclosure usage guidelines](https://ui.cimpress.io/components/disclosure/).\n */\nconst _Disclosure = withStyleProps(forwardRef(Disclosure), 'Disclosure');\n\nexport { _Disclosure as Disclosure };\n"]}
1
+ {"version":3,"file":"disclosure.js","sourceRoot":"","sources":["../../../../src/components/disclosure/disclosure.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAgF;AAChF,iEAM+B;AAC/B,yDAAkD;AAClD,mDAA8E;AAC9E,mEAA2D;AAE3D,mDAA6C;AAC7C,6CAA8F;AAE9F,MAAM,OAAO,GAA8D;IACzE,MAAM,EAAE,2BAAgB;IACxB,KAAK,EAAE,+BAAoB;CAC5B,CAA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,KAAK,GAAO,IACnE,GACD,EAEZ,OAAO,IAAI,gCAAK,SAAS,EAAC,wBAAwB,YAAE,OAAO,GAAO,IAC/D,EAEN,uBAAC,uCAAkB,IAAC,SAAS,EAAC,sBAAsB,YAClD,gCAAK,SAAS,EAAC,8BAA8B,YAE3C,uBAAC,8BAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,QAAQ,GAA8B,GAC5E,GACa,IACP,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEjD,iCAAU","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type JSX, useContext, type ForwardedRef, type ReactNode } from 'react';\nimport {\n Disclosure as RACDisclosure,\n Button as RACButton,\n Heading as RACHeading,\n DisclosurePanel as RACDisclosurePanel,\n type DisclosureProps as RACDisclosureProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconChevronRight, IconChevronRightBold } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, IconProps, Key } from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { DisclosureContext, type DisclosureSize, type DisclosureVariant } from './context.js';\n\nconst iconMap: Record<DisclosureSize, (props: IconProps) => JSX.Element> = {\n medium: IconChevronRight,\n small: IconChevronRightBold,\n};\n\nexport interface DisclosureProps\n extends Omit<CommonProps, 'id'>,\n Pick<RACDisclosureProps, 'isDisabled' | 'defaultExpanded' | 'isExpanded' | 'onExpandedChange'> {\n /** A unique ID for the disclosure when used within a `DisclosureGroup`. */\n id?: Key;\n /** The content to display when the disclosure is expanded. */\n children: ReactNode;\n /**\n * Determines the visual appearance of the disclosure.\n * If the disclosure is part of a group, this prop has no effect - provide `variant` to `DisclosureGroup` instead.\n * @default 'base'\n */\n variant?: DisclosureVariant;\n /**\n * Determines the size of the disclosure.\n * If the disclosure is part of a group, this prop has no effect - provide `size` to `DisclosureGroup` instead.\n * @default 'medium'\n */\n size?: DisclosureSize;\n /** The title that is always visible in the disclosure header. */\n title: string;\n /**\n * An icon displayed before the disclosure title.\n *\n * Should not be used when size is set to `'small'` as icons won't be displayed at this size.\n */\n iconStart?: ReactNode;\n /**\n * An icon displayed after the disclosure title.\n *\n * Should not be used when size is set to `'small'` as icons won't be displayed at this size.\n */\n iconEnd?: ReactNode;\n /**\n * The badge displayed in the disclosure header.\n *\n * Should not be used when size is set to `'small'` as the badge won't be displayed at this size.\n */\n badge?: ReactNode;\n /** The actions displayed in the disclosure header. */\n actions?: ReactNode;\n}\n\nfunction Disclosure(\n {\n children,\n variant: ownVariant = 'base',\n size: ownSize = 'medium',\n title,\n iconStart,\n iconEnd,\n badge,\n actions,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: DisclosureProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const disclosureContext = useContext(DisclosureContext);\n const variant = disclosureContext?.variant ?? ownVariant;\n const size = disclosureContext?.size ?? ownSize;\n const isMediumSize = size === 'medium';\n\n const Icon = iconMap[size];\n\n return (\n <RACDisclosure\n {...props}\n ref={ref}\n className={clsx('cim-disclosure', UNSAFE_className)}\n style={UNSAFE_style}\n data-variant={variant}\n data-size={size}\n >\n <div className=\"cim-disclosure-heading-wrapper\">\n <RACHeading className=\"cim-disclosure-heading\">\n <RACButton className=\"cim-disclosure-button\" slot=\"trigger\">\n <Icon size={isMediumSize ? 32 : 16} UNSAFE_className=\"cim-disclosure-icon\" />\n\n {isMediumSize && iconStart}\n <Text as=\"h3\" variant={isMediumSize ? 'body' : 'medium'}>\n {title}\n </Text>\n {isMediumSize && iconEnd}\n\n {isMediumSize && badge && <div className=\"cim-disclosure-badge\">{badge}</div>}\n </RACButton>\n </RACHeading>\n\n {actions && <div className=\"cim-disclosure-actions\">{actions}</div>}\n </div>\n\n <RACDisclosurePanel className=\"cim-disclosure-panel\">\n <div className=\"cim-disclosure-panel-content\">\n {/* Reset disclosure context to allow nesting disclosures */}\n <DisclosureContext.Provider value={null}>{children}</DisclosureContext.Provider>\n </div>\n </RACDisclosurePanel>\n </RACDisclosure>\n );\n}\n\n/**\n * Displays a collapsible section of content.\n *\n * See [disclosure usage guidelines](https://ui.cimpress.io/components/disclosure/).\n */\nconst _Disclosure = withStyleProps(forwardRef(Disclosure), 'Disclosure');\n\nexport { _Disclosure as Disclosure };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"link-tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/link-tabs/link-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAA0C,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIxF,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,MAAM,WAAW,aAAc,SAAQ,WAAW,EAAE,iBAAiB;IACnE,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,iEAAiE;IACjE,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AAkDD;;;;GAIG;AACH,QAAA,MAAM,SAAS,+JAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC;AAEjC,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC7B,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI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C,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC7B,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IAC/E,4CAA4C;IAC5C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,8CAA8C;AAC9C,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,GAAG,KAAK,EACT,EAAE,YAAY,2CA8Bd;yBAvCe,OAAO"}
@@ -31,7 +31,7 @@ function LinkTabs({ children, currentHref, defaultHref, onHrefChange, UNSAFE_cla
31
31
  currentHref: href,
32
32
  setCurrentHref: setHref,
33
33
  }), [isDisabled, href, setHref]);
34
- return ((0, jsx_runtime_1.jsx)("nav", { ...props, ref: ref, id: linkTabsId, children: (0, jsx_runtime_1.jsx)("ul", { className: (0, clsx_1.default)('cim-tab-list', 'cim-link-tabs', UNSAFE_className), style: UNSAFE_style, "aria-labelledby": linkTabsId, "data-disabled": isDisabled, children: (0, jsx_runtime_1.jsx)(context_js_1.LinkTabsContext.Provider, { value: linkTabsContext, children: children }) }) }));
34
+ return ((0, jsx_runtime_1.jsx)("nav", { ...props, ref: ref, id: linkTabsId, className: (0, clsx_1.default)('cim-link-tabs', UNSAFE_className), children: (0, jsx_runtime_1.jsx)("ul", { style: UNSAFE_style, "aria-labelledby": linkTabsId, "data-disabled": isDisabled, className: "cim-tab-list", children: (0, jsx_runtime_1.jsx)(context_js_1.LinkTabsContext.Provider, { value: linkTabsContext, children: children }) }) }));
35
35
  }
36
36
  /**
37
37
  * Displays a list of tabs to help users navigate through a website.
@@ -1 +1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,EAAC,QAAQ,YACzD,QAAQ,GACJ,EACN,KAAK,IACE,GACP,CACN,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["'use client';\n\nimport { useId } from '@react-aria/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport clsx from 'clsx';\nimport { type ReactNode, type ForwardedRef, useMemo, useContext } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } 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 CommonProps,\n Href,\n NavigationProps,\n StringLikeChildren,\n WithRequired,\n} from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { LinkTabsContext, type LinkTabsContextValue } from './context.js';\n\nexport interface LinkTabsProps extends CommonProps, AriaLabelingProps {\n /** Link tabs belonging to the group. */\n children: ReactNode;\n /** Whether the link tabs are disabled. */\n isDisabled?: boolean;\n /** The currently selected key in the collection (controlled). */\n currentHref?: Href | null;\n /** The initial selected key in the collection (uncontrolled). */\n defaultHref?: Href | null;\n /** Handler that is called when the selection changes. */\n onHrefChange?: (href: Href | null) => void;\n}\n\nfunction LinkTabs(\n {\n children,\n currentHref,\n defaultHref,\n onHrefChange,\n UNSAFE_className,\n UNSAFE_style,\n id,\n isDisabled,\n ...props\n }: LinkTabsProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!ariaLabel && !ariaLabelledBy) {\n console.warn('LinkTabs requires one of aria-label / aria-labelledby for accessibility');\n }\n }, [ariaLabel, ariaLabelledBy]);\n\n const linkTabsId = useId(id);\n const [href, setHref] = useControlledState(currentHref, defaultHref ?? null, onHrefChange);\n\n const linkTabsContext: LinkTabsContextValue = useMemo(\n () => ({\n isDisabled,\n currentHref: href,\n setCurrentHref: setHref,\n }),\n [isDisabled, href, setHref],\n );\n\n return (\n <nav {...props} ref={ref} id={linkTabsId}>\n <ul\n className={clsx('cim-tab-list', 'cim-link-tabs', UNSAFE_className)}\n style={UNSAFE_style}\n aria-labelledby={linkTabsId}\n data-disabled={isDisabled}\n >\n <LinkTabsContext.Provider value={linkTabsContext}>{children}</LinkTabsContext.Provider>\n </ul>\n </nav>\n );\n}\n\n/**\n * Displays a list of tabs to help users navigate through a website.\n *\n * See [tabs usage guidelines](https://ui.cimpress.io/components/tabs/).\n */\nconst _LinkTabs = withStyleProps(forwardRef(LinkTabs), 'LinkTabs');\n\nexport { _LinkTabs as LinkTabs };\n\nexport interface LinkTabProps\n extends Omit<CommonProps, 'id'>,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'children' | '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 `LinkTabs`. */\nexport function LinkTab({\n children,\n href,\n iconStart,\n badge,\n UNSAFE_className,\n UNSAFE_style,\n isDisabled,\n ...props\n}: LinkTabProps) {\n const linkTabsContext = useContext(LinkTabsContext);\n if (!linkTabsContext) {\n throw new Error('Cannot use link tab outside of link tabs');\n }\n\n const { isDisabled: isGroupDisabled, currentHref, setCurrentHref } = linkTabsContext;\n\n const isCurrent = href === currentHref;\n\n return (\n <li>\n <RACLink\n {...props}\n className={clsx('cim-tab-item', 'cim-link-tab-item', UNSAFE_className)}\n style={UNSAFE_style}\n href={href}\n onPress={() => setCurrentHref(href)}\n aria-current={isCurrent ? 'page' : undefined}\n data-selected={isCurrent || undefined}\n isDisabled={isDisabled || isGroupDisabled}\n >\n {iconStart}\n <Text as=\"span\" variant=\"medium-semibold\" alignment=\"center\">\n {children}\n </Text>\n {badge}\n </RACLink>\n </li>\n );\n}\n\nLinkTab.displayName = 'Lin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AAC,iBAAiB,EAAC,SAAS,EAAC,QAAQ,YACzD,QAAQ,GACJ,EACN,KAAK,IACE,GACP,CACN,CAAC;AACJ,CAAC;AAED,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["'use client';\n\nimport { useId } from '@react-aria/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport clsx from 'clsx';\nimport { type ReactNode, type ForwardedRef, useMemo, useContext } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } 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 CommonProps,\n Href,\n NavigationProps,\n StringLikeChildren,\n WithRequired,\n} from '../types.js';\nimport { Text } from '../typography/text.js';\nimport { LinkTabsContext, type LinkTabsContextValue } from './context.js';\n\nexport interface LinkTabsProps extends CommonProps, AriaLabelingProps {\n /** Link tabs belonging to the group. */\n children: ReactNode;\n /** Whether the link tabs are disabled. */\n isDisabled?: boolean;\n /** The currently selected key in the collection (controlled). */\n currentHref?: Href | null;\n /** The initial selected key in the collection (uncontrolled). */\n defaultHref?: Href | null;\n /** Handler that is called when the selection changes. */\n onHrefChange?: (href: Href | null) => void;\n}\n\nfunction LinkTabs(\n {\n children,\n currentHref,\n defaultHref,\n onHrefChange,\n UNSAFE_className,\n UNSAFE_style,\n id,\n isDisabled,\n ...props\n }: LinkTabsProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!ariaLabel && !ariaLabelledBy) {\n console.warn('LinkTabs requires one of aria-label / aria-labelledby for accessibility');\n }\n }, [ariaLabel, ariaLabelledBy]);\n\n const linkTabsId = useId(id);\n const [href, setHref] = useControlledState(currentHref, defaultHref ?? null, onHrefChange);\n\n const linkTabsContext: LinkTabsContextValue = useMemo(\n () => ({\n isDisabled,\n currentHref: href,\n setCurrentHref: setHref,\n }),\n [isDisabled, href, setHref],\n );\n\n return (\n <nav {...props} ref={ref} id={linkTabsId} className={clsx('cim-link-tabs', UNSAFE_className)}>\n <ul style={UNSAFE_style} aria-labelledby={linkTabsId} data-disabled={isDisabled} className=\"cim-tab-list\">\n <LinkTabsContext.Provider value={linkTabsContext}>{children}</LinkTabsContext.Provider>\n </ul>\n </nav>\n );\n}\n\n/**\n * Displays a list of tabs to help users navigate through a website.\n *\n * See [tabs usage guidelines](https://ui.cimpress.io/components/tabs/).\n */\nconst _LinkTabs = withStyleProps(forwardRef(LinkTabs), 'LinkTabs');\n\nexport { _LinkTabs as LinkTabs };\n\nexport interface LinkTabProps\n extends Omit<CommonProps, 'id'>,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'children' | '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 `LinkTabs`. */\nexport function LinkTab({\n children,\n href,\n iconStart,\n badge,\n UNSAFE_className,\n UNSAFE_style,\n isDisabled,\n ...props\n}: LinkTabProps) {\n const linkTabsContext = useContext(LinkTabsContext);\n if (!linkTabsContext) {\n throw new Error('Cannot use link tab outside of link tabs');\n }\n\n const { isDisabled: isGroupDisabled, currentHref, setCurrentHref } = linkTabsContext;\n\n const isCurrent = href === currentHref;\n\n return (\n <li>\n <RACLink\n {...props}\n className={clsx('cim-tab-item', 'cim-link-tab-item', UNSAFE_className)}\n style={UNSAFE_style}\n href={href}\n onPress={() => setCurrentHref(href)}\n aria-current={isCurrent ? 'page' : undefined}\n data-selected={isCurrent || undefined}\n isDisabled={isDisabled || isGroupDisabled}\n >\n {iconStart}\n <Text as=\"span\" variant=\"medium-semibold\" alignment=\"center\">\n {children}\n </Text>\n {badge}\n </RACLink>\n </li>\n );\n}\n\nLinkTab.displayName = 'LinkTab';\n"]}
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
- import { type MenuItemProps as RACMenuItemProps, type MenuProps as RACMenuProps, type MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';
1
+ import type { ReactNode, UIEventHandler } from 'react';
2
+ import { type MenuItemProps as RACMenuItemProps, type MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';
3
3
  import type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';
4
4
  export interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {
5
5
  /** The menu trigger with its associated menu. Provide the trigger as the first child, and the menu as the second child. */
@@ -14,9 +14,11 @@ export declare function MenuRoot(props: MenuRootProps): import("react/jsx-runtim
14
14
  export declare namespace MenuRoot {
15
15
  var displayName: string;
16
16
  }
17
- export interface MenuProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T>, Pick<RACMenuProps<T>, 'onScroll'> {
17
+ export interface MenuProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T> {
18
18
  /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */
19
19
  onAction?: (key: Key) => void;
20
+ /** Handler that is called when the list of items is scrolled. */
21
+ onScroll?: UIEventHandler<HTMLDivElement>;
20
22
  }
21
23
  /** Displays a collapsible list of options and actions that users can choose from. */
22
24
  export declare function Menu<T extends CollectionItem>(props: MenuProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAKL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,SAAS,IAAI,YAAY,EAG9B,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,CAAC;AAG/B,OAAO,K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ChD,SAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB;IAC/E,MAAM,SAAS,GACb,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhH,OAAO,CACL,uBAAC,gCAAW,OAAK,KAAK,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAE,SAAS,YACnE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACnB,6DACG,IAAI,EAEL,iCAAK,SAAS,EAAC,oBAAoB,aACjC,uBAAC,4BAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,EAET,WAAW,IAAI,CACd,uBAAC,4BAAO,IACN,IAAI,EAAC,aAAa,EAClB,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,YAEhF,WAAW,GACJ,CACX,IACG,IACL,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n Collection as RACCollection,\n Header as RACHeader,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n type MenuProps as RACMenuProps,\n MenuSection as RACMenuSection,\n MenuTrigger as RACMenuTrigger,\n type MenuTriggerProps as RACMenuTriggerProps,\n Text as RACText,\n} from 'react-aria-components';\nimport { isProduction } from '../../utils/is-production.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {\n /** The menu trigger with its associated menu. Provide the trigger as the first child, and the menu as the second child. */\n children: ReactNode;\n}\n\n/**\n * Encapsulates a menu trigger and its associated menu. The trigger can be any Cimpress UI button, and the menu will be displayed when the trigger is activated.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nexport function MenuRoot(props: MenuRootProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nMenuRoot.displayName = 'MenuRoot';\n\nexport interface MenuProps<T extends CollectionItem = CollectionItem>\n extends CollectionProps<T>,\n Pick<RACMenuProps<T>, 'onScroll'> {\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n}\n\n/** Displays a collapsible list of options and actions that users can choose from. */\nexport function Menu<T extends CollectionItem>(props: MenuProps<T>) {\n if (!isProduction() && props.items != null && typeof props.children !== 'function') {\n console.warn('`Menu` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <CollapsibleList\n placement=\"bottom start\"\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACMenu {...props} className=\"cim-menu\" />\n </CollapsibleList>\n );\n}\n\nMenu.displayName = 'Menu';\n\nexport interface MenuSectionProps<T extends CollectionItem = CollectionItem> 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 `Menu` into a section. */\nexport function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`MenuSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACMenuSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends NavigationProps,\n Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** Additional description for the menu item. */\n description?: string;\n /** An icon representing the menu item. */\n icon?: ReactNode;\n}\n\n/** Renders a single list item within `Menu`. */\nexport function MenuItem({ children, description, icon, ...props }: MenuItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n {icon}\n\n <div className=\"cim-menu-item-text\">\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n\n {description && (\n <RACText\n slot=\"description\"\n className={textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' })}\n >\n {description}\n </RACText>\n )}\n </div>\n </>\n )}\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n"]}
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AA8Bb,4BAEC;AAYD,oBAcC;AAYD,kCAaC;AAkBD,4BA4BC;;AA/HD,gDAAwB;AAExB,iEAU+B;AAC/B,mEAA4D;AAC5D,0FAAmF;AAEnF,qDAAmD;AAOnD;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,KAAoB;IAC3C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AexC,gDAAgD;AAChD,SAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,EAAiB;IAC/E,MAAM,SAAS,GACb,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhH,OAAO,CACL,uBAAC,gCAAW,OAAK,KAAK,EAAE,SAAS,EAAC,eAAe,EAAC,SAAS,EAAE,SAAS,YACnE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACnB,6DACG,IAAI,EAEL,iCAAK,SAAS,EAAC,oBAAoB,aACjC,uBAAC,4BAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,EAET,WAAW,IAAI,CACd,uBAAC,4BAAO,IACN,IAAI,EAAC,aAAa,EAClB,SAAS,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,YAEhF,WAAW,GACJ,CACX,IACG,IACL,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode, UIEventHandler } from 'react';\nimport {\n Collection as RACCollection,\n Header as RACHeader,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemProps as RACMenuItemProps,\n MenuSection as RACMenuSection,\n MenuTrigger as RACMenuTrigger,\n type MenuTriggerProps as RACMenuTriggerProps,\n Text as RACText,\n} from 'react-aria-components';\nimport { isProduction } from '../../utils/is-production.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport type { CollectionItem, CollectionProps, Key, NavigationProps, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface MenuRootProps extends Pick<RACMenuTriggerProps, 'onOpenChange' | 'isOpen' | 'defaultOpen'> {\n /** The menu trigger with its associated menu. Provide the trigger as the first child, and the menu as the second child. */\n children: ReactNode;\n}\n\n/**\n * Encapsulates a menu trigger and its associated menu. The trigger can be any Cimpress UI button, and the menu will be displayed when the trigger is activated.\n *\n * See [menu usage guidelines](https://ui.cimpress.io/components/menu/).\n */\nexport function MenuRoot(props: MenuRootProps) {\n return <RACMenuTrigger {...props} />;\n}\n\nMenuRoot.displayName = 'MenuRoot';\n\nexport interface MenuProps<T extends CollectionItem = CollectionItem> extends CollectionProps<T> {\n /** Handler that is called when an item is selected. When using `onAction`, all items must have an `id` prop defined. */\n onAction?: (key: Key) => void;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** Displays a collapsible list of options and actions that users can choose from. */\nexport function Menu<T extends CollectionItem>(props: MenuProps<T>) {\n if (!isProduction() && props.items != null && typeof props.children !== 'function') {\n console.warn('`Menu` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <CollapsibleList\n placement=\"bottom start\"\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACMenu {...props} className=\"cim-menu\" />\n </CollapsibleList>\n );\n}\n\nMenu.displayName = 'Menu';\n\nexport interface MenuSectionProps<T extends CollectionItem = CollectionItem> 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 `Menu` into a section. */\nexport function MenuSection<T extends CollectionItem>({ title, children, items, ...props }: MenuSectionProps<T>) {\n if (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`MenuSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACMenuSection {...props} className=\"cim-menu-section\">\n <RACHeader className={clsx('cim-menu-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACMenuSection>\n );\n}\n\nMenuSection.displayName = 'MenuSection';\n\nexport interface MenuItemProps\n extends NavigationProps,\n Pick<RACMenuItemProps, 'isDisabled' | 'onAction' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n /** Additional description for the menu item. */\n description?: string;\n /** An icon representing the menu item. */\n icon?: ReactNode;\n}\n\n/** Renders a single list item within `Menu`. */\nexport function MenuItem({ children, description, icon, ...props }: MenuItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACMenuItem {...props} className=\"cim-menu-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n {icon}\n\n <div className=\"cim-menu-item-text\">\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n\n {description && (\n <RACText\n slot=\"description\"\n className={textStyle({ variant: 'small', tone: isDisabled ? 'muted' : 'subtle' })}\n >\n {description}\n </RACText>\n )}\n </div>\n </>\n )}\n </RACMenuItem>\n );\n}\n\nMenuItem.displayName = 'MenuItem';\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';
2
- import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
3
- export interface NumberFieldProps extends CommonProps, FieldWithPlaceholderProps<number>, Pick<RACNumberFieldProps, 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'autoFocus' | 'minValue' | 'maxValue' | 'step' | 'formatOptions' | 'onFocus' | 'onBlur' | 'onKeyDown'> {
2
+ import type { ApiProps, CommonProps, FieldWithPlaceholderProps } from '../types.js';
3
+ export interface NumberFieldProps extends CommonProps, FieldWithPlaceholderProps<number>, ApiProps<NumberFieldApi>, Pick<RACNumberFieldProps, 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'autoFocus' | 'minValue' | 'maxValue' | 'step' | 'formatOptions' | 'onFocus' | 'onBlur' | 'onKeyDown'> {
4
4
  /** The current value (controlled). A `null` value means an empty field. */
5
5
  value?: number | null;
6
6
  /** The default value (uncontrolled). A `null` value means an empty field. */
@@ -8,6 +8,13 @@ export interface NumberFieldProps extends CommonProps, FieldWithPlaceholderProps
8
8
  /** Handler that is called when the value changes. A `null` value means an empty field. */
9
9
  onChange?: (value: number | null) => void;
10
10
  }
11
+ /** The imperative API exposed by the `NumberField` component. */
12
+ export interface NumberFieldApi {
13
+ /** Focuses the input field. */
14
+ focus: () => void;
15
+ /** Selects the contents of the input field. */
16
+ select: () => void;
17
+ }
11
18
  /**
12
19
  * Allows users to edit a number with a keyboard or increment/decrement buttons.
13
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,gBACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,mBAAmB,EACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,SAAS,GACT,QAAQ,GACR,WAAW,CACd;IACH,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAwED;;;;GAIG;AACH,QAAA,MAAM,YAAY,kKAAyD,CAAC;AAE5E,OAAO,EAAE,YAAY,IAAI,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGpF,MAAM,WAAW,gBACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,QAAQ,CAAC,cAAc,CAAC,EACxB,IAAI,CACF,mBAAmB,EACjB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,SAAS,GACT,QAAQ,GACR,WAAW,CACd;IACH,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC3C;AAED,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAqFD;;;;GAIG;AACH,QAAA,MAAM,YAAY,kKAAyD,CAAC;AAE5E,OAAO,EAAE,YAAY,IAAI,WAAW,EAAE,CAAC"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.NumberField = void 0;
8
8
  const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  const clsx_1 = __importDefault(require("clsx"));
10
+ const react_1 = require("react");
10
11
  const react_aria_components_1 = require("react-aria-components");
11
12
  const forward_ref_js_1 = require("../../forward-ref.js");
12
13
  const index_js_1 = require("../../i18n/index.js");
@@ -16,7 +17,8 @@ const with_style_props_js_1 = require("../../with-style-props.js");
16
17
  const icon_button_js_1 = require("../button/icon-button.js");
17
18
  const form_field_js_1 = require("../internal/form-field/form-field.js");
18
19
  const utils_js_1 = require("../typography/utils.js");
19
- function NumberField({ label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, value, defaultValue, onChange, ...props }, ref) {
20
+ function NumberField({ label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, value, defaultValue, onChange, apiRef, ...props }, ref) {
21
+ const inputRef = (0, react_1.useRef)(null);
20
22
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
21
23
  (0, use_production_warning_js_1.useProductionWarning)(() => {
22
24
  if (!label && !ariaLabel && !ariaLabelledBy) {
@@ -24,11 +26,15 @@ function NumberField({ label, description, error: errorMessage, placeholder, UNS
24
26
  }
25
27
  }, [label, ariaLabel, ariaLabelledBy]);
26
28
  const messages = (0, index_js_1.useLocalizedMessages)('numberField');
29
+ (0, react_1.useImperativeHandle)(apiRef, () => ({
30
+ focus: () => inputRef.current?.focus(),
31
+ select: () => inputRef.current?.select(),
32
+ }), []);
27
33
  return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.NumberField, { ...props, ref: ref, className: (0, clsx_1.default)('cim-number-field', UNSAFE_className), style: UNSAFE_style,
28
34
  // NumberField uses `NaN` to signify an empty value, which is unintuitive
29
35
  // https://github.com/adobe/react-spectrum/issues/5524
30
36
  // https://github.com/adobe/react-spectrum/issues/6971
31
- value: value === null ? Number.NaN : value, defaultValue: defaultValue === null ? Number.NaN : defaultValue, onChange: onChange ? (value) => onChange(Number.isNaN(value) ? null : value) : undefined, 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.Group, { className: "cim-number-field-input-group", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { className: (0, clsx_1.default)('cim-number-field-input', (0, utils_js_1.textStyle)({ variant: 'body' })), placeholder: placeholder }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-number-field-spinner", children: [(0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { slot: "decrement", icon: (0, jsx_runtime_1.jsx)(index_js_2.IconSubtract, {}), "aria-label": messages.format('decrement'), variant: "tertiary", size: "small" }), (0, jsx_runtime_1.jsx)("div", { className: "cim-number-field-spinner-separator" }), (0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { slot: "increment", icon: (0, jsx_runtime_1.jsx)(index_js_2.IconAdd, {}), "aria-label": messages.format('increment'), variant: "tertiary", size: "small" })] })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description })] }));
37
+ value: value === null ? Number.NaN : value, defaultValue: defaultValue === null ? Number.NaN : defaultValue, onChange: onChange ? (value) => onChange(Number.isNaN(value) ? null : value) : undefined, 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.Group, { className: "cim-number-field-input-group", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Input, { ref: inputRef, className: (0, clsx_1.default)('cim-number-field-input', (0, utils_js_1.textStyle)({ variant: 'body' })), placeholder: placeholder }), (0, jsx_runtime_1.jsxs)("div", { className: "cim-number-field-spinner", children: [(0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { slot: "decrement", icon: (0, jsx_runtime_1.jsx)(index_js_2.IconSubtract, {}), "aria-label": messages.format('decrement'), variant: "tertiary", size: "small" }), (0, jsx_runtime_1.jsx)("div", { className: "cim-number-field-spinner-separator" }), (0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { slot: "increment", icon: (0, jsx_runtime_1.jsx)(index_js_2.IconAdd, {}), "aria-label": messages.format('increment'), variant: "tertiary", size: "small" })] })] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: errorMessage }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description })] }));
32
38
  }
33
39
  /**
34
40
  * Allows users to edit a number with a keyboard or increment/decrement buttons.
@@ -1 +1 @@
1
- {"version":3,"file":"number-field.js","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,iEAK+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAA6D;AAC7D,qFAA6E;AAC7E,mEAA2D;AAC3D,6DAAsD;AACtD,wEAA4G;AAE5G,qDAAmD;AA4BnD,SAAS,WAAW,CAClB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACS,EACnB,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,oFAAoF,CAAC,CAAC;QACrG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EA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AS,EAAC,oCAAoC,GAAG,EACtD,uBAAC,2BAAU,IACT,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,uBAAC,kBAAO,KAAG,gBACL,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,EACxC,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,GACZ,IACE,IACG,EACX,uBAAC,8BAAc,cAAE,YAAY,GAAkB,EAC/C,uBAAC,oCAAoB,cAAE,WAAW,GAAwB,IAC3C,CAClB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,YAAY,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC;AAEnD,mCAAW","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport {\n Input as RACInput,\n NumberField as RACNumberField,\n type NumberFieldProps as RACNumberFieldProps,\n Group as RACGroup,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconAdd, IconSubtract } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface NumberFieldProps\n extends CommonProps,\n FieldWithPlaceholderProps<number>,\n Pick<\n RACNumberFieldProps,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'autoFocus'\n | 'minValue'\n | 'maxValue'\n | 'step'\n | 'formatOptions'\n | 'onFocus'\n | 'onBlur'\n | 'onKeyDown'\n > {\n /** The current value (controlled). A `null` value means an empty field. */\n value?: number | null;\n /** The default value (uncontrolled). A `null` value means an empty field. */\n defaultValue?: number | null;\n /** Handler that is called when the value changes. A `null` value means an empty field. */\n onChange?: (value: number | null) => void;\n}\n\nfunction NumberField(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n value,\n defaultValue,\n onChange,\n ...props\n }: NumberFieldProps,\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('NumberField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const messages = useLocalizedMessages('numberField');\n\n return (\n <RACNumberField\n {...props}\n ref={ref}\n className={clsx('cim-number-field', UNSAFE_className)}\n style={UNSAFE_style}\n // NumberField uses `NaN` to signify an empty value, which is unintuitive\n // https://github.com/adobe/react-spectrum/issues/5524\n // https://github.com/adobe/react-spectrum/issues/6971\n value={value === null ? Number.NaN : value}\n defaultValue={defaultValue === null ? Number.NaN : defaultValue}\n onChange={onChange ? (value) => onChange(Number.isNaN(value) ? null : value) : undefined}\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-number-field-input-group\">\n <RACInput\n className={clsx('cim-number-field-input', textStyle({ variant: 'body' }))}\n placeholder={placeholder}\n />\n <div className=\"cim-number-field-spinner\">\n <IconButton\n slot=\"decrement\"\n icon={<IconSubtract />}\n aria-label={messages.format('decrement')}\n variant=\"tertiary\"\n size=\"small\"\n />\n <div className=\"cim-number-field-spinner-separator\" />\n <IconButton\n slot=\"increment\"\n icon={<IconAdd />}\n aria-label={messages.format('increment')}\n variant=\"tertiary\"\n size=\"small\"\n />\n </div>\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACNumberField>\n );\n}\n\n/**\n * Allows users to edit a number with a keyboard or increment/decrement buttons.\n *\n * See [number field usage guidelines](https://ui.cimpress.io/components/number-field/).\n */\nconst _NumberField = withStyleProps(forwardRef(NumberField), 'NumberField');\n\nexport { _NumberField as NumberField };\n"]}
1
+ {"version":3,"file":"number-field.js","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AACxB,iCAAuE;AACvE,iEAK+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAA6D;AAC7D,qFAA6E;AAC7E,mEAA2D;AAC3D,6DAAsD;AACtD,wEAA4G;AAE5G,qDAAmD;AAqCnD,SAAS,WAAW,CAClB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACS,EACnB,GAAiC;IAEjC,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAmB,IAAI,CAAC,CAAC;IAEhD,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,oFAAoF,CAAC,CAAC;QACrG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,aAAa,CAAC,CAAC;IAErD,IAAA,2BAAmB,EACjB,MAAM,EACN,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE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AC,2BAAU,IACT,IAAI,EAAC,WAAW,EAChB,IAAI,EAAE,uBAAC,kBAAO,KAAG,gBACL,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,EACxC,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,GACZ,IACE,IACG,EACX,uBAAC,8BAAc,cAAE,YAAY,GAAkB,EAC/C,uBAAC,oCAAoB,cAAE,WAAW,GAAwB,IAC3C,CAClB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,YAAY,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,WAAW,CAAC,EAAE,aAAa,CAAC,CAAC;AAEnD,mCAAW","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { type ForwardedRef, useImperativeHandle, useRef } from 'react';\nimport {\n Input as RACInput,\n NumberField as RACNumberField,\n type NumberFieldProps as RACNumberFieldProps,\n Group as RACGroup,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconAdd, IconSubtract } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { ApiProps, CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface NumberFieldProps\n extends CommonProps,\n FieldWithPlaceholderProps<number>,\n ApiProps<NumberFieldApi>,\n Pick<\n RACNumberFieldProps,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'autoFocus'\n | 'minValue'\n | 'maxValue'\n | 'step'\n | 'formatOptions'\n | 'onFocus'\n | 'onBlur'\n | 'onKeyDown'\n > {\n /** The current value (controlled). A `null` value means an empty field. */\n value?: number | null;\n /** The default value (uncontrolled). A `null` value means an empty field. */\n defaultValue?: number | null;\n /** Handler that is called when the value changes. A `null` value means an empty field. */\n onChange?: (value: number | null) => void;\n}\n\n/** The imperative API exposed by the `NumberField` component. */\nexport interface NumberFieldApi {\n /** Focuses the input field. */\n focus: () => void;\n /** Selects the contents of the input field. */\n select: () => void;\n}\n\nfunction NumberField(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n value,\n defaultValue,\n onChange,\n apiRef,\n ...props\n }: NumberFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('NumberField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const messages = useLocalizedMessages('numberField');\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => inputRef.current?.focus(),\n select: () => inputRef.current?.select(),\n }),\n [],\n );\n\n return (\n <RACNumberField\n {...props}\n ref={ref}\n className={clsx('cim-number-field', UNSAFE_className)}\n style={UNSAFE_style}\n // NumberField uses `NaN` to signify an empty value, which is unintuitive\n // https://github.com/adobe/react-spectrum/issues/5524\n // https://github.com/adobe/react-spectrum/issues/6971\n value={value === null ? Number.NaN : value}\n defaultValue={defaultValue === null ? Number.NaN : defaultValue}\n onChange={onChange ? (value) => onChange(Number.isNaN(value) ? null : value) : undefined}\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-number-field-input-group\">\n <RACInput\n ref={inputRef}\n className={clsx('cim-number-field-input', textStyle({ variant: 'body' }))}\n placeholder={placeholder}\n />\n <div className=\"cim-number-field-spinner\">\n <IconButton\n slot=\"decrement\"\n icon={<IconSubtract />}\n aria-label={messages.format('decrement')}\n variant=\"tertiary\"\n size=\"small\"\n />\n <div className=\"cim-number-field-spinner-separator\" />\n <IconButton\n slot=\"increment\"\n icon={<IconAdd />}\n aria-label={messages.format('increment')}\n variant=\"tertiary\"\n size=\"small\"\n />\n </div>\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACNumberField>\n );\n}\n\n/**\n * Allows users to edit a number with a keyboard or increment/decrement buttons.\n *\n * See [number field usage guidelines](https://ui.cimpress.io/components/number-field/).\n */\nconst _NumberField = withStyleProps(forwardRef(NumberField), 'NumberField');\n\nexport { _NumberField as NumberField };\n"]}
@@ -1,11 +1,25 @@
1
- import { type ListBoxProps as RACListBoxProps, type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
2
- import type { AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
3
- export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, AsyncItemLoadingProps, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
1
+ import { type UIEventHandler } from 'react';
2
+ import { type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
3
+ import type { ApiProps, AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
4
+ export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, AsyncItemLoadingProps, ApiProps<SelectApi>, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'autoComplete' | 'autoFocus' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'> {
5
+ /** The currently selected key in the collection (controlled). */
6
+ selectedKey?: Key | null;
7
+ /** The initial selected key in the collection (uncontrolled). */
8
+ defaultSelectedKey?: Key;
9
+ /** Handler that is called when the selection changes. */
10
+ onSelectionChange?: (key: Key | null) => void;
4
11
  /**
5
12
  * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.
6
13
  * @default false
7
14
  */
8
15
  isVirtualized?: boolean;
16
+ /** Handler that is called when the list of items is scrolled. */
17
+ onScroll?: UIEventHandler<HTMLDivElement>;
18
+ }
19
+ /** The imperative API exposed by the `Select` component. */
20
+ export interface SelectApi {
21
+ /** Focuses the trigger button and opens the list of items. */
22
+ focus: () => void;
9
23
  }
10
24
  /**
11
25
  * Allows users to select one item from a collapsible list.
@@ -14,7 +28,9 @@ export interface SelectProps<T extends CollectionItem = CollectionItem> extends
14
28
  */
15
29
  declare const _Select: <T extends CollectionItem>(props: SelectProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
16
30
  export { _Select as Select };
17
- export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
31
+ export interface SelectItemProps extends Pick<RACListBoxItemProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
32
+ /** The ID of the item. Has to be unique across all sections and items. */
33
+ id?: Key;
18
34
  /** The content to display as the label. */
19
35
  children: StringLikeChildren;
20
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,IAAI,eAAe,EASpC,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EAEnC,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAWrB,MAA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