{
  "$schema": "https://www.cooki-ui.design/schema/registry-item.json",
  "name": "ai-loading-state",
  "type": "registry:ui",
  "title": "AI Loading State",
  "description": "Multi-pattern autonomous AI reasoning and thought synthesis status indicators with live elapsed timer and dynamic theme presets.",
  "category": "ai",
  "dependencies": [
    "framer-motion",
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/ai/ai-loading-state/ai-loading-state.tsx",
      "type": "registry:ui",
      "target": "components/ui/ai-loading-state.tsx",
      "content": "\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { motion } from \"framer-motion\";\nimport { Loader2, Cpu, Atom } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AiLoadingVariant =\n  | \"PulseBeam\"\n  | \"GooeyPulse\"\n  | \"QuantumWave\"\n  | \"CyberCore\"\n  | \"GlowingRings\"\n  | \"DotPulse\"\n  | \"MatrixSpinner\";\n\nexport interface AiLoadingStateProps {\n  /** Primary status label text */\n  label?: string;\n  /** Active loader animation pattern variant */\n  variant?: AiLoadingVariant;\n  /** Size variant */\n  size?: \"sm\" | \"md\" | \"lg\";\n  /** Visual theme variant */\n  theme?: \"default\" | \"glass\" | \"minimal\" | \"dark\";\n  /** Show live elapsed timer in mono figures */\n  showTimer?: boolean;\n  /** Custom container class names */\n  className?: string;\n}\n\n// Custom hook for live tabular elapsed timer\nfunction useElapsed(enabled: boolean = true) {\n  const [ds, setDs] = useState(0);\n\n  useEffect(() => {\n    if (!enabled) return;\n    const t = setInterval(() => setDs((d) => d + 1), 100);\n    return () => clearInterval(t);\n  }, [enabled]);\n\n  const total = ds / 10;\n  if (total < 60) return `${total.toFixed(1)}s`;\n  return `${Math.floor(total / 60)}m ${(total % 60).toFixed(1)}s`;\n}\n\nexport const AiLoadingState: React.FC<AiLoadingStateProps> = ({\n  label = \"Thinking...\",\n  variant = \"PulseBeam\",\n  size = \"md\",\n  theme = \"default\",\n  showTimer = true,\n  className,\n}) => {\n  const elapsed = useElapsed(showTimer);\n\n  // Size styles\n  const sizeClasses = {\n    sm: \"px-3 py-1.5 text-xs gap-2.5 rounded-xl\",\n    md: \"px-4 py-2.5 text-xs sm:text-sm gap-3 rounded-2xl\",\n    lg: \"px-5 py-3.5 text-sm sm:text-base gap-4 rounded-3xl\",\n  };\n\n  // Theme container styles ensuring perfect contrast in all light/dark contexts\n  const themeClasses = {\n    default:\n      \"bg-zinc-100/90 dark:bg-zinc-900/90 border border-zinc-200/80 dark:border-zinc-800/80 text-zinc-900 dark:text-zinc-100 shadow-xs\",\n    glass:\n      \"bg-white/80 dark:bg-zinc-900/80 backdrop-blur-xl border border-zinc-200/60 dark:border-zinc-800/60 text-zinc-900 dark:text-zinc-100 shadow-md\",\n    minimal:\n      \"bg-transparent border border-zinc-200/60 dark:border-zinc-800/60 text-zinc-900 dark:text-zinc-100\",\n    dark: \"bg-zinc-950 border border-zinc-800 text-zinc-100 shadow-md\",\n  };\n\n  // ── Render Monochromatic Modern AI Loader Variants ──────────────────────\n  const renderLoaderPattern = () => {\n    switch (variant) {\n      case \"PulseBeam\":\n        return (\n          <div className=\"relative flex items-center justify-center shrink-0 h-5 w-5\">\n            <motion.div\n              className=\"absolute inset-0 rounded-full border border-current opacity-30 border-t-current opacity-100\"\n              animate={{ rotate: 360 }}\n              transition={{ duration: 0.9, repeat: Infinity, ease: \"linear\" }}\n            />\n            <motion.span\n              className=\"w-1.5 h-1.5 rounded-full bg-current\"\n              animate={{ scale: [0.8, 1.3, 0.8], opacity: [0.4, 1, 0.4] }}\n              transition={{ duration: 0.8, repeat: Infinity, ease: \"easeInOut\" }}\n            />\n          </div>\n        );\n\n      case \"GooeyPulse\":\n        return (\n          <div className=\"flex items-center gap-1.5 shrink-0\">\n            {[0, 0.2, 0.4].map((delay, idx) => (\n              <motion.span\n                key={idx}\n                className=\"h-2 w-2 rounded-full bg-current\"\n                animate={{ scale: [0.75, 1.25, 0.75], opacity: [0.35, 1, 0.35] }}\n                transition={{ duration: 0.8, repeat: Infinity, delay }}\n              />\n            ))}\n          </div>\n        );\n\n      case \"QuantumWave\":\n        return (\n          <div className=\"flex items-center gap-1 h-4 shrink-0\">\n            {[0.1, 0.3, 0.5, 0.2, 0.4].map((delay, idx) => (\n              <motion.span\n                key={idx}\n                className=\"w-1 rounded-full bg-current\"\n                animate={{ height: [\"4px\", \"16px\", \"4px\"] }}\n                transition={{ duration: 0.6, repeat: Infinity, delay }}\n              />\n            ))}\n          </div>\n        );\n\n      case \"CyberCore\":\n        return (\n          <div className=\"relative flex items-center justify-center shrink-0 h-5 w-5\">\n            <motion.div\n              className=\"absolute inset-0 rounded-md border border-current opacity-40\"\n              animate={{ rotate: 180, scale: [1, 1.1, 1] }}\n              transition={{ duration: 1.4, repeat: Infinity, ease: \"easeInOut\" }}\n            />\n            <Cpu className=\"h-3 w-3 text-current\" />\n          </div>\n        );\n\n      case \"GlowingRings\":\n        return (\n          <div className=\"relative flex items-center justify-center shrink-0 h-5 w-5\">\n            <motion.div\n              className=\"absolute inset-0 rounded-full border-2 border-transparent border-t-current border-b-current opacity-40\"\n              animate={{ rotate: 360 }}\n              transition={{ duration: 0.85, repeat: Infinity, ease: \"linear\" }}\n            />\n            <Atom className=\"h-3 w-3 text-current\" />\n          </div>\n        );\n\n      case \"DotPulse\":\n        return (\n          <div className=\"flex items-center gap-1 shrink-0\">\n            {[0, 0.15, 0.3].map((delay, idx) => (\n              <motion.span\n                key={idx}\n                className=\"h-2 w-2 rounded-full bg-current\"\n                animate={{ y: [\"0px\", \"-5px\", \"0px\"] }}\n                transition={{ duration: 0.6, repeat: Infinity, delay }}\n              />\n            ))}\n          </div>\n        );\n\n      case \"MatrixSpinner\":\n      default:\n        return (\n          <div className=\"relative flex items-center justify-center shrink-0 h-5 w-5\">\n            <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-current\" />\n          </div>\n        );\n    }\n  };\n\n  return (\n    <div\n      className={cn(\n        \"inline-flex items-center select-none transition-all duration-300 font-sans w-fit\",\n        sizeClasses[size],\n        themeClasses[theme],\n        className\n      )}\n    >\n      {/* Loader Pattern */}\n      {renderLoaderPattern()}\n\n      {/* Status Text Label */}\n      {label && (\n        <span className=\"font-semibold text-current tracking-tight leading-none\">\n          {label}\n        </span>\n      )}\n\n      {/* Live Mono Tabular Timer */}\n      {showTimer && (\n        <span className=\"font-mono text-[11px] text-muted-foreground tabular-nums ml-1 font-medium\">\n          {elapsed}\n        </span>\n      )}\n    </div>\n  );\n};\n\nexport default AiLoadingState;\n"
    }
  ]
}