import type { JSX, ValidComponent } from "@solidjs/web"; import type { BaseUIComponentProps } from "../../internals/types.js"; import { type PopoverAlign, type PopoverSide } from "./popover-positioner-context.js"; export interface PopoverPositionerState { /** Whether the popover is currently open. */ open: boolean; /** The side of the anchor the component is placed on. */ side: PopoverSide; /** The alignment of the component relative to the anchor. */ align: PopoverAlign; /** Whether the anchor element is hidden. */ anchorHidden: boolean; } export interface PopoverPositionerProps extends BaseUIComponentProps<"div", PopoverPositionerState> { /** * Tag/component to render. Defaults to `"div"`. Replaces the * pre-spike `render` prop (axis G). */ as?: ValidComponent; /** * Which side of the trigger to place the popover on. * @default "bottom" */ side?: PopoverSide | undefined; /** * How to align the popover along the chosen side. * @default "center" */ align?: PopoverAlign | undefined; /** * Gap (px) between the trigger and the popover. * @default 0 */ sideOffset?: number | undefined; /** * Shift (px) along the side for finer `start` / `end` alignment. * @default 0 */ alignOffset?: number | undefined; /** * Padding (px) between the arrow element and the positioner's edges. * @default 5 */ arrowPadding?: number | undefined; /** * Padding (px) between the positioner and the collision boundary. * @default 5 */ collisionPadding?: number | undefined; /** * `absolute` (default) or `fixed` CSS positioning strategy. * @default "absolute" */ positionMethod?: "absolute" | "fixed" | undefined; } /** * Positions the popover against the trigger. Renders a `