From d5ade2359539648845a5854ed353b29367961d74 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 20 Nov 2023 11:02:20 +0100 Subject: refactor(components): extract MetaItem from MetaList * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers. --- src/components/molecules/card/card.stories.tsx | 261 +++++++++++-------------- 1 file changed, 111 insertions(+), 150 deletions(-) (limited to 'src/components/molecules/card/card.stories.tsx') diff --git a/src/components/molecules/card/card.stories.tsx b/src/components/molecules/card/card.stories.tsx index bc9cbd4..7cc2ad4 100644 --- a/src/components/molecules/card/card.stories.tsx +++ b/src/components/molecules/card/card.stories.tsx @@ -1,6 +1,7 @@ import type { ComponentMeta, Story } from '@storybook/react'; import NextImage from 'next/image'; import { Button, ButtonLink, Link, Time } from '../../atoms'; +import { MetaItem } from '../meta-list'; import { Card, type CardProps } from './card'; import { CardActions } from './card-actions'; import { CardBody } from './card-body'; @@ -71,17 +72,13 @@ export const HeaderMeta = Template.bind({}); HeaderMeta.args = { children: ( - , - }, - ]} - /> + + + } + /> + ), }; @@ -107,27 +104,23 @@ export const FooterMeta = Template.bind({}); FooterMeta.args = { children: , meta: ( - Category 1 }, - { id: 'cat-2', value: Category 2 }, - ], - }, - { - id: 'tags', - label: 'Tags:', - value: [ - { id: 'tag-1', value: 'Tag 1' }, - { id: 'tag-2', value: 'Tag 2' }, - { id: 'tag-3', value: 'Tag 3' }, - ], - }, - ]} - /> + + Category 1 }, + { id: 'cat-2', value: Category 2 }, + ]} + /> + + ), }; @@ -155,17 +148,13 @@ CompositionTitleMeta.args = { children: ( The card title - , - }, - ]} - /> + + + } + /> + ), }; @@ -175,17 +164,13 @@ CompositionCoverTitleMeta.args = { children: ( The card title - , - }, - ]} - /> + + + } + /> + ), cover: ( @@ -250,17 +235,13 @@ CompositionTitleMetaBody.args = { <> The card title - , - }, - ]} - /> + + + } + /> + Nihil magnam tempora voluptatem. Reiciendis ut cum vel. Odit et @@ -278,17 +259,13 @@ CompositionCoverTitleMetaBody.args = { <> The card title - , - }, - ]} - /> + + + } + /> + Nihil magnam tempora voluptatem. Reiciendis ut cum vel. Odit et @@ -399,27 +376,23 @@ CompositionTitleBodyActionsMeta.args = { ), meta: ( - Category 1 }, - { id: 'cat-2', value: Category 2 }, - ], - }, - { - id: 'tags', - label: 'Tags:', - value: [ - { id: 'tag-1', value: 'Tag 1' }, - { id: 'tag-2', value: 'Tag 2' }, - { id: 'tag-3', value: 'Tag 3' }, - ], - }, - ]} - /> + + Category 1 }, + { id: 'cat-2', value: Category 2 }, + ]} + /> + + ), }; @@ -455,27 +428,23 @@ CompositionCoverTitleBodyActionsMeta.args = { ), meta: ( - Category 1 }, - { id: 'cat-2', value: Category 2 }, - ], - }, - { - id: 'tags', - label: 'Tags:', - value: [ - { id: 'tag-1', value: 'Tag 1' }, - { id: 'tag-2', value: 'Tag 2' }, - { id: 'tag-3', value: 'Tag 3' }, - ], - }, - ]} - /> + + Category 1 }, + { id: 'cat-2', value: Category 2 }, + ]} + /> + + ), }; @@ -485,17 +454,13 @@ CompositionAllContents.args = { <> The card title - , - }, - ]} - /> + + + } + /> + Nihil magnam tempora voluptatem. Reiciendis ut cum vel. Odit et @@ -522,26 +487,22 @@ CompositionAllContents.args = { ), meta: ( - Category 1 }, - { id: 'cat-2', value: Category 2 }, - ], - }, - { - id: 'tags', - label: 'Tags:', - value: [ - { id: 'tag-1', value: 'Tag 1' }, - { id: 'tag-2', value: 'Tag 2' }, - { id: 'tag-3', value: 'Tag 3' }, - ], - }, - ]} - /> + + Category 1 }, + { id: 'cat-2', value: Category 2 }, + ]} + /> + + ), }; -- cgit v1.2.3