From 8370602f37ad6aa02485d85e5b179b76c3f15701 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 31 Mar 2022 15:39:55 +0200
Subject: chore: add a Heading component

---
 src/components/atoms/headings/heading.stories.tsx | 37 +++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 src/components/atoms/headings/heading.stories.tsx

(limited to 'src/components/atoms/headings/heading.stories.tsx')

diff --git a/src/components/atoms/headings/heading.stories.tsx b/src/components/atoms/headings/heading.stories.tsx
new file mode 100644
index 0000000..9958af9
--- /dev/null
+++ b/src/components/atoms/headings/heading.stories.tsx
@@ -0,0 +1,37 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import HeadingComponent from './heading';
+
+export default {
+  title: 'Atoms/Headings',
+  component: HeadingComponent,
+  argTypes: {
+    children: {
+      description: 'Heading body.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    level: {
+      control: {
+        type: 'select',
+      },
+      description: 'Heading level.',
+      options: [1, 2, 3, 4, 5, 6],
+      type: {
+        name: 'number',
+        required: true,
+      },
+    },
+  },
+} as ComponentMeta<typeof HeadingComponent>;
+
+const Template: ComponentStory<typeof HeadingComponent> = (args) => {
+  const { level, ...props } = args;
+  return <HeadingComponent level={level || 1} {...props} />;
+};
+
+export const Heading = Template.bind({});
+Heading.args = {
+  children: 'Your title',
+};
-- 
cgit v1.2.3

