@box-kite/react 2.2.16 → 2.2.18

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 (76) hide show
  1. package/.claude/rules/box-kite-rules.md +3 -3
  2. package/.claude/skills/box-kite/SKILL.md +3 -3
  3. package/.claude/skills/box-kite/references/components.md +1 -1
  4. package/.claude/skills/box-kite/references/styling.md +1 -1
  5. package/.cursor/rules/box-kite.mdc +3 -3
  6. package/AGENTS.md +3 -3
  7. package/BOX_AI_CONTEXT.md +2 -2
  8. package/BOX_KITE_AI_CONTEXT.md +2 -2
  9. package/behavior.cjs +1 -1
  10. package/behavior.mjs +62 -62
  11. package/catalog.cjs +1 -1
  12. package/catalog.mjs +3 -3
  13. package/client.cjs +1 -1
  14. package/client.mjs +15 -15
  15. package/components/accordion.cjs +1 -1
  16. package/components/accordion.mjs +1 -1
  17. package/components/calendar.cjs +1 -1
  18. package/components/calendar.mjs +1 -1
  19. package/components/combobox.cjs +1 -1
  20. package/components/combobox.mjs +1 -1
  21. package/components/dashboard.cjs +1 -1
  22. package/components/dashboard.mjs +1 -1
  23. package/components/dataGrid.cjs +2 -2
  24. package/components/dataGrid.mjs +11 -11
  25. package/components/dateField.cjs +1 -1
  26. package/components/dateField.mjs +1 -1
  27. package/components/datePicker.cjs +1 -1
  28. package/components/datePicker.mjs +198 -198
  29. package/components/dialog.cjs +1 -1
  30. package/components/dialog.mjs +140 -132
  31. package/components/form.cjs +1 -1
  32. package/components/form.mjs +1 -1
  33. package/components/menu.cjs +1 -1
  34. package/components/menu.mjs +120 -119
  35. package/components/overlay.cjs +1 -1
  36. package/components/overlay.mjs +5 -4
  37. package/components/popover.cjs +1 -1
  38. package/components/popover.mjs +50 -49
  39. package/components/presence.cjs +1 -1
  40. package/components/presence.mjs +1 -1
  41. package/components/radioGroup.cjs +1 -1
  42. package/components/radioGroup.mjs +1 -1
  43. package/components/semantics.d.ts +29 -29
  44. package/components/slider.cjs +1 -1
  45. package/components/slider.mjs +1 -1
  46. package/components/sortableList.cjs +1 -1
  47. package/components/sortableList.mjs +1 -1
  48. package/components/swipeItem.cjs +1 -1
  49. package/components/swipeItem.mjs +12 -12
  50. package/components/tabs.cjs +1 -1
  51. package/components/tabs.mjs +2 -2
  52. package/components/toaster.cjs +1 -1
  53. package/components/toaster.mjs +133 -115
  54. package/components/tooltip.cjs +1 -1
  55. package/components/tooltip.mjs +1 -1
  56. package/components/virtualList.cjs +1 -1
  57. package/components/virtualList.mjs +1 -1
  58. package/docs/props.md +2 -2
  59. package/interactionListening.cjs +1 -1
  60. package/interactionListening.mjs +3 -3
  61. package/layer.cjs +1 -1
  62. package/layer.mjs +17 -14
  63. package/motion.cjs +1 -1
  64. package/motion.mjs +30 -20
  65. package/package.json +40 -40
  66. package/placement.cjs +1 -1
  67. package/placement.mjs +10 -10
  68. package/platform.cjs +1 -1
  69. package/platform.mjs +18 -11
  70. package/react/animation/useHeldContent.d.ts +6 -0
  71. package/react/animation/usePresence.d.ts +4 -0
  72. package/react-shared.cjs +1 -1
  73. package/react-shared.mjs +1 -1
  74. package/scrolling.cjs +1 -1
  75. package/scrolling.mjs +1 -1
  76. package/utils/dom/domUtils.d.ts +7 -0
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { f as e } from "../react-shared.mjs";
3
- import { l as t } from "../platform.mjs";
3
+ import { d as t } from "../platform.mjs";
4
4
  import n from "../box.mjs";
5
5
  import { a as r, t as i } from "../behavior.mjs";
6
6
  import { t as a } from "../placement.mjs";
@@ -13,17 +13,18 @@ import { n as ee } from "../date-environment.mjs";
13
13
  import x from "./calendar.mjs";
14
14
  import { t as S } from "../layer.mjs";
15
15
  import C from "./overlay.mjs";
16
- import w from "./dateField.mjs";
17
- import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as te } from "react";
18
- import { Fragment as ne, jsx as k, jsxs as A } from "react/jsx-runtime";
16
+ import { n as w } from "../motion.mjs";
17
+ import te from "./dateField.mjs";
18
+ import { useCallback as T, useEffect as E, useMemo as D, useRef as ne, useState as re } from "react";
19
+ import { Fragment as ie, jsx as O, jsxs as k } from "react/jsx-runtime";
19
20
  //#region src/components/datePicker.tsx
20
- function re() {
21
- return /* @__PURE__ */ k(b, {
21
+ function A() {
22
+ return /* @__PURE__ */ O(b, {
22
23
  viewBox: "0 0 16 16",
23
24
  width: "1rem",
24
25
  height: "1rem",
25
26
  props: { fill: "none" },
26
- children: /* @__PURE__ */ k(y, {
27
+ children: /* @__PURE__ */ O(y, {
27
28
  d: "M3 3.5h10a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1ZM2 7h12M5.5 2v3M10.5 2v3",
28
29
  stroke: "currentColor",
29
30
  strokeWidth: 1.5,
@@ -31,13 +32,13 @@ function re() {
31
32
  })
32
33
  });
33
34
  }
34
- function ie() {
35
- return /* @__PURE__ */ k(b, {
35
+ function j() {
36
+ return /* @__PURE__ */ O(b, {
36
37
  viewBox: "0 0 16 16",
37
38
  width: "1rem",
38
39
  height: "1rem",
39
40
  props: { fill: "none" },
40
- children: /* @__PURE__ */ k(y, {
41
+ children: /* @__PURE__ */ O(y, {
41
42
  d: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM8 5v3l2 1.5",
42
43
  stroke: "currentColor",
43
44
  strokeWidth: 1.5,
@@ -47,12 +48,12 @@ function ie() {
47
48
  });
48
49
  }
49
50
  function ae() {
50
- return /* @__PURE__ */ k(b, {
51
+ return /* @__PURE__ */ O(b, {
51
52
  viewBox: "0 0 16 16",
52
53
  width: "0.875rem",
53
54
  height: "0.875rem",
54
55
  props: { fill: "none" },
55
- children: /* @__PURE__ */ k(y, {
56
+ children: /* @__PURE__ */ O(y, {
56
57
  d: "m4.5 4.5 7 7m0-7-7 7",
57
58
  stroke: "currentColor",
58
59
  strokeWidth: 1.5,
@@ -61,7 +62,7 @@ function ae() {
61
62
  });
62
63
  }
63
64
  function oe(e) {
64
- let [i, o] = te(null), s = e.ref, c = T((e) => {
65
+ let [i, o] = re(null), s = e.ref, c = T((e) => {
65
66
  o(e), t(s, e);
66
67
  }, [s]), l = (e) => {
67
68
  if (!e || e.contains(document.activeElement) && document.activeElement !== e) return;
@@ -81,10 +82,7 @@ function oe(e) {
81
82
  component: "datePicker",
82
83
  type: "openChange"
83
84
  },
84
- onOpened: u,
85
- onClosing: (e, t) => {
86
- e && t?.focus();
87
- }
85
+ onOpened: u
88
86
  }), y = a({
89
87
  side: e.side,
90
88
  align: e.align,
@@ -93,9 +91,11 @@ function oe(e) {
93
91
  matchWidth: e.matchWidth,
94
92
  anchor: i
95
93
  });
96
- return E(() => {
94
+ E(() => {
97
95
  f && l(v);
98
- }, [f, v]), {
96
+ }, [f, v]);
97
+ let b = T(() => v, [v]), ee = w(f, b);
98
+ return {
99
99
  attachTrigger: g.ref,
100
100
  triggerAttributes: g.props,
101
101
  triggerElement: _,
@@ -113,7 +113,7 @@ function oe(e) {
113
113
  "aria-label": e.label,
114
114
  tabIndex: -1
115
115
  };
116
- return d ? /* @__PURE__ */ k(n, {
116
+ return d ? /* @__PURE__ */ O(n, {
117
117
  ref: m,
118
118
  component: "popover",
119
119
  variant: { topLayer: !0 },
@@ -124,8 +124,8 @@ function oe(e) {
124
124
  popover: "auto",
125
125
  ...r
126
126
  },
127
- children: f ? t : null
128
- }) : f && /* @__PURE__ */ k(C, {
127
+ children: ee === "closed" ? null : t
128
+ }) : f && /* @__PURE__ */ O(C, {
129
129
  contentRef: m,
130
130
  anchor: i,
131
131
  side: e.side,
@@ -158,7 +158,7 @@ function se(e) {
158
158
  ps: 2,
159
159
  bs: 1
160
160
  } : {};
161
- return m.length === 0 ? /* @__PURE__ */ k(n, {
161
+ return m.length === 0 ? /* @__PURE__ */ O(n, {
162
162
  component: "datePicker.empty",
163
163
  flexGrow: 1,
164
164
  px: 3,
@@ -167,7 +167,7 @@ function se(e) {
167
167
  ...b,
168
168
  props: { role: "status" },
169
169
  children: f
170
- }) : /* @__PURE__ */ k(n, {
170
+ }) : /* @__PURE__ */ O(n, {
171
171
  component: "datePicker.times",
172
172
  position: "relative",
173
173
  display: "flex",
@@ -183,7 +183,7 @@ function se(e) {
183
183
  "aria-label": l,
184
184
  onKeyDown: y.onKeyDown
185
185
  },
186
- children: m.map((e, t) => /* @__PURE__ */ k(n, {
186
+ children: m.map((e, t) => /* @__PURE__ */ O(n, {
187
187
  component: "datePicker.time",
188
188
  variant: { selected: e === _ },
189
189
  px: 3,
@@ -209,7 +209,7 @@ function se(e) {
209
209
  });
210
210
  }
211
211
  function ce(e) {
212
- return /* @__PURE__ */ k(n, {
212
+ return /* @__PURE__ */ O(n, {
213
213
  component: "datePicker.presets",
214
214
  display: "flex",
215
215
  d: "column",
@@ -217,7 +217,7 @@ function ce(e) {
217
217
  pe: 2,
218
218
  be: 1,
219
219
  props: { role: "group" },
220
- children: e.presets.map((t) => /* @__PURE__ */ k(n, {
220
+ children: e.presets.map((t) => /* @__PURE__ */ O(n, {
221
221
  tag: "button",
222
222
  component: "datePicker.preset",
223
223
  variant: { selected: e.isSelected(t.value) },
@@ -236,11 +236,11 @@ function ce(e) {
236
236
  });
237
237
  }
238
238
  function le(e) {
239
- let { frame: t, attachField: i, attachTrigger: a, triggerAttributes: o, triggerElement: s, id: c, label: l, labelledBy: u, describedBy: d } = e, { text: f, placeholder: p, icon: m, clear: h, disabled: g, invalid: _, required: v = !1, tabIndex: y, inputs: b, onReset: ee } = e, x = O(null), S = l === void 0 ? void 0 : `${c}-label`, C = `${c}-value`, w = r(ee);
239
+ let { frame: t, attachField: i, attachTrigger: a, triggerAttributes: o, triggerElement: s, id: c, label: l, labelledBy: u, describedBy: d } = e, { text: f, placeholder: p, icon: m, clear: h, disabled: g, invalid: _, required: v = !1, tabIndex: y, inputs: b, onReset: ee } = e, x = ne(null), S = l === void 0 ? void 0 : `${c}-label`, C = `${c}-value`, w = r(ee);
240
240
  return E(() => {
241
241
  let e = x.current?.form;
242
242
  if (e) return e.addEventListener("reset", w), () => e.removeEventListener("reset", w);
243
- }, [w]), /* @__PURE__ */ A(ne, { children: [l !== void 0 && /* @__PURE__ */ k(n, {
243
+ }, [w]), /* @__PURE__ */ k(ie, { children: [l !== void 0 && /* @__PURE__ */ O(n, {
244
244
  component: "dateField.label",
245
245
  display: "block",
246
246
  mb: 1.5,
@@ -248,7 +248,7 @@ function le(e) {
248
248
  id: S,
249
249
  props: { onClick: () => s?.focus() },
250
250
  children: l
251
- }), /* @__PURE__ */ A(n, {
251
+ }), /* @__PURE__ */ k(n, {
252
252
  ref: i,
253
253
  component: "dateField",
254
254
  display: "inline-flex",
@@ -262,7 +262,7 @@ function le(e) {
262
262
  invalid: _
263
263
  }],
264
264
  children: [
265
- /* @__PURE__ */ k(n, {
265
+ /* @__PURE__ */ O(n, {
266
266
  tag: "button",
267
267
  ref: a,
268
268
  component: "datePicker.value",
@@ -288,17 +288,17 @@ function le(e) {
288
288
  "aria-invalid": _ || void 0,
289
289
  ...o
290
290
  },
291
- children: /* @__PURE__ */ k("span", {
291
+ children: /* @__PURE__ */ O("span", {
292
292
  id: C,
293
293
  children: f || p
294
294
  })
295
295
  }),
296
- /* @__PURE__ */ A(n, {
296
+ /* @__PURE__ */ k(n, {
297
297
  display: "inline-flex",
298
298
  ai: "center",
299
299
  gap: 1,
300
300
  ms: 2,
301
- children: [h, /* @__PURE__ */ k(n, {
301
+ children: [h, /* @__PURE__ */ O(n, {
302
302
  component: "datePicker.icon",
303
303
  display: "inline-flex",
304
304
  ai: "center",
@@ -310,7 +310,7 @@ function le(e) {
310
310
  children: m
311
311
  })]
312
312
  }),
313
- b.map((e, t) => v ? /* @__PURE__ */ k(n, {
313
+ b.map((e, t) => v ? /* @__PURE__ */ O(n, {
314
314
  tag: "input",
315
315
  ref: t === 0 ? x : void 0,
316
316
  component: "dateField.validation",
@@ -325,7 +325,7 @@ function le(e) {
325
325
  onChange: () => {},
326
326
  onFocus: () => s?.focus()
327
327
  }
328
- }, t) : e.name === void 0 ? null : /* @__PURE__ */ k("input", {
328
+ }, t) : e.name === void 0 ? null : /* @__PURE__ */ O("input", {
329
329
  ref: t === 0 ? x : void 0,
330
330
  type: "hidden",
331
331
  name: e.name,
@@ -335,62 +335,62 @@ function le(e) {
335
335
  ]
336
336
  })] });
337
337
  }
338
- function j(e, t) {
339
- let { type: r = "date", value: i, defaultValue: a = null, onValueChange: o, zone: h, locale: g, hourCycle: y, granularity: b, disambiguation: S, min: C, max: T, isDateUnavailable: E, disabled: D = !1, readOnly: O = !1, required: te, invalid: j, name: M, label: N, labelledBy: P, describedBy: ue, open: de, defaultOpen: fe, onOpenChange: pe, closeOnSelect: F = !0, firstDayOfWeek: I, weekNumbers: me, side: L = "bottom", align: R = "start", matchWidth: he = r === "time", emptyTimesLabel: z = "No times available", clearable: ge = !1, pickOnly: B = !1, triggerLabel: _e, clearLabel: ve = "Clear", tabIndex: V, step: H = 30, defaultTime: U = "00:00", presets: W, showZone: G, ...ye } = e, K = ee({
338
+ function M(e, t) {
339
+ let { type: r = "date", value: i, defaultValue: a = null, onValueChange: o, zone: h, locale: g, hourCycle: y, granularity: b, disambiguation: S, min: C, max: w, isDateUnavailable: T, disabled: E = !1, readOnly: D = !1, required: ne, invalid: re, name: M, label: N, labelledBy: P, describedBy: F, open: ue, defaultOpen: de, onOpenChange: fe, closeOnSelect: I = !0, firstDayOfWeek: L, weekNumbers: pe, side: R = "bottom", align: me = "start", matchWidth: he = r === "time", emptyTimesLabel: ge = "No times available", clearable: _e = !1, pickOnly: z = !1, triggerLabel: ve, clearLabel: ye = "Clear", tabIndex: B, step: V = 30, defaultTime: H = "00:00", presets: U, showZone: W, ...be } = e, G = ee({
340
340
  locale: g,
341
341
  zone: h === "none" ? void 0 : h
342
- }), { locale: q } = K, J = r === "datetime" && h !== "none" ? K.zone : null, Y = J ?? K.zone, [X, Z] = _({
342
+ }), { locale: K } = G, q = r === "datetime" && h !== "none" ? G.zone : null, J = q ?? G.zone, [Y, X] = _({
343
343
  value: i,
344
344
  defaultValue: a,
345
345
  onChange: (e, t) => o?.(e, {
346
346
  ...t,
347
- ...m(e, Y)
347
+ ...m(e, J)
348
348
  }),
349
349
  interaction: {
350
350
  component: "datePicker",
351
351
  type: "valueChange",
352
352
  content: ["value"]
353
353
  }
354
- }), Q = _e ?? (r === "time" ? "Choose time" : "Choose date"), be = typeof N == "string" ? N : Q, { attachTrigger: xe, triggerAttributes: Se, triggerElement: Ce, closeOnChoice: we, id: Te, attachField: Ee, panel: De } = oe({
354
+ }), Z = ve ?? (r === "time" ? "Choose time" : "Choose date"), xe = typeof N == "string" ? N : Z, { attachTrigger: Q, triggerAttributes: Se, triggerElement: Ce, closeOnChoice: we, id: Te, attachField: Ee, panel: De } = oe({
355
355
  ref: t,
356
- open: de,
357
- defaultOpen: fe,
358
- onOpenChange: pe,
359
- side: L,
360
- align: R,
356
+ open: ue,
357
+ defaultOpen: de,
358
+ onOpenChange: fe,
359
+ side: R,
360
+ align: me,
361
361
  matchWidth: he,
362
- label: be
363
- }), $ = X && r !== "time" ? d(X, { zone: Y }) : null, Oe = X && r !== "date" ? l(X, { zone: Y }) : null, ke = r === "datetime" ? $ ?? u(Y) : null, Ae = (e) => e && (ke === null || d(e, { zone: Y }) === ke) ? l(e, { zone: Y }) : null, je = X ? c(X, {
364
- locale: q,
365
- zone: Y,
362
+ label: xe
363
+ }), $ = Y && r !== "time" ? d(Y, { zone: J }) : null, Oe = Y && r !== "date" ? l(Y, { zone: J }) : null, ke = r === "datetime" ? $ ?? u(J) : null, Ae = (e) => e && (ke === null || d(e, { zone: J }) === ke) ? l(e, { zone: J }) : null, je = Y ? c(Y, {
364
+ locale: K,
365
+ zone: J,
366
366
  hourCycle: y === void 0 ? void 0 : y === 12 ? "h12" : "h23",
367
367
  ...r === "date" ? { dateStyle: "medium" } : r === "time" ? { timeStyle: "short" } : {
368
368
  dateStyle: "medium",
369
369
  timeStyle: "short"
370
370
  }
371
- }) : "", Me = B && X && J && (G ?? J !== K.readerZone) ? s(J, {
372
- locale: q,
371
+ }) : "", Me = z && Y && q && (W ?? q !== G.readerZone) ? s(q, {
372
+ locale: K,
373
373
  style: "short",
374
- at: X
375
- }) : null, Ne = we, Pe = (e, t) => p(e, t, J ? {
376
- zone: J,
374
+ at: Y
375
+ }) : null, Ne = we, Pe = (e, t) => p(e, t, q ? {
376
+ zone: q,
377
377
  disambiguation: S
378
378
  } : {}), Fe = (e, t) => {
379
- e && (r === "date" ? (Z(e, {
379
+ e && (r === "date" ? (X(e, {
380
380
  reason: "select",
381
381
  event: t
382
- }), F && Ne(t)) : Z(Pe(e, Oe ?? U), {
382
+ }), I && Ne(t)) : X(Pe(e, Oe ?? H), {
383
383
  reason: "select",
384
384
  event: t
385
385
  }));
386
386
  }, Ie = (e, t) => {
387
- Z(r === "time" ? e : Pe($ ?? u(Y), e), {
387
+ X(r === "time" ? e : Pe($ ?? u(J), e), {
388
388
  reason: "select",
389
389
  event: t
390
- }), F && Ne(t);
391
- }, Le = /* @__PURE__ */ k(n, {
390
+ }), I && Ne(t);
391
+ }, Le = /* @__PURE__ */ O(n, {
392
392
  tag: "button",
393
- ref: xe,
393
+ ref: Q,
394
394
  component: "datePicker.trigger",
395
395
  display: "inline-flex",
396
396
  ai: "center",
@@ -400,15 +400,15 @@ function j(e, t) {
400
400
  ms: 2,
401
401
  me: -1.5,
402
402
  borderRadius: 1.5,
403
- disabled: D || O,
403
+ disabled: E || D,
404
404
  props: {
405
405
  type: "button",
406
- "aria-label": je ? `${Q}, ${je}` : Q,
407
- tabIndex: V,
406
+ "aria-label": je ? `${Z}, ${je}` : Z,
407
+ tabIndex: B,
408
408
  ...Se
409
409
  },
410
- children: k(r === "time" ? ie : re, {})
411
- }), Re = ge && X && !D && !O && /* @__PURE__ */ k(n, {
410
+ children: O(r === "time" ? j : A, {})
411
+ }), Re = _e && Y && !E && !D && /* @__PURE__ */ O(n, {
412
412
  tag: "button",
413
413
  component: "datePicker.clear",
414
414
  display: "inline-flex",
@@ -422,46 +422,46 @@ function j(e, t) {
422
422
  zIndex: 1,
423
423
  props: {
424
424
  type: "button",
425
- "aria-label": ve,
426
- tabIndex: V,
427
- onClick: (e) => Z(null, {
425
+ "aria-label": ye,
426
+ tabIndex: B,
427
+ onClick: (e) => X(null, {
428
428
  reason: "clear",
429
429
  event: e
430
430
  })
431
431
  },
432
- children: /* @__PURE__ */ k(ae, {})
433
- }), ze = X !== null && (C != null && f(X, C) < 0 || T != null && f(X, T) > 0), Be = B ? /* @__PURE__ */ k(le, {
434
- frame: ye,
432
+ children: /* @__PURE__ */ O(ae, {})
433
+ }), ze = Y !== null && (C != null && f(Y, C) < 0 || w != null && f(Y, w) > 0), Be = z ? /* @__PURE__ */ O(le, {
434
+ frame: be,
435
435
  attachField: Ee,
436
- attachTrigger: O ? void 0 : xe,
437
- triggerAttributes: O ? void 0 : Se,
436
+ attachTrigger: D ? void 0 : Q,
437
+ triggerAttributes: D ? void 0 : Se,
438
438
  triggerElement: Ce,
439
439
  id: Te,
440
440
  label: N,
441
441
  labelledBy: P,
442
- describedBy: ue,
442
+ describedBy: F,
443
443
  text: Me ? `${je} ${Me}` : je,
444
- placeholder: Q,
445
- icon: k(r === "time" ? ie : re, {}),
444
+ placeholder: Z,
445
+ icon: O(r === "time" ? j : A, {}),
446
446
  clear: Re,
447
- disabled: D,
448
- invalid: j ?? (ze || $ !== null && !!E?.($)),
449
- required: te,
450
- tabIndex: V,
447
+ disabled: E,
448
+ invalid: re ?? (ze || $ !== null && !!T?.($)),
449
+ required: ne,
450
+ tabIndex: B,
451
451
  inputs: [{
452
452
  name: M,
453
- value: X ?? ""
453
+ value: Y ?? ""
454
454
  }],
455
- onReset: (e) => Z(a, {
455
+ onReset: (e) => X(a, {
456
456
  reason: "reset",
457
457
  event: e
458
458
  })
459
- }) : /* @__PURE__ */ k(w, {
459
+ }) : /* @__PURE__ */ O(te, {
460
460
  ref: Ee,
461
- ...ye,
461
+ ...be,
462
462
  type: r,
463
- value: X,
464
- onValueChange: (e, t) => Z(e, {
463
+ value: Y,
464
+ onValueChange: (e, t) => X(e, {
465
465
  reason: t.reason,
466
466
  event: t.event
467
467
  }),
@@ -471,63 +471,63 @@ function j(e, t) {
471
471
  granularity: b,
472
472
  disambiguation: S,
473
473
  min: C,
474
- max: T,
475
- isDateUnavailable: E,
476
- disabled: D,
477
- readOnly: O,
478
- required: te,
479
- invalid: j,
474
+ max: w,
475
+ isDateUnavailable: T,
476
+ disabled: E,
477
+ readOnly: D,
478
+ required: ne,
479
+ invalid: re,
480
480
  name: M,
481
481
  label: N,
482
482
  labelledBy: P,
483
- describedBy: ue,
484
- showZone: G,
485
- tabIndex: V,
486
- end: /* @__PURE__ */ A(ne, { children: [Re, Le] })
483
+ describedBy: F,
484
+ showZone: W,
485
+ tabIndex: B,
486
+ end: /* @__PURE__ */ k(ie, { children: [Re, Le] })
487
487
  });
488
- return /* @__PURE__ */ A(v, { children: [Be, De(/* @__PURE__ */ A(n, {
488
+ return /* @__PURE__ */ k(v, { children: [Be, De(/* @__PURE__ */ k(n, {
489
489
  display: "flex",
490
490
  gap: 3,
491
491
  ai: "stretch",
492
492
  children: [
493
- W && W.length > 0 && /* @__PURE__ */ k(ce, {
494
- presets: W,
495
- isSelected: (e) => X !== null && f(e, X, { zone: Y }) === 0,
493
+ U && U.length > 0 && /* @__PURE__ */ O(ce, {
494
+ presets: U,
495
+ isSelected: (e) => Y !== null && f(e, Y, { zone: J }) === 0,
496
496
  onSelect: (e, t) => {
497
- Z(e, {
497
+ X(e, {
498
498
  reason: "preset",
499
499
  event: t
500
- }), F && Ne(t);
500
+ }), I && Ne(t);
501
501
  }
502
502
  }),
503
- r !== "time" && /* @__PURE__ */ k(x, {
503
+ r !== "time" && /* @__PURE__ */ O(x, {
504
504
  value: $,
505
505
  onValueChange: (e, t) => Fe(e, t.event),
506
- min: C ? d(C, { zone: Y }) : void 0,
507
- max: T ? d(T, { zone: Y }) : void 0,
508
- isDateUnavailable: E,
506
+ min: C ? d(C, { zone: J }) : void 0,
507
+ max: w ? d(w, { zone: J }) : void 0,
508
+ isDateUnavailable: T,
509
509
  locale: g,
510
510
  zone: h === "none" ? void 0 : h,
511
- firstDayOfWeek: I,
512
- weekNumbers: me
511
+ firstDayOfWeek: L,
512
+ weekNumbers: pe
513
513
  }),
514
- r !== "date" && /* @__PURE__ */ k(se, {
514
+ r !== "date" && /* @__PURE__ */ O(se, {
515
515
  value: Oe,
516
- step: H,
517
- locale: q,
516
+ step: V,
517
+ locale: K,
518
518
  hourCycle: y,
519
- label: r === "time" ? be : "Time",
519
+ label: r === "time" ? xe : "Time",
520
520
  min: Ae(C),
521
- max: Ae(T),
522
- emptyLabel: z,
521
+ max: Ae(w),
522
+ emptyLabel: ge,
523
523
  separated: r === "datetime",
524
524
  onSelect: Ie
525
525
  })
526
526
  ]
527
527
  }))] });
528
528
  }
529
- function M(e, t) {
530
- let { value: r, defaultValue: i = null, onValueChange: a, locale: s, min: c, max: l, isDateUnavailable: u, disabled: d = !1, readOnly: p = !1, required: m, invalid: h, startName: g, endName: y, label: b, labelledBy: S, describedBy: C, startLabel: T = "Start date", endLabel: E = "End date", open: D, defaultOpen: O, onOpenChange: ie, closeOnSelect: se = !0, firstDayOfWeek: j, weekNumbers: M, months: N = 2, side: P = "bottom", align: ue = "start", matchWidth: de = !1, emptyTimesLabel: fe, clearable: pe = !1, pickOnly: F = !1, triggerLabel: I = "Choose dates", clearLabel: me = "Clear", tabIndex: L, presets: R, props: he, ...z } = e, { locale: ge } = ee({ locale: s }), [B, _e] = _({
529
+ function N(e, t) {
530
+ let { value: r, defaultValue: i = null, onValueChange: a, locale: s, min: c, max: l, isDateUnavailable: u, disabled: d = !1, readOnly: p = !1, required: m, invalid: h, startName: g, endName: y, label: b, labelledBy: S, describedBy: C, startLabel: w = "Start date", endLabel: T = "End date", open: E, defaultOpen: D, onOpenChange: ne, closeOnSelect: j = !0, firstDayOfWeek: se, weekNumbers: M, months: N = 2, side: P = "bottom", align: F = "start", matchWidth: ue = !1, emptyTimesLabel: de, clearable: fe = !1, pickOnly: I = !1, triggerLabel: L = "Choose dates", clearLabel: pe = "Clear", tabIndex: R, presets: me, props: he, ...ge } = e, { locale: _e } = ee({ locale: s }), [z, ve] = _({
531
531
  value: r,
532
532
  defaultValue: i,
533
533
  onChange: a,
@@ -536,39 +536,39 @@ function M(e, t) {
536
536
  type: "valueChange",
537
537
  content: ["value"]
538
538
  }
539
- }), [ve, V] = te({
540
- start: B?.start ?? null,
541
- end: B?.end ?? null,
542
- source: B
543
- }), { start: H, end: U } = ve;
544
- ve.source !== B && (H = B?.start ?? null, U = B?.end ?? null, V({
545
- start: H,
546
- end: U,
547
- source: B
539
+ }), [ye, B] = re({
540
+ start: z?.start ?? null,
541
+ end: z?.end ?? null,
542
+ source: z
543
+ }), { start: V, end: H } = ye;
544
+ ye.source !== z && (V = z?.start ?? null, H = z?.end ?? null, B({
545
+ start: V,
546
+ end: H,
547
+ source: z
548
548
  }));
549
- let { attachTrigger: W, triggerAttributes: G, triggerElement: ye, closeOnChoice: K, id: q, attachField: J, panel: Y } = oe({
549
+ let { attachTrigger: U, triggerAttributes: W, triggerElement: be, closeOnChoice: G, id: K, attachField: q, panel: J } = oe({
550
550
  ref: t,
551
- open: D,
552
- defaultOpen: O,
553
- onOpenChange: ie,
551
+ open: E,
552
+ defaultOpen: D,
553
+ onOpenChange: ne,
554
554
  side: P,
555
- align: ue,
556
- matchWidth: de,
557
- label: typeof b == "string" ? b : I
558
- }), X = B ? o(B.start, B.end, { locale: ge }) : "", Z = H !== null && U !== null && f(H, U) > 0, Q = (e, t, n, r) => {
555
+ align: F,
556
+ matchWidth: ue,
557
+ label: typeof b == "string" ? b : L
558
+ }), Y = z ? o(z.start, z.end, { locale: _e }) : "", X = V !== null && H !== null && f(V, H) > 0, Z = (e, t, n, r) => {
559
559
  let i = e && t && f(e, t) <= 0 ? {
560
560
  start: e,
561
561
  end: t
562
562
  } : null;
563
- V({
563
+ B({
564
564
  start: e,
565
565
  end: t,
566
566
  source: i
567
- }), _e(i, {
567
+ }), ve(i, {
568
568
  reason: n,
569
569
  event: r
570
570
  });
571
- }, be = K, xe = {
571
+ }, xe = G, Q = {
572
572
  locale: s,
573
573
  min: c,
574
574
  max: l,
@@ -579,8 +579,8 @@ function M(e, t) {
579
579
  component: "datePicker.part",
580
580
  px: 0,
581
581
  py: 0,
582
- tabIndex: L
583
- }, Se = pe && B && !d && !p && /* @__PURE__ */ k(n, {
582
+ tabIndex: R
583
+ }, Se = fe && z && !d && !p && /* @__PURE__ */ O(n, {
584
584
  tag: "button",
585
585
  component: "datePicker.clear",
586
586
  display: "inline-flex",
@@ -593,97 +593,97 @@ function M(e, t) {
593
593
  zIndex: 1,
594
594
  props: {
595
595
  type: "button",
596
- "aria-label": me,
597
- tabIndex: L,
598
- onClick: (e) => Q(null, null, "clear", e)
596
+ "aria-label": pe,
597
+ tabIndex: R,
598
+ onClick: (e) => Z(null, null, "clear", e)
599
599
  },
600
- children: /* @__PURE__ */ k(ae, {})
601
- }), Ce = B !== null && (c != null && f(B.start, c) < 0 || l != null && f(B.end, l) > 0), we = F ? /* @__PURE__ */ k(le, {
600
+ children: /* @__PURE__ */ O(ae, {})
601
+ }), Ce = z !== null && (c != null && f(z.start, c) < 0 || l != null && f(z.end, l) > 0), we = I ? /* @__PURE__ */ O(le, {
602
602
  frame: {
603
- ...z,
603
+ ...ge,
604
604
  props: he
605
605
  },
606
- attachField: J,
607
- attachTrigger: p ? void 0 : W,
608
- triggerAttributes: p ? void 0 : G,
609
- triggerElement: ye,
610
- id: q,
606
+ attachField: q,
607
+ attachTrigger: p ? void 0 : U,
608
+ triggerAttributes: p ? void 0 : W,
609
+ triggerElement: be,
610
+ id: K,
611
611
  label: b,
612
612
  labelledBy: S,
613
613
  describedBy: C,
614
- text: X,
615
- placeholder: I,
616
- icon: /* @__PURE__ */ k(re, {}),
614
+ text: Y,
615
+ placeholder: L,
616
+ icon: /* @__PURE__ */ O(A, {}),
617
617
  clear: Se,
618
618
  disabled: d,
619
619
  invalid: h ?? Ce,
620
620
  required: m,
621
- tabIndex: L,
621
+ tabIndex: R,
622
622
  inputs: [{
623
623
  name: g,
624
- value: B?.start ?? ""
624
+ value: z?.start ?? ""
625
625
  }, {
626
626
  name: y,
627
- value: B?.end ?? ""
627
+ value: z?.end ?? ""
628
628
  }],
629
- onReset: (e) => Q(i?.start ?? null, i?.end ?? null, "reset", e)
630
- }) : /* @__PURE__ */ A(ne, { children: [b !== void 0 && /* @__PURE__ */ k(n, {
629
+ onReset: (e) => Z(i?.start ?? null, i?.end ?? null, "reset", e)
630
+ }) : /* @__PURE__ */ k(ie, { children: [b !== void 0 && /* @__PURE__ */ O(n, {
631
631
  component: "dateField.label",
632
632
  display: "block",
633
633
  mb: 1.5,
634
634
  fontSize: 14,
635
- id: `${q}-label`,
635
+ id: `${K}-label`,
636
636
  children: b
637
- }), /* @__PURE__ */ A(n, {
638
- ref: J,
637
+ }), /* @__PURE__ */ k(n, {
638
+ ref: q,
639
639
  component: "dateField",
640
640
  display: "inline-flex",
641
641
  ai: "center",
642
642
  gap: 2,
643
643
  px: 3,
644
644
  py: 2,
645
- ...z,
646
- variant: [z.variant, {
645
+ ...ge,
646
+ variant: [ge.variant, {
647
647
  disabled: d,
648
- invalid: h ?? Z
648
+ invalid: h ?? X
649
649
  }],
650
650
  props: {
651
651
  role: "group",
652
- "aria-labelledby": [b === void 0 ? void 0 : `${q}-label`, S].filter(Boolean).join(" ") || void 0,
653
- "aria-invalid": (h ?? Z) || void 0,
652
+ "aria-labelledby": [b === void 0 ? void 0 : `${K}-label`, S].filter(Boolean).join(" ") || void 0,
653
+ "aria-invalid": (h ?? X) || void 0,
654
654
  "aria-describedby": C,
655
655
  ...he
656
656
  },
657
657
  children: [
658
- /* @__PURE__ */ k(w, {
659
- ...xe,
660
- value: H,
661
- onValueChange: (e, t) => Q(e, U, t.reason, t.event),
658
+ /* @__PURE__ */ O(te, {
659
+ ...Q,
660
+ value: V,
661
+ onValueChange: (e, t) => Z(e, H, t.reason, t.event),
662
662
  name: g,
663
- props: { "aria-label": T },
664
- invalid: h ?? Z
663
+ props: { "aria-label": w },
664
+ invalid: h ?? X
665
665
  }),
666
- /* @__PURE__ */ k(n, {
666
+ /* @__PURE__ */ O(n, {
667
667
  component: "dateField.literal",
668
668
  props: { "aria-hidden": !0 },
669
669
  children: "–"
670
670
  }),
671
- /* @__PURE__ */ k(w, {
672
- ...xe,
673
- value: U,
674
- onValueChange: (e, t) => Q(H, e, t.reason, t.event),
671
+ /* @__PURE__ */ O(te, {
672
+ ...Q,
673
+ value: H,
674
+ onValueChange: (e, t) => Z(V, e, t.reason, t.event),
675
675
  name: y,
676
- props: { "aria-label": E },
677
- invalid: h ?? Z
676
+ props: { "aria-label": T },
677
+ invalid: h ?? X
678
678
  }),
679
- /* @__PURE__ */ A(n, {
679
+ /* @__PURE__ */ k(n, {
680
680
  display: "inline-flex",
681
681
  ai: "center",
682
682
  gap: 2,
683
683
  ms: "auto",
684
- children: [Se, /* @__PURE__ */ k(n, {
684
+ children: [Se, /* @__PURE__ */ O(n, {
685
685
  tag: "button",
686
- ref: W,
686
+ ref: U,
687
687
  component: "datePicker.trigger",
688
688
  display: "inline-flex",
689
689
  ai: "center",
@@ -695,42 +695,42 @@ function M(e, t) {
695
695
  disabled: d || p,
696
696
  props: {
697
697
  type: "button",
698
- "aria-label": X ? `${I}, ${X}` : I,
699
- tabIndex: L,
700
- ...G
698
+ "aria-label": Y ? `${L}, ${Y}` : L,
699
+ tabIndex: R,
700
+ ...W
701
701
  },
702
- children: /* @__PURE__ */ k(re, {})
702
+ children: /* @__PURE__ */ O(A, {})
703
703
  })]
704
704
  })
705
705
  ]
706
706
  })] });
707
- return /* @__PURE__ */ A(v, { children: [we, Y(/* @__PURE__ */ A(n, {
707
+ return /* @__PURE__ */ k(v, { children: [we, J(/* @__PURE__ */ k(n, {
708
708
  display: "flex",
709
709
  gap: 3,
710
710
  ai: "stretch",
711
- children: [R && R.length > 0 && /* @__PURE__ */ k(ce, {
712
- presets: R,
713
- isSelected: (e) => B !== null && e.start === B.start && e.end === B.end,
711
+ children: [me && me.length > 0 && /* @__PURE__ */ O(ce, {
712
+ presets: me,
713
+ isSelected: (e) => z !== null && e.start === z.start && e.end === z.end,
714
714
  onSelect: (e, t) => {
715
- Q(e.start, e.end, "preset", t), se && be(t);
715
+ Z(e.start, e.end, "preset", t), j && xe(t);
716
716
  }
717
- }), /* @__PURE__ */ k(x, {
717
+ }), /* @__PURE__ */ O(x, {
718
718
  mode: "range",
719
719
  months: N,
720
- value: B,
721
- defaultFocusedDate: H ?? void 0,
720
+ value: z,
721
+ defaultFocusedDate: V ?? void 0,
722
722
  onValueChange: (e, t) => {
723
- Q(e?.start ?? null, e?.end ?? null, "select", t.event), se && e && t.event && be(t.event);
723
+ Z(e?.start ?? null, e?.end ?? null, "select", t.event), j && e && t.event && xe(t.event);
724
724
  },
725
725
  min: c,
726
726
  max: l,
727
727
  isDateUnavailable: u,
728
728
  locale: s,
729
- firstDayOfWeek: j,
729
+ firstDayOfWeek: se,
730
730
  weekNumbers: M
731
731
  })]
732
732
  }))] });
733
733
  }
734
- var N = e(j, "DatePicker"), P = e(M, "DateRangePicker");
734
+ var P = e(M, "DatePicker"), F = e(N, "DateRangePicker");
735
735
  //#endregion
736
- export { P as DateRangePicker, N as default };
736
+ export { F as DateRangePicker, P as default };