import * as React from 'react'; import { cva, type VariantProps } from '@/lib/cva'; import { cn } from '@/lib/utils'; const alertVariants = cva( cn( 'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm', 'has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3', '[&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current' ), { variants: { variant: { default: 'bg-card text-card-foreground', destructive: 'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90', success: 'bg-card text-success *:data-[slot=alert-description]:text-success/90', warning: 'bg-card text-warning *:data-[slot=alert-description]:text-warning/90', }, }, defaultVariants: { variant: 'default', }, } ); export interface AlertProps extends React.ComponentProps<'div'>, VariantProps {} /** * Inline message about the state of the page or a section of it. * * Carries `role="alert"`, so screen readers announce it as soon as it appears — * do not use it for static explanatory copy. */ function Alert({ className, variant, ...props }: AlertProps) { return (
); } function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) { return (
); } function AlertDescription({ className, ...props }: React.ComponentProps<'div'>) { return (
); } export { Alert, AlertTitle, AlertDescription, alertVariants };