Archived
f4abfe6fdc
Belated rename commit for foundation/el-ui — was missed in the workspace-wide crates→vessels pass earlier today. Same structural intent as the rename in the other repos: 'crates' is the Rust word, 'vessel' is El's, and the directory rename is the marker that this slot holds an El buildable unit even if its current contents are still Rust pending port. Plus the El ports themselves — manifest.el + src/main.el per sub- vessel (el-aop, el-auth, el-config, el-i18n, el-identity, el-layout, el-platform, el-publish, el-secrets, el-services, el-style, el-ui- compiler). The ui-compiler is a stub: elc only emits C right now; generating browser-target JS/Wasm is the biggest open language gap and gets its own project. Until then, el-ui-compiler emits a JS module that throws elc.backend_missing so callers fail loudly. Cross-repo path dependencies in Cargo.toml updated to vessels/.
51 lines
1.7 KiB
Rust
51 lines
1.7 KiB
Rust
//! el-layout — Responsive layout engine for el-ui.
|
|
//!
|
|
//! **Responsive by default.** VStack and HStack wrap automatically.
|
|
//! Grid uses auto columns. You don't write breakpoints for basic layouts.
|
|
//!
|
|
//! ## Layout primitives
|
|
//!
|
|
//! - [`VStack`] — vertical stack, wraps by default
|
|
//! - [`HStack`] — horizontal stack, wraps by default, RTL-aware
|
|
//! - [`ZStack`] — depth stack, children overlap
|
|
//! - [`GridLayout`] — responsive grid, auto or fixed columns
|
|
//! - [`ScrollView`] — scrollable container
|
|
//!
|
|
//! ## Responsive values
|
|
//!
|
|
//! For the rare case where you need a value to change at a specific breakpoint:
|
|
//! ```
|
|
//! use el_layout::prelude::*;
|
|
//!
|
|
//! // Most specific value that applies cascades down to less specific
|
|
//! let cols: Responsive<u32> = Responsive::fixed(1).md(2).lg(3);
|
|
//! assert_eq!(*cols.resolve(Breakpoint::Sm), 1);
|
|
//! assert_eq!(*cols.resolve(Breakpoint::Md), 2);
|
|
//! assert_eq!(*cols.resolve(Breakpoint::Lg), 3);
|
|
//! assert_eq!(*cols.resolve(Breakpoint::Xl), 3); // cascades from lg
|
|
//! ```
|
|
|
|
#![deny(warnings)]
|
|
|
|
pub mod breakpoint;
|
|
pub mod constraints;
|
|
pub mod flex;
|
|
pub mod grid;
|
|
pub mod platform;
|
|
pub mod responsive;
|
|
pub mod scroll;
|
|
pub mod stack;
|
|
|
|
pub mod prelude {
|
|
pub use crate::breakpoint::Breakpoint;
|
|
pub use crate::constraints::{LayoutConstraints, Size};
|
|
pub use crate::flex::{CrossAxisAlignment, FlexDirection, FlexLayout, HAlign, MainAxisAlignment, MainAxisSize, VAlign};
|
|
pub use crate::grid::{GridColumns, GridLayout, GridRows};
|
|
pub use crate::platform::{PlatformFamily, PlatformSizing, SafeAreaInsets};
|
|
pub use crate::responsive::Responsive;
|
|
pub use crate::scroll::{ScrollAxis, ScrollIndicator, ScrollView};
|
|
pub use crate::stack::{HStack, Spacer, VStack, ZStack};
|
|
}
|
|
|
|
pub use prelude::*;
|