import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React__default, { forwardRef } from 'react';
import cls from 'classnames';
import { base as base$1 } from './variations/_view/base.js';
import { base as base$2 } from './variations/_size/base.js';
import { base } from './Card.styles.js';
import { classes } from './Card.tokens.js';

var _excluded = ["className", "view", "size", "selected", "orientation", "backgroundType", "style", "children"];
var cardRoot = function cardRoot(Root) {
  return /*#__PURE__*/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 = _objectWithoutProperties(_ref, _excluded);
    return /*#__PURE__*/React__default.createElement(Root, _extends({
      ref: outerRef,
      view: view,
      size: size,
      className: cls(className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.selected, selected), classes.backgroundSolid, backgroundType === 'solid'), classes.horizontal, orientation === 'horizontal'), classes.vertical, orientation === 'vertical')),
      style: style
    }, rest), children);
  });
};
var cardConfig = {
  name: 'Card',
  tag: 'div',
  layout: cardRoot,
  base: base,
  variations: {
    view: {
      css: base$1
    },
    size: {
      css: base$2
    }
  },
  defaults: {
    view: 'default',
    size: 'm'
  }
};

export { cardConfig, cardRoot };
