shadcn-packaged 2025.8.25 → 2025.9.8
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/index.css +20 -0
- package/package.json +4 -4
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +15 -20
- package/ui/alert-dialog.d.ts +17 -11
- package/ui/alert-dialog.jsx +23 -36
- package/ui/alert.d.ts +4 -5
- package/ui/alert.jsx +9 -12
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +1 -3
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +6 -9
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +7 -9
- package/ui/breadcrumb.d.ts +16 -8
- package/ui/breadcrumb.jsx +21 -26
- package/ui/button.d.ts +3 -2
- package/ui/button.jsx +14 -13
- package/ui/calendar.jsx +20 -20
- package/ui/card.d.ts +7 -8
- package/ui/card.jsx +13 -22
- package/ui/carousel.d.ts +5 -6
- package/ui/carousel.jsx +34 -26
- package/ui/chart.d.ts +28 -6
- package/ui/chart.jsx +40 -37
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +7 -8
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +3 -9
- package/ui/command.d.ts +78 -16
- package/ui/command.jsx +27 -37
- package/ui/context-menu.d.ts +21 -19
- package/ui/context-menu.jsx +47 -65
- package/ui/dialog.d.ts +17 -13
- package/ui/dialog.jsx +27 -41
- package/ui/drawer.d.ts +19 -10
- package/ui/drawer.jsx +23 -36
- package/ui/dropdown-menu.d.ts +22 -20
- package/ui/dropdown-menu.jsx +50 -66
- package/ui/form.d.ts +5 -6
- package/ui/form.jsx +23 -19
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +4 -11
- package/ui/input-otp.d.ts +30 -7
- package/ui/input-otp.jsx +15 -17
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +4 -3
- package/ui/label.d.ts +2 -1
- package/ui/label.jsx +4 -3
- package/ui/menubar.d.ts +19 -17
- package/ui/menubar.jsx +49 -58
- package/ui/navigation-menu.d.ts +9 -11
- package/ui/navigation-menu.jsx +29 -37
- package/ui/pagination.d.ts +25 -10
- package/ui/pagination.jsx +28 -35
- package/ui/popover.d.ts +4 -5
- package/ui/popover.jsx +7 -15
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +4 -5
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +11 -9
- package/ui/resizable.d.ts +20 -5
- package/ui/resizable.jsx +8 -15
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +14 -16
- package/ui/select.d.ts +11 -13
- package/ui/select.jsx +47 -58
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +2 -3
- package/ui/sheet.d.ts +23 -11
- package/ui/sheet.jsx +41 -45
- package/ui/sidebar.d.ts +34 -38
- package/ui/sidebar.jsx +122 -109
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +7 -13
- package/ui/sonner.d.ts +2 -1
- package/ui/sonner.jsx +7 -4
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +5 -6
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +18 -27
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +7 -12
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +4 -3
- package/ui/toggle-group.d.ts +8 -3
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +4 -1
- package/ui/toggle.jsx +7 -8
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +5 -19
package/ui/calendar.jsx
CHANGED
@@ -6,33 +6,33 @@ import { cn } from "../lib/utils";
|
|
6
6
|
import { Button, buttonVariants } from "../ui/button";
|
7
7
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
8
8
|
const defaultClassNames = getDefaultClassNames();
|
9
|
-
return (<DayPicker showOutsideDays={showOutsideDays} className={cn("bg-background group/calendar p-3 [--cell-size
|
9
|
+
return (<DayPicker showOutsideDays={showOutsideDays} className={cn("bg-background group/calendar p-3 [--cell-size:2rem] [[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)} captionLayout={captionLayout} formatters={{
|
10
10
|
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
11
11
|
...formatters,
|
12
12
|
}} classNames={{
|
13
13
|
root: cn("w-fit", defaultClassNames.root),
|
14
|
-
months: cn("flex gap-4
|
15
|
-
month: cn("flex flex-col
|
16
|
-
nav: cn("
|
17
|
-
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-
|
18
|
-
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-
|
19
|
-
month_caption: cn("flex
|
20
|
-
dropdowns: cn("w-full
|
21
|
-
dropdown_root: cn("
|
22
|
-
dropdown: cn("
|
14
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
15
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
16
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
17
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_previous),
|
18
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_next),
|
19
|
+
month_caption: cn("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]", defaultClassNames.month_caption),
|
20
|
+
dropdowns: cn("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
21
|
+
dropdown_root: cn("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border", defaultClassNames.dropdown_root),
|
22
|
+
dropdown: cn("bg-popover absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
23
23
|
caption_label: cn("select-none font-medium", captionLayout === "label"
|
24
24
|
? "text-sm"
|
25
|
-
: "
|
25
|
+
: "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5", defaultClassNames.caption_label),
|
26
26
|
table: "w-full border-collapse",
|
27
27
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
28
|
-
weekday: cn("text-muted-foreground
|
29
|
-
week: cn("flex w-full
|
30
|
-
week_number_header: cn("
|
31
|
-
week_number: cn("text-
|
32
|
-
day: cn("relative
|
33
|
-
range_start: cn("rounded-l-md
|
28
|
+
weekday: cn("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal", defaultClassNames.weekday),
|
29
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
30
|
+
week_number_header: cn("w-[--cell-size] select-none", defaultClassNames.week_number_header),
|
31
|
+
week_number: cn("text-muted-foreground select-none text-[0.8rem]", defaultClassNames.week_number),
|
32
|
+
day: cn("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md", defaultClassNames.day),
|
33
|
+
range_start: cn("bg-accent rounded-l-md", defaultClassNames.range_start),
|
34
34
|
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
35
|
-
range_end: cn("rounded-r-md
|
35
|
+
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
36
36
|
today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
37
37
|
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
38
38
|
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
@@ -54,7 +54,7 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
54
54
|
DayButton: CalendarDayButton,
|
55
55
|
WeekNumber: ({ children, ...props }) => {
|
56
56
|
return (<td {...props}>
|
57
|
-
<div className="flex size-
|
57
|
+
<div className="flex size-[--cell-size] items-center justify-center text-center">
|
58
58
|
{children}
|
59
59
|
</div>
|
60
60
|
</td>);
|
@@ -72,6 +72,6 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
72
72
|
return (<Button ref={ref} variant="ghost" size="icon" data-day={day.date.toLocaleDateString()} data-selected-single={modifiers.selected &&
|
73
73
|
!modifiers.range_start &&
|
74
74
|
!modifiers.range_end &&
|
75
|
-
!modifiers.range_middle} data-range-start={modifiers.range_start} data-range-end={modifiers.range_end} data-range-middle={modifiers.range_middle} className={cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50
|
75
|
+
!modifiers.range_middle} data-range-start={modifiers.range_start} data-range-end={modifiers.range_end} data-range-middle={modifiers.range_middle} className={cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className)} {...props}/>);
|
76
76
|
}
|
77
77
|
export { Calendar, CalendarDayButton };
|
package/ui/card.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
|
9
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
package/ui/card.jsx
CHANGED
@@ -1,24 +1,15 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
|
5
|
-
}
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
return (<div data-slot="card-action" className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)} {...props}/>);
|
17
|
-
}
|
18
|
-
function CardContent({ className, ...props }) {
|
19
|
-
return (<div data-slot="card-content" className={cn("px-6", className)} {...props}/>);
|
20
|
-
}
|
21
|
-
function CardFooter({ className, ...props }) {
|
22
|
-
return (<div data-slot="card-footer" className={cn("flex items-center px-6 [.border-t]:pt-6", className)} {...props}/>);
|
23
|
-
}
|
24
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
3
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("rounded-lg border bg-card text-card-foreground shadow-sm", className)} {...props}/>));
|
4
|
+
Card.displayName = "Card";
|
5
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props}/>));
|
6
|
+
CardHeader.displayName = "CardHeader";
|
7
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("text-2xl font-semibold leading-none tracking-tight", className)} {...props}/>));
|
8
|
+
CardTitle.displayName = "CardTitle";
|
9
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
|
10
|
+
CardDescription.displayName = "CardDescription";
|
11
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("p-6 pt-0", className)} {...props}/>));
|
12
|
+
CardContent.displayName = "CardContent";
|
13
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props}/>));
|
14
|
+
CardFooter.displayName = "CardFooter";
|
15
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
package/ui/carousel.d.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
3
|
-
import { Button } from "../ui/button";
|
4
3
|
type CarouselApi = UseEmblaCarouselType[1];
|
5
4
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
6
5
|
type CarouselOptions = UseCarouselParameters[0];
|
@@ -11,9 +10,9 @@ type CarouselProps = {
|
|
11
10
|
orientation?: "horizontal" | "vertical";
|
12
11
|
setApi?: (api: CarouselApi) => void;
|
13
12
|
};
|
14
|
-
declare
|
15
|
-
declare
|
16
|
-
declare
|
17
|
-
declare
|
18
|
-
declare
|
13
|
+
declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
15
|
+
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
16
|
+
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
17
|
+
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
19
18
|
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
package/ui/carousel.jsx
CHANGED
@@ -12,7 +12,7 @@ function useCarousel() {
|
|
12
12
|
}
|
13
13
|
return context;
|
14
14
|
}
|
15
|
-
|
15
|
+
const Carousel = React.forwardRef(({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }, ref) => {
|
16
16
|
const [carouselRef, api] = useEmblaCarousel({
|
17
17
|
...opts,
|
18
18
|
axis: orientation === "horizontal" ? "x" : "y",
|
@@ -20,8 +20,9 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
20
20
|
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
21
21
|
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
22
22
|
const onSelect = React.useCallback((api) => {
|
23
|
-
if (!api)
|
23
|
+
if (!api) {
|
24
24
|
return;
|
25
|
+
}
|
25
26
|
setCanScrollPrev(api.canScrollPrev());
|
26
27
|
setCanScrollNext(api.canScrollNext());
|
27
28
|
}, []);
|
@@ -42,13 +43,15 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
42
43
|
}
|
43
44
|
}, [scrollPrev, scrollNext]);
|
44
45
|
React.useEffect(() => {
|
45
|
-
if (!api || !setApi)
|
46
|
+
if (!api || !setApi) {
|
46
47
|
return;
|
48
|
+
}
|
47
49
|
setApi(api);
|
48
50
|
}, [api, setApi]);
|
49
51
|
React.useEffect(() => {
|
50
|
-
if (!api)
|
52
|
+
if (!api) {
|
51
53
|
return;
|
54
|
+
}
|
52
55
|
onSelect(api);
|
53
56
|
api.on("reInit", onSelect);
|
54
57
|
api.on("select", onSelect);
|
@@ -66,37 +69,42 @@ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className
|
|
66
69
|
canScrollPrev,
|
67
70
|
canScrollNext,
|
68
71
|
}}>
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
74
|
-
|
72
|
+
<div ref={ref} onKeyDownCapture={handleKeyDown} className={cn("relative", className)} role="region" aria-roledescription="carousel" {...props}>
|
73
|
+
{children}
|
74
|
+
</div>
|
75
|
+
</CarouselContext.Provider>);
|
76
|
+
});
|
77
|
+
Carousel.displayName = "Carousel";
|
78
|
+
const CarouselContent = React.forwardRef(({ className, ...props }, ref) => {
|
75
79
|
const { carouselRef, orientation } = useCarousel();
|
76
|
-
return (<div ref={carouselRef} className="overflow-hidden"
|
77
|
-
<div className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)} {...props}/>
|
80
|
+
return (<div ref={carouselRef} className="overflow-hidden">
|
81
|
+
<div ref={ref} className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)} {...props}/>
|
78
82
|
</div>);
|
79
|
-
}
|
80
|
-
|
83
|
+
});
|
84
|
+
CarouselContent.displayName = "CarouselContent";
|
85
|
+
const CarouselItem = React.forwardRef(({ className, ...props }, ref) => {
|
81
86
|
const { orientation } = useCarousel();
|
82
|
-
return (<div role="group" aria-roledescription="slide"
|
83
|
-
}
|
84
|
-
|
87
|
+
return (<div ref={ref} role="group" aria-roledescription="slide" className={cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)} {...props}/>);
|
88
|
+
});
|
89
|
+
CarouselItem.displayName = "CarouselItem";
|
90
|
+
const CarouselPrevious = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
85
91
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
86
|
-
return (<Button
|
87
|
-
? "top-1/2 -
|
92
|
+
return (<Button ref={ref} variant={variant} size={size} className={cn("absolute h-8 w-8 rounded-full", orientation === "horizontal"
|
93
|
+
? "-left-12 top-1/2 -translate-y-1/2"
|
88
94
|
: "-top-12 left-1/2 -translate-x-1/2 rotate-90", className)} disabled={!canScrollPrev} onClick={scrollPrev} {...props}>
|
89
|
-
<ArrowLeft />
|
95
|
+
<ArrowLeft className="h-4 w-4"/>
|
90
96
|
<span className="sr-only">Previous slide</span>
|
91
97
|
</Button>);
|
92
|
-
}
|
93
|
-
|
98
|
+
});
|
99
|
+
CarouselPrevious.displayName = "CarouselPrevious";
|
100
|
+
const CarouselNext = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
94
101
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
95
|
-
return (<Button
|
96
|
-
? "top-1/2 -
|
102
|
+
return (<Button ref={ref} variant={variant} size={size} className={cn("absolute h-8 w-8 rounded-full", orientation === "horizontal"
|
103
|
+
? "-right-12 top-1/2 -translate-y-1/2"
|
97
104
|
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className)} disabled={!canScrollNext} onClick={scrollNext} {...props}>
|
98
|
-
<ArrowRight />
|
105
|
+
<ArrowRight className="h-4 w-4"/>
|
99
106
|
<span className="sr-only">Next slide</span>
|
100
107
|
</Button>);
|
101
|
-
}
|
108
|
+
});
|
109
|
+
CarouselNext.displayName = "CarouselNext";
|
102
110
|
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
package/ui/chart.d.ts
CHANGED
@@ -16,25 +16,47 @@ export type ChartConfig = {
|
|
16
16
|
theme: Record<keyof typeof THEMES, string>;
|
17
17
|
});
|
18
18
|
};
|
19
|
-
declare
|
19
|
+
declare const ChartContainer: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
20
20
|
config: ChartConfig;
|
21
21
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
22
|
-
}
|
22
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
23
|
declare const ChartStyle: ({ id, config }: {
|
24
24
|
id: string;
|
25
25
|
config: ChartConfig;
|
26
26
|
}) => React.JSX.Element;
|
27
27
|
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
28
|
-
declare
|
28
|
+
declare const ChartTooltipContent: React.ForwardRefExoticComponent<Omit<RechartsPrimitive.DefaultTooltipContentProps<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType> & {
|
29
|
+
accessibilityLayer?: boolean;
|
30
|
+
active?: boolean | undefined;
|
31
|
+
includeHidden?: boolean | undefined;
|
32
|
+
allowEscapeViewBox?: import("recharts/types/util/types").AllowInDimension;
|
33
|
+
animationDuration?: import("recharts/types/util/types").AnimationDuration;
|
34
|
+
animationEasing?: import("recharts/types/util/types").AnimationTiming;
|
35
|
+
content?: import("recharts/types/component/Tooltip").ContentType<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType>;
|
36
|
+
coordinate?: Partial<import("recharts/types/util/types").Coordinate>;
|
37
|
+
cursor?: boolean | React.ReactElement | React.SVGProps<SVGElement>;
|
38
|
+
filterNull?: boolean;
|
39
|
+
defaultIndex?: number;
|
40
|
+
isAnimationActive?: boolean;
|
41
|
+
offset?: number;
|
42
|
+
payloadUniqBy?: import("recharts/types/util/payload/getUniqPayload").UniqueOption<import("recharts/types/component/DefaultTooltipContent").Payload<import("recharts/types/component/DefaultTooltipContent").ValueType, import("recharts/types/component/DefaultTooltipContent").NameType>>;
|
43
|
+
position?: Partial<import("recharts/types/util/types").Coordinate>;
|
44
|
+
reverseDirection?: import("recharts/types/util/types").AllowInDimension;
|
45
|
+
shared?: boolean;
|
46
|
+
trigger?: "hover" | "click";
|
47
|
+
useTranslate3d?: boolean;
|
48
|
+
viewBox?: import("recharts/types/util/types").CartesianViewBox;
|
49
|
+
wrapperStyle?: React.CSSProperties;
|
50
|
+
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
29
51
|
hideLabel?: boolean;
|
30
52
|
hideIndicator?: boolean;
|
31
53
|
indicator?: "line" | "dot" | "dashed";
|
32
54
|
nameKey?: string;
|
33
55
|
labelKey?: string;
|
34
|
-
}
|
56
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
35
57
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
36
|
-
declare
|
58
|
+
declare const ChartLegendContent: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & Pick<RechartsPrimitive.LegendProps, "verticalAlign" | "payload"> & {
|
37
59
|
hideIcon?: boolean;
|
38
60
|
nameKey?: string;
|
39
|
-
}
|
61
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
40
62
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
package/ui/chart.jsx
CHANGED
@@ -12,18 +12,19 @@ function useChart() {
|
|
12
12
|
}
|
13
13
|
return context;
|
14
14
|
}
|
15
|
-
|
15
|
+
const ChartContainer = React.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
16
16
|
const uniqueId = React.useId();
|
17
17
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
18
18
|
return (<ChartContext.Provider value={{ config }}>
|
19
|
-
<div data-
|
19
|
+
<div data-chart={chartId} ref={ref} className={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-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", className)} {...props}>
|
20
20
|
<ChartStyle id={chartId} config={config}/>
|
21
21
|
<RechartsPrimitive.ResponsiveContainer>
|
22
22
|
{children}
|
23
23
|
</RechartsPrimitive.ResponsiveContainer>
|
24
24
|
</div>
|
25
25
|
</ChartContext.Provider>);
|
26
|
-
}
|
26
|
+
});
|
27
|
+
ChartContainer.displayName = "Chart";
|
27
28
|
const ChartStyle = ({ id, config }) => {
|
28
29
|
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
29
30
|
if (!colorConfig.length) {
|
@@ -46,7 +47,7 @@ ${colorConfig
|
|
46
47
|
}}/>);
|
47
48
|
};
|
48
49
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
49
|
-
|
50
|
+
const ChartTooltipContent = React.forwardRef(({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }, ref) => {
|
50
51
|
const { config } = useChart();
|
51
52
|
const tooltipLabel = React.useMemo(() => {
|
52
53
|
if (hideLabel || !payload?.length) {
|
@@ -60,8 +61,8 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
60
61
|
: itemConfig?.label;
|
61
62
|
if (labelFormatter) {
|
62
63
|
return (<div className={cn("font-medium", labelClassName)}>
|
63
|
-
|
64
|
-
|
64
|
+
{labelFormatter(value, payload)}
|
65
|
+
</div>);
|
65
66
|
}
|
66
67
|
if (!value) {
|
67
68
|
return null;
|
@@ -80,16 +81,16 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
80
81
|
return null;
|
81
82
|
}
|
82
83
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
83
|
-
return (<div className={cn("
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
return (<div ref={ref} className={cn("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", className)}>
|
85
|
+
{!nestLabel ? tooltipLabel : null}
|
86
|
+
<div className="grid gap-1.5">
|
87
|
+
{payload.map((item, index) => {
|
87
88
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
88
89
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
89
90
|
const indicatorColor = color || item.payload.fill || item.color;
|
90
|
-
return (<div key={item.dataKey} className={cn("
|
91
|
-
|
92
|
-
|
91
|
+
return (<div key={item.dataKey} className={cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center")}>
|
92
|
+
{formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (<>
|
93
|
+
{itemConfig?.icon ? (<itemConfig.icon />) : (!hideIndicator && (<div className={cn("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
93
94
|
"h-2.5 w-2.5": indicator === "dot",
|
94
95
|
"w-1": indicator === "line",
|
95
96
|
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
@@ -98,42 +99,44 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
98
99
|
"--color-bg": indicatorColor,
|
99
100
|
"--color-border": indicatorColor,
|
100
101
|
}}/>))}
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
<div className={cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center")}>
|
103
|
+
<div className="grid gap-1.5">
|
104
|
+
{nestLabel ? tooltipLabel : null}
|
105
|
+
<span className="text-muted-foreground">
|
106
|
+
{itemConfig?.label || item.name}
|
107
|
+
</span>
|
108
|
+
</div>
|
109
|
+
{item.value && (<span className="font-mono font-medium tabular-nums text-foreground">
|
110
|
+
{item.value.toLocaleString()}
|
111
|
+
</span>)}
|
107
112
|
</div>
|
108
|
-
|
109
|
-
|
110
|
-
</span>)}
|
111
|
-
</div>
|
112
|
-
</>)}
|
113
|
-
</div>);
|
113
|
+
</>)}
|
114
|
+
</div>);
|
114
115
|
})}
|
115
|
-
|
116
|
-
|
117
|
-
}
|
116
|
+
</div>
|
117
|
+
</div>);
|
118
|
+
});
|
119
|
+
ChartTooltipContent.displayName = "ChartTooltip";
|
118
120
|
const ChartLegend = RechartsPrimitive.Legend;
|
119
|
-
|
121
|
+
const ChartLegendContent = React.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
120
122
|
const { config } = useChart();
|
121
123
|
if (!payload?.length) {
|
122
124
|
return null;
|
123
125
|
}
|
124
|
-
return (<div className={cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)}>
|
125
|
-
|
126
|
+
return (<div ref={ref} className={cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)}>
|
127
|
+
{payload.map((item) => {
|
126
128
|
const key = `${nameKey || item.dataKey || "value"}`;
|
127
129
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
128
|
-
return (<div key={item.value} className={cn("
|
129
|
-
|
130
|
+
return (<div key={item.value} className={cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground")}>
|
131
|
+
{itemConfig?.icon && !hideIcon ? (<itemConfig.icon />) : (<div className="h-2 w-2 shrink-0 rounded-[2px]" style={{
|
130
132
|
backgroundColor: item.color,
|
131
133
|
}}/>)}
|
132
|
-
|
133
|
-
|
134
|
+
{itemConfig?.label}
|
135
|
+
</div>);
|
134
136
|
})}
|
135
|
-
|
136
|
-
}
|
137
|
+
</div>);
|
138
|
+
});
|
139
|
+
ChartLegendContent.displayName = "ChartLegend";
|
137
140
|
// Helper to extract item config from a payload.
|
138
141
|
function getPayloadConfigFromPayload(config, payload, key) {
|
139
142
|
if (typeof payload !== "object" || payload === null) {
|
package/ui/checkbox.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
3
|
-
declare
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
4
4
|
export { Checkbox };
|
package/ui/checkbox.jsx
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
4
|
-
import {
|
4
|
+
import { Check } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
6
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (<CheckboxPrimitive.Root ref={ref} className={cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className)} {...props}>
|
7
|
+
<CheckboxPrimitive.Indicator className={cn("flex items-center justify-center text-current")}>
|
8
|
+
<Check className="h-4 w-4"/>
|
9
|
+
</CheckboxPrimitive.Indicator>
|
10
|
+
</CheckboxPrimitive.Root>));
|
11
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
13
12
|
export { Checkbox };
|
package/ui/collapsible.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
2
|
-
declare
|
3
|
-
declare
|
4
|
-
declare
|
2
|
+
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
5
5
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
package/ui/collapsible.jsx
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
function CollapsibleTrigger({ ...props }) {
|
7
|
-
return (<CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props}/>);
|
8
|
-
}
|
9
|
-
function CollapsibleContent({ ...props }) {
|
10
|
-
return (<CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props}/>);
|
11
|
-
}
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
12
6
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|