diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-12-15 18:35:16 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-12-15 18:49:49 +0100 |
| commit | 0f936ec0e7606cb79434d94096b6e113a7ce78eb (patch) | |
| tree | 465ec7f66ac9459be6a18ac046e10357814c7b92 /src/components/organisms/nav/main-nav/main-nav.stories.tsx | |
| parent | 4e4d2eb25365be861e19f9756cf334ba2faa6911 (diff) | |
refactor(stories): migrate stories to CSF3 format
Diffstat (limited to 'src/components/organisms/nav/main-nav/main-nav.stories.tsx')
| -rw-r--r-- | src/components/organisms/nav/main-nav/main-nav.stories.tsx | 107 |
1 files changed, 45 insertions, 62 deletions
diff --git a/src/components/organisms/nav/main-nav/main-nav.stories.tsx b/src/components/organisms/nav/main-nav/main-nav.stories.tsx index 6333f2c..c18d0d5 100644 --- a/src/components/organisms/nav/main-nav/main-nav.stories.tsx +++ b/src/components/organisms/nav/main-nav/main-nav.stories.tsx @@ -1,71 +1,54 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Icon } from '../../../atoms'; import { MainNav } from './main-nav'; -/** - * MainNav - Storybook Meta - */ -export default { - title: 'Organisms/Nav/MainNav', +const meta = { component: MainNav, - argTypes: { - items: { - description: 'The main nav items.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - }, -} as ComponentMeta<typeof MainNav>; + title: 'Organisms/Nav/MainNav', +} satisfies Meta<typeof MainNav>; + +export default meta; -const Template: ComponentStory<typeof MainNav> = (args) => ( - <MainNav {...args} /> -); +type Story = StoryObj<typeof meta>; -/** - * MainNav Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - items: [ - { id: 'home', label: 'Home', href: '#home' }, - { id: 'blog', label: 'Blog', href: '#blog' }, - { id: 'projects', label: 'Projects', href: '#projects' }, - { id: 'contact', label: 'Contact', href: '#contact' }, - ], +export const Example: Story = { + args: { + items: [ + { id: 'home', label: 'Home', href: '#home' }, + { id: 'blog', label: 'Blog', href: '#blog' }, + { id: 'projects', label: 'Projects', href: '#projects' }, + { id: 'contact', label: 'Contact', href: '#contact' }, + ], + }, }; -/** - * MainNav Stories - WithLogo - */ -export const WithLogo = Template.bind({}); -WithLogo.args = { - items: [ - { - id: 'home', - label: 'Home', - href: '#home', - logo: <Icon aria-hidden shape="home" />, - }, - { - id: 'blog', - label: 'Blog', - href: '#blog', - logo: <Icon aria-hidden shape="posts-stack" />, - }, - { - id: 'projects', - label: 'Projects', - href: '#projects', - logo: <Icon aria-hidden shape="computer" />, - }, - { - id: 'contact', - label: 'Contact', - href: '#contact', - logo: <Icon aria-hidden shape="envelop" />, - }, - ], +export const WithLogo: Story = { + args: { + items: [ + { + id: 'home', + label: 'Home', + href: '#home', + logo: <Icon aria-hidden shape="home" />, + }, + { + id: 'blog', + label: 'Blog', + href: '#blog', + logo: <Icon aria-hidden shape="posts-stack" />, + }, + { + id: 'projects', + label: 'Projects', + href: '#projects', + logo: <Icon aria-hidden shape="computer" />, + }, + { + id: 'contact', + label: 'Contact', + href: '#contact', + logo: <Icon aria-hidden shape="envelop" />, + }, + ], + }, }; |
