import type { EventEmitter } from '../../stencil-public-runtime'; import { type IconName } from '../mud-icon/mud-icon.types'; import type { LocaleProp } from '../../utils/locale'; import type { ToastVariant } from './mud-toast.types'; /** * Toast — semantic toast message (350px filled surface, 8px radius). * * Matches the Figma `toast` component (page "Messaging (Notification)"): * a leading icon, an optional bold heading, the message body (default slot), * an optional inline link/action group (`actions` slot) and a trailing close * button (shown by default — `closable` defaults to `true`). * * Placement, vertical stacking and auto-dismiss are the consumer's * responsibility — this atom is just the surface. Its entrance animation * (slide-down + fade-in) plays once on mount; closing it fades it out in * place before `mudClose` fires (Figma Behavior › dismissal). * * Pattern B (atom-display + interactive close): the close affordance lives * inside shadow DOM so it participates in tab order with a real * `button` role. The body itself is not interactive. * * `variant` selects the semantic color family — `info`, `warning`, `success`, * or `error` — each a filled toast surface with its own leading icon. * * Live-region routing: * - `info` / `success` → `role="status"` + `aria-live="polite"` * - `warning` / `error` → `role="alert"` + `aria-live="assertive"` * * Set the native `aria-label` attribute on the host for an explicit accessible * name when the body content alone is not descriptive enough. * * @element mud-toast * * @slot - (default) The message body. Plain text or rich inline content. * @slot icon-start - Optional override for the leading icon. When supplied, * suppresses both the `iconName` prop and the per-variant * default icon. * @slot actions - Optional inline action group (typically `mud-button` or * `mud-link`). Renders as its own line below the heading/body * stack (Figma `toast` `w/ heading: link` variant). */ export declare class MudToast { /** * Semantic color family. * @default 'info' */ variant: ToastVariant; /** * Renders a trailing close button. Activating it emits `mudClose`; the * consumer is responsible for removing the toast from the DOM. Defaults to * `true` per the Figma `toast` component (`Close = true`); set * `closable="false"` for a toast the user cannot dismiss manually (e.g. one * that only auto-dismisses). * @default true */ closable: boolean; /** * Optional bold title rendered above the body. */ titleText?: string; /** * Override the default `mud-icon` name for the variant (e.g. swap * `circle-info` for a custom glyph). When the `icon-start` slot * is populated, this prop is ignored. */ iconName?: IconName; /** * Language of the built-in copy. Unset, the component follows the closest ancestor `lang` * (`` included), else `ro-MD`. */ locale?: LocaleProp; /** * Close-button accessible label. Overrides the `locale`'s copy when set to a non-empty string. * @default 'Închide' (ro-MD) */ closeLabel?: string; private hasIconStart; private hasActions; private dismissing; host: HTMLMudToastElement; /** * Fires once the close fade-out has finished (at once under * `prefers-reduced-motion`). Payload is `void` — the consumer removes the * toast from the DOM. */ mudClose: EventEmitter; private dismissTimer?; private stopLang?; /** Ends the close fade-out; the entrance animation ends here too and is ignored. */ onAnimationEnd(ev: AnimationEvent): void; connectedCallback(): void; componentWillLoad(): void; disconnectedCallback(): void; /** * Built-in strings in the resolved locale, with the override props on top. */ private messages; private detectSlots; private onIconSlotChange; private onActionsSlotChange; private handleCloseClick; private handleCloseKeyDown; /** Fades the toast out, then emits `mudClose`; a second close is ignored. */ private dismiss; private finishDismiss; private resolveIconName; private resolveAriaRole; private resolveAriaLive; render(): any; }