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 --- .../meta-list/meta-item/meta-item.stories.tsx | 149 +++++++++------------ 1 file changed, 60 insertions(+), 89 deletions(-) (limited to 'src/components/molecules/meta-list/meta-item') diff --git a/src/components/molecules/meta-list/meta-item/meta-item.stories.tsx b/src/components/molecules/meta-list/meta-item/meta-item.stories.tsx index 3ddb8f1..9b1596a 100644 --- a/src/components/molecules/meta-list/meta-item/meta-item.stories.tsx +++ b/src/components/molecules/meta-list/meta-item/meta-item.stories.tsx @@ -1,108 +1,79 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; +import type { Meta, StoryObj } from '@storybook/react'; import { Link } from '../../../atoms'; import { MetaItem } from './meta-item'; -/** - * MetaItem - Storybook Meta - */ -export default { - title: 'Molecules/MetaList/Item', +const meta = { component: MetaItem, - argTypes: { - label: { - control: { - type: 'text', - }, - description: 'The item label.', - type: { - name: 'string', - required: true, - }, - }, - }, -} as ComponentMeta; + title: 'Molecules/MetaList/Item', +} satisfies Meta; -const Template: ComponentStory = (args) => ( - -); +export default meta; -/** - * MetaItem Stories - SingleValue - */ -export const SingleValue = Template.bind({}); -SingleValue.args = { - label: 'Comments', - value: 'No comments', +type Story = StoryObj; + +export const SingleValue: Story = { + args: { + label: 'Comments', + value: 'No comments', + }, }; -/** - * MetaItem Stories - MultipleValues - */ -export const MultipleValues = Template.bind({}); -MultipleValues.args = { - label: 'Tags', - value: [ - { id: 'tag1', value: Tag 1 }, - { id: 'tag2', value: Tag 2 }, - ], +export const MultipleValues: Story = { + args: { + label: 'Tags', + value: [ + { id: 'tag1', value: Tag 1 }, + { id: 'tag2', value: Tag 2 }, + ], + }, }; -/** - * MetaItem Stories - SingleValueBordered - */ -export const SingleValueBordered = Template.bind({}); -SingleValueBordered.args = { - hasBorderedValues: true, - label: 'Comments', - value: 'No comments', +export const SingleValueBordered: Story = { + args: { + hasBorderedValues: true, + label: 'Comments', + value: 'No comments', + }, }; -/** - * MetaItem Stories - MultipleValuesBordered - */ -export const MultipleValuesBordered = Template.bind({}); -MultipleValuesBordered.args = { - hasBorderedValues: true, - label: 'Tags', - value: [ - { id: 'tag1', value: Tag 1 }, - { id: 'tag2', value: Tag 2 }, - ], +export const MultipleValuesBordered: Story = { + args: { + hasBorderedValues: true, + label: 'Tags', + value: [ + { id: 'tag1', value: Tag 1 }, + { id: 'tag2', value: Tag 2 }, + ], + }, }; -/** - * MetaItem Stories - SingleValueInlined - */ -export const SingleValueInlined = Template.bind({}); -SingleValueInlined.args = { - isInline: true, - label: 'Comments', - value: 'No comments', +export const SingleValueInlined: Story = { + args: { + isInline: true, + label: 'Comments', + value: 'No comments', + }, }; -/** - * MetaItem Stories - MultipleValuesInlined - */ -export const MultipleValuesInlined = Template.bind({}); -MultipleValuesInlined.args = { - isInline: true, - label: 'Tags', - value: [ - { id: 'tag1', value: Tag 1 }, - { id: 'tag2', value: Tag 2 }, - ], +export const MultipleValuesInlined: Story = { + args: { + isInline: true, + label: 'Tags', + value: [ + { id: 'tag1', value: Tag 1 }, + { id: 'tag2', value: Tag 2 }, + ], + }, }; -/** - * MetaItem Stories - InlinedValues - */ -export const InlinedValues = Template.bind({}); -InlinedValues.args = { - hasInlinedValues: true, - label: 'Tags', - value: [ - { id: 'tag1', value: Tag 1 }, - { id: 'tag2', value: A long tag 2 }, - { id: 'tag3', value: Tag 3 }, - ], +export const InlinedValues: Story = { + args: { + hasInlinedValues: true, + label: 'Tags', + value: [ + { id: 'tag1', value: Tag 1 }, + { id: 'tag2', value: A long tag 2 }, + { id: 'tag3', value: Tag 3 }, + ], + }, }; -- cgit v1.2.3