import { LitElement } from 'lit'; /** * Tooltips are floating containers for displaying additional information * for the currently focused element. A tooltip can be useful when you want * to e.g. give a hint about an existing Command Menu shortcut. * * @status ready * @category overlay * @slot - The tooltip content * @slot shortcut - Optional slot that holds shortcut keys to access the subject * @cssprop [--n-tooltip-max-size=50ch] - Controls the maximum inline size, or width, of the tooltip. */ export default class Tooltip extends LitElement { static styles: import("lit").CSSResult[]; private static lastOpened?; private shortcutSlot; private events; private currentElement?; private timeoutId?; /** * the proxy element is for cases where the targetElement is a web component, * and the WC has a focusable child in its shadow root e.g. a button component. * in this case, when the tooltip is shown, we inject the proxy into targetElement's shadow root * and wire up aria-describedby from the focusable element to the proxy. * when the tooltip is hidden, we remove the proxy and remove the aria-describedby relationship. */ private proxy?; /** * The current state of the tooltip, dependent on the state machine */ private state; private coords; /** * Control the position of the tooltip component. * When set to "none", the tooltip will be shown above * but accommodate for browser boundaries. */ position: 'block-end' | 'block-start' | 'inline-start' | 'inline-end'; /** * The tooltip role, set on the component by default. */ role: string; /** * The id for the active element to reference via aria-describedby. */ id: string; /** * The delay in milliseconds before the tooltip is opened. */ delay: number; /** * Apply all event listeners */ connectedCallback(): void; disconnectedCallback(): void; render(): import("lit").TemplateResult<1>; protected handleIdChange(): void; private handleStateChange; /** * Setting and updating the position of the tooltip */ private updatePosition; private hideTooltip; private reposition; private handleShow; private handleHide; private hideOnEscape; private addDescribedBy; private removeDescribedBy; } declare global { interface HTMLElementTagNameMap { 'nord-tooltip': Tooltip; } }