'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 Card_styles = require('./Card.styles.js');
var Card_tokens = require('./Card.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 = ["className", "view", "size", "selected", "orientation", "backgroundType", "style", "children"];
var cardRoot = function cardRoot(Root) {
  return /*#__PURE__*/React.forwardRef(function (_ref, outerRef) {
    var className = _ref.className,
      view = _ref.view,
      size = _ref.size,
      selected = _ref.selected,
      orientation = _ref.orientation,
      _ref$backgroundType = _ref.backgroundType,
      backgroundType = _ref$backgroundType === void 0 ? 'none' : _ref$backgroundType,
      style = _ref.style,
      children = _ref.children,
      rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
    return /*#__PURE__*/React__default.default.createElement(Root, _rollupPluginBabelHelpers.extends({
      ref: outerRef,
      view: view,
      size: size,
      className: cls__default.default(className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, Card_tokens.classes.selected, selected), Card_tokens.classes.backgroundSolid, backgroundType === 'solid'), Card_tokens.classes.horizontal, orientation === 'horizontal'), Card_tokens.classes.vertical, orientation === 'vertical')),
      style: style
    }, rest), children);
  });
};
var cardConfig = {
  name: 'Card',
  tag: 'div',
  layout: cardRoot,
  base: Card_styles.base,
  variations: {
    view: {
      css: base.base
    },
    size: {
      css: base$1.base
    }
  },
  defaults: {
    view: 'default',
    size: 'm'
  }
};

exports.cardConfig = cardConfig;
exports.cardRoot = cardRoot;
