impact-nova 2.5.9 → 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 (73) 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-display/calendar/calendar-apply-validation.d.ts +2 -0
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  7. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  8. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  9. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +6 -1
  10. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
  11. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +5 -2
  12. package/dist/components/data-display/calendar/calendar-day-picker-components.js +210 -167
  13. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
  14. package/dist/components/data-display/calendar/calendar-day-picker-view.js +126 -124
  15. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  16. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  17. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  18. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  19. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -1
  20. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
  21. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
  22. package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
  23. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +3 -1
  24. package/dist/components/data-display/calendar/calendar-week-number-cell.js +68 -53
  25. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
  26. package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
  27. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
  28. package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
  29. package/dist/components/data-display/calendar/calendar.js +170 -165
  30. package/dist/components/data-display/calendar/calendar.types.d.ts +7 -0
  31. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +5 -2
  32. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +86 -76
  33. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  34. package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
  35. package/dist/components/feedback/dialog/dialog.js +12 -12
  36. package/dist/components/feedback/sheet/sheet.js +22 -22
  37. package/dist/components/forms/date-picker/calendar-selection-adapters.d.ts +2 -0
  38. package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
  39. package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
  40. package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
  41. package/dist/components/forms/date-picker/date-picker.js +74 -70
  42. package/dist/components/forms/date-picker/date-picker.types.d.ts +7 -0
  43. package/dist/components/forms/date-picker/date-range-picker.js +148 -144
  44. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +2 -0
  45. package/dist/components/forms/date-picker/fiscal-pass-through.js +4 -2
  46. package/dist/components/forms/date-picker/month-picker.js +84 -80
  47. package/dist/components/forms/date-picker/month-range-picker.js +147 -143
  48. package/dist/components/forms/date-picker/multi-date-picker.js +53 -49
  49. package/dist/components/forms/date-picker/multi-month-picker.js +51 -47
  50. package/dist/components/forms/date-picker/multi-quarter-picker.js +48 -44
  51. package/dist/components/forms/date-picker/multi-week-picker.js +55 -51
  52. package/dist/components/forms/date-picker/multi-year-picker.js +50 -46
  53. package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
  54. package/dist/components/forms/date-picker/quarter-picker.js +48 -44
  55. package/dist/components/forms/date-picker/quarter-range-picker.js +47 -43
  56. package/dist/components/forms/date-picker/week-picker.js +86 -82
  57. package/dist/components/forms/date-picker/week-range-picker.js +171 -164
  58. package/dist/components/forms/date-picker/year-picker.js +49 -45
  59. package/dist/components/forms/date-picker/year-range-picker.js +49 -45
  60. package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
  61. package/dist/components/forms/select/select.js +1 -0
  62. package/dist/form-react/Fields/DateInputField.js +51 -50
  63. package/dist/form-react/Fields/DateRangeField.js +14 -13
  64. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  65. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  66. package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
  67. package/dist/form-react/Fields/WeekRangePicker.js +48 -48
  68. package/dist/form-react/types/fields.types.d.ts +14 -0
  69. package/dist/impact-nova.css +1 -1
  70. package/dist/lib/overlay/overlay-portal-context.js +16 -16
  71. package/dist/llms/rules/installation.js +1 -1
  72. package/dist/llms/rules/requirements.js +1 -1
  73. package/package.json +1 -1
@@ -6,8 +6,8 @@ import { createCompoundPart as y, wrapRadixPart as c } from "../../../lib/primit
6
6
  import { cn as v } from "../../../lib/utils.js";
7
7
  import { useImpactNovaI18n as h } from "../../../i18n/use-impact-nova-i18n.js";
8
8
  import { Button as w } from "../../primitives/button/button.js";
9
- import { mergeElementRefs as O } from "../../../lib/overlay/merge-element-refs.js";
10
- import { OverlayHostProvider as P, useOverlayHostDismissBeforeClose as x, useOverlayHostNestedDismissing as H } from "../../../lib/overlay/overlay-portal-context.js";
9
+ import { mergeElementRefs as P } from "../../../lib/overlay/merge-element-refs.js";
10
+ import { OverlayHostProvider as O, useOverlayHostDismissBeforeClose as x, useOverlayHostNestedDismissing as H } from "../../../lib/overlay/overlay-portal-context.js";
11
11
  import { OVERLAY_HOST_GROUP_CLASS as R } from "../../../lib/overlay/overlay-host.constants.js";
12
12
  import { useOverlayPortalContainerState as T } from "../../../lib/overlay/use-overlay-portal-container-state.js";
13
13
  const K = (o) => /* @__PURE__ */ t(e.Root, { "data-component": "dialog", ...o }), U = c(
@@ -49,20 +49,20 @@ const C = u.forwardRef(
49
49
  onEscapeKeyDown: m,
50
50
  ...g
51
51
  }, p) => {
52
- const f = H(), l = x();
52
+ const f = H(), d = x();
53
53
  return /* @__PURE__ */ D(
54
54
  e.Content,
55
55
  {
56
- ref: O(p, s),
56
+ ref: P(p, s),
57
57
  "aria-describedby": void 0,
58
58
  "data-component": "dialog-content",
59
59
  "data-overlay-host": "",
60
60
  "data-nested-dismissing": f || void 0,
61
- onOpenAutoFocus: (d) => {
62
- d.preventDefault(), r?.(d);
61
+ onOpenAutoFocus: (l) => {
62
+ l.preventDefault(), r?.(l);
63
63
  },
64
- onEscapeKeyDown: (d) => {
65
- l(), m?.(d);
64
+ onEscapeKeyDown: (l) => {
65
+ m?.(l), !l.defaultPrevented && d();
66
66
  },
67
67
  className: v(
68
68
  "fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-canvas shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg motion-reduce:animate-none motion-reduce:transition-none",
@@ -81,7 +81,7 @@ const C = u.forwardRef(
81
81
  "data-component": "dialog-close",
82
82
  className: "absolute end-4 top-3.5 opacity-50 ring-offset-canvas transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 data-[state=open]:bg-accent data-[state=open]:text-content-icon [&_svg]:!size-3 [&_svg]:block",
83
83
  "aria-label": a,
84
- onPointerDown: () => l(),
84
+ onPointerDown: () => d(),
85
85
  children: /* @__PURE__ */ t(N, {})
86
86
  }
87
87
  ) })
@@ -92,8 +92,8 @@ const C = u.forwardRef(
92
92
  );
93
93
  C.displayName = "DialogHostContent";
94
94
  const B = u.forwardRef(({ className: o, children: a, hideClose: s, onOpenAutoFocus: i, onEscapeKeyDown: n, ...r }, m) => {
95
- const { t: g } = h(), p = g("aria.close"), { portalContainer: f, setPortalContainerElement: l } = T();
96
- return /* @__PURE__ */ t(z, { children: /* @__PURE__ */ D(P, { portalContainer: f, children: [
95
+ const { t: g } = h(), p = g("aria.close"), { portalContainer: f, setPortalContainerElement: d } = T();
96
+ return /* @__PURE__ */ t(z, { children: /* @__PURE__ */ D(O, { portalContainer: f, children: [
97
97
  /* @__PURE__ */ t(b, {}),
98
98
  /* @__PURE__ */ t(
99
99
  C,
@@ -101,7 +101,7 @@ const B = u.forwardRef(({ className: o, children: a, hideClose: s, onOpenAutoFoc
101
101
  ref: m,
102
102
  hideClose: s,
103
103
  closeLabel: p,
104
- setPortalContainerElement: l,
104
+ setPortalContainerElement: d,
105
105
  className: o,
106
106
  onOpenAutoFocus: i,
107
107
  onEscapeKeyDown: n,
@@ -10,7 +10,7 @@ import { mergeElementRefs as E } from "../../../lib/overlay/merge-element-refs.j
10
10
  import { OverlayHostProvider as k, useOverlayHostDismissBeforeClose as x, useOverlayHostNestedDismissing as B } from "../../../lib/overlay/overlay-portal-context.js";
11
11
  import { OVERLAY_HOST_GROUP_CLASS as j } from "../../../lib/overlay/overlay-host.constants.js";
12
12
  import { useOverlayPortalContainerState as z } from "../../../lib/overlay/use-overlay-portal-container-state.js";
13
- import { SheetContext as T } from "./sheet-context.js";
13
+ import { SheetContext as P } from "./sheet-context.js";
14
14
  import { sheetVariants as A } from "./sheet.variants.js";
15
15
  const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t }), te = y(
16
16
  "sheet",
@@ -22,8 +22,8 @@ const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t })
22
22
  "close",
23
23
  "SheetClose",
24
24
  a.Close
25
- ), I = a.Portal, P = p.forwardRef(({ className: t, onPointerDown: i, ...l }, n) => {
26
- const o = x();
25
+ ), I = a.Portal, T = p.forwardRef(({ className: t, onPointerDown: i, ...l }, n) => {
26
+ const s = x();
27
27
  return /* @__PURE__ */ e(
28
28
  a.Overlay,
29
29
  {
@@ -32,21 +32,21 @@ const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t })
32
32
  t
33
33
  ),
34
34
  onPointerDown: (c) => {
35
- o(), i?.(c);
35
+ s(), i?.(c);
36
36
  },
37
37
  ...l,
38
38
  ref: n
39
39
  }
40
40
  );
41
41
  });
42
- P.displayName = a.Overlay.displayName;
42
+ T.displayName = a.Overlay.displayName;
43
43
  const D = p.forwardRef(
44
44
  ({
45
45
  side: t,
46
46
  isExpanded: i,
47
47
  setPortalContainerElement: l,
48
48
  className: n,
49
- children: o,
49
+ children: s,
50
50
  onOpenAutoFocus: c,
51
51
  onEscapeKeyDown: h,
52
52
  ...f
@@ -59,11 +59,11 @@ const D = p.forwardRef(
59
59
  "data-component": "sheet-content",
60
60
  "data-overlay-host": "",
61
61
  "data-nested-dismissing": r || void 0,
62
- onOpenAutoFocus: (s) => {
63
- s.preventDefault(), c?.(s);
62
+ onOpenAutoFocus: (o) => {
63
+ o.preventDefault(), c?.(o);
64
64
  },
65
- onEscapeKeyDown: (s) => {
66
- d(), h?.(s);
65
+ onEscapeKeyDown: (o) => {
66
+ h?.(o), !o.defaultPrevented && d();
67
67
  },
68
68
  className: g(
69
69
  A({ side: t }),
@@ -73,7 +73,7 @@ const D = p.forwardRef(
73
73
  n
74
74
  ),
75
75
  ...f,
76
- children: o
76
+ children: s
77
77
  }
78
78
  );
79
79
  }
@@ -85,16 +85,16 @@ const _ = p.forwardRef(
85
85
  className: i,
86
86
  children: l,
87
87
  expandable: n = !1,
88
- defaultExpanded: o = !1,
88
+ defaultExpanded: s = !1,
89
89
  onOpenAutoFocus: c,
90
90
  onEscapeKeyDown: h,
91
91
  ...f
92
92
  }, u) => {
93
- const [r, d] = p.useState(o), { portalContainer: s, setPortalContainerElement: H } = z(), O = p.useCallback(() => {
93
+ const [r, d] = p.useState(s), { portalContainer: o, setPortalContainerElement: H } = z(), O = p.useCallback(() => {
94
94
  d((w) => !w);
95
95
  }, []);
96
96
  return /* @__PURE__ */ e(
97
- T.Provider,
97
+ P.Provider,
98
98
  {
99
99
  value: {
100
100
  isExpanded: r,
@@ -102,8 +102,8 @@ const _ = p.forwardRef(
102
102
  expandable: n,
103
103
  side: t || void 0
104
104
  },
105
- children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ m(k, { portalContainer: s, children: [
106
- /* @__PURE__ */ e(P, {}),
105
+ children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ m(k, { portalContainer: o, children: [
106
+ /* @__PURE__ */ e(T, {}),
107
107
  /* @__PURE__ */ e(
108
108
  D,
109
109
  {
@@ -129,7 +129,7 @@ const V = ({
129
129
  children: i,
130
130
  ...l
131
131
  }) => {
132
- const { t: n } = R(), { isExpanded: o, onExpandToggle: c, expandable: h, side: f } = p.useContext(T), u = x(), r = n("aria.close"), d = n("nestedList.expand"), s = n("nestedList.collapse");
132
+ const { t: n } = R(), { isExpanded: s, onExpandToggle: c, expandable: h, side: f } = p.useContext(P), u = x(), r = n("aria.close"), d = n("nestedList.expand"), o = n("nestedList.collapse");
133
133
  return /* @__PURE__ */ m(
134
134
  "div",
135
135
  {
@@ -150,14 +150,14 @@ const V = ({
150
150
  "data-component": "sheet-expand-toggle",
151
151
  onClick: c,
152
152
  className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none",
153
- "aria-label": o ? s : d,
153
+ "aria-label": s ? o : d,
154
154
  children: [
155
- o ? /* @__PURE__ */ e(v, { size: 19, className: " -rotate-90" }) : /* @__PURE__ */ e(v, { size: 19, className: "rotate-90" }),
156
- /* @__PURE__ */ e("span", { className: "sr-only", children: o ? s : d })
155
+ s ? /* @__PURE__ */ e(v, { size: 19, className: " -rotate-90" }) : /* @__PURE__ */ e(v, { size: 19, className: "rotate-90" }),
156
+ /* @__PURE__ */ e("span", { className: "sr-only", children: s ? o : d })
157
157
  ]
158
158
  }
159
159
  ) }),
160
- /* @__PURE__ */ e(C, { variant: "tertiary", side: "top", children: o ? s : d })
160
+ /* @__PURE__ */ e(C, { variant: "tertiary", side: "top", children: s ? o : d })
161
161
  ] }),
162
162
  /* @__PURE__ */ m(N, { children: [
163
163
  /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ m(
@@ -211,7 +211,7 @@ export {
211
211
  ne as SheetDescription,
212
212
  se as SheetFooter,
213
213
  V as SheetHeader,
214
- P as SheetOverlay,
214
+ T as SheetOverlay,
215
215
  I as SheetPortal,
216
216
  ae as SheetTitle,
217
217
  te as SheetTrigger
@@ -16,6 +16,8 @@ export declare function coerceMonthRangeApply(value: CalendarApplyValue | undefi
16
16
  export declare function coerceSingleWeek(value: WeekSelectValue): WeekSelection | undefined;
17
17
  export declare function coerceWeekArray(value: WeekSelectValue): WeekSelection[] | undefined;
18
18
  export declare function coerceWeekRangeApply(value: CalendarApplyValue | undefined, fallback?: WeekRange): WeekRange | undefined;
19
+ /** Range-mode first click is `{ from }` only. A single week is a valid range. */
20
+ export declare function completeWeekRange(range?: WeekRange): WeekRange | undefined;
19
21
  export declare function coerceDateArray(value: DateSelectValue): Date[] | undefined;
20
22
  export declare function coerceDateArrayApply(value: CalendarApplyValue | undefined, fallback?: Date[]): Date[] | undefined;
21
23
  export declare function coerceMonthArrayApply(value: CalendarApplyValue | undefined, fallback?: MonthSelection[]): MonthSelection[] | undefined;
@@ -11,16 +11,16 @@ function o(r) {
11
11
  const n = r.from;
12
12
  return n === void 0 || n instanceof Date;
13
13
  }
14
- function f(r) {
14
+ function c(r) {
15
15
  return r instanceof Date ? r : void 0;
16
16
  }
17
- function c(r) {
17
+ function y(r) {
18
18
  return o(r) ? r : void 0;
19
19
  }
20
- function y(r, n) {
20
+ function A(r, n) {
21
21
  return r instanceof Date ? r : n;
22
22
  }
23
- function A(r, n) {
23
+ function s(r, n) {
24
24
  if (r == null || Array.isArray(r) || r instanceof Date || "weekOfMonth" in r || "year" in r && "month" in r && !("from" in r)) return n;
25
25
  if ("from" in r || "to" in r) {
26
26
  const t = r.from;
@@ -28,61 +28,66 @@ function A(r, n) {
28
28
  }
29
29
  return n;
30
30
  }
31
- function s(r) {
31
+ function p(r) {
32
32
  if (!(r == null || Array.isArray(r) || e(r)))
33
33
  return r;
34
34
  }
35
- function p(r) {
35
+ function h(r) {
36
36
  return Array.isArray(r) ? r : void 0;
37
37
  }
38
- function h(r, n) {
38
+ function D(r, n) {
39
39
  return e(r) ? r : n;
40
40
  }
41
- function D(r) {
41
+ function m(r) {
42
42
  if (!(r == null || Array.isArray(r) || i(r)))
43
43
  return r;
44
44
  }
45
45
  function M(r) {
46
46
  return Array.isArray(r) ? r : void 0;
47
47
  }
48
- function g(r, n) {
49
- return i(r) ? r : n;
48
+ function u(r, n) {
49
+ return f(i(r) ? r : n);
50
50
  }
51
- function m(r) {
51
+ function f(r) {
52
+ if (r?.from)
53
+ return { from: r.from, to: r.to ?? r.from };
54
+ }
55
+ function g(r) {
52
56
  return Array.isArray(r) ? r : void 0;
53
57
  }
54
- function u(r, n) {
58
+ function d(r, n) {
55
59
  return Array.isArray(r) && r.every((t) => t instanceof Date) ? r : n;
56
60
  }
57
- function d(r, n) {
61
+ function S(r, n) {
58
62
  return !Array.isArray(r) || !r.every((t) => typeof t == "object" && t !== null && "year" in t && "month" in t && !("weekOfMonth" in t)) ? n : r;
59
63
  }
60
- function S(r, n) {
64
+ function w(r, n) {
61
65
  return Array.isArray(r) && r.every((t) => "weekOfMonth" in t) ? r : n;
62
66
  }
63
- function w(r, n) {
67
+ function O(r, n) {
64
68
  return r == null || Array.isArray(r) || r instanceof Date || e(r) || "weekOfMonth" in r ? n : "year" in r && "month" in r ? r : n;
65
69
  }
66
- function O(r, n) {
70
+ function R(r, n) {
67
71
  return r == null || Array.isArray(r) || r instanceof Date || i(r) ? n : "weekOfMonth" in r ? r : n;
68
72
  }
69
73
  export {
70
- m as coerceDateArray,
71
- u as coerceDateArrayApply,
72
- c as coerceDateRange,
73
- A as coerceDateRangeApply,
74
- p as coerceMonthArray,
75
- d as coerceMonthArrayApply,
76
- h as coerceMonthRangeApply,
77
- f as coerceSingleDate,
78
- y as coerceSingleDateApply,
79
- s as coerceSingleMonth,
80
- w as coerceSingleMonthApply,
81
- D as coerceSingleWeek,
82
- O as coerceSingleWeekApply,
74
+ g as coerceDateArray,
75
+ d as coerceDateArrayApply,
76
+ y as coerceDateRange,
77
+ s as coerceDateRangeApply,
78
+ h as coerceMonthArray,
79
+ S as coerceMonthArrayApply,
80
+ D as coerceMonthRangeApply,
81
+ c as coerceSingleDate,
82
+ A as coerceSingleDateApply,
83
+ p as coerceSingleMonth,
84
+ O as coerceSingleMonthApply,
85
+ m as coerceSingleWeek,
86
+ R as coerceSingleWeekApply,
83
87
  M as coerceWeekArray,
84
- S as coerceWeekArrayApply,
85
- g as coerceWeekRangeApply,
88
+ w as coerceWeekArrayApply,
89
+ u as coerceWeekRangeApply,
90
+ f as completeWeekRange,
86
91
  o as isDateRangeSelection,
87
92
  e as isMonthRangeSelection,
88
93
  i as isWeekRangeSelection
@@ -25,6 +25,8 @@ export declare function createRangePickerOpenChangeHandler(options: {
25
25
  popoverContentRef: RefObject<HTMLElement | null>;
26
26
  setOpen: (open: boolean) => void;
27
27
  }): (newOpen: boolean) => void;
28
+ export declare function isNestedPickerOverlayOpen(): boolean;
29
+ export declare function isEventOnNestedPickerOverlay(event: Event): boolean;
28
30
  /** True when the outside-dismiss event originated on the picker field chrome (not a real outside click). */
29
31
  export declare function isEventOnPickerSurface(event: Event, surfaceRef: RefObject<HTMLElement | null>): boolean;
30
32
  export type PickerSurfaceField = "start" | "end";
@@ -41,6 +43,14 @@ export declare function handleReadonlyPickerKeyDown(event: React.KeyboardEvent,
41
43
  onCancel: () => void;
42
44
  onKeyboardOpen?: () => void;
43
45
  }): void;
46
+ /** Close the picker on Escape unless a nested caption overlay is handling it. */
47
+ export declare function handlePickerEscapeKeyDown(event: {
48
+ key: string;
49
+ preventDefault: () => void;
50
+ }, options: {
51
+ open: boolean;
52
+ onCancel: () => void;
53
+ }): void;
44
54
  /** Opens the picker when clicking dead zones on the field shell (padding, gaps, icon gutter). */
45
55
  export declare function handlePickerSurfacePointerDown({ disabled, event, onOpen, focusField, }: PickerSurfacePointerDownOptions): void;
46
56
  /** Block Radix outside-dismiss when the calendar footer requires explicit Apply/Cancel. */
@@ -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
  };