'use strict';

var React = require('react');
var BottomSheet = require('../bottomSheet/BottomSheet.js');
var Panel = require('../panel/Panel.js');
var jsxRuntime = require('react/jsx-runtime');
var useLayout = require('../hooks/useLayout/useLayout.js');
var position = require('../propsValues/position.js');

const ResponsivePanel = /*#__PURE__*/React.forwardRef(function ResponsivePanel({
  anchorRef,
  arrow = false,
  flip = true,
  children,
  className = undefined,
  onClose,
  open = false,
  position: position$1 = position.Position.BOTTOM,
  anchorWidth = false,
  'aria-label': ariaLabel,
  'aria-labelledby': ariaLabelledBy
}, reference) {
  const {
    isMobile
  } = useLayout.useLayout();
  if (isMobile) {
    return /*#__PURE__*/jsxRuntime.jsx(BottomSheet, {
      "aria-label": ariaLabel,
      "aria-labelledby": ariaLabelledBy,
      open: open,
      className: className,
      onClose: onClose,
      children: children
    }, "bottomSheet");
  }
  return /*#__PURE__*/jsxRuntime.jsx(Panel, {
    ref: reference,
    flip: flip,
    arrow: arrow,
    open: open,
    position: position$1,
    anchorWidth: anchorWidth,
    anchorRef: anchorRef,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledBy,
    className: className,
    onClose: onClose,
    children: children
  }, "panel");
});

module.exports = ResponsivePanel;
//# sourceMappingURL=ResponsivePanel.js.map
