import type React from 'react'; import type { DismissDetail } from './types.js'; export interface ToastRef extends HTMLElement { /** Dismisses the toast with exit animation. */ dismiss(): void; } /** * Created imperatively in most cases — the CE appears in DOM, auto-dismisses on timeout. * Use `dismissible` to show a close button. `onDismiss` fires when dismissed. * Position is controlled by the container, not the toast itself. * * In React, reach the imperative methods through a ref: * `const api = useRef(null)`, pass `ref={api}`, then `api.current?.dismiss()`. * Available: dismiss(). * * @csspart base, content */ export interface ToastOwnProps { /** * Unique identifier for the element. * @example 'example-id' */ id?: string; /** * Title text. * @example 'Example title' */ title?: string; /** * Secondary descriptive text rendered inside Shadow DOM. Not the same as React children — use the `description` prop for helper text. * @example 'Additional context' */ description?: string; /** * Visual style variant. Allowed values: `subtle`, `filled`, `outline`. * @example 'subtle' */ variant?: 'subtle' | 'filled' | 'outline'; /** * Semantic color intent (e.g. primary, success, danger). Allowed values: `neutral`, `primary`, `info`, `success`, `warning`, `danger`. * @example 'neutral' */ intent?: 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger'; /** * Component size. Allowed values: `xs`, `sm`, `md`, `lg`, `xl`. * @example 'xs' */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * Whether to display the intent icon. * @defaultValue true * @example true */ showIcon?: boolean; /** * Icon name to display. * @example 'example' */ icon?: string; /** * Whether the component can be dismissed by the user. * @defaultValue true * @example true */ dismissible?: boolean; /** * Accessible label for the dismiss/close button. * @example 'example' */ dismissLabel?: string; /** * Auto-dismiss delay in milliseconds (default: 4250). Set to 0 for persistent toasts. * @defaultValue 4250 * @example 300 */ duration?: number; /** * Fires when the user dismisses the component. Detail: `DismissDetail`. * @example (event) => console.log(event.detail) */ onDismiss?: (event: CustomEvent) => void; /** Content for the `action` slot. * @example Content */ action?: React.ReactNode; /** CSS class applied to the Custom Element host. * @example 'my-component' */ className?: string; /** Inline styles applied to the Custom Element host. * @example { marginTop: 8 } */ style?: React.CSSProperties; } /** * Props for ``: the component's own API plus every standard DOM * attribute and native React event handler, forwarded verbatim to the * `` host — `id`, `data-*`, `aria-*`, `title`, `tabIndex`, * `slot`, `onMouseEnter`, and the rest. Own props always win over a * same-named DOM attribute. */ export type ToastProps = ToastOwnProps & Omit, keyof ToastOwnProps | 'children' | 'dangerouslySetInnerHTML'>; export declare const Toast: React.ForwardRefExoticComponent, "children" | "dangerouslySetInnerHTML" | keyof ToastOwnProps> & React.RefAttributes>;