{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-badge",
  "title": "Notification Badge",
  "description": "The dot and numeric badges that sit over an icon, with `99+` overflow.",
  "registryDependencies": [
    "https://guillermo-rebolledo.github.io/materialcn/r/materialcn-theme.json",
    "https://guillermo-rebolledo.github.io/materialcn/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/ui/notification-badge.tsx",
      "content": "import type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype NotificationBadgeBaseProps = Omit<\n  React.ComponentProps<\"span\">,\n  \"aria-hidden\" | \"aria-label\" | \"children\" | \"role\"\n>\n\ntype NotificationBadgeProps = NotificationBadgeBaseProps &\n  (\n    | {\n        \"aria-label\"?: never\n        max?: never\n        value?: never\n      }\n    | {\n        \"aria-label\": string\n        max?: number\n        value: number\n      }\n  )\n\nfunction NotificationBadge({\n  \"aria-label\": ariaLabel,\n  className,\n  max = 99,\n  value,\n  ...props\n}: NotificationBadgeProps) {\n  const isDot = value === undefined\n  const displayValue = !isDot && value > max ? `${max}+` : value\n  const isLarge = String(displayValue).length > 1\n\n  return (\n    <span\n      {...props}\n      aria-hidden={isDot ? true : undefined}\n      aria-label={ariaLabel}\n      data-slot=\"notification-badge\"\n      role={isDot ? undefined : \"status\"}\n      className={cn(\n        \"pointer-events-none inline-flex shrink-0 items-center justify-center rounded-m3-full bg-m3-error text-m3-label-sm text-m3-on-error select-none\",\n        isDot ? \"size-1.5\" : isLarge ? \"h-4 min-w-5.5 px-1\" : \"size-4\",\n        className\n      )}\n    >\n      {displayValue}\n    </span>\n  )\n}\n\nfunction NotificationBadgeAnchor({\n  className,\n  ...props\n}: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"notification-badge-anchor\"\n      className={cn(\n        \"relative inline-flex shrink-0 [&>[data-slot=notification-badge]]:absolute [&>[data-slot=notification-badge]]:top-0 [&>[data-slot=notification-badge]]:right-0\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  NotificationBadge,\n  NotificationBadgeAnchor,\n  type NotificationBadgeProps,\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "display"
  ],
  "type": "registry:ui"
}