{"_id":"@aireact/predictive-input","_rev":"4-117ffed3b9a2eb1caa35cb2ad6c8a1b6","name":"@aireact/predictive-input","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@aireact/predictive-input","version":"1.0.0","keywords":["react","predictive","autocomplete","ai","text"],"author":{"name":"reachbrt"},"license":"MIT","_id":"@aireact/predictive-input@1.0.0","maintainers":[{"name":"aivue","email":"reachbrt@gmail.com"}],"dist":{"shasum":"189ee6439c6be9f5bccb235986eb4efd49c63f4f","tarball":"https://registry.npmjs.org/@aireact/predictive-input/-/predictive-input-1.0.0.tgz","fileCount":10,"integrity":"sha512-dSCRC8krSFte+Rcrj3GD8ewOqWAqSRbesZFuMGZOW4abEZeKta4O0xCGFT8abAc1dwL0RvOo9dx5gtNxBgtJ4g==","signatures":[{"sig":"MEUCIEMem2hz5CF6uz4kpafZiv8wFyY43JOSJjubK4lapiRQAiEAvo4GAlcP2PMI9CmDOyFVdlWw60TYKNcxNdu1J5XBLIU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106052},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./dist/predictive-input.css":"./dist/predictive-input.css"},"gitHead":"3578555f09dd610edce51f84a4d6d27a6b2146bd","scripts":{"dev":"vite build --watch","build":"tsc && vite build"},"_npmUser":{"name":"aivue","email":"reachbrt@gmail.com"},"_npmVersion":"10.9.2","description":"AI predictive text completion for React","directories":{},"sideEffects":["*.css"],"_nodeVersion":"22.14.0","dependencies":{"@aireact/core":"*"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.10","typescript":"^5.3.3","@types/react":"^18.2.45","vite-plugin-dts":"^3.7.0","@types/react-dom":"^18.2.18","@vitejs/plugin-react":"^4.2.1"},"peerDependencies":{"react":"^18.0.0","react-dom":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/predictive-input_1.0.0_1765693705952_0.34969892187631957","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aireact/predictive-input","version":"1.0.1","keywords":["react","predictive","autocomplete","ai","text"],"author":{"name":"reachbrt"},"license":"MIT","_id":"@aireact/predictive-input@1.0.1","maintainers":[{"name":"aivue","email":"reachbrt@gmail.com"}],"dist":{"shasum":"538c9bcdb5a6d51c64d87f3e07cff9aec3fcbaaf","tarball":"https://registry.npmjs.org/@aireact/predictive-input/-/predictive-input-1.0.1.tgz","fileCount":11,"integrity":"sha512-T1dKBnUD++6Pljxd3xwGmP2MyfDQYdHy2xvh3C+aRppn1hqBrBhVwi90JBYukS5UWjZbm2HB05hV+MXkbr768Q==","signatures":[{"sig":"MEYCIQCmtOEeCrruvAyvi9g/8QQ9n0JCoXyzxA4uLiR25RaEvAIhAN9vmgLzZVbNSoNMzQYEs21jaa5fZzrLCbNa8ImvyiFS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109407},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./dist/predictive-input.css":"./dist/predictive-input.css"},"gitHead":"6857364eda430b8e9222514d3a5eeb6a5175c5b7","scripts":{"dev":"vite build --watch","build":"tsc && vite build"},"_npmUser":{"name":"aivue","email":"reachbrt@gmail.com"},"_npmVersion":"10.9.2","description":"AI predictive text completion for React","directories":{},"sideEffects":["*.css"],"_nodeVersion":"22.14.0","dependencies":{"@aireact/core":"*"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.10","typescript":"^5.3.3","@types/react":"^18.2.45","vite-plugin-dts":"^3.7.0","@types/react-dom":"^18.2.18","@vitejs/plugin-react":"^4.2.1"},"peerDependencies":{"react":"^18.0.0","react-dom":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/predictive-input_1.0.1_1765694989658_0.43133528874503857","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aireact/predictive-input","version":"1.0.2","keywords":["react","predictive","autocomplete","ai","text"],"author":{"name":"reachbrt"},"license":"MIT","_id":"@aireact/predictive-input@1.0.2","maintainers":[{"name":"aivue","email":"reachbrt@gmail.com"}],"dist":{"shasum":"34f1ceb36366a9f456015cab2de9259ad11c7545","tarball":"https://registry.npmjs.org/@aireact/predictive-input/-/predictive-input-1.0.2.tgz","fileCount":11,"integrity":"sha512-Fj636ZS5Zgx+qiNvkz8jzI3IAqk0hqMDJvQ8kJtW8FJKQ8CmkkbSsk2uo8quxuf532LzjKGYhpOIkTZEV/ZFdw==","signatures":[{"sig":"MEUCIByvNsm3RLGM3Ufrw5YxxjDZ8RQQXxojb4in+zdbgvv0AiEAnVPHHg3wRh2oQUeqLqA2ROf/iFlNOGdBoIfBBtpxyFA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109407},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./dist/predictive-input.css":"./dist/predictive-input.css"},"gitHead":"6857364eda430b8e9222514d3a5eeb6a5175c5b7","scripts":{"dev":"vite build --watch","build":"tsc && vite build"},"_npmUser":{"name":"aivue","email":"reachbrt@gmail.com"},"_npmVersion":"10.9.2","description":"AI predictive text completion for React","directories":{},"sideEffects":["*.css"],"_nodeVersion":"22.14.0","dependencies":{"@aireact/core":"*"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.10","typescript":"^5.3.3","@types/react":"^18.2.45","vite-plugin-dts":"^3.7.0","@types/react-dom":"^18.2.18","@vitejs/plugin-react":"^4.2.1"},"peerDependencies":{"react":"^18.0.0","react-dom":"^18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/predictive-input_1.0.2_1765696320846_0.8895626998429103","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aireact/predictive-input","version":"1.0.3","description":"AI predictive text completion for React","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./dist/predictive-input.css":"./dist/predictive-input.css"},"scripts":{"build":"tsc && vite build","dev":"vite build --watch"},"peerDependencies":{"react":"^18.0.0","react-dom":"^18.0.0"},"dependencies":{"@aireact/core":"*"},"devDependencies":{"@types/react":"^18.2.45","@types/react-dom":"^18.2.18","@vitejs/plugin-react":"^4.2.1","typescript":"^5.3.3","vite":"^5.0.10","vite-plugin-dts":"^3.7.0"},"keywords":["react","predictive","autocomplete","ai","text"],"author":{"name":"reachbrt"},"license":"MIT","sideEffects":["*.css"],"_id":"@aireact/predictive-input@1.0.3","gitHead":"eb0d57118209adc317afca9ec14db9074a14377b","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-pJGCmthHxh8+nXyl4KRnB7XlormbNNx6HnwTxtPWBZY4lG4znYXGIJRClu3Q4uUnlP+2g93RKSGS1zcHapZjNA==","shasum":"208741b92b64e1d42d31fbb1d8c66eba1fdf403a","tarball":"https://registry.npmjs.org/@aireact/predictive-input/-/predictive-input-1.0.3.tgz","fileCount":11,"unpackedSize":110317,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICfxvh+zdpRWRCOMWnxTtFt9XzBytMjjFdy6nCBxPP/9AiEA3iL90W6V59XFQsp50hOIKMJ1qxhiNc+7NwpJN3jz4Gg="}]},"_npmUser":{"name":"aivue","email":"reachbrt@gmail.com"},"directories":{},"maintainers":[{"name":"aivue","email":"reachbrt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/predictive-input_1.0.3_1766466261052_0.487648456197455"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-14T06:28:25.877Z","modified":"2025-12-23T05:04:21.728Z","1.0.0":"2025-12-14T06:28:26.123Z","1.0.1":"2025-12-14T06:49:49.796Z","1.0.2":"2025-12-14T07:12:00.997Z","1.0.3":"2025-12-23T05:04:21.190Z"},"author":{"name":"reachbrt"},"license":"MIT","keywords":["react","predictive","autocomplete","ai","text"],"description":"AI predictive text completion for React","maintainers":[{"name":"aivue","email":"reachbrt@gmail.com"}],"readme":"# @aireact/predictive-input\n\n🚀 **AI-Powered Predictive Text Input for React**\n\nIntelligent text prediction and completion powered by AI for enhanced typing experiences.\n\n<p>\n  <a href=\"https://www.npmjs.com/package/@aireact/predictive-input\"><img src=\"https://img.shields.io/npm/v/@aireact/predictive-input.svg?style=flat-square\" alt=\"npm version\"></a>\n  <a href=\"https://www.npmjs.com/package/@aireact/predictive-input\"><img src=\"https://img.shields.io/npm/dm/@aireact/predictive-input\" alt=\"npm downloads\"></a>\n  <a href=\"https://github.com/reachbrt/AIReact/blob/main/LICENSE\"><img src=\"https://img.shields.io/npm/l/@aireact/predictive-input.svg?style=flat-square\" alt=\"MIT License\"></a>\n  <a href=\"https://github.com/reachbrt/AIReact\"><img src=\"https://img.shields.io/github/stars/reachbrt/AIReact?style=social\" alt=\"GitHub Stars\"></a>\n</p>\n\n## ✨ Features\n\n- **🧠 AI Predictions**: Smart text completion using AI\n- **⚡ Inline Suggestions**: Ghost text predictions as you type\n- **🎯 Context-Aware**: Understands context for better predictions\n- **⌨️ Tab to Accept**: Easy keyboard navigation\n- **🎨 Customizable**: Fully stylable components\n- **🔧 TypeScript**: Full TypeScript support\n\n## 📦 Installation\n\n```bash\nnpm install @aireact/predictive-input @aireact/core\n```\n\n## 🚀 Quick Start\n\n```tsx\nimport { PredictiveInput, usePredictiveText } from '@aireact/predictive-input';\nimport '@aireact/predictive-input/style.css';\n\nfunction App() {\n  return (\n    <PredictiveInput\n      provider=\"openai\"\n      apiKey={process.env.REACT_APP_OPENAI_API_KEY}\n      placeholder=\"Start typing...\"\n      context=\"email composition\"\n      onAccept={(text) => console.log('Accepted:', text)}\n    />\n  );\n}\n```\n\n### Using the Hook\n\n```tsx\nimport { usePredictiveText } from '@aireact/predictive-input';\n\nfunction CustomPredictive() {\n  const {\n    prediction,\n    isLoading,\n    getPrediction,\n    acceptPrediction,\n    clearPrediction\n  } = usePredictiveText({\n    provider: 'openai',\n    apiKey: process.env.REACT_APP_OPENAI_API_KEY,\n    context: 'professional email'\n  });\n\n  const [value, setValue] = useState('');\n\n  const handleChange = (e) => {\n    setValue(e.target.value);\n    getPrediction(e.target.value);\n  };\n\n  const handleKeyDown = (e) => {\n    if (e.key === 'Tab' && prediction) {\n      e.preventDefault();\n      setValue(value + prediction);\n      acceptPrediction();\n    }\n  };\n\n  return (\n    <div className=\"predictive-wrapper\">\n      <input\n        value={value}\n        onChange={handleChange}\n        onKeyDown={handleKeyDown}\n      />\n      {prediction && (\n        <span className=\"ghost-text\">{prediction}</span>\n      )}\n    </div>\n  );\n}\n```\n\n## 📖 Props\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `provider` | string | - | AI provider |\n| `apiKey` | string | - | API key |\n| `context` | string | - | Context for predictions |\n| `placeholder` | string | 'Type...' | Input placeholder |\n| `debounceMs` | number | 200 | Debounce delay |\n| `onAccept` | function | - | Accept callback |\n| `acceptKey` | string | 'Tab' | Key to accept |\n\n## 🎨 Customization\n\n```css\n:root {\n  --aireact-predict-ghost: #9e9e9e;\n  --aireact-predict-text: #333333;\n  --aireact-predict-bg: #ffffff;\n}\n```\n\n## 📦 Related Packages\n\n### React (@aireact)\n- [@aireact/core](https://www.npmjs.com/package/@aireact/core) - Core AI Client\n- [@aireact/autosuggest](https://www.npmjs.com/package/@aireact/autosuggest) - AI Suggestions\n- [@aireact/smartform](https://www.npmjs.com/package/@aireact/smartform) - Smart Forms\n\n### Vue.js (@aivue)\n- [@aivue/predictive-input](https://www.npmjs.com/package/@aivue/predictive-input) - Vue Predictive Input\n- [@aivue/core](https://www.npmjs.com/package/@aivue/core) - Vue Core AI Client\n\n### Angular (@aiangular) - Coming Soon\n- @aiangular/predictive-input - Angular Predictive Input\n\n## 🔗 More Information\n\n- [GitHub Repository](https://github.com/reachbrt/AIReact)\n- [Full Documentation](https://github.com/reachbrt/AIReact/wiki)\n- [Report Issues](https://github.com/reachbrt/AIReact/issues)\n\n## 📄 License\n\nMIT © [Bharatkumar Subramanian](https://github.com/reachbrt)\n\n","readmeFilename":"README.md"}