import { RadiantElement } from '@ecopages/radiant'; import { type ToastId, type ToastPosition, type ToastVariant } from './toast-context'; /** Clears shared dismiss timers (test / Storybook resets). */ export declare function resetToastDeadlines(): void; export type RuiToastProps = { /** JSX list reconciliation key (not reflected to the DOM). */ key?: string | number; toastId?: ToastId; title?: string; description?: string; variant?: ToastVariant; duration?: number; dismissible?: boolean; closeButton?: boolean; actionLabel?: string; position?: ToastPosition; /** When true, plays the exit animation then removes the toast. */ markedDelete?: boolean; }; type RuiToastBindings = { title: string; description: string; variant: ToastVariant; actionLabel: string; closeButton: boolean; }; /** * `` — a single transient notification in a toaster stack. * * Prefer the imperative {@link toast} API with ``; this element is * rendered by the toaster and is not typically authored by hand. * * The composed surface is `role="status"` (live region) with a per-variant * border accent. `loading` toasts never auto-dismiss. * * @element rui-toast * * @attr {string} toast-id - Toast id; used for deadline bookkeeping. Default: `''`. * @attr {string} title - Heading text. Default: `''`. * @attr {string} description - Supporting detail under the title. Default: `''`. * @attr {('default'|'info'|'success'|'warning'|'error'|'loading')} variant - * Status tone; drives the icon and border accent. Default: `default`. * @attr {number} duration - Lifetime in ms before auto-dismiss. Default: `4000`. * @attr {boolean} dismissible - Allow close button / swipe-to-dismiss. Default: `true`. * @attr {boolean} close-button - Render the corner close control. Default: `false`. * @attr {string} action-label - Text for the optional action button. Default: `''`. * @attr {string} position - Placement; mirrors the toaster's position. Default: `bottom-end`. * @attr {boolean} marked-delete - Marks the toast for animated exit. Default: `false`. * * @fires rui-toast-mounted - Bubbles after the toast mounts and paints (enter * animation / timer start); the toaster uses it to resync stack layout. * * @remarks * Styling lives on the composed surface — BEM classes authored here, not on a * JSX view. Variants map to semantic status roles (`info`, `success`, `warning`, * `error`) in `toast.css`. * * **Why a custom element?** The toast owns dismiss lifetime bookkeeping (pause * on hover / hidden tab, swipe-to-dismiss), which needs DOM state — not a * presentational view. * * @cssclass rui-toast - Toast surface (`role="status"`). * @cssclass rui-toast--info - Info tone (blue accent). * @cssclass rui-toast--success - Success tone (green accent). * @cssclass rui-toast--warning - Warning tone (amber accent). * @cssclass rui-toast--error - Error tone (red accent). * @cssclass rui-toast--loading - Loading tone (neutral accent). * @cssclass rui-toast__icon - Status icon wrapper. * @cssclass rui-toast__loader - Spinner for `loading` toasts. * @cssclass rui-toast__content - Title + description column. * @cssclass rui-toast__title - Heading. * @cssclass rui-toast__description - Supporting detail. * @cssclass rui-toast__action - Optional action button. * @cssclass rui-toast__close - Corner close control. */ export declare class RuiToast extends RadiantElement { toastId: string; title: string; description: string; variant: ToastVariant; duration: number; dismissible: boolean; closeButton: boolean; actionLabel: string; position: ToastPosition; markedDelete: boolean; toastTarget: HTMLElement; private mounted; private removed; private swiping; private swipeOut; private swipeAxis; private swipeOutDirection; private held; private timerReady; private timeoutId; private pointerStart; private dragStartTime; private exitTimer; /** * Wire pointer listeners, then announce mount after paint so enter CSS can run. * * @remarks * `mounted` stays true across disconnect so list remounts skip the enter * animation (avoids an opacity flicker when siblings update). Timer state is * still reset on disconnect and restarted on reconnect / first paint. */ connectedCallback(): void; /** * Clear timers on unmount. Only purge shared state when this instance was exiting — * overflow toasts are intentionally unmounted while still queued. */ disconnectedCallback(): void; onContentUpdated(): void; onPositionUpdated(): void; /** * Hold or release auto-dismiss (toaster-controlled on stack hover). * * @remarks * Pause freezes leftover ms so wall-clock time during hover does not consume * the lifetime. Resume rebuilds the deadline from that remainder. */ setPaused(paused: boolean): void; onDurationUpdated(): void; onMarkedDeleteUpdated(): void; private get resolvedId(); private clearTimer; /** * Countdown to the toast's dismiss deadline. * * @remarks * Deadlines live in a module map keyed by toast id so list remounts (sibling * dismiss / re-render) resume leftover time instead of restarting `duration`. * Hover pause stores remaining ms separately and rebuilds the deadline on resume. */ private startTimer; private beginRemove; private onPointerDown; private onPointerMove; private onPointerUp; onCloseClick(event: Event): void; onActionClick(event: MouseEvent): void; private syncDomState; private iconForVariant; render(): import("@ecopages/jsx").JsxRenderable; } export {};