impact-nova 0.1.11 → 0.1.13

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,13 +1,13 @@
1
- import { jsxs as y, jsx as o } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { X as j } from "lucide-react";
4
- import { CalendarMonth as R } from "../../../icons/index.js";
5
- import { format as D, parse as C, isValid as k } from "date-fns";
6
- import { cn as T, maskDate as L } from "../../../lib/utils.js";
7
- import { Input as X } from "../input.js";
8
- import { Popover as q, PopoverTrigger as z, PopoverContent as G } from "../popover.js";
9
- import { Calendar as H } from "../calendar.js";
10
- const J = a.forwardRef(
1
+ import { jsxs as C, jsx as a } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { X as R } from "lucide-react";
4
+ import { CalendarMonth as T } from "../../../icons/index.js";
5
+ import { format as g, parse as y, isValid as k } from "date-fns";
6
+ import { cn as L, maskDate as X } from "../../../lib/utils.js";
7
+ import { Input as q } from "../input.js";
8
+ import { Popover as z, PopoverTrigger as G, PopoverContent as H } from "../popover.js";
9
+ import { Calendar as J } from "../calendar.js";
10
+ const K = l.forwardRef(
11
11
  ({
12
12
  value: n,
13
13
  onChange: i,
@@ -22,87 +22,91 @@ const J = a.forwardRef(
22
22
  className: N,
23
23
  ...M
24
24
  }, A) => {
25
- const [l, f] = a.useState(!1), [r, c] = a.useState(n), [m, d] = a.useState(n ? D(n, t) : ""), [O, h] = a.useState(n || /* @__PURE__ */ new Date());
26
- a.useEffect(() => {
27
- d(n ? D(n, t) : "");
28
- }, [n, t]), a.useEffect(() => {
29
- console.log("[DatePicker] useEffect - open:", l, "value:", n, "pendingDate:", r), l && (c(n), h(n || /* @__PURE__ */ new Date()));
30
- }, [l]);
25
+ const [r, d] = l.useState(!1), [c, s] = l.useState(n), [h, f] = l.useState(n ? g(n, t) : ""), [O, m] = l.useState(n || /* @__PURE__ */ new Date());
26
+ l.useEffect(() => {
27
+ f(n ? g(n, t) : "");
28
+ }, [n, t]), l.useEffect(() => {
29
+ console.log("[DatePicker] useEffect - open:", r, "value:", n, "pendingDate:", c), r && (s(n), m(n || /* @__PURE__ */ new Date()));
30
+ }, [r]);
31
31
  const V = (e) => {
32
- console.log("[DatePicker] handleSelect called:", e), c(e), p || (console.log("[DatePicker] No footer - applying immediately"), i?.(e), f(!1));
32
+ console.log("[DatePicker] handleSelect called:", e), s(e), p || (console.log("[DatePicker] No footer - applying immediately"), i?.(e), d(!1));
33
33
  }, B = (e) => {
34
- const s = e !== void 0 ? e : r;
35
- console.log("[DatePicker] handleApply called, appliedDate:", e, "pendingDate:", r, "using:", s), i?.(s), f(!1);
36
- }, E = () => {
37
- console.log("[DatePicker] handleCancel called"), c(n), f(!1);
38
- }, g = () => {
39
- console.log("[DatePicker] handleClear called"), c(void 0), d(""), i?.(void 0), p || f(!1);
34
+ const o = e;
35
+ f(o ? g(o, t) : "");
36
+ }, E = (e) => {
37
+ const o = e !== void 0 ? e : c;
38
+ console.log("[DatePicker] handleApply called, appliedDate:", e, "pendingDate:", c, "using:", o), i?.(o), d(!1);
39
+ }, j = () => {
40
+ console.log("[DatePicker] handleCancel called"), s(n), d(!1);
41
+ }, D = () => {
42
+ console.log("[DatePicker] handleClear called"), s(void 0), f(""), i?.(void 0), p || d(!1);
40
43
  };
41
- return /* @__PURE__ */ y(q, { open: l, onOpenChange: f, children: [
42
- /* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
43
- X,
44
+ return /* @__PURE__ */ C(z, { open: r, onOpenChange: d, children: [
45
+ /* @__PURE__ */ a(G, { asChild: !0, children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
46
+ q,
44
47
  {
45
48
  ref: A,
46
- value: m,
49
+ value: h,
47
50
  onChange: (e) => {
48
- const s = L(e.target.value, t);
49
- if (d(s), s === "") {
50
- c(void 0), p || i?.(void 0);
51
+ const o = X(e.target.value, t);
52
+ if (f(o), o === "") {
53
+ s(void 0), p || i?.(void 0);
51
54
  return;
52
55
  }
53
- const u = C(s, t, /* @__PURE__ */ new Date());
54
- k(u) && (c(u), h(u), p || i?.(u));
56
+ const u = y(o, t, /* @__PURE__ */ new Date());
57
+ k(u) && (s(u), m(u), p || i?.(u));
55
58
  },
56
59
  onBlur: () => {
57
- if (m === "") {
58
- g();
60
+ if (h === "") {
61
+ D();
59
62
  return;
60
63
  }
61
- const e = C(m, t, /* @__PURE__ */ new Date());
62
- k(e) || d(r ? D(r, t) : "");
64
+ const e = y(h, t, /* @__PURE__ */ new Date());
65
+ k(e) || f(c ? g(c, t) : "");
63
66
  },
64
- onClick: (e) => l && e.stopPropagation(),
65
- placeholder: l ? t : S,
67
+ onClick: (e) => r && e.stopPropagation(),
68
+ placeholder: r ? t : S,
66
69
  disabled: P,
67
- className: T("cursor-pointer", N),
68
- suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
69
- n && !P && /* @__PURE__ */ o(
70
- j,
70
+ className: L("cursor-pointer", N),
71
+ suffix: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
72
+ n && !P && /* @__PURE__ */ a(
73
+ R,
71
74
  {
72
75
  className: "h-4 w-4 cursor-pointer hover:text-foreground",
73
76
  onClick: (e) => {
74
- e.stopPropagation(), g();
77
+ e.stopPropagation(), D();
75
78
  }
76
79
  }
77
80
  ),
78
- /* @__PURE__ */ o(R, { className: "h-4 w-4 text-secondary-foreground" })
81
+ /* @__PURE__ */ a(T, { className: "h-4 w-4 text-secondary-foreground" })
79
82
  ] }),
80
83
  ...M
81
84
  }
82
85
  ) }) }),
83
- /* @__PURE__ */ o(
84
- G,
86
+ /* @__PURE__ */ a(
87
+ H,
85
88
  {
86
89
  className: "w-auto p-0",
87
90
  align: "start",
88
91
  onOpenAutoFocus: (e) => e.preventDefault(),
89
92
  onInteractOutside: (e) => e.preventDefault(),
90
- children: /* @__PURE__ */ o(
91
- H,
93
+ children: /* @__PURE__ */ a(
94
+ J,
92
95
  {
93
96
  mode: "single",
94
- selected: r,
97
+ selected: c,
95
98
  onSelect: V,
99
+ onPendingChange: B,
96
100
  month: O,
97
- onMonthChange: h,
101
+ onMonthChange: m,
98
102
  fromDate: v,
99
103
  toDate: w,
100
104
  fromYear: x,
101
105
  toYear: I,
102
106
  showFooter: p,
103
- onApply: B,
104
- onCancel: E,
105
- onClear: g,
107
+ onApply: E,
108
+ onCancel: j,
109
+ onClear: D,
106
110
  captionLayout: "dropdown"
107
111
  }
108
112
  )
@@ -111,7 +115,7 @@ const J = a.forwardRef(
111
115
  ] });
112
116
  }
113
117
  );
114
- J.displayName = "DatePicker";
118
+ K.displayName = "DatePicker";
115
119
  export {
116
- J as DatePicker
120
+ K as DatePicker
117
121
  };
@@ -1,15 +1,15 @@
1
- import { jsxs as m, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
- import { X as W } from "lucide-react";
4
- import { CalendarMonth as Y, Info as Z } from "../../../icons/index.js";
5
- import { format as u, parse as C, isValid as S } from "date-fns";
3
+ import { X as Y } from "lucide-react";
4
+ import { CalendarMonth as Z, Info as $ } from "../../../icons/index.js";
5
+ import { format as p, parse as k, isValid as S } from "date-fns";
6
6
  import { cn as v, maskDate as I } from "../../../lib/utils.js";
7
- import { Popover as $, PopoverTrigger as _, PopoverContent as F } from "../popover.js";
8
- import { Calendar as ee } from "../calendar.js";
9
- const te = c.forwardRef(
7
+ import { Popover as _, PopoverTrigger as F, PopoverContent as ee } from "../popover.js";
8
+ import { Calendar as te } from "../calendar.js";
9
+ const ne = c.forwardRef(
10
10
  ({
11
11
  value: t,
12
- onChange: p,
12
+ onChange: f,
13
13
  format: n = "MM/dd/yyyy",
14
14
  startPlaceholder: M = "Start Date",
15
15
  endPlaceholder: V = "End Date",
@@ -17,68 +17,71 @@ const te = c.forwardRef(
17
17
  maxDate: O,
18
18
  fromYear: j,
19
19
  toYear: B,
20
- showFooter: f = !0,
20
+ showFooter: m = !0,
21
21
  disabled: g,
22
22
  label: D,
23
- helperText: R,
24
- prefix: ne,
25
- prefixClick: oe,
26
- isError: x,
27
- size: N,
23
+ helperText: P,
24
+ prefix: oe,
25
+ prefixClick: re,
26
+ isError: h,
27
+ size: R,
28
28
  required: E,
29
29
  className: z,
30
30
  ...L
31
31
  }, T) => {
32
- const [l, h] = c.useState(!1), [o, i] = c.useState(t), [X, b] = c.useState(t?.from ? u(t.from, n) : ""), [q, y] = c.useState(t?.to ? u(t.to, n) : ""), [G, w] = c.useState(t?.from || /* @__PURE__ */ new Date());
32
+ const [l, x] = c.useState(!1), [r, i] = c.useState(t), [X, b] = c.useState(t?.from ? p(t.from, n) : ""), [q, y] = c.useState(t?.to ? p(t.to, n) : ""), [G, w] = c.useState(t?.from || /* @__PURE__ */ new Date());
33
33
  c.useEffect(() => {
34
- b(t?.from ? u(t.from, n) : ""), y(t?.to ? u(t.to, n) : "");
34
+ b(t?.from ? p(t.from, n) : ""), y(t?.to ? p(t.to, n) : "");
35
35
  }, [t, n]), c.useEffect(() => {
36
- console.log("[DateRangePicker] useEffect - open:", l, "value:", t, "pendingRange:", o), l && (i(t), w(t?.from || /* @__PURE__ */ new Date()));
36
+ console.log("[DateRangePicker] useEffect - open:", l, "value:", t, "pendingRange:", r), l && (i(t), w(t?.from || /* @__PURE__ */ new Date()));
37
37
  }, [l]);
38
38
  const H = (e) => {
39
- console.log("[DateRangePicker] handleSelect called:", e), i(e), !f && e?.from && e?.to && (console.log("[DateRangePicker] No footer - applying immediately"), p?.(e), h(!1));
39
+ console.log("[DateRangePicker] handleSelect called:", e), i(e), !m && e?.from && e?.to && (console.log("[DateRangePicker] No footer - applying immediately"), f?.(e), x(!1));
40
40
  }, J = (e) => {
41
- const a = e !== void 0 ? e : o;
42
- console.log("[DateRangePicker] handleApply called, appliedRange:", e, "pendingRange:", o, "using:", a), p?.(a), h(!1);
43
- }, K = () => {
44
- console.log("[DateRangePicker] handleCancel called"), i(t), h(!1);
45
- }, k = () => {
46
- console.log("[DateRangePicker] handleClear called"), i(void 0), b(""), y(""), p?.(void 0), f || h(!1);
47
- }, Q = (e) => {
48
- const a = I(e.target.value, n);
49
- if (b(a), a === "") {
50
- const r = { from: void 0, to: o?.to };
51
- i(r), f || p?.(r);
41
+ const o = e;
42
+ b(o?.from ? p(o.from, n) : ""), y(o?.to ? p(o.to, n) : "");
43
+ }, K = (e) => {
44
+ const o = e !== void 0 ? e : r;
45
+ console.log("[DateRangePicker] handleApply called, appliedRange:", e, "pendingRange:", r, "using:", o), f?.(o), x(!1);
46
+ }, Q = () => {
47
+ console.log("[DateRangePicker] handleCancel called"), i(t), x(!1);
48
+ }, C = () => {
49
+ console.log("[DateRangePicker] handleClear called"), i(void 0), b(""), y(""), f?.(void 0), m || x(!1);
50
+ }, U = (e) => {
51
+ const o = I(e.target.value, n);
52
+ if (b(o), o === "") {
53
+ const a = { from: void 0, to: r?.to };
54
+ i(a), m || f?.(a);
52
55
  return;
53
56
  }
54
- const d = C(a, n, /* @__PURE__ */ new Date());
57
+ const d = k(o, n, /* @__PURE__ */ new Date());
55
58
  if (S(d)) {
56
- const r = { from: d, to: o?.to };
57
- i(r), w(d), f || p?.(r);
59
+ const a = { from: d, to: r?.to };
60
+ i(a), w(d), m || f?.(a);
58
61
  }
59
- }, U = (e) => {
60
- const a = I(e.target.value, n);
61
- if (y(a), a === "") {
62
- const r = { from: o?.from, to: void 0 };
63
- i(r), f || p?.(r);
62
+ }, W = (e) => {
63
+ const o = I(e.target.value, n);
64
+ if (y(o), o === "") {
65
+ const a = { from: r?.from, to: void 0 };
66
+ i(a), m || f?.(a);
64
67
  return;
65
68
  }
66
- const d = C(a, n, /* @__PURE__ */ new Date());
69
+ const d = k(o, n, /* @__PURE__ */ new Date());
67
70
  if (S(d)) {
68
- const r = { from: o?.from, to: d };
69
- i(r), d && w(d), f || p?.(r);
71
+ const a = { from: r?.from, to: d };
72
+ i(a), d && w(d), m || f?.(a);
70
73
  }
71
- }, P = () => {
72
- b(o?.from ? u(o.from, n) : ""), y(o?.to ? u(o.to, n) : "");
74
+ }, N = () => {
75
+ b(r?.from ? p(r.from, n) : ""), y(r?.to ? p(r.to, n) : "");
73
76
  };
74
- return /* @__PURE__ */ m("div", { className: "w-full space-y-1.5 min-w-[240px]", children: [
75
- D && /* @__PURE__ */ m(
77
+ return /* @__PURE__ */ u("div", { className: "w-full space-y-1.5 min-w-[240px]", children: [
78
+ D && /* @__PURE__ */ u(
76
79
  "label",
77
80
  {
78
81
  className: v(
79
82
  "text-xs font-medium leading-[18px] text-[#60697d]",
80
83
  g && "opacity-70",
81
- x && "text-destructive"
84
+ h && "text-destructive"
82
85
  ),
83
86
  children: [
84
87
  D,
@@ -87,28 +90,28 @@ const te = c.forwardRef(
87
90
  ]
88
91
  }
89
92
  ),
90
- /* @__PURE__ */ m($, { open: l, onOpenChange: h, children: [
91
- /* @__PURE__ */ s(_, { asChild: !0, children: /* @__PURE__ */ m(
93
+ /* @__PURE__ */ u(_, { open: l, onOpenChange: x, children: [
94
+ /* @__PURE__ */ s(F, { asChild: !0, children: /* @__PURE__ */ u(
92
95
  "div",
93
96
  {
94
97
  className: v(
95
98
  "flex w-full items-center justify-between gap-2 rounded-md border bg-transparent px-3 text-sm shadow-sm transition-colors hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border",
96
- x ? "border-destructive hover:border-destructive" : "border-input",
97
- N === "sm" ? "h-6" : N === "md" ? "h-[28px]" : "h-8",
99
+ h ? "border-destructive hover:border-destructive" : "border-input",
100
+ R === "sm" ? "h-6" : R === "md" ? "h-[28px]" : "h-8",
98
101
  g && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
99
102
  "cursor-pointer",
100
103
  z
101
104
  ),
102
105
  children: [
103
- /* @__PURE__ */ m("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
106
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
104
107
  /* @__PURE__ */ s(
105
108
  "input",
106
109
  {
107
110
  ref: T,
108
111
  type: "text",
109
112
  value: X,
110
- onChange: Q,
111
- onBlur: P,
113
+ onChange: U,
114
+ onBlur: N,
112
115
  onClick: (e) => l && e.stopPropagation(),
113
116
  placeholder: l ? n : M,
114
117
  disabled: !!g,
@@ -121,8 +124,8 @@ const te = c.forwardRef(
121
124
  {
122
125
  type: "text",
123
126
  value: q,
124
- onChange: U,
125
- onBlur: P,
127
+ onChange: W,
128
+ onBlur: N,
126
129
  onClick: (e) => l && e.stopPropagation(),
127
130
  placeholder: l ? n : V,
128
131
  disabled: !!g,
@@ -130,67 +133,67 @@ const te = c.forwardRef(
130
133
  }
131
134
  )
132
135
  ] }),
133
- /* @__PURE__ */ m("div", { className: "flex items-center gap-1 shrink-0", children: [
136
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-1 shrink-0", children: [
134
137
  t?.from && !g && /* @__PURE__ */ s(
135
- W,
138
+ Y,
136
139
  {
137
140
  className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
138
141
  onClick: (e) => {
139
- e.stopPropagation(), k();
142
+ e.stopPropagation(), C();
140
143
  }
141
144
  }
142
145
  ),
143
- /* @__PURE__ */ s(Y, { className: "h-4 w-4 text-secondary-foreground" })
146
+ /* @__PURE__ */ s(Z, { className: "h-4 w-4 text-secondary-foreground" })
144
147
  ] })
145
148
  ]
146
149
  }
147
150
  ) }),
148
151
  /* @__PURE__ */ s(
149
- F,
152
+ ee,
150
153
  {
151
154
  className: "w-auto p-0",
152
155
  align: "start",
153
156
  onOpenAutoFocus: (e) => e.preventDefault(),
154
157
  onInteractOutside: (e) => e.preventDefault(),
155
158
  children: /* @__PURE__ */ s(
156
- ee,
159
+ te,
157
160
  {
158
161
  mode: "range",
159
- selected: o,
162
+ selected: r,
160
163
  onSelect: H,
164
+ onPendingChange: J,
161
165
  month: G,
162
166
  onMonthChange: w,
163
- fromDate: A,
164
- toDate: O,
167
+ disabled: { before: A, after: O },
165
168
  fromYear: j,
166
169
  toYear: B,
167
- showFooter: f,
168
- onApply: J,
169
- onCancel: K,
170
- onClear: k,
170
+ showFooter: m,
171
+ onApply: K,
172
+ onCancel: Q,
173
+ onClear: C,
171
174
  captionLayout: "dropdown"
172
175
  }
173
176
  )
174
177
  }
175
178
  )
176
179
  ] }),
177
- R && /* @__PURE__ */ m("div", { className: v("flex items-center gap-1", x && "text-destructive"), children: [
178
- !x && /* @__PURE__ */ s(Z, { size: 10, className: "shrink-0 text-muted-foreground" }),
180
+ P && /* @__PURE__ */ u("div", { className: v("flex items-center gap-1", h && "text-destructive"), children: [
181
+ !h && /* @__PURE__ */ s($, { size: 10, className: "shrink-0 text-muted-foreground" }),
179
182
  /* @__PURE__ */ s(
180
183
  "p",
181
184
  {
182
185
  className: v(
183
186
  "text-[10px] text-[#7a8294]",
184
- x && "text-destructive"
187
+ h && "text-destructive"
185
188
  ),
186
- children: R
189
+ children: P
187
190
  }
188
191
  )
189
192
  ] })
190
193
  ] });
191
194
  }
192
195
  );
193
- te.displayName = "DateRangePicker";
196
+ ne.displayName = "DateRangePicker";
194
197
  export {
195
- te as DateRangePicker
198
+ ne as DateRangePicker
196
199
  };
@@ -1,110 +1,114 @@
1
- import { jsxs as P, jsx as n } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { X as v } from "lucide-react";
4
- import { CalendarMonth as B } from "../../../icons/index.js";
5
- import { parse as E, isValid as T } from "date-fns";
6
- import { cn as j, maskDate as R } from "../../../lib/utils.js";
7
- import { Input as $ } from "../input.js";
8
- import { Popover as X, PopoverTrigger as q, PopoverContent as z } from "../popover.js";
9
- import { Calendar as G } from "../calendar.js";
10
- const u = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, H = o.forwardRef(
1
+ import { jsxs as P, jsx as o } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { X as B } from "lucide-react";
4
+ import { CalendarMonth as E } from "../../../icons/index.js";
5
+ import { parse as T, isValid as j } from "date-fns";
6
+ import { cn as R, maskDate as $ } from "../../../lib/utils.js";
7
+ import { Input as X } from "../input.js";
8
+ import { Popover as q, PopoverTrigger as z, PopoverContent as G } from "../popover.js";
9
+ import { Calendar as H } from "../calendar.js";
10
+ const f = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, J = r.forwardRef(
11
11
  ({
12
12
  value: e,
13
- onChange: r,
13
+ onChange: a,
14
14
  placeholder: C = "Select Month",
15
15
  minDate: k,
16
16
  maxDate: S,
17
17
  fromYear: D,
18
18
  toYear: w,
19
19
  showFooter: i = !0,
20
- disabled: M,
20
+ disabled: u,
21
21
  className: x,
22
22
  ...I
23
23
  }, N) => {
24
- const [a, p] = o.useState(!1), [l, c] = o.useState(e), [g, h] = o.useState(e ? u(e) : ""), [A, f] = o.useState(() => e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date());
25
- o.useEffect(() => {
26
- h(e ? u(e) : "");
27
- }, [e]), o.useEffect(() => {
28
- console.log("[MonthPicker] useEffect - open:", a, "value:", e, "pendingMonth:", l), a && (c(e), f(e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date()));
29
- }, [a]);
30
- const Y = (t) => {
31
- console.log("[MonthPicker] handleSelect called:", t), c(t), i || (console.log("[MonthPicker] No footer - applying immediately"), r?.(t), p(!1));
32
- }, O = (t) => {
33
- const s = t !== void 0 ? t : l;
34
- console.log("[MonthPicker] handleApply called, appliedMonth:", t, "pendingMonth:", l, "using:", s), r?.(s), p(!1);
35
- }, V = () => {
36
- console.log("[MonthPicker] handleCancel called"), c(e), p(!1);
37
- }, m = () => {
38
- console.log("[MonthPicker] handleClear called"), c(void 0), h(""), r?.(void 0), i || p(!1);
24
+ const [l, p] = r.useState(!1), [c, s] = r.useState(e), [M, h] = r.useState(e ? f(e) : ""), [A, m] = r.useState(() => e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date());
25
+ r.useEffect(() => {
26
+ h(e ? f(e) : "");
27
+ }, [e]), r.useEffect(() => {
28
+ console.log("[MonthPicker] useEffect - open:", l, "value:", e, "pendingMonth:", c), l && (s(e), m(e ? new Date(e.year, e.month, 1) : /* @__PURE__ */ new Date()));
29
+ }, [l]);
30
+ const Y = (n) => {
31
+ console.log("[MonthPicker] handleSelect called:", n), s(n), i || (console.log("[MonthPicker] No footer - applying immediately"), a?.(n), p(!1));
32
+ }, O = (n) => {
33
+ const t = n;
34
+ h(t ? f(t) : "");
35
+ }, V = (n) => {
36
+ const t = n !== void 0 ? n : c;
37
+ console.log("[MonthPicker] handleApply called, appliedMonth:", n, "pendingMonth:", c, "using:", t), a?.(t), p(!1);
38
+ }, v = () => {
39
+ console.log("[MonthPicker] handleCancel called"), s(e), p(!1);
40
+ }, g = () => {
41
+ console.log("[MonthPicker] handleClear called"), s(void 0), h(""), a?.(void 0), i || p(!1);
39
42
  };
40
- return /* @__PURE__ */ P(X, { open: a, onOpenChange: p, children: [
41
- /* @__PURE__ */ n(q, { asChild: !0, children: /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
42
- $,
43
+ return /* @__PURE__ */ P(q, { open: l, onOpenChange: p, children: [
44
+ /* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
45
+ X,
43
46
  {
44
47
  ref: N,
45
- value: g,
46
- onChange: (t) => {
47
- const s = R(t.target.value, "MM/yyyy");
48
- if (h(s), s === "") {
49
- c(void 0), i || r?.(void 0);
48
+ value: M,
49
+ onChange: (n) => {
50
+ const t = $(n.target.value, "MM/yyyy");
51
+ if (h(t), t === "") {
52
+ s(void 0), i || a?.(void 0);
50
53
  return;
51
54
  }
52
- const d = E(s, "MM/yyyy", /* @__PURE__ */ new Date());
53
- if (T(d)) {
55
+ const d = T(t, "MM/yyyy", /* @__PURE__ */ new Date());
56
+ if (j(d)) {
54
57
  const y = { month: d.getMonth(), year: d.getFullYear() };
55
- c(y), f(d), i || r?.(y);
58
+ s(y), m(d), i || a?.(y);
56
59
  }
57
60
  },
58
61
  onBlur: () => {
59
- if (g === "") {
60
- m();
62
+ if (M === "") {
63
+ g();
61
64
  return;
62
65
  }
63
- h(l ? u(l) : "");
66
+ h(c ? f(c) : "");
64
67
  },
65
- onClick: (t) => a && t.stopPropagation(),
66
- placeholder: a ? "MM/YYYY" : C,
67
- disabled: M,
68
- className: j("cursor-pointer", x),
68
+ onClick: (n) => l && n.stopPropagation(),
69
+ placeholder: l ? "MM/YYYY" : C,
70
+ disabled: u,
71
+ className: R("cursor-pointer", x),
69
72
  suffix: /* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
70
- e && !M && /* @__PURE__ */ n(
71
- v,
73
+ e && !u && /* @__PURE__ */ o(
74
+ B,
72
75
  {
73
76
  className: "h-4 w-4 cursor-pointer hover:text-foreground",
74
- onClick: (t) => {
75
- t.stopPropagation(), m();
77
+ onClick: (n) => {
78
+ n.stopPropagation(), g();
76
79
  }
77
80
  }
78
81
  ),
79
- /* @__PURE__ */ n(B, { className: "h-4 w-4 text-secondary-foreground" })
82
+ /* @__PURE__ */ o(E, { className: "h-4 w-4 text-secondary-foreground" })
80
83
  ] }),
81
84
  ...I
82
85
  }
83
86
  ) }) }),
84
- /* @__PURE__ */ n(
85
- z,
87
+ /* @__PURE__ */ o(
88
+ G,
86
89
  {
87
90
  className: "w-auto p-0",
88
91
  align: "start",
89
- onOpenAutoFocus: (t) => t.preventDefault(),
90
- onInteractOutside: (t) => t.preventDefault(),
91
- children: /* @__PURE__ */ n(
92
- G,
92
+ onOpenAutoFocus: (n) => n.preventDefault(),
93
+ onInteractOutside: (n) => n.preventDefault(),
94
+ children: /* @__PURE__ */ o(
95
+ H,
93
96
  {
94
97
  pickerType: "month",
95
98
  monthMode: "single",
96
- selectedMonths: l,
99
+ selectedMonths: c,
97
100
  onMonthSelect: Y,
101
+ onPendingChange: O,
98
102
  month: A,
99
- onMonthChange: f,
103
+ onMonthChange: m,
100
104
  fromDate: k,
101
105
  toDate: S,
102
106
  fromYear: D,
103
107
  toYear: w,
104
108
  showFooter: i,
105
- onApply: O,
106
- onCancel: V,
107
- onClear: m
109
+ onApply: V,
110
+ onCancel: v,
111
+ onClear: g
108
112
  }
109
113
  )
110
114
  }
@@ -112,7 +116,7 @@ const u = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, H = o
112
116
  ] });
113
117
  }
114
118
  );
115
- H.displayName = "MonthPicker";
119
+ J.displayName = "MonthPicker";
116
120
  export {
117
- H as MonthPicker
121
+ J as MonthPicker
118
122
  };