import React from 'react'; export type ToggletipPlacement = 'top' | 'bottom' | 'left' | 'right'; export type ToggletipSize = 'sm' | 'md'; export interface ToggletipProps { /** * Names the button for what it explains — "About log retention", not * "Info". Required: the button holds nothing but a glyph. */ 'aria-label': string; /** The explanation. Text, and at most a Link or a Button. */ children: React.ReactNode; /** Where the bubble sits. Flips when there is no room. */ placement?: ToggletipPlacement; /** The button: 16px glyph beside body-sm text, 20px beside body. */ size?: ToggletipSize; isOpen?: boolean; defaultOpen?: boolean; onOpenChange?: (isOpen: boolean) => void; className?: string; } /** * Toggletip — an "ⓘ" that opens an explanation on click, with room for a link. * * WHY NOT TOOLTIP, AND WHY NOT POPOVER * * A Tooltip opens on hover, closes on pointer-out and cannot be focused, so a * link in one is unreachable — and a hover-only hint is invisible on touch. * A Popover is a dialog: it takes focus, traps it, and hides the rest of the * page from assistive technology, which is a lot of ceremony for a sentence of * help beside a label. A toggletip sits between: opened on purpose, it stays * open, and it is part of the page. * * HOW IT IS BUILT * * - The bubble is rendered right after the button in the DOM, not portalled, * so the next Tab from the button lands on a link inside it. It is * positioned with `useOverlayPosition`, which measures against the * bubble's own containing block, so it still flips and stays on screen. * - Focus stays on the button when it opens. The bubble is a live region * that is always in the page — empty while closed — so its text is read * out on open without focus having to move. The same reason TableBatchBar * stays mounted: a live region inserted with its message is silent. * - It closes on Escape (focus back to the button), on a press outside, and * when focus leaves the button and bubble together. It never traps focus * and never hides the page — it is not modal. */ export declare function Toggletip({ children, ...props }: ToggletipProps): React.JSX.Element; export declare namespace Toggletip { var displayName: string; } /** * The behaviour both Toggletip and AILabel are: a button that opens an * explanation in the page. `children` is what the button shows; `content` * is the explanation. Internal — not exported from the package. */ export declare function ToggletipBase({ 'aria-label': ariaLabel, children: face, content: children, placement, size, isOpen, defaultOpen, onOpenChange, className, rootClassName, buttonClassName, }: Omit & { children: React.ReactNode; content: React.ReactNode; rootClassName?: string; buttonClassName?: string; }): React.JSX.Element; //# sourceMappingURL=Toggletip.d.ts.map