From 0f936ec0e7606cb79434d94096b6e113a7ce78eb Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 15 Dec 2023 18:35:16 +0100
Subject: refactor(stories): migrate stories to CSF3 format

---
 .../atoms/forms/legend/legend.stories.tsx          | 38 ++++++++++------------
 1 file changed, 18 insertions(+), 20 deletions(-)

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

diff --git a/src/components/atoms/forms/legend/legend.stories.tsx b/src/components/atoms/forms/legend/legend.stories.tsx
index b23d889..963fe33 100644
--- a/src/components/atoms/forms/legend/legend.stories.tsx
+++ b/src/components/atoms/forms/legend/legend.stories.tsx
@@ -1,27 +1,25 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { Meta, StoryObj } from '@storybook/react';
 import { Fieldset } from '../fieldset';
-import { Legend as LegendComponent } from './legend';
+import { Legend, type LegendProps } from './legend';
 
-/**
- * Legend - Storybook Meta
- */
-export default {
-  title: 'Atoms/Forms',
-  component: LegendComponent,
-  args: {},
-  argTypes: {},
-} as ComponentMeta<typeof LegendComponent>;
-
-const Template: ComponentStory<typeof LegendComponent> = (args) => (
+const FieldsetWithLegend = (args: LegendProps) => (
   <Fieldset>
-    <LegendComponent {...args} />
+    <Legend {...args} />
   </Fieldset>
 );
 
-/**
- * Legend Story
- */
-export const Legend = Template.bind({});
-Legend.args = {
-  children: 'A fieldset legend',
+const meta = {
+  component: Legend,
+  title: 'Atoms/Forms/Legend',
+  render: FieldsetWithLegend,
+} satisfies Meta<typeof Legend>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Default: Story = {
+  args: {
+    children: 'A legend',
+  },
 };
-- 
cgit v1.2.3

