"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ToolbarIcon = exports.GripIcon = exports.Chevron = void 0;

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

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

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

var _ChevronRight = _interopRequireDefault(require("@material-ui/icons/ChevronRight"));

var _MoreVert = _interopRequireDefault(require("@material-ui/icons/MoreVert"));

var _styles = require("@material-ui/core/styles");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

var getRotate = function getRotate(direction) {
  switch (direction) {
    case 'down':
      return 90;

    case 'up':
      return -90;

    case 'left':
      return 180;

    default:
      return 0;
  }
};

var Chevron = function Chevron(props) {
  var direction = props.direction,
      style = props.style;
  var rotate = getRotate(direction);
  return /*#__PURE__*/_react["default"].createElement(_ChevronRight["default"], {
    style: _objectSpread({
      transform: "rotate(".concat(rotate, "deg)")
    }, style)
  });
};

exports.Chevron = Chevron;
Chevron.propTypes = {
  direction: _propTypes["default"].string,
  style: _propTypes["default"].object
};

var GripIcon = function GripIcon(_ref) {
  var style = _ref.style;
  return /*#__PURE__*/_react["default"].createElement("span", {
    style: style
  }, /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], {
    style: {
      margin: '0 -16px'
    }
  }), /*#__PURE__*/_react["default"].createElement(_MoreVert["default"], null));
};

exports.GripIcon = GripIcon;
GripIcon.propTypes = {
  style: _propTypes["default"].object
};
var ToolbarIcon = (0, _styles.withStyles)(function (theme) {
  return {
    icon: {
      fontFamily: 'Cerebri Sans !important',
      fontSize: theme.typography.fontSize,
      fontWeight: 'bold',
      lineHeight: '14px',
      position: 'relative',
      top: '7px',
      width: '110px',
      height: '28px',
      whiteSpace: 'nowrap'
    }
  };
})(function (_ref2) {
  var classes = _ref2.classes;
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: classes.icon
  }, "+ Response Area");
});
exports.ToolbarIcon = ToolbarIcon;
//# sourceMappingURL=index.js.map