import React from 'react'; import { SpaceProps } from 'styled-system'; /** * Prop Types of a MessageBox component. * Apart from those defined below it extends all {@link SpaceProps} * * @memberof MessageBox * @alias MessageBoxProps */ declare type MessageBoxProps = { /** Triggered when user clicks close button. If not given close button won't be seen */ onCloseClick?: () => void; /** Title content of a message */ message?: string; /** Variant */ variant?: 'danger' | 'info' | 'success'; /** Icon which will be seen in the title */ icon?: string; /** Size variant */ size?: 'sm'; /** Optional html style property */ style?: Record; /** Optional children, when given component will be expanded */ children?: React.ReactNode; }; declare type Props = SpaceProps & MessageBoxProps; export { Props as MessageBoxProps }; /** * @classdesc * * * * Component responsible for rendering standard danger/info/success * messages. * * It has 2 size versions: default and small. Also it can either contain or * don't contain children, which causes different look. * * ### Usage * * ```javascript * import { MessageBox, MessageBoxProps } from '@admin-bro/design-system' * ``` * * @component * @subcategory Molecules * @hideconstructor * @see MessageBoxProps * @see {@link https://storybook.adminbro.com/?path=/story/designsystem-molecules-messagebox--default Storybook} * @example Different variants * return ( * * alert('close clicked')} /> * alert('close clicked')} /> * alert('close clicked')} /> * * ) * @example Different variants with children * return ( * * alert('close clicked')}> * With inside text * * alert('close clicked')}> * With inside text * * alert('close clicked')}> * With inside text * * * ) * @example Small with an icon and inside text * return ( * * alert('close clicked')} * > * With inside text * * * ) * @section design-system */ declare const MessageBox: React.FC; export { MessageBox }; export default MessageBox;