import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonNotificationActionContext = { describedBy: import("svelte/store").Writable; toast: boolean; }; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Specify the kind of notification. * @default "error" */ kind?: "error" | "info" | "info-square" | "success" | "warning" | "warning-alt"; /** * Set to `true` to use the low contrast variant * @default false */ lowContrast?: boolean; /** * Set the timeout duration (ms) to hide the notification after opening it. * Ignored when the notification is `actionable` or has an `actions` slot. * @default 0 */ timeout?: number; /** * Set to `true` to pause the auto-dismiss timeout while the pointer is over the notification or while focus is inside it. * @default false */ pauseOnHover?: boolean; /** * Specify the ARIA `role` for the notification container. * `actionable` overrides it with `alertdialog`. * @default "status" */ role?: "alert" | "log" | "status"; /** * Set to `true` when the notification holds an action that users must * reach, such as an undo or a retry. The notification becomes an * `alertdialog` named by its title, moves focus to its first action * (or the close button) when it opens, keeps Tab inside, and closes * on Escape. * @default false */ actionable?: boolean; /** * Set to `false` to keep focus where it is when an actionable * notification opens. Has no effect unless `actionable` is `true`. * @default true */ focusOnOpen?: boolean; /** * Set to `false` to keep an actionable notification open on Escape. * With `hideCloseButton` also set, Tab can leave the notification. * Has no effect unless `actionable` is `true`. * @default true */ closeOnEscape?: boolean; /** * Specify the title text * @default "" */ title?: string; /** * Specify the subtitle text * @default "" */ subtitle?: string; /** * Specify the caption text * @default "" */ caption?: string; /** * Specify the ARIA label for the close button * @default "Close notification" */ closeButtonDescription?: string; /** * Specify the label of the status icon for screen readers. * Defaults to the kind, such as "Warning". */ statusIconDescription?: string | undefined; /** * Set to `true` to hide the close button * @default false */ hideCloseButton?: boolean; /** * Set to `true` for the notification to span * the full width of its containing element. * @default false */ fullWidth?: boolean; /** * Set to `true` to show the notification, `false` to hide it. * @default true */ open?: boolean; /** * Set an id for the top-level element. The title and subtitle ids derive * from it as `{id}-title` and `{id}-subtitle`, so the server and the * browser render the same ids. */ id?: string | undefined; actions?: (this: void) => void; captionChildren?: (this: void) => void; subtitleChildren?: (this: void) => void; titleChildren?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ToastNotificationProps = Omit<$RestProps, keyof $Props> & $Props; export default class ToastNotification extends SvelteComponentTyped< ToastNotificationProps, { click: WindowEventMap["click"]; close: CustomEvent<{ timeout: boolean; }>; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; }, { default: Record; actions: Record; captionChildren: Record; subtitleChildren: Record; titleChildren: Record; } > {}