@turingpaper/ui 0.0.1-test.2 → 0.0.1-test.3
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/accordion.mjs +44 -83
- package/dist/alert-dialog.mjs +108 -175
- package/dist/avatar.mjs +40 -104
- package/dist/badge.mjs +10 -27
- package/dist/breadcrumb.mjs +82 -109
- package/dist/button.mjs +26 -38
- package/dist/card.mjs +62 -96
- package/dist/chart.mjs +208 -0
- package/dist/checkbox.mjs +25 -32
- package/dist/collapsible.mjs +5 -32
- package/dist/command.mjs +101 -165
- package/dist/components/accordion.d.ts +4 -5
- package/dist/components/alert-dialog.d.ts +19 -17
- package/dist/components/avatar.d.ts +4 -10
- package/dist/components/badge.d.ts +4 -4
- package/dist/components/breadcrumb.d.ts +16 -8
- package/dist/components/button.d.ts +5 -4
- package/dist/components/card.d.ts +7 -10
- package/dist/components/chart.d.ts +62 -0
- package/dist/components/checkbox.d.ts +1 -2
- package/dist/components/collapsible.d.ts +3 -4
- package/dist/components/command.d.ts +78 -16
- package/dist/components/dialog.d.ts +18 -16
- package/dist/components/drawer.d.ts +19 -10
- package/dist/components/dropdown-menu.d.ts +21 -27
- package/dist/components/hover-card.d.ts +3 -4
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-otp.d.ts +34 -0
- package/dist/components/input.d.ts +1 -1
- package/dist/components/label.d.ts +1 -2
- package/dist/components/pagination.d.ts +24 -13
- package/dist/components/popover.d.ts +4 -9
- package/dist/components/progress.d.ts +1 -2
- package/dist/components/radio-group.d.ts +2 -3
- package/dist/components/scroll-area.d.ts +2 -3
- package/dist/components/select.d.ts +11 -14
- package/dist/components/separator.d.ts +1 -2
- package/dist/components/sheet.d.ts +24 -13
- package/dist/components/skeleton.d.ts +1 -1
- package/dist/components/slider.d.ts +1 -2
- package/dist/components/switch.d.ts +1 -4
- package/dist/components/table.d.ts +8 -8
- package/dist/components/tabs.d.ts +5 -10
- package/dist/components/textarea.d.ts +1 -1
- package/dist/components/toggle-group.d.ts +2 -8
- package/dist/components/toggle.d.ts +1 -3
- package/dist/components/tooltip.d.ts +5 -6
- package/dist/dialog.mjs +91 -147
- package/dist/drawer.mjs +89 -118
- package/dist/dropdown-menu.mjs +141 -249
- package/dist/hover-card.mjs +20 -35
- package/dist/input-otp.mjs +48 -0
- package/dist/input.mjs +15 -13
- package/dist/label.mjs +17 -20
- package/dist/pagination.mjs +103 -126
- package/dist/popover.mjs +19 -76
- package/dist/progress.mjs +23 -28
- package/dist/provider.mjs +1 -1
- package/dist/radio-group.mjs +29 -42
- package/dist/scroll-area.mjs +36 -57
- package/dist/select.mjs +117 -182
- package/dist/separator.mjs +16 -18
- package/dist/sheet.mjs +99 -128
- package/dist/skeleton.mjs +8 -6
- package/dist/slider.mjs +21 -57
- package/dist/styles.css +1 -1
- package/dist/switch.mjs +25 -29
- package/dist/table.mjs +83 -110
- package/dist/tabs.mjs +42 -86
- package/dist/textarea.mjs +16 -16
- package/dist/toggle-group.mjs +32 -67
- package/dist/toggle.mjs +22 -28
- package/dist/tooltip.mjs +20 -52
- package/package.json +11 -1
package/dist/breadcrumb.mjs
CHANGED
|
@@ -1,117 +1,90 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
function h({ className: r, ...e }) {
|
|
55
|
-
return /* @__PURE__ */ a(
|
|
56
|
-
"span",
|
|
57
|
-
{
|
|
58
|
-
"data-slot": "breadcrumb-page",
|
|
59
|
-
role: "link",
|
|
60
|
-
"aria-disabled": "true",
|
|
61
|
-
"aria-current": "page",
|
|
62
|
-
className: t("font-normal text-foreground", r),
|
|
63
|
-
...e
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
function N({
|
|
1
|
+
import { jsx as s, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Slot as n } from "radix-ui";
|
|
4
|
+
import { MoreHorizontal as c, ChevronRight as d } from "lucide-react";
|
|
5
|
+
import { cn as o } from "./utils.mjs";
|
|
6
|
+
const l = t.forwardRef(({ ...r }, e) => /* @__PURE__ */ s("nav", { ref: e, "aria-label": "breadcrumb", ...r }));
|
|
7
|
+
l.displayName = "Breadcrumb";
|
|
8
|
+
const p = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
|
|
9
|
+
"ol",
|
|
10
|
+
{
|
|
11
|
+
ref: a,
|
|
12
|
+
className: o(
|
|
13
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
14
|
+
r
|
|
15
|
+
),
|
|
16
|
+
...e
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
p.displayName = "BreadcrumbList";
|
|
20
|
+
const u = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
|
|
21
|
+
"li",
|
|
22
|
+
{
|
|
23
|
+
ref: a,
|
|
24
|
+
className: o("inline-flex items-center gap-1.5", r),
|
|
25
|
+
...e
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
u.displayName = "BreadcrumbItem";
|
|
29
|
+
const f = t.forwardRef(({ asChild: r, className: e, ...a }, m) => /* @__PURE__ */ s(
|
|
30
|
+
r ? n : "a",
|
|
31
|
+
{
|
|
32
|
+
ref: m,
|
|
33
|
+
className: o("transition-colors hover:text-foreground", e),
|
|
34
|
+
...a
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
f.displayName = "BreadcrumbLink";
|
|
38
|
+
const b = t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ s(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
ref: a,
|
|
42
|
+
role: "link",
|
|
43
|
+
"aria-disabled": "true",
|
|
44
|
+
"aria-current": "page",
|
|
45
|
+
className: o("font-normal text-foreground", r),
|
|
46
|
+
...e
|
|
47
|
+
}
|
|
48
|
+
));
|
|
49
|
+
b.displayName = "BreadcrumbPage";
|
|
50
|
+
const N = ({
|
|
68
51
|
children: r,
|
|
69
52
|
className: e,
|
|
70
|
-
...
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
function B({
|
|
53
|
+
...a
|
|
54
|
+
}) => /* @__PURE__ */ s(
|
|
55
|
+
"li",
|
|
56
|
+
{
|
|
57
|
+
role: "presentation",
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
className: o("[&>svg]:w-3.5 [&>svg]:h-3.5", e),
|
|
60
|
+
...a,
|
|
61
|
+
children: r ?? /* @__PURE__ */ s(d, {})
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
N.displayName = "BreadcrumbSeparator";
|
|
65
|
+
const B = ({
|
|
85
66
|
className: r,
|
|
86
67
|
...e
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
l,
|
|
102
|
-
{}
|
|
103
|
-
),
|
|
104
|
-
/* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
68
|
+
}) => /* @__PURE__ */ i(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
role: "presentation",
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
className: o("flex h-9 w-9 items-center justify-center", r),
|
|
74
|
+
...e,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ s(c, { className: "h-4 w-4" }),
|
|
77
|
+
/* @__PURE__ */ s("span", { className: "sr-only", children: "More" })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
B.displayName = "BreadcrumbElipssis";
|
|
109
82
|
export {
|
|
110
|
-
|
|
83
|
+
l as Breadcrumb,
|
|
111
84
|
B as BreadcrumbEllipsis,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
85
|
+
u as BreadcrumbItem,
|
|
86
|
+
f as BreadcrumbLink,
|
|
87
|
+
p as BreadcrumbList,
|
|
88
|
+
b as BreadcrumbPage,
|
|
116
89
|
N as BreadcrumbSeparator
|
|
117
90
|
};
|
package/dist/button.mjs
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
3
|
import { Slot as d } from "radix-ui";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { cva as c } from "class-variance-authority";
|
|
5
|
+
import { cn as u } from "./utils.mjs";
|
|
6
|
+
const f = c(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
7
8
|
{
|
|
8
9
|
variants: {
|
|
9
10
|
variant: {
|
|
10
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
13
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
15
16
|
link: "text-primary underline-offset-4 hover:underline"
|
|
16
17
|
},
|
|
17
18
|
size: {
|
|
18
|
-
default: "h-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
icon: "size-9",
|
|
23
|
-
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
24
|
-
"icon-sm": "size-8",
|
|
25
|
-
"icon-lg": "size-10"
|
|
19
|
+
default: "h-10 px-4 py-2",
|
|
20
|
+
sm: "h-9 rounded-md px-3",
|
|
21
|
+
lg: "h-11 rounded-md px-8",
|
|
22
|
+
icon: "h-10 w-10"
|
|
26
23
|
}
|
|
27
24
|
},
|
|
28
25
|
defaultVariants: {
|
|
@@ -30,27 +27,18 @@ const u = s(
|
|
|
30
27
|
size: "default"
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
variant: e = "default",
|
|
37
|
-
size: i = "default",
|
|
38
|
-
asChild: r = !1,
|
|
39
|
-
...a
|
|
40
|
-
}) {
|
|
41
|
-
const n = r ? d.Root : "button";
|
|
42
|
-
return /* @__PURE__ */ o(
|
|
43
|
-
n,
|
|
30
|
+
), g = a.forwardRef(
|
|
31
|
+
({ className: e, variant: r, size: t, asChild: o = !1, ...n }, i) => /* @__PURE__ */ s(
|
|
32
|
+
o ? d : "button",
|
|
44
33
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: l(u({ variant: e, size: i, className: t })),
|
|
49
|
-
...a
|
|
34
|
+
className: u(f({ variant: r, size: t, className: e })),
|
|
35
|
+
ref: i,
|
|
36
|
+
...n
|
|
50
37
|
}
|
|
51
|
-
)
|
|
52
|
-
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
g.displayName = "Button";
|
|
53
41
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
g as Button,
|
|
43
|
+
f as buttonVariants
|
|
56
44
|
};
|
package/dist/card.mjs
CHANGED
|
@@ -1,98 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
"data-slot": "card-action",
|
|
59
|
-
className: d(
|
|
60
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
61
|
-
a
|
|
62
|
-
),
|
|
63
|
-
...r
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
function p({ className: a, ...r }) {
|
|
68
|
-
return /* @__PURE__ */ t(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
"data-slot": "card-content",
|
|
72
|
-
className: d("px-6 group-data-[size=sm]/card:px-4", a),
|
|
73
|
-
...r
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
function m({ className: a, ...r }) {
|
|
78
|
-
return /* @__PURE__ */ t(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
"data-slot": "card-footer",
|
|
82
|
-
className: d(
|
|
83
|
-
"flex items-center rounded-b-xl px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4",
|
|
84
|
-
a
|
|
85
|
-
),
|
|
86
|
-
...r
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
}
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { cn as t } from "./utils.mjs";
|
|
4
|
+
const s = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
ref: r,
|
|
8
|
+
className: t(
|
|
9
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
10
|
+
a
|
|
11
|
+
),
|
|
12
|
+
...e
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
s.displayName = "Card";
|
|
16
|
+
const i = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
ref: r,
|
|
20
|
+
className: t("flex flex-col space-y-1.5 p-6", a),
|
|
21
|
+
...e
|
|
22
|
+
}
|
|
23
|
+
));
|
|
24
|
+
i.displayName = "CardHeader";
|
|
25
|
+
const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref: r,
|
|
29
|
+
className: t(
|
|
30
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
31
|
+
a
|
|
32
|
+
),
|
|
33
|
+
...e
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
m.displayName = "CardTitle";
|
|
37
|
+
const c = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
ref: r,
|
|
41
|
+
className: t("text-sm text-muted-foreground", a),
|
|
42
|
+
...e
|
|
43
|
+
}
|
|
44
|
+
));
|
|
45
|
+
c.displayName = "CardDescription";
|
|
46
|
+
const l = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
|
|
47
|
+
l.displayName = "CardContent";
|
|
48
|
+
const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: r,
|
|
52
|
+
className: t("flex items-center p-6 pt-0", a),
|
|
53
|
+
...e
|
|
54
|
+
}
|
|
55
|
+
));
|
|
56
|
+
n.displayName = "CardFooter";
|
|
90
57
|
export {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
c as CardTitle
|
|
58
|
+
s as Card,
|
|
59
|
+
l as CardContent,
|
|
60
|
+
c as CardDescription,
|
|
61
|
+
n as CardFooter,
|
|
62
|
+
i as CardHeader,
|
|
63
|
+
m as CardTitle
|
|
98
64
|
};
|
package/dist/chart.mjs
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsx as s, jsxs as g, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import * as w from "recharts";
|
|
4
|
+
import { cn as i } from "./utils.mjs";
|
|
5
|
+
const P = { light: "", dark: ".dark" }, N = f.createContext(null);
|
|
6
|
+
function j() {
|
|
7
|
+
const a = f.useContext(N);
|
|
8
|
+
if (!a)
|
|
9
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
10
|
+
return a;
|
|
11
|
+
}
|
|
12
|
+
const I = f.forwardRef(({ id: a, className: e, children: n, config: r, ...c }, d) => {
|
|
13
|
+
const l = f.useId(), o = `chart-${a || l.replace(/:/g, "")}`;
|
|
14
|
+
return /* @__PURE__ */ s(N.Provider, { value: { config: r }, children: /* @__PURE__ */ g(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
"data-chart": o,
|
|
18
|
+
ref: d,
|
|
19
|
+
className: i(
|
|
20
|
+
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
21
|
+
e
|
|
22
|
+
),
|
|
23
|
+
...c,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ s(S, { id: o, config: r }),
|
|
26
|
+
/* @__PURE__ */ s(w.ResponsiveContainer, { children: n })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
});
|
|
31
|
+
I.displayName = "Chart";
|
|
32
|
+
const S = ({ id: a, config: e }) => {
|
|
33
|
+
const n = Object.entries(e).filter(
|
|
34
|
+
([, r]) => r.theme || r.color
|
|
35
|
+
);
|
|
36
|
+
return n.length ? /* @__PURE__ */ s(
|
|
37
|
+
"style",
|
|
38
|
+
{
|
|
39
|
+
dangerouslySetInnerHTML: {
|
|
40
|
+
__html: Object.entries(P).map(
|
|
41
|
+
([r, c]) => `
|
|
42
|
+
${c} [data-chart=${a}] {
|
|
43
|
+
${n.map(([d, l]) => {
|
|
44
|
+
const o = l.theme?.[r] || l.color;
|
|
45
|
+
return o ? ` --color-${d}: ${o};` : null;
|
|
46
|
+
}).join(`
|
|
47
|
+
`)}
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
).join(`
|
|
51
|
+
`)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
) : null;
|
|
55
|
+
}, O = w.Tooltip, E = f.forwardRef(
|
|
56
|
+
({
|
|
57
|
+
active: a,
|
|
58
|
+
payload: e,
|
|
59
|
+
className: n,
|
|
60
|
+
indicator: r = "dot",
|
|
61
|
+
hideLabel: c = !1,
|
|
62
|
+
hideIndicator: d = !1,
|
|
63
|
+
label: l,
|
|
64
|
+
labelFormatter: o,
|
|
65
|
+
labelClassName: m,
|
|
66
|
+
formatter: h,
|
|
67
|
+
color: $,
|
|
68
|
+
nameKey: L,
|
|
69
|
+
labelKey: x
|
|
70
|
+
}, R) => {
|
|
71
|
+
const { config: p } = j(), k = f.useMemo(() => {
|
|
72
|
+
if (c || !e?.length)
|
|
73
|
+
return null;
|
|
74
|
+
const [t] = e, b = `${x || t?.dataKey || t?.name || "value"}`, C = _(p, t, b), u = !x && typeof l == "string" ? p[l]?.label || l : C?.label;
|
|
75
|
+
return o ? /* @__PURE__ */ s("div", { className: i("font-medium", m), children: o(u, e) }) : u ? /* @__PURE__ */ s("div", { className: i("font-medium", m), children: u }) : null;
|
|
76
|
+
}, [
|
|
77
|
+
l,
|
|
78
|
+
o,
|
|
79
|
+
e,
|
|
80
|
+
c,
|
|
81
|
+
m,
|
|
82
|
+
p,
|
|
83
|
+
x
|
|
84
|
+
]);
|
|
85
|
+
if (!a || !e?.length)
|
|
86
|
+
return null;
|
|
87
|
+
const v = e.length === 1 && r !== "dot";
|
|
88
|
+
return /* @__PURE__ */ g(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
ref: R,
|
|
92
|
+
className: i(
|
|
93
|
+
"grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
|
|
94
|
+
n
|
|
95
|
+
),
|
|
96
|
+
children: [
|
|
97
|
+
v ? null : k,
|
|
98
|
+
/* @__PURE__ */ s("div", { className: "grid gap-1.5", children: e.filter((t) => t.type !== "none").map((t, b) => {
|
|
99
|
+
const C = `${L || t.name || t.dataKey || "value"}`, u = _(p, t, C), y = $ || t.payload.fill || t.color;
|
|
100
|
+
return /* @__PURE__ */ s(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
className: i(
|
|
104
|
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
105
|
+
r === "dot" && "items-center"
|
|
106
|
+
),
|
|
107
|
+
children: h && t?.value !== void 0 && t.name ? h(t.value, t.name, t, b, t.payload) : /* @__PURE__ */ g(T, { children: [
|
|
108
|
+
u?.icon ? /* @__PURE__ */ s(u.icon, {}) : !d && /* @__PURE__ */ s(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: i(
|
|
112
|
+
"shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",
|
|
113
|
+
{
|
|
114
|
+
"h-2.5 w-2.5": r === "dot",
|
|
115
|
+
"w-1": r === "line",
|
|
116
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": r === "dashed",
|
|
117
|
+
"my-0.5": v && r === "dashed"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
style: {
|
|
121
|
+
"--color-bg": y,
|
|
122
|
+
"--color-border": y
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ g(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: i(
|
|
130
|
+
"flex flex-1 justify-between leading-none",
|
|
131
|
+
v ? "items-end" : "items-center"
|
|
132
|
+
),
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ g("div", { className: "grid gap-1.5", children: [
|
|
135
|
+
v ? k : null,
|
|
136
|
+
/* @__PURE__ */ s("span", { className: "text-muted-foreground", children: u?.label || t.name })
|
|
137
|
+
] }),
|
|
138
|
+
t.value && /* @__PURE__ */ s("span", { className: "font-mono font-medium tabular-nums text-foreground", children: t.value.toLocaleString() })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] })
|
|
143
|
+
},
|
|
144
|
+
t.dataKey
|
|
145
|
+
);
|
|
146
|
+
}) })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
E.displayName = "ChartTooltip";
|
|
153
|
+
const q = w.Legend, K = f.forwardRef(
|
|
154
|
+
({ className: a, hideIcon: e = !1, payload: n, verticalAlign: r = "bottom", nameKey: c }, d) => {
|
|
155
|
+
const { config: l } = j();
|
|
156
|
+
return n?.length ? /* @__PURE__ */ s(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
ref: d,
|
|
160
|
+
className: i(
|
|
161
|
+
"flex items-center justify-center gap-4",
|
|
162
|
+
r === "top" ? "pb-3" : "pt-3",
|
|
163
|
+
a
|
|
164
|
+
),
|
|
165
|
+
children: n.filter((o) => o.type !== "none").map((o) => {
|
|
166
|
+
const m = `${c || o.dataKey || "value"}`, h = _(l, o, m);
|
|
167
|
+
return /* @__PURE__ */ g(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
className: i(
|
|
171
|
+
"flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
|
|
172
|
+
),
|
|
173
|
+
children: [
|
|
174
|
+
h?.icon && !e ? /* @__PURE__ */ s(h.icon, {}) : /* @__PURE__ */ s(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
178
|
+
style: {
|
|
179
|
+
backgroundColor: o.color
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
h?.label
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
o.value
|
|
187
|
+
);
|
|
188
|
+
})
|
|
189
|
+
}
|
|
190
|
+
) : null;
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
K.displayName = "ChartLegend";
|
|
194
|
+
function _(a, e, n) {
|
|
195
|
+
if (typeof e != "object" || e === null)
|
|
196
|
+
return;
|
|
197
|
+
const r = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
|
|
198
|
+
let c = n;
|
|
199
|
+
return n in e && typeof e[n] == "string" ? c = e[n] : r && n in r && typeof r[n] == "string" && (c = r[n]), c in a ? a[c] : a[n];
|
|
200
|
+
}
|
|
201
|
+
export {
|
|
202
|
+
I as ChartContainer,
|
|
203
|
+
q as ChartLegend,
|
|
204
|
+
K as ChartLegendContent,
|
|
205
|
+
S as ChartStyle,
|
|
206
|
+
O as ChartTooltip,
|
|
207
|
+
E as ChartTooltipContent
|
|
208
|
+
};
|