euv-ui 0.48.0

Cross-platform UI component library and 17-scheme design system for the euv framework with pixel-consistent rendering across Web, Android, iOS, iPadOS, macOS, Windows, and Linux.
Documentation
use super::*;

/// Compact dismissible or labeled metadata tag.
#[derive(Clone, Data, New, Props)]
pub struct EuvTag {
    /// Tag text label.
    pub(crate) label: String,
    /// Semantic tone.
    #[get(type(copy))]
    pub(crate) tone: EuvTone,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Circular initials avatar surface.
#[derive(Clone, Data, New, Props)]
pub struct EuvAvatar {
    /// Display initials (1-2 chars).
    pub(crate) initials: String,
    /// Diameter in logical pixels.
    #[get(type(copy))]
    pub(crate) size: f32,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Crisp vector-rendered symbolic icon badge.
#[derive(Clone, Data, New, Props)]
pub struct EuvIcon {
    /// Symbolic glyph string (used when `icon` is `None`).
    pub(crate) symbol: String,
    /// Icon box size in logical pixels.
    #[get(type(copy))]
    pub(crate) size: f32,
    /// Optional style overrides controlling icon foreground color and layout (`style: { color: ... }`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
    /// Optional built-in native vector glyph drawn directly via `DisplayList` primitives.
    #[new(skip)]
    #[get(type(copy))]
    #[prop(default = None)]
    pub(crate) icon: Option<EuvIconName>,
}

/// Keyboard shortcut keycap indicator (`Cmd`, `Ctrl`, `K`).
#[derive(Clone, Data, New, Props)]
pub struct EuvKbd {
    /// Keycap text.
    pub(crate) key: String,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Semantic typography text node across heading, body, and caption scales.
#[derive(Clone, Data, New, Props)]
pub struct EuvTypography {
    /// Text string.
    pub(crate) text: String,
    /// Scale variant.
    #[get(type(copy))]
    pub(crate) variant: EuvTypographyVariant,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Empty-state placeholder card with title and explanation.
#[derive(Clone, Data, New, Props)]
pub struct EuvEmpty {
    /// Empty-state heading.
    pub(crate) title: String,
    /// Supporting guidance text.
    pub(crate) description: String,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Shimmer-style skeleton loading placeholder rectangle.
#[derive(Clone, Data, New, Props)]
pub struct EuvSkeleton {
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
    /// Optional style overrides controlling dimensions and shape (`style: { width: Length::Px(180.0) height: Length::Px(16.0) }`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
}

/// Vector circular activity spinner rendered via `Canvas`.
#[derive(Clone, Data, New, Props)]
pub struct EuvSpinner {
    /// Diameter in logical pixels.
    #[get(type(copy))]
    pub(crate) size: f32,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Single chronological milestone entry inside `EuvTimeline`.
#[derive(Clone, Debug, Eq, Getter, New, PartialEq)]
pub struct EuvTimelineItem {
    /// Milestone title.
    pub(crate) title: String,
    /// Timestamp or version label.
    pub(crate) timestamp: String,
    /// Event description.
    pub(crate) detail: String,
}

/// Vertical chronological timeline component.
#[derive(Clone, Data, New, Props)]
pub struct EuvTimeline {
    /// Ordered milestone entries.
    pub(crate) items: Vec<EuvTimelineItem>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Structured vertical list component with dividers.
#[derive(Clone, Data, New, Props)]
pub struct EuvList {
    /// Ordered row text labels.
    pub(crate) items: Vec<String>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Hierarchical node entry inside `EuvTree`.
#[derive(Clone, Debug, Eq, Getter, New, PartialEq)]
pub struct EuvTreeNode {
    /// Visible node label.
    pub(crate) label: String,
    /// Nested child tree nodes.
    pub(crate) children: Vec<Self>,
}

/// Indented hierarchical tree viewer component with interactive branch folding and optional node selection.
#[derive(Clone, Data, New, Props)]
pub struct EuvTree {
    /// Root tree nodes.
    pub(crate) roots: Vec<EuvTreeNode>,
    /// Optional controlled selected node label signal.
    #[new(skip)]
    #[get(skip)]
    #[prop(custom)]
    pub(crate) selected: Option<Signal<Option<String>>>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}