import { ElementRects, Placement } from '@floating-ui/react'; import { Align, ElementPosition, ExtendedPlacement, Justify, TransformAlign } from '../Popover/Popover.types'; /** * Returns the width and height as well as the top, bottom, left, and right positions of an element * within a given container. If `scrollContainer` is undefined, the position is relative to the * document. */ export declare function getElementDocumentPosition(element: HTMLElement | null, scrollContainer?: HTMLElement | null, isReference?: boolean): ElementPosition; /** * Function to convert `align` and `justify` props to a desired Floating UI * {@link https://floating-ui.com/docs/useFloating#placement placement} * value to provide in {@link https://floating-ui.com/docs/useFloating#placement useFloating hook}. * Floating UI supports 12 placements out-of-the-box. In addition to these placements, we override * the `align` prop when it is set to 'center-horizontal' or 'center-vertical' to * {@link https://floating-ui.com/docs/offset#creating-custom-placements create custom placements} */ export declare const getFloatingPlacement: (align: Align, justify: Justify) => Placement; /** * Function to derive window-safe align and justify values that are used when rendering * children. The placement calculated by Floating UI does not explicitly specify the justify * value when it is 'middle' */ export declare const getWindowSafePlacementValues: (placement: Placement) => { align: Align; justify: Justify; }; /** * Function to extend the {@link https://floating-ui.com/docs/usefloating#placement-1 final placement} * calculated by the `useFloating` hook and provide the align value used for transform styling. * * Floating UI supports 12 placements out-of-the-box. We extend these placements when the `align` prop is * set to 'center-horizontal' or 'center-vertical' */ export declare const getExtendedPlacementValues: ({ placement, align: alignProp, }: { placement: Placement; align: Align; }) => { placement: ExtendedPlacement; transformAlign: TransformAlign; }; /** * This function calculates the offset value of the popover element based on the `align` prop * If the `align` prop is 'center-horizontal' or 'center-vertical', an offset value is calculated * to position the popover element on top of the reference element. Otherwise, the `spacing` prop * is used to calculate the offset value */ export declare const getOffsetValue: (align: Align, spacing: number, rects: ElementRects) => number; //# sourceMappingURL=positionUtils.d.ts.map