@box-kite/react 2.2.15 → 2.2.17
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 +1 -1
- package/.claude/skills/box-kite/SKILL.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +1 -1
- package/.cursor/rules/box-kite.mdc +1 -1
- package/AGENTS.md +1 -1
- package/BOX_AI_CONTEXT.md +16 -0
- package/BOX_KITE_AI_CONTEXT.md +16 -0
- package/behavior.cjs +1 -1
- package/behavior.mjs +16 -16
- package/catalog.cjs +1 -1
- package/catalog.mjs +1 -1
- package/client.cjs +1 -1
- package/client.mjs +10 -10
- package/components/accordion.cjs +1 -1
- package/components/accordion.mjs +95 -91
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +212 -210
- package/components/chart.cjs +1 -1
- package/components/chart.d.ts +8 -3
- package/components/chart.mjs +70 -65
- package/components/combobox.cjs +1 -1
- package/components/combobox.mjs +187 -186
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.d.ts +1 -44
- package/components/dashboard.mjs +202 -201
- package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
- package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
- package/components/dataGrid/models/gridModel.d.ts +1 -1
- package/components/dataGrid.cjs +2 -2
- package/components/dataGrid.mjs +10 -10
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +96 -96
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +286 -285
- package/components/dialog.cjs +1 -1
- package/components/dialog.d.ts +2 -64
- package/components/dialog.mjs +131 -126
- package/components/form.cjs +1 -1
- package/components/form.d.ts +4 -3
- package/components/form.mjs +25 -22
- package/components/menu.cjs +1 -1
- package/components/menu.d.ts +2 -73
- package/components/menu.mjs +220 -215
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +44 -43
- package/components/popover.cjs +1 -1
- package/components/popover.d.ts +1 -41
- package/components/popover.mjs +56 -51
- package/components/presence.cjs +1 -1
- package/components/presence.mjs +1 -1
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +59 -55
- package/components/semantics.d.ts +29 -29
- package/components/slider.cjs +1 -1
- package/components/slider.d.ts +1 -55
- package/components/slider.mjs +92 -90
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +149 -148
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +100 -100
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +135 -132
- package/components/toaster.cjs +1 -1
- package/components/toaster.d.ts +1 -37
- package/components/toaster.mjs +130 -128
- package/components/tooltip.cjs +1 -1
- package/components/tooltip.d.ts +1 -34
- package/components/tooltip.mjs +73 -69
- package/components/virtualList.cjs +1 -1
- package/components/virtualList.mjs +88 -87
- package/docs/props.md +2 -2
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/motion.cjs +1 -1
- package/motion.mjs +30 -20
- package/package.json +41 -40
- package/placement.cjs +1 -1
- package/placement.mjs +1 -1
- package/platform.cjs +1 -1
- package/platform.mjs +17 -14
- package/react/animation/useHeldContent.d.ts +6 -0
- package/react/animation/usePresence.d.ts +4 -0
- package/react/componentsContext.d.ts +1 -1
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/scrolling.cjs +1 -1
- package/scrolling.mjs +1 -1
- package/utils/chart/chartUtils.d.ts +3 -2
- package/utils/dashboard/dashboardUtils.d.ts +1 -1
- package/utils/dom/domUtils.d.ts +6 -0
- package/create/src/agents.d.ts +0 -22
- package/create/src/agents.test.d.ts +0 -1
- package/create/src/index.d.ts +0 -1
- package/create/src/options.d.ts +0 -31
- package/create/src/options.test.d.ts +0 -1
- package/create/src/packageManager.d.ts +0 -5
- package/create/src/project.d.ts +0 -27
- package/create/src/project.test.d.ts +0 -1
- package/create/templates/ts/designs/azure.d.ts +0 -5
- package/create/templates/ts/designs/ember.d.ts +0 -5
- package/create/templates/ts/designs/mono.d.ts +0 -5
- package/create/templates/ts/src/App.d.ts +0 -2
- package/create/templates/ts/src/design.d.ts +0 -5
- package/create/templates/ts/src/main.d.ts +0 -0
- package/mcp/src/data.d.ts +0 -90
- package/mcp/src/data.test.d.ts +0 -1
- package/mcp/src/engine.d.ts +0 -23
- package/mcp/src/index.d.ts +0 -1
- package/mcp/src/search.d.ts +0 -38
- package/mcp/src/search.test.d.ts +0 -1
- package/mcp/src/server.d.ts +0 -18
- package/mcp/src/server.test.d.ts +0 -1
- package/mcp/src/styles.d.ts +0 -27
- package/mcp/src/styles.test.d.ts +0 -1
- package/mcp/src/tools.d.ts +0 -18
- package/mcp/src/vocabulary.d.ts +0 -41
- package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
- package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
- package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
- package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
- package/registry/blocks/settings-form/settings-form.d.ts +0 -17
- package/registry/designs/store/address-form.d.ts +0 -11
- package/registry/designs/store/cart-items.d.ts +0 -10
- package/registry/designs/store/cart-page.d.ts +0 -4
- package/registry/designs/store/checkout-page.d.ts +0 -7
- package/registry/designs/store/credit-card-form.d.ts +0 -10
- package/registry/designs/store/form-field.d.ts +0 -19
- package/registry/designs/store/order-summary.d.ts +0 -18
- package/registry/designs/store/product-art.d.ts +0 -26
- package/registry/designs/store/product-card.d.ts +0 -11
- package/registry/designs/store/product-gallery.d.ts +0 -11
- package/registry/designs/store/product-grid.d.ts +0 -10
- package/registry/designs/store/product-page.d.ts +0 -5
- package/registry/designs/store/quantity-stepper.d.ts +0 -13
- package/registry/designs/store/shipping-method.d.ts +0 -14
- package/registry/designs/store/store-data.d.ts +0 -53
- package/registry/designs/store/store-design.d.ts +0 -63
- package/registry/designs/store/store-shell.d.ts +0 -12
- package/registry/designs/store/storefront-page.d.ts +0 -4
- package/registry/designs/store/variant-picker.d.ts +0 -15
- package/supabase/functions/collect/index.d.ts +0 -30
- package/supabase/functions/collect/index.test.d.ts +0 -1
package/components/calendar.mjs
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import t from "../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import ue from "
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
2
|
+
import { f as e } from "../react-shared.mjs";
|
|
3
|
+
import { l as t, m as n } from "../platform.mjs";
|
|
4
|
+
import r from "../box.mjs";
|
|
5
|
+
import { a as i, i as a } from "../behavior.mjs";
|
|
6
|
+
import { t as o } from "../identity.mjs";
|
|
7
|
+
import { C as s, G as c, Q as l, S as ee, U as u, V as te, W as d, Z as ne, f, q as p, t as m, w as h, x as re } from "../dates.mjs";
|
|
8
|
+
import { N as ie, x as ae } from "../date-math.mjs";
|
|
9
|
+
import { a as oe, i as se } from "../reporting.mjs";
|
|
10
|
+
import { Path as ce, Svg as le } from "./svg.mjs";
|
|
11
|
+
import { n as ue } from "../date-environment.mjs";
|
|
12
|
+
import de from "./visuallyHidden.mjs";
|
|
13
|
+
import { useCallback as fe, useEffect as pe, useMemo as me, useRef as he, useState as g } from "react";
|
|
14
|
+
import { Fragment as ge, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
15
|
//#region src/utils/date/calendarModel.ts
|
|
15
|
-
function
|
|
16
|
-
let t =
|
|
16
|
+
function y(e) {
|
|
17
|
+
let t = f(e);
|
|
17
18
|
return t && t.kind === "date" ? t.fields : null;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
20
|
+
function b(e) {
|
|
21
|
+
return h({
|
|
21
22
|
...e,
|
|
22
|
-
...
|
|
23
|
+
...te
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function _e(e, t, n) {
|
|
26
27
|
let r = {
|
|
27
28
|
year: e,
|
|
28
29
|
month: t,
|
|
29
30
|
day: 1
|
|
30
|
-
}, i =
|
|
31
|
+
}, i = u(r, -l(c(r) - n, 7));
|
|
31
32
|
return Array.from({ length: 6 }, (e, r) => {
|
|
32
33
|
let a = Array.from({ length: 7 }, (e, n) => {
|
|
33
|
-
let a =
|
|
34
|
+
let a = u(i, r * 7 + n);
|
|
34
35
|
return {
|
|
35
|
-
date:
|
|
36
|
+
date: b(a),
|
|
36
37
|
day: a.day,
|
|
37
38
|
outside: a.month !== t
|
|
38
39
|
};
|
|
39
|
-
}), o =
|
|
40
|
+
}), o = u(i, r * 7 + l(4 - n, 7));
|
|
40
41
|
return {
|
|
41
|
-
week:
|
|
42
|
+
week: ne(o).week,
|
|
42
43
|
days: a
|
|
43
44
|
};
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
+
function ve(e, t, n, r) {
|
|
47
48
|
let i = r.rtl ? "ArrowLeft" : "ArrowRight", a = r.rtl ? "ArrowRight" : "ArrowLeft";
|
|
48
49
|
switch (t) {
|
|
49
|
-
case i: return
|
|
50
|
-
case a: return
|
|
51
|
-
case "ArrowDown": return
|
|
52
|
-
case "ArrowUp": return
|
|
53
|
-
case "Home": return
|
|
54
|
-
case "End": return
|
|
55
|
-
case "PageUp": return
|
|
56
|
-
case "PageDown": return
|
|
50
|
+
case i: return u(e, 1);
|
|
51
|
+
case a: return u(e, -1);
|
|
52
|
+
case "ArrowDown": return u(e, 7);
|
|
53
|
+
case "ArrowUp": return u(e, -7);
|
|
54
|
+
case "Home": return u(e, -l(c(e) - r.firstDay, 7));
|
|
55
|
+
case "End": return u(e, 6 - l(c(e) - r.firstDay, 7));
|
|
56
|
+
case "PageUp": return d(e, n ? -12 : -1);
|
|
57
|
+
case "PageDown": return d(e, n ? 12 : 1);
|
|
57
58
|
default: return null;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
return t.min != null &&
|
|
62
|
-
}
|
|
63
|
-
function b(e, t) {
|
|
64
|
-
return t.min && f(e) < f(t.min) ? t.min : t.max && f(e) > f(t.max) ? t.max : e;
|
|
61
|
+
function ye(e, t) {
|
|
62
|
+
return t.min != null && p(e) < p(t.min) || t.max != null && p(e) > p(t.max);
|
|
65
63
|
}
|
|
66
64
|
function x(e, t) {
|
|
67
|
-
return
|
|
65
|
+
return t.min && p(e) < p(t.min) ? t.min : t.max && p(e) > p(t.max) ? t.max : e;
|
|
66
|
+
}
|
|
67
|
+
function S(e, t) {
|
|
68
|
+
return p(e) <= p(t) ? [e, t] : [t, e];
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
-
if (!t || !n) return t &&
|
|
71
|
-
let [r, i] =
|
|
72
|
-
return a ===
|
|
70
|
+
function be(e, t, n) {
|
|
71
|
+
if (!t || !n) return t && p(e) === p(t) ? "start" : null;
|
|
72
|
+
let [r, i] = S(t, n), a = p(e);
|
|
73
|
+
return a === p(r) ? "start" : a === p(i) ? "end" : a > p(r) && a < p(i) ? "middle" : null;
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
let [r, i] =
|
|
76
|
-
for (let e =
|
|
75
|
+
function xe(e, t, n) {
|
|
76
|
+
let [r, i] = S(e, t);
|
|
77
|
+
for (let e = p(r); e <= p(i); e++) if (n(b(u({
|
|
77
78
|
year: 1970,
|
|
78
79
|
month: 1,
|
|
79
80
|
day: 1
|
|
@@ -82,24 +83,24 @@ function ye(e, t, n) {
|
|
|
82
83
|
}
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region src/components/calendar.tsx
|
|
85
|
-
var
|
|
86
|
-
function
|
|
87
|
-
return e !== null && t !== null &&
|
|
86
|
+
var Se = "data-date", C = 12;
|
|
87
|
+
function w(e, t) {
|
|
88
|
+
return e !== null && t !== null && p(e) === p(t);
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
let { mode:
|
|
91
|
-
locale:
|
|
92
|
-
zone:
|
|
93
|
-
}), { locale:
|
|
94
|
-
min:
|
|
95
|
-
max:
|
|
96
|
-
}), [
|
|
97
|
-
value:
|
|
98
|
-
defaultValue:
|
|
90
|
+
function Ce(e, c) {
|
|
91
|
+
let { mode: l = "single", value: u, defaultValue: te = null, onValueChange: ne, min: f, max: p, isDateUnavailable: h, locale: ce, zone: le, firstDayOfWeek: Ce, months: E = 1, weekNumbers: O = !1, showOutsideDays: Ee = !0, focusedDate: De, defaultFocusedDate: Oe, onFocusedDateChange: ke, disabled: k = !1, readOnly: Ae = !1, autoFocus: je = !1, label: Me, previousLabel: Ne = "Previous", nextLabel: Pe = "Next", props: Fe, ...Ie } = e, A = ue({
|
|
92
|
+
locale: ce,
|
|
93
|
+
zone: le
|
|
94
|
+
}), { locale: j } = A, M = y(ie(A.zone)), N = Ce ?? ee(j).firstDay, P = (e) => we(j).format(e), F = l === "range", I = me(() => ({
|
|
95
|
+
min: y(f),
|
|
96
|
+
max: y(p)
|
|
97
|
+
}), [f, p]), [L, R] = oe({
|
|
98
|
+
value: u,
|
|
99
|
+
defaultValue: te,
|
|
99
100
|
onChange: (e, t) => {
|
|
100
|
-
|
|
101
|
+
ne?.(e, F ? t : {
|
|
101
102
|
...t,
|
|
102
|
-
...
|
|
103
|
+
...ae(e, A.zone)
|
|
103
104
|
});
|
|
104
105
|
},
|
|
105
106
|
interaction: {
|
|
@@ -107,93 +108,95 @@ function xe(o) {
|
|
|
107
108
|
type: "valueChange",
|
|
108
109
|
content: ["value"]
|
|
109
110
|
}
|
|
110
|
-
}),
|
|
111
|
-
value:
|
|
112
|
-
defaultValue:
|
|
113
|
-
onChange:
|
|
114
|
-
}),
|
|
115
|
-
(
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
}), Le = F ? null : y(L), z = F && L ? L : null, [B, V] = g(null), [Re, H] = g(null), ze = b(x(y(Oe) ?? Le ?? y(z?.start) ?? M, I)), [Be, U] = a({
|
|
112
|
+
value: De,
|
|
113
|
+
defaultValue: ze,
|
|
114
|
+
onChange: ke
|
|
115
|
+
}), W = y(Be) ?? M, [G, Ve] = g("day"), K = se("calendar"), [q, He] = g(() => T(W)), J = q;
|
|
116
|
+
(T(W) < q || T(W) > q + E - 1) && (J = T(W) < q ? T(W) : T(W) - E + 1, He(J));
|
|
117
|
+
let Ue = he(null), We = fe((e) => {
|
|
118
|
+
Ue.current = e, t(c, e);
|
|
119
|
+
}, [c]), Y = he(je), Ge = o("calendar");
|
|
120
|
+
pe(() => {
|
|
121
|
+
Y.current && (Y.current = !1, Ue.current?.querySelector(`[${Se}="${Be}"]`)?.focus());
|
|
119
122
|
});
|
|
120
|
-
let
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
if (
|
|
124
|
-
if (
|
|
125
|
-
|
|
123
|
+
let Ke = (e) => ye(e, I), qe = (e) => h?.(b(e)) ?? !1, X = (e, t, n) => {
|
|
124
|
+
Y.current = n, U(b(x(e, I)), { reason: t });
|
|
125
|
+
}, Je = (e, t) => {
|
|
126
|
+
if (k || Ae || Ke(e) || qe(e)) return;
|
|
127
|
+
if (X(e, "select", !1), !F) {
|
|
128
|
+
R(b(e), {
|
|
126
129
|
reason: "select",
|
|
127
130
|
event: t
|
|
128
131
|
});
|
|
129
132
|
return;
|
|
130
133
|
}
|
|
131
|
-
if (!
|
|
132
|
-
|
|
134
|
+
if (!B) {
|
|
135
|
+
V(e), H(e);
|
|
133
136
|
return;
|
|
134
137
|
}
|
|
135
|
-
let [n, r] =
|
|
136
|
-
|
|
137
|
-
start:
|
|
138
|
-
end:
|
|
138
|
+
let [n, r] = S(B, e);
|
|
139
|
+
V(null), H(null), !(h && xe(n, r, h)) && R({
|
|
140
|
+
start: b(n),
|
|
141
|
+
end: b(r)
|
|
139
142
|
}, {
|
|
140
143
|
reason: "select",
|
|
141
144
|
event: t
|
|
142
145
|
});
|
|
143
|
-
},
|
|
144
|
-
if (
|
|
145
|
-
if (
|
|
146
|
-
|
|
146
|
+
}, Ye = i((e) => {
|
|
147
|
+
if (k) return;
|
|
148
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
149
|
+
e.preventDefault(), Je(W, e);
|
|
147
150
|
return;
|
|
148
151
|
}
|
|
149
|
-
if (
|
|
150
|
-
|
|
152
|
+
if (e.key === "Escape" && B) {
|
|
153
|
+
e.preventDefault(), e.stopPropagation(), V(null), H(null);
|
|
151
154
|
return;
|
|
152
155
|
}
|
|
153
|
-
let
|
|
154
|
-
rtl: e
|
|
155
|
-
firstDay:
|
|
156
|
+
let t = ve(W, e.key, e.shiftKey, {
|
|
157
|
+
rtl: n(e.currentTarget),
|
|
158
|
+
firstDay: N
|
|
156
159
|
});
|
|
157
|
-
|
|
158
|
-
}),
|
|
159
|
-
let t =
|
|
160
|
-
|
|
160
|
+
t && (e.preventDefault(), X(t, "keyboard", !0), B && H(x(t, I)));
|
|
161
|
+
}), Xe = (e) => {
|
|
162
|
+
let t = d(W, e * (G === "day" ? E : G === "month" ? 12 : 144));
|
|
163
|
+
G === "day" && He(J + e * E), X(t, "navigate", !1), K("pageChange", b(t), {
|
|
161
164
|
reason: e === 1 ? "next" : "previous",
|
|
162
165
|
content: ["value"]
|
|
163
166
|
});
|
|
164
|
-
},
|
|
165
|
-
year: Math.floor((
|
|
166
|
-
month: (
|
|
167
|
+
}, Z = Array.from({ length: E }, (e, t) => ({
|
|
168
|
+
year: Math.floor((J + t) / 12),
|
|
169
|
+
month: (J + t) % 12 + 1,
|
|
167
170
|
day: 1
|
|
168
|
-
})),
|
|
169
|
-
locale:
|
|
171
|
+
})), Q = `${Ge}-title`, Ze = G === "day" && E > 1, Qe = G === "day" ? Z.map((e) => m(b(e), {
|
|
172
|
+
locale: j,
|
|
170
173
|
month: "long",
|
|
171
174
|
year: "numeric"
|
|
172
|
-
})).join(" – ") :
|
|
173
|
-
let
|
|
174
|
-
return e.outside && (!
|
|
175
|
+
})).join(" – ") : G === "month" ? P(W.year) : `${P(D(W.year))} – ${P(D(W.year) + C - 1)}`, $e = s(j, "short"), et = $e.some((e) => e.length > 4) ? s(j, "narrow") : $e, tt = s(j, "long"), nt = Array.from({ length: 7 }, (e, t) => (N + t) % 7), rt = B ? Re ?? B : null, it = B ?? y(z?.start), $ = B ? rt : y(z?.end), at = (e) => {
|
|
176
|
+
let t = y(e.date), n = Ke(t), i = qe(t), a = F ? be(t, it, $) : null, o = F ? a !== null : w(t, Le), s = w(t, M), c = w(t, W);
|
|
177
|
+
return e.outside && (!Ee || E > 1) ? /* @__PURE__ */ _(r, {
|
|
175
178
|
tag: "td",
|
|
176
179
|
component: "calendar.cell",
|
|
177
180
|
display: "table-cell",
|
|
178
181
|
props: { role: "gridcell" }
|
|
179
|
-
}, e.date) : /* @__PURE__ */
|
|
182
|
+
}, e.date) : /* @__PURE__ */ _(r, {
|
|
180
183
|
tag: "td",
|
|
181
184
|
component: "calendar.cell",
|
|
182
185
|
display: "table-cell",
|
|
183
186
|
p: 0,
|
|
184
187
|
py: .5,
|
|
185
188
|
variant: {
|
|
186
|
-
rangeStart: a === "start" && $ !== null && !
|
|
189
|
+
rangeStart: a === "start" && $ !== null && !w(it, $),
|
|
187
190
|
rangeEnd: a === "end",
|
|
188
191
|
rangeMiddle: a === "middle"
|
|
189
192
|
},
|
|
190
193
|
props: {
|
|
191
194
|
role: "gridcell",
|
|
192
195
|
"aria-selected": o || void 0,
|
|
193
|
-
"aria-disabled":
|
|
196
|
+
"aria-disabled": n || k || void 0,
|
|
194
197
|
"aria-current": s ? "date" : void 0
|
|
195
198
|
},
|
|
196
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ _(r, {
|
|
197
200
|
component: "calendar.day",
|
|
198
201
|
display: "flex",
|
|
199
202
|
ai: "center",
|
|
@@ -208,69 +211,69 @@ function xe(o) {
|
|
|
208
211
|
today: s,
|
|
209
212
|
selected: o && a !== "middle",
|
|
210
213
|
outside: e.outside,
|
|
211
|
-
blocked:
|
|
214
|
+
blocked: n || k,
|
|
212
215
|
unavailable: i
|
|
213
216
|
},
|
|
214
217
|
props: {
|
|
215
|
-
[
|
|
216
|
-
tabIndex: c && !
|
|
217
|
-
"aria-label":
|
|
218
|
-
locale:
|
|
218
|
+
[Se]: e.date,
|
|
219
|
+
tabIndex: c && !n && !k ? 0 : -1,
|
|
220
|
+
"aria-label": m(e.date, {
|
|
221
|
+
locale: j,
|
|
219
222
|
dateStyle: "full"
|
|
220
223
|
}),
|
|
221
|
-
onClick: (e) =>
|
|
222
|
-
onPointerEnter: () =>
|
|
224
|
+
onClick: (e) => Je(t, e),
|
|
225
|
+
onPointerEnter: () => B && H(t)
|
|
223
226
|
},
|
|
224
|
-
children:
|
|
227
|
+
children: P(e.day)
|
|
225
228
|
})
|
|
226
229
|
}, e.date);
|
|
227
|
-
},
|
|
228
|
-
let s = e
|
|
230
|
+
}, ot = (e, t, r, i, a, o) => {
|
|
231
|
+
let s = n(e.currentTarget), c = {
|
|
229
232
|
ArrowUp: -r,
|
|
230
233
|
ArrowDown: r,
|
|
231
234
|
[s ? "ArrowRight" : "ArrowLeft"]: -1,
|
|
232
235
|
[s ? "ArrowLeft" : "ArrowRight"]: 1
|
|
233
236
|
};
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
let e =
|
|
237
|
+
e.key === "Enter" || e.key === " " ? (e.preventDefault(), i(o)) : e.key in c && (e.preventDefault(), a(Math.max(0, Math.min(t - 1, o + c[e.key])), e.currentTarget.parentElement));
|
|
238
|
+
}, st = () => {
|
|
239
|
+
let e = re(j, "short"), t = D(W.year), n = G === "month" ? e.map((e, t) => ({
|
|
237
240
|
label: e,
|
|
238
|
-
active: t + 1 ===
|
|
239
|
-
current:
|
|
240
|
-
})) : Array.from({ length:
|
|
241
|
-
label:
|
|
242
|
-
active:
|
|
243
|
-
current:
|
|
244
|
-
})), i = (e) =>
|
|
245
|
-
...
|
|
241
|
+
active: t + 1 === W.month,
|
|
242
|
+
current: M.year === W.year && M.month === t + 1
|
|
243
|
+
})) : Array.from({ length: C }, (e, n) => ({
|
|
244
|
+
label: P(t + n),
|
|
245
|
+
active: t + n === W.year,
|
|
246
|
+
current: M.year === t + n
|
|
247
|
+
})), i = (e) => G === "month" ? {
|
|
248
|
+
...W,
|
|
246
249
|
month: e + 1,
|
|
247
250
|
day: 1
|
|
248
251
|
} : {
|
|
249
|
-
...
|
|
250
|
-
year:
|
|
252
|
+
...W,
|
|
253
|
+
year: t + e,
|
|
251
254
|
day: 1
|
|
252
255
|
}, a = (e) => {
|
|
253
256
|
let t = i(e);
|
|
254
|
-
|
|
257
|
+
Y.current = !0, U(b(x({
|
|
255
258
|
...t,
|
|
256
|
-
day: Math.min(
|
|
257
|
-
},
|
|
259
|
+
day: Math.min(W.day, 28)
|
|
260
|
+
}, I)), { reason: "navigate" }), Ve(G === "year" ? "month" : "day"), K("viewChange", G === "year" ? "month" : "day", { reason: "zoom-in" });
|
|
258
261
|
}, o = (e, t) => {
|
|
259
262
|
let n = i(e);
|
|
260
|
-
|
|
263
|
+
U(b({
|
|
261
264
|
...n,
|
|
262
|
-
day: Math.min(
|
|
265
|
+
day: Math.min(W.day, 28)
|
|
263
266
|
}), { reason: "keyboard" }), t?.querySelector(`[data-zoom="${e}"]`)?.focus();
|
|
264
267
|
};
|
|
265
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ _(r, {
|
|
266
269
|
display: "grid",
|
|
267
270
|
gridTemplateColumns: 3,
|
|
268
271
|
gap: 1,
|
|
269
272
|
props: {
|
|
270
273
|
role: "group",
|
|
271
|
-
"aria-labelledby":
|
|
274
|
+
"aria-labelledby": Q
|
|
272
275
|
},
|
|
273
|
-
children:
|
|
276
|
+
children: n.map((e, t) => /* @__PURE__ */ _(r, {
|
|
274
277
|
tag: "button",
|
|
275
278
|
component: "calendar.zoomItem",
|
|
276
279
|
variant: {
|
|
@@ -279,25 +282,25 @@ function xe(o) {
|
|
|
279
282
|
},
|
|
280
283
|
py: 2,
|
|
281
284
|
borderRadius: 2,
|
|
282
|
-
disabled:
|
|
285
|
+
disabled: k,
|
|
283
286
|
props: {
|
|
284
287
|
type: "button",
|
|
285
|
-
"data-zoom":
|
|
288
|
+
"data-zoom": t,
|
|
286
289
|
tabIndex: e.active ? 0 : -1,
|
|
287
290
|
"aria-pressed": e.active,
|
|
288
|
-
onClick: () => a(
|
|
289
|
-
onKeyDown: (e) =>
|
|
291
|
+
onClick: () => a(t),
|
|
292
|
+
onKeyDown: (e) => ot(e, n.length, 3, a, o, t)
|
|
290
293
|
},
|
|
291
294
|
children: e.label
|
|
292
295
|
}, e.label))
|
|
293
296
|
});
|
|
294
|
-
},
|
|
295
|
-
let
|
|
296
|
-
locale:
|
|
297
|
+
}, ct = (e, t) => {
|
|
298
|
+
let n = _e(e.year, e.month, N), i = m(b(e), {
|
|
299
|
+
locale: j,
|
|
297
300
|
month: "long",
|
|
298
301
|
year: "numeric"
|
|
299
302
|
});
|
|
300
|
-
return /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ v(r, {
|
|
301
304
|
tag: "table",
|
|
302
305
|
css: {
|
|
303
306
|
borderCollapse: "collapse",
|
|
@@ -305,23 +308,23 @@ function xe(o) {
|
|
|
305
308
|
},
|
|
306
309
|
props: {
|
|
307
310
|
role: "grid",
|
|
308
|
-
"aria-label":
|
|
309
|
-
"aria-labelledby":
|
|
310
|
-
"aria-readonly":
|
|
311
|
-
onKeyDown:
|
|
311
|
+
"aria-label": E > 1 ? i : void 0,
|
|
312
|
+
"aria-labelledby": E > 1 ? void 0 : Q,
|
|
313
|
+
"aria-readonly": Ae || void 0,
|
|
314
|
+
onKeyDown: Ye
|
|
312
315
|
},
|
|
313
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ _(r, {
|
|
314
317
|
tag: "thead",
|
|
315
318
|
display: "table-header-group",
|
|
316
|
-
children: /* @__PURE__ */
|
|
319
|
+
children: /* @__PURE__ */ v(r, {
|
|
317
320
|
tag: "tr",
|
|
318
321
|
display: "table-row",
|
|
319
|
-
children: [
|
|
322
|
+
children: [O && /* @__PURE__ */ _(r, {
|
|
320
323
|
tag: "th",
|
|
321
324
|
display: "table-cell",
|
|
322
325
|
component: "calendar.weekday",
|
|
323
326
|
props: { "aria-hidden": !0 }
|
|
324
|
-
}),
|
|
327
|
+
}), nt.map((e) => /* @__PURE__ */ _(r, {
|
|
325
328
|
tag: "th",
|
|
326
329
|
display: "table-cell",
|
|
327
330
|
component: "calendar.weekday",
|
|
@@ -329,48 +332,48 @@ function xe(o) {
|
|
|
329
332
|
fontSize: 12,
|
|
330
333
|
props: {
|
|
331
334
|
scope: "col",
|
|
332
|
-
abbr:
|
|
335
|
+
abbr: tt[e]
|
|
333
336
|
},
|
|
334
|
-
children:
|
|
337
|
+
children: et[e]
|
|
335
338
|
}, e))]
|
|
336
339
|
})
|
|
337
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ _(r, {
|
|
338
341
|
tag: "tbody",
|
|
339
342
|
display: "table-row-group",
|
|
340
|
-
children:
|
|
343
|
+
children: n.map((e) => /* @__PURE__ */ v(r, {
|
|
341
344
|
tag: "tr",
|
|
342
345
|
display: "table-row",
|
|
343
|
-
children: [
|
|
346
|
+
children: [O && /* @__PURE__ */ _(r, {
|
|
344
347
|
tag: "td",
|
|
345
348
|
display: "table-cell",
|
|
346
349
|
component: "calendar.weekNumber",
|
|
347
350
|
fontSize: 11,
|
|
348
351
|
textAlign: "center",
|
|
349
352
|
props: { role: "rowheader" },
|
|
350
|
-
children:
|
|
351
|
-
}), e.days.map(
|
|
353
|
+
children: P(e.week)
|
|
354
|
+
}), e.days.map(at)]
|
|
352
355
|
}, e.days[0].date))
|
|
353
356
|
})]
|
|
354
|
-
},
|
|
357
|
+
}, t);
|
|
355
358
|
};
|
|
356
|
-
return /* @__PURE__ */
|
|
357
|
-
ref:
|
|
359
|
+
return /* @__PURE__ */ v(r, {
|
|
360
|
+
ref: We,
|
|
358
361
|
component: "calendar",
|
|
359
362
|
display: "inline-block",
|
|
360
|
-
...
|
|
361
|
-
variant: [
|
|
363
|
+
...Ie,
|
|
364
|
+
variant: [Ie.variant, { disabled: k }],
|
|
362
365
|
props: {
|
|
363
|
-
role:
|
|
364
|
-
"aria-label":
|
|
365
|
-
...
|
|
366
|
-
onPointerLeave: () =>
|
|
366
|
+
role: Me ? "group" : void 0,
|
|
367
|
+
"aria-label": Me,
|
|
368
|
+
...Fe,
|
|
369
|
+
onPointerLeave: () => B && H(B)
|
|
367
370
|
},
|
|
368
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ v(r, {
|
|
369
372
|
position: "relative",
|
|
370
373
|
minHeight: 8,
|
|
371
374
|
mb: 2,
|
|
372
375
|
children: [
|
|
373
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ _(r, {
|
|
374
377
|
tag: "button",
|
|
375
378
|
component: "calendar.nav",
|
|
376
379
|
position: "absolute",
|
|
@@ -382,58 +385,58 @@ function xe(o) {
|
|
|
382
385
|
width: 8,
|
|
383
386
|
height: 8,
|
|
384
387
|
borderRadius: 2,
|
|
385
|
-
disabled:
|
|
388
|
+
disabled: k,
|
|
386
389
|
props: {
|
|
387
390
|
type: "button",
|
|
388
|
-
"aria-label":
|
|
389
|
-
onClick: () =>
|
|
391
|
+
"aria-label": Ne,
|
|
392
|
+
onClick: () => Xe(-1)
|
|
390
393
|
},
|
|
391
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ _(Te, { direction: -1 })
|
|
392
395
|
}),
|
|
393
|
-
|
|
396
|
+
Ze ? /* @__PURE__ */ v(ge, { children: [/* @__PURE__ */ _(r, {
|
|
394
397
|
display: "flex",
|
|
395
398
|
gap: 4,
|
|
396
|
-
children:
|
|
399
|
+
children: Z.map((e) => /* @__PURE__ */ _(r, {
|
|
397
400
|
flex1: !0,
|
|
398
401
|
textAlign: "center",
|
|
399
402
|
py: 1.5,
|
|
400
403
|
fontSize: 14,
|
|
401
404
|
fontWeight: 600,
|
|
402
405
|
props: { "aria-hidden": !0 },
|
|
403
|
-
children:
|
|
404
|
-
locale:
|
|
406
|
+
children: m(b(e), {
|
|
407
|
+
locale: j,
|
|
405
408
|
month: "long",
|
|
406
409
|
year: "numeric"
|
|
407
410
|
})
|
|
408
|
-
},
|
|
409
|
-
}), /* @__PURE__ */
|
|
410
|
-
id:
|
|
411
|
+
}, b(e)))
|
|
412
|
+
}), /* @__PURE__ */ _(de, {
|
|
413
|
+
id: Q,
|
|
411
414
|
props: { "aria-live": "polite" },
|
|
412
|
-
children:
|
|
413
|
-
})] }) : /* @__PURE__ */
|
|
415
|
+
children: Qe
|
|
416
|
+
})] }) : /* @__PURE__ */ _(r, {
|
|
414
417
|
display: "flex",
|
|
415
418
|
jc: "center",
|
|
416
419
|
px: 9,
|
|
417
|
-
children: /* @__PURE__ */
|
|
420
|
+
children: /* @__PURE__ */ _(r, {
|
|
418
421
|
tag: "button",
|
|
419
422
|
component: "calendar.title",
|
|
420
423
|
py: 1.5,
|
|
421
424
|
px: 3,
|
|
422
425
|
borderRadius: 2,
|
|
423
426
|
fontSize: 14,
|
|
424
|
-
id:
|
|
425
|
-
disabled:
|
|
427
|
+
id: Q,
|
|
428
|
+
disabled: k || G === "year",
|
|
426
429
|
props: {
|
|
427
430
|
type: "button",
|
|
428
431
|
"aria-live": "polite",
|
|
429
432
|
onClick: () => {
|
|
430
|
-
|
|
433
|
+
Ve(G === "day" ? "month" : "year"), K("viewChange", G === "day" ? "month" : "year", { reason: "zoom-out" });
|
|
431
434
|
}
|
|
432
435
|
},
|
|
433
|
-
children:
|
|
436
|
+
children: Qe
|
|
434
437
|
})
|
|
435
438
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ _(r, {
|
|
437
440
|
tag: "button",
|
|
438
441
|
component: "calendar.nav",
|
|
439
442
|
position: "absolute",
|
|
@@ -445,42 +448,42 @@ function xe(o) {
|
|
|
445
448
|
width: 8,
|
|
446
449
|
height: 8,
|
|
447
450
|
borderRadius: 2,
|
|
448
|
-
disabled:
|
|
451
|
+
disabled: k,
|
|
449
452
|
props: {
|
|
450
453
|
type: "button",
|
|
451
|
-
"aria-label":
|
|
452
|
-
onClick: () =>
|
|
454
|
+
"aria-label": Pe,
|
|
455
|
+
onClick: () => Xe(1)
|
|
453
456
|
},
|
|
454
|
-
children: /* @__PURE__ */
|
|
457
|
+
children: /* @__PURE__ */ _(Te, { direction: 1 })
|
|
455
458
|
})
|
|
456
459
|
]
|
|
457
|
-
}),
|
|
460
|
+
}), G === "day" ? /* @__PURE__ */ _(r, {
|
|
458
461
|
display: "flex",
|
|
459
462
|
gap: 4,
|
|
460
463
|
ai: "start",
|
|
461
|
-
children:
|
|
462
|
-
}) :
|
|
464
|
+
children: Z.map(ct)
|
|
465
|
+
}) : st()]
|
|
463
466
|
});
|
|
464
467
|
}
|
|
465
|
-
function
|
|
468
|
+
function T(e) {
|
|
466
469
|
return e.year * 12 + e.month - 1;
|
|
467
470
|
}
|
|
468
|
-
var
|
|
469
|
-
function
|
|
470
|
-
let t =
|
|
471
|
-
return t || (t = new Intl.NumberFormat(e, { useGrouping: !1 }),
|
|
471
|
+
var E = /* @__PURE__ */ new Map();
|
|
472
|
+
function we(e) {
|
|
473
|
+
let t = E.get(e);
|
|
474
|
+
return t || (t = new Intl.NumberFormat(e, { useGrouping: !1 }), E.set(e, t)), t;
|
|
472
475
|
}
|
|
473
|
-
function
|
|
474
|
-
return e - (e %
|
|
476
|
+
function D(e) {
|
|
477
|
+
return e - (e % C + C) % C;
|
|
475
478
|
}
|
|
476
|
-
function
|
|
477
|
-
return /* @__PURE__ */
|
|
479
|
+
function Te({ direction: e }) {
|
|
480
|
+
return /* @__PURE__ */ _(le, {
|
|
478
481
|
viewBox: "0 0 16 16",
|
|
479
482
|
width: "1rem",
|
|
480
483
|
height: "1rem",
|
|
481
484
|
rtl: { flip: "xAxis" },
|
|
482
485
|
props: { fill: "none" },
|
|
483
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: /* @__PURE__ */ _(ce, {
|
|
484
487
|
d: e === 1 ? "M6 3l5 5-5 5" : "M10 3L5 8l5 5",
|
|
485
488
|
stroke: "currentColor",
|
|
486
489
|
strokeWidth: 2,
|
|
@@ -489,7 +492,6 @@ function Ce({ direction: e }) {
|
|
|
489
492
|
})
|
|
490
493
|
});
|
|
491
494
|
}
|
|
492
|
-
var
|
|
493
|
-
D.displayName = "Calendar";
|
|
495
|
+
var O = e(Ce, "Calendar");
|
|
494
496
|
//#endregion
|
|
495
|
-
export {
|
|
497
|
+
export { O as default };
|