{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tw-badge-indicator",
  "type": "registry:ui",
  "title": "react-tw/badge-indicator.tsx",
  "description": "Carbon `BadgeIndicator` as React + Tailwind, the look of `<ui-badge-indicator>`: a support-error badge in the Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [],
  "registryDependencies": [
    "@kanok-ui/core-badge-indicator",
    "@kanok-ui/tw-theme",
    "@kanok-ui/tw-utils"
  ],
  "files": [
    {
      "path": "src/react-tw/badge-indicator.tsx",
      "type": "registry:ui",
      "target": "components/ui/react-tw/badge-indicator.tsx",
      "content": "import type { ComponentProps } from 'react';\nimport { badgeText } from '../core/badge-indicator.ts';\nimport { cn } from './lib/utils.ts';\n\nexport interface BadgeIndicatorProps extends Omit<ComponentProps<'div'>, 'children'> {\n    /** The number shown; unset or 0 = a dot. */\n    count?: number;\n}\n\n/**\n * Carbon `BadgeIndicator` as React + Tailwind, the look of `<ui-badge-indicator>`: a support-error badge in the\n * top-end corner of a ghost `IconButton` (use `IconButton badgeCount`) — an 8px dot 8px in, or a 16px pill with the\n * count 4px in, \"999+\" past 999.\n */\nexport function BadgeIndicator({ count, className, ...rest }: Readonly<BadgeIndicatorProps>) {\n    const text = badgeText(count);\n    return (\n        <div\n            // the count is the button's description (aria-describedby reads hidden text); hidden here, so the button's visible content stays its name (WCAG 2.5.3)\n            aria-hidden=\"true\"\n            {...rest}\n            className={cn(\n                'pointer-events-none absolute end-0 top-0 box-border flex max-h-4 min-h-2 min-w-2 rounded-[100px] bg-error px-1 pt-0 pb-0.5 text-on-primary type-caption',\n                text ? 'mt-1 me-1' : 'mt-2 me-2',\n                'forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]',\n                className,\n            )}\n        >\n            {text}\n        </div>\n    );\n}\n"
    }
  ]
}
