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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user