{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "avatar",
  "type": "registry:ui",
  "title": "Avatar",
  "description": "A compact, accessible identity marker for a person or team.",
  "dependencies": [
    "@base-ui/react@1.8.0",
    "lucide-react@0.561.0"
  ],
  "registryDependencies": [
    "https://ghost-ui.com/r/base-styled.json",
    "https://ghost-ui.com/r/utils.json",
    "https://ghost-ui.com/r/foundation.json",
    "https://ghost-ui.com/r/ghost-tokens.json"
  ],
  "files": [
    {
      "path": "src/components/ui/avatar.tsx",
      "type": "registry:component",
      "target": "@ui/avatar.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { createLucideIcon, UserRound } from \"lucide-react\";\nimport { cn } from '@/lib/utils'\nimport type { MemberTone } from './member-types'\nimport { styled } from './base-styled';\nimport { Astroid } from './internal/astroid';\nimport { diceAvatarUrl } from './avatar-starters';\n\n/** @license\n * Lucide QuestionMark, https://lucide.dev/icons/question-mark (ISC).\n * Copyright (c) 2026 Lucide Icons and Contributors.\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n// Backport the official glyph for the installed Lucide renderer.\nconst QuestionMark = createLucideIcon(\"QuestionMark\", [\n  [\"path\", { d: \"M12 15c0-2.48 5-2.99 5-6.5a5 4.5 0 00-10 0\", key: \"question\" }],\n  [\"path\", { d: \"M12 20h.01\", key: \"dot\" }],\n]);\n\nexport type AvatarStatusTone = \"success\" | \"warning\" | \"danger\" | \"neutral\" | \"primary\" | \"ai\" | \"unknown\";\nexport type AvatarStatusPosition = \"bottom-right\" | \"bottom-left\" | \"top-right\" | \"top-left\";\nexport interface AvatarStatusProps extends React.HTMLAttributes<HTMLSpanElement> {\n  tone?: AvatarStatusTone;\n  color?: string;\n  position?: AvatarStatusPosition;\n  label?: string;\n  indicator?: \"dot\" | \"icon\";\n  /** Adds a quiet attention ring; useful for live, warning, and failed states. */\n  pulse?: boolean;\n}\nexport interface AvatarProps extends React.AriaAttributes { name: string; initials?: string; tone?: MemberTone; className?: string; src?: string; seed?: string; kind?: 'human' | 'agent' | 'unknown'; /** Compact identities: xs is 16px, sm is 24px. */ size?: 'xs' | 'sm'; /** Replaces the automatic AI or unknown badge with caller-owned status. Pass null to omit it. */ status?: AvatarStatusProps | null }\n\nconst AvatarWrap = React.forwardRef<HTMLSpanElement, React.HTMLAttributes<HTMLSpanElement>>(\n  function AvatarWrap({ className, ...rest }, ref) {\n    return <span ref={ref} className={cn(\"ui-avatar-wrap\", className)} {...rest} />;\n  },\n);\n\nfunction AvatarStatus({ tone = \"success\", color, position = \"bottom-right\", label, indicator = \"dot\", pulse = false, className, style, children = tone === \"ai\" && indicator === \"icon\" ? <Astroid fill=\"currentColor\" aria-hidden=\"true\" /> : tone === \"unknown\" && indicator === \"icon\" ? <QuestionMark aria-hidden=\"true\" /> : undefined, ...rest }: AvatarStatusProps) {\n  const classes = cn(\"ui-avatar-status\", `ui-avatar-status--${position}`, `ui-avatar-status--${tone}`, `ui-avatar-status--indicator-${indicator}`, color && \"ui-avatar-status--custom\", className);\n  const mergedStyle = color ? ({ ...style, \"--ui-status-color\": color } as React.CSSProperties) : style;\n  const pulseAttr = pulse ? \"true\" : undefined;\n  return label ? <span data-indicator={indicator} data-pulse={pulseAttr} className={classes} style={mergedStyle} {...rest}>{children}<span className=\"ui-sr-only\">{label}</span></span> : <span data-indicator={indicator} data-pulse={pulseAttr} aria-hidden=\"true\" className={classes} style={mergedStyle} {...rest}>{children}</span>;\n}\n\nfunction AvatarIdentity({ name, initials, tone = 'neutral', className, src, seed, kind, size, status, 'aria-hidden': ariaHidden, ...ariaProps }: AvatarProps) {\n  const hidden = ariaHidden === true || ariaHidden === \"true\";\n  const unknown = kind === 'unknown';\n  const fallback = name.split(/\\s+/).map((part) => part[0]).join('').slice(0, 2).toUpperCase()\n  const imageSrc = unknown ? undefined : src ?? (seed !== undefined || kind !== undefined ? diceAvatarUrl(kind === 'agent' ? 'gaze' : 'dylan', seed ?? name) : undefined)\n  const sizeClass = size === 'xs' ? 'ui-avatar--xs' : size === 'sm' ? 'ui-avatar--sm' : undefined\n  const identity = imageSrc\n    ? <Avatar.Root className={cn(`ui-avatar--${tone}`, sizeClass, className)} role={hidden ? undefined : 'img'} aria-label={hidden ? undefined : name} aria-hidden={ariaHidden} {...ariaProps}><Avatar.Image src={imageSrc} alt=\"\" /><Avatar.Fallback>{initials ?? fallback}</Avatar.Fallback></Avatar.Root>\n    : unknown\n      ? <Avatar.Root className={cn(`ui-avatar--${tone}`, sizeClass, className)} role={hidden ? undefined : 'img'} aria-label={hidden ? undefined : name} aria-hidden={ariaHidden} {...ariaProps}><Avatar.Fallback /></Avatar.Root>\n      : <span className={cn('ui-avatar', `ui-avatar--${tone}`, sizeClass, className)} role={hidden ? undefined : 'img'} aria-label={hidden ? undefined : name} aria-hidden={ariaHidden} {...ariaProps}>{initials ?? fallback}</span>\n  const statusNode = status === undefined\n    ? kind === 'agent' && imageSrc ? <Avatar.Status tone=\"ai\" indicator=\"icon\" label={hidden ? undefined : \"AI agent\"} /> : unknown ? <Avatar.Status tone=\"unknown\" indicator=\"icon\" /> : null\n    : status === null ? null : <Avatar.Status {...status} />\n  return statusNode ? <Avatar.Wrap>{identity}{statusNode}</Avatar.Wrap> : identity\n}\n\nconst AvatarFallback = styled(BaseAvatar.Fallback, \"ui-avatar-fallback\");\n\nfunction Fallback({ children = <UserRound className=\"ui-avatar-fallback-icon\" aria-hidden=\"true\" />, ...props }: React.ComponentProps<typeof AvatarFallback>) {\n  return <AvatarFallback {...props}>{children}</AvatarFallback>;\n}\n\n// One public owner supports Ghost's identity API and the compound Base UI API.\nexport const Avatar = Object.assign(AvatarIdentity, {\n  ...BaseAvatar,\n  Root: styled(BaseAvatar.Root, \"ui-avatar\"),\n  Image: styled(BaseAvatar.Image, \"ui-avatar-image\"),\n  Fallback,\n  Wrap: AvatarWrap,\n  Status: AvatarStatus,\n});\n"
    },
    {
      "path": "src/components/ui/member-types.ts",
      "type": "registry:component",
      "target": "@ui/member-types.ts",
      "content": "export type MemberTone = 'neutral' | 'blue' | 'green' | 'orange' | 'coral' | 'indigo' | 'slate'\n"
    },
    {
      "path": "src/components/ui/internal/astroid.tsx",
      "type": "registry:component",
      "target": "@ui/internal/astroid.tsx",
      "content": "/** @license\n * Official Lucide Astroid (1.12.0), https://lucide.dev/icons/astroid\n * Backport for the installed lucide-react 0.561 renderer.\n * ISC License\n * \n * Copyright (c) 2026 Lucide Icons and Contributors\n * \n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n * \n * ---\n * \n * The following Lucide icons are derived from the Feather project:\n * \n * airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out\n * \n * The MIT License (MIT) (for the icons listed above)\n * \n * Copyright (c) 2013-present Cole Bemis\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n */\nimport { createLucideIcon } from \"lucide-react\";\n\nexport const Astroid = /* @__PURE__ */ createLucideIcon(\"Astroid\", [[\"path\", { d: \"M12.983 21.186a1 1 0 0 1-1.966 0 10 10 0 0 0-8.203-8.203 1 1 0 0 1 0-1.966 10 10 0 0 0 8.203-8.203 1 1 0 0 1 1.966 0 10 10 0 0 0 8.203 8.203 1 1 0 0 1 0 1.966 10 10 0 0 0-8.203 8.203\", key: \"astroid\" }]]);\n"
    },
    {
      "path": "src/components/ui/avatar-starters.ts",
      "type": "registry:component",
      "target": "@ui/avatar-starters.ts",
      "content": "// Zero-bundle DiceBear starters: demos use the HTTP API (no npm dep,\n// only the requested SVG loads). Self-hosted/offline alternative is\n// per-style JSON imports (`import dylan from '@dicebear/styles/dylan.json'`)\n// — never `import *`, never bulk `@dicebear/collection`-style imports.\n// Style licenses vary (CC0/CC-BY, etc.): see dicebear.com/licenses.\nexport const DICE_API_VERSION = '10.x';\n\nexport const DICE_SHOWCASE = ['dylan', 'gaze', 'glass', 'clay', 'critters', 'line-face', 'sprouts', 'thumbs', 'open-peeps'] as const;\nexport type DiceShowcaseStyle = (typeof DICE_SHOWCASE)[number];\n\n// Full DiceBear 10.x catalog holds 61 styles; swap the style slug for the rest.\nexport const DICE_STYLE_COUNT = 61;\n\nexport type DiceStyle = DiceShowcaseStyle | (string & {});\n\nexport interface DiceOptions {\n  seed?: string;\n  backgroundColor?: string | string[];\n  skinColor?: string;\n  size?: number;\n}\n\nfunction normalizeColor(value: string): string {\n  return value.replace(/^#+/, '');\n}\n\nexport function diceAvatarUrl(\n  style: DiceStyle,\n  seedOrOptions?: string | DiceOptions,\n  maybeOptions?: DiceOptions,\n): string {\n  const base: DiceOptions =\n    typeof seedOrOptions === 'string' ? { ...maybeOptions, seed: seedOrOptions } : { ...seedOrOptions };\n  const seed = base.seed ?? 'ghost';\n  const params = new URLSearchParams();\n  params.set('seed', seed);\n  if (base.backgroundColor !== undefined) {\n    const colors = Array.isArray(base.backgroundColor) ? base.backgroundColor : [base.backgroundColor];\n    const csv = colors.map(normalizeColor).filter(Boolean).join(',');\n    if (csv) params.set('backgroundColor', csv);\n  }\n  if (base.size !== undefined) params.set('size', String(base.size));\n  if (base.skinColor) params.set('skinColor', normalizeColor(base.skinColor));\n  return `https://api.dicebear.com/${DICE_API_VERSION}/${style}/svg?${params.toString()}`;\n}\n\nexport function diceAvatarUrls(\n  seeds: string[],\n  style: DiceStyle,\n  baseOptions?: Omit<DiceOptions, 'seed'>,\n): string[] {\n  return seeds.map((seed) => diceAvatarUrl(style, { ...baseOptions, seed }));\n}\n"
    }
  ]
}
