import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import InputField from './index'
import {
  text,
  boolean,
  number,
  object,
  array,
  date,
  color,
  button
} from '@storybook/addon-knobs/react';
import { withInfo } from '@storybook/addon-info';
import { linkTo } from '@storybook/addon-links'
import styled from 'styled-components';

storiesOf('InputField', module)
  .add('InputField',
     withInfo('')(
          () => (
            <InputField
              label = {text('label','myLabel')}
              isRequired = {boolean('isRequired',false)}
              disabled = {boolean('disabled',false)}
              warning = {text('warning','')}
              showWarning = {boolean('showWarning',false)}
              error= {boolean('error',false)}
              placeholder= {text('placeholder','')}
              value = {text('value','')}
              autoFocus = {boolean('autoFocus',false)}
              onChange = {action('onChange')}
              onError= {action('onError')}
              showSearch = {boolean('showSearch',false)}
              showLoader = {boolean('showLoader',false)}
            />
          )
     ))
  .add('Number InputField',
     withInfo('Only accepts numbers')(
          () => (
            <InputField
              label = {text('label','myLabel')}
              type = 'number'
              isRequired = {boolean('isRequired',false)}
              disabled = {boolean('disabled',false)}
              warning = {text('warning','')}
              showWarning = {boolean('showWarning',false)}
              error= {boolean('error',false)}
              placeholder= {text('placeholder','')}
              value = {text('value','')}
              autoFocus = {boolean('autoFocus',false)}
              onChange = {action('onChange')}
              onError= {action('onError')}
              minimumValue = {number('minimumValue',0)}
              maximumValue = {number('maximumValue',1000)}
            />
          )
     ))
