-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e56b6ad
commit b735039
Showing
8 changed files
with
183 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@inherits FluentComponentBase | ||
|
||
<div class="settings-card"> | ||
<FluentCard AreaRestricted="false" Style="padding: var(--settings-card-padding);"> | ||
<div class="root-grid"> | ||
<div style="display: flex; align-items: center;"> | ||
<div class="icon-holder"> | ||
@Icon | ||
</div> | ||
<div class="header-panel"> | ||
<span>@Header</span> | ||
<span class="description">@Description</span> | ||
</div> | ||
</div> | ||
@ActionContent | ||
</div> | ||
</FluentCard> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.FluentUI.AspNetCore.Components; | ||
|
||
namespace Wherlog.Controls | ||
{ | ||
public partial class SettingsCard : FluentComponentBase | ||
{ | ||
/// <summary> | ||
/// Gets or sets the Header. | ||
/// </summary> | ||
[Parameter] | ||
public RenderFragment Header { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the description. | ||
/// </summary> | ||
[Parameter] | ||
public RenderFragment Description { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the icon on the left. | ||
/// </summary> | ||
[Parameter] | ||
public RenderFragment Icon { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the icon that is shown when IsClickEnabled is set to true. | ||
/// </summary> | ||
[Parameter] | ||
public RenderFragment ActionIcon { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the content of a ContentControl. | ||
/// </summary> | ||
[Parameter] | ||
public RenderFragment ActionContent { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the tooltip of the ActionIcon. | ||
/// </summary> | ||
[Parameter] | ||
public string ActionIconToolTip { get; set; } = "More"; | ||
|
||
/// <summary> | ||
/// Gets or sets if the card can be clicked. | ||
/// </summary> | ||
[Parameter] | ||
public bool IsClickEnabled { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the alignment of the Content. | ||
/// </summary> | ||
[Parameter] | ||
public ContentAlignment ContentAlignment { get; set; } | ||
} | ||
|
||
public enum ContentAlignment | ||
{ | ||
/// <summary> | ||
/// The Content is aligned to the right. Default state. | ||
/// </summary> | ||
Right, | ||
/// <summary> | ||
/// The Content is left-aligned while the Header, HeaderIcon and Description are collapsed. This is commonly used for Content types such as CheckBoxes, RadioButtons and custom layouts. | ||
/// </summary> | ||
Left, | ||
/// <summary> | ||
/// The Content is vertically aligned. | ||
/// </summary> | ||
Vertical | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
* { | ||
--settings-card-border-thickness: 1px; | ||
--settings-card-padding: 16px; | ||
--settings-card-description-font-size: 12px; | ||
--settings-card-header-icon-max-size: 20px; | ||
--settings-card-content-min-width: 240px; | ||
--settings-card-header-icon-margin: 0px 20px 0px 2px; | ||
} | ||
|
||
::deep div.root-grid { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
::deep div.icon-holder { | ||
max-width: var(--settings-card-header-icon-max-size); | ||
max-height: var(--settings-card-header-icon-max-size); | ||
margin: var(--settings-card-header-icon-margin); | ||
} | ||
|
||
::deep div.header-panel { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 0px 24px 0px 0px; | ||
} | ||
|
||
::deep span.description { | ||
font-size: var(--settings-card-description-font-size); | ||
color: var(--neutral-fill-strong-hover); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters