import { LitElement, PropertyValues } from "lit"; export type SkyAlertClosedEventDetail = { title: string; message: string; }; export type SkyAlertStrip = "start" | "end" | "both" | "none"; export type SkyAlertVariant = "flat" | "bordered" | "light" | "faded" | "solid"; export type SkyAlertRoleType = "alert" | "alertdialog"; /** * @element sky-alert * * @summary Status alert banner with variants, optional icon, strip accents, actions, dismiss behavior, and loading state. * * @status stable * @since 1.0.0 * * @documentation https://sky-ui.com/components/alert * @dependency sky-icon * * @slot - Custom message content (used when `message` is empty). * @slot actions - Action buttons or links displayed on the trailing side. * * @property {string} title - Title text shown above the message. * @property {string} message - Message text rendered inside the alert. * @property {boolean} removable - Shows a dismiss button when enabled. * @property {string} color - Base color token or CSS color used by the alert. * @property {string} size - Preset size token (`xs | sm | md | lg | xl`) or CSS length. * @property {string} radius - Radius token or CSS length. * @property {string | null} icon - Optional leading icon name for ``. * @property {SkyAlertStrip} strip - Strip accent placement. * @property {string} stripColor - Strip accent color token or CSS color. * @property {SkyAlertVariant} variant - Visual style variant. * @property {boolean} loading - Shows a loading overlay. * @property {SkyAlertRoleType} roleType - ARIA role for the alert container. * @property {string} preset - Named prop preset from nearest `sky-config-provider`. Default: `""`. * @method close Dispatches `alert-closed` and removes the alert from the DOM. * * @fires {CustomEvent} alert-closed - Fired when the alert is dismissed via the close button; bubbles and is composed. * * @csspart alert - The outer alert container. * @csspart icon - The optional leading icon. * @csspart content - The content container (title + message/slot). * @csspart title - The title text element. * @csspart message - The message text element (when `message` is provided). * @csspart actions - The trailing actions container. * @csspart close-button - The dismiss button (when `removable`). * @csspart loading-overlay - Overlay shown when `loading` is true. * @csspart loading-spinner - Spinner element shown inside the loading overlay. * * @Behavior * - `message` content takes priority over default-slot message content. * - Dismissing a removable alert dispatches `alert-closed` and removes the element. * - `strip` controls accent placement (`start`, `end`, `both`, `none`). * - `role-type="alert"` maps to `aria-live="assertive"`; `alertdialog` maps to `aria-live="polite"`. * - Respects reduced motion preferences for entry, button hover rotation, and spinner animation. * * @example * ```html * * * * ``` * ```vue * * ``` * ```jsx * export default function Demo() { * return ( * * * * ); * } * ``` */ export declare class SkyAlert extends LitElement { static dependencies: Record; /** Title text displayed above the message. @default "" */ title: string; /** Message text displayed inside the alert. @default "" */ message: string; /** Shows a close button that dismisses the alert. @default false */ removable: boolean; /** Base color token or CSS color. @default "primary" */ color: string; /** Size token (`xs | sm | md | lg | xl`) or CSS length. @default "md" */ size: string; /** Radius token or CSS length. @default "md" */ radius: string; /** Optional leading icon name for ``. @default null */ icon: string | null; /** Strip accent position. @default "none" */ strip: SkyAlertStrip; /** Strip accent color. @default "currentColor" */ stripColor: string; /** Visual style variant. @default "solid" */ variant: SkyAlertVariant; /** Shows a loading overlay. @default false */ loading: boolean; /** ARIA role applied to the alert container. @default "alert" */ roleType: SkyAlertRoleType; /** Internal style variables */ private _styleVars; /** Cached result of _resolveSize for the last `size` value (avoids recomputing when only color/variant change). */ private _sizeCache; /** True when the actions slot has assigned content (used to show separator only when needed). */ private _hasActionsSlotContent; /** Named prop preset from nearest `sky-config-provider`. */ preset: string; private _presets; static styles: import("lit").CSSResult[]; /** * Resolves size to get padding, font sizes, and other metrics. * Result is memoized by `size` to avoid recomputing when only color/variant/radius change. */ private _resolveSize; /** * Lit order: willUpdate → controllers hostUpdate (presets) → update/render. * Rebuild CSS vars here so preset-applied color/variant are visible. */ update(changedProperties: PropertyValues): void; private _lastPresetRevision; /** Initializes actions-slot presence state after first render. */ firstUpdated(): void; /** Computes CSS custom properties from current variant, size, and color inputs. */ private _updateStyleVars; /** * Dispatches `alert-closed` and removes the alert from the DOM. * * @returns {void} */ close(): void; /** Returns the ARIA role applied to the alert container. */ private getAriaRole; /** Checks whether the actions slot currently has meaningful assigned content. */ private _checkActionsSlot; /** Updates action-slot state when the slot assignment changes. */ private _onActionsSlotChange; render(): import("lit-html").TemplateResult<1>; }