import { type PropertyValues } from 'lit'; import { Dialog } from '../dialog/dialog.js'; import '../spinner/index.js'; /** * Fired when the user accepts an alert dialog (the confirm action). Cancelable — * call `event.preventDefault()` to keep the dialog open (e.g. to await an async * task); close it yourself afterwards by setting `open = false`. * * Does not bubble and is not composed: listen on the element itself. */ export declare class ConfirmEvent extends Event { constructor(); } /** * Fired when the user dismisses an alert dialog (the cancel action, Escape, or a * close request). Cancelable — call `event.preventDefault()` to keep it open. * * Does not bubble and is not composed: listen on the element itself. */ export declare class CancelEvent extends Event { constructor(); } /** * An interruptive confirmation dialog built on ``. Renders its own * cancel/confirm actions and exposes `role="alertdialog"`. Use it to confirm a * consequential action (delete, publish, discard) — not for generic content. * * Open and close by toggling the `open` property (or the `--show` / `--hide` * Invoker commands). The dialog closes automatically when the user picks an * action, unless the matching `confirm` / `cancel` event is canceled. * * @slot - Description text. Provides the dialog's accessible description. * @slot title - Custom heading element. Overrides the default `

` rendered from the `title` property. Also provides the dialog's accessible name. * @slot cancel - Replaces the built-in cancel action (e.g. a link). Keep it focusable. * @slot confirm - Replaces the built-in confirm action. * * @csspart dialog - The native `` element. * @csspart header - The header wrapper containing the title. * @csspart title - The dialog title heading. * @csspart body - The body wrapper around the description. * @csspart footer - The footer wrapper around the actions. * @csspart button - Both built-in action buttons. * @csspart cancel - The built-in cancel button. * @csspart confirm - The built-in confirm button. * * @cssproperty [--width=31rem] - Dialog width. * @cssproperty [--border-radius=6px] - Dialog border radius. * @cssproperty [--padding=1.5rem] - Padding applied to the header, footer, and inline-padding of the body. * @cssproperty [--show-duration=200ms] - Open transition duration. * @cssproperty [--hide-duration=200ms] - Close transition duration. * @cssproperty --backdrop - Backdrop color. * @cssproperty [--backdrop-blur=0] - Backdrop blur amount (any CSS length). * * @event confirm - Fired when the user accepts. Cancelable — `preventDefault()` keeps it open for async work. * @event cancel - Fired when the user dismisses (cancel action, Escape). Cancelable — `preventDefault()` keeps it open. * @event show - Fired when the dialog is about to open. Cancelable. * @event hide - Fired when the dialog is about to close via the `open` property. Cancelable. (The confirm, cancel, and Escape paths close natively and emit `confirm`/`cancel` instead of `hide`.) * @event after-show - Fired after the open animation completes. Not cancelable. * @event after-hide - Fired after the close animation completes. Not cancelable. * * @command --show - Sets `open = true`. * @command --hide - Sets `open = false`. * * @customElement l-alert-dialog */ export declare class AlertDialog extends Dialog { static styles: import("lit").CSSResult[]; /** Label for the confirm action. */ confirmText: string; /** Label for the cancel action. */ cancelText: string; /** Visual tone. `danger` renders the confirm action as destructive. */ tone?: 'danger'; /** Show a busy state on the confirm action (spinner + `aria-disabled`); the * cancel action stays operable as an escape hatch. */ loading: boolean; protected get _role(): string; private _bodyContent; protected get _bodyId(): "" | "description"; protected willUpdate(changed: PropertyValues): void; protected _onCancel(e: Event): void; protected _focusInitial(): void; private _close; private _activate; private _onFooterClick; protected renderFooter(): import("lit").TemplateResult<1>; } export interface AlertDialog { addEventListener(type: 'confirm', listener: (this: AlertDialog, ev: ConfirmEvent) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: 'cancel', listener: (this: AlertDialog, ev: CancelEvent) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: 'confirm', listener: (this: AlertDialog, ev: ConfirmEvent) => void, options?: boolean | EventListenerOptions): void; removeEventListener(type: 'cancel', listener: (this: AlertDialog, ev: CancelEvent) => void, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } //# sourceMappingURL=alert-dialog.d.ts.map