impact-nova 2.2.1 → 2.2.3

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 (68) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid-header-dom.d.ts +8 -0
  2. package/dist/components/data/ag-grid-react/ag-grid-header-dom.js +11 -0
  3. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +4 -1
  4. package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +14 -3
  5. package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.d.ts +19 -0
  6. package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.js +74 -0
  7. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.d.ts +4 -5
  8. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +110 -144
  9. package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +2 -1
  10. package/dist/components/data/ag-grid-react/headers/components/header-info.js +73 -70
  11. package/dist/components/data/ag-grid-react/headers/context/grid-header-context.d.ts +0 -8
  12. package/dist/components/data/ag-grid-react/headers/custom-header.js +112 -118
  13. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +27 -23
  14. package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.d.ts +10 -0
  15. package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.js +19 -0
  16. package/dist/components/data/ag-grid-react/index.js +169 -210
  17. package/dist/components/data/ag-grid-react/info-system-story-columns.d.ts +12 -0
  18. package/dist/components/data/ag-grid-react/merge-column-group-defs.d.ts +3 -0
  19. package/dist/components/data/ag-grid-react/merge-column-group-defs.js +27 -0
  20. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +2 -1
  21. package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +7 -7
  22. package/dist/components/data/data-table/data-table-view-menu.d.ts +1 -0
  23. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +6 -7
  24. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
  25. package/dist/components/data-display/calendar/calendar-day-picker-view.js +70 -68
  26. package/dist/components/data-display/calendar/calendar-week-number-cell.js +29 -29
  27. package/dist/components/data-display/calendar/calendar.js +96 -94
  28. package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
  29. package/dist/components/feedback/dialog/dialog.js +107 -61
  30. package/dist/components/feedback/dropdown-menu/dropdown-menu.d.ts +1 -0
  31. package/dist/components/feedback/dropdown-menu/dropdown-menu.js +83 -76
  32. package/dist/components/feedback/popover/popover.d.ts +5 -2
  33. package/dist/components/feedback/popover/popover.js +43 -40
  34. package/dist/components/feedback/sheet/sheet.js +149 -102
  35. package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
  36. package/dist/components/flows/filter-panel/filter-panel.js +79 -76
  37. package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -4
  38. package/dist/components/forms/date-picker/date-input-behavior.js +86 -67
  39. package/dist/components/forms/date-picker/date-picker.js +59 -52
  40. package/dist/components/forms/date-picker/date-range-picker.js +26 -25
  41. package/dist/components/forms/date-picker/month-picker.js +76 -69
  42. package/dist/components/forms/date-picker/month-range-picker.js +41 -40
  43. package/dist/components/forms/date-picker/multi-date-picker.js +31 -31
  44. package/dist/components/forms/date-picker/multi-month-picker.js +27 -27
  45. package/dist/components/forms/date-picker/multi-week-picker.js +37 -37
  46. package/dist/components/forms/date-picker/week-picker.js +85 -78
  47. package/dist/components/forms/date-picker/week-range-picker.js +67 -66
  48. package/dist/components/forms/select/components/SelectMenuPanel.js +19 -15
  49. package/dist/components/forms/select/components/SelectOptionRow.js +110 -90
  50. package/dist/components/forms/select/components/Submenu.js +39 -34
  51. package/dist/components/forms/select/hooks/useSelectOpenEffects.js +65 -70
  52. package/dist/components/forms/select/select.js +228 -223
  53. package/dist/components/forms/select/select.types.d.ts +8 -0
  54. package/dist/impact-nova-components.css +59 -15
  55. package/dist/impact-nova.css +1 -1
  56. package/dist/lib/overlay/merge-element-refs.d.ts +2 -0
  57. package/dist/lib/overlay/merge-element-refs.js +17 -0
  58. package/dist/lib/overlay/overlay-host.constants.d.ts +4 -0
  59. package/dist/lib/overlay/overlay-host.constants.js +5 -0
  60. package/dist/lib/overlay/overlay-portal-context.d.ts +26 -0
  61. package/dist/lib/overlay/overlay-portal-context.js +65 -0
  62. package/dist/lib/overlay/use-overlay-portal-container-state.d.ts +5 -0
  63. package/dist/lib/overlay/use-overlay-portal-container-state.js +13 -0
  64. package/dist/llms/rules/installation.js +1 -1
  65. package/dist/llms/rules/requirements.js +1 -1
  66. package/package.json +23 -8
  67. package/dist/components/forms/select/components/LabelWithSequence.d.ts +0 -13
  68. package/dist/components/forms/select/components/LabelWithSequence.js +0 -18
@@ -1,26 +1,27 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import b from "react";
3
- import { Sheet as v, SheetContent as g, SheetDescription as N, SheetTitle as y, SheetClose as w } from "../../feedback/sheet/sheet.js";
4
- import { createCompoundPart as k } from "../../../lib/primitives/create-compound.js";
2
+ import v from "react";
3
+ import { Sheet as b, SheetContent as g, SheetDescription as N, SheetTitle as y, SheetClose as w } from "../../feedback/sheet/sheet.js";
4
+ import { createCompoundPart as C } from "../../../lib/primitives/create-compound.js";
5
5
  import { cn as o } from "../../../lib/utils.js";
6
- import { MultiColorFilter as C, Cross as F, InfoBadge as m } from "impact-nova-icons";
6
+ import { MultiColorFilter as k, Cross as F, InfoBadge as x } from "impact-nova-icons";
7
7
  import { Button as P } from "../../primitives/button/button.js";
8
- import { Tooltip as d, TooltipTrigger as h, TooltipContent as f } from "../../feedback/tooltip/tooltip.js";
9
- import { Kbd as I } from "../../primitives/kbd/kbd.js";
8
+ import { Tooltip as c, TooltipTrigger as h, TooltipContent as f } from "../../feedback/tooltip/tooltip.js";
9
+ import { Kbd as j } from "../../primitives/kbd/kbd.js";
10
10
  import { useImpactNovaI18n as u } from "../../../i18n/use-impact-nova-i18n.js";
11
- const j = ({
12
- title: r,
13
- children: l,
14
- className: n
11
+ import { useOverlayHostDismissBeforeClose as I } from "../../../lib/overlay/overlay-portal-context.js";
12
+ const S = ({
13
+ title: i,
14
+ children: n,
15
+ className: l
15
16
  }) => {
16
- const { t: c } = u();
17
+ const { t: d } = u();
17
18
  return /* @__PURE__ */ t(
18
19
  "div",
19
20
  {
20
21
  "data-component": "filter-panel-header",
21
22
  className: o(
22
23
  "flex shrink-0 flex-row items-center justify-between border-b px-4 py-[9px] bg-canvas-elevated",
23
- n
24
+ l
24
25
  ),
25
26
  children: [
26
27
  /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: [
@@ -29,20 +30,20 @@ const j = ({
29
30
  {
30
31
  className: "flex size-8 shrink-0 items-center justify-center rounded-md border border-brand-tint bg-canvas-elevated",
31
32
  "aria-hidden": !0,
32
- children: /* @__PURE__ */ e(C, { className: "size-5 shrink-0" })
33
+ children: /* @__PURE__ */ e(k, { className: "size-5 shrink-0" })
33
34
  }
34
35
  ),
35
- /* @__PURE__ */ e(y, { className: "text-lg font-bold text-content", children: r })
36
+ /* @__PURE__ */ e(y, { className: "text-lg font-bold text-content", children: i })
36
37
  ] }),
37
38
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
38
- l,
39
+ n,
39
40
  /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
40
41
  P,
41
42
  {
42
43
  variant: "secondary",
43
44
  size: "icon",
44
45
  tabIndex: -1,
45
- "aria-label": c("aria.close"),
46
+ "aria-label": d("aria.close"),
46
47
  "data-component": "filter-panel-close",
47
48
  children: /* @__PURE__ */ e(F, { className: "h-3 w-3" })
48
49
  }
@@ -51,72 +52,74 @@ const j = ({
51
52
  ]
52
53
  }
53
54
  );
54
- }, R = ({
55
- open: r,
56
- onOpenChange: l,
57
- title: n = "Filter panel",
58
- children: c,
59
- header: i,
60
- sidebar: a,
61
- className: s,
62
- preventClose: x = !1
63
- }) => /* @__PURE__ */ e(v, { open: r, onOpenChange: l, children: /* @__PURE__ */ t(
55
+ }, W = ({
56
+ open: i,
57
+ onOpenChange: n,
58
+ title: l = "Filter panel",
59
+ children: d,
60
+ header: s,
61
+ sidebar: p,
62
+ className: m,
63
+ preventClose: a = !1
64
+ }) => /* @__PURE__ */ e(b, { open: i, onOpenChange: n, children: /* @__PURE__ */ t(
64
65
  g,
65
66
  {
66
67
  side: "right",
67
68
  className: o(
68
69
  "w-full !max-w-[840px] p-0 sm:!max-w-[840px] gap-0 border-l shadow-xl transition-all duration-300 ease-in-out bg-canvas-elevated",
69
- s
70
+ m
70
71
  ),
71
- onInteractOutside: (p) => {
72
- x && p.preventDefault();
72
+ onInteractOutside: (r) => {
73
+ a && r.preventDefault();
73
74
  },
74
- onEscapeKeyDown: (p) => {
75
- x && p.preventDefault();
75
+ onEscapeKeyDown: (r) => {
76
+ a && r.preventDefault();
76
77
  },
77
78
  children: [
78
79
  /* @__PURE__ */ e(N, { className: "sr-only", children: "Select filters to apply to the current view." }),
79
80
  /* @__PURE__ */ t("div", { className: "flex h-full flex-col bg-canvas-elevated", "data-component": "filter-panel", children: [
80
- i || /* @__PURE__ */ e(j, { title: n }),
81
+ s || /* @__PURE__ */ e(S, { title: l }),
81
82
  /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: [
82
- a,
83
- /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: c })
83
+ p,
84
+ /* @__PURE__ */ e("div", { className: "flex flex-col flex-1 overflow-hidden", children: d })
84
85
  ] })
85
86
  ] })
86
87
  ]
87
88
  }
88
- ) }), W = ({
89
- items: r,
90
- activeTab: l,
91
- onTabChange: n,
92
- className: c
89
+ ) }), _ = ({
90
+ items: i,
91
+ activeTab: n,
92
+ onTabChange: l,
93
+ className: d
93
94
  }) => {
94
- const { t: i } = u();
95
+ const { t: s } = u(), p = I(), m = (a) => {
96
+ a !== n && p(), l(a);
97
+ };
95
98
  return /* @__PURE__ */ e(
96
99
  "div",
97
100
  {
98
101
  "data-component": "filter-panel-sidebar",
99
102
  className: o(
100
103
  "flex w-[200px] shrink-0 flex-col border-r bg-navigation-canvas",
101
- c
104
+ d
102
105
  ),
103
- children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: r.map((a) => {
104
- const s = l === a.id;
105
- return /* @__PURE__ */ t(b.Fragment, { children: [
106
+ children: /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col py-2 gap-1 overflow-y-auto", children: i.map((a) => {
107
+ const r = n === a.id;
108
+ return /* @__PURE__ */ t(v.Fragment, { children: [
106
109
  a.separator && /* @__PURE__ */ e("div", { className: "my-2 h-px bg-stroke-hairline" }),
107
110
  /* @__PURE__ */ t(
108
111
  "button",
109
112
  {
110
113
  type: "button",
111
- autoFocus: s,
112
- onClick: () => n(a.id),
114
+ autoFocus: r,
115
+ onClick: () => m(a.id),
113
116
  "data-component": "filter-panel-sidebar-item",
114
- "data-active": s ? "true" : "false",
117
+ "data-active": r ? "true" : "false",
115
118
  "data-tab": a.id,
116
119
  "data-shortcut-id": a.shortcutId,
117
120
  className: o(
118
121
  "group flex items-center justify-between px-3 py-[6px] mx-2 rounded-lg text-left text-sm font-medium transition-colors",
119
- s ? "bg-canvas-accent text-brand" : "text-content-secondary hover:bg-canvas-accent"
122
+ r ? "bg-canvas-accent text-brand" : "text-content-secondary hover:bg-canvas-accent"
120
123
  ),
121
124
  children: [
122
125
  /* @__PURE__ */ t("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
@@ -125,19 +128,19 @@ const j = ({
125
128
  {
126
129
  className: o(
127
130
  "shrink-0",
128
- s ? "text-brand" : "text-content-secondary"
131
+ r ? "text-brand" : "text-content-secondary"
129
132
  ),
130
133
  children: a.icon
131
134
  }
132
135
  ),
133
136
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 min-w-0", children: [
134
- /* @__PURE__ */ t(d, { children: [
137
+ /* @__PURE__ */ t(c, { children: [
135
138
  /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "truncate font-['Manrope']", children: a.label }) }),
136
139
  /* @__PURE__ */ e(f, { variant: "tertiary", side: "right", children: a.tooltipKeybinding ? /* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
137
140
  a.label,
138
141
  " ",
139
142
  /* @__PURE__ */ e(
140
- I,
143
+ j,
141
144
  {
142
145
  keybinding: a.tooltipKeybinding,
143
146
  size: "sm"
@@ -149,33 +152,33 @@ const j = ({
149
152
  ] })
150
153
  ] }),
151
154
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0 ml-1", children: [
152
- a.count !== void 0 && a.count > 0 && /* @__PURE__ */ t(d, { children: [
155
+ a.count !== void 0 && a.count > 0 && /* @__PURE__ */ t(c, { children: [
153
156
  /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(
154
157
  "span",
155
158
  {
156
159
  className: o(
157
160
  "inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[11px] font-medium tabular-nums leading-none shrink-0",
158
- s ? "bg-canvas-elevated text-brand border border-stroke-subtle" : "bg-brand-tint border border-stroke-subtle"
161
+ r ? "bg-canvas-elevated text-brand border border-stroke-subtle" : "bg-brand-tint border border-stroke-subtle"
159
162
  ),
160
163
  children: a.count
161
164
  }
162
165
  ) }),
163
- /* @__PURE__ */ e(f, { variant: "tertiary", side: "top", children: i(
166
+ /* @__PURE__ */ e(f, { variant: "tertiary", side: "top", children: s(
164
167
  a.countBadgeContext === "savedFiltersTotal" ? "filterPanel.savedFiltersAvailableCount" : "filterPanel.filtersAppliedCount",
165
168
  { count: a.count }
166
169
  ) })
167
170
  ] }),
168
- a.hasError && /* @__PURE__ */ t(d, { children: [
169
- /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(m, { className: "h-5 w-5 shrink-0 text-danger" }) }),
170
- /* @__PURE__ */ e(f, { variant: "tertiary", children: i("filterPanel.tabContainsErrors") })
171
+ a.hasError && /* @__PURE__ */ t(c, { children: [
172
+ /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-danger" }) }),
173
+ /* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.tabContainsErrors") })
171
174
  ] }),
172
- a.hasWarning && /* @__PURE__ */ t(d, { children: [
173
- /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(m, { className: "h-5 w-5 shrink-0 text-warning" }) }),
174
- /* @__PURE__ */ e(f, { variant: "tertiary", children: i("filterPanel.tabHasWarnings") })
175
+ a.hasWarning && /* @__PURE__ */ t(c, { children: [
176
+ /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-warning" }) }),
177
+ /* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.tabHasWarnings") })
175
178
  ] }),
176
- a.hasInfo && /* @__PURE__ */ t(d, { children: [
177
- /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(m, { className: "h-5 w-5 shrink-0 text-content-icon" }) }),
178
- /* @__PURE__ */ e(f, { variant: "tertiary", children: i("filterPanel.additionalInfoAvailable") })
179
+ a.hasInfo && /* @__PURE__ */ t(c, { children: [
180
+ /* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "h-5 w-5 shrink-0 text-content-icon" }) }),
181
+ /* @__PURE__ */ e(f, { variant: "tertiary", children: s("filterPanel.additionalInfoAvailable") })
179
182
  ] })
180
183
  ] })
181
184
  ]
@@ -185,32 +188,32 @@ const j = ({
185
188
  }) })
186
189
  }
187
190
  );
188
- }, _ = k("filter-panel", {
191
+ }, q = C("filter-panel", {
189
192
  part: "body",
190
193
  displayName: "FilterPanelBody",
191
194
  className: "flex flex-1 flex-col overflow-auto bg-canvas-elevated p-4"
192
- }), q = ({
193
- children: r,
194
- className: l,
195
- leftAction: n
195
+ }), L = ({
196
+ children: i,
197
+ className: n,
198
+ leftAction: l
196
199
  }) => /* @__PURE__ */ t(
197
200
  "div",
198
201
  {
199
202
  "data-component": "filter-panel-footer",
200
203
  className: o(
201
204
  "flex items-center justify-between border-t bg-canvas-elevated px-4 py-3 shrink-0",
202
- l
205
+ n
203
206
  ),
204
207
  children: [
205
- /* @__PURE__ */ e("div", { children: n && n }),
206
- /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: r })
208
+ /* @__PURE__ */ e("div", { children: l && l }),
209
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: i })
207
210
  ]
208
211
  }
209
212
  );
210
213
  export {
211
- R as FilterPanel,
212
- _ as FilterPanelBody,
213
- q as FilterPanelFooter,
214
- j as FilterPanelHeader,
215
- W as FilterPanelSidebar
214
+ W as FilterPanel,
215
+ q as FilterPanelBody,
216
+ L as FilterPanelFooter,
217
+ S as FilterPanelHeader,
218
+ _ as FilterPanelSidebar
216
219
  };
@@ -30,13 +30,15 @@ export declare function isEventOnPickerSurface(event: Event, surfaceRef: RefObje
30
30
  /** Block Radix outside-dismiss when the calendar footer requires explicit Apply/Cancel. */
31
31
  export declare function preventOutsideDismissWhenFooter(showFooter: boolean, dismissActionsRef?: RefObject<{
32
32
  onDismiss: () => void;
33
- resolveFlash: () => FooterFlashTarget;
33
+ resolveFlash: () => PickerDismissAction;
34
34
  }>, triggerOutsideFlash?: (target: FooterFlashTarget) => void, surfaceRef?: RefObject<HTMLElement | null>): {
35
35
  onInteractOutside?: (event: Event) => void;
36
36
  onPointerDownOutside?: (event: Event) => void;
37
37
  onEscapeKeyDown?: (event: KeyboardEvent) => void;
38
38
  };
39
39
  export type { FooterFlashTarget } from '../../data-display/calendar/calendar-footer-emphasis';
40
+ export type PickerDismissAction = FooterFlashTarget | "dismiss";
41
+ export declare function resolveSingleValueDismissFlash<T>(pending: T | undefined, committed: T | undefined, isEqual: (left: T, right: T) => boolean): PickerDismissAction;
40
42
  export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
41
43
  startInput: string;
42
44
  endInput: string;
@@ -46,6 +48,10 @@ export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
46
48
  from?: TFrom;
47
49
  to?: TTo;
48
50
  } | undefined;
51
+ pendingRange?: {
52
+ from?: TFrom;
53
+ to?: TTo;
54
+ } | undefined;
49
55
  computeEffectiveRange: () => {
50
56
  from?: TFrom;
51
57
  to?: TTo;
@@ -57,14 +63,14 @@ export declare function resolveRangePickerDismissFlash<TFrom, TTo>(params: {
57
63
  from?: TFrom;
58
64
  to?: TTo;
59
65
  } | undefined) => boolean;
60
- }): FooterFlashTarget;
66
+ }): PickerDismissAction;
61
67
  export declare function usePickerDismissActionsRef(): React.RefObject<{
62
68
  onDismiss: () => void;
63
- resolveFlash: () => FooterFlashTarget;
69
+ resolveFlash: () => PickerDismissAction;
64
70
  }>;
65
71
  export declare function usePickerFooterDismissNudge(showFooter: boolean, open: boolean, dismissActionsRef: React.RefObject<{
66
72
  onDismiss: () => void;
67
- resolveFlash: () => FooterFlashTarget;
73
+ resolveFlash: () => PickerDismissAction;
68
74
  }>, surfaceRef?: RefObject<HTMLElement | null>): {
69
75
  footerFlashKey: number;
70
76
  footerFlashTarget: FooterFlashTarget | undefined;
@@ -1,104 +1,122 @@
1
- import { parse as g, isValid as h } from "date-fns";
2
- import * as u from "react";
3
- import { resolveRangeFooterFlashTarget as D } from "../../data-display/calendar/calendar-footer-emphasis.js";
4
- import { padValidDateString as v, maskDate as y } from "../../../lib/utils.js";
5
- function w(e, t, n) {
6
- return y(e, t, n);
1
+ import { parse as h, isValid as D } from "date-fns";
2
+ import * as d from "react";
3
+ import { resolveRangeFooterFlashTarget as v } from "../../data-display/calendar/calendar-footer-emphasis.js";
4
+ import { padValidDateString as y, maskDate as k } from "../../../lib/utils.js";
5
+ function E(e, t, n) {
6
+ return k(e, t, n);
7
7
  }
8
8
  function f(e, t, n) {
9
- const r = v(e, t), s = g(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), i = h(s) && r.length === t.length;
9
+ const r = y(e, t), s = h(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), a = D(s) && r.length === t.length;
10
10
  return {
11
11
  padded: r,
12
- parsed: i ? s : void 0,
12
+ parsed: a ? s : void 0,
13
13
  isComplete: e.length === t.length,
14
- isValid: i
14
+ isValid: a
15
15
  };
16
16
  }
17
- function C(e, t, n) {
17
+ function T(e, t, n) {
18
18
  return !e || e.length !== t.length ? !1 : !f(e, t, n).isValid;
19
19
  }
20
- function p(e, t) {
20
+ function m(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 T(e) {
24
+ function S(e) {
25
25
  return (t) => {
26
26
  if (!e.disabled) {
27
27
  if (t) {
28
28
  e.setOpen(!0);
29
29
  return;
30
30
  }
31
- e.showFooter || queueMicrotask(() => {
32
- p(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
31
+ if (e.showFooter) {
32
+ e.setOpen(!1);
33
+ return;
34
+ }
35
+ queueMicrotask(() => {
36
+ m(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
33
37
  });
34
38
  }
35
39
  };
36
40
  }
37
- function k(e, t) {
41
+ function O(e, t) {
38
42
  const n = e.target;
39
43
  return n instanceof Node ? !!t.current?.contains(n) : !1;
40
44
  }
41
- function O(e, t, n, r) {
45
+ function F(e, t, n, r) {
42
46
  return e ? {
43
- onInteractOutside: (a) => {
44
- a.preventDefault();
47
+ onInteractOutside: (i) => {
48
+ i.preventDefault();
45
49
  },
46
- onPointerDownOutside: (a) => {
47
- a.preventDefault(), !(r && k(a, r)) && t && n && n(t.current.resolveFlash());
50
+ onPointerDownOutside: (i) => {
51
+ if (i.preventDefault(), !(r && O(i, r)) && t) {
52
+ const o = t.current.resolveFlash();
53
+ if (o === "dismiss") {
54
+ t.current.onDismiss();
55
+ return;
56
+ }
57
+ n?.(o);
58
+ }
48
59
  },
49
- onEscapeKeyDown: t ? (a) => {
50
- a.preventDefault(), t.current.onDismiss();
60
+ onEscapeKeyDown: t ? (i) => {
61
+ i.preventDefault(), t.current.onDismiss();
51
62
  } : void 0
52
63
  } : {};
53
64
  }
54
- function E(e) {
65
+ function V(e, t, n) {
66
+ const r = e == null, s = t == null;
67
+ return r && s || !r && !s && n(e, t) ? "dismiss" : r ? "cancel" : "apply";
68
+ }
69
+ function B(e) {
55
70
  const {
56
71
  startInput: t,
57
72
  endInput: n,
58
73
  committedStart: r,
59
74
  committedEnd: s,
60
- committedRange: i,
61
- computeEffectiveRange: a,
75
+ committedRange: a,
76
+ pendingRange: i,
77
+ computeEffectiveRange: u,
62
78
  rangesEqual: o
63
- } = e, c = a(), d = D(c), l = t !== r || n !== s, m = !o(c, i);
64
- return d === "apply" && (l || m) ? "apply" : "cancel";
79
+ } = e, c = t !== r || n !== s, l = u(), p = !c && i !== void 0 ? i : l, g = !o(p, a);
80
+ return !c && !g ? "dismiss" : v(
81
+ c ? l : p
82
+ ) === "apply" ? "apply" : "cancel";
65
83
  }
66
- function S() {
67
- return u.useRef({
84
+ function q() {
85
+ return d.useRef({
68
86
  onDismiss: () => {
69
87
  },
70
88
  resolveFlash: () => "cancel"
71
89
  });
72
90
  }
73
- function V(e, t, n, r) {
74
- const [s, i] = u.useState({ key: 0, target: "cancel" }), a = u.useRef(t);
75
- u.useLayoutEffect(() => {
76
- a.current !== t && (a.current = t, i({ key: 0, target: "cancel" }));
91
+ function b(e, t, n, r) {
92
+ const [s, a] = d.useState({ key: 0, target: "cancel" }), i = d.useRef(t);
93
+ d.useLayoutEffect(() => {
94
+ i.current !== t && (i.current = t, a({ key: 0, target: "cancel" }));
77
95
  }, [t]);
78
- const o = u.useCallback(
79
- (d) => {
80
- e && i((l) => ({ key: l.key + 1, target: d }));
96
+ const u = d.useCallback(
97
+ (c) => {
98
+ e && a((l) => ({ key: l.key + 1, target: c }));
81
99
  },
82
100
  [e]
83
- ), c = O(
101
+ ), o = F(
84
102
  e,
85
103
  n,
86
- o,
104
+ u,
87
105
  r
88
106
  );
89
107
  return {
90
108
  footerFlashKey: s.key,
91
109
  footerFlashTarget: s.key > 0 ? s.target : void 0,
92
- triggerFooterFlash: o,
93
- popoverHandlers: c
110
+ triggerFooterFlash: u,
111
+ popoverHandlers: o
94
112
  };
95
113
  }
96
- function B(e, t, n) {
114
+ function M(e, t, n) {
97
115
  queueMicrotask(() => {
98
- p(e, t) || n();
116
+ m(e, t) || n();
99
117
  });
100
118
  }
101
- function F(e, t, n, r) {
119
+ function R(e, t, n, r) {
102
120
  if (!e)
103
121
  return { display: "", parsed: void 0, resetToCommitted: !1 };
104
122
  const s = f(e, t, r);
@@ -108,27 +126,27 @@ function F(e, t, n, r) {
108
126
  resetToCommitted: !1
109
127
  } : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
110
128
  }
111
- function q(e, t, n, r) {
112
- const s = F(e, t, n, r);
129
+ function X(e, t, n, r) {
130
+ const s = R(e, t, n, r);
113
131
  return {
114
132
  ...s,
115
133
  isPartial: !!e && e.length < t.length && !s.resetToCommitted
116
134
  };
117
135
  }
118
- function b(e, t, n) {
136
+ function x(e, t, n) {
119
137
  const r = f(e, t, n);
120
138
  return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
121
139
  }
122
- function M(e, t, n) {
140
+ function N(e, t, n) {
123
141
  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 };
124
142
  }
125
- function X(e, t) {
143
+ function H(e, t) {
126
144
  return e.year * 12 + e.month - (t.year * 12 + t.month);
127
145
  }
128
- function x(e, t) {
146
+ function K(e, t) {
129
147
  return e.getTime() - t.getTime();
130
148
  }
131
- function N(e) {
149
+ function z(e) {
132
150
  if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
133
151
  return;
134
152
  const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
@@ -143,22 +161,23 @@ function N(e) {
143
161
  ));
144
162
  }
145
163
  export {
146
- x as compareDates,
147
- X as compareMonthSelection,
148
- T as createRangePickerOpenChangeHandler,
149
- B as deferRangeInputBlur,
150
- N as flashRangeReorder,
151
- C as isDateInputInvalid,
152
- k as isEventOnPickerSurface,
153
- p as isFocusInsidePicker,
154
- w as maskDateInput,
155
- M as normalizeOrderedRange,
164
+ K as compareDates,
165
+ H as compareMonthSelection,
166
+ S as createRangePickerOpenChangeHandler,
167
+ M as deferRangeInputBlur,
168
+ z as flashRangeReorder,
169
+ T as isDateInputInvalid,
170
+ O as isEventOnPickerSurface,
171
+ m as isFocusInsidePicker,
172
+ E as maskDateInput,
173
+ N as normalizeOrderedRange,
156
174
  f as parseDateInput,
157
- O as preventOutsideDismissWhenFooter,
158
- F as resolveDateInputOnBlur,
159
- b as resolveDateInputOnEnter,
160
- q as resolveRangeFieldBlur,
161
- E as resolveRangePickerDismissFlash,
162
- S as usePickerDismissActionsRef,
163
- V as usePickerFooterDismissNudge
175
+ F as preventOutsideDismissWhenFooter,
176
+ R as resolveDateInputOnBlur,
177
+ x as resolveDateInputOnEnter,
178
+ X as resolveRangeFieldBlur,
179
+ B as resolveRangePickerDismissFlash,
180
+ V as resolveSingleValueDismissFlash,
181
+ q as usePickerDismissActionsRef,
182
+ b as usePickerFooterDismissNudge
164
183
  };