import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import { jsx } from '@emotion/core';
import { Fragment, forwardRef } from 'react';
import _pt from 'prop-types';
import { MdKeyboardArrowDown } from 'react-icons/md';
import { DisableReachStyleCheck } from '../../utils/helpers/DisableReachStyleCheck.esm.js';
import { Menu, MenuButton, MenuList, MenuItems, MenuItem, MenuLink, MenuPopover, useMenuButtonContext } from '../../../node_modules/@reach/menu-button/dist/menu-button.esm.esm.js';
import { dropdownButtonCss, dropdownButtonIconCss, menuItemCss, dropdownCss, dropdownSizeCss } from './DropdownMenu.styles.esm.js';

var DropdownMenu = function DropdownMenu(props) {
  return jsx(Fragment, null, jsx(DisableReachStyleCheck, {
    reachComponent: "menu-button"
  }), jsx(Menu, props));
};
var DropdownMenuButton = function DropdownMenuButton(props) {
  return jsx(MenuButton, props);
};
var DropdownMenuButtonStyled = function DropdownMenuButtonStyled(_ref) {
  var children = _ref.children,
      props = _objectWithoutProperties(_ref, ["children"]);

  return jsx(DropdownMenuButton, _extends({}, props, {
    css: dropdownButtonCss
  }), children, jsx(MdKeyboardArrowDown, {
    css: dropdownButtonIconCss
  }));
};
var DropdownMenuItems = function DropdownMenuItems(_ref2) {
  var _ref2$size = _ref2.size,
      size = _ref2$size === void 0 ? "LEGACY" : _ref2$size,
      rest = _objectWithoutProperties(_ref2, ["size"]);

  var finalCss = function finalCss(theme) {
    return [dropdownCss(theme), dropdownSizeCss[size](theme)];
  };

  return jsx(MenuList, _extends({}, rest, {
    css: finalCss
  }));
};
DropdownMenuItems.propTypes = {
  size: _pt.oneOf(["AUTO", "MAX_CONTENT", "LEGACY"])
};
var DropdownMenuItemsLowLevel = function DropdownMenuItemsLowLevel(_ref3) {
  var _ref3$size = _ref3.size,
      size = _ref3$size === void 0 ? "LEGACY" : _ref3$size,
      rest = _objectWithoutProperties(_ref3, ["size"]);

  var finalCss = function finalCss(theme) {
    return [dropdownCss(theme), dropdownSizeCss[size](theme)];
  };

  return jsx(MenuItems, _extends({}, rest, {
    css: finalCss
  }));
};
DropdownMenuItemsLowLevel.propTypes = {
  size: _pt.oneOf(["AUTO", "MAX_CONTENT", "LEGACY"])
};
var DropdownMenuItem = function DropdownMenuItem(props) {
  return jsx(MenuItem, _extends({}, props, {
    css: menuItemCss
  }));
};
var DropdownMenuLink = forwardRef(function DropdownMenuLink(props, ref) {
  return jsx(MenuLink, _extends({
    ref: ref
  }, props, {
    css: menuItemCss
  }));
});
function DropdownMenuPopover(props) {
  return jsx(MenuPopover, props);
}
function useDropdownMenuContext() {
  return useMenuButtonContext();
}
DropdownMenu.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenu"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenu",
    docgenInfo: DropdownMenu.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuButton.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuButton"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuButton",
    docgenInfo: DropdownMenuButton.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuButtonStyled.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuButtonStyled"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuButtonStyled",
    docgenInfo: DropdownMenuButtonStyled.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuItems.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuItems",
  "props": {
    "size": {
      "defaultValue": {
        "value": "`LEGACY`",
        "computed": false
      },
      "required": false
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuItems",
    docgenInfo: DropdownMenuItems.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuItemsLowLevel.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuItemsLowLevel",
  "props": {
    "size": {
      "defaultValue": {
        "value": "`LEGACY`",
        "computed": false
      },
      "required": false
    }
  }
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuItemsLowLevel",
    docgenInfo: DropdownMenuItemsLowLevel.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuItem.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuItem"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuItem",
    docgenInfo: DropdownMenuItem.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuLink.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuLink"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuLink",
    docgenInfo: DropdownMenuLink.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

DropdownMenuPopover.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "DropdownMenuPopover"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/DropdownMenu/DropdownMenu.tsx"] = {
    name: "DropdownMenuPopover",
    docgenInfo: DropdownMenuPopover.__docgenInfo,
    path: "src/components/DropdownMenu/DropdownMenu.tsx"
  };
}

export { DropdownMenu, DropdownMenuButton, DropdownMenuButtonStyled, DropdownMenuItem, DropdownMenuItems, DropdownMenuItemsLowLevel, DropdownMenuLink, DropdownMenuPopover, useDropdownMenuContext };
//# sourceMappingURL=DropdownMenu.esm.js.map
