@kanso-labs/kanso-ui 0.45.34 → 0.46.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 (108) hide show
  1. package/dist/button/index.js +13 -9
  2. package/dist/button/index.js.map +1 -1
  3. package/dist/calendar/styles.js +12 -7
  4. package/dist/calendar/styles.js.map +1 -1
  5. package/dist/chip/styles.js +1 -0
  6. package/dist/chip/styles.js.map +1 -1
  7. package/dist/collection/styles.js +1 -1
  8. package/dist/collection/styles.js.map +1 -1
  9. package/dist/components/breadcrumbs/index.js +4 -1
  10. package/dist/components/breadcrumbs/index.js.map +1 -1
  11. package/dist/components/button-group/index.d.ts +16 -3
  12. package/dist/components/button-group/index.js +53 -86
  13. package/dist/components/button-group/index.js.map +1 -1
  14. package/dist/components/calendar/index.d.ts +3 -3
  15. package/dist/components/calendar/index.js.map +1 -1
  16. package/dist/components/card/index.js +5 -1
  17. package/dist/components/card/index.js.map +1 -1
  18. package/dist/components/carousel/index.js +162 -105
  19. package/dist/components/carousel/index.js.map +1 -1
  20. package/dist/components/chip/index.d.ts +38 -15
  21. package/dist/components/chip/index.js +104 -8
  22. package/dist/components/chip/index.js.map +1 -1
  23. package/dist/components/color-area/index.d.ts +5 -3
  24. package/dist/components/color-area/index.js +5 -3
  25. package/dist/components/color-area/index.js.map +1 -1
  26. package/dist/components/color-picker/index.js +6 -3
  27. package/dist/components/color-picker/index.js.map +1 -1
  28. package/dist/components/color-swatch-picker/index.js +24 -9
  29. package/dist/components/color-swatch-picker/index.js.map +1 -1
  30. package/dist/components/combo-box/index.d.ts +11 -3
  31. package/dist/components/combo-box/index.js +66 -62
  32. package/dist/components/combo-box/index.js.map +1 -1
  33. package/dist/components/copy-field/index.js +1 -0
  34. package/dist/components/copy-field/index.js.map +1 -1
  35. package/dist/components/date-picker/index.d.ts +22 -3
  36. package/dist/components/date-picker/index.js +234 -45
  37. package/dist/components/date-picker/index.js.map +1 -1
  38. package/dist/components/date-range-picker/index.d.ts +3 -1
  39. package/dist/components/date-range-picker/index.js +6 -4
  40. package/dist/components/date-range-picker/index.js.map +1 -1
  41. package/dist/components/disclosure/index.d.ts +4 -3
  42. package/dist/components/disclosure/index.js +159 -101
  43. package/dist/components/disclosure/index.js.map +1 -1
  44. package/dist/components/fab/index.d.ts +3 -1
  45. package/dist/components/fab/index.js +25 -12
  46. package/dist/components/fab/index.js.map +1 -1
  47. package/dist/components/fab-menu/index.js +1 -1
  48. package/dist/components/fab-menu/index.js.map +1 -1
  49. package/dist/components/icon-button/index.js.map +1 -1
  50. package/dist/components/index.d.ts +2 -2
  51. package/dist/components/menu/index.js +1 -1
  52. package/dist/components/menu/index.js.map +1 -1
  53. package/dist/components/navigation-rail/index.js +4 -4
  54. package/dist/components/navigation-rail/index.js.map +1 -1
  55. package/dist/components/navigation-tree/index.js +16 -13
  56. package/dist/components/navigation-tree/index.js.map +1 -1
  57. package/dist/components/popover/index.js +35 -33
  58. package/dist/components/popover/index.js.map +1 -1
  59. package/dist/components/range-calendar/index.js +41 -7
  60. package/dist/components/range-calendar/index.js.map +1 -1
  61. package/dist/components/segmented-button/index.d.ts +3 -2
  62. package/dist/components/segmented-button/index.js +46 -95
  63. package/dist/components/segmented-button/index.js.map +1 -1
  64. package/dist/components/select/index.js +5 -2
  65. package/dist/components/select/index.js.map +1 -1
  66. package/dist/components/slider/index.js +42 -10
  67. package/dist/components/slider/index.js.map +1 -1
  68. package/dist/components/time-picker/index.js +2 -0
  69. package/dist/components/time-picker/index.js.map +1 -1
  70. package/dist/components/token-field/index.js +89 -66
  71. package/dist/components/token-field/index.js.map +1 -1
  72. package/dist/components/toolbar/index.d.ts +4 -0
  73. package/dist/components/toolbar/index.js +16 -5
  74. package/dist/components/toolbar/index.js.map +1 -1
  75. package/dist/components/tree/index.js +1 -1
  76. package/dist/components/tree/index.js.map +1 -1
  77. package/dist/fab/styles.js +12 -0
  78. package/dist/fab/styles.js.map +1 -1
  79. package/dist/field/styles.js +2 -2
  80. package/dist/field/styles.js.map +1 -1
  81. package/dist/hooks/useDockedMonths.js +36 -0
  82. package/dist/hooks/useDockedMonths.js.map +1 -0
  83. package/dist/i18n/index.js +1 -0
  84. package/dist/i18n/index.js.map +1 -1
  85. package/dist/i18n/messages.js +34 -0
  86. package/dist/i18n/messages.js.map +1 -1
  87. package/dist/index.d.ts +2 -2
  88. package/dist/navigation/index.js +5 -5
  89. package/dist/navigation/index.js.map +1 -1
  90. package/dist/navigation/styles.js +4 -0
  91. package/dist/navigation/styles.js.map +1 -1
  92. package/dist/row/context.js +6 -0
  93. package/dist/row/context.js.map +1 -0
  94. package/dist/row/index.js +77 -66
  95. package/dist/row/index.js.map +1 -1
  96. package/dist/row/styles.js +15 -0
  97. package/dist/row/styles.js.map +1 -1
  98. package/dist/segments/index.js +2 -1
  99. package/dist/segments/index.js.map +1 -1
  100. package/dist/segments/styles.js +4 -0
  101. package/dist/segments/styles.js.map +1 -1
  102. package/dist/styles/chequer.js +1 -0
  103. package/dist/styles/chequer.js.map +1 -1
  104. package/dist/styles/focus.js.map +1 -1
  105. package/dist/styles.css +158 -35
  106. package/dist/toggle-group/index.js +133 -0
  107. package/dist/toggle-group/index.js.map +1 -0
  108. package/package.json +1 -1
@@ -3,16 +3,22 @@ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { FieldBox, FieldMessage, FieldSegments } from "../../field/index.js";
4
4
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
5
5
  import { CalendarGlyph } from "../../glyphs/index.js";
6
+ import { useDockedMonths } from "../../hooks/useDockedMonths.js";
7
+ import { useMessages } from "../../i18n/index.js";
6
8
  import { renderSegment } from "../../segments/index.js";
7
9
  import { segmentStyles } from "../../segments/styles.js";
8
10
  import { focus } from "../../styles/focus.js";
9
11
  import { mergeStatefulStyles } from "../../styles/merge.js";
10
12
  import { overlay } from "../../styles/overlay.js";
11
13
  import { datePopoverClassName, picker, triggerClassName } from "../../styles/picker.js";
14
+ import Button$1 from "../button/index.js";
12
15
  import Calendar$1 from "../calendar/index.js";
13
16
  import { c } from "react/compiler-runtime";
17
+ import { useContext, useRef, useState } from "react";
14
18
  import { jsx, jsxs } from "react/jsx-runtime";
15
- import { Button, DateInput, DatePicker as DatePicker$1, Dialog, Group, Popover } from "react-aria-components";
19
+ import { Button, CalendarContext, DateInput, DatePicker as DatePicker$1, DatePickerStateContext, Dialog, Group, Popover, useSlottedContext } from "react-aria-components";
20
+ import { toCalendarDate } from "@internationalized/date";
21
+ import { useDateFormatter } from "react-aria";
16
22
  // src/components/date-picker/index.tsx
17
23
  function calendarTrigger(triggerLabel) {
18
24
  return /* @__PURE__ */ jsx(Button, {
@@ -36,19 +42,23 @@ function calendarTrigger(triggerLabel) {
36
42
  * The segments are `DateField`'s and the calendar is `Calendar`, so
37
43
  * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave
38
44
  * as they do there. Above the medium breakpoint the calendar is docked to
39
- * the field; below it, it opens centred, which is the page's modal picker.
45
+ * the field and a pick is the answer; below it, it opens centred as the
46
+ * page's modal picker, under a headline holding the date picked, and only
47
+ * its OK writes that date into the field.
40
48
  *
41
49
  * The call site's `className` and `style` land on the picker as a whole,
42
50
  * which is the element a layout positions.
43
51
  */
44
52
  function DatePicker(t0) {
45
- const $ = c(34);
46
- const { container, description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, showMonthYearMenus: t3, triggerLabel, variant: t4, visibleDuration, ...props$1 } = t0;
53
+ const $ = c(36);
54
+ const { cancelLabel, confirmLabel, container, description, error, floatingLabel: t1, isDisabled: t2, label, leadingIcon, selectDateLabel, showMonthYearMenus: t3, triggerLabel, variant: t4, visibleDuration, ...props$1 } = t0;
47
55
  const floatingLabel = t1 === void 0 ? true : t1;
48
56
  const isDisabled = t2 === void 0 ? false : t2;
49
57
  const showMonthYearMenus = t3 === void 0 ? false : t3;
50
58
  const variant = t4 === void 0 ? "filled" : t4;
51
59
  const validationBehavior = useFieldValidationBehavior();
60
+ const messages = useMessages();
61
+ const months = useDockedMonths(visibleDuration);
52
62
  const T0 = DatePicker$1;
53
63
  let t5;
54
64
  if ($[0] !== error) {
@@ -110,40 +120,41 @@ function DatePicker(t0) {
110
120
  $[14] = error;
111
121
  $[15] = t12;
112
122
  } else t12 = $[15];
113
- let t13;
114
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
115
- t13 = props(overlay.popupDialog, focus.ring);
116
- $[16] = t13;
117
- } else t13 = $[16];
118
- let t14;
119
- if ($[17] !== label || $[18] !== showMonthYearMenus || $[19] !== visibleDuration) {
120
- t14 = /* @__PURE__ */ jsx(Dialog, {
121
- ...t13,
122
- children: /* @__PURE__ */ jsx(Calendar$1, {
123
- "aria-label": label,
124
- showMonthYearMenus,
125
- visibleDuration
126
- })
123
+ const t13 = cancelLabel ?? messages.cancel;
124
+ const t14 = confirmLabel ?? messages.confirm;
125
+ const t15 = selectDateLabel ?? messages.selectDate;
126
+ let t16;
127
+ if ($[16] !== label || $[17] !== months || $[18] !== showMonthYearMenus || $[19] !== t13 || $[20] !== t14 || $[21] !== t15) {
128
+ t16 = /* @__PURE__ */ jsx(DatePickerDialog, {
129
+ cancelLabel: t13,
130
+ confirmLabel: t14,
131
+ label,
132
+ selectDateLabel: t15,
133
+ showMonthYearMenus,
134
+ visibleDuration: months
127
135
  });
128
- $[17] = label;
136
+ $[16] = label;
137
+ $[17] = months;
129
138
  $[18] = showMonthYearMenus;
130
- $[19] = visibleDuration;
139
+ $[19] = t13;
131
140
  $[20] = t14;
132
- } else t14 = $[20];
133
- let t15;
134
- if ($[21] !== container || $[22] !== t14) {
135
- t15 = /* @__PURE__ */ jsx(Popover, {
141
+ $[21] = t15;
142
+ $[22] = t16;
143
+ } else t16 = $[22];
144
+ let t17;
145
+ if ($[23] !== container || $[24] !== t16) {
146
+ t17 = /* @__PURE__ */ jsx(Popover, {
136
147
  className: datePopoverClassName,
137
148
  UNSTABLE_portalContainer: container,
138
- children: t14
149
+ children: t16
139
150
  });
140
- $[21] = container;
141
- $[22] = t14;
142
- $[23] = t15;
143
- } else t15 = $[23];
144
- let t16;
145
- if ($[24] !== T0 || $[25] !== isDisabled || $[26] !== props$1 || $[27] !== t11 || $[28] !== t12 || $[29] !== t15 || $[30] !== t5 || $[31] !== t6 || $[32] !== validationBehavior) {
146
- t16 = /* @__PURE__ */ jsxs(T0, {
151
+ $[23] = container;
152
+ $[24] = t16;
153
+ $[25] = t17;
154
+ } else t17 = $[25];
155
+ let t18;
156
+ if ($[26] !== T0 || $[27] !== isDisabled || $[28] !== props$1 || $[29] !== t11 || $[30] !== t12 || $[31] !== t17 || $[32] !== t5 || $[33] !== t6 || $[34] !== validationBehavior) {
157
+ t18 = /* @__PURE__ */ jsxs(T0, {
147
158
  isDisabled,
148
159
  isInvalid: t5,
149
160
  validationBehavior,
@@ -152,21 +163,199 @@ function DatePicker(t0) {
152
163
  children: [
153
164
  t11,
154
165
  t12,
155
- t15
166
+ t17
167
+ ]
168
+ });
169
+ $[26] = T0;
170
+ $[27] = isDisabled;
171
+ $[28] = props$1;
172
+ $[29] = t11;
173
+ $[30] = t12;
174
+ $[31] = t17;
175
+ $[32] = t5;
176
+ $[33] = t6;
177
+ $[34] = validationBehavior;
178
+ $[35] = t18;
179
+ } else t18 = $[35];
180
+ return t18;
181
+ }
182
+ /**
183
+ * The surface's content, mounted each time the calendar opens: the date it
184
+ * was opened on is its draft, which a pick in the docked calendar writes
185
+ * straight through and a pick in the modal holds until OK.
186
+ */
187
+ function DatePickerDialog(t0) {
188
+ const $ = c(43);
189
+ const { cancelLabel, confirmLabel, label, selectDateLabel, showMonthYearMenus, visibleDuration } = t0;
190
+ const calendar = useSlottedContext(CalendarContext);
191
+ const state = useContext(DatePickerStateContext);
192
+ let t1;
193
+ if ($[0] !== state?.dateValue) {
194
+ t1 = () => state?.dateValue ?? null;
195
+ $[0] = state?.dateValue;
196
+ $[1] = t1;
197
+ } else t1 = $[1];
198
+ const [draft, setDraft] = useState(t1);
199
+ const actions = useRef(null);
200
+ const t2 = draft?.calendar.identifier;
201
+ let t3;
202
+ if ($[2] !== t2) {
203
+ t3 = {
204
+ calendar: t2,
205
+ day: "numeric",
206
+ month: "short",
207
+ timeZone: "UTC",
208
+ weekday: "short"
209
+ };
210
+ $[2] = t2;
211
+ $[3] = t3;
212
+ } else t3 = $[3];
213
+ const formatter = useDateFormatter(t3);
214
+ let t4;
215
+ if ($[4] !== state) {
216
+ t4 = (date) => {
217
+ if (!("calendar" in date)) return;
218
+ setDraft(date);
219
+ if (actions.current?.checkVisibility() !== true) state?.setDateValue(date);
220
+ };
221
+ $[4] = state;
222
+ $[5] = t4;
223
+ } else t4 = $[5];
224
+ const pick = t4;
225
+ let t5;
226
+ if ($[6] !== draft || $[7] !== state) {
227
+ t5 = () => {
228
+ if (draft !== null) state?.setDateValue(draft);
229
+ };
230
+ $[6] = draft;
231
+ $[7] = state;
232
+ $[8] = t5;
233
+ } else t5 = $[8];
234
+ const confirm = t5;
235
+ let t6;
236
+ if ($[9] !== calendar || $[10] !== draft || $[11] !== pick) {
237
+ t6 = {
238
+ ...calendar,
239
+ onChange: pick,
240
+ value: draft
241
+ };
242
+ $[9] = calendar;
243
+ $[10] = draft;
244
+ $[11] = pick;
245
+ $[12] = t6;
246
+ } else t6 = $[12];
247
+ const drafted = t6;
248
+ let t7;
249
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
250
+ t7 = props(overlay.popupDialog, focus.ring);
251
+ $[13] = t7;
252
+ } else t7 = $[13];
253
+ let t8;
254
+ if ($[14] !== selectDateLabel) {
255
+ t8 = /* @__PURE__ */ jsx("div", {
256
+ className: "xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4",
257
+ children: selectDateLabel
258
+ });
259
+ $[14] = selectDateLabel;
260
+ $[15] = t8;
261
+ } else t8 = $[15];
262
+ let t9;
263
+ if ($[16] !== draft || $[17] !== formatter) {
264
+ t9 = draft === null ? null : formatter.format(toCalendarDate(draft).toDate("UTC"));
265
+ $[16] = draft;
266
+ $[17] = formatter;
267
+ $[18] = t9;
268
+ } else t9 = $[18];
269
+ let t10;
270
+ if ($[19] !== t9) {
271
+ t10 = /* @__PURE__ */ jsx("div", {
272
+ className: "x1vsmgmf xh9c4x x1y15vu6 xoqu3bc x10x9d6x xsv2w1p",
273
+ children: t9
274
+ });
275
+ $[19] = t9;
276
+ $[20] = t10;
277
+ } else t10 = $[20];
278
+ let t11;
279
+ if ($[21] !== t10 || $[22] !== t8) {
280
+ t11 = /* @__PURE__ */ jsxs("div", {
281
+ className: "x1wkxgih x1j6faob x1q0q8m5 xso031l x9f619 x1w5n3ug x1s85apg x37i4ze xdt5ytf x1qughib x1ux19a9 x1clyivc xk163s x1kdgbu8",
282
+ children: [t8, t10]
283
+ });
284
+ $[21] = t10;
285
+ $[22] = t8;
286
+ $[23] = t11;
287
+ } else t11 = $[23];
288
+ let t12;
289
+ if ($[24] !== label || $[25] !== showMonthYearMenus || $[26] !== visibleDuration) {
290
+ t12 = /* @__PURE__ */ jsx(Calendar$1, {
291
+ "aria-label": label,
292
+ showMonthYearMenus,
293
+ visibleDuration
294
+ });
295
+ $[24] = label;
296
+ $[25] = showMonthYearMenus;
297
+ $[26] = visibleDuration;
298
+ $[27] = t12;
299
+ } else t12 = $[27];
300
+ let t13;
301
+ if ($[28] !== drafted || $[29] !== t12) {
302
+ t13 = /* @__PURE__ */ jsx(CalendarContext.Provider, {
303
+ value: drafted,
304
+ children: t12
305
+ });
306
+ $[28] = drafted;
307
+ $[29] = t12;
308
+ $[30] = t13;
309
+ } else t13 = $[30];
310
+ let t14;
311
+ if ($[31] !== cancelLabel) {
312
+ t14 = /* @__PURE__ */ jsx(Button$1, {
313
+ slot: "close",
314
+ variant: "text",
315
+ children: cancelLabel
316
+ });
317
+ $[31] = cancelLabel;
318
+ $[32] = t14;
319
+ } else t14 = $[32];
320
+ let t15;
321
+ if ($[33] !== confirm || $[34] !== confirmLabel) {
322
+ t15 = /* @__PURE__ */ jsx(Button$1, {
323
+ onPress: confirm,
324
+ slot: "close",
325
+ variant: "text",
326
+ children: confirmLabel
327
+ });
328
+ $[33] = confirm;
329
+ $[34] = confirmLabel;
330
+ $[35] = t15;
331
+ } else t15 = $[35];
332
+ let t16;
333
+ if ($[36] !== t14 || $[37] !== t15) {
334
+ t16 = /* @__PURE__ */ jsxs("div", {
335
+ ref: actions,
336
+ className: "x9f619 x1s85apg x37i4ze x126z3so x13a6bvl xqf7pud xk163s",
337
+ children: [t14, t15]
338
+ });
339
+ $[36] = t14;
340
+ $[37] = t15;
341
+ $[38] = t16;
342
+ } else t16 = $[38];
343
+ let t17;
344
+ if ($[39] !== t11 || $[40] !== t13 || $[41] !== t16) {
345
+ t17 = /* @__PURE__ */ jsxs(Dialog, {
346
+ ...t7,
347
+ children: [
348
+ t11,
349
+ t13,
350
+ t16
156
351
  ]
157
352
  });
158
- $[24] = T0;
159
- $[25] = isDisabled;
160
- $[26] = props$1;
161
- $[27] = t11;
162
- $[28] = t12;
163
- $[29] = t15;
164
- $[30] = t5;
165
- $[31] = t6;
166
- $[32] = validationBehavior;
167
- $[33] = t16;
168
- } else t16 = $[33];
169
- return t16;
353
+ $[39] = t11;
354
+ $[40] = t13;
355
+ $[41] = t16;
356
+ $[42] = t17;
357
+ } else t17 = $[42];
358
+ return t17;
170
359
  }
171
360
  export { DatePicker as default };
172
361
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","DatePicker","RACDatePicker","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","datePopoverClassName","picker","triggerClassName","container","description","error","floatingLabel","label","leadingIcon","showMonthYearMenus","triggerLabel","variant","visibleDuration","calendarTrigger","props","triggerGlyph","t0","$","t1","isDisabled","t2","t3","t4","undefined","validationBehavior","T0","t5","t6","root","t7","isRequired","t8","t9","Symbol","for","group","t10","input","t11","t12","t13","popupDialog","ring","t14","t15","t16","RACButton","RACGroup","RACDateInput","RACDialog","Calendar","RACPopover"],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DateDuration } from '@internationalized/date';\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { datePopoverClassName, picker, triggerClassName } from '../../styles/picker';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws: below the breakpoint the picker is a dialog,\n// centred over a scrim, and `Sheet` changes presentation at the same width.\n// It is done in CSS rather than by rendering a different tree: a 360dp\n// calendar anchored to a field is unreachable at 375px, and a modal that\n// stayed centred on a desktop would cover a form for no reason. `Sheet`\n// settles its own swap the same way, and doing it twice in two different\n// ways is how the two would drift. The styles are in `src/styles/picker.ts`.\n\ntype DatePickerProps<T extends DateValue = DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /**\n * Where to portal the calendar. Defaults to the container of the `ThemeScope`\n * around it, which keeps the calendar on that scope's tokens, or to the end\n * of `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the calendar\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * Whether the calendar's header draws the month and the year as menu\n * buttons, each opening a list of them in the grid's place — see\n * `Calendar`.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Calendar\" in\n * English, followed by the field's own label.\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n /**\n * How much of the calendar shows at once: `{ months: 2 }` draws two\n * months side by side. Below the expanded breakpoint, where two do not\n * fit, they stack instead — see `Calendar`.\n * @default { months: 1 }\n */\n visibleDuration?: DateDuration;\n};\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason Select builds its\n// chevron this way.\nfunction calendarTrigger(triggerLabel: string | undefined) {\n return <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, which is the page's modal picker.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n showMonthYearMenus = false,\n triggerLabel,\n variant = 'filled',\n visibleDuration,\n ...props\n}: DatePickerProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // In the chrome's trailing slot rather than on the segments' line,\n // which is where Select and ComboBox put their chevron. The slot\n // cancels the box's top padding and stretches to its full height, so\n // it centres the 40dp trigger in the box; on the line the trigger\n // was taller than the row that held it and hung past the underline,\n // and the segments centred on it rather than on their own line.\n //\n // React Aria's `DatePicker` is what gives the trigger its press\n // behaviour, through context, so the slot reaches it as well as the\n // group did.\n trailing={calendarTrigger(triggerLabel)} variant={variant}>\n <FieldSegments>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </RACGroup>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={datePopoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <Calendar aria-label={label} showMonthYearMenus={showMonthYearMenus} visibleDuration={visibleDuration} />\n </RACDialog>\n </RACPopover>\n </RACDatePicker>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;AA4GA,SAASyB,gBAAgBH,cAAkC;CACzD,OAAO,oBAACoC,QAAD;EAAW,cAAYpC;EAAc,WAAWR;EACnD,UAAA,oBAAC,eAAD,EAAe,GAAIb,MAAaY,OAAOc,YAAY,EAAE,CAAA;CAC5C,CAAA;AACf;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAAzB,WAAA0B,IAAA;CAAA,MAAAC,IAAA7B,EAAA,EAAA;CAAyC,MAAA,EAAAe,WAAAC,aAAAC,OAAAC,eAAAY,IAAAC,YAAAC,IAAAb,OAAAC,aAAAC,oBAAAY,IAAAX,cAAAC,SAAAW,IAAAV,iBAAA,GAAAE,YAAAE;CAIvC,MAAAV,gBAAAY,OAAAK,KAAAA,IAAA,OAAAL;CACA,MAAAC,aAAAC,OAAAG,KAAAA,IAAA,QAAAH;CAGA,MAAAX,qBAAAY,OAAAE,KAAAA,IAAA,QAAAF;CAEA,MAAAV,UAAAW,OAAAC,KAAAA,IAAA,WAAAD;CAIA,MAAAE,qBAA2B9B,2BAA2B;CAC9C,MAAA+B,KAAAlC;CAAa,IAAAmC;CAAA,IAAAT,EAAA,OAAAZ,OAAA;EAAuCqB,KAAAjC,YAAYY,KAAK;EA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GAA8B1B;GAAuB,WAAAO;GAAwCF;GAAkB,GAAMV;GAAK,GAAMa;GAAhI,UAAA;IACHW;IA8BAC;IACAK;GAhCiB;;EAuCH3B,EAAA,MAAAQ;EAAAR,EAAA,MAAAE;EAAAF,EAAA,MAAAH;EAAAG,EAAA,MAAAqB;EAAArB,EAAA,MAAAsB;EAAAtB,EAAA,MAAA2B;EAAA3B,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAO;EAAAP,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,OAvCX4B;AAuCW"}
1
+ {"version":3,"file":"index.js","names":["_c","toCalendarDate","stylex","useContext","useRef","useState","useDateFormatter","CalendarContext","DatePickerStateContext","DatePicker","RACDatePicker","useSlottedContext","fieldStyles","invalidFrom","useFieldValidationBehavior","useDockedMonths","useMessages","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","datePopoverClassName","picker","triggerClassName","cancelLabel","confirmLabel","container","description","error","floatingLabel","label","leadingIcon","selectDateLabel","showMonthYearMenus","triggerLabel","variant","visibleDuration","calendarTrigger","props","triggerGlyph","t0","$","t1","isDisabled","t2","t3","t4","undefined","validationBehavior","messages","months","T0","t5","t6","root","t7","isRequired","t8","t9","Symbol","for","group","t10","input","t11","t12","t13","cancel","t14","confirm","t15","selectDate","t16","t17","t18","DatePickerDialog","calendar","state","dateValue","draft","setDraft","actions","identifier","day","month","timeZone","weekday","formatter","date","current","checkVisibility","setDateValue","pick","onChange","value","drafted","popupDialog","ring","format","toDate","RACButton","RACGroup","RACDateInput","RACPopover","Calendar","Button","RACDialog"],"sources":["../../../src/components/date-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DateDuration } from '@internationalized/date';\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DatePickerProps as RACDatePickerProps } from 'react-aria-components';\nimport { toCalendarDate } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { CalendarContext, DatePickerStateContext, Button as RACButton, DateInput as RACDateInput, DatePicker as RACDatePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover, useSlottedContext } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { useDockedMonths } from '../../hooks/useDockedMonths';\nimport { useMessages } from '../../i18n';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { datePopoverClassName, picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Button from '../button';\nimport Calendar from '../calendar';\n\n// The date pickers page's picker: the date field a date is typed into, with\n// a calendar behind a button for picking it instead. Both halves already\n// exist — the segments are `DateField`'s, from `src/segments`, and the\n// calendar is `Calendar` — so what this adds is the button between them and\n// the surface the calendar opens on.\n//\n// Two things are this component's own.\n//\n// **The picker is one field, not a field beside a button.** React Aria's\n// `Group` is what holds the segments and the trigger together, so the box\n// draws once around both and a reader tabs through the segments and reaches\n// the button at the end of them rather than as a separate control.\n//\n// **It is docked above the medium breakpoint and modal below it**, which is\n// the pairing the page draws: below the breakpoint the picker is a dialog,\n// centred over a scrim, and `Sheet` changes presentation at the same width.\n// It is done in CSS rather than by rendering a different tree: a 360dp\n// calendar anchored to a field is unreachable at 375px, and a modal that\n// stayed centred on a desktop would cover a form for no reason. `Sheet`\n// settles its own swap the same way, and doing it twice in two different\n// ways is how the two would drift. The styles are in `src/styles/picker.ts`.\n//\n// **The modal is the page's modal picker, not the docked calendar centred.**\n// Below the breakpoint the calendar opens under the modal's header — the\n// `Select date` supporting text in label-large over the date held in\n// headline-large, both on surface variant, in a 120dp header padded 24dp at\n// its start, 12dp at its end, 16dp above and 12dp below, with an outline\n// variant divider under it — and over the Cancel and OK text buttons at the\n// actions' end. A date picked there is a draft: it moves the headline and\n// the selection and nothing else, OK writes it into the field, and Cancel,\n// Escape or a press on the scrim close the modal with the field as it was.\n// Docked, the header and the actions are not drawn and a pick is the answer.\n//\n// The header and the actions are hidden above the breakpoint by the same\n// media query that moves the surface, and a pick asks whether the actions\n// are on screen to know which of the two it was made in. That keeps the\n// breakpoint in the stylesheet alone, rather than spelled again for\n// `matchMedia`, so what is drawn and what a pick does cannot disagree about\n// which picker is showing.\n//\n// Two departures from the page's modal. It draws no button switching the\n// modal to a text input, since the field under the scrim is that input. And\n// with nothing yet picked the headline is left empty rather than holding\n// words of its own, the header keeping its height.\n\n// The page's height for the modal picker's header.\nconst HEADER_BLOCK_SIZE = '120px';\ntype DatePickerProps<T extends DateValue = DateValue> = Omit<RACDatePickerProps<T>, 'children' | 'className' | 'style'> & {\n /**\n * What the modal's dismissing action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"Cancel\" in English.\n */\n cancelLabel?: string;\n /** A function may compute the class from the picker's render state. */\n className?: RACDatePickerProps<T>['className'];\n /**\n * What the modal's confirming action says. Left out, it is the word for\n * it in the I18nProvider's locale — \"OK\" in English.\n */\n confirmLabel?: string;\n /**\n * Where to portal the calendar. Defaults to the container of the `ThemeScope`\n * around it, which keeps the calendar on that scope's tokens, or to the end\n * of `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the calendar\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * The modal's supporting text, above the date it holds. Left out, it is\n * the I18nProvider's locale's — \"Select date\" in English.\n */\n selectDateLabel?: string;\n /**\n * Whether the calendar's header draws the month and the year as menu\n * buttons, each opening a list of them in the grid's place — see\n * `Calendar`.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the picker's render state. */\n style?: RACDatePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Calendar\" in\n * English, followed by the field's own label.\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n /**\n * How much of the calendar shows at once: `{ months: 2 }` draws two\n * months side by side. Below the expanded breakpoint, where two do not\n * fit, they stack instead — see `Calendar` — in the modal; docked, above\n * the medium breakpoint, the calendar shows one month at a time there,\n * since two stacked are taller than the room under the field.\n * @default { months: 1 }\n */\n visibleDuration?: DateDuration;\n};\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason Select builds its\n// chevron this way.\nfunction calendarTrigger(triggerLabel: string | undefined) {\n return <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/**\n * A date typed into a field, or picked from a calendar behind a button. The\n * value is React Aria's — pass `value` with `onChange` to control it, or\n * `defaultValue` — as an `@internationalized/date` value from this package's\n * `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DatePicker defaultValue={new CalendarDate(2026, 9, 15)} label=\"Label\" />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `Calendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field and a pick is the answer; below it, it opens centred as the\n * page's modal picker, under a headline holding the date picked, and only\n * its OK writes that date into the field.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DatePicker<T extends DateValue>({\n cancelLabel,\n confirmLabel,\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n selectDateLabel,\n showMonthYearMenus = false,\n triggerLabel,\n variant = 'filled',\n visibleDuration,\n ...props\n}: DatePickerProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n const messages = useMessages();\n const months = useDockedMonths(visibleDuration);\n return <RACDatePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden `<input type=\"date\">` carrying no placeholder, so the CSS\n // half reads as populated on its own; the React half reads React\n // Aria's input context, which a picker does not provide. Without\n // this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // In the chrome's trailing slot rather than on the segments' line,\n // which is where Select and ComboBox put their chevron. The slot\n // cancels the box's top padding and stretches to its full height, so\n // it centres the 40dp trigger in the box; on the line the trigger\n // was taller than the row that held it and hung past the underline,\n // and the segments centred on it rather than on their own line.\n //\n // React Aria's `DatePicker` is what gives the trigger its press\n // behaviour, through context, so the slot reaches it as well as the\n // group did.\n trailing={calendarTrigger(triggerLabel)} variant={variant}>\n <FieldSegments>\n <RACGroup {...stylex.props(picker.group)}>\n <RACDateInput {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </RACGroup>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={datePopoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <DatePickerDialog cancelLabel={cancelLabel ?? messages.cancel} confirmLabel={confirmLabel ?? messages.confirm} label={label} selectDateLabel={selectDateLabel ?? messages.selectDate} showMonthYearMenus={showMonthYearMenus} visibleDuration={months} />\n </RACPopover>\n </RACDatePicker>;\n}\n\n/**\n * The surface's content, mounted each time the calendar opens: the date it\n * was opened on is its draft, which a pick in the docked calendar writes\n * straight through and a pick in the modal holds until OK.\n */\nfunction DatePickerDialog({\n cancelLabel,\n confirmLabel,\n label,\n selectDateLabel,\n showMonthYearMenus,\n visibleDuration\n}: {\n cancelLabel: string;\n confirmLabel: string;\n label: string;\n selectDateLabel: string;\n showMonthYearMenus: boolean;\n visibleDuration: DateDuration | undefined;\n}) {\n // What React Aria's picker hands its calendar — the bounds, the date it\n // holds, and an `onChange` that writes a date into the field and closes\n // the surface — and the picker's state, which holds the date and writes\n // one the same way. The calendar is handed the same props with the draft\n // in place of the date and of `onChange`, so the picker stays the one\n // owner of its value and its `onChange` stays React Aria's own.\n const calendar = useSlottedContext(CalendarContext);\n const state = useContext(DatePickerStateContext);\n const [draft, setDraft] = useState(() => state?.dateValue ?? null);\n const actions = useRef<HTMLDivElement>(null);\n const formatter = useDateFormatter({\n calendar: draft?.calendar.identifier,\n day: 'numeric',\n month: 'short',\n timeZone: 'UTC',\n weekday: 'short'\n });\n\n // A calendar's `onChange` is typed for a calendar selecting several dates\n // as well as one; the picker's selects one, so a list never arrives.\n const pick = useCallback((date: DateValue | readonly DateValue[]) => {\n if (!('calendar' in date)) {\n return;\n }\n setDraft(date);\n if (actions.current?.checkVisibility() !== true) {\n state?.setDateValue(date);\n }\n }, [state]);\n\n // OK writes the draft through the picker's state, and its `slot` closes\n // the surface after, which is all Cancel does.\n const confirm = useCallback(() => {\n if (draft !== null) {\n state?.setDateValue(draft);\n }\n }, [draft, state]);\n const drafted = useMemo(() => ({\n ...calendar,\n onChange: pick,\n value: draft\n }), [calendar, draft, pick]);\n return <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <div className=\"x1wkxgih x1j6faob x1q0q8m5 xso031l x9f619 x1w5n3ug x1s85apg x37i4ze xdt5ytf x1qughib x1ux19a9 x1clyivc xk163s x1kdgbu8\">\n <div className=\"xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\">{selectDateLabel}</div>\n <div className=\"x1vsmgmf xh9c4x x1y15vu6 xoqu3bc x10x9d6x xsv2w1p\">\n {draft === null ? null : formatter.format(toCalendarDate(draft).toDate('UTC'))}\n </div>\n </div>\n <CalendarContext.Provider value={drafted}>\n <Calendar aria-label={label} showMonthYearMenus={showMonthYearMenus} visibleDuration={visibleDuration} />\n </CalendarContext.Provider>\n <div ref={actions} className=\"x9f619 x1s85apg x37i4ze x126z3so x13a6bvl xqf7pud xk163s\">\n <Button slot=\"close\" variant=\"text\">\n {cancelLabel}\n </Button>\n <Button onPress={confirm} slot=\"close\" variant=\"text\">\n {confirmLabel}\n </Button>\n </div>\n </RACDialog>;\n}\nexport type { DatePickerProps };\nexport default DatePicker;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8JA,SAASsC,gBAAgBH,cAAkC;CACzD,OAAO,oBAACkE,QAAD;EAAW,cAAYlE;EAAc,WAAWX;EACnD,UAAA,oBAAC,eAAD,EAAe,GAAItB,MAAaqB,OAAOiB,YAAY,EAAE,CAAA;CAC5C,CAAA;AACf;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAA/B,WAAAgC,IAAA;CAAA,MAAAC,IAAA1C,EAAA,EAAA;CAAyC,MAAA,EAAAyB,aAAAC,cAAAC,WAAAC,aAAAC,OAAAC,eAAAa,IAAAC,YAAAC,IAAAd,OAAAC,aAAAC,iBAAAC,oBAAAY,IAAAX,cAAAC,SAAAW,IAAAV,iBAAA,GAAAE,YA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AAf,UAAA;IACHS;IAMAE;IAGAM;GAVa;;EAkBH/B,EAAA,MAAAuB;EAAAvB,EAAA,MAAAyB;EAAAzB,EAAA,MAAA+B;EAAA/B,EAAA,MAAAgC;CAAA,OAAAA,MAAAhC,EAAA;CAAA,OAlBPgC;AAkBO"}
@@ -67,7 +67,9 @@ type DateRangePickerProps<T extends DateValue = DateValue> = Omit<DateRangePicke
67
67
  * How much of the calendar shows at once: `{ months: 2 }` draws two
68
68
  * months side by side, which is what a range is usually picked from.
69
69
  * Below the expanded breakpoint, where two do not fit, they stack instead
70
- * — see `RangeCalendar`.
70
+ * — see `RangeCalendar` — in the modal; docked, above the medium
71
+ * breakpoint, the calendar shows one month at a time there, since two
72
+ * stacked are taller than the room under the field.
71
73
  * @default { months: 1 }
72
74
  */
73
75
  visibleDuration?: DateDuration;
@@ -3,6 +3,7 @@ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { FieldBox, FieldMessage, FieldSegments } from "../../field/index.js";
4
4
  import { fieldStyles, invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
5
5
  import { CalendarGlyph } from "../../glyphs/index.js";
6
+ import { useDockedMonths } from "../../hooks/useDockedMonths.js";
6
7
  import { renderSegment } from "../../segments/index.js";
7
8
  import { segmentStyles } from "../../segments/styles.js";
8
9
  import { focus } from "../../styles/focus.js";
@@ -62,6 +63,7 @@ function DateRangePicker(t0) {
62
63
  const showMonthYearMenus = t4 === void 0 ? false : t4;
63
64
  const variant = t5 === void 0 ? "filled" : t5;
64
65
  const validationBehavior = useFieldValidationBehavior();
66
+ const months = useDockedMonths(visibleDuration);
65
67
  const [group, setGroup] = useState(null);
66
68
  const wrapped = useEndDateWrap(group);
67
69
  const T0 = DateRangePicker$1;
@@ -178,18 +180,18 @@ function DateRangePicker(t0) {
178
180
  $[28] = t18;
179
181
  } else t18 = $[28];
180
182
  let t19;
181
- if ($[29] !== label || $[30] !== showMonthYearMenus || $[31] !== visibleDuration) {
183
+ if ($[29] !== label || $[30] !== months || $[31] !== showMonthYearMenus) {
182
184
  t19 = /* @__PURE__ */ jsx(Dialog, {
183
185
  ...t18,
184
186
  children: /* @__PURE__ */ jsx(RangeCalendar$1, {
185
187
  "aria-label": label,
186
188
  showMonthYearMenus,
187
- visibleDuration
189
+ visibleDuration: months
188
190
  })
189
191
  });
190
192
  $[29] = label;
191
- $[30] = showMonthYearMenus;
192
- $[31] = visibleDuration;
193
+ $[30] = months;
194
+ $[31] = showMonthYearMenus;
193
195
  $[32] = t19;
194
196
  } else t19 = $[32];
195
197
  let t20;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","useLayoutEffect","useState","DateRangePicker","RACDateRangePicker","fieldStyles","invalidFrom","useFieldValidationBehavior","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","datePopoverClassName","picker","triggerClassName","styles","groupWrapped","kwnvtZ","khm7nJ","$$css","container","description","error","floatingLabel","label","leadingIcon","separator","showMonthYearMenus","triggerLabel","variant","visibleDuration","calendarTrigger","props","triggerGlyph","t0","$","t1","isDisabled","t2","t3","t4","t5","undefined","validationBehavior","group","setGroup","wrapped","useEndDateWrap","T0","t6","t7","root","t8","isRequired","t9","t10","t11","Symbol","for","input","t12","t13","t14","t15","t16","t17","t18","popupDialog","ring","t19","t20","t21","setWrapped","decidedAt","measure","room","getBoundingClientRect","width","parts","children","filter","_temp","gap","Number","parseFloat","getComputedStyle","columnGap","needs","reduce","_temp2","length","fits","redecide","resize","ResizeObserver","observe","part_1","part","document","fonts","addEventListener","disconnect","removeEventListener","sum","part_0","height","RACButton","RACDateInput","RACGroup","RACDialog","RangeCalendar","RACPopover"],"sources":["../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DateDuration } from '@internationalized/date';\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DateRangePickerProps as RACDateRangePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLayoutEffect, useState } from 'react';\nimport { Button as RACButton, DateInput as RACDateInput, DateRangePicker as RACDateRangePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { datePopoverClassName, picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\nimport RangeCalendar from '../range-calendar';\n\n// `DatePicker` picking two dates rather than one. Every part it draws is\n// already here — the segments from `src/segments`, the trigger and the\n// overlay from `src/styles/picker`, the calendar from `RangeCalendar` — so\n// the two pickers cannot come apart. What a range adds is a second segment\n// group and the dash between them.\n//\n// The date pickers page draws a range as a configuration of the *modal*\n// picker: a full-screen selector with a header and two text fields, plus a\n// modal date input variant. It carries no docked range picker and no range\n// token of its own — its token set is `docked.*` and `modal.*`, and neither\n// names a range. So the docked shape here follows the docked single picker,\n// the same choice `RangeCalendar` records for the band it draws.\n//\n// Two things are this component's own.\n//\n// **The dash is decoration, not content.** It reads as a range to someone\n// looking, and React Aria has already told a screen reader which group is\n// which — every segment is named \"Start Date\" or \"End Date\" — so repeating\n// it aloud would be a third telling. It is `aria-hidden` and takes the muted\n// role, which is what keeps it quieter than the dates either side.\n//\n// **Both segment groups and the trigger sit in one React Aria `Group`.** The\n// box draws once around all three, so a reader tabs start, end, trigger\n// rather than meeting three controls in a row.\n//\n// **The end date takes a line of its own where the two do not fit on one.**\n// The line the segments sit on clips them, as an input clips its text, and\n// two dates and the dash are wider than a phone's field: at 328px the empty\n// field showed 212px of the 281px its placeholders take, so most of the end\n// date was out of sight until it was typed in. Every segment is a place to\n// type, so none can be hidden, and shortening the placeholders would not hold\n// for a locale whose dates are longer. So the two groups wrap, the dash stays\n// after the start date, and the box grows by a line, as a text area's does,\n// from the page's 56dp. Where both fit, nothing moves: the box is 56dp and\n// the dates share their line.\n//\n// The wrap is decided by the line's width, and typing never undoes it. A date\n// is narrower filled than empty — `9` where `mm` was — so a field between the\n// two widths, which is where a 375 to 400px phone puts it, would otherwise\n// lift the end date back up beside the start and shrink the box while the\n// start date was being typed. So the end date goes onto its own line whenever\n// the three stop fitting, and comes back only when the line's width changes\n// or a font arrives — see `useEndDateWrap`.\n\nconst styles = {\n groupWrapped: {\n kwnvtZ: \"x1a02dak\",\n khm7nJ: \"xxs79tx\",\n $$css: true\n }\n};\ntype DateRangePickerProps<T extends DateValue = DateValue> = Omit<RACDateRangePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDateRangePickerProps<T>['className'];\n /**\n * Where to portal the calendar. Defaults to the container of the `ThemeScope`\n * around it, which keeps the calendar on that scope's tokens, or to the end\n * of `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the calendar\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * What is drawn between the two segment groups. Decoration — a screen\n * reader is told which group is which by React Aria.\n * @default '–'\n */\n separator?: string;\n /**\n * Whether the calendar's header draws the month and the year as menu\n * buttons, each opening a list of them in the grid's place — see\n * `RangeCalendar`.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the picker's render state. */\n style?: RACDateRangePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Calendar\" in\n * English, followed by the field's own label.\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n /**\n * How much of the calendar shows at once: `{ months: 2 }` draws two\n * months side by side, which is what a range is usually picked from.\n * Below the expanded breakpoint, where two do not fit, they stack instead\n * — see `RangeCalendar`.\n * @default { months: 1 }\n */\n visibleDuration?: DateDuration;\n};\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason Select builds its\n// chevron this way.\nfunction calendarTrigger(triggerLabel: string | undefined) {\n return <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/**\n * A date range typed into a field, or picked from a calendar behind a\n * button. The value is React Aria's — pass `value` with `onChange` to\n * control it, or `defaultValue` — as a `{ start, end }` pair of\n * `@internationalized/date` values from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateRangePicker\n * defaultValue={{\n * end: new CalendarDate(2026, 9, 20),\n * start: new CalendarDate(2026, 9, 15),\n * }}\n * label=\"Label\"\n * />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `RangeCalendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, the same swap `DatePicker` makes.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DateRangePicker<T extends DateValue>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n separator = '–',\n showMonthYearMenus = false,\n triggerLabel,\n variant = 'filled',\n visibleDuration,\n ...props\n}: DateRangePickerProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n const [group, setGroup] = useState<HTMLDivElement | null>(null);\n const wrapped = useEndDateWrap(group);\n return <RACDateRangePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden input per segment group, neither carrying a placeholder, so\n // the CSS half reads as populated on its own; the React half reads\n // React Aria's input context, which a picker does not provide.\n // Without this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // Grows by a line while the end date is on one of its own, and is\n // the page's 56dp otherwise — see the header.\n multiline\n // In the chrome's trailing slot rather than on the segments' line —\n // see the same prop on DatePicker for what that slot does and why\n // the trigger still opens from there.\n trailing={calendarTrigger(triggerLabel)} variant={variant}>\n <FieldSegments>\n <RACGroup ref={setGroup} {...stylex.props(picker.group, wrapped && styles.groupWrapped)}>\n <RACDateInput slot=\"start\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <span aria-hidden=\"true\" className=\"x1w5n3ug x2lah0s x16svsjw x1848etk xh7dzej\">\n {separator}\n </span>\n {wrapped && <span aria-hidden=\"true\" className=\"xqtp20y x9f619 x1l7klhg\" />}\n <RACDateInput slot=\"end\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </RACGroup>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={datePopoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <RangeCalendar aria-label={label} showMonthYearMenus={showMonthYearMenus} visibleDuration={visibleDuration} />\n </RACDialog>\n </RACPopover>\n </RACDateRangePicker>;\n}\n\n/**\n * Whether the end date takes a line of its own: whenever the start date, the\n * dash and the end date are wider together than the line they sit on.\n *\n * Decided afresh when the line's width changes or a font finishes loading,\n * and otherwise only ever turned on, so a date narrowing as it is typed\n * never moves the end date back up mid-entry — see the header. Read off the\n * three parts' own widths rather than the line's overflow, since a wrapped\n * line overflows nothing.\n */\nfunction useEndDateWrap(group: HTMLElement | null) {\n const [wrapped, setWrapped] = useState(false);\n useLayoutEffect(() => {\n if (group === null) {\n return undefined;\n }\n let decidedAt: null | number = null;\n const measure = () => {\n const room = group.getBoundingClientRect().width;\n // React Aria's hidden inputs sit in the group too, and so does the\n // break while the end date is held down. Neither takes a line's height,\n // and neither is a part the line has to hold.\n const parts = [...group.children].filter(part => part.getBoundingClientRect().height > 0);\n const gap = Number.parseFloat(getComputedStyle(group).columnGap) || 0;\n const needs = parts.reduce((sum, part) => sum + part.getBoundingClientRect().width, gap * (parts.length - 1));\n const fits = needs <= room + 0.5;\n if (room !== decidedAt) {\n decidedAt = room;\n setWrapped(!fits);\n } else if (!fits) {\n setWrapped(true);\n }\n };\n const redecide = () => {\n decidedAt = null;\n measure();\n };\n measure();\n const resize = new ResizeObserver(measure);\n resize.observe(group);\n for (const part of group.children) {\n resize.observe(part);\n }\n document.fonts.addEventListener('loadingdone', redecide);\n return () => {\n resize.disconnect();\n document.fonts.removeEventListener('loadingdone', redecide);\n };\n }, [group]);\n return wrapped;\n}\nexport type { DateRangePickerProps };\nexport default DateRangePicker;"],"mappings":";;;;;;;;;;;;;;;;;AAkEA,MAAMiB,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA2EA,SAASY,gBAAgBH,cAAkC;CACzD,OAAO,oBAAC8E,QAAD;EAAW,cAAY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ker","RACDateRangePicker","fieldStyles","invalidFrom","useFieldValidationBehavior","useDockedMonths","renderSegment","segmentStyles","focus","mergeStatefulStyles","overlay","datePopoverClassName","picker","triggerClassName","styles","groupWrapped","kwnvtZ","khm7nJ","$$css","container","description","error","floatingLabel","label","leadingIcon","separator","showMonthYearMenus","triggerLabel","variant","visibleDuration","calendarTrigger","props","triggerGlyph","t0","$","t1","isDisabled","t2","t3","t4","t5","undefined","validationBehavior","months","group","setGroup","wrapped","useEndDateWrap","T0","t6","t7","root","t8","isRequired","t9","t10","t11","Symbol","for","input","t12","t13","t14","t15","t16","t17","t18","popupDialog","ring","t19","t20","t21","setWrapped","decidedAt","measure","room","getBoundingClientRect","width","parts","children","filter","_temp","gap","Number","parseFloat","getComputedStyle","columnGap","needs","reduce","_temp2","length","fits","redecide","resize","ResizeObserver","observe","part_1","part","document","fonts","addEventListener","disconnect","removeEventListener","sum","part_0","height","RACButton","RACDateInput","RACGroup","RACDialog","RangeCalendar","RACPopover"],"sources":["../../../src/components/date-range-picker/index.tsx"],"sourcesContent":["'use client';\n\nimport type { DateDuration } from '@internationalized/date';\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { DateValue, DateRangePickerProps as RACDateRangePickerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useLayoutEffect, useState } from 'react';\nimport { Button as RACButton, DateInput as RACDateInput, DateRangePicker as RACDateRangePicker, Dialog as RACDialog, Group as RACGroup, Popover as RACPopover } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldMessage, FieldSegments } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { CalendarGlyph } from '../../glyphs';\nimport { useDockedMonths } from '../../hooks/useDockedMonths';\nimport { renderSegment } from '../../segments';\nimport { segmentStyles } from '../../segments/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport { datePopoverClassName, picker, triggerClassName } from '../../styles/picker';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\nimport RangeCalendar from '../range-calendar';\n\n// `DatePicker` picking two dates rather than one. Every part it draws is\n// already here — the segments from `src/segments`, the trigger and the\n// overlay from `src/styles/picker`, the calendar from `RangeCalendar` — so\n// the two pickers cannot come apart. What a range adds is a second segment\n// group and the dash between them.\n//\n// The date pickers page draws a range as a configuration of the *modal*\n// picker: a full-screen selector with a header and two text fields, plus a\n// modal date input variant. It carries no docked range picker and no range\n// token of its own — its token set is `docked.*` and `modal.*`, and neither\n// names a range. So the docked shape here follows the docked single picker,\n// the same choice `RangeCalendar` records for the band it draws.\n//\n// Two things are this component's own.\n//\n// **The dash is decoration, not content.** It reads as a range to someone\n// looking, and React Aria has already told a screen reader which group is\n// which — every segment is named \"Start Date\" or \"End Date\" — so repeating\n// it aloud would be a third telling. It is `aria-hidden` and takes the muted\n// role, which is what keeps it quieter than the dates either side.\n//\n// **Both segment groups and the trigger sit in one React Aria `Group`.** The\n// box draws once around all three, so a reader tabs start, end, trigger\n// rather than meeting three controls in a row.\n//\n// **The end date takes a line of its own where the two do not fit on one.**\n// The line the segments sit on clips them, as an input clips its text, and\n// two dates and the dash are wider than a phone's field: at 328px the empty\n// field showed 212px of the 281px its placeholders take, so most of the end\n// date was out of sight until it was typed in. Every segment is a place to\n// type, so none can be hidden, and shortening the placeholders would not hold\n// for a locale whose dates are longer. So the two groups wrap, the dash stays\n// after the start date, and the box grows by a line, as a text area's does,\n// from the page's 56dp. Where both fit, nothing moves: the box is 56dp and\n// the dates share their line.\n//\n// The wrap is decided by the line's width, and typing never undoes it. A date\n// is narrower filled than empty — `9` where `mm` was — so a field between the\n// two widths, which is where a 375 to 400px phone puts it, would otherwise\n// lift the end date back up beside the start and shrink the box while the\n// start date was being typed. So the end date goes onto its own line whenever\n// the three stop fitting, and comes back only when the line's width changes\n// or a font arrives — see `useEndDateWrap`.\n\nconst styles = {\n groupWrapped: {\n kwnvtZ: \"x1a02dak\",\n khm7nJ: \"xxs79tx\",\n $$css: true\n }\n};\ntype DateRangePickerProps<T extends DateValue = DateValue> = Omit<RACDateRangePickerProps<T>, 'children' | 'className' | 'style'> & {\n /** A function may compute the class from the picker's render state. */\n className?: RACDateRangePickerProps<T>['className'];\n /**\n * Where to portal the calendar. Defaults to the container of the `ThemeScope`\n * around it, which keeps the calendar on that scope's tokens, or to the end\n * of `<body>` where there is none. A subtree themed through the `themeScope`\n * class has no container of its own, so point this inside it, or the calendar\n * renders outside and keeps the page's tokens.\n */\n container?: Element;\n /** Supporting text under the field. */\n description?: string;\n /**\n * The message shown instead of the description, which also marks the\n * field invalid.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label floats into the box's top once the field holds a\n * value, rather than sitting above it.\n * @default true\n */\n floatingLabel?: boolean;\n /** What the field is for. Always rendered; never a placeholder. */\n label: string;\n /**\n * An icon at the box's leading end, in the page's 24dp size. An icon drawn\n * in `em` takes that size from the slot.\n */\n leadingIcon?: ReactNode;\n /**\n * What is drawn between the two segment groups. Decoration — a screen\n * reader is told which group is which by React Aria.\n * @default '–'\n */\n separator?: string;\n /**\n * Whether the calendar's header draws the month and the year as menu\n * buttons, each opening a list of them in the grid's place — see\n * `RangeCalendar`.\n * @default false\n */\n showMonthYearMenus?: boolean;\n /** A function may compute the style from the picker's render state. */\n style?: RACDateRangePickerProps<T>['style'];\n /**\n * What the button that opens the calendar is called, for a screen reader.\n * Left out, React Aria names it in the reader's locale — \"Calendar\" in\n * English, followed by the field's own label.\n */\n triggerLabel?: string;\n /**\n * Which of the text fields page's two boxes to draw.\n * @default 'filled'\n */\n variant?: FieldVariant;\n /**\n * How much of the calendar shows at once: `{ months: 2 }` draws two\n * months side by side, which is what a range is usually picked from.\n * Below the expanded breakpoint, where two do not fit, they stack instead\n * — see `RangeCalendar` — in the modal; docked, above the medium\n * breakpoint, the calendar shows one month at a time there, since two\n * stacked are taller than the room under the field.\n * @default { months: 1 }\n */\n visibleDuration?: DateDuration;\n};\n\n// Built by a call rather than written inline at the prop, which is what\n// react-perf's no-jsx-as-prop is after — the same reason Select builds its\n// chevron this way.\nfunction calendarTrigger(triggerLabel: string | undefined) {\n return <RACButton aria-label={triggerLabel} className={triggerClassName}>\n <CalendarGlyph {...stylex.props(picker.triggerGlyph)} />\n </RACButton>;\n}\n\n/**\n * A date range typed into a field, or picked from a calendar behind a\n * button. The value is React Aria's — pass `value` with `onChange` to\n * control it, or `defaultValue` — as a `{ start, end }` pair of\n * `@internationalized/date` values from this package's `./date` subpath.\n *\n * ```tsx\n * import { CalendarDate } from '@kanso-labs/kanso-ui/date'\n *\n * <DateRangePicker\n * defaultValue={{\n * end: new CalendarDate(2026, 9, 20),\n * start: new CalendarDate(2026, 9, 15),\n * }}\n * label=\"Label\"\n * />\n * ```\n *\n * The segments are `DateField`'s and the calendar is `RangeCalendar`, so\n * `granularity`, `minValue`, `maxValue` and `isDateUnavailable` all behave\n * as they do there. Above the medium breakpoint the calendar is docked to\n * the field; below it, it opens centred, the same swap `DatePicker` makes.\n *\n * The call site's `className` and `style` land on the picker as a whole,\n * which is the element a layout positions.\n */\nfunction DateRangePicker<T extends DateValue>({\n container,\n description,\n error,\n floatingLabel = true,\n isDisabled = false,\n label,\n leadingIcon,\n separator = '–',\n showMonthYearMenus = false,\n triggerLabel,\n variant = 'filled',\n visibleDuration,\n ...props\n}: DateRangePickerProps<T> & RefAttributes<HTMLDivElement>) {\n const validationBehavior = useFieldValidationBehavior();\n const months = useDockedMonths(visibleDuration);\n const [group, setGroup] = useState<HTMLDivElement | null>(null);\n const wrapped = useEndDateWrap(group);\n return <RACDateRangePicker<T> isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel}\n // Always populated, which buys exactly one thing: the outlined\n // notch. The box decides populated twice over — in CSS for the\n // label's type, and in React for the notch, since CSS cannot cut an\n // outline to a width it has no way to measure. React Aria renders a\n // hidden input per segment group, neither carrying a placeholder, so\n // the CSS half reads as populated on its own; the React half reads\n // React Aria's input context, which a picker does not provide.\n // Without this the notch stays shut across segments already showing\n // `mm/dd/yyyy`.\n isPopulated isRequired={props.isRequired} label={label} leading={leadingIcon}\n // Grows by a line while the end date is on one of its own, and is\n // the page's 56dp otherwise — see the header.\n multiline\n // In the chrome's trailing slot rather than on the segments' line —\n // see the same prop on DatePicker for what that slot does and why\n // the trigger still opens from there.\n trailing={calendarTrigger(triggerLabel)} variant={variant}>\n <FieldSegments>\n <RACGroup ref={setGroup} {...stylex.props(picker.group, wrapped && styles.groupWrapped)}>\n <RACDateInput slot=\"start\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n <span aria-hidden=\"true\" className=\"x1w5n3ug x2lah0s x16svsjw x1848etk xh7dzej\">\n {separator}\n </span>\n {wrapped && <span aria-hidden=\"true\" className=\"xqtp20y x9f619 x1l7klhg\" />}\n <RACDateInput slot=\"end\" {...stylex.props(segmentStyles.input)}>\n {renderSegment}\n </RACDateInput>\n </RACGroup>\n </FieldSegments>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n <RACPopover className={datePopoverClassName}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container}>\n <RACDialog {...stylex.props(overlay.popupDialog, focus.ring)}>\n <RangeCalendar aria-label={label} showMonthYearMenus={showMonthYearMenus} visibleDuration={months} />\n </RACDialog>\n </RACPopover>\n </RACDateRangePicker>;\n}\n\n/**\n * Whether the end date takes a line of its own: whenever the start date, the\n * dash and the end date are wider together than the line they sit on.\n *\n * Decided afresh when the line's width changes or a font finishes loading,\n * and otherwise only ever turned on, so a date narrowing as it is typed\n * never moves the end date back up mid-entry — see the header. Read off the\n * three parts' own widths rather than the line's overflow, since a wrapped\n * line overflows nothing.\n */\nfunction useEndDateWrap(group: HTMLElement | null) {\n const [wrapped, setWrapped] = useState(false);\n useLayoutEffect(() => {\n if (group === null) {\n return undefined;\n }\n let decidedAt: null | number = null;\n const measure = () => {\n const room = group.getBoundingClientRect().width;\n // React Aria's hidden inputs sit in the group too, and so does the\n // break while the end date is held down. Neither takes a line's height,\n // and neither is a part the line has to hold.\n const parts = [...group.children].filter(part => part.getBoundingClientRect().height > 0);\n const gap = Number.parseFloat(getComputedStyle(group).columnGap) || 0;\n const needs = parts.reduce((sum, part) => sum + part.getBoundingClientRect().width, gap * (parts.length - 1));\n const fits = needs <= room + 0.5;\n if (room !== decidedAt) {\n decidedAt = room;\n setWrapped(!fits);\n } else if (!fits) {\n setWrapped(true);\n }\n };\n const redecide = () => {\n decidedAt = null;\n measure();\n };\n measure();\n const resize = new ResizeObserver(measure);\n resize.observe(group);\n for (const part of group.children) {\n resize.observe(part);\n }\n document.fonts.addEventListener('loadingdone', redecide);\n return () => {\n resize.disconnect();\n document.fonts.removeEventListener('loadingdone', redecide);\n };\n }, [group]);\n return wrapped;\n}\nexport type { DateRangePickerProps };\nexport default DateRangePicker;"],"mappings":";;;;;;;;;;;;;;;;;;AAmEA,MAAMkB,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA6EA,SAASY,gBAAgBH,cAAkC;CACzD,OAAO,oBAAC+E,QAAD;EAAW,cAAY/E;EAAc,WAAWd;EACnD,UAAA,oBAAC,eAAD,EAAe,GAAIhB,MAAae,OAAOoB,YAAY,EAAE,CAAA;CAC5C,CAAA;AACf;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAAhC,gBAAAiC,IAAA;CAAA,MAAAC,IAAAtC,EAAA,EAAA;CAA8C,MAAA,EAAAuB,WAAAC,aAAAC,OAAAC,eAAAa,IAAAC,YAAAC,IAAAd,OAAAC,aAAAC,WAAAa,I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0C,SAAe,KAAxD;IAEZ,MAAAK,OADcb,MAAKU,OAAQC,QAAyDP,OAAOJ,MAAKY,SAAU,EAC7FH,KAASZ,OAAO;IAC7B,IAAIA,SAASF,WAAS;KACpBA,YAAYE;KACZH,WAAW,CAACmB,IAAI;IAAC,OACZ,IAAI,CAACA,MACVnB,WAAW,IAAI;GAChB;GAEH,MAAAoB,iBAAiB;IACfnB,YAAYA;IACZC,QAAQ;GAAC;GAEXA,QAAQ;GACR,MAAAmB,SAAe,IAAIC,eAAepB,OAAO;GACzCmB,OAAME,QAASnD,KAAK;GACpB,KAAK,MAAAoD,UAAcpD,MAAKmC,UACtBc,OAAME,QAASE,MAAI;GAErBC,SAAQC,MAAMC,iBAAkB,eAAeR,QAAQ;GAAC,aACjD;IACLC,OAAMQ,WAAY;IAClBH,SAAQC,MAAMG,oBAAqB,eAAeV,QAAQ;GAAC;EAC5D;EACAzD,KAAA,CAACS,KAAK;EAACV,EAAA,KAAAU;EAAAV,EAAA,KAAAD;EAAAC,EAAA,KAAAC;CAAA,OAAA;EAAAF,KAAAC,EAAA;EAAAC,KAAAD,EAAA;CAAA;CApCVpC,gBAAgBmC,IAoCbE,EAAO;CAAC,OACJW;AAAO;AAvChB,SAAA2C,OAAAc,KAAAC,QAAA;CAAA,OAcgDD,MAAMN,OAAIrB,sBAAuB,CAAC,CAAAC;AAAM;AAdxF,SAAAI,MAAAgB,MAAA;CAAA,OAYuDA,KAAIrB,sBAAuB,CAAC,CAAA6B,SAAU;AAAC"}
@@ -57,9 +57,10 @@ declare namespace Disclosure {
57
57
  declare function DisclosureHeader({ children, headingLevel, leading, supporting }: DisclosureHeaderProps): import("react").JSX.Element;
58
58
  /**
59
59
  * What the section shows while it is open. Its content lines up with the
60
- * headline above it, and it takes the group role React Aria gives it —
61
- * `role="region"` names it in the landmark list instead, for a section a
62
- * reader should be able to jump to.
60
+ * headline above it, past the header's leading slot when it has one, and it
61
+ * takes the group role React Aria gives it — `role="region"` names it in
62
+ * the landmark list instead, for a section a reader should be able to jump
63
+ * to.
63
64
  */
64
65
  declare function DisclosurePanel({ children, ...props }: DisclosurePanelProps & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
65
66
  export { DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, Disclosure as default };