shadcn-packaged 2025.4.21 → 2025.6.16-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/README.md +31 -30
- package/index.css +112 -138
- package/package.json +37 -37
- 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/slider.jsx
CHANGED
@@ -2,11 +2,17 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
6
|
+
const _values = React.useMemo(() => Array.isArray(value)
|
7
|
+
? value
|
8
|
+
: Array.isArray(defaultValue)
|
9
|
+
? defaultValue
|
10
|
+
: [min, max], [value, defaultValue, min, max]);
|
11
|
+
return (<SliderPrimitive.Root data-slot="slider" defaultValue={defaultValue} value={value} min={min} max={max} className={cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className)} {...props}>
|
12
|
+
<SliderPrimitive.Track data-slot="slider-track" className={cn("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5")}>
|
13
|
+
<SliderPrimitive.Range data-slot="slider-range" className={cn("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")}/>
|
14
|
+
</SliderPrimitive.Track>
|
15
|
+
{Array.from({ length: _values.length }, (_, index) => (<SliderPrimitive.Thumb data-slot="slider-thumb" key={index} className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"/>))}
|
16
|
+
</SliderPrimitive.Root>);
|
17
|
+
}
|
12
18
|
export { Slider };
|
package/ui/sonner.d.ts
CHANGED
package/ui/sonner.jsx
CHANGED
@@ -3,13 +3,10 @@ import { useTheme } from "next-themes";
|
|
3
3
|
import { Toaster as Sonner } from "sonner";
|
4
4
|
const Toaster = ({ ...props }) => {
|
5
5
|
const { theme = "system" } = useTheme();
|
6
|
-
return (<Sonner theme={theme} className="toaster group"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
11
|
-
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
12
|
-
},
|
6
|
+
return (<Sonner theme={theme} className="toaster group" style={{
|
7
|
+
"--normal-bg": "var(--popover)",
|
8
|
+
"--normal-text": "var(--popover-foreground)",
|
9
|
+
"--normal-border": "var(--border)",
|
13
10
|
}} {...props}/>);
|
14
11
|
};
|
15
12
|
export { Toaster };
|
package/ui/switch.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import * as
|
3
|
-
declare
|
2
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
3
|
+
declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): React.JSX.Element;
|
4
4
|
export { Switch };
|
package/ui/switch.jsx
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
|
-
import * as
|
3
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
5
|
+
function Switch({ className, ...props }) {
|
6
|
+
return (<SwitchPrimitive.Root data-slot="switch" className={cn("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}>
|
7
|
+
<SwitchPrimitive.Thumb data-slot="switch-thumb" className={cn("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}/>
|
8
|
+
</SwitchPrimitive.Root>);
|
9
|
+
}
|
9
10
|
export { Switch };
|
package/ui/table.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
declare
|
9
|
-
declare
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
10
10
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
package/ui/table.jsx
CHANGED
@@ -1,21 +1,30 @@
|
|
1
|
+
"use client";
|
1
2
|
import * as React from "react";
|
2
3
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
TableHeader
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
function Table({ className, ...props }) {
|
5
|
+
return (<div data-slot="table-container" className="relative w-full overflow-x-auto">
|
6
|
+
<table data-slot="table" className={cn("w-full caption-bottom text-sm", className)} {...props}/>
|
7
|
+
</div>);
|
8
|
+
}
|
9
|
+
function TableHeader({ className, ...props }) {
|
10
|
+
return (<thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props}/>);
|
11
|
+
}
|
12
|
+
function TableBody({ className, ...props }) {
|
13
|
+
return (<tbody data-slot="table-body" className={cn("[&_tr:last-child]:border-0", className)} {...props}/>);
|
14
|
+
}
|
15
|
+
function TableFooter({ className, ...props }) {
|
16
|
+
return (<tfoot data-slot="table-footer" className={cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className)} {...props}/>);
|
17
|
+
}
|
18
|
+
function TableRow({ className, ...props }) {
|
19
|
+
return (<tr data-slot="table-row" className={cn("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", className)} {...props}/>);
|
20
|
+
}
|
21
|
+
function TableHead({ className, ...props }) {
|
22
|
+
return (<th data-slot="table-head" className={cn("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)} {...props}/>);
|
23
|
+
}
|
24
|
+
function TableCell({ className, ...props }) {
|
25
|
+
return (<td data-slot="table-cell" className={cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)} {...props}/>);
|
26
|
+
}
|
27
|
+
function TableCaption({ className, ...props }) {
|
28
|
+
return (<caption data-slot="table-caption" className={cn("text-muted-foreground mt-4 text-sm", className)} {...props}/>);
|
29
|
+
}
|
21
30
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
package/ui/tabs.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
3
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
5
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
6
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
7
7
|
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
package/ui/tabs.jsx
CHANGED
@@ -2,11 +2,16 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
function Tabs({ className, ...props }) {
|
6
|
+
return (<TabsPrimitive.Root data-slot="tabs" className={cn("flex flex-col gap-2", className)} {...props}/>);
|
7
|
+
}
|
8
|
+
function TabsList({ className, ...props }) {
|
9
|
+
return (<TabsPrimitive.List data-slot="tabs-list" className={cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className)} {...props}/>);
|
10
|
+
}
|
11
|
+
function TabsTrigger({ className, ...props }) {
|
12
|
+
return (<TabsPrimitive.Trigger data-slot="tabs-trigger" className={cn("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
|
13
|
+
}
|
14
|
+
function TabsContent({ className, ...props }) {
|
15
|
+
return (<TabsPrimitive.Content data-slot="tabs-content" className={cn("flex-1 outline-none", className)} {...props}/>);
|
16
|
+
}
|
12
17
|
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
package/ui/textarea.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
2
|
+
declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
3
3
|
export { Textarea };
|
package/ui/textarea.jsx
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
return (<textarea className={cn("flex min-h-
|
5
|
-
}
|
6
|
-
Textarea.displayName = "Textarea";
|
3
|
+
function Textarea({ className, ...props }) {
|
4
|
+
return (<textarea data-slot="textarea" className={cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className)} {...props}/>);
|
5
|
+
}
|
7
6
|
export { Textarea };
|
package/ui/toggle-group.d.ts
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
3
3
|
import { type VariantProps } from "class-variance-authority";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string>) & React.RefAttributes<HTMLDivElement>>;
|
8
|
-
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: {
|
9
|
-
variant?: "default" | "outline";
|
10
|
-
size?: "default" | "sm" | "lg";
|
11
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>>;
|
4
|
+
import { toggleVariants } from "../ui/toggle";
|
5
|
+
declare function ToggleGroup({ className, variant, size, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
6
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
12
7
|
export { ToggleGroup, ToggleGroupItem };
|
package/ui/toggle-group.jsx
CHANGED
@@ -7,20 +7,20 @@ const ToggleGroupContext = React.createContext({
|
|
7
7
|
size: "default",
|
8
8
|
variant: "default",
|
9
9
|
});
|
10
|
-
|
11
|
-
<
|
12
|
-
{
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
function ToggleGroup({ className, variant, size, children, ...props }) {
|
11
|
+
return (<ToggleGroupPrimitive.Root data-slot="toggle-group" data-variant={variant} data-size={size} className={cn("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs", className)} {...props}>
|
12
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
13
|
+
{children}
|
14
|
+
</ToggleGroupContext.Provider>
|
15
|
+
</ToggleGroupPrimitive.Root>);
|
16
|
+
}
|
17
|
+
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
17
18
|
const context = React.useContext(ToggleGroupContext);
|
18
|
-
return (<ToggleGroupPrimitive.Item
|
19
|
+
return (<ToggleGroupPrimitive.Item data-slot="toggle-group-item" data-variant={context.variant || variant} data-size={context.size || size} className={cn(toggleVariants({
|
19
20
|
variant: context.variant || variant,
|
20
21
|
size: context.size || size,
|
21
|
-
}), className)} {...props}>
|
22
|
+
}), "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l", className)} {...props}>
|
22
23
|
{children}
|
23
24
|
</ToggleGroupPrimitive.Item>);
|
24
|
-
}
|
25
|
-
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
25
|
+
}
|
26
26
|
export { ToggleGroup, ToggleGroupItem };
|
package/ui/toggle.d.ts
CHANGED
@@ -5,8 +5,5 @@ declare const toggleVariants: (props?: {
|
|
5
5
|
variant?: "default" | "outline";
|
6
6
|
size?: "default" | "sm" | "lg";
|
7
7
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
8
|
-
declare
|
9
|
-
variant?: "default" | "outline";
|
10
|
-
size?: "default" | "sm" | "lg";
|
11
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>>;
|
8
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
12
9
|
export { Toggle, toggleVariants };
|
package/ui/toggle.jsx
CHANGED
@@ -3,16 +3,16 @@ import * as React from "react";
|
|
3
3
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
4
4
|
import { cva } from "class-variance-authority";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium
|
6
|
+
const toggleVariants = cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap", {
|
7
7
|
variants: {
|
8
8
|
variant: {
|
9
9
|
default: "bg-transparent",
|
10
|
-
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
10
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
11
11
|
},
|
12
12
|
size: {
|
13
|
-
default: "h-
|
14
|
-
sm: "h-
|
15
|
-
lg: "h-
|
13
|
+
default: "h-9 px-2 min-w-9",
|
14
|
+
sm: "h-8 px-1.5 min-w-8",
|
15
|
+
lg: "h-10 px-2.5 min-w-10",
|
16
16
|
},
|
17
17
|
},
|
18
18
|
defaultVariants: {
|
@@ -20,6 +20,7 @@ const toggleVariants = cva("inline-flex items-center justify-center rounded-md t
|
|
20
20
|
size: "default",
|
21
21
|
},
|
22
22
|
});
|
23
|
-
|
24
|
-
|
23
|
+
function Toggle({ className, variant, size, ...props }) {
|
24
|
+
return (<TogglePrimitive.Root data-slot="toggle" className={cn(toggleVariants({ variant, size, className }))} {...props}/>);
|
25
|
+
}
|
25
26
|
export { Toggle, toggleVariants };
|
package/ui/tooltip.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
7
7
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/ui/tooltip.jsx
CHANGED
@@ -2,9 +2,23 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
6
|
+
return (<TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props}/>);
|
7
|
+
}
|
8
|
+
function Tooltip({ ...props }) {
|
9
|
+
return (<TooltipProvider>
|
10
|
+
<TooltipPrimitive.Root data-slot="tooltip" {...props}/>
|
11
|
+
</TooltipProvider>);
|
12
|
+
}
|
13
|
+
function TooltipTrigger({ ...props }) {
|
14
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props}/>;
|
15
|
+
}
|
16
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
17
|
+
return (<TooltipPrimitive.Portal>
|
18
|
+
<TooltipPrimitive.Content data-slot="tooltip-content" sideOffset={sideOffset} className={cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", className)} {...props}>
|
19
|
+
{children}
|
20
|
+
<TooltipPrimitive.Arrow className="bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"/>
|
21
|
+
</TooltipPrimitive.Content>
|
22
|
+
</TooltipPrimitive.Portal>);
|
23
|
+
}
|
10
24
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/tailwind.config.js
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
2
|
-
module.exports = {
|
3
|
-
darkMode: ["class"],
|
4
|
-
content: ["./**/*.{ts,tsx,js,jsx}"],
|
5
|
-
theme: {
|
6
|
-
extend: {
|
7
|
-
borderRadius: {
|
8
|
-
lg: 'var(--radius)',
|
9
|
-
md: 'calc(var(--radius) - 2px)',
|
10
|
-
sm: 'calc(var(--radius) - 4px)'
|
11
|
-
},
|
12
|
-
colors: {
|
13
|
-
background: 'hsl(var(--background))',
|
14
|
-
foreground: 'hsl(var(--foreground))',
|
15
|
-
card: {
|
16
|
-
DEFAULT: 'hsl(var(--card))',
|
17
|
-
foreground: 'hsl(var(--card-foreground))'
|
18
|
-
},
|
19
|
-
popover: {
|
20
|
-
DEFAULT: 'hsl(var(--popover))',
|
21
|
-
foreground: 'hsl(var(--popover-foreground))'
|
22
|
-
},
|
23
|
-
primary: {
|
24
|
-
DEFAULT: 'hsl(var(--primary))',
|
25
|
-
foreground: 'hsl(var(--primary-foreground))'
|
26
|
-
},
|
27
|
-
secondary: {
|
28
|
-
DEFAULT: 'hsl(var(--secondary))',
|
29
|
-
foreground: 'hsl(var(--secondary-foreground))'
|
30
|
-
},
|
31
|
-
muted: {
|
32
|
-
DEFAULT: 'hsl(var(--muted))',
|
33
|
-
foreground: 'hsl(var(--muted-foreground))'
|
34
|
-
},
|
35
|
-
accent: {
|
36
|
-
DEFAULT: 'hsl(var(--accent))',
|
37
|
-
foreground: 'hsl(var(--accent-foreground))'
|
38
|
-
},
|
39
|
-
destructive: {
|
40
|
-
DEFAULT: 'hsl(var(--destructive))',
|
41
|
-
foreground: 'hsl(var(--destructive-foreground))'
|
42
|
-
},
|
43
|
-
border: 'hsl(var(--border))',
|
44
|
-
input: 'hsl(var(--input))',
|
45
|
-
ring: 'hsl(var(--ring))',
|
46
|
-
chart: {
|
47
|
-
'1': 'hsl(var(--chart-1))',
|
48
|
-
'2': 'hsl(var(--chart-2))',
|
49
|
-
'3': 'hsl(var(--chart-3))',
|
50
|
-
'4': 'hsl(var(--chart-4))',
|
51
|
-
'5': 'hsl(var(--chart-5))'
|
52
|
-
},
|
53
|
-
sidebar: {
|
54
|
-
DEFAULT: 'hsl(var(--sidebar-background))',
|
55
|
-
foreground: 'hsl(var(--sidebar-foreground))',
|
56
|
-
primary: 'hsl(var(--sidebar-primary))',
|
57
|
-
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
|
58
|
-
accent: 'hsl(var(--sidebar-accent))',
|
59
|
-
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
60
|
-
border: 'hsl(var(--sidebar-border))',
|
61
|
-
ring: 'hsl(var(--sidebar-ring))'
|
62
|
-
}
|
63
|
-
},
|
64
|
-
keyframes: {
|
65
|
-
'accordion-down': {
|
66
|
-
from: {
|
67
|
-
height: '0'
|
68
|
-
},
|
69
|
-
to: {
|
70
|
-
height: 'var(--radix-accordion-content-height)'
|
71
|
-
}
|
72
|
-
},
|
73
|
-
'accordion-up': {
|
74
|
-
from: {
|
75
|
-
height: 'var(--radix-accordion-content-height)'
|
76
|
-
},
|
77
|
-
to: {
|
78
|
-
height: '0'
|
79
|
-
}
|
80
|
-
}
|
81
|
-
},
|
82
|
-
animation: {
|
83
|
-
'accordion-down': 'accordion-down 0.2s ease-out',
|
84
|
-
'accordion-up': 'accordion-up 0.2s ease-out'
|
85
|
-
}
|
86
|
-
}
|
87
|
-
},
|
88
|
-
plugins: [require("tailwindcss-animate")],
|
89
|
-
}
|
File without changes
|