import _extends from "@babel/runtime/helpers/esm/extends";
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["children", "as", "size", "color", "className", "inherited"];
import * as React from 'react';
import classNames from 'classnames';
import { TEXT_COLOR } from './textConsts';
import { generateResponsiveClassNames } from '../utils/responsive-props';
export var TEXT_BIT_AS = {
  H1: 'h1',
  H2: 'h2',
  H3: 'h3',
  H4: 'h4',
  H5: 'h5',
  H6: 'h6',
  DIV: 'div',
  SPAN: 'span',
  BLOCKQUOTE: 'blockquote',
  Q: 'q',
  STRONG: 'strong',
  EM: 'em',
  DEL: 'del',
  INS: 'ins'
};
export var TEXT_BIT_SIZE = {
  SMALL: 'small',
  MEDIUM: 'medium',
  LARGE: 'large',
  XLARGE: 'xlarge'
};
export { TEXT_COLOR };

var TextBit = function TextBit(_ref) {
  var children = _ref.children,
      _ref$as = _ref.as,
      as = _ref$as === void 0 ? TEXT_BIT_AS.H1 : _ref$as,
      size = _ref.size,
      color = _ref.color,
      className = _ref.className,
      inherited = _ref.inherited,
      props = _objectWithoutProperties(_ref, _excluded);

  var Type = as;
  var textClass = classNames.apply(void 0, ['sg-text-bit'].concat(_toConsumableArray(generateResponsiveClassNames(function (size) {
    return "sg-text-bit--".concat(size);
  }, size)), [_defineProperty({
    'sg-text-bit--inherited': inherited
  }, "sg-text-bit--".concat(color || ''), color), className]));
  return /*#__PURE__*/React.createElement(Type, _extends({}, props, {
    className: textClass
  }), children);
};

export default TextBit;