// Copyright (c) MudBlazor 2021
// MudBlazor licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Connected.Annotations;
using Microsoft.AspNetCore.Components;
using Connected.Utilities;
namespace Connected.Components;
public partial class Paper : UIComponent
{
protected string Classname =>
new CssBuilder("mud-paper")
.AddClass($"mud-paper-outlined", Outlined)
.AddClass($"mud-paper-square", Square)
.AddClass($"mud-elevation-{Elevation.ToString()}", !Outlined)
.AddClass(Class)
.Build();
protected string Stylename =>
new StyleBuilder()
.AddStyle("height", $"{Height}", !String.IsNullOrEmpty(Height))
.AddStyle("width", $"{Width}", !String.IsNullOrEmpty(Width))
.AddStyle("max-height", $"{MaxHeight}", !String.IsNullOrEmpty(MaxHeight))
.AddStyle("max-width", $"{MaxWidth}", !String.IsNullOrEmpty(MaxWidth))
.AddStyle("min-height", $"{MinHeight}", !String.IsNullOrEmpty(MinHeight))
.AddStyle("min-width", $"{MinWidth}", !String.IsNullOrEmpty(MinWidth))
.AddStyle(Style)
.Build();
///
/// The higher the number, the heavier the drop-shadow.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public int Elevation { set; get; } = 1;
///
/// If true, border-radius is set to 0.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public bool Square { get; set; }
///
/// If true, card will be outlined.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public bool Outlined { get; set; }
///
/// Height of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string Height { get; set; }
///
/// Width of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string Width { get; set; }
///
/// Max-Height of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string MaxHeight { get; set; }
///
/// Max-Width of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string MaxWidth { get; set; }
///
/// Min-Height of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string MinHeight { get; set; }
///
/// Min-Width of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Appearance)]
public string MinWidth { get; set; }
///
/// Child content of the component.
///
[Parameter]
[Category(CategoryTypes.Paper.Behavior)]
public RenderFragment ChildContent { get; set; }
}