@still-forest/canopy 0.28.1 → 0.28.2
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/calendar.js +103 -103
- package/package.json +1 -1
package/dist/calendar.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as T } from "./jsx-runtime.js";
|
|
2
2
|
import { F as bt } from "./Layout2.js";
|
|
3
3
|
import { a as Nn, c as W } from "./index2.js";
|
|
4
4
|
import * as B from "react";
|
|
5
|
-
import h, { forwardRef as wt, createElement as Re, createContext as xn, useContext as Wn, useCallback as V, useRef as Te, useLayoutEffect as Sn, useState as Ge, useEffect as _n, useMemo as
|
|
5
|
+
import h, { forwardRef as wt, createElement as Re, createContext as xn, useContext as Wn, useCallback as V, useRef as Te, useLayoutEffect as Sn, useState as Ge, useEffect as _n, useMemo as Ie } from "react";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.525.0 - ISC
|
|
8
8
|
*
|
|
@@ -106,7 +106,7 @@ const Bn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], kt = vt("chevron-
|
|
|
106
106
|
* This source code is licensed under the ISC license.
|
|
107
107
|
* See the LICENSE file in the root directory of this source tree.
|
|
108
108
|
*/
|
|
109
|
-
const
|
|
109
|
+
const jn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Mt = vt("chevron-right", jn);
|
|
110
110
|
function nt(e, t) {
|
|
111
111
|
if (typeof e == "function")
|
|
112
112
|
return e(t);
|
|
@@ -132,18 +132,18 @@ function oa(...e) {
|
|
|
132
132
|
return B.useCallback(Dt(...e), e);
|
|
133
133
|
}
|
|
134
134
|
// @__NO_SIDE_EFFECTS__
|
|
135
|
-
function
|
|
135
|
+
function In(e) {
|
|
136
136
|
const t = /* @__PURE__ */ Hn(e), n = B.forwardRef((r, o) => {
|
|
137
137
|
const { children: s, ...i } = r, a = B.Children.toArray(s), c = a.find(qn);
|
|
138
138
|
if (c) {
|
|
139
139
|
const l = c.props.children, d = a.map((u) => u === c ? B.Children.count(l) > 1 ? B.Children.only(null) : B.isValidElement(l) ? l.props.children : null : u);
|
|
140
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ T.jsx(t, { ...i, ref: o, children: B.isValidElement(l) ? B.cloneElement(l, void 0, d) : null });
|
|
141
141
|
}
|
|
142
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ T.jsx(t, { ...i, ref: o, children: s });
|
|
143
143
|
});
|
|
144
144
|
return n.displayName = `${e}.Slot`, n;
|
|
145
145
|
}
|
|
146
|
-
var An = /* @__PURE__ */
|
|
146
|
+
var An = /* @__PURE__ */ In("Slot");
|
|
147
147
|
// @__NO_SIDE_EFFECTS__
|
|
148
148
|
function Hn(e) {
|
|
149
149
|
const t = B.forwardRef((n, r) => {
|
|
@@ -159,7 +159,7 @@ function Hn(e) {
|
|
|
159
159
|
var Ot = Symbol("radix.slottable");
|
|
160
160
|
// @__NO_SIDE_EFFECTS__
|
|
161
161
|
function sa(e) {
|
|
162
|
-
const t = ({ children: n }) => /* @__PURE__ */
|
|
162
|
+
const t = ({ children: n }) => /* @__PURE__ */ T.jsx(T.Fragment, { children: n });
|
|
163
163
|
return t.displayName = `${e}.Slottable`, t.__radixId = Ot, t;
|
|
164
164
|
}
|
|
165
165
|
function qn(e) {
|
|
@@ -244,7 +244,7 @@ function Ce({
|
|
|
244
244
|
...o
|
|
245
245
|
}) {
|
|
246
246
|
const s = r ? An : "button";
|
|
247
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ T.jsx(s, { className: W(Ze({ variant: t, size: n, className: e })), "data-slot": "button", ...o });
|
|
248
248
|
}
|
|
249
249
|
const Zn = ({
|
|
250
250
|
children: e,
|
|
@@ -261,7 +261,7 @@ const Zn = ({
|
|
|
261
261
|
...u
|
|
262
262
|
}) => {
|
|
263
263
|
const f = () => n === "primary" ? "default" : n === "subtle" ? "secondary" : n, m = () => r === "md" ? "default" : r === "xs" ? "sm" : n === "unstyled" ? "unstyled" : r;
|
|
264
|
-
return /* @__PURE__ */
|
|
264
|
+
return /* @__PURE__ */ T.jsx(
|
|
265
265
|
Ce,
|
|
266
266
|
{
|
|
267
267
|
asChild: c,
|
|
@@ -272,31 +272,31 @@ const Zn = ({
|
|
|
272
272
|
type: a,
|
|
273
273
|
variant: f(),
|
|
274
274
|
...u,
|
|
275
|
-
children: o && e ? /* @__PURE__ */
|
|
276
|
-
o,
|
|
277
|
-
e
|
|
275
|
+
children: o && e ? /* @__PURE__ */ T.jsxs(bt, { align: "center", gap: "2", children: [
|
|
276
|
+
/* @__PURE__ */ T.jsx("span", { children: o }, "icon"),
|
|
277
|
+
/* @__PURE__ */ T.jsx("span", { children: e }, "children")
|
|
278
278
|
] }) : o || e
|
|
279
279
|
}
|
|
280
280
|
);
|
|
281
|
-
}, Ln = ({ children: e, className: t = "" }) => /* @__PURE__ */
|
|
282
|
-
Ln.Button = ({ children: e, className: t, ...n }) => /* @__PURE__ */
|
|
281
|
+
}, Ln = ({ children: e, className: t = "" }) => /* @__PURE__ */ T.jsx(bt, { className: t, children: e });
|
|
282
|
+
Ln.Button = ({ children: e, className: t, ...n }) => /* @__PURE__ */ T.jsx(Zn, { className: W("not-first:-ml-1 not-last:rounded-r-none not-first:rounded-l-none", t), ...n, children: e });
|
|
283
283
|
const Ct = 6048e5, zn = 864e5, st = Symbol.for("constructDateFrom");
|
|
284
|
-
function
|
|
284
|
+
function j(e, t) {
|
|
285
285
|
return typeof e == "function" ? e(t) : e && typeof e == "object" && st in e ? e[st](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
286
286
|
}
|
|
287
287
|
function _(e, t) {
|
|
288
|
-
return
|
|
288
|
+
return j(t || e, e);
|
|
289
289
|
}
|
|
290
290
|
function Nt(e, t, n) {
|
|
291
291
|
const r = _(e, n?.in);
|
|
292
|
-
return isNaN(t) ?
|
|
292
|
+
return isNaN(t) ? j(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
293
293
|
}
|
|
294
294
|
function xt(e, t, n) {
|
|
295
295
|
const r = _(e, n?.in);
|
|
296
|
-
if (isNaN(t)) return
|
|
296
|
+
if (isNaN(t)) return j(e, NaN);
|
|
297
297
|
if (!t)
|
|
298
298
|
return r;
|
|
299
|
-
const o = r.getDate(), s =
|
|
299
|
+
const o = r.getDate(), s = j(e, r.getTime());
|
|
300
300
|
s.setMonth(r.getMonth() + t + 1, 0);
|
|
301
301
|
const i = s.getDate();
|
|
302
302
|
return o >= i ? s : (r.setFullYear(
|
|
@@ -317,9 +317,9 @@ function Ne(e, t) {
|
|
|
317
317
|
return be(e, { ...t, weekStartsOn: 1 });
|
|
318
318
|
}
|
|
319
319
|
function Wt(e, t) {
|
|
320
|
-
const n = _(e, t?.in), r = n.getFullYear(), o =
|
|
320
|
+
const n = _(e, t?.in), r = n.getFullYear(), o = j(n, 0);
|
|
321
321
|
o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
322
|
-
const s = Ne(o), i =
|
|
322
|
+
const s = Ne(o), i = j(n, 0);
|
|
323
323
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
324
324
|
const a = Ne(i);
|
|
325
325
|
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= a.getTime() ? r : r - 1;
|
|
@@ -339,7 +339,7 @@ function at(e) {
|
|
|
339
339
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
340
340
|
}
|
|
341
341
|
function we(e, ...t) {
|
|
342
|
-
const n =
|
|
342
|
+
const n = j.bind(
|
|
343
343
|
null,
|
|
344
344
|
t.find((r) => typeof r == "object")
|
|
345
345
|
);
|
|
@@ -358,7 +358,7 @@ function le(e, t, n) {
|
|
|
358
358
|
return Math.round((a - c) / zn);
|
|
359
359
|
}
|
|
360
360
|
function Qn(e, t) {
|
|
361
|
-
const n = Wt(e, t), r =
|
|
361
|
+
const n = Wt(e, t), r = j(e, 0);
|
|
362
362
|
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Ne(r);
|
|
363
363
|
}
|
|
364
364
|
function Xn(e, t, n) {
|
|
@@ -370,18 +370,18 @@ function Un(e, t, n) {
|
|
|
370
370
|
function Kn(e, t) {
|
|
371
371
|
let n, r = t?.in;
|
|
372
372
|
return e.forEach((o) => {
|
|
373
|
-
!r && typeof o == "object" && (r =
|
|
373
|
+
!r && typeof o == "object" && (r = j.bind(null, o));
|
|
374
374
|
const s = _(o, r);
|
|
375
375
|
(!n || n < s || isNaN(+s)) && (n = s);
|
|
376
|
-
}),
|
|
376
|
+
}), j(r, n || NaN);
|
|
377
377
|
}
|
|
378
378
|
function Jn(e, t) {
|
|
379
379
|
let n, r = t?.in;
|
|
380
380
|
return e.forEach((o) => {
|
|
381
|
-
!r && typeof o == "object" && (r =
|
|
381
|
+
!r && typeof o == "object" && (r = j.bind(null, o));
|
|
382
382
|
const s = _(o, r);
|
|
383
383
|
(!n || n > s || isNaN(+s)) && (n = s);
|
|
384
|
-
}),
|
|
384
|
+
}), j(r, n || NaN);
|
|
385
385
|
}
|
|
386
386
|
function er(e, t, n) {
|
|
387
387
|
const [r, o] = we(
|
|
@@ -421,7 +421,7 @@ function sr(e, t) {
|
|
|
421
421
|
let a = 1;
|
|
422
422
|
const c = [];
|
|
423
423
|
for (; +i <= s; )
|
|
424
|
-
c.push(
|
|
424
|
+
c.push(j(n, i)), i.setMonth(i.getMonth() + a);
|
|
425
425
|
return o ? c.reverse() : c;
|
|
426
426
|
}
|
|
427
427
|
function ar(e, t) {
|
|
@@ -808,10 +808,10 @@ const Wr = /^(\d+)(th|st|nd|rd)?/i, Sr = /\d+/i, _r = {
|
|
|
808
808
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
809
809
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
810
810
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
811
|
-
},
|
|
811
|
+
}, jr = {
|
|
812
812
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
813
813
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
814
|
-
},
|
|
814
|
+
}, Ir = {
|
|
815
815
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
816
816
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
817
817
|
}, Ar = {
|
|
@@ -853,11 +853,11 @@ const Wr = /^(\d+)(th|st|nd|rd)?/i, Sr = /\d+/i, _r = {
|
|
|
853
853
|
day: Me({
|
|
854
854
|
matchPatterns: Br,
|
|
855
855
|
defaultMatchWidth: "wide",
|
|
856
|
-
parsePatterns:
|
|
856
|
+
parsePatterns: jr,
|
|
857
857
|
defaultParseWidth: "any"
|
|
858
858
|
}),
|
|
859
859
|
dayPeriod: Me({
|
|
860
|
-
matchPatterns:
|
|
860
|
+
matchPatterns: Ir,
|
|
861
861
|
defaultMatchWidth: "any",
|
|
862
862
|
parsePatterns: Ar,
|
|
863
863
|
defaultParseWidth: "any"
|
|
@@ -883,15 +883,15 @@ function Tt(e, t) {
|
|
|
883
883
|
return Math.round(r / Ct) + 1;
|
|
884
884
|
}
|
|
885
885
|
function Pt(e, t) {
|
|
886
|
-
const n = _(e, t?.in), r = n.getFullYear(), o = We(), s = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i =
|
|
886
|
+
const n = _(e, t?.in), r = n.getFullYear(), o = We(), s = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = j(t?.in || e, 0);
|
|
887
887
|
i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
|
|
888
|
-
const a = be(i, t), c =
|
|
888
|
+
const a = be(i, t), c = j(t?.in || e, 0);
|
|
889
889
|
c.setFullYear(r, 0, s), c.setHours(0, 0, 0, 0);
|
|
890
890
|
const l = be(c, t);
|
|
891
891
|
return +n >= +a ? r + 1 : +n >= +l ? r : r - 1;
|
|
892
892
|
}
|
|
893
893
|
function $r(e, t) {
|
|
894
|
-
const n = We(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = Pt(e, t), s =
|
|
894
|
+
const n = We(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = Pt(e, t), s = j(t?.in || e, 0);
|
|
895
895
|
return s.setFullYear(o, 0, r), s.setHours(0, 0, 0, 0), be(s, t);
|
|
896
896
|
}
|
|
897
897
|
function Yt(e, t) {
|
|
@@ -1637,7 +1637,7 @@ function oo(e) {
|
|
|
1637
1637
|
return t ? t[1].replace(to, "'") : e;
|
|
1638
1638
|
}
|
|
1639
1639
|
function so(e, t) {
|
|
1640
|
-
const n = _(e, t?.in), r = n.getFullYear(), o = n.getMonth(), s =
|
|
1640
|
+
const n = _(e, t?.in), r = n.getFullYear(), o = n.getMonth(), s = j(n, 0);
|
|
1641
1641
|
return s.setFullYear(r, o + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
|
|
1642
1642
|
}
|
|
1643
1643
|
function ao(e, t) {
|
|
@@ -1669,14 +1669,14 @@ function fo(e, t, n) {
|
|
|
1669
1669
|
return r.getFullYear() === o.getFullYear();
|
|
1670
1670
|
}
|
|
1671
1671
|
function ho(e, t, n) {
|
|
1672
|
-
const r = _(e, n?.in), o = r.getFullYear(), s = r.getDate(), i =
|
|
1672
|
+
const r = _(e, n?.in), o = r.getFullYear(), s = r.getDate(), i = j(e, 0);
|
|
1673
1673
|
i.setFullYear(o, t, 15), i.setHours(0, 0, 0, 0);
|
|
1674
1674
|
const a = so(i);
|
|
1675
1675
|
return r.setMonth(t, Math.min(s, a)), r;
|
|
1676
1676
|
}
|
|
1677
1677
|
function mo(e, t, n) {
|
|
1678
1678
|
const r = _(e, n?.in);
|
|
1679
|
-
return isNaN(+r) ?
|
|
1679
|
+
return isNaN(+r) ? j(e, NaN) : (r.setFullYear(t), r);
|
|
1680
1680
|
}
|
|
1681
1681
|
const yo = {}, De = {};
|
|
1682
1682
|
function Oe(e, t) {
|
|
@@ -1841,12 +1841,12 @@ function vo(e, t) {
|
|
|
1841
1841
|
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), s = t.addDays(o, ht * 7 - 1);
|
|
1842
1842
|
return t.getMonth(e) === t.getMonth(s) ? ht : po;
|
|
1843
1843
|
}
|
|
1844
|
-
function
|
|
1844
|
+
function jt(e, t) {
|
|
1845
1845
|
const n = t.startOfMonth(e), r = n.getDay();
|
|
1846
1846
|
return r === 1 ? n : r === 0 ? t.addDays(n, -1 * 6) : t.addDays(n, -1 * (r - 1));
|
|
1847
1847
|
}
|
|
1848
1848
|
function ko(e, t) {
|
|
1849
|
-
const n =
|
|
1849
|
+
const n = jt(e, t), r = vo(e, t);
|
|
1850
1850
|
return t.addDays(n, r * 7 - 1);
|
|
1851
1851
|
}
|
|
1852
1852
|
class se {
|
|
@@ -1860,7 +1860,7 @@ class se {
|
|
|
1860
1860
|
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? $.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, o, s) => this.overrides?.newDate ? this.overrides.newDate(r, o, s) : this.options.timeZone ? new $(r, o, s, this.options.timeZone) : new Date(r, o, s), this.addDays = (r, o) => this.overrides?.addDays ? this.overrides.addDays(r, o) : Nt(r, o), this.addMonths = (r, o) => this.overrides?.addMonths ? this.overrides.addMonths(r, o) : xt(r, o), this.addWeeks = (r, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, o) : Xn(r, o), this.addYears = (r, o) => this.overrides?.addYears ? this.overrides.addYears(r, o) : Un(r, o), this.differenceInCalendarDays = (r, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : le(r, o), this.differenceInCalendarMonths = (r, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : nr(r, o), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : sr(r), this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : ko(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : cr(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : rr(r), this.endOfWeek = (r, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, o) : Et(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : ir(r), this.format = (r, o, s) => {
|
|
1861
1861
|
const i = this.overrides?.format ? this.overrides.format(r, o, this.options) : ro(r, o, this.options);
|
|
1862
1862
|
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1863
|
-
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : Tt(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : ao(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : io(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : Yt(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : co(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : uo(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : St(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : er(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : lo(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : fo(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : Kn(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : Jn(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : ho(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : mo(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) :
|
|
1863
|
+
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : Tt(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : ao(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : io(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : Yt(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : co(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : uo(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : St(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : er(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : lo(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : fo(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : Kn(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : Jn(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : ho(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : mo(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : jt(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : xe(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : Ne(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : ar(r), this.startOfWeek = (r, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : be(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : _t(r), this.options = { locale: ze, ...t }, this.overrides = n;
|
|
1864
1864
|
}
|
|
1865
1865
|
/**
|
|
1866
1866
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1900,7 +1900,7 @@ class se {
|
|
|
1900
1900
|
}
|
|
1901
1901
|
}
|
|
1902
1902
|
const te = new se();
|
|
1903
|
-
class
|
|
1903
|
+
class It {
|
|
1904
1904
|
constructor(t, n, r = te) {
|
|
1905
1905
|
this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r;
|
|
1906
1906
|
}
|
|
@@ -1975,13 +1975,13 @@ function Oo(e, t, n, r, o) {
|
|
|
1975
1975
|
[F.disabled]: [],
|
|
1976
1976
|
[F.hidden]: [],
|
|
1977
1977
|
[F.today]: []
|
|
1978
|
-
},
|
|
1978
|
+
}, P = {};
|
|
1979
1979
|
for (const y of e) {
|
|
1980
|
-
const { date: k, displayMonth: v } = y, C = !!(v && !f(k, v)),
|
|
1980
|
+
const { date: k, displayMonth: v } = y, C = !!(v && !f(k, v)), I = !!(O && w(k, O)), A = !!(E && p(k, E)), H = !!(s && oe(k, s, o)), G = !!(i && oe(k, i, o)) || I || A || // Broadcast calendar will show outside days as default
|
|
1981
1981
|
!l && !c && C || l && c === !1 && C, ne = u(k, d ?? o.today());
|
|
1982
1982
|
C && M.outside.push(y), H && M.disabled.push(y), G && M.hidden.push(y), ne && M.today.push(y), a && Object.keys(a).forEach((ae) => {
|
|
1983
1983
|
const ie = a?.[ae];
|
|
1984
|
-
ie && oe(k, ie, o) && (
|
|
1984
|
+
ie && oe(k, ie, o) && (P[ae] ? P[ae].push(y) : P[ae] = [y]);
|
|
1985
1985
|
});
|
|
1986
1986
|
}
|
|
1987
1987
|
return (y) => {
|
|
@@ -1993,11 +1993,11 @@ function Oo(e, t, n, r, o) {
|
|
|
1993
1993
|
[F.today]: !1
|
|
1994
1994
|
}, v = {};
|
|
1995
1995
|
for (const C in M) {
|
|
1996
|
-
const
|
|
1997
|
-
k[C] =
|
|
1996
|
+
const I = M[C];
|
|
1997
|
+
k[C] = I.some((A) => A === y);
|
|
1998
1998
|
}
|
|
1999
|
-
for (const C in
|
|
2000
|
-
v[C] =
|
|
1999
|
+
for (const C in P)
|
|
2000
|
+
v[C] = P[C].some((I) => I === y);
|
|
2001
2001
|
return {
|
|
2002
2002
|
...k,
|
|
2003
2003
|
// custom modifiers should override all the previous ones
|
|
@@ -2066,7 +2066,7 @@ function Fo(e) {
|
|
|
2066
2066
|
function Bo(e) {
|
|
2067
2067
|
return h.createElement("table", { ...e });
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function jo(e) {
|
|
2070
2070
|
return h.createElement("div", { ...e });
|
|
2071
2071
|
}
|
|
2072
2072
|
const Gt = xn(void 0);
|
|
@@ -2076,7 +2076,7 @@ function he() {
|
|
|
2076
2076
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
2077
2077
|
return e;
|
|
2078
2078
|
}
|
|
2079
|
-
function
|
|
2079
|
+
function Io(e) {
|
|
2080
2080
|
const { components: t } = he();
|
|
2081
2081
|
return h.createElement(t.Dropdown, { ...e });
|
|
2082
2082
|
}
|
|
@@ -2160,8 +2160,8 @@ const Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2160
2160
|
Month: Yo,
|
|
2161
2161
|
MonthCaption: Fo,
|
|
2162
2162
|
MonthGrid: Bo,
|
|
2163
|
-
Months:
|
|
2164
|
-
MonthsDropdown:
|
|
2163
|
+
Months: jo,
|
|
2164
|
+
MonthsDropdown: Io,
|
|
2165
2165
|
Nav: Ao,
|
|
2166
2166
|
NextMonthButton: Ho,
|
|
2167
2167
|
Option: qo,
|
|
@@ -2357,8 +2357,8 @@ function Ws(e, t, { classNames: n, months: r, focused: o, dateLib: s }) {
|
|
|
2357
2357
|
if (b instanceof HTMLElement ? (He(b).forEach((M) => {
|
|
2358
2358
|
if (!(M instanceof HTMLElement))
|
|
2359
2359
|
return;
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2360
|
+
const P = Cs(M);
|
|
2361
|
+
P && M.contains(P) && M.removeChild(P);
|
|
2362
2362
|
const y = qe(M);
|
|
2363
2363
|
y && y.classList.remove(f);
|
|
2364
2364
|
const k = $e(M);
|
|
@@ -2370,8 +2370,8 @@ function Ws(e, t, { classNames: n, months: r, focused: o, dateLib: s }) {
|
|
|
2370
2370
|
if (O && O.every((E) => E instanceof HTMLElement) && p && p.every((E) => E instanceof HTMLElement)) {
|
|
2371
2371
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2372
2372
|
const E = Ns(e.current);
|
|
2373
|
-
E && (E.style.zIndex = "1"), O.forEach((M,
|
|
2374
|
-
const y = p[
|
|
2373
|
+
E && (E.style.zIndex = "1"), O.forEach((M, P) => {
|
|
2374
|
+
const y = p[P];
|
|
2375
2375
|
if (!y)
|
|
2376
2376
|
return;
|
|
2377
2377
|
M.style.position = "relative", M.style.overflow = "hidden";
|
|
@@ -2383,8 +2383,8 @@ function Ws(e, t, { classNames: n, months: r, focused: o, dateLib: s }) {
|
|
|
2383
2383
|
c.current = !1, e.current && (e.current.style.isolation = ""), E && (E.style.zIndex = ""), k && k.classList.remove(f), v && v.classList.remove(m), M.style.position = "", M.style.overflow = "", M.contains(y) && M.removeChild(y);
|
|
2384
2384
|
};
|
|
2385
2385
|
y.style.pointerEvents = "none", y.style.position = "absolute", y.style.overflow = "hidden", y.setAttribute("aria-hidden", "true");
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2386
|
+
const I = xs(y);
|
|
2387
|
+
I && (I.style.opacity = "0");
|
|
2388
2388
|
const A = qe(y);
|
|
2389
2389
|
A && (A.classList.add(u ? n[z.caption_before_exit] : n[z.caption_after_exit]), A.addEventListener("animationend", C));
|
|
2390
2390
|
const H = $e(y);
|
|
@@ -2394,9 +2394,9 @@ function Ws(e, t, { classNames: n, months: r, focused: o, dateLib: s }) {
|
|
|
2394
2394
|
});
|
|
2395
2395
|
}
|
|
2396
2396
|
function Ss(e, t, n, r) {
|
|
2397
|
-
const o = e[0], s = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } = n ?? {}, { addDays: l, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: f, endOfISOWeek: m, endOfMonth: w, endOfWeek: b, isAfter: p, startOfBroadcastWeek: O, startOfISOWeek: E, startOfWeek: M } = r,
|
|
2397
|
+
const o = e[0], s = e[e.length - 1], { ISOWeek: i, fixedWeeks: a, broadcastCalendar: c } = n ?? {}, { addDays: l, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: f, endOfISOWeek: m, endOfMonth: w, endOfWeek: b, isAfter: p, startOfBroadcastWeek: O, startOfISOWeek: E, startOfWeek: M } = r, P = c ? O(o, r) : i ? E(o) : M(o), y = c ? f(s) : i ? m(w(s)) : b(w(s)), k = d(y, P), v = u(s, o) + 1, C = [];
|
|
2398
2398
|
for (let H = 0; H <= k; H++) {
|
|
2399
|
-
const G = l(
|
|
2399
|
+
const G = l(P, H);
|
|
2400
2400
|
if (t && p(G, t))
|
|
2401
2401
|
break;
|
|
2402
2402
|
C.push(G);
|
|
@@ -2440,17 +2440,17 @@ function mt(e, t, n, r) {
|
|
|
2440
2440
|
}
|
|
2441
2441
|
function Ts(e, t, n, r) {
|
|
2442
2442
|
const { addDays: o, endOfBroadcastWeek: s, endOfISOWeek: i, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: f, startOfWeek: m } = r, w = e.reduce((b, p) => {
|
|
2443
|
-
const O = n.broadcastCalendar ? u(p, r) : n.ISOWeek ? f(p) : m(p), E = n.broadcastCalendar ? s(p) : n.ISOWeek ? i(a(p)) : c(a(p)), M = t.filter((v) => v >= O && v <= E),
|
|
2444
|
-
if (n.fixedWeeks && M.length <
|
|
2443
|
+
const O = n.broadcastCalendar ? u(p, r) : n.ISOWeek ? f(p) : m(p), E = n.broadcastCalendar ? s(p) : n.ISOWeek ? i(a(p)) : c(a(p)), M = t.filter((v) => v >= O && v <= E), P = n.broadcastCalendar ? 35 : 42;
|
|
2444
|
+
if (n.fixedWeeks && M.length < P) {
|
|
2445
2445
|
const v = t.filter((C) => {
|
|
2446
|
-
const
|
|
2447
|
-
return C > E && C <= o(E,
|
|
2446
|
+
const I = P - M.length;
|
|
2447
|
+
return C > E && C <= o(E, I);
|
|
2448
2448
|
});
|
|
2449
2449
|
M.push(...v);
|
|
2450
2450
|
}
|
|
2451
2451
|
const y = M.reduce((v, C) => {
|
|
2452
|
-
const
|
|
2453
|
-
return A ? A.days.push(H) : v.push(new Do(
|
|
2452
|
+
const I = n.ISOWeek ? l(C) : d(C), A = v.find((G) => G.weekNumber === I), H = new It(C, p, r);
|
|
2453
|
+
return A ? A.days.push(H) : v.push(new Do(I, [H])), v;
|
|
2454
2454
|
}, []), k = new Mo(p, y);
|
|
2455
2455
|
return b.push(k), b;
|
|
2456
2456
|
}, []);
|
|
@@ -2492,7 +2492,7 @@ function Pe(e, t) {
|
|
|
2492
2492
|
const [n, r] = Ge(e);
|
|
2493
2493
|
return [t === void 0 ? n : t, r];
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function js(e, t) {
|
|
2496
2496
|
const [n, r] = Ps(e, t), { startOfMonth: o, endOfMonth: s } = t, i = mt(e, n, r, t), [a, c] = Pe(
|
|
2497
2497
|
i,
|
|
2498
2498
|
// initialMonth is always computed from props.month if provided
|
|
@@ -2529,7 +2529,7 @@ var J;
|
|
|
2529
2529
|
function yt(e) {
|
|
2530
2530
|
return !e[F.disabled] && !e[F.hidden] && !e[F.outside];
|
|
2531
2531
|
}
|
|
2532
|
-
function
|
|
2532
|
+
function Is(e, t, n, r) {
|
|
2533
2533
|
let o, s = -1;
|
|
2534
2534
|
for (const i of e) {
|
|
2535
2535
|
const a = t(i);
|
|
@@ -2538,13 +2538,13 @@ function js(e, t, n, r) {
|
|
|
2538
2538
|
return o || (o = e.find((i) => yt(t(i)))), o;
|
|
2539
2539
|
}
|
|
2540
2540
|
function As(e, t, n, r, o, s, i) {
|
|
2541
|
-
const { ISOWeek: a, broadcastCalendar: c } = s, { addDays: l, addMonths: d, addWeeks: u, addYears: f, endOfBroadcastWeek: m, endOfISOWeek: w, endOfWeek: b, max: p, min: O, startOfBroadcastWeek: E, startOfISOWeek: M, startOfWeek:
|
|
2541
|
+
const { ISOWeek: a, broadcastCalendar: c } = s, { addDays: l, addMonths: d, addWeeks: u, addYears: f, endOfBroadcastWeek: m, endOfISOWeek: w, endOfWeek: b, max: p, min: O, startOfBroadcastWeek: E, startOfISOWeek: M, startOfWeek: P } = i;
|
|
2542
2542
|
let k = {
|
|
2543
2543
|
day: l,
|
|
2544
2544
|
week: u,
|
|
2545
2545
|
month: d,
|
|
2546
2546
|
year: f,
|
|
2547
|
-
startOfWeek: (v) => c ? E(v, i) : a ? M(v) :
|
|
2547
|
+
startOfWeek: (v) => c ? E(v, i) : a ? M(v) : P(v),
|
|
2548
2548
|
endOfWeek: (v) => c ? m(v) : a ? w(v) : b(v)
|
|
2549
2549
|
}[e](n, t === "after" ? 1 : -1);
|
|
2550
2550
|
return t === "before" && r ? k = p([r, k]) : t === "after" && o && (k = O([o, k])), k;
|
|
@@ -2552,11 +2552,11 @@ function As(e, t, n, r, o, s, i) {
|
|
|
2552
2552
|
function Ut(e, t, n, r, o, s, i, a = 0) {
|
|
2553
2553
|
if (a > 365)
|
|
2554
2554
|
return;
|
|
2555
|
-
const c = As(e, t, n.date, r, o, s, i), l = !!(s.disabled && oe(c, s.disabled, i)), d = !!(s.hidden && oe(c, s.hidden, i)), u = c, f = new
|
|
2555
|
+
const c = As(e, t, n.date, r, o, s, i), l = !!(s.disabled && oe(c, s.disabled, i)), d = !!(s.hidden && oe(c, s.hidden, i)), u = c, f = new It(c, u, i);
|
|
2556
2556
|
return !l && !d ? f : Ut(e, t, f, r, o, s, i, a + 1);
|
|
2557
2557
|
}
|
|
2558
2558
|
function Hs(e, t, n, r, o) {
|
|
2559
|
-
const { autoFocus: s } = e, [i, a] = Ge(), c =
|
|
2559
|
+
const { autoFocus: s } = e, [i, a] = Ge(), c = Is(t.days, n, r || (() => !1), i), [l, d] = Ge(s ? c : void 0);
|
|
2560
2560
|
return {
|
|
2561
2561
|
isFocusTarget: (b) => !!c?.isEqualTo(b),
|
|
2562
2562
|
setFocused: d,
|
|
@@ -2693,7 +2693,7 @@ function Vs(e) {
|
|
|
2693
2693
|
from: t.selected.from ? new $(t.selected.from, t.timeZone) : void 0,
|
|
2694
2694
|
to: t.selected.to ? new $(t.selected.to, t.timeZone) : void 0
|
|
2695
2695
|
}));
|
|
2696
|
-
const { components: n, formatters: r, labels: o, dateLib: s, locale: i, classNames: a } =
|
|
2696
|
+
const { components: n, formatters: r, labels: o, dateLib: s, locale: i, classNames: a } = Ie(() => {
|
|
2697
2697
|
const D = { ...ze, ...t.locale };
|
|
2698
2698
|
return {
|
|
2699
2699
|
dateLib: new se({
|
|
@@ -2725,7 +2725,7 @@ function Vs(e) {
|
|
|
2725
2725
|
t.formatters,
|
|
2726
2726
|
t.labels,
|
|
2727
2727
|
t.classNames
|
|
2728
|
-
]), { captionLayout: c, mode: l, navLayout: d, numberOfMonths: u = 1, onDayBlur: f, onDayClick: m, onDayFocus: w, onDayKeyDown: b, onDayMouseEnter: p, onDayMouseLeave: O, onNextClick: E, onPrevClick: M, showWeekNumber:
|
|
2728
|
+
]), { captionLayout: c, mode: l, navLayout: d, numberOfMonths: u = 1, onDayBlur: f, onDayClick: m, onDayFocus: w, onDayKeyDown: b, onDayMouseEnter: p, onDayMouseLeave: O, onNextClick: E, onPrevClick: M, showWeekNumber: P, styles: y } = t, { formatCaption: k, formatDay: v, formatMonthDropdown: C, formatWeekNumber: I, formatWeekNumberHeader: A, formatWeekdayName: H, formatYearDropdown: G } = r, ne = js(t, s), { days: ae, months: ie, navStart: me, navEnd: pe, previousMonth: Z, nextMonth: L, goToMonth: Q } = ne, ve = Oo(ae, t, me, pe, s), { isSelected: R, select: de, selected: ye } = zs(t, s) ?? {}, { blur: Qe, focused: Xe, isFocusTarget: Kt, moveFocus: Ue, setFocused: _e } = Hs(t, ne, ve, R ?? (() => !1), s), { labelDayButton: Jt, labelGridcell: en, labelGrid: tn, labelMonthDropdown: nn, labelNav: Ke, labelPrevious: rn, labelNext: on, labelWeekday: sn, labelWeekNumber: an, labelWeekNumberHeader: cn, labelYearDropdown: un } = o, ln = Ie(() => hs(s, t.ISOWeek), [s, t.ISOWeek]), Je = l !== void 0 || m !== void 0, Ye = V(() => {
|
|
2729
2729
|
Z && (Q(Z), M?.(Z));
|
|
2730
2730
|
}, [Z, Q, M]), Fe = V(() => {
|
|
2731
2731
|
L && (Q(L), E?.(L));
|
|
@@ -2768,7 +2768,7 @@ function Vs(e) {
|
|
|
2768
2768
|
}, [s, Q]), wn = V((D) => (Y) => {
|
|
2769
2769
|
const N = Number(Y.target.value), ce = s.setYear(s.startOfMonth(D), N);
|
|
2770
2770
|
Q(ce);
|
|
2771
|
-
}, [s, Q]), { className: pn, style: vn } =
|
|
2771
|
+
}, [s, Q]), { className: pn, style: vn } = Ie(() => ({
|
|
2772
2772
|
className: [a[g.Root], t.className].filter(Boolean).join(" "),
|
|
2773
2773
|
style: { ...y?.[g.Root], ...t.style }
|
|
2774
2774
|
}), [a, t.className, t.style, y]), kn = es(t), et = Te(null);
|
|
@@ -2844,20 +2844,20 @@ function Vs(e) {
|
|
|
2844
2844
|
!t.hideWeekdays && h.createElement(
|
|
2845
2845
|
n.Weekdays,
|
|
2846
2846
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: a[g.Weekdays], style: y?.[g.Weekdays] },
|
|
2847
|
-
|
|
2847
|
+
P && h.createElement(n.WeekNumberHeader, { "aria-label": cn(s.options), className: a[g.WeekNumberHeader], style: y?.[g.WeekNumberHeader], scope: "col" }, A()),
|
|
2848
2848
|
ln.map((X, Ee) => h.createElement(n.Weekday, { "aria-label": sn(X, s.options, s), className: a[g.Weekday], key: Ee, style: y?.[g.Weekday], scope: "col" }, H(X, s.options, s)))
|
|
2849
2849
|
),
|
|
2850
2850
|
h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: a[g.Weeks], style: y?.[g.Weeks] }, D.weeks.map((X, Ee) => h.createElement(
|
|
2851
2851
|
n.Week,
|
|
2852
2852
|
{ className: a[g.Week], key: X.weekNumber, style: y?.[g.Week], week: X },
|
|
2853
|
-
|
|
2853
|
+
P && h.createElement(n.WeekNumber, { week: X, style: y?.[g.WeekNumber], "aria-label": an(X.weekNumber, {
|
|
2854
2854
|
locale: i
|
|
2855
|
-
}), className: a[g.WeekNumber], scope: "row", role: "rowheader" },
|
|
2855
|
+
}), className: a[g.WeekNumber], scope: "row", role: "rowheader" }, I(X.weekNumber, s)),
|
|
2856
2856
|
X.days.map((q) => {
|
|
2857
2857
|
const { date: K } = q, x = ve(q);
|
|
2858
2858
|
if (x[F.focused] = !x.hidden && !!Xe?.isEqualTo(q), x[U.selected] = R?.(K) || x.selected, Ve(ye)) {
|
|
2859
|
-
const { from: Be, to:
|
|
2860
|
-
x[U.range_start] = !!(Be &&
|
|
2859
|
+
const { from: Be, to: je } = ye;
|
|
2860
|
+
x[U.range_start] = !!(Be && je && s.isSameDay(K, Be)), x[U.range_end] = !!(Be && je && s.isSameDay(K, je)), x[U.range_middle] = re(ye, K, !0, s);
|
|
2861
2861
|
}
|
|
2862
2862
|
const Dn = fs(x, y, t.modifiersStyles), On = Co(x, a, t.modifiersClassNames), Cn = !Je && !x.hidden ? en(K, x, s.options, s) : void 0;
|
|
2863
2863
|
return h.createElement(n.Day, { key: `${s.format(K, "yyyy-MM-dd")}_${s.format(q.displayMonth, "yyyy-MM")}`, day: q, modifiers: x, className: On.join(" "), style: Dn, role: "gridcell", "aria-selected": x.selected || void 0, "aria-label": Cn, "data-day": s.format(K, "yyyy-MM-dd"), "data-month": q.outside ? s.format(K, "yyyy-MM") : void 0, "data-selected": x.selected || void 0, "data-disabled": x.disabled || void 0, "data-hidden": x.hidden || void 0, "data-outside": q.outside || void 0, "data-focused": x.focused || void 0, "data-today": x.today || void 0 }, !x.hidden && Je ? h.createElement(n.DayButton, { className: a[g.DayButton], style: y?.[g.DayButton], type: "button", day: q, modifiers: x, disabled: x.disabled || void 0, tabIndex: Kt(q) ? 0 : -1, "aria-label": Jt(K, x, s.options, s), onClick: dn(q, x), onBlur: hn(q, x), onFocus: fn(q, x), onKeyDown: mn(q, x), onMouseEnter: yn(q, x), onMouseLeave: gn(q, x) }, v(K, s.options, s)) : !x.hidden && v(q.date, s.options, s));
|
|
@@ -2887,10 +2887,10 @@ function Qs({
|
|
|
2887
2887
|
to: R + Math.ceil(r / 2)
|
|
2888
2888
|
};
|
|
2889
2889
|
}, [r])
|
|
2890
|
-
), { onPrevClick: d, startMonth: u, endMonth: f } = s, m = i === "years" ? 1 : o, w = W("relative flex", s.monthsClassName), b = W("relative mx-10 flex h-7 items-center justify-center", s.monthCaptionClassName), p = W("flex flex-row", s.weekdaysClassName), O = W("w-8 font-normal text-muted-foreground text-sm", s.weekdayClassName), E = W("w-full", s.monthClassName), M = W("relative flex items-center justify-center pt-1", s.captionClassName),
|
|
2890
|
+
), { onPrevClick: d, startMonth: u, endMonth: f } = s, m = i === "years" ? 1 : o, w = W("relative flex", s.monthsClassName), b = W("relative mx-10 flex h-7 items-center justify-center", s.monthCaptionClassName), p = W("flex flex-row", s.weekdaysClassName), O = W("w-8 font-normal text-muted-foreground text-sm", s.weekdayClassName), E = W("w-full", s.monthClassName), M = W("relative flex items-center justify-center pt-1", s.captionClassName), P = W("truncate font-medium text-sm", s.captionLabelClassName), y = Ze({
|
|
2891
2891
|
variant: "outline",
|
|
2892
2892
|
className: "absolute h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
2893
|
-
}), k = W(y, "right-0", s.buttonNextClassName), v = W(y, "left-0", s.buttonPreviousClassName), C = W("flex items-start", s.navClassName),
|
|
2893
|
+
}), k = W(y, "right-0", s.buttonNextClassName), v = W(y, "left-0", s.buttonPreviousClassName), C = W("flex items-start", s.navClassName), I = W("mx-auto mt-4", s.monthGridClassName), A = W("mt-2 flex w-max items-start", s.weekClassName), H = W("flex size-8 flex-1 items-center justify-center p-0 text-sm", s.dayClassName), G = W(
|
|
2894
2894
|
Ze({ variant: "ghost" }),
|
|
2895
2895
|
"size-8 rounded-md p-0 font-normal transition-none aria-selected:opacity-100",
|
|
2896
2896
|
s.dayButtonClassName
|
|
@@ -2904,7 +2904,7 @@ function Qs({
|
|
|
2904
2904
|
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
2905
2905
|
s.outsideClassName
|
|
2906
2906
|
), Q = W("text-muted-foreground opacity-50", s.disabledClassName), ve = W("invisible flex-1", s.hiddenClassName);
|
|
2907
|
-
return /* @__PURE__ */
|
|
2907
|
+
return /* @__PURE__ */ T.jsx(
|
|
2908
2908
|
Vs,
|
|
2909
2909
|
{
|
|
2910
2910
|
className: W("p-3", e),
|
|
@@ -2915,11 +2915,11 @@ function Qs({
|
|
|
2915
2915
|
weekday: O,
|
|
2916
2916
|
month: E,
|
|
2917
2917
|
caption: M,
|
|
2918
|
-
caption_label:
|
|
2918
|
+
caption_label: P,
|
|
2919
2919
|
button_next: k,
|
|
2920
2920
|
button_previous: v,
|
|
2921
2921
|
nav: C,
|
|
2922
|
-
month_grid:
|
|
2922
|
+
month_grid: I,
|
|
2923
2923
|
week: A,
|
|
2924
2924
|
day: H,
|
|
2925
2925
|
day_button: G,
|
|
@@ -2935,9 +2935,9 @@ function Qs({
|
|
|
2935
2935
|
components: {
|
|
2936
2936
|
Chevron: ({ orientation: R }) => {
|
|
2937
2937
|
const de = R === "left" ? kt : Mt;
|
|
2938
|
-
return /* @__PURE__ */
|
|
2938
|
+
return /* @__PURE__ */ T.jsx(de, { className: "h-4 w-4" });
|
|
2939
2939
|
},
|
|
2940
|
-
Nav: ({ className: R }) => /* @__PURE__ */
|
|
2940
|
+
Nav: ({ className: R }) => /* @__PURE__ */ T.jsx(
|
|
2941
2941
|
Xs,
|
|
2942
2942
|
{
|
|
2943
2943
|
className: R,
|
|
@@ -2949,7 +2949,7 @@ function Qs({
|
|
|
2949
2949
|
startMonth: u
|
|
2950
2950
|
}
|
|
2951
2951
|
),
|
|
2952
|
-
CaptionLabel: (R) => /* @__PURE__ */
|
|
2952
|
+
CaptionLabel: (R) => /* @__PURE__ */ T.jsx(
|
|
2953
2953
|
Us,
|
|
2954
2954
|
{
|
|
2955
2955
|
displayYears: c,
|
|
@@ -2959,7 +2959,7 @@ function Qs({
|
|
|
2959
2959
|
...R
|
|
2960
2960
|
}
|
|
2961
2961
|
),
|
|
2962
|
-
MonthGrid: ({ className: R, children: de, ...ye }) => /* @__PURE__ */
|
|
2962
|
+
MonthGrid: ({ className: R, children: de, ...ye }) => /* @__PURE__ */ T.jsx(
|
|
2963
2963
|
Ks,
|
|
2964
2964
|
{
|
|
2965
2965
|
className: R,
|
|
@@ -3016,8 +3016,8 @@ function Xs({
|
|
|
3016
3016
|
d(c), a?.(c);
|
|
3017
3017
|
}
|
|
3018
3018
|
}, [d, c, o, t, a, s]);
|
|
3019
|
-
return /* @__PURE__ */
|
|
3020
|
-
/* @__PURE__ */
|
|
3019
|
+
return /* @__PURE__ */ T.jsxs("nav", { className: W("flex items-center", e), children: [
|
|
3020
|
+
/* @__PURE__ */ T.jsx(
|
|
3021
3021
|
Ce,
|
|
3022
3022
|
{
|
|
3023
3023
|
"aria-label": t === "years" ? `Go to the previous ${o.to - o.from + 1} years` : Xt(),
|
|
@@ -3027,10 +3027,10 @@ function Xs({
|
|
|
3027
3027
|
tabIndex: u ? void 0 : -1,
|
|
3028
3028
|
type: "button",
|
|
3029
3029
|
variant: "outline",
|
|
3030
|
-
children: /* @__PURE__ */
|
|
3030
|
+
children: /* @__PURE__ */ T.jsx(kt, { className: "h-4 w-4" })
|
|
3031
3031
|
}
|
|
3032
3032
|
),
|
|
3033
|
-
/* @__PURE__ */
|
|
3033
|
+
/* @__PURE__ */ T.jsx(
|
|
3034
3034
|
Ce,
|
|
3035
3035
|
{
|
|
3036
3036
|
"aria-label": t === "years" ? `Go to the next ${o.to - o.from + 1} years` : Qt(),
|
|
@@ -3040,7 +3040,7 @@ function Xs({
|
|
|
3040
3040
|
tabIndex: f ? void 0 : -1,
|
|
3041
3041
|
type: "button",
|
|
3042
3042
|
variant: "outline",
|
|
3043
|
-
children: /* @__PURE__ */
|
|
3043
|
+
children: /* @__PURE__ */ T.jsx(Mt, { className: "h-4 w-4" })
|
|
3044
3044
|
}
|
|
3045
3045
|
)
|
|
3046
3046
|
] });
|
|
@@ -3053,7 +3053,7 @@ function Us({
|
|
|
3053
3053
|
displayYears: o,
|
|
3054
3054
|
...s
|
|
3055
3055
|
}) {
|
|
3056
|
-
return t ? /* @__PURE__ */
|
|
3056
|
+
return t ? /* @__PURE__ */ T.jsx(
|
|
3057
3057
|
Ce,
|
|
3058
3058
|
{
|
|
3059
3059
|
className: "h-7 w-full truncate font-medium text-sm",
|
|
@@ -3062,7 +3062,7 @@ function Us({
|
|
|
3062
3062
|
variant: "ghost",
|
|
3063
3063
|
children: n === "days" ? e : `${o.from} - ${o.to}`
|
|
3064
3064
|
}
|
|
3065
|
-
) : /* @__PURE__ */
|
|
3065
|
+
) : /* @__PURE__ */ T.jsx("span", { ...s, children: e });
|
|
3066
3066
|
}
|
|
3067
3067
|
function Ks({
|
|
3068
3068
|
className: e,
|
|
@@ -3074,7 +3074,7 @@ function Ks({
|
|
|
3074
3074
|
setNavView: i,
|
|
3075
3075
|
...a
|
|
3076
3076
|
}) {
|
|
3077
|
-
return s === "years" ? /* @__PURE__ */
|
|
3077
|
+
return s === "years" ? /* @__PURE__ */ T.jsx(
|
|
3078
3078
|
Js,
|
|
3079
3079
|
{
|
|
3080
3080
|
className: e,
|
|
@@ -3085,7 +3085,7 @@ function Ks({
|
|
|
3085
3085
|
startMonth: r,
|
|
3086
3086
|
...a
|
|
3087
3087
|
}
|
|
3088
|
-
) : /* @__PURE__ */
|
|
3088
|
+
) : /* @__PURE__ */ T.jsx("table", { className: e, ...a, children: t });
|
|
3089
3089
|
}
|
|
3090
3090
|
function Js({
|
|
3091
3091
|
className: e,
|
|
@@ -3097,9 +3097,9 @@ function Js({
|
|
|
3097
3097
|
...i
|
|
3098
3098
|
}) {
|
|
3099
3099
|
const { goToMonth: a, selected: c } = he();
|
|
3100
|
-
return /* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ T.jsx("div", { className: W("grid grid-cols-4 gap-y-2", e), ...i, children: Array.from({ length: t.to - t.from + 1 }, (l, d) => {
|
|
3101
3101
|
const u = le(new Date(t.from + d, 11, 31), n) < 0, f = le(new Date(t.from + d, 0, 0), r) > 0, m = u || f;
|
|
3102
|
-
return /* @__PURE__ */
|
|
3102
|
+
return /* @__PURE__ */ T.jsx(
|
|
3103
3103
|
Ce,
|
|
3104
3104
|
{
|
|
3105
3105
|
className: W(
|
|
@@ -3129,7 +3129,7 @@ export {
|
|
|
3129
3129
|
Gn as f,
|
|
3130
3130
|
Ze as g,
|
|
3131
3131
|
kt as h,
|
|
3132
|
-
|
|
3132
|
+
In as i,
|
|
3133
3133
|
Qs as j,
|
|
3134
3134
|
oa as u
|
|
3135
3135
|
};
|