import React from 'react'; export type ToastType = 'default' | 'info' | 'success' | 'warning' | 'error' | 'custom'; export type ToastPosition = | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center'; export type ToastLayout = 'stack' | 'normal'; export type RichColorsMode = 'soft' | 'solid' | 'minimal'; export type ToastSize = 'sm' | 'md' | 'lg'; export interface ToastAction { label: string; onClick: () => void; style?: 'default' | 'primary' | 'secondary' | 'danger'; className?: string; } export interface ToastInput { placeholder: string; onSubmit: (value: string) => void; submitClassName?: string; className?: string; } export type ToastPriority = 'low' | 'normal' | 'high'; export type ToastStatus = 'idle' | 'loading' | 'success' | 'error'; export interface ToastProps { id: string; content: React.ReactNode; description?: React.ReactNode; // Subtitle/description like Sonner type: ToastType; status?: ToastStatus; // For promise-based toasts duration?: number; icon?: React.ReactNode; actions?: ToastAction[]; input?: ToastInput; onClose?: () => void; onClick?: () => void; // Click to dismiss/action progress?: number; theme?: 'light' | 'dark' | 'custom'; customStyles?: React.CSSProperties; soundEffect?: string; className?: string; showCloseButton?: boolean; swipeClose?: boolean; showProgressBar?: boolean; priority?: ToastPriority; size?: ToastSize; expandable?: boolean; expanded?: boolean; groupId?: string; // For toast groups customComponent?: React.ComponentType<{ toast: ToastProps; dismiss: () => void }>; // Custom toast component unstyled?: boolean; // For completely custom styling invert?: boolean; // Invert colors cancel?: { label: string; onClick?: () => void; }; // Cancel action for promises } export interface ToastContextValue { addToast: (toast: Omit) => string; removeToast: (id: string) => void; updateToast: (id: string, updates: Partial>) => void; clearAllToasts: () => void; position: ToastPosition; setPosition: (position: ToastPosition) => void; layout: ToastLayout; setLayout: (layout: ToastLayout) => void; showCloseButton?: boolean; swipeDirection?: SwipeDirection; showProgressBar?: boolean; color?: boolean; richColors?: boolean | RichColorsMode; size?: ToastSize; } export interface ToastProviderProps { children?: React.ReactNode; // Optional - allows self-closing like Sonner // Support both naming conventions for flexibility position?: ToastPosition; // Preferred: simpler name like Sonner defaultPosition?: ToastPosition; // Legacy: for backward compatibility layout?: ToastLayout; // Preferred: simpler name like Sonner defaultLayout?: ToastLayout; // Legacy: for backward compatibility maxToasts?: number; containerClassName?: string; showCloseButton?: boolean; swipeDirection?: SwipeDirection; showProgressBar?: boolean; color?: boolean; duration?: number; // Preferred: simpler name like Sonner defaultDuration?: number; // Legacy: for backward compatibility expand?: boolean; // Enable expandable toasts richColors?: boolean | RichColorsMode; // true => minimal, or choose soft/solid/minimal size?: ToastSize; // Global toast size closeButton?: boolean; // Global close button setting gap?: number; // Gap between toasts offset?: string | number; // Offset from edge toastOptions?: Partial>; // Default options for all toasts theme?: 'light' | 'dark' | 'system'; } export interface ToastTheme { background: string; text: string; border: string; progressBar: string; } export interface ToastGroupOptions { groupId: string; groupTitle: string; } export type SwipeDirection = 'left' | 'right' | 'up' | 'down';