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/context-menu.jsx
CHANGED
@@ -1,52 +1,70 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
4
|
-
import {
|
4
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
{
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
{
|
32
|
-
|
33
|
-
|
34
|
-
ContextMenuPrimitive.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}
|
51
|
-
|
6
|
+
function ContextMenu({ ...props }) {
|
7
|
+
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props}/>;
|
8
|
+
}
|
9
|
+
function ContextMenuTrigger({ ...props }) {
|
10
|
+
return (<ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props}/>);
|
11
|
+
}
|
12
|
+
function ContextMenuGroup({ ...props }) {
|
13
|
+
return (<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props}/>);
|
14
|
+
}
|
15
|
+
function ContextMenuPortal({ ...props }) {
|
16
|
+
return (<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props}/>);
|
17
|
+
}
|
18
|
+
function ContextMenuSub({ ...props }) {
|
19
|
+
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props}/>;
|
20
|
+
}
|
21
|
+
function ContextMenuRadioGroup({ ...props }) {
|
22
|
+
return (<ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props}/>);
|
23
|
+
}
|
24
|
+
function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
25
|
+
return (<ContextMenuPrimitive.SubTrigger data-slot="context-menu-sub-trigger" data-inset={inset} className={cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
|
26
|
+
{children}
|
27
|
+
<ChevronRightIcon className="ml-auto"/>
|
28
|
+
</ContextMenuPrimitive.SubTrigger>);
|
29
|
+
}
|
30
|
+
function ContextMenuSubContent({ className, ...props }) {
|
31
|
+
return (<ContextMenuPrimitive.SubContent data-slot="context-menu-sub-content" className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
|
32
|
+
}
|
33
|
+
function ContextMenuContent({ className, ...props }) {
|
34
|
+
return (<ContextMenuPrimitive.Portal>
|
35
|
+
<ContextMenuPrimitive.Content data-slot="context-menu-content" className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className)} {...props}/>
|
36
|
+
</ContextMenuPrimitive.Portal>);
|
37
|
+
}
|
38
|
+
function ContextMenuItem({ className, inset, variant = "default", ...props }) {
|
39
|
+
return (<ContextMenuPrimitive.Item data-slot="context-menu-item" data-inset={inset} data-variant={variant} className={cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
|
40
|
+
}
|
41
|
+
function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
|
42
|
+
return (<ContextMenuPrimitive.CheckboxItem data-slot="context-menu-checkbox-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} checked={checked} {...props}>
|
43
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
44
|
+
<ContextMenuPrimitive.ItemIndicator>
|
45
|
+
<CheckIcon className="size-4"/>
|
46
|
+
</ContextMenuPrimitive.ItemIndicator>
|
47
|
+
</span>
|
48
|
+
{children}
|
49
|
+
</ContextMenuPrimitive.CheckboxItem>);
|
50
|
+
}
|
51
|
+
function ContextMenuRadioItem({ className, children, ...props }) {
|
52
|
+
return (<ContextMenuPrimitive.RadioItem data-slot="context-menu-radio-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
|
53
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
54
|
+
<ContextMenuPrimitive.ItemIndicator>
|
55
|
+
<CircleIcon className="size-2 fill-current"/>
|
56
|
+
</ContextMenuPrimitive.ItemIndicator>
|
57
|
+
</span>
|
58
|
+
{children}
|
59
|
+
</ContextMenuPrimitive.RadioItem>);
|
60
|
+
}
|
61
|
+
function ContextMenuLabel({ className, inset, ...props }) {
|
62
|
+
return (<ContextMenuPrimitive.Label data-slot="context-menu-label" data-inset={inset} className={cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)} {...props}/>);
|
63
|
+
}
|
64
|
+
function ContextMenuSeparator({ className, ...props }) {
|
65
|
+
return (<ContextMenuPrimitive.Separator data-slot="context-menu-separator" className={cn("bg-border -mx-1 my-1 h-px", className)} {...props}/>);
|
66
|
+
}
|
67
|
+
function ContextMenuShortcut({ className, ...props }) {
|
68
|
+
return (<span data-slot="context-menu-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
|
69
|
+
}
|
52
70
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
package/ui/dialog.d.ts
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
declare
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
};
|
13
|
-
declare
|
14
|
-
|
15
|
-
|
16
|
-
};
|
17
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
18
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
19
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
9
|
+
showCloseButton?: boolean;
|
10
|
+
}): React.JSX.Element;
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
package/ui/dialog.jsx
CHANGED
@@ -1,31 +1,45 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
4
|
-
import {
|
4
|
+
import { XIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
6
|
+
function Dialog({ ...props }) {
|
7
|
+
return <DialogPrimitive.Root data-slot="dialog" {...props}/>;
|
8
|
+
}
|
9
|
+
function DialogTrigger({ ...props }) {
|
10
|
+
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props}/>;
|
11
|
+
}
|
12
|
+
function DialogPortal({ ...props }) {
|
13
|
+
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props}/>;
|
14
|
+
}
|
15
|
+
function DialogClose({ ...props }) {
|
16
|
+
return <DialogPrimitive.Close data-slot="dialog-close" {...props}/>;
|
17
|
+
}
|
18
|
+
function DialogOverlay({ className, ...props }) {
|
19
|
+
return (<DialogPrimitive.Overlay data-slot="dialog-overlay" className={cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className)} {...props}/>);
|
20
|
+
}
|
21
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
22
|
+
return (<DialogPortal data-slot="dialog-portal">
|
23
|
+
<DialogOverlay />
|
24
|
+
<DialogPrimitive.Content data-slot="dialog-content" className={cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className)} {...props}>
|
25
|
+
{children}
|
26
|
+
{showCloseButton && (<DialogPrimitive.Close data-slot="dialog-close" className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
|
27
|
+
<XIcon />
|
28
|
+
<span className="sr-only">Close</span>
|
29
|
+
</DialogPrimitive.Close>)}
|
30
|
+
</DialogPrimitive.Content>
|
31
|
+
</DialogPortal>);
|
32
|
+
}
|
33
|
+
function DialogHeader({ className, ...props }) {
|
34
|
+
return (<div data-slot="dialog-header" className={cn("flex flex-col gap-2 text-center sm:text-left", className)} {...props}/>);
|
35
|
+
}
|
36
|
+
function DialogFooter({ className, ...props }) {
|
37
|
+
return (<div data-slot="dialog-footer" className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)} {...props}/>);
|
38
|
+
}
|
39
|
+
function DialogTitle({ className, ...props }) {
|
40
|
+
return (<DialogPrimitive.Title data-slot="dialog-title" className={cn("text-lg leading-none font-semibold", className)} {...props}/>);
|
41
|
+
}
|
42
|
+
function DialogDescription({ className, ...props }) {
|
43
|
+
return (<DialogPrimitive.Description data-slot="dialog-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
|
44
|
+
}
|
45
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
package/ui/drawer.d.ts
CHANGED
@@ -1,22 +1,13 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { Drawer as DrawerPrimitive } from "vaul";
|
3
|
-
declare
|
4
|
-
|
5
|
-
|
6
|
-
};
|
7
|
-
declare
|
8
|
-
declare
|
9
|
-
declare
|
10
|
-
declare
|
11
|
-
declare
|
12
|
-
declare
|
13
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
14
|
-
displayName: string;
|
15
|
-
};
|
16
|
-
declare const DrawerFooter: {
|
17
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
18
|
-
displayName: string;
|
19
|
-
};
|
20
|
-
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
21
|
-
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
3
|
+
declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
|
5
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
|
6
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
|
7
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
|
8
|
+
declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
|
9
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
10
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
11
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
|
12
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
|
22
13
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
package/ui/drawer.jsx
CHANGED
@@ -2,27 +2,40 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import { Drawer as DrawerPrimitive } from "vaul";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
5
|
+
function Drawer({ ...props }) {
|
6
|
+
return <DrawerPrimitive.Root data-slot="drawer" {...props}/>;
|
7
|
+
}
|
8
|
+
function DrawerTrigger({ ...props }) {
|
9
|
+
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props}/>;
|
10
|
+
}
|
11
|
+
function DrawerPortal({ ...props }) {
|
12
|
+
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props}/>;
|
13
|
+
}
|
14
|
+
function DrawerClose({ ...props }) {
|
15
|
+
return <DrawerPrimitive.Close data-slot="drawer-close" {...props}/>;
|
16
|
+
}
|
17
|
+
function DrawerOverlay({ className, ...props }) {
|
18
|
+
return (<DrawerPrimitive.Overlay data-slot="drawer-overlay" className={cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className)} {...props}/>);
|
19
|
+
}
|
20
|
+
function DrawerContent({ className, children, ...props }) {
|
21
|
+
return (<DrawerPortal data-slot="drawer-portal">
|
22
|
+
<DrawerOverlay />
|
23
|
+
<DrawerPrimitive.Content data-slot="drawer-content" className={cn("group/drawer-content bg-background fixed z-50 flex h-auto flex-col", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className)} {...props}>
|
24
|
+
<div className="bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"/>
|
25
|
+
{children}
|
26
|
+
</DrawerPrimitive.Content>
|
27
|
+
</DrawerPortal>);
|
28
|
+
}
|
29
|
+
function DrawerHeader({ className, ...props }) {
|
30
|
+
return (<div data-slot="drawer-header" className={cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className)} {...props}/>);
|
31
|
+
}
|
32
|
+
function DrawerFooter({ className, ...props }) {
|
33
|
+
return (<div data-slot="drawer-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props}/>);
|
34
|
+
}
|
35
|
+
function DrawerTitle({ className, ...props }) {
|
36
|
+
return (<DrawerPrimitive.Title data-slot="drawer-title" className={cn("text-foreground font-semibold", className)} {...props}/>);
|
37
|
+
}
|
38
|
+
function DrawerDescription({ className, ...props }) {
|
39
|
+
return (<DrawerPrimitive.Description data-slot="drawer-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
|
40
|
+
}
|
28
41
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
package/ui/dropdown-menu.d.ts
CHANGED
@@ -1,27 +1,25 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
declare
|
9
|
-
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
10
9
|
inset?: boolean;
|
11
|
-
|
12
|
-
|
13
|
-
declare
|
14
|
-
declare
|
10
|
+
variant?: "default" | "destructive";
|
11
|
+
}): React.JSX.Element;
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
15
16
|
inset?: boolean;
|
16
|
-
}
|
17
|
-
declare
|
18
|
-
declare
|
19
|
-
declare
|
17
|
+
}): React.JSX.Element;
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
20
22
|
inset?: boolean;
|
21
|
-
}
|
22
|
-
declare
|
23
|
-
|
24
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
25
|
-
displayName: string;
|
26
|
-
};
|
27
|
-
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
23
|
+
}): React.JSX.Element;
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
25
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
package/ui/dropdown-menu.jsx
CHANGED
@@ -1,54 +1,70 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
4
|
-
import {
|
4
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
{
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}
|
53
|
-
|
54
|
-
|
6
|
+
function DropdownMenu({ ...props }) {
|
7
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props}/>;
|
8
|
+
}
|
9
|
+
function DropdownMenuPortal({ ...props }) {
|
10
|
+
return (<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props}/>);
|
11
|
+
}
|
12
|
+
function DropdownMenuTrigger({ ...props }) {
|
13
|
+
return (<DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props}/>);
|
14
|
+
}
|
15
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
16
|
+
return (<DropdownMenuPrimitive.Portal>
|
17
|
+
<DropdownMenuPrimitive.Content data-slot="dropdown-menu-content" sideOffset={sideOffset} className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", className)} {...props}/>
|
18
|
+
</DropdownMenuPrimitive.Portal>);
|
19
|
+
}
|
20
|
+
function DropdownMenuGroup({ ...props }) {
|
21
|
+
return (<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props}/>);
|
22
|
+
}
|
23
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
24
|
+
return (<DropdownMenuPrimitive.Item data-slot="dropdown-menu-item" data-inset={inset} data-variant={variant} className={cn("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}/>);
|
25
|
+
}
|
26
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
27
|
+
return (<DropdownMenuPrimitive.CheckboxItem data-slot="dropdown-menu-checkbox-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} checked={checked} {...props}>
|
28
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
29
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
30
|
+
<CheckIcon className="size-4"/>
|
31
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
32
|
+
</span>
|
33
|
+
{children}
|
34
|
+
</DropdownMenuPrimitive.CheckboxItem>);
|
35
|
+
}
|
36
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
37
|
+
return (<DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props}/>);
|
38
|
+
}
|
39
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
40
|
+
return (<DropdownMenuPrimitive.RadioItem data-slot="dropdown-menu-radio-item" className={cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
|
41
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
42
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
43
|
+
<CircleIcon className="size-2 fill-current"/>
|
44
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
45
|
+
</span>
|
46
|
+
{children}
|
47
|
+
</DropdownMenuPrimitive.RadioItem>);
|
48
|
+
}
|
49
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
50
|
+
return (<DropdownMenuPrimitive.Label data-slot="dropdown-menu-label" data-inset={inset} className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)} {...props}/>);
|
51
|
+
}
|
52
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
53
|
+
return (<DropdownMenuPrimitive.Separator data-slot="dropdown-menu-separator" className={cn("bg-border -mx-1 my-1 h-px", className)} {...props}/>);
|
54
|
+
}
|
55
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
56
|
+
return (<span data-slot="dropdown-menu-shortcut" className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)} {...props}/>);
|
57
|
+
}
|
58
|
+
function DropdownMenuSub({ ...props }) {
|
59
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props}/>;
|
60
|
+
}
|
61
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
62
|
+
return (<DropdownMenuPrimitive.SubTrigger data-slot="dropdown-menu-sub-trigger" data-inset={inset} className={cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className)} {...props}>
|
63
|
+
{children}
|
64
|
+
<ChevronRightIcon className="ml-auto size-4"/>
|
65
|
+
</DropdownMenuPrimitive.SubTrigger>);
|
66
|
+
}
|
67
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
68
|
+
return (<DropdownMenuPrimitive.SubContent data-slot="dropdown-menu-sub-content" className={cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", className)} {...props}/>);
|
69
|
+
}
|
70
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
package/ui/form.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
3
4
|
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
4
5
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
5
6
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
@@ -15,9 +16,9 @@ declare const useFormField: () => {
|
|
15
16
|
formDescriptionId: string;
|
16
17
|
formMessageId: string;
|
17
18
|
};
|
18
|
-
declare
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare
|
22
|
-
declare
|
19
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
20
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
|
21
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): React.JSX.Element;
|
22
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
23
24
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|