shadcn-packaged 2025.4.14 → 2025.6.16-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/README.md +30 -31
- package/index.css +112 -138
- package/package.json +38 -38
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +20 -15
- package/ui/alert-dialog.d.ts +11 -17
- package/ui/alert-dialog.jsx +36 -23
- package/ui/alert.d.ts +5 -4
- package/ui/alert.jsx +12 -9
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +3 -1
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +9 -6
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +9 -7
- package/ui/breadcrumb.d.ts +8 -16
- package/ui/breadcrumb.jsx +26 -21
- package/ui/button.d.ts +2 -3
- package/ui/button.jsx +13 -14
- package/ui/calendar.d.ts +7 -7
- package/ui/calendar.jsx +70 -30
- package/ui/card.d.ts +8 -7
- package/ui/card.jsx +22 -13
- package/ui/carousel.d.ts +6 -5
- package/ui/carousel.jsx +26 -34
- package/ui/chart.d.ts +6 -28
- package/ui/chart.jsx +37 -40
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +8 -7
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +9 -3
- package/ui/command.d.ts +16 -78
- package/ui/command.jsx +37 -27
- package/ui/context-menu.d.ts +19 -21
- package/ui/context-menu.jsx +65 -47
- package/ui/dialog.d.ts +13 -17
- package/ui/dialog.jsx +41 -27
- package/ui/drawer.d.ts +10 -19
- package/ui/drawer.jsx +36 -23
- package/ui/dropdown-menu.d.ts +20 -22
- package/ui/dropdown-menu.jsx +66 -50
- package/ui/form.d.ts +6 -5
- package/ui/form.jsx +19 -23
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +11 -4
- package/ui/input-otp.d.ts +7 -30
- package/ui/input-otp.jsx +17 -15
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +3 -4
- package/ui/label.d.ts +1 -2
- package/ui/label.jsx +3 -4
- package/ui/menubar.d.ts +17 -19
- package/ui/menubar.jsx +58 -49
- package/ui/navigation-menu.d.ts +11 -9
- package/ui/navigation-menu.jsx +37 -29
- package/ui/pagination.d.ts +10 -25
- package/ui/pagination.jsx +35 -28
- package/ui/popover.d.ts +5 -4
- package/ui/popover.jsx +15 -7
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +5 -4
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +9 -11
- package/ui/resizable.d.ts +5 -20
- package/ui/resizable.jsx +15 -8
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +16 -14
- package/ui/select.d.ts +13 -11
- package/ui/select.jsx +58 -47
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +3 -2
- package/ui/sheet.d.ts +11 -23
- package/ui/sheet.jsx +45 -41
- package/ui/sidebar.d.ts +38 -34
- package/ui/sidebar.jsx +109 -122
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +13 -7
- package/ui/sonner.d.ts +1 -2
- package/ui/sonner.jsx +4 -7
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +6 -5
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +27 -18
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +12 -7
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +3 -4
- package/ui/toggle-group.d.ts +3 -8
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +1 -4
- package/ui/toggle.jsx +8 -7
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +19 -5
- package/tailwind.config.js +0 -89
- /package/hooks/{use-mobile.jsx → use-mobile.js} +0 -0
package/ui/carousel.jsx
CHANGED
@@ -12,7 +12,7 @@ function useCarousel() {
|
|
12
12
|
}
|
13
13
|
return context;
|
14
14
|
}
|
15
|
-
|
15
|
+
function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
|
16
16
|
const [carouselRef, api] = useEmblaCarousel({
|
17
17
|
...opts,
|
18
18
|
axis: orientation === "horizontal" ? "x" : "y",
|
@@ -20,9 +20,8 @@ const Carousel = React.forwardRef(({ orientation = "horizontal", opts, setApi, p
|
|
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
|
-
}
|
26
25
|
setCanScrollPrev(api.canScrollPrev());
|
27
26
|
setCanScrollNext(api.canScrollNext());
|
28
27
|
}, []);
|
@@ -43,15 +42,13 @@ const Carousel = React.forwardRef(({ orientation = "horizontal", opts, setApi, p
|
|
43
42
|
}
|
44
43
|
}, [scrollPrev, scrollNext]);
|
45
44
|
React.useEffect(() => {
|
46
|
-
if (!api || !setApi)
|
45
|
+
if (!api || !setApi)
|
47
46
|
return;
|
48
|
-
}
|
49
47
|
setApi(api);
|
50
48
|
}, [api, setApi]);
|
51
49
|
React.useEffect(() => {
|
52
|
-
if (!api)
|
50
|
+
if (!api)
|
53
51
|
return;
|
54
|
-
}
|
55
52
|
onSelect(api);
|
56
53
|
api.on("reInit", onSelect);
|
57
54
|
api.on("select", onSelect);
|
@@ -69,42 +66,37 @@ const Carousel = React.forwardRef(({ orientation = "horizontal", opts, setApi, p
|
|
69
66
|
canScrollPrev,
|
70
67
|
canScrollNext,
|
71
68
|
}}>
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
}
|
77
|
-
|
78
|
-
const CarouselContent = React.forwardRef(({ className, ...props }, ref) => {
|
69
|
+
<div onKeyDownCapture={handleKeyDown} className={cn("relative", className)} role="region" aria-roledescription="carousel" data-slot="carousel" {...props}>
|
70
|
+
{children}
|
71
|
+
</div>
|
72
|
+
</CarouselContext.Provider>);
|
73
|
+
}
|
74
|
+
function CarouselContent({ className, ...props }) {
|
79
75
|
const { carouselRef, orientation } = useCarousel();
|
80
|
-
return (<div ref={carouselRef} className="overflow-hidden">
|
81
|
-
<div
|
76
|
+
return (<div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
|
77
|
+
<div className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)} {...props}/>
|
82
78
|
</div>);
|
83
|
-
}
|
84
|
-
|
85
|
-
const CarouselItem = React.forwardRef(({ className, ...props }, ref) => {
|
79
|
+
}
|
80
|
+
function CarouselItem({ className, ...props }) {
|
86
81
|
const { orientation } = useCarousel();
|
87
|
-
return (<div
|
88
|
-
}
|
89
|
-
|
90
|
-
const CarouselPrevious = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
82
|
+
return (<div role="group" aria-roledescription="slide" data-slot="carousel-item" className={cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)} {...props}/>);
|
83
|
+
}
|
84
|
+
function CarouselPrevious({ className, variant = "outline", size = "icon", ...props }) {
|
91
85
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
92
|
-
return (<Button
|
93
|
-
? "
|
86
|
+
return (<Button data-slot="carousel-previous" variant={variant} size={size} className={cn("absolute size-8 rounded-full", orientation === "horizontal"
|
87
|
+
? "top-1/2 -left-12 -translate-y-1/2"
|
94
88
|
: "-top-12 left-1/2 -translate-x-1/2 rotate-90", className)} disabled={!canScrollPrev} onClick={scrollPrev} {...props}>
|
95
|
-
<ArrowLeft
|
89
|
+
<ArrowLeft />
|
96
90
|
<span className="sr-only">Previous slide</span>
|
97
91
|
</Button>);
|
98
|
-
}
|
99
|
-
|
100
|
-
const CarouselNext = React.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
92
|
+
}
|
93
|
+
function CarouselNext({ className, variant = "outline", size = "icon", ...props }) {
|
101
94
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
102
|
-
return (<Button
|
103
|
-
? "
|
95
|
+
return (<Button data-slot="carousel-next" variant={variant} size={size} className={cn("absolute size-8 rounded-full", orientation === "horizontal"
|
96
|
+
? "top-1/2 -right-12 -translate-y-1/2"
|
104
97
|
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className)} disabled={!canScrollNext} onClick={scrollNext} {...props}>
|
105
|
-
<ArrowRight
|
98
|
+
<ArrowRight />
|
106
99
|
<span className="sr-only">Next slide</span>
|
107
100
|
</Button>);
|
108
|
-
}
|
109
|
-
CarouselNext.displayName = "CarouselNext";
|
101
|
+
}
|
110
102
|
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
package/ui/chart.d.ts
CHANGED
@@ -16,47 +16,25 @@ export type ChartConfig = {
|
|
16
16
|
theme: Record<keyof typeof THEMES, string>;
|
17
17
|
});
|
18
18
|
};
|
19
|
-
declare
|
19
|
+
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<"div"> & {
|
20
20
|
config: ChartConfig;
|
21
21
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
22
|
-
}
|
22
|
+
}): React.JSX.Element;
|
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
|
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> & {
|
28
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
51
29
|
hideLabel?: boolean;
|
52
30
|
hideIndicator?: boolean;
|
53
31
|
indicator?: "line" | "dot" | "dashed";
|
54
32
|
nameKey?: string;
|
55
33
|
labelKey?: string;
|
56
|
-
}
|
34
|
+
}): React.JSX.Element;
|
57
35
|
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
58
|
-
declare
|
36
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
59
37
|
hideIcon?: boolean;
|
60
38
|
nameKey?: string;
|
61
|
-
}
|
39
|
+
}): React.JSX.Element;
|
62
40
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
package/ui/chart.jsx
CHANGED
@@ -12,19 +12,18 @@ function useChart() {
|
|
12
12
|
}
|
13
13
|
return context;
|
14
14
|
}
|
15
|
-
|
15
|
+
function ChartContainer({ id, className, children, config, ...props }) {
|
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-chart={chartId}
|
19
|
+
<div data-slot="chart" data-chart={chartId} 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)} {...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
|
-
}
|
27
|
-
ChartContainer.displayName = "Chart";
|
26
|
+
}
|
28
27
|
const ChartStyle = ({ id, config }) => {
|
29
28
|
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
30
29
|
if (!colorConfig.length) {
|
@@ -47,7 +46,7 @@ ${colorConfig
|
|
47
46
|
}}/>);
|
48
47
|
};
|
49
48
|
const ChartTooltip = RechartsPrimitive.Tooltip;
|
50
|
-
|
49
|
+
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }) {
|
51
50
|
const { config } = useChart();
|
52
51
|
const tooltipLabel = React.useMemo(() => {
|
53
52
|
if (hideLabel || !payload?.length) {
|
@@ -61,8 +60,8 @@ const ChartTooltipContent = React.forwardRef(({ active, payload, className, indi
|
|
61
60
|
: itemConfig?.label;
|
62
61
|
if (labelFormatter) {
|
63
62
|
return (<div className={cn("font-medium", labelClassName)}>
|
64
|
-
|
65
|
-
|
63
|
+
{labelFormatter(value, payload)}
|
64
|
+
</div>);
|
66
65
|
}
|
67
66
|
if (!value) {
|
68
67
|
return null;
|
@@ -81,16 +80,16 @@ const ChartTooltipContent = React.forwardRef(({ active, payload, className, indi
|
|
81
80
|
return null;
|
82
81
|
}
|
83
82
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
84
|
-
return (<div
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
return (<div 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)}>
|
84
|
+
{!nestLabel ? tooltipLabel : null}
|
85
|
+
<div className="grid gap-1.5">
|
86
|
+
{payload.map((item, index) => {
|
88
87
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
89
88
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
90
89
|
const indicatorColor = color || item.payload.fill || item.color;
|
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
|
92
|
-
|
93
|
-
|
90
|
+
return (<div key={item.dataKey} 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")}>
|
91
|
+
{formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (<>
|
92
|
+
{itemConfig?.icon ? (<itemConfig.icon />) : (!hideIndicator && (<div className={cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
94
93
|
"h-2.5 w-2.5": indicator === "dot",
|
95
94
|
"w-1": indicator === "line",
|
96
95
|
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
@@ -99,44 +98,42 @@ const ChartTooltipContent = React.forwardRef(({ active, payload, className, indi
|
|
99
98
|
"--color-bg": indicatorColor,
|
100
99
|
"--color-border": indicatorColor,
|
101
100
|
}}/>))}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
</div>
|
109
|
-
{item.value && (<span className="font-mono font-medium tabular-nums text-foreground">
|
110
|
-
{item.value.toLocaleString()}
|
111
|
-
</span>)}
|
101
|
+
<div className={cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center")}>
|
102
|
+
<div className="grid gap-1.5">
|
103
|
+
{nestLabel ? tooltipLabel : null}
|
104
|
+
<span className="text-muted-foreground">
|
105
|
+
{itemConfig?.label || item.name}
|
106
|
+
</span>
|
112
107
|
</div>
|
113
|
-
|
114
|
-
|
108
|
+
{item.value && (<span className="text-foreground font-mono font-medium tabular-nums">
|
109
|
+
{item.value.toLocaleString()}
|
110
|
+
</span>)}
|
111
|
+
</div>
|
112
|
+
</>)}
|
113
|
+
</div>);
|
115
114
|
})}
|
116
|
-
|
117
|
-
|
118
|
-
}
|
119
|
-
ChartTooltipContent.displayName = "ChartTooltip";
|
115
|
+
</div>
|
116
|
+
</div>);
|
117
|
+
}
|
120
118
|
const ChartLegend = RechartsPrimitive.Legend;
|
121
|
-
|
119
|
+
function ChartLegendContent({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey, }) {
|
122
120
|
const { config } = useChart();
|
123
121
|
if (!payload?.length) {
|
124
122
|
return null;
|
125
123
|
}
|
126
|
-
return (<div
|
127
|
-
|
124
|
+
return (<div className={cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)}>
|
125
|
+
{payload.map((item) => {
|
128
126
|
const key = `${nameKey || item.dataKey || "value"}`;
|
129
127
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
130
|
-
return (<div key={item.value} className={cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3
|
131
|
-
|
128
|
+
return (<div key={item.value} className={cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3")}>
|
129
|
+
{itemConfig?.icon && !hideIcon ? (<itemConfig.icon />) : (<div className="h-2 w-2 shrink-0 rounded-[2px]" style={{
|
132
130
|
backgroundColor: item.color,
|
133
131
|
}}/>)}
|
134
|
-
|
135
|
-
|
132
|
+
{itemConfig?.label}
|
133
|
+
</div>);
|
136
134
|
})}
|
137
|
-
|
138
|
-
}
|
139
|
-
ChartLegendContent.displayName = "ChartLegend";
|
135
|
+
</div>);
|
136
|
+
}
|
140
137
|
// Helper to extract item config from a payload.
|
141
138
|
function getPayloadConfigFromPayload(config, payload, key) {
|
142
139
|
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 function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
|
4
4
|
export { Checkbox };
|
package/ui/checkbox.jsx
CHANGED
@@ -1,12 +1,13 @@
|
|
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 { CheckIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
<CheckboxPrimitive.
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
function Checkbox({ className, ...props }) {
|
7
|
+
return (<CheckboxPrimitive.Root data-slot="checkbox" 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)} {...props}>
|
8
|
+
<CheckboxPrimitive.Indicator data-slot="checkbox-indicator" className="flex items-center justify-center text-current transition-none">
|
9
|
+
<CheckIcon className="size-3.5"/>
|
10
|
+
</CheckboxPrimitive.Indicator>
|
11
|
+
</CheckboxPrimitive.Root>);
|
12
|
+
}
|
12
13
|
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 function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react").JSX.Element;
|
3
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react").JSX.Element;
|
4
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react").JSX.Element;
|
5
5
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
package/ui/collapsible.jsx
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
function Collapsible({ ...props }) {
|
4
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props}/>;
|
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
|
+
}
|
6
12
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
package/ui/command.d.ts
CHANGED
@@ -1,80 +1,18 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
vimBindings?: boolean;
|
19
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
20
|
-
declare const CommandDialog: ({ children, ...props }: DialogProps) => React.JSX.Element;
|
21
|
-
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
22
|
-
ref?: React.Ref<HTMLInputElement>;
|
23
|
-
} & {
|
24
|
-
asChild?: boolean;
|
25
|
-
}, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "value" | "onChange"> & {
|
26
|
-
value?: string;
|
27
|
-
onValueChange?: (search: string) => void;
|
28
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
29
|
-
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
30
|
-
children?: React.ReactNode;
|
31
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
32
|
-
ref?: React.Ref<HTMLDivElement>;
|
33
|
-
} & {
|
34
|
-
asChild?: boolean;
|
35
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
36
|
-
label?: string;
|
37
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
38
|
-
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
39
|
-
children?: React.ReactNode;
|
40
|
-
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
41
|
-
ref?: React.Ref<HTMLDivElement>;
|
42
|
-
} & {
|
43
|
-
asChild?: boolean;
|
44
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
45
|
-
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
46
|
-
children?: React.ReactNode;
|
47
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
48
|
-
ref?: React.Ref<HTMLDivElement>;
|
49
|
-
} & {
|
50
|
-
asChild?: boolean;
|
51
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
52
|
-
heading?: React.ReactNode;
|
53
|
-
value?: string;
|
54
|
-
forceMount?: boolean;
|
55
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
56
|
-
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
57
|
-
ref?: React.Ref<HTMLDivElement>;
|
58
|
-
} & {
|
59
|
-
asChild?: boolean;
|
60
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
61
|
-
alwaysRender?: boolean;
|
62
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
63
|
-
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
64
|
-
children?: React.ReactNode;
|
65
|
-
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
66
|
-
ref?: React.Ref<HTMLDivElement>;
|
67
|
-
} & {
|
68
|
-
asChild?: boolean;
|
69
|
-
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "disabled" | "onSelect"> & {
|
70
|
-
disabled?: boolean;
|
71
|
-
onSelect?: (value: string) => void;
|
72
|
-
value?: string;
|
73
|
-
keywords?: string[];
|
74
|
-
forceMount?: boolean;
|
75
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
76
|
-
declare const CommandShortcut: {
|
77
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
78
|
-
displayName: string;
|
79
|
-
};
|
2
|
+
import { Command as CommandPrimitive } from "cmdk";
|
3
|
+
import { Dialog } from "../ui/dialog";
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
6
|
+
title?: string;
|
7
|
+
description?: string;
|
8
|
+
className?: string;
|
9
|
+
showCloseButton?: boolean;
|
10
|
+
}): React.JSX.Element;
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
80
18
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
package/ui/command.jsx
CHANGED
@@ -1,37 +1,47 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import { Command as CommandPrimitive } from "cmdk";
|
4
|
-
import {
|
4
|
+
import { SearchIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
import { Dialog, DialogContent } from "../ui/dialog";
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "../ui/dialog";
|
7
|
+
function Command({ className, ...props }) {
|
8
|
+
return (<CommandPrimitive data-slot="command" className={cn("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md", className)} {...props}/>);
|
9
|
+
}
|
10
|
+
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
10
11
|
return (<Dialog {...props}>
|
11
|
-
<
|
12
|
-
<
|
12
|
+
<DialogHeader className="sr-only">
|
13
|
+
<DialogTitle>{title}</DialogTitle>
|
14
|
+
<DialogDescription>{description}</DialogDescription>
|
15
|
+
</DialogHeader>
|
16
|
+
<DialogContent className={cn("overflow-hidden p-0", className)} showCloseButton={showCloseButton}>
|
17
|
+
<Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
13
18
|
{children}
|
14
19
|
</Command>
|
15
20
|
</DialogContent>
|
16
21
|
</Dialog>);
|
17
|
-
}
|
18
|
-
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
CommandList
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return (<
|
35
|
-
}
|
36
|
-
|
22
|
+
}
|
23
|
+
function CommandInput({ className, ...props }) {
|
24
|
+
return (<div data-slot="command-input-wrapper" className="flex h-9 items-center gap-2 border-b px-3">
|
25
|
+
<SearchIcon className="size-4 shrink-0 opacity-50"/>
|
26
|
+
<CommandPrimitive.Input data-slot="command-input" className={cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}/>
|
27
|
+
</div>);
|
28
|
+
}
|
29
|
+
function CommandList({ className, ...props }) {
|
30
|
+
return (<CommandPrimitive.List data-slot="command-list" className={cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className)} {...props}/>);
|
31
|
+
}
|
32
|
+
function CommandEmpty({ ...props }) {
|
33
|
+
return (<CommandPrimitive.Empty data-slot="command-empty" className="py-6 text-center text-sm" {...props}/>);
|
34
|
+
}
|
35
|
+
function CommandGroup({ className, ...props }) {
|
36
|
+
return (<CommandPrimitive.Group data-slot="command-group" className={cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className)} {...props}/>);
|
37
|
+
}
|
38
|
+
function CommandSeparator({ className, ...props }) {
|
39
|
+
return (<CommandPrimitive.Separator data-slot="command-separator" className={cn("bg-border -mx-1 h-px", className)} {...props}/>);
|
40
|
+
}
|
41
|
+
function CommandItem({ className, ...props }) {
|
42
|
+
return (<CommandPrimitive.Item data-slot="command-item" className={cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
|
43
|
+
}
|
44
|
+
function CommandShortcut({ className, ...props }) {
|
45
|
+
return (<span data-slot="command-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
|
46
|
+
}
|
37
47
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
package/ui/context-menu.d.ts
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
declare
|
9
|
-
declare
|
3
|
+
declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): React.JSX.Element;
|
5
|
+
declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): React.JSX.Element;
|
6
|
+
declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): React.JSX.Element;
|
7
|
+
declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): React.JSX.Element;
|
8
|
+
declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): React.JSX.Element;
|
9
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
10
10
|
inset?: boolean;
|
11
|
-
}
|
12
|
-
declare
|
13
|
-
declare
|
14
|
-
declare
|
11
|
+
}): React.JSX.Element;
|
12
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): React.JSX.Element;
|
13
|
+
declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): React.JSX.Element;
|
14
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
15
15
|
inset?: boolean;
|
16
|
-
|
17
|
-
|
18
|
-
declare
|
19
|
-
declare
|
16
|
+
variant?: "default" | "destructive";
|
17
|
+
}): React.JSX.Element;
|
18
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
19
|
+
declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): React.JSX.Element;
|
20
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
20
21
|
inset?: boolean;
|
21
|
-
}
|
22
|
-
declare
|
23
|
-
declare
|
24
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
25
|
-
displayName: string;
|
26
|
-
};
|
22
|
+
}): React.JSX.Element;
|
23
|
+
declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): React.JSX.Element;
|
24
|
+
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
27
25
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|