{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "link",
  "title": "Link",
  "description": "Text link with a chevron that turns into an arrow on hover, an external variant that opens a new tab, and a linkComponent prop for your router.",
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/dentil/link/link.tsx",
      "content": "import { ArrowRight, ChevronRight, ExternalLink } from 'lucide-react';\nimport type * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/** Props passed to a custom `linkComponent`. Compatible with `next/link`, an adapted React Router `Link`, or a plain `<a>`. */\nexport type LinkComponentProps = Omit<React.ComponentProps<'a'>, 'href'> & { href: string };\n\nexport type LinkComponent = React.ElementType<LinkComponentProps>;\n\nexport interface LinkProps extends Omit<React.ComponentProps<'a'>, 'href'> {\n  href: string;\n  /** Show the chevron that turns into an arrow on hover. Ignored when `external` is set. */\n  arrow?: boolean;\n  /** Open in a new tab with `rel=\"noopener noreferrer\"` and show an external link icon. */\n  external?: boolean;\n  /** Renders the anchor, e.g. `next/link`. Defaults to `'a'`. */\n  linkComponent?: LinkComponent;\n  /** Merged onto the label, which truncates when the link is narrower than its text. */\n  labelClassName?: string;\n}\n\nconst icon = 'size-4 transition-[translate,opacity] duration-200 ease-out';\n\nexport function Link({\n  href,\n  arrow = true,\n  external = false,\n  linkComponent: Anchor = 'a',\n  className,\n  labelClassName,\n  children,\n  ...props\n}: LinkProps) {\n  return (\n    <Anchor\n      data-slot=\"link\"\n      href={href}\n      target={external ? '_blank' : undefined}\n      rel={external ? 'noopener noreferrer' : undefined}\n      {...props}\n      className={cn(\n        'group/link text-primary hover:text-primary/80 focus-visible:ring-ring/50 inline-flex max-w-full items-center gap-1 rounded-sm font-medium transition-colors outline-none focus-visible:ring-[3px]',\n        className\n      )}>\n      <span className={cn('min-w-0 truncate', labelClassName)}>{children}</span>\n      {external ? (\n        <>\n          <ExternalLink aria-hidden className=\"size-3 shrink-0\" />\n          <span className=\"sr-only\">(opens in a new tab)</span>\n        </>\n      ) : arrow ? (\n        <span aria-hidden className=\"relative -ml-0.5 shrink-0 overflow-hidden\">\n          <ChevronRight\n            className={cn(\n              icon,\n              'group-hover/link:opacity-0 group-focus-visible/link:opacity-0',\n              'motion-safe:group-hover/link:translate-x-1 motion-safe:group-focus-visible/link:translate-x-1'\n            )}\n          />\n          <ArrowRight\n            className={cn(\n              icon,\n              'absolute inset-0 opacity-0 group-hover/link:opacity-100 group-focus-visible/link:opacity-100',\n              'motion-safe:-translate-x-1 motion-safe:group-hover/link:translate-x-0 motion-safe:group-focus-visible/link:translate-x-0'\n            )}\n          />\n        </span>\n      ) : null}\n    </Anchor>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/dentil/link/link.tsx"
    }
  ],
  "type": "registry:component"
}