@locusgraph/components 0.2.0 → 0.2.1
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/action/button-group.js +148 -17
- package/dist/action/button.js +91 -27
- package/dist/action/toggle-group.js +176 -12
- package/dist/action/toggle.js +70 -17
- package/dist/display/avatar.js +118 -7
- package/dist/display/badge.js +74 -20
- package/dist/display/chart/chart-container.js +205 -45
- package/dist/display/chart/chart-legend.js +79 -14
- package/dist/display/chart/chart-tooltip.js +211 -40
- package/dist/display/chat/attachment/attachment-parts.js +222 -13
- package/dist/display/chat/attachment/attachment.js +210 -28
- package/dist/display/chat/bubble.js +225 -37
- package/dist/display/chat/marker.js +143 -15
- package/dist/display/chat/message-scroller.js +276 -14
- package/dist/display/chat/message.js +238 -13
- package/dist/display/content/item.js +448 -47
- package/dist/display/content/kbd.js +78 -5
- package/dist/display/media/aspect-ratio.js +27 -3
- package/dist/display/media/carousel-controls.js +162 -11
- package/dist/display/media/carousel.js +325 -65
- package/dist/display/rule-grid/rule-grid.js +309 -29
- package/dist/display/separator.js +56 -3
- package/dist/display/skeletons/layouts/skeleton-rule-grid.js +79 -6
- package/dist/display/skeletons/layouts/skeleton-table.js +163 -5
- package/dist/display/skeletons/shapes/skeleton-avatar.js +95 -13
- package/dist/display/skeletons/shapes/skeleton-button.js +95 -13
- package/dist/display/skeletons/shapes/skeleton-text.js +78 -7
- package/dist/display/skeletons/skeleton-parts.js +63 -6
- package/dist/display/status/alert.js +136 -18
- package/dist/display/status/empty.js +250 -22
- package/dist/display/status/progress.js +116 -16
- package/dist/display/status/skeleton.js +40 -3
- package/dist/display/status/spinner.js +41 -3
- package/dist/display/table.js +310 -17
- package/dist/feedback/toaster.js +98 -21
- package/dist/form/advanced/calendar-day-button.js +89 -12
- package/dist/form/advanced/calendar.js +349 -56
- package/dist/form/advanced/combobox/combobox-chips.js +151 -8
- package/dist/form/advanced/combobox/combobox-items.js +239 -14
- package/dist/form/advanced/combobox/combobox.js +386 -13
- package/dist/form/advanced/input-otp.js +201 -11
- package/dist/form/choice/checkbox.js +58 -3
- package/dist/form/choice/radio-group.js +94 -5
- package/dist/form/choice/select.js +479 -25
- package/dist/form/choice/slider.js +118 -4
- package/dist/form/choice/switch.js +53 -3
- package/dist/form/field/field-error.js +117 -14
- package/dist/form/field/field-separator.js +70 -3
- package/dist/form/field/field-set.js +85 -5
- package/dist/form/field/field-text.js +116 -7
- package/dist/form/field/field.js +137 -25
- package/dist/form/hook-form/form.js +338 -40
- package/dist/form/input-group.js +297 -47
- package/dist/form/input.js +47 -3
- package/dist/form/label.js +42 -3
- package/dist/form/native-select.js +147 -7
- package/dist/form/textarea.js +41 -3
- package/dist/layout/accordion.js +165 -8
- package/dist/layout/collapsible.js +75 -7
- package/dist/layout/resizable.js +122 -7
- package/dist/layout/scroll/direction.js +25 -3
- package/dist/layout/scroll/scroll-area.js +138 -5
- package/dist/layout/sidebar/sidebar-context.js +184 -51
- package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
- package/dist/layout/sidebar/sidebar-menu.js +319 -38
- package/dist/layout/sidebar/sidebar-sections.js +369 -22
- package/dist/layout/sidebar/sidebar.js +384 -28
- package/dist/layout/tabs.js +183 -18
- package/dist/layout/use-mobile.js +23 -10
- package/dist/navigation/breadcrumb.js +301 -17
- package/dist/navigation/menubar/menubar-items.js +322 -16
- package/dist/navigation/menubar/menubar-sub.js +125 -7
- package/dist/navigation/menubar/menubar.js +213 -13
- package/dist/navigation/navigation-menu.js +366 -18
- package/dist/navigation/pagination.js +328 -20
- package/dist/overlay/alert-dialog.js +485 -26
- package/dist/overlay/context-menu/context-menu-items.js +322 -16
- package/dist/overlay/context-menu/context-menu-sub.js +125 -7
- package/dist/overlay/context-menu/context-menu.js +140 -11
- package/dist/overlay/dialog.js +405 -24
- package/dist/overlay/floating/command.js +423 -20
- package/dist/overlay/floating/drawer.js +354 -22
- package/dist/overlay/floating/hover-card.js +107 -7
- package/dist/overlay/menu/dropdown-menu-choice.js +149 -7
- package/dist/overlay/menu/dropdown-menu-item.js +174 -9
- package/dist/overlay/menu/dropdown-menu-sub.js +124 -7
- package/dist/overlay/menu/dropdown-menu.js +147 -12
- package/dist/overlay/popover.js +106 -7
- package/dist/overlay/sheet.js +379 -26
- package/dist/overlay/tooltip.js +145 -9
- package/dist/shell/app-header.js +81 -5
- package/dist/shell/app-shell.js +58 -3
- package/dist/shell/breadcrumbs.js +102 -12
- package/dist/shell/docs/docs-header.js +210 -10
- package/dist/shell/docs/docs-shell.js +100 -3
- package/dist/shell/docs/docs-sidebar.js +88 -7
- package/dist/shell/docs/on-this-page.js +78 -7
- package/dist/shell/docs/use-active-section.js +88 -42
- package/dist/shell/navigation/app-sidebar.js +188 -6
- package/dist/shell/navigation/nav-group.js +161 -10
- package/dist/shell/theme-toggle.js +51 -4
- package/package.json +2 -2
package/dist/display/avatar.js
CHANGED
|
@@ -1,14 +1,125 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { cn } from "cn";
|
|
4
5
|
import * as AvatarPrimitive from "radix-ui/avatar";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function Avatar(t0) {
|
|
9
|
+
const $ = _c(8);
|
|
10
|
+
let className;
|
|
11
|
+
let props;
|
|
12
|
+
if ($[0] !== t0) {
|
|
13
|
+
({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
} = t0);
|
|
17
|
+
$[0] = t0;
|
|
18
|
+
$[1] = className;
|
|
19
|
+
$[2] = props;
|
|
20
|
+
} else {
|
|
21
|
+
className = $[1];
|
|
22
|
+
props = $[2];
|
|
23
|
+
}
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[3] !== className) {
|
|
26
|
+
t1 = cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className);
|
|
27
|
+
$[3] = className;
|
|
28
|
+
$[4] = t1;
|
|
29
|
+
} else {
|
|
30
|
+
t1 = $[4];
|
|
31
|
+
}
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
34
|
+
t2 = /*#__PURE__*/_jsx(AvatarPrimitive.Root, {
|
|
35
|
+
"data-slot": "avatar",
|
|
36
|
+
className: t1,
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
$[5] = props;
|
|
40
|
+
$[6] = t1;
|
|
41
|
+
$[7] = t2;
|
|
42
|
+
} else {
|
|
43
|
+
t2 = $[7];
|
|
44
|
+
}
|
|
45
|
+
return t2;
|
|
7
46
|
}
|
|
8
|
-
function AvatarImage(
|
|
9
|
-
|
|
47
|
+
function AvatarImage(t0) {
|
|
48
|
+
const $ = _c(8);
|
|
49
|
+
let className;
|
|
50
|
+
let props;
|
|
51
|
+
if ($[0] !== t0) {
|
|
52
|
+
({
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
} = t0);
|
|
56
|
+
$[0] = t0;
|
|
57
|
+
$[1] = className;
|
|
58
|
+
$[2] = props;
|
|
59
|
+
} else {
|
|
60
|
+
className = $[1];
|
|
61
|
+
props = $[2];
|
|
62
|
+
}
|
|
63
|
+
let t1;
|
|
64
|
+
if ($[3] !== className) {
|
|
65
|
+
t1 = cn("aspect-square size-full", className);
|
|
66
|
+
$[3] = className;
|
|
67
|
+
$[4] = t1;
|
|
68
|
+
} else {
|
|
69
|
+
t1 = $[4];
|
|
70
|
+
}
|
|
71
|
+
let t2;
|
|
72
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
73
|
+
t2 = /*#__PURE__*/_jsx(AvatarPrimitive.Image, {
|
|
74
|
+
"data-slot": "avatar-image",
|
|
75
|
+
className: t1,
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
$[5] = props;
|
|
79
|
+
$[6] = t1;
|
|
80
|
+
$[7] = t2;
|
|
81
|
+
} else {
|
|
82
|
+
t2 = $[7];
|
|
83
|
+
}
|
|
84
|
+
return t2;
|
|
10
85
|
}
|
|
11
|
-
function AvatarFallback(
|
|
12
|
-
|
|
86
|
+
function AvatarFallback(t0) {
|
|
87
|
+
const $ = _c(8);
|
|
88
|
+
let className;
|
|
89
|
+
let props;
|
|
90
|
+
if ($[0] !== t0) {
|
|
91
|
+
({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
} = t0);
|
|
95
|
+
$[0] = t0;
|
|
96
|
+
$[1] = className;
|
|
97
|
+
$[2] = props;
|
|
98
|
+
} else {
|
|
99
|
+
className = $[1];
|
|
100
|
+
props = $[2];
|
|
101
|
+
}
|
|
102
|
+
let t1;
|
|
103
|
+
if ($[3] !== className) {
|
|
104
|
+
t1 = cn("flex size-full items-center justify-center rounded-full bg-ghost text-xs font-medium uppercase", className);
|
|
105
|
+
$[3] = className;
|
|
106
|
+
$[4] = t1;
|
|
107
|
+
} else {
|
|
108
|
+
t1 = $[4];
|
|
109
|
+
}
|
|
110
|
+
let t2;
|
|
111
|
+
if ($[5] !== props || $[6] !== t1) {
|
|
112
|
+
t2 = /*#__PURE__*/_jsx(AvatarPrimitive.Fallback, {
|
|
113
|
+
"data-slot": "avatar-fallback",
|
|
114
|
+
className: t1,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
$[5] = props;
|
|
118
|
+
$[6] = t1;
|
|
119
|
+
$[7] = t2;
|
|
120
|
+
} else {
|
|
121
|
+
t2 = $[7];
|
|
122
|
+
}
|
|
123
|
+
return t2;
|
|
13
124
|
}
|
|
14
125
|
export { Avatar, AvatarFallback, AvatarImage };
|
package/dist/display/badge.js
CHANGED
|
@@ -1,27 +1,81 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { cn } from "cn";
|
|
4
4
|
import * as Slot from "radix-ui/slot";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
7
|
const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
12
|
+
destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
13
|
+
success: "bg-good/10 text-good [a&]:hover:bg-good/15",
|
|
14
|
+
warning: "bg-warn/10 text-warn [a&]:hover:bg-warn/15",
|
|
15
|
+
"destructive-soft": "bg-destructive/10 text-destructive [a&]:hover:bg-destructive/15",
|
|
16
|
+
outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
17
|
+
ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
18
|
+
link: "text-primary underline-offset-4 [a&]:hover:underline"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default"
|
|
23
|
+
}
|
|
22
24
|
});
|
|
23
|
-
function Badge(
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
function Badge(t0) {
|
|
26
|
+
const $ = _c(13);
|
|
27
|
+
let className;
|
|
28
|
+
let props;
|
|
29
|
+
let t1;
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[0] !== t0) {
|
|
32
|
+
({
|
|
33
|
+
className,
|
|
34
|
+
variant: t1,
|
|
35
|
+
asChild: t2,
|
|
36
|
+
...props
|
|
37
|
+
} = t0);
|
|
38
|
+
$[0] = t0;
|
|
39
|
+
$[1] = className;
|
|
40
|
+
$[2] = props;
|
|
41
|
+
$[3] = t1;
|
|
42
|
+
$[4] = t2;
|
|
43
|
+
} else {
|
|
44
|
+
className = $[1];
|
|
45
|
+
props = $[2];
|
|
46
|
+
t1 = $[3];
|
|
47
|
+
t2 = $[4];
|
|
48
|
+
}
|
|
49
|
+
const variant = t1 === undefined ? "default" : t1;
|
|
50
|
+
const asChild = t2 === undefined ? false : t2;
|
|
51
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[5] !== className || $[6] !== variant) {
|
|
54
|
+
t3 = cn(badgeVariants({
|
|
55
|
+
variant
|
|
56
|
+
}), className);
|
|
57
|
+
$[5] = className;
|
|
58
|
+
$[6] = variant;
|
|
59
|
+
$[7] = t3;
|
|
60
|
+
} else {
|
|
61
|
+
t3 = $[7];
|
|
62
|
+
}
|
|
63
|
+
let t4;
|
|
64
|
+
if ($[8] !== Comp || $[9] !== props || $[10] !== t3 || $[11] !== variant) {
|
|
65
|
+
t4 = /*#__PURE__*/_jsx(Comp, {
|
|
66
|
+
"data-slot": "badge",
|
|
67
|
+
"data-variant": variant,
|
|
68
|
+
className: t3,
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
$[8] = Comp;
|
|
72
|
+
$[9] = props;
|
|
73
|
+
$[10] = t3;
|
|
74
|
+
$[11] = variant;
|
|
75
|
+
$[12] = t4;
|
|
76
|
+
} else {
|
|
77
|
+
t4 = $[12];
|
|
78
|
+
}
|
|
79
|
+
return t4;
|
|
26
80
|
}
|
|
27
81
|
export { Badge, badgeVariants };
|
|
@@ -1,59 +1,219 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { cn } from "cn";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import * as RechartsPrimitive from "recharts";
|
|
6
|
-
|
|
7
|
-
const
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const THEMES = {
|
|
9
|
+
light: "",
|
|
10
|
+
dark: ".dark"
|
|
11
|
+
};
|
|
12
|
+
const INITIAL_DIMENSION = {
|
|
13
|
+
width: 320,
|
|
14
|
+
height: 200
|
|
15
|
+
};
|
|
8
16
|
const ChartContext = React.createContext(null);
|
|
9
17
|
function useChart() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
const context = React.useContext(ChartContext);
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
15
23
|
}
|
|
16
|
-
function ChartContainer(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
function ChartContainer(t0) {
|
|
25
|
+
const $ = _c(29);
|
|
26
|
+
let children;
|
|
27
|
+
let className;
|
|
28
|
+
let config;
|
|
29
|
+
let id;
|
|
30
|
+
let props;
|
|
31
|
+
let t1;
|
|
32
|
+
if ($[0] !== t0) {
|
|
33
|
+
({
|
|
34
|
+
id,
|
|
35
|
+
className,
|
|
36
|
+
children,
|
|
37
|
+
config,
|
|
38
|
+
initialDimension: t1,
|
|
39
|
+
...props
|
|
40
|
+
} = t0);
|
|
41
|
+
$[0] = t0;
|
|
42
|
+
$[1] = children;
|
|
43
|
+
$[2] = className;
|
|
44
|
+
$[3] = config;
|
|
45
|
+
$[4] = id;
|
|
46
|
+
$[5] = props;
|
|
47
|
+
$[6] = t1;
|
|
48
|
+
} else {
|
|
49
|
+
children = $[1];
|
|
50
|
+
className = $[2];
|
|
51
|
+
config = $[3];
|
|
52
|
+
id = $[4];
|
|
53
|
+
props = $[5];
|
|
54
|
+
t1 = $[6];
|
|
55
|
+
}
|
|
56
|
+
const initialDimension = t1 === undefined ? INITIAL_DIMENSION : t1;
|
|
57
|
+
const uniqueId = React.useId();
|
|
58
|
+
let t2;
|
|
59
|
+
if ($[7] !== id || $[8] !== uniqueId) {
|
|
60
|
+
t2 = id ?? uniqueId.replace(/:/g, "");
|
|
61
|
+
$[7] = id;
|
|
62
|
+
$[8] = uniqueId;
|
|
63
|
+
$[9] = t2;
|
|
64
|
+
} else {
|
|
65
|
+
t2 = $[9];
|
|
66
|
+
}
|
|
67
|
+
const chartId = `chart-${t2}`;
|
|
68
|
+
let t3;
|
|
69
|
+
if ($[10] !== config) {
|
|
70
|
+
t3 = {
|
|
71
|
+
config
|
|
72
|
+
};
|
|
73
|
+
$[10] = config;
|
|
74
|
+
$[11] = t3;
|
|
75
|
+
} else {
|
|
76
|
+
t3 = $[11];
|
|
77
|
+
}
|
|
78
|
+
let t4;
|
|
79
|
+
if ($[12] !== className) {
|
|
80
|
+
t4 = cn("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-hidden [&_.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]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className);
|
|
81
|
+
$[12] = className;
|
|
82
|
+
$[13] = t4;
|
|
83
|
+
} else {
|
|
84
|
+
t4 = $[13];
|
|
85
|
+
}
|
|
86
|
+
let t5;
|
|
87
|
+
if ($[14] !== chartId || $[15] !== config) {
|
|
88
|
+
t5 = /*#__PURE__*/_jsx(ChartStyle, {
|
|
89
|
+
id: chartId,
|
|
90
|
+
config: config
|
|
91
|
+
});
|
|
92
|
+
$[14] = chartId;
|
|
93
|
+
$[15] = config;
|
|
94
|
+
$[16] = t5;
|
|
95
|
+
} else {
|
|
96
|
+
t5 = $[16];
|
|
97
|
+
}
|
|
98
|
+
let t6;
|
|
99
|
+
if ($[17] !== children || $[18] !== initialDimension) {
|
|
100
|
+
t6 = /*#__PURE__*/_jsx(RechartsPrimitive.ResponsiveContainer, {
|
|
101
|
+
initialDimension: initialDimension,
|
|
102
|
+
children: children
|
|
103
|
+
});
|
|
104
|
+
$[17] = children;
|
|
105
|
+
$[18] = initialDimension;
|
|
106
|
+
$[19] = t6;
|
|
107
|
+
} else {
|
|
108
|
+
t6 = $[19];
|
|
109
|
+
}
|
|
110
|
+
let t7;
|
|
111
|
+
if ($[20] !== chartId || $[21] !== props || $[22] !== t4 || $[23] !== t5 || $[24] !== t6) {
|
|
112
|
+
t7 = /*#__PURE__*/_jsxs("div", {
|
|
113
|
+
"data-slot": "chart",
|
|
114
|
+
"data-chart": chartId,
|
|
115
|
+
className: t4,
|
|
116
|
+
...props,
|
|
117
|
+
children: [t5, t6]
|
|
118
|
+
});
|
|
119
|
+
$[20] = chartId;
|
|
120
|
+
$[21] = props;
|
|
121
|
+
$[22] = t4;
|
|
122
|
+
$[23] = t5;
|
|
123
|
+
$[24] = t6;
|
|
124
|
+
$[25] = t7;
|
|
125
|
+
} else {
|
|
126
|
+
t7 = $[25];
|
|
127
|
+
}
|
|
128
|
+
let t8;
|
|
129
|
+
if ($[26] !== t3 || $[27] !== t7) {
|
|
130
|
+
t8 = /*#__PURE__*/_jsx(ChartContext.Provider, {
|
|
131
|
+
value: t3,
|
|
132
|
+
children: t7
|
|
133
|
+
});
|
|
134
|
+
$[26] = t3;
|
|
135
|
+
$[27] = t7;
|
|
136
|
+
$[28] = t8;
|
|
137
|
+
} else {
|
|
138
|
+
t8 = $[28];
|
|
139
|
+
}
|
|
140
|
+
return t8;
|
|
20
141
|
}
|
|
21
|
-
const ChartStyle =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
142
|
+
const ChartStyle = t0 => {
|
|
143
|
+
const $ = _c(8);
|
|
144
|
+
const {
|
|
145
|
+
id,
|
|
146
|
+
config
|
|
147
|
+
} = t0;
|
|
148
|
+
let t1;
|
|
149
|
+
if ($[0] !== config) {
|
|
150
|
+
t1 = Object.entries(config).filter(_temp);
|
|
151
|
+
$[0] = config;
|
|
152
|
+
$[1] = t1;
|
|
153
|
+
} else {
|
|
154
|
+
t1 = $[1];
|
|
155
|
+
}
|
|
156
|
+
const colorConfig = t1;
|
|
157
|
+
if (!colorConfig.length) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
let t2;
|
|
161
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
162
|
+
t2 = Object.entries(THEMES);
|
|
163
|
+
$[2] = t2;
|
|
164
|
+
} else {
|
|
165
|
+
t2 = $[2];
|
|
166
|
+
}
|
|
167
|
+
let t3;
|
|
168
|
+
if ($[3] !== colorConfig || $[4] !== id) {
|
|
169
|
+
t3 = t2.map(t4 => {
|
|
170
|
+
const [theme, prefix] = t4;
|
|
171
|
+
return `
|
|
29
172
|
${prefix} [data-chart=${id}] {
|
|
30
|
-
${colorConfig
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.join("\n")}
|
|
173
|
+
${colorConfig.map(t5 => {
|
|
174
|
+
const [key, itemConfig] = t5;
|
|
175
|
+
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
176
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
177
|
+
}).join("\n")}
|
|
36
178
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
179
|
+
`;
|
|
180
|
+
});
|
|
181
|
+
$[3] = colorConfig;
|
|
182
|
+
$[4] = id;
|
|
183
|
+
$[5] = t3;
|
|
184
|
+
} else {
|
|
185
|
+
t3 = $[5];
|
|
186
|
+
}
|
|
187
|
+
const t4 = t3.join("\n");
|
|
188
|
+
let t5;
|
|
189
|
+
if ($[6] !== t4) {
|
|
190
|
+
t5 = /*#__PURE__*/_jsx("style", {
|
|
191
|
+
dangerouslySetInnerHTML: {
|
|
192
|
+
__html: t4
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
$[6] = t4;
|
|
196
|
+
$[7] = t5;
|
|
197
|
+
} else {
|
|
198
|
+
t5 = $[7];
|
|
199
|
+
}
|
|
200
|
+
return t5;
|
|
40
201
|
};
|
|
41
202
|
function getPayloadConfigFromPayload(config, payload, key) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
key in payloadPayload &&
|
|
54
|
-
typeof payloadPayload[key] === "string") {
|
|
55
|
-
configLabelKey = payloadPayload[key];
|
|
56
|
-
}
|
|
57
|
-
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
203
|
+
if (typeof payload !== "object" || payload === null) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : undefined;
|
|
207
|
+
let configLabelKey = key;
|
|
208
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
209
|
+
configLabelKey = payload[key];
|
|
210
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
211
|
+
configLabelKey = payloadPayload[key];
|
|
212
|
+
}
|
|
213
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
58
214
|
}
|
|
59
215
|
export { ChartContainer, ChartStyle, getPayloadConfigFromPayload, useChart };
|
|
216
|
+
function _temp(t0) {
|
|
217
|
+
const [, config_0] = t0;
|
|
218
|
+
return config_0.theme ?? config_0.color;
|
|
219
|
+
}
|
|
@@ -1,22 +1,87 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { cn } from "cn";
|
|
5
|
+
import * as React from "react";
|
|
4
6
|
import * as RechartsPrimitive from "recharts";
|
|
5
7
|
import { getPayloadConfigFromPayload, useChart } from "./chart-container.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
9
|
const ChartLegend = RechartsPrimitive.Legend;
|
|
7
|
-
function ChartLegendContent(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
function ChartLegendContent(t0) {
|
|
11
|
+
const $ = _c(15);
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
hideIcon: t1,
|
|
15
|
+
payload,
|
|
16
|
+
verticalAlign: t2,
|
|
17
|
+
nameKey
|
|
18
|
+
} = t0;
|
|
19
|
+
const hideIcon = t1 === undefined ? false : t1;
|
|
20
|
+
const verticalAlign = t2 === undefined ? "bottom" : t2;
|
|
21
|
+
const {
|
|
22
|
+
config
|
|
23
|
+
} = useChart();
|
|
24
|
+
if (!payload?.length) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const t3 = verticalAlign === "top" ? "pb-3" : "pt-3";
|
|
28
|
+
let t4;
|
|
29
|
+
if ($[0] !== className || $[1] !== t3) {
|
|
30
|
+
t4 = cn("flex items-center justify-center gap-4", t3, className);
|
|
31
|
+
$[0] = className;
|
|
32
|
+
$[1] = t3;
|
|
33
|
+
$[2] = t4;
|
|
34
|
+
} else {
|
|
35
|
+
t4 = $[2];
|
|
36
|
+
}
|
|
37
|
+
let t5;
|
|
38
|
+
if ($[3] !== config || $[4] !== hideIcon || $[5] !== nameKey || $[6] !== payload) {
|
|
39
|
+
let t6;
|
|
40
|
+
if ($[8] !== config || $[9] !== hideIcon || $[10] !== nameKey) {
|
|
41
|
+
t6 = item_0 => {
|
|
42
|
+
const key = `${nameKey ?? item_0.dataKey ?? "value"}`;
|
|
43
|
+
const itemConfig = getPayloadConfigFromPayload(config, item_0, key);
|
|
44
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
45
|
+
className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
46
|
+
children: [itemConfig?.icon && !hideIcon ? /*#__PURE__*/_jsx(itemConfig.icon, {}) : /*#__PURE__*/_jsx("div", {
|
|
47
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
48
|
+
style: {
|
|
49
|
+
backgroundColor: item_0.color
|
|
50
|
+
}
|
|
51
|
+
}), itemConfig?.label]
|
|
52
|
+
}, key);
|
|
53
|
+
};
|
|
54
|
+
$[8] = config;
|
|
55
|
+
$[9] = hideIcon;
|
|
56
|
+
$[10] = nameKey;
|
|
57
|
+
$[11] = t6;
|
|
58
|
+
} else {
|
|
59
|
+
t6 = $[11];
|
|
11
60
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
61
|
+
t5 = payload.filter(_temp).map(t6);
|
|
62
|
+
$[3] = config;
|
|
63
|
+
$[4] = hideIcon;
|
|
64
|
+
$[5] = nameKey;
|
|
65
|
+
$[6] = payload;
|
|
66
|
+
$[7] = t5;
|
|
67
|
+
} else {
|
|
68
|
+
t5 = $[7];
|
|
69
|
+
}
|
|
70
|
+
let t6;
|
|
71
|
+
if ($[12] !== t4 || $[13] !== t5) {
|
|
72
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: t4,
|
|
74
|
+
children: t5
|
|
75
|
+
});
|
|
76
|
+
$[12] = t4;
|
|
77
|
+
$[13] = t5;
|
|
78
|
+
$[14] = t6;
|
|
79
|
+
} else {
|
|
80
|
+
t6 = $[14];
|
|
81
|
+
}
|
|
82
|
+
return t6;
|
|
83
|
+
}
|
|
84
|
+
function _temp(item) {
|
|
85
|
+
return item.type !== "none";
|
|
21
86
|
}
|
|
22
87
|
export { ChartLegend, ChartLegendContent };
|