import React from 'react'; export type ToastIntent = 'neutral' | 'primary' | 'success' | 'warning' | 'error' | 'information'; export type ToastPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; export interface ToastOptions { intent?: ToastIntent; title?: React.ReactNode; message?: React.ReactNode; /** One action. A second choice belongs in a dialog, which will still be there. */ action?: { label: string; onPress: () => void; }; /** Milliseconds before auto-dismiss. `null` keeps it until dismissed. */ duration?: number | null; dismissLabel?: string; } export interface ToastItem extends ToastOptions { id: string; } export interface ToastProps extends ToastItem { onDismiss: (id: string) => void; } /** * Toast — Figma `Toast` (820:1655). * * Neutral chrome on `surface/raised`; the intent is carried by the icon alone. * A tinted panel floating over unknown content competes with whatever is * behind it, and makes Toast and Alert indistinguishable at a glance. * * AUTO-DISMISS PAUSES ON HOVER AND FOCUS. A toast that keeps counting down * while being read or while its action has keyboard focus takes the action * away mid-reach — WCAG 2.2.1 asks for exactly this. The timer restarts rather * than resumes, which is the forgiving direction. */ export declare const Toast: React.ForwardRefExoticComponent>; interface ToastContextValue { toast: (options: ToastOptions) => string; dismiss: (id: string) => void; } export interface ToastProviderProps { children?: React.ReactNode; /** Where the stack sits. Not a Figma variant — position is the queue's concern. */ placement?: ToastPlacement; /** Oldest are dropped past this. Prevents an unbounded stack covering the page. */ limit?: number; /** * The live region's accessible name. The region is a landmark, and landmark * names must be unique on a page: an app with its own section called * "Notifications" fails axe `landmark-unique` on every page that has one * unless this is changed. */ label?: string; } /** * Renders the queue and supplies `useToast`. * * The live region is the CONTAINER, declared once and always present. A region * that appears at the same moment as its content is not reliably announced — * assistive tech has to be watching the node before the text lands in it. */ export declare function ToastProvider({ children, placement, limit, label, }: ToastProviderProps): React.JSX.Element; export declare function useToast(): ToastContextValue; export {}; //# sourceMappingURL=Toast.d.ts.map