import React, { type ReactNode } from 'react'; import { Text, View, type TextProps, type ViewProps } from 'react-native'; import type { ForgeIcon } from '@cdx-ui/icons'; import { type IconProps } from '../Icon'; import { type AlertSeverity, type AlertVariantProps } from './styles'; export interface AlertProps extends ViewProps, AlertVariantProps { /** * Replace the root element with the consumer's child element via `Slot`. * When `true`, children are rendered as-is (no automatic icon/text/actions * layout splitting). Severity context is still provided so sub-components * receive the correct styles. */ asChild?: boolean; /** Severity level that controls background colour, icon, and live-region urgency. */ severity?: AlertSeverity; className?: string; /** * Sub-components (`Alert.Icon`, `Alert.Title`, `Alert.Description`, * `Alert.Actions`) must be rendered as **direct** children — wrapping them * in HOCs or `memo()` will break the automatic layout splitting. */ children?: ReactNode; } declare const AlertRoot: React.ForwardRefExoticComponent>; export interface AlertIconProps extends Omit { asChild?: boolean; /** * Override the auto-rendered severity icon. Omit to use the default icon for * the current severity (EmergencyHome, Warning, CheckCircle, or Info). * Not required when `asChild` is set. */ as?: ForgeIcon; } declare const AlertIconComponent: React.ForwardRefExoticComponent>; export interface AlertTitleProps extends TextProps { asChild?: boolean; className?: string; children?: ReactNode; } declare const AlertTitle: React.ForwardRefExoticComponent>; export interface AlertDescriptionProps extends TextProps { asChild?: boolean; className?: string; children?: ReactNode; } declare const AlertDescription: React.ForwardRefExoticComponent>; export interface AlertActionsProps extends ViewProps { /** * Replace the wrapper element with the consumer's child via `Slot`. * **Note:** when `true`, automatic `color={severity}` injection on * direct `Button`/`IconButton` children is bypassed — the consumer * must set `color` explicitly. */ asChild?: boolean; className?: string; children?: ReactNode; } declare const AlertActions: React.ForwardRefExoticComponent>; type AlertCompoundComponent = typeof AlertRoot & { Icon: typeof AlertIconComponent; Title: typeof AlertTitle; Description: typeof AlertDescription; Actions: typeof AlertActions; }; export declare const Alert: AlertCompoundComponent; export type { AlertVariantProps, AlertSeverity }; //# sourceMappingURL=index.d.ts.map