Skip to content

Commit

Permalink
feat: added the stories of the components of the atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
kurone-kito committed Jun 5, 2021
1 parent 73b62dd commit 53d9015
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 0 deletions.
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',
};
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' };
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' };
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**' };
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' };
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,
};
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' };
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',
};

0 comments on commit 53d9015

Please sign in to comment.