UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

17 lines (16 loc) 651 B
import type { Middleware, Placement } from "@floating-ui/react-dom"; type Side = "top" | "right" | "bottom" | "left"; type Align = "start" | "center" | "end"; type Measurable = { getBoundingClientRect(): DOMRect; }; /** * `transformOrigin` is a custom middleware for floating-ui that calculates the transform origin of the floating-element. */ declare function transformOrigin(options: { arrowWidth: number; arrowHeight: number; }): Middleware; declare function getSideAndAlignFromPlacement(placement: Placement): readonly [Side, Align]; export { getSideAndAlignFromPlacement, transformOrigin }; export type { Side, Align, Measurable };