'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var applySpacing = require('../../../mixins/applySpacing.js');
var tokens = require('../tokens.js');
var index = require('../../../utils/index.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

var _excluded = ["size", "children", "breakWord", "noWrap", "color", "className", "style"];
var typographyOldRoot = function typographyOldRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
    var size = props.size,
      children = props.children,
      breakWord = props.breakWord,
      noWrap = props.noWrap,
      color = props.color,
      className = props.className,
      style = props.style,
      rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
    return /*#__PURE__*/React__default.default.createElement(Root, _rollupPluginBabelHelpers.extends({
      size: size,
      ref: ref,
      className: index.cx(noWrap && tokens.classes.typoWithNoWrap, breakWord && tokens.classes.typoWithBreakWord, className),
      style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
        color: color
      }, style), applySpacing.applySpacing(rest))
    }, rest), children);
  });
};

exports.typographyOldRoot = typographyOldRoot;
