@navinc/base-react-components
Version:
Nav's Pattern Library
41 lines (38 loc) • 1.18 kB
JavaScript
import React from 'react'
import { storiesOf } from '@storybook/react'
import { boolean, text, array } from '@storybook/addon-knobs'
import withPropsCombinations from 'react-storybook-addon-props-combinations'
import CurrencyInput from './index.js'
import readme from './readme.md'
storiesOf('1. Components | Form Elements', module).add(
'CurrencyInput',
() => (
<CurrencyInput
lede={text('lede', 'Input lede')}
label={text('label', 'Input some text')}
type={text('type', 'text')}
value={text('value', 'I am an input component')}
required={boolean('required', false)}
hasSpaceForErrors={boolean('hasSpaceForErrors', false)}
isInvalid={boolean('isInvalid', false)}
errors={array('errors[]', [])}
/>
),
{
info: { text: readme },
}
)
storiesOf('2. Misc | Variations', module).add(
'CurrencyInput',
withPropsCombinations(CurrencyInput, {
label: ['Input some text'],
type: ['text'],
value: ['I am an input component'],
hasSpaceForErrors: [false, true],
isInvalid: [false, true],
errors: [[], ['An error'], ['One error', 'Two Errors']],
}),
{
info: { disable: true },
}
)