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", "extraBold", "transform", "align", "color", "className", "inherited"];
import * as React from 'react';
import classNames from 'classnames';
import { HEADLINE_AS } from './headlineConsts';
import { TEXT_COLOR } from './Text';
import { generateResponsiveClassNames } from '../utils/responsive-props';
export { HEADLINE_AS, HEADLINE_SIZE, HEADLINE_TRANSFORM, HEADLINE_ALIGN } from './headlineConsts';
export { TEXT_COLOR };

var Headline = function Headline(_ref) {
  var _ref2;

  var children = _ref.children,
      _ref$as = _ref.as,
      as = _ref$as === void 0 ? HEADLINE_AS.H1 : _ref$as,
      size = _ref.size,
      extraBold = _ref.extraBold,
      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 headlineClass = classNames.apply(void 0, ['sg-headline', (_ref2 = {
    'sg-headline--inherited': inherited
  }, _defineProperty(_ref2, "sg-headline--".concat(String(color)), color), _defineProperty(_ref2, 'sg-headline--extra-bold', as === 'strong'), _ref2)].concat(_toConsumableArray(generateResponsiveClassNames(function (propValue) {
    return "sg-headline--".concat(propValue);
  }, size)), _toConsumableArray(generateResponsiveClassNames(function (propValue) {
    return "sg-headline--".concat(propValue);
  }, transform)), _toConsumableArray(generateResponsiveClassNames(function (propValue) {
    return propValue ? "sg-headline--extra-bold" : 'sg-headline--no-bold';
  }, extraBold)), _toConsumableArray(generateResponsiveClassNames(function (propValue) {
    return "sg-headline--".concat(propValue);
  }, align)), [className]));
  return /*#__PURE__*/React.createElement(Type, _extends({}, props, {
    className: headlineClass
  }), children);
};

export default Headline;