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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
//! Styling system for list components.
//!
//! This module provides comprehensive styling options for list components, including
//! styles for different UI elements and visual states. The styling system is built
//! on top of lipgloss and provides sensible defaults for terminal applications.
//!
//! ## Style Categories
//!
//! - **Title and Header**: Styles for list titles and column headers
//! - **Status and Filter**: Styles for status bar and filter prompt
//! - **Pagination**: Styles for pagination indicators and navigation
//! - **Visual Elements**: Styles for spinners, dots, and separators
//!
//! ## Constants
//!
//! - `BULLET`: Unicode bullet character (`•`) used in pagination
//! - `ELLIPSIS`: Unicode ellipsis character (`…`) for truncated content
//!
//! ## Color Scheme
//!
//! The default styles use a dark theme with:
//! - Bright colors for active/selected elements
//! - Subdued colors for secondary information
//! - High contrast for readability
//!
//! ## Adaptive Colors
//!
//! All default styles use `AdaptiveColor` which automatically adjusts to the
//! terminal's light or dark theme, ensuring optimal readability and visual
//! consistency across different environments.
//!
//! ## Example
//!
//! ```rust
//! use bubbletea_widgets::list::style::{ListStyles, BULLET, ELLIPSIS};
//! use lipgloss_extras::prelude::*;
//!
//! // Use default adaptive styles
//! let mut styles = ListStyles::default();
//!
//! // Customize specific elements with adaptive colors
//! styles.title = Style::new()
//! .foreground(AdaptiveColor { Light: "#1a1a1a", Dark: "#ffffff" })
//! .bold(true);
//!
//! // Use the constants for consistent symbols
//! println!("Pagination: {}", BULLET);
//! println!("Truncated: item1, item2{}", ELLIPSIS);
//! ```
use *;
/// Unicode bullet character (•) used in pagination indicators and visual separators.
///
/// This constant provides a consistent bullet symbol for pagination dots, dividers,
/// and other list UI elements. The bullet character is automatically styled by
/// the respective style configurations in `ListStyles`.
///
/// # Usage
///
/// The bullet is automatically used by default in:
/// - Active and inactive pagination dots
/// - Divider elements between UI sections
/// - Visual separation in status displays
///
/// # Examples
///
/// ```rust
/// use bubbletea_widgets::list::style::BULLET;
///
/// // Display pagination indicator
/// println!("Page 1 {} 2 {} 3", BULLET, BULLET);
///
/// // Create divider text
/// let divider = format!(" {} ", BULLET);
/// assert_eq!(divider, " • ");
/// ```
pub const BULLET: &str = "•";
/// Unicode ellipsis character (…) used for truncated content display.
///
/// This constant provides a consistent ellipsis symbol for indicating truncated
/// text in list items, headers, and other UI elements when content exceeds the
/// available display width.
///
/// # Usage
///
/// The ellipsis is commonly used for:
/// - Truncating long item titles or descriptions
/// - Indicating overflow in fixed-width displays
/// - Showing partial content in constrained layouts
///
/// # Examples
///
/// ```rust
/// use bubbletea_widgets::list::style::ELLIPSIS;
///
/// // Simulate text truncation
/// let long_text = "This is a very long text that needs truncation";
/// let max_width = 20;
///
/// let truncated = if long_text.len() > max_width {
/// format!("{}{}", &long_text[..max_width-1], ELLIPSIS)
/// } else {
/// long_text.to_string()
/// };
///
/// println!("{}", truncated); // "This is a very lon…"
/// ```
pub const ELLIPSIS: &str = "…";
/// Comprehensive styling configuration for all list component UI elements.
///
/// This struct contains styling definitions for every visual element in a list
/// component, from the title bar and items to pagination and help text. All
/// styles use adaptive colors that automatically adjust to the terminal's
/// light or dark theme.
///
/// # Style Categories
///
/// The styles are organized into logical categories:
///
/// ## Header and Title
/// - `title_bar`: Container for the list title
/// - `title`: The list title text styling
///
/// ## Filtering and Input
/// - `filter_prompt`: The "Filter:" prompt text
/// - `filter_cursor`: Cursor/caret in filter input
/// - `default_filter_character_match`: Character-level match highlighting
///
/// ## Status and Information
/// - `status_bar`: Main status bar container
/// - `status_empty`: Status when list is empty
/// - `status_bar_active_filter`: Active filter indicator
/// - `status_bar_filter_count`: Filter result count
/// - `no_items`: "No items" message
///
/// ## Pagination and Navigation
/// - `pagination_style`: Pagination area container
/// - `active_pagination_dot`: Current page indicator (•)
/// - `inactive_pagination_dot`: Other page indicators (•)
/// - `arabic_pagination`: Numeric pagination (1, 2, 3...)
/// - `divider_dot`: Separator between elements ( • )
///
/// ## Interactive Elements
/// - `spinner`: Loading/processing indicator
/// - `help_style`: Help text area
///
/// # Adaptive Color System
///
/// All default styles use `AdaptiveColor` which provides different colors
/// for light and dark terminal themes:
/// - **Light themes**: Darker text on light backgrounds
/// - **Dark themes**: Lighter text on dark backgrounds
///
/// # Examples
///
/// ```rust
/// use bubbletea_widgets::list::style::ListStyles;
/// use lipgloss_extras::prelude::*;
///
/// // Start with default adaptive styles
/// let mut styles = ListStyles::default();
///
/// // Customize title with branded colors
/// styles.title = Style::new()
/// .background(Color::from("#7D56F4"))
/// .foreground(Color::from("#FFFFFF"))
/// .bold(true)
/// .padding(0, 1, 0, 1);
///
/// // Make filter prompt more prominent
/// styles.filter_prompt = Style::new()
/// .foreground(AdaptiveColor { Light: "#059669", Dark: "#10B981" })
/// .bold(true);
///
/// // Use subtle pagination
/// styles.pagination_style = Style::new()
/// .foreground(AdaptiveColor { Light: "#9CA3AF", Dark: "#6B7280" })
/// .padding_left(2);
/// ```
///
/// # Integration
///
/// This struct is typically used with `Model` to configure the entire
/// list appearance:
///
/// ```rust
/// use bubbletea_widgets::list::{Model, DefaultItem, DefaultDelegate, style::ListStyles};
///
/// let items = vec![DefaultItem::new("Item 1", "Description 1")];
/// let delegate = DefaultDelegate::new();
/// let list: Model<DefaultItem> = Model::new(items, delegate, 80, 24);
///
/// // Custom styles can be created and configured
/// let mut custom_styles = ListStyles::default();
/// custom_styles.title = custom_styles.title.bold(true);
/// // Note: Styles would be applied through constructor or builder pattern
/// ```