import * as React from 'react'; import { IStyledComponentProps } from '../styled'; import { AlertClasses } from './alert-classes'; export type AlertSeverityType = 'default' | 'success' | 'info' | 'danger' | 'warning'; export type AlertVariantType = 'standard' | 'outlined'; export type IAlertProps = IStyledComponentProps<{ props: { /** * The action to display. It renders after the message, at the end of the alert. */ action?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: Partial; /** * Override the default label for the *close popup* icon button. * * @default 'Close' */ closeText?: string; /** * Backwards compatible prop for Manhattan. Setting this to false will hide the close button if onClose is passed. * * @default true */ dismissible?: boolean; /** * Adds box-shadow based on elecation value. The higher the value the larger the shadow. This maps to `theme.shadows[elevation]` */ elevation?: 1 | 2 | 3 | 4; /** * Override the icon displayed before the children. * Unless provided, the icon is mapped to the value of the `severity` prop. * Set to `false` to remove the `icon`. */ icon?: React.ReactNode; /** * The component maps the `severity` prop to a range of different icons, * for instance success to ``. * If you wish to change this mapping, you can provide your own. * Alternatively, you can use the `icon` prop to override the icon displayed. */ iconMapping?: Partial>; /** * Alternative to using children. If both are passed message will be used. */ message?: React.ReactNode; /** * The ARIA role attribute of the element. * @default 'alert' */ role?: string; /** * The severity of the alert. This defines the color and icon used. * @default 'default' */ severity?: AlertSeverityType; /** * The variant to use. * @default 'standard' */ variant?: AlertVariantType; /** * Callback fired when the component requests to be closed. * When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked. * @param {React.SyntheticEvent} event The event source of the callback. */ onClose?(event: React.MouseEvent): void; /** * @deprecated Backwards compatible prop for Cosmos migration. Maps to `onClose` prop. Use onClose if possible */ onDismiss?(event: React.MouseEvent): void; }; defaultComponent: 'div'; }>; export type IAlertOwnerState = Pick; export declare const Alert: React.ForwardRefExoticComponent<{ /** * The action to display. It renders after the message, at the end of the alert. */ action?: React.ReactNode; /** * Override or extend the styles applied to the component. */ classes?: Partial; /** * Override the default label for the *close popup* icon button. * * @default 'Close' */ closeText?: string; /** * Backwards compatible prop for Manhattan. Setting this to false will hide the close button if onClose is passed. * * @default true */ dismissible?: boolean; /** * Adds box-shadow based on elecation value. The higher the value the larger the shadow. This maps to `theme.shadows[elevation]` */ elevation?: 1 | 2 | 3 | 4; /** * Override the icon displayed before the children. * Unless provided, the icon is mapped to the value of the `severity` prop. * Set to `false` to remove the `icon`. */ icon?: React.ReactNode; /** * The component maps the `severity` prop to a range of different icons, * for instance success to ``. * If you wish to change this mapping, you can provide your own. * Alternatively, you can use the `icon` prop to override the icon displayed. */ iconMapping?: Partial>; /** * Alternative to using children. If both are passed message will be used. */ message?: React.ReactNode; /** * The ARIA role attribute of the element. * @default 'alert' */ role?: string; /** * The severity of the alert. This defines the color and icon used. * @default 'default' */ severity?: AlertSeverityType; /** * The variant to use. * @default 'standard' */ variant?: AlertVariantType; /** * Callback fired when the component requests to be closed. * When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked. * @param {React.SyntheticEvent} event The event source of the callback. */ onClose?(event: React.MouseEvent): void; /** * @deprecated Backwards compatible prop for Cosmos migration. Maps to `onClose` prop. Use onClose if possible */ onDismiss?(event: React.MouseEvent): void; } & Omit, HTMLDivElement>, "ref" | "action" | "icon" | "role" | "elevation" | "onClose" | "classes" | "variant" | "closeText" | "dismissible" | "iconMapping" | "message" | "severity" | "onDismiss"> & import("../styled").IStyledCommonProps & React.RefAttributes>;