import * as React from 'react' import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const alertVariants = cva( 'relative grid w-full items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm', { variants: { variant: { default: 'border-border-tertiary bg-bg-container text-text [&>svg]:text-text-secondary', info: 'border-info-border bg-info-bg text-text [&>svg]:text-info', success: 'border-success-border bg-success-bg text-text [&>svg]:text-success', warning: 'border-warning-border bg-warning-bg text-text [&>svg]:text-warning', destructive: 'border-error-border bg-error-bg text-text [&>svg]:text-error', }, }, defaultVariants: { variant: 'default' }, }, ) export interface AlertProps extends React.HTMLAttributes, VariantProps {} const Alert = React.forwardRef( ({ className, variant, ...props }, ref) => (
svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-3', '[&>svg]:size-4 [&>svg]:translate-y-0.5', className, )} {...props} /> ), ) Alert.displayName = 'Alert' const AlertTitle = React.forwardRef>( ({ className, ...props }, ref) => (
), ) AlertTitle.displayName = 'AlertTitle' const AlertDescription = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)) AlertDescription.displayName = 'AlertDescription' export type AlertTitleProps = React.HTMLAttributes export type AlertDescriptionProps = React.HTMLAttributes export { Alert, AlertTitle, AlertDescription, alertVariants }