using Connected.Extensions; using Connected.Utilities; using Microsoft.AspNetCore.Components; namespace Connected.Components; public partial class AppBar : UIComponent { /// /// If true, Appbar will be placed at the bottom of the screen. /// [Parameter] public bool Bottom { get; set; } /// /// The higher the number, the heavier the drop-shadow. 0 for no shadow. /// [Parameter] public int Elevation { set; get; } = 4; /// /// If true, compact padding will be used. /// [Parameter] public bool Dense { get; set; } /// /// If true, the left and right padding is removed from from the appbar. /// [Parameter] public bool DisableGutters { get; set; } /// /// The color of the component. It supports the theme colors. /// [Parameter] public ThemeColor Color { get; set; } = ThemeColor.Default; /// /// If true, appbar will be Fixed. /// [Parameter] public bool Fixed { get; set; } = true; /// /// User class names, separated by spaces for the nested toolbar. /// [Parameter] public string? ToolBarClass { get; set; } /// /// Child content of the component. /// [Parameter] public RenderFragment? ChildContent { get; set; } protected string ClassList() { return new CssBuilder("appbar") .AddClass($"appbar-dense", Dense) .AddClass($"appbar-fixed-top", Fixed && !Bottom) .AddClass($"appbar-fixed-bottom", Fixed && Bottom) .AddClass($"elevation-{Elevation}") .AddClass($"theme-{Color.ToDescriptionString()}", Color != ThemeColor.Default) .AddClass(Class) .Build(); } protected string ToolBarClassList() { return new CssBuilder("toolbar-appbar") .AddClass(ToolBarClass) .Build(); } }