{
  "$schema": "https://ui.adrianub.dev/schema/registry-item.json",
  "author": "Adrián UB (https://ui.adrianub.dev)",
  "name": "badge",
  "type": "registry:ui",
  "files": [
    {
      "path": "ui/badge.ts",
      "content": "import type { VariantProps } from 'class-variance-authority'\nimport { computed, Directive, input } from '@angular/core'\n\nimport { cva } from 'class-variance-authority'\nimport { cn } from '~/lib/utils'\n\nexport const badgeVariants = cva(\n  'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n  {\n    variants: {\n      variant: {\n        default:\n          'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',\n        secondary:\n          'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n        destructive:\n          'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',\n        outline: 'text-foreground',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n    },\n  },\n)\n\ntype BadgeProps = VariantProps<typeof badgeVariants>\n\nexport type UbBadgeVariant = NonNullable<BadgeProps['variant']>\n\n@Directive({\n  selector: '[ubBadge]',\n  standalone: true,\n  host: {\n    '[class]': 'computedClass()',\n  },\n})\nexport class UbBadgeDirective {\n  readonly class = input<string>()\n  readonly variant = input<UbBadgeVariant>('default')\n\n  protected computedClass = computed(() =>\n    cn(badgeVariants({ variant: this.variant(), class: this.class() })),\n  )\n}\n",
      "type": "registry:ui"
    }
  ]
}