import { forwardRef } from 'react';
import '../theme.mjs';
import '../direction.mjs';
import '../propsValues/control.mjs';
import '../propsValues/breakpoint.mjs';
import '../propsValues/size.mjs';
import '../propsValues/typography.mjs';
import '../propsValues/width.mjs';
import '../propsValues/type.mjs';
import '../propsValues/dateMode.mjs';
import '../propsValues/monthFormat.mjs';
import { Position } from '../propsValues/position.mjs';
import '../propsValues/layouts.mjs';
import '../propsValues/status.mjs';
import '../propsValues/sentiment.mjs';
import '../propsValues/profileType.mjs';
import '../propsValues/variant.mjs';
import '../propsValues/scroll.mjs';
import '../propsValues/markdownNodeType.mjs';
import '../fileType.mjs';
import '@transferwise/icons';
import 'clsx';
import 'react-intl';
import '../closeButton/CloseButton.messages.mjs';
import { jsx } from 'react/jsx-runtime';
import BottomSheet from '../bottomSheet/BottomSheet.mjs';
import '@transferwise/neptune-validation';
import '../../provider/direction/DirectionProvider.mjs';
import { useLayout } from '../hooks/useLayout/useLayout.mjs';
import Panel from '../panel/Panel.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
