@alegendstale/holly-components
Version:
Reusable UI components created using lit
51 lines • 1.55 kB
TypeScript
import { LitElement } from "lit";
export declare const triggerTypes: readonly ["hover", "click", "manual"];
export type TriggerTypes = typeof triggerTypes[number];
type client = {
x: number;
y: number;
};
/**
* A tooltip that can display information on hover or click
*
* @cssprop {<length>} --tooltip-x - The x position of the tooltip.
* @cssprop {<length>} --tooltip-y - The y position of the tooltip.
*/
export declare class ToolTip extends LitElement {
static styles: import("lit").CSSResult[];
/** @internal */
textEl?: HTMLParagraphElement;
/** Whether the tooltip can be visible. */
display: boolean;
/** @internal */
private _trigger;
/**
* Which type of trigger the tool-tip will use.
* @type {TriggerTypes}
* @default manual
*/
set trigger(val: TriggerTypes);
get trigger(): TriggerTypes;
/** The text to display on the tool-tip. */
text: string;
render(): import("lit-html").TemplateResult<1>;
/** Clamps the tooltip position to within the bounds. */
protected clampPosition(pos: {
x: number;
y: number;
}, bounds: DOMRect): {
x: number;
y: number;
};
/** Sets the tooltip position, clamped to a set of bounds. */
setClampedPosition({ x, y }: client, bounds: DOMRect): void;
/** Sets the tooltip position. */
setPosition({ x, y }: client): void;
}
declare global {
interface HTMLElementTagNameMap {
'tool-tip': ToolTip;
}
}
export {};
//# sourceMappingURL=tool-tip.d.ts.map