@kanso-labs/kanso-ui 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +88 -9
  2. package/dist/button/hooks.js +81 -0
  3. package/dist/button/hooks.js.map +1 -0
  4. package/dist/button/index.d.ts +11 -0
  5. package/dist/button/index.js +260 -0
  6. package/dist/button/index.js.map +1 -0
  7. package/dist/button/styles.js +23 -0
  8. package/dist/button/styles.js.map +1 -0
  9. package/dist/calendar/index.js +473 -7
  10. package/dist/calendar/index.js.map +1 -1
  11. package/dist/calendar/styles.js +132 -4
  12. package/dist/calendar/styles.js.map +1 -1
  13. package/dist/chip/index.js +29 -2
  14. package/dist/chip/index.js.map +1 -1
  15. package/dist/chip/styles.js +30 -4
  16. package/dist/chip/styles.js.map +1 -1
  17. package/dist/collection/index.js +12 -9
  18. package/dist/collection/index.js.map +1 -1
  19. package/dist/color-scheme.d.ts +29 -0
  20. package/dist/color-scheme.js +32 -0
  21. package/dist/color-scheme.js.map +1 -0
  22. package/dist/components/avatar/index.js +35 -22
  23. package/dist/components/avatar/index.js.map +1 -1
  24. package/dist/components/badge/index.d.ts +37 -0
  25. package/dist/components/badge/index.js +97 -0
  26. package/dist/components/badge/index.js.map +1 -0
  27. package/dist/components/breadcrumbs/index.d.ts +1 -1
  28. package/dist/components/breadcrumbs/index.js +1 -1
  29. package/dist/components/breadcrumbs/index.js.map +1 -1
  30. package/dist/components/button/index.d.ts +58 -14
  31. package/dist/components/button/index.js +418 -148
  32. package/dist/components/button/index.js.map +1 -1
  33. package/dist/components/calendar/index.d.ts +9 -1
  34. package/dist/components/calendar/index.js +71 -44
  35. package/dist/components/calendar/index.js.map +1 -1
  36. package/dist/components/card/index.d.ts +1 -1
  37. package/dist/components/card/index.js +4 -4
  38. package/dist/components/card/index.js.map +1 -1
  39. package/dist/components/checkbox-group/index.js +1 -0
  40. package/dist/components/checkbox-group/index.js.map +1 -1
  41. package/dist/components/chip/index.js +2 -8
  42. package/dist/components/chip/index.js.map +1 -1
  43. package/dist/components/chip-group/index.d.ts +3 -3
  44. package/dist/components/chip-group/index.js +8 -9
  45. package/dist/components/chip-group/index.js.map +1 -1
  46. package/dist/components/color-field/index.js +25 -23
  47. package/dist/components/color-field/index.js.map +1 -1
  48. package/dist/components/color-picker/index.js +42 -31
  49. package/dist/components/color-picker/index.js.map +1 -1
  50. package/dist/components/color-swatch-picker/index.d.ts +1 -1
  51. package/dist/components/color-swatch-picker/index.js +17 -13
  52. package/dist/components/color-swatch-picker/index.js.map +1 -1
  53. package/dist/components/combo-box/index.js +63 -58
  54. package/dist/components/combo-box/index.js.map +1 -1
  55. package/dist/components/copy-field/index.d.ts +7 -6
  56. package/dist/components/copy-field/index.js +92 -90
  57. package/dist/components/copy-field/index.js.map +1 -1
  58. package/dist/components/currency/index.d.ts +8 -7
  59. package/dist/components/currency/index.js +43 -65
  60. package/dist/components/currency/index.js.map +1 -1
  61. package/dist/components/date-field/index.js +24 -22
  62. package/dist/components/date-field/index.js.map +1 -1
  63. package/dist/components/date-picker/index.d.ts +10 -2
  64. package/dist/components/date-picker/index.js +76 -69
  65. package/dist/components/date-picker/index.js.map +1 -1
  66. package/dist/components/date-range-picker/index.d.ts +10 -2
  67. package/dist/components/date-range-picker/index.js +93 -86
  68. package/dist/components/date-range-picker/index.js.map +1 -1
  69. package/dist/components/dialog/index.d.ts +1 -1
  70. package/dist/components/dialog/index.js +2 -2
  71. package/dist/components/dialog/index.js.map +1 -1
  72. package/dist/components/disclosure/index.d.ts +1 -1
  73. package/dist/components/disclosure/index.js +6 -6
  74. package/dist/components/disclosure/index.js.map +1 -1
  75. package/dist/components/fab/index.d.ts +72 -0
  76. package/dist/components/fab/index.js +89 -0
  77. package/dist/components/fab/index.js.map +1 -0
  78. package/dist/components/fab-menu/index.d.ts +90 -0
  79. package/dist/components/fab-menu/index.js +297 -0
  80. package/dist/components/fab-menu/index.js.map +1 -0
  81. package/dist/components/feed/index.d.ts +2 -1
  82. package/dist/components/feed/index.js +1 -1
  83. package/dist/components/feed/index.js.map +1 -1
  84. package/dist/components/icon-button/index.d.ts +11 -8
  85. package/dist/components/icon-button/index.js +209 -177
  86. package/dist/components/icon-button/index.js.map +1 -1
  87. package/dist/components/index.d.ts +26 -20
  88. package/dist/components/list/index.d.ts +15 -13
  89. package/dist/components/list/index.js +62 -63
  90. package/dist/components/list/index.js.map +1 -1
  91. package/dist/components/list-box/index.d.ts +3 -2
  92. package/dist/components/list-box/index.js +8 -8
  93. package/dist/components/list-box/index.js.map +1 -1
  94. package/dist/components/list-item/index.js +1 -1
  95. package/dist/components/list-item/index.js.map +1 -1
  96. package/dist/components/menu/index.d.ts +3 -2
  97. package/dist/components/menu/index.js +2 -2
  98. package/dist/components/menu/index.js.map +1 -1
  99. package/dist/components/navigation-bar/index.d.ts +50 -0
  100. package/dist/components/navigation-bar/index.js +129 -0
  101. package/dist/components/navigation-bar/index.js.map +1 -0
  102. package/dist/components/navigation-rail/index.d.ts +59 -0
  103. package/dist/components/navigation-rail/index.js +166 -0
  104. package/dist/components/navigation-rail/index.js.map +1 -0
  105. package/dist/components/navigation-tree/index.d.ts +1 -5
  106. package/dist/components/navigation-tree/index.js +3 -3
  107. package/dist/components/navigation-tree/index.js.map +1 -1
  108. package/dist/components/number-field/index.d.ts +6 -4
  109. package/dist/components/number-field/index.js +84 -84
  110. package/dist/components/number-field/index.js.map +1 -1
  111. package/dist/components/popover/index.d.ts +1 -1
  112. package/dist/components/popover/index.js +1 -1
  113. package/dist/components/popover/index.js.map +1 -1
  114. package/dist/components/radio-group/index.js +11 -10
  115. package/dist/components/radio-group/index.js.map +1 -1
  116. package/dist/components/range-calendar/index.d.ts +7 -1
  117. package/dist/components/range-calendar/index.js +71 -44
  118. package/dist/components/range-calendar/index.js.map +1 -1
  119. package/dist/components/search-field/index.d.ts +2 -1
  120. package/dist/components/search-field/index.js +24 -25
  121. package/dist/components/search-field/index.js.map +1 -1
  122. package/dist/components/segmented-button/index.d.ts +1 -1
  123. package/dist/components/segmented-button/index.js +2 -2
  124. package/dist/components/segmented-button/index.js.map +1 -1
  125. package/dist/components/select/index.js +1 -0
  126. package/dist/components/select/index.js.map +1 -1
  127. package/dist/components/sheet/index.d.ts +1 -1
  128. package/dist/components/sheet/index.js +2 -2
  129. package/dist/components/sheet/index.js.map +1 -1
  130. package/dist/components/slider/index.js +1 -1
  131. package/dist/components/slider/index.js.map +1 -1
  132. package/dist/components/snackbar/index.d.ts +2 -2
  133. package/dist/components/snackbar/index.js +28 -13
  134. package/dist/components/snackbar/index.js.map +1 -1
  135. package/dist/components/table/index.d.ts +11 -9
  136. package/dist/components/table/index.js +68 -29
  137. package/dist/components/table/index.js.map +1 -1
  138. package/dist/components/tabs/index.d.ts +1 -1
  139. package/dist/components/tabs/index.js +79 -23
  140. package/dist/components/tabs/index.js.map +1 -1
  141. package/dist/components/tag/index.d.ts +1 -1
  142. package/dist/components/tag/index.js.map +1 -1
  143. package/dist/components/text-area/index.d.ts +7 -5
  144. package/dist/components/text-area/index.js +28 -26
  145. package/dist/components/text-area/index.js.map +1 -1
  146. package/dist/components/text-field/index.d.ts +7 -5
  147. package/dist/components/text-field/index.js +28 -26
  148. package/dist/components/text-field/index.js.map +1 -1
  149. package/dist/components/time-field/index.js +24 -22
  150. package/dist/components/time-field/index.js.map +1 -1
  151. package/dist/components/tree/index.d.ts +7 -9
  152. package/dist/components/tree/index.js +11 -12
  153. package/dist/components/tree/index.js.map +1 -1
  154. package/dist/drag/styles.js +4 -1
  155. package/dist/drag/styles.js.map +1 -1
  156. package/dist/fab/styles.js +161 -0
  157. package/dist/fab/styles.js.map +1 -0
  158. package/dist/field/index.js +260 -214
  159. package/dist/field/index.js.map +1 -1
  160. package/dist/field/styles.js +10 -2
  161. package/dist/field/styles.js.map +1 -1
  162. package/dist/glyphs/index.js +19 -1
  163. package/dist/glyphs/index.js.map +1 -1
  164. package/dist/hooks/useRipple.js +199 -162
  165. package/dist/hooks/useRipple.js.map +1 -1
  166. package/dist/i18n/index.js +42 -0
  167. package/dist/i18n/index.js.map +1 -0
  168. package/dist/i18n/messages.js +353 -0
  169. package/dist/i18n/messages.js.map +1 -0
  170. package/dist/index.d.ts +27 -20
  171. package/dist/index.js +22 -16
  172. package/dist/navigation/context.js +7 -0
  173. package/dist/navigation/context.js.map +1 -0
  174. package/dist/navigation/index.d.ts +28 -0
  175. package/dist/navigation/index.js +96 -0
  176. package/dist/navigation/index.js.map +1 -0
  177. package/dist/navigation/styles.js +312 -0
  178. package/dist/navigation/styles.js.map +1 -0
  179. package/dist/react-aria.d.ts +2 -2
  180. package/dist/react-aria.js +2 -2
  181. package/dist/render/useRender.js +0 -1
  182. package/dist/render/useRender.js.map +1 -1
  183. package/dist/row/styles.js +18 -11
  184. package/dist/row/styles.js.map +1 -1
  185. package/dist/styles/focus.js.map +1 -1
  186. package/dist/styles/icon-button.js +9 -1
  187. package/dist/styles/icon-button.js.map +1 -1
  188. package/dist/styles/overlay.js +1 -0
  189. package/dist/styles/overlay.js.map +1 -1
  190. package/dist/styles/picker.js +1 -1
  191. package/dist/styles/picker.js.map +1 -1
  192. package/dist/styles.css +870 -360
  193. package/dist/tokens/design.tokens.stylex.js +18 -1
  194. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  195. package/dist/tokens.css +166 -53
  196. package/package.json +8 -4
@@ -1,12 +1,45 @@
1
1
  import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
- import { ChevronEndGlyph } from "../glyphs/index.js";
2
+ import { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from "../glyphs/index.js";
3
3
  import { focus } from "../styles/focus.js";
4
4
  import { iconButton } from "../styles/icon-button.js";
5
- import { calendarStyles } from "./styles.js";
5
+ import { calendarStyles, dateLayers, menuLayers } from "./styles.js";
6
6
  import { c } from "react/compiler-runtime";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- import { Button, CalendarGridHeader, CalendarHeaderCell, Heading } from "react-aria-components";
7
+ import { useContext, useEffect, useId, useRef, useState } from "react";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Button, ButtonContext, CalendarGridHeader, CalendarHeaderCell, CalendarMonthPicker, CalendarStateContext, CalendarYearPicker, Heading, ListBox, ListBoxItem, RangeCalendarStateContext } from "react-aria-components";
10
+ import { endOfMonth, startOfMonth } from "@internationalized/date";
9
11
  //#region src/calendar/index.tsx
12
+ /**
13
+ * What a calendar draws above its months, and the months themselves. With
14
+ * `showMonthYearMenus` the header is the date pickers page's docked one —
15
+ * the month and the year as menu buttons — and while either is open its list
16
+ * takes the months' place.
17
+ */
18
+ function CalendarFrame(t0) {
19
+ const $ = c(5);
20
+ const { children, showMonthYearMenus } = t0;
21
+ if (showMonthYearMenus) {
22
+ let t1;
23
+ if ($[0] !== children) {
24
+ t1 = /* @__PURE__ */ jsx(CalendarMenus, { children });
25
+ $[0] = children;
26
+ $[1] = t1;
27
+ } else t1 = $[1];
28
+ return t1;
29
+ }
30
+ let t1;
31
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
32
+ t1 = /* @__PURE__ */ jsx(CalendarHeader, {});
33
+ $[2] = t1;
34
+ } else t1 = $[2];
35
+ let t2;
36
+ if ($[3] !== children) {
37
+ t2 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t1, children] });
38
+ $[3] = children;
39
+ $[4] = t2;
40
+ } else t2 = $[4];
41
+ return t2;
42
+ }
10
43
  function CalendarGridHeader$1() {
11
44
  const $ = c(1);
12
45
  let t0;
@@ -73,10 +106,443 @@ function calendarHeaderCell(day) {
73
106
  children: day
74
107
  });
75
108
  }
76
- function chevronClassName(state) {
77
- return props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isDisabled && iconButton.chromeDisabled).className ?? "";
109
+ /**
110
+ * The docked header: the month's menu button between the chevrons that step
111
+ * it, and the year's menu button at the end. A press opens the button's list
112
+ * in the months' place, where the page draws it, rather than in a popover over
113
+ * them; a calendar inside a picker is already in one. While a list is open
114
+ * the chevrons are hidden and the other menu is disabled, as the page draws
115
+ * them, and choosing an entry — or pressing the one already checked, or
116
+ * Escape — closes the list and puts focus back on its button.
117
+ *
118
+ * The lists are React Aria's month and year pickers, rendered twice: the
119
+ * header names the month short, as the page's button does, and the list in
120
+ * full. The year list holds the years `minValue` and `maxValue` allow and no
121
+ * others, which React Aria bounds itself; a month with no day inside them is
122
+ * disabled here.
123
+ */
124
+ function CalendarMenus(t0) {
125
+ const $ = c(47);
126
+ const { children } = t0;
127
+ const single = useContext(CalendarStateContext);
128
+ const range = useContext(RangeCalendarStateContext);
129
+ const state = single ?? range;
130
+ const [open, setOpen] = useState(null);
131
+ const listId = useId();
132
+ const monthButton = useRef(null);
133
+ const yearButton = useRef(null);
134
+ let t1;
135
+ if ($[0] !== open) {
136
+ t1 = () => {
137
+ const button = open === "month" ? monthButton : yearButton;
138
+ requestAnimationFrame(() => {
139
+ button.current?.focus();
140
+ setOpen(null);
141
+ });
142
+ };
143
+ $[0] = open;
144
+ $[1] = t1;
145
+ } else t1 = $[1];
146
+ const close = t1;
147
+ let t2;
148
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
149
+ t2 = () => {
150
+ setOpen(_temp);
151
+ };
152
+ $[2] = t2;
153
+ } else t2 = $[2];
154
+ const toggleMonth = t2;
155
+ let t3;
156
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
157
+ t3 = () => {
158
+ setOpen(_temp2);
159
+ };
160
+ $[3] = t3;
161
+ } else t3 = $[3];
162
+ const toggleYear = t3;
163
+ const isDisabled = state?.isDisabled ?? false;
164
+ let t4;
165
+ if ($[4] !== state) {
166
+ t4 = (picker) => picker.items.filter((entry) => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(_temp3);
167
+ $[4] = state;
168
+ $[5] = t4;
169
+ } else t4 = $[5];
170
+ const outsideBounds = t4;
171
+ let t5;
172
+ let t6;
173
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
174
+ t5 = props(calendarStyles.header);
175
+ t6 = props(calendarStyles.headerGroup);
176
+ $[6] = t5;
177
+ $[7] = t6;
178
+ } else {
179
+ t5 = $[6];
180
+ t6 = $[7];
181
+ }
182
+ const t7 = open !== null;
183
+ let t8;
184
+ if ($[8] !== t7) {
185
+ t8 = chevronClassNameWhile(t7);
186
+ $[8] = t7;
187
+ $[9] = t8;
188
+ } else t8 = $[9];
189
+ let t9;
190
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
191
+ t9 = /* @__PURE__ */ jsx(ChevronEndGlyph, { ...props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious) });
192
+ $[10] = t9;
193
+ } else t9 = $[10];
194
+ let t10;
195
+ if ($[11] !== t8) {
196
+ t10 = /* @__PURE__ */ jsx(Button, {
197
+ className: t8,
198
+ slot: "previous",
199
+ children: t9
200
+ });
201
+ $[11] = t8;
202
+ $[12] = t10;
203
+ } else t10 = $[12];
204
+ let t11;
205
+ if ($[13] !== isDisabled || $[14] !== listId || $[15] !== open) {
206
+ t11 = /* @__PURE__ */ jsx(CalendarMonthPicker, { children: (picker_0) => /* @__PURE__ */ jsx(MenuButton, {
207
+ controls: listId,
208
+ isDisabled: isDisabled || open === "year",
209
+ isExpanded: open === "month",
210
+ onPress: toggleMonth,
211
+ picker: picker_0,
212
+ ref: monthButton
213
+ }) });
214
+ $[13] = isDisabled;
215
+ $[14] = listId;
216
+ $[15] = open;
217
+ $[16] = t11;
218
+ } else t11 = $[16];
219
+ const t12 = open !== null;
220
+ let t13;
221
+ if ($[17] !== t12) {
222
+ t13 = chevronClassNameWhile(t12);
223
+ $[17] = t12;
224
+ $[18] = t13;
225
+ } else t13 = $[18];
226
+ let t14;
227
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
228
+ t14 = /* @__PURE__ */ jsx(ChevronEndGlyph, { ...props(calendarStyles.chevronGlyph) });
229
+ $[19] = t14;
230
+ } else t14 = $[19];
231
+ let t15;
232
+ if ($[20] !== t13) {
233
+ t15 = /* @__PURE__ */ jsx(Button, {
234
+ className: t13,
235
+ slot: "next",
236
+ children: t14
237
+ });
238
+ $[20] = t13;
239
+ $[21] = t15;
240
+ } else t15 = $[21];
241
+ let t16;
242
+ if ($[22] !== t10 || $[23] !== t11 || $[24] !== t15) {
243
+ t16 = /* @__PURE__ */ jsxs("div", {
244
+ ...t6,
245
+ children: [
246
+ t10,
247
+ t11,
248
+ t15
249
+ ]
250
+ });
251
+ $[22] = t10;
252
+ $[23] = t11;
253
+ $[24] = t15;
254
+ $[25] = t16;
255
+ } else t16 = $[25];
256
+ let t17;
257
+ if ($[26] !== isDisabled || $[27] !== listId || $[28] !== open) {
258
+ t17 = /* @__PURE__ */ jsx(CalendarYearPicker, { children: (picker_1) => /* @__PURE__ */ jsx(MenuButton, {
259
+ controls: listId,
260
+ isDisabled: isDisabled || open === "month",
261
+ isExpanded: open === "year",
262
+ onPress: toggleYear,
263
+ picker: picker_1,
264
+ ref: yearButton
265
+ }) });
266
+ $[26] = isDisabled;
267
+ $[27] = listId;
268
+ $[28] = open;
269
+ $[29] = t17;
270
+ } else t17 = $[29];
271
+ let t18;
272
+ if ($[30] !== t16 || $[31] !== t17) {
273
+ t18 = /* @__PURE__ */ jsxs("div", {
274
+ ...t5,
275
+ children: [t16, t17]
276
+ });
277
+ $[30] = t16;
278
+ $[31] = t17;
279
+ $[32] = t18;
280
+ } else t18 = $[32];
281
+ const t19 = open === null ? children : null;
282
+ let t20;
283
+ if ($[33] !== close || $[34] !== listId || $[35] !== open || $[36] !== outsideBounds) {
284
+ t20 = open === "month" ? /* @__PURE__ */ jsx(CalendarMonthPicker, {
285
+ format: "long",
286
+ children: (picker_2) => /* @__PURE__ */ jsx(MenuList, {
287
+ disabledKeys: outsideBounds(picker_2),
288
+ id: listId,
289
+ onClose: close,
290
+ picker: picker_2
291
+ })
292
+ }) : null;
293
+ $[33] = close;
294
+ $[34] = listId;
295
+ $[35] = open;
296
+ $[36] = outsideBounds;
297
+ $[37] = t20;
298
+ } else t20 = $[37];
299
+ let t21;
300
+ if ($[38] !== close || $[39] !== listId || $[40] !== open) {
301
+ t21 = open === "year" ? /* @__PURE__ */ jsx(CalendarYearPicker, { children: (picker_3) => /* @__PURE__ */ jsx(MenuList, {
302
+ id: listId,
303
+ onClose: close,
304
+ picker: picker_3
305
+ }) }) : null;
306
+ $[38] = close;
307
+ $[39] = listId;
308
+ $[40] = open;
309
+ $[41] = t21;
310
+ } else t21 = $[41];
311
+ let t22;
312
+ if ($[42] !== t18 || $[43] !== t19 || $[44] !== t20 || $[45] !== t21) {
313
+ t22 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
314
+ t18,
315
+ t19,
316
+ t20,
317
+ t21
318
+ ] });
319
+ $[42] = t18;
320
+ $[43] = t19;
321
+ $[44] = t20;
322
+ $[45] = t21;
323
+ $[46] = t22;
324
+ } else t22 = $[46];
325
+ return t22;
326
+ }
327
+ function _temp3(entry_0) {
328
+ return entry_0.id;
329
+ }
330
+ function _temp2(current_0) {
331
+ return current_0 === "year" ? null : "year";
332
+ }
333
+ function _temp(current) {
334
+ return current === "month" ? null : "month";
335
+ }
336
+ function chevronClassName(state, isHidden = false) {
337
+ return props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? "";
338
+ }
339
+ function chevronClassNameWhile(isListOpen) {
340
+ return (state) => chevronClassName(state, isListOpen);
341
+ }
342
+ /**
343
+ * The month or the year as the page's menu button, opening its list. Named
344
+ * by what it shows and then by what it is — "Sep month" — which keeps the
345
+ * visible text the start of the name, so a reader who says what they see
346
+ * reaches it.
347
+ *
348
+ * Outside React Aria's button context, which a calendar fills with its
349
+ * `previous` and `next` slots alone: a button with no slot inside it is an
350
+ * error, and these are not either chevron.
351
+ */
352
+ function MenuButton(t0) {
353
+ const $ = c(25);
354
+ const { controls, isDisabled, isExpanded, onPress, picker, ref } = t0;
355
+ const valueId = useId();
356
+ const nameId = useId();
357
+ let t1;
358
+ if ($[0] !== picker.items || $[1] !== picker.value) {
359
+ let t2;
360
+ if ($[3] !== picker.value) {
361
+ t2 = (entry) => entry.id === picker.value;
362
+ $[3] = picker.value;
363
+ $[4] = t2;
364
+ } else t2 = $[4];
365
+ t1 = picker.items.find(t2);
366
+ $[0] = picker.items;
367
+ $[1] = picker.value;
368
+ $[2] = t1;
369
+ } else t1 = $[2];
370
+ const shown = t1;
371
+ const t2 = isExpanded ? controls : void 0;
372
+ const t3 = `${valueId} ${nameId}`;
373
+ const t4 = shown?.formatted;
374
+ let t5;
375
+ if ($[5] !== t4 || $[6] !== valueId) {
376
+ t5 = /* @__PURE__ */ jsx("span", {
377
+ id: valueId,
378
+ children: t4
379
+ });
380
+ $[5] = t4;
381
+ $[6] = valueId;
382
+ $[7] = t5;
383
+ } else t5 = $[7];
384
+ const t6 = picker["aria-label"];
385
+ let t7;
386
+ if ($[8] !== nameId || $[9] !== t6) {
387
+ t7 = /* @__PURE__ */ jsx("span", {
388
+ hidden: true,
389
+ id: nameId,
390
+ children: t6
391
+ });
392
+ $[8] = nameId;
393
+ $[9] = t6;
394
+ $[10] = t7;
395
+ } else t7 = $[10];
396
+ let t8;
397
+ if ($[11] !== isExpanded) {
398
+ t8 = props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded);
399
+ $[11] = isExpanded;
400
+ $[12] = t8;
401
+ } else t8 = $[12];
402
+ let t9;
403
+ if ($[13] !== t8) {
404
+ t9 = /* @__PURE__ */ jsx(ArrowDropDownGlyph, { ...t8 });
405
+ $[13] = t8;
406
+ $[14] = t9;
407
+ } else t9 = $[14];
408
+ let t10;
409
+ if ($[15] !== isDisabled || $[16] !== isExpanded || $[17] !== onPress || $[18] !== ref || $[19] !== t2 || $[20] !== t3 || $[21] !== t5 || $[22] !== t7 || $[23] !== t9) {
410
+ t10 = /* @__PURE__ */ jsx(ButtonContext, {
411
+ value: null,
412
+ children: /* @__PURE__ */ jsxs(Button, {
413
+ "aria-controls": t2,
414
+ "aria-expanded": isExpanded,
415
+ "aria-haspopup": "listbox",
416
+ "aria-labelledby": t3,
417
+ className: menuButtonClassName,
418
+ isDisabled,
419
+ onPress,
420
+ ref,
421
+ children: [
422
+ t5,
423
+ t7,
424
+ t9
425
+ ]
426
+ })
427
+ });
428
+ $[15] = isDisabled;
429
+ $[16] = isExpanded;
430
+ $[17] = onPress;
431
+ $[18] = ref;
432
+ $[19] = t2;
433
+ $[20] = t3;
434
+ $[21] = t5;
435
+ $[22] = t7;
436
+ $[23] = t9;
437
+ $[24] = t10;
438
+ } else t10 = $[24];
439
+ return t10;
440
+ }
441
+ function menuButtonClassName(state) {
442
+ return props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? "";
443
+ }
444
+ function menuEntry(entry) {
445
+ return /* @__PURE__ */ jsx(ListBoxItem, {
446
+ className: menuItemClassName,
447
+ id: entry.id,
448
+ textValue: entry.formatted,
449
+ children: menuEntryContent(entry.formatted)
450
+ });
451
+ }
452
+ function menuEntryContent(label) {
453
+ return ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [isSelected ? /* @__PURE__ */ jsx(CheckGlyph, { ...props(calendarStyles.menuCheck) }) : /* @__PURE__ */ jsx("span", { ...props(calendarStyles.menuCheck) }), label] });
454
+ }
455
+ function menuItemClassName(state) {
456
+ return props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? "";
457
+ }
458
+ /**
459
+ * An open month or year list, in the months' place. React Aria's list box,
460
+ * with the entry the calendar shows selected and focused when it opens.
461
+ *
462
+ * Choosing closes it, and so does pressing the checked entry or Escape. A
463
+ * single selection that may empty is what tells those apart: choosing
464
+ * replaces the selection, while the checked entry toggles it off and Escape
465
+ * clears it — and the clearing is what stops Escape there rather than letting
466
+ * it close a picker's dialog around the calendar.
467
+ */
468
+ function MenuList(t0) {
469
+ const $ = c(15);
470
+ const { disabledKeys, id, onClose, picker } = t0;
471
+ const list = useRef(null);
472
+ let t1;
473
+ if ($[0] !== picker.value) {
474
+ t1 = [picker.value];
475
+ $[0] = picker.value;
476
+ $[1] = t1;
477
+ } else t1 = $[1];
478
+ const selected = t1;
479
+ let t2;
480
+ if ($[2] !== onClose || $[3] !== picker) {
481
+ t2 = (keys) => {
482
+ if (keys !== "all") for (const key of keys) picker.onChange(key);
483
+ onClose();
484
+ };
485
+ $[2] = onClose;
486
+ $[3] = picker;
487
+ $[4] = t2;
488
+ } else t2 = $[4];
489
+ const choose = t2;
490
+ let t3;
491
+ let t4;
492
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
493
+ t3 = () => {
494
+ const frame = requestAnimationFrame(() => {
495
+ const element = list.current;
496
+ const checked = element?.querySelector("[aria-selected=\"true\"]");
497
+ if (element == null || !(checked instanceof HTMLElement)) return;
498
+ element.scrollTop = element.scrollTop + (checked.getBoundingClientRect().top - element.getBoundingClientRect().top - (element.clientHeight - checked.offsetHeight) / 2);
499
+ });
500
+ return () => {
501
+ cancelAnimationFrame(frame);
502
+ };
503
+ };
504
+ t4 = [];
505
+ $[5] = t3;
506
+ $[6] = t4;
507
+ } else {
508
+ t3 = $[5];
509
+ t4 = $[6];
510
+ }
511
+ useEffect(t3, t4);
512
+ const t5 = picker["aria-label"];
513
+ const t6 = picker.items;
514
+ let t7;
515
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
516
+ t7 = props(calendarStyles.menuList);
517
+ $[7] = t7;
518
+ } else t7 = $[7];
519
+ let t8;
520
+ if ($[8] !== choose || $[9] !== disabledKeys || $[10] !== id || $[11] !== picker.items || $[12] !== selected || $[13] !== t5) {
521
+ t8 = /* @__PURE__ */ jsx(ListBox, {
522
+ "aria-label": t5,
523
+ autoFocus: true,
524
+ disabledKeys,
525
+ id,
526
+ items: t6,
527
+ onSelectionChange: choose,
528
+ ref: list,
529
+ selectedKeys: selected,
530
+ selectionMode: "single",
531
+ shouldSelectOnPressUp: true,
532
+ ...t7,
533
+ children: menuEntry
534
+ });
535
+ $[8] = choose;
536
+ $[9] = disabledKeys;
537
+ $[10] = id;
538
+ $[11] = picker.items;
539
+ $[12] = selected;
540
+ $[13] = t5;
541
+ $[14] = t8;
542
+ } else t8 = $[14];
543
+ return t8;
78
544
  }
79
545
  //#endregion
80
- export { CalendarGridHeader$1 as CalendarGridHeader, CalendarHeader };
546
+ export { CalendarFrame, CalendarGridHeader$1 as CalendarGridHeader };
81
547
 
82
548
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactElement","stylex","Button","RACButton","CalendarGridHeader","RACCalendarGridHeader","CalendarHeaderCell","RACCalendarHeaderCell","Heading","RACHeading","ChevronEndGlyph","focus","iconButton","calendarStyles","$","_c","t0","Symbol","for","calendarHeaderCell","CalendarHeader","props","header","t1","chevronClassName","chevronGlyph","chevronGlyphPrevious","t2","heading","t3","day","headerCell","state","isDisabled","chrome","chevron","ring","chromeDisabled","className","CalendarGridHeader","_c","RACCalendarGridHeader","stylex.props","RACButton","RACHeading","RACCalendarHeaderCell"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, Heading as RACHeading } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { calendarStyles } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the weekday header, and the offsets that put more than one month\n// side by side. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\nfunction CalendarGridHeader(): ReactElement {\n return <RACCalendarGridHeader>{calendarHeaderCell}</RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n}) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\nexport { CalendarGridHeader, CalendarHeader };"],"mappings":";;;;;;;;;AAaA,SAAAI,uBAAA;CAAA,MAAAU,IAAAC,EA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V,mBAAmBW,KAA2B;CACrD,OAAO,oBAACe,oBAAD;EAAuB,GAAI5C,MAAaY,eAAekB,UAAU;EACnED,UAAAA;CACoB,CAAA;AAC3B;AAMA,SAASN,iBAAiBQ,OAEvB;CACD,OAAO/B,MAAaW,WAAWsB,QAAQrB,eAAesB,SAASxB,MAAMyB,MAAMJ,MAAMC,cAAcrB,WAAWyB,cAAc,CAAC,CAACC,aAAa;AACzI"}
1
+ {"version":3,"file":"index.js","names":["CalendarDate","ReactElement","ReactNode","Ref","Key","Selection","endOfMonth","startOfMonth","stylex","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","ButtonContext","CalendarStateContext","Button","RACButton","CalendarGridHeader","RACCalendarGridHeader","CalendarHeaderCell","RACCalendarHeaderCell","CalendarMonthPicker","RACCalendarMonthPicker","CalendarYearPicker","RACCalendarYearPicker","Heading","RACHeading","ListBox","RACListBox","ListBoxItem","RACListBoxItem","RangeCalendarStateContext","ArrowDropDownGlyph","CheckGlyph","ChevronEndGlyph","focus","iconButton","calendarStyles","dateLayers","menuLayers","MenuEntry","date","formatted","id","MenuPicker","items","onChange","key","value","OpenMenu","CalendarFrame","t0","$","_c","children","showMonthYearMenus","t1","Symbol","for","t2","calendarHeaderCell","CalendarHeader","props","header","chevronClassName","chevronGlyph","chevronGlyphPrevious","heading","t3","day","headerCell","CalendarMenus","single","range","state","open","setOpen","listId","monthButton","yearButton","button","requestAnimationFrame","current","close","_temp","toggleMonth","_temp2","toggleYear","isDisabled","t4","picker","filter","entry","maxValue","compare","minValue","map","_temp3","outsideBounds","t5","t6","headerGroup","t7","t8","chevronClassNameWhile","t9","t10","t11","picker_0","t12","t13","t14","t15","t16","t17","picker_1","t18","t19","t20","picker_2","t21","picker_3","t22","entry_0","current_0","isHovered","isPressed","isHidden","chrome","chevron","ring","chromeHovered","chromePressed","chromeDisabled","chevronHidden","className","isListOpen","MenuButton","controls","isExpanded","onPress","ref","valueId","nameId","find","shown","undefined","menuArrow","menuArrowExpanded","menuButtonClassName","menuButton","menuEntry","menuItemClassName","menuEntryContent","label","isSelected","menuCheck","isFocusVisible","menuItem","menuItemSelected","selectedHovered","plainHovered","selectedPressed","plainPressed","menuItemFocused","menuItemDisabled","MenuList","disabledKeys","onClose","list","selected","keys","choose","frame","element","checked","querySelector","HTMLElement","scrollTop","getBoundingClientRect","top","clientHeight","offsetHeight","cancelAnimationFrame","menuList","_c","CalendarGridHeader","RACCalendarGridHeader","stylex.props","RACButton","RACHeading","RACCalendarHeaderCell","RACCalendarMonthPicker","RACCalendarYearPicker","RACListBoxItem","RACListBox"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, ReactNode, Ref } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\nimport { endOfMonth, startOfMonth } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { ButtonContext, CalendarStateContext, Button as RACButton, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, CalendarMonthPicker as RACCalendarMonthPicker, CalendarYearPicker as RACCalendarYearPicker, Heading as RACHeading, ListBox as RACListBox, ListBoxItem as RACListBoxItem, RangeCalendarStateContext } from 'react-aria-components';\nimport { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { calendarStyles, dateLayers, menuLayers } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the weekday header, and the offsets that put more than one month\n// side by side. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\n/** One entry of React Aria's month or year picker, as either lists it. */\ntype MenuEntry = {\n date: CalendarDate;\n formatted: string;\n id: number;\n};\n\n/** What React Aria's month and year pickers hand the element they render. */\ntype MenuPicker = {\n 'aria-label': string;\n items: MenuEntry[];\n onChange: (key: Key | null) => void;\n value: Key;\n};\ntype OpenMenu = 'month' | 'year';\n\n/**\n * What a calendar draws above its months, and the months themselves. With\n * `showMonthYearMenus` the header is the date pickers page's docked one —\n * the month and the year as menu buttons — and while either is open its list\n * takes the months' place.\n */\nfunction CalendarFrame({\n children,\n showMonthYearMenus\n}: {\n children: ReactNode;\n showMonthYearMenus: boolean;\n}): ReactElement {\n if (showMonthYearMenus) {\n return <CalendarMenus>{children}</CalendarMenus>;\n }\n return <>\n <CalendarHeader />\n {children}\n </>;\n}\nfunction CalendarGridHeader(): ReactElement {\n return <RACCalendarGridHeader>{calendarHeaderCell}</RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n/**\n * The docked header: the month's menu button between the chevrons that step\n * it, and the year's menu button at the end. A press opens the button's list\n * in the months' place, where the page draws it, rather than in a popover over\n * them; a calendar inside a picker is already in one. While a list is open\n * the chevrons are hidden and the other menu is disabled, as the page draws\n * them, and choosing an entry — or pressing the one already checked, or\n * Escape — closes the list and puts focus back on its button.\n *\n * The lists are React Aria's month and year pickers, rendered twice: the\n * header names the month short, as the page's button does, and the list in\n * full. The year list holds the years `minValue` and `maxValue` allow and no\n * others, which React Aria bounds itself; a month with no day inside them is\n * disabled here.\n */\nfunction CalendarMenus({\n children\n}: {\n children: ReactNode;\n}): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const [open, setOpen] = useState<null | OpenMenu>(null);\n const listId = useId();\n const monthButton = useRef<HTMLButtonElement>(null);\n const yearButton = useRef<HTMLButtonElement>(null);\n\n // A frame after the choice, and focus back on the button before the list\n // goes, rather than lost with it. The key that chose still has a keypress\n // to deliver: React Aria leaves Enter's default alone on a Mac, and with\n // focus already moved the keypress pressed the menu button and opened the\n // list again. A frame later it has landed on the list instead, as the\n // click after a pointer's choice has.\n const close = useCallback(() => {\n const button = open === 'month' ? monthButton : yearButton;\n requestAnimationFrame(() => {\n button.current?.focus();\n setOpen(null);\n });\n }, [open]);\n const toggleMonth = useCallback(() => {\n setOpen(current => current === 'month' ? null : 'month');\n }, []);\n const toggleYear = useCallback(() => {\n setOpen(current => current === 'year' ? null : 'year');\n }, []);\n const isDisabled = state?.isDisabled ?? false;\n const outsideBounds = (picker: MenuPicker) => picker.items.filter(entry => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(entry => entry.id);\n return <>\n <div {...stylex.props(calendarStyles.header)}>\n <div {...stylex.props(calendarStyles.headerGroup)}>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACCalendarMonthPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'year'} isExpanded={open === 'month'} onPress={toggleMonth} picker={picker} ref={monthButton} />}\n </RACCalendarMonthPicker>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>\n <RACCalendarYearPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'month'} isExpanded={open === 'year'} onPress={toggleYear} picker={picker} ref={yearButton} />}\n </RACCalendarYearPicker>\n </div>\n {open === null ? children : null}\n {open === 'month' ? <RACCalendarMonthPicker format=\"long\">\n {picker => <MenuList disabledKeys={outsideBounds(picker)} id={listId} onClose={close} picker={picker} />}\n </RACCalendarMonthPicker> : null}\n {open === 'year' ? <RACCalendarYearPicker>\n {picker => <MenuList id={listId} onClose={close} picker={picker} />}\n </RACCalendarYearPicker> : null}\n </>;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}, isHidden = false) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? '';\n}\n\n// The same, hidden while a month or year list is open.\nfunction chevronClassNameWhile(isListOpen: boolean) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => chevronClassName(state, isListOpen);\n}\n\n/**\n * The month or the year as the page's menu button, opening its list. Named\n * by what it shows and then by what it is — \"Sep month\" — which keeps the\n * visible text the start of the name, so a reader who says what they see\n * reaches it.\n *\n * Outside React Aria's button context, which a calendar fills with its\n * `previous` and `next` slots alone: a button with no slot inside it is an\n * error, and these are not either chevron.\n */\nfunction MenuButton({\n controls,\n isDisabled,\n isExpanded,\n onPress,\n picker,\n ref\n}: {\n controls: string;\n isDisabled: boolean;\n isExpanded: boolean;\n onPress: () => void;\n picker: MenuPicker;\n ref: Ref<HTMLButtonElement>;\n}): ReactElement {\n const valueId = useId();\n const nameId = useId();\n const shown = picker.items.find(entry => entry.id === picker.value);\n return <ButtonContext value={null}>\n <RACButton aria-controls={isExpanded ? controls : undefined} aria-expanded={isExpanded} aria-haspopup=\"listbox\" aria-labelledby={`${valueId} ${nameId}`} className={menuButtonClassName} isDisabled={isDisabled} onPress={onPress} ref={ref}>\n <span id={valueId}>{shown?.formatted}</span>\n <span hidden id={nameId}>\n {picker['aria-label']}\n </span>\n <ArrowDropDownGlyph {...stylex.props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded)} />\n </RACButton>\n </ButtonContext>;\n}\n\n// A menu button's classes, from React Aria's render state, with the icon\n// buttons' state layers and fade — see `menuButton`.\nfunction menuButtonClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\n\n// One row of an open list: the check where the row is the one shown, the\n// room it takes where it is not, then the month or the year. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction menuEntry(entry: MenuEntry): ReactElement {\n return <RACListBoxItem className={menuItemClassName} id={entry.id} textValue={entry.formatted}>\n {menuEntryContent(entry.formatted)}\n </RACListBoxItem>;\n}\nfunction menuEntryContent(label: string) {\n return ({\n isSelected\n }: {\n isSelected: boolean;\n }) => <>\n {isSelected ? <CheckGlyph {...stylex.props(calendarStyles.menuCheck)} /> : <span {...stylex.props(calendarStyles.menuCheck)} />}\n {label}\n </>;\n}\n\n// A row's classes, from React Aria's render state. The layers come after the\n// checked row's surface variant, written for whichever ground the row has,\n// and the fade last, which StyleX lets drop them by replacing a property\n// whole.\nfunction menuItemClassName(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? '';\n}\n\n/**\n * An open month or year list, in the months' place. React Aria's list box,\n * with the entry the calendar shows selected and focused when it opens.\n *\n * Choosing closes it, and so does pressing the checked entry or Escape. A\n * single selection that may empty is what tells those apart: choosing\n * replaces the selection, while the checked entry toggles it off and Escape\n * clears it — and the clearing is what stops Escape there rather than letting\n * it close a picker's dialog around the calendar.\n */\nfunction MenuList({\n disabledKeys,\n id,\n onClose,\n picker\n}: {\n disabledKeys?: Key[];\n id: string;\n onClose: () => void;\n picker: MenuPicker;\n}): ReactElement {\n const list = useRef<HTMLDivElement>(null);\n const selected = useMemo(() => [picker.value], [picker.value]);\n const choose = useCallback((keys: Selection) => {\n // The one entry a single selection holds after a choice, and none\n // after the checked entry is pressed again or Escape clears it.\n if (keys !== 'all') {\n for (const key of keys) {\n picker.onChange(key);\n }\n }\n onClose();\n }, [onClose, picker]);\n\n // The checked entry opens in the middle of the list, as the page draws it,\n // with the entries either side of it in view. React Aria scrolls the entry\n // it focuses only as far as the nearest edge, which left the year shown at\n // the bottom with every later year out of sight. A frame after opening,\n // since React Aria renders its entries a render after the list mounts and\n // scrolls once it has; and the list's own scroll alone moves, where\n // `scrollIntoView` would move the page around it too.\n useEffect(() => {\n const frame = requestAnimationFrame(() => {\n const element = list.current;\n const checked = element?.querySelector('[aria-selected=\"true\"]');\n if (element == null || !(checked instanceof HTMLElement)) {\n return;\n }\n element.scrollTop += checked.getBoundingClientRect().top - element.getBoundingClientRect().top - (element.clientHeight - checked.offsetHeight) / 2;\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n }, []);\n return <RACListBox aria-label={picker['aria-label']}\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a list opened from its button takes focus, as a select's does\n autoFocus disabledKeys={disabledKeys} id={id} items={picker.items} onSelectionChange={choose} ref={list} selectedKeys={selected} selectionMode=\"single\"\n // On the release rather than the press, so the pointer is done with the\n // list before it closes: chosen on the press, the release landed on\n // whatever the closing list uncovered beneath it.\n shouldSelectOnPressUp {...stylex.props(calendarStyles.menuList)}>\n {menuEntry}\n </RACListBox>;\n}\nexport { CalendarFrame, CalendarGridHeader };"],"mappings":";;;;;;;;;;;;;;;;;AAuCA,SAAAqD,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAuB,MAAA,EAAAC,UAAAC,uBAAAJ;CAOrB,IAAII,oBAAkB;EAAA,IAAAC;EAAA,IAAAJ,EAAA,OAAAE,UAAA;GACbE,KAAA,oBAAC,eAAD,EAAgBF,SAAF,CAAA;GAA2BF,EAAA,KAAAE;GAAAF,EAAA,KAAAI;EAAA,OAAAA,KAAAJ,EAAA;EAAA,OAAzCI;CAAyC;CACjD,IAAAA;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EAEGF,KAAA,oBAAC,gBAAD,CAAe,CAAA;EAAGJ,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,UAAA;EADfK,KAAA,qBAAA,YAAA,EAAA,UAAA,CACHH,IACCF,QAAQ,EAAA,CAAA;EACRF,EAAA,KAAAE;EAAAF,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OAHEO;AAGF;AAEP,SAAA1C,uBAAA;CAAA,MAAAmC,IAAAC,EAAA,CAAA;CAAA,IAAAF;CAAA,IAAAC,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EACSP,KAAA,oBAACwI,oBAAD,EAAA,UAAwB/H,mBAAF,CAAA;EAA6CR,EAAA,KAA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