import { nothing, type PropertyValues, type TemplateResult } from "lit"; import { LoomiElement, type LoomiSize } from "@loomidev/core"; import "@loomidev/button/loomi-button.js"; import "@loomidev/icon/loomi-icon.js"; import type { LoomiIconSource } from "@loomidev/icon"; export type LoomiModalType = "" | "info" | "error" | "warning" | "success"; /** Open a modal by its `name`. */ export declare function showLoomiModal(name: string): void; /** Close a modal by its `name`. */ export declare function hideLoomiModal(name: string): void; declare global { interface Window { showLoomiModal: typeof showLoomiModal; hideLoomiModal: typeof hideLoomiModal; } } /** * `` — an overlay dialog. Open/close via `name` with `showLoomiModal()` / * `hideLoomiModal()`, or the instance `show()` / `hide()` methods. * * @slot - The modal body. * @fires ok - Primary button clicked. @fires cancel - Secondary button clicked. @fires close - Dismissed. */ export declare class LoomiModal extends LoomiElement { static styles: import("lit").CSSResultGroup[]; /** Size names this component supports, from the canonical `LoomiSize` scale. `blur-size` also accepts `none`. */ static readonly supportedSizes: { size: readonly ["tiny", "small", "regular", "big", "huge", "omg"]; blurSize: readonly ["small", "regular", "big", "huge", "omg"]; }; name: string; title: string; type: LoomiModalType; icon: string; iconSource: LoomiIconSource; /** Dialog width: `tiny` | `small` | `regular` | `big` | `huge` | `omg` (full width). */ size: LoomiSize; locale: string; open: boolean; okButtonLabel: string; cancelButtonLabel: string; showActionButtons: boolean; showCloseIcon: boolean; backdropCanClose: boolean; closeAfterAction: boolean; preventScroll: boolean; stretchActionButtons: boolean; alignButtons: "left" | "center" | "right"; /** Backdrop blur: `none` | `small` | `regular` | `big` | `huge` | `omg`. */ blurSize: "none" | LoomiSize; /** Rendered-but-leaving: the dialog and backdrop are playing their exit animation. */ private closing; /** The element focused before `show()` was called, restored when the modal closes. */ private previouslyFocused; private cancelExit?; private hasScrollLock; private reparent; connectedCallback(): void; disconnectedCallback(): void; protected updated(changedProperties: PropertyValues): void; /** * `open` is reflected and is what `:host` keys its `display` off; while the exit plays, * `open` is already false, so the host needs its own reason to keep generating boxes. */ private setClosing; show(): void; hide(): void; /** * Keeps the backdrop and dialog rendered while they play their `-out` keyframes, then * unmounts and returns the host to where the author put it. * * `reparent.restore()` waits for the same reason: moving a node re-inserts it, which * cancels any animation running on it. */ private startExit; private syncScrollLock; private releaseScrollLock; /** Focusable elements in template order: close button, slotted body, footer buttons. */ private getFocusable; private waitForActionButtons; private onKey; private onBackdrop; private onOk; private onCancel; render(): TemplateResult | typeof nothing; } /** Event map for ``. All four are plain `Event`s with no detail. */ export interface LoomiModalEventMap { open: Event; close: Event; ok: Event; cancel: Event; } declare global { interface HTMLElementTagNameMap { "loomi-modal": LoomiModal; } } //# sourceMappingURL=loomi-modal.d.ts.map