#[derive(Debug, Clone, PartialEq, Default, Copy)]
pub enum Variant {
Transparent,
#[default]
Default,
Secondary,
Tertiary,
Custom(&'static str),
}
impl Variant {
pub fn to_class(self) -> &'static str {
match self {
Self::Transparent => "card--transparent",
Self::Default => "card--default",
Self::Secondary => "card--secondary",
Self::Tertiary => "card--tertiary",
Self::Custom(_) => "card--custom",
}
}
pub fn to_style(self) -> &'static str {
match self {
Self::Transparent => "background: transparent;",
Self::Default => "background: #ffffff; border: 1px solid #e5e7eb;",
Self::Secondary => "background: #f9fafb; border: 1px solid #e5e7eb;",
Self::Tertiary => "background: #f3f4f6; border: 1px solid #d1d5db;",
Self::Custom(s) => s,
}
}
}
pub fn base_card_style() -> &'static str {
"position: relative; display: flex; flex-direction: column; border-radius: 0.75rem; padding: 1rem; box-sizing: border-box; overflow: hidden;"
}
pub fn base_header_style() -> &'static str {
"display: flex; flex-direction: column; gap: 0.25rem;"
}
pub fn base_title_style() -> &'static str {
"font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 0;"
}
pub fn base_description_style() -> &'static str {
"font-size: 0.875rem; color: #6b7280; line-height: 1.5; margin: 0;"
}
pub fn base_content_style() -> &'static str {
"display: flex; flex-direction: column; gap: 0.5rem;"
}
pub fn base_footer_style() -> &'static str {
"display: flex; flex-direction: row; align-items: center; gap: 0.5rem;"
}