{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dynamic-island-toast",
  "type": "registry:ui",
  "title": "Dynamic Island Toast",
  "author": "Rishabh Bose <https://theb0se.vercel.app/>",
  "description": "Morphing top-edge status capsule that expands smoothly between compact badge, live telemetry pill, and actionable notification drawer.",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/ui/dynamic-island-toast.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { Activity, CheckCircle2, Sparkles, X } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type IslandMode = \"compact\" | \"telemetry\" | \"expanded\";\n\nexport interface DynamicIslandToastProps {\n  /** Initial state mode of the dynamic capsule. Default: \"compact\" */\n  defaultMode?: IslandMode;\n  /** Title displayed in expanded and telemetry modes. Default: \"Registry Sync Active\" */\n  title?: string;\n  /** Subtitle displayed inside the expanded capsule. Default: \"12 shadcn v2 manifests compiled in 42ms\" */\n  subtitle?: string;\n  /** Hooke's Law spring stiffness coefficient. Default: 340 */\n  stiffness?: number;\n  /** Spring damping coefficient. Default: 25 */\n  damping?: number;\n  className?: string;\n}\n\nexport function DynamicIslandToast({\n  defaultMode = \"compact\",\n  title = \"Registry Sync Active\",\n  subtitle = \"12 shadcn v2 manifests compiled in 42ms\",\n  stiffness = 340,\n  damping = 25,\n  className,\n}: DynamicIslandToastProps) {\n  const shouldReduceMotion = useReducedMotion() ?? false;\n  const [mode, setMode] = useState<IslandMode>(defaultMode);\n\n  const cycleMode = () => {\n    setMode((prev) =>\n      prev === \"compact\"\n        ? \"telemetry\"\n        : prev === \"telemetry\"\n          ? \"expanded\"\n          : \"compact\"\n    );\n  };\n\n  const springTransition = shouldReduceMotion\n    ? { duration: 0.01 }\n    : { type: \"spring\" as const, stiffness, damping };\n\n  return (\n    <div\n      className={cn(\n        \"flex min-h-[160px] w-full flex-col items-center justify-center gap-3\",\n        className\n      )}\n    >\n      <motion.div\n        layout\n        role=\"status\"\n        aria-live=\"polite\"\n        transition={springTransition}\n        onClick={() => {\n          if (mode !== \"expanded\") cycleMode();\n        }}\n        className={cn(\n          \"relative overflow-hidden border border-neutral-800 bg-black text-white shadow-xl dark:border-[#2A2A2A] dark:bg-[#0D0D0D]\",\n          mode === \"compact\" && \"cursor-pointer rounded-full px-4 py-2\",\n          mode === \"telemetry\" && \"cursor-pointer rounded-full px-5 py-2.5\",\n          mode === \"expanded\" && \"w-full max-w-sm rounded-3xl p-5\"\n        )}\n      >\n        <AnimatePresence mode=\"wait\" initial={false}>\n          {mode === \"compact\" && (\n            <motion.button\n              key=\"compact\"\n              type=\"button\"\n              onClick={(e) => {\n                e.stopPropagation();\n                setMode(\"telemetry\");\n              }}\n              initial={{ opacity: 0, scale: 0.92 }}\n              animate={{ opacity: 1, scale: 1 }}\n              exit={{ opacity: 0, scale: 0.92 }}\n              transition={{ duration: 0.14 }}\n              className=\"flex items-center gap-2.5 text-xs font-semibold focus-visible:outline-none\"\n            >\n              <span className=\"relative flex h-2 w-2\">\n                <span className=\"absolute inline-flex h-full w-full animate-ping rounded-full bg-white opacity-75\" />\n                <span className=\"relative inline-flex h-2 w-2 rounded-full bg-white\" />\n              </span>\n              <span>BoseUI Live</span>\n              <span className=\"font-mono text-[10px] text-neutral-400\">\n                120Hz\n              </span>\n            </motion.button>\n          )}\n\n          {mode === \"telemetry\" && (\n            <motion.button\n              key=\"telemetry\"\n              type=\"button\"\n              onClick={(e) => {\n                e.stopPropagation();\n                setMode(\"expanded\");\n              }}\n              initial={{ opacity: 0, scale: 0.94 }}\n              animate={{ opacity: 1, scale: 1 }}\n              exit={{ opacity: 0, scale: 0.94 }}\n              transition={{ duration: 0.15 }}\n              className=\"flex items-center gap-3 text-xs font-semibold focus-visible:outline-none\"\n            >\n              <Activity className=\"h-4 w-4 text-white\" />\n              <span>{title}</span>\n              <span className=\"rounded-full bg-white/15 px-2 py-0.5 font-mono text-[10px] text-white\">\n                99.8%\n              </span>\n            </motion.button>\n          )}\n\n          {mode === \"expanded\" && (\n            <motion.div\n              key=\"expanded\"\n              initial={{ opacity: 0, y: 4 }}\n              animate={{ opacity: 1, y: 0 }}\n              exit={{ opacity: 0, y: -4 }}\n              transition={{ duration: 0.16 }}\n              className=\"flex flex-col gap-3\"\n            >\n              <div className=\"flex items-start justify-between gap-3\">\n                <div className=\"flex items-center gap-2.5\">\n                  <div className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-2xl bg-white/10 text-white\">\n                    <Sparkles className=\"h-4 w-4\" />\n                  </div>\n                  <div>\n                    <div className=\"text-sm font-semibold text-white\">\n                      {title}\n                    </div>\n                    <div className=\"text-xs text-neutral-400\">{subtitle}</div>\n                  </div>\n                </div>\n\n                <button\n                  type=\"button\"\n                  aria-label=\"Collapse dynamic island\"\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setMode(\"compact\");\n                  }}\n                  className=\"flex h-7 w-7 items-center justify-center rounded-full bg-white/10 text-neutral-300 transition-colors hover:bg-white hover:text-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white\"\n                >\n                  <X className=\"h-3.5 w-3.5\" />\n                </button>\n              </div>\n\n              <div className=\"flex items-center justify-between rounded-2xl bg-white/5 px-3.5 py-2.5 font-mono text-[11px]\">\n                <span className=\"inline-flex items-center gap-1.5 text-neutral-300\">\n                  <CheckCircle2 className=\"h-3.5 w-3.5 text-white\" />\n                  SEO Audit: 100/100\n                </span>\n                <button\n                  type=\"button\"\n                  onClick={(e) => {\n                    e.stopPropagation();\n                    setMode(\"compact\");\n                  }}\n                  className=\"rounded-lg bg-white px-2.5 py-1 text-[10px] font-bold text-black transition-opacity hover:opacity-90\"\n                >\n                  Dismiss\n                </button>\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </motion.div>\n\n      {/* Mode Switcher Controls */}\n      <div className=\"flex items-center gap-1.5\">\n        {([\"compact\", \"telemetry\", \"expanded\"] as IslandMode[]).map((m) => (\n          <button\n            key={m}\n            type=\"button\"\n            onClick={() => setMode(m)}\n            className={cn(\n              \"rounded-full border px-2.5 py-1 font-mono text-[10px] uppercase transition-colors\",\n              mode === m\n                ? \"border-black bg-black text-white dark:border-white dark:bg-white dark:text-black\"\n                : \"border-neutral-200 bg-transparent text-neutral-500 hover:border-neutral-400 dark:border-[#222222]\"\n            )}\n          >\n            {m}\n          </button>\n        ))}\n      </div>\n    </div>\n  );\n}\n\nexport default DynamicIslandToast;\n",
      "type": "registry:ui",
      "target": "components/ui/dynamic-island-toast.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"
    }
  ]
}
