using Connected.Extensions; using Microsoft.AspNetCore.Components; namespace Connected.Components; public partial class InputLabel : UIComponent { protected string Classname => new Utilities.CssBuilder() .AddClass("mud-input-label") .AddClass("mud-input-label-animated") .AddClass($"mud-input-label-{Variant.ToDescriptionString()}") .AddClass($"mud-input-label-margin-{Margin.ToDescriptionString()}", when: () => Margin != Margin.None) .AddClass($"mud-disabled", Disabled) .AddClass("mud-input-error", Error) .AddClass(Class) .Build(); /// /// Child content of component. /// [Parameter] public RenderFragment ChildContent { get; set; } /// /// If true, the input element will be disabled. /// [Parameter] public bool Disabled { get; set; } /// /// If true, the label will be displayed in an error state. /// [Parameter] public bool Error { get; set; } /// /// Variant to use. /// [Parameter] public Variant Variant { get; set; } = Variant.Text; /// /// Will adjust vertical spacing. /// [Parameter] public Margin Margin { get; set; } = Margin.None; /// /// Will set the for attribute for WCAG accessiblility /// [Parameter] public string ForId { get; set; } = string.Empty; }