import { OverrideProps } from '@mui/types'; import { CreateSlotsAndSlotProps, SlotCommonProps, SlotProps } from '../types/slot'; import { IconButtonProps } from '../IconButton'; export type SystemColor = 'primary' | 'error' | 'info' | 'warning' | 'success'; export type AlertSlot = 'slot' | 'startDecorator' | 'action' | 'closeButton'; export interface AlertSlots { /** * The component that renders the root. * @default 'div' */ root?: React.ElementType; /** * The component that renders the start decorator. * @default 'span' */ startDecorator?: React.ElementType; /** * The component that renders the action. * @default 'span' */ action?: React.ElementType; /** * The component that renders the close button. * @default 'button' */ closeButton?: React.ElementType; } export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps; startDecorator: SlotProps<'span', object, AlertOwnerState>; action: SlotProps<'span', object, AlertOwnerState>; closeButton: SlotProps<'button', IconButtonProps, AlertOwnerState>; }>; export interface AlertTypeMap

{ props: P & AlertSlotsAndSlotProps & { /** * The system color of Alert * @default 'primary' */ color?: SystemColor; /** * The intensity of Alert * @default 'bold' */ intensity?: 'bold' | 'subtle'; /** * The content direction flow, if `vertical`, the endDecorator will be placed below the text. * @default 'horizontal' */ orientation?: 'vertical' | 'horizontal'; /** * Element placed before the children. */ startDecorator?: React.ReactNode; /** * The action of alert. It will be presented as a button. */ action?: { onClick: () => void; label: string; }; /** * Callback fired when the component requests to be closed. * When provided, 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.SyntheticEvent) => void; }; defaultComponent: D; } export type AlertProps = OverrideProps, D>; export interface AlertOwnerState extends AlertProps { }