{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-input-004",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "path": "src/components/watermelon-ui/ai-input-004.tsx",
      "content": "import React, { useState, useRef, useEffect } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { Plus, Mic, ArrowUp } from \"lucide-react\";\n\ntype AppState = \"IDLE\" | \"GENERATING\" | \"RESULT\";\n\ninterface AiInputProps {\n  onSend: (text: string) => void | Promise<void>;\n  placeholder?: string;\n  disabled?: boolean;\n  appState?: AppState;\n}\n\nexport const AiInput004: React.FC<AiInputProps> = ({\n  onSend,\n  placeholder = \"Ask anything...\",\n  disabled = false,\n  appState = \"IDLE\",\n}) => {\n  const [value, setValue] = useState(\"\");\n  const textareaRef = useRef<HTMLTextAreaElement>(null);\n  const hasContent = value.trim().length > 0;\n\n  useEffect(() => {\n    if (textareaRef.current) {\n      textareaRef.current.style.height = \"auto\";\n      textareaRef.current.style.height =\n        Math.min(textareaRef.current.scrollHeight, 200) + \"px\";\n    }\n  }, [value]);\n\n  const handleSubmit = async () => {\n    if (!value.trim() || disabled) return;\n    const text = value.trim();\n    setValue(\"\");\n    await onSend(text);\n  };\n\n  return (\n    <div className=\"relative flex h-screen w-full items-center justify-center overflow-hidden bg-[#fdf2f8]\">\n      <div className=\"absolute inset-0 z-0\">\n        <motion.div\n          className=\"absolute top-[-10%] left-[-10%] h-[70%] w-[70%] rounded-full bg-blue-200/50 blur-[120px]\"\n          animate={{\n            x: [0, 50, 0],\n            y: [0, 30, 0],\n            scale: [1, 1.1, 1],\n          }}\n          transition={{ duration: 15, repeat: Infinity, ease: \"easeInOut\" }}\n        />\n\n        <motion.div\n          className=\"absolute right-[-10%] bottom-[-10%] h-[60%] w-[60%] rounded-full bg-purple-200/50 blur-[120px]\"\n          animate={{\n            x: [0, -40, 0],\n            y: [0, -60, 0],\n            scale: [1, 1.2, 1],\n          }}\n          transition={{ duration: 20, repeat: Infinity, ease: \"easeInOut\" }}\n        />\n\n        <motion.div\n          className=\"absolute top-[20%] right-[10%] h-[40%] w-[40%] rounded-full bg-pink-100/40 blur-[100px]\"\n          animate={{\n            x: [0, -20, 0],\n            y: [0, 40, 0],\n          }}\n          transition={{ duration: 12, repeat: Infinity, ease: \"easeInOut\" }}\n        />\n      </div>\n\n      {/* --- GENERATING TEXT EFFECT --- */}\n      <AnimatePresence mode=\"wait\">\n        {appState === \"GENERATING\" && (\n          <motion.div\n            key=\"generating-text\"\n            initial={{ opacity: 0, scale: 0.98 }}\n            animate={{ opacity: 1, scale: 1 }}\n            exit={{ opacity: 0 }}\n            transition={{\n              y: { type: \"spring\", stiffness: 300, damping: 30 },\n              opacity: { duration: 0.3 },\n            }}\n            className=\"absolute z-20 px-4 text-center text-lg font-normal tracking-tight text-neutral-400/80 md:text-[22px]\"\n          >\n            <motion.span\n              style={{\n                backgroundImage:\n                  \"linear-gradient(90deg, #9ca3af 0%, #9ca3af 40%, #ffffff 50%, #9ca3af 60%, #9ca3af 100%)\",\n                backgroundSize: \"200% 100%\",\n                WebkitBackgroundClip: \"text\",\n                WebkitTextFillColor: \"transparent\",\n              }}\n              animate={{ backgroundPositionX: [\"100%\", \"-100%\"] }}\n              transition={{\n                duration: 2.5,\n                repeat: Infinity,\n                ease: \"linear\",\n              }}\n            >\n              Generating Your{\" \"}\n              <span className=\"font-semibold text-neutral-500/50\">\n                $Billion Dollar\n              </span>{\" \"}\n              saas...\n            </motion.span>\n          </motion.div>\n        )}\n      </AnimatePresence>\n\n      <AnimatePresence>\n        {(appState === \"IDLE\" || appState === \"RESULT\") && (\n          <motion.div\n            layout\n            initial={{ opacity: 0, y: 10 }}\n            animate={{\n              opacity: 1,\n              y: 0,\n              borderRadius: 28,\n              padding: \"8px 12px\",\n            }}\n            exit={{ opacity: 0, y: -20, transition: { duration: 0.2 } }}\n            className=\"relative z-10 w-full max-w-[calc(100vw-32px)] border border-white/40 bg-white/80 shadow-[0_10px_40px_rgba(0,0,0,0.04)] backdrop-blur-xl md:w-[440px]\"\n          >\n            <div className=\"flex w-full items-center gap-2\">\n              <Plus className=\"h-5 w-5 cursor-pointer text-neutral-400 transition-colors hover:text-neutral-600\" />\n\n              <textarea\n                ref={textareaRef}\n                value={value}\n                onChange={(e) => setValue(e.target.value)}\n                onKeyDown={(e) => {\n                  if (e.key === \"Enter\" && !e.shiftKey) {\n                    e.preventDefault();\n                    handleSubmit();\n                  }\n                }}\n                placeholder={placeholder}\n                rows={1}\n                className=\"min-h-[40px] flex-1 resize-none bg-transparent py-2 text-[16px] text-neutral-800 placeholder-neutral-400 outline-none\"\n              />\n\n              <div className=\"flex items-center gap-3\">\n                <Mic className=\"h-5 w-5 cursor-pointer text-neutral-400 hover:text-neutral-600\" />\n                <button\n                  onClick={handleSubmit}\n                  className={`flex h-9 w-9 items-center justify-center rounded-full text-white transition-all duration-200 ${\n                    hasContent ? \"bg-black\" : \"bg-black/20\"\n                  }`}\n                >\n                  <ArrowUp className=\"h-5 w-5\" />\n                </button>\n              </div>\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n};\n",
      "type": "registry:ui",
      "target": "components/ui/ai-input-004.tsx"
    }
  ],
  "type": "registry:ui"
}
