import React from 'react'; import { EllipsisCommonProps } from '../common/Ellipsis'; import { ValuesOf } from '../utils/typeUtils'; import { SKINS, TYPE_POSITIONS_MAP } from './Notification.constants'; export type NotificationSkin = ValuesOf; export type NotificationTheme = NotificationSkin; export type NotificationType = ValuesOf; export interface NotificationProps { /** Can be either: * - `` (required) * - `` * - `` */ children?: React.ReactNode; /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; /** Specifies whether the notification is shown. */ show?: boolean; /** Controls the skin of the notification. * @deprecated Use `skin` instead. */ theme?: NotificationSkin; /** Controls the skin of the notification, which sets its color and icon. */ skin?: NotificationSkin; /** Sets how should be displayed: * - `type="global"` takes up space and pushes the content down. * - `type="local"` doesn't take up space and is displayed on top of content * - `type="sticky"` doesn't take up space and is displayed at the top of the whole page and on top of content (position: fixed;) */ type?: NotificationType; /** When provided, the Notification hides after the specified timeout. */ autoHideTimeout?: number; /** Sets the `z-index` of the notification. */ zIndex?: number; /** Defines a callback function which is called when the notification is closed. It receives the close source, either `'hide-by-close-click'` or `'hide-by-timer'`. * @default null */ onClose?: (source: string) => void; } interface TextLinkActionButtonProps { /** Sets the text of the link. */ children?: React.ReactNode; /** Renders the action as an underlined text link instead of a button. */ type: 'textLink'; /** Called when the link is clicked. */ onClick?: React.MouseEventHandler; /** Sets the URL the link points to. */ link?: string; /** Sets the browsing context the link opens in. * @default '_self' */ target?: string; } interface ButtonActionButtonProps { /** Sets the text of the button. */ children?: React.ReactNode; /** Renders the action as a button, which is the default. */ type?: 'button'; /** Called when the button is clicked. */ onClick?: React.MouseEventHandler; } export type ActionButtonProps = ButtonActionButtonProps | TextLinkActionButtonProps; export type TextLabelProps = EllipsisCommonProps & { /** Sets the text of the notification. */ children: React.ReactNode; }; export interface MappedChildren { label?: React.ReactElement; ctaButton?: React.ReactElement; closeButton?: React.ReactElement; } export interface NotificationState { hideByCloseClick: boolean; hideByTimer: boolean; height: number; showChildren: boolean; } export {}; //# sourceMappingURL=Notification.types.d.ts.map