shadcn-packaged 2025.8.25 → 2025.9.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/index.css +20 -0
- package/package.json +3 -3
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +15 -20
- package/ui/alert-dialog.d.ts +17 -11
- package/ui/alert-dialog.jsx +23 -36
- package/ui/alert.d.ts +4 -5
- package/ui/alert.jsx +9 -12
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +1 -3
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +6 -9
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +7 -9
- package/ui/breadcrumb.d.ts +16 -8
- package/ui/breadcrumb.jsx +21 -26
- package/ui/button.d.ts +3 -2
- package/ui/button.jsx +14 -13
- package/ui/calendar.jsx +20 -20
- package/ui/card.d.ts +7 -8
- package/ui/card.jsx +13 -22
- package/ui/carousel.d.ts +5 -6
- package/ui/carousel.jsx +34 -26
- package/ui/chart.d.ts +28 -6
- package/ui/chart.jsx +40 -37
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +7 -8
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +3 -9
- package/ui/command.d.ts +78 -16
- package/ui/command.jsx +27 -37
- package/ui/context-menu.d.ts +21 -19
- package/ui/context-menu.jsx +47 -65
- package/ui/dialog.d.ts +17 -13
- package/ui/dialog.jsx +27 -41
- package/ui/drawer.d.ts +19 -10
- package/ui/drawer.jsx +23 -36
- package/ui/dropdown-menu.d.ts +22 -20
- package/ui/dropdown-menu.jsx +50 -66
- package/ui/form.d.ts +5 -6
- package/ui/form.jsx +23 -19
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +4 -11
- package/ui/input-otp.d.ts +30 -7
- package/ui/input-otp.jsx +15 -17
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +4 -3
- package/ui/label.d.ts +2 -1
- package/ui/label.jsx +4 -3
- package/ui/menubar.d.ts +19 -17
- package/ui/menubar.jsx +49 -58
- package/ui/navigation-menu.d.ts +9 -11
- package/ui/navigation-menu.jsx +29 -37
- package/ui/pagination.d.ts +25 -10
- package/ui/pagination.jsx +28 -35
- package/ui/popover.d.ts +4 -5
- package/ui/popover.jsx +7 -15
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +4 -5
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +11 -9
- package/ui/resizable.d.ts +20 -5
- package/ui/resizable.jsx +8 -15
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +14 -16
- package/ui/select.d.ts +11 -13
- package/ui/select.jsx +47 -58
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +2 -3
- package/ui/sheet.d.ts +23 -11
- package/ui/sheet.jsx +41 -45
- package/ui/sidebar.d.ts +34 -38
- package/ui/sidebar.jsx +122 -109
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +7 -13
- package/ui/sonner.d.ts +2 -1
- package/ui/sonner.jsx +7 -4
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +5 -6
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +18 -27
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +7 -12
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +4 -3
- package/ui/toggle-group.d.ts +8 -3
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +4 -1
- package/ui/toggle.jsx +7 -8
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +5 -19
package/ui/command.jsx
CHANGED
@@ -1,47 +1,37 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import { Command as CommandPrimitive } from "cmdk";
|
4
|
-
import {
|
4
|
+
import { Search } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
import { Dialog, DialogContent
|
7
|
-
|
8
|
-
|
9
|
-
}
|
10
|
-
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
6
|
+
import { Dialog, DialogContent } from "../ui/dialog";
|
7
|
+
const Command = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive ref={ref} className={cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className)} {...props}/>));
|
8
|
+
Command.displayName = CommandPrimitive.displayName;
|
9
|
+
const CommandDialog = ({ children, ...props }) => {
|
11
10
|
return (<Dialog {...props}>
|
12
|
-
<
|
13
|
-
<
|
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">
|
11
|
+
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
12
|
+
<Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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">
|
18
13
|
{children}
|
19
14
|
</Command>
|
20
15
|
</DialogContent>
|
21
16
|
</Dialog>);
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
return (<
|
40
|
-
}
|
41
|
-
|
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
|
-
}
|
17
|
+
};
|
18
|
+
const CommandInput = React.forwardRef(({ className, ...props }, ref) => (<div className="flex items-center border-b px-3" cmdk-input-wrapper="">
|
19
|
+
<Search className="mr-2 h-4 w-4 shrink-0 opacity-50"/>
|
20
|
+
<CommandPrimitive.Input ref={ref} className={cn("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}/>
|
21
|
+
</div>));
|
22
|
+
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
23
|
+
const CommandList = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.List ref={ref} className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)} {...props}/>));
|
24
|
+
CommandList.displayName = CommandPrimitive.List.displayName;
|
25
|
+
const CommandEmpty = React.forwardRef((props, ref) => (<CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props}/>));
|
26
|
+
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
27
|
+
const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Group ref={ref} className={cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)} {...props}/>));
|
28
|
+
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
29
|
+
const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Separator ref={ref} className={cn("-mx-1 h-px bg-border", className)} {...props}/>));
|
30
|
+
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
31
|
+
const CommandItem = React.forwardRef(({ className, ...props }, ref) => (<CommandPrimitive.Item ref={ref} className={cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className)} {...props}/>));
|
32
|
+
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
33
|
+
const CommandShortcut = ({ className, ...props }) => {
|
34
|
+
return (<span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props}/>);
|
35
|
+
};
|
36
|
+
CommandShortcut.displayName = "CommandShortcut";
|
47
37
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
package/ui/context-menu.d.ts
CHANGED
@@ -1,25 +1,27 @@
|
|
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 const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
|
4
|
+
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
5
|
+
declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
|
7
|
+
declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
|
8
|
+
declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
10
10
|
inset?: boolean;
|
11
|
-
}
|
12
|
-
declare
|
13
|
-
declare
|
14
|
-
declare
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
15
15
|
inset?: boolean;
|
16
|
-
|
17
|
-
|
18
|
-
declare
|
19
|
-
declare
|
20
|
-
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
|
+
declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
21
20
|
inset?: boolean;
|
22
|
-
}
|
23
|
-
declare
|
24
|
-
declare
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
22
|
+
declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
|
+
declare const ContextMenuShortcut: {
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
25
|
+
displayName: string;
|
26
|
+
};
|
25
27
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
package/ui/context-menu.jsx
CHANGED
@@ -1,70 +1,52 @@
|
|
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 { Check, ChevronRight, Circle } 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
|
-
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
|
-
}
|
6
|
+
const ContextMenu = ContextMenuPrimitive.Root;
|
7
|
+
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
8
|
+
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
9
|
+
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
10
|
+
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
11
|
+
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
12
|
+
const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (<ContextMenuPrimitive.SubTrigger ref={ref} className={cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className)} {...props}>
|
13
|
+
{children}
|
14
|
+
<ChevronRight className="ml-auto h-4 w-4"/>
|
15
|
+
</ContextMenuPrimitive.SubTrigger>));
|
16
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
17
|
+
const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.SubContent ref={ref} className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-[--radix-context-menu-content-transform-origin]", className)} {...props}/>));
|
18
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
19
|
+
const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.Portal>
|
20
|
+
<ContextMenuPrimitive.Content ref={ref} className={cn("z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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 origin-[--radix-context-menu-content-transform-origin]", className)} {...props}/>
|
21
|
+
</ContextMenuPrimitive.Portal>));
|
22
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
23
|
+
const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (<ContextMenuPrimitive.Item ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)} {...props}/>));
|
24
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
25
|
+
const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (<ContextMenuPrimitive.CheckboxItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} checked={checked} {...props}>
|
26
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
27
|
+
<ContextMenuPrimitive.ItemIndicator>
|
28
|
+
<Check className="h-4 w-4"/>
|
29
|
+
</ContextMenuPrimitive.ItemIndicator>
|
30
|
+
</span>
|
31
|
+
{children}
|
32
|
+
</ContextMenuPrimitive.CheckboxItem>));
|
33
|
+
ContextMenuCheckboxItem.displayName =
|
34
|
+
ContextMenuPrimitive.CheckboxItem.displayName;
|
35
|
+
const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (<ContextMenuPrimitive.RadioItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} {...props}>
|
36
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
37
|
+
<ContextMenuPrimitive.ItemIndicator>
|
38
|
+
<Circle className="h-2 w-2 fill-current"/>
|
39
|
+
</ContextMenuPrimitive.ItemIndicator>
|
40
|
+
</span>
|
41
|
+
{children}
|
42
|
+
</ContextMenuPrimitive.RadioItem>));
|
43
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
44
|
+
const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (<ContextMenuPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className)} {...props}/>));
|
45
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
46
|
+
const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (<ContextMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-border", className)} {...props}/>));
|
47
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
48
|
+
const ContextMenuShortcut = ({ className, ...props }) => {
|
49
|
+
return (<span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props}/>);
|
50
|
+
};
|
51
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
70
52
|
export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
|
package/ui/dialog.d.ts
CHANGED
@@ -1,15 +1,19 @@
|
|
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
|
-
}): React.JSX.Element;
|
11
|
-
|
12
|
-
|
13
|
-
declare
|
14
|
-
|
15
|
-
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
declare const DialogHeader: {
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
11
|
+
displayName: string;
|
12
|
+
};
|
13
|
+
declare const DialogFooter: {
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
15
|
+
displayName: string;
|
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, };
|
package/ui/dialog.jsx
CHANGED
@@ -1,45 +1,31 @@
|
|
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 { X } 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
|
-
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, };
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
8
|
+
const DialogPortal = DialogPrimitive.Portal;
|
9
|
+
const DialogClose = DialogPrimitive.Close;
|
10
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Overlay ref={ref} className={cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)} {...props}/>));
|
11
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
12
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (<DialogPortal>
|
13
|
+
<DialogOverlay />
|
14
|
+
<DialogPrimitive.Content ref={ref} className={cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className)} {...props}>
|
15
|
+
{children}
|
16
|
+
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
17
|
+
<X className="h-4 w-4"/>
|
18
|
+
<span className="sr-only">Close</span>
|
19
|
+
</DialogPrimitive.Close>
|
20
|
+
</DialogPrimitive.Content>
|
21
|
+
</DialogPortal>));
|
22
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
23
|
+
const DialogHeader = ({ className, ...props }) => (<div className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...props}/>);
|
24
|
+
DialogHeader.displayName = "DialogHeader";
|
25
|
+
const DialogFooter = ({ className, ...props }) => (<div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props}/>);
|
26
|
+
DialogFooter.displayName = "DialogFooter";
|
27
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold leading-none tracking-tight", className)} {...props}/>));
|
28
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
29
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (<DialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
|
30
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
31
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
package/ui/drawer.d.ts
CHANGED
@@ -1,13 +1,22 @@
|
|
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
|
3
|
+
declare const Drawer: {
|
4
|
+
({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
5
|
+
displayName: string;
|
6
|
+
};
|
7
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
8
|
+
declare const DrawerPortal: typeof import("vaul").Portal;
|
9
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
10
|
+
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
11
|
+
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const DrawerHeader: {
|
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>>;
|
13
22
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
package/ui/drawer.jsx
CHANGED
@@ -2,40 +2,27 @@
|
|
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
|
-
|
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
|
-
}
|
5
|
+
const Drawer = ({ shouldScaleBackground = true, ...props }) => (<DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props}/>);
|
6
|
+
Drawer.displayName = "Drawer";
|
7
|
+
const DrawerTrigger = DrawerPrimitive.Trigger;
|
8
|
+
const DrawerPortal = DrawerPrimitive.Portal;
|
9
|
+
const DrawerClose = DrawerPrimitive.Close;
|
10
|
+
const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Overlay ref={ref} className={cn("fixed inset-0 z-50 bg-black/80", className)} {...props}/>));
|
11
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
12
|
+
const DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => (<DrawerPortal>
|
13
|
+
<DrawerOverlay />
|
14
|
+
<DrawerPrimitive.Content ref={ref} className={cn("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background", className)} {...props}>
|
15
|
+
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"/>
|
16
|
+
{children}
|
17
|
+
</DrawerPrimitive.Content>
|
18
|
+
</DrawerPortal>));
|
19
|
+
DrawerContent.displayName = "DrawerContent";
|
20
|
+
const DrawerHeader = ({ className, ...props }) => (<div className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...props}/>);
|
21
|
+
DrawerHeader.displayName = "DrawerHeader";
|
22
|
+
const DrawerFooter = ({ className, ...props }) => (<div className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props}/>);
|
23
|
+
DrawerFooter.displayName = "DrawerFooter";
|
24
|
+
const DrawerTitle = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Title ref={ref} className={cn("text-lg font-semibold leading-none tracking-tight", className)} {...props}/>));
|
25
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
26
|
+
const DrawerDescription = React.forwardRef(({ className, ...props }, ref) => (<DrawerPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
|
27
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
41
28
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
package/ui/dropdown-menu.d.ts
CHANGED
@@ -1,25 +1,27 @@
|
|
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
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
9
10
|
inset?: boolean;
|
10
|
-
|
11
|
-
|
12
|
-
declare
|
13
|
-
declare
|
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> & {
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
16
15
|
inset?: boolean;
|
17
|
-
}
|
18
|
-
declare
|
19
|
-
declare
|
20
|
-
declare
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
22
20
|
inset?: boolean;
|
23
|
-
}
|
24
|
-
declare
|
25
|
-
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
23
|
+
declare const DropdownMenuShortcut: {
|
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, };
|