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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import NextImage from 'next/image';
import { Figure } from '../../atoms';
import { Gallery } from './gallery';
/**
* Gallery - Storybook Meta
*/
export default {
title: 'Organisms/Images/Gallery',
component: Gallery,
argTypes: {
children: {
control: {
type: null,
},
description: 'Two or more images.',
type: {
name: 'function',
required: true,
},
},
columns: {
control: {
type: 'number',
min: 2,
max: 4,
},
description: 'The columns count.',
type: {
name: 'number',
required: true,
},
},
},
} as ComponentMeta<typeof Gallery>;
const image = {
alt: 'Modi provident omnis',
height: 480,
src: 'https://picsum.photos/640/480',
width: 640,
};
const Template: ComponentStory<typeof Gallery> = (args) => (
<Gallery {...args}>
<Figure>
<NextImage {...image} />
</Figure>
<Figure>
<NextImage {...image} />
</Figure>
<Figure>
<NextImage {...image} />
</Figure>
<Figure>
<NextImage {...image} />
</Figure>
</Gallery>
);
/**
* Gallery Stories - Two columns
*/
export const TwoColumns = Template.bind({});
TwoColumns.args = {
columns: 2,
};
/**
* Gallery Stories - Three columns
*/
export const ThreeColumns = Template.bind({});
ThreeColumns.args = {
columns: 3,
};
/**
* Gallery Stories - Four columns
*/
export const FourColumns = Template.bind({});
FourColumns.args = {
columns: 4,
};
|