impact-nova 2.5.9 → 2.5.10

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