import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["button"]; type $Props = { /** * Specify the tooltip text. * Alternatively, use the "tooltipChildren" slot. * @default "" */ tooltipText?: string; /** * Set to `true` to open the tooltip. * @default false */ open?: boolean; /** * Specify the icon to render. */ icon?: Icon | undefined; /** * Specify the icon size. * Carbon icons use a 16/20/24/32 scale, but any number (pixels) can be used. * @default 16 */ size?: (16 | 20 | 24 | 32 | (number & {})); /** * Set to `true` to disable the tooltip icon * @default false */ disabled?: boolean; /** * Set the alignment of the tooltip relative to the icon. * Above and below 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" | "right" | "bottom" | "left"; /** * Set an id for the span element * @default uniqueId() */ id?: string; /** * 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 `100`, so the * pointer can move onto the tooltip. */ 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; /** Custom tooltip content. Replaces `tooltipText`. */ tooltipChildren?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type TooltipIconProps = Omit<$RestProps, keyof $Props> & $Props; export default class TooltipIcon extends SvelteComponentTyped< TooltipIconProps, { blur: WindowEventMap["blur"]; click: WindowEventMap["click"]; close: CustomEvent; focus: WindowEventMap["focus"]; mouseenter: WindowEventMap["mouseenter"]; mouseleave: WindowEventMap["mouseleave"]; mouseover: WindowEventMap["mouseover"]; open: CustomEvent; }, { default: Record; /** Custom tooltip content. Replaces `tooltipText`. */ tooltipChildren: Record; /** * @deprecated use the `tooltipChildren` slot */ tooltipText: Record; } > {}