-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate storybook components to new package
- Loading branch information
1 parent
ae760c0
commit d926ae2
Showing
152 changed files
with
1,423 additions
and
1,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import type { ButtonPropTypes } from '@rango-dev/ui'; | ||
import type { Meta } from '@storybook/react'; | ||
|
||
import { Button, Divider, styled, WalletIcon } from '@rango-dev/ui'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<typeof Button> = { | ||
component: Button, | ||
args: { | ||
prefix: <></>, | ||
suffix: <></>, | ||
}, | ||
argTypes: { | ||
size: { | ||
options: ['medium', 'small', 'xxsmall', 'xsmall', 'large'], | ||
control: { type: 'select' }, | ||
description: 'medium | small | xxsmall | xsmall | large | undefined', | ||
type: 'string', | ||
}, | ||
variant: { | ||
name: 'variant', | ||
options: ['contained', 'outlined', 'ghost', 'default'], | ||
control: { type: 'select' }, | ||
description: 'contained | outlined | ghost | default | undefined', | ||
type: 'string', | ||
}, | ||
type: { | ||
options: ['primary', 'secondary', 'error', 'warning', 'success'], | ||
control: { type: 'select' }, | ||
description: | ||
'primary | secondary | error | warning | success | undefined', | ||
type: 'string', | ||
}, | ||
loading: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
fullWidth: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
disableRipple: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
const Content = styled('div', { | ||
display: 'flex', | ||
alignItems: 'center', | ||
}); | ||
|
||
export const Main = (props: ButtonPropTypes) => ( | ||
<Button {...props}>I'm a button</Button> | ||
); | ||
|
||
export const WithPrefix = (args: ButtonPropTypes) => { | ||
return ( | ||
<Button {...args} prefix={<WalletIcon />}> | ||
I'm a button | ||
</Button> | ||
); | ||
}; | ||
|
||
export const WithSuffix = (args: ButtonPropTypes) => ( | ||
<Button {...args} suffix={<WalletIcon />}> | ||
I'm a button | ||
</Button> | ||
); | ||
|
||
export const TypesAndVariants = (args: ButtonPropTypes) => ( | ||
<div> | ||
<Content> | ||
<Button {...args} type="primary" variant="contained"> | ||
I'm a primary button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="primary" variant="outlined"> | ||
I'm a primary button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="primary" variant="ghost"> | ||
I'm a primary button | ||
</Button> | ||
</Content> | ||
|
||
<Divider size={12} /> | ||
<Content> | ||
<Button {...args} type="secondary" variant="contained"> | ||
I'm a secondary button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="secondary" variant="outlined"> | ||
I'm a secondary button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="secondary" variant="ghost"> | ||
I'm a secondary button | ||
</Button> | ||
</Content> | ||
|
||
<Divider size={12} /> | ||
<Content> | ||
<Button {...args} type="error" variant="contained"> | ||
I'm a error button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="error" variant="outlined"> | ||
I'm a error button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="error" variant="ghost"> | ||
I'm a error button | ||
</Button> | ||
</Content> | ||
|
||
<Divider size={12} /> | ||
<Content> | ||
<Button {...args} type="warning" variant="contained"> | ||
I'm a warning button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="warning" variant="outlined"> | ||
I'm a warning button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="warning" variant="ghost"> | ||
I'm a warning button | ||
</Button> | ||
</Content> | ||
|
||
<Divider size={12} /> | ||
<Content> | ||
<Button {...args} type="success" variant="contained"> | ||
I'm a success button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="success" variant="outlined"> | ||
I'm a success button | ||
</Button> | ||
<Divider direction="horizontal" size={12} /> | ||
<Button {...args} type="success" variant="ghost"> | ||
I'm a success button | ||
</Button> | ||
</Content> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import type { ChainTokenPropTypes } from '@rango-dev/ui'; | ||
import type { Meta } from '@storybook/react'; | ||
|
||
import { ChainToken } from '@rango-dev/ui'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<typeof ChainToken> = { | ||
title: 'Components/Chain Token', | ||
component: ChainToken, | ||
args: { | ||
chainImage: 'https://api.rango.exchange/blockchains/bsc.svg', | ||
tokenImage: 'https://api.rango.exchange/tokens/ETH/BNB.png', | ||
size: 'medium', | ||
}, | ||
argTypes: { | ||
size: { | ||
options: ['medium', 'small', 'large', 'xmedium'], | ||
control: { type: 'select' }, | ||
description: 'medium | small | large | xmedium', | ||
type: 'string', | ||
}, | ||
chianImageId: { | ||
control: { type: 'text' }, | ||
type: 'string', | ||
}, | ||
useAsPlaceholder: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
loading: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Main = (args: ChainTokenPropTypes) => <ChainToken {...args} />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import type { CheckboxPropTypes } from '@rango-dev/ui'; | ||
import type { Meta } from '@storybook/react'; | ||
|
||
import { Checkbox } from '@rango-dev/ui'; | ||
import React from 'react'; | ||
|
||
const meta: Meta<typeof Checkbox> = { | ||
title: 'Components/Checkbox', | ||
component: Checkbox, | ||
args: { | ||
label: 'I am a checkbox', | ||
defaultChecked: true, | ||
}, | ||
argTypes: { | ||
id: { | ||
control: { type: 'text' }, | ||
type: 'string', | ||
}, | ||
label: { | ||
control: { type: 'text' }, | ||
defaultValue: 'I am a checkbox', | ||
}, | ||
defaultChecked: { | ||
control: { type: 'boolean' }, | ||
defaultValue: true, | ||
type: 'boolean', | ||
}, | ||
checked: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' }, | ||
type: 'boolean', | ||
}, | ||
name: { | ||
control: { type: 'text' }, | ||
type: 'string', | ||
}, | ||
onCheckedChange: { | ||
type: 'function', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Main = (props: CheckboxPropTypes) => ( | ||
<Checkbox id="test" label="My checkbox" {...props} /> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 12 additions & 9 deletions
21
...nents/Collapsible/Collapsible.stories.tsx → ...ok/src/components/Collapsible.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.