{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "funnel-chart",
  "type": "registry:ui",
  "title": "Funnel Chart",
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/ui/funnel-chart.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { motion } from \"motion/react\";\nimport { ArrowDownRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface FunnelStage {\n  label: string;\n  value: number;\n  color: string;\n}\n\nexport interface FunnelChartProps {\n  stages?: FunnelStage[];\n  title?: string;\n  className?: string;\n}\n\nconst DEFAULT_STAGES: FunnelStage[] = [\n  { label: \"Landing Visits\", value: 24800, color: \"from-blue-500 to-blue-400\" },\n  { label: \"Signups\", value: 8920, color: \"from-cyan-500 to-cyan-400\" },\n  { label: \"Activated\", value: 4640, color: \"from-emerald-500 to-emerald-400\" },\n  { label: \"Paid Pro\", value: 1480, color: \"from-violet-500 to-violet-400\" },\n];\n\nexport function FunnelChart({\n  stages = DEFAULT_STAGES,\n  title = \"Conversion Funnel\",\n  className,\n}: FunnelChartProps) {\n  const [activeIdx, setActiveIdx] = useState<number | null>(null);\n  const topVal = stages[0]?.value || 1;\n  const totalConv = ((stages[stages.length - 1]?.value ?? 0) / topVal) * 100;\n\n  return (\n    <div\n      className={cn(\n        \"w-full max-w-md rounded-2xl border border-white/10 bg-[#101013] p-5 shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]\",\n        className\n      )}\n    >\n      <div className=\"mb-4 flex items-center justify-between\">\n        <div>\n          <h3 className=\"text-xs font-semibold text-zinc-100\">{title}</h3>\n          <p className=\"text-[11px] text-zinc-500\">\n            End-to-end conversion{\" \"}\n            <span className=\"font-mono font-semibold text-emerald-400\">\n              {totalConv.toFixed(1)}%\n            </span>\n          </p>\n        </div>\n        <span className=\"rounded-full border border-white/10 bg-zinc-900 px-2.5 py-0.5 font-mono text-[10px] text-zinc-400\">\n          {stages.length} stages\n        </span>\n      </div>\n\n      <div className=\"space-y-2.5\">\n        {stages.map((stage, idx) => {\n          const widthPct = Math.max(12, (stage.value / topVal) * 100);\n          const prev = idx > 0 ? stages[idx - 1].value : null;\n          const dropPct =\n            prev && prev > 0 ? Math.round(((prev - stage.value) / prev) * 100) : null;\n          const isDimmed = activeIdx !== null && activeIdx !== idx;\n\n          return (\n            <div\n              key={stage.label}\n              onMouseEnter={() => setActiveIdx(idx)}\n              onMouseLeave={() => setActiveIdx(null)}\n              className={cn(\n                \"space-y-1 transition-opacity duration-150\",\n                isDimmed ? \"opacity-40\" : \"opacity-100\"\n              )}\n            >\n              <div className=\"flex items-center justify-between text-[11px]\">\n                <span className=\"font-medium text-zinc-200\">{stage.label}</span>\n                <div className=\"flex items-center gap-2\">\n                  {dropPct !== null && (\n                    <span className=\"inline-flex items-center gap-0.5 rounded-full bg-rose-500/10 px-1.5 py-0.5 font-mono text-[10px] text-rose-300\">\n                      <ArrowDownRight className=\"h-2.5 w-2.5\" />\n                      -{dropPct}%\n                    </span>\n                  )}\n                  <span className=\"font-mono font-semibold text-zinc-100 tabular-nums\">\n                    {stage.value.toLocaleString()}\n                  </span>\n                </div>\n              </div>\n\n              <div className=\"h-6 w-full overflow-hidden rounded-lg bg-zinc-950/90 p-0.5 border border-white/[0.06]\">\n                <motion.div\n                  initial={{ width: 0 }}\n                  animate={{ width: `${widthPct}%` }}\n                  transition={{\n                    duration: 0.28,\n                    delay: idx * 0.04,\n                    ease: [0.22, 1, 0.36, 1],\n                  }}\n                  className={cn(\n                    \"h-full rounded-md bg-gradient-to-r shadow-sm\",\n                    stage.color\n                  )}\n                />\n              </div>\n            </div>\n          );\n        })}\n      </div>\n    </div>\n  );\n}\n\n",
      "type": "registry:ui"
    }
  ]
}