{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "expandable-bento-card",
  "type": "registry:ui",
  "title": "Expandable Bento Card",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Interactive bento surface that expands inline with Hooke's Law spring height projection to reveal secondary diagnostic modules.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/expandable-bento-card.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { ChevronDown, Cpu, Gauge, Sparkles } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ExpandableBentoCardProps {\n  /** Card header badge text. Default: \"RUNTIME_TELEMETRY\" */\n  badge?: string;\n  /** Primary card title. Default: \"GPU Compositor Pipeline\" */\n  title?: string;\n  /** Short summary shown in both states. */\n  summary?: string;\n  /** Initial expanded state. Default: false */\n  defaultExpanded?: boolean;\n  /** Hooke's Law spring stiffness coefficient. Default: 320 */\n  stiffness?: number;\n  /** Spring damping coefficient. Default: 26 */\n  damping?: number;\n  className?: string;\n}\n\nexport function ExpandableBentoCard({\n  badge = \"RUNTIME_TELEMETRY\",\n  title = \"GPU Compositor Pipeline\",\n  summary = \"Click to expand live sub-pixel spring diagnostics and frame budget metrics.\",\n  defaultExpanded = false,\n  stiffness = 320,\n  damping = 26,\n  className,\n}: ExpandableBentoCardProps) {\n  const shouldReduceMotion = useReducedMotion() ?? false;\n  const [expanded, setExpanded] = useState(defaultExpanded);\n\n  return (\n    <motion.div\n      layout\n      transition={\n        shouldReduceMotion\n          ? { duration: 0.01 }\n          : { type: \"spring\", stiffness, damping }\n      }\n      className={cn(\n        \"w-full max-w-sm overflow-hidden rounded-3xl border border-neutral-200 bg-white p-5 shadow-sm transition-colors hover:border-neutral-400 dark:border-[#222222] dark:bg-[#0A0A0A] dark:hover:border-[#383838]\",\n        className\n      )}\n    >\n      <button\n        type=\"button\"\n        aria-expanded={expanded}\n        onClick={() => setExpanded((prev) => !prev)}\n        className=\"flex w-full items-start justify-between gap-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black dark:focus-visible:ring-white\"\n      >\n        <div>\n          <span className=\"inline-flex items-center gap-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-neutral-400\">\n            <Sparkles className=\"h-3 w-3 text-black dark:text-white\" />\n            {badge}\n          </span>\n          <h3 className=\"mt-1 text-base font-semibold text-black dark:text-white\">\n            {title}\n          </h3>\n          <p className=\"mt-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400\">\n            {summary}\n          </p>\n        </div>\n\n        <motion.span\n          animate={{ rotate: expanded ? 180 : 0 }}\n          transition={\n            shouldReduceMotion\n              ? { duration: 0 }\n              : { type: \"spring\", stiffness: 360, damping: 24 }\n          }\n          className=\"mt-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-neutral-200 bg-neutral-50 text-black dark:border-[#262626] dark:bg-[#141414] dark:text-white\"\n        >\n          <ChevronDown className=\"h-4 w-4\" />\n        </motion.span>\n      </button>\n\n      <AnimatePresence initial={false}>\n        {expanded && (\n          <motion.div\n            key=\"expanded-content\"\n            initial={{ opacity: 0, height: 0 }}\n            animate={{ opacity: 1, height: \"auto\" }}\n            exit={{ opacity: 0, height: 0 }}\n            transition={\n              shouldReduceMotion\n                ? { duration: 0.01 }\n                : { type: \"spring\", stiffness, damping }\n            }\n            className=\"overflow-hidden\"\n          >\n            <div className=\"mt-4 grid grid-cols-2 gap-2.5 border-t border-neutral-200 pt-4 dark:border-[#1F1F1F]\">\n              <div className=\"rounded-2xl border border-neutral-200/80 bg-neutral-50 p-3 dark:border-[#222222] dark:bg-[#121212]\">\n                <div className=\"flex items-center gap-1.5 text-[10px] font-semibold uppercase text-neutral-400\">\n                  <Gauge className=\"h-3 w-3\" />\n                  Frame Budget\n                </div>\n                <div className=\"mt-1 font-mono text-sm font-bold text-black dark:text-white\">\n                  0.42 ms\n                </div>\n                <div className=\"text-[10px] text-neutral-500\">\n                  120fps locked\n                </div>\n              </div>\n\n              <div className=\"rounded-2xl border border-neutral-200/80 bg-neutral-50 p-3 dark:border-[#222222] dark:bg-[#121212]\">\n                <div className=\"flex items-center gap-1.5 text-[10px] font-semibold uppercase text-neutral-400\">\n                  <Cpu className=\"h-3 w-3\" />\n                  Re-Renders\n                </div>\n                <div className=\"mt-1 font-mono text-sm font-bold text-black dark:text-white\">\n                  0 / sec\n                </div>\n                <div className=\"text-[10px] text-neutral-500\">\n                  MotionValue direct\n                </div>\n              </div>\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </motion.div>\n  );\n}\n\nexport default ExpandableBentoCard;\n",
      "type": "registry:ui",
      "target": "components/ui/expandable-bento-card.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport async function copyToClipboard(text: string): Promise<boolean> {\n  if (typeof window === \"undefined\") return false;\n\n  try {\n    if (navigator.clipboard && window.isSecureContext) {\n      await navigator.clipboard.writeText(text);\n      return true;\n    }\n\n    const textArea = document.createElement(\"textarea\");\n    textArea.value = text;\n    textArea.style.position = \"fixed\";\n    textArea.style.left = \"-999999px\";\n    textArea.style.top = \"-999999px\";\n    document.body.appendChild(textArea);\n    textArea.focus();\n    textArea.select();\n    const succeeded = document.execCommand(\"copy\");\n    textArea.remove();\n    return succeeded;\n  } catch {\n    return false;\n  }\n}\n",
      "type": "registry:lib",
      "target": "lib/utils.ts"
    }
  ]
}
