aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/legend/legend.stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/atoms/forms/legend/legend.stories.tsx')
-rw-r--r--src/components/atoms/forms/legend/legend.stories.tsx38
1 files changed, 18 insertions, 20 deletions
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',
+ },
};