{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "label",
  "title": "Label",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-angular/components/label/label.component.ts",
      "content": "import { Component, Input, ChangeDetectionStrategy } from '@angular/core'\nimport { cn } from '@/lib/utils'\n\n/**\n * Angular port of the React Label (Radix Label). Put it on a native label for the real\n * control association (`<label ui-label for=\"email\">`); `<ui-label>` is kept for\n * wrapper-only use. React's `htmlFor` is accepted as an alias of `for`.\n *\n * Radix behaviour: a double-click on the label text does not select it (mousedown with\n * detail > 1 is prevented), except when the press lands on a nested form control.\n */\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-label, label[ui-label]',\n  standalone: true,\n  host: {\n    '[attr.data-uipkge]': '\"\"',\n    '[attr.data-slot]': '\"label\"',\n    '[attr.for]': 'htmlFor ?? null',\n    '[class]': 'hostClass',\n    '(mousedown)': 'onMouseDown($event)',\n  },\n  template: `<ng-content />`,\n})\nexport class UiLabelComponent {\n  /** Id of the control this label describes (React `htmlFor`). */\n  @Input('for') htmlFor?: string\n  /** React prop name, same as `for`. */\n  @Input('htmlFor') set htmlForAlias(v: string | undefined) {\n    this.htmlFor = v\n  }\n  @Input('class') className?: string\n\n  get hostClass(): string {\n    return cn(\n      'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n      this.className,\n    )\n  }\n\n  onMouseDown(event: MouseEvent): void {\n    const target = event.target as HTMLElement | null\n    if (target?.closest?.('button, input, select, textarea')) return\n    // Prevent text selection when double clicking the label.\n    if (!event.defaultPrevented && event.detail > 1) event.preventDefault()\n  }\n}\n",
      "type": "registry:ui",
      "target": "~/src/app/components/ui/label/label.component.ts"
    },
    {
      "path": "packages/registry-angular/components/label/index.ts",
      "content": "export { UiLabelComponent } from './label.component'\n",
      "type": "registry:ui",
      "target": "~/src/app/components/ui/label/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Accessible label (Radix Label port): a native label bound to its control via `for` / `htmlFor`, peer- and group-disabled dimming, and the Radix double-click text-selection guard.",
  "categories": [
    "form"
  ]
}