|
1
|
import type { Meta, StoryObj } from "@storybook/react" |
|
2
|
|
|
3
|
import { Avatar } from "./avatar" |
|
4
|
|
|
5
|
const meta: Meta<typeof Avatar> = { |
|
6
|
title: "Components/Avatar", |
|
7
|
component: Avatar, |
|
8
|
argTypes: { |
|
9
|
src: { |
|
10
|
control: { |
|
11
|
type: "text", |
|
12
|
}, |
|
13
|
}, |
|
14
|
fallback: { |
|
15
|
control: { |
|
16
|
type: "text", |
|
17
|
}, |
|
18
|
}, |
|
19
|
variant: { |
|
20
|
control: { |
|
21
|
type: "select", |
|
22
|
options: ["rounded", "squared"], |
|
23
|
}, |
|
24
|
}, |
|
25
|
size: { |
|
26
|
control: { |
|
27
|
type: "select", |
|
28
|
options: ["default", "large"], |
|
29
|
}, |
|
30
|
}, |
|
31
|
}, |
|
32
|
parameters: { |
|
33
|
layout: "centered", |
|
34
|
}, |
|
35
|
} |
|
36
|
|
|
37
|
export default meta |
|
38
|
|
|
39
|
type Story = StoryObj<typeof Avatar> |
|
40
|
|
|
41
|
export const WithImage: Story = { |
|
42
|
args: { |
|
43
|
src: "https://avatars.githubusercontent.com/u/10656202?v=4", |
|
44
|
fallback: "J", |
|
45
|
size: "base", |
|
46
|
}, |
|
47
|
} |
|
48
|
|
|
49
|
export const WithFallback: Story = { |
|
50
|
args: { |
|
51
|
fallback: "J", |
|
52
|
size: "large", |
|
53
|
}, |
|
54
|
} |
|
55
|
|
|
56
|
export const TwoXSmall: Story = { |
|
57
|
args: { |
|
58
|
fallback: "J", |
|
59
|
size: "2xsmall", |
|
60
|
}, |
|
61
|
} |
|
62
|
|
|
63
|
export const XSmall: Story = { |
|
64
|
args: { |
|
65
|
fallback: "J", |
|
66
|
size: "xsmall", |
|
67
|
}, |
|
68
|
} |
|
69
|
|
|
70
|
export const Small: Story = { |
|
71
|
args: { |
|
72
|
fallback: "J", |
|
73
|
size: "small", |
|
74
|
}, |
|
75
|
} |
|
76
|
|
|
77
|
export const Base: Story = { |
|
78
|
args: { |
|
79
|
fallback: "J", |
|
80
|
size: "base", |
|
81
|
}, |
|
82
|
} |
|
83
|
|
|
84
|
export const Large: Story = { |
|
85
|
args: { |
|
86
|
fallback: "J", |
|
87
|
size: "large", |
|
88
|
}, |
|
89
|
} |
|
90
|
|
|
91
|
export const XLarge: Story = { |
|
92
|
args: { |
|
93
|
fallback: "J", |
|
94
|
size: "xlarge", |
|
95
|
}, |
|
96
|
} |