impact-nova 2.5.10 → 2.5.12

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