summaryrefslogtreecommitdiffstats
path: root/src/components/atoms/buttons/button.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-20 19:24:21 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-20 19:27:29 +0200
commita08291b1586858fc894a27d56f55f87a88f8dbd3 (patch)
tree0aa36c8add0ad0ecc07c0f7f20f5af3e2f7abe46 /src/components/atoms/buttons/button.stories.tsx
parent362cf45bc520a68a1c1be20e1189ca2307577dde (diff)
refactor(storybook): reorganize design system
Add more stories for each components and change some components categories for better organization.
Diffstat (limited to 'src/components/atoms/buttons/button.stories.tsx')
-rw-r--r--src/components/atoms/buttons/button.stories.tsx42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/components/atoms/buttons/button.stories.tsx b/src/components/atoms/buttons/button.stories.tsx
index d47a1ea..6803706 100644
--- a/src/components/atoms/buttons/button.stories.tsx
+++ b/src/components/atoms/buttons/button.stories.tsx
@@ -1,12 +1,14 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import ButtonComponent from './button';
+import Button from './button';
+/**
+ * Button - Storybook Meta
+ */
export default {
- title: 'Atoms/Buttons',
- component: ButtonComponent,
+ title: 'Atoms/Buttons/Button',
+ component: Button,
args: {
disabled: false,
- kind: 'secondary',
type: 'button',
},
argTypes: {
@@ -119,9 +121,9 @@ export default {
},
},
},
-} as ComponentMeta<typeof ButtonComponent>;
+} as ComponentMeta<typeof Button>;
-const Template: ComponentStory<typeof ButtonComponent> = (args) => {
+const Template: ComponentStory<typeof Button> = (args) => {
const { children, type, ...props } = args;
const getBody = () => {
@@ -139,10 +141,32 @@ const Template: ComponentStory<typeof ButtonComponent> = (args) => {
};
return (
- <ButtonComponent type={type} {...props}>
+ <Button type={type} {...props}>
{getBody()}
- </ButtonComponent>
+ </Button>
);
};
-export const Button = Template.bind({});
+/**
+ * Button Story - Primary
+ */
+export const Primary = Template.bind({});
+Primary.args = {
+ kind: 'primary',
+};
+
+/**
+ * Button Story - Secondary
+ */
+export const Secondary = Template.bind({});
+Secondary.args = {
+ kind: 'secondary',
+};
+
+/**
+ * Button Story - Tertiary
+ */
+export const Tertiary = Template.bind({});
+Tertiary.args = {
+ kind: 'tertiary',
+};