@mechane-ai/elements 0.53.0 → 0.54.1
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/dist/ai.js +1 -1
- package/dist/{article-qU2scA0w.js → article-DPDk0Xgp.js} +1 -1
- package/dist/article.js +1 -1
- package/dist/catalog.json +1 -1
- package/dist/{categorical-values-DHl0r9od.js → categorical-values-CGavb4HZ.js} +1 -1
- package/dist/{cells-CNZE4us2.js → cells-BTTLURWI.js} +32 -26
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/cells.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +3 -3
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +1 -1
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +2 -2
- package/dist/collections.js +1 -1
- package/dist/{dates-CjlTzw00.js → dates-Cq90-D2X.js} +237 -227
- package/dist/{dumbbell-plot-CKNqa-L2.js → dumbbell-plot-DJOyXW7m.js} +3 -3
- package/dist/{embedding-map-DyCE2isi.js → embedding-map-BSlNwXs2.js} +3 -3
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-DVZlUsa7.js → figure-frame-C2hCrRX4.js} +2 -2
- package/dist/forms/dates.js +1 -1
- package/dist/{image-grid-FByan2gk.js → image-grid-D0Xk_KNk.js} +2 -2
- package/dist/kits/evaluation.js +5 -5
- package/dist/kits/interpretability.js +9 -9
- package/dist/kits/operations.js +5 -5
- package/dist/kits/research.js +107 -102
- package/dist/kits/training.js +5 -5
- package/dist/mdx.js +2 -2
- package/dist/packages/charts/src/cells/heat-cell.d.ts +3 -1
- package/dist/packages/feedback/src/async-region.d.ts +1 -0
- package/dist/packages/forms/src/dates/event-month.d.ts +5 -1
- package/dist/packages/kits/src/research/lineage-graph.d.ts +4 -0
- package/dist/{plot-layout-DjXbV9Lf.js → plot-layout-PBlcYu9p.js} +2 -2
- package/dist/{plot-surface-BJuVNKMs.js → plot-surface-CdqANDC1.js} +1 -1
- package/dist/{reference-lines-DLCFC7OO.js → reference-lines-Cdrs0B3S.js} +1 -1
- package/dist/{scene-C4Q0pFav.js → scene-CcJb3zcs.js} +4 -4
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-DgpKO_1Y.js → slope-chart-CagCaJYG.js} +6 -6
- package/dist/{src-fvoTU3Bq.js → src-BdMdzP0t.js} +1 -1
- package/dist/{src-npqwq3Sa.js → src-Bg4eyJZO.js} +95 -94
- package/dist/styles2.css +12 -0
- package/dist/{time-series-BrM0g-aY.js → time-series-g4trCNxp.js} +6 -6
- package/dist/{token-heatmap-DKIPkRXQ.js → token-heatmap-CgJNUXJH.js} +3 -3
- package/dist/{token-predictions-CKcNk4ks.js → token-predictions-BMVVfAL3.js} +3 -3
- package/dist/{tree-diagram-ZLk2jDUv.js → tree-diagram-BHLewHQl.js} +4 -4
- package/dist/{treemap-D6uNK6Tw.js → treemap-n3Er3k6e.js} +4 -4
- package/dist/{violin-plot-DeHiuWU_.js → violin-plot-qCMn4e1I.js} +3 -3
- package/dist/{waterfall-CihTq6le.js → waterfall-ChExGsn8.js} +3 -3
- package/package.json +1 -1
- package/skills/review-elements/SKILL.md +2 -1
- package/skills/use-elements/references/reports.md +6 -0
|
@@ -2,14 +2,15 @@ import { r as e } from "./control-styles-D3q_Qyxi.js";
|
|
|
2
2
|
import { n as t, t as n } from "./forms-CEbwzlRR.js";
|
|
3
3
|
import { D as r, T as i, k as a } from "./src-9EJskqB_.js";
|
|
4
4
|
import { r as o } from "./src-na2DdkKI.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
5
|
+
import { t as s } from "./accessibility-P89UG9-r.js";
|
|
6
|
+
import * as c from "@stylexjs/stylex";
|
|
7
|
+
import { useEffect as l, useId as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
|
|
8
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { CalendarDays as _, ChevronLeft as v, ChevronRight as y } from "lucide-react";
|
|
10
|
+
import * as b from "@ui-sdk/react/calendar";
|
|
11
|
+
import { DateInput as x, DateInputSegment as S } from "@ui-sdk/react/date-input";
|
|
11
12
|
// packages/forms/src/dates/civil.ts
|
|
12
|
-
var
|
|
13
|
+
var C = {
|
|
13
14
|
maximumYear: 9999,
|
|
14
15
|
monthsPerYear: 12,
|
|
15
16
|
leapCycle: 4,
|
|
@@ -22,12 +23,12 @@ var S = {
|
|
|
22
23
|
yearDigits: 4,
|
|
23
24
|
componentDigits: 2
|
|
24
25
|
};
|
|
25
|
-
function C(e) {
|
|
26
|
-
return Number.isInteger(e.year) && e.year >= 1 && e.year <= S.maximumYear ? Number.isInteger(e.month) && e.month >= 1 && e.month <= S.monthsPerYear : !1;
|
|
27
|
-
}
|
|
28
26
|
function w(e) {
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
return Number.isInteger(e.year) && e.year >= 1 && e.year <= C.maximumYear ? Number.isInteger(e.month) && e.month >= 1 && e.month <= C.monthsPerYear : !1;
|
|
28
|
+
}
|
|
29
|
+
function T(e) {
|
|
30
|
+
if (!w(e) || !Number.isInteger(e.day) || e.day < 1) return !1;
|
|
31
|
+
let t = e.year % C.leapCycle === 0 && (e.year % C.century !== 0 || e.year % C.leapCentury === 0) ? C.leapFebruaryDays : C.februaryDays, { longMonthDays: n, shortMonthDays: r } = C, i = [
|
|
31
32
|
n,
|
|
32
33
|
t,
|
|
33
34
|
n,
|
|
@@ -43,80 +44,80 @@ function w(e) {
|
|
|
43
44
|
];
|
|
44
45
|
return e.day <= (i[e.month - 1] ?? 0);
|
|
45
46
|
}
|
|
46
|
-
function T(e) {
|
|
47
|
-
return e.year * S.monthsPerYear + e.month;
|
|
48
|
-
}
|
|
49
47
|
function E(e) {
|
|
50
|
-
|
|
51
|
-
return `${D(e)}-${String(e.day).padStart(S.componentDigits, "0")}`;
|
|
48
|
+
return e.year * C.monthsPerYear + e.month;
|
|
52
49
|
}
|
|
53
50
|
function D(e) {
|
|
54
|
-
if (!
|
|
55
|
-
return `${
|
|
51
|
+
if (!T(e)) throw RangeError("Cannot serialize an invalid calendar date.");
|
|
52
|
+
return `${O(e)}-${String(e.day).padStart(C.componentDigits, "0")}`;
|
|
56
53
|
}
|
|
57
54
|
function O(e) {
|
|
55
|
+
if (!w(e)) throw RangeError("Cannot serialize an invalid calendar month.");
|
|
56
|
+
return `${String(e.year).padStart(C.yearDigits, "0")}-${String(e.month).padStart(C.componentDigits, "0")}`;
|
|
57
|
+
}
|
|
58
|
+
function k(e) {
|
|
58
59
|
let [t = 0, n = 0, r = 0] = e.split("-").map(Number), i = {
|
|
59
60
|
year: t,
|
|
60
61
|
month: n,
|
|
61
62
|
day: r
|
|
62
63
|
};
|
|
63
|
-
return
|
|
64
|
+
return T(i) && D(i) === e ? i : void 0;
|
|
64
65
|
}
|
|
65
|
-
function
|
|
66
|
+
function A(e) {
|
|
66
67
|
let [t = 0, n = 0] = e.split("-").map(Number), r = {
|
|
67
68
|
year: t,
|
|
68
69
|
month: n
|
|
69
70
|
};
|
|
70
|
-
return
|
|
71
|
+
return w(r) && O(r) === e ? r : void 0;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
-
if (!
|
|
74
|
-
let n = /* @__PURE__ */ new Date(`${
|
|
73
|
+
function j(e, t) {
|
|
74
|
+
if (!T(e) || !Number.isInteger(t)) throw RangeError("Calendar-day arithmetic requires a valid date and integer offset.");
|
|
75
|
+
let n = /* @__PURE__ */ new Date(`${D(e)}T00:00:00Z`);
|
|
75
76
|
n.setUTCDate(n.getUTCDate() + t);
|
|
76
77
|
let r = {
|
|
77
78
|
year: n.getUTCFullYear(),
|
|
78
79
|
month: n.getUTCMonth() + 1,
|
|
79
80
|
day: n.getUTCDate()
|
|
80
81
|
};
|
|
81
|
-
if (!
|
|
82
|
+
if (!T(r)) throw RangeError("Calendar-day arithmetic exceeds the supported years 1–9999.");
|
|
82
83
|
return r;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
-
if (!
|
|
86
|
-
let n = (e.year - 1) *
|
|
87
|
-
year: Math.floor(n /
|
|
88
|
-
month: n %
|
|
85
|
+
function M(e, t) {
|
|
86
|
+
if (!w(e) || !Number.isInteger(t)) throw RangeError("Calendar-month arithmetic requires a valid month and integer offset.");
|
|
87
|
+
let n = (e.year - 1) * C.monthsPerYear + e.month - 1 + t, r = {
|
|
88
|
+
year: Math.floor(n / C.monthsPerYear) + 1,
|
|
89
|
+
month: n % C.monthsPerYear + 1
|
|
89
90
|
};
|
|
90
|
-
if (!
|
|
91
|
+
if (!w(r)) throw RangeError("Calendar-month arithmetic exceeds the supported years 1–9999.");
|
|
91
92
|
return r;
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
94
|
+
function N(e, t) {
|
|
95
|
+
return T(e) ? new Intl.DateTimeFormat(t, {
|
|
95
96
|
dateStyle: "medium",
|
|
96
97
|
timeZone: "UTC",
|
|
97
98
|
calendar: "gregory"
|
|
98
|
-
}).format(Date.parse(`${
|
|
99
|
+
}).format(Date.parse(`${D(e)}T12:00:00Z`)) : "Invalid date";
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
101
|
+
function P(e, t) {
|
|
102
|
+
return w(e) ? new Intl.DateTimeFormat(t, {
|
|
102
103
|
month: "short",
|
|
103
104
|
year: "numeric",
|
|
104
105
|
timeZone: "UTC",
|
|
105
106
|
calendar: "gregory"
|
|
106
|
-
}).format(Date.parse(`${
|
|
107
|
-
}
|
|
108
|
-
function P(e, t, n) {
|
|
109
|
-
if (!w(e)) return "Select a valid date.";
|
|
110
|
-
if (t !== void 0 && E(e) < E(t)) return `Select a date on or after ${E(t)}.`;
|
|
111
|
-
if (n !== void 0 && E(e) > E(n)) return `Select a date on or before ${E(n)}.`;
|
|
107
|
+
}).format(Date.parse(`${O(e)}-01T12:00:00Z`)) : "Invalid month";
|
|
112
108
|
}
|
|
113
109
|
function F(e, t, n) {
|
|
114
|
-
if (!
|
|
115
|
-
if (t !== void 0 &&
|
|
116
|
-
if (n !== void 0 &&
|
|
110
|
+
if (!T(e)) return "Select a valid date.";
|
|
111
|
+
if (t !== void 0 && D(e) < D(t)) return `Select a date on or after ${D(t)}.`;
|
|
112
|
+
if (n !== void 0 && D(e) > D(n)) return `Select a date on or before ${D(n)}.`;
|
|
113
|
+
}
|
|
114
|
+
function I(e, t, n) {
|
|
115
|
+
if (!w(e)) return "Select a valid month.";
|
|
116
|
+
if (t !== void 0 && E(e) < E(t)) return `Select a month on or after ${O(t)}.`;
|
|
117
|
+
if (n !== void 0 && E(e) > E(n)) return `Select a month on or before ${O(n)}.`;
|
|
117
118
|
}
|
|
118
119
|
// packages/forms/src/dates/calendar.tsx
|
|
119
|
-
var
|
|
120
|
+
var L = {
|
|
120
121
|
dayButton: {
|
|
121
122
|
kB7OPa: "x9f619",
|
|
122
123
|
kzqmXN: "x9c6wpo x1ff4b4a",
|
|
@@ -172,16 +173,16 @@ var I = {
|
|
|
172
173
|
$$css: !0
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
|
-
function L(e) {
|
|
176
|
-
return e !== void 0 && w(e) ? E(e) : void 0;
|
|
177
|
-
}
|
|
178
176
|
function R(e) {
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
return e !== void 0 && T(e) ? D(e) : void 0;
|
|
178
|
+
}
|
|
179
|
+
function z(e) {
|
|
180
|
+
let t = f(null);
|
|
181
|
+
d(() => {
|
|
181
182
|
e.autoFocus === !0 && t.current?.querySelector("[tabindex=\"0\"]")?.focus();
|
|
182
183
|
}, [e.autoFocus, e.timeZone]);
|
|
183
|
-
let n =
|
|
184
|
-
return /* @__PURE__ */
|
|
184
|
+
let n = R(e.today) ?? "2000-01-01", r = T(e.initialMonth) ? O(e.initialMonth) : n.slice(0, 7), i = R(e.minimum), a = R(e.maximum), o = e.mode === "range" ? R(e.value?.from) : void 0, s = e.mode === "range" ? R(e.value?.to) : void 0, l = o !== void 0 && s !== void 0 ? [o, s] : null;
|
|
185
|
+
return /* @__PURE__ */ h(b.Calendar, {
|
|
185
186
|
className: "xbixft xpvm0e4 x1hz01jw xj57cvi xtqrqnz x1778rvt x1717udv xezivpi x193iq5w xw2csxc",
|
|
186
187
|
"aria-label": e.label,
|
|
187
188
|
mode: e.mode,
|
|
@@ -194,15 +195,15 @@ function R(e) {
|
|
|
194
195
|
...a !== void 0 && { max: a },
|
|
195
196
|
showOutsideDays: !0,
|
|
196
197
|
deselectable: !0,
|
|
197
|
-
value: e.mode === "single" ?
|
|
198
|
+
value: e.mode === "single" ? R(e.value) ?? null : l,
|
|
198
199
|
onAnchorChange: (t, n) => {
|
|
199
200
|
if (e.mode !== "range") return;
|
|
200
201
|
if (t === null) {
|
|
201
202
|
n.reason === "escape-key" && e.onValueChange(void 0);
|
|
202
203
|
return;
|
|
203
204
|
}
|
|
204
|
-
let r =
|
|
205
|
-
r !== void 0 && (e.value !== void 0 && o !== void 0 &&
|
|
205
|
+
let r = k(t);
|
|
206
|
+
r !== void 0 && (e.value !== void 0 && o !== void 0 && s === void 0 ? (n.cancel(), e.onValueChange(t < o ? {
|
|
206
207
|
from: r,
|
|
207
208
|
to: e.value.from
|
|
208
209
|
} : {
|
|
@@ -211,49 +212,49 @@ function R(e) {
|
|
|
211
212
|
})) : e.onValueChange({ from: r }));
|
|
212
213
|
},
|
|
213
214
|
onValueChange: (t) => {
|
|
214
|
-
if (e.mode === "single") e.onValueChange(typeof t == "string" ?
|
|
215
|
+
if (e.mode === "single") e.onValueChange(typeof t == "string" ? k(t) : void 0);
|
|
215
216
|
else if (Array.isArray(t)) {
|
|
216
|
-
let n =
|
|
217
|
+
let n = k(t[0]), r = k(t[1]);
|
|
217
218
|
n !== void 0 && r !== void 0 && e.onValueChange({
|
|
218
219
|
from: n,
|
|
219
220
|
to: r
|
|
220
221
|
});
|
|
221
222
|
}
|
|
222
223
|
},
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ g("div", {
|
|
224
225
|
className: "x1n2onr6",
|
|
225
226
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ h("div", {
|
|
227
228
|
className: "x78zum5 x6s0dn4 xl56j7k x1f9pz31 x992rv9 x1jfksii",
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ h(b.CalendarHeading, { className: "x1ghz6dp xtqrqnz xk4h15q" })
|
|
229
230
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ g("div", {
|
|
231
232
|
className: "x10l6tqk x17y0mx6 x13vifvy x78zum5 x1qughib x47corl",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ h(b.CalendarPrevious, {
|
|
233
234
|
className: "x3nfvp2 x9f619 x6s0dn4 xl56j7k x9c6wpo x1ff4b4a x1f9pz31 x992rv9 x1717udv xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xbixft xpvm0e4 x67bb7w x1ypdohk x19tlqzf xtgyt42 xqqsu6m xzro3xz x13qnu6 x9v5kkp x19rmrnh x1bqaal",
|
|
234
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */ h(v, {
|
|
235
236
|
"aria-hidden": "true",
|
|
236
237
|
className: "xtwnzbg x18utl2x"
|
|
237
238
|
})
|
|
238
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ h(b.CalendarNext, {
|
|
239
240
|
className: "x3nfvp2 x9f619 x6s0dn4 xl56j7k x9c6wpo x1ff4b4a x1f9pz31 x992rv9 x1717udv xmkeg23 x1y0btm7 x1ey3b81 x1ok0vyi xbixft xpvm0e4 x67bb7w x1ypdohk x19tlqzf xtgyt42 xqqsu6m xzro3xz x13qnu6 x9v5kkp x19rmrnh x1bqaal",
|
|
240
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ h(y, {
|
|
241
242
|
"aria-hidden": "true",
|
|
242
243
|
className: "xtwnzbg x18utl2x"
|
|
243
244
|
})
|
|
244
245
|
})]
|
|
245
246
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ g(b.CalendarGrid, {
|
|
247
248
|
ref: t,
|
|
248
249
|
className: "x1mwwwfo x1gukg7c",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ h(b.CalendarWeekdays, { children: (e) => /* @__PURE__ */ h(b.CalendarWeekday, {
|
|
250
251
|
index: e,
|
|
251
252
|
className: "x153jb6y xj57cvi xy8obcc x1f9pz31 x2b8uid"
|
|
252
|
-
}) }), /* @__PURE__ */
|
|
253
|
+
}) }), /* @__PURE__ */ h(b.CalendarWeeks, { children: (e) => /* @__PURE__ */ h(b.CalendarDay, {
|
|
253
254
|
value: e.date,
|
|
254
255
|
className: (e) => {
|
|
255
|
-
let t = e.rangeStart || e.rangeEnd, n = e.date === o &&
|
|
256
|
-
return
|
|
256
|
+
let t = e.rangeStart || e.rangeEnd, n = e.date === o && s === void 0, r = e.selected || t || n, i = e.inRange && !t;
|
|
257
|
+
return c.props(L.dayButton, e.outside && L.outside, e.today && L.today, r && L.selected, i && L.rangeMiddle, e.disabled && L.disabledDay).className ?? "";
|
|
257
258
|
}
|
|
258
259
|
}) })]
|
|
259
260
|
})
|
|
@@ -262,7 +263,7 @@ function R(e) {
|
|
|
262
263
|
}, e.timeZone);
|
|
263
264
|
}
|
|
264
265
|
// packages/forms/src/dates/date-inputs.tsx
|
|
265
|
-
var
|
|
266
|
+
var B = {
|
|
266
267
|
input: {
|
|
267
268
|
kzqmXN: "xh8yej3",
|
|
268
269
|
k7Eaqz: "xeuugli",
|
|
@@ -308,82 +309,82 @@ var z = {
|
|
|
308
309
|
kMwMTN: "x153jb6y",
|
|
309
310
|
$$css: !0
|
|
310
311
|
}
|
|
311
|
-
},
|
|
312
|
-
year: [
|
|
313
|
-
month: [
|
|
314
|
-
day: [
|
|
315
|
-
hour: [
|
|
316
|
-
minute: [
|
|
317
|
-
second: [
|
|
318
|
-
dayPeriod: [
|
|
319
|
-
literal: [
|
|
312
|
+
}, V = {
|
|
313
|
+
year: [B.segment, B.year],
|
|
314
|
+
month: [B.segment],
|
|
315
|
+
day: [B.segment],
|
|
316
|
+
hour: [B.segment],
|
|
317
|
+
minute: [B.segment],
|
|
318
|
+
second: [B.segment],
|
|
319
|
+
dayPeriod: [B.segment],
|
|
320
|
+
literal: [B.literal]
|
|
320
321
|
};
|
|
321
|
-
function
|
|
322
|
-
return /* @__PURE__ */
|
|
323
|
-
value: r === void 0 ? null :
|
|
324
|
-
...i !== void 0 && { min:
|
|
325
|
-
...a !== void 0 && { max:
|
|
322
|
+
function H({ label: t, value: r, minimum: i, maximum: a, locale: o, onValueChange: s }) {
|
|
323
|
+
return /* @__PURE__ */ g(n.Root, { children: [/* @__PURE__ */ h(n.Label, { children: t }), /* @__PURE__ */ h(x, {
|
|
324
|
+
value: r === void 0 ? null : D(r),
|
|
325
|
+
...i !== void 0 && { min: D(i) },
|
|
326
|
+
...a !== void 0 && { max: D(a) },
|
|
326
327
|
locale: o,
|
|
327
|
-
onValueChange: (e) =>
|
|
328
|
-
...
|
|
329
|
-
children: ({ segments: e }) => e.map((e) => /* @__PURE__ */
|
|
328
|
+
onValueChange: (e) => s(e === null ? void 0 : k(e)),
|
|
329
|
+
...c.props(e.base, e.field, e.singleLineField, B.segments),
|
|
330
|
+
children: ({ segments: e }) => e.map((e) => /* @__PURE__ */ h(S, {
|
|
330
331
|
segment: e,
|
|
331
|
-
...
|
|
332
|
+
...c.props(V[e.type])
|
|
332
333
|
}, e.key))
|
|
333
334
|
})] });
|
|
334
335
|
}
|
|
335
|
-
function
|
|
336
|
-
return /* @__PURE__ */
|
|
336
|
+
function U({ label: e, value: r, minimum: i, maximum: a, onValueChange: o }) {
|
|
337
|
+
return /* @__PURE__ */ g(n.Root, { children: [/* @__PURE__ */ h(n.Label, { children: e }), /* @__PURE__ */ h(t, {
|
|
337
338
|
type: "month",
|
|
338
|
-
value: r === void 0 ? "" :
|
|
339
|
-
min: i === void 0 ? "0001-01" :
|
|
340
|
-
max: a === void 0 ? "9999-12" :
|
|
341
|
-
onChange: (e) => o(
|
|
342
|
-
xstyle:
|
|
339
|
+
value: r === void 0 ? "" : O(r),
|
|
340
|
+
min: i === void 0 ? "0001-01" : O(i),
|
|
341
|
+
max: a === void 0 ? "9999-12" : O(a),
|
|
342
|
+
onChange: (e) => o(A(e.target.value)),
|
|
343
|
+
xstyle: B.input
|
|
343
344
|
})] });
|
|
344
345
|
}
|
|
345
|
-
function
|
|
346
|
-
return /* @__PURE__ */
|
|
346
|
+
function W({ children: e }) {
|
|
347
|
+
return /* @__PURE__ */ h("div", {
|
|
347
348
|
className: "xrvj5dj xnby9oq x1hnptsi",
|
|
348
349
|
children: e
|
|
349
350
|
});
|
|
350
351
|
}
|
|
351
352
|
// packages/forms/src/dates/picker-popover.tsx
|
|
352
|
-
function
|
|
353
|
-
let [y, b] =
|
|
353
|
+
function G({ label: e, value: t, onValueChange: n, formatValue: r, validateValue: s, presets: c = [], density: l = "standard", disabled: d, isClearable: f = !0, timeZone: m, children: v }) {
|
|
354
|
+
let [y, b] = p(!1), [x, S] = p(t), C = u(), w = x === void 0 ? void 0 : s(x);
|
|
354
355
|
function T(e) {
|
|
355
356
|
n(e), b(!1);
|
|
356
357
|
}
|
|
357
|
-
return /* @__PURE__ */
|
|
358
|
+
return /* @__PURE__ */ g(o.Root, {
|
|
358
359
|
open: y,
|
|
359
360
|
onOpenChange: (e) => {
|
|
360
361
|
e && S(t), b(e);
|
|
361
362
|
},
|
|
362
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ g(o.Trigger, {
|
|
363
364
|
disabled: d ?? !1,
|
|
364
|
-
render: /* @__PURE__ */
|
|
365
|
-
density:
|
|
365
|
+
render: /* @__PURE__ */ h(i, {
|
|
366
|
+
density: l,
|
|
366
367
|
variant: "outline"
|
|
367
368
|
}),
|
|
368
369
|
"aria-label": t === void 0 ? e : `${e}: ${r(t)}`,
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ h(_, {
|
|
370
371
|
size: 16,
|
|
371
372
|
"aria-hidden": "true"
|
|
372
373
|
}), t === void 0 ? e : r(t)]
|
|
373
|
-
}), /* @__PURE__ */
|
|
374
|
+
}), /* @__PURE__ */ h(o.Popup, {
|
|
374
375
|
align: "end",
|
|
375
376
|
collisionPadding: 1,
|
|
376
377
|
"aria-label": e,
|
|
377
378
|
className: "x1vae6as x1rxfojk",
|
|
378
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ g("div", {
|
|
379
380
|
className: "x78zum5 xdt5ytf x1n8ia3y xeuugli",
|
|
380
381
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
c.length > 0 && /* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ h(o.Title, { children: e }),
|
|
383
|
+
c.length > 0 && /* @__PURE__ */ h("div", {
|
|
383
384
|
role: "group",
|
|
384
385
|
"aria-label": "Date presets",
|
|
385
386
|
className: "x78zum5 x1a02dak xunmzkg xmmm7uk xso031l x1q0q8m5 x1qndepd",
|
|
386
|
-
children: c.map((e) => /* @__PURE__ */
|
|
387
|
+
children: c.map((e) => /* @__PURE__ */ h(i, {
|
|
387
388
|
variant: "ghost",
|
|
388
389
|
disabled: s(e.value) !== void 0,
|
|
389
390
|
onClick: () => T(e.value),
|
|
@@ -391,31 +392,31 @@ function W({ label: e, value: t, onValueChange: n, formatValue: r, validateValue
|
|
|
391
392
|
}, e.id))
|
|
392
393
|
}),
|
|
393
394
|
y && v(x, S),
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ h("div", {
|
|
395
396
|
id: C,
|
|
396
397
|
"aria-live": "polite",
|
|
397
398
|
className: "xr5kp14 xy8obcc xas2l8k",
|
|
398
399
|
children: w
|
|
399
400
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ g("div", {
|
|
401
402
|
className: "x78zum5 x1a02dak x6s0dn4 x1qughib x1hnptsi x3bg4vu x178xt8z x13fuv20 xhjagg4",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
403
|
+
children: [/* @__PURE__ */ h("span", {
|
|
403
404
|
className: "x153jb6y xy8obcc xas2l8k",
|
|
404
|
-
children:
|
|
405
|
-
}), /* @__PURE__ */
|
|
405
|
+
children: m
|
|
406
|
+
}), /* @__PURE__ */ g("div", {
|
|
406
407
|
className: "x78zum5 x1a02dak x6s0dn4 x1hnptsi",
|
|
407
408
|
children: [
|
|
408
|
-
|
|
409
|
+
f && /* @__PURE__ */ h(a, {
|
|
409
410
|
disabled: t === void 0,
|
|
410
411
|
onClick: () => T(void 0),
|
|
411
412
|
children: "Clear"
|
|
412
413
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ h(i, {
|
|
414
415
|
variant: "ghost",
|
|
415
416
|
onClick: () => b(!1),
|
|
416
417
|
children: "Cancel"
|
|
417
418
|
}),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ h(i, {
|
|
419
420
|
variant: "solid",
|
|
420
421
|
disabled: x === void 0 || w !== void 0,
|
|
421
422
|
"aria-describedby": w === void 0 ? void 0 : C,
|
|
@@ -433,54 +434,54 @@ function W({ label: e, value: t, onValueChange: n, formatValue: r, validateValue
|
|
|
433
434
|
});
|
|
434
435
|
}
|
|
435
436
|
// packages/forms/src/dates/date-picker.tsx
|
|
436
|
-
function
|
|
437
|
-
return /* @__PURE__ */
|
|
437
|
+
function K({ label: e, value: t, onValueChange: n, formatValue: r, density: i, disabled: a, isClearable: o, ...s }) {
|
|
438
|
+
return /* @__PURE__ */ h(G, {
|
|
438
439
|
label: e,
|
|
439
440
|
value: t,
|
|
440
441
|
onValueChange: n,
|
|
441
|
-
formatValue: r ?? ((e) =>
|
|
442
|
-
validateValue: (e) =>
|
|
442
|
+
formatValue: r ?? ((e) => N(e, s.locale)),
|
|
443
|
+
validateValue: (e) => F(e, s.minimum, s.maximum),
|
|
443
444
|
density: i,
|
|
444
445
|
disabled: a,
|
|
445
446
|
isClearable: o,
|
|
446
447
|
timeZone: s.timeZone,
|
|
447
|
-
children: (t, n) => /* @__PURE__ */
|
|
448
|
+
children: (t, n) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(H, {
|
|
448
449
|
label: "Date",
|
|
449
450
|
value: t,
|
|
450
451
|
locale: s.locale,
|
|
451
452
|
minimum: s.minimum,
|
|
452
453
|
maximum: s.maximum,
|
|
453
454
|
onValueChange: n
|
|
454
|
-
}), /* @__PURE__ */
|
|
455
|
+
}), /* @__PURE__ */ h(z, {
|
|
455
456
|
...s,
|
|
456
457
|
label: e,
|
|
457
458
|
mode: "single",
|
|
458
459
|
autoFocus: !0,
|
|
459
460
|
value: t,
|
|
460
|
-
initialMonth: t !== void 0 &&
|
|
461
|
+
initialMonth: t !== void 0 && T(t) ? t : s.initialMonth,
|
|
461
462
|
onValueChange: n
|
|
462
463
|
})] })
|
|
463
464
|
});
|
|
464
465
|
}
|
|
465
466
|
// packages/forms/src/dates/date-range-picker.tsx
|
|
466
|
-
function
|
|
467
|
+
function q({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, validateRange: a, density: o, disabled: s, isClearable: c, ...l }) {
|
|
467
468
|
function u(e) {
|
|
468
469
|
if (e.to === void 0) return "Select a start and end date.";
|
|
469
|
-
let t =
|
|
470
|
-
return t === void 0 ?
|
|
470
|
+
let t = F(e.from, l.minimum, l.maximum) ?? F(e.to, l.minimum, l.maximum);
|
|
471
|
+
return t === void 0 ? D(e.from) > D(e.to) ? "End date must be on or after start date." : a?.({
|
|
471
472
|
from: e.from,
|
|
472
473
|
to: e.to
|
|
473
474
|
}) : t;
|
|
474
475
|
}
|
|
475
476
|
function d(e) {
|
|
476
|
-
if (e.to === void 0) return
|
|
477
|
+
if (e.to === void 0) return N(e.from, l.locale);
|
|
477
478
|
let t = {
|
|
478
479
|
from: e.from,
|
|
479
480
|
to: e.to
|
|
480
481
|
};
|
|
481
|
-
return r?.(t) ?? `${
|
|
482
|
+
return r?.(t) ?? `${N(t.from, l.locale)} – ${N(t.to, l.locale)}`;
|
|
482
483
|
}
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ h(G, {
|
|
484
485
|
label: e,
|
|
485
486
|
value: t,
|
|
486
487
|
formatValue: d,
|
|
@@ -496,7 +497,7 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
496
497
|
to: e.to
|
|
497
498
|
});
|
|
498
499
|
},
|
|
499
|
-
children: (t, n) => /* @__PURE__ */
|
|
500
|
+
children: (t, n) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(W, { children: [/* @__PURE__ */ h(H, {
|
|
500
501
|
label: "Start date",
|
|
501
502
|
value: t?.from,
|
|
502
503
|
locale: l.locale,
|
|
@@ -506,7 +507,7 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
506
507
|
from: e,
|
|
507
508
|
to: t?.to
|
|
508
509
|
})
|
|
509
|
-
}), /* @__PURE__ */
|
|
510
|
+
}), /* @__PURE__ */ h(H, {
|
|
510
511
|
label: "End date",
|
|
511
512
|
value: t?.to,
|
|
512
513
|
locale: l.locale,
|
|
@@ -521,32 +522,32 @@ function K({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
521
522
|
to: e
|
|
522
523
|
});
|
|
523
524
|
}
|
|
524
|
-
})] }), /* @__PURE__ */
|
|
525
|
+
})] }), /* @__PURE__ */ h(z, {
|
|
525
526
|
...l,
|
|
526
527
|
label: e,
|
|
527
528
|
mode: "range",
|
|
528
529
|
autoFocus: !0,
|
|
529
530
|
value: t,
|
|
530
|
-
initialMonth: t !== void 0 &&
|
|
531
|
+
initialMonth: t !== void 0 && T(t.from) ? t.from : l.initialMonth,
|
|
531
532
|
onValueChange: n
|
|
532
533
|
})] })
|
|
533
534
|
});
|
|
534
535
|
}
|
|
535
536
|
// packages/forms/src/dates/month-calendar.tsx
|
|
536
|
-
var
|
|
537
|
+
var J = { month: {
|
|
537
538
|
kzqmXN: "xh8yej3",
|
|
538
539
|
$$css: !0
|
|
539
540
|
} };
|
|
540
|
-
function
|
|
541
|
-
let r =
|
|
541
|
+
function Y(e, t, n) {
|
|
542
|
+
let r = w(e) ? e : {
|
|
542
543
|
year: 2e3,
|
|
543
544
|
month: 1
|
|
544
545
|
};
|
|
545
|
-
return t !== void 0 &&
|
|
546
|
+
return t !== void 0 && E(r) < E(t) ? t : n !== void 0 && E(r) > E(n) ? n : r;
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
-
let
|
|
549
|
-
|
|
548
|
+
function X({ label: e, selection: t, onSelect: n, locale: a, today: o, initialMonth: s, minimum: c, maximum: u }) {
|
|
549
|
+
let d = Y(s, c, u), [m, _] = p(d.year), [b, x] = p(d), S = f(/* @__PURE__ */ new Map()), C = f(!1);
|
|
550
|
+
l(() => {
|
|
550
551
|
C.current && (C.current = !1, S.current.get(b.month)?.focus());
|
|
551
552
|
}, [b]);
|
|
552
553
|
function w(e, t) {
|
|
@@ -560,121 +561,121 @@ function Y({ label: e, selection: t, onSelect: n, locale: a, today: o, initialMo
|
|
|
560
561
|
}[e.key];
|
|
561
562
|
if (e.key === "Home" && (n = 1 - t.month), e.key === "End" && (n = 12 - t.month), n === void 0) return;
|
|
562
563
|
e.preventDefault();
|
|
563
|
-
let r = Math.max(12, Math.min(119999,
|
|
564
|
+
let r = Math.max(12, Math.min(119999, E(t) - 1 + n)), i = Y({
|
|
564
565
|
year: Math.floor(r / 12),
|
|
565
566
|
month: r % 12 + 1
|
|
566
|
-
},
|
|
567
|
-
C.current = !0,
|
|
567
|
+
}, c, u);
|
|
568
|
+
C.current = !0, _(i.year), x(i);
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
-
let t =
|
|
570
|
+
function T(e) {
|
|
571
|
+
let t = Y({
|
|
571
572
|
year: e,
|
|
572
573
|
month: b.month
|
|
573
|
-
},
|
|
574
|
-
|
|
574
|
+
}, c, u);
|
|
575
|
+
_(t.year), x(t);
|
|
575
576
|
}
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ g("div", {
|
|
577
578
|
className: "x78zum5 xdt5ytf x1hnptsi xeuugli",
|
|
578
|
-
children: [/* @__PURE__ */
|
|
579
|
+
children: [/* @__PURE__ */ g("div", {
|
|
579
580
|
className: "x78zum5 x6s0dn4 x1qughib x1hnptsi",
|
|
580
581
|
children: [
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ h(r, {
|
|
582
583
|
"aria-label": "Previous year",
|
|
583
|
-
disabled:
|
|
584
|
-
onClick: () =>
|
|
585
|
-
children: /* @__PURE__ */
|
|
584
|
+
disabled: m <= (c?.year ?? 1),
|
|
585
|
+
onClick: () => T(m - 1),
|
|
586
|
+
children: /* @__PURE__ */ h(v, { size: 16 })
|
|
586
587
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ h("span", {
|
|
588
589
|
"aria-live": "polite",
|
|
589
590
|
className: "xk4h15q xss6m8b",
|
|
590
|
-
children:
|
|
591
|
+
children: m
|
|
591
592
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ h(r, {
|
|
593
594
|
"aria-label": "Next year",
|
|
594
|
-
disabled:
|
|
595
|
-
onClick: () =>
|
|
596
|
-
children: /* @__PURE__ */
|
|
595
|
+
disabled: m >= (u?.year ?? 9999),
|
|
596
|
+
onClick: () => T(m + 1),
|
|
597
|
+
children: /* @__PURE__ */ h(y, { size: 16 })
|
|
597
598
|
})
|
|
598
599
|
]
|
|
599
|
-
}), /* @__PURE__ */
|
|
600
|
+
}), /* @__PURE__ */ h("div", {
|
|
600
601
|
role: "group",
|
|
601
602
|
"aria-label": e,
|
|
602
603
|
className: "xrvj5dj x185a7wo xunmzkg",
|
|
603
604
|
children: Array.from({ length: 12 }, (e, r) => {
|
|
604
605
|
let s = {
|
|
605
|
-
year:
|
|
606
|
+
year: m,
|
|
606
607
|
month: r + 1
|
|
607
|
-
},
|
|
608
|
-
return /* @__PURE__ */
|
|
609
|
-
variant: p ||
|
|
610
|
-
"aria-label":
|
|
611
|
-
"aria-pressed": p ||
|
|
612
|
-
"aria-current":
|
|
608
|
+
}, l = E(s), d = t === void 0 ? void 0 : E(t.from), f = t?.to === void 0 ? void 0 : E(t.to), p = l === d || l === f, g = d !== void 0 && f !== void 0 && l > d && l < f, _ = c !== void 0 && l < E(c), v = u !== void 0 && l > E(u), y = _ || v;
|
|
609
|
+
return /* @__PURE__ */ h(i, {
|
|
610
|
+
variant: p || g ? "solid" : "ghost",
|
|
611
|
+
"aria-label": P(s, a),
|
|
612
|
+
"aria-pressed": p || g,
|
|
613
|
+
"aria-current": m === o.year && s.month === o.month ? "date" : void 0,
|
|
613
614
|
disabled: y,
|
|
614
|
-
tabIndex: b.year ===
|
|
615
|
+
tabIndex: b.year === m && b.month === s.month ? 0 : -1,
|
|
615
616
|
ref: (e) => {
|
|
616
617
|
e === null ? S.current.delete(s.month) : S.current.set(s.month, e);
|
|
617
618
|
},
|
|
618
619
|
onFocus: () => x(s),
|
|
619
620
|
onKeyDown: (e) => w(e, s),
|
|
620
621
|
onClick: () => n(s),
|
|
621
|
-
xstyle:
|
|
622
|
+
xstyle: J.month,
|
|
622
623
|
children: new Intl.DateTimeFormat(a, {
|
|
623
624
|
month: "short",
|
|
624
625
|
timeZone: "UTC",
|
|
625
626
|
calendar: "gregory"
|
|
626
|
-
}).format(/* @__PURE__ */ new Date(`${String(
|
|
627
|
+
}).format(/* @__PURE__ */ new Date(`${String(m).padStart(4, "0")}-${String(s.month).padStart(2, "0")}-01T12:00:00Z`))
|
|
627
628
|
}, s.month);
|
|
628
629
|
})
|
|
629
630
|
})]
|
|
630
631
|
});
|
|
631
632
|
}
|
|
632
633
|
// packages/forms/src/dates/month-picker.tsx
|
|
633
|
-
function
|
|
634
|
-
return /* @__PURE__ */
|
|
634
|
+
function Z({ label: e, value: t, onValueChange: n, formatValue: r, density: i, disabled: a, isClearable: o, ...s }) {
|
|
635
|
+
return /* @__PURE__ */ h(G, {
|
|
635
636
|
label: e,
|
|
636
637
|
value: t,
|
|
637
638
|
onValueChange: n,
|
|
638
|
-
formatValue: r ?? ((e) =>
|
|
639
|
-
validateValue: (e) =>
|
|
639
|
+
formatValue: r ?? ((e) => P(e, s.locale)),
|
|
640
|
+
validateValue: (e) => I(e, s.minimum, s.maximum),
|
|
640
641
|
density: i,
|
|
641
642
|
disabled: a,
|
|
642
643
|
isClearable: o,
|
|
643
644
|
timeZone: s.timeZone,
|
|
644
|
-
children: (t, n) => /* @__PURE__ */
|
|
645
|
+
children: (t, n) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(U, {
|
|
645
646
|
label: "Month",
|
|
646
647
|
value: t,
|
|
647
648
|
minimum: s.minimum,
|
|
648
649
|
maximum: s.maximum,
|
|
649
650
|
onValueChange: n
|
|
650
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ h(X, {
|
|
651
652
|
...s,
|
|
652
653
|
label: e,
|
|
653
654
|
selection: t === void 0 ? void 0 : { from: t },
|
|
654
|
-
initialMonth: t !== void 0 &&
|
|
655
|
+
initialMonth: t !== void 0 && w(t) ? t : s.initialMonth,
|
|
655
656
|
onSelect: n
|
|
656
657
|
})] })
|
|
657
658
|
});
|
|
658
659
|
}
|
|
659
660
|
// packages/forms/src/dates/month-range-picker.tsx
|
|
660
|
-
function
|
|
661
|
+
function Q({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, validateRange: a, density: o, disabled: s, isClearable: c, ...l }) {
|
|
661
662
|
function u(e) {
|
|
662
663
|
if (e.to === void 0) return "Select a start and end month.";
|
|
663
|
-
let t =
|
|
664
|
-
return t === void 0 ?
|
|
664
|
+
let t = I(e.from, l.minimum, l.maximum) ?? I(e.to, l.minimum, l.maximum);
|
|
665
|
+
return t === void 0 ? E(e.from) > E(e.to) ? "End month must be on or after start month." : a?.({
|
|
665
666
|
from: e.from,
|
|
666
667
|
to: e.to
|
|
667
668
|
}) : t;
|
|
668
669
|
}
|
|
669
670
|
function d(e) {
|
|
670
|
-
if (e.to === void 0) return
|
|
671
|
+
if (e.to === void 0) return P(e.from, l.locale);
|
|
671
672
|
let t = {
|
|
672
673
|
from: e.from,
|
|
673
674
|
to: e.to
|
|
674
675
|
};
|
|
675
|
-
return r?.(t) ?? `${
|
|
676
|
+
return r?.(t) ?? `${P(t.from, l.locale)} – ${P(t.to, l.locale)}`;
|
|
676
677
|
}
|
|
677
|
-
return /* @__PURE__ */
|
|
678
|
+
return /* @__PURE__ */ h(G, {
|
|
678
679
|
label: e,
|
|
679
680
|
value: t,
|
|
680
681
|
formatValue: d,
|
|
@@ -690,7 +691,7 @@ function Z({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
690
691
|
to: e.to
|
|
691
692
|
});
|
|
692
693
|
},
|
|
693
|
-
children: (t, n) => /* @__PURE__ */
|
|
694
|
+
children: (t, n) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(W, { children: [/* @__PURE__ */ h(U, {
|
|
694
695
|
label: "Start month",
|
|
695
696
|
value: t?.from,
|
|
696
697
|
minimum: l.minimum,
|
|
@@ -699,7 +700,7 @@ function Z({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
699
700
|
from: e,
|
|
700
701
|
to: t?.to
|
|
701
702
|
})
|
|
702
|
-
}), /* @__PURE__ */
|
|
703
|
+
}), /* @__PURE__ */ h(U, {
|
|
703
704
|
label: "End month",
|
|
704
705
|
value: t?.to,
|
|
705
706
|
minimum: l.minimum,
|
|
@@ -713,13 +714,13 @@ function Z({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
713
714
|
to: e
|
|
714
715
|
});
|
|
715
716
|
}
|
|
716
|
-
})] }), /* @__PURE__ */
|
|
717
|
+
})] }), /* @__PURE__ */ h(X, {
|
|
717
718
|
...l,
|
|
718
719
|
label: e,
|
|
719
720
|
selection: t,
|
|
720
|
-
initialMonth: t !== void 0 &&
|
|
721
|
+
initialMonth: t !== void 0 && w(t.from) ? t.from : l.initialMonth,
|
|
721
722
|
onSelect: (e) => {
|
|
722
|
-
t === void 0 || t.to !== void 0 ? n({ from: e }) :
|
|
723
|
+
t === void 0 || t.to !== void 0 ? n({ from: e }) : E(e) < E(t.from) ? n({
|
|
723
724
|
from: e,
|
|
724
725
|
to: t.from
|
|
725
726
|
}) : n({
|
|
@@ -731,44 +732,45 @@ function Z({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
|
|
|
731
732
|
});
|
|
732
733
|
}
|
|
733
734
|
// packages/forms/src/dates/event-month.tsx
|
|
734
|
-
var
|
|
735
|
-
function
|
|
736
|
-
let
|
|
737
|
-
function
|
|
738
|
-
let t =
|
|
739
|
-
t !== void 0 &&
|
|
735
|
+
var $ = 2;
|
|
736
|
+
function ee({ label: e, loading: t, locale: n, timeZone: r, today: i, selected: a, weekStartsOn: o = 1, itemsByDate: l, onSelect: u }) {
|
|
737
|
+
let d = D(a), f = D(i);
|
|
738
|
+
function p(e) {
|
|
739
|
+
let t = k(e);
|
|
740
|
+
t !== void 0 && u(t);
|
|
740
741
|
}
|
|
741
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ g(b.Calendar, {
|
|
742
743
|
"aria-label": e,
|
|
743
744
|
mode: "single",
|
|
744
|
-
locale:
|
|
745
|
-
timeZone:
|
|
746
|
-
today:
|
|
747
|
-
month:
|
|
748
|
-
value:
|
|
749
|
-
weekStartsOn:
|
|
745
|
+
locale: n,
|
|
746
|
+
timeZone: r,
|
|
747
|
+
today: f,
|
|
748
|
+
month: O(a),
|
|
749
|
+
value: d,
|
|
750
|
+
weekStartsOn: o,
|
|
750
751
|
weekdayFormat: "short",
|
|
751
752
|
showOutsideDays: !0,
|
|
752
753
|
onValueChange: (e) => {
|
|
753
|
-
typeof e == "string" &&
|
|
754
|
+
typeof e == "string" && p(e);
|
|
754
755
|
},
|
|
755
756
|
onFocusedChange: (e, t) => {
|
|
756
|
-
t.reason === "list-navigation" &&
|
|
757
|
+
t.reason === "list-navigation" && p(e);
|
|
757
758
|
},
|
|
758
|
-
children: /* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ g(b.CalendarGrid, {
|
|
760
|
+
"aria-busy": t !== void 0,
|
|
759
761
|
className: "xh8yej3 x140o2bo x1mwwwfo x1y0btm7 xmkeg23 x1ey3b81 xpvm0e4 xbixft x1hz01jw",
|
|
760
|
-
children: [/* @__PURE__ */
|
|
762
|
+
children: [/* @__PURE__ */ h(b.CalendarWeekdays, { children: (e) => /* @__PURE__ */ h(b.CalendarWeekday, {
|
|
761
763
|
index: e,
|
|
762
764
|
className: "xn9t2bk x14w6jbu x153jb6y x2b8uid xy8obcc xk4h15q"
|
|
763
|
-
}) }), /* @__PURE__ */
|
|
764
|
-
let
|
|
765
|
-
if (
|
|
766
|
-
let
|
|
767
|
-
|
|
768
|
-
...
|
|
769
|
-
|
|
765
|
+
}) }), /* @__PURE__ */ h(b.CalendarWeeks, { children: (e) => {
|
|
766
|
+
let r = k(e.date);
|
|
767
|
+
if (r === void 0) return null;
|
|
768
|
+
let i = l.get(e.date) ?? [], o = i.length === 0 && r.month === a.month, s = i.length - $, c = i.slice(0, $), u = [
|
|
769
|
+
N(r, n),
|
|
770
|
+
...c.map((e) => e.label),
|
|
771
|
+
s > 0 && `+${s} more`
|
|
770
772
|
].filter(Boolean).join(", ");
|
|
771
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ h(b.CalendarDay, {
|
|
772
774
|
value: e.date,
|
|
773
775
|
"aria-label": u,
|
|
774
776
|
...{
|
|
@@ -776,27 +778,31 @@ function $({ label: e, locale: t, timeZone: n, today: r, selected: i, weekStarts
|
|
|
776
778
|
2: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x153jb6y x1r7kqkb" },
|
|
777
779
|
1: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x1r8u7ye" },
|
|
778
780
|
3: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x153jb6y x1r8u7ye" }
|
|
779
|
-
}[(
|
|
780
|
-
children: /* @__PURE__ */
|
|
781
|
+
}[(r.month !== a.month) << 1 | e.date === d],
|
|
782
|
+
children: /* @__PURE__ */ g("div", {
|
|
781
783
|
className: "xrvj5dj x10ukxgv xunmzkg xefclja x13wpdut x1s01oa9",
|
|
782
784
|
"aria-hidden": "true",
|
|
783
785
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ h("span", {
|
|
785
787
|
...{
|
|
786
788
|
0: { className: "x1lqcxt8 x14w6jbu xy8obcc x1ok0vyi" },
|
|
787
789
|
1: { className: "x1lqcxt8 x14w6jbu xy8obcc x1ok0vyi x7ixh4y x1r8u7ye xtjd4bd" }
|
|
788
|
-
}[e.date ===
|
|
789
|
-
children:
|
|
790
|
+
}[e.date === f | 0],
|
|
791
|
+
children: r.day
|
|
792
|
+
}),
|
|
793
|
+
t !== void 0 && o && /* @__PURE__ */ h("span", {
|
|
794
|
+
className: "xqcmdr3 x1qme5af x13ux6vm x1irg2zc xskzprw",
|
|
795
|
+
children: t.placeholder
|
|
790
796
|
}),
|
|
791
|
-
|
|
797
|
+
c.map((e) => /* @__PURE__ */ h("span", {
|
|
792
798
|
className: "x1lliihq xb3r6kr xlyipyv xuxw1ft x14w6jbu xy8obcc x1r7kqkb x1ok0vyi",
|
|
793
799
|
children: e.label
|
|
794
800
|
}, e.id)),
|
|
795
|
-
|
|
801
|
+
s > 0 && /* @__PURE__ */ g("span", {
|
|
796
802
|
className: "xy8obcc x153jb6y xuxw1ft xb3r6kr",
|
|
797
803
|
children: [
|
|
798
804
|
"+",
|
|
799
|
-
|
|
805
|
+
s,
|
|
800
806
|
" more"
|
|
801
807
|
]
|
|
802
808
|
})
|
|
@@ -804,7 +810,11 @@ function $({ label: e, locale: t, timeZone: n, today: r, selected: i, weekStarts
|
|
|
804
810
|
})
|
|
805
811
|
});
|
|
806
812
|
} })]
|
|
807
|
-
})
|
|
813
|
+
}), t !== void 0 && /* @__PURE__ */ h("span", {
|
|
814
|
+
role: "status",
|
|
815
|
+
...c.props(s.hidden),
|
|
816
|
+
children: t.label
|
|
817
|
+
})]
|
|
808
818
|
});
|
|
809
819
|
}
|
|
810
|
-
export {
|
|
820
|
+
export { K as a, M as c, D as d, O as f, q as i, k as l, Q as n, z as o, Z as r, j as s, ee as t, A as u };
|