From 0f936ec0e7606cb79434d94096b6e113a7ce78eb Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 15 Dec 2023 18:35:16 +0100 Subject: refactor(stories): migrate stories to CSF3 format --- .../molecules/colophon/colophon.stories.tsx | 102 +++++++-------------- 1 file changed, 33 insertions(+), 69 deletions(-) (limited to 'src/components/molecules/colophon') diff --git a/src/components/molecules/colophon/colophon.stories.tsx b/src/components/molecules/colophon/colophon.stories.tsx index 7baecad..83db4f4 100644 --- a/src/components/molecules/colophon/colophon.stories.tsx +++ b/src/components/molecules/colophon/colophon.stories.tsx @@ -1,83 +1,47 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Icon } from '../../atoms'; import { Copyright } from '../copyright'; import { Colophon } from './colophon'; -/** - * Colophon - Storybook Meta - */ -export default { - title: 'Molecules/Colophon', +const meta = { component: Colophon, - argTypes: { - copyright: { - description: 'The website copyright.', - type: { - name: 'object', - required: true, - value: {}, - }, - }, - links: { - control: { - type: 'object', - }, - description: - 'Adds links to the colophon (a Legal Notice link for example).', - table: { - category: 'Options', - }, - type: { - name: 'object', - required: false, - value: {}, - }, - }, - }, -} as ComponentMeta; + title: 'Molecules/Colophon', +} satisfies Meta; + +export default meta; -const Template: ComponentStory = (args) => ( - -); +type Story = StoryObj; -/** - * Colophon Stories - Default - */ -export const Default = Template.bind({}); -Default.args = { - copyright: , +export const Default: Story = { + args: { + copyright: , + }, }; -/** - * Colophon Stories - WithLicense - */ -export const WithLicense = Template.bind({}); -WithLicense.args = { - copyright: , - license: , +export const WithLicense: Story = { + args: { + copyright: , + license: , + }, }; -/** - * Colophon Stories - WithLinks - */ -export const WithLinks = Template.bind({}); -WithLinks.args = { - copyright: , - links: [ - { href: '#legal', id: 'item-1', label: 'Legal notice' }, - { href: '#credits', id: 'item-2', label: 'Credits' }, - ], +export const WithLinks: Story = { + args: { + copyright: , + links: [ + { href: '#legal', id: 'item-1', label: 'Legal notice' }, + { href: '#credits', id: 'item-2', label: 'Credits' }, + ], + }, }; -/** - * Colophon Stories - WithLicenseAndLinks - */ -export const WithLicenseAndLinks = Template.bind({}); -WithLicenseAndLinks.args = { - copyright: , - license: , - links: [ - { href: '#legal', id: 'item-1', label: 'Legal notice' }, - { href: '#credits', id: 'item-2', label: 'Credits' }, - ], +export const WithLicenseAndLinks: Story = { + args: { + copyright: , + license: , + links: [ + { href: '#legal', id: 'item-1', label: 'Legal notice' }, + { href: '#credits', id: 'item-2', label: 'Credits' }, + ], + }, }; -- cgit v1.2.3