impact-nova 2.5.13 → 2.5.14

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