impact-nova 2.2.3 → 2.2.5

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