package.dist.components.popover.popover-root.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.
The newest version!
'use client';
import { jsx } from 'react/jsx-runtime';
import { mergeProps } from '@zag-js/react';
import { splitPresenceProps } from '../presence/split-presence-props.js';
import { usePresence } from '../presence/use-presence.js';
import { PresenceProvider } from '../presence/use-presence-context.js';
import { usePopover } from './use-popover.js';
import { PopoverProvider } from './use-popover-context.js';
const PopoverRoot = (props) => {
const [presenceProps, { children, ...localProps }] = splitPresenceProps(props);
const popover = usePopover(localProps);
const presence = usePresence(mergeProps({ present: popover.open }, presenceProps));
return /* @__PURE__ */ jsx(PopoverProvider, { value: popover, children: /* @__PURE__ */ jsx(PresenceProvider, { value: presence, children }) });
};
export { PopoverRoot };
© 2015 - 2025 Weber Informatics LLC | Privacy Policy