@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.
- package/.claude/rules/box-kite-rules.md +3 -3
- package/.claude/skills/box-kite/SKILL.md +3 -3
- package/.claude/skills/box-kite/references/components.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +1 -1
- package/.cursor/rules/box-kite.mdc +3 -3
- package/AGENTS.md +3 -3
- package/BOX_AI_CONTEXT.md +2 -2
- package/BOX_KITE_AI_CONTEXT.md +2 -2
- package/behavior.cjs +1 -1
- package/behavior.mjs +62 -62
- package/catalog.cjs +1 -1
- package/catalog.mjs +3 -3
- package/client.cjs +1 -1
- package/client.mjs +15 -15
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +1 -1
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +1 -1
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +1 -1
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +1 -1
- package/components/dataGrid.cjs +2 -2
- package/components/dataGrid.mjs +11 -11
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +1 -1
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +198 -198
- package/components/dialog.cjs +1 -1
- package/components/dialog.mjs +140 -132
- package/components/form.cjs +1 -1
- package/components/form.mjs +1 -1
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +120 -119
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +5 -4
- package/components/popover.cjs +1 -1
- package/components/popover.mjs +50 -49
- package/components/presence.cjs +1 -1
- package/components/presence.mjs +1 -1
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +1 -1
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +1 -1
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +1 -1
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +12 -12
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +2 -2
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +133 -115
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.mjs +1 -1
- package/components/virtualList.cjs +1 -1
- package/components/virtualList.mjs +1 -1
- package/docs/props.md +2 -2
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +17 -14
- package/motion.cjs +1 -1
- package/motion.mjs +30 -20
- package/package.json +40 -40
- package/placement.cjs +1 -1
- package/placement.mjs +10 -10
- package/platform.cjs +1 -1
- package/platform.mjs +18 -11
- package/react/animation/useHeldContent.d.ts +6 -0
- package/react/animation/usePresence.d.ts +4 -0
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- 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 {
|
|
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 "
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
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
|
|
21
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
35
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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] =
|
|
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
|
-
|
|
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__ */
|
|
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:
|
|
128
|
-
}) : f && /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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 =
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
291
|
+
children: /* @__PURE__ */ O("span", {
|
|
292
292
|
id: C,
|
|
293
293
|
children: f || p
|
|
294
294
|
})
|
|
295
295
|
}),
|
|
296
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
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:
|
|
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:
|
|
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,
|
|
347
|
+
...m(e, J)
|
|
348
348
|
}),
|
|
349
349
|
interaction: {
|
|
350
350
|
component: "datePicker",
|
|
351
351
|
type: "valueChange",
|
|
352
352
|
content: ["value"]
|
|
353
353
|
}
|
|
354
|
-
}),
|
|
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:
|
|
357
|
-
defaultOpen:
|
|
358
|
-
onOpenChange:
|
|
359
|
-
side:
|
|
360
|
-
align:
|
|
356
|
+
open: ue,
|
|
357
|
+
defaultOpen: de,
|
|
358
|
+
onOpenChange: fe,
|
|
359
|
+
side: R,
|
|
360
|
+
align: me,
|
|
361
361
|
matchWidth: he,
|
|
362
|
-
label:
|
|
363
|
-
}), $ =
|
|
364
|
-
locale:
|
|
365
|
-
zone:
|
|
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 =
|
|
372
|
-
locale:
|
|
371
|
+
}) : "", Me = z && Y && q && (W ?? q !== G.readerZone) ? s(q, {
|
|
372
|
+
locale: K,
|
|
373
373
|
style: "short",
|
|
374
|
-
at:
|
|
375
|
-
}) : null, Ne = we, Pe = (e, t) => p(e, t,
|
|
376
|
-
zone:
|
|
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" ? (
|
|
379
|
+
e && (r === "date" ? (X(e, {
|
|
380
380
|
reason: "select",
|
|
381
381
|
event: t
|
|
382
|
-
}),
|
|
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
|
-
|
|
387
|
+
X(r === "time" ? e : Pe($ ?? u(J), e), {
|
|
388
388
|
reason: "select",
|
|
389
389
|
event: t
|
|
390
|
-
}),
|
|
391
|
-
}, Le = /* @__PURE__ */
|
|
390
|
+
}), I && Ne(t);
|
|
391
|
+
}, Le = /* @__PURE__ */ O(n, {
|
|
392
392
|
tag: "button",
|
|
393
|
-
ref:
|
|
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:
|
|
403
|
+
disabled: E || D,
|
|
404
404
|
props: {
|
|
405
405
|
type: "button",
|
|
406
|
-
"aria-label": je ? `${
|
|
407
|
-
tabIndex:
|
|
406
|
+
"aria-label": je ? `${Z}, ${je}` : Z,
|
|
407
|
+
tabIndex: B,
|
|
408
408
|
...Se
|
|
409
409
|
},
|
|
410
|
-
children:
|
|
411
|
-
}), Re =
|
|
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":
|
|
426
|
-
tabIndex:
|
|
427
|
-
onClick: (e) =>
|
|
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__ */
|
|
433
|
-
}), ze =
|
|
434
|
-
frame:
|
|
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:
|
|
437
|
-
triggerAttributes:
|
|
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:
|
|
442
|
+
describedBy: F,
|
|
443
443
|
text: Me ? `${je} ${Me}` : je,
|
|
444
|
-
placeholder:
|
|
445
|
-
icon:
|
|
444
|
+
placeholder: Z,
|
|
445
|
+
icon: O(r === "time" ? j : A, {}),
|
|
446
446
|
clear: Re,
|
|
447
|
-
disabled:
|
|
448
|
-
invalid:
|
|
449
|
-
required:
|
|
450
|
-
tabIndex:
|
|
447
|
+
disabled: E,
|
|
448
|
+
invalid: re ?? (ze || $ !== null && !!T?.($)),
|
|
449
|
+
required: ne,
|
|
450
|
+
tabIndex: B,
|
|
451
451
|
inputs: [{
|
|
452
452
|
name: M,
|
|
453
|
-
value:
|
|
453
|
+
value: Y ?? ""
|
|
454
454
|
}],
|
|
455
|
-
onReset: (e) =>
|
|
455
|
+
onReset: (e) => X(a, {
|
|
456
456
|
reason: "reset",
|
|
457
457
|
event: e
|
|
458
458
|
})
|
|
459
|
-
}) : /* @__PURE__ */
|
|
459
|
+
}) : /* @__PURE__ */ O(te, {
|
|
460
460
|
ref: Ee,
|
|
461
|
-
...
|
|
461
|
+
...be,
|
|
462
462
|
type: r,
|
|
463
|
-
value:
|
|
464
|
-
onValueChange: (e, t) =>
|
|
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:
|
|
475
|
-
isDateUnavailable:
|
|
476
|
-
disabled:
|
|
477
|
-
readOnly:
|
|
478
|
-
required:
|
|
479
|
-
invalid:
|
|
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:
|
|
484
|
-
showZone:
|
|
485
|
-
tabIndex:
|
|
486
|
-
end: /* @__PURE__ */
|
|
483
|
+
describedBy: F,
|
|
484
|
+
showZone: W,
|
|
485
|
+
tabIndex: B,
|
|
486
|
+
end: /* @__PURE__ */ k(ie, { children: [Re, Le] })
|
|
487
487
|
});
|
|
488
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
494
|
-
presets:
|
|
495
|
-
isSelected: (e) =>
|
|
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
|
-
|
|
497
|
+
X(e, {
|
|
498
498
|
reason: "preset",
|
|
499
499
|
event: t
|
|
500
|
-
}),
|
|
500
|
+
}), I && Ne(t);
|
|
501
501
|
}
|
|
502
502
|
}),
|
|
503
|
-
r !== "time" && /* @__PURE__ */
|
|
503
|
+
r !== "time" && /* @__PURE__ */ O(x, {
|
|
504
504
|
value: $,
|
|
505
505
|
onValueChange: (e, t) => Fe(e, t.event),
|
|
506
|
-
min: C ? d(C, { zone:
|
|
507
|
-
max:
|
|
508
|
-
isDateUnavailable:
|
|
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:
|
|
512
|
-
weekNumbers:
|
|
511
|
+
firstDayOfWeek: L,
|
|
512
|
+
weekNumbers: pe
|
|
513
513
|
}),
|
|
514
|
-
r !== "date" && /* @__PURE__ */
|
|
514
|
+
r !== "date" && /* @__PURE__ */ O(se, {
|
|
515
515
|
value: Oe,
|
|
516
|
-
step:
|
|
517
|
-
locale:
|
|
516
|
+
step: V,
|
|
517
|
+
locale: K,
|
|
518
518
|
hourCycle: y,
|
|
519
|
-
label: r === "time" ?
|
|
519
|
+
label: r === "time" ? xe : "Time",
|
|
520
520
|
min: Ae(C),
|
|
521
|
-
max: Ae(
|
|
522
|
-
emptyLabel:
|
|
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
|
|
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:
|
|
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
|
-
}), [
|
|
540
|
-
start:
|
|
541
|
-
end:
|
|
542
|
-
source:
|
|
543
|
-
}), { start:
|
|
544
|
-
|
|
545
|
-
start:
|
|
546
|
-
end:
|
|
547
|
-
source:
|
|
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:
|
|
549
|
+
let { attachTrigger: U, triggerAttributes: W, triggerElement: be, closeOnChoice: G, id: K, attachField: q, panel: J } = oe({
|
|
550
550
|
ref: t,
|
|
551
|
-
open:
|
|
552
|
-
defaultOpen:
|
|
553
|
-
onOpenChange:
|
|
551
|
+
open: E,
|
|
552
|
+
defaultOpen: D,
|
|
553
|
+
onOpenChange: ne,
|
|
554
554
|
side: P,
|
|
555
|
-
align:
|
|
556
|
-
matchWidth:
|
|
557
|
-
label: typeof b == "string" ? b :
|
|
558
|
-
}),
|
|
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
|
-
|
|
563
|
+
B({
|
|
564
564
|
start: e,
|
|
565
565
|
end: t,
|
|
566
566
|
source: i
|
|
567
|
-
}),
|
|
567
|
+
}), ve(i, {
|
|
568
568
|
reason: n,
|
|
569
569
|
event: r
|
|
570
570
|
});
|
|
571
|
-
},
|
|
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:
|
|
583
|
-
}, Se =
|
|
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":
|
|
597
|
-
tabIndex:
|
|
598
|
-
onClick: (e) =>
|
|
596
|
+
"aria-label": pe,
|
|
597
|
+
tabIndex: R,
|
|
598
|
+
onClick: (e) => Z(null, null, "clear", e)
|
|
599
599
|
},
|
|
600
|
-
children: /* @__PURE__ */
|
|
601
|
-
}), Ce =
|
|
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
|
-
...
|
|
603
|
+
...ge,
|
|
604
604
|
props: he
|
|
605
605
|
},
|
|
606
|
-
attachField:
|
|
607
|
-
attachTrigger: p ? void 0 :
|
|
608
|
-
triggerAttributes: p ? void 0 :
|
|
609
|
-
triggerElement:
|
|
610
|
-
id:
|
|
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:
|
|
615
|
-
placeholder:
|
|
616
|
-
icon: /* @__PURE__ */
|
|
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:
|
|
621
|
+
tabIndex: R,
|
|
622
622
|
inputs: [{
|
|
623
623
|
name: g,
|
|
624
|
-
value:
|
|
624
|
+
value: z?.start ?? ""
|
|
625
625
|
}, {
|
|
626
626
|
name: y,
|
|
627
|
-
value:
|
|
627
|
+
value: z?.end ?? ""
|
|
628
628
|
}],
|
|
629
|
-
onReset: (e) =>
|
|
630
|
-
}) : /* @__PURE__ */
|
|
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: `${
|
|
635
|
+
id: `${K}-label`,
|
|
636
636
|
children: b
|
|
637
|
-
}), /* @__PURE__ */
|
|
638
|
-
ref:
|
|
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
|
-
...
|
|
646
|
-
variant: [
|
|
645
|
+
...ge,
|
|
646
|
+
variant: [ge.variant, {
|
|
647
647
|
disabled: d,
|
|
648
|
-
invalid: h ??
|
|
648
|
+
invalid: h ?? X
|
|
649
649
|
}],
|
|
650
650
|
props: {
|
|
651
651
|
role: "group",
|
|
652
|
-
"aria-labelledby": [b === void 0 ? void 0 : `${
|
|
653
|
-
"aria-invalid": (h ??
|
|
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__ */
|
|
659
|
-
...
|
|
660
|
-
value:
|
|
661
|
-
onValueChange: (e, t) =>
|
|
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":
|
|
664
|
-
invalid: h ??
|
|
663
|
+
props: { "aria-label": w },
|
|
664
|
+
invalid: h ?? X
|
|
665
665
|
}),
|
|
666
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ O(n, {
|
|
667
667
|
component: "dateField.literal",
|
|
668
668
|
props: { "aria-hidden": !0 },
|
|
669
669
|
children: "–"
|
|
670
670
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
...
|
|
673
|
-
value:
|
|
674
|
-
onValueChange: (e, t) =>
|
|
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":
|
|
677
|
-
invalid: h ??
|
|
676
|
+
props: { "aria-label": T },
|
|
677
|
+
invalid: h ?? X
|
|
678
678
|
}),
|
|
679
|
-
/* @__PURE__ */
|
|
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__ */
|
|
684
|
+
children: [Se, /* @__PURE__ */ O(n, {
|
|
685
685
|
tag: "button",
|
|
686
|
-
ref:
|
|
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":
|
|
699
|
-
tabIndex:
|
|
700
|
-
...
|
|
698
|
+
"aria-label": Y ? `${L}, ${Y}` : L,
|
|
699
|
+
tabIndex: R,
|
|
700
|
+
...W
|
|
701
701
|
},
|
|
702
|
-
children: /* @__PURE__ */
|
|
702
|
+
children: /* @__PURE__ */ O(A, {})
|
|
703
703
|
})]
|
|
704
704
|
})
|
|
705
705
|
]
|
|
706
706
|
})] });
|
|
707
|
-
return /* @__PURE__ */
|
|
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: [
|
|
712
|
-
presets:
|
|
713
|
-
isSelected: (e) =>
|
|
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
|
-
|
|
715
|
+
Z(e.start, e.end, "preset", t), j && xe(t);
|
|
716
716
|
}
|
|
717
|
-
}), /* @__PURE__ */
|
|
717
|
+
}), /* @__PURE__ */ O(x, {
|
|
718
718
|
mode: "range",
|
|
719
719
|
months: N,
|
|
720
|
-
value:
|
|
721
|
-
defaultFocusedDate:
|
|
720
|
+
value: z,
|
|
721
|
+
defaultFocusedDate: V ?? void 0,
|
|
722
722
|
onValueChange: (e, t) => {
|
|
723
|
-
|
|
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:
|
|
729
|
+
firstDayOfWeek: se,
|
|
730
730
|
weekNumbers: M
|
|
731
731
|
})]
|
|
732
732
|
}))] });
|
|
733
733
|
}
|
|
734
|
-
var
|
|
734
|
+
var P = e(M, "DatePicker"), F = e(N, "DateRangePicker");
|
|
735
735
|
//#endregion
|
|
736
|
-
export {
|
|
736
|
+
export { F as DateRangePicker, P as default };
|