Update PopoverContent
* Add PopoverContentProps * Set sideOffset as default prop * Add class name to arrow
This commit is contained in:
parent
a082c392ef
commit
075e4d52d7
1 changed files with 9 additions and 5 deletions
|
|
@ -8,7 +8,8 @@ interface Props
|
||||||
extends React.DetailedHTMLProps<
|
extends React.DetailedHTMLProps<
|
||||||
React.DialogHTMLAttributes<HTMLDivElement>,
|
React.DialogHTMLAttributes<HTMLDivElement>,
|
||||||
HTMLDivElement
|
HTMLDivElement
|
||||||
> {}
|
>,
|
||||||
|
PopoverPrimitive.PopoverContentProps {}
|
||||||
|
|
||||||
export const Popover = PopoverPrimitive.Root
|
export const Popover = PopoverPrimitive.Root
|
||||||
export const PopoverAnchor = PopoverPrimitive.Anchor
|
export const PopoverAnchor = PopoverPrimitive.Anchor
|
||||||
|
|
@ -26,15 +27,18 @@ export const PopoverContent = React.forwardRef<HTMLDivElement, Props>(
|
||||||
return (
|
return (
|
||||||
<PopoverPrimitive.Portal>
|
<PopoverPrimitive.Portal>
|
||||||
<PopoverPrimitive.Content
|
<PopoverPrimitive.Content
|
||||||
sideOffset={5}
|
|
||||||
{...props}
|
{...props}
|
||||||
className={classes}
|
className={classes}
|
||||||
ref={forwardedRef}
|
ref={forwardedRef}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
<PopoverPrimitive.Arrow />
|
<PopoverPrimitive.Arrow className="Arrow" />
|
||||||
</PopoverPrimitive.Content>
|
</PopoverPrimitive.Content>
|
||||||
</PopoverPrimitive.Portal>
|
</PopoverPrimitive.Portal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
PopoverContent.defaultProps = {
|
||||||
|
sideOffset: 8,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue