import { LitElement, type CSSResultGroup, type PropertyValues, type TemplateResult } from "lit"; import { HideEvent, ShowEvent } from "./events.ts"; interface TapsiSnackbarEventMap extends HTMLElementEventMap { [HideEvent.type]: HideEvent; [ShowEvent.type]: ShowEvent; } /** * @summary The snackbar component for brief notifications of processes that have been or will be performed. * * @tag tapsi-snackbar * * @slot [icon] - The slot for icon when color is `inverse`. * * @fires {ShowEvent} show - Fires when the snackbar should be visible. (cancelable) * @fires {HideEvent} hide - Fires when the snackbar should be hidden. (cancelable) */ export declare class Snackbar extends LitElement { /** @internal */ static readonly styles: CSSResultGroup; /** @internal */ static readonly shadowRootOptions: { delegatesFocus: boolean; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; /** @internal */ addEventListener: (type: K, listener: (this: Snackbar, ev: TapsiSnackbarEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void; /** @internal */ removeEventListener: (type: K, listener: (this: Snackbar, ev: TapsiSnackbarEventMap[K]) => void, options?: boolean | EventListenerOptions) => void; /** * Sets the text of the snackbar. * * @prop {string} text * @attr {string} text * @default "" */ text: string; /** * Determines whether the snackbar is open or not. * * @prop {boolean} open * @attr {string} open * @default false */ open: boolean; /** * The color of the snackbar, indicating the type of message. * * @prop {"success" | "error" | "info" | "warning" | "inverse"} color * @attr {"success" | "error" | "info" | "warning" | "inverse"} color * @default "inverse" */ color: "success" | "error" | "info" | "warning" | "inverse"; /** * Indicates whether the snackbar can be dismissed. * * @prop {boolean} dismissible * @attr {string} dismissible * @default false */ dismissible: boolean; /** * The time before the snackbar automatically closes (in milliseconds). * * @prop {number} duration * @attr {string} duration * @default -1 */ duration: number; private _hasIconSlot; private _iconSlotNodes; private _timeoutRef; private _focusTarget; private _ignoreFocusChanges; private _focusSent; constructor(); private _attachGlobalEvents; private _detachGlobalEvents; /** @internal */ connectedCallback(): void; /** @internal */ disconnectedCallback(): void; protected updated(changed: PropertyValues): void; protected willUpdate(changed: PropertyValues): void; private _handleIconSlotChange; private _calculateAutoHideDuration; /** * Opens the snackbar if it is not already open. * Dispatches a cancelable ShowEvent ("show"). */ show(): void; /** * Closes the snackbar if it is currently open. * Dispatches a cancelable HideEvent ("hide"). */ hide(): void; private _renderDismiss; private _getActualTarget; private _tryFocus; private _getFirstFocusableElement; private _handleDocumentFocus; private _handleDocumentKeyDown; private _renderIcon; protected render(): TemplateResult; } export {};