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

---
 src/components/organisms/navbar/navbar.stories.tsx | 108 ++++++++-------------
 1 file changed, 43 insertions(+), 65 deletions(-)

(limited to 'src/components/organisms/navbar/navbar.stories.tsx')

diff --git a/src/components/organisms/navbar/navbar.stories.tsx b/src/components/organisms/navbar/navbar.stories.tsx
index 95b71ef..a52602e 100644
--- a/src/components/organisms/navbar/navbar.stories.tsx
+++ b/src/components/organisms/navbar/navbar.stories.tsx
@@ -1,77 +1,55 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Navbar as NavbarComponent } from './navbar';
+import type { Meta, StoryObj } from '@storybook/react';
+import { Navbar } from './navbar';
 import { NavbarItem } from './navbar-item';
 
-/**
- * Navbar - Storybook Meta
- */
-export default {
+const meta = {
+  component: Navbar,
   title: 'Organisms/Navbar',
-  component: NavbarComponent,
-  argTypes: {
-    children: {
-      description: 'The navbar items.',
-      type: {
-        name: 'object',
-        required: true,
-        value: {},
-      },
-    },
-  },
-  parameters: {
-    layout: 'fullscreen',
-  },
-} as ComponentMeta<typeof NavbarComponent>;
+} satisfies Meta<typeof Navbar>;
 
-const Template: ComponentStory<typeof NavbarComponent> = (args) => (
-  <NavbarComponent {...args} />
-);
+export default meta;
 
-/**
- * Navbar Stories - 1 item
- */
-export const OneItem = Template.bind({});
-OneItem.args = {
-  children: (
-    <NavbarItem icon="hamburger" id="main-nav" label="Nav">
-      The main nav contents
-    </NavbarItem>
-  ),
-};
+type Story = StoryObj<typeof meta>;
 
-/**
- * Navbar Stories - 2 items
- */
-export const TwoItems = Template.bind({});
-TwoItems.args = {
-  children: (
-    <>
+export const OneItem: Story = {
+  args: {
+    children: (
       <NavbarItem icon="hamburger" id="main-nav" label="Nav">
         The main nav contents
       </NavbarItem>
-      <NavbarItem icon="magnifying-glass" id="search" label="Search">
-        A search form
-      </NavbarItem>
-    </>
-  ),
+    ),
+  },
 };
 
-/**
- * Navbar Stories - 3 items
- */
-export const ThreeItems = Template.bind({});
-ThreeItems.args = {
-  children: (
-    <>
-      <NavbarItem icon="hamburger" id="main-nav" label="Nav">
-        The main nav contents
-      </NavbarItem>
-      <NavbarItem icon="magnifying-glass" id="search" label="Search">
-        A search form
-      </NavbarItem>
-      <NavbarItem icon="cog" id="settings" label="Settings">
-        A settings form
-      </NavbarItem>
-    </>
-  ),
+export const TwoItems: Story = {
+  args: {
+    children: (
+      <>
+        <NavbarItem icon="hamburger" id="main-nav" label="Nav">
+          The main nav contents
+        </NavbarItem>
+        <NavbarItem icon="magnifying-glass" id="search" label="Search">
+          A search form
+        </NavbarItem>
+      </>
+    ),
+  },
+};
+
+export const ThreeItems: Story = {
+  args: {
+    children: (
+      <>
+        <NavbarItem icon="hamburger" id="main-nav" label="Nav">
+          The main nav contents
+        </NavbarItem>
+        <NavbarItem icon="magnifying-glass" id="search" label="Search">
+          A search form
+        </NavbarItem>
+        <NavbarItem icon="cog" id="settings" label="Settings">
+          A settings form
+        </NavbarItem>
+      </>
+    ),
+  },
 };
-- 
cgit v1.2.3

