import * as React from 'react'; import { type ExternalToast, toast as sonnerToast, type ToasterProps } from 'sonner'; import { type AvatarProps } from '../../data/Avatar/index.js'; declare function Toaster({ theme, dir, className, toastOptions, ...props }: ToasterProps): React.JSX.Element; declare namespace Toaster { var displayName: string; } interface ToastContentProps { title: string; description?: string; icon?: React.ReactNode; action?: { label: string; onClick: () => void; }; className?: string; } declare function ToastContent({ title, description, icon, action, className, }: ToastContentProps): React.JSX.Element; declare namespace ToastContent { var displayName: string; } type SonnerItemVariant = 'primary' | 'success' | 'warning' | 'error' | 'gray' | 'avatar' | 'image' | 'progress' | 'none'; interface SonnerItemAction { label: string; onClick?: () => void; } export interface SonnerItemProps extends Omit, 'title'> { /** Toast ID from Sonner - used to dismiss the toast */ toastId: string | number; /** Visual style variant */ variant?: SonnerItemVariant; /** Notification title */ title: string; /** Supporting description text */ supportingText?: string; /** Show the close button */ showCloseButton?: boolean; /** Primary action */ primaryAction?: SonnerItemAction; /** Secondary action */ secondaryAction?: SonnerItemAction; /** Custom icon for gray/none/progress variants */ icon?: React.ReactNode; /** Avatar props for avatar variant */ avatarProps?: AvatarProps; /** Timestamp for avatar variant */ timestamp?: string; /** Image source for image variant */ imageSrc?: string; /** Image alt text */ imageAlt?: string; /** Progress value for progress variant */ progressValue?: number; /** Progress label for progress variant */ progressLabel?: string; /** Stack action buttons vertically */ stackedActions?: boolean; } /** * SonnerItem - Advanced toast layout for use with Sonner custom toasts. * * Usage: * ```tsx * toast.custom((t) => ( * * )); * ``` */ declare function SonnerItem({ toastId, variant, title, supportingText, showCloseButton, primaryAction, secondaryAction, icon, avatarProps, timestamp, imageSrc, imageAlt, progressValue, progressLabel, stackedActions, className, ...props }: SonnerItemProps): React.JSX.Element; declare namespace SonnerItem { var displayName: string; } export interface ToastOptions { /** Supporting description text */ description?: string; /** Duration in milliseconds before auto-dismiss. Set to Infinity to disable. */ duration?: number; /** Toast ID for programmatic control */ id?: string | number; /** Callback when toast is dismissed */ onDismiss?: () => void; /** Callback when toast auto-closes */ onAutoClose?: () => void; /** Action button displayed on the right */ action?: { label: string; onClick: () => void; }; } type ToastMessage = string | { title: string; description?: string; }; /** * Lightweight toast notification API. * * @example * ```tsx * // Simple usage * toast('Changes saved'); * toast.success('File uploaded successfully'); * toast.error('Failed to save changes'); * * // With description * toast.success({ * title: 'File uploaded', * description: 'document.pdf has been uploaded successfully.' * }); * * // With action button * toast.error('Something went wrong', { * action: { label: 'Try Again', onClick: () => {} }, * }); * ``` */ declare function toast(message: ToastMessage, options?: ToastOptions): string | number; declare namespace toast { var success: (message: ToastMessage, options?: ToastOptions) => string | number; var error: (message: ToastMessage, options?: ToastOptions) => string | number; var warning: (message: ToastMessage, options?: ToastOptions) => string | number; var info: (message: ToastMessage, options?: ToastOptions) => string | number; var loading: (message: ToastMessage, options?: ToastOptions) => string | number; var promise: (promise: Promise | (() => Promise), messages: { loading: ToastMessage; success: ToastMessage | ((data: T) => ToastMessage); error: ToastMessage | ((error: unknown) => ToastMessage); }, options?: ToastOptions) => string | number; var dismiss: (id?: number | string) => string | number; var custom: (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => string | number; } export type { ToastContentProps, ToasterProps, ToastMessage }; export { SonnerItem, sonnerToast, ToastContent, Toaster, toast };