impact-nova 2.5.11 → 2.5.12

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