UNPKG

tuix

Version:

A performant TUI framework for Bun with JSX and reactive state management

46 lines (35 loc) 1.39 kB
# Legacy TextInput Implementations This folder contains the previous TextInput implementations that have been consolidated into the main `TextInput.ts` file. ## Migration Complete The following files have been consolidated: - **TextInput-clean.ts** - Cleaner rendering implementation (merged into main) - **TextInputBindable.ts** - Basic bindable support (functionality merged) - **TextInputWithRunes.ts** - Full rune support (functionality merged) ## New Unified TextInput The new `src/components/TextInput.ts` now provides: - ✅ Traditional model/update pattern support - ✅ Clean rendering without color bleeding - ✅ Full cursor control with blinking support - ✅ Svelte-inspired $bindable rune integration - ✅ Callbacks (onValueChange, onFocus, onBlur) - ✅ All factory functions (textInput, emailInput, passwordInput, numberInput) - ✅ JSX component support ## Usage Examples ### Traditional Usage ```typescript const input = textInput({ placeholder: "Enter text..." }) ``` ### With Runes ```typescript const name = $bindable('') const input = textInput({ 'bind:value': name, onValueChange: (v) => console.log('Changed:', v) }) ``` ### JSX Usage ```tsx <TextInput bind:value={name} placeholder="Enter name..." /> ``` ## Deprecated These legacy implementations should not be used in new code. They remain here temporarily for reference during the migration period.