"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _rebass = require("rebass");

var _ramda = require("ramda");

var _ramdaExtension = require("ramda-extension");

var resolveDefaultProps = (0, _ramda.cond)([[(0, _ramda.equals)('h1'), (0, _ramda.always)({
  fontSize: [8, 9],
  mb: [5, 6]
})], [(0, _ramda.equals)('h2'), (0, _ramda.always)({
  fontSize: [4, 7],
  mb: 3,
  mt: [4, 5]
})], [(0, _ramda.equals)('h3'), (0, _ramda.always)({
  fontSize: [5, 6],
  mb: 2
})], [_ramda.T, _ramdaExtension.alwaysEmptyObject]]);

var Heading = function Heading(_ref) {
  var _ref$as = _ref.as,
      as = _ref$as === void 0 ? 'h1' : _ref$as,
      rest = (0, _objectWithoutPropertiesLoose2.default)(_ref, ["as"]);
  return (
    /*#__PURE__*/
    _react.default.createElement(_rebass.Heading, (0, _extends2.default)({
      as: as,
      fontFamily: "heading",
      fontWeight: "800"
    }, resolveDefaultProps(as), rest))
  );
};

process.env.NODE_ENV !== "production" ? Heading.propTypes = {
  as: _propTypes.default.string
} : void 0;
var _default = Heading;
exports.default = _default;