UNPKG

@eccenca/gui-elements

Version:

GUI elements based on other libraries, usable in React application, written in Typescript.

43 lines (42 loc) 1.94 kB
import React from "react"; import { ToastProps as BlueprintToastProps } from "@blueprintjs/core"; import { IntentTypes } from "../../common/Intent"; import { TestableComponent } from "../interfaces"; import { IconProps } from "./../Icon/Icon"; import { TestIconProps } from "./../Icon/TestIcon"; export interface NotificationProps extends TestableComponent, Omit<BlueprintToastProps, "message" | "action" | "icon" | "intent">, React.HTMLAttributes<HTMLDivElement> { /** * Extra user action elements */ actions?: JSX.Element | JSX.Element[]; /** * Notification message that can be used as alternative to children elements. */ message?: JSX.Element | string; /** * Intent state of the notification. */ intent?: Extract<IntentTypes, "neutral" | "success" | "warning" | "danger" | "info">; /** * Notification uses the the given space more flexible. * Default notification is displayed in min and max limits. * Those limits are removed by setting this property to `true`. */ flexWidth?: boolean; /** * Icon displayed with the notification. * Set it to false if you need to prevent automatically set icon regarding the notification type. */ icon?: false | React.ReactElement<IconProps> | React.ReactElement<TestIconProps>; /** * If set then a `div` element is used as wrapper. * It uses the attributes given via this property. */ wrapperProps?: React.HTMLAttributes<HTMLDivElement>; } /** * Displays a notification message, optionally combined with depiction and further action buttons. * By default it uses colorization of an blueish info alert. */ export declare const Notification: ({ actions, children, className, message, flexWidth, icon, timeout, wrapperProps, "data-test-id": dataTestId, "data-testid": dataTestid, intent, ...otherProps }: NotificationProps) => React.JSX.Element; export default Notification;