impact-nova 2.5.9 → 2.5.11

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