-
Notifications
You must be signed in to change notification settings - Fork 9
/
Avatar.stories.tsx
49 lines (45 loc) · 1.21 KB
/
Avatar.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
import { type StoryObj, type Meta } from "@storybook/react";
import Avatar from "./Avatar";
import image from "../../../../apps/storybook/assets/images/jane.webp";
export default {
title: "Components/Avatar",
component: Avatar,
parameters: {
design: {
type: "figma",
url: "https://www.figma.com/file/p7LKna9JMU0JEkcKamzs53/%F0%9F%93%90-Syntax?node-id=1206-4420&t=yFh7Ijhf6PU7Lin3-0",
},
},
argTypes: {
size: {
options: ["xs", "sm", "md", "lg", "xl"],
control: { type: "radio" },
},
},
tags: ["autodocs"],
} as Meta<typeof Avatar>;
const DotIcon = () => (
<div
style={{
height: "100%",
width: "100%",
backgroundColor: "green",
borderRadius: "50%",
}}
/>
);
export const Default: StoryObj<typeof Avatar> = {
args: { accessibilityLabel: "Jane", src: image },
};
export const Small: StoryObj<typeof Avatar> = {
args: { ...Default.args, size: "sm" },
};
export const Large: StoryObj<typeof Avatar> = {
args: { ...Default.args, size: "lg" },
};
export const ExtraLarge: StoryObj<typeof Avatar> = {
args: { ...Default.args, size: "xl" },
};
export const IconAvatar: StoryObj<typeof Avatar> = {
args: { ...Default.args, icon: <DotIcon /> },
};