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,16 +1,16 @@
1
1
  import { jsxs as f, jsx as n } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
- import { Cross as B, CalendarMonth as H } from "impact-nova-icons";
4
- import { cn as q } from "../../../lib/utils.js";
5
- import { Input as G } from "../input/input.js";
6
- import { Popover as J, PopoverAnchor as Q, PopoverContent as U } from "../../feedback/popover/popover.js";
7
- import { Calendar as W } from "../../data-display/calendar/calendar.js";
3
+ import { Cross as w, CalendarMonth as B } from "impact-nova-icons";
4
+ import { cn as H } from "../../../lib/utils.js";
5
+ import { Input as q } from "../input/input.js";
6
+ import { Popover as G, PopoverAnchor as J, PopoverContent as Q } from "../../feedback/popover/popover.js";
7
+ import { Calendar as U } from "../../data-display/calendar/calendar.js";
8
8
  import { Tooltip as b, TooltipTrigger as x, TooltipContent as A } from "../../feedback/tooltip/tooltip.js";
9
- import { useImpactNovaI18n as X } from "../../../i18n/use-impact-nova-i18n.js";
10
- import { coerceMonthArrayApply as Y, coerceMonthArray as Z } from "./calendar-selection-adapters.js";
11
- import { usePickerDismissActionsRef as _, usePickerFooterDismissNudge as ee } from "./date-input-behavior.js";
12
- import { buildDateBoundsMatcher as te } from "../../../lib/date-bounds-matcher.js";
13
- const ne = r.forwardRef(
9
+ import { useImpactNovaI18n as W } from "../../../i18n/use-impact-nova-i18n.js";
10
+ import { coerceMonthArrayApply as X, coerceMonthArray as Y } from "./calendar-selection-adapters.js";
11
+ import { usePickerDismissActionsRef as Z, usePickerFooterDismissNudge as _ } from "./date-input-behavior.js";
12
+ import { buildDateBoundsMatcher as ee } from "../../../lib/date-bounds-matcher.js";
13
+ const te = r.forwardRef(
14
14
  ({
15
15
  value: t,
16
16
  onChange: h,
@@ -24,15 +24,15 @@ const ne = r.forwardRef(
24
24
  className: I,
25
25
  ...S
26
26
  }, j) => {
27
- const { t: s } = X(), v = N ?? s("datePicker.selectMultipleMonths"), [c, i] = r.useState(!1), m = r.useRef(!1), y = r.useRef(null), g = _(), { footerFlashKey: O, footerFlashTarget: E, popoverHandlers: K } = ee(l, c, g, y), [p, d] = r.useState(t);
27
+ const { t: s } = W(), v = N ?? s("datePicker.selectMultipleMonths"), [c, i] = r.useState(!1), m = r.useRef(!1), y = r.useRef(null), g = Z(), { footerFlashKey: O, footerFlashTarget: E, popoverHandlers: K } = _(l, c, g, y), [p, d] = r.useState(t);
28
28
  r.useEffect(() => {
29
29
  d(t);
30
30
  }, [c, t]);
31
31
  const z = (e) => {
32
- const a = Z(e);
32
+ const a = Y(e);
33
33
  d(a), l || h?.(a);
34
34
  }, F = (e) => {
35
- const a = Y(e, p);
35
+ const a = X(e, p);
36
36
  h?.(a), i(!1);
37
37
  }, M = () => {
38
38
  d(t), i(!1);
@@ -41,19 +41,19 @@ const ne = r.forwardRef(
41
41
  }, L = t && t.length > 0 ? t.length === 1 ? `${t[0].month + 1}/${t[0].year}` : s("datePicker.monthsSelected", { count: t.length }) : "", V = (e) => {
42
42
  o || !e && l || i(e);
43
43
  }, $ = r.useCallback(() => {
44
- const e = p?.length ?? 0, a = t?.length ?? 0, w = e === a && (p ?? []).every(
44
+ const e = p?.length ?? 0, a = t?.length ?? 0;
45
+ return e === a && (p ?? []).every(
45
46
  (P, k) => P.month === t?.[k]?.month && P.year === t?.[k]?.year
46
- );
47
- return e > 0 && !w ? "apply" : "cancel";
47
+ ) ? "dismiss" : e > 0 ? "apply" : "cancel";
48
48
  }, [p, t]);
49
49
  return r.useLayoutEffect(() => {
50
50
  g.current = {
51
51
  onDismiss: M,
52
52
  resolveFlash: $
53
53
  };
54
- }), /* @__PURE__ */ f(J, { open: o ? !1 : c, onOpenChange: V, children: [
55
- /* @__PURE__ */ n(Q, { asChild: !0, children: /* @__PURE__ */ n("div", { ref: y, children: /* @__PURE__ */ n(
56
- G,
54
+ }), /* @__PURE__ */ f(G, { open: o ? !1 : c, onOpenChange: V, children: [
55
+ /* @__PURE__ */ n(J, { asChild: !0, children: /* @__PURE__ */ n("div", { ref: y, children: /* @__PURE__ */ n(
56
+ q,
57
57
  {
58
58
  ref: j,
59
59
  value: L,
@@ -63,7 +63,7 @@ const ne = r.forwardRef(
63
63
  onClick: () => {
64
64
  !o && !c && i(!0);
65
65
  },
66
- className: q("cursor-pointer", I),
66
+ className: H("cursor-pointer", I),
67
67
  suffix: /* @__PURE__ */ f("div", { className: "flex items-center gap-1", children: [
68
68
  t && t.length > 0 && !o && /* @__PURE__ */ f(b, { children: [
69
69
  /* @__PURE__ */ n(x, { asChild: !0, children: /* @__PURE__ */ n(
@@ -76,7 +76,7 @@ const ne = r.forwardRef(
76
76
  e.stopPropagation(), C();
77
77
  },
78
78
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
79
- children: /* @__PURE__ */ n(B, { className: "size-3 hover:text-content" })
79
+ children: /* @__PURE__ */ n(w, { className: "size-3 hover:text-content" })
80
80
  }
81
81
  ) }),
82
82
  /* @__PURE__ */ n(A, { variant: "tertiary", side: "top", children: s("calendar.clear") })
@@ -96,7 +96,7 @@ const ne = r.forwardRef(
96
96
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o || (m.current = !0, i(!c)));
97
97
  },
98
98
  className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
99
- children: /* @__PURE__ */ n(H, { className: "h-4 w-4 text-secondary-foreground" })
99
+ children: /* @__PURE__ */ n(B, { className: "h-4 w-4 text-secondary-foreground" })
100
100
  }
101
101
  ) }),
102
102
  /* @__PURE__ */ n(A, { variant: "tertiary", side: "top", children: s("datePicker.selectMultipleMonths") })
@@ -106,7 +106,7 @@ const ne = r.forwardRef(
106
106
  }
107
107
  ) }) }),
108
108
  /* @__PURE__ */ n(
109
- U,
109
+ Q,
110
110
  {
111
111
  className: "w-auto p-0",
112
112
  align: "start",
@@ -116,7 +116,7 @@ const ne = r.forwardRef(
116
116
  },
117
117
  ...K,
118
118
  children: /* @__PURE__ */ n(
119
- W,
119
+ U,
120
120
  {
121
121
  pickerType: "month",
122
122
  monthMode: "multiple",
@@ -124,7 +124,7 @@ const ne = r.forwardRef(
124
124
  footerFlashKey: O,
125
125
  footerFlashTarget: E,
126
126
  onMonthSelect: z,
127
- disabled: te(u, D),
127
+ disabled: ee(u, D),
128
128
  startMonth: R,
129
129
  endMonth: T,
130
130
  defaultMonth: u,
@@ -140,7 +140,7 @@ const ne = r.forwardRef(
140
140
  ] });
141
141
  }
142
142
  );
143
- ne.displayName = "MultiMonthPicker";
143
+ te.displayName = "MultiMonthPicker";
144
144
  export {
145
- ne as MultiMonthPicker
145
+ te as MultiMonthPicker
146
146
  };
@@ -1,25 +1,25 @@
1
1
  import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
3
+ import { Cross as Y, CalendarMonth as Z } from "impact-nova-icons";
4
4
  import { format as b } from "date-fns";
5
- import { cn as ee } from "../../../lib/utils.js";
6
- import { Input as te } from "../input/input.js";
7
- import { Popover as re, PopoverAnchor as ne, PopoverContent as oe } from "../../feedback/popover/popover.js";
8
- import { Calendar as se } from "../../data-display/calendar/calendar.js";
5
+ import { cn as _ } from "../../../lib/utils.js";
6
+ import { Input as ee } from "../input/input.js";
7
+ import { Popover as te, PopoverAnchor as re, PopoverContent as ne } from "../../feedback/popover/popover.js";
8
+ import { Calendar as oe } 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 ae } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { getDateFnsLocale as ce } from "../../../i18n/getDateFnsLocale.js";
12
- import { coerceWeekArrayApply as ie, coerceWeekArray as le } from "./calendar-selection-adapters.js";
13
- import { usePickerDismissActionsRef as pe, usePickerFooterDismissNudge as de } from "./date-input-behavior.js";
14
- import { buildDateBoundsMatcher as fe } from "../../../lib/date-bounds-matcher.js";
15
- const me = (t, a = "MM/dd/yyyy", c) => {
16
- const h = b(t.startDate, a, c ? { locale: c } : {}), y = b(t.endDate, a, c ? { locale: c } : {});
10
+ import { useImpactNovaI18n as se } from "../../../i18n/use-impact-nova-i18n.js";
11
+ import { getDateFnsLocale as ae } from "../../../i18n/getDateFnsLocale.js";
12
+ import { coerceWeekArrayApply as ie, coerceWeekArray as ce } from "./calendar-selection-adapters.js";
13
+ import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as pe } from "./date-input-behavior.js";
14
+ import { buildDateBoundsMatcher as de } from "../../../lib/date-bounds-matcher.js";
15
+ const fe = (t, a = "MM/dd/yyyy", i) => {
16
+ const h = b(t.startDate, a, i ? { locale: i } : {}), y = b(t.endDate, a, i ? { locale: i } : {});
17
17
  return `${h} - ${y}`;
18
- }, ue = n.forwardRef(
18
+ }, me = n.forwardRef(
19
19
  ({
20
20
  value: t,
21
21
  onChange: a,
22
- format: c = "MM/dd/yyyy",
22
+ format: i = "MM/dd/yyyy",
23
23
  placeholder: h,
24
24
  minDate: y,
25
25
  maxDate: N,
@@ -36,12 +36,12 @@ const me = (t, a = "MM/dd/yyyy", c) => {
36
36
  className: O,
37
37
  ...E
38
38
  }, F) => {
39
- const { locale: g, t: i } = ae(), K = n.useMemo(() => ce(g), [g]), $ = h ?? i("datePicker.selectWeeks"), [l, s] = n.useState(!1), k = n.useRef(!1), C = n.useRef(null), P = pe(), { footerFlashKey: z, footerFlashTarget: V, popoverHandlers: B } = de(d, l, P, C), [f, m] = n.useState(t);
39
+ const { locale: g, t: c } = se(), K = n.useMemo(() => ae(g), [g]), $ = h ?? c("datePicker.selectWeeks"), [l, s] = n.useState(!1), k = n.useRef(!1), C = n.useRef(null), P = le(), { footerFlashKey: z, footerFlashTarget: V, popoverHandlers: B } = pe(d, l, P, C), [f, m] = n.useState(t);
40
40
  n.useEffect(() => {
41
41
  m(t);
42
42
  }, [l, t]);
43
43
  const H = (e) => {
44
- const p = le(e);
44
+ const p = ce(e);
45
45
  m(p), d || a?.(p);
46
46
  }, q = (e) => {
47
47
  const p = ie(e, f);
@@ -50,22 +50,22 @@ const me = (t, a = "MM/dd/yyyy", c) => {
50
50
  m(t), s(!1);
51
51
  }, W = () => {
52
52
  m(void 0), a?.(void 0), d || s(!1);
53
- }, G = t && t.length > 0 ? t.length === 1 ? me(t[0], c, K) : `${t.length} weeks selected` : "", J = (e) => {
53
+ }, G = t && t.length > 0 ? t.length === 1 ? fe(t[0], i, K) : `${t.length} weeks selected` : "", J = (e) => {
54
54
  o || !e && d || s(e);
55
55
  }, Q = n.useCallback(() => {
56
- const e = f?.length ?? 0, p = t?.length ?? 0, U = e === p && (f ?? []).every(
57
- (X, Y) => X.startDate.getTime() === t?.[Y]?.startDate.getTime()
58
- );
59
- return e > 0 && !U ? "apply" : "cancel";
56
+ const e = f?.length ?? 0, p = t?.length ?? 0;
57
+ return e === p && (f ?? []).every(
58
+ (U, X) => U.startDate.getTime() === t?.[X]?.startDate.getTime()
59
+ ) ? "dismiss" : e > 0 ? "apply" : "cancel";
60
60
  }, [f, t]);
61
61
  return n.useLayoutEffect(() => {
62
62
  P.current = {
63
63
  onDismiss: D,
64
64
  resolveFlash: Q
65
65
  };
66
- }), /* @__PURE__ */ u(re, { open: o ? !1 : l, onOpenChange: J, children: [
67
- /* @__PURE__ */ r(ne, { asChild: !0, children: /* @__PURE__ */ r("div", { ref: C, children: /* @__PURE__ */ r(
68
- te,
66
+ }), /* @__PURE__ */ u(te, { open: o ? !1 : l, onOpenChange: J, children: [
67
+ /* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r("div", { ref: C, children: /* @__PURE__ */ r(
68
+ ee,
69
69
  {
70
70
  ref: F,
71
71
  value: G,
@@ -75,7 +75,7 @@ const me = (t, a = "MM/dd/yyyy", c) => {
75
75
  onClick: () => {
76
76
  !o && !l && s(!0);
77
77
  },
78
- className: ee("cursor-pointer", O),
78
+ className: _("cursor-pointer", O),
79
79
  suffix: /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: [
80
80
  t && t.length > 0 && !o && /* @__PURE__ */ u(x, { children: [
81
81
  /* @__PURE__ */ r(A, { asChild: !0, children: /* @__PURE__ */ r(
@@ -83,15 +83,15 @@ const me = (t, a = "MM/dd/yyyy", c) => {
83
83
  {
84
84
  type: "button",
85
85
  tabIndex: 0,
86
- "aria-label": i("calendar.clear"),
86
+ "aria-label": c("calendar.clear"),
87
87
  onClick: (e) => {
88
88
  e.stopPropagation(), W();
89
89
  },
90
90
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
91
- children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
91
+ children: /* @__PURE__ */ r(Y, { className: "size-3 hover:text-content" })
92
92
  }
93
93
  ) }),
94
- /* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: i("calendar.clear") })
94
+ /* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: c("calendar.clear") })
95
95
  ] }),
96
96
  /* @__PURE__ */ u(x, { children: [
97
97
  /* @__PURE__ */ r(A, { asChild: !0, children: /* @__PURE__ */ r(
@@ -100,7 +100,7 @@ const me = (t, a = "MM/dd/yyyy", c) => {
100
100
  type: "button",
101
101
  tabIndex: 0,
102
102
  "data-component": "calendar-trigger",
103
- "aria-label": i("datePicker.selectWeeks"),
103
+ "aria-label": c("datePicker.selectWeeks"),
104
104
  onPointerDown: (e) => {
105
105
  e.preventDefault(), e.stopPropagation(), o || s(!l);
106
106
  },
@@ -108,27 +108,27 @@ const me = (t, a = "MM/dd/yyyy", c) => {
108
108
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o || (k.current = !0, s(!l)));
109
109
  },
110
110
  className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
111
- children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
111
+ children: /* @__PURE__ */ r(Z, { className: "h-4 w-4 text-secondary-foreground" })
112
112
  }
113
113
  ) }),
114
- /* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: i("datePicker.selectWeeks") })
114
+ /* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: c("datePicker.selectWeeks") })
115
115
  ] })
116
116
  ] }),
117
117
  ...E
118
118
  }
119
119
  ) }) }),
120
120
  /* @__PURE__ */ r(
121
- oe,
121
+ ne,
122
122
  {
123
123
  className: "w-auto p-0",
124
124
  align: "start",
125
- "aria-label": i("datePicker.selectWeeks"),
125
+ "aria-label": c("datePicker.selectWeeks"),
126
126
  onOpenAutoFocus: (e) => {
127
127
  k.current || e.preventDefault(), k.current = !1;
128
128
  },
129
129
  ...B,
130
130
  children: /* @__PURE__ */ r(
131
- se,
131
+ oe,
132
132
  {
133
133
  pickerType: "week",
134
134
  weekMode: "multiple",
@@ -136,7 +136,7 @@ const me = (t, a = "MM/dd/yyyy", c) => {
136
136
  footerFlashKey: z,
137
137
  footerFlashTarget: V,
138
138
  onWeekSelect: H,
139
- disabled: fe(y, N),
139
+ disabled: de(y, N),
140
140
  startMonth: T,
141
141
  endMonth: R,
142
142
  showFooter: d,
@@ -157,7 +157,7 @@ const me = (t, a = "MM/dd/yyyy", c) => {
157
157
  ] });
158
158
  }
159
159
  );
160
- ue.displayName = "MultiWeekPicker";
160
+ me.displayName = "MultiWeekPicker";
161
161
  export {
162
- ue as MultiWeekPicker
162
+ me as MultiWeekPicker
163
163
  };
@@ -1,26 +1,26 @@
1
1
  import { jsxs as C, jsx as a } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { Cross as ve, CalendarMonth as Ce } from "impact-nova-icons";
3
+ import { Cross as Ie, CalendarMonth as Ce } from "impact-nova-icons";
4
4
  import { format as O } from "date-fns";
5
5
  import { cn as We } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as Re, usePickerFooterDismissNudge as Pe, isDateInputInvalid as be, resolveDateInputOnBlur as xe, maskDateInput as Ee, parseDateInput as Ae, resolveDateInputOnEnter as Ne } from "./date-input-behavior.js";
7
- import { Input as Se } from "../input/input.js";
8
- import { Popover as Te, PopoverAnchor as we, PopoverContent as Ve } from "../../feedback/popover/popover.js";
9
- import { Calendar as Le } from "../../data-display/calendar/calendar.js";
6
+ import { usePickerDismissActionsRef as Re, usePickerFooterDismissNudge as Pe, isDateInputInvalid as be, resolveSingleValueDismissFlash as xe, resolveDateInputOnBlur as Ee, maskDateInput as Se, parseDateInput as Ae, resolveDateInputOnEnter as Ne } from "./date-input-behavior.js";
7
+ import { Input as Te } from "../input/input.js";
8
+ import { Popover as Ve, PopoverAnchor as we, PopoverContent as Le } from "../../feedback/popover/popover.js";
9
+ import { Calendar as Oe } from "../../data-display/calendar/calendar.js";
10
10
  import { Tooltip as X, TooltipTrigger as Z, TooltipContent as _ } from "../../feedback/tooltip/tooltip.js";
11
- import { resolveWeekSelection as Oe } from "../../../lib/fiscal-calendar.js";
12
- import { useImpactNovaI18n as je } from "../../../i18n/use-impact-nova-i18n.js";
13
- import { getDateFnsLocale as Be } from "../../../i18n/getDateFnsLocale.js";
14
- import { coerceSingleWeekApply as Ke, coerceSingleWeek as Me } from "./calendar-selection-adapters.js";
15
- import { buildDateBoundsMatcher as ze } from "../../../lib/date-bounds-matcher.js";
16
- const Y = (t, c = "MM/dd/yyyy", n) => {
17
- const W = O(t.startDate, c, n ? { locale: n } : {}), R = O(t.endDate, c, n ? { locale: n } : {});
11
+ import { resolveWeekSelection as je } from "../../../lib/fiscal-calendar.js";
12
+ import { useImpactNovaI18n as Be } from "../../../i18n/use-impact-nova-i18n.js";
13
+ import { getDateFnsLocale as Ke } from "../../../i18n/getDateFnsLocale.js";
14
+ import { coerceSingleWeekApply as Me, coerceSingleWeek as ze } from "./calendar-selection-adapters.js";
15
+ import { buildDateBoundsMatcher as He } from "../../../lib/date-bounds-matcher.js";
16
+ const Y = (n, c = "MM/dd/yyyy", t) => {
17
+ const W = O(n.startDate, c, t ? { locale: t } : {}), R = O(n.endDate, c, t ? { locale: t } : {});
18
18
  return `${W} - ${R}`;
19
- }, h = (t, c, n) => t ? O(t.startDate, c, n ? { locale: n } : {}) : "", He = s.forwardRef(
19
+ }, h = (n, c, t) => n ? O(n.startDate, c, t ? { locale: t } : {}) : "", $e = s.forwardRef(
20
20
  ({
21
- value: t,
21
+ value: n,
22
22
  onChange: c,
23
- format: n = "MM/dd/yyyy",
23
+ format: t = "MM/dd/yyyy",
24
24
  placeholder: W,
25
25
  minDate: R,
26
26
  maxDate: F,
@@ -31,83 +31,83 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
31
31
  fiscalMode: b = "basic",
32
32
  selectionMode: x = "week",
33
33
  fiscalMonthPattern: E,
34
- fiscalYearStartMonth: A = 1,
35
- weekStartsOn: N = 1,
36
- disabled: u,
34
+ fiscalYearStartMonth: S = 1,
35
+ weekStartsOn: A = 1,
36
+ disabled: p,
37
37
  className: ne,
38
38
  ...re
39
39
  }, se) => {
40
- const { locale: j, t: k } = je(), o = s.useMemo(() => Be(j), [j]), ie = W ?? k("datePicker.selectWeek"), B = s.useRef(null), K = s.useRef(null), I = s.useRef(!1);
40
+ const { locale: j, t: k } = Be(), o = s.useMemo(() => Ke(j), [j]), ie = W ?? k("datePicker.selectWeek"), B = s.useRef(null), K = s.useRef(null), v = s.useRef(!1);
41
41
  s.useImperativeHandle(se, () => B.current);
42
- const [i, M] = s.useState(!1), z = Re(), { footerFlashKey: oe, footerFlashTarget: ce, popoverHandlers: ae } = Pe(l, i, z, K), [le, S] = s.useState(!1), [p, f] = s.useState(t), [y, m] = s.useState(""), [pe, D] = s.useState(t?.startDate || /* @__PURE__ */ new Date()), ue = t ? Y(t, n, o) : "", H = p ? Y(p, n, o) : "", T = i || le, fe = T ? y : H, $ = s.useCallback(() => {
43
- f(t), m(h(t, n, o)), D(t?.startDate || /* @__PURE__ */ new Date());
44
- }, [t, n, o]), v = s.useCallback(() => {
45
- m(h(p ?? t, n, o)), D((p ?? t)?.startDate || /* @__PURE__ */ new Date());
46
- }, [p, t, n, o]);
42
+ const [i, M] = s.useState(!1), z = Re(), { footerFlashKey: oe, footerFlashTarget: ce, popoverHandlers: ae } = Pe(l, i, z, K), [le, N] = s.useState(!1), [u, f] = s.useState(n), [y, m] = s.useState(""), [pe, D] = s.useState(n?.startDate || /* @__PURE__ */ new Date()), ue = n ? Y(n, t, o) : "", H = u ? Y(u, t, o) : "", T = i || le, fe = T ? y : H, $ = s.useCallback(() => {
43
+ f(n), m(h(n, t, o)), D(n?.startDate || /* @__PURE__ */ new Date());
44
+ }, [n, t, o]), I = s.useCallback(() => {
45
+ m(h(u ?? n, t, o)), D((u ?? n)?.startDate || /* @__PURE__ */ new Date());
46
+ }, [u, n, t, o]);
47
47
  s.useEffect(() => {
48
- i || f(t);
49
- }, [i, t]);
48
+ i || f(n);
49
+ }, [i, n]);
50
50
  const q = s.useRef(!1);
51
51
  s.useEffect(() => {
52
- i && !q.current && v(), q.current = i;
53
- }, [i, v]);
52
+ i && !q.current && I(), q.current = i;
53
+ }, [i, I]);
54
54
  const d = () => {
55
- S(!1), M(!1);
55
+ N(!1), M(!1);
56
56
  }, g = (e) => {
57
- if (!u) {
57
+ if (!p) {
58
58
  if (e) {
59
- v(), M(!0);
59
+ I(), M(!0);
60
60
  return;
61
61
  }
62
62
  l || d();
63
63
  }
64
- }, w = s.useCallback(
65
- (e) => Oe(e, {
64
+ }, V = s.useCallback(
65
+ (e) => je(e, {
66
66
  calendarType: P,
67
67
  fiscalMode: b,
68
68
  selectionMode: x,
69
69
  fiscalMonthPattern: E,
70
- fiscalYearStartMonth: A,
71
- weekStartsOn: N
70
+ fiscalYearStartMonth: S,
71
+ weekStartsOn: A
72
72
  }),
73
73
  [
74
74
  P,
75
75
  b,
76
76
  x,
77
77
  E,
78
- A,
79
- N
78
+ S,
79
+ A
80
80
  ]
81
81
  ), de = (e) => {
82
- const r = Me(e);
83
- f(r), r && (m(h(r, n, o)), D(r.startDate)), l || (c?.(r), d());
82
+ const r = ze(e);
83
+ f(r), r && (m(h(r, t, o)), D(r.startDate)), l || (c?.(r), d());
84
84
  }, G = (e) => {
85
- const r = Ke(e, p);
85
+ const r = Me(e, u);
86
86
  c?.(r), d();
87
- }, V = () => {
87
+ }, w = () => {
88
88
  $(), d();
89
89
  }, J = () => {
90
90
  f(void 0), m(""), c?.(void 0), l || d();
91
91
  }, me = (e) => {
92
- const r = w(e);
93
- f(r), m(h(r, n, o)), D(e), c?.(r), d();
92
+ const r = V(e);
93
+ f(r), m(h(r, t, o)), D(e), c?.(r), d();
94
94
  }, ke = (e) => {
95
- const r = Ee(e.target.value, n, y);
95
+ const r = Se(e.target.value, t, y);
96
96
  if (m(r), r === "") {
97
97
  f(void 0), l || c?.(void 0);
98
98
  return;
99
99
  }
100
- const { parsed: L, isValid: Ie } = Ae(r, n, o);
101
- if (Ie && L) {
102
- const U = w(L);
100
+ const { parsed: L, isValid: ve } = Ae(r, t, o);
101
+ if (ve && L) {
102
+ const U = V(L);
103
103
  f(U), D(L), l || c?.(U);
104
104
  }
105
105
  }, ye = () => {
106
- if (S(!1), i) return;
107
- const e = xe(
106
+ if (N(!1), i) return;
107
+ const e = Ee(
108
108
  y,
109
- n,
110
- h(p ?? t, n, o),
109
+ t,
110
+ h(u ?? n, t, o),
111
111
  o
112
112
  );
113
113
  if (e.resetToCommitted) {
@@ -115,8 +115,8 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
115
115
  return;
116
116
  }
117
117
  if (e.parsed) {
118
- const r = w(e.parsed);
119
- f(r), m(h(r, n, o)), l || c?.(r);
118
+ const r = V(e.parsed);
119
+ f(r), m(h(r, t, o)), l || c?.(r);
120
120
  return;
121
121
  }
122
122
  y || (f(void 0), l || c?.(void 0));
@@ -125,19 +125,26 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
125
125
  G();
126
126
  return;
127
127
  }
128
- const e = Ne(y, n, o);
128
+ const e = Ne(y, t, o);
129
129
  if (e.parsed) {
130
130
  l && me(e.parsed);
131
131
  return;
132
132
  }
133
- i || (I.current = !0, g(!0));
134
- }, Q = ue !== H, ge = T && be(y, n, o), he = s.useCallback(() => p && (!t || p.startDate.getTime() !== t.startDate.getTime()) ? "apply" : "cancel", [p, t]);
133
+ i || (v.current = !0, g(!0));
134
+ }, Q = ue !== H, ge = T && be(y, t, o), he = s.useCallback(
135
+ () => xe(
136
+ u,
137
+ n,
138
+ (e, r) => e.startDate.getTime() === r.startDate.getTime()
139
+ ),
140
+ [u, n]
141
+ );
135
142
  return s.useLayoutEffect(() => {
136
143
  z.current = {
137
- onDismiss: V,
144
+ onDismiss: w,
138
145
  resolveFlash: he
139
146
  };
140
- }), /* @__PURE__ */ C(Te, { open: u ? !1 : i, onOpenChange: g, children: [
147
+ }), /* @__PURE__ */ C(Ve, { open: p ? !1 : i, onOpenChange: g, children: [
141
148
  /* @__PURE__ */ a(we, { asChild: !0, children: /* @__PURE__ */ a(
142
149
  "div",
143
150
  {
@@ -146,21 +153,21 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
146
153
  "data-state": i ? "open" : "closed",
147
154
  "data-pending": Q || void 0,
148
155
  children: /* @__PURE__ */ a(
149
- Se,
156
+ Te,
150
157
  {
151
158
  ref: B,
152
159
  value: fe,
153
160
  onChange: ke,
154
161
  onFocus: () => {
155
- u || (S(!0), v());
162
+ p || (N(!0), I());
156
163
  },
157
164
  onBlur: ye,
158
- onClick: () => !u && g(!0),
165
+ onClick: () => !p && g(!0),
159
166
  onKeyDown: (e) => {
160
- e.key === "Enter" && !u && (e.preventDefault(), De()), e.key === "ArrowDown" && !i && !u && (e.preventDefault(), I.current = !0, g(!0)), e.key === "Escape" && i && (e.preventDefault(), V());
167
+ e.key === "Enter" && !p && (e.preventDefault(), De()), e.key === "ArrowDown" && !i && !p && (e.preventDefault(), v.current = !0, g(!0)), e.key === "Escape" && i && (e.preventDefault(), w());
161
168
  },
162
- placeholder: T ? n : ie,
163
- disabled: u,
169
+ placeholder: T ? t : ie,
170
+ disabled: p,
164
171
  "data-form-control": "input",
165
172
  className: We(
166
173
  "cursor-pointer",
@@ -168,7 +175,7 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
168
175
  ne
169
176
  ),
170
177
  suffix: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
171
- t && !u && /* @__PURE__ */ C(X, { children: [
178
+ n && !p && /* @__PURE__ */ C(X, { children: [
172
179
  /* @__PURE__ */ a(Z, { asChild: !0, children: /* @__PURE__ */ a(
173
180
  "button",
174
181
  {
@@ -179,7 +186,7 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
179
186
  e.stopPropagation(), J();
180
187
  },
181
188
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
182
- children: /* @__PURE__ */ a(ve, { className: "size-3 hover:text-content" })
189
+ children: /* @__PURE__ */ a(Ie, { className: "size-3 hover:text-content" })
183
190
  }
184
191
  ) }),
185
192
  /* @__PURE__ */ a(_, { variant: "tertiary", side: "top", children: k("calendar.clear") })
@@ -192,10 +199,10 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
192
199
  tabIndex: 0,
193
200
  "aria-label": k("datePicker.selectWeek"),
194
201
  onClick: (e) => {
195
- e.stopPropagation(), u || (i ? d() : g(!0));
202
+ e.stopPropagation(), p || (i ? d() : g(!0));
196
203
  },
197
204
  onKeyDown: (e) => {
198
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), u || (I.current = !0, i ? d() : g(!0)));
205
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), p || (v.current = !0, i ? d() : g(!0)));
199
206
  },
200
207
  className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
201
208
  children: /* @__PURE__ */ a(Ce, { className: "h-4 w-4 text-secondary-foreground" })
@@ -210,27 +217,27 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
210
217
  }
211
218
  ) }),
212
219
  /* @__PURE__ */ a(
213
- Ve,
220
+ Le,
214
221
  {
215
222
  className: "w-auto p-0",
216
223
  align: "start",
217
224
  "aria-label": k("datePicker.selectWeek"),
218
225
  onOpenAutoFocus: (e) => {
219
- I.current || e.preventDefault(), I.current = !1;
226
+ v.current || e.preventDefault(), v.current = !1;
220
227
  },
221
228
  ...ae,
222
229
  children: /* @__PURE__ */ a(
223
- Le,
230
+ Oe,
224
231
  {
225
232
  pickerType: "week",
226
233
  weekMode: "single",
227
- selectedWeeks: p,
234
+ selectedWeeks: u,
228
235
  footerFlashKey: oe,
229
236
  footerFlashTarget: ce,
230
237
  onWeekSelect: de,
231
238
  month: pe,
232
239
  onMonthChange: D,
233
- disabled: ze(R, F),
240
+ disabled: He(R, F),
234
241
  startMonth: ee,
235
242
  endMonth: te,
236
243
  showFooter: l,
@@ -238,10 +245,10 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
238
245
  fiscalMode: b,
239
246
  selectionMode: x,
240
247
  fiscalMonthPattern: E,
241
- fiscalYearStartMonth: A,
242
- weekStartsOn: N,
248
+ fiscalYearStartMonth: S,
249
+ weekStartsOn: A,
243
250
  onApply: G,
244
- onCancel: V,
251
+ onCancel: w,
245
252
  onClear: J,
246
253
  captionLayout: "dropdown"
247
254
  }
@@ -251,7 +258,7 @@ const Y = (t, c = "MM/dd/yyyy", n) => {
251
258
  ] });
252
259
  }
253
260
  );
254
- He.displayName = "WeekPicker";
261
+ $e.displayName = "WeekPicker";
255
262
  export {
256
- He as WeekPicker
263
+ $e as WeekPicker
257
264
  };