impact-nova 2.5.9 → 2.5.10

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