import * as React from 'react';
import PopoverElement from './PopoverElement';
import PopoverTrigger from './PopoverTrigger';
import { PopoverContext } from './usePopoverContext';
import usePopover from './usePopover';

var Popover = function Popover(_ref) {
  var children = _ref.children,
      placement = _ref.placement,
      id = _ref.id,
      useHover = _ref.useHover,
      useClick = _ref.useClick,
      _ref$defaultOpen = _ref.defaultOpen,
      defaultOpen = _ref$defaultOpen === void 0 ? false : _ref$defaultOpen,
      open = _ref.open,
      role = _ref.role,
      onOpenChange = _ref.onOpenChange;
  var popover = usePopover({
    placement: placement,
    customId: id,
    defaultOpen: defaultOpen,
    open: open,
    onOpenChange: onOpenChange,
    useHover: useHover,
    useClick: useClick,
    role: role
  });
  return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
    value: popover
  }, children);
};

Popover.Trigger = PopoverTrigger;
Popover.Element = PopoverElement;
export default Popover;