'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 base = require('../../variations/_size/base.js');
var tokens = require('../../tokens.js');
var index = require('../../../../utils/index.js');
var Subtitle_styles = require('./Subtitle.styles.js');

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

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

var _excluded = ["size", "children", "color", "noWrap", "className", "style"];
var subtitleRoot = function subtitleRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
    var size = props.size,
      children = props.children,
      color = props.color,
      noWrap = props.noWrap,
      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, className),
      style: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
        color: color
      }, style), applySpacing.applySpacing(rest))
    }, rest), children);
  });
};
var subtitleConfig = {
  name: 'Subtitle',
  tag: 'div',
  layout: subtitleRoot,
  base: Subtitle_styles.base,
  variations: {
    size: {
      css: base.base
    }
  },
  defaults: {
    size: 'm'
  }
};

exports.subtitleConfig = subtitleConfig;
exports.subtitleRoot = subtitleRoot;
