minui 0.2.1

A minimalist Rust framework for TUIs and terminal games.
Documentation
//! # Input Widgets
//!
//! A comprehensive collection of interactive input widgets for building rich terminal-based
//! user interfaces. This module provides a complete set of form controls and input fields
//! that handle user interaction, validation, and data entry with sophisticated features
//! like cursor management, text selection, and clipboard integration.
//!
//! ## Features (Planned)
//!
//! - **Comprehensive input types**: Text, password, numeric, and selection widgets
//! - **Advanced validation**: Built-in validators with custom validation support
//! - **Rich text editing**: Cursor management, selection, and clipboard operations
//! - **Visual feedback**: Placeholder text, error highlighting, and status indicators
//! - **Flexible formatting**: Input masking for structured data entry
//! - **Keyboard navigation**: Full keyboard accessibility and shortcuts
//! - **Event handling**: Comprehensive input event processing
//! - **Container integration**: Seamless layout within MinUI's container system
//!
//! ## Widget Types
//!
//! ### TextInput
//! Single-line text input field for general text entry. Supports placeholder text,
//! validation, maximum length limits, and various text formatting options.
//! Perfect for names, addresses, and general string input.
//!
//! ### MultilineInput
//! Multi-line text area widget for longer text content. Features line wrapping,
//! scrolling, and advanced text editing capabilities including line navigation
//! and block selection. Ideal for comments, descriptions, and document editing.
//!
//! ### PasswordInput
//! Secure password input field with character masking. Displays asterisks or
//! dots instead of actual characters while maintaining full editing capabilities.
//! Includes password strength indicators and secure clipboard handling.
//!
//! ### NumberInput
//! Specialized input widget for numeric data with built-in validation and
//! formatting. Supports integers, decimals, ranges, and step values.
//! Includes increment/decrement controls and automatic value validation.
//!
//! ### SelectInput
//! Dropdown selection widget presenting a list of choices. Features keyboard
//! navigation, search functionality, and custom option rendering.
//! Perfect for categories, statuses, and predefined value selection.
//!
//! ### CheckboxInput
//! Boolean input widget for yes/no, on/off, or enabled/disabled states.
//! Provides clear visual indicators and supports tri-state logic for
//! intermediate or indeterminate values.
//!
//! ### RadioGroup
//! Single-selection widget from multiple exclusive options. Groups related
//! radio buttons together with automatic selection management and clear
//! visual grouping. Ideal for mutually exclusive choices.
//!
//! ## Visual Structure
//!
//! ```text
//! Text Input:
//! ┌─────────────────────────────┐
//! │ Enter your name here...     │  ← Placeholder or content
//! └─────────────────────────────┘
//!
//! Select Input:
//! ┌─────────────────────┐
//! │ Selected Option ▼   │
//! └─────────────────────┘
//!
//! Checkbox:
//! ☐ Unchecked option
//! ☑ Checked option
//!
//! Radio Group:
//! ○ Option 1
//! ● Option 2 (selected)
//! ○ Option 3
//! ```
//!
//! ## Basic Usage
//!
//! ```rust,ignore
//! use minui::{TextInput, PasswordInput, CheckboxInput, Container};
//!
//! // Simple text input with validation
//! let name_input = TextInput::new(30)
//!     .with_placeholder("Enter your name...")
//!     .with_validator(|text| !text.trim().is_empty())
//!     .with_max_length(50);
//!
//! // Password input with strength indicator
//! let password_input = PasswordInput::new(30)
//!     .with_placeholder("Password")
//!     .with_strength_indicator(true)
//!     .with_min_length(8);
//!
//! // Simple checkbox
//! let agree_checkbox = CheckboxInput::new("I agree to the terms and conditions");
//! ```
//!
//! ## Advanced Form Creation
//!
//! ```rust,ignore
//! use minui::{Container, Label, TextInput, SelectInput, NumberInput, LayoutDirection};
//!
//! // Create a complete user registration form
//! let registration_form = Container::vertical()
//!     .add_child(Label::new("User Registration"))
//!     .add_child(
//!         Container::horizontal()
//!             .add_child(Label::new("Name:"))
//!             .add_child(TextInput::new(25).with_required(true))
//!     )
//!     .add_child(
//!         Container::horizontal()
//!             .add_child(Label::new("Age:"))
//!             .add_child(NumberInput::new(5).with_range(13, 120))
//!     )
//!     .add_child(
//!         Container::horizontal()
//!             .add_child(Label::new("Country:"))
//!             .add_child(SelectInput::new(20).with_options([
//!                 "United States", "Canada", "United Kingdom", "Other"
//!             ]))
//!     );
//! ```
//!
//! ## Input Validation
//!
//! ```rust,ignore
//! use minui::{TextInput, ValidationRule, Color};
//!
//! // Email input with custom validation
//! let email_input = TextInput::new(40)
//!     .with_placeholder("email@example.com")
//!     .with_validator(ValidationRule::email())
//!     .with_error_color(Color::Red.into())
//!     .with_success_color(Color::Green.into());
//!
//! // Phone number with input masking
//! let phone_input = TextInput::new(15)
//!     .with_mask("(###) ###-####")
//!     .with_placeholder("(555) 123-4567");
//! ```
//!
//! ## Event Handling
//!
//! ```rust,ignore
//! use minui::{Event, KeyCode};
//!
//! // Comprehensive input event handling
//! match event {
//!     Event::Character(c) => input.type_char(c),
//!     Event::Key(KeyCode::Backspace) => input.delete_char(),
//!     Event::Key(KeyCode::Delete) => input.delete_forward(),
//!     Event::Key(KeyCode::Left) => input.move_cursor_left(),
//!     Event::Key(KeyCode::Right) => input.move_cursor_right(),
//!     Event::Key(KeyCode::Home) => input.move_cursor_home(),
//!     Event::Key(KeyCode::End) => input.move_cursor_end(),
//!     Event::Key(KeyCode::Enter) => {
//!         if input.validate() {
//!             // Process valid input
//!             handle_input(input.text());
//!         }
//!     },
//!     _ => {}
//! }
//! ```
//!
//! Input widgets provide the foundation for interactive terminal applications,
//! enabling sophisticated data entry and user interaction with full validation
//! and accessibility support.
//!
//! ## Implementation Status
//!
//! Input widgets are not yet implemented. The current focus is on basic widgets
//! and core functionality. Input widgets will be added in a future release.

// TODO: Implement input field widgets
// These will likely be built as container components with text handling