"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "ALIGNMENT", {
  enumerable: true,
  get: function get() {
    return _ContentBoxConstants.ALIGNMENT;
  }
});
Object.defineProperty(exports, "SIZE", {
  enumerable: true,
  get: function get() {
    return _ContentBoxConstants.SIZE;
  }
});
exports.default = void 0;

var React = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _ContentBoxConstants = require("./ContentBoxConstants");

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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; }

var ContentBoxTitle = function ContentBoxTitle(_ref) {
  var _classNames;

  var children = _ref.children,
      spaced = _ref.spaced,
      spacedSmall = _ref.spacedSmall,
      spacedTop = _ref.spacedTop,
      spacedBottom = _ref.spacedBottom,
      className = _ref.className,
      _ref$align = _ref.align,
      align = _ref$align === void 0 ? _ContentBoxConstants.ALIGNMENT.LEFT : _ref$align;
  var contentBoxClass = (0, _classnames.default)('sg-content-box__title', (_classNames = {
    'sg-content-box__title--with-centered-elements': align === _ContentBoxConstants.ALIGNMENT.CENTER,
    'sg-content-box__title--spaced': spaced,
    'sg-content-box__title--spaced-small': spacedSmall,
    'sg-content-box__title--spaced-top': spacedTop === _ContentBoxConstants.SIZE.NORMAL
  }, _defineProperty(_classNames, "sg-content-box__title--spaced-top-".concat(spacedTop || ''), spacedTop && spacedTop !== _ContentBoxConstants.SIZE.NORMAL), _defineProperty(_classNames, 'sg-content-box__title--spaced-bottom', spacedBottom === _ContentBoxConstants.SIZE.NORMAL), _defineProperty(_classNames, "sg-content-box__title--spaced-bottom-".concat(spacedBottom || ''), spacedBottom && spacedBottom !== _ContentBoxConstants.SIZE.NORMAL), _classNames), className);
  return /*#__PURE__*/React.createElement("div", {
    className: contentBoxClass
  }, children);
};

var _default = ContentBoxTitle;
exports.default = _default;