import { cva } from "class-variance-authority"; import * as React from "react"; import { View } from "react-native"; import { cn } from "@turbostarter/ui"; import { Text, TextClassContext } from "./text"; import type { Icon } from "./icons"; import type { VariantProps } from "class-variance-authority"; import type { ViewProps } from "react-native"; const alertVariants = cva( "bg-card border-border relative w-full rounded-lg border px-4 pt-3.5 pb-2", { variants: { variant: { default: "bg-card border-border", destructive: "border-destructive/20 bg-destructive/5", primary: "border-primary/20 bg-primary/5", success: "border-success/20 bg-success/5", }, }, defaultVariants: { variant: "default", }, }, ); const alertTextVariants = cva("text-sm", { variants: { variant: { default: "text-foreground", destructive: "text-destructive", primary: "text-primary", success: "text-success", }, }, defaultVariants: { variant: "default", }, }); const alertDescriptionVariants = cva("ml-0.5 pb-1.5 pl-6 text-sm", { variants: { variant: { default: "text-muted-foreground", destructive: "text-destructive/90", primary: "text-primary/90", success: "text-success/90", }, }, defaultVariants: { variant: "default", }, }); const AlertContext = React.createContext["variant"]>(null); function Alert({ className, variant, children, icon: Icon, iconClassName, ...props }: ViewProps & React.RefAttributes & VariantProps & { icon?: Icon; iconClassName?: string; }) { return ( {Icon && ( )} {children} ); } function AlertTitle({ className, ...props }: React.ComponentProps & React.RefAttributes) { return ( ); } function AlertDescription({ className, ...props }: React.ComponentProps & React.RefAttributes) { const variant = React.useContext(AlertContext); return ( ); } export { Alert, AlertDescription, AlertTitle };