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,27 +1,27 @@
1
- import { parse as h, isValid as D } from "date-fns";
2
- import * as d from "react";
3
- import { resolveRangeFooterFlashTarget as y } from "../../data-display/calendar/calendar-footer-emphasis.js";
4
- import { padValidDateString as v, maskDate as k } from "../../../lib/utils.js";
5
- function I(e, t, n) {
6
- return k(e, t, n);
7
- }
8
- function f(e, t, n) {
9
- const r = v(e, t), s = h(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), a = D(s) && r.length === t.length;
1
+ import { parse as D, isValid as k } from "date-fns";
2
+ import * as l from "react";
3
+ import { resolveRangeFooterFlashTarget as E } from "../../data-display/calendar/calendar-footer-emphasis.js";
4
+ import { padValidDateString as O, maskDate as v } from "../../../lib/utils.js";
5
+ function b(e, t, n) {
6
+ return v(e, t, n);
7
+ }
8
+ function p(e, t, n) {
9
+ const r = O(e, t), a = D(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), i = k(a) && r.length === t.length;
10
10
  return {
11
11
  padded: r,
12
- parsed: a ? s : void 0,
12
+ parsed: i ? a : void 0,
13
13
  isComplete: e.length === t.length,
14
- isValid: a
14
+ isValid: i
15
15
  };
16
16
  }
17
- function T(e, t, n) {
18
- return !e || e.length !== t.length ? !1 : !f(e, t, n).isValid;
17
+ function B(e, t, n) {
18
+ return !e || e.length !== t.length ? !1 : !p(e, t, n).isValid;
19
19
  }
20
- function m(e, t) {
20
+ function g(e, t) {
21
21
  const n = document.activeElement;
22
22
  return n instanceof Node ? !!(e.current?.contains(n) || t.current?.contains(n)) : !1;
23
23
  }
24
- function S(e) {
24
+ function N(e) {
25
25
  return (t) => {
26
26
  if (!e.disabled) {
27
27
  if (t) {
@@ -33,37 +33,55 @@ function S(e) {
33
33
  return;
34
34
  }
35
35
  queueMicrotask(() => {
36
- m(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
36
+ g(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
37
37
  });
38
38
  }
39
39
  };
40
40
  }
41
- function O(e, t) {
41
+ const f = '[data-component="select-menu"], [data-component="dropdown-menu-content"]';
42
+ function h() {
43
+ return !!document.querySelector(f);
44
+ }
45
+ function P(e) {
46
+ if ((typeof e.composedPath == "function" ? e.composedPath() : []).some(
47
+ (r) => r instanceof Element && r.closest(f)
48
+ ))
49
+ return !0;
50
+ const n = e.target;
51
+ return n instanceof Element ? !!n.closest(f) : !1;
52
+ }
53
+ function R(e, t) {
42
54
  const n = e.target;
43
55
  return n instanceof Node ? !!t.current?.contains(n) : !1;
44
56
  }
45
- function V(e, t) {
46
- t.disabled || (e.key === "ArrowDown" && !t.open && (e.preventDefault(), t.onKeyboardOpen?.(), t.onOpen()), e.key === "Escape" && t.open && (e.preventDefault(), t.onCancel()));
57
+ function q(e, t) {
58
+ t.disabled || (e.key === "ArrowDown" && !t.open && (e.preventDefault(), t.onKeyboardOpen?.(), t.onOpen()), e.key === "Escape" && t.open && w(e, {
59
+ open: t.open,
60
+ onCancel: t.onCancel
61
+ }));
62
+ }
63
+ function w(e, t) {
64
+ e.key !== "Escape" || !t.open || h() || (e.preventDefault(), t.onCancel());
47
65
  }
48
- function b({
66
+ function K({
49
67
  disabled: e,
50
68
  event: t,
51
69
  onOpen: n,
52
70
  focusField: r
53
71
  }) {
54
72
  if (e) return;
55
- const s = t.target;
56
- if (!(s instanceof HTMLElement) || s.closest("button") || (n(), !r)) return;
57
- const i = s.closest("[data-field]")?.getAttribute("data-field");
58
- r(i === "end" ? "end" : "start");
73
+ const a = t.target;
74
+ if (!(a instanceof HTMLElement) || a.closest("button") || (n(), !r)) return;
75
+ const s = a.closest("[data-field]")?.getAttribute("data-field");
76
+ r(s === "end" ? "end" : "start");
59
77
  }
60
- function F(e, t, n, r) {
78
+ function C(e, t, n, r) {
61
79
  return e ? {
62
- onInteractOutside: (i) => {
63
- i.preventDefault();
80
+ onInteractOutside: (s) => {
81
+ s.preventDefault();
64
82
  },
65
- onPointerDownOutside: (i) => {
66
- if (i.preventDefault(), !(r && O(i, r)) && t) {
83
+ onPointerDownOutside: (s) => {
84
+ if (s.preventDefault(), !(P(s) || r && R(s, r)) && t) {
67
85
  const o = t.current.resolveFlash();
68
86
  if (o === "dismiss") {
69
87
  t.current.onDismiss();
@@ -72,96 +90,96 @@ function F(e, t, n, r) {
72
90
  n?.(o);
73
91
  }
74
92
  },
75
- onEscapeKeyDown: t ? (i) => {
76
- i.preventDefault(), t.current.onDismiss();
93
+ onEscapeKeyDown: t ? (s) => {
94
+ s.preventDefault(), !h() && t.current.onDismiss();
77
95
  } : void 0
78
96
  } : {};
79
97
  }
80
- function B(e, t, n) {
81
- const r = e == null, s = t == null;
82
- return r && s || !r && !s && n(e, t) ? "dismiss" : r ? "cancel" : "apply";
98
+ function M(e, t, n) {
99
+ const r = e == null, a = t == null;
100
+ return r && a || !r && !a && n(e, t) ? "dismiss" : r ? "cancel" : "apply";
83
101
  }
84
- function q(e) {
102
+ function L(e) {
85
103
  const {
86
104
  startInput: t,
87
105
  endInput: n,
88
106
  committedStart: r,
89
- committedEnd: s,
90
- committedRange: a,
91
- pendingRange: i,
107
+ committedEnd: a,
108
+ committedRange: i,
109
+ pendingRange: s,
92
110
  computeEffectiveRange: u,
93
111
  rangesEqual: o
94
- } = e, c = t !== r || n !== s, l = u(), p = !c && i !== void 0 ? i : l, g = !o(p, a);
95
- return !c && !g ? "dismiss" : y(
96
- c ? l : p
112
+ } = e, c = t !== r || n !== a, d = u(), m = !c && s !== void 0 ? s : d, y = !o(m, i);
113
+ return !c && !y ? "dismiss" : E(
114
+ c ? d : m
97
115
  ) === "apply" ? "apply" : "cancel";
98
116
  }
99
- function M() {
100
- return d.useRef({
117
+ function X() {
118
+ return l.useRef({
101
119
  onDismiss: () => {
102
120
  },
103
121
  resolveFlash: () => "cancel"
104
122
  });
105
123
  }
106
- function K(e, t, n, r) {
107
- const [s, a] = d.useState({ key: 0, target: "cancel" }), i = d.useRef(t);
108
- d.useLayoutEffect(() => {
109
- i.current !== t && (i.current = t, a({ key: 0, target: "cancel" }));
124
+ function x(e, t, n, r) {
125
+ const [a, i] = l.useState({ key: 0, target: "cancel" }), s = l.useRef(t);
126
+ l.useLayoutEffect(() => {
127
+ s.current !== t && (s.current = t, i({ key: 0, target: "cancel" }));
110
128
  }, [t]);
111
- const u = d.useCallback(
129
+ const u = l.useCallback(
112
130
  (c) => {
113
- e && a((l) => ({ key: l.key + 1, target: c }));
131
+ e && i((d) => ({ key: d.key + 1, target: c }));
114
132
  },
115
133
  [e]
116
- ), o = F(
134
+ ), o = C(
117
135
  e,
118
136
  n,
119
137
  u,
120
138
  r
121
139
  );
122
140
  return {
123
- footerFlashKey: s.key,
124
- footerFlashTarget: s.key > 0 ? s.target : void 0,
141
+ footerFlashKey: a.key,
142
+ footerFlashTarget: a.key > 0 ? a.target : void 0,
125
143
  triggerFooterFlash: u,
126
144
  popoverHandlers: o
127
145
  };
128
146
  }
129
- function N(e, t, n) {
147
+ function H(e, t, n) {
130
148
  queueMicrotask(() => {
131
- m(e, t) || n();
149
+ g(e, t) || n();
132
150
  });
133
151
  }
134
- function P(e, t, n, r) {
152
+ function F(e, t, n, r) {
135
153
  if (!e)
136
154
  return { display: "", parsed: void 0, resetToCommitted: !1 };
137
- const s = f(e, t, r);
138
- return s.isValid ? {
139
- display: s.padded,
140
- parsed: s.parsed,
155
+ const a = p(e, t, r);
156
+ return a.isValid ? {
157
+ display: a.padded,
158
+ parsed: a.parsed,
141
159
  resetToCommitted: !1
142
160
  } : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
143
161
  }
144
- function X(e, t, n, r) {
145
- const s = P(e, t, n, r);
162
+ function _(e, t, n, r) {
163
+ const a = F(e, t, n, r);
146
164
  return {
147
- ...s,
148
- isPartial: !!e && e.length < t.length && !s.resetToCommitted
165
+ ...a,
166
+ isPartial: !!e && e.length < t.length && !a.resetToCommitted
149
167
  };
150
168
  }
151
- function x(e, t, n) {
152
- const r = f(e, t, n);
169
+ function z(e, t, n) {
170
+ const r = p(e, t, n);
153
171
  return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
154
172
  }
155
- function H(e, t, n) {
173
+ function A(e, t, n) {
156
174
  return e === void 0 || t === void 0 ? { from: e, to: t, swapped: !1 } : n(e, t) <= 0 ? { from: e, to: t, swapped: !1 } : { from: t, to: e, swapped: !0 };
157
175
  }
158
- function L(e, t) {
176
+ function W(e, t) {
159
177
  return e.year * 12 + e.month - (t.year * 12 + t.month);
160
178
  }
161
- function z(e, t) {
179
+ function Y(e, t) {
162
180
  return e.getTime() - t.getTime();
163
181
  }
164
- function W(e) {
182
+ function j(e) {
165
183
  if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
166
184
  return;
167
185
  const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
@@ -176,25 +194,28 @@ function W(e) {
176
194
  ));
177
195
  }
178
196
  export {
179
- z as compareDates,
180
- L as compareMonthSelection,
181
- S as createRangePickerOpenChangeHandler,
182
- N as deferRangeInputBlur,
183
- W as flashRangeReorder,
184
- b as handlePickerSurfacePointerDown,
185
- V as handleReadonlyPickerKeyDown,
186
- T as isDateInputInvalid,
187
- O as isEventOnPickerSurface,
188
- m as isFocusInsidePicker,
189
- I as maskDateInput,
190
- H as normalizeOrderedRange,
191
- f as parseDateInput,
192
- F as preventOutsideDismissWhenFooter,
193
- P as resolveDateInputOnBlur,
194
- x as resolveDateInputOnEnter,
195
- X as resolveRangeFieldBlur,
196
- q as resolveRangePickerDismissFlash,
197
- B as resolveSingleValueDismissFlash,
198
- M as usePickerDismissActionsRef,
199
- K as usePickerFooterDismissNudge
197
+ Y as compareDates,
198
+ W as compareMonthSelection,
199
+ N as createRangePickerOpenChangeHandler,
200
+ H as deferRangeInputBlur,
201
+ j as flashRangeReorder,
202
+ w as handlePickerEscapeKeyDown,
203
+ K as handlePickerSurfacePointerDown,
204
+ q as handleReadonlyPickerKeyDown,
205
+ B as isDateInputInvalid,
206
+ P as isEventOnNestedPickerOverlay,
207
+ R as isEventOnPickerSurface,
208
+ g as isFocusInsidePicker,
209
+ h as isNestedPickerOverlayOpen,
210
+ b as maskDateInput,
211
+ A as normalizeOrderedRange,
212
+ p as parseDateInput,
213
+ C as preventOutsideDismissWhenFooter,
214
+ F as resolveDateInputOnBlur,
215
+ z as resolveDateInputOnEnter,
216
+ _ as resolveRangeFieldBlur,
217
+ L as resolveRangePickerDismissFlash,
218
+ M as resolveSingleValueDismissFlash,
219
+ X as usePickerDismissActionsRef,
220
+ x as usePickerFooterDismissNudge
200
221
  };
@@ -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 he, CalendarMonth as De } from "impact-nova-icons";
3
+ import { Cross as De, CalendarMonth as ge } from "impact-nova-icons";
4
4
  import { format as b } from "date-fns";
5
- import { cn as ge } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as ye, usePickerFooterDismissNudge as ke, isDateInputInvalid as ve, resolveSingleValueDismissFlash as Ie, handlePickerSurfacePointerDown as Ce, maskDateInput as Pe, parseDateInput as Me, resolveDateInputOnBlur as xe, resolveDateInputOnEnter as Re } from "./date-input-behavior.js";
7
- import { Input as Se } from "../input/input.js";
8
- import { Calendar as be } from "../../data-display/calendar/calendar.js";
9
- import { Tooltip as j, TooltipTrigger as B, TooltipContent as K } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as we } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { getDateFnsLocale as Te } from "../../../i18n/getDateFnsLocale.js";
12
- import { createComponent as Ee } from "../../../lib/primitives/create-component.js";
13
- import { coerceSingleDateApply as Ae, coerceSingleDate as Ne } from "./calendar-selection-adapters.js";
14
- import { buildDateBoundsMatcher as Le } from "../../../lib/date-bounds-matcher.js";
15
- import { fiscalCalendarPassThrough as Oe } from "./fiscal-pass-through.js";
16
- import { DatePickerShell as Ve } from "./date-picker-shell.js";
17
- const $e = Ee(
5
+ import { cn as ye } from "../../../lib/utils.js";
6
+ import { usePickerDismissActionsRef as ke, usePickerFooterDismissNudge as ve, isDateInputInvalid as Ce, resolveSingleValueDismissFlash as Ie, handlePickerEscapeKeyDown as Pe, handlePickerSurfacePointerDown as Me, maskDateInput as xe, parseDateInput as Re, resolveDateInputOnBlur as Se, resolveDateInputOnEnter as be } from "./date-input-behavior.js";
7
+ import { Input as we } from "../input/input.js";
8
+ import { Calendar as Te } from "../../data-display/calendar/calendar.js";
9
+ 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(
18
18
  "DatePicker",
19
19
  ({
20
20
  value: n,
@@ -36,13 +36,14 @@ const $e = Ee(
36
36
  fiscalYearStartMonth: Z,
37
37
  fiscalConfig: _,
38
38
  showPresets: $,
39
- comparison: F,
40
- onComparisonChange: ee,
41
- ...te
42
- }, ne) => {
43
- const { locale: T, t: h } = we(), f = r.useMemo(() => Te(T), [T]), re = z ?? h("datePicker.selectDate"), g = r.useRef(null), E = r.useRef(null), C = r.useRef(null);
44
- r.useImperativeHandle(ne, () => g.current);
45
- const [i, A] = r.useState(!1), N = ye(), { footerFlashKey: ie, footerFlashTarget: oe, popoverHandlers: se } = ke(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, ce = x?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), u = r.useCallback(() => {
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(() => {
46
47
  o(null), A(!1);
47
48
  }, []), m = (e) => {
48
49
  if (!c) {
@@ -58,15 +59,15 @@ const $e = Ee(
58
59
  }
59
60
  };
60
61
  r.useEffect(() => {
61
- g.current && C.current !== null && (g.current.setSelectionRange(C.current, C.current), C.current = null);
62
+ g.current && I.current !== null && (g.current.setSelectionRange(I.current, I.current), I.current = null);
62
63
  }, [d]);
63
- const le = (e) => {
64
- const t = Ne(e), D = t ? b(t, l, { locale: f }) : "";
64
+ const ae = (e) => {
65
+ const t = Oe(e), D = t ? b(t, l, { locale: f }) : "";
65
66
  o(
66
67
  (v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
67
68
  ), t && !a && (p?.(t), u());
68
69
  }, L = (e) => {
69
- const t = Ae(e, P);
70
+ const t = Le(e, P);
70
71
  p?.(t), u();
71
72
  }, R = () => {
72
73
  u();
@@ -81,27 +82,27 @@ const $e = Ee(
81
82
  viewMonth: n ?? /* @__PURE__ */ new Date()
82
83
  }),
83
84
  [k, n]
84
- ), ae = (e) => {
85
- const t = Pe(e.target.value, l, d);
86
- if (o((I) => ({ ...I ?? M(), input: t })), t === "") {
87
- o((I) => ({ ...I ?? M(), input: "", pending: void 0 })), a || p?.(void 0);
85
+ ), ue = (e) => {
86
+ const t = xe(e.target.value, l, d);
87
+ if (o((C) => ({ ...C ?? M(), input: t })), t === "") {
88
+ o((C) => ({ ...C ?? M(), input: "", pending: void 0 })), a || p?.(void 0);
88
89
  return;
89
90
  }
90
- const { parsed: D, isValid: v } = Me(t, l, f);
91
- v && D && (o((I) => ({
92
- ...I ?? M(),
91
+ const { parsed: D, isValid: v } = Re(t, l, f);
92
+ v && D && (o((C) => ({
93
+ ...C ?? M(),
93
94
  input: t,
94
95
  pending: D,
95
96
  viewMonth: D
96
97
  })), a || p?.(D));
97
- }, ue = r.useCallback(
98
+ }, pe = r.useCallback(
98
99
  (e) => {
99
100
  p?.(e), u();
100
101
  },
101
102
  [p, u]
102
- ), pe = () => {
103
+ ), fe = () => {
103
104
  if (i) return;
104
- const e = xe(
105
+ const e = Se(
105
106
  d,
106
107
  l,
107
108
  k,
@@ -121,18 +122,18 @@ const $e = Ee(
121
122
  return;
122
123
  }
123
124
  o(null);
124
- }, fe = () => {
125
+ }, de = () => {
125
126
  if (i && a) {
126
127
  L();
127
128
  return;
128
129
  }
129
- const e = Re(d, l, f);
130
+ const e = be(d, l, f);
130
131
  if (e.parsed) {
131
- a && ue(e.parsed);
132
+ a && pe(e.parsed);
132
133
  return;
133
134
  }
134
135
  i || (y.current = !0, m(!0));
135
- }, V = (n ? b(n, l, { locale: f }) : "") !== d, de = ve(d, l, f), me = r.useCallback(
136
+ }, V = (n ? b(n, l, { locale: f }) : "") !== d, me = Ce(d, l, f), he = r.useCallback(
136
137
  () => Ie(
137
138
  P,
138
139
  n,
@@ -143,10 +144,10 @@ const $e = Ee(
143
144
  return r.useLayoutEffect(() => {
144
145
  N.current = {
145
146
  onDismiss: R,
146
- resolveFlash: me
147
+ resolveFlash: he
147
148
  };
148
149
  }), /* @__PURE__ */ s(
149
- Ve,
150
+ je,
150
151
  {
151
152
  open: i,
152
153
  disabled: c,
@@ -155,7 +156,7 @@ const $e = Ee(
155
156
  onOpenAutoFocus: (e) => {
156
157
  y.current || e.preventDefault(), y.current = !1;
157
158
  },
158
- popoverHandlers: se,
159
+ popoverHandlers: ce,
159
160
  trigger: /* @__PURE__ */ s(
160
161
  "div",
161
162
  {
@@ -163,34 +164,34 @@ const $e = Ee(
163
164
  "data-component": "date-picker",
164
165
  "data-state": i ? "open" : "closed",
165
166
  "data-pending": V || void 0,
166
- onPointerDown: (e) => Ce({
167
+ onPointerDown: (e) => Me({
167
168
  disabled: c,
168
169
  event: e,
169
170
  onOpen: () => m(!0),
170
171
  focusField: () => g.current?.focus()
171
172
  }),
172
173
  children: /* @__PURE__ */ s(
173
- Se,
174
+ we,
174
175
  {
175
176
  ref: g,
176
177
  value: d,
177
- onChange: ae,
178
- onBlur: pe,
178
+ onChange: ue,
179
+ onBlur: fe,
179
180
  onClick: () => !c && m(!0),
180
181
  onKeyDown: (e) => {
181
- e.key === "Enter" && !c && (e.preventDefault(), fe()), e.key === "ArrowDown" && !i && !c && (e.preventDefault(), y.current = !0, m(!0)), e.key === "Escape" && i && (e.preventDefault(), R());
182
+ e.key === "Enter" && !c && (e.preventDefault(), de()), e.key === "ArrowDown" && !i && !c && (e.preventDefault(), y.current = !0, m(!0)), e.key === "Escape" && i && Pe(e, { open: i, onCancel: R });
182
183
  },
183
- placeholder: i ? l : re,
184
+ placeholder: i ? l : ie,
184
185
  disabled: c,
185
186
  "data-form-control": "input",
186
- className: ge(
187
+ className: ye(
187
188
  "cursor-pointer",
188
- de ? "text-destructive" : V ? "text-content-placeholder" : "",
189
+ me ? "text-destructive" : V ? "text-content-placeholder" : "",
189
190
  Q
190
191
  ),
191
192
  suffix: /* @__PURE__ */ S("div", { className: "flex items-center gap-1", children: [
192
- n && !c && /* @__PURE__ */ S(j, { children: [
193
- /* @__PURE__ */ s(B, { asChild: !0, children: /* @__PURE__ */ s(
193
+ n && !c && /* @__PURE__ */ S(K, { children: [
194
+ /* @__PURE__ */ s(j, { asChild: !0, children: /* @__PURE__ */ s(
194
195
  "button",
195
196
  {
196
197
  type: "button",
@@ -200,38 +201,38 @@ const $e = Ee(
200
201
  e.stopPropagation(), O();
201
202
  },
202
203
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
203
- children: /* @__PURE__ */ s(he, { className: "size-3 hover:text-content" })
204
+ children: /* @__PURE__ */ s(De, { className: "size-3 hover:text-content" })
204
205
  }
205
206
  ) }),
206
- /* @__PURE__ */ s(K, { variant: "tertiary", side: "top", children: h("calendar.clear") })
207
+ /* @__PURE__ */ s(B, { variant: "tertiary", side: "top", children: h("calendar.clear") })
207
208
  ] }),
208
- /* @__PURE__ */ S(j, { children: [
209
- /* @__PURE__ */ s(B, { asChild: !0, children: /* @__PURE__ */ s("button", { type: "button", tabIndex: 0, "aria-label": h("datePicker.selectDate"), onClick: (e) => {
209
+ /* @__PURE__ */ S(K, { children: [
210
+ /* @__PURE__ */ s(j, { asChild: !0, children: /* @__PURE__ */ s("button", { type: "button", tabIndex: 0, "aria-label": h("datePicker.selectDate"), onClick: (e) => {
210
211
  e.stopPropagation(), c || (i ? u() : m(!0));
211
212
  }, onKeyDown: (e) => {
212
213
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (y.current = !0, i ? u() : m(!0)));
213
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ s(De, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
214
- /* @__PURE__ */ s(K, { variant: "tertiary", side: "top", children: h("datePicker.selectDate") })
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
+ /* @__PURE__ */ s(B, { variant: "tertiary", side: "top", children: h("datePicker.selectDate") })
215
216
  ] })
216
217
  ] }),
217
- ...te
218
+ ...ne
218
219
  }
219
220
  )
220
221
  }
221
222
  ),
222
223
  children: /* @__PURE__ */ s(
223
- be,
224
+ Te,
224
225
  {
225
226
  mode: "single",
226
227
  selected: P,
227
- footerFlashKey: ie,
228
- footerFlashTarget: oe,
229
- onSelect: le,
230
- month: ce,
228
+ footerFlashKey: oe,
229
+ footerFlashTarget: se,
230
+ onSelect: ae,
231
+ month: le,
231
232
  onMonthChange: (e) => o(
232
233
  (t) => t ? { ...t, viewMonth: e } : null
233
234
  ),
234
- disabled: Le(H, q),
235
+ disabled: Ve(H, q),
235
236
  startMonth: G,
236
237
  endMonth: J,
237
238
  showFooter: a,
@@ -240,7 +241,7 @@ const $e = Ee(
240
241
  onClear: O,
241
242
  captionLayout: "dropdown",
242
243
  ...w !== void 0 ? { weekStartsOn: w } : {},
243
- ...Oe({
244
+ ...Ke({
244
245
  calendarKind: U,
245
246
  fiscalMode: W,
246
247
  granularity: X,
@@ -248,8 +249,9 @@ const $e = Ee(
248
249
  fiscalYearStartMonth: Z,
249
250
  fiscalConfig: _,
250
251
  showPresets: $,
251
- comparison: F,
252
- onComparisonChange: ee
252
+ showPeriodBoundaries: F,
253
+ comparison: ee,
254
+ onComparisonChange: te
253
255
  })
254
256
  }
255
257
  )
@@ -258,5 +260,5 @@ const $e = Ee(
258
260
  }
259
261
  );
260
262
  export {
261
- $e as DatePicker
263
+ et as DatePicker
262
264
  };
@@ -11,6 +11,8 @@ export interface FiscalPickerProps {
11
11
  fiscalConfig?: FiscalCalendarConfig;
12
12
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
13
13
  showPresets?: boolean;
14
+ /** Draw `(` / `)` on fiscal period start/end days. Default false. */
15
+ showPeriodBoundaries?: boolean;
14
16
  comparison?: "prior-fy";
15
17
  onComparisonChange?: (value: YoYComparison | undefined) => void;
16
18
  }