{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "avatar",
  "title": "Avatar",
  "description": "User image with a fallback, a status badge, and grouped avatars with an overflow count.",
  "dependencies": [
    "radix-ui@^1.6.7"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/ui/avatar.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Avatar as AvatarPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Avatar({\n  className,\n  size = \"default\",\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root> & {\n  size?: \"default\" | \"sm\" | \"lg\"\n}) {\n  return (\n    <AvatarPrimitive.Root\n      data-slot=\"avatar\"\n      data-size={size}\n      className={cn(\n        \"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Motion: the primitive mounts this element only once the source has actually\n   decoded, so its arrival is a real event and a mount animation is the honest\n   way to mark it — a face appearing with a hard cut is the one moment an\n   avatar has anything to say.\n\n   Deliberately opacity only, and deliberately short. Two reasons:\n\n   - The fallback is not a sibling that fades out, it is *replaced* — the\n     primitive renders one or the other, never both — so anything longer than\n     a snap leaves the parent surface showing through the gap. `ease-out-expo`\n     is front-loaded enough to be past nine-tenths opaque within the first\n     third of the run, which puts the gap under the threshold of notice.\n   - No scale and therefore no blur (blur only ever travels with movement).\n     The ring on the root sits at the element's edge; an image growing into\n     place would open a hairline crescent inside it for the whole animation.\n\n   Avatars come in groups and in table rows. This has to survive twenty at\n   once on first paint, which rules out anything with mass. */\nfunction AvatarImage({\n  className,\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n  return (\n    <AvatarPrimitive.Image\n      data-slot=\"avatar-image\"\n      className={cn(\n        \"aspect-square size-full animate-in rounded-full object-cover ease-out-expo anim-base fade-in-0\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AvatarFallback({\n  className,\n  ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n  return (\n    <AvatarPrimitive.Fallback\n      data-slot=\"avatar-fallback\"\n      className={cn(\n        \"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AvatarBadge({ className, ...props }: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"avatar-badge\"\n      className={cn(\n        \"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none\",\n        \"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden\",\n        \"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2\",\n        \"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The row lift lives in `styles/motion.css` as `@utility avatar-lift`, not in\n   a class string here. The seven falloff rules have to be ordered relative to\n   each other and Tailwind picks its own emission order; expressed as arbitrary\n   variants they came out with the backward rules always winning, so a seat\n   between two engaged seats took the wrong distance. The utility also owns the\n   `z-index` and the reduced-motion gate, both of which exist only to serve the\n   translate and have to appear and disappear with it.\n\n   Known limitation: the lift moves the seat out from under the pointer, so a\n   pointer resting in the bottom few pixels of a seat can oscillate — hover\n   lost, seat returns, hover regained. `scale-105` widens the box by under a\n   pixel per side and does not cover it. Fixing it properly means driving the\n   effect from the group plus an index rather than from each seat's own\n   `:hover`, which is a different shape of solution than this one. */\n\nfunction AvatarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"avatar-group\"\n      className={cn(\n        \"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background\",\n        \"avatar-lift\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AvatarGroupCount({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"avatar-group-count\"\n      className={cn(\n        \"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Avatar,\n  AvatarImage,\n  AvatarFallback,\n  AvatarGroup,\n  AvatarGroupCount,\n  AvatarBadge,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}