using Connected.Annotations;
using Connected.Extensions;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class ButtonGroup : UIComponent
{
protected string Classname =>
new CssBuilder("mud-button-group-root")
.AddClass($"mud-button-group-override-styles", OverrideStyles)
.AddClass($"mud-button-group-{Variant.ToDescriptionString()}")
.AddClass($"mud-button-group-{Variant.ToDescriptionString()}-{Color.ToDescriptionString()}")
.AddClass($"mud-button-group-{Variant.ToDescriptionString()}-size-{Size.ToDescriptionString()}")
.AddClass($"mud-button-group-vertical", VerticalAlign)
.AddClass($"mud-button-group-horizontal", !VerticalAlign)
.AddClass($"mud-button-group-disable-elevation", DisableElevation)
.AddClass($"mud-button-group-rtl", RightToLeft)
.AddClass(Class)
.Build();
[CascadingParameter(Name = "RightToLeft")]
public bool RightToLeft { get; set; }
///
/// If true, the button group will override the styles of the individual buttons.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public bool OverrideStyles { get; set; } = true;
///
/// Child content of component.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Behavior)]
public RenderFragment ChildContent { get; set; }
///
/// If true, the button group will be displayed vertically.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public bool VerticalAlign { get; set; } = false;
///
/// If true, no drop-shadow will be used.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public bool DisableElevation { get; set; } = false;
///
/// The color of the component. It supports the theme colors.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public ThemeColor Color { get; set; } = ThemeColor.Default;
///
/// The size of the component.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public Size Size { get; set; } = Size.Medium;
///
/// The variant to use.
///
[Parameter]
[Category(CategoryTypes.ButtonGroup.Appearance)]
public Variant Variant { get; set; } = Variant.Text;
}