rustyle_css/components/
mod.rs

1//! Component style system
2//!
3//! Provides a comprehensive component styling system with variants, sizes, and states.
4
5pub mod alert;
6pub mod badge;
7pub mod button;
8pub mod card;
9pub mod dropdown;
10pub mod input;
11pub mod modal;
12pub mod pagination;
13pub mod progress;
14pub mod select;
15pub mod spinner;
16pub mod table;
17pub mod tabs;
18pub mod textarea;
19pub mod tooltip;
20
21pub use alert::AlertStyle;
22pub use badge::BadgeStyle;
23pub use button::ButtonStyle;
24pub use card::CardStyle;
25pub use dropdown::DropdownStyle;
26pub use input::InputStyle;
27pub use modal::ModalStyle;
28pub use pagination::PaginationStyle;
29pub use progress::ProgressStyle;
30pub use select::SelectStyle;
31pub use spinner::SpinnerStyle;
32pub use table::TableStyle;
33pub use tabs::TabsStyle;
34pub use textarea::TextareaStyle;
35pub use tooltip::{TooltipPosition, TooltipStyle};
36
37/// Component variant (e.g., primary, secondary)
38#[derive(Clone, Debug, PartialEq)]
39pub enum Variant {
40    Primary,
41    Secondary,
42    Success,
43    Error,
44    Warning,
45    Info,
46}
47
48/// Component size
49#[derive(Clone, Debug, PartialEq)]
50pub enum Size {
51    Small,
52    Medium,
53    Large,
54    ExtraLarge,
55}
56
57/// Component state
58#[derive(Clone, Debug, PartialEq)]
59pub enum State {
60    Default,
61    Hover,
62    Active,
63    Disabled,
64    Focus,
65    FocusVisible,
66}
67
68/// Base trait for component styles
69pub trait ComponentStyle {
70    /// Generate CSS for the component
71    fn to_css(&self) -> String;
72
73    /// Get the class name
74    fn class_name(&self) -> &str;
75}