aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/nav-item/nav-item.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-15 18:35:16 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-15 18:49:49 +0100
commit0f936ec0e7606cb79434d94096b6e113a7ce78eb (patch)
tree465ec7f66ac9459be6a18ac046e10357814c7b92 /src/components/molecules/nav/nav-item/nav-item.stories.tsx
parent4e4d2eb25365be861e19f9756cf334ba2faa6911 (diff)
refactor(stories): migrate stories to CSF3 format
Diffstat (limited to 'src/components/molecules/nav/nav-item/nav-item.stories.tsx')
-rw-r--r--src/components/molecules/nav/nav-item/nav-item.stories.tsx46
1 files changed, 17 insertions, 29 deletions
diff --git a/src/components/molecules/nav/nav-item/nav-item.stories.tsx b/src/components/molecules/nav/nav-item/nav-item.stories.tsx
index df736a4..3d77b4d 100644
--- a/src/components/molecules/nav/nav-item/nav-item.stories.tsx
+++ b/src/components/molecules/nav/nav-item/nav-item.stories.tsx
@@ -1,37 +1,25 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { Meta, StoryObj } from '@storybook/react';
import { NavLink } from '../nav-link';
-import { NavItem } from './nav-item';
+import { NavItem, type NavItemProps } from './nav-item';
-/**
- * NavItem - Storybook Meta
- */
-export default {
- title: 'Molecules/Nav/NavItem',
- component: NavItem,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'Define the nav item contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof NavItem>;
-
-const Template: ComponentStory<typeof NavItem> = (args) => (
+const WrappedNavItem = (args: NavItemProps) => (
<ul style={{ margin: 0, padding: 0 }}>
<NavItem {...args} />
</ul>
);
-/**
- * NavItem Stories - Default
- */
-export const Default = Template.bind({});
-Default.args = {
- children: <NavLink href="#example" label="Example" />,
+const meta = {
+ component: NavItem,
+ title: 'Molecules/Nav/Item',
+ render: WrappedNavItem,
+} satisfies Meta<typeof NavItem>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: <NavLink href="#example" label="Example" />,
+ },
};