import { type HTMLAttributes, type ReactNode } from 'react'; import { type VariantProps } from 'class-variance-authority'; declare const alertVariants: (props?: ({ variant?: "error" | "info" | "success" | "warning" | "promo" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; interface AlertTitleProps extends HTMLAttributes { as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span'; } /** How urgently the alert is announced — independent of the visual `variant`. * * - `off` — not a live region. No `role`, no `aria-live`. Correct for a * static notice that is present from mount (a read-only banner, a summary * of missing answers on a form the user is still typing into). * - `polite` — `role="status"` + `aria-live="polite"`. Queued behind the * current utterance. The right default for anything that appears in * response to a user action but is not an emergency. * - `assertive` — `role="alert"` + `aria-live="assertive"`. Interrupts the * screen reader immediately. Reserve for content the user cannot miss. */ export type AlertAnnounce = 'off' | 'polite' | 'assertive'; export interface AlertProps extends Omit, 'role'>, VariantProps { variant?: 'info' | 'success' | 'warning' | 'error' | 'promo'; /** Shows the close button. Defaults to true when `dismissKey` is set. */ dismissible?: boolean; /** * Remember a dismissal in this browser. Dismissing stores the key (in * `localStorage`, under `alfadocs-ui.dismissed.`), and the alert stays * hidden for that key from then on, even when `open` is true. A new key * shows it again, so put the condition in the key, for example * `hours-${hoursVersion}`. The key is stored as written in plain * browser storage: never put personal or patient data in it. Where * storage is unavailable the dismissal lasts for this page only. * Errors should not be dismissible. A dismissal lasts 30 days (see * `dismissLifetimeMs`), and the kit keeps at most 200, oldest out first. */ dismissKey?: string; /** * How long a `dismissKey` dismissal lasts, in ms. Defaults to 30 days * (`DISMISSED_DEFAULT_LIFETIME_MS`). `Infinity` keeps it until the cap * drops it. Stored with the dismissal, so changing it later affects * only new dismissals. */ dismissLifetimeMs?: number; /** Controlled visibility. `false` hides the alert whatever `dismissKey` says. */ open?: boolean; /** * Fires `false` when the user dismisses the alert. With `dismissKey` * the stored key hides it, so an uncontrolled alert returns by itself * on a new key; a host that sets `open` to false here must set it back. */ onOpenChange?: (open: boolean) => void; icon?: ReactNode; /** Announcement urgency — sets `role` **and** `aria-live` together, so the * tint (`variant`) and the interruption are chosen independently. Defaults * to the variant's historical mapping: `info` / `success` / `promo` → * `polite`, `warning` / `error` → `assertive`. Wins over `live`. */ announce?: AlertAnnounce; /** @deprecated Use `announce`. Sets `aria-live` only and leaves `role` * variant-derived, which can pair `role="alert"` with `aria-live="polite"`. * Kept for the consumers already shipping it. */ live?: 'assertive' | 'polite' | 'off'; /** Compact mode: clamps `Alert.Title` to 2 lines (with a tooltip when the * title is truncated) and `Alert.Description` to 2 lines (with a "Read more" * toggle). Opt-in — leave off for standalone alerts whose full message must * always be visible. */ clamp?: boolean; } export type { AlertTitleProps }; export declare const Alert: import("react").ForwardRefExoticComponent> & { Title: import("react").ForwardRefExoticComponent>; Description: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; Action: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; //# sourceMappingURL=alert.d.ts.map