@navinc/base-react-components
Version:
Nav's Pattern Library
43 lines (37 loc) • 1.02 kB
JavaScript
import React from 'react'
import withPropsCombinations from 'react-storybook-addon-props-combinations'
import AddressInput from './address-input.js'
import readme from './address-input.readme.md'
export default {
title: 'Form Elements/AddressInput',
component: AddressInput,
parameters: {
info: { text: readme },
},
}
export const Basic = (args) => {
return <AddressInput {...args} />
}
Basic.args = {
lede: 'Lede',
label: 'Address',
placeholder: 'Placeholder',
defaultValue: 'I am an input component',
required: true,
hasSpaceForErrors: true,
isInvalid: false,
errors: ['This is incorrect'],
onChange: 'function()',
onAddressSelected: 'function()',
}
export const Variations = withPropsCombinations(AddressInput, {
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']],
})
Variations.parameters = {
info: { disable: true },
}