import React from 'react'; import { ThemeOverrideProps } from '@xsolla/xui-core'; import { ButtonProps, IconButtonProps } from '@xsolla/xui-button'; type ToastType = "alert" | "success" | "warning" | "info"; type ToastActionElement = React.ReactElement; interface ToastProps extends ThemeOverrideProps { /** Visual variant/tone of the toast */ type?: ToastType; /** Title text (required for accessibility) */ title?: string; /** Optional description text shown beneath the title */ description?: string; /** * Action element (Button/IconButton). The toast will inject * `size="xs"`, `variant="tertiary"`, and a tone matching the toast type. */ action?: React.ReactElement; /** Show/hide close button */ showCloseButton?: boolean; /** Close button click handler */ onClose?: () => void; testID?: string; } declare const Toast: React.FC; type ToastPosition = "top-right" | "top-left" | "top-center" | "bottom-right" | "bottom-left" | "bottom-center"; type ToastVariant = "default" | "sonner"; interface ToastOptions extends Omit { /** * Auto-dismiss duration in ms. Pass 0 to disable auto-dismiss. * Defaults derived from `type`: success 4500, info/warning 6500, alert 9000. */ duration?: number; /** Stable id — if provided and a toast with that id already exists, it's replaced. */ id?: string; /** Called when the toast is dismissed (auto or manual). */ onDismiss?: () => void; } interface ToastQueueItem extends ToastOptions { id: string; type: ToastType; createdAt: number; } interface ToastApi { alert: (options: ToastOptions) => string; success: (options: ToastOptions) => string; warning: (options: ToastOptions) => string; info: (options: ToastOptions) => string; show: (type: ToastType, options: ToastOptions) => string; dismiss: (id: string) => void; dismissAll: () => void; } interface ToastProviderProps { children: React.ReactNode; /** Where toasts appear on screen. Defaults to top-right. */ position?: ToastPosition; /** Maximum number of simultaneously visible toasts. Defaults to 3. */ limit?: number; /** DOM node to portal the viewport into. Defaults to document.body. */ container?: HTMLElement | null; /** * Enable enter & exit animations. Defaults to `true`. * When `false`, toasts appear and disappear instantly. */ animated?: boolean; /** Animation duration in ms. Defaults to 220 (default variant) / 400 (sonner). */ animationDuration?: number; /** * Visual variant. * - `"default"` — toasts slide in from the edge and stack vertically. * - `"sonner"` — shadcn/sonner-style stacked-cards: toasts overlap as a deck * with back cards scaled & peeking; hovering the stack expands it. */ variant?: ToastVariant; testID?: string; } declare const ToastProvider: React.FC; declare const useToast: () => ToastApi; export { Toast, type ToastActionElement, type ToastApi, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastQueueItem, type ToastType, type ToastVariant, useToast };