@yuno-payments/dashboard-design-system 0.0.192 → 0.0.193
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,60 +1,60 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { forwardRef as b, useId as w } from "react";
|
|
3
|
-
import { InputGroup as y, InputGroupAddon as
|
|
4
|
-
import { cn as
|
|
3
|
+
import { InputGroup as y, InputGroupAddon as h, InputGroupInput as z } from "../../../vendor/shadcn/input-group.js";
|
|
4
|
+
import { cn as l } from "../../../lib/utils.js";
|
|
5
5
|
import { Button as B } from "../button/button.js";
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Field as
|
|
8
|
-
import { Label as
|
|
6
|
+
import { Icon as N } from "../icon/icon.js";
|
|
7
|
+
import { Field as R, FieldDescription as A, FieldError as D } from "../../../vendor/shadcn/field.js";
|
|
8
|
+
import { Label as I } from "../label/label.js";
|
|
9
9
|
const L = b(
|
|
10
10
|
({
|
|
11
|
-
className:
|
|
12
|
-
orientation:
|
|
13
|
-
label:
|
|
14
|
-
description:
|
|
15
|
-
error:
|
|
16
|
-
info:
|
|
17
|
-
requiredIndicator:
|
|
18
|
-
required:
|
|
11
|
+
className: v,
|
|
12
|
+
orientation: g = "vertical",
|
|
13
|
+
label: c,
|
|
14
|
+
description: a,
|
|
15
|
+
error: s,
|
|
16
|
+
info: o,
|
|
17
|
+
requiredIndicator: x,
|
|
18
|
+
required: f,
|
|
19
19
|
id: F,
|
|
20
|
-
button:
|
|
20
|
+
button: u,
|
|
21
21
|
disabled: r,
|
|
22
|
-
startIcon:
|
|
22
|
+
startIcon: j,
|
|
23
23
|
startIconProps: d,
|
|
24
|
-
endIcon:
|
|
24
|
+
endIcon: p,
|
|
25
25
|
endIconProps: m,
|
|
26
26
|
inputProps: t,
|
|
27
27
|
...$
|
|
28
28
|
}, E) => {
|
|
29
|
-
const G = w(),
|
|
29
|
+
const G = w(), i = F || t?.id || G, n = !!s;
|
|
30
30
|
return /* @__PURE__ */ e.jsxs(
|
|
31
|
-
|
|
31
|
+
R,
|
|
32
32
|
{
|
|
33
|
-
orientation:
|
|
33
|
+
orientation: g,
|
|
34
34
|
"data-invalid": n,
|
|
35
|
-
className:
|
|
35
|
+
className: l("w-full", v),
|
|
36
36
|
children: [
|
|
37
|
-
o && /* @__PURE__ */ e.jsx(
|
|
38
|
-
|
|
37
|
+
(c || o || x) && /* @__PURE__ */ e.jsx(
|
|
38
|
+
I,
|
|
39
39
|
{
|
|
40
|
-
htmlFor:
|
|
41
|
-
info:
|
|
42
|
-
requiredIndicator:
|
|
43
|
-
required:
|
|
40
|
+
htmlFor: i,
|
|
41
|
+
info: o,
|
|
42
|
+
requiredIndicator: x,
|
|
43
|
+
required: f,
|
|
44
44
|
disabled: r,
|
|
45
|
-
children:
|
|
45
|
+
children: c
|
|
46
46
|
}
|
|
47
47
|
),
|
|
48
48
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
49
49
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
50
50
|
/* @__PURE__ */ e.jsxs(y, { className: "flex-1", children: [
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
j && /* @__PURE__ */ e.jsx(h, { align: "inline-start", children: /* @__PURE__ */ e.jsx(
|
|
52
|
+
N,
|
|
53
53
|
{
|
|
54
|
-
name: d?.name ||
|
|
54
|
+
name: d?.name || j,
|
|
55
55
|
size: "sm",
|
|
56
56
|
...d,
|
|
57
|
-
className:
|
|
57
|
+
className: l(
|
|
58
58
|
"cursor-default text-muted-foreground",
|
|
59
59
|
d?.className
|
|
60
60
|
)
|
|
@@ -65,35 +65,35 @@ const L = b(
|
|
|
65
65
|
{
|
|
66
66
|
ref: E,
|
|
67
67
|
disabled: r,
|
|
68
|
-
required:
|
|
69
|
-
className:
|
|
68
|
+
required: f,
|
|
69
|
+
className: l(
|
|
70
70
|
n && "border-destructive focus-visible:border-destructive",
|
|
71
71
|
t?.className
|
|
72
72
|
),
|
|
73
73
|
"aria-invalid": n ? !0 : void 0,
|
|
74
|
-
"aria-describedby":
|
|
74
|
+
"aria-describedby": a || s ? `${i}-description` : void 0,
|
|
75
75
|
...$,
|
|
76
76
|
...t,
|
|
77
|
-
id:
|
|
77
|
+
id: i
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
p && /* @__PURE__ */ e.jsx(h, { align: "inline-end", children: /* @__PURE__ */ e.jsx(
|
|
81
|
+
N,
|
|
82
82
|
{
|
|
83
|
-
name: m?.name ||
|
|
83
|
+
name: m?.name || p,
|
|
84
84
|
size: "sm",
|
|
85
85
|
...m,
|
|
86
|
-
className:
|
|
86
|
+
className: l(
|
|
87
87
|
"cursor-default text-muted-foreground",
|
|
88
88
|
m?.className
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
) })
|
|
92
92
|
] }),
|
|
93
|
-
|
|
93
|
+
u && /* @__PURE__ */ e.jsx(B, { disabled: r, ...u })
|
|
94
94
|
] }),
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
a && !s && /* @__PURE__ */ e.jsx(A, { id: `${i}-description`, children: a }),
|
|
96
|
+
s && /* @__PURE__ */ e.jsx(D, { id: `${i}-description`, children: s })
|
|
97
97
|
] })
|
|
98
98
|
]
|
|
99
99
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Label as
|
|
2
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
3
|
+
import { Label as x } from "../../../vendor/shadcn/label.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Icon as
|
|
5
|
+
import { Icon as c } from "../icon/icon.js";
|
|
6
6
|
import { Tooltip as p } from "../tooltip/tooltip.js";
|
|
7
7
|
const u = ({
|
|
8
|
-
htmlFor:
|
|
9
|
-
className:
|
|
8
|
+
htmlFor: n,
|
|
9
|
+
className: a,
|
|
10
10
|
info: s,
|
|
11
11
|
requiredIndicator: t,
|
|
12
|
-
required:
|
|
13
|
-
disabled:
|
|
14
|
-
children:
|
|
12
|
+
required: l = !1,
|
|
13
|
+
disabled: i = !1,
|
|
14
|
+
children: r,
|
|
15
15
|
...f
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
17
|
+
const o = () => t ? typeof t == "string" ? t : l ? "required" : "optional" : null;
|
|
18
|
+
return /* @__PURE__ */ e.jsxs("div", { className: m(
|
|
19
19
|
"flex items-center justify-between gap-2",
|
|
20
|
-
|
|
20
|
+
i && "text-muted-foreground"
|
|
21
21
|
), children: [
|
|
22
22
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
23
|
-
/* @__PURE__ */ e.jsx(
|
|
24
|
-
|
|
23
|
+
r && /* @__PURE__ */ e.jsx(
|
|
24
|
+
x,
|
|
25
25
|
{
|
|
26
|
-
htmlFor:
|
|
27
|
-
className:
|
|
26
|
+
htmlFor: n,
|
|
27
|
+
className: m("text-sm cursor-pointer", a),
|
|
28
28
|
...f,
|
|
29
|
-
children:
|
|
29
|
+
children: r
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
32
|
s && /* @__PURE__ */ e.jsx(p, { content: s, children: /* @__PURE__ */ e.jsx(
|
|
33
|
-
|
|
33
|
+
c,
|
|
34
34
|
{
|
|
35
35
|
name: "Info",
|
|
36
36
|
size: "sm",
|
|
@@ -38,9 +38,9 @@ const u = ({
|
|
|
38
38
|
}
|
|
39
39
|
) })
|
|
40
40
|
] }),
|
|
41
|
-
|
|
41
|
+
o() && /* @__PURE__ */ e.jsxs("span", { className: "text-sm text-muted-foreground font-normal", children: [
|
|
42
42
|
"(",
|
|
43
|
-
|
|
43
|
+
o(),
|
|
44
44
|
")"
|
|
45
45
|
] })
|
|
46
46
|
] });
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import * as G from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Select as L, SelectTrigger as O, SelectValue as R, SelectContent as T, SelectGroup as V, SelectLabel as E, SelectItem as
|
|
3
|
+
import { cn as m } from "../../../lib/utils.js";
|
|
4
|
+
import { Select as L, SelectTrigger as O, SelectValue as R, SelectContent as T, SelectGroup as V, SelectLabel as E, SelectItem as f } from "../../../vendor/shadcn/select.js";
|
|
5
5
|
import { Label as F } from "../label/label.js";
|
|
6
6
|
import { Typography as n } from "../typography/typography.js";
|
|
7
7
|
const $ = G.forwardRef(
|
|
8
8
|
({
|
|
9
|
-
label:
|
|
10
|
-
description:
|
|
9
|
+
label: r,
|
|
10
|
+
description: i,
|
|
11
11
|
error: a,
|
|
12
|
-
info:
|
|
13
|
-
requiredIndicator:
|
|
12
|
+
info: x,
|
|
13
|
+
requiredIndicator: c,
|
|
14
14
|
required: u = !1,
|
|
15
|
-
optional:
|
|
16
|
-
placeholder:
|
|
15
|
+
optional: v = !1,
|
|
16
|
+
placeholder: o = "Select an option",
|
|
17
17
|
value: p,
|
|
18
18
|
defaultValue: S,
|
|
19
19
|
onChange: N,
|
|
20
|
-
disabled:
|
|
21
|
-
options:
|
|
22
|
-
groups:
|
|
20
|
+
disabled: t = !1,
|
|
21
|
+
options: h = [],
|
|
22
|
+
groups: j = [],
|
|
23
23
|
className: b,
|
|
24
24
|
id: d
|
|
25
25
|
}, g) => {
|
|
26
|
-
const y =
|
|
27
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
28
|
-
|
|
26
|
+
const y = j.length > 0, w = h.length > 0;
|
|
27
|
+
return /* @__PURE__ */ e.jsxs("div", { className: m("w-full", b), children: [
|
|
28
|
+
(r || x || c) && /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
|
|
29
29
|
/* @__PURE__ */ e.jsx(
|
|
30
30
|
F,
|
|
31
31
|
{
|
|
32
32
|
htmlFor: d,
|
|
33
|
-
info:
|
|
34
|
-
requiredIndicator:
|
|
33
|
+
info: x,
|
|
34
|
+
requiredIndicator: c,
|
|
35
35
|
required: u,
|
|
36
|
-
disabled:
|
|
37
|
-
children:
|
|
36
|
+
disabled: t,
|
|
37
|
+
children: r
|
|
38
38
|
}
|
|
39
39
|
),
|
|
40
|
-
|
|
40
|
+
v && !c && /* @__PURE__ */ e.jsx(n, { variant: "sm", className: "text-muted-foreground", children: "(Optional)" })
|
|
41
41
|
] }),
|
|
42
|
-
|
|
42
|
+
i && !a && /* @__PURE__ */ e.jsx(
|
|
43
43
|
n,
|
|
44
44
|
{
|
|
45
45
|
variant: "sm",
|
|
46
|
-
className:
|
|
46
|
+
className: m(
|
|
47
47
|
"text-muted-foreground mb-2",
|
|
48
|
-
|
|
48
|
+
t && "opacity-50"
|
|
49
49
|
),
|
|
50
|
-
children:
|
|
50
|
+
children: i
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
53
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -56,29 +56,29 @@ const $ = G.forwardRef(
|
|
|
56
56
|
value: p,
|
|
57
57
|
defaultValue: S,
|
|
58
58
|
onValueChange: N,
|
|
59
|
-
disabled:
|
|
59
|
+
disabled: t,
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ e.jsx(
|
|
62
62
|
O,
|
|
63
63
|
{
|
|
64
64
|
ref: g,
|
|
65
65
|
id: d,
|
|
66
|
-
className:
|
|
67
|
-
children: /* @__PURE__ */ e.jsx(R, { placeholder:
|
|
66
|
+
className: m(a && "border-destructive"),
|
|
67
|
+
children: /* @__PURE__ */ e.jsx(R, { placeholder: o })
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ e.jsx(T, { children: y ? (
|
|
71
71
|
// Render grouped options
|
|
72
|
-
|
|
72
|
+
j.map((l, C) => /* @__PURE__ */ e.jsxs(V, { children: [
|
|
73
73
|
l.label && /* @__PURE__ */ e.jsx(E, { children: l.label }),
|
|
74
|
-
l.options.map((s) => /* @__PURE__ */ e.jsxs(
|
|
74
|
+
l.options.map((s) => /* @__PURE__ */ e.jsxs(f, { value: s.value, children: [
|
|
75
75
|
s.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: s.icon }),
|
|
76
76
|
s.label
|
|
77
77
|
] }, s.value))
|
|
78
78
|
] }, C))
|
|
79
79
|
) : w ? (
|
|
80
80
|
// Render flat options
|
|
81
|
-
|
|
81
|
+
h.map((l) => /* @__PURE__ */ e.jsx(f, { value: l.value, children: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center", children: [
|
|
82
82
|
l.icon && /* @__PURE__ */ e.jsx("span", { className: "mr-2 inline-flex items-center", children: l.icon }),
|
|
83
83
|
l.label
|
|
84
84
|
] }) }, l.value))
|
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
import { j as e } from "../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useId as P } from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as p } from "../../lib/utils.js";
|
|
4
4
|
import { Button as F } from "./button.js";
|
|
5
|
-
import { Calendar as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { Field as
|
|
5
|
+
import { Calendar as b } from "./calendar.js";
|
|
6
|
+
import { Popover as k, PopoverTrigger as E, PopoverContent as $ } from "./popover.js";
|
|
7
|
+
import { Field as I, FieldDescription as M, FieldError as B } from "./field.js";
|
|
8
8
|
import S from "../../node_modules/lucide-react/dist/esm/icons/calendar.js";
|
|
9
9
|
import L from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
10
10
|
import { Label as R } from "../../components/atoms/label/label.js";
|
|
11
11
|
import { formatDate as T } from "../../node_modules/date-fns/format.js";
|
|
12
|
-
function
|
|
13
|
-
date:
|
|
14
|
-
onChange:
|
|
15
|
-
placeholder:
|
|
16
|
-
disabled:
|
|
17
|
-
className:
|
|
18
|
-
iconPosition:
|
|
19
|
-
minDate:
|
|
20
|
-
maxDate:
|
|
21
|
-
dateFormat:
|
|
12
|
+
function X({
|
|
13
|
+
date: s,
|
|
14
|
+
onChange: h,
|
|
15
|
+
placeholder: u = "Pick a date",
|
|
16
|
+
disabled: c = !1,
|
|
17
|
+
className: d,
|
|
18
|
+
iconPosition: m = "start",
|
|
19
|
+
minDate: j,
|
|
20
|
+
maxDate: v,
|
|
21
|
+
dateFormat: w = "MMM d, yyyy",
|
|
22
22
|
label: i,
|
|
23
23
|
error: t,
|
|
24
|
-
description:
|
|
25
|
-
info:
|
|
26
|
-
requiredIndicator:
|
|
24
|
+
description: o,
|
|
25
|
+
info: a,
|
|
26
|
+
requiredIndicator: n,
|
|
27
27
|
required: y = !1,
|
|
28
28
|
orientation: g = "vertical",
|
|
29
29
|
id: C
|
|
30
30
|
}) {
|
|
31
|
-
const D = P(), r = C || D,
|
|
32
|
-
/* @__PURE__ */ e.jsx(
|
|
31
|
+
const D = P(), r = C || D, l = !!t, N = m === "start", f = m === "end", x = /* @__PURE__ */ e.jsxs(k, { children: [
|
|
32
|
+
/* @__PURE__ */ e.jsx(E, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
33
33
|
F,
|
|
34
34
|
{
|
|
35
35
|
variant: "outline",
|
|
36
|
-
className:
|
|
36
|
+
className: p(
|
|
37
37
|
"w-full text-left font-normal h-9",
|
|
38
|
-
|
|
39
|
-
!
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
f ? "justify-between" : "justify-start",
|
|
39
|
+
!s && "text-muted-foreground",
|
|
40
|
+
l && "border-destructive focus-visible:border-destructive",
|
|
41
|
+
d
|
|
42
42
|
),
|
|
43
|
-
disabled:
|
|
44
|
-
"aria-invalid":
|
|
45
|
-
"aria-describedby":
|
|
43
|
+
disabled: c,
|
|
44
|
+
"aria-invalid": l ? !0 : void 0,
|
|
45
|
+
"aria-describedby": o || t ? `${r}-description` : void 0,
|
|
46
46
|
id: r,
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
49
49
|
N && /* @__PURE__ */ e.jsx(S, { className: "h-4 w-4" }),
|
|
50
|
-
|
|
50
|
+
s ? T(s, w) : /* @__PURE__ */ e.jsx("span", { children: u })
|
|
51
51
|
] }),
|
|
52
|
-
|
|
52
|
+
f && /* @__PURE__ */ e.jsx(L, { className: "h-4 w-4 opacity-50" })
|
|
53
53
|
]
|
|
54
54
|
}
|
|
55
55
|
) }),
|
|
56
|
-
/* @__PURE__ */ e.jsx(
|
|
57
|
-
|
|
56
|
+
/* @__PURE__ */ e.jsx($, { className: "w-auto p-0", children: /* @__PURE__ */ e.jsx(
|
|
57
|
+
b,
|
|
58
58
|
{
|
|
59
59
|
mode: "single",
|
|
60
|
-
selected:
|
|
61
|
-
onSelect:
|
|
60
|
+
selected: s,
|
|
61
|
+
onSelect: h,
|
|
62
62
|
initialFocus: !0,
|
|
63
|
-
fromDate:
|
|
64
|
-
toDate:
|
|
63
|
+
fromDate: j,
|
|
64
|
+
toDate: v
|
|
65
65
|
}
|
|
66
66
|
) })
|
|
67
67
|
] });
|
|
68
|
-
return i || t ||
|
|
69
|
-
|
|
68
|
+
return i || t || o || a || n ? /* @__PURE__ */ e.jsxs(
|
|
69
|
+
I,
|
|
70
70
|
{
|
|
71
71
|
orientation: g,
|
|
72
|
-
"data-invalid":
|
|
73
|
-
className:
|
|
72
|
+
"data-invalid": l,
|
|
73
|
+
className: p("w-full", d),
|
|
74
74
|
children: [
|
|
75
|
-
i && /* @__PURE__ */ e.jsx(
|
|
75
|
+
(i || a || n) && /* @__PURE__ */ e.jsx(
|
|
76
76
|
R,
|
|
77
77
|
{
|
|
78
78
|
htmlFor: r,
|
|
79
|
-
info:
|
|
80
|
-
requiredIndicator:
|
|
79
|
+
info: a,
|
|
80
|
+
requiredIndicator: n,
|
|
81
81
|
required: y,
|
|
82
|
-
disabled:
|
|
82
|
+
disabled: c,
|
|
83
83
|
children: i
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
86
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 flex-1", children: [
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
x,
|
|
88
|
+
o && !t && /* @__PURE__ */ e.jsx(M, { id: `${r}-description`, children: o }),
|
|
89
89
|
t && /* @__PURE__ */ e.jsx(B, { id: `${r}-description`, children: t })
|
|
90
90
|
] })
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
|
-
) :
|
|
93
|
+
) : x;
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
96
|
+
X as DatePicker
|
|
97
97
|
};
|