-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathImage.features.stories.tsx
43 lines (37 loc) · 1.19 KB
/
Image.features.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react'
import {Meta, StoryFn} from '@storybook/react'
import placeholderImage from '../fixtures/images/placeholder-600x400.png'
import {Image, type ImageAspectRatio, ImageBorderRadiusOptions} from './Image'
import {Stack} from '../Stack'
export default {
title: 'Components/Image/Features',
component: Image,
} as Meta<typeof Image>
const demoAspectRatios: ImageAspectRatio[] = ['16:9', '16:10', '4:3', '1:1']
export const AspectRatio: StoryFn<typeof Image> = () => (
<Stack direction="horizontal" alignItems="flex-start">
{demoAspectRatios.map(aspectRatio => (
<Image
key={aspectRatio}
src={placeholderImage}
alt="placeholder, blank area with an off-white background color"
width={200}
aspectRatio={aspectRatio}
/>
))}
</Stack>
)
export const BorderRadius: StoryFn<typeof Image> = () => (
<Stack direction="horizontal">
{ImageBorderRadiusOptions.map(borderRadius => (
<Image
key={borderRadius}
src={placeholderImage}
width={200}
height={200}
alt="placeholder, blank area with an off-white background color"
borderRadius={borderRadius}
/>
))}
</Stack>
)