'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.card = undefined;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var card = function card(WrappedComponent, wrappedProps) {
  var defaultProps = {
    className: null,
    light: false,
    padded: false,
    rounded: false,
    translateOnHover: false,
    withBorder: false,
    withDarkBorder: false,
    withShadow: false,
    withVerticalPadding: false
  };

  var Card = function Card(props) {
    var _defaultProps$wrapped = _extends({}, defaultProps, wrappedProps, props),
        className = _defaultProps$wrapped.className,
        light = _defaultProps$wrapped.light,
        padded = _defaultProps$wrapped.padded,
        rounded = _defaultProps$wrapped.rounded,
        translateOnHover = _defaultProps$wrapped.translateOnHover,
        withBorder = _defaultProps$wrapped.withBorder,
        withDarkBorder = _defaultProps$wrapped.withDarkBorder,
        withShadow = _defaultProps$wrapped.withShadow,
        withVerticalPadding = _defaultProps$wrapped.withVerticalPadding,
        withoutBoxShadowOnHover = _defaultProps$wrapped.withoutBoxShadowOnHover,
        others = _objectWithoutProperties(_defaultProps$wrapped, ['className', 'light', 'padded', 'rounded', 'translateOnHover', 'withBorder', 'withDarkBorder', 'withShadow', 'withVerticalPadding', 'withoutBoxShadowOnHover']);

    var cardClassName = (0, _classnames2.default)('k-Card', {
      'k-Card--light': light,
      'k-Card--padded': padded,
      'k-Card--microRounded': rounded == 'micro',
      'k-Card--tinyRounded': rounded == 'tiny',
      'k-Card--rounded': rounded == true,
      'k-Card--translateOnHover': translateOnHover,
      'k-Card--withBorder': withBorder,
      'k-Card--withDarkBorder': withDarkBorder,
      'k-Card--withShadow': withShadow,
      'k-Card--withVerticalPadding': withVerticalPadding,
      'k-Card--withoutBoxShadowOnHover': withoutBoxShadowOnHover
    }, className);

    return _react2.default.createElement(WrappedComponent, _extends({ className: cardClassName }, others));
  };

  return Card;
};

exports.card = card;
card.propTypes = {
  rounded: _propTypes2.default.oneOf(['micro', 'tiny'])
};