import { ReactNode } from 'react'; /** * Message variant types * - info: General informational message (blue) * - error: Error/validation message (red) * - warning: Cautionary message (orange) * - success: Success/confirmation message (green) * - assistive: Helper/assistive text (grey) */ export type MessageVariant = 'info' | 'error' | 'warning' | 'success' | 'assistive'; /** * Display mode for the message * - inline: Default inline message (current behavior) * - banner: Full-width banner with background color * - snackbar: Toast notification with timeout and optional action */ export type MessageDisplayMode = 'inline' | 'banner' | 'snackbar'; /** * Size variants for the Message component * - tn: Tiny (10px with default theme) * - xs: Extra small (12px with default theme) * - sm: Small (14px with default theme) * - md: Medium (14.5px with default theme) */ export type MessageSize = 'tn' | 'xs' | 'sm' | 'md'; /** * Text color options * - default: Generic black text (theme text.primary) * - context: Color tied to the variant (blue for info, red for error, etc.) * - custom: Use the custom color provided via customTextColor prop */ export type MessageTextColor = 'default' | 'context' | 'custom'; /** * Position for snackbar messages */ export type SnackbarPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; /** * Action button configuration for snackbar mode */ export interface MessageAction { /** Label for the action button */ label: string; /** Callback when action is clicked */ onClick: () => void; } /** * Props for the Message component */ export interface MessageProps { /** * The variant/type of message to display */ variant: MessageVariant; /** * The message content to display */ children: ReactNode; /** * Display mode for the message * @default 'inline' */ mode?: MessageDisplayMode; /** * Text size variant * @default 'sm' */ size?: MessageSize; /** * Text color option * - 'default': Generic black text (theme text.primary) * - 'context': Color tied to the variant * - 'custom': Use customTextColor prop value * @default 'context' */ textColor?: MessageTextColor; /** * Custom text color (only used when textColor='custom') */ customTextColor?: string; /** * Optional custom icon to override the default variant icon */ icon?: ReactNode; /** * Whether to show the icon * @default true */ showIcon?: boolean; /** * Whether the snackbar is open (only for mode='snackbar') * @default true */ open?: boolean; /** * Auto-hide duration in milliseconds (only for mode='snackbar') * Set to null to disable auto-hide * @default 5000 */ autoHideDuration?: number | null; /** * Callback when snackbar is closed (only for mode='snackbar') */ onClose?: () => void; /** * Optional action button (only for mode='snackbar') */ action?: MessageAction; /** * Whether to show close button (only for mode='snackbar') * @default true */ showCloseButton?: boolean; /** * Position for snackbar (only for mode='snackbar') * Note: Position is typically controlled by a provider, but can be overridden * @default 'bottom-right' */ position?: SnackbarPosition; /** * Maximum width of the message container. * Accepts any valid CSS width value (e.g., '400px', '50%', '20rem'). * Only applies to banner and snackbar modes. */ maxWidth?: string | number; /** * Number of lines to show before truncating. * When set, long text will be truncated and a "Show More" toggle will appear. * Set to undefined or 0 to disable truncation. */ truncateLines?: number; /** * Custom text for the "Show More" button * @default 'Show More' */ showMoreText?: string; /** * Custom text for the "Show Less" button * @default 'Show Less' */ showLessText?: string; /** * Additional CSS classes */ className?: string; /** * Test ID for testing (deprecated, use dataTestId) */ 'data-testid'?: string; /** * Test identifier for automated testing */ dataTestId?: string; /** * Data identifier for ib-ui compatibility */ dataId?: string; } /** * Internal props for snackbar animation state */ export interface InternalSnackbarProps extends MessageProps { /** Whether snackbar is in exiting animation state */ isExiting?: boolean; } //# sourceMappingURL=Message.types.d.ts.map