Añade clases de fondo, texto, bordes y esquinas

- Refactoriza el componente contenedor `Container` para usar estas
  clases y aplicar los nuevos enums `Kind` y `Width` para mejorar el
  comportamiento semántico y *responsive*.
- Actualiza los componentes `Dropdown`, `Image`, `Nav`, `Navbar` y
  `Offcanvas` para usar los nuevos métodos de unión de clases.
- Elimina propiedades de estilo redundantes de los componentes
  `Navbar` e `Image`, simplificando sus interfaces.
This commit is contained in:
Manuel Cillero 2025-11-10 07:45:05 +01:00
parent b6cf3f71a0
commit 0e17d7c1d9
23 changed files with 1041 additions and 994 deletions

View file

@ -26,7 +26,7 @@ pub struct Dropdown {
classes : AttrClasses,
title : L10n,
button_size : ButtonSize,
button_color : ColorButton,
button_color : ButtonColor,
button_split : bool,
button_grouped: bool,
auto_close : dropdown::AutoClose,
@ -59,7 +59,7 @@ impl Component for Dropdown {
dropdown::Direction::Dropend => "dropend",
dropdown::Direction::Dropstart => "dropstart",
}
].join(" "));
].join_classes());
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
@ -79,7 +79,7 @@ impl Component for Dropdown {
"btn",
&self.button_size().to_string(),
&self.button_color().to_string(),
].join(" "));
].join_classes());
@let (offset, reference) = match self.menu_position() {
dropdown::MenuPosition::Default => (None, None),
dropdown::MenuPosition::Offset(x, y) => (Some(format!("{x},{y}")), None),
@ -212,7 +212,7 @@ impl Dropdown {
/// Define el color/estilo del botón.
#[builder_fn]
pub fn with_button_color(mut self, color: ColorButton) -> Self {
pub fn with_button_color(mut self, color: ButtonColor) -> Self {
self.button_color = color;
self
}
@ -291,7 +291,7 @@ impl Dropdown {
}
/// Devuelve el color/estilo configurado del botón.
pub fn button_color(&self) -> &ColorButton {
pub fn button_color(&self) -> &ButtonColor {
&self.button_color
}