//! Definiciones para crear botones ([`Button`]).
use pagetop::prelude::*;
use crate::theme::BootsierColors;
pub use pagetop::base::component::button::{Button, Kind, Size, Style};
const EXTRA_ACTIVE: &str = "bootsier.button.active";
const EXTRA_FULL_WIDTH: &str = "bootsier.button.full_width";
const EXTRA_COLOR: &str = "bootsier.button.color";
// **< ButtonBsExt >********************************************************************************
/// Extensión de Bootsier para [`Button`].
///
/// Añade funcionalidad de Bootstrap que no cubre el componente base: estado activo (`.active`,
/// `aria-pressed`), ancho completo (`w-100`, el reemplazo de `.btn-block` desde Bootstrap 5), y un
/// color de la paleta de Bootsier que fuerza el que le correspondería a la [`Intent`] del botón --
/// por ejemplo, para usar `Light`/`Dark`, que `Intent` no tiene.
///
/// ```rust,no_run
/// use pagetop::prelude::*;
/// use pagetop_bootsier::theme::*;
///
/// let toggle = bs::Button::plain(Lc::n("Bold"))
/// .with_style(button::Style::Outline(Intent::Neutral))
/// .with_active(true);
///
/// let submit = bs::Button::submit(Lc::n("Save"))
/// .with_style(button::Style::Solid(Intent::Primary))
/// .with_full_width(true);
///
/// let subtle = bs::Button::plain(Lc::n("Cancel"))
/// .with_style(button::Style::Solid(Intent::Neutral))
/// .with_color(BootsierColors::Light);
/// ```
#[builder_impl]
pub trait ButtonBsExt {
/// Marca el botón como activo (`.active`, `aria-pressed="true"`).
fn with_active(self, active: bool) -> Self;
/// Expande el botón al ancho completo de su contenedor (`w-100`).
fn with_full_width(self, full_width: bool) -> Self;
/// Fuerza un color de la paleta de Bootsier, ignorando el que le correspondería a la `Intent`
/// del botón. `None` restablece el comportamiento por defecto (color derivado de la `Intent`).
/// Sin efecto si el estilo del botón es [`Style::Link`] o [`Style::None`].
fn with_color(self, color: impl Into