(frontend) add arrow toggle option to Popover primitive

Allow enabling/disabling arrow graphics in Popover component to create
more modular and flexible primitive.

Provides greater design flexibility by making arrow display optional,
enabling different visual presentations based on specific use cases.
This commit is contained in:
lebaudantoine
2025-08-21 11:52:19 +02:00
committed by aleb_the_flash
parent 8f28a46a5f
commit 89b1190bb4

View File

@@ -69,6 +69,7 @@ const StyledOverlayArrow = styled(OverlayArrow, {
export const Popover = ({
children,
variant = 'light',
withArrow = true,
...dialogProps
}: {
children: [
@@ -78,17 +79,20 @@ export const Popover = ({
| ReactNode,
]
variant?: 'dark' | 'light'
withArrow?: boolean
} & DialogProps) => {
const [trigger, popoverContent] = children
return (
<DialogTrigger>
{trigger}
<StyledPopover>
<StyledOverlayArrow variant={variant}>
<svg width={12} height={12} viewBox="0 0 12 12">
<path d="M0 0 L6 6 L12 0" />
</svg>
</StyledOverlayArrow>
{withArrow && (
<StyledOverlayArrow variant={variant}>
<svg width={12} height={12} viewBox="0 0 12 12">
<path d="M0 0 L6 6 L12 0" />
</svg>
</StyledOverlayArrow>
)}
<Dialog {...dialogProps}>
{({ close }) => (
<Box size="sm" type="popover" variant={variant}>