import { type ComponentPropsWithoutRef, type ReactNode, type ReactElement } from 'react'; import { type ToastSlotRecipeVariant } from '../../styled-system/recipes'; export type ToastProps = { /** * The type of the toast message. * * @default 'success' */ type?: ToastSlotRecipeVariant['type']; /** * The message to be displayed in the toast. */ message: ReactNode; /** * The callback function to be called when the toast is closed. * * @default undefined */ onClose?: () => void; /** * The action slot of the toast message. It can be a button or any other element. * It will be displayed on the right side of the toast message. * * @default undefined */ actionSlot?: ReactNode; /** * The properties for the status icon. * If this prop is not passed, the default values for each property will be applied. * * @property aria-label - The alternative text for the status icon. * Default is as follows: * - 'success' type: '完了' * - 'failure' type: '失敗' * - 'busy' type: '進行中' */ statusIconProps?: Pick, 'aria-label'>; /** * The properties for the close button. * If this prop is not passed, the default values for each property will be applied. * * @property aria-label - The alternative text for the close button. default is '閉じる'. */ closeButtonProps?: Pick, 'aria-label'>; /** * The duration of the toast message in milliseconds: * - If the duration is not provided or under `5000`, the toast message will be displayed until it's closed via the close button. * - If the duration is greater than or equal `5000`, the toast will be auto-closed. * * @default undefined */ duration?: number; /** * The active element in the document which has the focus. * Used to detect focus state on the toast or its content. */ activeElement?: Element | null; /** * Custom icon to be displayed in the toast. * If this prop is not passed, the default icon for the type will be used. * * @default undefined */ customIcon?: ReactElement; /** * Whether to enable the close button. * When false, the close button will be disabled (non-interactive). * * @default true */ showCloseButton?: boolean; } & ComponentPropsWithoutRef<'div'>;