{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ink/badge",
  "title": "Badge",
  "description": "Semantic status indicator badge (success/error/warning/info)",
  "dependencies": [
    "ink"
  ],
  "registryDependencies": [
    "https://termcn.dev/r/ink/terminal-style.json",
    "https://termcn.dev/r/ink/types.json",
    "https://termcn.dev/r/ink/use-theme.json",
    "https://termcn.dev/r/ink/use-unicode.json"
  ],
  "files": [
    {
      "path": "registry/ui/badge.tsx",
      "content": "import { Box, Text } from \"ink\";\n\nimport { useTheme } from \"@/hooks/use-theme\";\nimport { useUnicode } from \"@/hooks/use-unicode\";\nimport { resolveBorderStyle } from \"@/lib/terminal-style\";\nimport type { BorderStyle } from \"@/components/ui/types\";\n\nexport type BadgeVariant =\n  | \"default\"\n  | \"success\"\n  | \"warning\"\n  | \"error\"\n  | \"info\"\n  | \"secondary\";\n\nexport interface BadgeProps {\n  children: string;\n  variant?: BadgeVariant;\n  color?: string;\n  bold?: boolean;\n  bordered?: boolean;\n  borderStyle?: BorderStyle;\n  paddingX?: number;\n  \"aria-label\"?: string;\n}\n\nexport const Badge = ({\n  children,\n  variant = \"default\",\n  color,\n  bold = false,\n  bordered = true,\n  borderStyle = \"round\",\n  paddingX = 1,\n  \"aria-label\": ariaLabel,\n}: BadgeProps) => {\n  const unicode = useUnicode();\n  const theme = useTheme();\n\n  const variantColor =\n    color ??\n    (() => {\n      switch (variant) {\n        case \"success\": {\n          return theme.colors.success;\n        }\n        case \"warning\": {\n          return theme.colors.warning;\n        }\n        case \"error\": {\n          return theme.colors.error;\n        }\n        case \"info\": {\n          return theme.colors.info;\n        }\n        case \"secondary\": {\n          return theme.colors.secondary;\n        }\n        default: {\n          return theme.colors.primary;\n        }\n      }\n    })();\n\n  if (!bordered) {\n    return (\n      <Text\n        aria-label={ariaLabel ?? `${variant}: ${children}`}\n        color={variantColor}\n        bold={bold}\n      >\n        {children}\n      </Text>\n    );\n  }\n\n  return (\n    <Box\n      borderStyle={resolveBorderStyle(borderStyle, unicode)}\n      borderColor={variantColor}\n      paddingX={paddingX}\n      aria-label={ariaLabel ?? `${variant}: ${children}`}\n    >\n      <Text color={variantColor} bold={bold}>\n        {children}\n      </Text>\n    </Box>\n  );\n};\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "typography"
  ],
  "type": "registry:ui"
}