'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = require('react');
var React__default = _interopDefault(React);
var __chunk_1 = require('../chunk-f817ce38.js');
var PropTypes = _interopDefault(require('prop-types'));
var index$1 = require('../Text/index.js');
var __chunk_3 = require('../chunk-6d243953.js');
require('../chunk-2b268ae7.js');

var styles = (function (_ref) {
  var spacing = _ref.spacing,
      palette = _ref.palette,
      typography = _ref.typography;
  return {
    chipBase: {
      borderRadius: 100,
      border: 'solid 1px ' + palette.grey80,
      padding: '1px ' + spacing(2) + 'px',
      width: 'fit-content',
      height: 'fit-content',
      display: 'inline',
      letterSpacing: 0.3,
      lineHeight: 1.6,
      fontSize: function fontSize(_ref2) {
        var size = _ref2.size;
        return size || typography.fontSizeSm;
      },
      fontWeight: typography.fontWeightBold,
      textAlign: 'center',
      textTransform: 'uppercase'
    },
    black: {
      color: palette.black,
      borderColor: palette.grey80
    },
    grey: {
      color: palette.grey100,
      borderColor: palette.grey80
    },
    white: {
      color: palette.white,
      borderColor: palette.white
    },
    orange: {
      color: palette.orange,
      borderColor: palette.lightOrange
    },
    green: {
      color: palette.green,
      borderColor: palette.lightGreen
    },
    red: {
      color: palette.red,
      borderColor: palette.veryLightRed
    }
  };
});

var Chip = function Chip(_ref) {
  var label = _ref.label,
      classes = _ref.classes,
      className = _ref.className,
      _ref$color = _ref.color,
      color = _ref$color === undefined ? 'black' : _ref$color,
      rest = __chunk_3.objectWithoutProperties(_ref, ['label', 'classes', 'className', 'color']);
  return React__default.createElement(
    index$1,
    __chunk_3._extends({
      className: __chunk_1.classNames(classes.chipBase, className && className, color && classes[color])
    }, rest),
    label
  );
};

Chip.propTypes = {
  classes: PropTypes.object,
  label: PropTypes.string.isRequired,
  className: PropTypes.string,
  color: PropTypes.oneOf(['black', 'grey', 'white', 'red', 'orange', 'green'])
};
var Chip$1 = __chunk_1.withNano(styles)(Chip);

module.exports = Chip$1;
//# sourceMappingURL=index.js.map
