UNPKG

@sandlada/mdc

Version:

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

83 lines 2.77 kB
/** * @license * Copyright 2026 Kai-Orion & Sandlada * SPDX-License-Identifier: MIT */ import { LitElement, type PropertyValues, type TemplateResult } from 'lit'; import { type ITooltip, type TooltipPosition } from './tooltip.interface'; declare global { interface HTMLElementTagNameMap { 'mdc-tooltip': MDCTooltip; } } declare const MDCTooltip_base: Omit<typeof LitElement, "prototype"> & (new () => LitElement & object); /** * @element mdc-tooltip * * A tooltip adds context to a button or other UI element. * Supports plain and rich variants via slots. * * Plain tooltip: Describes elements or actions (default). * Rich tooltip: Provides more detail with optional title and actions. * * @slot - Tooltip content text. * @slot headline - Rich tooltip title (auto-detects rich mode). * @slot actions - Rich tooltip action buttons (auto-detects rich mode). * * @fires tooltip-showing - Dispatched when the tooltip starts showing. * @fires tooltip-shown - Dispatched when the tooltip is fully visible. * @fires tooltip-hiding - Dispatched when the tooltip starts hiding. * @fires tooltip-hidden - Dispatched when the tooltip is fully hidden. * * @cssproperty --mdc-tooltip-enabled-container-color * @cssproperty --mdc-tooltip-container-shape-start-start * @cssproperty --mdc-tooltip-container-shape-start-end * @cssproperty --mdc-tooltip-container-shape-end-start * @cssproperty --mdc-tooltip-container-shape-end-end * @cssproperty --mdc-tooltip-enabled-label-color * * @version * Material Design 3 * * @link * https://m3.material.io/components/tooltip/overview */ export declare class MDCTooltip extends MDCTooltip_base implements ITooltip { static styles: import("lit").CSSResult; position: TooltipPosition; open: boolean; rich: boolean; plain: boolean; hasContent: boolean; hasActions: boolean; protected readonly containerElement: HTMLDivElement | null; constructor(); connectedCallback(): void; protected willUpdate(changedProperties: PropertyValues<this>): void; protected getRenderClasses(): { container: boolean; 'has-content': boolean; 'has-actions': boolean; 'has-headline': boolean; }; protected render(): TemplateResult; protected renderHeadline(): TemplateResult; protected renderContent(): TemplateResult; protected renderActions(): TemplateResult; /** * Shows the tooltip. */ show(): Promise<void>; /** * Hides the tooltip. */ hide(): Promise<void>; private detectRichMode; private hasHeadline; private handleOpen; private handleClose; private handleContentSlotChange; private handleActionsSlotChange; } export {}; //# sourceMappingURL=tooltip.d.ts.map