'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _react3 = require('@storybook/react');

var _addonKnobs = require('@storybook/addon-knobs');

var _addonActions = require('@storybook/addon-actions');

var _index = require('./index');

var _index2 = _interopRequireDefault(_index);

var _DateRange = require('./DateRange.md');

var _DateRange2 = _interopRequireDefault(_DateRange);

var _InputDateKnobs = require('../InputDate/InputDate.knobs.options');

var _InputDateKnobs2 = _interopRequireDefault(_InputDateKnobs);

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

(0, _react3.storiesOf)('forms|molecules', module).addDecorator((0, _addonKnobs.withKnobs)({ escapeHTML: false })).add('DateRange', function () {
  var props = {
    label: (0, _addonKnobs.text)('label', 'Filter by date'),
    startDate: {
      labelText: (0, _addonKnobs.text)('StartDate: labelText', 'Select a start date:', 'StartDate'),
      placeholder: (0, _addonKnobs.text)('StartDate: placeholder', 'today', 'StartDate'),
      required: (0, _addonKnobs.boolean)('StartDate: required', false, 'StartDate'),
      id: (0, _addonKnobs.text)('StartDate: id', 'start-date', 'StartDate'),
      name: (0, _addonKnobs.text)('StartDate: name', 'start-date', 'StartDate'),
      restrict: (0, _addonKnobs.select)('StartDate: restrict', _InputDateKnobs2.default.restrict, '', 'StartDate'),
      onChangeCallback: (0, _addonActions.action)('startdate custom onchange callback function'),
      defaultDate: new Date((0, _addonKnobs.date)('StartDate: defaultDate', new Date('Jan 01 2018'), 'StartDate'))
    },
    endDate: {
      labelText: (0, _addonKnobs.text)('EndDate: labelText', 'Select an end date:', 'EndDate'),
      placeholder: (0, _addonKnobs.text)('EndDate:placeholder', 'm/dd/yy', 'EndDate'),
      required: (0, _addonKnobs.boolean)('EndDate: required', false, 'EndDate'),
      id: (0, _addonKnobs.text)('EndDate: id', 'end-date', 'EndDate'),
      name: (0, _addonKnobs.text)('EndDate: name', 'end-date', 'EndDate'),
      restrict: (0, _addonKnobs.select)('EndDate: restrict', _InputDateKnobs2.default.restrict, '', 'EndDate'),
      onChangeCallback: (0, _addonActions.action)('enddate custom onchange callback function'),
      defaultDate: new Date((0, _addonKnobs.date)('EndDate: defaultDate', new Date('Feb 01 2018'), 'EndDate'))
    }
  };
  return _react2.default.createElement(_index2.default, props);
}, { info: _DateRange2.default });