"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SectionHeader = void 0;

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

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _semanticHeaderLevel = require("../../../mixins/semantic-header-level");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var StyledSemanticHeader = (0, _styledComponents["default"])(_semanticHeaderLevel.SemanticHeader).withConfig({
  displayName: "StyledSemanticHeader",
  componentId: "sc-1cg6vne-0"
})(["line-height:1.2;"]);

var SectionHeader = function SectionHeader(_ref) {
  var _extends2;

  var spacing = _ref.spacing,
      grow = _ref.grow,
      shrink = _ref.shrink,
      basis = _ref.basis,
      className = _ref.className,
      _ref$size = _ref.size,
      size = _ref$size === void 0 ? 'lg' : _ref$size,
      headerLevel = _ref.headerLevel,
      dataCy = _ref['data-cy'],
      dataQa = _ref['data-qa'],
      id = _ref.id,
      children = _ref.children,
      props = _objectWithoutProperties(_ref, ["spacing", "grow", "shrink", "basis", "className", "size", "headerLevel", "data-cy", "data-qa", "id", "children"]);

  var defaultSpacing = size === 'lg' ? 'mb2' : 'mb1';
  var defaultHeaderLevel = size === 'lg' ? 3 : 2;
  return /*#__PURE__*/_react["default"].createElement(StyledSemanticHeader, _extends((_extends2 = {
    className: className,
    spacing: spacing,
    grow: grow,
    shrink: shrink,
    basis: basis,
    id: id
  }, _defineProperty(_extends2, "spacing", spacing !== null && spacing !== void 0 ? spacing : defaultSpacing), _defineProperty(_extends2, "headerLevel", headerLevel !== null && headerLevel !== void 0 ? headerLevel : defaultHeaderLevel), _defineProperty(_extends2, "data-cy", dataCy), _defineProperty(_extends2, "data-qa", dataQa), _defineProperty(_extends2, "fontSize", size === 'lg' ? 'f2' : 'f1'), _defineProperty(_extends2, "colorName", "greyscale-dark"), _defineProperty(_extends2, "bold", true), _extends2), props), children);
};

exports.SectionHeader = SectionHeader;
SectionHeader.displayName = 'SectionHeader';