shadcn-packaged 2025.8.25 → 2025.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +20 -0
- package/package.json +4 -4
- package/ui/accordion.d.ts +4 -4
- package/ui/accordion.jsx +15 -20
- package/ui/alert-dialog.d.ts +17 -11
- package/ui/alert-dialog.jsx +23 -36
- package/ui/alert.d.ts +4 -5
- package/ui/alert.jsx +9 -12
- package/ui/aspect-ratio.d.ts +1 -1
- package/ui/aspect-ratio.jsx +1 -3
- package/ui/avatar.d.ts +3 -3
- package/ui/avatar.jsx +6 -9
- package/ui/badge.d.ts +3 -3
- package/ui/badge.jsx +7 -9
- package/ui/breadcrumb.d.ts +16 -8
- package/ui/breadcrumb.jsx +21 -26
- package/ui/button.d.ts +3 -2
- package/ui/button.jsx +14 -13
- package/ui/calendar.jsx +20 -20
- package/ui/card.d.ts +7 -8
- package/ui/card.jsx +13 -22
- package/ui/carousel.d.ts +5 -6
- package/ui/carousel.jsx +34 -26
- package/ui/chart.d.ts +28 -6
- package/ui/chart.jsx +40 -37
- package/ui/checkbox.d.ts +1 -1
- package/ui/checkbox.jsx +7 -8
- package/ui/collapsible.d.ts +3 -3
- package/ui/collapsible.jsx +3 -9
- package/ui/command.d.ts +78 -16
- package/ui/command.jsx +27 -37
- package/ui/context-menu.d.ts +21 -19
- package/ui/context-menu.jsx +47 -65
- package/ui/dialog.d.ts +17 -13
- package/ui/dialog.jsx +27 -41
- package/ui/drawer.d.ts +19 -10
- package/ui/drawer.jsx +23 -36
- package/ui/dropdown-menu.d.ts +22 -20
- package/ui/dropdown-menu.jsx +50 -66
- package/ui/form.d.ts +5 -6
- package/ui/form.jsx +23 -19
- package/ui/hover-card.d.ts +3 -3
- package/ui/hover-card.jsx +4 -11
- package/ui/input-otp.d.ts +30 -7
- package/ui/input-otp.jsx +15 -17
- package/ui/input.d.ts +1 -1
- package/ui/input.jsx +4 -3
- package/ui/label.d.ts +2 -1
- package/ui/label.jsx +4 -3
- package/ui/menubar.d.ts +19 -17
- package/ui/menubar.jsx +49 -58
- package/ui/navigation-menu.d.ts +9 -11
- package/ui/navigation-menu.jsx +29 -37
- package/ui/pagination.d.ts +25 -10
- package/ui/pagination.jsx +28 -35
- package/ui/popover.d.ts +4 -5
- package/ui/popover.jsx +7 -15
- package/ui/progress.d.ts +1 -1
- package/ui/progress.jsx +4 -5
- package/ui/radio-group.d.ts +2 -2
- package/ui/radio-group.jsx +11 -9
- package/ui/resizable.d.ts +20 -5
- package/ui/resizable.jsx +8 -15
- package/ui/scroll-area.d.ts +2 -2
- package/ui/scroll-area.jsx +14 -16
- package/ui/select.d.ts +11 -13
- package/ui/select.jsx +47 -58
- package/ui/separator.d.ts +1 -1
- package/ui/separator.jsx +2 -3
- package/ui/sheet.d.ts +23 -11
- package/ui/sheet.jsx +41 -45
- package/ui/sidebar.d.ts +34 -38
- package/ui/sidebar.jsx +122 -109
- package/ui/skeleton.d.ts +1 -1
- package/ui/skeleton.jsx +1 -1
- package/ui/slider.d.ts +1 -1
- package/ui/slider.jsx +7 -13
- package/ui/sonner.d.ts +2 -1
- package/ui/sonner.jsx +7 -4
- package/ui/switch.d.ts +2 -2
- package/ui/switch.jsx +5 -6
- package/ui/table.d.ts +8 -8
- package/ui/table.jsx +18 -27
- package/ui/tabs.d.ts +4 -4
- package/ui/tabs.jsx +7 -12
- package/ui/textarea.d.ts +1 -1
- package/ui/textarea.jsx +4 -3
- package/ui/toggle-group.d.ts +8 -3
- package/ui/toggle-group.jsx +11 -11
- package/ui/toggle.d.ts +4 -1
- package/ui/toggle.jsx +7 -8
- package/ui/tooltip.d.ts +4 -4
- package/ui/tooltip.jsx +5 -19
package/ui/sidebar.jsx
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
4
4
|
import { cva } from "class-variance-authority";
|
5
|
-
import {
|
5
|
+
import { PanelLeft } from "lucide-react";
|
6
6
|
import { useIsMobile } from "../hooks/use-mobile";
|
7
7
|
import { cn } from "../lib/utils";
|
8
8
|
import { Button } from "../ui/button";
|
@@ -25,7 +25,7 @@ function useSidebar() {
|
|
25
25
|
}
|
26
26
|
return context;
|
27
27
|
}
|
28
|
-
|
28
|
+
const SidebarProvider = React.forwardRef(({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }, ref) => {
|
29
29
|
const isMobile = useIsMobile();
|
30
30
|
const [openMobile, setOpenMobile] = React.useState(false);
|
31
31
|
// This is the internal state of the sidebar.
|
@@ -45,7 +45,9 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
45
45
|
}, [setOpenProp, open]);
|
46
46
|
// Helper to toggle the sidebar.
|
47
47
|
const toggleSidebar = React.useCallback(() => {
|
48
|
-
return isMobile
|
48
|
+
return isMobile
|
49
|
+
? setOpenMobile((open) => !open)
|
50
|
+
: setOpen((open) => !open);
|
49
51
|
}, [isMobile, setOpen, setOpenMobile]);
|
50
52
|
// Adds a keyboard shortcut to toggle the sidebar.
|
51
53
|
React.useEffect(() => {
|
@@ -72,110 +74,120 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
72
74
|
toggleSidebar,
|
73
75
|
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
74
76
|
return (<SidebarContext.Provider value={contextValue}>
|
75
|
-
|
76
|
-
|
77
|
+
<TooltipProvider delayDuration={0}>
|
78
|
+
<div style={{
|
77
79
|
"--sidebar-width": SIDEBAR_WIDTH,
|
78
80
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
79
81
|
...style,
|
80
|
-
}} className={cn("group/sidebar-wrapper has-data-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
}
|
86
|
-
|
82
|
+
}} className={cn("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar", className)} ref={ref} {...props}>
|
83
|
+
{children}
|
84
|
+
</div>
|
85
|
+
</TooltipProvider>
|
86
|
+
</SidebarContext.Provider>);
|
87
|
+
});
|
88
|
+
SidebarProvider.displayName = "SidebarProvider";
|
89
|
+
const Sidebar = React.forwardRef(({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }, ref) => {
|
87
90
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
88
91
|
if (collapsible === "none") {
|
89
|
-
return (<div
|
90
|
-
|
91
|
-
|
92
|
+
return (<div className={cn("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground", className)} ref={ref} {...props}>
|
93
|
+
{children}
|
94
|
+
</div>);
|
92
95
|
}
|
93
96
|
if (isMobile) {
|
94
97
|
return (<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
95
|
-
|
98
|
+
<SheetContent data-sidebar="sidebar" data-mobile="true" className="w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden" style={{
|
96
99
|
"--sidebar-width": SIDEBAR_WIDTH_MOBILE,
|
97
100
|
}} side={side}>
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
<SheetHeader className="sr-only">
|
102
|
+
<SheetTitle>Sidebar</SheetTitle>
|
103
|
+
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
104
|
+
</SheetHeader>
|
105
|
+
<div className="flex h-full w-full flex-col">{children}</div>
|
106
|
+
</SheetContent>
|
107
|
+
</Sheet>);
|
105
108
|
}
|
106
|
-
return (<div className="group peer text-sidebar-foreground
|
107
|
-
|
108
|
-
|
109
|
-
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(
|
110
|
-
: "group-data-[collapsible=icon]:w-
|
111
|
-
|
109
|
+
return (<div ref={ref} className="group peer hidden text-sidebar-foreground md:block" data-state={state} data-collapsible={state === "collapsed" ? collapsible : ""} data-variant={variant} data-side={side}>
|
110
|
+
{/* This is what handles the sidebar gap on desktop */}
|
111
|
+
<div className={cn("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset"
|
112
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]"
|
113
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}/>
|
114
|
+
<div className={cn("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex", side === "left"
|
112
115
|
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
113
116
|
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
114
117
|
// Adjust the padding for floating and inset variants.
|
115
118
|
variant === "floating" || variant === "inset"
|
116
|
-
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(
|
117
|
-
: "group-data-[collapsible=icon]:w-
|
118
|
-
|
119
|
-
|
119
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]"
|
120
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l", className)} {...props}>
|
121
|
+
<div data-sidebar="sidebar" className="flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow">
|
122
|
+
{children}
|
123
|
+
</div>
|
120
124
|
</div>
|
121
|
-
</div>
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
+
</div>);
|
126
|
+
});
|
127
|
+
Sidebar.displayName = "Sidebar";
|
128
|
+
const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
|
125
129
|
const { toggleSidebar } = useSidebar();
|
126
|
-
return (<Button
|
130
|
+
return (<Button ref={ref} data-sidebar="trigger" variant="ghost" size="icon" className={cn("h-7 w-7", className)} onClick={(event) => {
|
127
131
|
onClick?.(event);
|
128
132
|
toggleSidebar();
|
129
133
|
}} {...props}>
|
130
|
-
<
|
134
|
+
<PanelLeft />
|
131
135
|
<span className="sr-only">Toggle Sidebar</span>
|
132
136
|
</Button>);
|
133
|
-
}
|
134
|
-
|
137
|
+
});
|
138
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
139
|
+
const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
135
140
|
const { toggleSidebar } = useSidebar();
|
136
|
-
return (<button
|
137
|
-
}
|
138
|
-
|
139
|
-
|
140
|
-
}
|
141
|
-
|
142
|
-
|
143
|
-
}
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
return (<div
|
149
|
-
}
|
150
|
-
|
151
|
-
|
152
|
-
}
|
153
|
-
|
154
|
-
|
155
|
-
}
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
141
|
+
return (<button ref={ref} data-sidebar="rail" aria-label="Toggle Sidebar" tabIndex={-1} onClick={toggleSidebar} title="Toggle Sidebar" className={cn("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex", "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className)} {...props}/>);
|
142
|
+
});
|
143
|
+
SidebarRail.displayName = "SidebarRail";
|
144
|
+
const SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
|
145
|
+
return (<main ref={ref} className={cn("relative flex w-full flex-1 flex-col bg-background", "md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow", className)} {...props}/>);
|
146
|
+
});
|
147
|
+
SidebarInset.displayName = "SidebarInset";
|
148
|
+
const SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
|
149
|
+
return (<Input ref={ref} data-sidebar="input" className={cn("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring", className)} {...props}/>);
|
150
|
+
});
|
151
|
+
SidebarInput.displayName = "SidebarInput";
|
152
|
+
const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => {
|
153
|
+
return (<div ref={ref} data-sidebar="header" className={cn("flex flex-col gap-2 p-2", className)} {...props}/>);
|
154
|
+
});
|
155
|
+
SidebarHeader.displayName = "SidebarHeader";
|
156
|
+
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
|
157
|
+
return (<div ref={ref} data-sidebar="footer" className={cn("flex flex-col gap-2 p-2", className)} {...props}/>);
|
158
|
+
});
|
159
|
+
SidebarFooter.displayName = "SidebarFooter";
|
160
|
+
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
161
|
+
return (<Separator ref={ref} data-sidebar="separator" className={cn("mx-2 w-auto bg-sidebar-border", className)} {...props}/>);
|
162
|
+
});
|
163
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
164
|
+
const SidebarContent = React.forwardRef(({ className, ...props }, ref) => {
|
165
|
+
return (<div ref={ref} data-sidebar="content" className={cn("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className)} {...props}/>);
|
166
|
+
});
|
167
|
+
SidebarContent.displayName = "SidebarContent";
|
168
|
+
const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
|
169
|
+
return (<div ref={ref} data-sidebar="group" className={cn("relative flex w-full min-w-0 flex-col p-2", className)} {...props}/>);
|
170
|
+
});
|
171
|
+
SidebarGroup.displayName = "SidebarGroup";
|
172
|
+
const SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
160
173
|
const Comp = asChild ? Slot : "div";
|
161
|
-
return (<Comp
|
162
|
-
}
|
163
|
-
|
174
|
+
return (<Comp ref={ref} data-sidebar="group-label" className={cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", className)} {...props}/>);
|
175
|
+
});
|
176
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
177
|
+
const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
164
178
|
const Comp = asChild ? Slot : "button";
|
165
|
-
return (<Comp
|
179
|
+
return (<Comp ref={ref} data-sidebar="group-action" className={cn("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
166
180
|
// Increases the hit area of the button on mobile.
|
167
|
-
"after:absolute after:-inset-2 md:
|
168
|
-
}
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
}
|
178
|
-
const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
181
|
+
"after:absolute after:-inset-2 after:md:hidden", "group-data-[collapsible=icon]:hidden", className)} {...props}/>);
|
182
|
+
});
|
183
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
184
|
+
const SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="group-content" className={cn("w-full text-sm", className)} {...props}/>));
|
185
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
186
|
+
const SidebarMenu = React.forwardRef(({ className, ...props }, ref) => (<ul ref={ref} data-sidebar="menu" className={cn("flex w-full min-w-0 flex-col gap-1", className)} {...props}/>));
|
187
|
+
SidebarMenu.displayName = "SidebarMenu";
|
188
|
+
const SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => (<li ref={ref} data-sidebar="menu-item" className={cn("group/menu-item relative", className)} {...props}/>));
|
189
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
190
|
+
const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
179
191
|
variants: {
|
180
192
|
variant: {
|
181
193
|
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
@@ -184,7 +196,7 @@ const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center
|
|
184
196
|
size: {
|
185
197
|
default: "h-8 text-sm",
|
186
198
|
sm: "h-7 text-xs",
|
187
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]
|
199
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
|
188
200
|
},
|
189
201
|
},
|
190
202
|
defaultVariants: {
|
@@ -192,10 +204,10 @@ const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center
|
|
192
204
|
size: "default",
|
193
205
|
},
|
194
206
|
});
|
195
|
-
|
207
|
+
const SidebarMenuButton = React.forwardRef(({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }, ref) => {
|
196
208
|
const Comp = asChild ? Slot : "button";
|
197
209
|
const { isMobile, state } = useSidebar();
|
198
|
-
const button = (<Comp
|
210
|
+
const button = (<Comp ref={ref} data-sidebar="menu-button" data-size={size} data-active={isActive} className={cn(sidebarMenuButtonVariants({ variant, size }), className)} {...props}/>);
|
199
211
|
if (!tooltip) {
|
200
212
|
return button;
|
201
213
|
}
|
@@ -205,40 +217,41 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
205
217
|
};
|
206
218
|
}
|
207
219
|
return (<Tooltip>
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
}
|
212
|
-
|
220
|
+
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
221
|
+
<TooltipContent side="right" align="center" hidden={state !== "collapsed" || isMobile} {...tooltip}/>
|
222
|
+
</Tooltip>);
|
223
|
+
});
|
224
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
225
|
+
const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
213
226
|
const Comp = asChild ? Slot : "button";
|
214
|
-
return (<Comp
|
227
|
+
return (<Comp ref={ref} data-sidebar="menu-action" className={cn("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
215
228
|
// Increases the hit area of the button on mobile.
|
216
|
-
"after:absolute after:-inset-2 md:
|
217
|
-
"
|
218
|
-
}
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
229
|
+
"after:absolute after:-inset-2 after:md:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", showOnHover &&
|
230
|
+
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0", className)} {...props}/>);
|
231
|
+
});
|
232
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
233
|
+
const SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} data-sidebar="menu-badge" className={cn("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", className)} {...props}/>));
|
234
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
235
|
+
const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
223
236
|
// Random width between 50 to 90%.
|
224
237
|
const width = React.useMemo(() => {
|
225
238
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
226
239
|
}, []);
|
227
|
-
return (<div
|
240
|
+
return (<div ref={ref} data-sidebar="menu-skeleton" className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)} {...props}>
|
228
241
|
{showIcon && (<Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon"/>)}
|
229
|
-
<Skeleton className="h-4 max-w-
|
242
|
+
<Skeleton className="h-4 max-w-[--skeleton-width] flex-1" data-sidebar="menu-skeleton-text" style={{
|
230
243
|
"--skeleton-width": width,
|
231
244
|
}}/>
|
232
245
|
</div>);
|
233
|
-
}
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
}
|
240
|
-
function SidebarMenuSubButton({ asChild = false, size = "md", isActive = false, className, ...props }) {
|
246
|
+
});
|
247
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
248
|
+
const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => (<ul ref={ref} data-sidebar="menu-sub" className={cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", className)} {...props}/>));
|
249
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
250
|
+
const SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => <li ref={ref} {...props}/>);
|
251
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
252
|
+
const SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
241
253
|
const Comp = asChild ? Slot : "a";
|
242
|
-
return (<Comp
|
243
|
-
}
|
254
|
+
return (<Comp ref={ref} data-sidebar="menu-sub-button" data-size={size} data-active={isActive} className={cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", size === "sm" && "text-xs", size === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", className)} {...props}/>);
|
255
|
+
});
|
256
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
244
257
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
package/ui/skeleton.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
declare function Skeleton({ className, ...props }: React.
|
1
|
+
declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
2
2
|
export { Skeleton };
|
package/ui/skeleton.jsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { cn } from "../lib/utils";
|
2
2
|
function Skeleton({ className, ...props }) {
|
3
|
-
return (<div
|
3
|
+
return (<div className={cn("animate-pulse rounded-md bg-muted", className)} {...props}/>);
|
4
4
|
}
|
5
5
|
export { Skeleton };
|
package/ui/slider.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
3
|
-
declare
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
4
4
|
export { Slider };
|
package/ui/slider.jsx
CHANGED
@@ -2,17 +2,11 @@
|
|
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
|
-
|
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
|
-
}
|
5
|
+
const Slider = React.forwardRef(({ className, ...props }, ref) => (<SliderPrimitive.Root ref={ref} className={cn("relative flex w-full touch-none select-none items-center", className)} {...props}>
|
6
|
+
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
|
7
|
+
<SliderPrimitive.Range className="absolute h-full bg-primary"/>
|
8
|
+
</SliderPrimitive.Track>
|
9
|
+
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"/>
|
10
|
+
</SliderPrimitive.Root>));
|
11
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
18
12
|
export { Slider };
|
package/ui/sonner.d.ts
CHANGED
package/ui/sonner.jsx
CHANGED
@@ -3,10 +3,13 @@ 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
|
-
|
6
|
+
return (<Sonner theme={theme} className="toaster group" toastOptions={{
|
7
|
+
classNames: {
|
8
|
+
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
9
|
+
description: "group-[.toast]:text-muted-foreground",
|
10
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
11
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
12
|
+
},
|
10
13
|
}} {...props}/>);
|
11
14
|
};
|
12
15
|
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 SwitchPrimitives from "@radix-ui/react-switch";
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
4
4
|
export { Switch };
|
package/ui/switch.jsx
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
|
-
import * as
|
3
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
}
|
5
|
+
const Switch = React.forwardRef(({ className, ...props }, ref) => (<SwitchPrimitives.Root className={cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)} {...props} ref={ref}>
|
6
|
+
<SwitchPrimitives.Thumb className={cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")}/>
|
7
|
+
</SwitchPrimitives.Root>));
|
8
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
10
9
|
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 const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
10
10
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
package/ui/table.jsx
CHANGED
@@ -1,30 +1,21 @@
|
|
1
|
-
"use client";
|
2
1
|
import * as React from "react";
|
3
2
|
import { cn } from "../lib/utils";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
21
|
-
|
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
|
-
}
|
3
|
+
const Table = React.forwardRef(({ className, ...props }, ref) => (<div className="relative w-full overflow-auto">
|
4
|
+
<table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props}/>
|
5
|
+
</div>));
|
6
|
+
Table.displayName = "Table";
|
7
|
+
const TableHeader = React.forwardRef(({ className, ...props }, ref) => (<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props}/>));
|
8
|
+
TableHeader.displayName = "TableHeader";
|
9
|
+
const TableBody = React.forwardRef(({ className, ...props }, ref) => (<tbody ref={ref} className={cn("[&_tr:last-child]:border-0", className)} {...props}/>));
|
10
|
+
TableBody.displayName = "TableBody";
|
11
|
+
const TableFooter = React.forwardRef(({ className, ...props }, ref) => (<tfoot ref={ref} className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)} {...props}/>));
|
12
|
+
TableFooter.displayName = "TableFooter";
|
13
|
+
const TableRow = React.forwardRef(({ className, ...props }, ref) => (<tr ref={ref} className={cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)} {...props}/>));
|
14
|
+
TableRow.displayName = "TableRow";
|
15
|
+
const TableHead = React.forwardRef(({ className, ...props }, ref) => (<th ref={ref} className={cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className)} {...props}/>));
|
16
|
+
TableHead.displayName = "TableHead";
|
17
|
+
const TableCell = React.forwardRef(({ className, ...props }, ref) => (<td ref={ref} className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)} {...props}/>));
|
18
|
+
TableCell.displayName = "TableCell";
|
19
|
+
const TableCaption = React.forwardRef(({ className, ...props }, ref) => (<caption ref={ref} className={cn("mt-4 text-sm text-muted-foreground", className)} {...props}/>));
|
20
|
+
TableCaption.displayName = "TableCaption";
|
30
21
|
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 const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
4
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
5
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
6
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
7
7
|
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
package/ui/tabs.jsx
CHANGED
@@ -2,16 +2,11 @@
|
|
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
|
-
|
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
|
-
}
|
5
|
+
const Tabs = TabsPrimitive.Root;
|
6
|
+
const TabsList = React.forwardRef(({ className, ...props }, ref) => (<TabsPrimitive.List ref={ref} className={cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className)} {...props}/>));
|
7
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
8
|
+
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => (<TabsPrimitive.Trigger ref={ref} className={cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", className)} {...props}/>));
|
9
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
10
|
+
const TabsContent = React.forwardRef(({ className, ...props }, ref) => (<TabsPrimitive.Content ref={ref} className={cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className)} {...props}/>));
|
11
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
17
12
|
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 const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
3
3
|
export { Textarea };
|
package/ui/textarea.jsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
return (<textarea
|
5
|
-
}
|
3
|
+
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
4
|
+
return (<textarea className={cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className)} ref={ref} {...props}/>);
|
5
|
+
});
|
6
|
+
Textarea.displayName = "Textarea";
|
6
7
|
export { Textarea };
|