import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { array, withKnobs, boolean, object, text, select, number } from '@storybook/addon-knobs'; import { withInfo } from '@storybook/addon-info'; import ReactCodeInput from './ReactCodeInput.js'; import CodeInputField from "./ReactCodeInput"; const stories = storiesOf('ReactCodeInput', module); const propVariantStories = storiesOf('ReactCodeInput/Props', module); const typeLabel = 'Type'; const typeOptions = ['text', 'number', 'password', 'tel']; const typeDefaultValue = 'text'; const typeGroupId = 'Type'; const inputModeOptions = [ 'verbatim', 'latin', 'latin-name', 'latin-prose', 'full-width-latin', 'kana', 'kana-name', 'katakana', 'numeric', 'tel', 'email', 'url', ]; const inputStyle = { fontFamily: 'monospace', MozAppearance: 'textfield', borderRadius: '6px', border: '1px solid', boxShadow: '0px 0px 10px 0px rgba(0,0,0,.10)', margin: '4px', paddingLeft: '8px', width: '36px', height: '42px', fontSize: '32px', boxSizing: 'border-box', color: 'black', backgroundColor: 'white', borderColor: 'lightgrey', }; const darkStyle = { fontFamily: 'monospace', MozAppearance: 'textfield', borderRadius: '3px', border: '1px solid', margin: '4px', paddingLeft: '7px', width: '15px', height: '26px', fontSize: '14px', color: 'lightskyblue', backgroundColor: 'black', borderColor: 'lightskyblue', }; // Creation of Stories stories.addDecorator((story, context) => withInfo('Details')(story)(context)); stories.addDecorator(withKnobs); // Stories for Input Field stories .add( 'Default', () => ) .add( 'Dark Themed', () =>
) .add( 'Force Uppercase', () => ); // Creation of Props propVariantStories.addDecorator((story, context) => withInfo('Details')(story)(context)); propVariantStories.addDecorator(withKnobs); propVariantStories .add('type', () => ) .add('fields', () => ) .add('placeholder', () => ) .add('inputStyle', () => ) .add('value', () => ) .add('isValid', () => ) .add('inputMode', () => ) .add('onChange', () => ) .add('pattern', () =>
) .add('touch', () => ) .add('untouch', () => ) .add('disabled', () => );