diff --git a/packages/ui/report.api.md b/packages/ui/report.api.md index c80da62db9..db20cceff3 100644 --- a/packages/ui/report.api.md +++ b/packages/ui/report.api.md @@ -31,6 +31,7 @@ import type { MenuSectionProps as MenuSectionProps_2 } from 'react-aria-componen import type { MenuTriggerProps as MenuTriggerProps_2 } from 'react-aria-components'; import type { ModalOverlayProps } from 'react-aria-components'; import { PopoverProps as PopoverProps_2 } from 'react-aria-components'; +import type { QueuedToast } from 'react-stately'; import type { RadioGroupProps as RadioGroupProps_2 } from 'react-aria-components'; import type { RadioProps as RadioProps_2 } from 'react-aria-components'; import type { ReactElement } from 'react'; @@ -58,6 +59,7 @@ import type { ToggleButtonGroupProps as ToggleButtonGroupProps_2 } from 'react-a import type { ToggleButtonProps as ToggleButtonProps_2 } from 'react-aria-components'; import { TooltipProps as TooltipProps_2 } from 'react-aria-components'; import { TooltipTriggerComponentProps } from 'react-aria-components'; +import { UNSTABLE_ToastQueue } from 'react-aria-components'; // @public (undocumented) export const Accordion: ForwardRefExoticComponent< @@ -2179,6 +2181,88 @@ export type TextVariants = // @public (undocumented) export type TextWeights = 'regular' | 'bold'; +// @public +export const Toast: ForwardRefExoticComponent< + ToastProps & RefAttributes +>; + +// @public +export interface ToastContent { + description?: ReactNode; + icon?: boolean | ReactElement; + status?: 'info' | 'success' | 'warning' | 'danger'; + title: ReactNode; +} + +// @public +export const ToastDefinition: { + readonly styles: { + readonly [key: string]: string; + }; + readonly classNames: { + readonly root: 'bui-Toast'; + readonly content: 'bui-ToastContent'; + readonly title: 'bui-ToastTitle'; + readonly description: 'bui-ToastDescription'; + readonly icon: 'bui-ToastIcon'; + readonly closeButton: 'bui-ToastCloseButton'; + }; + readonly surface: 'container'; + readonly propDefs: { + readonly toast: {}; + readonly onSwipeEnd: {}; + readonly status: { + readonly dataAttribute: true; + }; + readonly icon: {}; + readonly surface: {}; + readonly className: {}; + readonly style: {}; + }; +}; + +// @public +export type ToastOwnProps = ContainerSurfaceProps & { + toast: QueuedToast; + onSwipeEnd?: () => void; + status?: Responsive<'info' | 'success' | 'warning' | 'danger'>; + icon?: boolean | ReactElement; +}; + +// @public +export interface ToastProps extends ToastOwnProps {} + +// @public +export const toastQueue: UNSTABLE_ToastQueue; + +// @public +export const ToastRegion: ForwardRefExoticComponent< + ToastRegionProps & RefAttributes +>; + +// @public +export const ToastRegionDefinition: { + readonly styles: { + readonly [key: string]: string; + }; + readonly classNames: { + readonly region: 'bui-ToastRegion'; + }; + readonly propDefs: { + readonly queue: {}; + readonly className: {}; + }; +}; + +// @public +export type ToastRegionOwnProps = { + queue: UNSTABLE_ToastQueue; + className?: string; +}; + +// @public +export interface ToastRegionProps extends ToastRegionOwnProps {} + // @public (undocumented) export const ToggleButton: ForwardRefExoticComponent< ToggleButtonProps & RefAttributes diff --git a/packages/ui/src/components/Toast/index.ts b/packages/ui/src/components/Toast/index.ts index 20788b1a0f..3ab960dbd5 100644 --- a/packages/ui/src/components/Toast/index.ts +++ b/packages/ui/src/components/Toast/index.ts @@ -18,4 +18,10 @@ export { Toast } from './Toast'; export { ToastRegion } from './ToastRegion'; export { ToastDefinition, ToastRegionDefinition } from './definition'; export { toastQueue } from './ToastQueue'; -export * from './types'; +export type { + ToastContent, + ToastOwnProps, + ToastProps, + ToastRegionOwnProps, + ToastRegionProps, +} from './types'; diff --git a/packages/ui/src/components/Toast/types.ts b/packages/ui/src/components/Toast/types.ts index fae8bd8e81..777daa3c37 100644 --- a/packages/ui/src/components/Toast/types.ts +++ b/packages/ui/src/components/Toast/types.ts @@ -36,7 +36,7 @@ export interface ToastContent { /** * Own props for the Toast component - * @internal + * @public */ export type ToastOwnProps = ContainerSurfaceProps & { /** Toast object from the queue */ @@ -51,7 +51,7 @@ export type ToastOwnProps = ContainerSurfaceProps & { /** * Properties for {@link Toast} - * @internal + * @public */ export interface ToastProps extends ToastOwnProps {}