'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var cls = require('classnames');
var base = require('./variations/_view/base.js');
var base$1 = require('./variations/_size/base.js');
var Header_styles = require('./Header.styles.js');
var Header_tokens = require('./Header.tokens.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);
var cls__default = /*#__PURE__*/_interopDefault(cls);

var _excluded = ["actionBefore", "title", "description", "actionAfter", "view", "size", "textAlign", "hasDivider", "className"];
var headerRoot = function headerRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (_ref, ref) {
    var actionBefore = _ref.actionBefore,
      title = _ref.title,
      description = _ref.description,
      actionAfter = _ref.actionAfter,
      view = _ref.view,
      size = _ref.size,
      textAlign = _ref.textAlign,
      hasDivider = _ref.hasDivider,
      className = _ref.className,
      rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
    return /*#__PURE__*/React__default.default.createElement(Root, _rollupPluginBabelHelpers.extends({
      ref: ref,
      className: cls__default.default(className, _rollupPluginBabelHelpers.defineProperty({}, Header_tokens.classes.enableDivider, hasDivider)),
      view: view,
      size: size
    }, rest), actionBefore && /*#__PURE__*/React__default.default.createElement(Header_styles.ActionWrapper, null, actionBefore), /*#__PURE__*/React__default.default.createElement(Header_styles.Content, {
      className: cls__default.default(_rollupPluginBabelHelpers.defineProperty({}, Header_tokens.classes.textAlignCenter, textAlign === 'center'))
    }, /*#__PURE__*/React__default.default.createElement(Header_styles.Title, null, title), description && /*#__PURE__*/React__default.default.createElement(Header_styles.Description, null, description)), actionAfter && /*#__PURE__*/React__default.default.createElement(Header_styles.ActionWrapper, null, actionAfter));
  });
};
var headerConfig = {
  name: 'Header',
  tag: 'div',
  layout: headerRoot,
  base: Header_styles.base,
  variations: {
    view: {
      css: base.base
    },
    size: {
      css: base$1.base
    }
  },
  defaults: {
    view: 'default',
    size: 'm'
  }
};

exports.headerConfig = headerConfig;
exports.headerRoot = headerRoot;
