@procore/core-react
Version:
React library of Procore Design Guidelines
23 lines (22 loc) • 1.15 kB
TypeScript
import type { Middleware, MiddlewareData, offset, Placement as FloatingPlacement, ReferenceType } from '@floating-ui/react-dom';
import type { CSSProperties } from 'react';
import type { Placement } from '../_utils/placement';
export declare type OverlayOffsetValue = Parameters<typeof offset>[0];
export declare type OverlayRefType = (node: HTMLElement | null) => void;
export declare type ReferenceRefType = (node: ReferenceType | null) => void;
export declare type OverlayMiddleware = Middleware;
export declare type OverlayPlacement = FloatingPlacement;
export declare function useOverlay({ placement, middleware, }: {
placement: Placement;
middleware?: Middleware[];
}): {
isPositioned: boolean;
overlayRef: (node: HTMLElement | null) => void;
referenceRef: (node: ReferenceType | null) => void;
/** Dimensions of the floating element should not change before and after being positioned
* https://floating-ui.com/docs/computeposition#initial-layout
* https://github.com/floating-ui/floating-ui/issues/1740 */
overlayStyle: CSSProperties;
middlewareData: MiddlewareData;
placement: OverlayPlacement;
};