import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { StyledPopover } from './Popover.styles.js';
import { getPlacements } from '../../../../utils/getPopoverPlacement.js';
import { getSizeValueFromProp } from '../../../../utils/getSizeValueFromProp.js';

var _excluded = ["children", "placement", "calendarContainerWidth", "calendarContainerHeight"];
var Popover = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var children = _ref.children,
    placement = _ref.placement,
    calendarContainerWidth = _ref.calendarContainerWidth,
    calendarContainerHeight = _ref.calendarContainerHeight,
    rest = _objectWithoutProperties(_ref, _excluded);
  var calendarContainerWidthValue = calendarContainerWidth ? getSizeValueFromProp(calendarContainerWidth, 'rem') : undefined;
  var calendarContainerHeightValue = calendarContainerHeight ? getSizeValueFromProp(calendarContainerHeight, 'rem') : undefined;
  return /*#__PURE__*/React__default.createElement(StyledPopover, _extends({
    ref: ref
  }, rest, {
    innerWidth: calendarContainerWidthValue,
    innerHeight: calendarContainerHeightValue,
    placement: getPlacements(placement, false),
    trigger: "click",
    isFocusTrapped: false,
    preventOverflow: false
  }), children);
});

export { Popover };
