Browse Source

Flatten storybook

master
meriadec 7 years ago
parent
commit
f0dc41c952
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 4
      src/components/Breadcrumb/stories.js
  2. 4
      src/components/RecipientAddress/stories.js
  3. 4
      src/components/SelectAccount/stories.js
  4. 4
      src/components/TransactionsList/stories.js
  5. 4
      src/components/base/Bar/stories.js
  6. 4
      src/components/base/Button/stories.js
  7. 4
      src/components/base/CheckBox/stories.js
  8. 4
      src/components/base/GrowScroll/stories.js
  9. 4
      src/components/base/Input/stories.js
  10. 4
      src/components/base/Modal/stories.js
  11. 4
      src/components/base/NewChart/stories.js
  12. 4
      src/components/base/Pills/stories.js
  13. 4
      src/components/base/QRCode/stories.js
  14. 4
      src/components/base/Radio/stories.js
  15. 79
      src/components/base/Search/stories.js
  16. 4
      src/components/base/Tabs/stories.js
  17. 4
      src/components/base/Tooltip/stories.js

4
src/components/Breadcrumb/stories.js

@ -6,9 +6,9 @@ import { number } from '@storybook/addon-knobs'
import Breadcrumb from 'components/Breadcrumb'
const stories = storiesOf('Components/Breadcrumb', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => (
stories.add('Breadcrumb', () => (
<Breadcrumb
currentStep={number('currentStep', 1, {
min: 1,

4
src/components/RecipientAddress/stories.js

@ -6,7 +6,7 @@ import { boolean } from '@storybook/addon-knobs'
import RecipientAddress from 'components/RecipientAddress'
const stories = storiesOf('Components/RecipientAddress', module)
const stories = storiesOf('Components', module)
type State = {
value: any,
@ -27,7 +27,7 @@ class Wrapper extends PureComponent<any, State> {
}
}
stories.add('basic', () => (
stories.add('RecipientAddress', () => (
<Wrapper
render={({ onChange, value }) => (
<RecipientAddress

4
src/components/SelectAccount/stories.js

@ -8,7 +8,7 @@ import { getCurrencyByCoinType, getDefaultUnitByCoinType } from '@ledgerhq/curre
import { SelectAccount } from 'components/SelectAccount'
const chance = new Chance()
const stories = storiesOf('Components/SelectAccount', module)
const stories = storiesOf('Components', module)
const accounts = [...Array(20)].map(() => ({
id: chance.string(),
@ -48,7 +48,7 @@ class Wrapper extends PureComponent<any, State> {
}
}
stories.add('basic', () => (
stories.add('SelectAccount', () => (
<Wrapper
render={({ onChange, value }) => (
<SelectAccount onChange={onChange} value={value} accounts={accounts} t={k => k} />

4
src/components/TransactionsList/stories.js

@ -6,7 +6,7 @@ import { boolean } from '@storybook/addon-knobs'
import TransactionsList from 'components/TransactionsList'
const stories = storiesOf('Components/TransactionsList', module)
const stories = storiesOf('Components', module)
const transactions = [
{
@ -23,6 +23,6 @@ const transactions = [
},
]
stories.add('basic', () => (
stories.add('TransactionsList', () => (
<TransactionsList transactions={transactions} canShowMore={boolean('canShowMore')} />
))

4
src/components/base/Bar/stories.js

@ -7,6 +7,6 @@ import { storiesOf } from '@storybook/react'
import Bar from 'components/base/Bar'
const stories = storiesOf('Components/Bar', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => <Bar size={number('size', 1)} color="grey" />)
stories.add('Bar', () => <Bar size={number('size', 1)} color="grey" />)

4
src/components/base/Button/stories.js

@ -6,7 +6,7 @@ import styled from 'styled-components'
import Button from 'components/base/Button'
const stories = storiesOf('Components/Button', module)
const stories = storiesOf('Components', module)
const Th = styled.th`
padding: 20px;
@ -17,7 +17,7 @@ const Td = styled.td`
min-width: 150px;
`
stories.add('all', () => (
stories.add('Button', () => (
<table border={1}>
<thead>
<tr>

4
src/components/base/CheckBox/stories.js

@ -5,8 +5,8 @@ import { action } from '@storybook/addon-actions'
import CheckBox from 'components/base/CheckBox'
const stories = storiesOf('Components/CheckBox', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => (
stories.add('CheckBox', () => (
<CheckBox isChecked={boolean('isChecked', false)} onChange={action('onChange')} />
))

4
src/components/base/GrowScroll/stories.js

@ -7,9 +7,9 @@ import { boolean } from '@storybook/addon-knobs'
import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll'
const stories = storiesOf('Components/GrowScroll', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => {
stories.add('GrowScroll', () => {
const reverseColor = boolean('reverseColor', false)
return (

4
src/components/base/Input/stories.js

@ -5,6 +5,6 @@ import { storiesOf } from '@storybook/react'
import Input from 'components/base/Input'
const stories = storiesOf('Components/Input', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => <Input placeholder="Foo bar" />)
stories.add('Input', () => <Input placeholder="Foo bar" />)

4
src/components/base/Modal/stories.js

@ -6,9 +6,9 @@ import { boolean } from '@storybook/addon-knobs'
import { Modal, ModalBody } from 'components/base/Modal'
const stories = storiesOf('Components/Modal', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => {
stories.add('Modal', () => {
const isOpened = boolean('isOpened', true)
return (
<Modal

4
src/components/base/NewChart/stories.js

@ -9,7 +9,7 @@ import { color } from '@storybook/addon-knobs/react'
import Chart from 'components/base/NewChart'
const stories = storiesOf('Components/Chart', module)
const stories = storiesOf('Components', module)
const data = generateRandomData(365)
@ -52,7 +52,7 @@ class Wrapper extends Component<any, State> {
}
}
stories.add('default', () => <Wrapper />)
stories.add('Chart', () => <Wrapper />)
function generateRandomData(n) {
const today = moment()

4
src/components/base/Pills/stories.js

@ -5,7 +5,7 @@ import { storiesOf } from '@storybook/react'
import Pills from 'components/base/Pills'
const stories = storiesOf('Components/Pills', module)
const stories = storiesOf('Components', module)
type State = {
key: string,
@ -32,4 +32,4 @@ class Wrapper extends PureComponent<any, State> {
}
}
stories.add('basic', () => <Wrapper />)
stories.add('Pills', () => <Wrapper />)

4
src/components/base/QRCode/stories.js

@ -7,6 +7,6 @@ import { text, number } from '@storybook/addon-knobs'
import QRCode from 'components/base/QRCode'
const stories = storiesOf('Components/QRCode', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => <QRCode data={text('data', 'sample')} size={number('size', 200)} />)
stories.add('QRCode', () => <QRCode data={text('data', 'sample')} size={number('size', 200)} />)

4
src/components/base/Radio/stories.js

@ -5,8 +5,8 @@ import { boolean } from '@storybook/addon-knobs'
import Radio from 'components/base/Radio'
const stories = storiesOf('Components/Radio', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => (
stories.add('Radio', () => (
<Radio isChecked={boolean('checked', false)} onChange={action('onChange')} />
))

79
src/components/base/Search/stories.js

@ -1,79 +0,0 @@
// @flow
import React from 'react'
import PropTypes from 'prop-types'
import { storiesOf } from '@storybook/react'
import { text, boolean } from '@storybook/addon-knobs'
import Search from 'components/base/Search'
const stories = storiesOf('Components/Search', module)
const items = [
{ key: 'aleksandr-grichtchouk', name: 'Aleksandr Grichtchouk' },
{ key: 'fabiano-caruana', name: 'Fabiano Caruana' },
{ key: 'garry-kasparov', name: 'Garry Kasparov' },
{ key: 'hikaru-nakamura', name: 'Hikaru Nakamura' },
{ key: 'levon-aronian', name: 'Levon Aronian' },
{ key: 'magnus-carlsen', name: 'Magnus Carlsen' },
{ key: 'maxime-vachier-lagrave', name: 'Maxime Vachier-Lagrave' },
{ key: 'shakhriyar-mamedyarov', name: 'Shakhriyar Mamedyarov' },
{ key: 'veselin-topalov', name: 'Veselin Topalov' },
{ key: 'viswanathan-anand', name: 'Viswanathan Anand' },
{ key: 'vladimir-kramnik', name: 'Vladimir Kramnik' },
]
const Wrapper = ({ children }) => (
<div>
<div style={{ opacity: 0.2 }}>{'(Change the search value in knobs)'}</div>
{children}
</div>
)
Wrapper.propTypes = {
children: PropTypes.any.isRequired,
}
stories.add('basic', () => {
const value = text('value', '')
const filterEmpty = boolean('filterEmpty', false)
return (
<Wrapper>
<Search
value={value}
items={items}
filterEmpty={filterEmpty}
fuseOptions={{
keys: ['name'],
}}
render={items => items.map(item => <div key={item.name}>{item.name}</div>)}
/>
</Wrapper>
)
})
stories.add('highlight matches', () => {
const value = text('value', '')
const filterEmpty = boolean('filterEmpty', false)
return (
<Wrapper>
<Search
value={value}
items={items}
filterEmpty={filterEmpty}
highlight
fuseOptions={{
keys: ['name'],
}}
renderHighlight={(text, key) => (
<b key={key} style={{ textDecoration: 'underline', color: 'red' }}>
{text}
</b>
)}
render={items =>
items.map(item => <div key={item.key}>{item.name_highlight || item.name}</div>)
}
/>
</Wrapper>
)
})

4
src/components/base/Tabs/stories.js

@ -6,9 +6,9 @@ import { storiesOf } from '@storybook/react'
import Tabs from 'components/base/Tabs'
const stories = storiesOf('Components/Tabs', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => (
stories.add('Tabs', () => (
<Tabs
index={number('index', 0, {
min: 0,

4
src/components/base/Tooltip/stories.js

@ -5,6 +5,6 @@ import { storiesOf } from '@storybook/react'
import Tooltip from 'components/base/Tooltip'
const stories = storiesOf('Components/Tooltip', module)
const stories = storiesOf('Components', module)
stories.add('basic', () => <Tooltip render={() => <div>Oyo!</div>}>Hover me!</Tooltip>)
stories.add('Tooltip', () => <Tooltip render={() => <div>Oyo!</div>}>Hover me!</Tooltip>)

Loading…
Cancel
Save