mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-03 01:18:38 +00:00
* feat: add phosphor icons to base ui * feat_ add phosphor to blocks * feat: add phosphor to radix blocks * feat: add phosphor to radix ui * feat: add phosphor to radix example * feat: add missing phosphor icons * fix: rename broken icons * chore: format files * fix: add missing phosphor icons * chore: build registry --------- Co-authored-by: shadcn <m@shadcn.com>
501 lines
14 KiB
TypeScript
501 lines
14 KiB
TypeScript
import {
|
|
Example,
|
|
ExampleWrapper,
|
|
} from "@/registry/bases/base/components/example"
|
|
import {
|
|
Avatar,
|
|
AvatarBadge,
|
|
AvatarFallback,
|
|
AvatarGroup,
|
|
AvatarGroupCount,
|
|
AvatarImage,
|
|
} from "@/registry/bases/base/ui/avatar"
|
|
import { Button } from "@/registry/bases/base/ui/button"
|
|
import {
|
|
Empty,
|
|
EmptyContent,
|
|
EmptyDescription,
|
|
EmptyHeader,
|
|
EmptyMedia,
|
|
EmptyTitle,
|
|
} from "@/registry/bases/base/ui/empty"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
export default function AvatarExample() {
|
|
return (
|
|
<ExampleWrapper>
|
|
<AvatarSizes />
|
|
<AvatarWithBadge />
|
|
<AvatarWithBadgeIcon />
|
|
<AvatarGroupExample />
|
|
<AvatarGroupWithCount />
|
|
<AvatarGroupWithIconCount />
|
|
<AvatarInEmpty />
|
|
</ExampleWrapper>
|
|
)
|
|
}
|
|
|
|
function AvatarSizes() {
|
|
return (
|
|
<Example title="Sizes">
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
</div>
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
</div>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarWithBadge() {
|
|
return (
|
|
<Example title="Badge">
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/jorgezreik.png"
|
|
alt="@jorgezreik"
|
|
/>
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/jorgezreik.png"
|
|
alt="@jorgezreik"
|
|
/>
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/jorgezreik.png"
|
|
alt="@jorgezreik"
|
|
/>
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
</div>
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarFallback>JZ</AvatarFallback>
|
|
<AvatarBadge />
|
|
</Avatar>
|
|
</div>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarWithBadgeIcon() {
|
|
return (
|
|
<Example title="Badge with Icon">
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/pranathip.png"
|
|
alt="@pranathip"
|
|
/>
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/pranathip.png"
|
|
alt="@pranathip"
|
|
/>
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/pranathip.png"
|
|
alt="@pranathip"
|
|
/>
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
</div>
|
|
<div className="flex flex-wrap items-center gap-2">
|
|
<Avatar size="sm">
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="CheckIcon"
|
|
tabler="IconCheck"
|
|
hugeicons="Tick02Icon"
|
|
phosphor="CheckIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="CheckIcon"
|
|
tabler="IconCheck"
|
|
hugeicons="Tick02Icon"
|
|
phosphor="CheckIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarFallback>PP</AvatarFallback>
|
|
<AvatarBadge>
|
|
<IconPlaceholder
|
|
lucide="CheckIcon"
|
|
tabler="IconCheck"
|
|
hugeicons="Tick02Icon"
|
|
phosphor="CheckIcon"
|
|
/>
|
|
</AvatarBadge>
|
|
</Avatar>
|
|
</div>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarGroupExample() {
|
|
return (
|
|
<Example title="Group">
|
|
<AvatarGroup>
|
|
<Avatar size="sm">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar>
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar size="lg">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
</AvatarGroup>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarGroupWithCount() {
|
|
return (
|
|
<Example title="Group with Count">
|
|
<AvatarGroup>
|
|
<Avatar size="sm">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar>
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar size="lg">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarGroupWithIconCount() {
|
|
return (
|
|
<Example title="Group with Icon Count">
|
|
<AvatarGroup>
|
|
<Avatar size="sm">
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="sm">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar>
|
|
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar>
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
<AvatarGroup>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/shadcn.png"
|
|
alt="@shadcn"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
</Example>
|
|
)
|
|
}
|
|
|
|
function AvatarInEmpty() {
|
|
return (
|
|
<Example title="In Empty">
|
|
<Empty className="w-full flex-none border">
|
|
<EmptyHeader>
|
|
<EmptyMedia>
|
|
<AvatarGroup>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/shadcn.png"
|
|
alt="@shadcn"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>CN</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/maxleiter.png"
|
|
alt="@maxleiter"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>LR</AvatarFallback>
|
|
</Avatar>
|
|
<Avatar size="lg">
|
|
<AvatarImage
|
|
src="https://github.com/evilrabbit.png"
|
|
alt="@evilrabbit"
|
|
className="grayscale"
|
|
/>
|
|
<AvatarFallback>ER</AvatarFallback>
|
|
</Avatar>
|
|
<AvatarGroupCount>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
</AvatarGroupCount>
|
|
</AvatarGroup>
|
|
</EmptyMedia>
|
|
<EmptyTitle>No Team Members</EmptyTitle>
|
|
<EmptyDescription>
|
|
Invite your team to collaborate on this project.
|
|
</EmptyDescription>
|
|
</EmptyHeader>
|
|
<EmptyContent>
|
|
<Button>
|
|
<IconPlaceholder
|
|
lucide="PlusIcon"
|
|
tabler="IconPlus"
|
|
hugeicons="PlusSignIcon"
|
|
phosphor="PlusIcon"
|
|
/>
|
|
Invite Members
|
|
</Button>
|
|
</EmptyContent>
|
|
</Empty>
|
|
</Example>
|
|
)
|
|
}
|