import { forwardRef } from "react"; import { alertDescriptionVariants, alertIconVariants, alertTitleVariants, alertVariants } from "./alert.variants"; import { cn } from "../lib/cn"; import type { VariantProps } from "../lib/cva"; import { createDataAttributes, createSlot } from "../lib/contracts"; export type AlertProps = React.ComponentPropsWithoutRef<"div"> & VariantProps & { icon?: React.ReactNode; }; export const Alert = forwardRef(function Alert( { children, className, icon, variant = "default", ...props }, ref ) { const hasIcon = Boolean(icon); return (
{hasIcon ? {icon} : null} {children}
); }); export type AlertTitleProps = React.ComponentPropsWithoutRef<"h4">; export const AlertTitle = forwardRef(function AlertTitle( { className, ...props }, ref ) { return (

); }); export type AlertDescriptionProps = React.ComponentPropsWithoutRef<"div">; export const AlertDescription = forwardRef( function AlertDescription({ className, ...props }, ref) { return (
); } );