1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
//! Lipgloss - Terminal styling made simple and delightful
//!
//! Lipgloss is a Rust port of the popular Go library for styling terminal layouts
//! and building Terminal User Interfaces (TUIs). It provides a comprehensive set of
//! tools for creating beautiful, styled terminal output with support for colors,
//! borders, alignment, positioning, and complex layout management.
//!
//! # Features
//!
//! - **Rich styling**: Colors (ANSI 16, 256, and true color), bold, italic, underline, strikethrough
//! - **Flexible layouts**: Horizontal and vertical joining, precise positioning
//! - **Border system**: Multiple built-in border styles with customization options
//! - **Color profiles**: Automatic adaptation to terminal capabilities
//! - **Unicode support**: Proper handling of wide characters and emojis
//! - **Composable design**: Chain styles and combine multiple elements seamlessly
//!
//! # Quick Start
//!
//! ```rust
//! use lipgloss::{Style, Color, rounded_border};
//!
//! // Create a styled text block
//! let style = Style::new()
//! .foreground(Color("205".to_string()))
//! .background(Color("235".to_string()))
//! .padding(1, 2, 1, 2)
//! .border(rounded_border())
//! .border_foreground(Color("63".to_string()));
//!
//! let rendered = style.render("Hello, Lipgloss!");
//! println!("{}", rendered);
//! ```
//!
//! # Theme-Aware Color Best Practices
//!
//! For applications that work across different terminal themes (light and dark),
//! use the pre-defined [`color`] constants instead of hardcoded colors:
//!
//! ```rust
//! use lipgloss::{Style, color::{TEXT_PRIMARY, ACCENT_PRIMARY, STATUS_SUCCESS}};
//!
//! // ✅ Theme-aware (adapts to light/dark backgrounds)
//! let good_style = Style::new()
//! .foreground(TEXT_PRIMARY) // Readable in any theme
//! .border_foreground(ACCENT_PRIMARY); // Consistent brand color
//!
//! // ❌ Hardcoded (breaks in some themes)
//! let bad_style = Style::new()
//! .foreground("#000000".to_string()) // Invisible on dark backgrounds!
//! .border_foreground("#ff0000".to_string()); // Harsh red everywhere
//!
//! // Status indicators with semantic colors
//! let success_msg = Style::new()
//! .foreground(STATUS_SUCCESS)
//! .render("✓ Task completed successfully");
//! ```
//!
//! **Available color constants for common UI patterns:**
//! - **Text**: `TEXT_PRIMARY`, `TEXT_MUTED`, `TEXT_SUBTLE`, `TEXT_HEADER`
//! - **Accents**: `ACCENT_PRIMARY`, `ACCENT_SECONDARY`, `INTERACTIVE`
//! - **Status**: `STATUS_SUCCESS`, `STATUS_WARNING`, `STATUS_ERROR`, `STATUS_INFO`
//! - **Surfaces**: `SURFACE_SUBTLE`, `SURFACE_ELEVATED`
//! - **Lists**: `LIST_ITEM_PRIMARY`, `LIST_ENUMERATOR`
//! - **Tables**: `TABLE_HEADER_TEXT`, `TABLE_ROW_TEXT`, `TABLE_BORDER`
//!
//! See the `theme-showcase` example for a comprehensive demonstration.
//!
//! # Core Modules
//!
//! - [`style`] - Core styling functionality and the main `Style` struct
//! - [`color`] - Color definitions and terminal color profile management
//! - [`mod@gradient`] - Color gradients and 2D color grids for advanced styling
//! - [`border`] - Border styles and customization
//! - [`mod@align`] - Text alignment utilities
//! - [`position`] - Positioning and placement functions
//! - [`join`] - Horizontal and vertical layout joining
//! - [`mod@size`] - Dimension measurement and calculation
//! - [`whitespace`] - Styled whitespace and filler generation
//! - [`renderer`] - Terminal rendering and color profile detection
//!
//! # Advanced Usage
//!
//! Complex layouts with multiple components:
//!
//! ```rust
//! use lipgloss::{Style, Color, join_horizontal, join_vertical, normal_border, CENTER, LEFT, TOP};
//!
//! let header = Style::new()
//! .align_horizontal(CENTER)
//! .foreground(Color("86".to_string()))
//! .render("Application Title");
//!
//! let left_panel = Style::new()
//! .width(30)
//! .padding(1, 2, 1, 2)
//! .border(normal_border())
//! .render("Left content");
//!
//! let right_panel = Style::new()
//! .width(30)
//! .padding(1, 2, 1, 2)
//! .border(normal_border())
//! .render("Right content");
//!
//! let body = join_horizontal(TOP, &[&left_panel, &right_panel]);
//! let layout = join_vertical(LEFT, &[&header, &body]);
//!
//! println!("{}", layout);
//! ```
//!
//! This crate maintains API compatibility with the original Go implementation
//! while following Rust idioms and leveraging Rust's type system for safer
//! terminal styling.
// Constants for Go API compatibility
/// Special value for [`Style::tab_width`] to disable tab conversion entirely.
///
/// When passed to [`Style::tab_width`], this value instructs the renderer to leave
/// tab characters (`\t`) unchanged rather than converting them to spaces. This is
/// useful when you want to preserve the original tab characters in the output.
///
/// # Examples
///
/// ```rust
/// use lipgloss::{Style, NO_TAB_CONVERSION};
///
/// // Leave tabs intact (don't convert to spaces)
/// let style = Style::new().tab_width(NO_TAB_CONVERSION);
/// let text_with_tabs = "Column1\tColumn2\tColumn3";
/// let rendered = style.render(text_with_tabs);
/// // Output contains original tab characters
/// ```
///
/// # See Also
///
/// - [`Style::tab_width`] - Set tab width or disable conversion
pub const NO_TAB_CONVERSION: i32 = -1;
pub use *;
pub use ;
pub use *;
pub use *;
pub use ;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
// Avoid re-exporting all of utils to prevent name clashes with size (width/height).
// Re-export only the public helpers and API-parity items we want at the crate root.
pub use ;