-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added the stories of the components of the atoms
- Loading branch information
1 parent
73b62dd
commit 53d9015
Showing
8 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/dantalion-web-playground/src/components/atoms/Anchor.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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import Anchor, { Props } from './Anchor'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: Anchor, | ||
title: `atoms/${Anchor.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ | ||
children, | ||
className, | ||
href, | ||
noblank, | ||
nofollow, | ||
tooltip, | ||
}) => ( | ||
<Anchor | ||
className={className} | ||
href={href} | ||
noblank={noblank} | ||
nofollow={nofollow} | ||
tooltip={tooltip} | ||
> | ||
{children} | ||
</Anchor> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
className: 'text-4xl', | ||
href: 'https://kurone-kito.github.io/dantalion', | ||
children: 'Dantalion', | ||
noblank: false, | ||
nofollow: false, | ||
tooltip: 'Tooltip', | ||
}; |
17 changes: 17 additions & 0 deletions
17
packages/dantalion-web-playground/src/components/atoms/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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import Button, { Props } from './Button'; | ||
|
||
export default Object.freeze<Meta>({ | ||
argTypes: { onClick: { action: 'clicked' } }, | ||
component: Button, | ||
title: `atoms/${Button.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ children, className, onClick }) => ( | ||
<Button className={className} onClick={onClick}> | ||
{children} | ||
</Button> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { className: 'text-4xl', children: 'Children' }; |
12 changes: 12 additions & 0 deletions
12
packages/dantalion-web-playground/src/components/atoms/Header.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import Header, { Props } from './Header'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: Header, | ||
title: `atoms/${Header.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ children }) => <Header>{children}</Header>; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { children: 'Children' }; |
15 changes: 15 additions & 0 deletions
15
packages/dantalion-web-playground/src/components/atoms/InlineMarkdown.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import { ReactMarkdownOptions } from 'react-markdown'; | ||
import InlineMarkdown from './InlineMarkdown'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: InlineMarkdown, | ||
title: `atoms/${InlineMarkdown.displayName}`, | ||
}); | ||
|
||
const Template: Story<ReactMarkdownOptions> = ({ children }) => ( | ||
<InlineMarkdown>{children}</InlineMarkdown> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { children: '_Markdown_ **contents**' }; |
13 changes: 13 additions & 0 deletions
13
packages/dantalion-web-playground/src/components/atoms/Input.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import Input, { Props } from './Input'; | ||
|
||
export default Object.freeze<Meta>({ | ||
argTypes: { onBlur: { action: 'blured' }, onChange: { action: 'changed' } }, | ||
component: Input, | ||
title: `atoms/${Input.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ label }) => <Input label={label} />; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { label: 'Label', placeholder: 'Placeholder' }; |
20 changes: 20 additions & 0 deletions
20
packages/dantalion-web-playground/src/components/atoms/List.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import List, { Props } from './List'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: List, | ||
title: `atoms/${List.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ children, className, itemType, order }) => ( | ||
<List className={className} itemType={itemType} order={order}> | ||
{children} | ||
</List> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
children: ['A', 'B', 'C'], | ||
className: 'list-disc text-red-900', | ||
order: false, | ||
}; |
14 changes: 14 additions & 0 deletions
14
packages/dantalion-web-playground/src/components/atoms/ResultFrame.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import ResultFrame, { Props } from './ResultFrame'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: ResultFrame, | ||
title: `atoms/${ResultFrame.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ children }) => ( | ||
<ResultFrame>{children}</ResultFrame> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { children: 'Children' }; |
21 changes: 21 additions & 0 deletions
21
packages/dantalion-web-playground/src/components/atoms/ResultHeading.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Meta, Story } from '@storybook/react'; | ||
import ResultHeading, { Props } from './ResultHeading'; | ||
|
||
export default Object.freeze<Meta>({ | ||
component: ResultHeading, | ||
title: `atoms/${ResultHeading.displayName}`, | ||
}); | ||
|
||
const Template: Story<Props> = ({ additional, children, detail, heading }) => ( | ||
<ResultHeading additional={additional} detail={detail} heading={heading}> | ||
{children} | ||
</ResultHeading> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
additional: 'Additional', | ||
children: 'Children', | ||
detail: 'Detail', | ||
heading: 'Heading', | ||
}; |