impact-nova 2.5.18 → 2.5.20

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.
Files changed (30) hide show
  1. package/dist/components/data-display/calendar/calendar-quarter-utils.js +12 -12
  2. package/dist/components/data-display/calendar/calendar-year-utils.js +9 -9
  3. package/dist/components/data-display/calendar/calendar.js +194 -190
  4. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +6 -6
  5. package/dist/components/forms/date-picker/fiscal-pass-through.js +7 -3
  6. package/dist/components/forms/date-picker/multi-quarter-picker.js +87 -87
  7. package/dist/components/forms/date-picker/multi-week-picker.js +1 -1
  8. package/dist/components/forms/date-picker/multi-year-picker.js +81 -81
  9. package/dist/components/forms/date-picker/quarter-range-picker.js +84 -84
  10. package/dist/components/forms/date-picker/week-picker.js +123 -123
  11. package/dist/components/forms/date-picker/week-range-picker.js +188 -188
  12. package/dist/components/forms/date-picker/year-range-picker.js +79 -79
  13. package/dist/form-react/Fields/DateRangeField.js +25 -25
  14. package/dist/form-react/Fields/MonthRangeField.js +57 -57
  15. package/dist/form-react/Fields/MultiMonthPickerField.js +28 -26
  16. package/dist/form-react/Fields/MultiWeekPickerField.js +41 -38
  17. package/dist/form-react/Fields/MultiYearPickerField.js +45 -45
  18. package/dist/form-react/Fields/WeekRangePicker.js +18 -16
  19. package/dist/form-react/Fields/YearPickerField.js +27 -27
  20. package/dist/form-react/Fields/YearRangePickerField.js +29 -29
  21. package/dist/form-react/types/fields.types.d.ts +34 -0
  22. package/dist/form-react/utils/date.utils.d.ts +52 -2
  23. package/dist/form-react/utils/date.utils.js +198 -62
  24. package/dist/lib/fiscal-calendar/index.d.ts +2 -2
  25. package/dist/lib/fiscal-calendar/index.js +26 -24
  26. package/dist/lib/fiscal-calendar/week-selection.d.ts +5 -0
  27. package/dist/lib/fiscal-calendar/week-selection.js +56 -49
  28. package/dist/llms/rules/installation.js +1 -1
  29. package/dist/llms/rules/requirements.js +1 -1
  30. package/package.json +1 -1
@@ -1,74 +1,74 @@
1
1
  import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { Cross as q, CalendarMonth as ee } from "impact-nova-icons";
4
- import { cn as re } from "../../../lib/utils.js";
5
- import { Input as te } from "../input/input.js";
6
- import { Calendar as ne } from "../../data-display/calendar/calendar.js";
3
+ import { Cross as ee, CalendarMonth as re } from "impact-nova-icons";
4
+ import { cn as te } from "../../../lib/utils.js";
5
+ import { Input as ne } from "../input/input.js";
6
+ import { Calendar as oe } from "../../data-display/calendar/calendar.js";
7
7
  import { Tooltip as C, TooltipTrigger as x, TooltipContent as b } from "../../feedback/tooltip/tooltip.js";
8
- import { useImpactNovaI18n as oe } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { buildDateBoundsMatcher as ae } from "../../../lib/date-bounds-matcher.js";
10
- import { fiscalCalendarPassThrough as ie } from "./fiscal-pass-through.js";
11
- import { DatePickerShell as ce } from "./date-picker-shell.js";
12
- import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as le, handleReadonlyPickerKeyDown as fe, handlePickerSurfacePointerDown as pe } from "./date-input-behavior.js";
13
- import { formatQuarterInput as D } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
- import { viewMonthFromQuarter as de } from "../../data-display/calendar/calendar-quarter-utils.js";
15
- const me = t.forwardRef(
8
+ import { useImpactNovaI18n as ae } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { buildDateBoundsMatcher as ie } from "../../../lib/date-bounds-matcher.js";
10
+ import { fiscalCalendarPassThrough as ce } from "./fiscal-pass-through.js";
11
+ import { DatePickerShell as se } from "./date-picker-shell.js";
12
+ import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as fe, handleReadonlyPickerKeyDown as pe, handlePickerSurfacePointerDown as ue } from "./date-input-behavior.js";
13
+ import { formatQuarterInput as Q } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
+ import { viewMonthFromQuarter as de, isQuarterRangeSelection as me } from "../../data-display/calendar/calendar-quarter-utils.js";
15
+ const he = t.forwardRef(
16
16
  ({
17
- value: n,
18
- onChange: d,
19
- placeholder: Q,
17
+ value: y,
18
+ onChange: u,
19
+ placeholder: D,
20
20
  minDate: N,
21
21
  maxDate: S,
22
- startMonth: v,
23
- endMonth: A,
22
+ startMonth: A,
23
+ endMonth: I,
24
24
  showFooter: l = !0,
25
25
  disabled: o,
26
- className: I,
27
- calendarKind: M,
28
- fiscalMode: O,
29
- granularity: T,
30
- fiscalMonthPattern: w,
31
- fiscalYearStartMonth: K,
32
- fiscalConfig: j,
33
- weekStartsOn: F,
34
- showPresets: $,
35
- showPeriodBoundaries: z,
36
- autoNavigateToAvailable: E,
37
- ...H
38
- }, L) => {
39
- const { t: a } = oe(), V = Q ?? a("datePicker.selectQuarterRange"), m = t.useRef(null), y = t.useRef(null);
40
- t.useImperativeHandle(L, () => m.current);
41
- const [i, c] = t.useState(!1), u = t.useRef(!1), k = se(), { footerFlashKey: B, footerFlashTarget: G, popoverHandlers: J } = le(l, i, k, y), [P, f] = t.useState(n), [U, W] = t.useState(de(n?.from));
26
+ className: M,
27
+ calendarKind: O,
28
+ fiscalMode: T,
29
+ granularity: w,
30
+ fiscalMonthPattern: K,
31
+ fiscalYearStartMonth: j,
32
+ fiscalConfig: F,
33
+ weekStartsOn: $,
34
+ showPresets: z,
35
+ showPeriodBoundaries: E,
36
+ autoNavigateToAvailable: H,
37
+ ...L
38
+ }, V) => {
39
+ const { t: a } = ae(), B = D ?? a("datePicker.selectQuarterRange"), d = t.useRef(null), k = t.useRef(null);
40
+ t.useImperativeHandle(V, () => d.current);
41
+ const [i, c] = t.useState(!1), m = t.useRef(!1), P = le(), { footerFlashKey: G, footerFlashTarget: J, popoverHandlers: U } = fe(l, i, P, k), n = me(y) ? y : void 0, [R, f] = t.useState(n), [W, X] = t.useState(de(n?.from));
42
42
  t.useEffect(() => {
43
43
  i || f(n);
44
44
  }, [i, n]);
45
- const p = t.useCallback(() => c(!1), []), X = ie({
46
- calendarKind: M,
47
- fiscalMode: O,
48
- granularity: T,
49
- fiscalMonthPattern: w,
50
- fiscalYearStartMonth: K,
51
- fiscalConfig: j,
52
- weekStartsOn: F,
53
- showPresets: $,
54
- showPeriodBoundaries: z,
55
- autoNavigateToAvailable: E
56
- }), Y = (e) => {
45
+ const p = t.useCallback(() => c(!1), []), Y = ce({
46
+ calendarKind: O,
47
+ fiscalMode: T,
48
+ granularity: w,
49
+ fiscalMonthPattern: K,
50
+ fiscalYearStartMonth: j,
51
+ fiscalConfig: F,
52
+ weekStartsOn: $,
53
+ showPresets: z,
54
+ showPeriodBoundaries: E,
55
+ autoNavigateToAvailable: H
56
+ }), Z = (e) => {
57
57
  const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
58
- f(s), l || (d?.(s), s?.to && p());
59
- }, Z = () => {
60
- d?.(P), p();
58
+ f(s), l || (u?.(s), s?.to && p());
59
+ }, _ = () => {
60
+ u?.(R), p();
61
61
  }, h = () => {
62
62
  f(n), p();
63
- }, R = () => {
64
- f(void 0), d?.(void 0), l || p();
63
+ }, v = () => {
64
+ f(void 0), u?.(void 0), l || p();
65
65
  };
66
66
  t.useLayoutEffect(() => {
67
- k.current = { onDismiss: h, resolveFlash: () => "cancel" };
67
+ P.current = { onDismiss: h, resolveFlash: () => "cancel" };
68
68
  });
69
- const _ = n?.from ? `${D(n.from)}${n.to ? ` – ${D(n.to)}` : ""}` : "";
69
+ const q = n?.from ? `${Q(n.from)}${n.to ? ` – ${Q(n.to)}` : ""}` : "";
70
70
  return /* @__PURE__ */ r(
71
- ce,
71
+ se,
72
72
  {
73
73
  open: i,
74
74
  disabled: o,
@@ -77,41 +77,41 @@ const me = t.forwardRef(
77
77
  o || c(e);
78
78
  },
79
79
  onOpenAutoFocus: (e) => {
80
- u.current || e.preventDefault(), u.current = !1;
80
+ m.current || e.preventDefault(), m.current = !1;
81
81
  },
82
- popoverHandlers: J,
82
+ popoverHandlers: U,
83
83
  trigger: /* @__PURE__ */ r(
84
84
  "div",
85
85
  {
86
- ref: y,
86
+ ref: k,
87
87
  "data-component": "quarter-range-picker",
88
88
  "data-state": i ? "open" : "closed",
89
- onPointerDown: (e) => pe({
89
+ onPointerDown: (e) => ue({
90
90
  disabled: o,
91
91
  event: e,
92
92
  onOpen: () => c(!0),
93
- focusField: () => m.current?.focus()
93
+ focusField: () => d.current?.focus()
94
94
  }),
95
95
  children: /* @__PURE__ */ r(
96
- te,
96
+ ne,
97
97
  {
98
- ref: m,
99
- value: _,
98
+ ref: d,
99
+ value: q,
100
100
  readOnly: !0,
101
- onKeyDown: (e) => fe(e, {
101
+ onKeyDown: (e) => pe(e, {
102
102
  disabled: o,
103
103
  open: i,
104
104
  onOpen: () => c(!0),
105
105
  onCancel: h,
106
106
  onKeyboardOpen: () => {
107
- u.current = !0;
107
+ m.current = !0;
108
108
  }
109
109
  }),
110
110
  onClick: () => !o && c(!0),
111
- placeholder: V,
111
+ placeholder: B,
112
112
  disabled: o,
113
113
  "data-form-control": "input",
114
- className: re("cursor-pointer", I),
114
+ className: te("cursor-pointer", M),
115
115
  suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
116
116
  n?.from && !o ? /* @__PURE__ */ g(C, { children: [
117
117
  /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
@@ -121,10 +121,10 @@ const me = t.forwardRef(
121
121
  tabIndex: 0,
122
122
  "aria-label": a("calendar.clear"),
123
123
  onClick: (e) => {
124
- e.stopPropagation(), R();
124
+ e.stopPropagation(), v();
125
125
  },
126
126
  className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
127
- children: /* @__PURE__ */ r(q, { className: "size-3 hover:text-content" })
127
+ children: /* @__PURE__ */ r(ee, { className: "size-3 hover:text-content" })
128
128
  }
129
129
  ) }),
130
130
  /* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
@@ -141,43 +141,43 @@ const me = t.forwardRef(
141
141
  e.stopPropagation(), o || c((s) => !s);
142
142
  },
143
143
  className: "inline-flex items-center justify-center border-none bg-transparent p-0",
144
- children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
144
+ children: /* @__PURE__ */ r(re, { className: "h-4 w-4 text-secondary-foreground" })
145
145
  }
146
146
  ) }),
147
147
  /* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarterRange") })
148
148
  ] })
149
149
  ] }),
150
- ...H
150
+ ...L
151
151
  }
152
152
  )
153
153
  }
154
154
  ),
155
155
  children: /* @__PURE__ */ r(
156
- ne,
156
+ oe,
157
157
  {
158
158
  pickerType: "quarter",
159
159
  monthMode: "range",
160
- selectedQuarters: P,
161
- footerFlashKey: B,
162
- footerFlashTarget: G,
163
- onQuarterSelect: Y,
164
- month: U,
165
- onMonthChange: W,
166
- disabled: ae(N, S),
167
- startMonth: v,
168
- endMonth: A,
160
+ selectedQuarters: R,
161
+ footerFlashKey: G,
162
+ footerFlashTarget: J,
163
+ onQuarterSelect: Z,
164
+ month: W,
165
+ onMonthChange: X,
166
+ disabled: ie(N, S),
167
+ startMonth: A,
168
+ endMonth: I,
169
169
  showFooter: l,
170
- onApply: Z,
170
+ onApply: _,
171
171
  onCancel: h,
172
- onClear: R,
173
- ...X
172
+ onClear: v,
173
+ ...Y
174
174
  }
175
175
  )
176
176
  }
177
177
  );
178
178
  }
179
179
  );
180
- me.displayName = "QuarterRangePicker";
180
+ he.displayName = "QuarterRangePicker";
181
181
  export {
182
- me as QuarterRangePicker
182
+ he as QuarterRangePicker
183
183
  };
@@ -1,52 +1,52 @@
1
- import { jsxs as W, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as R, jsx as a } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
3
  import { Cross as Te, CalendarMonth as Ee } from "impact-nova-icons";
4
- import { format as B } from "date-fns";
5
- import { cn as Se } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as Ae, usePickerFooterDismissNudge as Ne, isDateInputInvalid as we, resolveSingleValueDismissFlash as Ve, handlePickerEscapeKeyDown as Le, handlePickerSurfacePointerDown as Oe, resolveDateInputOnBlur as Me, maskDateInput as je, parseDateInput as Be, resolveDateInputOnEnter as ze } from "./date-input-behavior.js";
7
- import { Input as He } from "../input/input.js";
8
- import { Popover as Ke, PopoverAnchor as $e, PopoverContent as qe } from "../../feedback/popover/popover.js";
9
- import { Calendar as Ge } from "../../data-display/calendar/calendar.js";
10
- import { Tooltip as _, TooltipTrigger as Y, TooltipContent as F } from "../../feedback/tooltip/tooltip.js";
11
- import { resolveWeekSelection as Je } from "../../../lib/fiscal-calendar/week-selection.js";
12
- import { useImpactNovaI18n as Qe } from "../../../i18n/use-impact-nova-i18n.js";
13
- import { getDateFnsLocale as Ue } from "../../../i18n/getDateFnsLocale.js";
14
- import { coerceSingleWeekApply as Xe, coerceSingleWeek as Ze } from "./calendar-selection-adapters.js";
15
- import { buildDateBoundsMatcher as _e } from "../../../lib/date-bounds-matcher.js";
16
- import { fiscalCalendarPassThrough as Ye } from "./fiscal-pass-through.js";
17
- const ee = (n, c = "MM/dd/yyyy", t) => {
18
- const R = B(n.startDate, c, t ? { locale: t } : {}), b = B(n.endDate, c, t ? { locale: t } : {});
19
- return `${R} - ${b}`;
20
- }, g = (n, c, t) => n ? B(n.startDate, c, t ? { locale: t } : {}) : "", Fe = s.forwardRef(
4
+ import { format as j } from "date-fns";
5
+ import { cn as we } from "../../../lib/utils.js";
6
+ import { usePickerDismissActionsRef as Ae, usePickerFooterDismissNudge as Ne, isDateInputInvalid as Oe, resolveSingleValueDismissFlash as Ve, handlePickerEscapeKeyDown as Le, handlePickerSurfacePointerDown as Me, resolveDateInputOnBlur as je, maskDateInput as Be, parseDateInput as ze, resolveDateInputOnEnter as He } from "./date-input-behavior.js";
7
+ import { Input as Ke } from "../input/input.js";
8
+ import { Popover as $e, PopoverAnchor as qe, PopoverContent as Ge } from "../../feedback/popover/popover.js";
9
+ import { Calendar as Je } from "../../data-display/calendar/calendar.js";
10
+ import { Tooltip as Y, TooltipTrigger as F, TooltipContent as ee } from "../../feedback/tooltip/tooltip.js";
11
+ import { resolveWeekStartsOn as Qe, resolveWeekSelection as Ue } from "../../../lib/fiscal-calendar/week-selection.js";
12
+ import { useImpactNovaI18n as Xe } from "../../../i18n/use-impact-nova-i18n.js";
13
+ import { getDateFnsLocale as Ze } from "../../../i18n/getDateFnsLocale.js";
14
+ import { coerceSingleWeekApply as _e, coerceSingleWeek as Ye } from "./calendar-selection-adapters.js";
15
+ import { buildDateBoundsMatcher as Fe } from "../../../lib/date-bounds-matcher.js";
16
+ import { fiscalCalendarPassThrough as et } from "./fiscal-pass-through.js";
17
+ const te = (n, c = "MM/dd/yyyy", t) => {
18
+ const S = j(n.startDate, c, t ? { locale: t } : {}), b = j(n.endDate, c, t ? { locale: t } : {});
19
+ return `${S} - ${b}`;
20
+ }, g = (n, c, t) => n ? j(n.startDate, c, t ? { locale: t } : {}) : "", tt = s.forwardRef(
21
21
  ({
22
22
  value: n,
23
23
  onChange: c,
24
24
  format: t = "MM/dd/yyyy",
25
- placeholder: R,
25
+ placeholder: S,
26
26
  minDate: b,
27
- maxDate: te,
28
- startMonth: ne,
29
- endMonth: re,
27
+ maxDate: ne,
28
+ startMonth: re,
29
+ endMonth: se,
30
30
  showFooter: l = !0,
31
31
  calendarKind: P,
32
32
  fiscalMode: x = "basic",
33
33
  granularity: T,
34
34
  fiscalMonthPattern: E,
35
- fiscalYearStartMonth: S = 1,
36
- fiscalConfig: A,
37
- weekStartsOn: N = 1,
38
- showPresets: se,
39
- showPeriodBoundaries: oe,
40
- autoNavigateToAvailable: ie,
41
- comparison: ce,
42
- onComparisonChange: ae,
35
+ fiscalYearStartMonth: w = 1,
36
+ fiscalConfig: W,
37
+ weekStartsOn: B,
38
+ showPresets: oe,
39
+ showPeriodBoundaries: ie,
40
+ autoNavigateToAvailable: ce,
41
+ comparison: ae,
42
+ onComparisonChange: le,
43
43
  disabled: p,
44
- className: le,
45
- ...pe
46
- }, ue) => {
47
- const { locale: z, t: D } = Qe(), i = s.useMemo(() => Ue(z), [z]), fe = R ?? D("datePicker.selectWeek"), v = P === "fiscal", w = s.useRef(null), H = s.useRef(null), I = s.useRef(!1);
48
- s.useImperativeHandle(ue, () => w.current);
49
- const [o, K] = s.useState(!1), $ = Ae(), { footerFlashKey: de, footerFlashTarget: me, popoverHandlers: ke } = Ne(l, o, $, H), [De, V] = s.useState(!1), [u, f] = s.useState(n), [y, m] = s.useState(""), [ye, h] = s.useState(n?.startDate || /* @__PURE__ */ new Date()), he = n ? ee(n, t, i) : "", q = u ? ee(u, t, i) : "", L = o || De, ge = L ? y : q, G = s.useCallback(() => {
44
+ className: pe,
45
+ ...ue
46
+ }, fe) => {
47
+ const { locale: z, t: D } = Xe(), i = s.useMemo(() => Ze(z), [z]), de = S ?? D("datePicker.selectWeek"), v = P === "fiscal", H = Qe({ weekStartsOn: B, fiscalConfig: W }), A = s.useRef(null), K = s.useRef(null), I = s.useRef(!1);
48
+ s.useImperativeHandle(fe, () => A.current);
49
+ const [o, $] = s.useState(!1), q = Ae(), { footerFlashKey: me, footerFlashTarget: ke, popoverHandlers: De } = Ne(l, o, q, K), [ye, N] = s.useState(!1), [u, f] = s.useState(n), [y, m] = s.useState(""), [he, h] = s.useState(n?.startDate || /* @__PURE__ */ new Date()), ge = n ? te(n, t, i) : "", G = u ? te(u, t, i) : "", O = o || ye, ve = O ? y : G, J = s.useCallback(() => {
50
50
  f(n), m(g(n, t, i)), v || h(n?.startDate || /* @__PURE__ */ new Date());
51
51
  }, [n, t, i, v]), C = s.useCallback(() => {
52
52
  m(g(u ?? n, t, i)), v || h((u ?? n)?.startDate || /* @__PURE__ */ new Date());
@@ -54,93 +54,93 @@ const ee = (n, c = "MM/dd/yyyy", t) => {
54
54
  s.useEffect(() => {
55
55
  o || f(n);
56
56
  }, [o, n]);
57
- const J = s.useRef(!1);
57
+ const Q = s.useRef(!1);
58
58
  s.useEffect(() => {
59
- o && !J.current && C(), J.current = o;
59
+ o && !Q.current && C(), Q.current = o;
60
60
  }, [o, C]);
61
61
  const d = () => {
62
- V(!1), K(!1);
62
+ N(!1), $(!1);
63
63
  }, k = (e) => {
64
64
  if (!p) {
65
65
  if (e) {
66
- C(), K(!0);
66
+ C(), $(!0);
67
67
  return;
68
68
  }
69
69
  l || d();
70
70
  }
71
- }, O = s.useCallback(
72
- (e) => Je(e, {
71
+ }, V = s.useCallback(
72
+ (e) => Ue(e, {
73
73
  calendarKind: P,
74
74
  fiscalMode: x,
75
75
  granularity: T,
76
76
  fiscalMonthPattern: E,
77
- fiscalYearStartMonth: S,
78
- weekStartsOn: N,
79
- fiscalConfig: A
77
+ fiscalYearStartMonth: w,
78
+ weekStartsOn: H,
79
+ fiscalConfig: W
80
80
  }),
81
81
  [
82
82
  P,
83
83
  x,
84
84
  T,
85
85
  E,
86
- S,
87
- N,
88
- A
86
+ w,
87
+ H,
88
+ W
89
89
  ]
90
- ), ve = (e) => {
91
- const r = Ze(e);
90
+ ), Ie = (e) => {
91
+ const r = Ye(e);
92
92
  f(r), r && (m(g(r, t, i)), v || h(r.startDate)), l || (c?.(r), d());
93
- }, Q = (e) => {
94
- const r = Xe(e, u);
93
+ }, U = (e) => {
94
+ const r = _e(e, u);
95
95
  c?.(r), d();
96
- }, M = () => {
97
- G(), d();
98
- }, U = () => {
96
+ }, L = () => {
97
+ J(), d();
98
+ }, X = () => {
99
99
  f(void 0), m(""), c?.(void 0), l || d();
100
- }, Ie = (e) => {
101
- const r = O(e);
102
- f(r), m(g(r, t, i)), h(e), c?.(r), d();
103
100
  }, Pe = (e) => {
104
- const r = je(e.target.value, t, y);
101
+ const r = V(e);
102
+ f(r), m(g(r, t, i)), h(e), c?.(r), d();
103
+ }, We = (e) => {
104
+ const r = Be(e.target.value, t, y);
105
105
  if (m(r), r === "") {
106
106
  f(void 0), l || c?.(void 0);
107
107
  return;
108
108
  }
109
- const { parsed: j, isValid: xe } = Be(r, t, i);
110
- if (xe && j) {
111
- const Z = O(j);
112
- f(Z), h(j), l || c?.(Z);
109
+ const { parsed: M, isValid: xe } = ze(r, t, i);
110
+ if (xe && M) {
111
+ const _ = V(M);
112
+ f(_), h(M), l || c?.(_);
113
113
  }
114
114
  }, Ce = () => {
115
- if (V(!1), o) return;
116
- const e = Me(
115
+ if (N(!1), o) return;
116
+ const e = je(
117
117
  y,
118
118
  t,
119
119
  g(u ?? n, t, i),
120
120
  i
121
121
  );
122
122
  if (e.resetToCommitted) {
123
- G();
123
+ J();
124
124
  return;
125
125
  }
126
126
  if (e.parsed) {
127
- const r = O(e.parsed);
127
+ const r = V(e.parsed);
128
128
  f(r), m(g(r, t, i)), l || c?.(r);
129
129
  return;
130
130
  }
131
131
  y || (f(void 0), l || c?.(void 0));
132
- }, We = () => {
132
+ }, Re = () => {
133
133
  if (o && l) {
134
- Q();
134
+ U();
135
135
  return;
136
136
  }
137
- const e = ze(y, t, i);
137
+ const e = He(y, t, i);
138
138
  if (e.parsed) {
139
- l && Ie(e.parsed);
139
+ l && Pe(e.parsed);
140
140
  return;
141
141
  }
142
142
  o || (I.current = !0, k(!0));
143
- }, X = he !== q, Re = L && we(y, t, i), be = s.useCallback(
143
+ }, Z = ge !== G, Se = O && Oe(y, t, i), be = s.useCallback(
144
144
  () => Ve(
145
145
  u,
146
146
  n,
@@ -149,65 +149,65 @@ const ee = (n, c = "MM/dd/yyyy", t) => {
149
149
  [u, n]
150
150
  );
151
151
  return s.useLayoutEffect(() => {
152
- $.current = {
153
- onDismiss: M,
152
+ q.current = {
153
+ onDismiss: L,
154
154
  resolveFlash: be
155
155
  };
156
- }), /* @__PURE__ */ W(Ke, { open: p ? !1 : o, onOpenChange: k, children: [
157
- /* @__PURE__ */ a($e, { asChild: !0, children: /* @__PURE__ */ a(
156
+ }), /* @__PURE__ */ R($e, { open: p ? !1 : o, onOpenChange: k, children: [
157
+ /* @__PURE__ */ a(qe, { asChild: !0, children: /* @__PURE__ */ a(
158
158
  "div",
159
159
  {
160
- ref: H,
160
+ ref: K,
161
161
  "data-component": "week-picker",
162
162
  "data-state": o ? "open" : "closed",
163
- "data-pending": X || void 0,
164
- onPointerDown: (e) => Oe({
163
+ "data-pending": Z || void 0,
164
+ onPointerDown: (e) => Me({
165
165
  disabled: p,
166
166
  event: e,
167
167
  onOpen: () => k(!0),
168
- focusField: () => w.current?.focus()
168
+ focusField: () => A.current?.focus()
169
169
  }),
170
170
  children: /* @__PURE__ */ a(
171
- He,
171
+ Ke,
172
172
  {
173
- ref: w,
174
- value: ge,
175
- onChange: Pe,
173
+ ref: A,
174
+ value: ve,
175
+ onChange: We,
176
176
  onFocus: () => {
177
- p || (V(!0), C());
177
+ p || (N(!0), C());
178
178
  },
179
179
  onBlur: Ce,
180
180
  onClick: () => !p && k(!0),
181
181
  onKeyDown: (e) => {
182
- e.key === "Enter" && !p && (e.preventDefault(), We()), e.key === "ArrowDown" && !o && !p && (e.preventDefault(), I.current = !0, k(!0)), e.key === "Escape" && o && Le(e, { open: o, onCancel: M });
182
+ e.key === "Enter" && !p && (e.preventDefault(), Re()), e.key === "ArrowDown" && !o && !p && (e.preventDefault(), I.current = !0, k(!0)), e.key === "Escape" && o && Le(e, { open: o, onCancel: L });
183
183
  },
184
- placeholder: L ? t : fe,
184
+ placeholder: O ? t : de,
185
185
  disabled: p,
186
186
  "data-form-control": "input",
187
- className: Se(
187
+ className: we(
188
188
  "cursor-pointer",
189
- Re ? "text-destructive" : X ? "text-content-placeholder" : "",
190
- le
189
+ Se ? "text-destructive" : Z ? "text-content-placeholder" : "",
190
+ pe
191
191
  ),
192
- suffix: /* @__PURE__ */ W("div", { className: "flex items-center gap-1", children: [
193
- n && !p && /* @__PURE__ */ W(_, { children: [
194
- /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ a(
192
+ suffix: /* @__PURE__ */ R("div", { className: "flex items-center gap-1", children: [
193
+ n && !p && /* @__PURE__ */ R(Y, { children: [
194
+ /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a(
195
195
  "button",
196
196
  {
197
197
  type: "button",
198
198
  tabIndex: 0,
199
199
  "aria-label": D("calendar.clear"),
200
200
  onClick: (e) => {
201
- e.stopPropagation(), U();
201
+ e.stopPropagation(), X();
202
202
  },
203
203
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
204
204
  children: /* @__PURE__ */ a(Te, { className: "size-3 hover:text-content" })
205
205
  }
206
206
  ) }),
207
- /* @__PURE__ */ a(F, { variant: "tertiary", side: "top", children: D("calendar.clear") })
207
+ /* @__PURE__ */ a(ee, { variant: "tertiary", side: "top", children: D("calendar.clear") })
208
208
  ] }),
209
- /* @__PURE__ */ W(_, { children: [
210
- /* @__PURE__ */ a(Y, { asChild: !0, children: /* @__PURE__ */ a(
209
+ /* @__PURE__ */ R(Y, { children: [
210
+ /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a(
211
211
  "button",
212
212
  {
213
213
  type: "button",
@@ -223,16 +223,16 @@ const ee = (n, c = "MM/dd/yyyy", t) => {
223
223
  children: /* @__PURE__ */ a(Ee, { className: "h-4 w-4 text-secondary-foreground" })
224
224
  }
225
225
  ) }),
226
- /* @__PURE__ */ a(F, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
226
+ /* @__PURE__ */ a(ee, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
227
227
  ] })
228
228
  ] }),
229
- ...pe
229
+ ...ue
230
230
  }
231
231
  )
232
232
  }
233
233
  ) }),
234
234
  /* @__PURE__ */ a(
235
- qe,
235
+ Ge,
236
236
  {
237
237
  className: "w-auto p-0",
238
238
  align: "start",
@@ -240,39 +240,39 @@ const ee = (n, c = "MM/dd/yyyy", t) => {
240
240
  onOpenAutoFocus: (e) => {
241
241
  I.current || e.preventDefault(), I.current = !1;
242
242
  },
243
- ...ke,
243
+ ...De,
244
244
  children: /* @__PURE__ */ a(
245
- Ge,
245
+ Je,
246
246
  {
247
247
  pickerType: "week",
248
248
  weekMode: "single",
249
249
  selectedWeeks: u,
250
- footerFlashKey: de,
251
- footerFlashTarget: me,
252
- onWeekSelect: ve,
253
- month: ye,
250
+ footerFlashKey: me,
251
+ footerFlashTarget: ke,
252
+ onWeekSelect: Ie,
253
+ month: he,
254
254
  onMonthChange: h,
255
- disabled: _e(b, te),
256
- startMonth: ne,
257
- endMonth: re,
255
+ disabled: Fe(b, ne),
256
+ startMonth: re,
257
+ endMonth: se,
258
258
  showFooter: l,
259
- ...Ye({
259
+ ...et({
260
260
  calendarKind: P,
261
261
  fiscalMode: x,
262
262
  granularity: T,
263
263
  fiscalMonthPattern: E,
264
- fiscalYearStartMonth: S,
265
- fiscalConfig: A,
266
- weekStartsOn: N,
267
- showPresets: se,
268
- showPeriodBoundaries: oe,
269
- autoNavigateToAvailable: ie,
270
- comparison: ce,
271
- onComparisonChange: ae
264
+ fiscalYearStartMonth: w,
265
+ fiscalConfig: W,
266
+ weekStartsOn: B,
267
+ showPresets: oe,
268
+ showPeriodBoundaries: ie,
269
+ autoNavigateToAvailable: ce,
270
+ comparison: ae,
271
+ onComparisonChange: le
272
272
  }),
273
- onApply: Q,
274
- onCancel: M,
275
- onClear: U,
273
+ onApply: U,
274
+ onCancel: L,
275
+ onClear: X,
276
276
  captionLayout: "dropdown"
277
277
  }
278
278
  )
@@ -281,7 +281,7 @@ const ee = (n, c = "MM/dd/yyyy", t) => {
281
281
  ] });
282
282
  }
283
283
  );
284
- Fe.displayName = "WeekPicker";
284
+ tt.displayName = "WeekPicker";
285
285
  export {
286
- Fe as WeekPicker
286
+ tt as WeekPicker
287
287
  };