"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ContextMenuGroup = ContextMenuGroup;
exports.ContextMenuItem = ContextMenuItem;
exports.default = exports.ContextMenu = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Tooltip = _interopRequireDefault(require("../Tooltip"));

var _classnames4 = _interopRequireDefault(require("classnames"));

var _js = require("../../globals/js");

var _excluded = ["children", "className", "content", "href", "inline", "trigger"],
    _excluded2 = ["className"],
    _excluded3 = ["className"];
var prefix = _js.settings.prefix;
/** Context menu are used as navigational elements. They should contain commands that apply to the target object. */

var ContextMenu = function ContextMenu(_ref) {
  var children = _ref.children,
      className = _ref.className,
      content = _ref.content,
      href = _ref.href,
      inline = _ref.inline,
      _ref$trigger = _ref.trigger,
      trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
      other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var classNames = (0, _classnames4.default)((0, _defineProperty2.default)({}, "".concat(prefix, "--context-menu"), true), className);
  return /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
    className: classNames,
    content: content,
    noPadding: true,
    trigger: "click"
  }, children);
};

exports.ContextMenu = ContextMenu;

function ContextMenuGroup(_ref2) {
  var className = _ref2.className,
      other = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
  var classNames = (0, _classnames4.default)((0, _defineProperty2.default)({}, "".concat(prefix, "--context-menu__group"), true), className);
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    className: classNames
  }, other));
}

function ContextMenuItem(_ref3) {
  var className = _ref3.className,
      other = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
  var classNames = (0, _classnames4.default)((0, _defineProperty2.default)({}, "".concat(prefix, "--context-menu__item"), true), className);
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
    className: classNames
  }, other));
}

ContextMenu.propTypes = {
  /**
   * Provide the content for the Link
   */
  children: _propTypes.default.node,

  /**
   * Provide a custom className to be applied to the containing <a> node
   */
  className: _propTypes.default.string,

  /**
   * Inline links are used within a sentence or paragraph and are styled with an underline. They should not be paired with an icon.
   */
  inline: _propTypes.default.bool
};
var _default = ContextMenu;
exports.default = _default;