import { text, boolean, number } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';

export default {
  hiddenLabel: function hiddenLabel() {
    return boolean('hiddenLabel', false);
  },
  labelText: function labelText() {
    return text('labelText', 'Number Input');
  },
  required: function required() {
    return boolean('required', false);
  },
  inline: function inline() {
    return boolean('inline', false);
  },
  disabled: function disabled() {
    return boolean('disabled', false);
  },
  id: function id() {
    return text('id', 'number-input');
  },
  name: function name() {
    return text('name', 'number-input');
  },
  width: function width() {
    return number('width', 0);
  },
  maxlength: function maxlength() {
    return number('maxlength', 20);
  },
  placeholder: function placeholder() {
    return text('placeholder', '0');
  },
  errorMsg: function errorMsg() {
    return text('errorMsg', 'you did not type something');
  },
  defaultValue: function defaultValue() {
    return number('defaultValue');
  },
  max: function max() {
    return number('max', 100);
  },
  min: function min() {
    return number('min', 0);
  },
  step: function step() {
    return number('step', 1);
  },
  onChange: function onChange() {
    return action('onChange');
  },
  onBlur: function onBlur() {
    return action('onBlur');
  },
  unit: function unit() {
    return text('unit', '');
  },
  showButtons: function showButtons() {
    return boolean('hasButtons', true);
  }
};