'use strict';

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

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 _getClassName2 = require('babel-plugin-react-css-modules/dist/browser/getClassName');

var _getClassName3 = _interopRequireDefault(_getClassName2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactModal = require('react-modal');

var _reactModal2 = _interopRequireDefault(_reactModal);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _Header = require('./Header');

var _Header2 = _interopRequireDefault(_Header);

var _Body = require('./Body');

var _Body2 = _interopRequireDefault(_Body);

var _Footer = require('./Footer');

var _Footer2 = _interopRequireDefault(_Footer);

var _Fake = require('./Fake');

var _Fake2 = _interopRequireDefault(_Fake);

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

var _styleModuleImportMap = {
  './modal.scss': {
    'overlay': 'flive_modal_overlay',
    'content': 'flive_modal_content',
    'xs': 'flive_modal_xs',
    'sm': 'flive_modal_sm',
    'md': 'flive_modal_md',
    'lg': 'flive_modal_lg'
  }
};

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 propTypes = {
  /** @ignore */
  className: _propTypes2.default.string,
  size: _propTypes2.default.oneOf(['xs', 'sm', 'md', 'lg']),
  /** Modal content inline style */
  contentStyle: _propTypes2.default.object,
  /** Modal overlay inline style */
  overlayStyle: _propTypes2.default.object,
  contentLabel: _propTypes2.default.string
};

var defaultProps = {
  className: undefined,
  size: 'sm',
  contentStyle: {},
  overlayStyle: {},
  contentLabel: ''
};

var Modal = function Modal(_ref) {
  var className = _ref.className,
      overlayStyle = _ref.overlayStyle,
      contentStyle = _ref.contentStyle,
      size = _ref.size,
      rest = _objectWithoutProperties(_ref, ['className', 'overlayStyle', 'contentStyle', 'size']);

  return _react2.default.createElement(_reactModal2.default, _extends({
    overlayClassName: 'flive_modal_overlay',
    style: {
      overlay: _extends({}, overlayStyle),
      content: _extends({}, contentStyle)
    }
  }, rest, {
    className: (className ? className + ' ' : '') + (0, _getClassName3.default)((0, _classnames2.default)('content', size), _styleModuleImportMap)
  }));
};

Modal.propTypes = propTypes;
Modal.defaultProps = defaultProps;

Modal.Header = _Header2.default;
Modal.Body = _Body2.default;
Modal.Footer = _Footer2.default;
Modal.Fake = _Fake2.default;

exports.default = Modal;
module.exports = exports['default'];