{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toc",
  "title": "Toc",
  "description": "Astro table-of-contents links for headings within a page.",
  "dependencies": [
    "cn"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "packages/ui/src/components/ui/toc/index.ts",
      "content": "export { default as Toc } from \"./toc.astro\"\nexport { default as TocMenu } from \"./toc-menu.astro\"\nexport { default as TocMenuItem } from \"./toc-menu-item.astro\"\nexport { default as TocMenuLink } from \"./toc-menu-link.astro\"\nexport { default as TocTitle } from \"./toc-title.astro\"\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/toc/toc-menu-item.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"li\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<li data-slot=\"toc-menu-item\" class={cn(\"relative\", className)} {...props}>\n  <slot />\n</li>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/toc-menu-item.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toc/toc-menu-link.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"a\"> & {\n  depth?: number\n  isActive?: boolean\n  active?: boolean\n}\n\nconst {\n  class: className,\n  depth = 2,\n  isActive,\n  active = false,\n  ...props\n} = Astro.props\n\nconst resolvedActive = isActive ?? active\n---\n\n<a\n  data-slot=\"toc-menu-link\"\n  data-depth={depth}\n  data-active={resolvedActive ? \"true\" : undefined}\n  aria-current={resolvedActive ? \"location\" : undefined}\n  class={cn(\n    \"text-muted-foreground hover:text-foreground data-[active=true]:text-foreground block text-sm leading-6 transition-colors\",\n    depth === 3 && \"pl-4\",\n    depth >= 4 && \"pl-8\",\n    className,\n  )}\n  {...props}\n>\n  <slot />\n</a>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/toc-menu-link.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toc/toc-menu.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"ul\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<ul\n  data-slot=\"toc-menu\"\n  class={cn(\"flex flex-col gap-1\", className)}\n  {...props}\n>\n  <slot />\n</ul>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/toc-menu.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toc/toc-title.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"p\"> &\n  HTMLAttributes<\"h2\"> &\n  HTMLAttributes<\"div\"> & {\n    as?: \"p\" | \"h2\" | \"div\"\n  }\n\nconst { as: Tag = \"p\", class: className, ...props } = Astro.props\n---\n\n<Tag data-slot=\"toc-title\" class={cn(\"text-sm font-medium tracking-tight\", className)} {...props}>\n  <slot />\n</Tag>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/toc-title.astro"
    },
    {
      "path": "packages/ui/src/components/ui/toc/toc.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\n\ntype Props = HTMLAttributes<\"nav\">\n\nconst { class: className, ...props } = Astro.props\n---\n\n<nav data-slot=\"toc\" class={cn(\"flex flex-col gap-3\", className)} {...props}>\n  <slot />\n</nav>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/toc/toc.astro"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/toc",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
