"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.DropdownMenu = DropdownMenu;

var _react = require("@headlessui/react");

var _react2 = require("react");

var _jsxRuntime = require("react/jsx-runtime");

// anchors: top-right top-left bottom-right bottom-left
function DropdownMenu(_ref) {
  var buttonElement = _ref.buttonElement,
      className = _ref.className,
      anchor = _ref.anchor,
      content = _ref.content,
      dropdownClass = _ref.dropdownClass,
      buttonClass = _ref.buttonClass,
      menuDropdownStyle = _ref.menuDropdownStyle;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Menu, {
    as: "div",
    className: "".concat(className, " relative flex-shrink-0"),
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Menu.Button, {
      className: "".concat(buttonClass),
      children: buttonElement
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Transition, {
      as: _react2.Fragment,
      enter: "transition ease-out duration-100",
      enterFrom: "transform opacity-0 scale-95",
      enterTo: "transform opacity-100 scale-100",
      leave: "transition ease-in duration-75",
      leaveFrom: "transform opacity-100 scale-100",
      leaveTo: "transform opacity-0 scale-95",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Menu.Items, {
        style: menuDropdownStyle,
        className: "".concat(dropdownClass, " origin-").concat(anchor, " absolute mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 py-1 focus:outline-none"),
        children: content
      })
    })]
  });
}