import React, { useState } from 'react'; import { boolean, optionsKnob, text, withKnobs } from '@storybook/addon-knobs'; import { Description, Divider, Title, Wrapper } from '../../..'; import { formSizes, formSizesPixels, fromSizesMap, iconColors } from '../../util/global-props'; import { Input } from './input.component'; export default { title: 'GEENEE-UI/Form', component: Input, decorators: [ withKnobs ] }; export const _Input = () => { const [ value, setValue ] = useState(undefined); const handlerClear = () => { setValue(''); }; const handlerChange = ({ target }: { target: HTMLInputElement }) => { setValue(target.value); }; return ( Input { fromSizesMap.map((size, key) => ( { `${ size } - ${ formSizesPixels[ size ] }` } { text('After text', '') }) } before={ ({ text('Before text', '') }) } /> )) } ); };