'use strict';

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

var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var index = require('../../utils/index.js');
var base$1 = require('./variations/_view/base.js');
var base = require('./variations/_size/base.js');
var Toolbar_tokens = require('./Toolbar.tokens.js');
var Toolbar_styles = require('./Toolbar.styles.js');

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

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

var _excluded = ["children", "orientation", "hasShadow", "className"];
var toolbarRoot = function toolbarRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (props, ref) {
    var children = props.children,
      _props$orientation = props.orientation,
      orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation,
      _props$hasShadow = props.hasShadow,
      hasShadow = _props$hasShadow === void 0 ? true : _props$hasShadow,
      className = props.className,
      rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
    var orientationClassName = orientation === 'horizontal' ? Toolbar_tokens.classes.horizontal : Toolbar_tokens.classes.vertical;
    var shadowClassName = hasShadow ? Toolbar_tokens.classes.shadow : undefined;
    return /*#__PURE__*/React__default.default.createElement(Root, _rollupPluginBabelHelpers.extends({
      ref: ref,
      orientation: orientation,
      hasShadow: hasShadow,
      className: index.cx(className, orientationClassName, shadowClassName)
    }, rest), children);
  });
};
var toolbarConfig = {
  name: 'Toolbar',
  tag: 'div',
  layout: toolbarRoot,
  base: Toolbar_styles.base,
  variations: {
    size: {
      css: base.base
    },
    view: {
      css: base$1.base
    }
  },
  defaults: {
    view: 'default'
  }
};

exports.toolbarConfig = toolbarConfig;
exports.toolbarRoot = toolbarRoot;
