import type { CSSResultGroup } from 'lit'; import DSAIconButton from '../icon-button/icon-button'; import DSAIcon from '../icon/icon'; import { ShoelaceElement } from '../../internal/shoelace-element'; /** * @summary Alerts are used to display important messages inline or as toast notifications. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/alerte-alert/web-n2YDCsNN * * @dependency dsa-icon * @dependency dsa-icon-button * * @slot - The alert's main content. * @slot action - An optional slot action, usually a `dsa-button`. * * @event dsa-show - Emitted when the alert opens. * @event dsa-after-show - Emitted after the alert opens and all animations are complete. * @event dsa-hide - Emitted when the alert closes. * @event dsa-after-hide - Emitted after the alert closes and all animations are complete. */ export default class DSAAlert extends ShoelaceElement { static styles: CSSResultGroup; static dependencies: { 'dsa-icon-button': typeof DSAIconButton; 'dsa-icon': typeof DSAIcon; }; private autoHideTimeout; private readonly localize; base: HTMLElement; /** The alert's title. */ alertTitle: string; /** (deprecated) The alert's title. */ title: string; /** * Indicates whether or not the alert is open. You can toggle this attribute to show and hide the alert, or you can * use the `show()` and `hide()` methods and this attribute will reflect the alert's open state. */ open: boolean; /** Enables a close button that allows the user to dismiss the alert. */ closable: boolean; /** Optional aria-level of the alert header */ headerLevel: 1 | 2 | 3 | 4 | 5 | 6; /** The alert's theme variant. */ variant: 'primary' | 'success' | 'neutral' | 'warning' | 'danger'; /** The alert's size. */ size: 'small' | 'medium'; /** * (deprecated) The length of time, in milliseconds, the alert will show before closing itself. If the user interacts with * the alert before it closes (e.g. moves the mouse over it), the timer will restart. Defaults to `Infinity`, meaning * the alert will not close on its own. */ duration: number; firstUpdated(): void; private restartAutoHide; private handleCloseClick; private handleMouseMove; private getPrefixIconName; private getIconLabel; handleOpenChange(): Promise; handleDurationChange(): void; /** Shows the alert. */ show(): Promise; /** Hides the alert */ hide(): Promise; /** * Displays the alert as a toast notification. This will move the alert out of its position in the DOM and, when * dismissed, it will be removed from the DOM completely. By storing a reference to the alert, you can reuse it by * calling this method again. The returned promise will resolve after the alert is hidden. */ toast(): Promise; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-alert': DSAAlert; } }