-
-
Notifications
You must be signed in to change notification settings - Fork 26
docs: add Home page with library usage examples #241
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c7facd8
feat(icons): add more icons
desmondinho 398cab0
docs: add showcases on home page
desmondinho 9114d81
chore(components): adjust some styles
desmondinho 83c80be
docs(overview): update paths
desmondinho a860129
chore(docs): nits
desmondinho 395e534
fix(components): add missing popover js parts
desmondinho 124e019
chore(docs): nits
desmondinho 8d55d98
fix(popover): use overlay to close instead of custom outside click event
desmondinho fb26f3d
fix(tooltip): remove pressed effect from on trigger hover
desmondinho 788b4b7
chore(showcases): complete column visibility toggling in UserTable ex…
desmondinho 10118ca
chore(showcases): adjust legend color in usage chart
desmondinho 72ca33e
test(popover): update tests
desmondinho e305615
chore(docs): coderabbit suggestions
desmondinho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
33 changes: 33 additions & 0 deletions
33
docs/LumexUI.Docs.Client/Components/Layouts/HomeLayout.razor
This file contains hidden or 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,33 @@ | ||
| @namespace LumexUI.Docs.Client.Components | ||
| @inherits LayoutComponentBase | ||
| @layout MainLayout | ||
|
|
||
| <Header Bordered="@false" | ||
| MaxWidth="@MaxWidth.XXLarge" | ||
| Class="before:backdrop-saturate-100" /> | ||
|
|
||
| @Body | ||
|
|
||
| <footer class="mt-12 text-small/6"> | ||
| <div class="py-10 flex flex-col justify-center items-center gap-3"> | ||
| <p class="text-default-500"> | ||
| © @(DateTimeOffset.UtcNow.ToString( "yyyy" )) LumexUI. All rights reserved. | ||
| </p> | ||
|
|
||
| <div class="flex items-center gap-1"> | ||
| <LumexLink Href="https://github.com/LumexUI/lumexui" | ||
| External="@true" | ||
| Class="p-1 text-default-600"> | ||
| <GithubIcon Size="20" /> | ||
| <span class="sr-only">GitHub</span> | ||
| </LumexLink> | ||
|
|
||
| <LumexLink Href="https://discord.gg/jjgMz3apcb" | ||
| External="@true" | ||
| Class="p-1 text-default-600"> | ||
| <DiscordIcon Size="20" /> | ||
| <span class="sr-only">Discord</span> | ||
| </LumexLink> | ||
| </div> | ||
| </div> | ||
| </footer> |
This file contains hidden or 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,54 @@ | ||
| @namespace LumexUI.Docs.Client.Components | ||
| @rendermode InteractiveWebAssembly | ||
|
|
||
| <LumexSelect TValue="ThemeColor" | ||
| LabelPlacement="@LabelPlacement.Outside" | ||
| Value="@_themeColor" | ||
| ValueChanged="@HandleThemeChange" | ||
| Class="max-w-40"> | ||
| <ChildContent> | ||
| @foreach( var color in Enum.GetValues<ThemeColor>()[1..] ) | ||
| { | ||
| <LumexSelectItem @key="@color" Value="@color"> | ||
| <div class="flex gap-2 items-center"> | ||
| <span class="w-4 h-4 border border-default-900/10 rounded-full shrink-0 @_themeColorMap[color]" /> | ||
| @color.ToString() | ||
| </div> | ||
| </LumexSelectItem> | ||
| } | ||
| </ChildContent> | ||
| <ValueContent Context="color"> | ||
| <div class="flex gap-2 items-center"> | ||
| <span class="w-4 h-4 border border-default-900/10 rounded-full shrink-0 @_themeColorMap[color]" /> | ||
| @color.ToString() | ||
| </div> | ||
| </ValueContent> | ||
| </LumexSelect> | ||
|
|
||
| @code { | ||
| [Inject] private DocsThemeService ThemeService { get; set; } = default!; | ||
|
|
||
| private readonly Dictionary<ThemeColor, string> _themeColorMap = new() | ||
| { | ||
| [ThemeColor.Default] = "bg-default", | ||
| [ThemeColor.Primary] = "bg-primary", | ||
| [ThemeColor.Secondary] = "bg-secondary", | ||
| [ThemeColor.Success] = "bg-success", | ||
| [ThemeColor.Warning] = "bg-warning", | ||
| [ThemeColor.Danger] = "bg-danger", | ||
| [ThemeColor.Info] = "bg-info" | ||
| }; | ||
|
|
||
| private ThemeColor _themeColor = ThemeColor.Default; | ||
|
|
||
| private void HandleThemeChange( ThemeColor color ) | ||
| { | ||
| if( color is ThemeColor.None ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| _themeColor = color; | ||
| ThemeService.SetThemeColor( color ); | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| @page "/" | ||
| @page "/docs/getting-started" | ||
| @page "/docs/getting-started/overview" | ||
| @layout DocsContentLayout | ||
|
|
||
|
|
||
51 changes: 51 additions & 0 deletions
51
docs/LumexUI.Docs.Client/Pages/Home/Examples/ActivityGoal.razor
This file contains hidden or 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,51 @@ | ||
| @rendermode InteractiveWebAssembly | ||
| @inherits ExampleComponentBase | ||
|
|
||
| <LumexCard Classes="@(new() | ||
| { | ||
| Header = "flex-col items-start p-6 pb-0 gap-1", | ||
| Body = "px-6 py-5 gap-4", | ||
| Footer = "p-6 pt-0" | ||
| })"> | ||
| <LumexCardHeader> | ||
| <div class="font-semibold text-foreground-900">Move Goal</div> | ||
| <p class="text-small text-foreground-500">Set your daily activity goal.</p> | ||
| </LumexCardHeader> | ||
|
|
||
| <LumexCardBody> | ||
| <div class="flex items-center justify-center gap-4"> | ||
| <LumexButton IconOnly="@true" | ||
| Disabled="@(_caloriesDay <= _minCalories)" | ||
| Size="@LumexUI.Common.Size.Small" | ||
| Radius="@Radius.Full" | ||
| Variant="@Variant.Light" | ||
| OnClick="@DecrementCalories" | ||
| Class="size-7 min-w-7 border border-default-900/10"> | ||
| <MinusIcon Size="16" /> | ||
| </LumexButton> | ||
|
|
||
| <div class="text-center"> | ||
| <div class="text-foreground-900 text-4xl font-bold tracking-tighter tabular-nums">@_caloriesDay</div> | ||
| <div class="text-foreground text-tiny uppercase">Calories/day</div> | ||
| </div> | ||
|
|
||
| <LumexButton IconOnly="@true" | ||
| Disabled="@(_caloriesDay >= _maxCalories)" | ||
| Size="@LumexUI.Common.Size.Small" | ||
| Radius="@Radius.Full" | ||
| Variant="@Variant.Light" | ||
| OnClick="@IncrementCalories" | ||
| Class="size-7 min-w-7 border border-default-900/10"> | ||
| <PlusIcon Size="16" /> | ||
| </LumexButton> | ||
| </div> | ||
|
|
||
| <div class="h-20 @_chartCssVariables[ThemeColor]"> | ||
| <div id="chart-activity" /> | ||
| </div> | ||
| </LumexCardBody> | ||
|
|
||
| <LumexCardFooter> | ||
| <LumexButton FullWidth="@true" Variant="@Variant.Flat">Set goal</LumexButton> | ||
| </LumexCardFooter> | ||
| </LumexCard> |
43 changes: 43 additions & 0 deletions
43
docs/LumexUI.Docs.Client/Pages/Home/Examples/ActivityGoal.razor.cs
This file contains hidden or 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,43 @@ | ||
| // Copyright (c) LumexUI 2024 | ||
| // LumexUI licenses this file to you under the MIT license | ||
| // See the license here https://github.com/LumexUI/lumexui/blob/main/LICENSE | ||
|
|
||
| using LumexUI.Common; | ||
|
|
||
| using Microsoft.AspNetCore.Components; | ||
| using Microsoft.JSInterop; | ||
|
|
||
| namespace LumexUI.Docs.Client.Pages.Home.Examples; | ||
|
|
||
| public partial class ActivityGoal : ExampleComponentBase | ||
| { | ||
| private const int _minCalories = 200; | ||
| private const int _maxCalories = 400; | ||
|
|
||
| private readonly Dictionary<ThemeColor, string> _chartCssVariables = new() | ||
| { | ||
| [ThemeColor.Default] = "[--chart:var(--lumex-default-900)]", | ||
| [ThemeColor.Primary] = "[--chart:var(--lumex-primary)]", | ||
| [ThemeColor.Secondary] = "[--chart:var(--lumex-secondary)]", | ||
| [ThemeColor.Success] = "[--chart:var(--lumex-success)]", | ||
| [ThemeColor.Warning] = "[--chart:var(--lumex-warning)]", | ||
| [ThemeColor.Danger] = "[--chart:var(--lumex-danger)]", | ||
| [ThemeColor.Info] = "[--chart:var(--lumex-info)]", | ||
| }; | ||
|
|
||
| private int _caloriesDay = 350; | ||
|
|
||
| [Inject] private IJSRuntime JSRuntime { get; set; } = default!; | ||
|
|
||
| protected override async Task OnAfterRenderAsync( bool firstRender ) | ||
| { | ||
| if( firstRender ) | ||
| { | ||
| await JSRuntime.InvokeVoidAsync( "charts.activity.initialize" ); | ||
| } | ||
| } | ||
|
|
||
| private void DecrementCalories() => SetCalories( -10 ); | ||
| private void IncrementCalories() => SetCalories( +10 ); | ||
| private void SetCalories( int value ) => _caloriesDay += value; | ||
| } |
70 changes: 70 additions & 0 deletions
70
docs/LumexUI.Docs.Client/Pages/Home/Examples/Authentication.razor
This file contains hidden or 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,70 @@ | ||
| @rendermode InteractiveWebAssembly | ||
| @inherits ExampleComponentBase | ||
|
|
||
| <LumexCard Classes="@(new() | ||
| { | ||
| Header = "p-6 pb-0", | ||
| Body = "flex-col p-6 gap-4", | ||
| Footer = "p-6 pt-0 justify-center" | ||
| })"> | ||
| <LumexCardHeader> | ||
| <div class="text-xl text-foreground-900 font-medium"> | ||
| Sign in to your account | ||
| </div> | ||
| </LumexCardHeader> | ||
|
|
||
| <LumexCardBody> | ||
| @if( !_isEmailLogin ) | ||
| { | ||
| <LumexButton Color="@ThemeColor" | ||
| OnClick="@(() => _isEmailLogin = true)"> | ||
| <StartContent> | ||
| <EnvelopeFilledIcon Size="20" /> | ||
| </StartContent> | ||
| <ChildContent>Continue with email</ChildContent> | ||
| </LumexButton> | ||
| } | ||
| else | ||
| { | ||
| <EditForm Model="@LoginModel" FormName="login" class="flex flex-col gap-4"> | ||
| <LumexTextbox Type="@InputType.Email" | ||
| Label="Email" | ||
| @bind-Value="@LoginModel.Email" /> | ||
| <LumexButton Type="@ButtonType.Submit" | ||
| Color="@ThemeColor"> | ||
| Continue | ||
| </LumexButton> | ||
| </EditForm> | ||
| } | ||
|
|
||
| <div class="flex items-center gap-4 py-2"> | ||
| <LumexDivider /> | ||
| <p class="shrink-0 text-tiny text-default-500">OR</p> | ||
| <LumexDivider /> | ||
| </div> | ||
|
|
||
| <LumexButton Variant="@Variant.Flat"> | ||
| <StartContent> | ||
| <GoogleIcon Size="20" /> | ||
| </StartContent> | ||
| <ChildContent>Continue with Google</ChildContent> | ||
| </LumexButton> | ||
|
|
||
| <LumexButton Variant="@Variant.Flat"> | ||
| <StartContent> | ||
| <GithubIcon Size="20" /> | ||
| </StartContent> | ||
| <ChildContent>Continue with Github</ChildContent> | ||
| </LumexButton> | ||
| </LumexCardBody> | ||
|
|
||
| <LumexCardFooter> | ||
| <p class="text-small text-foreground-500"> | ||
| Need to create an account? | ||
| <LumexLink Color="@ThemeColor" | ||
| Class="@($"font-medium {(ThemeColor is ThemeColor.Default ? "text-foreground" : default)}")"> | ||
| Sign Up | ||
| </LumexLink> | ||
| </p> | ||
| </LumexCardFooter> | ||
| </LumexCard> |
18 changes: 18 additions & 0 deletions
18
docs/LumexUI.Docs.Client/Pages/Home/Examples/Authentication.razor.cs
This file contains hidden or 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 @@ | ||
| using Microsoft.AspNetCore.Components; | ||
|
|
||
| namespace LumexUI.Docs.Client.Pages.Home.Examples; | ||
|
|
||
| public partial class Authentication : ExampleComponentBase | ||
| { | ||
| [SupplyParameterFromForm] | ||
| private Login LoginModel { get; set; } = new(); | ||
|
|
||
| private bool _isEmailLogin; | ||
|
|
||
| private void Submit() { } | ||
|
|
||
| public sealed record Login | ||
| { | ||
| public string? Email { get; set; } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify updated route exists and is linked correctly.
Ensure a page is bound to “/docs/getting-started” and that any previous "/" or "/docs" routes redirect appropriately.
Run this to confirm the route and find potential stale routes:
🏁 Script executed:
Length of output: 228
🏁 Script executed:
Length of output: 692
Missing
/docsroute redirect/docswill 404 unless you add a redirect or stub page./) is still served by Home.razor.Please add a page or redirect for
/docs(for example, a Razor component with@page "/docs"that forwards to/docs/getting-started) so old links don’t break.🤖 Prompt for AI Agents