@zimyo/ui 1.0.1 → 1.0.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/index.d.ts +1 -0
- package/dist/components/ui/accordion.d.ts +5 -4
- package/dist/components/ui/accordion.js +21 -16
- package/dist/components/ui/alert-dialog.d.ts +12 -11
- package/dist/components/ui/alert-dialog.js +17 -16
- package/dist/components/ui/alert.d.ts +4 -3
- package/dist/components/ui/alert.js +4 -5
- package/dist/components/ui/aspect-ratio.d.ts +2 -2
- package/dist/components/ui/aspect-ratio.js +2 -2
- package/dist/components/ui/avatar.d.ts +4 -3
- package/dist/components/ui/avatar.js +4 -5
- package/dist/components/ui/badge.d.ts +3 -2
- package/dist/components/ui/badge.js +2 -3
- package/dist/components/ui/breadcrumb.d.ts +8 -7
- package/dist/components/ui/breadcrumb.js +19 -15
- package/dist/components/ui/button.d.ts +3 -2
- package/dist/components/ui/button.js +2 -3
- package/dist/components/ui/calendar.d.ts +3 -2
- package/dist/components/ui/calendar.js +13 -10
- package/dist/components/ui/card.d.ts +8 -7
- package/dist/components/ui/card.js +8 -9
- package/dist/components/ui/carousel.d.ts +6 -5
- package/dist/components/ui/carousel.js +34 -24
- package/dist/components/ui/chart.d.ts +5 -4
- package/dist/components/ui/chart.js +81 -65
- package/dist/components/ui/checkbox.d.ts +2 -1
- package/dist/components/ui/checkbox.js +11 -9
- package/dist/components/ui/collapsible.d.ts +4 -4
- package/dist/components/ui/collapsible.js +4 -4
- package/dist/components/ui/command.d.ts +10 -9
- package/dist/components/ui/command.js +34 -25
- package/dist/components/ui/context-menu.d.ts +16 -15
- package/dist/components/ui/context-menu.js +45 -32
- package/dist/components/ui/dialog.d.ts +11 -10
- package/dist/components/ui/dialog.js +26 -22
- package/dist/components/ui/drawer.d.ts +11 -10
- package/dist/components/ui/drawer.js +21 -19
- package/dist/components/ui/dropdown-menu.d.ts +16 -15
- package/dist/components/ui/dropdown-menu.js +46 -33
- package/dist/components/ui/form.d.ts +7 -6
- package/dist/components/ui/form.js +19 -15
- package/dist/components/ui/hover-card.d.ts +4 -3
- package/dist/components/ui/hover-card.js +12 -12
- package/dist/components/ui/input-otp.d.ts +5 -4
- package/dist/components/ui/input-otp.js +16 -11
- package/dist/components/ui/input.d.ts +2 -1
- package/dist/components/ui/input.js +2 -3
- package/dist/components/ui/label.d.ts +2 -1
- package/dist/components/ui/label.js +2 -3
- package/dist/components/ui/menubar.d.ts +17 -16
- package/dist/components/ui/menubar.js +49 -36
- package/dist/components/ui/navigation-menu.d.ts +9 -8
- package/dist/components/ui/navigation-menu.js +27 -21
- package/dist/components/ui/pagination.d.ts +8 -7
- package/dist/components/ui/pagination.js +28 -20
- package/dist/components/ui/popover.d.ts +5 -4
- package/dist/components/ui/popover.js +12 -11
- package/dist/components/ui/progress.d.ts +2 -1
- package/dist/components/ui/progress.js +11 -10
- package/dist/components/ui/radio-group.d.ts +3 -2
- package/dist/components/ui/radio-group.js +12 -10
- package/dist/components/ui/resizable.d.ts +4 -3
- package/dist/components/ui/resizable.js +12 -10
- package/dist/components/ui/scroll-area.d.ts +3 -2
- package/dist/components/ui/scroll-area.js +15 -11
- package/dist/components/ui/select.d.ts +11 -10
- package/dist/components/ui/select.js +50 -32
- package/dist/components/ui/separator.d.ts +2 -1
- package/dist/components/ui/separator.js +2 -3
- package/dist/components/ui/sheet.d.ts +9 -8
- package/dist/components/ui/sheet.js +26 -21
- package/dist/components/ui/sidebar.d.ts +24 -23
- package/dist/components/ui/sidebar.js +112 -85
- package/dist/components/ui/skeleton.d.ts +2 -2
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/slider.d.ts +2 -1
- package/dist/components/ui/slider.js +17 -15
- package/dist/components/ui/sonner.d.ts +2 -2
- package/dist/components/ui/sonner.js +2 -2
- package/dist/components/ui/switch.d.ts +2 -1
- package/dist/components/ui/switch.js +7 -6
- package/dist/components/ui/table.d.ts +9 -8
- package/dist/components/ui/table.js +15 -15
- package/dist/components/ui/tabs.d.ts +5 -4
- package/dist/components/ui/tabs.js +5 -6
- package/dist/components/ui/textarea.d.ts +2 -1
- package/dist/components/ui/textarea.js +2 -3
- package/dist/components/ui/toggle-group.d.ts +3 -2
- package/dist/components/ui/toggle-group.js +15 -10
- package/dist/components/ui/toggle.d.ts +2 -1
- package/dist/components/ui/toggle.js +2 -3
- package/dist/components/ui/tooltip.d.ts +5 -4
- package/dist/components/ui/tooltip.js +19 -14
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/providers/ThemeProvider.d.ts +12 -0
- package/dist/providers/ThemeProvider.js +27 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/styles.css +1 -1
- package/package.json +5 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { buttonVariants, Button } from './button.js';
|
|
@@ -19,7 +19,7 @@ function Calendar(_a) {
|
|
|
19
19
|
} = _a,
|
|
20
20
|
props = __rest(_a, ["className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components"]);
|
|
21
21
|
const defaultClassNames = getDefaultClassNames();
|
|
22
|
-
return
|
|
22
|
+
return jsx(DayPicker, Object.assign({
|
|
23
23
|
showOutsideDays: showOutsideDays,
|
|
24
24
|
className: cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
25
25
|
captionLayout: captionLayout,
|
|
@@ -66,7 +66,7 @@ function Calendar(_a) {
|
|
|
66
66
|
rootRef
|
|
67
67
|
} = _a,
|
|
68
68
|
props = __rest(_a, ["className", "rootRef"]);
|
|
69
|
-
return
|
|
69
|
+
return jsx("div", Object.assign({
|
|
70
70
|
"data-slot": "calendar",
|
|
71
71
|
ref: rootRef,
|
|
72
72
|
className: cn(className)
|
|
@@ -79,16 +79,16 @@ function Calendar(_a) {
|
|
|
79
79
|
} = _a,
|
|
80
80
|
props = __rest(_a, ["className", "orientation"]);
|
|
81
81
|
if (orientation === "left") {
|
|
82
|
-
return
|
|
82
|
+
return jsx(ChevronLeftIcon, Object.assign({
|
|
83
83
|
className: cn("size-4", className)
|
|
84
84
|
}, props));
|
|
85
85
|
}
|
|
86
86
|
if (orientation === "right") {
|
|
87
|
-
return
|
|
87
|
+
return jsx(ChevronRightIcon, Object.assign({
|
|
88
88
|
className: cn("size-4", className)
|
|
89
89
|
}, props));
|
|
90
90
|
}
|
|
91
|
-
return
|
|
91
|
+
return jsx(ChevronDownIcon, Object.assign({
|
|
92
92
|
className: cn("size-4", className)
|
|
93
93
|
}, props));
|
|
94
94
|
},
|
|
@@ -98,9 +98,12 @@ function Calendar(_a) {
|
|
|
98
98
|
children
|
|
99
99
|
} = _a,
|
|
100
100
|
props = __rest(_a, ["children"]);
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
return jsx("td", Object.assign({}, props, {
|
|
102
|
+
children: jsx("div", {
|
|
103
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
104
|
+
children: children
|
|
105
|
+
})
|
|
106
|
+
}));
|
|
104
107
|
}
|
|
105
108
|
}, components)
|
|
106
109
|
}, props));
|
|
@@ -118,7 +121,7 @@ function CalendarDayButton(_a) {
|
|
|
118
121
|
var _a;
|
|
119
122
|
if (modifiers.focused) (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
120
123
|
}, [modifiers.focused]);
|
|
121
|
-
return
|
|
124
|
+
return jsx(Button, Object.assign({
|
|
122
125
|
ref: ref,
|
|
123
126
|
variant: "ghost",
|
|
124
127
|
size: "icon",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
|
|
3
|
-
declare function Card({ className, ...props }: React.ComponentProps<"div">):
|
|
4
|
-
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">):
|
|
5
|
-
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">):
|
|
6
|
-
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">):
|
|
7
|
-
declare function CardAction({ className, ...props }: React.ComponentProps<"div">):
|
|
8
|
-
declare function CardContent({ className, ...props }: React.ComponentProps<"div">):
|
|
9
|
-
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">):
|
|
4
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
12
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
3
|
-
import
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
3
|
import { cn } from '../../lib/utils.js';
|
|
5
4
|
|
|
6
5
|
function Card(_a) {
|
|
@@ -8,7 +7,7 @@ function Card(_a) {
|
|
|
8
7
|
className
|
|
9
8
|
} = _a,
|
|
10
9
|
props = __rest(_a, ["className"]);
|
|
11
|
-
return
|
|
10
|
+
return jsx("div", Object.assign({
|
|
12
11
|
"data-slot": "card",
|
|
13
12
|
className: cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)
|
|
14
13
|
}, props));
|
|
@@ -18,7 +17,7 @@ function CardHeader(_a) {
|
|
|
18
17
|
className
|
|
19
18
|
} = _a,
|
|
20
19
|
props = __rest(_a, ["className"]);
|
|
21
|
-
return
|
|
20
|
+
return jsx("div", Object.assign({
|
|
22
21
|
"data-slot": "card-header",
|
|
23
22
|
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className)
|
|
24
23
|
}, props));
|
|
@@ -28,7 +27,7 @@ function CardTitle(_a) {
|
|
|
28
27
|
className
|
|
29
28
|
} = _a,
|
|
30
29
|
props = __rest(_a, ["className"]);
|
|
31
|
-
return
|
|
30
|
+
return jsx("div", Object.assign({
|
|
32
31
|
"data-slot": "card-title",
|
|
33
32
|
className: cn("leading-none font-semibold", className)
|
|
34
33
|
}, props));
|
|
@@ -38,7 +37,7 @@ function CardDescription(_a) {
|
|
|
38
37
|
className
|
|
39
38
|
} = _a,
|
|
40
39
|
props = __rest(_a, ["className"]);
|
|
41
|
-
return
|
|
40
|
+
return jsx("div", Object.assign({
|
|
42
41
|
"data-slot": "card-description",
|
|
43
42
|
className: cn("text-muted-foreground text-sm", className)
|
|
44
43
|
}, props));
|
|
@@ -48,7 +47,7 @@ function CardAction(_a) {
|
|
|
48
47
|
className
|
|
49
48
|
} = _a,
|
|
50
49
|
props = __rest(_a, ["className"]);
|
|
51
|
-
return
|
|
50
|
+
return jsx("div", Object.assign({
|
|
52
51
|
"data-slot": "card-action",
|
|
53
52
|
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)
|
|
54
53
|
}, props));
|
|
@@ -58,7 +57,7 @@ function CardContent(_a) {
|
|
|
58
57
|
className
|
|
59
58
|
} = _a,
|
|
60
59
|
props = __rest(_a, ["className"]);
|
|
61
|
-
return
|
|
60
|
+
return jsx("div", Object.assign({
|
|
62
61
|
"data-slot": "card-content",
|
|
63
62
|
className: cn("px-6", className)
|
|
64
63
|
}, props));
|
|
@@ -68,7 +67,7 @@ function CardFooter(_a) {
|
|
|
68
67
|
className
|
|
69
68
|
} = _a,
|
|
70
69
|
props = __rest(_a, ["className"]);
|
|
71
|
-
return
|
|
70
|
+
return jsx("div", Object.assign({
|
|
72
71
|
"data-slot": "card-footer",
|
|
73
72
|
className: cn("flex items-center px-6 [.border-t]:pt-6", className)
|
|
74
73
|
}, props));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { Button } from './button.js';
|
|
@@ -14,11 +15,11 @@ type CarouselProps = {
|
|
|
14
15
|
orientation?: "horizontal" | "vertical";
|
|
15
16
|
setApi?: (api: CarouselApi) => void;
|
|
16
17
|
};
|
|
17
|
-
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps):
|
|
18
|
-
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">):
|
|
19
|
-
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">):
|
|
20
|
-
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>):
|
|
21
|
-
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>):
|
|
18
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
22
23
|
|
|
23
24
|
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
|
24
25
|
export type { CarouselApi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import useEmblaCarousel from '../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js';
|
|
4
4
|
import { ArrowRight, ArrowLeft } from 'lucide-react';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -62,7 +62,7 @@ function Carousel(_a) {
|
|
|
62
62
|
api === null || api === void 0 ? void 0 : api.off("select", onSelect);
|
|
63
63
|
};
|
|
64
64
|
}, [api, onSelect]);
|
|
65
|
-
return
|
|
65
|
+
return jsx(CarouselContext.Provider, {
|
|
66
66
|
value: {
|
|
67
67
|
carouselRef,
|
|
68
68
|
api: api,
|
|
@@ -72,14 +72,17 @@ function Carousel(_a) {
|
|
|
72
72
|
scrollNext,
|
|
73
73
|
canScrollPrev,
|
|
74
74
|
canScrollNext
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
},
|
|
76
|
+
children: jsx("div", Object.assign({
|
|
77
|
+
onKeyDownCapture: handleKeyDown,
|
|
78
|
+
className: cn("relative", className),
|
|
79
|
+
role: "region",
|
|
80
|
+
"aria-roledescription": "carousel",
|
|
81
|
+
"data-slot": "carousel"
|
|
82
|
+
}, props, {
|
|
83
|
+
children: children
|
|
84
|
+
}))
|
|
85
|
+
});
|
|
83
86
|
}
|
|
84
87
|
function CarouselContent(_a) {
|
|
85
88
|
var {
|
|
@@ -90,13 +93,14 @@ function CarouselContent(_a) {
|
|
|
90
93
|
carouselRef,
|
|
91
94
|
orientation
|
|
92
95
|
} = useCarousel();
|
|
93
|
-
return
|
|
96
|
+
return jsx("div", {
|
|
94
97
|
ref: carouselRef,
|
|
95
98
|
className: "overflow-hidden",
|
|
96
|
-
"data-slot": "carousel-content"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
"data-slot": "carousel-content",
|
|
100
|
+
children: jsx("div", Object.assign({
|
|
101
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)
|
|
102
|
+
}, props))
|
|
103
|
+
});
|
|
100
104
|
}
|
|
101
105
|
function CarouselItem(_a) {
|
|
102
106
|
var {
|
|
@@ -106,7 +110,7 @@ function CarouselItem(_a) {
|
|
|
106
110
|
const {
|
|
107
111
|
orientation
|
|
108
112
|
} = useCarousel();
|
|
109
|
-
return
|
|
113
|
+
return jsx("div", Object.assign({
|
|
110
114
|
role: "group",
|
|
111
115
|
"aria-roledescription": "slide",
|
|
112
116
|
"data-slot": "carousel-item",
|
|
@@ -125,16 +129,19 @@ function CarouselPrevious(_a) {
|
|
|
125
129
|
scrollPrev,
|
|
126
130
|
canScrollPrev
|
|
127
131
|
} = useCarousel();
|
|
128
|
-
return
|
|
132
|
+
return jsxs(Button, Object.assign({
|
|
129
133
|
"data-slot": "carousel-previous",
|
|
130
134
|
variant: variant,
|
|
131
135
|
size: size,
|
|
132
136
|
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
133
137
|
disabled: !canScrollPrev,
|
|
134
138
|
onClick: scrollPrev
|
|
135
|
-
}, props
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
}, props, {
|
|
140
|
+
children: [jsx(ArrowLeft, {}), jsx("span", {
|
|
141
|
+
className: "sr-only",
|
|
142
|
+
children: "Previous slide"
|
|
143
|
+
})]
|
|
144
|
+
}));
|
|
138
145
|
}
|
|
139
146
|
function CarouselNext(_a) {
|
|
140
147
|
var {
|
|
@@ -148,16 +155,19 @@ function CarouselNext(_a) {
|
|
|
148
155
|
scrollNext,
|
|
149
156
|
canScrollNext
|
|
150
157
|
} = useCarousel();
|
|
151
|
-
return
|
|
158
|
+
return jsxs(Button, Object.assign({
|
|
152
159
|
"data-slot": "carousel-next",
|
|
153
160
|
variant: variant,
|
|
154
161
|
size: size,
|
|
155
162
|
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
156
163
|
disabled: !canScrollNext,
|
|
157
164
|
onClick: scrollNext
|
|
158
|
-
}, props
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
}, props, {
|
|
166
|
+
children: [jsx(ArrowRight, {}), jsx("span", {
|
|
167
|
+
className: "sr-only",
|
|
168
|
+
children: "Next slide"
|
|
169
|
+
})]
|
|
170
|
+
}));
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import * as RechartsPrimitive from 'recharts';
|
|
3
4
|
|
|
@@ -20,11 +21,11 @@ type ChartConfig = {
|
|
|
20
21
|
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<"div"> & {
|
|
21
22
|
config: ChartConfig;
|
|
22
23
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
23
|
-
}):
|
|
24
|
+
}): react_jsx_runtime.JSX.Element;
|
|
24
25
|
declare const ChartStyle: ({ id, config }: {
|
|
25
26
|
id: string;
|
|
26
27
|
config: ChartConfig;
|
|
27
|
-
}) =>
|
|
28
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
28
29
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
29
30
|
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
30
31
|
hideLabel?: boolean;
|
|
@@ -32,12 +33,12 @@ declare function ChartTooltipContent({ active, payload, className, indicator, hi
|
|
|
32
33
|
indicator?: "line" | "dot" | "dashed";
|
|
33
34
|
nameKey?: string;
|
|
34
35
|
labelKey?: string;
|
|
35
|
-
}):
|
|
36
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
36
37
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
37
38
|
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
38
39
|
hideIcon?: boolean;
|
|
39
40
|
nameKey?: string;
|
|
40
|
-
}):
|
|
41
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
41
42
|
|
|
42
43
|
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
43
44
|
export type { ChartConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as RechartsPrimitive from 'recharts';
|
|
5
5
|
import { cn } from '../../lib/utils.js';
|
|
@@ -27,18 +27,23 @@ function ChartContainer(_a) {
|
|
|
27
27
|
props = __rest(_a, ["id", "className", "children", "config"]);
|
|
28
28
|
const uniqueId = React.useId();
|
|
29
29
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
30
|
-
return
|
|
30
|
+
return jsx(ChartContext.Provider, {
|
|
31
31
|
value: {
|
|
32
32
|
config
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
},
|
|
34
|
+
children: jsxs("div", Object.assign({
|
|
35
|
+
"data-slot": "chart",
|
|
36
|
+
"data-chart": chartId,
|
|
37
|
+
className: cn("[&_.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-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 flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className)
|
|
38
|
+
}, props, {
|
|
39
|
+
children: [jsx(ChartStyle, {
|
|
40
|
+
id: chartId,
|
|
41
|
+
config: config
|
|
42
|
+
}), jsx(RechartsPrimitive.ResponsiveContainer, {
|
|
43
|
+
children: children
|
|
44
|
+
})]
|
|
45
|
+
}))
|
|
46
|
+
});
|
|
42
47
|
}
|
|
43
48
|
const ChartStyle = ({
|
|
44
49
|
id,
|
|
@@ -48,7 +53,7 @@ const ChartStyle = ({
|
|
|
48
53
|
if (!colorConfig.length) {
|
|
49
54
|
return null;
|
|
50
55
|
}
|
|
51
|
-
return
|
|
56
|
+
return jsx("style", {
|
|
52
57
|
dangerouslySetInnerHTML: {
|
|
53
58
|
__html: Object.entries(THEMES).map(([theme, prefix]) => `
|
|
54
59
|
${prefix} [data-chart=${id}] {
|
|
@@ -91,53 +96,63 @@ function ChartTooltipContent({
|
|
|
91
96
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
92
97
|
const value = !labelKey && typeof label === "string" ? ((_a = config[label]) === null || _a === void 0 ? void 0 : _a.label) || label : itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label;
|
|
93
98
|
if (labelFormatter) {
|
|
94
|
-
return
|
|
95
|
-
className: cn("font-medium", labelClassName)
|
|
96
|
-
|
|
99
|
+
return jsx("div", {
|
|
100
|
+
className: cn("font-medium", labelClassName),
|
|
101
|
+
children: labelFormatter(value, payload)
|
|
102
|
+
});
|
|
97
103
|
}
|
|
98
104
|
if (!value) {
|
|
99
105
|
return null;
|
|
100
106
|
}
|
|
101
|
-
return
|
|
102
|
-
className: cn("font-medium", labelClassName)
|
|
103
|
-
|
|
107
|
+
return jsx("div", {
|
|
108
|
+
className: cn("font-medium", labelClassName),
|
|
109
|
+
children: value
|
|
110
|
+
});
|
|
104
111
|
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
105
112
|
if (!active || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
106
113
|
return null;
|
|
107
114
|
}
|
|
108
115
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
109
|
-
return
|
|
110
|
-
className: cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
116
|
+
return jsxs("div", {
|
|
117
|
+
className: cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
118
|
+
children: [!nestLabel ? tooltipLabel : null, jsx("div", {
|
|
119
|
+
className: "grid gap-1.5",
|
|
120
|
+
children: payload.map((item, index) => {
|
|
121
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
122
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
123
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
124
|
+
return jsx("div", {
|
|
125
|
+
className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center"),
|
|
126
|
+
children: formatter && (item === null || item === void 0 ? void 0 : item.value) !== undefined && item.name ? formatter(item.value, item.name, item, index, item.payload) : jsxs(Fragment, {
|
|
127
|
+
children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) ? jsx(itemConfig.icon, {}) : !hideIndicator && jsx("div", {
|
|
128
|
+
className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
129
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
130
|
+
"w-1": indicator === "line",
|
|
131
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
132
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
133
|
+
}),
|
|
134
|
+
style: {
|
|
135
|
+
"--color-bg": indicatorColor,
|
|
136
|
+
"--color-border": indicatorColor
|
|
137
|
+
}
|
|
138
|
+
}), jsxs("div", {
|
|
139
|
+
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
|
|
140
|
+
children: [jsxs("div", {
|
|
141
|
+
className: "grid gap-1.5",
|
|
142
|
+
children: [nestLabel ? tooltipLabel : null, jsx("span", {
|
|
143
|
+
className: "text-muted-foreground",
|
|
144
|
+
children: (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label) || item.name
|
|
145
|
+
})]
|
|
146
|
+
}), item.value && jsx("span", {
|
|
147
|
+
className: "text-foreground font-mono font-medium tabular-nums",
|
|
148
|
+
children: item.value.toLocaleString()
|
|
149
|
+
})]
|
|
150
|
+
})]
|
|
151
|
+
})
|
|
152
|
+
}, item.dataKey);
|
|
153
|
+
})
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
141
156
|
}
|
|
142
157
|
const ChartLegend = RechartsPrimitive.Legend;
|
|
143
158
|
function ChartLegendContent({
|
|
@@ -153,21 +168,22 @@ function ChartLegendContent({
|
|
|
153
168
|
if (!(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
154
169
|
return null;
|
|
155
170
|
}
|
|
156
|
-
return
|
|
157
|
-
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
return jsx("div", {
|
|
172
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
173
|
+
children: payload.map(item => {
|
|
174
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
175
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
176
|
+
return jsxs("div", {
|
|
177
|
+
className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
|
|
178
|
+
children: [(itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) && !hideIcon ? jsx(itemConfig.icon, {}) : jsx("div", {
|
|
179
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
180
|
+
style: {
|
|
181
|
+
backgroundColor: item.color
|
|
182
|
+
}
|
|
183
|
+
}), itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label]
|
|
184
|
+
}, item.value);
|
|
185
|
+
})
|
|
186
|
+
});
|
|
171
187
|
}
|
|
172
188
|
// Helper to extract item config from a payload.
|
|
173
189
|
function getPayloadConfigFromPayload(config, payload, key) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { Checkbox as Checkbox$1 } from 'radix-ui';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
|
|
4
|
-
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof Checkbox$1.Root>):
|
|
5
|
+
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof Checkbox$1.Root>): react_jsx_runtime.JSX.Element;
|
|
5
6
|
|
|
6
7
|
export { Checkbox };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { CheckIcon } from 'lucide-react';
|
|
4
4
|
import { Checkbox as Checkbox$1 } from 'radix-ui';
|
|
5
|
-
import * as React from 'react';
|
|
6
5
|
import { cn } from '../../lib/utils.js';
|
|
7
6
|
|
|
8
7
|
function Checkbox(_a) {
|
|
@@ -10,15 +9,18 @@ function Checkbox(_a) {
|
|
|
10
9
|
className
|
|
11
10
|
} = _a,
|
|
12
11
|
props = __rest(_a, ["className"]);
|
|
13
|
-
return
|
|
12
|
+
return jsx(Checkbox$1.Root, Object.assign({
|
|
14
13
|
"data-slot": "checkbox",
|
|
15
14
|
className: cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
16
|
-
}, props
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
}, props, {
|
|
16
|
+
children: jsx(Checkbox$1.Indicator, {
|
|
17
|
+
"data-slot": "checkbox-indicator",
|
|
18
|
+
className: "flex items-center justify-center text-current transition-none",
|
|
19
|
+
children: jsx(CheckIcon, {
|
|
20
|
+
className: "size-3.5"
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}));
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export { Checkbox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Collapsible as Collapsible$1 } from 'radix-ui';
|
|
3
3
|
|
|
4
|
-
declare function Collapsible({ ...props }: React.ComponentProps<typeof Collapsible$1.Root>):
|
|
5
|
-
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof Collapsible$1.CollapsibleTrigger>):
|
|
6
|
-
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof Collapsible$1.CollapsibleContent>):
|
|
4
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof Collapsible$1.Root>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof Collapsible$1.CollapsibleTrigger>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof Collapsible$1.CollapsibleContent>): react_jsx_runtime.JSX.Element;
|
|
7
7
|
|
|
8
8
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { Collapsible as Collapsible$1 } from 'radix-ui';
|
|
4
4
|
|
|
5
5
|
function Collapsible(_a) {
|
|
6
6
|
var props = __rest(_a, []);
|
|
7
|
-
return
|
|
7
|
+
return jsx(Collapsible$1.Root, Object.assign({
|
|
8
8
|
"data-slot": "collapsible"
|
|
9
9
|
}, props));
|
|
10
10
|
}
|
|
11
11
|
function CollapsibleTrigger(_a) {
|
|
12
12
|
var props = __rest(_a, []);
|
|
13
|
-
return
|
|
13
|
+
return jsx(Collapsible$1.CollapsibleTrigger, Object.assign({
|
|
14
14
|
"data-slot": "collapsible-trigger"
|
|
15
15
|
}, props));
|
|
16
16
|
}
|
|
17
17
|
function CollapsibleContent(_a) {
|
|
18
18
|
var props = __rest(_a, []);
|
|
19
|
-
return
|
|
19
|
+
return jsx(Collapsible$1.CollapsibleContent, Object.assign({
|
|
20
20
|
"data-slot": "collapsible-content"
|
|
21
21
|
}, props));
|
|
22
22
|
}
|