'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 _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

require('react-dates/initialize');

var _reactDates = require('react-dates');

var _Icon = require('../Icon');

var _Icon2 = _interopRequireDefault(_Icon);

var _DatePickerWrapper = require('./styles/DatePickerWrapper');

var _DatePickerWrapper2 = _interopRequireDefault(_DatePickerWrapper);

var _DateRangePicker = require('./DateRangePicker');

var _DateRangePicker2 = _interopRequireDefault(_DateRangePicker);

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 DatePicker = function DatePicker(_ref) {
  var Wrapper = _ref.Wrapper,
      props = _objectWithoutProperties(_ref, ['Wrapper']);

  return _react2.default.createElement(
    Wrapper,
    null,
    _react2.default.createElement(_reactDates.SingleDatePicker, _extends({}, props, {
      navPrev: _react2.default.createElement(_Icon2.default, { name: 'back', size: '12px' }),
      navNext: _react2.default.createElement(_Icon2.default, { name: 'forward', size: '12px' }),
      weekDayFormat: 'dd',
      displayFormat: 'MMM DD YYYY',
      daySize: 37,
      horizontalMargin: 0,
      numberOfMonths: 1
    }))
  );
};

DatePicker.propTypes = _extends({}, _reactDates.SingleDatePickerShape, {
  id: _propTypes2.default.string,
  /**
   * A component to wrap and control styles of the underlying react-dates DatePicker
   */
  Wrapper: _propTypes2.default.func
});

DatePicker.defaultProps = {
  Wrapper: _DatePickerWrapper2.default
};

DatePicker.Range = _DateRangePicker2.default;

exports.default = DatePicker;