{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "inline-toc",
  "title": "Inline TOC",
  "description": "InlineTOC: a collapsible table of contents to place inside a page.",
  "dependencies": [
    "cn",
    "@fuma-translate/react@^1.0.2",
    "fumadocs-core@^16.17.8",
    "lucide-react"
  ],
  "registryDependencies": [
    "collapsible"
  ],
  "files": [
    {
      "path": "registry/base/docs/components/inline-toc.tsx",
      "content": "// Adapted from Fumadocs UI (https://github.com/fuma-nama/fumadocs)\n// Copyright (c) 2023 Fuma, MIT License\n\"use client\";\n\nimport { useTranslations } from \"@fuma-translate/react\";\nimport { cn } from \"cn\";\nimport type { TOCItemType } from \"fumadocs-core/toc\";\nimport { ChevronDown } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport {\n  Collapsible,\n  CollapsibleContent,\n  CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\n\nexport interface InlineTocProps extends Omit<\n  ComponentProps<typeof Collapsible>,\n  \"className\"\n> {\n  items: TOCItemType[];\n  className?: string;\n}\n\nexport function InlineTOC({ items, className, ...props }: InlineTocProps) {\n  const t = useTranslations({ note: \"inline table of contents\" });\n\n  return (\n    <Collapsible\n      {...props}\n      className={cn(\n        \"not-docs-typeset my-4 rounded-xl border bg-card text-card-foreground\",\n        className,\n      )}\n    >\n      <CollapsibleTrigger className=\"group inline-flex w-full items-center justify-between rounded-xl px-4 py-2.5 font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring\">\n        {props.children ?? t(\"Table of Contents\")}\n        <ChevronDown className=\"size-4 transition-transform duration-200 group-data-panel-open:rotate-180\" />\n      </CollapsibleTrigger>\n      <CollapsibleContent>\n        <div className=\"flex flex-col p-4 pt-0 text-sm text-muted-foreground\">\n          {items.map((item) => (\n            <a\n              key={item.url}\n              href={item.url}\n              className=\"border-s py-1.5 hover:text-foreground\"\n              style={{\n                paddingInlineStart: 12 * Math.max(item.depth - 1, 0),\n              }}\n            >\n              {item.title}\n            </a>\n          ))}\n        </div>\n      </CollapsibleContent>\n    </Collapsible>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/docs/components/inline-toc.tsx"
    }
  ],
  "type": "registry:component"
}