shadcn-packaged 2025.4.21 → 2025.6.16-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -31
- package/index.css +112 -138
- package/package.json +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/pagination.jsx
CHANGED
@@ -1,31 +1,38 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import {
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon, } from "lucide-react";
|
3
3
|
import { cn } from "../lib/utils";
|
4
4
|
import { buttonVariants } from "../ui/button";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
PaginationContent
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
PaginationPrevious
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
5
|
+
function Pagination({ className, ...props }) {
|
6
|
+
return (<nav role="navigation" aria-label="pagination" data-slot="pagination" className={cn("mx-auto flex w-full justify-center", className)} {...props}/>);
|
7
|
+
}
|
8
|
+
function PaginationContent({ className, ...props }) {
|
9
|
+
return (<ul data-slot="pagination-content" className={cn("flex flex-row items-center gap-1", className)} {...props}/>);
|
10
|
+
}
|
11
|
+
function PaginationItem({ ...props }) {
|
12
|
+
return <li data-slot="pagination-item" {...props}/>;
|
13
|
+
}
|
14
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }) {
|
15
|
+
return (<a aria-current={isActive ? "page" : undefined} data-slot="pagination-link" data-active={isActive} className={cn(buttonVariants({
|
16
|
+
variant: isActive ? "outline" : "ghost",
|
17
|
+
size,
|
18
|
+
}), className)} {...props}/>);
|
19
|
+
}
|
20
|
+
function PaginationPrevious({ className, ...props }) {
|
21
|
+
return (<PaginationLink aria-label="Go to previous page" size="default" className={cn("gap-1 px-2.5 sm:pl-2.5", className)} {...props}>
|
22
|
+
<ChevronLeftIcon />
|
23
|
+
<span className="hidden sm:block">Previous</span>
|
24
|
+
</PaginationLink>);
|
25
|
+
}
|
26
|
+
function PaginationNext({ className, ...props }) {
|
27
|
+
return (<PaginationLink aria-label="Go to next page" size="default" className={cn("gap-1 px-2.5 sm:pr-2.5", className)} {...props}>
|
28
|
+
<span className="hidden sm:block">Next</span>
|
29
|
+
<ChevronRightIcon />
|
30
|
+
</PaginationLink>);
|
31
|
+
}
|
32
|
+
function PaginationEllipsis({ className, ...props }) {
|
33
|
+
return (<span aria-hidden data-slot="pagination-ellipsis" className={cn("flex size-9 items-center justify-center", className)} {...props}>
|
34
|
+
<MoreHorizontalIcon className="size-4"/>
|
35
|
+
<span className="sr-only">More pages</span>
|
36
|
+
</span>);
|
37
|
+
}
|
38
|
+
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
package/ui/popover.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
package/ui/popover.jsx
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
function Popover({ ...props }) {
|
6
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props}/>;
|
7
|
+
}
|
8
|
+
function PopoverTrigger({ ...props }) {
|
9
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props}/>;
|
10
|
+
}
|
11
|
+
function PopoverContent({ className, align = "center", sideOffset = 4, ...props }) {
|
12
|
+
return (<PopoverPrimitive.Portal>
|
13
|
+
<PopoverPrimitive.Content data-slot="popover-content" align={align} 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 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", className)} {...props}/>
|
14
|
+
</PopoverPrimitive.Portal>);
|
15
|
+
}
|
16
|
+
function PopoverAnchor({ ...props }) {
|
17
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props}/>;
|
18
|
+
}
|
19
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
package/ui/progress.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
3
|
-
declare
|
3
|
+
declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): React.JSX.Element;
|
4
4
|
export { Progress };
|
package/ui/progress.jsx
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
<ProgressPrimitive.
|
7
|
-
|
8
|
-
|
5
|
+
function Progress({ className, value, ...props }) {
|
6
|
+
return (<ProgressPrimitive.Root data-slot="progress" className={cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className)} {...props}>
|
7
|
+
<ProgressPrimitive.Indicator data-slot="progress-indicator" className="bg-primary h-full w-full flex-1 transition-all" style={{ transform: `translateX(-${100 - (value || 0)}%)` }}/>
|
8
|
+
</ProgressPrimitive.Root>);
|
9
|
+
}
|
9
10
|
export { Progress };
|
package/ui/radio-group.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
3
|
-
declare
|
4
|
-
declare
|
3
|
+
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
|
5
5
|
export { RadioGroup, RadioGroupItem };
|
package/ui/radio-group.jsx
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
4
|
-
import {
|
4
|
+
import { CircleIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
return (<RadioGroupPrimitive.Root className={cn("grid gap-
|
8
|
-
}
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<Circle className="h-2.5 w-2.5 fill-current text-current"/>
|
6
|
+
function RadioGroup({ className, ...props }) {
|
7
|
+
return (<RadioGroupPrimitive.Root data-slot="radio-group" className={cn("grid gap-3", className)} {...props}/>);
|
8
|
+
}
|
9
|
+
function RadioGroupItem({ className, ...props }) {
|
10
|
+
return (<RadioGroupPrimitive.Item data-slot="radio-group-item" className={cn("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className)} {...props}>
|
11
|
+
<RadioGroupPrimitive.Indicator data-slot="radio-group-indicator" className="relative flex items-center justify-center">
|
12
|
+
<CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"/>
|
14
13
|
</RadioGroupPrimitive.Indicator>
|
15
14
|
</RadioGroupPrimitive.Item>);
|
16
|
-
}
|
17
|
-
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
15
|
+
}
|
18
16
|
export { RadioGroup, RadioGroupItem };
|
package/ui/resizable.d.ts
CHANGED
@@ -1,23 +1,8 @@
|
|
1
|
+
import * as React from "react";
|
1
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
2
|
-
declare
|
3
|
-
declare
|
4
|
-
|
5
|
-
collapsedSize?: number | undefined;
|
6
|
-
collapsible?: boolean | undefined;
|
7
|
-
defaultSize?: number | undefined;
|
8
|
-
id?: string | undefined;
|
9
|
-
maxSize?: number | undefined;
|
10
|
-
minSize?: number | undefined;
|
11
|
-
onCollapse?: ResizablePrimitive.PanelOnCollapse | undefined;
|
12
|
-
onExpand?: ResizablePrimitive.PanelOnExpand | undefined;
|
13
|
-
onResize?: ResizablePrimitive.PanelOnResize | undefined;
|
14
|
-
order?: number | undefined;
|
15
|
-
style?: object | undefined;
|
16
|
-
tagName?: keyof HTMLElementTagNameMap | undefined;
|
17
|
-
} & {
|
18
|
-
children?: import("react").ReactNode;
|
19
|
-
} & import("react").RefAttributes<ResizablePrimitive.ImperativePanelHandle>>;
|
20
|
-
declare const ResizableHandle: ({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
3
|
+
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): React.JSX.Element;
|
4
|
+
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): React.JSX.Element;
|
5
|
+
declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
21
6
|
withHandle?: boolean;
|
22
|
-
})
|
7
|
+
}): React.JSX.Element;
|
23
8
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
package/ui/resizable.jsx
CHANGED
@@ -1,12 +1,19 @@
|
|
1
1
|
"use client";
|
2
|
-
import
|
2
|
+
import * as React from "react";
|
3
|
+
import { GripVerticalIcon } from "lucide-react";
|
3
4
|
import * as ResizablePrimitive from "react-resizable-panels";
|
4
5
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
function ResizablePanelGroup({ className, ...props }) {
|
7
|
+
return (<ResizablePrimitive.PanelGroup data-slot="resizable-panel-group" className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)} {...props}/>);
|
8
|
+
}
|
9
|
+
function ResizablePanel({ ...props }) {
|
10
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props}/>;
|
11
|
+
}
|
12
|
+
function ResizableHandle({ withHandle, className, ...props }) {
|
13
|
+
return (<ResizablePrimitive.PanelResizeHandle data-slot="resizable-handle" className={cn("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90", className)} {...props}>
|
14
|
+
{withHandle && (<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
15
|
+
<GripVerticalIcon className="size-2.5"/>
|
16
|
+
</div>)}
|
17
|
+
</ResizablePrimitive.PanelResizeHandle>);
|
18
|
+
}
|
12
19
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
package/ui/scroll-area.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
3
|
-
declare
|
4
|
-
declare
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): React.JSX.Element;
|
5
5
|
export { ScrollArea, ScrollBar };
|
package/ui/scroll-area.jsx
CHANGED
@@ -2,18 +2,20 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
<ScrollAreaPrimitive.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
function ScrollArea({ className, children, ...props }) {
|
6
|
+
return (<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative", className)} {...props}>
|
7
|
+
<ScrollAreaPrimitive.Viewport data-slot="scroll-area-viewport" className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1">
|
8
|
+
{children}
|
9
|
+
</ScrollAreaPrimitive.Viewport>
|
10
|
+
<ScrollBar />
|
11
|
+
<ScrollAreaPrimitive.Corner />
|
12
|
+
</ScrollAreaPrimitive.Root>);
|
13
|
+
}
|
14
|
+
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
15
|
+
return (<ScrollAreaPrimitive.ScrollAreaScrollbar data-slot="scroll-area-scrollbar" orientation={orientation} className={cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" &&
|
16
|
+
"h-full w-2.5 border-l border-l-transparent", orientation === "horizontal" &&
|
17
|
+
"h-2.5 flex-col border-t border-t-transparent", className)} {...props}>
|
18
|
+
<ScrollAreaPrimitive.ScrollAreaThumb data-slot="scroll-area-thumb" className="bg-border relative flex-1 rounded-full"/>
|
19
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>);
|
20
|
+
}
|
19
21
|
export { ScrollArea, ScrollBar };
|
package/ui/select.d.ts
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
|
8
|
-
|
9
|
-
declare
|
10
|
-
declare
|
11
|
-
declare
|
12
|
-
declare
|
13
|
-
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
7
|
+
size?: "sm" | "default";
|
8
|
+
}): React.JSX.Element;
|
9
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
package/ui/select.jsx
CHANGED
@@ -1,51 +1,62 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
3
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
4
|
-
import {
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
{
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
SelectTrigger
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
SelectPrimitive.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</SelectPrimitive.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
<
|
41
|
-
<
|
42
|
-
<
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
6
|
+
function Select({ ...props }) {
|
7
|
+
return <SelectPrimitive.Root data-slot="select" {...props}/>;
|
8
|
+
}
|
9
|
+
function SelectGroup({ ...props }) {
|
10
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props}/>;
|
11
|
+
}
|
12
|
+
function SelectValue({ ...props }) {
|
13
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props}/>;
|
14
|
+
}
|
15
|
+
function SelectTrigger({ className, size = "default", children, ...props }) {
|
16
|
+
return (<SelectPrimitive.Trigger data-slot="select-trigger" data-size={size} className={cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className)} {...props}>
|
17
|
+
{children}
|
18
|
+
<SelectPrimitive.Icon asChild>
|
19
|
+
<ChevronDownIcon className="size-4 opacity-50"/>
|
20
|
+
</SelectPrimitive.Icon>
|
21
|
+
</SelectPrimitive.Trigger>);
|
22
|
+
}
|
23
|
+
function SelectContent({ className, children, position = "popper", ...props }) {
|
24
|
+
return (<SelectPrimitive.Portal>
|
25
|
+
<SelectPrimitive.Content data-slot="select-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" &&
|
26
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className)} position={position} {...props}>
|
27
|
+
<SelectScrollUpButton />
|
28
|
+
<SelectPrimitive.Viewport className={cn("p-1", position === "popper" &&
|
29
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1")}>
|
30
|
+
{children}
|
31
|
+
</SelectPrimitive.Viewport>
|
32
|
+
<SelectScrollDownButton />
|
33
|
+
</SelectPrimitive.Content>
|
34
|
+
</SelectPrimitive.Portal>);
|
35
|
+
}
|
36
|
+
function SelectLabel({ className, ...props }) {
|
37
|
+
return (<SelectPrimitive.Label data-slot="select-label" className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)} {...props}/>);
|
38
|
+
}
|
39
|
+
function SelectItem({ className, children, ...props }) {
|
40
|
+
return (<SelectPrimitive.Item data-slot="select-item" className={cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className)} {...props}>
|
41
|
+
<span className="absolute right-2 flex size-3.5 items-center justify-center">
|
42
|
+
<SelectPrimitive.ItemIndicator>
|
43
|
+
<CheckIcon className="size-4"/>
|
44
|
+
</SelectPrimitive.ItemIndicator>
|
45
|
+
</span>
|
46
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
47
|
+
</SelectPrimitive.Item>);
|
48
|
+
}
|
49
|
+
function SelectSeparator({ className, ...props }) {
|
50
|
+
return (<SelectPrimitive.Separator data-slot="select-separator" className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)} {...props}/>);
|
51
|
+
}
|
52
|
+
function SelectScrollUpButton({ className, ...props }) {
|
53
|
+
return (<SelectPrimitive.ScrollUpButton data-slot="select-scroll-up-button" className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
|
54
|
+
<ChevronUpIcon className="size-4"/>
|
55
|
+
</SelectPrimitive.ScrollUpButton>);
|
56
|
+
}
|
57
|
+
function SelectScrollDownButton({ className, ...props }) {
|
58
|
+
return (<SelectPrimitive.ScrollDownButton data-slot="select-scroll-down-button" className={cn("flex cursor-default items-center justify-center py-1", className)} {...props}>
|
59
|
+
<ChevronDownIcon className="size-4"/>
|
60
|
+
</SelectPrimitive.ScrollDownButton>);
|
61
|
+
}
|
62
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
package/ui/separator.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
3
|
-
declare
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
|
4
4
|
export { Separator };
|
package/ui/separator.jsx
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
5
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
6
|
+
return (<SeparatorPrimitive.Root data-slot="separator" decorative={decorative} orientation={orientation} className={cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className)} {...props}/>);
|
7
|
+
}
|
7
8
|
export { Separator };
|
package/ui/sheet.d.ts
CHANGED
@@ -1,25 +1,13 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
3
|
-
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
|
8
|
-
|
9
|
-
declare
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
}
|
14
|
-
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
15
|
-
declare const SheetHeader: {
|
16
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
17
|
-
displayName: string;
|
18
|
-
};
|
19
|
-
declare const SheetFooter: {
|
20
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
21
|
-
displayName: string;
|
22
|
-
};
|
23
|
-
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
24
|
-
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
25
|
-
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
6
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
8
|
+
}): React.JSX.Element;
|
9
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
10
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
11
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
12
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
13
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|