impact-nova 1.1.1 → 1.1.2
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.
- package/dist/components/ui/accordion.js +37 -33
- package/dist/components/ui/alert.d.ts +2 -0
- package/dist/components/ui/alert.js +46 -31
- package/dist/components/ui/breadcrumb.d.ts +7 -2
- package/dist/components/ui/breadcrumb.js +98 -77
- package/dist/components/ui/calendar.js +198 -178
- package/dist/components/ui/date-picker/date-picker.js +94 -87
- package/dist/components/ui/date-picker/date-range-picker.js +124 -117
- package/dist/components/ui/date-picker/month-picker.js +98 -91
- package/dist/components/ui/date-picker/month-range-picker.js +118 -111
- package/dist/components/ui/date-picker/multi-date-picker.js +76 -69
- package/dist/components/ui/date-picker/multi-month-picker.js +72 -65
- package/dist/components/ui/date-picker/multi-week-picker.js +88 -81
- package/dist/components/ui/date-picker/week-picker.js +107 -100
- package/dist/components/ui/date-picker/week-range-picker.js +144 -137
- package/dist/components/ui/dialog.js +65 -61
- package/dist/components/ui/drawer.d.ts +3 -1
- package/dist/components/ui/drawer.js +44 -29
- package/dist/components/ui/file-upload.d.ts +2 -1
- package/dist/components/ui/file-upload.js +159 -135
- package/dist/components/ui/filter-panel/filter-panel.js +89 -70
- package/dist/components/ui/filter-strip/filter-summary.js +117 -104
- package/dist/components/ui/filter-strip/filter-tag-list.js +81 -65
- package/dist/components/ui/popover.js +52 -48
- package/dist/components/ui/prompt.d.ts +2 -1
- package/dist/components/ui/prompt.js +81 -64
- package/dist/components/ui/sheet.js +91 -84
- package/dist/components/ui/sidebar.js +9 -8
- package/dist/components/ui/tabs.d.ts +2 -0
- package/dist/components/ui/tabs.js +58 -55
- package/dist/components/ui/tag.js +21 -20
- package/dist/components/ui/toast.js +41 -37
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +250 -248
- package/package.json +1 -1
|
@@ -1,116 +1,123 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X } from "lucide-react";
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { isValid as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
|
|
1
|
+
import { jsxs as y, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { X as G } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as J } from "../../../icons/index.js";
|
|
5
|
+
import { isValid as g, parse as u } from "date-fns";
|
|
6
|
+
import { cn as K, padValidDateString as L, maskDate as Q } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as U } from "../input.js";
|
|
8
|
+
import { Popover as W, PopoverTrigger as Z, PopoverContent as _ } from "../popover.js";
|
|
9
|
+
import { Calendar as F } from "../calendar.js";
|
|
10
|
+
import { Tooltip as k, TooltipTrigger as T, TooltipContent as V } from "../tooltip.js";
|
|
11
|
+
const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, v = o.forwardRef(
|
|
11
12
|
({
|
|
12
13
|
value: t,
|
|
13
|
-
onChange:
|
|
14
|
-
placeholder:
|
|
15
|
-
minDate:
|
|
16
|
-
maxDate:
|
|
17
|
-
startMonth:
|
|
18
|
-
endMonth:
|
|
19
|
-
showFooter:
|
|
20
|
-
disabled:
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
23
|
-
},
|
|
24
|
-
const S =
|
|
25
|
-
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
!
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
14
|
+
onChange: s,
|
|
15
|
+
placeholder: I = "Select Month",
|
|
16
|
+
minDate: N,
|
|
17
|
+
maxDate: Y,
|
|
18
|
+
startMonth: A,
|
|
19
|
+
endMonth: R,
|
|
20
|
+
showFooter: d = !0,
|
|
21
|
+
disabled: C,
|
|
22
|
+
className: O,
|
|
23
|
+
...j
|
|
24
|
+
}, B) => {
|
|
25
|
+
const S = o.useRef(null);
|
|
26
|
+
o.useRef(null), o.useImperativeHandle(B, () => S.current);
|
|
27
|
+
const [r, h] = o.useState(!1), [w, i] = o.useState(t), [p, a] = o.useState(t ? c(t) : ""), [E, M] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
28
|
+
o.useEffect(() => {
|
|
29
|
+
!r && t && (a(c(t)), i(t));
|
|
30
|
+
}, [r, t]), o.useEffect(() => {
|
|
31
|
+
r && (i(t), M(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), a(t ? c(t) : ""));
|
|
32
|
+
}, [r, t]);
|
|
33
|
+
const $ = (e) => {
|
|
34
|
+
i(e), e && a(c(e)), d || (s?.(e), h(!1));
|
|
35
|
+
}, b = (e) => {
|
|
36
|
+
s?.(e !== void 0 ? e : w), h(!1);
|
|
37
|
+
}, H = () => {
|
|
38
|
+
i(t), a(t ? c(t) : ""), h(!1);
|
|
38
39
|
}, D = () => {
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
40
|
+
i(void 0), a(""), s?.(void 0), d || h(!1);
|
|
41
|
+
}, X = (e) => {
|
|
42
|
+
const l = e.target.value, f = Q(l, "MM/yyyy", p);
|
|
43
|
+
if (a(f), f === "") {
|
|
44
|
+
i(void 0), d || s?.(void 0);
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
47
|
+
const m = u(f, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
48
|
+
if (g(m) && f.length === 7) {
|
|
49
|
+
const x = { month: m.getMonth(), year: m.getFullYear() };
|
|
50
|
+
i(x), M(m), d || s?.(x);
|
|
50
51
|
}
|
|
51
|
-
},
|
|
52
|
-
if (
|
|
53
|
-
const e =
|
|
54
|
-
if (!
|
|
55
|
-
|
|
56
|
-
else if (
|
|
57
|
-
const
|
|
58
|
-
|
|
52
|
+
}, q = () => {
|
|
53
|
+
if (r) return;
|
|
54
|
+
const e = L(p, "MM/yyyy"), l = u(e, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
55
|
+
if (!g(l) || e.length !== 7)
|
|
56
|
+
a(t ? c(t) : ""), i(t);
|
|
57
|
+
else if (a(e), !d) {
|
|
58
|
+
const f = { month: l.getMonth(), year: l.getFullYear() };
|
|
59
|
+
s?.(f);
|
|
59
60
|
}
|
|
60
|
-
},
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
61
|
+
}, P = (t ? c(t) : "") !== p, z = p.length === 7 && !g(u(p, "MM/yyyy", /* @__PURE__ */ new Date()));
|
|
62
|
+
return /* @__PURE__ */ y(W, { open: r, onOpenChange: h, children: [
|
|
63
|
+
/* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n("div", { "data-component": "month-picker", "data-state": r ? "open" : "closed", "data-pending": P || void 0, children: /* @__PURE__ */ n(
|
|
64
|
+
U,
|
|
64
65
|
{
|
|
65
66
|
ref: S,
|
|
66
|
-
value:
|
|
67
|
-
onChange:
|
|
68
|
-
onBlur:
|
|
69
|
-
onClick: (e) =>
|
|
70
|
-
placeholder:
|
|
71
|
-
disabled:
|
|
67
|
+
value: p,
|
|
68
|
+
onChange: X,
|
|
69
|
+
onBlur: q,
|
|
70
|
+
onClick: (e) => r && e.stopPropagation(),
|
|
71
|
+
placeholder: r ? "MM/YYYY" : I,
|
|
72
|
+
disabled: C,
|
|
72
73
|
"data-form-control": "input",
|
|
73
|
-
className:
|
|
74
|
+
className: K(
|
|
74
75
|
"cursor-pointer",
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
z ? "text-destructive" : P ? "text-muted-foreground" : "",
|
|
77
|
+
O
|
|
77
78
|
),
|
|
78
|
-
suffix: /* @__PURE__ */
|
|
79
|
-
t && !
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
e
|
|
79
|
+
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
80
|
+
t && !C && /* @__PURE__ */ y(k, { children: [
|
|
81
|
+
/* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(
|
|
82
|
+
G,
|
|
83
|
+
{
|
|
84
|
+
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
85
|
+
onClick: (e) => {
|
|
86
|
+
e.stopPropagation(), D();
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
) }),
|
|
90
|
+
/* @__PURE__ */ n(V, { variant: "tertiary", side: "top", children: "Clear" })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ y(k, { children: [
|
|
93
|
+
/* @__PURE__ */ n(T, { asChild: !0, children: /* @__PURE__ */ n(J, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
94
|
+
/* @__PURE__ */ n(V, { variant: "tertiary", side: "top", children: "Pick a month" })
|
|
95
|
+
] })
|
|
89
96
|
] }),
|
|
90
|
-
...
|
|
97
|
+
...j
|
|
91
98
|
}
|
|
92
99
|
) }) }),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
100
|
+
/* @__PURE__ */ n(
|
|
101
|
+
_,
|
|
95
102
|
{
|
|
96
103
|
className: "w-auto p-0",
|
|
97
104
|
align: "start",
|
|
98
105
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
-
|
|
106
|
+
children: /* @__PURE__ */ n(
|
|
107
|
+
F,
|
|
101
108
|
{
|
|
102
109
|
pickerType: "month",
|
|
103
110
|
monthMode: "single",
|
|
104
111
|
selectedMonths: w,
|
|
105
|
-
onMonthSelect:
|
|
106
|
-
month:
|
|
107
|
-
onMonthChange:
|
|
108
|
-
disabled: { before:
|
|
109
|
-
startMonth:
|
|
110
|
-
endMonth:
|
|
111
|
-
showFooter:
|
|
112
|
-
onApply:
|
|
113
|
-
onCancel:
|
|
112
|
+
onMonthSelect: $,
|
|
113
|
+
month: E,
|
|
114
|
+
onMonthChange: M,
|
|
115
|
+
disabled: { before: N, after: Y },
|
|
116
|
+
startMonth: A,
|
|
117
|
+
endMonth: R,
|
|
118
|
+
showFooter: d,
|
|
119
|
+
onApply: b,
|
|
120
|
+
onCancel: H,
|
|
114
121
|
onClear: D
|
|
115
122
|
}
|
|
116
123
|
)
|
|
@@ -119,7 +126,7 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Z = n
|
|
|
119
126
|
] });
|
|
120
127
|
}
|
|
121
128
|
);
|
|
122
|
-
|
|
129
|
+
v.displayName = "MonthPicker";
|
|
123
130
|
export {
|
|
124
|
-
|
|
131
|
+
v as MonthPicker
|
|
125
132
|
};
|
|
@@ -1,199 +1,206 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
3
|
+
import { X as dt } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as st, Info as at } from "../../../icons/index.js";
|
|
5
5
|
import { isValid as b, parse as w } from "date-fns";
|
|
6
|
-
import { cn as S, padValidDateString as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
|
|
6
|
+
import { cn as S, padValidDateString as T, maskDate as A } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as it, PopoverTrigger as ct, PopoverContent as lt } from "../popover.js";
|
|
8
|
+
import { Calendar as mt } from "../calendar.js";
|
|
9
|
+
import { Tooltip as j, TooltipTrigger as B, TooltipContent as O } from "../tooltip.js";
|
|
10
|
+
const n = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ft = s.forwardRef(
|
|
10
11
|
({
|
|
11
12
|
value: t,
|
|
12
13
|
onChange: l,
|
|
13
|
-
placeholder:
|
|
14
|
-
minDate:
|
|
15
|
-
maxDate:
|
|
16
|
-
startMonth:
|
|
17
|
-
endMonth:
|
|
18
|
-
showFooter:
|
|
14
|
+
placeholder: pt = "Select Month Range",
|
|
15
|
+
minDate: $,
|
|
16
|
+
maxDate: z,
|
|
17
|
+
startMonth: H,
|
|
18
|
+
endMonth: X,
|
|
19
|
+
showFooter: p = !0,
|
|
19
20
|
disabled: g,
|
|
20
|
-
className:
|
|
21
|
-
isError:
|
|
22
|
-
size:
|
|
21
|
+
className: q,
|
|
22
|
+
isError: C,
|
|
23
|
+
size: N,
|
|
23
24
|
label: D,
|
|
24
25
|
helperText: I,
|
|
25
|
-
required:
|
|
26
|
-
prefix:
|
|
27
|
-
prefixClick:
|
|
28
|
-
...
|
|
29
|
-
},
|
|
30
|
-
const Y = s.useRef(null),
|
|
31
|
-
s.useRef(null), s.useRef(null), s.useImperativeHandle(
|
|
32
|
-
const [
|
|
26
|
+
required: G,
|
|
27
|
+
prefix: ht,
|
|
28
|
+
prefixClick: yt,
|
|
29
|
+
...J
|
|
30
|
+
}, K) => {
|
|
31
|
+
const Y = s.useRef(null), L = s.useRef(null);
|
|
32
|
+
s.useRef(null), s.useRef(null), s.useImperativeHandle(K, () => Y.current);
|
|
33
|
+
const [a, P] = s.useState(!1), [k, i] = s.useState(t), [x, h] = s.useState(t?.from ? n(t.from) : ""), [M, y] = s.useState(t?.to ? n(t.to) : ""), [Q, R] = s.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
|
|
33
34
|
s.useEffect(() => {
|
|
34
|
-
!
|
|
35
|
-
}, [
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
l?.(e !== void 0 ? e : k),
|
|
42
|
-
},
|
|
43
|
-
|
|
35
|
+
!a && t && (h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), i(t));
|
|
36
|
+
}, [a, t]), s.useEffect(() => {
|
|
37
|
+
a && (i(t), h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), R(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
|
|
38
|
+
}, [a, t]);
|
|
39
|
+
const U = (e) => {
|
|
40
|
+
i(e), e?.from && h(n(e.from)), e?.to && y(n(e.to)), !p && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (l?.(e), P(!1));
|
|
41
|
+
}, W = (e) => {
|
|
42
|
+
l?.(e !== void 0 ? e : k), P(!1);
|
|
43
|
+
}, Z = () => {
|
|
44
|
+
i(t), h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), P(!1);
|
|
44
45
|
}, V = () => {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
const m = e.target.value,
|
|
48
|
-
if (
|
|
49
|
-
const
|
|
50
|
-
|
|
46
|
+
i(void 0), h(""), y(""), l?.(void 0), p || P(!1);
|
|
47
|
+
}, v = (e) => {
|
|
48
|
+
const m = e.target.value, r = A(m, "MM/yyyy", x);
|
|
49
|
+
if (h(r), r === "") {
|
|
50
|
+
const c = { from: void 0, to: t?.to };
|
|
51
|
+
i(c), p || l?.(c);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
|
-
const
|
|
54
|
-
if (b(
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
const d = w(r, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
55
|
+
if (b(d) && r.length === 7) {
|
|
56
|
+
const u = { from: { month: d.getMonth(), year: d.getFullYear() }, to: t?.to };
|
|
57
|
+
i(u), R(d), p || l?.(u);
|
|
57
58
|
}
|
|
58
|
-
},
|
|
59
|
-
const m = e.target.value,
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
|
|
59
|
+
}, F = (e) => {
|
|
60
|
+
const m = e.target.value, r = A(m, "MM/yyyy", M);
|
|
61
|
+
if (y(r), r === "") {
|
|
62
|
+
const c = { from: t?.from, to: void 0 };
|
|
63
|
+
i(c), p || l?.(c);
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
const
|
|
66
|
-
if (b(
|
|
67
|
-
const
|
|
68
|
-
|
|
66
|
+
const d = w(r, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
67
|
+
if (b(d) && r.length === 7) {
|
|
68
|
+
const c = { month: d.getMonth(), year: d.getFullYear() }, u = { from: t?.from, to: c };
|
|
69
|
+
i(u), R(d), p || l?.(u);
|
|
69
70
|
}
|
|
70
71
|
}, E = () => {
|
|
71
|
-
if (
|
|
72
|
-
const e =
|
|
73
|
-
!
|
|
74
|
-
from: { month:
|
|
75
|
-
to: { month:
|
|
72
|
+
if (a) return;
|
|
73
|
+
const e = T(x, "MM/yyyy"), m = T(M, "MM/yyyy"), r = w(e, "MM/yyyy", /* @__PURE__ */ new Date()), d = w(m, "MM/yyyy", /* @__PURE__ */ new Date()), c = b(r) && e.length === 7, u = b(d) && m.length === 7;
|
|
74
|
+
!c || !u ? (h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), i(t)) : (h(e), y(m), p || l?.({
|
|
75
|
+
from: { month: r.getMonth(), year: r.getFullYear() },
|
|
76
|
+
to: { month: d.getMonth(), year: d.getFullYear() }
|
|
76
77
|
}));
|
|
77
|
-
},
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
D && /* @__PURE__ */
|
|
78
|
+
}, _ = t?.from ? n(t.from) : "", tt = t?.to ? n(t.to) : "", et = x !== _, ot = M !== tt, nt = x.length === 7 && !b(w(x, "MM/yyyy", /* @__PURE__ */ new Date())), rt = M.length === 7 && !b(w(M, "MM/yyyy", /* @__PURE__ */ new Date()));
|
|
79
|
+
return /* @__PURE__ */ f("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "month-range-picker", "data-disabled": g || void 0, children: [
|
|
80
|
+
D && /* @__PURE__ */ f(
|
|
80
81
|
"label",
|
|
81
82
|
{
|
|
82
83
|
className: S(
|
|
83
84
|
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
84
85
|
g && "opacity-70",
|
|
85
|
-
|
|
86
|
+
C && "text-destructive"
|
|
86
87
|
),
|
|
87
88
|
children: [
|
|
88
89
|
D,
|
|
89
90
|
" ",
|
|
90
|
-
|
|
91
|
+
G && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
|
|
91
92
|
]
|
|
92
93
|
}
|
|
93
94
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ f(it, { open: a, onOpenChange: P, children: [
|
|
96
|
+
/* @__PURE__ */ o(ct, { asChild: !0, children: /* @__PURE__ */ f(
|
|
96
97
|
"div",
|
|
97
98
|
{
|
|
98
|
-
"data-state":
|
|
99
|
+
"data-state": a ? "open" : "closed",
|
|
99
100
|
className: S(
|
|
100
101
|
"flex w-full items-center justify-between gap-2 rounded-md border bg-white 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",
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
C ? "border-destructive hover:border-destructive" : "border-input",
|
|
103
|
+
N === "sm" ? "h-6" : N === "md" ? "h-[28px]" : "h-8",
|
|
103
104
|
g && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
104
105
|
"cursor-pointer",
|
|
105
|
-
|
|
106
|
+
q
|
|
106
107
|
),
|
|
107
108
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
110
|
+
/* @__PURE__ */ o(
|
|
110
111
|
"input",
|
|
111
112
|
{
|
|
112
113
|
ref: Y,
|
|
113
114
|
type: "text",
|
|
114
115
|
value: x,
|
|
115
|
-
onChange:
|
|
116
|
+
onChange: v,
|
|
116
117
|
onBlur: E,
|
|
117
|
-
onClick: (e) =>
|
|
118
|
-
placeholder:
|
|
118
|
+
onClick: (e) => a && e.stopPropagation(),
|
|
119
|
+
placeholder: a ? "MM/YYYY" : "Start Month",
|
|
119
120
|
disabled: !!g,
|
|
120
121
|
"data-field": "start",
|
|
121
122
|
className: S(
|
|
122
123
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
123
|
-
|
|
124
|
+
nt ? "text-destructive" : et ? "text-muted-foreground" : ""
|
|
124
125
|
),
|
|
125
|
-
...
|
|
126
|
+
...J
|
|
126
127
|
}
|
|
127
128
|
),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ o(
|
|
129
130
|
"input",
|
|
130
131
|
{
|
|
131
|
-
ref:
|
|
132
|
+
ref: L,
|
|
132
133
|
type: "text",
|
|
133
134
|
value: M,
|
|
134
|
-
onChange:
|
|
135
|
+
onChange: F,
|
|
135
136
|
onBlur: E,
|
|
136
|
-
onClick: (e) =>
|
|
137
|
-
placeholder:
|
|
137
|
+
onClick: (e) => a && e.stopPropagation(),
|
|
138
|
+
placeholder: a ? "MM/YYYY" : "End Month",
|
|
138
139
|
disabled: !!g,
|
|
139
140
|
"data-field": "end",
|
|
140
141
|
className: S(
|
|
141
142
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
142
|
-
|
|
143
|
+
rt ? "text-destructive" : ot ? "text-muted-foreground" : ""
|
|
143
144
|
)
|
|
144
145
|
}
|
|
145
146
|
)
|
|
146
147
|
] }),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
t?.from && !g && /* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
e
|
|
148
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
149
|
+
t?.from && !g && /* @__PURE__ */ f(j, { children: [
|
|
150
|
+
/* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(
|
|
151
|
+
dt,
|
|
152
|
+
{
|
|
153
|
+
className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
|
|
154
|
+
onClick: (e) => {
|
|
155
|
+
e.stopPropagation(), V();
|
|
156
|
+
}
|
|
154
157
|
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
) }),
|
|
159
|
+
/* @__PURE__ */ o(O, { variant: "tertiary", side: "top", children: "Clear" })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ f(j, { children: [
|
|
162
|
+
/* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(st, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
163
|
+
/* @__PURE__ */ o(O, { variant: "tertiary", side: "top", children: "Pick a range" })
|
|
164
|
+
] })
|
|
158
165
|
] })
|
|
159
166
|
]
|
|
160
167
|
}
|
|
161
168
|
) }),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
169
|
+
/* @__PURE__ */ o(
|
|
170
|
+
lt,
|
|
164
171
|
{
|
|
165
172
|
className: "w-auto p-0",
|
|
166
173
|
align: "start",
|
|
167
174
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
-
|
|
175
|
+
children: /* @__PURE__ */ o(
|
|
176
|
+
mt,
|
|
170
177
|
{
|
|
171
178
|
pickerType: "month",
|
|
172
179
|
monthMode: "range",
|
|
173
180
|
selectedMonths: k,
|
|
174
|
-
onMonthSelect:
|
|
175
|
-
month:
|
|
176
|
-
onMonthChange:
|
|
177
|
-
disabled: { before:
|
|
178
|
-
startMonth:
|
|
179
|
-
endMonth:
|
|
180
|
-
showFooter:
|
|
181
|
-
onApply:
|
|
182
|
-
onCancel:
|
|
181
|
+
onMonthSelect: U,
|
|
182
|
+
month: Q,
|
|
183
|
+
onMonthChange: R,
|
|
184
|
+
disabled: { before: $, after: z },
|
|
185
|
+
startMonth: H,
|
|
186
|
+
endMonth: X,
|
|
187
|
+
showFooter: p,
|
|
188
|
+
onApply: W,
|
|
189
|
+
onCancel: Z,
|
|
183
190
|
onClear: V
|
|
184
191
|
}
|
|
185
192
|
)
|
|
186
193
|
}
|
|
187
194
|
)
|
|
188
195
|
] }),
|
|
189
|
-
I && /* @__PURE__ */
|
|
190
|
-
!
|
|
191
|
-
/* @__PURE__ */
|
|
196
|
+
I && /* @__PURE__ */ f("div", { className: S("flex items-center gap-1", C && "text-destructive"), children: [
|
|
197
|
+
!C && /* @__PURE__ */ o(at, { size: 10, className: "shrink-0 text-muted-foreground" }),
|
|
198
|
+
/* @__PURE__ */ o(
|
|
192
199
|
"p",
|
|
193
200
|
{
|
|
194
201
|
className: S(
|
|
195
202
|
"text-[10px] text-[#7a8294]",
|
|
196
|
-
|
|
203
|
+
C && "text-destructive"
|
|
197
204
|
),
|
|
198
205
|
children: I
|
|
199
206
|
}
|
|
@@ -202,7 +209,7 @@ const o = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ct =
|
|
|
202
209
|
] });
|
|
203
210
|
}
|
|
204
211
|
);
|
|
205
|
-
|
|
212
|
+
ft.displayName = "MonthRangePicker";
|
|
206
213
|
export {
|
|
207
|
-
|
|
214
|
+
ft as MonthRangePicker
|
|
208
215
|
};
|