import type { ReactElement, HTMLAttributes, Ref } from "react"; import type SlAlertElement from "@shoelace-style/shoelace/dist/components/alert/alert.js"; import { SlShowEvent, SlAfterShowEvent, SlHideEvent, SlAfterHideEvent, } from "../events"; export type { SlAlertElement }; export type SlAlertShowEvent = SlShowEvent; export type SlAlertAfterShowEvent = SlAfterShowEvent; export type SlAlertHideEvent = SlHideEvent; export type SlAlertAfterHideEvent = SlAfterHideEvent; export interface SlAlertProps extends HTMLAttributes { ref?: Ref; /** * Indicates whether or not the alert is open. You can toggle this attribute to show and hide the alert, or you can * use the `show()` and `hide()` methods and this attribute will reflect the alert's open state. */ open?: boolean; /** * Enables a close button that allows the user to dismiss the alert. */ closable?: boolean; /** * The alert's theme variant. */ variant?: "primary" | "success" | "neutral" | "warning" | "danger"; /** * The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with * the alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`, meaning * the alert will not close on its own. */ duration?: any; /** * Enables a countdown that indicates the remaining time the alert will be displayed. * Typically used to indicate the remaining time before a whole app refresh. */ countdown?: "rtl" | "ltr" | undefined; /** * Emitted when the alert opens. */ onSlShow?: (event: SlAlertShowEvent) => void; /** * Emitted when the alert opens. */ onSlShowCapture?: (event: SlAlertShowEvent) => void; /** * Emitted after the alert opens and all animations are complete. */ onSlAfterShow?: (event: SlAlertAfterShowEvent) => void; /** * Emitted after the alert opens and all animations are complete. */ onSlAfterShowCapture?: (event: SlAlertAfterShowEvent) => void; /** * Emitted when the alert closes. */ onSlHide?: (event: SlAlertHideEvent) => void; /** * Emitted when the alert closes. */ onSlHideCapture?: (event: SlAlertHideEvent) => void; /** * Emitted after the alert closes and all animations are complete. */ onSlAfterHide?: (event: SlAlertAfterHideEvent) => void; /** * Emitted after the alert closes and all animations are complete. */ onSlAfterHideCapture?: (event: SlAlertAfterHideEvent) => void; } /** * Alerts are used to display important messages inline or as toast notifications. */ export default function SlAlert( props: SlAlertProps, ): ReactElement;