@serendie/ui 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { CalendarDate as S } from "../../../@internationalized/date/dist/CalendarDate.js";
|
|
2
|
+
import { toCalendarDate as g, toCalendarDateTime as P } from "../../../@internationalized/date/dist/conversion.js";
|
|
3
|
+
import { now as T, startOfYear as D, endOfYear as j, startOfWeek as m, endOfWeek as Y, startOfMonth as y, endOfMonth as R, maxDate as O, minDate as W, today as M, getLocalTimeZone as A, isSameDay as $, getWeeksInMonth as z } from "../../../@internationalized/date/dist/queries.js";
|
|
4
|
+
import { DateFormatter as h } from "../../../@internationalized/date/dist/DateFormatter.js";
|
|
5
|
+
function L(t, r, n, e, s) {
|
|
6
|
+
const a = {};
|
|
7
|
+
for (let c in r) {
|
|
8
|
+
const u = c, f = r[u];
|
|
9
|
+
f != null && (a[u] = Math.floor(f / 2), a[u] > 0 && f % 2 === 0 && a[u]--);
|
|
10
|
+
}
|
|
11
|
+
const o = d(t, r, n).subtract(a);
|
|
12
|
+
return i(t, o, r, n, e, s);
|
|
13
|
+
}
|
|
14
|
+
function d(t, r, n, e, s) {
|
|
15
|
+
let a = t;
|
|
16
|
+
return r.years ? a = D(t) : r.months ? a = y(t) : r.weeks && (a = m(t, n)), i(t, a, r, n, e, s);
|
|
17
|
+
}
|
|
18
|
+
function F(t, r, n, e, s) {
|
|
19
|
+
let a = { ...r };
|
|
20
|
+
a.days ? a.days-- : a.weeks ? a.weeks-- : a.months ? a.months-- : a.years && a.years--;
|
|
21
|
+
let o = d(t, r, n).subtract(a);
|
|
22
|
+
return i(t, o, r, n, e, s);
|
|
23
|
+
}
|
|
24
|
+
function i(t, r, n, e, s, a) {
|
|
25
|
+
return s && t.compare(s) >= 0 && (r = O(r, d(g(s), n, e))), a && t.compare(a) <= 0 && (r = W(r, F(g(a), n, e))), r;
|
|
26
|
+
}
|
|
27
|
+
function p(t, r, n) {
|
|
28
|
+
let e = g(t);
|
|
29
|
+
return r && (e = O(e, g(r))), n && (e = W(e, g(n))), e;
|
|
30
|
+
}
|
|
31
|
+
function at(t, r, n, e, s, a) {
|
|
32
|
+
switch (r) {
|
|
33
|
+
case "start":
|
|
34
|
+
return d(t, n, e, s, a);
|
|
35
|
+
case "end":
|
|
36
|
+
return F(t, n, e, s, a);
|
|
37
|
+
case "center":
|
|
38
|
+
default:
|
|
39
|
+
return L(t, n, e, s, a);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function st(t, r) {
|
|
43
|
+
return r != null && $(t, r);
|
|
44
|
+
}
|
|
45
|
+
function ot(t, r, n, e, s) {
|
|
46
|
+
return t ? r != null && r(t, n) ? !0 : w(t, e, s) : !1;
|
|
47
|
+
}
|
|
48
|
+
function w(t, r, n) {
|
|
49
|
+
return r != null && t.compare(r) < 0 || n != null && t.compare(n) > 0;
|
|
50
|
+
}
|
|
51
|
+
function ct(t, r, n) {
|
|
52
|
+
const e = t.subtract({ days: 1 });
|
|
53
|
+
return $(e, t) || w(e, r, n);
|
|
54
|
+
}
|
|
55
|
+
function ft(t, r, n) {
|
|
56
|
+
const e = t.add({ days: 1 });
|
|
57
|
+
return $(e, t) || w(e, r, n);
|
|
58
|
+
}
|
|
59
|
+
function E(t) {
|
|
60
|
+
let r = { ...t };
|
|
61
|
+
for (let n in r) r[n] = 1;
|
|
62
|
+
return r;
|
|
63
|
+
}
|
|
64
|
+
function Q(t, r) {
|
|
65
|
+
let n = { ...r };
|
|
66
|
+
return n.days ? n.days-- : n.days = -1, t.add(n);
|
|
67
|
+
}
|
|
68
|
+
function C(t) {
|
|
69
|
+
return (t == null ? void 0 : t.calendar.identifier) === "gregory" && t.era === "BC" ? "short" : void 0;
|
|
70
|
+
}
|
|
71
|
+
function _(t, r) {
|
|
72
|
+
const n = P(M(r));
|
|
73
|
+
return new h(t, {
|
|
74
|
+
weekday: "long",
|
|
75
|
+
month: "long",
|
|
76
|
+
year: "numeric",
|
|
77
|
+
day: "numeric",
|
|
78
|
+
era: C(n),
|
|
79
|
+
timeZone: r
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function ut(t, r) {
|
|
83
|
+
const n = M(r);
|
|
84
|
+
return new h(t, {
|
|
85
|
+
month: "long",
|
|
86
|
+
year: "numeric",
|
|
87
|
+
era: C(n),
|
|
88
|
+
calendar: n == null ? void 0 : n.calendar.identifier,
|
|
89
|
+
timeZone: r
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function q(t, r, n, e, s) {
|
|
93
|
+
let a = n.formatRangeToParts(t.toDate(s), r.toDate(s)), o = -1;
|
|
94
|
+
for (let f = 0; f < a.length; f++) {
|
|
95
|
+
let k = a[f];
|
|
96
|
+
if (k.source === "shared" && k.type === "literal")
|
|
97
|
+
o = f;
|
|
98
|
+
else if (k.source === "endRange")
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
let c = "", u = "";
|
|
102
|
+
for (let f = 0; f < a.length; f++)
|
|
103
|
+
f < o ? c += a[f].value : f > o && (u += a[f].value);
|
|
104
|
+
return e(c, u);
|
|
105
|
+
}
|
|
106
|
+
function dt(t, r, n, e) {
|
|
107
|
+
let s = t, a = t, o = _(n, e);
|
|
108
|
+
return $(s, a) ? o.format(s.toDate(e)) : q(s, a, o, (c, u) => `${c} – ${u}`, e);
|
|
109
|
+
}
|
|
110
|
+
var b = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
111
|
+
function I(t) {
|
|
112
|
+
return t != null ? b[t] : void 0;
|
|
113
|
+
}
|
|
114
|
+
function N(t, r, n) {
|
|
115
|
+
const e = I(n);
|
|
116
|
+
return m(t, r, e);
|
|
117
|
+
}
|
|
118
|
+
function B(t, r, n, e) {
|
|
119
|
+
const s = r.add({ weeks: t }), a = [];
|
|
120
|
+
let o = N(s, n, e);
|
|
121
|
+
for (; a.length < 7; ) {
|
|
122
|
+
a.push(o);
|
|
123
|
+
let c = o.add({ days: 1 });
|
|
124
|
+
if ($(o, c)) break;
|
|
125
|
+
o = c;
|
|
126
|
+
}
|
|
127
|
+
return a;
|
|
128
|
+
}
|
|
129
|
+
function gt(t, r, n, e) {
|
|
130
|
+
const s = I(e), a = n ?? z(t, r, s);
|
|
131
|
+
return [...new Array(a).keys()].map((c) => B(c, t, r, e));
|
|
132
|
+
}
|
|
133
|
+
function G(t, r) {
|
|
134
|
+
const n = new h(t, { weekday: "long", timeZone: r }), e = new h(t, { weekday: "short", timeZone: r }), s = new h(t, { weekday: "narrow", timeZone: r });
|
|
135
|
+
return (a) => {
|
|
136
|
+
const o = a instanceof Date ? a : a.toDate(r);
|
|
137
|
+
return {
|
|
138
|
+
value: a,
|
|
139
|
+
short: e.format(o),
|
|
140
|
+
long: n.format(o),
|
|
141
|
+
narrow: s.format(o)
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function ht(t, r, n, e) {
|
|
146
|
+
const s = N(t, e, r), a = [...new Array(7).keys()], o = G(e, n);
|
|
147
|
+
return a.map((c) => o(s.add({ days: c })));
|
|
148
|
+
}
|
|
149
|
+
function yt(t, r = "long") {
|
|
150
|
+
const n = new Date(2021, 0, 1), e = [];
|
|
151
|
+
for (let s = 0; s < 12; s++)
|
|
152
|
+
e.push(n.toLocaleString(t, { month: r })), n.setMonth(n.getMonth() + 1);
|
|
153
|
+
return e;
|
|
154
|
+
}
|
|
155
|
+
function $t(t) {
|
|
156
|
+
const r = [];
|
|
157
|
+
for (let n = t.from; n <= t.to; n += 1) r.push(n);
|
|
158
|
+
return r;
|
|
159
|
+
}
|
|
160
|
+
var H = 10;
|
|
161
|
+
function J(t) {
|
|
162
|
+
if (t) {
|
|
163
|
+
if (t.length === 3) return t.padEnd(4, "0");
|
|
164
|
+
if (t.length === 2) {
|
|
165
|
+
const r = (/* @__PURE__ */ new Date()).getFullYear(), n = Math.floor(r / 100) * 100, e = parseInt(t.slice(-2), 10), s = n + e;
|
|
166
|
+
return s > r + H ? (s - 100).toString() : s.toString();
|
|
167
|
+
}
|
|
168
|
+
return t;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function it(t) {
|
|
172
|
+
const r = t - t % 10 - 1, n = [];
|
|
173
|
+
for (let e = 0; e < 12; e += 1) {
|
|
174
|
+
const s = r + e;
|
|
175
|
+
n.push(s);
|
|
176
|
+
}
|
|
177
|
+
return n;
|
|
178
|
+
}
|
|
179
|
+
function pt(t) {
|
|
180
|
+
return M(t ?? A());
|
|
181
|
+
}
|
|
182
|
+
function l(t, r, n, e) {
|
|
183
|
+
return function(a) {
|
|
184
|
+
const { startDate: o, focusedDate: c } = a, u = Q(o, t);
|
|
185
|
+
return w(c, n, e) ? {
|
|
186
|
+
startDate: o,
|
|
187
|
+
focusedDate: p(c, n, e),
|
|
188
|
+
endDate: u
|
|
189
|
+
} : c.compare(o) < 0 ? {
|
|
190
|
+
startDate: F(c, t, r, n, e),
|
|
191
|
+
focusedDate: p(c, n, e),
|
|
192
|
+
endDate: u
|
|
193
|
+
} : c.compare(u) > 0 ? {
|
|
194
|
+
startDate: d(c, t, r, n, e),
|
|
195
|
+
endDate: u,
|
|
196
|
+
focusedDate: p(c, n, e)
|
|
197
|
+
} : {
|
|
198
|
+
startDate: o,
|
|
199
|
+
endDate: u,
|
|
200
|
+
focusedDate: p(c, n, e)
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function K(t, r, n, e, s, a) {
|
|
205
|
+
const o = l(n, e, s, a), c = r.add(n);
|
|
206
|
+
return o({
|
|
207
|
+
focusedDate: t.add(n),
|
|
208
|
+
startDate: d(
|
|
209
|
+
i(t, c, n, e, s, a),
|
|
210
|
+
n,
|
|
211
|
+
e
|
|
212
|
+
)
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function U(t, r, n, e, s, a) {
|
|
216
|
+
const o = l(n, e, s, a);
|
|
217
|
+
let c = r.subtract(n);
|
|
218
|
+
return o({
|
|
219
|
+
focusedDate: t.subtract(n),
|
|
220
|
+
startDate: d(
|
|
221
|
+
i(t, c, n, e, s, a),
|
|
222
|
+
n,
|
|
223
|
+
e
|
|
224
|
+
)
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function mt(t, r, n, e, s, a, o) {
|
|
228
|
+
const c = l(e, s, a, o);
|
|
229
|
+
if (!n && !e.days)
|
|
230
|
+
return c({
|
|
231
|
+
focusedDate: t.add(E(e)),
|
|
232
|
+
startDate: r
|
|
233
|
+
});
|
|
234
|
+
if (e.days)
|
|
235
|
+
return K(t, r, e, s, a, o);
|
|
236
|
+
if (e.weeks)
|
|
237
|
+
return c({
|
|
238
|
+
focusedDate: t.add({ months: 1 }),
|
|
239
|
+
startDate: r
|
|
240
|
+
});
|
|
241
|
+
if (e.months || e.years)
|
|
242
|
+
return c({
|
|
243
|
+
focusedDate: t.add({ years: 1 }),
|
|
244
|
+
startDate: r
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function wt(t, r, n, e, s, a, o) {
|
|
248
|
+
const c = l(e, s, a, o);
|
|
249
|
+
if (!n && !e.days)
|
|
250
|
+
return c({
|
|
251
|
+
focusedDate: t.subtract(E(e)),
|
|
252
|
+
startDate: r
|
|
253
|
+
});
|
|
254
|
+
if (e.days)
|
|
255
|
+
return U(t, r, e, s, a, o);
|
|
256
|
+
if (e.weeks)
|
|
257
|
+
return c({
|
|
258
|
+
focusedDate: t.subtract({ months: 1 }),
|
|
259
|
+
startDate: r
|
|
260
|
+
});
|
|
261
|
+
if (e.months || e.years)
|
|
262
|
+
return c({
|
|
263
|
+
focusedDate: t.subtract({ years: 1 }),
|
|
264
|
+
startDate: r
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
var x = (t) => t != null && t.length === 4, X = (t) => t != null && parseFloat(t) <= 12, Z = (t) => t != null && parseFloat(t) <= 31;
|
|
268
|
+
function lt(t, r, n) {
|
|
269
|
+
const e = v(r, n);
|
|
270
|
+
let { year: s, month: a, day: o } = V(e, t) ?? {};
|
|
271
|
+
if (s != null || a != null || o != null) {
|
|
272
|
+
const f = /* @__PURE__ */ new Date();
|
|
273
|
+
s || (s = f.getFullYear().toString()), a || (a = (f.getMonth() + 1).toString()), o || (o = f.getDate().toString());
|
|
274
|
+
}
|
|
275
|
+
if (x(s) || (s = J(s)), x(s) && X(a) && Z(o))
|
|
276
|
+
return new S(+s, +a, +o);
|
|
277
|
+
const u = Date.parse(t);
|
|
278
|
+
if (!isNaN(u)) {
|
|
279
|
+
const f = new Date(u);
|
|
280
|
+
return new S(f.getFullYear(), f.getMonth() + 1, f.getDate());
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function v(t, r) {
|
|
284
|
+
return new h(t, { day: "numeric", month: "numeric", year: "numeric", timeZone: r }).formatToParts(new Date(2e3, 11, 25)).map(({ type: s, value: a }) => s === "literal" ? `${a}?` : `((?!=<${s}>)\\d+)?`).join("");
|
|
285
|
+
}
|
|
286
|
+
function V(t, r) {
|
|
287
|
+
var e;
|
|
288
|
+
const n = r.match(t);
|
|
289
|
+
return (e = t.toString().match(/<(.+?)>/g)) == null ? void 0 : e.map((s) => {
|
|
290
|
+
var o;
|
|
291
|
+
const a = s.match(/<(.+)>/);
|
|
292
|
+
return !a || a.length <= 0 ? null : (o = s.match(/<(.+)>/)) == null ? void 0 : o[1];
|
|
293
|
+
}).reduce((s, a, o) => (a && (n && n.length > o ? s[a] = n[o + 1] : s[a] = null), s), {});
|
|
294
|
+
}
|
|
295
|
+
function kt(t, r, n) {
|
|
296
|
+
const e = g(T(n));
|
|
297
|
+
switch (t) {
|
|
298
|
+
case "thisWeek":
|
|
299
|
+
return [m(e, r), Y(e, r)];
|
|
300
|
+
case "thisMonth":
|
|
301
|
+
return [y(e), e];
|
|
302
|
+
case "thisQuarter":
|
|
303
|
+
return [y(e).add({ months: -e.month % 3 }), e];
|
|
304
|
+
case "thisYear":
|
|
305
|
+
return [D(e), e];
|
|
306
|
+
case "last3Days":
|
|
307
|
+
return [e.add({ days: -2 }), e];
|
|
308
|
+
case "last7Days":
|
|
309
|
+
return [e.add({ days: -6 }), e];
|
|
310
|
+
case "last14Days":
|
|
311
|
+
return [e.add({ days: -13 }), e];
|
|
312
|
+
case "last30Days":
|
|
313
|
+
return [e.add({ days: -29 }), e];
|
|
314
|
+
case "last90Days":
|
|
315
|
+
return [e.add({ days: -89 }), e];
|
|
316
|
+
case "lastMonth":
|
|
317
|
+
return [y(e.add({ months: -1 })), R(e.add({ months: -1 }))];
|
|
318
|
+
case "lastQuarter":
|
|
319
|
+
return [
|
|
320
|
+
y(e.add({ months: -e.month % 3 - 3 })),
|
|
321
|
+
R(e.add({ months: -e.month % 3 - 1 }))
|
|
322
|
+
];
|
|
323
|
+
case "lastWeek":
|
|
324
|
+
return [m(e, r).add({ weeks: -1 }), Y(e, r).add({ weeks: -1 })];
|
|
325
|
+
case "lastYear":
|
|
326
|
+
return [D(e.add({ years: -1 })), j(e.add({ years: -1 }))];
|
|
327
|
+
default:
|
|
328
|
+
throw new Error(`Invalid date range preset: ${t}`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
export {
|
|
332
|
+
L as alignCenter,
|
|
333
|
+
at as alignDate,
|
|
334
|
+
F as alignEnd,
|
|
335
|
+
d as alignStart,
|
|
336
|
+
i as constrainStart,
|
|
337
|
+
p as constrainValue,
|
|
338
|
+
q as formatRange,
|
|
339
|
+
dt as formatSelectedDate,
|
|
340
|
+
l as getAdjustedDateFn,
|
|
341
|
+
kt as getDateRangePreset,
|
|
342
|
+
_ as getDayFormatter,
|
|
343
|
+
B as getDaysInWeek,
|
|
344
|
+
it as getDecadeRange,
|
|
345
|
+
Q as getEndDate,
|
|
346
|
+
gt as getMonthDays,
|
|
347
|
+
ut as getMonthFormatter,
|
|
348
|
+
yt as getMonthNames,
|
|
349
|
+
K as getNextPage,
|
|
350
|
+
mt as getNextSection,
|
|
351
|
+
U as getPreviousPage,
|
|
352
|
+
wt as getPreviousSection,
|
|
353
|
+
N as getStartOfWeek,
|
|
354
|
+
pt as getTodayDate,
|
|
355
|
+
E as getUnitDuration,
|
|
356
|
+
ht as getWeekDays,
|
|
357
|
+
G as getWeekdayFormats,
|
|
358
|
+
$t as getYearsRange,
|
|
359
|
+
st as isDateEqual,
|
|
360
|
+
w as isDateOutsideRange,
|
|
361
|
+
ot as isDateUnavailable,
|
|
362
|
+
ft as isNextRangeInvalid,
|
|
363
|
+
ct as isPreviousRangeInvalid,
|
|
364
|
+
J as normalizeYear,
|
|
365
|
+
lt as parseDateString
|
|
366
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createAnatomy as
|
|
1
|
+
import { createAnatomy as C } from "../../anatomy/dist/index.js";
|
|
2
2
|
import { ariaHidden as k } from "../../aria-hidden/dist/index.js";
|
|
3
|
-
import { createMachine as
|
|
3
|
+
import { createMachine as D } from "../../core/dist/index.js";
|
|
4
4
|
import { trackDismissableElement as b } from "../../dismissable/dist/index.js";
|
|
5
|
-
import { raf as E, getComputedStyle as
|
|
5
|
+
import { raf as E, getComputedStyle as I } from "../../dom-query/dist/index.js";
|
|
6
6
|
import { trapFocus as P } from "../../focus-trap/dist/index.js";
|
|
7
7
|
import { preventBodyScroll as F } from "../../remove-scroll/dist/index.js";
|
|
8
8
|
import { createProps as T } from "../../types/dist/index.js";
|
|
9
|
-
var L =
|
|
9
|
+
var L = C("dialog").parts(
|
|
10
10
|
"trigger",
|
|
11
11
|
"backdrop",
|
|
12
12
|
"positioner",
|
|
@@ -14,45 +14,45 @@ var L = y("dialog").parts(
|
|
|
14
14
|
"title",
|
|
15
15
|
"description",
|
|
16
16
|
"closeTrigger"
|
|
17
|
-
),
|
|
17
|
+
), d = L.build(), m = (e) => {
|
|
18
18
|
var t;
|
|
19
19
|
return ((t = e.ids) == null ? void 0 : t.positioner) ?? `dialog:${e.id}:positioner`;
|
|
20
20
|
}, v = (e) => {
|
|
21
21
|
var t;
|
|
22
22
|
return ((t = e.ids) == null ? void 0 : t.backdrop) ?? `dialog:${e.id}:backdrop`;
|
|
23
|
-
},
|
|
23
|
+
}, g = (e) => {
|
|
24
24
|
var t;
|
|
25
25
|
return ((t = e.ids) == null ? void 0 : t.content) ?? `dialog:${e.id}:content`;
|
|
26
|
-
},
|
|
26
|
+
}, y = (e) => {
|
|
27
27
|
var t;
|
|
28
28
|
return ((t = e.ids) == null ? void 0 : t.trigger) ?? `dialog:${e.id}:trigger`;
|
|
29
|
-
},
|
|
29
|
+
}, p = (e) => {
|
|
30
30
|
var t;
|
|
31
31
|
return ((t = e.ids) == null ? void 0 : t.title) ?? `dialog:${e.id}:title`;
|
|
32
32
|
}, u = (e) => {
|
|
33
33
|
var t;
|
|
34
34
|
return ((t = e.ids) == null ? void 0 : t.description) ?? `dialog:${e.id}:description`;
|
|
35
|
-
},
|
|
35
|
+
}, f = (e) => {
|
|
36
36
|
var t;
|
|
37
37
|
return ((t = e.ids) == null ? void 0 : t.closeTrigger) ?? `dialog:${e.id}:close`;
|
|
38
|
-
}, c = (e) => e.getById(
|
|
39
|
-
function
|
|
40
|
-
const { state: n, send: a, context:
|
|
38
|
+
}, c = (e) => e.getById(g(e)), h = (e) => e.getById(m(e)), S = (e) => e.getById(v(e)), B = (e) => e.getById(y(e)), R = (e) => e.getById(p(e)), N = (e) => e.getById(u(e)), w = (e) => e.getById(f(e));
|
|
39
|
+
function j(e, t) {
|
|
40
|
+
const { state: n, send: a, context: r, prop: o, scope: i } = e, O = o("aria-label"), l = n.matches("open");
|
|
41
41
|
return {
|
|
42
|
-
open:
|
|
42
|
+
open: l,
|
|
43
43
|
setOpen(s) {
|
|
44
44
|
n.matches("open") !== s && a({ type: s ? "OPEN" : "CLOSE" });
|
|
45
45
|
},
|
|
46
46
|
getTriggerProps() {
|
|
47
47
|
return t.button({
|
|
48
|
-
...
|
|
49
|
-
dir:
|
|
50
|
-
id:
|
|
48
|
+
...d.trigger.attrs,
|
|
49
|
+
dir: o("dir"),
|
|
50
|
+
id: y(i),
|
|
51
51
|
"aria-haspopup": "dialog",
|
|
52
52
|
type: "button",
|
|
53
|
-
"aria-expanded":
|
|
54
|
-
"data-state":
|
|
55
|
-
"aria-controls":
|
|
53
|
+
"aria-expanded": l,
|
|
54
|
+
"data-state": l ? "open" : "closed",
|
|
55
|
+
"aria-controls": g(i),
|
|
56
56
|
onClick(s) {
|
|
57
57
|
s.defaultPrevented || a({ type: "TOGGLE" });
|
|
58
58
|
}
|
|
@@ -60,58 +60,58 @@ function q(e, t) {
|
|
|
60
60
|
},
|
|
61
61
|
getBackdropProps() {
|
|
62
62
|
return t.element({
|
|
63
|
-
...
|
|
64
|
-
dir:
|
|
65
|
-
hidden: !
|
|
63
|
+
...d.backdrop.attrs,
|
|
64
|
+
dir: o("dir"),
|
|
65
|
+
hidden: !l,
|
|
66
66
|
id: v(i),
|
|
67
|
-
"data-state":
|
|
67
|
+
"data-state": l ? "open" : "closed"
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
70
|
getPositionerProps() {
|
|
71
71
|
return t.element({
|
|
72
|
-
...
|
|
73
|
-
dir:
|
|
72
|
+
...d.positioner.attrs,
|
|
73
|
+
dir: o("dir"),
|
|
74
74
|
id: m(i),
|
|
75
75
|
style: {
|
|
76
|
-
pointerEvents:
|
|
76
|
+
pointerEvents: l ? void 0 : "none"
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
80
|
getContentProps() {
|
|
81
|
-
const s =
|
|
81
|
+
const s = r.get("rendered");
|
|
82
82
|
return t.element({
|
|
83
|
-
...
|
|
84
|
-
dir:
|
|
85
|
-
role:
|
|
86
|
-
hidden: !
|
|
87
|
-
id:
|
|
83
|
+
...d.content.attrs,
|
|
84
|
+
dir: o("dir"),
|
|
85
|
+
role: o("role"),
|
|
86
|
+
hidden: !l,
|
|
87
|
+
id: g(i),
|
|
88
88
|
tabIndex: -1,
|
|
89
|
-
"data-state":
|
|
89
|
+
"data-state": l ? "open" : "closed",
|
|
90
90
|
"aria-modal": !0,
|
|
91
91
|
"aria-label": O || void 0,
|
|
92
|
-
"aria-labelledby": O || !s.title ? void 0 :
|
|
92
|
+
"aria-labelledby": O || !s.title ? void 0 : p(i),
|
|
93
93
|
"aria-describedby": s.description ? u(i) : void 0
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
96
|
getTitleProps() {
|
|
97
97
|
return t.element({
|
|
98
|
-
...
|
|
99
|
-
dir:
|
|
100
|
-
id:
|
|
98
|
+
...d.title.attrs,
|
|
99
|
+
dir: o("dir"),
|
|
100
|
+
id: p(i)
|
|
101
101
|
});
|
|
102
102
|
},
|
|
103
103
|
getDescriptionProps() {
|
|
104
104
|
return t.element({
|
|
105
|
-
...
|
|
106
|
-
dir:
|
|
105
|
+
...d.description.attrs,
|
|
106
|
+
dir: o("dir"),
|
|
107
107
|
id: u(i)
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
110
|
getCloseTriggerProps() {
|
|
111
111
|
return t.button({
|
|
112
|
-
...
|
|
113
|
-
dir:
|
|
114
|
-
id:
|
|
112
|
+
...d.closeTrigger.attrs,
|
|
113
|
+
dir: o("dir"),
|
|
114
|
+
id: f(i),
|
|
115
115
|
type: "button",
|
|
116
116
|
onClick(s) {
|
|
117
117
|
s.defaultPrevented || (s.stopPropagation(), a({ type: "CLOSE" }));
|
|
@@ -120,18 +120,18 @@ function q(e, t) {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
var J =
|
|
123
|
+
var J = D({
|
|
124
124
|
props({ props: e, scope: t }) {
|
|
125
|
-
const n = e.role === "alertdialog";
|
|
125
|
+
const n = e.role === "alertdialog", a = n ? () => w(t) : void 0, r = typeof e.modal == "boolean" ? e.modal : !0;
|
|
126
126
|
return {
|
|
127
127
|
role: "dialog",
|
|
128
|
-
modal:
|
|
129
|
-
trapFocus:
|
|
130
|
-
preventScroll:
|
|
128
|
+
modal: r,
|
|
129
|
+
trapFocus: r,
|
|
130
|
+
preventScroll: r,
|
|
131
131
|
closeOnInteractOutside: !n,
|
|
132
132
|
closeOnEscape: !0,
|
|
133
133
|
restoreFocus: !0,
|
|
134
|
-
initialFocusEl:
|
|
134
|
+
initialFocusEl: a,
|
|
135
135
|
...e
|
|
136
136
|
};
|
|
137
137
|
},
|
|
@@ -218,16 +218,17 @@ var J = I({
|
|
|
218
218
|
defer: !0,
|
|
219
219
|
pointerBlocking: n("modal"),
|
|
220
220
|
exclude: [B(e)],
|
|
221
|
-
onInteractOutside(
|
|
222
|
-
var
|
|
223
|
-
(
|
|
221
|
+
onInteractOutside(r) {
|
|
222
|
+
var o;
|
|
223
|
+
(o = n("onInteractOutside")) == null || o(r), n("closeOnInteractOutside") || r.preventDefault();
|
|
224
224
|
},
|
|
225
225
|
persistentElements: n("persistentElements"),
|
|
226
226
|
onFocusOutside: n("onFocusOutside"),
|
|
227
227
|
onPointerDownOutside: n("onPointerDownOutside"),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
onRequestDismiss: n("onRequestDismiss"),
|
|
229
|
+
onEscapeKeyDown(r) {
|
|
230
|
+
var o;
|
|
231
|
+
(o = n("onEscapeKeyDown")) == null || o(r), n("closeOnEscape") || r.preventDefault();
|
|
231
232
|
},
|
|
232
233
|
onDismiss() {
|
|
233
234
|
t({ type: "CLOSE", src: "interact-outside" });
|
|
@@ -239,15 +240,15 @@ var J = I({
|
|
|
239
240
|
return F(e.getDoc());
|
|
240
241
|
},
|
|
241
242
|
trapFocus({ scope: e, prop: t }) {
|
|
242
|
-
return
|
|
243
|
+
return t("trapFocus") ? P(() => c(e), {
|
|
243
244
|
preventScroll: !0,
|
|
244
245
|
returnFocusOnDeactivate: !!t("restoreFocus"),
|
|
245
246
|
initialFocus: t("initialFocusEl"),
|
|
246
247
|
setReturnFocus: (a) => {
|
|
247
|
-
var
|
|
248
|
-
return ((
|
|
248
|
+
var r;
|
|
249
|
+
return ((r = t("finalFocusEl")) == null ? void 0 : r()) ?? a;
|
|
249
250
|
}
|
|
250
|
-
});
|
|
251
|
+
}) : void 0;
|
|
251
252
|
},
|
|
252
253
|
hideContentBelow({ scope: e, prop: t }) {
|
|
253
254
|
return t("modal") ? k(() => [c(e)], { defer: !0 }) : void 0;
|
|
@@ -257,8 +258,8 @@ var J = I({
|
|
|
257
258
|
checkRenderedElements({ context: e, scope: t }) {
|
|
258
259
|
E(() => {
|
|
259
260
|
e.set("rendered", {
|
|
260
|
-
title: !!
|
|
261
|
-
description: !!
|
|
261
|
+
title: !!R(t),
|
|
262
|
+
description: !!N(t)
|
|
262
263
|
});
|
|
263
264
|
});
|
|
264
265
|
},
|
|
@@ -266,9 +267,9 @@ var J = I({
|
|
|
266
267
|
E(() => {
|
|
267
268
|
const t = c(e);
|
|
268
269
|
if (!t) return;
|
|
269
|
-
const n =
|
|
270
|
-
[h(e), S(e)].forEach((
|
|
271
|
-
|
|
270
|
+
const n = I(t);
|
|
271
|
+
[h(e), S(e)].forEach((r) => {
|
|
272
|
+
r == null || r.style.setProperty("--z-index", n.zIndex), r == null || r.style.setProperty("--layer-index", n.getPropertyValue("--layer-index"));
|
|
272
273
|
});
|
|
273
274
|
});
|
|
274
275
|
},
|
|
@@ -307,6 +308,7 @@ T()([
|
|
|
307
308
|
"onInteractOutside",
|
|
308
309
|
"onOpenChange",
|
|
309
310
|
"onPointerDownOutside",
|
|
311
|
+
"onRequestDismiss",
|
|
310
312
|
"defaultOpen",
|
|
311
313
|
"open",
|
|
312
314
|
"persistentElements",
|
|
@@ -317,6 +319,6 @@ T()([
|
|
|
317
319
|
]);
|
|
318
320
|
export {
|
|
319
321
|
L as anatomy,
|
|
320
|
-
|
|
322
|
+
j as connect,
|
|
321
323
|
J as machine
|
|
322
324
|
};
|