Skip to content

Commit

Permalink
feat: adds spinner and buttonGroup example stories
Browse files Browse the repository at this point in the history
  • Loading branch information
riyalohia committed Jul 21, 2020
1 parent 52ab440 commit e2ba146
Show file tree
Hide file tree
Showing 30 changed files with 338 additions and 150 deletions.
2 changes: 1 addition & 1 deletion core/components/atoms/button/__stories__/Cancel.story.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Button from '../Button';

export const cancel = () => (
export const cancelButton = () => (
<Button
appearance="basic"
size="regular"
Expand Down
26 changes: 13 additions & 13 deletions core/components/atoms/button/__stories__/Download.story.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as React from 'react';
import Button from '../Button';

export const download = () => (
<Button
appearance="basic"
size="regular"
expanded={false}
disabled={false}
loading={false}
icon="get_app"
iconAlign="left"
>
Download
</Button>
);
export const downloadButton = () => (
<Button
appearance="basic"
size="regular"
expanded={false}
disabled={false}
loading={false}
icon="get_app"
iconAlign="left"
>
Download
</Button>
);

export default {
title: 'Atoms|Button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import * as React from 'react';
import Button from '../Button';

export const iconLeftSecondary = () => (
<Button
appearance="basic"
size="regular"
expanded={false}
disabled={false}
loading={false}
icon={'refresh'}
iconAlign={'left'}
>
{'Button'}
</Button>
);
<Button
appearance="basic"
size="regular"
expanded={false}
disabled={false}
loading={false}
icon={'refresh'}
iconAlign={'left'}
>
{'Button'}
</Button>
);

export default {
title: 'Atoms|Button',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import * as React from 'react';
import Button from '../Button';

export const LargeIconRightPrimary = () => (
<Button
appearance="primary"
size="large"
expanded={false}
disabled={false}
loading={false}
icon={'refresh'}
iconAlign={'right'}
>
{'Button'}
</Button>
);
export const LargeIconRightPrimary = () => (
<Button
appearance="primary"
size="large"
expanded={false}
disabled={false}
loading={false}
icon={'refresh'}
iconAlign={'right'}
>
{'Button'}
</Button>
);

export default {
title: 'Atoms|Button',
Expand Down
23 changes: 12 additions & 11 deletions core/components/atoms/button/__stories__/LoadingPrimary.story.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import * as React from 'react';
import Button from '../Button';
export const loadingPrimary = () => (
<Button
appearance="primary"
size="regular"
expanded={false}
disabled={false}
loading={true}
>
{''}
</Button>
);

export const loadingPrimary = () => (
<Button
appearance="primary"
size="regular"
expanded={false}
disabled={false}
loading={true}
>
{''}
</Button>
);

export default {
title: 'Atoms|Button',
Expand Down
22 changes: 11 additions & 11 deletions core/components/atoms/button/__stories__/MenuHorizontal.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import * as React from 'react';
import Button from '../Button';

export const menuHorizontal = () => (
<Button
appearance={'transparent'}
size="regular"
expanded={false}
disabled={false}
loading={false}
icon="more_horiz"
>
{''}
</Button>
);
<Button
appearance={'transparent'}
size="regular"
expanded={false}
disabled={false}
loading={false}
icon="more_horiz"
>
{''}
</Button>
);

export default {
title: 'Atoms|Button',
Expand Down
2 changes: 1 addition & 1 deletion core/components/atoms/button/__stories__/Submit.story.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Button from '../Button';

export const submit = () => (
export const submitButton = () => (
<Button
appearance="primary"
size="regular"
Expand Down
1 change: 1 addition & 0 deletions core/components/atoms/chip/_stories_/Action.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import Chip from '../Chip';

export const actionChip = () => (
<Chip
label="First Name"
Expand Down
17 changes: 9 additions & 8 deletions core/components/atoms/chip/_stories_/Input.story.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import * as React from 'react';
import Chip from '../Chip';

export const input = () => (
<Chip
label="First Name"
clearButton={false}
disabled={false}
type="input"
name={'chip'}
/>
);
<Chip
label="First Name"
clearButton={false}
disabled={false}
type="input"
name={'chip'}
/>
);

export default {
title: 'Atoms|Chip',
Expand Down
18 changes: 10 additions & 8 deletions core/components/atoms/chip/_stories_/Selection.story.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import * as React from 'react';
import Chip from '../Chip';

export const selection = () => (
<Chip
label="Yes"
clearButton={false}
type="selection"
selected={false}
name={'chip'}
/>
);
<Chip
label="Yes"
clearButton={false}
type="selection"
selected={false}
name={'chip'}
/>
);

export default {
title: 'Atoms|Chip',
component: Chip,
Expand Down
16 changes: 16 additions & 0 deletions core/components/atoms/message/__stories__/Success.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from 'react';
import Message from '../index';

// CSF format story
export const successWithoutTitle = () => (
<Message
appearance={'success'}
>
{'Password updated. Login with your updated credentials.'}
</Message>
);

export default {
title: 'Atoms|Message',
component: Message
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from 'react';
import Message from '../index';

// CSF format story
export const successWithTitle = () => (
<Message
appearance={'success'}
title={'Outreach successfully sent'}
>
{'2,340 messages sent.'}
</Message>
);

export default {
title: 'Atoms|Message',
component: Message
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import ProgressBar from '../ProgressBar';

// CSF format story
export const fiftyPercent = () => (
<ProgressBar
value={Number(50)}
max={Number(100)}
/>
);
<ProgressBar
value={50}
max={100}
/>
);

export default {
title: 'Atoms|ProgressBar',
Expand Down

This file was deleted.

This file was deleted.

20 changes: 20 additions & 0 deletions core/components/atoms/spinner/__stories__/InlineLoader.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react';
import Spinner from '../Spinner';
import Text from '@/components/atoms/text';

// CSF format story
export const inlineLoader = () => (
<div className="d-flex">
<Spinner
appearance="primary"
size="small"
className="mr-3"
/>
<Text>uploading...</Text>
</div>
);

export default {
title: 'Atoms|Loaders/Spinner',
component: Spinner
};
15 changes: 15 additions & 0 deletions core/components/atoms/spinner/__stories__/ModalLoader.story.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as React from 'react';
import Spinner from '../Spinner';

// CSF format story
export const modalLoader = () => (
<Spinner
appearance="primary"
size="medium"
/>
);

export default {
title: 'Atoms|Loaders/Spinner',
component: Spinner
};
14 changes: 8 additions & 6 deletions core/components/atoms/statusHint/__stories__/Completed.story.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as React from 'react';
import StatusHint from '../StatusHint';

export const completed = () => (
<StatusHint
appearance="success"
>
{'Completed'}
</StatusHint>
);
<StatusHint
appearance="success"
>
{'Completed'}
</StatusHint>
);

export default {
title: 'Atoms|StatusHint',
component: StatusHint,
Expand Down
14 changes: 8 additions & 6 deletions core/components/atoms/statusHint/__stories__/Inactive.story.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as React from 'react';
import StatusHint from '../StatusHint';

export const inactive = () => (
<StatusHint
appearance="alert"
>
{'Inactive'}
</StatusHint>
);
<StatusHint
appearance="alert"
>
{'Inactive'}
</StatusHint>
);

export default {
title: 'Atoms|StatusHint',
component: StatusHint,
Expand Down
Loading

0 comments on commit e2ba146

Please sign in to comment.