impact-nova 1.6.4 → 1.6.6

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.
@@ -1,70 +1,73 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import * as m from "@radix-ui/react-checkbox";
4
- import { Check as N, Minus as w } from "lucide-react";
5
- import { cn as r } from "../../lib/utils.js";
6
- const y = i.forwardRef(({ className: x, label: s, helperText: c, isError: n, disabled: a, checked: e, defaultChecked: u, onCheckedChange: g, ...o }, k) => {
7
- const v = i.useId(), b = o.id || v, [f, h] = i.useState(
8
- e !== void 0 ? e : u || !1
1
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import * as f from "@radix-ui/react-checkbox";
4
+ import { Check as y, Minus as w } from "lucide-react";
5
+ import { cn as s } from "../../lib/utils.js";
6
+ const I = n.forwardRef(({ className: g, label: c, helperText: o, isError: m, disabled: d, checked: e, defaultChecked: b, onCheckedChange: k, onKeyDown: v, ...u }, p) => {
7
+ const N = n.useId(), h = u.id || N, [i, l] = n.useState(
8
+ e !== void 0 ? e : b || !1
9
9
  );
10
- i.useEffect(() => {
11
- e !== void 0 && h(e);
10
+ n.useEffect(() => {
11
+ e !== void 0 && l(e);
12
12
  }, [e]);
13
- const p = (l) => {
14
- e === void 0 && h(l), g?.(l);
13
+ const x = (t) => {
14
+ e === void 0 && l(t), k?.(t);
15
15
  };
16
- return /* @__PURE__ */ d("div", { className: "flex items-center", "data-component": "checkbox", "data-state": f === "indeterminate" ? "indeterminate" : f ? "checked" : "unchecked", "data-disabled": a || void 0, children: [
17
- /* @__PURE__ */ t(
18
- m.Root,
16
+ return /* @__PURE__ */ r("div", { className: "flex items-center", "data-component": "checkbox", "data-state": i === "indeterminate" ? "indeterminate" : i ? "checked" : "unchecked", "data-disabled": d || void 0, children: [
17
+ /* @__PURE__ */ a(
18
+ f.Root,
19
19
  {
20
- ref: k,
21
- id: b,
22
- className: r(
20
+ ref: p,
21
+ id: h,
22
+ className: s(
23
23
  "peer h-4 w-4 shrink-0 rounded-[4px] border border-stroke-field bg-canvas-elevated ring-offset-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-brand data-[state=checked]:bg-accent data-[state=checked]:text-brand data-[state=indeterminate]:border-brand data-[state=indeterminate]:bg-accent data-[state=indeterminate]:text-brand mr-[7px]",
24
- n && "border-destructive focus-visible:ring-destructive",
25
- a && "border-stroke text-disabled-foreground data-[state=checked]:bg-disabled-surface data-[state=checked]:text-disabled-foreground",
26
- x
24
+ m && "border-destructive focus-visible:ring-destructive",
25
+ d && "border-stroke text-disabled-foreground data-[state=checked]:bg-disabled-surface data-[state=checked]:text-disabled-foreground",
26
+ g
27
27
  ),
28
28
  checked: e,
29
- defaultChecked: u,
30
- onCheckedChange: p,
31
- disabled: a,
32
- ...o,
33
- children: /* @__PURE__ */ d(
34
- m.Indicator,
29
+ defaultChecked: b,
30
+ onCheckedChange: x,
31
+ disabled: d,
32
+ onKeyDown: (t) => {
33
+ t.key === "Enter" && (t.preventDefault(), x(i === "indeterminate" ? !0 : !i)), v?.(t);
34
+ },
35
+ ...u,
36
+ children: /* @__PURE__ */ r(
37
+ f.Indicator,
35
38
  {
36
39
  "data-checkbox": "indicator",
37
- className: r("flex items-center justify-center text-current group"),
40
+ className: s("flex items-center justify-center text-current group"),
38
41
  children: [
39
- /* @__PURE__ */ t(N, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
40
- /* @__PURE__ */ t(w, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
42
+ /* @__PURE__ */ a(y, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
43
+ /* @__PURE__ */ a(w, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
41
44
  ]
42
45
  }
43
46
  )
44
47
  }
45
48
  ),
46
- (s || c) && /* @__PURE__ */ d("div", { className: "grid gap-[6px] leading-none", children: [
47
- s && /* @__PURE__ */ d(
49
+ (c || o) && /* @__PURE__ */ r("div", { className: "grid gap-[6px] leading-none", children: [
50
+ c && /* @__PURE__ */ r(
48
51
  "label",
49
52
  {
50
- htmlFor: b,
51
- className: r(
53
+ htmlFor: h,
54
+ className: s(
52
55
  "text-sm font-medium leading-[20px] text-secondary-foreground peer-data-[state=checked]:text-content peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
53
- n && "text-destructive",
54
- a && "text-disabled-foreground"
56
+ m && "text-destructive",
57
+ d && "text-disabled-foreground"
55
58
  ),
56
59
  children: [
57
- s,
60
+ c,
58
61
  " ",
59
- o.required && /* @__PURE__ */ t("span", { className: "text-destructive", children: "*" })
62
+ u.required && /* @__PURE__ */ a("span", { className: "text-destructive", children: "*" })
60
63
  ]
61
64
  }
62
65
  ),
63
- c && /* @__PURE__ */ t("p", { className: r("text-sm text-content-muted", n && "text-destructive"), children: c })
66
+ o && /* @__PURE__ */ a("p", { className: s("text-sm text-content-muted", m && "text-destructive"), children: o })
64
67
  ] })
65
68
  ] });
66
69
  });
67
- y.displayName = m.Root.displayName;
70
+ I.displayName = f.Root.displayName;
68
71
  export {
69
- y as Checkbox
72
+ I as Checkbox
70
73
  };
@@ -1,32 +1,32 @@
1
1
  import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import * as a from "react";
2
+ import * as d from "react";
3
3
  import { X as ft } from "lucide-react";
4
4
  import { CalendarMonth as mt, Info as pt } from "../../../icons/index.js";
5
5
  import { isValid as P, parse as S } from "date-fns";
6
- import { cn as y, padValidDateString as j, maskDate as B } from "../../../lib/utils.js";
6
+ import { cn as y, padValidDateString as B, maskDate as O } from "../../../lib/utils.js";
7
7
  import { Popover as ht, PopoverTrigger as ut, PopoverContent as xt } from "../popover.js";
8
8
  import { Calendar as gt } from "../calendar.js";
9
- import { Tooltip as O, TooltipTrigger as z, TooltipContent as H } from "../tooltip.js";
9
+ import { Tooltip as z, TooltipTrigger as H, TooltipContent as X } from "../tooltip.js";
10
10
  import { useImpactNovaI18n as Mt } from "../../../i18n/ImpactNovaI18nContext.js";
11
11
  const r = (t, i = "MM/YYYY") => {
12
- const I = (t.month + 1).toString().padStart(2, "0");
13
- return i === "YYYY/MM" ? `${t.year}/${I}` : `${I}/${t.year}`;
14
- }, Yt = a.forwardRef(
12
+ const R = (t.month + 1).toString().padStart(2, "0");
13
+ return i === "YYYY/MM" ? `${t.year}/${R}` : `${R}/${t.year}`;
14
+ }, Yt = d.forwardRef(
15
15
  ({
16
16
  value: t,
17
17
  onChange: i,
18
- placeholder: I,
19
- minDate: X,
18
+ placeholder: R,
19
+ minDate: N,
20
20
  maxDate: q,
21
21
  startMonth: G,
22
22
  endMonth: J,
23
23
  showFooter: u = !0,
24
24
  disabled: w,
25
25
  className: K,
26
- isError: N,
26
+ isError: C,
27
27
  size: D,
28
- label: V,
29
- helperText: E,
28
+ label: E,
29
+ helperText: T,
30
30
  required: L,
31
31
  prefix: wt,
32
32
  prefixClick: bt,
@@ -34,28 +34,28 @@ const r = (t, i = "MM/YYYY") => {
34
34
  ...Q
35
35
  }, U) => {
36
36
  const { t: M } = Mt();
37
- I ?? M("datePicker.selectMonthRange");
38
- const T = a.useRef(null), W = a.useRef(null), l = a.useMemo(
37
+ R ?? M("datePicker.selectMonthRange");
38
+ const A = d.useRef(null), W = d.useRef(null), l = d.useMemo(
39
39
  () => n === "YYYY/MM" ? "yyyy/MM" : "MM/yyyy",
40
40
  [n]
41
41
  );
42
- a.useImperativeHandle(U, () => T.current);
43
- const [d, C] = a.useState(!1), [A, f] = a.useState(t), [b, x] = a.useState(t?.from ? r(t.from, n) : ""), [k, g] = a.useState(t?.to ? r(t.to, n) : ""), [Z, R] = a.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
44
- a.useEffect(() => {
45
- d || (x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), f(t));
46
- }, [d, t, n]), a.useEffect(() => {
47
- d && (f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), R(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
48
- }, [d, t, n]);
42
+ d.useImperativeHandle(U, () => A.current);
43
+ const [a, I] = d.useState(!1), [v, f] = d.useState(t), [b, x] = d.useState(t?.from ? r(t.from, n) : ""), [k, g] = d.useState(t?.to ? r(t.to, n) : ""), [Z, V] = d.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : N || /* @__PURE__ */ new Date());
44
+ d.useEffect(() => {
45
+ a || (x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), f(t));
46
+ }, [a, t, n]), d.useEffect(() => {
47
+ a && (f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), V(t?.from ? new Date(t.from.year, t.from.month, 1) : N || /* @__PURE__ */ new Date()));
48
+ }, [a, t, n, N]);
49
49
  const _ = (e) => {
50
- f(e), e?.from && x(r(e.from, n)), e?.to && g(r(e.to, n)), !u && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (i?.(e), C(!1));
50
+ f(e), e?.from && x(r(e.from, n)), e?.to && g(r(e.to, n)), !u && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (i?.(e), I(!1));
51
51
  }, F = (e) => {
52
- i?.(e !== void 0 ? e : A), C(!1);
52
+ i?.(e !== void 0 ? e : v), I(!1);
53
53
  }, tt = () => {
54
- f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), C(!1);
55
- }, v = () => {
56
- f(void 0), x(""), g(""), i?.(void 0), u || C(!1);
54
+ f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), I(!1);
55
+ }, $ = () => {
56
+ f(void 0), x(""), g(""), i?.(void 0), u || I(!1);
57
57
  }, et = (e) => {
58
- const h = e.target.value, s = B(h, l, b);
58
+ const h = e.target.value, s = O(h, l, b);
59
59
  if (x(s), s === "") {
60
60
  const m = { from: void 0, to: t?.to };
61
61
  f(m), u || i?.(m);
@@ -64,10 +64,10 @@ const r = (t, i = "MM/YYYY") => {
64
64
  const c = S(s, l, /* @__PURE__ */ new Date());
65
65
  if (P(c) && s.length === 7) {
66
66
  const Y = { from: { month: c.getMonth(), year: c.getFullYear() }, to: t?.to };
67
- f(Y), R(c), u || i?.(Y);
67
+ f(Y), V(c), u || i?.(Y);
68
68
  }
69
69
  }, nt = (e) => {
70
- const h = e.target.value, s = B(h, l, k);
70
+ const h = e.target.value, s = O(h, l, k);
71
71
  if (g(s), s === "") {
72
72
  const m = { from: t?.from, to: void 0 };
73
73
  f(m), u || i?.(m);
@@ -76,41 +76,41 @@ const r = (t, i = "MM/YYYY") => {
76
76
  const c = S(s, l, /* @__PURE__ */ new Date());
77
77
  if (P(c) && s.length === 7) {
78
78
  const m = { month: c.getMonth(), year: c.getFullYear() }, Y = { from: t?.from, to: m };
79
- f(Y), R(c), u || i?.(Y);
79
+ f(Y), V(c), u || i?.(Y);
80
80
  }
81
- }, $ = () => {
82
- if (d) return;
83
- const e = j(b, l), h = j(k, l), s = S(e, l, /* @__PURE__ */ new Date()), c = S(h, l, /* @__PURE__ */ new Date()), m = P(s) && e.length === 7, Y = P(c) && h.length === 7;
81
+ }, j = () => {
82
+ if (a) return;
83
+ const e = B(b, l), h = B(k, l), s = S(e, l, /* @__PURE__ */ new Date()), c = S(h, l, /* @__PURE__ */ new Date()), m = P(s) && e.length === 7, Y = P(c) && h.length === 7;
84
84
  !m || !Y ? (x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), f(t)) : (x(e), g(h), u || i?.({
85
85
  from: { month: s.getMonth(), year: s.getFullYear() },
86
86
  to: { month: c.getMonth(), year: c.getFullYear() }
87
87
  }));
88
- }, ot = t?.from ? r(t.from, n) : "", rt = t?.to ? r(t.to, n) : "", st = b !== ot, ct = k !== rt, at = b.length === 7 && !P(S(b, l, /* @__PURE__ */ new Date())), dt = k.length === 7 && !P(S(k, l, /* @__PURE__ */ new Date())), it = M("datePicker.startMonth"), lt = M("datePicker.endMonth");
88
+ }, ot = t?.from ? r(t.from, n) : "", rt = t?.to ? r(t.to, n) : "", st = b !== ot, ct = k !== rt, dt = b.length === 7 && !P(S(b, l, /* @__PURE__ */ new Date())), at = k.length === 7 && !P(S(k, l, /* @__PURE__ */ new Date())), it = M("datePicker.startMonth"), lt = M("datePicker.endMonth");
89
89
  return /* @__PURE__ */ p("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "month-range-picker", "data-disabled": w || void 0, children: [
90
90
  /* @__PURE__ */ p("div", { className: "flex flex-col gap-[6px]", children: [
91
- V && /* @__PURE__ */ p(
91
+ E && /* @__PURE__ */ p(
92
92
  "label",
93
93
  {
94
94
  className: y(
95
95
  "text-xs font-medium leading-[18px] text-content-tertiary",
96
96
  w && "opacity-70",
97
- N && "text-destructive"
97
+ C && "text-destructive"
98
98
  ),
99
99
  children: [
100
- V,
100
+ E,
101
101
  " ",
102
102
  L && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
103
103
  ]
104
104
  }
105
105
  ),
106
- /* @__PURE__ */ p(ht, { open: d, onOpenChange: C, children: [
106
+ /* @__PURE__ */ p(ht, { open: a, onOpenChange: I, children: [
107
107
  /* @__PURE__ */ o(ut, { asChild: !0, children: /* @__PURE__ */ p(
108
108
  "div",
109
109
  {
110
- "data-state": d ? "open" : "closed",
110
+ "data-state": a ? "open" : "closed",
111
111
  className: y(
112
112
  "flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
113
- N ? "border-destructive hover:border-destructive" : "border-field",
113
+ C ? "border-destructive hover:border-destructive" : "border-field",
114
114
  D === "sm" ? "h-6" : D === "md" ? "h-[28px]" : "h-8",
115
115
  w && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
116
116
  "cursor-pointer",
@@ -121,18 +121,18 @@ const r = (t, i = "MM/YYYY") => {
121
121
  /* @__PURE__ */ o(
122
122
  "input",
123
123
  {
124
- ref: T,
124
+ ref: A,
125
125
  type: "text",
126
126
  value: b,
127
127
  onChange: et,
128
- onBlur: $,
129
- onClick: (e) => d && e.stopPropagation(),
130
- placeholder: d ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : it,
128
+ onBlur: j,
129
+ onClick: (e) => a && e.stopPropagation(),
130
+ placeholder: a ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : it,
131
131
  disabled: !!w,
132
132
  "data-field": "start",
133
133
  className: y(
134
134
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
135
- at ? "text-destructive" : st ? "text-content-muted" : ""
135
+ dt ? "text-destructive" : st ? "text-content-muted" : ""
136
136
  ),
137
137
  ...Q
138
138
  }
@@ -144,34 +144,34 @@ const r = (t, i = "MM/YYYY") => {
144
144
  type: "text",
145
145
  value: k,
146
146
  onChange: nt,
147
- onBlur: $,
148
- onClick: (e) => d && e.stopPropagation(),
149
- placeholder: d ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : lt,
147
+ onBlur: j,
148
+ onClick: (e) => a && e.stopPropagation(),
149
+ placeholder: a ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : lt,
150
150
  disabled: !!w,
151
151
  "data-field": "end",
152
152
  className: y(
153
153
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
154
- dt ? "text-destructive" : ct ? "text-content-muted" : ""
154
+ at ? "text-destructive" : ct ? "text-content-muted" : ""
155
155
  )
156
156
  }
157
157
  )
158
158
  ] }),
159
159
  /* @__PURE__ */ p("div", { className: "flex items-center gap-1 shrink-0", children: [
160
- t?.from && !w && /* @__PURE__ */ p(O, { children: [
161
- /* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o(
160
+ t?.from && !w && /* @__PURE__ */ p(z, { children: [
161
+ /* @__PURE__ */ o(H, { asChild: !0, children: /* @__PURE__ */ o(
162
162
  ft,
163
163
  {
164
164
  className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
165
165
  onClick: (e) => {
166
- e.stopPropagation(), v();
166
+ e.stopPropagation(), $();
167
167
  }
168
168
  }
169
169
  ) }),
170
- /* @__PURE__ */ o(H, { variant: "tertiary", side: "top", children: M("calendar.clear") })
170
+ /* @__PURE__ */ o(X, { variant: "tertiary", side: "top", children: M("calendar.clear") })
171
171
  ] }),
172
- /* @__PURE__ */ p(O, { children: [
173
- /* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o(mt, { className: "h-4 w-4 text-secondary-foreground" }) }),
174
- /* @__PURE__ */ o(H, { variant: "tertiary", side: "top", children: M("datePicker.selectMonthRange") })
172
+ /* @__PURE__ */ p(z, { children: [
173
+ /* @__PURE__ */ o(H, { asChild: !0, children: /* @__PURE__ */ o(mt, { className: "h-4 w-4 text-secondary-foreground" }) }),
174
+ /* @__PURE__ */ o(X, { variant: "tertiary", side: "top", children: M("datePicker.selectMonthRange") })
175
175
  ] })
176
176
  ] })
177
177
  ]
@@ -188,33 +188,33 @@ const r = (t, i = "MM/YYYY") => {
188
188
  {
189
189
  pickerType: "month",
190
190
  monthMode: "range",
191
- selectedMonths: A,
191
+ selectedMonths: v,
192
192
  onMonthSelect: _,
193
193
  month: Z,
194
- onMonthChange: R,
195
- disabled: { before: X, after: q },
194
+ onMonthChange: V,
195
+ disabled: { before: N, after: q },
196
196
  startMonth: G,
197
197
  endMonth: J,
198
198
  showFooter: u,
199
199
  onApply: F,
200
200
  onCancel: tt,
201
- onClear: v
201
+ onClear: $
202
202
  }
203
203
  )
204
204
  }
205
205
  )
206
206
  ] })
207
207
  ] }),
208
- E && /* @__PURE__ */ p("div", { className: y("flex items-center gap-[6px]", N && "text-destructive"), children: [
209
- !N && /* @__PURE__ */ o(pt, { size: 10, className: "shrink-0 text-content-muted" }),
208
+ T && /* @__PURE__ */ p("div", { className: y("flex items-center gap-[6px]", C && "text-destructive"), children: [
209
+ !C && /* @__PURE__ */ o(pt, { size: 10, className: "shrink-0 text-content-muted" }),
210
210
  /* @__PURE__ */ o(
211
211
  "p",
212
212
  {
213
213
  className: y(
214
214
  "text-[10px] leading-4 text-navigation-muted",
215
- N && "text-destructive"
215
+ C && "text-destructive"
216
216
  ),
217
- children: E
217
+ children: T
218
218
  }
219
219
  )
220
220
  ] })
@@ -1,91 +1,94 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
3
  import { X as I } from "lucide-react";
4
4
  import { CalendarMonth as j } from "../../../icons/index.js";
5
5
  import { cn as R } from "../../../lib/utils.js";
6
6
  import { Input as $ } from "../input.js";
7
- import { Popover as b, PopoverTrigger as D, PopoverContent as E } from "../popover.js";
8
- import { Calendar as L } from "../calendar.js";
9
- import { Tooltip as f, TooltipTrigger as u, TooltipContent as g } from "../tooltip.js";
10
- import { useImpactNovaI18n as V } from "../../../i18n/ImpactNovaI18nContext.js";
11
- const X = c.forwardRef(
7
+ import { Popover as E, PopoverTrigger as L, PopoverContent as V } from "../popover.js";
8
+ import { Calendar as X } from "../calendar.js";
9
+ import { Tooltip as u, TooltipTrigger as g, TooltipContent as M } from "../tooltip.js";
10
+ import { useImpactNovaI18n as b } from "../../../i18n/ImpactNovaI18nContext.js";
11
+ const q = c.forwardRef(
12
12
  ({
13
13
  value: e,
14
- onChange: s,
14
+ onChange: a,
15
15
  placeholder: y,
16
- minDate: M,
16
+ minDate: d,
17
17
  maxDate: C,
18
18
  startMonth: P,
19
19
  endMonth: T,
20
- showFooter: a = !0,
20
+ showFooter: s = !0,
21
21
  disabled: p,
22
22
  className: k,
23
23
  ...x
24
24
  }, N) => {
25
- const { t: r } = V(), A = y ?? r("datePicker.selectMultipleMonths"), [d, n] = c.useState(!1), [h, i] = c.useState(e);
25
+ const { t: n } = b(), O = y ?? n("datePicker.selectMultipleMonths"), [h, r] = c.useState(!1), [m, i] = c.useState(e);
26
26
  c.useEffect(() => {
27
27
  i(e);
28
- }, [d, e]);
29
- const S = (o) => {
30
- i(o), a || s?.(o);
31
- }, O = (o) => {
32
- s?.(o !== void 0 ? o : h), n(!1);
28
+ }, [h, e]);
29
+ const A = (t) => {
30
+ i(t), s || a?.(t);
31
+ }, S = (t) => {
32
+ a?.(t !== void 0 ? t : m), r(!1);
33
33
  }, v = () => {
34
- i(e), n(!1);
35
- }, m = () => {
36
- i(void 0), s?.(void 0), a || n(!1);
37
- }, w = e && e.length > 0 ? e.length === 1 ? `${e[0].month + 1}/${e[0].year}` : r("datePicker.monthsSelected", { count: e.length }) : "";
38
- return /* @__PURE__ */ l(b, { open: d, onOpenChange: n, children: [
39
- /* @__PURE__ */ t(D, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
34
+ i(e), r(!1);
35
+ }, f = () => {
36
+ i(void 0), a?.(void 0), s || r(!1);
37
+ }, w = e && e.length > 0 ? e.length === 1 ? `${e[0].month + 1}/${e[0].year}` : n("datePicker.monthsSelected", { count: e.length }) : "";
38
+ return /* @__PURE__ */ l(E, { open: h, onOpenChange: (t) => {
39
+ p || r(t);
40
+ }, children: [
41
+ /* @__PURE__ */ o(L, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
40
42
  $,
41
43
  {
42
44
  ref: N,
43
45
  value: w,
44
- placeholder: A,
46
+ placeholder: O,
45
47
  readOnly: !0,
46
48
  disabled: p,
47
49
  className: R("cursor-pointer", k),
48
50
  suffix: /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
49
- e && e.length > 0 && !p && /* @__PURE__ */ l(f, { children: [
50
- /* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(
51
+ e && e.length > 0 && !p && /* @__PURE__ */ l(u, { children: [
52
+ /* @__PURE__ */ o(g, { asChild: !0, children: /* @__PURE__ */ o(
51
53
  I,
52
54
  {
53
55
  className: "h-4 w-4 cursor-pointer hover:text-content",
54
- onClick: (o) => {
55
- o.stopPropagation(), m();
56
+ onClick: (t) => {
57
+ t.stopPropagation(), f();
56
58
  }
57
59
  }
58
60
  ) }),
59
- /* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: r("calendar.clear") })
61
+ /* @__PURE__ */ o(M, { variant: "tertiary", side: "top", children: n("calendar.clear") })
60
62
  ] }),
61
- /* @__PURE__ */ l(f, { children: [
62
- /* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(j, { className: "h-4 w-4 text-secondary-foreground" }) }),
63
- /* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: r("datePicker.selectMultipleMonths") })
63
+ /* @__PURE__ */ l(u, { children: [
64
+ /* @__PURE__ */ o(g, { asChild: !0, children: /* @__PURE__ */ o(j, { className: "h-4 w-4 text-secondary-foreground" }) }),
65
+ /* @__PURE__ */ o(M, { variant: "tertiary", side: "top", children: n("datePicker.selectMultipleMonths") })
64
66
  ] })
65
67
  ] }),
66
68
  ...x
67
69
  }
68
70
  ) }) }),
69
- /* @__PURE__ */ t(
70
- E,
71
+ /* @__PURE__ */ o(
72
+ V,
71
73
  {
72
74
  className: "w-auto p-0",
73
75
  align: "start",
74
- onOpenAutoFocus: (o) => o.preventDefault(),
75
- children: /* @__PURE__ */ t(
76
- L,
76
+ onOpenAutoFocus: (t) => t.preventDefault(),
77
+ children: /* @__PURE__ */ o(
78
+ X,
77
79
  {
78
80
  pickerType: "month",
79
81
  monthMode: "multiple",
80
- selectedMonths: h,
81
- onMonthSelect: S,
82
- disabled: { before: M, after: C },
82
+ selectedMonths: m,
83
+ onMonthSelect: A,
84
+ disabled: { before: d, after: C },
83
85
  startMonth: P,
84
86
  endMonth: T,
85
- showFooter: a,
86
- onApply: O,
87
+ defaultMonth: d,
88
+ showFooter: s,
89
+ onApply: S,
87
90
  onCancel: v,
88
- onClear: m,
91
+ onClear: f,
89
92
  captionLayout: "dropdown"
90
93
  }
91
94
  )
@@ -94,7 +97,7 @@ const X = c.forwardRef(
94
97
  ] });
95
98
  }
96
99
  );
97
- X.displayName = "MultiMonthPicker";
100
+ q.displayName = "MultiMonthPicker";
98
101
  export {
99
- X as MultiMonthPicker
102
+ q as MultiMonthPicker
100
103
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import * as s from "react";
2
+ import * as a from "react";
3
3
  import { X } from "lucide-react";
4
4
  import { CalendarMonth as q } from "../../../icons/index.js";
5
5
  import { format as g } from "date-fns";
@@ -13,7 +13,7 @@ import { useImpactNovaI18n as Q } from "../../../i18n/ImpactNovaI18nContext.js";
13
13
  const U = (e, o = "MM/dd/yyyy", n) => {
14
14
  const l = g(e.startDate, o, n ? { locale: n } : {}), p = g(e.endDate, o, n ? { locale: n } : {});
15
15
  return `${l} - ${p}`;
16
- }, Y = s.forwardRef(
16
+ }, Y = a.forwardRef(
17
17
  ({
18
18
  value: e,
19
19
  onChange: o,
@@ -26,28 +26,30 @@ const U = (e, o = "MM/dd/yyyy", n) => {
26
26
  showFooter: d = !0,
27
27
  calendarType: x = "calendar",
28
28
  fiscalMode: N = "basic",
29
- selectionMode: S = "week",
30
- fiscalMonthPattern: A,
31
- fiscalYearStartMonth: v = 1,
32
- weekStartsOn: D = 1,
29
+ selectionMode: O = "week",
30
+ fiscalMonthPattern: S,
31
+ fiscalYearStartMonth: A = 1,
32
+ weekStartsOn: v = 1,
33
33
  disabled: m,
34
- className: L,
35
- ...O
34
+ className: D,
35
+ ...L
36
36
  }, I) => {
37
- const { locale: h, t: f } = Q(), $ = s.useMemo(() => K(h), [h]), j = l ?? f("datePicker.selectWeeks"), [y, a] = s.useState(!1), [k, i] = s.useState(e);
38
- s.useEffect(() => {
37
+ const { locale: h, t: f } = Q(), $ = a.useMemo(() => K(h), [h]), j = l ?? f("datePicker.selectWeeks"), [y, s] = a.useState(!1), [k, i] = a.useState(e);
38
+ a.useEffect(() => {
39
39
  i(e);
40
40
  }, [y, e]);
41
41
  const R = (t) => {
42
42
  i(t), d || o?.(t);
43
43
  }, b = (t) => {
44
- o?.(t !== void 0 ? t : k), a(!1);
44
+ o?.(t !== void 0 ? t : k), s(!1);
45
45
  }, E = () => {
46
- i(e), a(!1);
46
+ i(e), s(!1);
47
47
  }, u = () => {
48
- i(void 0), o?.(void 0), d || a(!1);
48
+ i(void 0), o?.(void 0), d || s(!1);
49
49
  }, V = e && e.length > 0 ? e.length === 1 ? U(e[0], n, $) : `${e.length} weeks selected` : "";
50
- return /* @__PURE__ */ c(F, { open: y, onOpenChange: (t) => !m && a(t), children: [
50
+ return /* @__PURE__ */ c(F, { open: y, onOpenChange: (t) => {
51
+ m || s(t);
52
+ }, children: [
51
53
  /* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
52
54
  B,
53
55
  {
@@ -56,7 +58,7 @@ const U = (e, o = "MM/dd/yyyy", n) => {
56
58
  placeholder: j,
57
59
  readOnly: !0,
58
60
  disabled: m,
59
- className: z("cursor-pointer", L),
61
+ className: z("cursor-pointer", D),
60
62
  suffix: /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
61
63
  e && e.length > 0 && !m && /* @__PURE__ */ c(C, { children: [
62
64
  /* @__PURE__ */ r(M, { asChild: !0, children: /* @__PURE__ */ r(
@@ -75,7 +77,7 @@ const U = (e, o = "MM/dd/yyyy", n) => {
75
77
  /* @__PURE__ */ r(P, { variant: "tertiary", side: "top", children: f("datePicker.selectWeeks") })
76
78
  ] })
77
79
  ] }),
78
- ...O
80
+ ...L
79
81
  }
80
82
  ) }) }),
81
83
  /* @__PURE__ */ r(
@@ -97,10 +99,10 @@ const U = (e, o = "MM/dd/yyyy", n) => {
97
99
  showFooter: d,
98
100
  calendarType: x,
99
101
  fiscalMode: N,
100
- selectionMode: S,
101
- fiscalMonthPattern: A,
102
- fiscalYearStartMonth: v,
103
- weekStartsOn: D,
102
+ selectionMode: O,
103
+ fiscalMonthPattern: S,
104
+ fiscalYearStartMonth: A,
105
+ weekStartsOn: v,
104
106
  onApply: b,
105
107
  onCancel: E,
106
108
  onClear: u,