Skip to content

Commit

Permalink
Expose Popopver Anchor part (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmotta authored Sep 23, 2024
1 parent b469845 commit afa47e3
Show file tree
Hide file tree
Showing 2 changed files with 289 additions and 237 deletions.
12 changes: 12 additions & 0 deletions packages/radix-ui-themes/src/components/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,27 @@ const PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(
);
PopoverClose.displayName = 'Popover.Close';

type PopoverAnchorElement = React.ElementRef<typeof PopoverPrimitive.Anchor>;
interface PopoverAnchorProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor> {}
const PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(
({ children, ...props }, forwardedRef) => (
<PopoverPrimitive.Anchor {...props} ref={forwardedRef} />
)
);

PopoverAnchor.displayName = 'Popover.Anchor';

export {
PopoverRoot as Root,
PopoverContent as Content,
PopoverTrigger as Trigger,
PopoverClose as Close,
PopoverAnchor as Anchor,
};
export type {
PopoverRootProps as RootProps,
PopoverContentProps as ContentProps,
PopoverTriggerProps as TriggerProps,
PopoverCloseProps as CloseProps,
PopoverAnchorProps as AnchorProps,
};
Loading

0 comments on commit afa47e3

Please sign in to comment.