feat: Add GPUI component library
Add core UI components for TaskWarrior GUI application: Components: - Input: Text input with autocomplete suggestions, keyboard navigation - Button: Multiple variants (Primary, Secondary, Ghost, Danger, Success, Text) - DropdownButton: Compound button with dropdown menu - Icon: SVG icons with customizable sizes - Label: Simple text display - Panel: Container with optional title - List: List container - Modal: Modal dialog - Divider: Visual separator Infrastructure: - Theme system with dark/light modes (Catppuccin colors) - App module with window management
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
use gpui::SharedString;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Suggestion {
|
||||
pub label: SharedString,
|
||||
pub insert: SharedString,
|
||||
}
|
||||
|
||||
impl Suggestion {
|
||||
pub fn new(label: impl Into<SharedString>, insert: impl Into<SharedString>) -> Self {
|
||||
Self {
|
||||
label: label.into(),
|
||||
insert: insert.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn simple(text: impl Into<SharedString>) -> Self {
|
||||
let text = text.into();
|
||||
Self {
|
||||
label: text.clone(),
|
||||
insert: text,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user