Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Boilerplate for new version of BlazorUI (#8203) #8204

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $bit-color-primary-light-active: var(--bit-clr-pri-light-active);
$bit-color-primary-text: var(--bit-clr-pri-text);

//secondary
$bit-color-secondary-main: var(--bit-clr-sec);
$bit-color-secondary: var(--bit-clr-sec);
$bit-color-secondary-hover: var(--bit-clr-sec-hover);
$bit-color-secondary-active: var(--bit-clr-sec-active);
$bit-color-secondary-dark: var(--bit-clr-sec-dark);
Expand All @@ -24,7 +24,7 @@ $bit-color-secondary-light-active: var(--bit-clr-sec-light-active);
$bit-color-secondary-text: var(--bit-clr-sec-text);

//tertiary
$bit-color-tertiary-main: var(--bit-clr-ter);
$bit-color-tertiary: var(--bit-clr-ter);
$bit-color-tertiary-hover: var(--bit-clr-ter-hover);
$bit-color-tertiary-active: var(--bit-clr-ter-active);
$bit-color-tertiary-dark: var(--bit-clr-ter-dark);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else if (ErrorContent is null)
{
<div class="main">
<div class="header">
<BitIconButton OnClick="Recover" IconName="@BitIconName.ChromeClose" />
<BitButton OnClick="Recover" IconName="@BitIconName.ChromeClose" Variant="BitVariant.Text" />
</div>
<div>
<img src="_content/Boilerplate.Client.Core/images/icons/error-triangle.svg" />
Expand All @@ -19,8 +19,8 @@ else if (ErrorContent is null)
<div class="exception">@CurrentException?.ToString()</div>
}
<div class="buttons">
<BitButton OnClick="Refresh" ButtonStyle="BitButtonStyle.Primary">Refresh</BitButton>
<BitButton OnClick="GoHome" ButtonStyle="BitButtonStyle.Standard">Home</BitButton>
<BitButton OnClick="Refresh">Refresh</BitButton>
<BitButton OnClick="GoHome" Variant="BitVariant.Outline">Home</BitButton>
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

.title {
color: $bit-color-state-error;
color: $bit-color-error;
}

.exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
<div class="main-container">
<div class="header">
<span class="title">@title</span>
<BitIconButton IconName="@BitIconName.ChromeClose" OnClick="@(() => Confirm(false))" />
<BitButton IconName="@BitIconName.ChromeClose" OnClick="@(() => Confirm(false))" Variant="BitVariant.Text" />
</div>
<div class="body">
@message
</div>
<div class="btn-group">
<BitButton ButtonStyle="BitButtonStyle.Primary"
Style="margin-inline-end: 0.5rem"
OnClick="@(() => Confirm(true))">
<BitButton Style="margin-inline-end: 0.5rem" OnClick="@(() => Confirm(true))">
@Localizer[nameof(AppStrings.Yes)]
</BitButton>

<BitButton ButtonStyle="BitButtonStyle.Standard"
OnClick="@(() => Confirm(false))">
<BitButton Variant="BitVariant.Outline" OnClick="@(() => Confirm(false))">
@Localizer[nameof(AppStrings.No)]
</BitButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,8 @@
}
}

.text--red {
color: $bit-color-state-required;
}

::deep {
.culture-drp {
width: rem2(104px);
}
::deep .culture-drp {
width: rem2(104px);
}

.theme-container {
Expand All @@ -78,7 +72,7 @@
border-radius: 50%;
min-width: rem2(35px);
color: $bit-color-primary-text;
background-color: $bit-color-primary-main;
background-color: $bit-color-primary;

.icon-container {
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
<div class="header-contact">
@if (isUserAuthenticated)
{
<BitIconButton Class="header-menu" IconName="@BitIconName.CollapseMenu" OnClick=ToggleMenu />
<BitButton Class="header-menu" IconName="@BitIconName.CollapseMenu" OnClick="ToggleMenu" Variant="BitVariant.Text" />
}
<a class="logo-lnk" href="@Urls.HomePage"></a>
</div>
<div class="header-contact">
@if (!isUserAuthenticated)
@if (isUserAuthenticated is false)
{
<BitActionButton Class="header-item" IconName="@BitIconName.EntityExtraction" Href="@Urls.TermsPage" Target="_self">@Localizer[nameof(AppStrings.TermsTitle)]</BitActionButton>
<BitActionButton Class="header-item" IconName="@BitIconName.AddFriend" Href="@Urls.SignUpPage" Target="_self">@Localizer[nameof(AppStrings.SignUp)]</BitActionButton>
<BitActionButton Class="header-item" IconName="@BitIconName.Signin" Href="@Urls.SignInPage" Target="_self">@Localizer[nameof(AppStrings.SignIn)]</BitActionButton>
<BitActionButton Class="header-item" IconName="@BitIconName.EntityExtraction" Href="@Urls.TermsPage" Target="_self">
@Localizer[nameof(AppStrings.TermsTitle)]
</BitActionButton>
<BitActionButton Class="header-item" IconName="@BitIconName.AddFriend" Href="@Urls.SignUpPage" Target="_self">
@Localizer[nameof(AppStrings.SignUp)]
</BitActionButton>
<BitActionButton Class="header-item" IconName="@BitIconName.Signin" Href="@Urls.SignInPage" Target="_self">
@Localizer[nameof(AppStrings.SignIn)]
</BitActionButton>
}
</div>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
display: none;

@include lt-lg {
display: block;
display: flex;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ main {
text-align: start;
font-size: rem2(12px);
line-height: rem2(16px);
color: $bit-color-state-error;
color: $bit-color-error;
}

.form-submit-button {
Expand All @@ -142,3 +142,7 @@ main {
scroll-margin-top: calc($headerHeight + env(safe-area-inset-top) + 1px);
}
}

::deep .loading-container {
text-align: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="main">
<div class="header">
<span class="title">@title</span>
<BitIconButton IconName="@BitIconName.ChromeClose" OnClick="OnCloseClick" />
<BitButton IconName="@BitIconName.ChromeClose" OnClick="OnCloseClick" Variant="BitVariant.Text" />
</div>
<div class="body">
@body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
</ImageOverlayTemplate>
</BitPersona>
<br />
<BitActionButton IconName="@BitIconName.SignOut" OnClick=DoSignOut>
<BitActionButton IconName="@BitIconName.SignOut" OnClick=DoSignOut Style="width:fit-content">
@Localizer[nameof(AppStrings.SignOut)]
</BitActionButton>
</div>
<BitNav Items="navItems"
AriaLabel="NavMenu"
DefaultSelectedItem="navItems[0]"
OnItemClick="(BitNavItem item) => HandleNavItemClick(item)">
</BitNav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<BitModal @bind-IsOpen="IsOpen" IsBlocking="true" AutoToggleScroll="false">
<div class="modal-body">
<div class="modal-close-btn-container">
<BitIconButton OnClick="CloseModal" IconName="@BitIconName.ChromeClose" Title="Close" />
<BitButton OnClick="CloseModal" IconName="@BitIconName.ChromeClose" Title="Close" Variant="BitVariant.Text" />
</div>
<div class="modal-title">@Localizer[nameof(AppStrings.SignOut)]</div>
<div class="modal-desc">@Localizer[nameof(AppStrings.SignOutPrompt)]</div>
<div>
<BitButton ButtonStyle="BitButtonStyle.Primary" OnClick="SignOut">@Localizer[nameof(AppStrings.SignOut)]</BitButton>
<BitButton ButtonStyle="BitButtonStyle.Standard" OnClick="CloseModal">@Localizer[nameof(AppStrings.Cancel)]</BitButton>
<BitButton OnClick="SignOut">
@Localizer[nameof(AppStrings.SignOut)]
</BitButton>
<BitButton OnClick="CloseModal" Variant="BitVariant.Outline">
@Localizer[nameof(AppStrings.Cancel)]
</BitButton>
</div>
</div>
</BitModal>
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

<div class="page-container">
<div class="page-header">
<BitIconButton Class="back-btn"
Href="@Urls.CategoriesPage"
IconName="@BitIconName.Back"
Title="@Localizer[nameof(AppStrings.Back)]" />
<BitButton Class="back-btn"
Variant="BitVariant.Text"
Href="@Urls.CategoriesPage"
IconName="@BitIconName.Back"
Title="@Localizer[nameof(AppStrings.Back)]" />
<h1 class="page-title">
@if (category.Id == default)
{
Expand All @@ -32,66 +33,63 @@
<EditForm Model="category" OnValidSubmit="WrapHandled(Save)">
<AppDataAnnotationsValidator />

@if (isLoading)
@if (string.IsNullOrEmpty(saveMessage) is false)
{
<div class="loading-continaer">
<BitSpinner Size="BitSpinnerSize.Large"></BitSpinner>
</div>
<BitMessage Color="@saveMessageColor" OnDismiss="() => saveMessage = null">@saveMessage</BitMessage>
}

@if (string.IsNullOrEmpty(saveMessage) is false)
@if (isLoading)
{
<BitMessage Severity="@saveMessageSeverity" OnDismiss="() => saveMessage = null">@saveMessage</BitMessage>
<div class="loading-container">
<BitRingLoading />
</div>
}
else
{
<div class="form-input-container">
<BitTextField @bind-Value="category.Name"
Label="@Localizer[nameof(AppStrings.Name)]"
Placeholder="@Localizer[nameof(AppStrings.EnterCategoryName)]" />
<ValidationMessage For="() => category.Name" />
</div>

<div class="form-input-container">
<BitTextField @bind-Value="category.Name"
Label="@Localizer[nameof(AppStrings.Name)]"
Placeholder="@Localizer[nameof(AppStrings.EnterCategoryName)]" />
<ValidationMessage For="() => category.Name" />
</div>

<div class="form-input-container">
<BitLabel For="catColorInput">@Localizer[nameof(AppStrings.Color)]</BitLabel>
<div class="color-container">
<div class="color-btn-container">
@foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" })
{
<button @onclick="() => SetCategoryColor(color)"
class="color-btn @(category.Color == color ? "color-btn--active" : null)"
style="background-color: @color"
type="button" />
}
</div>
<div>
<BitButton ButtonStyle="BitButtonStyle.Standard" ButtonType="BitButtonType.Button" OnClick=@ToggleColorPicker>
<div class="custom-color-container">
<div class="color-square" style="background-color: @category.Color"></div>
<div class="form-input-container">
<BitLabel For="catColorInput">@Localizer[nameof(AppStrings.Color)]</BitLabel>
<BitStack Gap="1rem">
<BitStack Horizontal Gap="1rem">
@foreach (var color in new[] { "#FFCD56", "#FF6384", "#4BC0C0", "#FF9124", "#2B88D8", "#C7E0F4" })
{
<button @onclick="() => SetCategoryColor(color)"
class="color-btn @(category.Color == color ? "color-btn--active" : null)"
style="background-color: @color"
type="button" />
}
</BitStack>
<div />
<BitStack Horizontal Gap="1rem">
<div class="color-square selected" style="background-color: @category.Color"></div>
<BitToggleButton @bind-bind-IsChecked="isColorPickerOpen"
Variant="BitVariant.Outline"
OnClick=@ToggleColorPicker>
@Localizer[(nameof(AppStrings.CustomColor))]
</BitToggleButton>
</BitStack>
@if (isColorPickerOpen)
{
<div class="color-picker-container">
<BitColorPicker @bind-Color="category.Color" Id="catColorInput" ShowPreview="true">
@Localizer[nameof(AppStrings.DefaultColorPicker)]
</BitColorPicker>
</div>
</BitButton>
</div>
@if (isColorPickerOpen)
{
<div class="color-picker-container">
<BitColorPicker @bind-Color="category.Color"
id="catColorInput"
ShowPreview="true">
@Localizer[nameof(AppStrings.DefaultColorPicker)]
</BitColorPicker>
</div>
}
}
</BitStack>
<ValidationMessage For="() => category.Color" />
</div>
<ValidationMessage For="() => category.Color" />
</div>

<BitButton IsLoading="isSaving"
ButtonStyle="BitButtonStyle.Primary"
ButtonType="BitButtonType.Submit"
AriaLabel="Category">
@Localizer[nameof(AppStrings.Save)]
</BitButton>

<BitButton IsLoading="isSaving" ButtonType="BitButtonType.Submit">
@Localizer[nameof(AppStrings.Save)]
</BitButton>
}
</EditForm>
</div>

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class AddOrEditCategoryPage
private bool isSaving;
private string? saveMessage;
private bool isColorPickerOpen;
private BitSeverity saveMessageSeverity;
private BitColor saveMessageColor;
private CategoryDto category = new();

protected override async Task OnInitAsync()
Expand Down Expand Up @@ -69,14 +69,14 @@ private async Task Save()
}
catch (ResourceValidationException e)
{
saveMessageSeverity = BitSeverity.Error;
saveMessageColor = BitColor.Error;

saveMessage = string.Join(Environment.NewLine, e.Payload.Details.SelectMany(d => d.Errors).Select(e => e.Message));
}
catch (KnownException e)
{
saveMessage = e.Message;
saveMessageSeverity = BitSeverity.Error;
saveMessageColor = BitColor.Error;
}
finally
{
Expand Down
Loading
Loading