UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

41 lines (40 loc) 1.36 kB
import React, { CSSProperties, MouseEventHandler, PureComponent, ReactNode } from 'react'; import ConfigContext, { ConfigContextValue } from '../config-provider/ConfigContext'; export interface AlertProps { /** * Type of Alert styles, options:`success`, `info`, `warning`, `error` */ type?: 'success' | 'info' | 'warning' | 'error'; /** Whether Alert can be closed */ closable?: boolean; /** Close text to show */ closeText?: ReactNode; /** Content of Alert */ message: ReactNode; /** Additional content of Alert */ description?: ReactNode; /** Callback when close Alert */ onClose?: MouseEventHandler<HTMLAnchorElement>; /** Trigger when animation ending of Alert */ afterClose?: () => void; /** Whether to show icon */ showIcon?: boolean; iconType?: string; style?: CSSProperties; prefixCls?: string; className?: string; banner?: boolean; iconOutline?: boolean; } export default class Alert extends PureComponent<AlertProps, any> { static displayName: string; static get contextType(): typeof ConfigContext; context: ConfigContextValue; state: { closing: boolean; closed: boolean; }; handleClose: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void; animationEnd: () => void; render(): JSX.Element | null; }