import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["span"]; type $Props = { /** * Set the alignment of the content relative to the button. * Above and below the button, `start` and `end` name inline sides, so * they swap under `dir="rtl"`. * @default "center" */ align?: "start" | "center" | "end"; /** * Set the direction of the content relative to the button. * @default "bottom" */ direction?: "top" | "right" | "bottom" | "left"; /** * Set to `true` to open the toggletip. * @default false */ open?: boolean; /** * Specify the icon to render for the toggletip button. * Defaults to ``. * @default Information */ icon?: Icon; /** * Specify the icon name attribute * @default "" */ iconName?: string; /** * Specify the ARIA label for the toggletip button. * Set to `""` to name the button by its content instead. * @default "Show information" */ iconDescription?: string; /** * Set the toggletip label text. * Alternatively, use the "labelChildren" slot. * @default "" */ labelText?: string; /** * Obtain a reference to the button HTML element. * @default null */ ref?: null | HTMLButtonElement; /** * Set to `true` to always render the content in a portal, or `false` to * keep it in place. Left unset, the content moves to a portal inside a * `Modal`, or when a box around it (`overflow` other than `visible`) would * cut it off. */ portalTooltip?: boolean | undefined; /** * Specify a class for the popover. * The class is also applied when the popover is portalled. */ popoverClass?: string | undefined; /** * Set an id for the toggletip element. * The content id derives from it as `{id}-content`. * @default uniqueId() */ id?: string; /** Set the toggletip label, rendered beside the button. */ labelChildren?: (this: void) => void; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type ToggletipProps = Omit<$RestProps, keyof $Props> & $Props; export default class Toggletip extends SvelteComponentTyped< ToggletipProps, { close: CustomEvent; open: CustomEvent; }, { default: Record; /** Override the button icon. */ icon: Record; /** Set the toggletip label, rendered beside the button. */ labelChildren: Record; /** * @deprecated use the `labelChildren` slot */ labelText: Record; } > {}