import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import { applySpacing } from '../../../mixins/applySpacing.js';
import { classes } from '../tokens.js';
import { cx } from '../../../utils/index.js';

var _excluded = ["size", "children", "breakWord", "noWrap", "color", "className", "style"];
var typographyOldRoot = function typographyOldRoot(Root) {
  return /*#__PURE__*/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 = _objectWithoutProperties(props, _excluded);
    return /*#__PURE__*/React__default.createElement(Root, _extends({
      size: size,
      ref: ref,
      className: cx(noWrap && classes.typoWithNoWrap, breakWord && classes.typoWithBreakWord, className),
      style: _objectSpread2(_objectSpread2({
        color: color
      }, style), applySpacing(rest))
    }, rest), children);
  });
};

export { typographyOldRoot };
