-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.stories.tsx
More file actions
96 lines (86 loc) · 2.36 KB
/
index.stories.tsx
File metadata and controls
96 lines (86 loc) · 2.36 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
import { ExclamationCircleIcon } from '@heroicons/react/24/solid';
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
import AlertBox from '#ui/Common/AlertBox';
type Story = StoryObj<typeof AlertBox>;
type Meta = MetaObj<typeof AlertBox>;
const withMain = (args: React.ComponentProps<typeof AlertBox>) => (
<main>
<AlertBox {...args} />
</main>
);
export const Info: Story = {
args: {
level: 'info',
title: '3',
children:
'Legacy. Although this feature is unlikely to be removed and is still covered by semantic versioning guarantees, it is no longer actively maintained, and other alternatives are available.',
size: 'default',
},
};
export const Success: Story = {
args: {
level: 'success',
title: '2',
children:
'Stable. Compatibility with the npm ecosystem is a high priority.',
size: 'default',
},
};
export const Warning: Story = {
args: {
level: 'warning',
title: '1',
children:
'Experimental. The feature is not subject to semantic versioning rules. Non-backward compatible changes or removal may occur in any future release. Use of the feature is not recommended in production environments. Experimental features are subdivided into stages:',
size: 'default',
},
};
export const Danger: Story = {
args: {
level: 'danger',
title: '0',
children:
'Deprecated. The feature may emit warnings. Backward compatibility is not guaranteed.',
size: 'default',
},
};
export const InMarkdown: Story = {
args: {
level: 'danger',
title: '0',
children: (
<>
In a markdown component, <code>Code renders correctly,</code>{' '}
<a href="#">
<code>even when in a link</code>
</a>
</>
),
size: 'default',
},
render: withMain,
};
export const WithIcon: Story = {
args: {
level: 'info',
title: '3',
children: (
<p>
Lorem ipsum dolor sit amet <ExclamationCircleIcon /> consectetur
adipisicing elit. Inventore, quasi doloremque. Totam, earum velit, sunt
voluptates fugiat beatae praesentium quis magni explicabo repudiandae
nam aut molestias ex ad sequi eum!
</p>
),
size: 'default',
},
};
export default {
component: AlertBox,
argTypes: {
size: {
options: ['default', 'small'],
control: { type: 'radio' },
},
},
} as Meta;