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,203 +1,208 @@
1
- import { jsx as u, jsxs as T } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { Cross as Xe, CalendarMonth as Ze } from "impact-nova-icons";
1
+ import { jsx as u, jsxs as W } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { Cross as et, CalendarMonth as tt } from "impact-nova-icons";
4
4
  import { format as g } from "date-fns";
5
5
  import { cn as Q } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as _e, usePickerFooterDismissNudge as $e, createRangePickerOpenChangeHandler as Ye, parseDateInput as U, normalizeOrderedRange as Fe, compareDates as et, flashRangeReorder as tt, isDateInputInvalid as ie, resolveRangeFieldBlur as L, resolveRangePickerDismissFlash as rt, handlePickerSurfacePointerDown as ot, deferRangeInputBlur as nt, maskDateInput as le, resolveDateInputOnBlur as j } from "./date-input-behavior.js";
7
- import { useFieldChrome as st } from "../../../lib/primitives/use-field-chrome.js";
8
- import { Popover as it, PopoverAnchor as lt, PopoverContent as ct } from "../../feedback/popover/popover.js";
9
- import { Calendar as at } from "../../data-display/calendar/calendar.js";
10
- import { buildDateBoundsMatcher as ft } from "../../../lib/date-bounds-matcher.js";
11
- import { Tooltip as ce, TooltipTrigger as ae, TooltipContent as fe } from "../../feedback/tooltip/tooltip.js";
12
- import { resolveWeekSelection as dt } from "../../../lib/fiscal-calendar/week-selection.js";
13
- import { useImpactNovaI18n as pt } from "../../../i18n/use-impact-nova-i18n.js";
14
- import { getDateFnsLocale as mt } from "../../../i18n/getDateFnsLocale.js";
15
- import { coerceWeekRangeApply as ut, isWeekRangeSelection as gt } from "./calendar-selection-adapters.js";
16
- import { fiscalCalendarPassThrough as kt } from "./fiscal-pass-through.js";
6
+ import { usePickerDismissActionsRef as rt, usePickerFooterDismissNudge as ot, createRangePickerOpenChangeHandler as nt, parseDateInput as U, normalizeOrderedRange as st, compareDates as it, flashRangeReorder as ct, isDateInputInvalid as ce, resolveRangeFieldBlur as L, resolveRangePickerDismissFlash as lt, handlePickerEscapeKeyDown as le, handlePickerSurfacePointerDown as at, deferRangeInputBlur as ft, maskDateInput as ae, resolveDateInputOnBlur as j } from "./date-input-behavior.js";
7
+ import { useFieldChrome as dt } from "../../../lib/primitives/use-field-chrome.js";
8
+ import { Popover as pt, PopoverAnchor as mt, PopoverContent as ut } from "../../feedback/popover/popover.js";
9
+ import { Calendar as gt } from "../../data-display/calendar/calendar.js";
10
+ import { buildDateBoundsMatcher as kt } from "../../../lib/date-bounds-matcher.js";
11
+ import { Tooltip as fe, TooltipTrigger as de, TooltipContent as pe } from "../../feedback/tooltip/tooltip.js";
12
+ import { resolveWeekSelection as Rt } from "../../../lib/fiscal-calendar/week-selection.js";
13
+ import { useImpactNovaI18n as ht } from "../../../i18n/use-impact-nova-i18n.js";
14
+ import { getDateFnsLocale as Dt } from "../../../i18n/getDateFnsLocale.js";
15
+ import { coerceWeekRangeApply as yt, isWeekRangeSelection as vt } from "./calendar-selection-adapters.js";
16
+ import { fiscalCalendarPassThrough as xt } from "./fiscal-pass-through.js";
17
17
  const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, S = (t) => t?.from ? { from: t.from, to: t.to } : void 0;
18
- function de(t, c) {
19
- return !t && !c ? !0 : !t || !c ? !1 : t.startDate.getTime() === c.startDate.getTime();
18
+ function me(t, l) {
19
+ return !t && !l ? !0 : !t || !l ? !1 : t.startDate.getTime() === l.startDate.getTime();
20
20
  }
21
- function Rt(t, c) {
22
- return !t && !c ? !0 : !t || !c ? !1 : de(t.from, c.from) && de(t.to, c.to);
21
+ function Ct(t, l) {
22
+ return !t && !l ? !0 : !t || !l ? !1 : me(t.from, l.from) && me(t.to, l.to);
23
23
  }
24
- const ht = l.forwardRef(
24
+ const bt = c.forwardRef(
25
25
  ({
26
26
  value: t,
27
- onChange: c,
27
+ onChange: l,
28
28
  format: n = "MM/dd/yyyy",
29
- placeholder: pe,
30
- minDate: me,
31
- maxDate: ue,
32
- startMonth: ge,
33
- endMonth: ke,
29
+ placeholder: ue,
30
+ minDate: ge,
31
+ maxDate: ke,
32
+ startMonth: Re,
33
+ endMonth: he,
34
34
  showFooter: k = !0,
35
35
  calendarKind: N,
36
36
  fiscalMode: q = "basic",
37
37
  granularity: z,
38
38
  fiscalMonthPattern: H,
39
- fiscalYearStartMonth: M = 1,
40
- fiscalConfig: Re,
41
- weekStartsOn: K = 1,
42
- showPresets: he,
43
- comparison: De,
44
- onComparisonChange: ye,
39
+ fiscalYearStartMonth: K = 1,
40
+ fiscalConfig: De,
41
+ weekStartsOn: M = 1,
42
+ showPresets: ye,
43
+ showPeriodBoundaries: ve,
44
+ autoNavigateToAvailable: xe,
45
+ comparison: Ce,
46
+ onComparisonChange: be,
45
47
  disabled: d,
46
- className: ve,
47
- error: xe,
48
- isError: Ce,
48
+ className: we,
49
+ error: Ie,
50
+ isError: Te,
49
51
  size: X,
50
- label: be,
51
- helperText: Ie,
52
- helperTextPosition: we = "absolute",
53
- required: Pe,
54
- prefix: Dt,
55
- prefixClick: yt,
56
- ...Ee
57
- }, We) => {
58
- const Z = xe ?? Ce, Te = st({
59
- label: be,
60
- helperText: Ie,
61
- helperTextPosition: we,
52
+ label: Ee,
53
+ helperText: Pe,
54
+ helperTextPosition: We = "absolute",
55
+ required: Se,
56
+ prefix: wt,
57
+ prefixClick: It,
58
+ ...Be
59
+ }, Ne) => {
60
+ const Z = Ie ?? Te, Ve = dt({
61
+ label: Ee,
62
+ helperText: Pe,
63
+ helperTextPosition: We,
62
64
  error: Z,
63
- required: Pe,
65
+ required: Se,
64
66
  disabled: d ?? void 0,
65
67
  rootClassName: "w-full min-w-[240px]"
66
- }), { locale: _, t: P } = pt(), s = l.useMemo(() => mt(_), [_]), $ = pe ?? P("datePicker.selectWeekRange"), A = N === "fiscal", G = l.useRef(null), Y = l.useRef(null), F = l.useRef(null), V = l.useRef(null), J = l.useRef(null);
67
- l.useImperativeHandle(We, () => G.current);
68
- const [p, R] = l.useState(!1), ee = _e(), { footerFlashKey: Se, footerFlashTarget: Be, popoverHandlers: Ne } = $e(k, p, ee, F), E = l.useRef(!1), [a, h] = l.useState(t), [m, D] = l.useState(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), [y, v] = l.useState(x(t) ? g(x(t), n, { locale: s }) : ""), [Ae, W] = l.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
69
- l.useEffect(() => {
70
- D(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? g(x(t), n, { locale: s }) : ""), h(t);
71
- }, [t, n, s]);
72
- const Ve = l.useCallback(
73
- (e) => Ye({
68
+ }), { locale: _, t: T } = ht(), s = c.useMemo(() => Dt(_), [_]), $ = ue ?? T("datePicker.selectWeekRange"), V = N === "fiscal", G = c.useRef(null), Y = c.useRef(null), F = c.useRef(null), A = c.useRef(null), J = c.useRef(null);
69
+ c.useImperativeHandle(Ne, () => G.current);
70
+ const [p, R] = c.useState(!1), ee = rt(), { footerFlashKey: Ae, footerFlashTarget: Oe, popoverHandlers: Le } = ot(k, p, ee, F), E = c.useRef(!1), [a, h] = c.useState(t), [m, D] = c.useState(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), [y, v] = c.useState(x(t) ? g(x(t), n, { locale: s }) : ""), [je, P] = c.useState(t?.from?.startDate || /* @__PURE__ */ new Date()), qe = t?.from?.startDate.getTime(), ze = x(t)?.getTime(), te = c.useRef(t);
71
+ c.useEffect(() => {
72
+ te.current = t;
73
+ }), c.useEffect(() => {
74
+ const e = te.current;
75
+ D(e?.from ? g(e.from.startDate, n, { locale: s }) : ""), v(x(e) ? g(x(e), n, { locale: s }) : ""), h(e);
76
+ }, [qe, ze, n, s]);
77
+ const He = c.useCallback(
78
+ (e) => nt({
74
79
  disabled: d ?? void 0,
75
80
  showFooter: k,
76
- containerRef: V,
81
+ containerRef: A,
77
82
  popoverContentRef: J,
78
83
  setOpen: R
79
84
  })(e),
80
85
  [d, k]
81
- ), te = l.useRef(!1);
82
- l.useEffect(() => {
83
- if (p && !te.current && !A) {
86
+ ), re = c.useRef(!1);
87
+ c.useEffect(() => {
88
+ if (p && !re.current && !V) {
84
89
  const e = U(m, n, s);
85
- e.parsed ? W(e.parsed) : a?.from ? W(a.from.startDate) : t?.from && W(t.from.startDate);
90
+ e.parsed ? P(e.parsed) : a?.from ? P(a.from.startDate) : t?.from && P(t.from.startDate);
86
91
  }
87
- te.current = p;
88
- }, [p, m, n, s, a?.from, t?.from, A]);
89
- const Oe = (e) => {
90
- const r = gt(e) ? e : void 0;
91
- h(r), r?.from ? (D(g(r.from.startDate, n, { locale: s })), v(g(x(r), n, { locale: s }))) : (D(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (c?.(r), R(!1));
92
- }, C = l.useCallback(
93
- (e) => dt(e, {
92
+ re.current = p;
93
+ }, [p, m, n, s, a?.from, t?.from, V]);
94
+ const Ke = (e) => {
95
+ const r = vt(e) ? e : void 0;
96
+ h(r), r?.from ? (D(g(r.from.startDate, n, { locale: s })), v(g(x(r), n, { locale: s }))) : (D(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (l?.(r), R(!1));
97
+ }, C = c.useCallback(
98
+ (e) => Rt(e, {
94
99
  calendarKind: N,
95
100
  fiscalMode: q,
96
101
  granularity: z,
97
102
  fiscalMonthPattern: H,
98
- fiscalYearStartMonth: M,
99
- weekStartsOn: K
103
+ fiscalYearStartMonth: K,
104
+ weekStartsOn: M
100
105
  }),
101
106
  [
102
107
  N,
103
108
  q,
104
109
  z,
105
110
  H,
106
- M,
107
- K
111
+ K,
112
+ M
108
113
  ]
109
- ), B = l.useCallback((e, r) => {
110
- const o = Fe(
114
+ ), B = c.useCallback((e, r) => {
115
+ const o = st(
111
116
  e,
112
117
  r,
113
- (i, f) => et(i.startDate, f.startDate)
118
+ (i, f) => it(i.startDate, f.startDate)
114
119
  );
115
- return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })), tt(V.current)), { from: o.from, to: o.to };
116
- }, [n, s]), re = (e) => {
117
- const r = ut(e, S(a)), o = B(r?.from, r?.to), i = o.from ? { from: o.from, to: o.to } : void 0;
118
- h(i), c?.(i), R(!1);
120
+ return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })), ct(A.current)), { from: o.from, to: o.to };
121
+ }, [n, s]), oe = (e) => {
122
+ const r = yt(e, S(a)), o = B(r?.from, r?.to), i = o.from ? { from: o.from, to: o.to } : void 0;
123
+ h(i), l?.(i), R(!1);
119
124
  }, O = () => {
120
125
  h(t), D(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? g(x(t), n, { locale: s }) : ""), R(!1);
121
- }, oe = () => {
122
- h(void 0), D(""), v(""), c?.(void 0), k || R(!1);
123
- }, Le = (e) => {
124
- const r = le(e.target.value, n, m);
126
+ }, ne = () => {
127
+ h(void 0), D(""), v(""), l?.(void 0), k || R(!1);
128
+ }, Me = (e) => {
129
+ const r = ae(e.target.value, n, m);
125
130
  if (D(r), r === "") {
126
131
  const f = { to: a?.to };
127
- h(f), k || c?.(void 0);
132
+ h(f), k || l?.(void 0);
128
133
  return;
129
134
  }
130
135
  const { parsed: o, isValid: i } = U(r, n, s);
131
136
  if (i && o) {
132
- const w = { from: C(o), to: a?.to };
133
- h(w), a?.to && v(g(x(w), n, { locale: s })), A || W(o), k || c?.(S(w));
137
+ const I = { from: C(o), to: a?.to };
138
+ h(I), a?.to && v(g(x(I), n, { locale: s })), V || P(o), k || l?.(S(I));
134
139
  }
135
- }, je = (e) => {
136
- const r = le(e.target.value, n, y);
140
+ }, Ge = (e) => {
141
+ const r = ae(e.target.value, n, y);
137
142
  if (v(r), r === "") {
138
143
  const f = { from: a?.from };
139
- h(f), k || c?.(S(f));
144
+ h(f), k || l?.(S(f));
140
145
  return;
141
146
  }
142
147
  const { parsed: o, isValid: i } = U(r, n, s);
143
148
  if (i && o) {
144
- const f = C(o), w = { from: a?.from, to: f };
145
- h(w), a?.from && D(g(a.from.startDate, n, { locale: s })), A || W(o), k || c?.(S(w));
149
+ const f = C(o), I = { from: a?.from, to: f };
150
+ h(I), a?.from && D(g(a.from.startDate, n, { locale: s })), V || P(o), k || l?.(S(I));
146
151
  }
147
- }, qe = () => {
148
- const e = j(m, n, b, s), r = j(y, n, I, s);
149
- e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
152
+ }, Je = () => {
153
+ const e = j(m, n, b, s), r = j(y, n, w, s);
154
+ e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(w) : r.parsed && v(r.display);
150
155
  let o = e.parsed ? C(e.parsed) : a?.from, i = r.parsed ? C(r.parsed) : a?.to;
151
156
  o && i && ({ from: o, to: i } = B(o, i));
152
157
  const f = o ? { from: o, to: i } : void 0;
153
- f ? (h(f), c?.(f)) : !m && !y && (h(void 0), c?.(void 0));
154
- }, ne = () => {
155
- nt(
156
- V,
158
+ f ? (h(f), l?.(f)) : !m && !y && (h(void 0), l?.(void 0));
159
+ }, se = () => {
160
+ ft(
161
+ A,
157
162
  J,
158
163
  () => {
159
- const e = L(m, n, b, s), r = L(y, n, I, s);
160
- e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
164
+ const e = L(m, n, b, s), r = L(y, n, w, s);
165
+ e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(w) : r.parsed && v(r.display);
161
166
  let o = e.parsed ? C(e.parsed) : e.resetToCommitted ? t?.from : a?.from, i = r.parsed ? C(r.parsed) : r.resetToCommitted ? t?.to : a?.to;
162
167
  o && i && ({ from: o, to: i } = B(o, i));
163
168
  const f = o || i ? { from: o, to: i } : void 0;
164
- h(f), k || (f ? c?.(f) : !m && !y && c?.(void 0));
169
+ h(f), k || (f ? l?.(f) : !m && !y && l?.(void 0));
165
170
  }
166
171
  );
167
- }, se = () => {
172
+ }, ie = () => {
168
173
  if (p && k) {
169
- re();
174
+ oe();
170
175
  return;
171
176
  }
172
177
  if (!p) {
173
178
  if (k) {
174
- qe();
179
+ Je();
175
180
  return;
176
181
  }
177
- const e = j(m, n, b, s), r = j(y, n, I, s);
182
+ const e = j(m, n, b, s), r = j(y, n, w, s);
178
183
  if (e.parsed || r.parsed) return;
179
184
  E.current = !0, R(!0);
180
185
  }
181
- }, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "", I = x(t) ? g(x(t), n, { locale: s }) : "", ze = b !== m, He = I !== y, Me = ie(m, n, s), Ke = ie(y, n, s), Ge = "Start Date", Je = "End Date", Qe = l.useCallback(() => {
182
- const e = L(m, n, b, s), r = L(y, n, I, s);
186
+ }, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "", w = x(t) ? g(x(t), n, { locale: s }) : "", Qe = b !== m, Ue = w !== y, Xe = ce(m, n, s), Ze = ce(y, n, s), _e = "Start Date", $e = "End Date", Ye = c.useCallback(() => {
187
+ const e = L(m, n, b, s), r = L(y, n, w, s);
183
188
  let o = e.parsed ? C(e.parsed) : e.resetToCommitted ? t?.from : a?.from, i = r.parsed ? C(r.parsed) : r.resetToCommitted ? t?.to : a?.to;
184
189
  o && i && ({ from: o, to: i } = B(o, i));
185
190
  const f = o || i ? { from: o, to: i } : void 0;
186
- return rt({
191
+ return lt({
187
192
  startInput: m,
188
193
  endInput: y,
189
194
  committedStart: b,
190
- committedEnd: I,
195
+ committedEnd: w,
191
196
  committedRange: t,
192
197
  pendingRange: S(a),
193
198
  computeEffectiveRange: () => f,
194
- rangesEqual: (w, Ue) => Rt(w, Ue)
199
+ rangesEqual: (I, Fe) => Ct(I, Fe)
195
200
  });
196
201
  }, [
197
202
  m,
198
203
  y,
199
204
  b,
200
- I,
205
+ w,
201
206
  t,
202
207
  a,
203
208
  n,
@@ -205,10 +210,10 @@ const ht = l.forwardRef(
205
210
  B,
206
211
  C
207
212
  ]);
208
- return l.useLayoutEffect(() => {
213
+ return c.useLayoutEffect(() => {
209
214
  ee.current = {
210
215
  onDismiss: O,
211
- resolveFlash: Qe
216
+ resolveFlash: Ye
212
217
  };
213
218
  }), /* @__PURE__ */ u(
214
219
  "div",
@@ -216,14 +221,14 @@ const ht = l.forwardRef(
216
221
  ref: F,
217
222
  "data-component": "week-range-picker",
218
223
  "data-disabled": d || void 0,
219
- children: Te.wrapControl(
220
- /* @__PURE__ */ T(it, { open: d ? !1 : p, onOpenChange: Ve, children: [
221
- /* @__PURE__ */ u(lt, { asChild: !0, children: /* @__PURE__ */ T(
224
+ children: Ve.wrapControl(
225
+ /* @__PURE__ */ W(pt, { open: d ? !1 : p, onOpenChange: He, children: [
226
+ /* @__PURE__ */ u(mt, { asChild: !0, children: /* @__PURE__ */ W(
222
227
  "div",
223
228
  {
224
- ref: V,
229
+ ref: A,
225
230
  "data-state": p ? "open" : "closed",
226
- onPointerDown: (e) => ot({
231
+ onPointerDown: (e) => at({
227
232
  disabled: d,
228
233
  event: e,
229
234
  onOpen: () => R(!0),
@@ -237,31 +242,31 @@ const ht = l.forwardRef(
237
242
  X === "sm" ? "h-6" : X === "md" ? "h-[28px]" : "h-8",
238
243
  d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
239
244
  "cursor-pointer",
240
- ve
245
+ we
241
246
  ),
242
247
  children: [
243
- /* @__PURE__ */ T("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
248
+ /* @__PURE__ */ W("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
244
249
  /* @__PURE__ */ u(
245
250
  "input",
246
251
  {
247
252
  ref: G,
248
253
  type: "text",
249
254
  value: m,
250
- onChange: Le,
251
- onBlur: ne,
255
+ onChange: Me,
256
+ onBlur: se,
252
257
  onClick: () => !d && R(!0),
253
258
  onKeyDown: (e) => {
254
- e.key === "Enter" && !d && (e.preventDefault(), se()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), O());
259
+ e.key === "Enter" && !d && (e.preventDefault(), ie()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && le(e, { open: p, onCancel: O });
255
260
  },
256
261
  placeholder: p ? n : $,
257
262
  disabled: !!d,
258
- "aria-label": Ge,
263
+ "aria-label": _e,
259
264
  "data-field": "start",
260
265
  className: Q(
261
266
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
262
- Me ? "text-destructive" : ze ? "text-content-placeholder" : ""
267
+ Xe ? "text-destructive" : Qe ? "text-content-placeholder" : ""
263
268
  ),
264
- ...Ee
269
+ ...Be
265
270
  }
266
271
  ),
267
272
  /* @__PURE__ */ u(
@@ -270,93 +275,95 @@ const ht = l.forwardRef(
270
275
  ref: Y,
271
276
  type: "text",
272
277
  value: y,
273
- onChange: je,
274
- onBlur: ne,
278
+ onChange: Ge,
279
+ onBlur: se,
275
280
  onClick: () => !d && R(!0),
276
281
  onKeyDown: (e) => {
277
- e.key === "Enter" && !d && (e.preventDefault(), se()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), O());
282
+ e.key === "Enter" && !d && (e.preventDefault(), ie()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && le(e, { open: p, onCancel: O });
278
283
  },
279
284
  placeholder: p ? n : $,
280
285
  disabled: !!d,
281
- "aria-label": Je,
286
+ "aria-label": $e,
282
287
  "data-field": "end",
283
288
  className: Q(
284
289
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
285
- Ke ? "text-destructive" : He ? "text-content-placeholder" : ""
290
+ Ze ? "text-destructive" : Ue ? "text-content-placeholder" : ""
286
291
  )
287
292
  }
288
293
  )
289
294
  ] }),
290
- /* @__PURE__ */ T("div", { className: "flex items-center gap-1 shrink-0", children: [
291
- t?.from && !d && /* @__PURE__ */ T(ce, { children: [
292
- /* @__PURE__ */ u(ae, { asChild: !0, children: /* @__PURE__ */ u(
295
+ /* @__PURE__ */ W("div", { className: "flex items-center gap-1 shrink-0", children: [
296
+ t?.from && !d && /* @__PURE__ */ W(fe, { children: [
297
+ /* @__PURE__ */ u(de, { asChild: !0, children: /* @__PURE__ */ u(
293
298
  "button",
294
299
  {
295
300
  type: "button",
296
301
  tabIndex: 0,
297
- "aria-label": P("calendar.clear"),
302
+ "aria-label": T("calendar.clear"),
298
303
  onClick: (e) => {
299
- e.stopPropagation(), oe();
304
+ e.stopPropagation(), ne();
300
305
  },
301
306
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
302
- children: /* @__PURE__ */ u(Xe, { className: "size-3 hover:text-content text-content-icon" })
307
+ children: /* @__PURE__ */ u(et, { className: "size-3 hover:text-content text-content-icon" })
303
308
  }
304
309
  ) }),
305
- /* @__PURE__ */ u(fe, { variant: "tertiary", side: "top", children: P("calendar.clear") })
310
+ /* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("calendar.clear") })
306
311
  ] }),
307
- /* @__PURE__ */ T(ce, { children: [
308
- /* @__PURE__ */ u(ae, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": P("datePicker.selectWeekRange"), onClick: (e) => {
312
+ /* @__PURE__ */ W(fe, { children: [
313
+ /* @__PURE__ */ u(de, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": T("datePicker.selectWeekRange"), onClick: (e) => {
309
314
  e.stopPropagation(), d || R(!p);
310
315
  }, onKeyDown: (e) => {
311
316
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), d || (E.current = !0, R(!p)));
312
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Ze, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
313
- /* @__PURE__ */ u(fe, { variant: "tertiary", side: "top", children: P("datePicker.selectWeekRange") })
317
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(tt, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
318
+ /* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("datePicker.selectWeekRange") })
314
319
  ] })
315
320
  ] })
316
321
  ]
317
322
  }
318
323
  ) }),
319
324
  /* @__PURE__ */ u(
320
- ct,
325
+ ut,
321
326
  {
322
327
  ref: J,
323
328
  className: "w-auto p-0",
324
329
  align: "start",
325
- "aria-label": P("datePicker.selectWeekRange"),
330
+ "aria-label": T("datePicker.selectWeekRange"),
326
331
  onOpenAutoFocus: (e) => {
327
332
  E.current || e.preventDefault(), E.current = !1;
328
333
  },
329
- ...Ne,
334
+ ...Le,
330
335
  children: /* @__PURE__ */ u(
331
- at,
336
+ gt,
332
337
  {
333
338
  pickerType: "week",
334
339
  weekMode: "range",
335
340
  selectedWeeks: S(a),
336
- footerFlashKey: Se,
337
- footerFlashTarget: Be,
338
- onWeekSelect: Oe,
339
- month: Ae,
340
- onMonthChange: W,
341
- disabled: ft(me, ue),
342
- startMonth: ge,
343
- endMonth: ke,
341
+ footerFlashKey: Ae,
342
+ footerFlashTarget: Oe,
343
+ onWeekSelect: Ke,
344
+ month: je,
345
+ onMonthChange: P,
346
+ disabled: kt(ge, ke),
347
+ startMonth: Re,
348
+ endMonth: he,
344
349
  showFooter: k,
345
- ...kt({
350
+ ...xt({
346
351
  calendarKind: N,
347
352
  fiscalMode: q,
348
353
  granularity: z,
349
354
  fiscalMonthPattern: H,
350
- fiscalYearStartMonth: M,
351
- fiscalConfig: Re,
352
- weekStartsOn: K,
353
- showPresets: he,
354
- comparison: De,
355
- onComparisonChange: ye
355
+ fiscalYearStartMonth: K,
356
+ fiscalConfig: De,
357
+ weekStartsOn: M,
358
+ showPresets: ye,
359
+ showPeriodBoundaries: ve,
360
+ autoNavigateToAvailable: xe,
361
+ comparison: Ce,
362
+ onComparisonChange: be
356
363
  }),
357
- onApply: re,
364
+ onApply: oe,
358
365
  onCancel: O,
359
- onClear: oe,
366
+ onClear: ne,
360
367
  captionLayout: "dropdown"
361
368
  }
362
369
  )
@@ -368,7 +375,7 @@ const ht = l.forwardRef(
368
375
  );
369
376
  }
370
377
  );
371
- ht.displayName = "WeekRangePicker";
378
+ bt.displayName = "WeekRangePicker";
372
379
  export {
373
- ht as WeekRangePicker
380
+ bt as WeekRangePicker
374
381
  };