feat(ui): expose advanced popover positioning

Forward explicit anchors and position-method selection through PopoverContent so consumers can position popovers against virtual or custom anchors without bypassing the shared primitive.
This commit is contained in:
Maofeng
2026-07-31 16:06:44 +08:00
parent d364e5e39f
commit 94506aa349
+11 -1
View File
@@ -27,7 +27,13 @@ function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
type PopoverContentProps = PopoverPrimitive.Popup.Props &
Pick<
PopoverPrimitive.Positioner.Props,
"align" | "alignOffset" | "arrowPadding" | "side" | "sideOffset"
| "align"
| "alignOffset"
| "anchor"
| "arrowPadding"
| "positionMethod"
| "side"
| "sideOffset"
> & {
/**
* Renders the popup with an AnchoredSurface and connects its tail to the
@@ -42,7 +48,9 @@ function PopoverContent({
className,
align = "center",
alignOffset = 0,
anchor,
arrowPadding,
positionMethod,
render,
showArrow = false,
side = "bottom",
@@ -75,7 +83,9 @@ function PopoverContent({
<PopoverPrimitive.Positioner
align={align}
alignOffset={alignOffset}
anchor={anchor}
arrowPadding={resolvedArrowPadding}
positionMethod={positionMethod}
side={side}
sideOffset={resolvedSideOffset}
className="isolate z-50"