import { forwardRef } from 'react';
import BottomSheet from '../bottomSheet/BottomSheet.mjs';
import Panel from '../panel/Panel.mjs';
import { jsx } from 'react/jsx-runtime';
import { useLayout } from '../hooks/useLayout/useLayout.mjs';
import { Position } from '../propsValues/position.mjs';

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

export { ResponsivePanel as default };
//# sourceMappingURL=ResponsivePanel.mjs.map
