/** * Modal Component * * Pure wrapper for modal dialogs using the native element. * Provides backdrop, focus management, scroll locking, and keyboard interaction * without imposing any styling on content. * * Features: * - Native dialog element wrapper * - Dual API: declarative (open attribute) and imperative (show/hide methods) * - Cancellable `beforeclose` lifecycle event for unsaved-state flows * - Auto-hiding close button on hover (desktop only) * - Scroll locking with unique modal IDs * - Customizable backdrop via CSS variables * * @example * *
*

Modal Title

*

Modal content here

* * Close * *
*
*/ /** * Modal attributes configuration */ export interface ModalAttributes { open: boolean; backdrop: boolean; closeOnOutsideClick: boolean; closeOnEscape: boolean; } /** * How a modal close was triggered. */ export type ModalCloseReason = 'programmatic' | 'backdrop' | 'escape' | 'close-button' | 'native'; /** * Modal close event detail */ export interface ModalCloseDetail { reason: ModalCloseReason; returnValue?: string; } /** * Modal beforeclose event detail — fired *before* the modal closes. The event * is cancellable; consumers can call `event.preventDefault()` to abort the * close, render their own UI (e.g. a styled "Discard changes?" prompt), and * later call `.hide()` themselves when ready. */ export interface ModalBeforeCloseDetail { reason: ModalCloseReason; } /** * TyModal Web Component */ export declare class TyModal extends HTMLElement { /** Programmatic API methods */ show?: () => void; /** * Close the modal. Without `force`, fires `beforeclose` first — consumers * can `preventDefault()` to abort. With `force: true`, bypasses the * cancellable event; used when the consumer has already obtained user * consent through their own UI. */ hide?: (opts?: { force?: boolean; }) => void; /** Observed attributes */ static get observedAttributes(): string[]; constructor(); connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, _oldValue: string | null, _newValue: string | null): void; } //# sourceMappingURL=modal.d.ts.map