UNPKG

@sandlada/mdc

Version:

@sandlada/mdc is an open source component library that follows the Material Design 3 design specifications.

76 lines 2.54 kB
import { LitElement, type TemplateResult } from 'lit'; import { type ITooltipBox, type TooltipBoxPlacement, type TooltipBoxTriggerMode } from './tooltip-box.interface'; declare global { interface HTMLElementTagNameMap { 'mdc-tooltip-box': MDCTooltipBox; } } declare const MDCTooltipBox_base: Omit<typeof LitElement, "prototype"> & (new () => LitElement & object); /** * @element mdc-tooltip-box * * A controller that manages the display, positioning, and lifecycle * of a tooltip relative to its anchor content. Modeled after * Jetpack Compose's TooltipBox. * * @slot - The anchor content (e.g., a button or icon-button). * @slot tooltip - The mdc-tooltip element to display. * * @fires tooltip-box-showing - Dispatched when the tooltip starts showing. * @fires tooltip-box-shown - Dispatched when the tooltip is fully visible. * @fires tooltip-box-hiding - Dispatched when the tooltip starts hiding. * @fires tooltip-box-hidden - Dispatched when the tooltip is fully hidden. * * @csspart anchor - The wrapper around the anchor content. * * @version * Material Design 3 */ export declare class MDCTooltipBox extends MDCTooltipBox_base implements ITooltipBox { static styles: import("lit").CSSResult; placement: TooltipBoxPlacement; offset: number; showDelay: number; hideDelay: number; trigger: TooltipBoxTriggerMode; open: boolean; disableFlip: boolean; quick: boolean; private hasSlottedTooltip; private readonly tooltipSlotElements; private readonly anchorSlotElements; private get tooltipElement(); private get anchorElement(); private showTimeoutId; private hideTimeoutId; private cleanupAutoUpdate; private generation; constructor(); connectedCallback(): void; disconnectedCallback(): void; protected render(): TemplateResult; /** * Programmatically show the tooltip. */ show(): Promise<void>; /** * Programmatically hide the tooltip. */ hide(): Promise<void>; private handleTooltipSlotChange; private readonly handlePointerEnter; private readonly handlePointerLeave; private readonly handleFocusIn; private readonly handleFocusOut; private readonly handleKeyDown; private scheduleShow; private scheduleHide; private clearShowTimeout; private clearHideTimeout; private startPositionTracking; private stopPositionTracking; private updatePosition; private animateTooltip; } export {}; //# sourceMappingURL=tooltip-box.d.ts.map