import { PropertyValueMap } from 'lit'; import { ButtonVariant } from '../../common/types'; import { DdsElement } from '../../internal/dds-hu-element'; declare const ModalBaseWithSized: typeof DdsElement & { new (...args: any[]): import('../../internal/mixin/sizedMixin').SizedElementInterface; prototype: import('../../internal/mixin/sizedMixin').SizedElementInterface; }; export default class ModalBaseElement extends ModalBaseWithSized { dialog: HTMLDialogElement; modalBox: HTMLElement; open?: boolean; fullScreen?: boolean; closeOnEsc: string; closeOnOverlayClick: string; closeButton: string; title: string; description: string; okButtonLabel: string; cancelButtonLabel: string; closeButtonLabel: string; okButtonVariant: ButtonVariant; cancelButtonVariant: ButtonVariant; okButtonDisabled: boolean; cancelButtonDisabled: boolean; cancelButtonDanger: boolean; okButtonDanger: boolean; hideOkButton: boolean; hideCancelButton: boolean; /** Override size for the default OK button; when empty uses the modal's effective size. */ okButtonSize: string; /** Override sizeMap for the default OK button; when empty uses the modal's sizeMap. */ okButtonSizeMap: string; /** Override size for the default Cancel button; when empty uses the modal's effective size. */ cancelButtonSize: string; /** Override sizeMap for the default Cancel button; when empty uses the modal's sizeMap. */ cancelButtonSizeMap: string; /** Override size for the close icon button; when empty uses the modal's effective size. */ closeButtonSize: string; /** Override sizeMap for the close icon button; when empty uses the modal's sizeMap. */ closeButtonSizeMap: string; /** `data-testid` for the default OK button. */ okButtonTestId: string; /** `data-testid` for the default Cancel button. */ cancelButtonTestId: string; /** `data-testid` for the default close icon button. */ closeButtonTestId: string; footer: string; header: string; wideFooter: boolean; bottomFooter: boolean; useNativeFocus: boolean; fixedHeader: boolean; fixedFooter: boolean; noModal: boolean; /** * Also links the body to the dialog as its description (aria-describedby), * so a screen reader reads it out on open. Best for short, text-only content. */ describeContent: boolean; /** Content slotted into the title / description slots. */ private hasSlottedTitle; private hasSlottedDescription; private previouslyFocusedElement; private focusableElements; private canceled; private closeEventCanceled; /** Whether this instance currently holds the body scroll lock. */ private holdsScrollLock; /** Set when the lock was released by a disconnect, so a reconnect can take it back. */ private relockOnConnect; static readonly styles: import('lit').CSSResult; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, _old: string | null, value: string | null): void; protected updated(_changedProperties: PropertyValueMap | Map): void; private handleOpen; private handleCloseAction; /** * Run `callback` once the dialog's transition settles -- or on a timer if no * transition runs at all. * * Focus management and the `dds-opened` / `dds-closed` events used to hang directly * off a `transitionend` listener registered `{ once: true }`. That event never fires * when the transition is skipped (`prefers-reduced-motion: reduce`, a consumer * zeroing `--dds-modal-transition-speed`, a backgrounded tab) or when it is * interrupted, so focus would never enter the dialog and would never be restored on * close. Accessibility behaviour must not depend on an animation completing. */ private afterTransition; /** * Apply a transform change to the dialog without animating it. * * The dialog animates its entrance with `transform` (`transition: transform ...`), * so any later transform change would try to animate too. Suppressing the * transition for one reflow makes the change instant -- and importantly avoids * the unreliable "transition to `none`" interpolation, which Chrome can leave * pinned at the start value. */ private setTransformInstantly; /** * Drop the dialog's transform once it is settled open. * * A settled-open dialog keeps an identity transform (`translate(0, 0)`) for the * entrance animation. Any transform -- even the identity -- makes the dialog a * containing block for `position: fixed` descendants, which clips * `floatingStrategy="fixed"` dropdowns (select / combobox / tooltip) to the * modal instead of letting them escape and overflow it. Removing it (visually a * no-op) frees those popups. Restored in `restoreTransform` before closing. */ private dropTransform; /** Undo `dropTransform` so the close animation starts from the on-screen position. */ private restoreTransform; /** Longest transition duration + delay declared on the dialog, in milliseconds. */ private transitionDurationMs; scrollLock: (open: boolean) => void; protected firstUpdated(_changedProperties: PropertyValueMap | Map): void; show(): void; hide(): void; private handleClose; private handleCancel; private handleEscClose; private handleOkButton; private handleCancelButton; private handleCloseButton; private handleClick; /** * Escape closes the dialog: dds-cancel first, then dds-close, either of which * a listener may cancel. Returns whether the dialog is closing. */ private handleEscape; private handleKeyDown; private getFocusableElements; private getActiveElement; private getElementFromElement; private isElementContainedIn; private handleFocusTrap; /** * Focus reached a guard at the start or end of the dialog, so a Tab moved * past the edge the keydown trap knows about. Safari's default Tab order * skips buttons, so its first/last tab stop is often not the trap's first or * last element. Wrap around to the other end. */ private handleGuardFocus; private renderFocusGuard; /** Whether the header shows a title (property or slotted) to name the dialog by. */ private get hasTitle(); private get hasDescription(); private handleTitleSlotChange; private handleDescriptionSlotChange; renderModal(): import('lit-html').TemplateResult<1>; } export {};