import { HtmlHTMLAttributes } from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; import { Text } from "@/components/retroui/Text"; const alertVariants = cva("relative w-full rounded border-2 p-4", { variants: { variant: { default: "bg-background text-foreground [&_svg]:shrink-0", solid: "bg-black text-white", }, status: { error: "bg-red-300 text-red-800 border-red-800", success: "bg-green-300 text-green-800 border-green-800", warning: "bg-yellow-300 text-yellow-800 border-yellow-800", info: "bg-blue-300 text-blue-800 border-blue-800", }, }, defaultVariants: { variant: "default", }, }); interface IAlertProps extends HtmlHTMLAttributes, VariantProps {} const Alert = ({ className, variant, status, ...props }: IAlertProps) => (
); Alert.displayName = "Alert"; interface IAlertTitleProps extends HtmlHTMLAttributes {} const AlertTitle = ({ className, ...props }: IAlertTitleProps) => ( ); AlertTitle.displayName = "AlertTitle"; interface IAlertDescriptionProps extends HtmlHTMLAttributes {} const AlertDescription = ({ className, ...props }: IAlertDescriptionProps) => (
); AlertDescription.displayName = "AlertDescription"; const AlertComponent = Object.assign(Alert, { Title: AlertTitle, Description: AlertDescription, }); export { AlertComponent as Alert };