{
  "$schema": "https://ui.adrianub.dev/schema/registry-item.json",
  "author": "Adrián UB (https://ui.adrianub.dev)",
  "name": "button",
  "type": "registry:ui",
  "files": [
    {
      "path": "ui/button.ts",
      "content": "import type { VariantProps } from 'class-variance-authority'\n\nimport { computed, Directive, input } from '@angular/core'\n\nimport { cva } from 'class-variance-authority'\nimport { cn } from '~/lib/utils'\n\nexport const buttonVariants = cva(\n  'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n  {\n    variants: {\n      variant: {\n        default:\n          'bg-primary text-primary-foreground shadow hover:bg-primary/90',\n        destructive:\n          'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n        outline:\n          'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',\n        secondary:\n          'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',\n        ghost: 'hover:bg-accent hover:text-accent-foreground',\n        link: 'text-primary underline-offset-4 hover:underline',\n      },\n      size: {\n        default: 'h-9 px-4 py-2',\n        sm: 'h-8 rounded-md px-3 text-xs',\n        lg: 'h-10 rounded-md px-8',\n        icon: 'h-9 w-9',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      size: 'default',\n    },\n  },\n)\n\ntype ButtonProps = VariantProps<typeof buttonVariants>\n\nexport type UbButtonSize = NonNullable<ButtonProps['size']>\nexport type UbButtonVariant = NonNullable<ButtonProps['variant']>\n\n@Directive({\n  selector: '[ubButton]',\n  standalone: true,\n  host: {\n    '[class]': 'computedClass()',\n  },\n})\nexport class UbButtonDirective {\n  readonly class = input<string>()\n\n  readonly variant = input<UbButtonVariant>('default')\n\n  readonly size = input<UbButtonSize>('default')\n\n  protected computedClass = computed(() =>\n    cn(\n      buttonVariants({\n        variant: this.variant(),\n        size: this.size(),\n        class: this.class(),\n      }),\n    ),\n  )\n}\n",
      "type": "registry:ui"
    }
  ]
}