From 581632a626f81bce522be1cd809e9832d5b11c99 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 31 Mar 2022 18:21:30 +0200
Subject: chore: add a Label component

---
 src/components/atoms/forms/label.stories.tsx | 53 ++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 src/components/atoms/forms/label.stories.tsx

(limited to 'src/components/atoms/forms/label.stories.tsx')

diff --git a/src/components/atoms/forms/label.stories.tsx b/src/components/atoms/forms/label.stories.tsx
new file mode 100644
index 0000000..06e8eb9
--- /dev/null
+++ b/src/components/atoms/forms/label.stories.tsx
@@ -0,0 +1,53 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import LabelComponent from './label';
+
+export default {
+  title: 'Atoms/Forms',
+  component: LabelComponent,
+  argTypes: {
+    children: {
+      control: {
+        type: 'text',
+      },
+      description: 'The label body.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    htmlFor: {
+      control: {
+        type: 'text',
+      },
+      description: 'The field id.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    required: {
+      control: {
+        type: 'boolean',
+      },
+      description: 'Set to true if the field is required.',
+      table: {
+        category: 'Options',
+      },
+      type: {
+        name: 'boolean',
+        required: false,
+      },
+    },
+  },
+} as ComponentMeta<typeof LabelComponent>;
+
+const Template: ComponentStory<typeof LabelComponent> = (args) => {
+  const { children, ...props } = args;
+  return <LabelComponent {...props}>{children}</LabelComponent>;
+};
+
+export const Label = Template.bind({});
+Label.args = {
+  children: 'A label',
+  htmlFor: 'a-field-id',
+};
-- 
cgit v1.2.3

