import {
Avatar,
AvatarBadge,
AvatarFallback,
AvatarGroup,
AvatarGroupCount,
} from '@/components/avatar';
import type { AvatarProps } from '@/components/avatar';
import { PALETTES } from './axis-values';
import type { Entry } from './types';
/**
* Avatar's own axes — not shared with any other component (no `surface` or
* `ghost` treatment, and a six-rung ladder that starts two steps below every
* control), so like the Alert axes these have no home in `axis-values.ts`.
* Exported so `pages/avatars.tsx` and `pages/avatars-figma.tsx` read the same
* list instead of a second hand-copy.
*/
export const AVATAR_VARIANTS = ['solid', 'subtle', 'outline'] as const;
export const AVATAR_SIZES = ['2xs', 'xs', 'sm', 'md', 'lg', 'xl'] as const;
export const AVATAR_SHAPES = ['circle', 'square'] as const;
export const avatar: Entry = {
slug: 'avatar',
name: 'Avatar',
group: 'Data display',
description:
'A person or entity, as an image with a text fallback. Carries a third axis CBAR draws explicitly — `shape` — alongside treatment and palette.',
imports: { subpath: 'avatar', names: ['Avatar', 'AvatarFallback'] },
figma: {
set: 'avatar',
/* `shape=shape` is a typo on the canvas for the round one — corrected here
rather than in Figma, where renaming a variant breaks every instance. */
valueMap: {
shape: { circle: 'shape' },
colorPalette: { tertiary: 'third', black: 'neutral' },
},
pin: { 'avatar-type': 'initials' },
},
axes: {
variant: AVATAR_VARIANTS,
colorPalette: PALETTES,
size: AVATAR_SIZES,
shape: AVATAR_SHAPES,
},
defaults: { variant: 'subtle', colorPalette: 'primary', size: 'md', shape: 'circle' },
render: (props) => (