import React from 'react';
import { a as withNano, b as classNames } from '../chunk-566df01b.js';
import PropTypes from 'prop-types';
import Text from '../Text/index.js';
import { a as classCallCheck, b as createClass, c as defineProperty, d as inherits, e as objectWithoutProperties, f as possibleConstructorReturn, g as slicedToArray, h as _typeof, i as _extends } from '../chunk-aad905a2.js';
import '../chunk-aeb80e51.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 = objectWithoutProperties(_ref, ['label', 'classes', 'className', 'color']);
  return React.createElement(
    Text,
    _extends({
      className: 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 = withNano(styles)(Chip);

export default Chip$1;
//# sourceMappingURL=index.js.map
