aura-gui 0.2.1

UI nativa acelerada por GPU para escritorio, Android e iOS, en un solo crate: estilo tipo Tailwind, componentes, sombras, animaciones y agentes de IA. Reposo a cero. Licencia AGPL-3.0 o comercial.
//! Utilidades de cuadrícula de Tailwind: `grid_cols_3`, `grid_rows_2`, `col_span_2`, `col_start_2`, `grid_flow_col`.
//! Con `grid_cols_*` o `grid_rows_*` el contenedor pasa a ser una cuadrícula de pistas iguales (`1fr`); el hueco
//! se fija con `gap_*`, como siempre. Se expande dentro de `Styled`.

/// Una utilidad numérica por valor: `grid_cols_1 … grid_cols_12`.
macro_rules! grid_numbers {
    ($prefix:ident, |$s:ident, $n:ident| $apply:expr; $($value:literal),*) => {
        paste::paste! {
            $(
                fn [<$prefix _ $value>](mut self) -> Self {
                    let $n = $value;
                    let $s = &mut self.style().extra_mut().grid;
                    $apply;
                    self
                }
            )*
        }
    };
}

macro_rules! grid_utilities {
    () => {
        grid_numbers!(grid_cols, |g, n| g.cols = Some(n); 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
        grid_numbers!(grid_rows, |g, n| g.rows = Some(n); 1, 2, 3, 4, 5, 6);
        grid_numbers!(col_span, |g, n| g.col_span = Some(n); 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
        grid_numbers!(row_span, |g, n| g.row_span = Some(n); 1, 2, 3, 4, 5, 6);
        grid_numbers!(col_start, |g, n| g.col_start = Some(n); 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
        grid_numbers!(row_start, |g, n| g.row_start = Some(n); 1, 2, 3, 4, 5, 6, 7);

        setters! {
            grid_flow_col => |s| s.extra_mut().grid.flow_col = Some(true);
            grid_flow_row => |s| s.extra_mut().grid.flow_col = Some(false);
        }

        /// `grid-cols-[N]` con cualquier cantidad de columnas.
        fn grid_cols(mut self, count: u16) -> Self {
            self.style().extra_mut().grid.cols = Some(count);
            self
        }

        /// `grid-rows-[N]` con cualquier cantidad de filas.
        fn grid_rows(mut self, count: u16) -> Self {
            self.style().extra_mut().grid.rows = Some(count);
            self
        }
    };
}

pub(crate) use {grid_numbers, grid_utilities};