adabraka_ui/
lib.rs

1#![allow(missing_docs)]
2
3//! # adabraka-ui: Professional UI Component Library for GPUI
4//!
5//! A comprehensive, themeable component library inspired by shadcn/ui, designed specifically
6//! for building polished desktop applications using GPUI. Provides a complete set of
7//! reusable components with consistent styling, smooth animations, and accessibility support.
8//! ## Architecture Overview
9//!
10//! The library is organized into several key modules:
11//! - `theme`: Design tokens and theming system with light/dark variants
12//! - `components`: Core interactive elements (buttons, inputs, selects, etc.)
13//! - `display`: Presentation components (tables, cards, badges, etc.)
14//! - `navigation`: Navigation components (sidebars, menus, tabs, etc.)
15//! - `overlays`: Modal dialogs, popovers, tooltips, and command palettes
16//! - `animations`: Professional animation presets and easing functions
17//!
18//! ## Key Features
19//!
20//! - **Theme System**: Comprehensive design tokens with automatic light/dark mode support
21//! - **Accessibility**: Full keyboard navigation, ARIA labels, and screen reader support
22//! - **Performance**: Optimized rendering with virtual scrolling for large datasets
23//! - **Animation**: Smooth, professional animations using spring physics and easing curves
24//! - **Type Safety**: Strong typing throughout with compile-time guarantees
25//!
26//! ## Design Philosophy
27//!
28//! Components follow shadcn/ui principles with GPUI-specific optimizations:
29//! - Composition over inheritance for flexible component APIs
30//! - Builder pattern for ergonomic component construction
31//! - Entity-based state management for complex interactive components
32//! - Consistent naming and styling patterns across all components
33//!
34//! ## Usage Example
35//!
36//! ```rust
37//! use adabraka_ui::{prelude::*, theme};
38//!
39//! // Initialize theme and components
40//! fn init_app(cx: &mut gpui::App) {
41//!     theme::install_theme(cx, theme::Theme::dark());
42//!     adabraka_ui::init(cx);
43//! }
44//!
45//! // Use components in your views
46//! fn render(cx: &mut gpui::App) -> impl gpui::IntoElement {
47//!     div()
48//!         .child(Button::new("Click me").on_click(|_, _, _| println!("Clicked!")))
49//!         .child(Input::new(&input_state).placeholder("Enter text..."))
50//! }
51//! ```
52//!
53
54extern crate gpui;
55
56pub mod prelude;
57pub mod theme;
58pub mod layout;
59pub mod components;
60pub mod navigation;
61pub mod display;
62pub mod overlays;
63pub mod animations;
64pub mod transitions;
65pub mod virtual_list;
66
67/// Extension traits for common types
68pub mod util;
69
70/// Font loading and registration
71pub mod fonts;
72
73/// Icon configuration for custom asset paths
74pub mod icon_config;
75
76// Re-export commonly used icon configuration functions
77pub use icon_config::set_icon_base_path;
78
79/// Initialize the UI library
80///
81/// This registers all necessary keybindings and initializes component systems.
82/// Registers custom fonts for the component library.
83pub fn init(cx: &mut gpui::App) {
84    fonts::register_fonts(cx);
85
86    components::input::init(cx);
87    components::select::init_select(cx);
88    components::combobox::init_combobox(cx);
89    components::editor::init(cx);
90    navigation::sidebar::init_sidebar(cx);
91    overlays::popover::init(cx);
92}