import React from "react";
import { IconProps } from "#components/icons/types";
import { AlertView } from "./views";
// ============================================================================
// TYPES & CONFIGURATION
// ============================================================================
/**
* Valid severity levels for alerts.
* Each severity has associated colors, icons, and ARIA attributes.
*/
type Severity = "default" | "info" | "success" | "warning" | "error";
/**
* Props for the Alert component.
*/
export type AlertProps = {
/**
* Whether the alert is open.
*/
open: boolean;
/**
* The severity level of the alert.
* @default "default"
*/
severity?: Severity;
/**
* The main message content.
*/
children: React.ReactNode;
/**
* Optional title for the alert.
*/
title?: string;
/**
* Whether the alert can be dismissed.
* @default false
*/
dismissible?: boolean;
/**
* Callback when alert is dismissed.
*/
onDismiss?: () => void;
/**
* Size of the severity icon in pixels.
* Allows customization of icon size for different contexts.
* @default 24
* @example
* ```tsx
* Larger icon
* Smaller icon
* ```
*/
iconSize?: number;
/**
* Whether to hide the severity icon.
* When true, only text content is displayed.
* @default false
*/
hideIcon?: boolean;
/**
* Additional props to pass to the Icon component.
* Allows fine-grained control over icon appearance.
* @example
* ```tsx
*
* Alert with custom icon props
*
* ```
*/
iconProps?: IconProps;
/**
* Duration in milliseconds before the alert automatically dismisses.
* Set to 0 or undefined to disable auto-dismiss.
* @default undefined
* @example
* ```tsx
* Success message
* ```
*/
autoHideDuration?: number;
/**
* Whether to pause auto-dismiss when the alert is hovered or focused.
* Complies with WCAG 2.2.1 (Timing Adjustable).
* @default true
*/
pauseOnHover?: boolean;
/**
* Semantic heading level for the title (2-6).
* When undefined, uses element instead of heading.
* Use this to maintain proper heading hierarchy on the page.
* @default undefined
* @example
* ```tsx
* ...
* ...
* ```
*/
titleLevel?: 2 | 3 | 4 | 5 | 6;
/**
* Custom action buttons to display in the alert.
* @example
* ```tsx
* >}>
* File deleted
*
* ```
*/
actions?: React.ReactNode;
/**
* Whether to automatically focus the alert when it becomes visible.
* Useful for critical alerts that require immediate attention.
* @default false
*/
autoFocus?: boolean;
/**
* Visual variant of the alert.
* - outlined: Border with lighter background (default)
* - filled: Solid colored background
* - soft: No border, subtle background
* @default "outlined"
*/
variant?: "outlined" | "filled" | "soft";
/**
* Content rendering mode for alert children.
* Determines how the children content is wrapped in the alert message area.
* - "text": Wraps children in a paragraph tag (default, for simple text content)
* - "node": Renders children directly without wrapper (for complex layouts, lists, or custom components)
* @default "text"
* @example Simple text content (uses default "text" mode)
* ```tsx
*
* This is a simple text message that will be wrapped in a paragraph.
*
* ```
* @example Complex content with list
* ```tsx
*
*