generated from morewings/react-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPicture.stories.tsx
74 lines (66 loc) · 1.49 KB
/
Picture.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
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
import type {Meta, StoryObj} from '@storybook/react';
// import {fn} from '@storybook/test';
import {Picture} from './Picture.tsx';
const meta = {
title: 'Components/Picture',
component: Picture,
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout
layout: 'centered',
},
args: {},
argTypes: {
id: {
table: {
disable: true,
},
},
role: {
table: {
disable: true,
},
},
className: {
table: {
disable: true,
},
},
},
} as Meta<typeof Picture>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
render: function Render(args) {
return <Picture {...args} />;
},
args: {
src: 'https://picsum.photos/300/333',
width: 300,
height: 333,
alt: 'Image description',
sources: [
{
src: 'https://picsum.photos/600/666',
mediaCondition: '(orientation: portrait)',
},
],
},
};
export const WithCode: Story = {
render: args => {
// here comes the code
return <Picture {...args} />;
},
};
WithCode.args = {
id: 'foo',
};
WithCode.argTypes = {};
WithCode.parameters = {
docs: {
source: {
language: 'tsx',
type: 'code',
},
},
};