import type { CSSResultGroup } from 'lit'; import DSAIconButton from '../icon-button/icon-button'; import Modal from '../../internal/modal'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Dialogs, sometimes called "modals", appear above the page and require the user's immediate attention. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/boite-de-dialogue-dialog/web-O16ivvdn * * @dependency dsa-icon-button * * @slot - The dialog's main content. * @slot label - The dialog's label. Alternatively, you can use the `label` attribute. * @slot header-actions - Optional actions to add to the header. Works best with ``. * @slot footer - The dialog's footer, usually one or more buttons representing various options. * * @event dsa-show - Emitted when the dialog opens. * @event dsa-after-show - Emitted after the dialog opens and all animations are complete. * @event dsa-hide - Emitted when the dialog closes. * @event dsa-after-hide - Emitted after the dialog closes and all animations are complete. * @event dsa-initial-focus - Emitted when the dialog opens and is ready to receive focus. Calling * `event.preventDefault()` will prevent focusing and allow you to set it on a different element, such as an input. * @event dsa-request-close {{ source: 'close-button' | 'keyboard' | 'overlay' }} - Emitted when the user attempts to * close the dialog by clicking the close button, clicking the overlay, or pressing escape. Calling * `event.preventDefault()` will keep the dialog open. Avoid using this unless closing the dialog will result in * destructive behavior such as data loss. */ export default class DSADialog extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-icon-button': typeof DSAIconButton; }; private readonly hasSlotController; private readonly localize; private originalTrigger; modal: Modal; dialog: HTMLElement; panel: HTMLElement; overlay: HTMLElement; /** * Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can * use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state. */ open: boolean; /** * The dialog's label as displayed in the header. You should always include a relevant label even when using `no-header` * or `hide-title`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead. */ label: string; /** * Hides the title part from the header, which contains its label. When using this attribute, you still need to provide * a relevant label for accessibility. */ hideTitle: boolean; /** * Removes the close button from the header part of the dialog. Please ensure you provide an easy, accessible way for * users to dismiss the dialog if you use this attribute. */ noCloseButton: boolean; /** * Removes the entire header part of the dialog. This will also remove the default close button, so please ensure you * provide an easy, accessible way for users to dismiss the dialog. */ noHeader: boolean; /** The dialog's size. */ size: 'small' | 'medium' | 'large'; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private requestClose; private addOpenListeners; private removeOpenListeners; private handleDocumentKeyDown; handleOpenChange(): Promise; /** Shows the dialog. */ show(): Promise; /** Hides the dialog */ hide(): Promise; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-dialog': DSADialog; } }