Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add new avatar component#15882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 6 commits intomainfrombq/refactor-avatar
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionssite/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,6 +50,7 @@
"@mui/system": "5.16.7",
"@mui/utils": "5.16.6",
"@mui/x-tree-view": "7.18.0",
"@radix-ui/react-avatar": "1.1.2",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-slider": "1.2.1",
Expand Down
82 changes: 81 additions & 1 deletionsite/pnpm-lock.yaml
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

62 changes: 38 additions & 24 deletionssite/src/components/Avatar/Avatar.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,73 @@
import PauseIcon from "@mui/icons-material/PauseOutlined";
import type { Meta, StoryObj } from "@storybook/react";
import { Avatar,AvatarIcon } from "./Avatar";
import { Avatar,AvatarFallback, AvatarImage } from "./Avatar";

const meta: Meta<typeof Avatar> = {
title: "components/Avatar",
component: Avatar,
args: {
children: <AvatarImage src="https://github.com/kylecarbs.png" />,
},
};

export default meta;
type Story = StoryObj<typeof Avatar>;

export const WithLetter: Story = {
args: {
children: "Coder",
},
export const ImageLgSize: Story = {
args: { size: "lg" },
};

export const WithLetterXL = {
export const ImageDefaultSize: Story = {};

export const ImageSmSize: Story = {
args: { size: "sm" },
};

export const IconLgSize: Story = {
args: {
children: "Coder",
size: "xl",
size: "lg",
variant: "icon",
children: (
<AvatarImage src="https://em-content.zobj.net/source/apple/391/billed-cap_1f9e2.png" />
),
},
};

export constWithImage = {
export constIconDefaultSize: Story = {
args: {
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
variant: "icon",
children: (
<AvatarImage src="https://em-content.zobj.net/source/apple/391/billed-cap_1f9e2.png" />
),
},
};

export constWithImageXL = {
export constIconSmSize: Story = {
args: {
src: "https://avatars.githubusercontent.com/u/95932066?s=200&v=4",
size: "xl",
variant: "icon",
size: "sm",
children: (
<AvatarImage src="https://em-content.zobj.net/source/apple/391/billed-cap_1f9e2.png" />
),
},
};

export constWithMuiIcon = {
export constFallbackLgSize: Story = {
args: {
background: true,
children: <PauseIcon />,
size: "lg",

children: <AvatarFallback>AR</AvatarFallback>,
},
};

export constWithMuiIconXL = {
export constFallbackDefaultSize: Story = {
args: {
background: true,
children: <PauseIcon />,
size: "xl",
children: <AvatarFallback>AR</AvatarFallback>,
},
};

export constWithAvatarIcon = {
export constFallbackSmSize: Story = {
args: {
background: true,
children: <AvatarIcon src="/icon/database.svg" alt="Database" />,
size: "sm",
children: <AvatarFallback>AR</AvatarFallback>,
},
};
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp