import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["children", "className", "content", "href", "inline", "trigger"],
    _excluded2 = ["className"],
    _excluded3 = ["className"];
import React from 'react';
import PropTypes from 'prop-types';
import Tooltip from '../Tooltip';
import classnames from 'classnames';
import { settings } from '../../globals/js';
var prefix = settings.prefix;
/** Context menu are used as navigational elements. They should contain commands that apply to the target object. */

export 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 = _objectWithoutProperties(_ref, _excluded);

  var classNames = classnames(_defineProperty({}, "".concat(prefix, "--context-menu"), true), className);
  return /*#__PURE__*/React.createElement(Tooltip, {
    className: classNames,
    content: content,
    noPadding: true,
    trigger: "click"
  }, children);
};
export function ContextMenuGroup(_ref2) {
  var className = _ref2.className,
      other = _objectWithoutProperties(_ref2, _excluded2);

  var classNames = classnames(_defineProperty({}, "".concat(prefix, "--context-menu__group"), true), className);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: classNames
  }, other));
}
export function ContextMenuItem(_ref3) {
  var className = _ref3.className,
      other = _objectWithoutProperties(_ref3, _excluded3);

  var classNames = classnames(_defineProperty({}, "".concat(prefix, "--context-menu__item"), true), className);
  return /*#__PURE__*/React.createElement("div", _extends({
    className: classNames
  }, other));
}
ContextMenu.propTypes = {
  /**
   * Provide the content for the Link
   */
  children: PropTypes.node,

  /**
   * Provide a custom className to be applied to the containing <a> node
   */
  className: PropTypes.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.bool
};
export default ContextMenu;