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", "transform", "align", "color", "className", "inherited"];
import * as React from 'react';
import classNames from 'classnames';
import { SUBHEADLINE_AS } from './subheadlineConsts';
import { generateResponsiveClassNames } from '../utils/responsive-props';
export { SUBHEADLINE_AS, SUBHEADLINE_SIZE, SUBHEADLINE_TRANSFORM, SUBHEADLINE_ALIGN } from './subheadlineConsts';
export { TEXT_COLOR } from './Text';

var Subheadline = function Subheadline(_ref) {
  var children = _ref.children,
      _ref$as = _ref.as,
      as = _ref$as === void 0 ? SUBHEADLINE_AS.H2 : _ref$as,
      size = _ref.size,
      transform = _ref.transform,
      align = _ref.align,
      color = _ref.color,
      className = _ref.className,
      _ref$inherited = _ref.inherited,
      inherited = _ref$inherited === void 0 ? false : _ref$inherited,
      props = _objectWithoutProperties(_ref, _excluded);

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

export default Subheadline;