UNPKG

@dfinity/gix-components

Version:
22 lines (21 loc) 678 B
type translateTooltipParams = { containerRect: DOMRect; targetRect: DOMRect; tooltipRect: DOMRect; scrollbarWidth: number; top?: boolean; center?: boolean; }; /** * Returns how much the tooltip should be translated in the x and y directions * based on its current position. If the tooltip already has non-zero * translation, the returned values should be added to the current translation. * * The translation should be such that the tooltip remains within the bounds of * the container, centered on the target if possible. */ export declare const translateTooltip: (params: translateTooltipParams) => { x: number; y: number; }; export {};