import type { IntentName } from "@charcuterie/tokens"; import type { ReactNode } from "react"; export type ToastProps = { /** Detail under the title. Optional — many toasts are one line. */ children?: ReactNode; className?: string; /** * Milliseconds at `visible` before it starts leaving. `0` pins it * open, which is what a toast carrying an action has to do — WCAG * 2.2.1 gives a user the right to finish reading. */ duration?: number; /** How long `exiting` lasts, matched to the transition below. */ exitDuration?: number; intent?: IntentName; /** Called once, when the machine reaches its terminal state. */ onRemove: () => void; /** * A string, not a `ReactNode`. It is what the region announces and * what names this toast's own dismiss button — a stack of three * toasts all offering "Dismiss" is three matches for one query, * which `expectAgentDrivable` treats as a failure. */ title: string; }; /** * One toast, and its whole job is the four-state machine the plan * specified and M2 left unbuilt. * * ### Why a `Status`, when a boolean and a timeout would do * * Because a boolean cannot express *why* the node is still mounted. * A toast that is leaving is still painted, still occupies its slot, * and must not be announced again — and `isVisible === false` says * none of that. The states are what a reader needs to know the * difference between "arriving", "leaving", and "gone but not yet * unmounted", and `createStatus` makes the illegal ones throw: * `visible → removed` skips the exit and is rejected, and `removed` * is terminal so a late timer cannot remove the same toast twice. * * That last one is not hypothetical. Hover-to-pause plus a dismiss * button means two independent timers can be in flight, and the * hand-rolled version of this component reconciles them with a * `clearTimeout` and a ref. Here the second one throws. * * ### It does not announce itself * * No `role="status"` and no `aria-live` on this element — the * `ToastRegion` around it owns that, and a live region inside a live * region is a message announced twice. See that component for the * reason there is only ever one, and it is polite. */ export declare const Toast: ({ children, className, duration, exitDuration, intent, onRemove, title, }: ToastProps) => ReactNode; //# sourceMappingURL=Toast.d.ts.map