{
  "name": "avatar-group",
  "type": "registry:ui",
  "framework": "react",
  "title": "Avatar Group",
  "description": "A row of overlapping avatars with a count for the members not shown.",
  "registryDependencies": [
    "@newtui/avatar"
  ],
  "files": [
    {
      "path": "ui/avatar-group.tsx",
      "content": "\"use client\"\n\nimport type { VariantProps } from \"class-variance-authority\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { avatarVariants } from \"@/registry/bases/newt/ui/avatar\"\n\nexport interface AvatarGroupProps\n  extends React.ComponentProps<\"div\">, VariantProps<typeof avatarVariants> {\n  /**\n   * How many members are not shown. A count above zero adds a final \"+N\"\n   * chip; the total usually comes from the server, not from the children.\n   */\n  overflow?: number\n  /** What a screen reader says for the chip. */\n  overflowLabel?: (count: number) => string\n}\n\nconst defaultOverflowLabel = (count: number) => `${count} more`\n\n/*\n * A few avatars, overlapped, and a count for the rest. Each one is ringed in\n * the colour of the surface behind it so the overlap reads as a cut-out; set\n * `--newt-avatar-group-ring` when the group sits on something other than the\n * default surface. `size` is the chip's size: give the avatars the same one.\n */\nconst AvatarGroup = React.forwardRef<HTMLDivElement, AvatarGroupProps>(\n  (\n    {\n      className,\n      size,\n      overflow = 0,\n      overflowLabel = defaultOverflowLabel,\n      children,\n      ...props\n    },\n    ref\n  ) => (\n    <div\n      ref={ref}\n      role=\"group\"\n      className={cn(\n        \"inline-flex items-center [&>*:not(:first-child)]:-ms-2 [&>*]:shadow-[0_0_0_2px_var(--newt-avatar-group-ring,var(--newt-bg-surface))]\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      {overflow > 0 ? (\n        <div\n          className={cn(\n            avatarVariants({ size }),\n            \"bg-newt-bg-active tabular-nums text-newt-text-primary\"\n          )}\n        >\n          <span aria-hidden=\"true\">+{overflow}</span>\n          <span className=\"sr-only\">{overflowLabel(overflow)}</span>\n        </div>\n      ) : null}\n    </div>\n  )\n)\nAvatarGroup.displayName = \"AvatarGroup\"\n\nexport { AvatarGroup }\n",
      "type": "registry:ui"
    }
  ]
}