Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki committed Feb 18, 2024
1 parent 1270cf2 commit 6c93285
Show file tree
Hide file tree
Showing 38 changed files with 1,350 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Demos/Blazorise.Demo.FluentUI2/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#region Using directives
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Blazorise.FluentUI2;
using Blazorise.Icons.FluentUI;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
#endregion

namespace Blazorise.Demo.FluentUI2;
Expand All @@ -19,8 +22,8 @@ public static async Task Main( string[] args )
.AddFluentUIIcons();

builder.RootComponents.Add<App>( "#app" );
var host = builder.Build();
builder.Services.AddScoped( sp => new HttpClient { BaseAddress = new Uri( builder.HostEnvironment.BaseAddress ) } );

await host.RunAsync();
await builder.Build().RunAsync();
}
}
3 changes: 1 addition & 2 deletions Demos/Blazorise.Demo.Tailwind/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Blazorise.Tailwind;
using Blazorise.Icons.FontAwesome;
using Blazorise.RichTextEdit;
using Blazorise.Tailwind;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
#endregion
Expand Down
1 change: 1 addition & 0 deletions Demos/Blazorise.Demo/Components/SideMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<BarDropdownItem To="tests/steps">Steps</BarDropdownItem>
<BarDropdownItem To="tests/tables">Tables</BarDropdownItem>
<BarDropdownItem To="tests/tabs">Tabs</BarDropdownItem>
<BarDropdownItem To="tests/toasts">Toasts</BarDropdownItem>
<BarDropdownItem To="tests/tooltips">Tooltips</BarDropdownItem>
<BarDropdownItem To="tests/typography">Typography</BarDropdownItem>
</BarDropdownMenu>
Expand Down
78 changes: 78 additions & 0 deletions Demos/Blazorise.Demo/Pages/Tests/ToastPage.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@page "/tests/toasts";

<Row>
<Column>
<Card Margin="Margin.Is4.OnY">
<CardHeader>
<CardTitle>Toast (Configuration)</CardTitle>
</CardHeader>
<CardBody>
<Row>
<Column ColumnSize="ColumnSize.IsAuto">
<Field>
<FieldLabel>
Animation
</FieldLabel>
<FieldBody>
<Switch @bind-Checked="@animation">Animation</Switch>
</FieldBody>
</Field>
</Column>
<Column ColumnSize="ColumnSize.IsAuto">
<Field>
<FieldLabel>
Animation Duration (ms)
</FieldLabel>
<FieldBody>
<NumericEdit TValue="int" @bind-Value="animationDuration" />
</FieldBody>
</Field>
</Column>
</Row>
</CardBody>
</Card>
</Column>
</Row>

<Row>
<Column>
<Card Margin="Margin.Is4.OnY">
<CardHeader>
<CardTitle>Modals (Default)</CardTitle>
</CardHeader>
<CardBody>
<CardText>
A rendered modal with header, body, and set of actions in the footer.
</CardText>
</CardBody>
<CardBody>
<Button Color="Color.Primary" Clicked="@(()=>toastRef.Show())">
Show Toast
</Button>
</CardBody>
</Card>
</Column>
</Row>

<ToastContainer>
<Toast @ref="toastRef" Animated="@animation" AnimationDuration="@animationDuration">
<ToastHeader>
<Span>Toast Header</Span>
<CloseButton Clicked="@HideToast" />
</ToastHeader>
<ToastBody>
Hello, world! This is a toast message.
</ToastBody>
</Toast>
</ToastContainer>
@code {
Toast toastRef;

private bool animation = true;
private int animationDuration = 300;

private Task HideToast()
{
return toastRef.Hide();
}
}
20 changes: 20 additions & 0 deletions Source/Blazorise.AntDesign/AntDesignClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,26 @@ public override string OffcanvasFade( bool showing, bool hiding ) => showing

#endregion

#region Toast

public override string Toast() => null;

public override string ToastPlacement( ToastPlacement placement, bool visible ) => null;

public override string ToastFade( bool showing, bool hiding ) => null;

public override string ToastVisible( bool visible ) => null;

public override string ToastHeader() => null;

public override string ToastBody() => null;

public override string ToastContainer() => null;

public override string ToastContainerPlacement( ToastPlacement placement, bool visible ) => null;

#endregion

#region Pagination

public override string Pagination() => "ant-pagination";
Expand Down
9 changes: 9 additions & 0 deletions Source/Blazorise.AntDesign/AntDesignStyleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,13 @@ public override string OffcanvasBackdropAnimationDuration( bool animated, int an
: "transition-duration: unset";

#endregion

#region Toast

public override string ToastAnimationDuration( bool animated, int animationDuration )
=> animated
? $"transition-duration: {animationDuration}ms"
: "transition-duration: unset";

#endregion
}
24 changes: 24 additions & 0 deletions Source/Blazorise.Bootstrap/BootstrapClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,30 @@ public override string OffcanvasFade( bool showing, bool hiding ) => showing

#endregion

#region Toast

public override string Toast() => "toast";

public override string ToastPlacement( ToastPlacement placement, bool visible ) => null;

public override string ToastFade( bool showing, bool hiding ) => showing
? "showing"
: hiding
? "hiding"
: null;

public override string ToastVisible( bool visible ) => visible ? Show() : null;

public override string ToastHeader() => "toast-header";

public override string ToastBody() => "toast-body";

public override string ToastContainer() => "position-fixed bottom-0 right-0 p-3";

public override string ToastContainerPlacement( ToastPlacement placement, bool visible ) => null;

#endregion

#region Pagination

public override string Pagination() => "pagination";
Expand Down
9 changes: 9 additions & 0 deletions Source/Blazorise.Bootstrap/BootstrapStyleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ public override string OffcanvasBackdropAnimationDuration( bool animated, int an
: "transition-duration: unset";

#endregion

#region Toast

public override string ToastAnimationDuration( bool animated, int animationDuration )
=> animated
? $"transition-duration: {animationDuration}ms"
: "transition-duration: unset";

#endregion
}
24 changes: 24 additions & 0 deletions Source/Blazorise.Bootstrap5/Bootstrap5ClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,30 @@ public override string OffcanvasFade( bool showing, bool hiding ) => showing

#endregion

#region Toast

public override string Toast() => "toast";

public override string ToastPlacement( ToastPlacement placement, bool visible ) => null;

public override string ToastFade( bool showing, bool hiding ) => showing
? "showing"
: hiding
? "hiding"
: null;

public override string ToastVisible( bool visible ) => visible ? Show() : null;

public override string ToastHeader() => "toast-header";

public override string ToastBody() => "toast-body";

public override string ToastContainer() => "position-fixed bottom-0 right-0 p-3";

public override string ToastContainerPlacement( ToastPlacement placement, bool visible ) => null;

#endregion

#region Pagination

public override string Pagination() => "pagination";
Expand Down
9 changes: 9 additions & 0 deletions Source/Blazorise.Bootstrap5/Bootstrap5StyleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ public override string OffcanvasBackdropAnimationDuration( bool animated, int an
: "transition-duration: unset";

#endregion

#region Toast

public override string ToastAnimationDuration( bool animated, int animationDuration )
=> animated
? $"transition-duration: {animationDuration}ms"
: "transition-duration: unset";

#endregion
}
20 changes: 20 additions & 0 deletions Source/Blazorise.Bulma/BulmaClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,26 @@ public override string OffcanvasFade( bool showing, bool hiding ) => showing

#endregion

#region Toast

public override string Toast() => null;

public override string ToastPlacement( ToastPlacement placement, bool visible ) => null;

public override string ToastFade( bool showing, bool hiding ) => null;

public override string ToastVisible( bool visible ) => null;

public override string ToastHeader() => null;

public override string ToastBody() => null;

public override string ToastContainer() => null;

public override string ToastContainerPlacement( ToastPlacement placement, bool visible ) => null;

#endregion

#region Pagination

public override string Pagination() => "pagination-list";
Expand Down
9 changes: 9 additions & 0 deletions Source/Blazorise.Bulma/BulmaStyleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ public override string OffcanvasBackdropAnimationDuration( bool animated, int an
: "transition-duration: unset";

#endregion

#region Toast

public override string ToastAnimationDuration( bool animated, int animationDuration )
=> animated
? $"transition-duration: {animationDuration}ms"
: "transition-duration: unset";

#endregion
}
24 changes: 24 additions & 0 deletions Source/Blazorise.FluentUI2/Providers/FluentUI2ClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,30 @@ public override string OffcanvasBackdropFade( bool showing, bool hiding ) => sho

#endregion

#region Toast

public override string Toast() => "fui-Toast";

public override string ToastPlacement( ToastPlacement placement, bool visible ) => null;

public override string ToastFade( bool showing, bool hiding ) => showing
? "fui-Toast-showing"
: hiding
? "fui-Toast-hiding"
: null;

public override string ToastVisible( bool visible ) => visible ? "fui-Toast-show" : null;

public override string ToastHeader() => "fui-ToastHeader";

public override string ToastBody() => "fui-ToastBody";

public override string ToastContainer() => "fui-ToastContainer";

public override string ToastContainerPlacement( ToastPlacement placement, bool visible ) => null;

#endregion

#region Pagination

public override string Pagination() => "fui-Pagination";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,13 @@ public override string OffcanvasBackdropAnimationDuration( bool animated, int an
: "--durationGentle: 0ms";

#endregion

#region Toast

public override string ToastAnimationDuration( bool animated, int animationDuration )
=> animated
? $"--durationGentle: {animationDuration}ms"
: "--durationGentle: 0ms";

#endregion
}
1 change: 1 addition & 0 deletions Source/Blazorise.FluentUI2/Styles/blazorise.fluentui2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@import "components/switch";
@import "components/table";
@import "components/tabs";
@import "components/toast";
@import "components/tooltip";
@import "components/typography";

Expand Down
Loading

0 comments on commit 6c93285

Please sign in to comment.