impact-nova 1.6.4 → 1.6.6

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.
@@ -1,27 +1,27 @@
1
1
  import { jsxs as Y, jsx as c } from "react/jsx-runtime";
2
2
  import * as d from "react";
3
3
  import { ChevronLeftIcon as ye, ChevronRightIcon as Ne } from "lucide-react";
4
- import { getDefaultClassNames as Be, DayPicker as Fe } from "react-day-picker";
4
+ import { getDefaultClassNames as Fe, DayPicker as Te } from "react-day-picker";
5
5
  import { cn as f } from "../../lib/utils.js";
6
6
  import { Button as P } from "./button.js";
7
7
  import "./button-variants.js";
8
- import ue from "./select/select.js";
9
- import { FISCAL_PATTERNS as Te, resolveWeekSelection as Ke } from "../../lib/fiscal-calendar.js";
10
- import { getIntlLocale as We, getDateFnsLocale as qe } from "../../i18n/getDateFnsLocale.js";
11
- import { useImpactNovaI18n as Ge } from "../../i18n/ImpactNovaI18nContext.js";
12
- const fe = d.createContext(0);
13
- function ot({
14
- className: se,
8
+ import fe from "./select/select.js";
9
+ import { FISCAL_PATTERNS as Ke, resolveWeekSelection as We } from "../../lib/fiscal-calendar.js";
10
+ import { getIntlLocale as qe, getDateFnsLocale as Ge } from "../../i18n/getDateFnsLocale.js";
11
+ import { useImpactNovaI18n as Je } from "../../i18n/ImpactNovaI18nContext.js";
12
+ const de = d.createContext(0);
13
+ function lt({
14
+ className: oe,
15
15
  classNames: J,
16
16
  showOutsideDays: y = !1,
17
17
  captionLayout: Q = "dropdown",
18
18
  buttonVariant: F = "ghost",
19
19
  formatters: X,
20
20
  components: Ce,
21
- showFooter: x = !0,
21
+ showFooter: b = !0,
22
22
  onApply: Z,
23
- onCancel: de,
24
- onClear: me,
23
+ onCancel: me,
24
+ onClear: ge,
25
25
  mode: T = "single",
26
26
  selected: D,
27
27
  onSelect: U,
@@ -32,9 +32,9 @@ function ot({
32
32
  onWeekSelect: k,
33
33
  calendarType: R = "calendar",
34
34
  fiscalMode: V = "basic",
35
- selectionMode: oe = "week",
36
- fiscalMonthPattern: le,
37
- fiscalYearStartMonth: ge = 1,
35
+ selectionMode: le = "week",
36
+ fiscalMonthPattern: ie,
37
+ fiscalYearStartMonth: he = 1,
38
38
  weekStartsOn: K = 1,
39
39
  // Default Monday
40
40
  // Month picker props
@@ -42,13 +42,13 @@ function ot({
42
42
  selectedMonths: N,
43
43
  onMonthSelect: _,
44
44
  month: B,
45
- defaultMonth: he,
45
+ defaultMonth: xe,
46
46
  onMonthChange: Se,
47
47
  startMonth: _e,
48
48
  endMonth: Ye,
49
- ...xe
49
+ ...ee
50
50
  }) {
51
- const { locale: ee, t: h } = Ge(), W = d.useMemo(() => We(ee), [ee]), ke = d.useMemo(() => qe(ee), [ee]), be = d.useMemo(
51
+ const { locale: te, t: x } = Je(), W = d.useMemo(() => qe(te), [te]), ke = d.useMemo(() => Ge(te), [te]), be = d.useMemo(
52
52
  () => Array.from(
53
53
  { length: 12 },
54
54
  (e, n) => new Date(2024, n, 1).toLocaleString(W, { month: "long" })
@@ -60,14 +60,14 @@ function ot({
60
60
  (e, n) => new Date(2024, n, 1).toLocaleString(W, { month: "short" })
61
61
  ),
62
62
  [W]
63
- ), te = d.useMemo(() => {
63
+ ), ne = d.useMemo(() => {
64
64
  if (R === "fiscal") {
65
- if (le) return le;
66
- if (V === "advanced") return Te["4-4-5"];
65
+ if (ie) return ie;
66
+ if (V === "advanced") return Ke["4-4-5"];
67
67
  }
68
- }, [R, V, le]), b = Be(), je = d.useMemo(() => new Date(1900, 0, 1), []), Me = d.useMemo(() => new Date(2100, 11, 31), []), E = _e || je, L = Ye || Me, [q, ne] = d.useState(D), [A, pe] = d.useState(() => {
68
+ }, [R, V, ie]), v = Fe(), je = d.useMemo(() => new Date(1900, 0, 1), []), Me = d.useMemo(() => new Date(2100, 11, 31), []), E = _e || je, L = Ye || Me, [q, re] = d.useState(D), [A, ve] = d.useState(() => {
69
69
  if (B) return B;
70
- if (he) return he;
70
+ if (xe) return xe;
71
71
  if (D) {
72
72
  if (Array.isArray(D))
73
73
  return D[0] || /* @__PURE__ */ new Date();
@@ -79,28 +79,28 @@ function ot({
79
79
  return /* @__PURE__ */ new Date();
80
80
  });
81
81
  d.useEffect(() => {
82
- B && (pe(B), ve(B.getFullYear()));
82
+ B && (ve(B), pe(B.getFullYear()));
83
83
  }, [B]);
84
- const [$, re] = d.useState(C), [j, ae] = d.useState(N), [ze, ve] = d.useState(A.getFullYear());
84
+ const [$, ae] = d.useState(C), [j, se] = d.useState(N), [ze, pe] = d.useState(A.getFullYear());
85
85
  d.useEffect(() => {
86
- ne(D), re(C), ae(N);
86
+ re(D), ae(C), se(N);
87
87
  }, [D, C, N]);
88
88
  const O = (e) => {
89
- pe(e), ve(e.getFullYear()), Se?.(e);
90
- }, ie = d.useCallback((e) => {
89
+ ve(e), pe(e.getFullYear()), Se?.(e);
90
+ }, ce = d.useCallback((e) => {
91
91
  let n;
92
- return e instanceof Date ? n = e : n = e.days.find((t) => !t.outside)?.date || e.days[0]?.date || /* @__PURE__ */ new Date(), Ke(n, {
92
+ return e instanceof Date ? n = e : n = e.days.find((t) => !t.outside)?.date || e.days[0]?.date || /* @__PURE__ */ new Date(), We(n, {
93
93
  calendarType: R,
94
94
  fiscalMode: V,
95
- selectionMode: oe,
96
- fiscalMonthPattern: te,
97
- fiscalYearStartMonth: ge,
95
+ selectionMode: le,
96
+ fiscalMonthPattern: ne,
97
+ fiscalYearStartMonth: he,
98
98
  weekStartsOn: K
99
99
  });
100
- }, [R, V, oe, te, ge, K]), ce = d.useCallback((e) => {
100
+ }, [R, V, le, ne, he, K]), ue = d.useCallback((e) => {
101
101
  const n = (t, r) => t.year === r.year && t.month === r.month && t.weekOfMonth === r.weekOfMonth;
102
- if (x)
103
- re((t) => {
102
+ if (b)
103
+ ae((t) => {
104
104
  let r;
105
105
  if (p === "single")
106
106
  r = e;
@@ -132,10 +132,10 @@ function ot({
132
132
  e.startDate < t.from.startDate && (r.from = e, r.to = t.from), k?.(r);
133
133
  }
134
134
  }
135
- }, [p, x, C, k]), Ie = d.useCallback((e, n) => {
135
+ }, [p, b, C, k]), Ie = d.useCallback((e, n) => {
136
136
  const t = { year: e, month: n }, r = (a, s) => a.year === s.year && a.month === s.month;
137
- if (x)
138
- ae((a) => {
137
+ if (b)
138
+ se((a) => {
139
139
  let s;
140
140
  if (w === "single")
141
141
  s = t;
@@ -167,7 +167,7 @@ function ot({
167
167
  new Date(t.year, t.month, 1) < s ? _?.({ from: t, to: a.from }) : _?.({ from: a.from, to: t });
168
168
  }
169
169
  }
170
- }, [w, x, N, _]), De = d.useCallback(() => {
170
+ }, [w, b, N, _]), De = d.useCallback(() => {
171
171
  const e = E.getFullYear(), n = L.getFullYear(), t = [];
172
172
  for (let r = e; r <= n; r++)
173
173
  t.push({ label: r.toString(), value: r.toString() });
@@ -180,7 +180,7 @@ function ot({
180
180
  return !(E && a < new Date(E.getFullYear(), E.getMonth(), 1) || L && a > new Date(L.getFullYear(), L.getMonth(), 1));
181
181
  }), [E, L, be]), G = d.useMemo(() => {
182
182
  if (m !== "week") return;
183
- const e = x ? $ : C;
183
+ const e = b ? $ : C;
184
184
  if (!e) return;
185
185
  const n = [], t = (r) => {
186
186
  let a = new Date(r.startDate);
@@ -205,45 +205,45 @@ function ot({
205
205
  } else
206
206
  t(e);
207
207
  return n;
208
- }, [m, x, $, C]), Re = d.useMemo(() => {
208
+ }, [m, b, $, C]), Re = d.useMemo(() => {
209
209
  if (m !== "week" || !G || G.length === 0)
210
210
  return { range_start: [], range_middle: [], range_end: [] };
211
- const e = [...G].sort((i, g) => i.getTime() - g.getTime()), n = [], t = [], r = [], a = x ? $ : C, s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
211
+ const e = [...G].sort((i, g) => i.getTime() - g.getTime()), n = [], t = [], r = [], a = b ? $ : C, s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
212
212
  p === "multiple" && Array.isArray(a) && a.forEach((i) => {
213
- const g = i.startDate.toISOString().split("T")[0], v = i.endDate.toISOString().split("T")[0];
214
- s.add(g), o.add(v);
213
+ const g = i.startDate.toISOString().split("T")[0], h = i.endDate.toISOString().split("T")[0];
214
+ s.add(g), o.add(h);
215
215
  });
216
216
  const l = (i, g) => {
217
217
  if (g === 0) return !1;
218
- const v = e[g - 1];
219
- return i.getTime() - v.getTime() <= 1440 * 60 * 1e3;
218
+ const h = e[g - 1];
219
+ return i.getTime() - h.getTime() <= 1440 * 60 * 1e3;
220
220
  }, u = (i, g) => g === e.length - 1 ? !1 : e[g + 1].getTime() - i.getTime() <= 1440 * 60 * 1e3;
221
221
  return e.forEach((i, g) => {
222
- const v = i.toISOString().split("T")[0], M = s.has(v), S = o.has(v), z = l(i, g), I = u(i, g);
222
+ const h = i.toISOString().split("T")[0], M = s.has(h), S = o.has(h), z = l(i, g), I = u(i, g);
223
223
  p === "multiple" ? M ? n.push(i) : S ? r.push(i) : t.push(i) : !z && !I ? (n.push(i), r.push(i)) : z ? I ? t.push(i) : r.push(i) : n.push(i);
224
224
  }), {
225
225
  range_start: n,
226
226
  range_middle: t,
227
227
  range_end: r
228
228
  };
229
- }, [m, G, p, x, $, C]), Ee = d.useCallback((e) => {
229
+ }, [m, G, p, b, $, C]), Ee = d.useCallback((e) => {
230
230
  if (m === "week" && e) {
231
231
  const n = Array.isArray(e) ? e[e.length - 1] : e instanceof Date ? e : void 0;
232
232
  if (n) {
233
- const t = ie(n);
234
- ce(t);
233
+ const t = ce(n);
234
+ ue(t);
235
235
  return;
236
236
  }
237
237
  }
238
- x && ne(e), U?.(e);
239
- }, [x, U, m, ie, ce]), Le = d.useCallback(() => {
238
+ b && re(e), U?.(e);
239
+ }, [b, U, m, ce, ue]), Le = d.useCallback(() => {
240
240
  m === "week" ? (k?.($), Z?.($)) : m === "month" ? (_?.(j), Z?.(j)) : (U?.(q), Z?.(q));
241
241
  }, [q, $, j, U, k, _, Z, m]), $e = d.useCallback(() => {
242
- m === "week" ? re(C) : m === "month" ? ae(N) : ne(D), de?.();
243
- }, [D, C, N, de, m]), Oe = d.useCallback(() => {
244
- m === "week" ? (re(void 0), x || k?.(void 0)) : m === "month" ? (ae(void 0), x || _?.(void 0)) : (ne(void 0), x || U?.(void 0)), me?.();
245
- }, [x, U, k, _, me, m]), Ue = d.useCallback((e, n) => {
246
- const t = x ? j : N;
242
+ m === "week" ? ae(C) : m === "month" ? se(N) : re(D), me?.();
243
+ }, [D, C, N, me, m]), Oe = d.useCallback(() => {
244
+ m === "week" ? (ae(void 0), b || k?.(void 0)) : m === "month" ? (se(void 0), b || _?.(void 0)) : (re(void 0), b || U?.(void 0)), ge?.();
245
+ }, [b, U, k, _, ge, m]), Ue = d.useCallback((e, n) => {
246
+ const t = b ? j : N;
247
247
  if (!t) return !1;
248
248
  if (Array.isArray(t))
249
249
  return t.some((r) => r.year === e && r.month === n);
@@ -256,8 +256,8 @@ function ot({
256
256
  const r = t;
257
257
  return r.year === e && r.month === n;
258
258
  }
259
- }, [x, j, N]), He = d.useCallback((e, n) => {
260
- const t = x ? j : N;
259
+ }, [b, j, N]), He = d.useCallback((e, n) => {
260
+ const t = b ? j : N;
261
261
  if (!t || !("from" in t)) return { isStart: !1, isEnd: !1, isMiddle: !1 };
262
262
  const r = t, a = r.from, s = r.to, o = new Date(e, n, 1).getTime(), l = new Date(a.year, a.month, 1).getTime();
263
263
  if (!s) return { isStart: o === l, isEnd: !1, isMiddle: !1 };
@@ -267,7 +267,20 @@ function ot({
267
267
  isEnd: o === u,
268
268
  isMiddle: o > l && o < u
269
269
  };
270
- }, [x, j, N]), we = ({ yearOffset: e = 0 }) => {
270
+ }, [b, j, N]), Be = d.useCallback((e, n) => {
271
+ const t = ee.disabled;
272
+ if (!t) return !1;
273
+ const r = new Date(e, n, 1, 0, 0, 0, 0), a = new Date(e, n + 1, 0, 23, 59, 59, 999);
274
+ if (t.before) {
275
+ const s = new Date(t.before);
276
+ if (s.setHours(0, 0, 0, 0), a < s) return !0;
277
+ }
278
+ if (t.after) {
279
+ const s = new Date(t.after);
280
+ if (s.setHours(23, 59, 59, 999), r > s) return !0;
281
+ }
282
+ return !1;
283
+ }, [ee.disabled]), we = ({ yearOffset: e = 0 }) => {
271
284
  const n = ze + e;
272
285
  return /* @__PURE__ */ Y("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
273
286
  /* @__PURE__ */ Y("div", { className: "flex items-center justify-between", children: [
@@ -277,15 +290,15 @@ function ot({
277
290
  variant: "ghost",
278
291
  size: "icon",
279
292
  className: "h-7 w-7",
280
- "aria-label": h("calendar.previousYear"),
281
- title: h("calendar.previousYear"),
293
+ "aria-label": x("calendar.previousYear"),
294
+ title: x("calendar.previousYear"),
282
295
  disabled: n <= E.getFullYear(),
283
296
  onClick: () => O(new Date(n - 1, A.getMonth(), 1)),
284
297
  children: /* @__PURE__ */ c(ye, { className: "h-4 w-4" })
285
298
  }
286
299
  ),
287
300
  /* @__PURE__ */ c("div", { className: "flex-1 flex justify-center items-center", children: /* @__PURE__ */ c(
288
- ue,
301
+ fe,
289
302
  {
290
303
  value: { label: n.toString(), value: n.toString() },
291
304
  onChange: (t) => {
@@ -307,8 +320,8 @@ function ot({
307
320
  variant: "ghost",
308
321
  size: "icon",
309
322
  className: "h-7 w-7",
310
- "aria-label": h("calendar.nextYear"),
311
- title: h("calendar.nextYear"),
323
+ "aria-label": x("calendar.nextYear"),
324
+ title: x("calendar.nextYear"),
312
325
  disabled: n >= L.getFullYear(),
313
326
  onClick: () => O(new Date(n + 1, A.getMonth(), 1)),
314
327
  children: /* @__PURE__ */ c(Ne, { className: "h-4 w-4" })
@@ -316,9 +329,9 @@ function ot({
316
329
  )
317
330
  ] }),
318
331
  /* @__PURE__ */ c("div", { className: "grid grid-cols-4 gap-y-4 gap-x-0", children: Ae.map((t, r) => {
319
- const a = Ue(n, r), { isStart: s, isEnd: o, isMiddle: l } = He(n, r), u = w === "range", i = x ? j : N, g = i && "to" in i && !!i.to;
332
+ const a = Ue(n, r), { isStart: s, isEnd: o, isMiddle: l } = He(n, r), u = w === "range", i = b ? j : N, g = i && "to" in i && !!i.to, h = Be(n, r);
320
333
  return /* @__PURE__ */ Y("div", { className: "relative flex items-center justify-center h-10 w-full group", children: [
321
- u && g && (l || s || o) && /* @__PURE__ */ c("div", { className: f(
334
+ u && g && (l || s || o) && !h && /* @__PURE__ */ c("div", { className: f(
322
335
  "absolute inset-y-0 inset-x-0 bg-accent",
323
336
  s && "rounded-l-full left-1/2 -ml-5",
324
337
  o && "rounded-r-full right-1/2 -mr-5",
@@ -330,12 +343,14 @@ function ot({
330
343
  {
331
344
  variant: "ghost",
332
345
  onClick: () => Ie(n, r),
346
+ disabled: h,
333
347
  className: f(
334
348
  "relative z-10 w-10 h-10 p-0 text-sm font-normal rounded-lg transition-all",
335
- a && !u && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground",
336
- u && (s || o) && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground rounded-lg",
337
- !a && "hover:bg-accent hover:text-accent-foreground border border-transparent hover:border-brand",
338
- l && "text-accent-foreground"
349
+ a && !u && !h && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground",
350
+ u && (s || o) && !h && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground rounded-lg",
351
+ !a && !h && "hover:bg-accent hover:text-accent-foreground border border-transparent hover:border-brand",
352
+ l && !h && "text-accent-foreground",
353
+ h && "text-content-muted opacity-50 cursor-not-allowed"
339
354
  ),
340
355
  children: t
341
356
  }
@@ -355,10 +370,10 @@ function ot({
355
370
  // @ts-ignore: TS mismatch due to dynamic union types.
356
371
  // FIX: Split rendering into separate `DayPicker` calls for 'single' | 'multiple' | 'range' to strictly match discriminated unions.
357
372
  /* @__PURE__ */ c(
358
- Fe,
373
+ Te,
359
374
  {
360
375
  mode: m === "week" ? "multiple" : T,
361
- selected: m === "week" ? G : x ? q : D,
376
+ selected: m === "week" ? G : b ? q : D,
362
377
  onSelect: Ee,
363
378
  month: A,
364
379
  onMonthChange: O,
@@ -370,72 +385,72 @@ function ot({
370
385
  "bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
371
386
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
372
387
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
373
- se
388
+ oe
374
389
  ),
375
390
  captionLayout: Q,
376
391
  startMonth: E,
377
392
  endMonth: L,
378
- disabled: xe.disabled,
393
+ disabled: ee.disabled,
379
394
  numberOfMonths: T === "range" || T === "multiple" || p === "range" || p === "multiple" ? 2 : 1,
380
395
  showWeekNumber: !0,
381
396
  formatters: {
382
397
  formatMonthDropdown: (e) => e.toLocaleString(W, { month: "short" }),
383
- formatWeekNumber: (e) => h("calendar.weekNumber", { number: e }),
398
+ formatWeekNumber: (e) => x("calendar.weekNumber", { number: e }),
384
399
  ...X
385
400
  },
386
401
  classNames: {
387
- root: f("w-fit", b.root),
402
+ root: f("w-fit", v.root),
388
403
  months: f(
389
404
  "relative flex flex-col gap-2 md:flex-row",
390
- b.months
405
+ v.months
391
406
  ),
392
407
  month: f(
393
408
  "flex flex-1 min-w-[252px] flex-col gap-2 relative after:absolute after:top-[5.5rem] after:bottom-0 after:left-[30px] after:w-[1px] after:bg-stroke-hairline",
394
- b.month
409
+ v.month
395
410
  ),
396
411
  nav: f(
397
412
  "absolute inset-x-0 top-[2px] h-[--cell-size] flex w-full items-center justify-between px-2 gap-1",
398
- b.nav
413
+ v.nav
399
414
  ),
400
415
  button_previous: f(
401
416
  "h-7 w-7 select-none p-0 z-10 aria-disabled:opacity-50 flex items-center justify-center relative",
402
- b.button_previous
417
+ v.button_previous
403
418
  ),
404
419
  button_next: f(
405
420
  "h-7 w-7 select-none p-0 z-10 aria-disabled:opacity-50 flex items-center justify-center relative",
406
- b.button_next
421
+ v.button_next
407
422
  ),
408
423
  month_caption: f(
409
424
  "flex h-[--cell-size] w-full items-center justify-center px-[--cell-size] relative ",
410
- b.month_caption
425
+ v.month_caption
411
426
  ),
412
427
  dropdowns: f(
413
428
  "flex h-[--cell-size] gap-1 items-center justify-center text-sm font-medium relative ",
414
- b.dropdowns
429
+ v.dropdowns
415
430
  ),
416
431
  caption_label: f(
417
432
  "select-none font-medium text-sm",
418
- b.caption_label
433
+ v.caption_label
419
434
  ),
420
435
  table: "w-full border-collapse",
421
- weekdays: f("flex w-full relative after:absolute after:bottom-0 after:right-0 after:h-[1px] after:bg-stroke-hairline after:left-[30px]", b.weekdays),
436
+ weekdays: f("flex w-full relative after:absolute after:bottom-0 after:right-0 after:h-[1px] after:bg-stroke-hairline after:left-[30px]", v.weekdays),
422
437
  weekday: f(
423
438
  "flex-1 select-none rounded-md font-normal text-center",
424
439
  "text-[11px] text-content-muted pb-2",
425
440
  "[&:nth-child(2)]:pl-2",
426
- b.weekday
441
+ v.weekday
427
442
  ),
428
- week: f("mt-1 flex w-full items-stretch group/week", b.week),
443
+ week: f("mt-1 flex w-full items-stretch group/week", v.week),
429
444
  week_number_header: f(
430
445
  "select-none font-normal text-center h-[30px] flex items-center justify-center",
431
446
  "text-[11px] text-content-muted w-[30px] flex-shrink-0",
432
- b.week_number_header
447
+ v.week_number_header
433
448
  ),
434
449
  week_number: f(
435
450
  "select-none flex items-center justify-center h-[30px]",
436
451
  "text-[11px] text-content-muted w-[30px] flex-shrink-0 transition-colors",
437
452
  m === "week" && "group-hover/week:bg-accent group-hover/week:rounded-l-lg",
438
- b.week_number
453
+ v.week_number
439
454
  ),
440
455
  day: f(
441
456
  "group/day relative select-none p-0 text-center flex-1 h-[30px] flex items-center justify-center [&:nth-child(2)]:pl-2 rdp-day",
@@ -445,23 +460,23 @@ function ot({
445
460
  ),
446
461
  range_start: f(
447
462
  "bg-accent rounded-l-full",
448
- b.range_start
463
+ v.range_start
449
464
  ),
450
- range_middle: f("bg-accent rounded-none", b.range_middle),
451
- range_end: f("bg-accent rounded-r-full", b.range_end),
465
+ range_middle: f("bg-accent rounded-none", v.range_middle),
466
+ range_end: f("bg-accent rounded-r-full", v.range_end),
452
467
  today: f(
453
468
  "text-brand",
454
- b.today
469
+ v.today
455
470
  ),
456
471
  outside: f(
457
472
  R === "fiscal" || y ? "text-content-muted opacity-50" : "invisible",
458
- b.outside
473
+ v.outside
459
474
  ),
460
475
  disabled: f(
461
476
  "text-content-muted opacity-50",
462
- b.disabled
477
+ v.disabled
463
478
  ),
464
- hidden: f("invisible", b.hidden),
479
+ hidden: f("invisible", v.hidden),
465
480
  ...J
466
481
  },
467
482
  components: {
@@ -487,8 +502,8 @@ function ot({
487
502
  variant: F,
488
503
  size: "icon",
489
504
  className: "h-7 w-7",
490
- "aria-label": h("calendar.previousMonth"),
491
- title: h("calendar.previousMonth"),
505
+ "aria-label": x("calendar.previousMonth"),
506
+ title: x("calendar.previousMonth"),
492
507
  ...e
493
508
  }
494
509
  ),
@@ -498,16 +513,16 @@ function ot({
498
513
  variant: F,
499
514
  size: "icon",
500
515
  className: "h-7 w-7",
501
- "aria-label": h("calendar.nextMonth"),
502
- title: h("calendar.nextMonth"),
516
+ "aria-label": x("calendar.nextMonth"),
517
+ title: x("calendar.nextMonth"),
503
518
  ...e
504
519
  }
505
520
  ),
506
- MonthCaption: ({ displayIndex: e, ...n }) => /* @__PURE__ */ c(fe.Provider, { value: e, children: /* @__PURE__ */ c("div", { ...n }) }),
521
+ MonthCaption: ({ displayIndex: e, ...n }) => /* @__PURE__ */ c(de.Provider, { value: e, children: /* @__PURE__ */ c("div", { ...n }) }),
507
522
  MonthsDropdown: ({ value: e }) => {
508
- const n = d.useContext(fe), t = n > 0, a = new Date(A.getFullYear(), A.getMonth() + n, 1).getFullYear(), s = Pe(a);
523
+ const n = d.useContext(de), t = n > 0, a = new Date(A.getFullYear(), A.getMonth() + n, 1).getFullYear(), s = Pe(a);
509
524
  return /* @__PURE__ */ c(
510
- ue,
525
+ fe,
511
526
  {
512
527
  value: s.find((o) => o.value === e?.toString()),
513
528
  onChange: (o) => {
@@ -528,14 +543,14 @@ function ot({
528
543
  menuWidth: "140px",
529
544
  isSearchable: !0,
530
545
  isClearable: !1,
531
- placeholder: h("calendar.monthPlaceholder")
546
+ placeholder: x("calendar.monthPlaceholder")
532
547
  }
533
548
  );
534
549
  },
535
550
  YearsDropdown: ({ value: e }) => {
536
- const t = d.useContext(fe) > 0, r = De();
551
+ const t = d.useContext(de) > 0, r = De();
537
552
  return /* @__PURE__ */ c(
538
- ue,
553
+ fe,
539
554
  {
540
555
  value: r.find((a) => a.value === e?.toString()),
541
556
  onChange: (a) => {
@@ -556,12 +571,12 @@ function ot({
556
571
  menuWidth: "140px",
557
572
  isSearchable: !0,
558
573
  isClearable: !1,
559
- placeholder: h("calendar.yearPlaceholder")
574
+ placeholder: x("calendar.yearPlaceholder")
560
575
  }
561
576
  );
562
577
  },
563
578
  DayButton: (e) => /* @__PURE__ */ c(
564
- Je,
579
+ Qe,
565
580
  {
566
581
  ...e,
567
582
  pickerType: m
@@ -571,12 +586,12 @@ function ot({
571
586
  const t = e.days.find((I) => !I.outside)?.date;
572
587
  if (!t)
573
588
  return /* @__PURE__ */ c("td", { ...n, className: f("select-none flex items-center justify-center h-8 text-[11px] text-content-muted w-8 flex-shrink-0 rdp-week_number", n.className), children: /* @__PURE__ */ c("div", { className: "flex size-[--cell-size] items-center justify-center text-center" }) });
574
- const r = t.getFullYear(), a = t.getMonth(), l = (new Date(r, a, 1).getDay() + 7 - K) % 7, u = new Date(r, a, 1 - l), i = new Date(t), v = (t.getDay() + 7 - K) % 7;
575
- i.setDate(t.getDate() - v);
576
- const S = Math.round((i.getTime() - u.getTime()) / (10080 * 60 * 1e3)) + 1, z = h("calendar.weekLabel", { number: S });
589
+ const r = t.getFullYear(), a = t.getMonth(), l = (new Date(r, a, 1).getDay() + 7 - K) % 7, u = new Date(r, a, 1 - l), i = new Date(t), h = (t.getDay() + 7 - K) % 7;
590
+ i.setDate(t.getDate() - h);
591
+ const S = Math.round((i.getTime() - u.getTime()) / (10080 * 60 * 1e3)) + 1, z = x("calendar.weekLabel", { number: S });
577
592
  if (m === "week") {
578
593
  const I = () => {
579
- t && ce(ie(t));
594
+ t && ue(ce(t));
580
595
  };
581
596
  return /* @__PURE__ */ c(
582
597
  "td",
@@ -595,7 +610,7 @@ function ot({
595
610
  onKeyDown: (H) => {
596
611
  (H.key === "Enter" || H.key === " ") && (H.preventDefault(), H.stopPropagation(), I());
597
612
  },
598
- children: /* @__PURE__ */ c("div", { className: "flex h-8 w-full items-center justify-center text-center text-[11px] text-content-muted", children: h("calendar.weekNumber", { number: S }) })
613
+ children: /* @__PURE__ */ c("div", { className: "flex h-8 w-full items-center justify-center text-center text-[11px] text-content-muted", children: x("calendar.weekNumber", { number: S }) })
599
614
  }
600
615
  );
601
616
  }
@@ -610,17 +625,17 @@ function ot({
610
625
  ),
611
626
  scope: "row",
612
627
  role: "rowheader",
613
- children: /* @__PURE__ */ c("div", { className: "flex h-8 w-full items-center justify-center text-center", children: h("calendar.weekNumber", { number: S }) })
628
+ children: /* @__PURE__ */ c("div", { className: "flex h-8 w-full items-center justify-center text-center", children: x("calendar.weekNumber", { number: S }) })
614
629
  }
615
630
  );
616
631
  },
617
632
  ...Ce
618
633
  },
619
- ...xe
634
+ ...ee
620
635
  }
621
636
  )
622
637
  ),
623
- x && /* @__PURE__ */ Y("div", { className: f("flex items-center gap-2 border-t pt-3 p-3", m === "month" && w !== "single" || T === "range" || p === "range" || p === "multiple" ? "justify-between" : "justify-end"), children: [
638
+ b && /* @__PURE__ */ Y("div", { className: f("flex items-center gap-2 border-t pt-3 p-3", m === "month" && w !== "single" || T === "range" || p === "range" || p === "multiple" ? "justify-between" : "justify-end"), children: [
624
639
  T === "range" && m === "date" && /* @__PURE__ */ Y("div", { className: "flex flex-row items-center gap-1 text-content-tertiary text-xs leading-[18px] font-medium", children: [
625
640
  "Selected:",
626
641
  /* @__PURE__ */ c("span", { className: "text-content font-semibold", children: (() => {
@@ -640,7 +655,7 @@ function ot({
640
655
  const n = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate()), t = (l) => {
641
656
  const u = Math.floor(l / 7), i = l % 7, g = [];
642
657
  return u > 0 && g.push(`${u} week${u !== 1 ? "s" : ""}`), (i > 0 || u === 0) && g.push(`${i} day${i !== 1 ? "s" : ""}`), g.join(" ");
643
- }, r = R === "fiscal" && oe === "fiscalMonth", a = R === "fiscal", s = r ? "fiscal month" : a ? "fiscal week" : "week", o = r ? "fiscal months" : a ? "fiscal weeks" : "weeks";
658
+ }, r = R === "fiscal" && le === "fiscalMonth", a = R === "fiscal", s = r ? "fiscal month" : a ? "fiscal week" : "week", o = r ? "fiscal months" : a ? "fiscal weeks" : "weeks";
644
659
  if (Array.isArray(e))
645
660
  if (a || r) {
646
661
  const l = e.length;
@@ -656,19 +671,19 @@ function ot({
656
671
  const { from: l, to: u } = e;
657
672
  if (r) {
658
673
  if (!u) return `1 ${s}`;
659
- const i = n(l.startDate), g = n(u.endDate), v = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1, M = te ? te.reduce((z, I) => z + I, 0) / 12 : 4.33, S = Math.max(1, Math.round(v / (M * 7)));
674
+ const i = n(l.startDate), g = n(u.endDate), h = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1, M = ne ? ne.reduce((z, I) => z + I, 0) / 12 : 4.33, S = Math.max(1, Math.round(h / (M * 7)));
660
675
  return `${S} ${S !== 1 ? o : s}`;
661
676
  } else if (a) {
662
677
  if (!u) return `1 ${s}`;
663
- const i = n(l.startDate), g = n(u.endDate), v = Math.round((g - i) / (10080 * 60 * 1e3)), M = v > 0 ? v : 1;
678
+ const i = n(l.startDate), g = n(u.endDate), h = Math.round((g - i) / (10080 * 60 * 1e3)), M = h > 0 ? h : 1;
664
679
  return `${M} ${M !== 1 ? o : s}`;
665
680
  } else {
666
681
  if (!u) {
667
682
  const M = n(l.startDate), S = n(l.endDate), z = Math.round((S - M) / (1e3 * 60 * 60 * 24)) + 1;
668
683
  return t(z);
669
684
  }
670
- const i = n(l.startDate), g = n(u.endDate), v = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1;
671
- return t(v);
685
+ const i = n(l.startDate), g = n(u.endDate), h = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1;
686
+ return t(h);
672
687
  }
673
688
  } else
674
689
  return `1 ${s}`;
@@ -681,14 +696,14 @@ function ot({
681
696
  if (!e) return "0 months";
682
697
  if (Array.isArray(e)) {
683
698
  const n = e.length;
684
- return n === 1 ? h("calendar.monthRange") : h("calendar.monthRangePlural", { count: n });
699
+ return n === 1 ? x("calendar.monthRange") : x("calendar.monthRangePlural", { count: n });
685
700
  } else if ("from" in e) {
686
701
  const n = e;
687
- if (!n.to) return h("calendar.monthRange");
702
+ if (!n.to) return x("calendar.monthRange");
688
703
  const t = new Date(n.from.year, n.from.month, 1), r = new Date(n.to.year, n.to.month, 1), a = (r.getFullYear() - t.getFullYear()) * 12 + (r.getMonth() - t.getMonth()) + 1;
689
- return a === 1 ? h("calendar.monthRange") : h("calendar.monthRangePlural", { count: a });
704
+ return a === 1 ? x("calendar.monthRange") : x("calendar.monthRangePlural", { count: a });
690
705
  } else
691
- return h("calendar.monthRange");
706
+ return x("calendar.monthRange");
692
707
  })() })
693
708
  ] }),
694
709
  /* @__PURE__ */ Y("div", { className: "flex items-center gap-2", children: [
@@ -698,7 +713,7 @@ function ot({
698
713
  variant: "link",
699
714
  size: "sm",
700
715
  onClick: Oe,
701
- children: h("calendar.clear")
716
+ children: x("calendar.clear")
702
717
  }
703
718
  ),
704
719
  /* @__PURE__ */ c(
@@ -707,7 +722,7 @@ function ot({
707
722
  variant: "outline",
708
723
  size: "sm",
709
724
  onClick: $e,
710
- children: h("calendar.cancel")
725
+ children: x("calendar.cancel")
711
726
  }
712
727
  ),
713
728
  /* @__PURE__ */ c(
@@ -716,15 +731,15 @@ function ot({
716
731
  variant: "default",
717
732
  size: "sm",
718
733
  onClick: Le,
719
- children: h("calendar.apply")
734
+ children: x("calendar.apply")
720
735
  }
721
736
  )
722
737
  ] })
723
738
  ] })
724
739
  ] });
725
740
  }
726
- function Je({
727
- className: se,
741
+ function Qe({
742
+ className: oe,
728
743
  day: J,
729
744
  modifiers: y,
730
745
  pickerType: Q,
@@ -754,7 +769,7 @@ function Je({
754
769
  "data-[range-start=true]:bg-brand data-[range-start=true]:text-brand-foreground data-[range-start=true]:rounded-lg data-[range-start=true]:border-transparent",
755
770
  "data-[range-end=true]:bg-brand data-[range-end=true]:text-brand-foreground data-[range-end=true]:rounded-lg data-[range-end=true]:border-transparent",
756
771
  "data-[range-middle=true]:text-accent-foreground data-[range-middle=true]:rounded-none",
757
- se
772
+ oe
758
773
  ),
759
774
  "data-component": "calendar-day",
760
775
  ...F,
@@ -763,6 +778,6 @@ function Je({
763
778
  );
764
779
  }
765
780
  export {
766
- ot as Calendar,
767
- Je as CalendarDayButton
781
+ lt as Calendar,
782
+ Qe as CalendarDayButton
768
783
  };