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.
Files changed (97) hide show
  1. package/README.md +30 -31
  2. package/index.css +112 -138
  3. package/package.json +38 -38
  4. package/ui/accordion.d.ts +4 -4
  5. package/ui/accordion.jsx +20 -15
  6. package/ui/alert-dialog.d.ts +11 -17
  7. package/ui/alert-dialog.jsx +36 -23
  8. package/ui/alert.d.ts +5 -4
  9. package/ui/alert.jsx +12 -9
  10. package/ui/aspect-ratio.d.ts +1 -1
  11. package/ui/aspect-ratio.jsx +3 -1
  12. package/ui/avatar.d.ts +3 -3
  13. package/ui/avatar.jsx +9 -6
  14. package/ui/badge.d.ts +3 -3
  15. package/ui/badge.jsx +9 -7
  16. package/ui/breadcrumb.d.ts +8 -16
  17. package/ui/breadcrumb.jsx +26 -21
  18. package/ui/button.d.ts +2 -3
  19. package/ui/button.jsx +13 -14
  20. package/ui/calendar.d.ts +7 -7
  21. package/ui/calendar.jsx +70 -30
  22. package/ui/card.d.ts +8 -7
  23. package/ui/card.jsx +22 -13
  24. package/ui/carousel.d.ts +6 -5
  25. package/ui/carousel.jsx +26 -34
  26. package/ui/chart.d.ts +6 -28
  27. package/ui/chart.jsx +37 -40
  28. package/ui/checkbox.d.ts +1 -1
  29. package/ui/checkbox.jsx +8 -7
  30. package/ui/collapsible.d.ts +3 -3
  31. package/ui/collapsible.jsx +9 -3
  32. package/ui/command.d.ts +16 -78
  33. package/ui/command.jsx +37 -27
  34. package/ui/context-menu.d.ts +19 -21
  35. package/ui/context-menu.jsx +65 -47
  36. package/ui/dialog.d.ts +13 -17
  37. package/ui/dialog.jsx +41 -27
  38. package/ui/drawer.d.ts +10 -19
  39. package/ui/drawer.jsx +36 -23
  40. package/ui/dropdown-menu.d.ts +20 -22
  41. package/ui/dropdown-menu.jsx +66 -50
  42. package/ui/form.d.ts +6 -5
  43. package/ui/form.jsx +19 -23
  44. package/ui/hover-card.d.ts +3 -3
  45. package/ui/hover-card.jsx +11 -4
  46. package/ui/input-otp.d.ts +7 -30
  47. package/ui/input-otp.jsx +17 -15
  48. package/ui/input.d.ts +1 -1
  49. package/ui/input.jsx +3 -4
  50. package/ui/label.d.ts +1 -2
  51. package/ui/label.jsx +3 -4
  52. package/ui/menubar.d.ts +17 -19
  53. package/ui/menubar.jsx +58 -49
  54. package/ui/navigation-menu.d.ts +11 -9
  55. package/ui/navigation-menu.jsx +37 -29
  56. package/ui/pagination.d.ts +10 -25
  57. package/ui/pagination.jsx +35 -28
  58. package/ui/popover.d.ts +5 -4
  59. package/ui/popover.jsx +15 -7
  60. package/ui/progress.d.ts +1 -1
  61. package/ui/progress.jsx +5 -4
  62. package/ui/radio-group.d.ts +2 -2
  63. package/ui/radio-group.jsx +9 -11
  64. package/ui/resizable.d.ts +5 -20
  65. package/ui/resizable.jsx +15 -8
  66. package/ui/scroll-area.d.ts +2 -2
  67. package/ui/scroll-area.jsx +16 -14
  68. package/ui/select.d.ts +13 -11
  69. package/ui/select.jsx +58 -47
  70. package/ui/separator.d.ts +1 -1
  71. package/ui/separator.jsx +3 -2
  72. package/ui/sheet.d.ts +11 -23
  73. package/ui/sheet.jsx +45 -41
  74. package/ui/sidebar.d.ts +38 -34
  75. package/ui/sidebar.jsx +109 -122
  76. package/ui/skeleton.d.ts +1 -1
  77. package/ui/skeleton.jsx +1 -1
  78. package/ui/slider.d.ts +1 -1
  79. package/ui/slider.jsx +13 -7
  80. package/ui/sonner.d.ts +1 -2
  81. package/ui/sonner.jsx +4 -7
  82. package/ui/switch.d.ts +2 -2
  83. package/ui/switch.jsx +6 -5
  84. package/ui/table.d.ts +8 -8
  85. package/ui/table.jsx +27 -18
  86. package/ui/tabs.d.ts +4 -4
  87. package/ui/tabs.jsx +12 -7
  88. package/ui/textarea.d.ts +1 -1
  89. package/ui/textarea.jsx +3 -4
  90. package/ui/toggle-group.d.ts +3 -8
  91. package/ui/toggle-group.jsx +11 -11
  92. package/ui/toggle.d.ts +1 -4
  93. package/ui/toggle.jsx +8 -7
  94. package/ui/tooltip.d.ts +4 -4
  95. package/ui/tooltip.jsx +19 -5
  96. package/tailwind.config.js +0 -89
  97. /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 p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", {
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-background text-foreground",
8
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-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
- const Alert = React.forwardRef(({ className, variant, ...props }, ref) => (<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props}/>));
16
- Alert.displayName = "Alert";
17
- const AlertTitle = React.forwardRef(({ className, ...props }, ref) => (<h5 ref={ref} className={cn("mb-1 font-medium leading-none tracking-tight", className)} {...props}/>));
18
- AlertTitle.displayName = "AlertTitle";
19
- const AlertDescription = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("text-sm [&_p]:leading-relaxed", className)} {...props}/>));
20
- AlertDescription.displayName = "AlertDescription";
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 };
@@ -1,3 +1,3 @@
1
1
  import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2
- declare const AspectRatio: import("react").ForwardRefExoticComponent<AspectRatioPrimitive.AspectRatioProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ declare function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>): import("react").JSX.Element;
3
3
  export { AspectRatio };
@@ -1,4 +1,6 @@
1
1
  "use client";
2
2
  import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
3
- const AspectRatio = AspectRatioPrimitive.Root;
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 const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
4
- declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
5
- declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
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
- const Avatar = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Root ref={ref} className={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className)} {...props}/>));
6
- Avatar.displayName = AvatarPrimitive.Root.displayName;
7
- const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Image ref={ref} className={cn("aspect-square h-full w-full", className)} {...props}/>));
8
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
9
- const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (<AvatarPrimitive.Fallback ref={ref} className={cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className)} {...props}/>));
10
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
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
- export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
- }
8
- declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
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-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
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/80",
8
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
9
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
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
- return (<div className={cn(badgeVariants({ variant }), className)} {...props}/>);
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 };
@@ -1,19 +1,11 @@
1
1
  import * as React from "react";
2
- declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
3
- separator?: React.ReactNode;
4
- } & React.RefAttributes<HTMLElement>>;
5
- declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
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
- } & React.RefAttributes<HTMLAnchorElement>>;
10
- declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
11
- declare const BreadcrumbSeparator: {
12
- ({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
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
- const Breadcrumb = React.forwardRef(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props}/>);
6
- Breadcrumb.displayName = "Breadcrumb";
7
- const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (<ol ref={ref} className={cn("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5", className)} {...props}/>));
8
- BreadcrumbList.displayName = "BreadcrumbList";
9
- const BreadcrumbItem = React.forwardRef(({ className, ...props }, ref) => (<li ref={ref} className={cn("inline-flex items-center gap-1.5", className)} {...props}/>));
10
- BreadcrumbItem.displayName = "BreadcrumbItem";
11
- const BreadcrumbLink = React.forwardRef(({ asChild, className, ...props }, ref) => {
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 ref={ref} className={cn("transition-colors hover:text-foreground", className)} {...props}/>);
14
- });
15
- BreadcrumbLink.displayName = "BreadcrumbLink";
16
- const BreadcrumbPage = React.forwardRef(({ className, ...props }, ref) => (<span ref={ref} role="link" aria-disabled="true" aria-current="page" className={cn("font-normal text-foreground", className)} {...props}/>));
17
- BreadcrumbPage.displayName = "BreadcrumbPage";
18
- const BreadcrumbSeparator = ({ children, className, ...props }) => (<li role="presentation" aria-hidden="true" className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)} {...props}>
19
- {children ?? <ChevronRight />}
20
- </li>);
21
- BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
22
- const BreadcrumbEllipsis = ({ className, ...props }) => (<span role="presentation" aria-hidden="true" className={cn("flex h-9 w-9 items-center justify-center", className)} {...props}>
23
- <MoreHorizontal className="h-4 w-4"/>
24
- <span className="sr-only">More</span>
25
- </span>);
26
- BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
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
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
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 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
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-destructive-foreground hover:bg-destructive/90",
10
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
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-10 px-4 py-2",
17
- sm: "h-9 rounded-md px-3",
18
- lg: "h-11 rounded-md px-8",
19
- icon: "h-10 w-10",
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
- const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
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 }))} ref={ref} {...props}/>);
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
- export type CalendarProps = React.ComponentProps<typeof DayPicker>;
4
- declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
5
- declare namespace Calendar {
6
- var displayName: string;
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 { ChevronLeft, ChevronRight } from "lucide-react";
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
- return (<DayPicker showOutsideDays={showOutsideDays} className={cn("p-3", className)} classNames={{
9
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
10
- month: "space-y-4",
11
- caption: "flex justify-center pt-1 relative items-center",
12
- caption_label: "text-sm font-medium",
13
- nav: "space-x-1 flex items-center",
14
- nav_button: cn(buttonVariants({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
15
- nav_button_previous: "absolute left-1",
16
- nav_button_next: "absolute right-1",
17
- table: "w-full border-collapse space-y-1",
18
- head_row: "flex",
19
- head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
20
- row: "flex w-full mt-2",
21
- cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
22
- day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
23
- day_range_end: "day-range-end",
24
- day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
25
- day_today: "bg-accent text-accent-foreground",
26
- day_outside: "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
27
- day_disabled: "text-muted-foreground opacity-50",
28
- day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
29
- day_hidden: "invisible",
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
- IconLeft: ({ className, ...props }) => (<ChevronLeft className={cn("h-4 w-4", className)} {...props}/>),
33
- IconRight: ({ className, ...props }) => (<ChevronRight className={cn("h-4 w-4", className)} {...props}/>),
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
- Calendar.displayName = "Calendar";
37
- export { Calendar };
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 const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
- declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
- declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
- declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
- declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
- declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
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
- const Card = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("rounded-lg border bg-card text-card-foreground shadow-sm", className)} {...props}/>));
4
- Card.displayName = "Card";
5
- const CardHeader = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props}/>));
6
- CardHeader.displayName = "CardHeader";
7
- const CardTitle = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("text-2xl font-semibold leading-none tracking-tight", className)} {...props}/>));
8
- CardTitle.displayName = "CardTitle";
9
- const CardDescription = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props}/>));
10
- CardDescription.displayName = "CardDescription";
11
- const CardContent = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("p-6 pt-0", className)} {...props}/>));
12
- CardContent.displayName = "CardContent";
13
- const CardFooter = React.forwardRef(({ className, ...props }, ref) => (<div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props}/>));
14
- CardFooter.displayName = "CardFooter";
15
- export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
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 const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
14
- declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
- declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
- declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
- declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
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, };