aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/layout/card.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-10 19:37:51 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commitc87c615b5866b8a8f361eeb0764bfdea85740e90 (patch)
treec27bda05fd96bbe3154472e170ba1abd5f9ea499 /src/components/molecules/layout/card.stories.tsx
parent15522ec9146f6f1956620355c44dea2a6a75b67c (diff)
refactor(components): replace Meta component with MetaList
It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
Diffstat (limited to 'src/components/molecules/layout/card.stories.tsx')
-rw-r--r--src/components/molecules/layout/card.stories.tsx31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/components/molecules/layout/card.stories.tsx b/src/components/molecules/layout/card.stories.tsx
index a9545d1..070c978 100644
--- a/src/components/molecules/layout/card.stories.tsx
+++ b/src/components/molecules/layout/card.stories.tsx
@@ -1,6 +1,6 @@
-import { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import type { MetaItemData } from '../meta-list';
import { Card } from './card';
-import { cover, id, meta, tagline, title, url } from './card.fixture';
/**
* Card - Storybook Meta
@@ -119,6 +119,33 @@ export default {
const Template: ComponentStory<typeof Card> = (args) => <Card {...args} />;
+const cover = {
+ alt: 'A picture',
+ height: 480,
+ src: 'https://picsum.photos/640/480',
+ width: 640,
+};
+
+const id = 'nam';
+
+const meta = [
+ { id: 'author', label: 'Author', value: 'Possimus' },
+ {
+ id: 'categories',
+ label: 'Categories',
+ value: [
+ { id: 'autem', value: 'Autem' },
+ { id: 'eos', value: 'Eos' },
+ ],
+ },
+] satisfies MetaItemData[];
+
+const tagline = 'Ut rerum incidunt';
+
+const title = 'Alias qui porro';
+
+const url = '/an-existing-url';
+
/**
* Card Stories - Default
*/