import { AriaToastProps, AriaToastRegionProps } from 'react-aria/useToast'; import { ClassNameOrFunction, ContextValue, DOMRenderProps, RenderProps, StyleRenderProps } from './utils'; import { GlobalDOMAttributes } from '@react-types/shared'; import { QueuedToast, ToastQueue, ToastState } from 'react-stately/useToastState'; import React, { HTMLAttributes, ReactElement, ReactNode } from 'react'; declare const ToastStateContext: React.Context | null>; export interface ToastRegionRenderProps { /** A list of all currently visible toasts. */ visibleToasts: QueuedToast[]; /** * Whether the toast region is currently hovered with a mouse. * @selector [data-hovered] */ isHovered: boolean; /** * Whether the toast region is currently focused. * @selector [data-focused] */ isFocused: boolean; /** * Whether the toast region is keyboard focused. * @selector [data-focus-visible] */ isFocusVisible: boolean; } export interface ToastRegionProps extends AriaToastRegionProps, StyleRenderProps>, GlobalDOMAttributes { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. * @default 'react-aria-ToastRegion' */ className?: ClassNameOrFunction>; /** The queue of toasts to display. */ queue: ToastQueue; /** A function to render each toast, or children containing a ``. */ children: ReactNode | ((renderProps: { toast: QueuedToast; }) => ReactElement); } /** * A ToastRegion displays one or more toast notifications. */ declare const ToastRegion: (props: ToastRegionProps & React.RefAttributes) => ReactElement> | null; export interface ToastListProps extends Omit, 'queue' | 'children' | 'render'>, DOMRenderProps<'ol', ToastRegionRenderProps> { /** A function to render each toast. */ children: (renderProps: { toast: QueuedToast; }) => ReactElement; } declare const ToastList: (props: ToastListProps & React.RefAttributes) => ReactElement> | null; export interface ToastRenderProps { /** * The toast object to display. */ toast: QueuedToast; /** * Whether the toast is currently focused. * @selector [data-focused] */ isFocused: boolean; /** * Whether the toast is keyboard focused. * @selector [data-focus-visible] */ isFocusVisible: boolean; } export interface ToastProps extends AriaToastProps, RenderProps>, GlobalDOMAttributes { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. * @default 'react-aria-Toast' */ className?: ClassNameOrFunction>; } /** * A Toast displays a brief, temporary notification of actions, errors, or other events in an application. */ declare const Toast: (props: ToastProps & React.RefAttributes) => ReactElement> | null; export interface ToastContentProps extends HTMLAttributes, DOMRenderProps<'div', undefined> { } export declare const ToastContentContext: React.Context, HTMLDivElement>>; /** * ToastContent wraps the main content of a toast notification. */ export declare const ToastContent: React.ForwardRefExoticComponent>; export { Toast as UNSTABLE_Toast, ToastList as UNSTABLE_ToastList, ToastRegion as UNSTABLE_ToastRegion, ToastContent as UNSTABLE_ToastContent, ToastStateContext as UNSTABLE_ToastStateContext };