@navinc/base-react-components
Version:
Nav's Pattern Library
57 lines (52 loc) • 1.75 kB
JavaScript
import React from 'react'
import { storiesOf } from '@storybook/react'
import { boolean, text, object } from '@storybook/addon-knobs'
import { action } from '@storybook/addon-actions'
import withPropsCombinations from 'react-storybook-addon-props-combinations'
import readme from './readme.md'
import Card from './'
storiesOf('__ | Deprecated', module).add(
'Card',
() => {
const onBack = text('onBack', 'function()')
const onDismiss = text('onDismiss', 'function()')
const onNext = text('onNext', 'function()')
const onToggleKebab = text('onToggleKebab', 'function()')
const onUndo = text('onUndo', 'function()')
return (
<Card
buttonLabel={text('buttonLabel', 'Click this')}
cardLabel={text('cardLabel', 'Some cool label')}
title={text('title', 'Really fantastic title')}
kebabMenuItems={object('kebabMenuItems', [{ label: 'hide', icon: 'foo' }])}
onBack={onBack && action(onBack)}
onDismiss={onDismiss && action(onDismiss)}
onNext={onNext && action(onNext)}
onToggleKebab={onToggleKebab && action(onToggleKebab)}
onUndo={onUndo && action(onUndo)}
buttonDisabled={boolean('buttonDisabled', false)}
buttonForm={text('buttonForm', '')}
>
{text('Children', 'Body content goes here!')}
</Card>
)
},
{
info: { text: readme },
}
)
storiesOf('__ | Deprecated', module).add(
'Card:variations',
withPropsCombinations(Card, {
buttonLabel: ['Next'],
cardLabel: ['This is the label'],
kebabMenuItems: [[]],
onBack: ['', 'some function'],
onNext: ['', 'some function'],
title: ["Here's the copy"],
buttonDisabled: [true, false],
}),
{
info: { disable: true },
}
)