'use strict';

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

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

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

var _index2 = _interopRequireDefault(_index);

var _InputNumberKnobs = require('./InputNumber.knobs.options');

var _InputNumberKnobs2 = _interopRequireDefault(_InputNumberKnobs);

var _InputNumber = require('./InputNumber.md');

var _InputNumber2 = _interopRequireDefault(_InputNumber);

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

(0, _react3.storiesOf)('forms|atoms', module).addDecorator((0, _addonKnobs.withKnobs)({
  escapeHTML: false
})).add('InputNumber', function () {
  var inputTextOptionsWithKnobs = {};
  Object.getOwnPropertyNames(_InputNumberKnobs2.default).forEach(function (key) {
    inputTextOptionsWithKnobs[key] = _InputNumberKnobs2.default[key]();
  });
  var storyProps = {
    style: inputTextOptionsWithKnobs.inline ? { width: '400px' } : { width: '200px' }
  };
  if (inputTextOptionsWithKnobs.width > 0) {
    storyProps.style = { width: inputTextOptionsWithKnobs.width + 'px' };
  }
  return _react2.default.createElement(
    'div',
    storyProps,
    _react2.default.createElement(_index2.default, inputTextOptionsWithKnobs)
  );
}, {
  info: _InputNumber2.default
});