From dfd816d1891545aa8ead982b57891858f1c82bb4 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 6 Apr 2022 16:24:05 +0200
Subject: chore: add a ResponsiveImage component

---
 .../molecules/images/responsive-image.stories.tsx  | 87 ++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100644 src/components/molecules/images/responsive-image.stories.tsx

(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
new file mode 100644
index 0000000..f9c1d2b
--- /dev/null
+++ b/src/components/molecules/images/responsive-image.stories.tsx
@@ -0,0 +1,87 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import ResponsiveImageComponent from './responsive-image';
+
+export default {
+  title: 'Molecules/Images',
+  component: ResponsiveImageComponent,
+  argTypes: {
+    alt: {
+      control: {
+        type: 'text',
+      },
+      description: 'An alternative text.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    caption: {
+      control: {
+        type: 'text',
+      },
+      description: 'A figure caption.',
+      table: {
+        category: 'Options',
+      },
+      type: {
+        name: 'string',
+        required: false,
+      },
+    },
+    height: {
+      control: {
+        type: 'number',
+      },
+      description: 'The image height.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    src: {
+      control: {
+        type: 'text',
+      },
+      description: 'The image source.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+    target: {
+      control: {
+        type: 'text',
+      },
+      description: 'A link target.',
+      table: {
+        category: 'Options',
+      },
+      type: {
+        name: 'string',
+        required: false,
+      },
+    },
+    width: {
+      control: {
+        type: 'number',
+      },
+      description: 'The image width.',
+      type: {
+        name: 'string',
+        required: true,
+      },
+    },
+  },
+} as ComponentMeta<typeof ResponsiveImageComponent>;
+
+const Template: ComponentStory<typeof ResponsiveImageComponent> = (args) => (
+  <ResponsiveImageComponent {...args} />
+);
+
+export const ResponsiveImage = Template.bind({});
+ResponsiveImage.args = {
+  alt: 'An example',
+  src: 'http://placeimg.com/640/480/transport',
+  width: 640,
+  height: 480,
+};
-- 
cgit v1.2.3

