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::*;

/// Centered responsive page container with constrained maximum width.
#[derive(Clone, Data, New, Props)]
pub struct EuvPageContainer {
    /// Ordered child node handles.
    #[new(skip)]
    pub(crate) children: Vec<NodeId>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
    /// Optional style overrides controlling `max_width`, `padding`, `gap`, and container appearance (defaults to `max_width: Length::Px(1120.0)`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
}

/// Bordered surface panel for grouped tools or inspector content.
#[derive(Clone, Data, New, Props)]
pub struct EuvPanel {
    /// Optional panel heading.
    pub(crate) title: String,
    /// Ordered child nodes inside the panel.
    #[new(skip)]
    pub(crate) children: Vec<NodeId>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Flex spacing helper arranging child nodes horizontally or vertically with uniform gap.
#[derive(Clone, Data, New, Props)]
pub struct EuvSpace {
    /// When `true`, lays out children in a vertical column; otherwise horizontal row.
    #[get(type(copy))]
    pub(crate) vertical: bool,
    /// Ordered child node handles.
    #[new(skip)]
    pub(crate) children: Vec<NodeId>,
    /// Optional style overrides controlling `gap`, alignment, padding, and container appearance (defaults to `gap: SPACE_SM`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
}

/// Responsive fixed-column CSS-Grid-equivalent container.
#[derive(Clone, Data, Default, New, Props)]
pub struct EuvGrid {
    /// Ordered child node handles.
    #[new(skip)]
    pub(crate) children: Vec<NodeId>,
    /// Optional style overrides controlling `columns`, `gap`, and grid container appearance (defaults to `columns: 2`, `gap: SPACE_MD`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
}

/// Clipped scrollable viewport wrapper with configurable style height.
#[derive(Clone, Data, New, Props)]
pub struct EuvScrollArea {
    /// Ordered child nodes inside the scroll area.
    #[new(skip)]
    pub(crate) children: Vec<NodeId>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
    /// Optional style overrides controlling viewport `height` and scroll container appearance (defaults to `height: Length::Px(240.0)`).
    #[new(skip)]
    #[get(type(copy))]
    pub(crate) style: Option<Style>,
}

/// Two-pane split layout with proportional primary ratio.
#[derive(Clone, Data, New, Props)]
pub struct EuvSplitter {
    /// Primary pane percentage in `[15.0, 85.0]`.
    #[get(type(copy))]
    pub(crate) ratio_percent: f32,
    /// Primary pane node handle.
    #[get(type(copy))]
    pub(crate) primary: NodeId,
    /// Secondary pane node handle.
    #[get(type(copy))]
    pub(crate) secondary: NodeId,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Top navigation bar displaying brand title and trailing action nodes.
#[derive(Clone, Data, New, Props)]
pub struct EuvNavbar {
    /// Brand title text.
    pub(crate) brand: String,
    /// Trailing action nodes.
    #[new(skip)]
    pub(crate) actions: Vec<NodeId>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Page footer strip with copyright or metadata text.
#[derive(Clone, Data, New, Props)]
pub struct EuvFooter {
    /// Footer text content.
    pub(crate) text: String,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}

/// Contiguous horizontal group of button nodes.
#[derive(Clone, Data, New, Props)]
pub struct EuvButtonGroup {
    /// Ordered button child handles.
    pub(crate) children: Vec<NodeId>,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
    /// Whether child buttons auto-grow across every wrapped row with zero trailing empty space.
    #[new(skip)]
    #[get(type(copy))]
    #[prop(custom)]
    pub(crate) wrap_fill: bool,
}

/// Pressable two-state toggle pill bound to a reactive `Signal<bool>`.
#[derive(Clone, Data, New, Props)]
pub struct EuvToggle {
    /// Reactive pressed state signal.
    #[get(type(copy))]
    pub(crate) pressed: Signal<bool>,
    /// Toggle label text.
    pub(crate) label: String,
    /// Active theme tokens.
    #[get(type(copy))]
    pub(crate) tokens: ThemeTokens,
}