{children}
@@ -152,16 +154,36 @@ function PopoverPositioner({ side = 'top', sideOffset = 5, children }: PopoverPo
}
function PopoverPopup({ className, children }: PopoverPopupProps): JSX.Element {
- const { getFloatingProps } = usePopoverContext();
+ const { getFloatingProps, context, transitionStatus } = usePopoverContext();
+ const { refs, placement } = context;
+ const triggerElement = refs.reference.current as HTMLElement | null;
+
+ // Copy data attributes from trigger element
+ const dataAttributes = triggerElement?.attributes
+ ? Object.fromEntries(
+ Array.from(triggerElement.attributes)
+ .filter(attr => attr.name.startsWith('data-'))
+ .map(attr => [attr.name, attr.value]),
+ )
+ : {};
return (
-
+
{children}
);
}
-function PopoverPortal({ children, root, rootId }: PopoverPortalProps): JSX.Element {
+function PopoverPortal({ children, root, rootId = '@default_portal_id' }: PopoverPortalProps): JSX.Element {
return (
{children}
diff --git a/packages/react/react/src/skins/frosted/styles.ts b/packages/react/react/src/skins/frosted/styles.ts
index c06db070..1f044ccf 100644
--- a/packages/react/react/src/skins/frosted/styles.ts
+++ b/packages/react/react/src/skins/frosted/styles.ts
@@ -157,6 +157,8 @@ const styles: FrostedSkinStyles = {
'relative px-1.5 py-3.5 rounded-full',
'bg-white/10 backdrop-blur-3xl backdrop-saturate-150 backdrop-brightness-90',
'ring ring-white/10 ring-inset shadow-sm shadow-black/15',
+ // Animation
+ 'transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[instant]:duration-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0',
// Border to enhance contrast on lighter videos
'after:absolute after:inset-0 after:ring after:rounded-[inherit] after:ring-black/15 after:pointer-events-none after:z-10',
// Reduced transparency for users with preference