shadcn-packaged 2025.4.14 → 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 +38 -38
- 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/alert.jsx
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cva } from "class-variance-authority";
|
3
3
|
import { cn } from "../lib/utils";
|
4
|
-
const alertVariants = cva("relative w-full rounded-lg border
|
4
|
+
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
5
5
|
variants: {
|
6
6
|
variant: {
|
7
|
-
default: "bg-
|
8
|
-
destructive: "
|
7
|
+
default: "bg-card text-card-foreground",
|
8
|
+
destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
9
9
|
},
|
10
10
|
},
|
11
11
|
defaultVariants: {
|
12
12
|
variant: "default",
|
13
13
|
},
|
14
14
|
});
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
AlertTitle
|
19
|
-
|
20
|
-
|
15
|
+
function Alert({ className, variant, ...props }) {
|
16
|
+
return (<div data-slot="alert" role="alert" className={cn(alertVariants({ variant }), className)} {...props}/>);
|
17
|
+
}
|
18
|
+
function AlertTitle({ className, ...props }) {
|
19
|
+
return (<div data-slot="alert-title" className={cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)} {...props}/>);
|
20
|
+
}
|
21
|
+
function AlertDescription({ className, ...props }) {
|
22
|
+
return (<div data-slot="alert-description" className={cn("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className)} {...props}/>);
|
23
|
+
}
|
21
24
|
export { Alert, AlertTitle, AlertDescription };
|
package/ui/aspect-ratio.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
2
|
-
declare
|
2
|
+
declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react").JSX.Element;
|
3
3
|
export { AspectRatio };
|
package/ui/aspect-ratio.jsx
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
3
|
-
|
3
|
+
function AspectRatio({ ...props }) {
|
4
|
+
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props}/>;
|
5
|
+
}
|
4
6
|
export { AspectRatio };
|
package/ui/avatar.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
3
|
+
declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): React.JSX.Element;
|
4
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): React.JSX.Element;
|
5
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): React.JSX.Element;
|
6
6
|
export { Avatar, AvatarImage, AvatarFallback };
|
package/ui/avatar.jsx
CHANGED
@@ -2,10 +2,13 @@
|
|
2
2
|
import * as React from "react";
|
3
3
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
AvatarImage
|
9
|
-
|
10
|
-
|
5
|
+
function Avatar({ className, ...props }) {
|
6
|
+
return (<AvatarPrimitive.Root data-slot="avatar" className={cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className)} {...props}/>);
|
7
|
+
}
|
8
|
+
function AvatarImage({ className, ...props }) {
|
9
|
+
return (<AvatarPrimitive.Image data-slot="avatar-image" className={cn("aspect-square size-full", className)} {...props}/>);
|
10
|
+
}
|
11
|
+
function AvatarFallback({ className, ...props }) {
|
12
|
+
return (<AvatarPrimitive.Fallback data-slot="avatar-fallback" className={cn("bg-muted flex size-full items-center justify-center rounded-full", className)} {...props}/>);
|
13
|
+
}
|
11
14
|
export { Avatar, AvatarImage, AvatarFallback };
|
package/ui/badge.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: {
|
4
4
|
variant?: "default" | "outline" | "destructive" | "secondary";
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
7
|
+
asChild?: boolean;
|
8
|
+
}): React.JSX.Element;
|
9
9
|
export { Badge, badgeVariants };
|
package/ui/badge.jsx
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
import * as React from "react";
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
2
3
|
import { cva } from "class-variance-authority";
|
3
4
|
import { cn } from "../lib/utils";
|
4
|
-
const badgeVariants = cva("inline-flex items-center rounded-
|
5
|
+
const badgeVariants = cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
5
6
|
variants: {
|
6
7
|
variant: {
|
7
|
-
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/
|
8
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/
|
9
|
-
destructive: "border-transparent bg-destructive text-destructive-
|
10
|
-
outline: "text-foreground",
|
8
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
9
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
10
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
11
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
11
12
|
},
|
12
13
|
},
|
13
14
|
defaultVariants: {
|
14
15
|
variant: "default",
|
15
16
|
},
|
16
17
|
});
|
17
|
-
function Badge({ className, variant, ...props }) {
|
18
|
-
|
18
|
+
function Badge({ className, variant, asChild = false, ...props }) {
|
19
|
+
const Comp = asChild ? Slot : "span";
|
20
|
+
return (<Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props}/>);
|
19
21
|
}
|
20
22
|
export { Badge, badgeVariants };
|
package/ui/breadcrumb.d.ts
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
3
|
-
|
4
|
-
}
|
5
|
-
declare
|
6
|
-
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
7
|
-
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
8
6
|
asChild?: boolean;
|
9
|
-
}
|
10
|
-
declare
|
11
|
-
declare
|
12
|
-
|
13
|
-
displayName: string;
|
14
|
-
};
|
15
|
-
declare const BreadcrumbEllipsis: {
|
16
|
-
({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
17
|
-
displayName: string;
|
18
|
-
};
|
7
|
+
}): React.JSX.Element;
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
19
11
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
package/ui/breadcrumb.jsx
CHANGED
@@ -2,26 +2,31 @@ import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
3
3
|
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
BreadcrumbList
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
function Breadcrumb({ ...props }) {
|
6
|
+
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props}/>;
|
7
|
+
}
|
8
|
+
function BreadcrumbList({ className, ...props }) {
|
9
|
+
return (<ol data-slot="breadcrumb-list" className={cn("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5", className)} {...props}/>);
|
10
|
+
}
|
11
|
+
function BreadcrumbItem({ className, ...props }) {
|
12
|
+
return (<li data-slot="breadcrumb-item" className={cn("inline-flex items-center gap-1.5", className)} {...props}/>);
|
13
|
+
}
|
14
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
12
15
|
const Comp = asChild ? Slot : "a";
|
13
|
-
return (<Comp
|
14
|
-
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<span className="
|
25
|
-
|
26
|
-
|
16
|
+
return (<Comp data-slot="breadcrumb-link" className={cn("hover:text-foreground transition-colors", className)} {...props}/>);
|
17
|
+
}
|
18
|
+
function BreadcrumbPage({ className, ...props }) {
|
19
|
+
return (<span data-slot="breadcrumb-page" role="link" aria-disabled="true" aria-current="page" className={cn("text-foreground font-normal", className)} {...props}/>);
|
20
|
+
}
|
21
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
22
|
+
return (<li data-slot="breadcrumb-separator" role="presentation" aria-hidden="true" className={cn("[&>svg]:size-3.5", className)} {...props}>
|
23
|
+
{children ?? <ChevronRight />}
|
24
|
+
</li>);
|
25
|
+
}
|
26
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
27
|
+
return (<span data-slot="breadcrumb-ellipsis" role="presentation" aria-hidden="true" className={cn("flex size-9 items-center justify-center", className)} {...props}>
|
28
|
+
<MoreHorizontal className="size-4"/>
|
29
|
+
<span className="sr-only">More</span>
|
30
|
+
</span>);
|
31
|
+
}
|
27
32
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
package/ui/button.d.ts
CHANGED
@@ -4,8 +4,7 @@ declare const buttonVariants: (props?: {
|
|
4
4
|
variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost";
|
5
5
|
size?: "default" | "icon" | "sm" | "lg";
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
7
|
-
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
8
8
|
asChild?: boolean;
|
9
|
-
}
|
10
|
-
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
9
|
+
}): React.JSX.Element;
|
11
10
|
export { Button, buttonVariants };
|
package/ui/button.jsx
CHANGED
@@ -2,21 +2,21 @@ import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
3
3
|
import { cva } from "class-variance-authority";
|
4
4
|
import { cn } from "../lib/utils";
|
5
|
-
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium
|
5
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
6
6
|
variants: {
|
7
7
|
variant: {
|
8
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
9
|
-
destructive: "bg-destructive text-
|
10
|
-
outline: "border
|
11
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
12
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
8
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
9
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
10
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
11
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
12
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
13
13
|
link: "text-primary underline-offset-4 hover:underline",
|
14
14
|
},
|
15
15
|
size: {
|
16
|
-
default: "h-
|
17
|
-
sm: "h-
|
18
|
-
lg: "h-
|
19
|
-
icon: "
|
16
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
17
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
18
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
19
|
+
icon: "size-9",
|
20
20
|
},
|
21
21
|
},
|
22
22
|
defaultVariants: {
|
@@ -24,9 +24,8 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
24
24
|
size: "default",
|
25
25
|
},
|
26
26
|
});
|
27
|
-
|
27
|
+
function Button({ className, variant, size, asChild = false, ...props }) {
|
28
28
|
const Comp = asChild ? Slot : "button";
|
29
|
-
return (<Comp className={cn(buttonVariants({ variant, size, className }))}
|
30
|
-
}
|
31
|
-
Button.displayName = "Button";
|
29
|
+
return (<Comp data-slot="button" className={cn(buttonVariants({ variant, size, className }))} {...props}/>);
|
30
|
+
}
|
32
31
|
export { Button, buttonVariants };
|
package/ui/calendar.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import { DayPicker } from "react-day-picker";
|
3
|
-
|
4
|
-
declare function Calendar({ className, classNames, showOutsideDays, ...props }:
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
export { Calendar };
|
2
|
+
import { DayButton, DayPicker } from "react-day-picker";
|
3
|
+
import { Button } from "../ui/button";
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
|
5
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
6
|
+
}): React.JSX.Element;
|
7
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): React.JSX.Element;
|
8
|
+
export { Calendar, CalendarDayButton };
|
package/ui/calendar.jsx
CHANGED
@@ -1,37 +1,77 @@
|
|
1
1
|
"use client";
|
2
2
|
import * as React from "react";
|
3
|
-
import {
|
4
|
-
import { DayPicker } from "react-day-picker";
|
3
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, } from "lucide-react";
|
4
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
5
5
|
import { cn } from "../lib/utils";
|
6
|
-
import { buttonVariants } from "../ui/button";
|
7
|
-
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
8
|
-
|
9
|
-
|
10
|
-
month: "
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
6
|
+
import { Button, buttonVariants } from "../ui/button";
|
7
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
8
|
+
const defaultClassNames = getDefaultClassNames();
|
9
|
+
return (<DayPicker showOutsideDays={showOutsideDays} className={cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className)} captionLayout={captionLayout} formatters={{
|
10
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
11
|
+
...formatters,
|
12
|
+
}} classNames={{
|
13
|
+
root: cn("w-fit", defaultClassNames.root),
|
14
|
+
months: cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
|
15
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
16
|
+
nav: cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
|
17
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
|
18
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
|
19
|
+
month_caption: cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption),
|
20
|
+
dropdowns: cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns),
|
21
|
+
dropdown_root: cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
|
22
|
+
dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
23
|
+
caption_label: cn("select-none font-medium", captionLayout === "label"
|
24
|
+
? "text-sm"
|
25
|
+
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", defaultClassNames.caption_label),
|
26
|
+
table: "w-full border-collapse",
|
27
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
28
|
+
weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday),
|
29
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
30
|
+
week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
|
31
|
+
week_number: cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
|
32
|
+
day: cn("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", defaultClassNames.day),
|
33
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
34
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
35
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
36
|
+
today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
37
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
38
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
39
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
30
40
|
...classNames,
|
31
41
|
}} components={{
|
32
|
-
|
33
|
-
|
42
|
+
Root: ({ className, rootRef, ...props }) => {
|
43
|
+
return (<div data-slot="calendar" ref={rootRef} className={cn(className)} {...props}/>);
|
44
|
+
},
|
45
|
+
Chevron: ({ className, orientation, ...props }) => {
|
46
|
+
if (orientation === "left") {
|
47
|
+
return (<ChevronLeftIcon className={cn("size-4", className)} {...props}/>);
|
48
|
+
}
|
49
|
+
if (orientation === "right") {
|
50
|
+
return (<ChevronRightIcon className={cn("size-4", className)} {...props}/>);
|
51
|
+
}
|
52
|
+
return (<ChevronDownIcon className={cn("size-4", className)} {...props}/>);
|
53
|
+
},
|
54
|
+
DayButton: CalendarDayButton,
|
55
|
+
WeekNumber: ({ children, ...props }) => {
|
56
|
+
return (<td {...props}>
|
57
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
58
|
+
{children}
|
59
|
+
</div>
|
60
|
+
</td>);
|
61
|
+
},
|
62
|
+
...components,
|
34
63
|
}} {...props}/>);
|
35
64
|
}
|
36
|
-
|
37
|
-
|
65
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
66
|
+
const defaultClassNames = getDefaultClassNames();
|
67
|
+
const ref = React.useRef(null);
|
68
|
+
React.useEffect(() => {
|
69
|
+
if (modifiers.focused)
|
70
|
+
ref.current?.focus();
|
71
|
+
}, [modifiers.focused]);
|
72
|
+
return (<Button ref={ref} variant="ghost" size="icon" data-day={day.date.toLocaleDateString()} data-selected-single={modifiers.selected &&
|
73
|
+
!modifiers.range_start &&
|
74
|
+
!modifiers.range_end &&
|
75
|
+
!modifiers.range_middle} data-range-start={modifiers.range_start} data-range-end={modifiers.range_end} data-range-middle={modifiers.range_middle} className={cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className)} {...props}/>);
|
76
|
+
}
|
77
|
+
export { Calendar, CalendarDayButton };
|
package/ui/card.d.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
declare
|
3
|
-
declare
|
4
|
-
declare
|
5
|
-
declare
|
6
|
-
declare
|
7
|
-
declare
|
8
|
-
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
package/ui/card.jsx
CHANGED
@@ -1,15 +1,24 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { cn } from "../lib/utils";
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
CardHeader
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
function Card({ className, ...props }) {
|
4
|
+
return (<div data-slot="card" className={cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)} {...props}/>);
|
5
|
+
}
|
6
|
+
function CardHeader({ className, ...props }) {
|
7
|
+
return (<div data-slot="card-header" className={cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className)} {...props}/>);
|
8
|
+
}
|
9
|
+
function CardTitle({ className, ...props }) {
|
10
|
+
return (<div data-slot="card-title" className={cn("leading-none font-semibold", className)} {...props}/>);
|
11
|
+
}
|
12
|
+
function CardDescription({ className, ...props }) {
|
13
|
+
return (<div data-slot="card-description" className={cn("text-muted-foreground text-sm", className)} {...props}/>);
|
14
|
+
}
|
15
|
+
function CardAction({ className, ...props }) {
|
16
|
+
return (<div data-slot="card-action" className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)} {...props}/>);
|
17
|
+
}
|
18
|
+
function CardContent({ className, ...props }) {
|
19
|
+
return (<div data-slot="card-content" className={cn("px-6", className)} {...props}/>);
|
20
|
+
}
|
21
|
+
function CardFooter({ className, ...props }) {
|
22
|
+
return (<div data-slot="card-footer" className={cn("flex items-center px-6 [.border-t]:pt-6", className)} {...props}/>);
|
23
|
+
}
|
24
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
package/ui/carousel.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
3
|
+
import { Button } from "../ui/button";
|
3
4
|
type CarouselApi = UseEmblaCarouselType[1];
|
4
5
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
5
6
|
type CarouselOptions = UseCarouselParameters[0];
|
@@ -10,9 +11,9 @@ type CarouselProps = {
|
|
10
11
|
orientation?: "horizontal" | "vertical";
|
11
12
|
setApi?: (api: CarouselApi) => void;
|
12
13
|
};
|
13
|
-
declare
|
14
|
-
declare
|
15
|
-
declare
|
16
|
-
declare
|
17
|
-
declare
|
14
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
15
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
16
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
17
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
18
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
18
19
|
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|