-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor stories to enable show code feature
- Loading branch information
1 parent
ebd2b37
commit 6cc83eb
Showing
7 changed files
with
52 additions
and
70 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
39 changes: 17 additions & 22 deletions
39
packages/storybook/stories/buttons/add-button.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,54 @@ | ||
import React from 'react'; | ||
|
||
import { AddButton } from '@equisoft/design-elements-react'; | ||
|
||
type ButtonType = 'primary' | 'secondary' | 'tertiary'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Buttons/Add', | ||
component: AddButton, | ||
}; | ||
|
||
export const addButtons = () => ( | ||
<div> | ||
<> | ||
<AddButton | ||
label="Primary" | ||
buttonType={'primary' as ButtonType} | ||
buttonType="primary" | ||
disabled={false} | ||
/> | ||
<AddButton | ||
label="Secondary" | ||
buttonType={'secondary' as ButtonType} | ||
buttonType="secondary" | ||
disabled={false} | ||
/> | ||
<AddButton | ||
label="Tertiary" | ||
buttonType={'tertiary' as ButtonType} | ||
buttonType="tertiary" | ||
disabled={false} | ||
/> | ||
</div> | ||
</> | ||
); | ||
export const disabled = () => ( | ||
<div> | ||
<> | ||
<AddButton | ||
label="Primary" | ||
buttonType={'primary' as ButtonType} | ||
buttonType="primary" | ||
disabled={true} | ||
/> | ||
<AddButton | ||
label="Secondary" | ||
buttonType={'secondary' as ButtonType} | ||
buttonType="secondary" | ||
disabled={true} | ||
/> | ||
<AddButton | ||
label="Tertiary" | ||
buttonType={'tertiary' as ButtonType} | ||
buttonType="tertiary" | ||
disabled={true} | ||
/> | ||
</div> | ||
</> | ||
); | ||
export const eventCallback = () => ( | ||
<div> | ||
<AddButton | ||
label="See Console For Callback" | ||
buttonType={'primary' as ButtonType} | ||
onClick={() => { console.log('The button has been clicked!'); }} | ||
disabled={false} | ||
/> | ||
</div> | ||
<AddButton | ||
label="See Console For Callback" | ||
buttonType="primary" | ||
onClick={() => { console.log('The button has been clicked!'); }} | ||
disabled={false} | ||
/> | ||
); |
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 |
---|---|---|
@@ -1,35 +1,30 @@ | ||
import React from 'react'; | ||
|
||
import { Button } from '@equisoft/design-elements-react'; | ||
|
||
type ButtonType = 'primary' | 'secondary' | 'tertiary'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Buttons', | ||
component: Button, | ||
}; | ||
|
||
export const buttons = () => ( | ||
<div> | ||
<Button label="Primary" buttonType={'primary' as ButtonType} disabled={false} /> | ||
<Button label="Secondary" buttonType={'secondary' as ButtonType} disabled={false} /> | ||
<Button label="Tertiary" buttonType={'tertiary' as ButtonType} disabled={false} /> | ||
</div> | ||
<> | ||
<Button label="Primary" buttonType="primary" disabled={false} /> | ||
<Button label="Secondary" buttonType="secondary" disabled={false} /> | ||
<Button label="Tertiary" buttonType="tertiary" disabled={false} /> | ||
</> | ||
); | ||
export const disabled = () => ( | ||
<div> | ||
<Button label="Primary" buttonType={'primary' as ButtonType} disabled={true} /> | ||
<Button label="Secondary" buttonType={'secondary' as ButtonType} disabled={true} /> | ||
<Button label="Tertiary" buttonType={'tertiary' as ButtonType} disabled={true} /> | ||
</div> | ||
<> | ||
<Button label="Primary" buttonType="primary" disabled={true} /> | ||
<Button label="Secondary" buttonType="secondary" disabled={true} /> | ||
<Button label="Tertiary" buttonType="tertiary" disabled={true} /> | ||
</> | ||
); | ||
export const eventCallback = () => ( | ||
<div> | ||
<Button | ||
label="See Console For Callback" | ||
onClick={() => { console.log('The button has been clicked!'); }} | ||
buttonType={'primary' as ButtonType} | ||
disabled={false} | ||
/> | ||
</div> | ||
<Button | ||
label="See Console For Callback" | ||
onClick={() => { console.log('The button has been clicked!'); }} | ||
buttonType="primary" | ||
disabled={false} | ||
/> | ||
); |
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ export default { | |
|
||
export const normal = () => ( | ||
<Card>Hello, World!</Card> | ||
); | ||
); |
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