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 &
|
type PopoverContentProps = PopoverPrimitive.Popup.Props &
|
||||||
Pick<
|
Pick<
|
||||||
PopoverPrimitive.Positioner.Props,
|
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
|
* Renders the popup with an AnchoredSurface and connects its tail to the
|
||||||
@@ -42,7 +48,9 @@ function PopoverContent({
|
|||||||
className,
|
className,
|
||||||
align = "center",
|
align = "center",
|
||||||
alignOffset = 0,
|
alignOffset = 0,
|
||||||
|
anchor,
|
||||||
arrowPadding,
|
arrowPadding,
|
||||||
|
positionMethod,
|
||||||
render,
|
render,
|
||||||
showArrow = false,
|
showArrow = false,
|
||||||
side = "bottom",
|
side = "bottom",
|
||||||
@@ -75,7 +83,9 @@ function PopoverContent({
|
|||||||
<PopoverPrimitive.Positioner
|
<PopoverPrimitive.Positioner
|
||||||
align={align}
|
align={align}
|
||||||
alignOffset={alignOffset}
|
alignOffset={alignOffset}
|
||||||
|
anchor={anchor}
|
||||||
arrowPadding={resolvedArrowPadding}
|
arrowPadding={resolvedArrowPadding}
|
||||||
|
positionMethod={positionMethod}
|
||||||
side={side}
|
side={side}
|
||||||
sideOffset={resolvedSideOffset}
|
sideOffset={resolvedSideOffset}
|
||||||
className="isolate z-50"
|
className="isolate z-50"
|
||||||
|
|||||||
Reference in New Issue
Block a user