Skip to main content

bearask/
style.rs

1use owo_colors::{Style, colors::CustomColor};
2
3#[derive(Clone)]
4pub struct ConfirmStyle {
5    pub prompt: Style,
6    pub prompt_prefix: Style,
7    pub hint: Style,
8    pub yes_style: Style,
9    pub no_style: Style,
10    pub selected: Style,
11    pub default_value: Style,
12    pub error: Style,
13    pub error_hint: Style,
14    pub error_prefix: Option<String>,
15}
16
17impl Default for ConfirmStyle {
18    fn default() -> Self {
19        Self::mocha()
20    }
21}
22
23impl ConfirmStyle {
24    pub fn mocha() -> Self {
25        Self {
26            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
27            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
28            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
29            yes_style: Style::new().fg::<CustomColor<166, 227, 161>>(),
30            no_style: Style::new().fg::<CustomColor<243, 139, 168>>(),
31            selected: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
32            default_value: Style::new().fg::<CustomColor<186, 194, 222>>().italic(),
33            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
34            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
35            error_prefix: Some("✗".into()),
36        }
37    }
38
39    pub fn frappe() -> Self {
40        Self {
41            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
42            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
43            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
44            yes_style: Style::new().fg::<CustomColor<166, 209, 137>>(),
45            no_style: Style::new().fg::<CustomColor<231, 130, 132>>(),
46            selected: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
47            default_value: Style::new().fg::<CustomColor<181, 191, 226>>().italic(),
48            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
49            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
50            error_prefix: Some("✗".into()),
51        }
52    }
53
54    pub fn macchiato() -> Self {
55        Self {
56            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
57            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
58            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
59            yes_style: Style::new().fg::<CustomColor<166, 218, 149>>(),
60            no_style: Style::new().fg::<CustomColor<237, 135, 150>>(),
61            selected: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
62            default_value: Style::new().fg::<CustomColor<184, 192, 224>>().italic(),
63            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
64            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
65            error_prefix: Some("✗".into()),
66        }
67    }
68
69    pub fn latte() -> Self {
70        Self {
71            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
72            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
73            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
74            yes_style: Style::new().fg::<CustomColor<64, 160, 43>>(),
75            no_style: Style::new().fg::<CustomColor<210, 15, 57>>(),
76            selected: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
77            default_value: Style::new().fg::<CustomColor<92, 95, 119>>().italic(),
78            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
79            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
80            error_prefix: Some("✗".into()),
81        }
82    }
83
84    pub fn minimal() -> Self {
85        Self {
86            prompt: Style::new(),
87            prompt_prefix: Style::new().bold(),
88            hint: Style::new().dimmed(),
89            yes_style: Style::new(),
90            no_style: Style::new(),
91            selected: Style::new().bold(),
92            default_value: Style::new().dimmed(),
93            error: Style::new().bold(),
94            error_hint: Style::new().dimmed(),
95            error_prefix: Some("error:".into()),
96        }
97    }
98}
99
100#[derive(Clone)]
101pub struct TextInputStyle {
102    pub prompt: Style,
103    pub prompt_prefix: Style,
104    pub hint: Style,
105    pub input: Style,
106    pub placeholder: Style,
107    pub suggestion: Style,
108    pub selected: Style,
109    pub default_value: Style,
110    pub error: Style,
111    pub error_hint: Style,
112}
113
114impl Default for TextInputStyle {
115    fn default() -> Self {
116        Self::mocha()
117    }
118}
119
120impl TextInputStyle {
121    pub fn mocha() -> Self {
122        Self {
123            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
124            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
125            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
126            input: Style::new().fg::<CustomColor<166, 227, 161>>(),
127            placeholder: Style::new().fg::<CustomColor<127, 132, 156>>().italic(),
128            suggestion: Style::new().fg::<CustomColor<186, 194, 222>>(),
129            selected: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
130            default_value: Style::new().fg::<CustomColor<186, 194, 222>>().italic(),
131            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
132            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
133        }
134    }
135
136    pub fn frappe() -> Self {
137        Self {
138            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
139            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
140            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
141            input: Style::new().fg::<CustomColor<166, 209, 137>>(),
142            placeholder: Style::new().fg::<CustomColor<131, 139, 167>>().italic(),
143            suggestion: Style::new().fg::<CustomColor<181, 191, 226>>(),
144            selected: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
145            default_value: Style::new().fg::<CustomColor<181, 191, 226>>().italic(),
146            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
147            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
148        }
149    }
150
151    pub fn macchiato() -> Self {
152        Self {
153            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
154            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
155            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
156            input: Style::new().fg::<CustomColor<166, 218, 149>>(),
157            placeholder: Style::new().fg::<CustomColor<128, 135, 162>>().italic(),
158            suggestion: Style::new().fg::<CustomColor<184, 192, 224>>(),
159            selected: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
160            default_value: Style::new().fg::<CustomColor<184, 192, 224>>().italic(),
161            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
162            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
163        }
164    }
165
166    pub fn latte() -> Self {
167        Self {
168            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
169            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
170            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
171            input: Style::new().fg::<CustomColor<64, 160, 43>>(),
172            placeholder: Style::new().fg::<CustomColor<156, 160, 176>>().italic(),
173            suggestion: Style::new().fg::<CustomColor<92, 95, 119>>(),
174            selected: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
175            default_value: Style::new().fg::<CustomColor<92, 95, 119>>().italic(),
176            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
177            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
178        }
179    }
180
181    pub fn minimal() -> Self {
182        Self {
183            prompt: Style::new(),
184            prompt_prefix: Style::new().bold(),
185            hint: Style::new().dimmed(),
186            input: Style::new(),
187            placeholder: Style::new().dimmed().italic(),
188            suggestion: Style::new().dimmed(),
189            selected: Style::new().bold(),
190            default_value: Style::new().dimmed(),
191            error: Style::new().bold(),
192            error_hint: Style::new().dimmed(),
193        }
194    }
195}
196
197#[derive(Clone)]
198pub struct PasswordStyle {
199    pub prompt: Style,
200    pub prompt_prefix: Style,
201    pub hint: Style,
202    pub input_masked: Style,
203    pub input_revealed: Style,
204    pub strength_weak: Style,
205    pub strength_medium: Style,
206    pub strength_strong: Style,
207    pub error: Style,
208    pub error_hint: Style,
209}
210
211impl Default for PasswordStyle {
212    fn default() -> Self {
213        Self::mocha()
214    }
215}
216
217impl PasswordStyle {
218    pub fn mocha() -> Self {
219        Self {
220            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
221            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
222            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
223            input_masked: Style::new().fg::<CustomColor<186, 194, 222>>(),
224            input_revealed: Style::new().fg::<CustomColor<166, 227, 161>>(),
225            strength_weak: Style::new().fg::<CustomColor<243, 139, 168>>(),
226            strength_medium: Style::new().fg::<CustomColor<249, 226, 175>>(),
227            strength_strong: Style::new().fg::<CustomColor<166, 227, 161>>(),
228            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
229            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
230        }
231    }
232
233    pub fn frappe() -> Self {
234        Self {
235            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
236            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
237            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
238            input_masked: Style::new().fg::<CustomColor<181, 191, 226>>(),
239            input_revealed: Style::new().fg::<CustomColor<166, 209, 137>>(),
240            strength_weak: Style::new().fg::<CustomColor<231, 130, 132>>(),
241            strength_medium: Style::new().fg::<CustomColor<229, 200, 144>>(),
242            strength_strong: Style::new().fg::<CustomColor<166, 209, 137>>(),
243            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
244            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
245        }
246    }
247
248    pub fn macchiato() -> Self {
249        Self {
250            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
251            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
252            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
253            input_masked: Style::new().fg::<CustomColor<184, 192, 224>>(),
254            input_revealed: Style::new().fg::<CustomColor<166, 218, 149>>(),
255            strength_weak: Style::new().fg::<CustomColor<237, 135, 150>>(),
256            strength_medium: Style::new().fg::<CustomColor<238, 212, 159>>(),
257            strength_strong: Style::new().fg::<CustomColor<166, 218, 149>>(),
258            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
259            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
260        }
261    }
262
263    pub fn latte() -> Self {
264        Self {
265            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
266            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
267            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
268            input_masked: Style::new().fg::<CustomColor<92, 95, 119>>(),
269            input_revealed: Style::new().fg::<CustomColor<64, 160, 43>>(),
270            strength_weak: Style::new().fg::<CustomColor<210, 15, 57>>(),
271            strength_medium: Style::new().fg::<CustomColor<223, 142, 29>>(),
272            strength_strong: Style::new().fg::<CustomColor<64, 160, 43>>(),
273            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
274            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
275        }
276    }
277
278    pub fn minimal() -> Self {
279        Self {
280            prompt: Style::new(),
281            prompt_prefix: Style::new().bold(),
282            hint: Style::new().dimmed(),
283            input_masked: Style::new().dimmed(),
284            input_revealed: Style::new(),
285            strength_weak: Style::new().bold(),
286            strength_medium: Style::new().bold(),
287            strength_strong: Style::new().bold(),
288            error: Style::new().bold(),
289            error_hint: Style::new().dimmed(),
290        }
291    }
292}
293
294#[derive(Clone)]
295pub struct NumberStyle {
296    pub prompt: Style,
297    pub prompt_prefix: Style,
298    pub hint: Style,
299    pub input: Style,
300    pub bounds: Style,
301    pub default_value: Style,
302    pub error: Style,
303    pub error_hint: Style,
304}
305
306impl Default for NumberStyle {
307    fn default() -> Self {
308        Self::mocha()
309    }
310}
311
312impl NumberStyle {
313    pub fn mocha() -> Self {
314        Self {
315            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
316            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
317            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
318            input: Style::new().fg::<CustomColor<166, 227, 161>>(),
319            bounds: Style::new().fg::<CustomColor<147, 153, 178>>().italic(),
320            default_value: Style::new().fg::<CustomColor<186, 194, 222>>().italic(),
321            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
322            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
323        }
324    }
325
326    pub fn frappe() -> Self {
327        Self {
328            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
329            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
330            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
331            input: Style::new().fg::<CustomColor<166, 209, 137>>(),
332            bounds: Style::new().fg::<CustomColor<165, 173, 206>>().italic(),
333            default_value: Style::new().fg::<CustomColor<181, 191, 226>>().italic(),
334            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
335            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
336        }
337    }
338
339    pub fn macchiato() -> Self {
340        Self {
341            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
342            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
343            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
344            input: Style::new().fg::<CustomColor<166, 218, 149>>(),
345            bounds: Style::new().fg::<CustomColor<153, 160, 187>>().italic(),
346            default_value: Style::new().fg::<CustomColor<184, 192, 224>>().italic(),
347            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
348            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
349        }
350    }
351
352    pub fn latte() -> Self {
353        Self {
354            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
355            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
356            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
357            input: Style::new().fg::<CustomColor<64, 160, 43>>(),
358            bounds: Style::new().fg::<CustomColor<124, 127, 147>>().italic(),
359            default_value: Style::new().fg::<CustomColor<92, 95, 119>>().italic(),
360            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
361            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
362        }
363    }
364
365    pub fn minimal() -> Self {
366        Self {
367            prompt: Style::new(),
368            prompt_prefix: Style::new().bold(),
369            hint: Style::new().dimmed(),
370            input: Style::new(),
371            bounds: Style::new().dimmed(),
372            default_value: Style::new().dimmed(),
373            error: Style::new().bold(),
374            error_hint: Style::new().dimmed(),
375        }
376    }
377}
378
379#[derive(Clone)]
380pub struct SelectStyle {
381    pub prompt: Style,
382    pub prompt_prefix: Style,
383    pub hint: Style,
384    pub option_name: Style,
385    pub option_description: Style,
386    pub selected: Style,
387    pub selected_description: Style,
388    pub error: Style,
389    pub error_hint: Style,
390}
391
392impl Default for SelectStyle {
393    fn default() -> Self {
394        Self::mocha()
395    }
396}
397
398impl SelectStyle {
399    pub fn mocha() -> Self {
400        Self {
401            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
402            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
403            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
404            option_name: Style::new().fg::<CustomColor<186, 194, 222>>(),
405            option_description: Style::new().fg::<CustomColor<147, 153, 178>>(),
406            selected: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
407            selected_description: Style::new().fg::<CustomColor<166, 227, 161>>(),
408            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
409            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
410        }
411    }
412
413    pub fn frappe() -> Self {
414        Self {
415            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
416            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
417            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
418            option_name: Style::new().fg::<CustomColor<181, 191, 226>>(),
419            option_description: Style::new().fg::<CustomColor<165, 173, 206>>(),
420            selected: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
421            selected_description: Style::new().fg::<CustomColor<166, 209, 137>>(),
422            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
423            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
424        }
425    }
426
427    pub fn macchiato() -> Self {
428        Self {
429            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
430            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
431            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
432            option_name: Style::new().fg::<CustomColor<184, 192, 224>>(),
433            option_description: Style::new().fg::<CustomColor<153, 160, 187>>(),
434            selected: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
435            selected_description: Style::new().fg::<CustomColor<166, 218, 149>>(),
436            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
437            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
438        }
439    }
440
441    pub fn latte() -> Self {
442        Self {
443            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
444            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
445            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
446            option_name: Style::new().fg::<CustomColor<92, 95, 119>>(),
447            option_description: Style::new().fg::<CustomColor<124, 127, 147>>(),
448            selected: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
449            selected_description: Style::new().fg::<CustomColor<64, 160, 43>>(),
450            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
451            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
452        }
453    }
454
455    pub fn minimal() -> Self {
456        Self {
457            prompt: Style::new(),
458            prompt_prefix: Style::new().bold(),
459            hint: Style::new().dimmed(),
460            option_name: Style::new(),
461            option_description: Style::new().dimmed(),
462            selected: Style::new().bold(),
463            selected_description: Style::new(),
464            error: Style::new().bold(),
465            error_hint: Style::new().dimmed(),
466        }
467    }
468}
469
470#[derive(Clone)]
471pub struct MultiSelectStyle {
472    pub prompt: Style,
473    pub prompt_prefix: Style,
474    pub hint: Style,
475    pub option_name: Style,
476    pub option_description: Style,
477    pub cursor: Style,
478    pub cursor_description: Style,
479    pub selected: Style,
480    pub checkbox_selected: Style,
481    pub checkbox_unselected: Style,
482    pub selection_count: Style,
483    pub error: Style,
484    pub error_hint: Style,
485}
486
487impl Default for MultiSelectStyle {
488    fn default() -> Self {
489        Self::mocha()
490    }
491}
492
493impl MultiSelectStyle {
494    pub fn mocha() -> Self {
495        Self {
496            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
497            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
498            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
499            option_name: Style::new().fg::<CustomColor<186, 194, 222>>(),
500            option_description: Style::new().fg::<CustomColor<147, 153, 178>>(),
501            cursor: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
502            cursor_description: Style::new().fg::<CustomColor<166, 227, 161>>(),
503            selected: Style::new().fg::<CustomColor<166, 227, 161>>(),
504            checkbox_selected: Style::new().fg::<CustomColor<166, 227, 161>>(),
505            checkbox_unselected: Style::new().fg::<CustomColor<127, 132, 156>>(),
506            selection_count: Style::new().fg::<CustomColor<186, 194, 222>>().dimmed(),
507            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
508            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
509        }
510    }
511
512    pub fn frappe() -> Self {
513        Self {
514            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
515            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
516            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
517            option_name: Style::new().fg::<CustomColor<181, 191, 226>>(),
518            option_description: Style::new().fg::<CustomColor<165, 173, 206>>(),
519            cursor: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
520            cursor_description: Style::new().fg::<CustomColor<166, 209, 137>>(),
521            selected: Style::new().fg::<CustomColor<166, 209, 137>>(),
522            checkbox_selected: Style::new().fg::<CustomColor<166, 209, 137>>(),
523            checkbox_unselected: Style::new().fg::<CustomColor<131, 139, 167>>(),
524            selection_count: Style::new().fg::<CustomColor<181, 191, 226>>().dimmed(),
525            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
526            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
527        }
528    }
529
530    pub fn macchiato() -> Self {
531        Self {
532            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
533            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
534            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
535            option_name: Style::new().fg::<CustomColor<184, 192, 224>>(),
536            option_description: Style::new().fg::<CustomColor<153, 160, 187>>(),
537            cursor: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
538            cursor_description: Style::new().fg::<CustomColor<166, 218, 149>>(),
539            selected: Style::new().fg::<CustomColor<166, 218, 149>>(),
540            checkbox_selected: Style::new().fg::<CustomColor<166, 218, 149>>(),
541            checkbox_unselected: Style::new().fg::<CustomColor<128, 135, 162>>(),
542            selection_count: Style::new().fg::<CustomColor<184, 192, 224>>().dimmed(),
543            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
544            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
545        }
546    }
547
548    pub fn latte() -> Self {
549        Self {
550            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
551            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
552            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
553            option_name: Style::new().fg::<CustomColor<92, 95, 119>>(),
554            option_description: Style::new().fg::<CustomColor<124, 127, 147>>(),
555            cursor: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
556            cursor_description: Style::new().fg::<CustomColor<64, 160, 43>>(),
557            selected: Style::new().fg::<CustomColor<64, 160, 43>>(),
558            checkbox_selected: Style::new().fg::<CustomColor<64, 160, 43>>(),
559            checkbox_unselected: Style::new().fg::<CustomColor<156, 160, 176>>(),
560            selection_count: Style::new().fg::<CustomColor<92, 95, 119>>().dimmed(),
561            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
562            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
563        }
564    }
565
566    pub fn minimal() -> Self {
567        Self {
568            prompt: Style::new(),
569            prompt_prefix: Style::new().bold(),
570            hint: Style::new().dimmed(),
571            option_name: Style::new(),
572            option_description: Style::new().dimmed(),
573            cursor: Style::new().bold(),
574            cursor_description: Style::new(),
575            selected: Style::new(),
576            checkbox_selected: Style::new(),
577            checkbox_unselected: Style::new().dimmed(),
578            selection_count: Style::new().dimmed(),
579            error: Style::new().bold(),
580            error_hint: Style::new().dimmed(),
581        }
582    }
583}
584
585#[derive(Clone)]
586pub struct SortStyle {
587    pub prompt: Style,
588    pub prompt_prefix: Style,
589    pub hint: Style,
590    pub item: Style,
591    pub cursor: Style,
592    pub grabbed: Style,
593    pub index: Style,
594    pub error: Style,
595    pub error_hint: Style,
596}
597
598impl Default for SortStyle {
599    fn default() -> Self {
600        Self::mocha()
601    }
602}
603
604impl SortStyle {
605    pub fn mocha() -> Self {
606        Self {
607            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
608            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
609            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
610            item: Style::new().fg::<CustomColor<186, 194, 222>>(),
611            cursor: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
612            grabbed: Style::new().fg::<CustomColor<166, 227, 161>>().bold(),
613            index: Style::new().fg::<CustomColor<147, 153, 178>>().dimmed(),
614            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
615            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
616        }
617    }
618
619    pub fn frappe() -> Self {
620        Self {
621            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
622            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
623            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
624            item: Style::new().fg::<CustomColor<181, 191, 226>>(),
625            cursor: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
626            grabbed: Style::new().fg::<CustomColor<166, 209, 137>>().bold(),
627            index: Style::new().fg::<CustomColor<165, 173, 206>>().dimmed(),
628            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
629            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
630        }
631    }
632
633    pub fn macchiato() -> Self {
634        Self {
635            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
636            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
637            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
638            item: Style::new().fg::<CustomColor<184, 192, 224>>(),
639            cursor: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
640            grabbed: Style::new().fg::<CustomColor<166, 218, 149>>().bold(),
641            index: Style::new().fg::<CustomColor<153, 160, 187>>().dimmed(),
642            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
643            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
644        }
645    }
646
647    pub fn latte() -> Self {
648        Self {
649            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
650            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
651            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
652            item: Style::new().fg::<CustomColor<92, 95, 119>>(),
653            cursor: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
654            grabbed: Style::new().fg::<CustomColor<64, 160, 43>>().bold(),
655            index: Style::new().fg::<CustomColor<124, 127, 147>>().dimmed(),
656            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
657            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
658        }
659    }
660
661    pub fn minimal() -> Self {
662        Self {
663            prompt: Style::new(),
664            prompt_prefix: Style::new().bold(),
665            hint: Style::new().dimmed(),
666            item: Style::new(),
667            cursor: Style::new().bold(),
668            grabbed: Style::new().bold(),
669            index: Style::new().dimmed(),
670            error: Style::new().bold(),
671            error_hint: Style::new().dimmed(),
672        }
673    }
674}
675
676#[derive(Clone)]
677pub struct EditorStyle {
678    pub prompt: Style,
679    pub prompt_prefix: Style,
680    pub hint: Style,
681    pub editor_command: Style,
682    pub success: Style,
683    pub error: Style,
684    pub error_hint: Style,
685}
686
687impl Default for EditorStyle {
688    fn default() -> Self {
689        Self::mocha()
690    }
691}
692
693impl EditorStyle {
694    pub fn mocha() -> Self {
695        Self {
696            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
697            prompt_prefix: Style::new().fg::<CustomColor<137, 180, 250>>(),
698            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
699            editor_command: Style::new().fg::<CustomColor<249, 226, 175>>().italic(),
700            success: Style::new().fg::<CustomColor<166, 227, 161>>(),
701            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
702            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
703        }
704    }
705
706    pub fn frappe() -> Self {
707        Self {
708            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
709            prompt_prefix: Style::new().fg::<CustomColor<140, 170, 238>>(),
710            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
711            editor_command: Style::new().fg::<CustomColor<229, 200, 144>>().italic(),
712            success: Style::new().fg::<CustomColor<166, 209, 137>>(),
713            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
714            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
715        }
716    }
717
718    pub fn macchiato() -> Self {
719        Self {
720            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
721            prompt_prefix: Style::new().fg::<CustomColor<138, 173, 244>>(),
722            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
723            editor_command: Style::new().fg::<CustomColor<238, 212, 159>>().italic(),
724            success: Style::new().fg::<CustomColor<166, 218, 149>>(),
725            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
726            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
727        }
728    }
729
730    pub fn latte() -> Self {
731        Self {
732            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
733            prompt_prefix: Style::new().fg::<CustomColor<30, 102, 245>>(),
734            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
735            editor_command: Style::new().fg::<CustomColor<223, 142, 29>>().italic(),
736            success: Style::new().fg::<CustomColor<64, 160, 43>>(),
737            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
738            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
739        }
740    }
741
742    pub fn minimal() -> Self {
743        Self {
744            prompt: Style::new(),
745            prompt_prefix: Style::new().bold(),
746            hint: Style::new().dimmed(),
747            editor_command: Style::new().italic(),
748            success: Style::new(),
749            error: Style::new().bold(),
750            error_hint: Style::new().dimmed(),
751        }
752    }
753}
754
755#[derive(Clone)]
756pub struct FormStyle {
757    pub title: Style,
758    pub title_prefix_style: Style,
759    pub title_prefix: Option<String>,
760    pub section_title: Style,
761    pub section_decoration: Style,
762    pub prompt: Style,
763    pub active_prompt: Style,
764    pub active_marker: Style,
765    pub active_input: Style,
766    pub active_selected: Style,
767    pub placeholder: Style,
768    pub default_value: Style,
769    pub hint: Style,
770    pub option: Style,
771    pub checkbox_on: Style,
772    pub checkbox_off: Style,
773    pub password_mask: Style,
774    pub sort_grabbed: Style,
775    pub completed_prefix: Style,
776    pub completed_value: Style,
777    pub pending_prefix: Style,
778    pub pending_prompt: Style,
779    pub error: Style,
780    pub error_hint: Style,
781    pub nav_hint: Style,
782    pub progress: Style,
783    pub summary_text: Style,
784    pub summary_prefix_style: Style,
785    pub summary_prefix: Option<String>,
786}
787
788impl Default for FormStyle {
789    fn default() -> Self {
790        Self::mocha()
791    }
792}
793
794impl FormStyle {
795    pub fn mocha() -> Self {
796        Self {
797            title: Style::new().fg::<CustomColor<205, 214, 244>>().bold(),
798            title_prefix_style: Style::new().fg::<CustomColor<137, 180, 250>>(),
799            title_prefix: Some("◆".into()),
800            section_title: Style::new().fg::<CustomColor<186, 194, 222>>().bold(),
801            section_decoration: Style::new().fg::<CustomColor<127, 132, 156>>(),
802
803            prompt: Style::new().fg::<CustomColor<205, 214, 244>>(),
804            active_prompt: Style::new().fg::<CustomColor<205, 214, 244>>().bold(),
805            active_marker: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
806            active_input: Style::new().fg::<CustomColor<166, 227, 161>>(),
807            active_selected: Style::new().fg::<CustomColor<137, 180, 250>>().bold(),
808            placeholder: Style::new().fg::<CustomColor<127, 132, 156>>().italic(),
809            default_value: Style::new().fg::<CustomColor<186, 194, 222>>().italic(),
810            hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
811            option: Style::new().fg::<CustomColor<186, 194, 222>>(),
812            checkbox_on: Style::new().fg::<CustomColor<166, 227, 161>>(),
813            checkbox_off: Style::new().fg::<CustomColor<127, 132, 156>>(),
814            password_mask: Style::new().fg::<CustomColor<186, 194, 222>>(),
815            sort_grabbed: Style::new().fg::<CustomColor<166, 227, 161>>().bold(),
816
817            completed_prefix: Style::new().fg::<CustomColor<166, 227, 161>>(),
818            completed_value: Style::new().fg::<CustomColor<166, 227, 161>>(),
819
820            pending_prefix: Style::new().fg::<CustomColor<127, 132, 156>>(),
821            pending_prompt: Style::new().fg::<CustomColor<127, 132, 156>>().dimmed(),
822
823            error: Style::new().fg::<CustomColor<243, 139, 168>>().bold(),
824            error_hint: Style::new().fg::<CustomColor<147, 153, 178>>(),
825            nav_hint: Style::new().fg::<CustomColor<127, 132, 156>>(),
826            progress: Style::new().fg::<CustomColor<186, 194, 222>>().dimmed(),
827
828            summary_text: Style::new().fg::<CustomColor<166, 227, 161>>().bold(),
829            summary_prefix_style: Style::new().fg::<CustomColor<166, 227, 161>>(),
830            summary_prefix: Some("◆".into()),
831        }
832    }
833
834    pub fn frappe() -> Self {
835        Self {
836            title: Style::new().fg::<CustomColor<198, 208, 245>>().bold(),
837            title_prefix_style: Style::new().fg::<CustomColor<140, 170, 238>>(),
838            title_prefix: Some("◆".into()),
839            section_title: Style::new().fg::<CustomColor<181, 191, 226>>().bold(),
840            section_decoration: Style::new().fg::<CustomColor<131, 139, 167>>(),
841
842            prompt: Style::new().fg::<CustomColor<198, 208, 245>>(),
843            active_prompt: Style::new().fg::<CustomColor<198, 208, 245>>().bold(),
844            active_marker: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
845            active_input: Style::new().fg::<CustomColor<166, 209, 137>>(),
846            active_selected: Style::new().fg::<CustomColor<140, 170, 238>>().bold(),
847            placeholder: Style::new().fg::<CustomColor<131, 139, 167>>().italic(),
848            default_value: Style::new().fg::<CustomColor<181, 191, 226>>().italic(),
849            hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
850            option: Style::new().fg::<CustomColor<181, 191, 226>>(),
851            checkbox_on: Style::new().fg::<CustomColor<166, 209, 137>>(),
852            checkbox_off: Style::new().fg::<CustomColor<131, 139, 167>>(),
853            password_mask: Style::new().fg::<CustomColor<181, 191, 226>>(),
854            sort_grabbed: Style::new().fg::<CustomColor<166, 209, 137>>().bold(),
855
856            completed_prefix: Style::new().fg::<CustomColor<166, 209, 137>>(),
857            completed_value: Style::new().fg::<CustomColor<166, 209, 137>>(),
858
859            pending_prefix: Style::new().fg::<CustomColor<131, 139, 167>>(),
860            pending_prompt: Style::new().fg::<CustomColor<131, 139, 167>>().dimmed(),
861
862            error: Style::new().fg::<CustomColor<231, 130, 132>>().bold(),
863            error_hint: Style::new().fg::<CustomColor<165, 173, 206>>(),
864            nav_hint: Style::new().fg::<CustomColor<131, 139, 167>>(),
865            progress: Style::new().fg::<CustomColor<181, 191, 226>>().dimmed(),
866
867            summary_text: Style::new().fg::<CustomColor<166, 209, 137>>().bold(),
868            summary_prefix_style: Style::new().fg::<CustomColor<166, 209, 137>>(),
869            summary_prefix: Some("◆".into()),
870        }
871    }
872
873    pub fn macchiato() -> Self {
874        Self {
875            title: Style::new().fg::<CustomColor<202, 211, 245>>().bold(),
876            title_prefix_style: Style::new().fg::<CustomColor<138, 173, 244>>(),
877            title_prefix: Some("◆".into()),
878            section_title: Style::new().fg::<CustomColor<184, 192, 224>>().bold(),
879            section_decoration: Style::new().fg::<CustomColor<128, 135, 162>>(),
880
881            prompt: Style::new().fg::<CustomColor<202, 211, 245>>(),
882            active_prompt: Style::new().fg::<CustomColor<202, 211, 245>>().bold(),
883            active_marker: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
884            active_input: Style::new().fg::<CustomColor<166, 218, 149>>(),
885            active_selected: Style::new().fg::<CustomColor<138, 173, 244>>().bold(),
886            placeholder: Style::new().fg::<CustomColor<128, 135, 162>>().italic(),
887            default_value: Style::new().fg::<CustomColor<184, 192, 224>>().italic(),
888            hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
889            option: Style::new().fg::<CustomColor<184, 192, 224>>(),
890            checkbox_on: Style::new().fg::<CustomColor<166, 218, 149>>(),
891            checkbox_off: Style::new().fg::<CustomColor<128, 135, 162>>(),
892            password_mask: Style::new().fg::<CustomColor<184, 192, 224>>(),
893            sort_grabbed: Style::new().fg::<CustomColor<166, 218, 149>>().bold(),
894
895            completed_prefix: Style::new().fg::<CustomColor<166, 218, 149>>(),
896            completed_value: Style::new().fg::<CustomColor<166, 218, 149>>(),
897
898            pending_prefix: Style::new().fg::<CustomColor<128, 135, 162>>(),
899            pending_prompt: Style::new().fg::<CustomColor<128, 135, 162>>().dimmed(),
900
901            error: Style::new().fg::<CustomColor<237, 135, 150>>().bold(),
902            error_hint: Style::new().fg::<CustomColor<153, 160, 187>>(),
903            nav_hint: Style::new().fg::<CustomColor<128, 135, 162>>(),
904            progress: Style::new().fg::<CustomColor<184, 192, 224>>().dimmed(),
905
906            summary_text: Style::new().fg::<CustomColor<166, 218, 149>>().bold(),
907            summary_prefix_style: Style::new().fg::<CustomColor<166, 218, 149>>(),
908            summary_prefix: Some("◆".into()),
909        }
910    }
911
912    pub fn latte() -> Self {
913        Self {
914            title: Style::new().fg::<CustomColor<76, 79, 105>>().bold(),
915            title_prefix_style: Style::new().fg::<CustomColor<30, 102, 245>>(),
916            title_prefix: Some("◆".into()),
917            section_title: Style::new().fg::<CustomColor<92, 95, 119>>().bold(),
918            section_decoration: Style::new().fg::<CustomColor<156, 160, 176>>(),
919
920            prompt: Style::new().fg::<CustomColor<76, 79, 105>>(),
921            active_prompt: Style::new().fg::<CustomColor<76, 79, 105>>().bold(),
922            active_marker: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
923            active_input: Style::new().fg::<CustomColor<64, 160, 43>>(),
924            active_selected: Style::new().fg::<CustomColor<30, 102, 245>>().bold(),
925            placeholder: Style::new().fg::<CustomColor<156, 160, 176>>().italic(),
926            default_value: Style::new().fg::<CustomColor<92, 95, 119>>().italic(),
927            hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
928            option: Style::new().fg::<CustomColor<92, 95, 119>>(),
929            checkbox_on: Style::new().fg::<CustomColor<64, 160, 43>>(),
930            checkbox_off: Style::new().fg::<CustomColor<156, 160, 176>>(),
931            password_mask: Style::new().fg::<CustomColor<92, 95, 119>>(),
932            sort_grabbed: Style::new().fg::<CustomColor<64, 160, 43>>().bold(),
933
934            completed_prefix: Style::new().fg::<CustomColor<64, 160, 43>>(),
935            completed_value: Style::new().fg::<CustomColor<64, 160, 43>>(),
936
937            pending_prefix: Style::new().fg::<CustomColor<156, 160, 176>>(),
938            pending_prompt: Style::new().fg::<CustomColor<156, 160, 176>>().dimmed(),
939
940            error: Style::new().fg::<CustomColor<210, 15, 57>>().bold(),
941            error_hint: Style::new().fg::<CustomColor<124, 127, 147>>(),
942            nav_hint: Style::new().fg::<CustomColor<156, 160, 176>>(),
943            progress: Style::new().fg::<CustomColor<92, 95, 119>>().dimmed(),
944
945            summary_text: Style::new().fg::<CustomColor<64, 160, 43>>().bold(),
946            summary_prefix_style: Style::new().fg::<CustomColor<64, 160, 43>>(),
947            summary_prefix: Some("◆".into()),
948        }
949    }
950
951    pub fn minimal() -> Self {
952        Self {
953            title: Style::new().bold(),
954            title_prefix_style: Style::new().bold(),
955            title_prefix: Some("---".into()),
956            section_title: Style::new().bold(),
957            section_decoration: Style::new().dimmed(),
958
959            prompt: Style::new(),
960            active_prompt: Style::new().bold(),
961            active_marker: Style::new().bold(),
962            active_input: Style::new(),
963            active_selected: Style::new().bold(),
964            placeholder: Style::new().dimmed().italic(),
965            default_value: Style::new().dimmed(),
966            hint: Style::new().dimmed(),
967            option: Style::new(),
968            checkbox_on: Style::new(),
969            checkbox_off: Style::new().dimmed(),
970            password_mask: Style::new().dimmed(),
971            sort_grabbed: Style::new().bold(),
972
973            completed_prefix: Style::new(),
974            completed_value: Style::new(),
975
976            pending_prefix: Style::new().dimmed(),
977            pending_prompt: Style::new().dimmed(),
978
979            error: Style::new().bold(),
980            error_hint: Style::new().dimmed(),
981            nav_hint: Style::new().dimmed(),
982            progress: Style::new().dimmed(),
983
984            summary_text: Style::new().bold(),
985            summary_prefix_style: Style::new().bold(),
986            summary_prefix: Some("---".into()),
987        }
988    }
989}
990
991pub fn color<const R: u8, const G: u8, const B: u8>() -> Style {
992    Style::new().fg::<CustomColor<R, G, B>>()
993}