@yuno-payments/dashboard-design-system 0.0.62 → 0.0.64
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.
|
@@ -5,5 +5,8 @@ export interface DatePickerProps {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
iconPosition?: "start" | "end" | "none";
|
|
8
|
+
minDate?: Date;
|
|
9
|
+
maxDate?: Date;
|
|
10
|
+
dateFormat?: string;
|
|
8
11
|
}
|
|
9
|
-
export declare function DatePicker({ date, onDateChange, placeholder, disabled, className, iconPosition, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function DatePicker({ date, onDateChange, placeholder, disabled, className, iconPosition, minDate, maxDate, dateFormat, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as t } from "../../_virtual/jsx-runtime.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Calendar as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { formatDate as
|
|
10
|
-
function
|
|
11
|
-
date:
|
|
3
|
+
import { cn as p } from "../../lib/utils.js";
|
|
4
|
+
import { Button as d } from "./button.js";
|
|
5
|
+
import { Calendar as x } from "./calendar.js";
|
|
6
|
+
import { Popover as u, PopoverTrigger as h, PopoverContent as j } from "./popover.js";
|
|
7
|
+
import w from "../../node_modules/lucide-react/dist/esm/icons/calendar.js";
|
|
8
|
+
import y from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
9
|
+
import { formatDate as v } from "../../node_modules/date-fns/format.js";
|
|
10
|
+
function S({
|
|
11
|
+
date: r,
|
|
12
12
|
onDateChange: s,
|
|
13
13
|
placeholder: a = "Pick a date",
|
|
14
14
|
disabled: n = !1,
|
|
15
|
-
className:
|
|
16
|
-
iconPosition: e = "start"
|
|
15
|
+
className: m,
|
|
16
|
+
iconPosition: e = "start",
|
|
17
|
+
minDate: i,
|
|
18
|
+
maxDate: l,
|
|
19
|
+
dateFormat: c = "MMM d, yyyy"
|
|
17
20
|
}) {
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
21
|
+
const f = e === "start", o = e === "end";
|
|
22
|
+
return /* @__PURE__ */ t.jsxs(u, { children: [
|
|
23
|
+
/* @__PURE__ */ t.jsx(h, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
|
|
24
|
+
d,
|
|
22
25
|
{
|
|
23
26
|
variant: "outline",
|
|
24
|
-
className:
|
|
27
|
+
className: p(
|
|
25
28
|
"w-full text-left font-normal h-9",
|
|
26
29
|
o ? "justify-between" : "justify-start",
|
|
27
|
-
!
|
|
28
|
-
|
|
30
|
+
!r && "text-muted-foreground",
|
|
31
|
+
m
|
|
29
32
|
),
|
|
30
33
|
disabled: n,
|
|
31
34
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
36
|
+
f && /* @__PURE__ */ t.jsx(w, { className: "h-4 w-4" }),
|
|
37
|
+
r ? v(r, c) : /* @__PURE__ */ t.jsx("span", { children: a })
|
|
35
38
|
] }),
|
|
36
|
-
o && /* @__PURE__ */
|
|
39
|
+
o && /* @__PURE__ */ t.jsx(y, { className: "h-4 w-4 opacity-50" })
|
|
37
40
|
]
|
|
38
41
|
}
|
|
39
42
|
) }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
43
|
+
/* @__PURE__ */ t.jsx(j, { className: "w-auto p-0", children: /* @__PURE__ */ t.jsx(
|
|
44
|
+
x,
|
|
42
45
|
{
|
|
43
46
|
mode: "single",
|
|
44
|
-
selected:
|
|
47
|
+
selected: r,
|
|
45
48
|
onSelect: s,
|
|
46
|
-
initialFocus: !0
|
|
49
|
+
initialFocus: !0,
|
|
50
|
+
fromDate: i,
|
|
51
|
+
toDate: l
|
|
47
52
|
}
|
|
48
53
|
) })
|
|
49
54
|
] });
|
|
50
55
|
}
|
|
51
56
|
export {
|
|
52
|
-
|
|
57
|
+
S as DatePicker
|
|
53
58
|
};
|