UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

49 lines (48 loc) 2.02 kB
import React from "react"; import { TagProps } from "../../__internal__/utils/helpers/tags/tags"; /** * @deprecated `Toast` has been deprecated. See the Carbon documentation for migration details. */ type ToastVariants = "error" | "info" | "success" | "warning" | "notice" | "neutral" | "notification"; /** * @deprecated `Toast` has been deprecated. See the Carbon documentation for migration details. */ type AlignOptions = "left" | "center" | "right"; /** * @deprecated `Toast` has been deprecated. See the Carbon documentation for migration details. */ type AlignYOptions = "top" | "center" | "bottom"; /** * @deprecated `Toast` has been deprecated. See the Carbon documentation for migration details. */ export interface ToastProps extends TagProps { /** Sets the horizontal alignment of the component. */ align?: AlignOptions; /** Sets the vertical alignment of the component */ alignY?: AlignYOptions; /** The rendered children of the component. */ children: React.ReactNode; /** Sets Toast variant */ variant?: ToastVariants; /** Custom id */ id?: string; /** Determines if the Toast is open. */ open?: boolean; /** Callback for when dismissed. */ onDismiss?: (ev?: KeyboardEvent | React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void; /** Data tag prop bag for close Button */ closeButtonDataProps?: Pick<TagProps, "data-role" | "data-element">; /** Time for Toast to remain on screen */ timeout?: string | number; /** Target Portal ID where the Toast will render */ targetPortalId?: string; /** Maximum toast width */ maxWidth?: string; /** Disables auto focus functionality when the Toast has a close icon */ disableAutoFocus?: boolean; } /** * @deprecated `Toast` has been deprecated. See the Carbon documentation for migration details. */ export declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>; export default Toast;