bubbles/lib.rs
1#![forbid(unsafe_code)]
2// Allow pedantic lints for early-stage API ergonomics.
3#![allow(clippy::doc_markdown)]
4#![allow(clippy::missing_fields_in_debug)]
5#![allow(clippy::nursery)]
6#![allow(clippy::pedantic)]
7#![allow(clippy::suspicious_operation_groupings)]
8
9//! # Bubbles
10//!
11//! A collection of reusable TUI components for the Bubbletea framework.
12//!
13//! Bubbles provides ready-to-use components including:
14//! - **cursor** - Text cursor with blinking support
15//! - **spinner** - Animated loading indicators with multiple styles
16//! - **timer** - Countdown timer with timeout notifications
17//! - **stopwatch** - Elapsed time tracking
18//! - **paginator** - Pagination for lists and tables
19//! - **progress** - Progress bar with gradient and animation support
20//! - **viewport** - Scrollable content viewport
21//! - **help** - Help view for displaying key bindings
22//! - **key** - Key binding definitions and matching
23//! - **runeutil** - Input sanitization utilities
24//! - **textinput** - Single-line text input with suggestions
25//! - **textarea** - Multi-line text editor
26//! - **table** - Data table with keyboard navigation
27//! - **list** - Feature-rich filterable list
28//! - **filepicker** - File system browser
29//!
30//! ## Role in `charmed_rust`
31//!
32//! Bubbles is the component layer that sits on top of bubbletea and lipgloss:
33//! - **bubbletea** provides the runtime and message loop.
34//! - **lipgloss** provides styling used by every component.
35//! - **huh** and **glow** embed bubbles components directly.
36//! - **demo_showcase** uses bubbles to demonstrate real-world UI composition.
37//!
38//! ## Example
39//!
40//! ```rust,ignore
41//! use bubbles::spinner::{SpinnerModel, spinners};
42//!
43//! let spinner = SpinnerModel::with_spinner(spinners::dot());
44//! let tick_msg = spinner.tick();
45//! ```
46
47pub mod cursor;
48pub mod help;
49pub mod key;
50pub mod paginator;
51pub mod progress;
52pub mod runeutil;
53pub mod spinner;
54pub mod stopwatch;
55pub mod textarea;
56pub mod textinput;
57pub mod timer;
58pub mod viewport;
59
60// Complex components
61pub mod filepicker;
62pub mod list;
63pub mod table;
64
65/// Prelude module for convenient imports.
66pub mod prelude {
67 pub use crate::cursor::{Cursor, Mode as CursorMode, blink_cmd};
68 pub use crate::help::Help;
69 pub use crate::key::{Binding, Help as KeyHelp, matches};
70 pub use crate::paginator::{Paginator, Type as PaginatorType};
71 pub use crate::progress::Progress;
72 pub use crate::runeutil::Sanitizer;
73 pub use crate::spinner::{Spinner, SpinnerModel, spinners};
74 pub use crate::stopwatch::Stopwatch;
75 pub use crate::textarea::TextArea;
76 pub use crate::textinput::TextInput;
77 pub use crate::timer::Timer;
78 pub use crate::viewport::Viewport;
79
80 // Complex components
81 pub use crate::filepicker::{DirEntry, FilePicker, ReadDirErrMsg, ReadDirMsg};
82 pub use crate::list::{DefaultDelegate, FilterState, Item, ItemDelegate, List};
83 pub use crate::table::{Column, Row, Table};
84}