import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["span"]; type $Props = { /** * Specify the tooltip text * @default "" */ tooltipText?: string; /** * Set to `true` to open the tooltip. * @default false */ open?: boolean; /** * Set the alignment of the tooltip relative to the icon. * `start` and `end` name inline sides, so they swap under `dir="rtl"`. * @default "center" */ align?: "start" | "center" | "end"; /** * Set the direction of the tooltip relative to the icon. * @default "bottom" */ direction?: "top" | "bottom"; /** * Set an id for the tooltip div element * @default uniqueId() */ id?: string; /** * By default, the tooltip is opened on hover or focus. * Set to `true` to open the tooltip on click/focus instead of on hover. * Unhovering or blurring the tooltip will close it. * @default false */ clickToOpen?: boolean; /** * Specify the duration in milliseconds to delay before displaying the tooltip. * Defaults to the enclosing `TooltipGroup`'s delay, or `100`. */ enterDelayMs?: number | undefined; /** * Specify the duration in milliseconds to delay before hiding the tooltip. * Defaults to the enclosing `TooltipGroup`'s delay, or `300`. */ leaveDelayMs?: number | undefined; /** * Obtain a reference to the button HTML element. * @default null */ ref?: null | HTMLButtonElement; /** * Set to `true` to always render the tooltip in a portal, or `false` to * keep it in place. Left unset, the tooltip opens in a portal inside a * `Modal`, or when a box around it (`overflow` other than `visible`, such * as a `DataTable`) would cut it off. */ portalTooltip?: boolean | undefined; tooltip?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type TooltipDefinitionProps = Omit<$RestProps, keyof $Props> & $Props; export default class TooltipDefinition extends SvelteComponentTyped< TooltipDefinitionProps, { blur: WindowEventMap["blur"]; click: WindowEventMap["click"]; close: CustomEvent; focus: WindowEventMap["focus"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; open: CustomEvent; }, { default: Record; tooltip: Record; } > {}