{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "link",
  "title": "Link",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-vue/components/link/Link.vue",
      "content": "<script setup lang=\"ts\">\nimport type { HTMLAttributes } from 'vue'\nimport { computed } from 'vue'\nimport { Primitive } from 'reka-ui'\nimport { cn } from '@/lib/utils'\nimport { linkVariants } from './link.variants'\n\ntype Underline = 'none' | 'always' | 'hover'\ntype Color = 'default' | 'primary' | 'muted'\ntype Size = 'sm' | 'default' | 'lg'\n\ninterface Props {\n  /** External URL — renders an <a> with target/rel handling. */\n  href?: string\n  /** Router destination — renders a router-link when vue-router is present. */\n  to?: string | object\n  as?: string\n  asChild?: boolean\n  underline?: Underline\n  color?: Color\n  size?: Size\n  disabled?: boolean\n  /** Open external href in a new tab. Defaults to true for http(s) hrefs. */\n  external?: boolean\n  class?: HTMLAttributes['class']\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n  as: 'a',\n  underline: 'hover',\n  color: 'primary',\n  size: 'default',\n  external: undefined,\n})\n\nconst isExternal = computed(() => {\n  if (props.external !== undefined) return props.external\n  return typeof props.href === 'string' && /^https?:\\/\\//.test(props.href)\n})\n\nconst resolvedTag = computed(() => {\n  if (props.asChild) return Primitive\n  if (props.to) return 'router-link'\n  return props.as\n})\n\nconst resolvedHref = computed(() => props.to ?? props.href)\n\nconst externalAttrs = computed(() => (isExternal.value ? { target: '_blank', rel: 'noopener noreferrer' } : {}))\n</script>\n\n<template>\n  <component\n    :is=\"resolvedTag\"\n    data-uipkge\n    data-slot=\"link\"\n    :data-underline=\"underline\"\n    :data-color=\"color\"\n    :data-size=\"size\"\n    :data-disabled=\"disabled ? '' : undefined\"\n    :as=\"asChild ? as : undefined\"\n    :as-child=\"asChild\"\n    :to=\"to\"\n    :href=\"resolvedHref\"\n    :aria-disabled=\"disabled ? 'true' : undefined\"\n    :tabindex=\"disabled ? -1 : undefined\"\n    v-bind=\"externalAttrs\"\n    :class=\"cn(linkVariants({ underline, color, size }), disabled && 'pointer-events-none opacity-50', props.class)\"\n  >\n    <slot name=\"left\" />\n    <slot />\n    <slot name=\"right\" />\n  </component>\n</template>\n",
      "type": "registry:ui",
      "target": "~/app/components/ui/link/Link.vue"
    },
    {
      "path": "packages/registry-vue/components/link/link.variants.ts",
      "content": "import type { VariantProps } from 'class-variance-authority'\nimport { cva } from 'class-variance-authority'\n\nexport const linkVariants = cva(\n  \"inline-flex items-center gap-1.5 font-medium transition-colors duration-200 outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] rounded-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      underline: {\n        none: 'no-underline',\n        always: 'underline underline-offset-4',\n        hover: 'no-underline hover:underline hover:underline-offset-4',\n      },\n      color: {\n        default: 'text-foreground hover:text-foreground/80',\n        primary: 'text-primary hover:text-primary/80',\n        muted: 'text-muted-foreground hover:text-foreground',\n      },\n      size: {\n        sm: 'text-xs gap-1',\n        default: 'text-sm',\n        lg: 'text-base',\n      },\n    },\n    defaultVariants: {\n      underline: 'hover',\n      color: 'primary',\n      size: 'default',\n    },\n  },\n)\n\nexport type LinkVariants = VariantProps<typeof linkVariants>\n",
      "type": "registry:ui",
      "target": "~/app/components/ui/link/link.variants.ts"
    },
    {
      "path": "packages/registry-vue/components/link/index.ts",
      "content": "export { default as Link } from './Link.vue'\n\nexport { linkVariants, type LinkVariants } from './link.variants'\n",
      "type": "registry:ui",
      "target": "~/app/components/ui/link/index.ts"
    }
  ],
  "dependencies": [
    "class-variance-authority",
    "reka-ui"
  ],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Styled anchor with router integration. Renders an <a> for href, a router-link for to, and handles external links with target/rel. Supports underline variants (always/hover/none), color variants (default/primary/muted), disabled state, left/right icon slots, size variants, and asChild composition.",
  "categories": [
    "navigation"
  ]
}