function _templateObject3() {
  var data = _taggedTemplateLiteral(["\n                margin-left: 5px;\n              "]);

  _templateObject3 = function _templateObject3() {
    return data;
  };

  return data;
}

function _templateObject2() {
  var data = _taggedTemplateLiteral(["\n              margin-left: 10px;\n            "]);

  _templateObject2 = function _templateObject2() {
    return data;
  };

  return data;
}

function _templateObject() {
  var data = _taggedTemplateLiteral(["\n    font-family: \"Roboto Condensed\", \"Helvetica Neue\", Helvetica, sans-serif;\n    font-size: 14px;\n    font-weight: bold;\n    text-align: center;\n    margin: 10px 0 0 0;\n\n    @media (max-width: 640px) {\n      text-align: left;\n    }\n  "]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

import PropTypes from "prop-types";
import { jsx, css } from "@emotion/core";
import shortid from "shortid";
import { VictoryTheme } from "../_Themes/index";

var SimpleLegend = function SimpleLegend(_ref) {
  var colorScale = _ref.colorScale,
      legendData = _ref.legendData,
      theme = _ref.theme;
  var legendStyle = css(_templateObject());
  var colorMap = colorScale || theme.group.colorScale;

  if (legendData.length) {
    return jsx("div", {
      css: legendStyle
    }, legendData.map(function (group, idx) {
      return jsx("span", {
        key: shortid.generate(),
        css: css(_templateObject2())
      }, jsx("svg", {
        viewBox: "0 0 10 10",
        width: "10px"
      }, jsx("circle", {
        cx: "5",
        cy: "5",
        r: "5",
        fill: colorMap[idx]
      })), jsx("span", {
        css: css(_templateObject3())
      }, group.name));
    }));
  }

  return null;
};

SimpleLegend.propTypes = {
  colorScale: PropTypes.arrayOf(PropTypes.string),
  legendData: PropTypes.arrayOf(PropTypes.shape({
    name: PropTypes.string
  })),
  theme: PropTypes.shape({})
};
SimpleLegend.defaultProps = {
  colorScale: null,
  legendData: null,
  theme: VictoryTheme
};
export default SimpleLegend;