import * as React from 'react'; import type { VirtualAnchor } from './mentions.js'; import { type Align, type PhysicalSide, type Side } from './placement.js'; import { type PrimitivePropsWithRef } from './primitive.js'; export { setMeasurementProperties, type Align, type PhysicalSide, type Side } from './placement.js'; interface PopperContextValue { /** A real element, or the rectangle-only reference Mentions positions against the caret. */ anchor: HTMLElement | VirtualAnchor | null; /** `explicit` marks an `Anchor` part, which outranks the trigger's own registration however the two happen to mount. */ setAnchor: (node: HTMLElement | VirtualAnchor | null, explicit?: boolean) => void; updateRef: React.RefObject<(() => void) | null>; } declare const usePopperContext: (consumerName: string) => PopperContextValue; /** * @internal Provides the anchor element to descendant `Popper*` parts; wrap the anchor and content in one. * @param updateRef Optional ref the mounted {@link PopperContent}'s reposition trigger publishes into, for a family root rendered outside this provider to expose its own `reposition()`. */ export declare function PopperRoot({ children, updateRef, }: { children: React.ReactNode; updateRef?: React.RefObject<(() => void) | null> | undefined; }): React.JSX.Element; /** @internal Marks its rendered element as the anchor that {@link PopperContent} positions against. */ export declare const PopperAnchor: { ({ ref: forwardedRef, explicit, ...props }: PrimitivePropsWithRef<"div"> & { explicit?: boolean | undefined; }): React.ReactNode; displayName: string; }; /** @internal Positioning props for {@link PopperContent}. */ export interface PopperContentProps extends PrimitivePropsWithRef<'div'> { /** * Preferred side of the anchor to render on; `start`/`end` are logical and follow the writing direction, `left`/`right` are physical and don't. * @default 'bottom' */ side?: Side | undefined; /** * Alignment of the content along the chosen side. * @default 'center' — except on the list popups (menu, menubar, select, combobox, autocomplete, mentions, tree-select) and submenus, which align to `'start'`. */ align?: Align | undefined; /** * Distance in pixels between the content and the anchor along `side`. * @default 0 — except on the popups that set their own: `4` on popover, date picker and the list popups, `8` on speed dial and tour. */ sideOffset?: number | undefined; /** * Offset in pixels along `align`, shifting the content perpendicular to `side`. * @default 0 */ alignOffset?: number | undefined; /** * Flips to the opposite side when there isn't room to render on the preferred side. * @default true */ avoidCollisions?: boolean | undefined; /** * Minimum distance in pixels kept from the collision boundary when avoiding * collisions. A number applies to every side; an object sets only the sides * it names, the rest falling back to `0`. * @default 8 */ collisionPadding?: number | Partial> | undefined; /** * Element (or elements) collisions are measured against, instead of the * content's clipping ancestors. Use it to keep an overlay inside a scroll * container or one pane of a split layout rather than the whole viewport. * @default undefined — the content's clipping ancestors. */ collisionBoundary?: Element | Element[] | null | undefined; } interface PopperOwnProps extends PopperContentProps { component?: string | undefined; arrowPadding?: number | undefined; hideWhenDetached?: boolean | undefined; } /** @internal Floating element positioned against the anchor via floating-ui; exposes `data-side`/`data-align` and provides arrow context. */ export declare const PopperContent: { ({ ref: forwardedRef, ...props }: PopperOwnProps): React.ReactNode; displayName: string; }; /** @internal Arrow pointing at the anchor; must render inside {@link PopperContent}, which positions it via context. */ export declare const PopperArrow: { ({ ref: forwardedRef, ...props }: PrimitivePropsWithRef<"span">): React.ReactNode; displayName: string; }; export { usePopperContext };