impact-nova 2.5.10 → 2.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  2. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  3. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  4. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  5. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  6. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  7. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  8. package/dist/components/data-display/calendar/calendar-day-picker-components.js +163 -152
  9. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  10. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  11. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  12. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  13. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  14. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
  15. package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
  16. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  17. package/dist/components/data-display/calendar/calendar-week-number-cell.js +55 -41
  18. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
  19. package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
  20. package/dist/components/data-display/calendar/calendar.js +146 -143
  21. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  22. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  23. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  24. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  25. package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
  26. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  27. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  28. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  29. package/dist/components/forms/date-picker/date-picker.js +60 -58
  30. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  31. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  32. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  33. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  34. package/dist/components/forms/date-picker/month-picker.js +61 -59
  35. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  36. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  37. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  38. package/dist/components/forms/date-picker/multi-quarter-picker.js +46 -44
  39. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  40. package/dist/components/forms/date-picker/multi-year-picker.js +48 -46
  41. package/dist/components/forms/date-picker/quarter-picker.js +46 -44
  42. package/dist/components/forms/date-picker/quarter-range-picker.js +45 -43
  43. package/dist/components/forms/date-picker/week-picker.js +68 -66
  44. package/dist/components/forms/date-picker/week-range-picker.js +82 -80
  45. package/dist/components/forms/date-picker/year-picker.js +47 -45
  46. package/dist/components/forms/date-picker/year-range-picker.js +47 -45
  47. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  48. package/dist/components/forms/select/components/Submenu.js +3 -2
  49. package/dist/form-react/Fields/DateInputField.js +51 -50
  50. package/dist/form-react/Fields/DateRangeField.js +14 -13
  51. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  52. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  53. package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
  54. package/dist/form-react/Fields/WeekRangePicker.js +22 -21
  55. package/dist/form-react/types/fields.types.d.ts +12 -0
  56. package/dist/impact-nova.css +1 -1
  57. package/dist/llms/rules/installation.js +1 -1
  58. package/dist/llms/rules/requirements.js +1 -1
  59. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
1
  import { jsx as r, jsxs as y } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import { Cross as _, CalendarMonth as $ } from "impact-nova-icons";
4
- import { cn as ee } from "../../../lib/utils.js";
5
- import { Input as te } from "../input/input.js";
6
- import { Calendar as re } from "../../data-display/calendar/calendar.js";
3
+ import { Cross as $, CalendarMonth as ee } from "impact-nova-icons";
4
+ import { cn as te } from "../../../lib/utils.js";
5
+ import { Input as re } from "../input/input.js";
6
+ import { Calendar as ne } from "../../data-display/calendar/calendar.js";
7
7
  import { Tooltip as M, TooltipTrigger as x, TooltipContent as R } from "../../feedback/tooltip/tooltip.js";
8
- import { useImpactNovaI18n as ne } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { buildDateBoundsMatcher as oe } from "../../../lib/date-bounds-matcher.js";
10
- import { fiscalCalendarPassThrough as ae } from "./fiscal-pass-through.js";
11
- import { DatePickerShell as ie } from "./date-picker-shell.js";
12
- import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as le, handlePickerSurfacePointerDown as pe } from "./date-input-behavior.js";
13
- import { formatYearInput as fe } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
- import { viewMonthFromYear as de } from "../../data-display/calendar/calendar-year-utils.js";
15
- const ue = n.forwardRef(
8
+ import { useImpactNovaI18n as oe } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { buildDateBoundsMatcher as ae } from "../../../lib/date-bounds-matcher.js";
10
+ import { fiscalCalendarPassThrough as ie } from "./fiscal-pass-through.js";
11
+ import { DatePickerShell as se } from "./date-picker-shell.js";
12
+ import { usePickerDismissActionsRef as ce, usePickerFooterDismissNudge as le, handleReadonlyPickerKeyDown as pe, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
13
+ import { formatYearInput as de } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
+ import { viewMonthFromYear as ue } from "../../data-display/calendar/calendar-year-utils.js";
15
+ const me = n.forwardRef(
16
16
  ({
17
17
  value: t,
18
18
  onChange: f,
@@ -32,16 +32,17 @@ const ue = n.forwardRef(
32
32
  fiscalConfig: g,
33
33
  showPresets: j,
34
34
  showPeriodBoundaries: F,
35
- showIntervalCaption: L = !1,
36
- ...z
37
- }, E) => {
38
- const { t: a } = ne(), H = D ?? a("datePicker.selectMultipleYears"), V = g?.fyLabel ?? "fy-long", d = n.useRef(null), k = n.useRef(null);
39
- n.useImperativeHandle(E, () => d.current);
40
- const [i, s] = n.useState(!1), u = n.useRef(!1), P = se(), { footerFlashKey: B, footerFlashTarget: q, popoverHandlers: G } = ce(c, i, P, k), [C, l] = n.useState(t), [J, Q] = n.useState(de(t?.[0]));
35
+ autoNavigateToAvailable: L,
36
+ showIntervalCaption: z = !1,
37
+ ...E
38
+ }, H) => {
39
+ const { t: a } = oe(), V = D ?? a("datePicker.selectMultipleYears"), B = g?.fyLabel ?? "fy-long", d = n.useRef(null), k = n.useRef(null);
40
+ n.useImperativeHandle(H, () => d.current);
41
+ const [i, s] = n.useState(!1), u = n.useRef(!1), P = ce(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = le(c, i, P, k), [C, l] = n.useState(t), [Q, U] = n.useState(ue(t?.[0]));
41
42
  n.useEffect(() => {
42
43
  i || l(t);
43
44
  }, [i, t]);
44
- const m = n.useCallback(() => s(!1), []), U = ae({
45
+ const m = n.useCallback(() => s(!1), []), W = ie({
45
46
  calendarKind: O,
46
47
  fiscalMode: T,
47
48
  granularity: w,
@@ -49,11 +50,12 @@ const ue = n.forwardRef(
49
50
  fiscalYearStartMonth: K,
50
51
  fiscalConfig: g,
51
52
  showPresets: j,
52
- showPeriodBoundaries: F
53
- }), W = (e) => {
53
+ showPeriodBoundaries: F,
54
+ autoNavigateToAvailable: L
55
+ }), X = (e) => {
54
56
  const p = Array.isArray(e) && e.length > 0 ? e : void 0;
55
57
  l(p), c || f?.(p);
56
- }, X = () => {
58
+ }, Z = () => {
57
59
  f?.(C), m();
58
60
  }, h = () => {
59
61
  l(t), m();
@@ -63,9 +65,9 @@ const ue = n.forwardRef(
63
65
  n.useLayoutEffect(() => {
64
66
  P.current = { onDismiss: h, resolveFlash: () => "cancel" };
65
67
  });
66
- const Z = t && t.length > 0 ? t.length === 1 ? fe(t[0], V) : a("datePicker.yearsSelected", { count: t.length }) : "";
68
+ const _ = t && t.length > 0 ? t.length === 1 ? de(t[0], B) : a("datePicker.yearsSelected", { count: t.length }) : "";
67
69
  return /* @__PURE__ */ r(
68
- ie,
70
+ se,
69
71
  {
70
72
  open: i,
71
73
  disabled: o,
@@ -76,26 +78,26 @@ const ue = n.forwardRef(
76
78
  onOpenAutoFocus: (e) => {
77
79
  u.current || e.preventDefault(), u.current = !1;
78
80
  },
79
- popoverHandlers: G,
81
+ popoverHandlers: J,
80
82
  trigger: /* @__PURE__ */ r(
81
83
  "div",
82
84
  {
83
85
  ref: k,
84
86
  "data-component": "multi-year-picker",
85
87
  "data-state": i ? "open" : "closed",
86
- onPointerDown: (e) => pe({
88
+ onPointerDown: (e) => fe({
87
89
  disabled: o,
88
90
  event: e,
89
91
  onOpen: () => s(!0),
90
92
  focusField: () => d.current?.focus()
91
93
  }),
92
94
  children: /* @__PURE__ */ r(
93
- te,
95
+ re,
94
96
  {
95
97
  ref: d,
96
- value: Z,
98
+ value: _,
97
99
  readOnly: !0,
98
- onKeyDown: (e) => le(e, {
100
+ onKeyDown: (e) => pe(e, {
99
101
  disabled: o,
100
102
  open: i,
101
103
  onOpen: () => s(!0),
@@ -105,10 +107,10 @@ const ue = n.forwardRef(
105
107
  }
106
108
  }),
107
109
  onClick: () => !o && s(!0),
108
- placeholder: H,
110
+ placeholder: V,
109
111
  disabled: o,
110
112
  "data-form-control": "input",
111
- className: ee("cursor-pointer", I),
113
+ className: te("cursor-pointer", I),
112
114
  suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
113
115
  t && t.length > 0 && !o ? /* @__PURE__ */ y(M, { children: [
114
116
  /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
@@ -121,7 +123,7 @@ const ue = n.forwardRef(
121
123
  e.stopPropagation(), b();
122
124
  },
123
125
  className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
124
- children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
126
+ children: /* @__PURE__ */ r($, { className: "size-3 hover:text-content" })
125
127
  }
126
128
  ) }),
127
129
  /* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
@@ -138,44 +140,44 @@ const ue = n.forwardRef(
138
140
  e.stopPropagation(), o || s((p) => !p);
139
141
  },
140
142
  className: "inline-flex items-center justify-center border-none bg-transparent p-0",
141
- children: /* @__PURE__ */ r($, { className: "h-4 w-4 text-secondary-foreground" })
143
+ children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
142
144
  }
143
145
  ) }),
144
146
  /* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectMultipleYears") })
145
147
  ] })
146
148
  ] }),
147
- ...z
149
+ ...E
148
150
  }
149
151
  )
150
152
  }
151
153
  ),
152
154
  children: /* @__PURE__ */ r(
153
- re,
155
+ ne,
154
156
  {
155
157
  pickerType: "year",
156
158
  yearMode: "multiple",
157
159
  selectedYear: C,
158
- footerFlashKey: B,
159
- footerFlashTarget: q,
160
- onYearSelect: W,
161
- month: J,
162
- onMonthChange: Q,
163
- disabled: oe(Y, N),
160
+ footerFlashKey: q,
161
+ footerFlashTarget: G,
162
+ onYearSelect: X,
163
+ month: Q,
164
+ onMonthChange: U,
165
+ disabled: ae(Y, N),
164
166
  startMonth: S,
165
167
  endMonth: A,
166
168
  showFooter: c,
167
- onApply: X,
169
+ onApply: Z,
168
170
  onCancel: h,
169
171
  onClear: b,
170
- showIntervalCaption: L,
171
- ...U
172
+ showIntervalCaption: z,
173
+ ...W
172
174
  }
173
175
  )
174
176
  }
175
177
  );
176
178
  }
177
179
  );
178
- ue.displayName = "MultiYearPicker";
180
+ me.displayName = "MultiYearPicker";
179
181
  export {
180
- ue as MultiYearPicker
182
+ me as MultiYearPicker
181
183
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as r, jsxs as y } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
4
- import { cn as $ } from "../../../lib/utils.js";
5
- import { Input as q } from "../input/input.js";
6
- import { Calendar as ee } from "../../data-display/calendar/calendar.js";
3
+ import { Cross as _, CalendarMonth as $ } from "impact-nova-icons";
4
+ import { cn as q } from "../../../lib/utils.js";
5
+ import { Input as ee } from "../input/input.js";
6
+ import { Calendar as re } from "../../data-display/calendar/calendar.js";
7
7
  import { Tooltip as x, TooltipTrigger as b, TooltipContent as R } from "../../feedback/tooltip/tooltip.js";
8
- import { useImpactNovaI18n as re } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { buildDateBoundsMatcher as te } from "../../../lib/date-bounds-matcher.js";
10
- import { fiscalCalendarPassThrough as ne } from "./fiscal-pass-through.js";
11
- import { DatePickerShell as oe } from "./date-picker-shell.js";
12
- import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as ie, handleReadonlyPickerKeyDown as ce, handlePickerSurfacePointerDown as se } from "./date-input-behavior.js";
13
- import { formatQuarterInput as le } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
- import { viewMonthFromQuarter as pe } from "../../data-display/calendar/calendar-quarter-utils.js";
15
- const fe = t.forwardRef(
8
+ import { useImpactNovaI18n as te } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { buildDateBoundsMatcher as ne } from "../../../lib/date-bounds-matcher.js";
10
+ import { fiscalCalendarPassThrough as oe } from "./fiscal-pass-through.js";
11
+ import { DatePickerShell as ae } from "./date-picker-shell.js";
12
+ import { usePickerDismissActionsRef as ie, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as se, handlePickerSurfacePointerDown as le } from "./date-input-behavior.js";
13
+ import { formatQuarterInput as pe } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
+ import { viewMonthFromQuarter as fe } from "../../data-display/calendar/calendar-quarter-utils.js";
15
+ const ue = t.forwardRef(
16
16
  ({
17
17
  value: n,
18
18
  onChange: u,
@@ -32,15 +32,16 @@ const fe = t.forwardRef(
32
32
  fiscalConfig: K,
33
33
  showPresets: j,
34
34
  showPeriodBoundaries: F,
35
- ...z
36
- }, E) => {
37
- const { t: a } = re(), H = D ?? a("datePicker.selectQuarter"), d = t.useRef(null), k = t.useRef(null);
38
- t.useImperativeHandle(E, () => d.current);
39
- const [i, c] = t.useState(!1), P = ae(), { footerFlashKey: L, footerFlashTarget: V, popoverHandlers: B } = ie(s, i, P, k), m = t.useRef(!1), [g, l] = t.useState(n), [G, J] = t.useState(pe(n));
35
+ autoNavigateToAvailable: z,
36
+ ...E
37
+ }, H) => {
38
+ const { t: a } = te(), L = D ?? a("datePicker.selectQuarter"), d = t.useRef(null), k = t.useRef(null);
39
+ t.useImperativeHandle(H, () => d.current);
40
+ const [i, c] = t.useState(!1), P = ie(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: G } = ce(s, i, P, k), m = t.useRef(!1), [g, l] = t.useState(n), [J, U] = t.useState(fe(n));
40
41
  t.useEffect(() => {
41
42
  i || l(n);
42
43
  }, [i, n]);
43
- const p = t.useCallback(() => c(!1), []), U = ne({
44
+ const p = t.useCallback(() => c(!1), []), W = oe({
44
45
  calendarKind: I,
45
46
  fiscalMode: O,
46
47
  granularity: T,
@@ -48,11 +49,12 @@ const fe = t.forwardRef(
48
49
  fiscalYearStartMonth: M,
49
50
  fiscalConfig: K,
50
51
  showPresets: j,
51
- showPeriodBoundaries: F
52
- }), W = (e) => {
52
+ showPeriodBoundaries: F,
53
+ autoNavigateToAvailable: z
54
+ }), X = (e) => {
53
55
  const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
54
56
  l(f), s || (u?.(f), p());
55
- }, X = () => {
57
+ }, Y = () => {
56
58
  u?.(g), p();
57
59
  }, h = () => {
58
60
  l(n), p();
@@ -62,9 +64,9 @@ const fe = t.forwardRef(
62
64
  t.useLayoutEffect(() => {
63
65
  P.current = { onDismiss: h, resolveFlash: () => "cancel" };
64
66
  });
65
- const Y = n ? le(n) : "";
67
+ const Z = n ? pe(n) : "";
66
68
  return /* @__PURE__ */ r(
67
- oe,
69
+ ae,
68
70
  {
69
71
  open: i,
70
72
  disabled: o,
@@ -75,26 +77,26 @@ const fe = t.forwardRef(
75
77
  onOpenAutoFocus: (e) => {
76
78
  m.current || e.preventDefault(), m.current = !1;
77
79
  },
78
- popoverHandlers: B,
80
+ popoverHandlers: G,
79
81
  trigger: /* @__PURE__ */ r(
80
82
  "div",
81
83
  {
82
84
  ref: k,
83
85
  "data-component": "quarter-picker",
84
86
  "data-state": i ? "open" : "closed",
85
- onPointerDown: (e) => se({
87
+ onPointerDown: (e) => le({
86
88
  disabled: o,
87
89
  event: e,
88
90
  onOpen: () => c(!0),
89
91
  focusField: () => d.current?.focus()
90
92
  }),
91
93
  children: /* @__PURE__ */ r(
92
- q,
94
+ ee,
93
95
  {
94
96
  ref: d,
95
- value: Y,
97
+ value: Z,
96
98
  readOnly: !0,
97
- onKeyDown: (e) => ce(e, {
99
+ onKeyDown: (e) => se(e, {
98
100
  disabled: o,
99
101
  open: i,
100
102
  onOpen: () => c(!0),
@@ -104,10 +106,10 @@ const fe = t.forwardRef(
104
106
  }
105
107
  }),
106
108
  onClick: () => !o && c(!0),
107
- placeholder: H,
109
+ placeholder: L,
108
110
  disabled: o,
109
111
  "data-form-control": "input",
110
- className: $("cursor-pointer", A),
112
+ className: q("cursor-pointer", A),
111
113
  suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
112
114
  n && !o ? /* @__PURE__ */ y(x, { children: [
113
115
  /* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(
@@ -120,7 +122,7 @@ const fe = t.forwardRef(
120
122
  e.stopPropagation(), C();
121
123
  },
122
124
  className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
123
- children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
125
+ children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
124
126
  }
125
127
  ) }),
126
128
  /* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
@@ -137,42 +139,42 @@ const fe = t.forwardRef(
137
139
  e.stopPropagation(), o || c((f) => !f);
138
140
  },
139
141
  className: "inline-flex items-center justify-center border-none bg-transparent p-0",
140
- children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
142
+ children: /* @__PURE__ */ r($, { className: "h-4 w-4 text-secondary-foreground" })
141
143
  }
142
144
  ) }),
143
145
  /* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarter") })
144
146
  ] })
145
147
  ] }),
146
- ...z
148
+ ...E
147
149
  }
148
150
  )
149
151
  }
150
152
  ),
151
153
  children: /* @__PURE__ */ r(
152
- ee,
154
+ re,
153
155
  {
154
156
  pickerType: "quarter",
155
157
  selectedQuarters: g,
156
- footerFlashKey: L,
157
- footerFlashTarget: V,
158
- onQuarterSelect: W,
159
- month: G,
160
- onMonthChange: J,
161
- disabled: te(Q, v),
158
+ footerFlashKey: V,
159
+ footerFlashTarget: B,
160
+ onQuarterSelect: X,
161
+ month: J,
162
+ onMonthChange: U,
163
+ disabled: ne(Q, v),
162
164
  startMonth: N,
163
165
  endMonth: S,
164
166
  showFooter: s,
165
- onApply: X,
167
+ onApply: Y,
166
168
  onCancel: h,
167
169
  onClear: C,
168
- ...U
170
+ ...W
169
171
  }
170
172
  )
171
173
  }
172
174
  );
173
175
  }
174
176
  );
175
- fe.displayName = "QuarterPicker";
177
+ ue.displayName = "QuarterPicker";
176
178
  export {
177
- fe as QuarterPicker
179
+ ue as QuarterPicker
178
180
  };
@@ -1,18 +1,18 @@
1
1
  import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
4
- import { cn as q } from "../../../lib/utils.js";
5
- import { Input as ee } from "../input/input.js";
6
- import { Calendar as re } from "../../data-display/calendar/calendar.js";
3
+ import { Cross as _, CalendarMonth as q } from "impact-nova-icons";
4
+ import { cn as ee } from "../../../lib/utils.js";
5
+ import { Input as re } from "../input/input.js";
6
+ import { Calendar as te } from "../../data-display/calendar/calendar.js";
7
7
  import { Tooltip as C, TooltipTrigger as x, TooltipContent as b } from "../../feedback/tooltip/tooltip.js";
8
- import { useImpactNovaI18n as te } from "../../../i18n/use-impact-nova-i18n.js";
9
- import { buildDateBoundsMatcher as ne } from "../../../lib/date-bounds-matcher.js";
10
- import { fiscalCalendarPassThrough as oe } from "./fiscal-pass-through.js";
11
- import { DatePickerShell as ae } from "./date-picker-shell.js";
12
- import { usePickerDismissActionsRef as ie, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as se, handlePickerSurfacePointerDown as le } from "./date-input-behavior.js";
8
+ import { useImpactNovaI18n as ne } from "../../../i18n/use-impact-nova-i18n.js";
9
+ import { buildDateBoundsMatcher as oe } from "../../../lib/date-bounds-matcher.js";
10
+ import { fiscalCalendarPassThrough as ae } from "./fiscal-pass-through.js";
11
+ import { DatePickerShell as ie } from "./date-picker-shell.js";
12
+ import { usePickerDismissActionsRef as ce, usePickerFooterDismissNudge as se, handleReadonlyPickerKeyDown as le, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
13
13
  import { formatQuarterInput as D } from "../../data-display/calendar/calendar-fiscal-labels.js";
14
- import { viewMonthFromQuarter as fe } from "../../data-display/calendar/calendar-quarter-utils.js";
15
- const pe = t.forwardRef(
14
+ import { viewMonthFromQuarter as pe } from "../../data-display/calendar/calendar-quarter-utils.js";
15
+ const de = t.forwardRef(
16
16
  ({
17
17
  value: n,
18
18
  onChange: d,
@@ -32,15 +32,16 @@ const pe = t.forwardRef(
32
32
  fiscalConfig: j,
33
33
  showPresets: F,
34
34
  showPeriodBoundaries: $,
35
- ...z
36
- }, E) => {
37
- const { t: a } = te(), H = Q ?? a("datePicker.selectQuarterRange"), m = t.useRef(null), y = t.useRef(null);
38
- t.useImperativeHandle(E, () => m.current);
39
- const [i, c] = t.useState(!1), u = t.useRef(!1), k = ie(), { footerFlashKey: L, footerFlashTarget: V, popoverHandlers: B } = ce(l, i, k, y), [P, f] = t.useState(n), [G, J] = t.useState(fe(n?.from));
35
+ autoNavigateToAvailable: z,
36
+ ...E
37
+ }, H) => {
38
+ const { t: a } = ne(), L = Q ?? a("datePicker.selectQuarterRange"), m = t.useRef(null), y = t.useRef(null);
39
+ t.useImperativeHandle(H, () => m.current);
40
+ const [i, c] = t.useState(!1), u = t.useRef(!1), k = ce(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: G } = se(l, i, k, y), [P, f] = t.useState(n), [J, U] = t.useState(pe(n?.from));
40
41
  t.useEffect(() => {
41
42
  i || f(n);
42
43
  }, [i, n]);
43
- const p = t.useCallback(() => c(!1), []), U = oe({
44
+ const p = t.useCallback(() => c(!1), []), W = ae({
44
45
  calendarKind: M,
45
46
  fiscalMode: O,
46
47
  granularity: T,
@@ -48,11 +49,12 @@ const pe = t.forwardRef(
48
49
  fiscalYearStartMonth: K,
49
50
  fiscalConfig: j,
50
51
  showPresets: F,
51
- showPeriodBoundaries: $
52
- }), W = (e) => {
52
+ showPeriodBoundaries: $,
53
+ autoNavigateToAvailable: z
54
+ }), X = (e) => {
53
55
  const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
54
56
  f(s), l || (d?.(s), s?.to && p());
55
- }, X = () => {
57
+ }, Y = () => {
56
58
  d?.(P), p();
57
59
  }, h = () => {
58
60
  f(n), p();
@@ -62,9 +64,9 @@ const pe = t.forwardRef(
62
64
  t.useLayoutEffect(() => {
63
65
  k.current = { onDismiss: h, resolveFlash: () => "cancel" };
64
66
  });
65
- const Y = n?.from ? `${D(n.from)}${n.to ? ` – ${D(n.to)}` : ""}` : "";
67
+ const Z = n?.from ? `${D(n.from)}${n.to ? ` – ${D(n.to)}` : ""}` : "";
66
68
  return /* @__PURE__ */ r(
67
- ae,
69
+ ie,
68
70
  {
69
71
  open: i,
70
72
  disabled: o,
@@ -75,26 +77,26 @@ const pe = t.forwardRef(
75
77
  onOpenAutoFocus: (e) => {
76
78
  u.current || e.preventDefault(), u.current = !1;
77
79
  },
78
- popoverHandlers: B,
80
+ popoverHandlers: G,
79
81
  trigger: /* @__PURE__ */ r(
80
82
  "div",
81
83
  {
82
84
  ref: y,
83
85
  "data-component": "quarter-range-picker",
84
86
  "data-state": i ? "open" : "closed",
85
- onPointerDown: (e) => le({
87
+ onPointerDown: (e) => fe({
86
88
  disabled: o,
87
89
  event: e,
88
90
  onOpen: () => c(!0),
89
91
  focusField: () => m.current?.focus()
90
92
  }),
91
93
  children: /* @__PURE__ */ r(
92
- ee,
94
+ re,
93
95
  {
94
96
  ref: m,
95
- value: Y,
97
+ value: Z,
96
98
  readOnly: !0,
97
- onKeyDown: (e) => se(e, {
99
+ onKeyDown: (e) => le(e, {
98
100
  disabled: o,
99
101
  open: i,
100
102
  onOpen: () => c(!0),
@@ -104,10 +106,10 @@ const pe = t.forwardRef(
104
106
  }
105
107
  }),
106
108
  onClick: () => !o && c(!0),
107
- placeholder: H,
109
+ placeholder: L,
108
110
  disabled: o,
109
111
  "data-form-control": "input",
110
- className: q("cursor-pointer", I),
112
+ className: ee("cursor-pointer", I),
111
113
  suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
112
114
  n?.from && !o ? /* @__PURE__ */ g(C, { children: [
113
115
  /* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
@@ -120,7 +122,7 @@ const pe = t.forwardRef(
120
122
  e.stopPropagation(), R();
121
123
  },
122
124
  className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
123
- children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
125
+ children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
124
126
  }
125
127
  ) }),
126
128
  /* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
@@ -137,43 +139,43 @@ const pe = t.forwardRef(
137
139
  e.stopPropagation(), o || c((s) => !s);
138
140
  },
139
141
  className: "inline-flex items-center justify-center border-none bg-transparent p-0",
140
- children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
142
+ children: /* @__PURE__ */ r(q, { className: "h-4 w-4 text-secondary-foreground" })
141
143
  }
142
144
  ) }),
143
145
  /* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarterRange") })
144
146
  ] })
145
147
  ] }),
146
- ...z
148
+ ...E
147
149
  }
148
150
  )
149
151
  }
150
152
  ),
151
153
  children: /* @__PURE__ */ r(
152
- re,
154
+ te,
153
155
  {
154
156
  pickerType: "quarter",
155
157
  monthMode: "range",
156
158
  selectedQuarters: P,
157
- footerFlashKey: L,
158
- footerFlashTarget: V,
159
- onQuarterSelect: W,
160
- month: G,
161
- onMonthChange: J,
162
- disabled: ne(N, S),
159
+ footerFlashKey: V,
160
+ footerFlashTarget: B,
161
+ onQuarterSelect: X,
162
+ month: J,
163
+ onMonthChange: U,
164
+ disabled: oe(N, S),
163
165
  startMonth: v,
164
166
  endMonth: A,
165
167
  showFooter: l,
166
- onApply: X,
168
+ onApply: Y,
167
169
  onCancel: h,
168
170
  onClear: R,
169
- ...U
171
+ ...W
170
172
  }
171
173
  )
172
174
  }
173
175
  );
174
176
  }
175
177
  );
176
- pe.displayName = "QuarterRangePicker";
178
+ de.displayName = "QuarterRangePicker";
177
179
  export {
178
- pe as QuarterRangePicker
180
+ de as QuarterRangePicker
179
181
  };