import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const alertVariants = cva( [ "relative w-full text-sm border has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] grid-cols-[0_1fr] grid gap-y-0.5 items-center [&>svg:not([class*=size-])]:size-4", "has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3", "has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start", "has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5", "rounded-lg", "px-3", "py-2.5", "has-[>svg]:gap-x-2.5", ], { variants: { variant: { default: "bg-card text-card-foreground", destructive: "border-destructive/30 bg-destructive/4 [&>svg]:text-destructive", info: "border-info/30 bg-info/4 [&>svg]:text-info", success: "border-success/30 bg-success/4 [&>svg]:text-success", warning: "border-warning/30 bg-warning/4 [&>svg]:text-warning", invert: "border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70", }, }, defaultVariants: { variant: "default", }, } ) function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps) { return (
) } function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { return (
) } function AlertDescription({ className, ...props }: React.ComponentProps<"div">) { return (
) } function AlertAction({ className, ...props }: React.ComponentProps<"div">) { return (
) } export { Alert, AlertTitle, AlertDescription, AlertAction }