"use client"; import * as React from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { X, CheckCircle, AlertCircle, AlertTriangle, Info } from "lucide-react"; import { cn } from "@/lib/utils"; const toastVariants = cva( "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", { variants: { variant: { default: "border bg-background text-foreground", destructive: "destructive border-destructive bg-destructive text-destructive-foreground", success: "border-green-200 bg-green-50 text-green-900", warning: "border-yellow-200 bg-yellow-50 text-yellow-900", info: "border-blue-200 bg-blue-50 text-blue-900", }, }, defaultVariants: { variant: "default", }, } ); const Toast = React.forwardRef< HTMLDivElement, React.HTMLAttributes & VariantProps >(({ className, variant, ...props }, ref) => { return (
); }); Toast.displayName = "Toast"; const ToastAction = React.forwardRef< HTMLButtonElement, React.ButtonHTMLAttributes >(({ className, ...props }, ref) => ( )); ToastClose.displayName = "ToastClose"; const ToastTitle = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); ToastTitle.displayName = "ToastTitle"; const ToastDescription = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); ToastDescription.displayName = "ToastDescription"; const ToastViewport = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); ToastViewport.displayName = "ToastViewport"; const ToastProvider = ({ children }: { children: React.ReactNode }) => { return <>{children}; }; ToastProvider.displayName = "ToastProvider"; export { Toast, ToastAction, ToastClose, ToastTitle, ToastDescription, ToastViewport, ToastProvider }; export type ToastProps = React.ComponentPropsWithoutRef; export type ToastActionElement = React.ReactElement;