import { ElementType, ReactNode, Ref } from 'react';
import { Color } from '../types.js';
import { SurfaceVariant } from './Surface.js';
export interface ToastRootProps {
/** Trigger + toast (+ optional close) elements. */
children: ReactNode;
/** Initial open state (uncontrolled). Default `false`. Ignored when `open` is provided. */
defaultOpen?: boolean;
/** Controlled open state. When provided, internal state is bypassed. */
open?: boolean;
/** Fires whenever the open state should change (trigger click, close button, auto-timeout). */
onOpenChange?: (open: boolean) => void;
}
/**
* State container for the `Toast` + `ToastTrigger` + `Toast` compound. Less commonly used than
* the imperative `useToasts()` portal API - prefer the portal for app-wide notifications and
* use this only when you need a toast tied to a specific trigger element in JSX.
*/
export declare const ToastRoot: ({ children, defaultOpen, open: openProp, onOpenChange, }: ToastRootProps) => import("react/jsx-runtime").JSX.Element;
export interface ToastTriggerProps {
/** Single React element to clone as the trigger. Must accept `onClick`. */
children: ReactNode;
}
/**
* Wraps a single child element to act as the toast trigger. **Clones** the child to attach an `onClick` handler that toggles the surrounding `ToastRoot`'s open state (composed with any existing `onClick` on the child).
*
* No-ops (renders the child as-is) when used outside a `ToastRoot`.
*/
export declare const ToastTrigger: ({ children }: ToastTriggerProps) => import("react/jsx-runtime").JSX.Element;
export interface ToastCloseProps {
/** Single React element to clone as the close affordance. Must accept `onClick`. */
children: ReactNode;
}
/**
* Wraps a single child element to close the surrounding toast when clicked. **Clones** the child to attach an `onClick` handler that flips the surrounding `ToastRoot`'s open state to `false` (composed with any existing `onClick` on the child).
*
* ```tsx
*
*
*
*
*
*
* ```
*
* No-ops (renders the child as-is) when used outside a `ToastRoot`.
*/
export declare const ToastClose: ({ children }: ToastCloseProps) => import("react/jsx-runtime").JSX.Element;
export interface ToastProps {
/** Controlled open state. When omitted, falls back to the surrounding `ToastRoot` state, then `false`. */
open?: boolean;
/** Fires whenever the open state should change (close button, auto-timeout, etc.). */
onOpenChange?: (open: boolean) => void;
/** Portal target selector. Default `'#app, #__next, #root'`. */
root?: string;
/** Fires after the close transition completes - use for unmount or post-dismiss cleanup. */
onClosed?: () => void;
/** Extra classes applied to the toast root `Surface`. */
className?: string;
/** Title slot. Rendered as a bold line above `text`. */
title?: ReactNode;
/** Body text slot. Rendered as a smaller line under `title`. */
text?: ReactNode;
/** Icon component rendered before the text content. Receives `iconProps`. */
icon?: ElementType;
/** Props forwarded to the `icon` component. */
iconProps?: Record;
/** Stop click propagation on the toast surface. Use when the toast renders inside a clickable parent. */
stopPropagationOnClick?: boolean;
/** Render the auto close button on the right. Default `true`. */
closeButton?: boolean;
/**
* Forwarded to the underlying `Surface` as `level`.
*
* Default depends on theme: `3` for dark theme, `1` for light theme - keeps the toast visually elevated above page content.
*/
surfaceLevel?: string | number;
/** Default `'neutral'`. */
color?: Color;
/** Surface variant. Default `'gradient'`. */
variant?: SurfaceVariant;
/** Outline ring on the toast surface. Default `true`. */
outline?: boolean;
/** Auto-close after this many ms. Pass `0` to disable auto-close. Default `5000`. */
timeout?: number;
/** Forwarded to the toast surface root. */
ref?: Ref;
/** Custom content rendered after the title/text block, before the close button. */
children?: ReactNode;
}
/** Shape of `Toast` defaults that can be supplied via `CladdProvider`'s `defaults` prop. */
export type ToastDefaultProps = Partial>;
export declare const Toast: (props: ToastProps) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=Toast.d.ts.map