{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "link",
  "title": "Link",
  "description": "An inline link with an underline that follows the text colour; renders any element through the render prop.",
  "dependencies": [
    "@base-ui/react@^1.9.0"
  ],
  "registryDependencies": [
    "https://sproutboat.com/ikada/r/theme.json",
    "https://sproutboat.com/ikada/r/cn.json",
    "https://sproutboat.com/ikada/r/icons.json"
  ],
  "files": [
    {
      "path": "registry/ikada/ui/link.tsx",
      "content": "\"use client\";\n\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn, focusRing } from \"@/components/ikada/lib/cn\";\nimport { ArrowUpRightIcon } from \"@/components/ikada/lib/icons\";\n\nexport interface LinkProps extends useRender.ComponentProps<\"a\"> {\n  /** Opens in a new tab with a safe rel, shows an arrow and announces it. */\n  external?: boolean;\n}\n\n/**\n * An inline link. Pass `render` to hand the element to a router:\n * `<Link render={<RouterLink to=\"/projects\" />}>Sprouts</Link>`. ikada keeps the styles and\n * merges its props (class, ref, handlers) into the router's link.\n */\nexport function Link({ external = false, className, children, ref, render, ...props }: LinkProps) {\n  return useRender({\n    defaultTagName: \"a\",\n    render,\n    ref,\n    props: {\n      \"data-slot\": \"link\",\n      target: external ? \"_blank\" : undefined,\n      rel: external ? \"noopener noreferrer\" : undefined,\n      className: cn(\n        \"rounded-xs font-medium text-fg underline decoration-hairline-strong decoration-1 underline-offset-4 transition-colors duration-(--sb-duration-hover) ease-hover\",\n        \"hover:decoration-fg aria-disabled:pointer-events-none aria-disabled:opacity-55\",\n        focusRing,\n        className,\n      ),\n      ...props,\n      children: (\n        <>\n          {children}\n          {external ? (\n            <>\n              <ArrowUpRightIcon className=\"ms-1 inline-block size-3.5 align-[-0.2em]\" />\n              <span className=\"sr-only\">(opens in a new tab)</span>\n            </>\n          ) : null}\n        </>\n      ),\n    },\n  });\n}\n",
      "type": "registry:ui",
      "target": "@components/ikada/link.tsx"
    }
  ],
  "categories": [
    "actions",
    "navigation"
  ],
  "type": "registry:ui"
}