{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "morph-dialog",
  "title": "Morph Dialog",
  "type": "registry:component",
  "description": "A card morphs into a dialog with a shared layout",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/morph-dialog.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/morph-dialog.jsx",
      "content": "'use client'\n\nimport { useEffect, useId, useState } from 'react'\nimport { motion, AnimatePresence } from 'motion/react'\n\n// A card morphs into a dialog with a shared layout. Esc or the backdrop closes it.\nexport default function MorphDialog({ title = 'Edge Functions', meta = 'v2.4 · 12 regions', body = 'Run code within 50 ms of every user. Deploys roll out in seconds and roll back just as fast.' }) {\n  const [open, setOpen] = useState(false)\n  const id = useId()\n  useEffect(() => {\n    if (!open) return\n    const k = (e) => e.key === 'Escape' && setOpen(false)\n    window.addEventListener('keydown', k)\n    return () => window.removeEventListener('keydown', k)\n  }, [open])\n  return (\n    <div className=\"relative grid h-[300px] w-[360px] max-w-full place-items-center\">\n      <motion.button layoutId={`card-${id}`} type=\"button\" onClick={() => setOpen(true)} style={{ borderRadius: 16 }}\n        className=\"w-60 border border-line2 bg-panel p-4 text-left\">\n        <motion.div layoutId={`art-${id}`} className=\"h-20 rounded-lg bg-[linear-gradient(135deg,#c8a27a,#3d2b1c)]\" />\n        <motion.div layoutId={`t-${id}`} className=\"mt-3 text-sm font-medium text-tx\">{title}</motion.div>\n        <motion.div layoutId={`m-${id}`} className=\"text-xs text-mute\">{meta}</motion.div>\n      </motion.button>\n      <AnimatePresence>\n        {open && (\n          <>\n            <motion.div className=\"absolute inset-0 z-10 rounded-2xl bg-bg/70 backdrop-blur-sm\" initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} onClick={() => setOpen(false)} />\n            <motion.div layoutId={`card-${id}`} role=\"dialog\" aria-modal=\"true\" aria-label={title} style={{ borderRadius: 20 }}\n              className=\"absolute inset-3 z-20 overflow-hidden border border-line2 bg-panel p-5\">\n              <motion.div layoutId={`art-${id}`} className=\"h-24 rounded-xl bg-[linear-gradient(135deg,#c8a27a,#3d2b1c)]\" />\n              <div className=\"mt-4 flex items-start justify-between\">\n                <div>\n                  <motion.div layoutId={`t-${id}`} className=\"text-base font-medium text-tx\">{title}</motion.div>\n                  <motion.div layoutId={`m-${id}`} className=\"text-xs text-mute\">{meta}</motion.div>\n                </div>\n                <button type=\"button\" onClick={() => setOpen(false)} aria-label=\"Close\" className=\"grid size-7 place-items-center rounded-full border border-line2 text-mute hover:text-tx\">×</button>\n              </div>\n              <motion.p initial={{ opacity: 0, y: 6 }} animate={{ opacity: 1, y: 0, transition: { delay: 0.15 } }} exit={{ opacity: 0 }} className=\"mt-3 text-sm leading-6 text-mute\">{body}</motion.p>\n            </motion.div>\n          </>\n        )}\n      </AnimatePresence>\n    </div>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
