import { FlipOptions } from "@floating-ui/react-dom"; import React, { HTMLAttributes } from "react"; import type { AsChildProps } from "../../types/index.js"; import { type Align, type Measurable, type Side } from "./Floating.utils.js"; /** * Floating Root */ type FloatingContextValue = { anchor: Measurable | null; onAnchorChange: (anchor: Measurable | null) => void; }; export declare const FloatingProvider: React.FC, useFloatingContext: (strict?: S | undefined) => S extends true ? FloatingContextValue : FloatingContextValue | undefined; interface FloatingProps { children: React.ReactNode; } interface FloatingComponent extends React.FC { Anchor: typeof FloatingAnchor; Content: typeof FloatingContent; } declare const Floating: FloatingComponent; /** * Floating Anchor */ type FloatingAnchorProps = HTMLAttributes & AsChildProps & { virtualRef?: Measurable; }; /** * `FloatingAnchor` provides an anchor for a Floating instance. * Allows anchoring to non-DOM nodes like a cursor position when used with `virtualRef`. */ declare const FloatingAnchor: React.ForwardRefExoticComponent>; type Boundary = Element | null; interface FloatingContentProps extends HTMLAttributes { side?: Side; sideOffset?: number; align?: Align; alignOffset?: number; avoidCollisions?: boolean; collisionBoundary?: Boundary | Boundary[]; collisionPadding?: number | Partial>; hideWhenDetached?: boolean; updatePositionStrategy?: "optimized" | "always"; fallbackPlacements?: FlipOptions["fallbackPlacements"]; onPlaced?: () => void; /** * @default true */ enabled?: boolean; /** * Only use this option if your floating element is conditionally rendered, not hidden with CSS. * @default true */ autoUpdateWhileMounted?: boolean; arrow?: { className?: string; padding?: number; width: number; height: number; }; } declare const FloatingContent: React.ForwardRefExoticComponent>; export { Floating };