From a08291b1586858fc894a27d56f55f87a88f8dbd3 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 20 Apr 2022 19:24:21 +0200 Subject: refactor(storybook): reorganize design system Add more stories for each components and change some components categories for better organization. --- .../molecules/images/responsive-image.stories.tsx | 63 +++++++++++++++++++--- 1 file changed, 55 insertions(+), 8 deletions(-) (limited to 'src/components/molecules/images/responsive-image.stories.tsx') diff --git a/src/components/molecules/images/responsive-image.stories.tsx b/src/components/molecules/images/responsive-image.stories.tsx index f9c1d2b..a1f5295 100644 --- a/src/components/molecules/images/responsive-image.stories.tsx +++ b/src/components/molecules/images/responsive-image.stories.tsx @@ -1,9 +1,12 @@ import { ComponentMeta, ComponentStory } from '@storybook/react'; -import ResponsiveImageComponent from './responsive-image'; +import ResponsiveImage from './responsive-image'; +/** + * ResponsiveImage - Storybook Meta + */ export default { - title: 'Molecules/Images', - component: ResponsiveImageComponent, + title: 'Molecules/Images/ResponsiveImage', + component: ResponsiveImage, argTypes: { alt: { control: { @@ -72,16 +75,60 @@ export default { }, }, }, -} as ComponentMeta; +} as ComponentMeta; -const Template: ComponentStory = (args) => ( - +const Template: ComponentStory = (args) => ( + ); -export const ResponsiveImage = Template.bind({}); -ResponsiveImage.args = { +/** + * Responsive Image Stories - Default + */ +export const Default = Template.bind({}); +Default.args = { alt: 'An example', src: 'http://placeimg.com/640/480/transport', width: 640, height: 480, + unoptimized: true, +}; + +/** + * Responsive Image Stories - With link + */ +export const WithLink = Template.bind({}); +WithLink.args = { + alt: 'An example', + src: 'http://placeimg.com/640/480/transport', + width: 640, + height: 480, + unoptimized: true, + target: '#', +}; + +/** + * Responsive Image Stories - With caption + */ +export const WithCaption = Template.bind({}); +WithCaption.args = { + alt: 'An example', + src: 'http://placeimg.com/640/480/transport', + width: 640, + height: 480, + caption: 'Omnis nulla labore', + unoptimized: true, +}; + +/** + * Responsive Image Stories - With caption and link + */ +export const WithCaptionAndLink = Template.bind({}); +WithCaptionAndLink.args = { + alt: 'An example', + src: 'http://placeimg.com/640/480/transport', + width: 640, + height: 480, + caption: 'Omnis nulla labore', + target: '#', + unoptimized: true, }; -- cgit v1.2.3