import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import PropTypes from 'prop-types';
import { Heading as RebassHeading } from 'rebass';
import { T, always, cond, equals } from 'ramda';
import { alwaysEmptyObject } from 'ramda-extension';
var resolveDefaultProps = cond([[equals('h1'), always({
  fontSize: [7, 8, 9],
  mb: [5, 6]
})], [equals('h2'), always({
  fontSize: [3, 4, 7],
  mb: 3,
  mt: [2, 3]
})], [equals('h3'), always({
  fontSize: [4, 5, 6],
  mb: 2,
  mt: [2, 3]
})], [equals('h4'), always({
  fontSize: [4, 5, 6],
  mb: 1
})], [equals('h5'), always({
  fontSize: [4, 5, 6],
  mb: 1
})], [equals('h6'), always({
  fontSize: [4, 5, 6],
  fontWeight: 'bold',
  mb: 1
})], [T, alwaysEmptyObject]]);

var Heading = function Heading(_ref) {
  var _ref$as = _ref.as,
      as = _ref$as === void 0 ? 'h1' : _ref$as,
      rest = _objectWithoutProperties(_ref, ["as"]);

  return /*#__PURE__*/React.createElement(RebassHeading, _extends({
    as: as
  }, resolveDefaultProps(as), rest));
};

process.env.NODE_ENV !== "production" ? Heading.propTypes = {
  as: PropTypes.string
} : void 0;
export default Heading;