euv-ui 0.47.1

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

/// Universal 4px base spacing step (`xs`).
pub const SPACE_XS: f32 = 4.0;

/// Small spacing step (`sm`).
pub const SPACE_SM: f32 = 8.0;

/// Medium spacing step (`md`).
pub const SPACE_MD: f32 = 12.0;

/// Large spacing step (`lg`).
pub const SPACE_LG: f32 = 16.0;

/// Extra-large spacing step (`xl`).
pub const SPACE_XL: f32 = 20.0;

/// Double extra-large spacing step (`2xl`).
pub const SPACE_2XL: f32 = 24.0;

/// Canonical full-pill / perfect-circle corner radius; every renderer clamps it to half the shortest side.
///
/// Circles and pills (switch track & thumb, radio ring & dot, slider thumb, avatars, status dots, grabbers, pill
/// badges, spinners, scrollbar thumbs) MUST use this constant instead of magic half-height literals.
pub const RADIUS_PILL: f32 = 999.0;

/// Uniform inset shared by segmented tracks, tab lists, docks, and menus so outer padding equals inter-item gaps.
pub const CONTROL_INSET: f32 = 4.0;

/// Desktop navigation sidebar width in logical pixels.
pub const NAV_SIDEBAR_WIDTH: f32 = 240.0;

/// Maximum readable content container width in logical pixels.
pub const CONTENT_MAX_WIDTH: f32 = 960.0;

/// Mobile top header bar height in logical pixels when `top_inset == 0.0`.
pub const MOBILE_HEADER_HEIGHT: f32 = 44.0;

/// Z-index layer for normal content.
pub const Z_INDEX_CONTENT: i32 = 1;

/// Z-index layer for sticky app chrome (header / sidebar).
pub const Z_INDEX_CHROME: i32 = 100;

/// Z-index layer for tooltips.
pub const Z_INDEX_TOOLTIP: i32 = 140;

/// Z-index layer for floating popovers and dropdown menus.
pub const Z_INDEX_FLOATING: i32 = 150;

/// Z-index layer for dimmed backdrop overlays.
pub const Z_INDEX_OVERLAY: i32 = 200;

/// Z-index layer for slide-over drawers and sheets.
pub const Z_INDEX_DRAWER: i32 = 201;

/// Z-index layer for modal dialogs.
pub const Z_INDEX_MODAL: i32 = 1000;

/// Z-index layer for toast notifications.
pub const Z_INDEX_TOAST: i32 = 1100;

/// Z-index layer for true edge-to-edge fullscreen portals above shell chrome, modals, and toasts.
pub const Z_INDEX_FULLSCREEN: i32 = 1200;

/// Canonical default UI geometry `[radius_sm, radius_md, radius_lg, radius_xl, control_sm, control_md, control_lg]`
/// shared by every `DesignScheme`: schemes differ only in color palettes, so theme switches never touch layout or radii.
pub const THEME_CANONICAL_GEOMETRY_METRICS: [f32; 7] = [4.0, 6.0, 8.0, 12.0, 30.0, 36.0, 44.0];

/// Unified global motion duration in seconds for micro controls (switch thumb, checkbox/radio, segmented/tab
/// indicator, hover/press feedback).
pub const MOTION_MICRO_SECS: f32 = 0.22;

/// Unified global motion duration in seconds for standard overlays and transitions (modals, alert dialogs, command
/// palette, popovers, dropdowns, tooltips, context menus, toasts, fullscreen portals).
pub const MOTION_STANDARD_SECS: f32 = 0.30;

/// Unified global motion duration in seconds for large surface and chrome motion (drawers, bottom sheets,
/// `EuvAppShell` top bar / bottom navigation hide and reveal, route and page transitions).
pub const MOTION_EMPHASIZED_SECS: f32 = 0.36;

/// Effective motion duration in seconds applied to every transition while Reduced Motion is enabled.
pub const MOTION_REDUCED_SECS: f32 = 0.001;

/// Unified global enter easing: smooth monotonic deceleration with strictly zero overshoot.
pub const MOTION_EASE_ENTER: Easing = Easing::EaseOutQuint;

/// Unified global exit easing: crisp symmetric monotonic exit with strictly zero overshoot.
pub const MOTION_EASE_EXIT: Easing = Easing::EaseOutCubic;

/// Minimum WCAG 2.1 contrast ratio for normal body / label text.
pub const CONTRAST_MIN_TEXT: f32 = 4.5;

/// Minimum WCAG 2.1 contrast ratio for muted, large, or non-text UI elements.
pub const CONTRAST_MIN_MUTED: f32 = 3.0;

/// Compile-time lookup table of all 17 schemes x 2 modes (`(scheme_idx << 1) | dark_idx`) semantic palettes.
pub(crate) const THEME_PALETTE_LUT: [ThemePalette; 34] = ThemeTokens::build_palette_lut();