impact-nova 2.5.12 → 2.5.13

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