import "core-js/modules/es6.object.assign";
import "core-js/modules/web.dom.iterable";
import "core-js/modules/es6.array.iterator";
import "core-js/modules/es6.object.keys";

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { EuiBetaBadge } from '../../components/badge/beta_badge';
import { ICON_TYPES } from '../icon';

var renderContent = function renderContent(children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType) {
  return React.createElement("div", {
    className: "euiKeyPadMenuItem__inner"
  }, betaBadgeLabel && React.createElement("span", {
    className: "euiKeyPadMenuItem__betaBadgeWrapper"
  }, React.createElement(EuiBetaBadge, {
    className: "euiKeyPadMenuItem__betaBadge",
    label: betaBadgeLabel,
    iconType: betaBadgeIconType,
    tooltipContent: betaBadgeTooltipContent
  })), React.createElement("div", {
    className: "euiKeyPadMenuItem__icon"
  }, children), React.createElement("p", {
    className: "euiKeyPadMenuItem__label"
  }, label));
};

var commonPropTypes = {
  children: PropTypes.node.isRequired,
  label: PropTypes.node.isRequired,

  /**
   * Add a badge to the card to label it as "Beta" or other non-GA state
   */
  betaBadgeLabel: PropTypes.string,

  /**
   * Supply an icon type if the badge should just be an icon
   */
  betaBadgeIconType: PropTypes.oneOf(ICON_TYPES),

  /**
   * Add a description to the beta badge (will appear in a tooltip)
   */
  betaBadgeTooltipContent: PropTypes.node
};
export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
  var href = _ref.href,
      label = _ref.label,
      children = _ref.children,
      className = _ref.className,
      betaBadgeLabel = _ref.betaBadgeLabel,
      betaBadgeTooltipContent = _ref.betaBadgeTooltipContent,
      betaBadgeIconType = _ref.betaBadgeIconType,
      rest = _objectWithoutProperties(_ref, ["href", "label", "children", "className", "betaBadgeLabel", "betaBadgeTooltipContent", "betaBadgeIconType"]);

  var classes = classNames('euiKeyPadMenuItem', {
    'euiKeyPadMenuItem--hasBetaBadge': betaBadgeLabel
  }, className);
  return React.createElement("a", _extends({
    href: href,
    className: classes,
    role: "menuitem"
  }, rest), renderContent(children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType));
};
EuiKeyPadMenuItem.propTypes = _objectSpread({}, {
  href: PropTypes.string
}, commonPropTypes);
export var EuiKeyPadMenuItemButton = function EuiKeyPadMenuItemButton(_ref2) {
  var onClick = _ref2.onClick,
      label = _ref2.label,
      children = _ref2.children,
      className = _ref2.className,
      betaBadgeLabel = _ref2.betaBadgeLabel,
      betaBadgeTooltipContent = _ref2.betaBadgeTooltipContent,
      betaBadgeIconType = _ref2.betaBadgeIconType,
      rest = _objectWithoutProperties(_ref2, ["onClick", "label", "children", "className", "betaBadgeLabel", "betaBadgeTooltipContent", "betaBadgeIconType"]);

  var classes = classNames('euiKeyPadMenuItem', {
    'euiKeyPadMenuItem--hasBetaBadge': betaBadgeLabel
  }, className);
  return React.createElement("button", _extends({
    type: "button",
    onClick: onClick,
    className: classes
  }, rest), renderContent(children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType));
};
EuiKeyPadMenuItemButton.propTypes = _objectSpread({}, {
  onClick: PropTypes.func
}, commonPropTypes);
EuiKeyPadMenuItem.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "EuiKeyPadMenuItem",
  "props": {
    "href": {
      "type": {
        "name": "string"
      },
      "required": false,
      "description": ""
    },
    "children": {
      "type": {
        "name": "node"
      },
      "required": true,
      "description": ""
    },
    "label": {
      "type": {
        "name": "node"
      },
      "required": true,
      "description": ""
    },
    "betaBadgeLabel": {
      "type": {
        "name": "string"
      },
      "required": false,
      "description": "Add a badge to the card to label it as \"Beta\" or other non-GA state"
    },
    "betaBadgeIconType": {
      "type": {
        "name": "enum",
        "computed": true,
        "value": "ICON_TYPES"
      },
      "required": false,
      "description": "Supply an icon type if the badge should just be an icon"
    },
    "betaBadgeTooltipContent": {
      "type": {
        "name": "node"
      },
      "required": false,
      "description": "Add a description to the beta badge (will appear in a tooltip)"
    }
  }
};
EuiKeyPadMenuItemButton.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "EuiKeyPadMenuItemButton",
  "props": {
    "onClick": {
      "type": {
        "name": "func"
      },
      "required": false,
      "description": ""
    },
    "children": {
      "type": {
        "name": "node"
      },
      "required": true,
      "description": ""
    },
    "label": {
      "type": {
        "name": "node"
      },
      "required": true,
      "description": ""
    },
    "betaBadgeLabel": {
      "type": {
        "name": "string"
      },
      "required": false,
      "description": "Add a badge to the card to label it as \"Beta\" or other non-GA state"
    },
    "betaBadgeIconType": {
      "type": {
        "name": "enum",
        "computed": true,
        "value": "ICON_TYPES"
      },
      "required": false,
      "description": "Supply an icon type if the badge should just be an icon"
    },
    "betaBadgeTooltipContent": {
      "type": {
        "name": "node"
      },
      "required": false,
      "description": "Add a description to the beta badge (will appear in a tooltip)"
    }
  }
};