impact-nova 2.5.13 → 2.5.15

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