Skip to content

Commit fdc813c

Browse files
authored
refactor(*): remove all bundled Google Material Icons and related code (#232)
* build: add new shared icons project * feat(icons): add base icon component * feat(icons): add dynamic icon component * feat(icons): add some icons * build(deps): reference icons in components * refactor(accordion): use new icon components * docs(components): use new icons in Callout components * docs(*): use new icons * refactor(icons): add "Icon" suffix; add more icons * docs(*): use new icons * test(*): fix tests * refactor(components): remove `LumexIcon` component * docs(datagrid): formatting * refactor(icons): remove all Google Material Icons * refactor(icons): remove script for downloading/updating icons
1 parent f13177e commit fdc813c

File tree

222 files changed

+2489
-11969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+2489
-11969
lines changed

LumexUI.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LumexUI.Docs", "docs\LumexU
2626
EndProject
2727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LumexUI.Docs.Client", "docs\LumexUI.Docs.Client\LumexUI.Docs.Client.csproj", "{6CE81AB3-399F-44CB-9DBE-9A8D62B07C8A}"
2828
EndProject
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LumexUI.Shared.Icons", "src\LumexUI.Shared.Icons\LumexUI.Shared.Icons.csproj", "{9C883692-7F43-4E72-8610-AB1996BED8BC}"
30+
EndProject
2931
Global
3032
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3133
Debug|Any CPU = Debug|Any CPU
@@ -52,6 +54,10 @@ Global
5254
{6CE81AB3-399F-44CB-9DBE-9A8D62B07C8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
5355
{6CE81AB3-399F-44CB-9DBE-9A8D62B07C8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
5456
{6CE81AB3-399F-44CB-9DBE-9A8D62B07C8A}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{9C883692-7F43-4E72-8610-AB1996BED8BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{9C883692-7F43-4E72-8610-AB1996BED8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{9C883692-7F43-4E72-8610-AB1996BED8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{9C883692-7F43-4E72-8610-AB1996BED8BC}.Release|Any CPU.Build.0 = Release|Any CPU
5561
EndGlobalSection
5662
GlobalSection(SolutionProperties) = preSolution
5763
HideSolutionNode = FALSE
@@ -62,6 +68,7 @@ Global
6268
{06E849E9-A8EA-410B-83BC-0366524C4953} = {898610F1-A6C1-422C-84C9-C1E386957F31}
6369
{2A341376-2409-422C-A7A9-1AE6E86F91D9} = {3F4DE3FA-2636-440C-ACCC-137BAD95BAC4}
6470
{6CE81AB3-399F-44CB-9DBE-9A8D62B07C8A} = {3F4DE3FA-2636-440C-ACCC-137BAD95BAC4}
71+
{9C883692-7F43-4E72-8610-AB1996BED8BC} = {5DBC44B8-5B92-4504-8B8F-91A1672251E6}
6572
EndGlobalSection
6673
GlobalSection(ExtensibilityGlobals) = postSolution
6774
SolutionGuid = {1B8CD55B-BEF0-42D1-936A-BC1FB5D02CE2}

docs/LumexUI.Docs.Client/Common/Navigation/NavigationStore.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ public class NavigationStore
99
private static Navigation? _navigation;
1010

1111
private static NavigationCategory GettingStartedCategory =>
12-
new NavigationCategory( "Getting Started", Icons.Rounded.AutoStories )
12+
new NavigationCategory( "Getting Started" )
1313
.Add( new( "Overview" ) )
1414
.Add( new( "Installation" ) );
1515

1616
private static NavigationCategory ThemingCategory =>
17-
new NavigationCategory( "Theming", Icons.Rounded.DesignServices )
17+
new NavigationCategory( "Theming" )
1818
.Add( new( "Design Tokens", PageStatus.New ) )
1919
.Add( new( "Customization", PageStatus.Updated ) )
2020
.Add( new( "Dark Mode", PageStatus.New ) );
2121

2222
private static NavigationCategory ComponentsCategory =>
23-
new NavigationCategory( "Components", Icons.Rounded.Joystick )
23+
new NavigationCategory( "Components" )
2424
.Add( new( nameof( LumexAccordion ) ) )
2525
.Add( new( nameof( LumexAlert ), PageStatus.New ) )
2626
.Add( new( nameof( LumexAvatar ), PageStatus.New ) )
@@ -34,7 +34,6 @@ public class NavigationStore
3434
.Add( new( nameof( LumexDataGrid<T> ) ) )
3535
.Add( new( nameof( LumexDivider ) ) )
3636
.Add( new( nameof( LumexDropdown ) ) )
37-
.Add( new( nameof( LumexIcon ) ) )
3837
.Add( new( nameof( LumexLink ) ) )
3938
.Add( new( nameof( LumexListbox<T> ) ) )
4039
.Add( new( nameof( LumexNavbar ) ) )
@@ -50,7 +49,7 @@ public class NavigationStore
5049
.Add( new( nameof( LumexTooltip ), PageStatus.New ) );
5150

5251
private static NavigationCategory ComponentsApiCategory =>
53-
new NavigationCategory( "Components API", Icons.Rounded.Manufacturing )
52+
new NavigationCategory( "Components API" )
5453
.Add( new( nameof( LumexAccordion ) ) )
5554
.Add( new( nameof( LumexAccordionItem ) ) )
5655
.Add( new( nameof( LumexAvatar ) ) )
@@ -74,7 +73,6 @@ public class NavigationStore
7473
.Add( new( nameof( LumexDropdownMenu ) ) )
7574
//.Add( nameof( LumexInputBase<T> ) )
7675
//.Add( nameof( LumexInputFieldBase<T> ) )
77-
.Add( new( nameof( LumexIcon ) ) )
7876
.Add( new( nameof( LumexLink ) ) )
7977
.Add( new( nameof( LumexListbox<T> ) ) )
8078
.Add( new( nameof( LumexListboxItem<T> ) ) )

docs/LumexUI.Docs.Client/Common/Navigation/Types.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public Navigation Add( NavigationCategory category )
1313
}
1414
}
1515

16-
public class NavigationCategory( string name, string icon )
16+
public class NavigationCategory( string name, string? icon = null )
1717
{
1818
private readonly List<NavigationItem> _items = [];
1919

2020
public string Name { get; } = name;
21-
public string Icon { get; } = icon;
21+
public string? Icon { get; } = icon;
2222
public IEnumerable<NavigationItem> Items => _items.AsEnumerable();
2323

2424
public NavigationCategory Add( NavigationItem item )

docs/LumexUI.Docs.Client/Components/Callout.razor

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
@namespace LumexUI.Docs.Client.Components
22

3+
@using LumexUI.Shared.Icons
4+
35
<div class="@BaseClass">
4-
<LumexIcon Icon="@_icon" Class="@IconClass" />
6+
<DynamicIcon Type="@_icon" class="@IconClass" />
57
<p>@ChildContent</p>
68
</div>
79

@@ -32,17 +34,17 @@
3234
.Add( Classes?.Icon )
3335
.ToString();
3436

35-
private string _icon = default!;
37+
private Type _icon = default!;
3638

3739
protected override void OnInitialized()
3840
{
3941
_icon = Variant switch
4042
{
41-
CalloutVariant.Info => Icons.Rounded.Info,
42-
CalloutVariant.Warning => Icons.Rounded.Warning,
43-
CalloutVariant.Danger => Icons.Rounded.Dangerous,
44-
CalloutVariant.Success => Icons.Rounded.CheckCircle,
45-
CalloutVariant.Tip => Icons.Rounded.EmojiObjects,
43+
CalloutVariant.Info => typeof( InfoIcon ),
44+
CalloutVariant.Warning => typeof( ShieldAlertIcon ),
45+
CalloutVariant.Danger => typeof( OctagonAlertIcon ),
46+
CalloutVariant.Success => typeof( CircleCheckIcon ),
47+
CalloutVariant.Tip => typeof( InfoIcon ),
4648
_ => throw new NotImplementedException()
4749
};
4850
}

docs/LumexUI.Docs.Client/Components/ComponentLinks.razor

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
<LumexButton As="a"
77
Size="@Size.Small"
8-
StartContent="@BlazorIcon"
8+
StartContent="@_blazorIcon"
99
Class="bg-default-100 text-default-700 text-small"
1010
href="https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/?view=aspnetcore-8.0#client-and-server-rendering-concepts"
1111
target="_blank"
@@ -16,7 +16,7 @@
1616

1717
<LumexButton As="a"
1818
Size="@Size.Small"
19-
StartContent="@GithubIcon"
19+
StartContent="@_githubIcon"
2020
Class="bg-default-100 text-default-700 text-small"
2121
href="@($"{Constants.GitHub.ComponentPath}/{ComponentName}")"
2222
target="_blank"
@@ -26,7 +26,7 @@
2626

2727
<LumexButton As="a"
2828
Size="@Size.Small"
29-
StartContent="@GithubIcon"
29+
StartContent="@_githubIcon"
3030
Class="bg-default-100 text-default-700 text-small"
3131
href="@($"{Constants.GitHub.ComponentStylesPath}/{ComponentName}.cs")"
3232
target="_blank"
@@ -39,13 +39,6 @@
3939
[Parameter, EditorRequired] public string ComponentName { get; set; } = default!;
4040
[Parameter] public bool IsServer { get; set; }
4141

42-
private static readonly RenderFragment BlazorIcon =
43-
@<LumexIcon Icon="@Icons.Brands.Blazor"
44-
Size="@new("20")"
45-
viewBox="-10 -38 340 340" />;
46-
47-
private static readonly RenderFragment GithubIcon =
48-
@<LumexIcon Icon="@Icons.Brands.GitHub"
49-
Size="@new("20")"
50-
viewBox="0 0 24 24" />;
42+
private readonly RenderFragment _blazorIcon = @<BlazorIcon Size="18" />;
43+
private readonly RenderFragment _githubIcon = @<GithubIcon Size="16" />;
5144
}

docs/LumexUI.Docs.Client/Components/DocsFooter.razor

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
<LumexLink Href="https://github.com/LumexUI/lumexui"
1111
External="@true"
1212
Class="p-1 text-default-600">
13-
<LumexIcon Icon="@Icons.Brands.GitHub"
14-
viewBox="0 0 24 24" />
13+
<GithubIcon Size="20" />
1514
<span class="sr-only">GitHub</span>
1615
</LumexLink>
1716

1817
<LumexLink Href="https://discord.gg/jjgMz3apcb"
1918
External="@true"
2019
Class="p-1 text-default-600">
21-
<LumexIcon Icon="@Icons.Brands.Discord"
22-
viewBox="0 0 24 24" />
20+
<DiscordIcon Size="20" />
2321
<span class="sr-only">Discord</span>
2422
</LumexLink>
2523
</div>

docs/LumexUI.Docs.Client/Components/DocsSection.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@namespace LumexUI.Docs.Client.Components
22
@inject NavigationManager NavigationManager
33

4+
@using LumexUI.Shared.Icons
5+
46
<CascadingValue TValue="DocsSection" Value="@this" IsFixed="@true">
57
<LumexComponent As="@(IsSubsection ? "h3" : "h2")"
68
id="@_id">
@@ -9,8 +11,7 @@
911
Class="border-none">
1012
@Title
1113
<span class="flex items-center justify-center size-6 ml-2 rounded-md text-foreground-400 shadow-xs ring ring-foreground-900/10 hover:ring-orange-200 hover:bg-orange-50 hover:text-orange-500">
12-
<LumexIcon Icon="@Icons.Rounded.Link"
13-
Size="@new("16")" />
14+
<Link2Icon Size="16" />
1415
</span>
1516
</LumexLink>
1617
</LumexComponent>

docs/LumexUI.Docs.Client/Components/Header.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<LumexLink Href="https://github.com/LumexUI/lumexui"
4848
External="@true"
4949
Class="text-foreground-400 hover:text-foreground-600">
50-
<LumexIcon Icon="@Icons.Brands.GitHub" viewBox="0 0 24 24" />
50+
<GithubIcon Size="20" />
5151
</LumexLink>
5252
</LumexNavbarItem>
5353
</text>;

docs/LumexUI.Docs.Client/Components/Layouts/InstallationLayout.razor

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,20 @@
1818
<LumexLink Href="https://dotnet.microsoft.com/en-us/download"
1919
External="@true">
2020
.NET SDK 8
21-
<LumexIcon Icon="@Icons.Rounded.OpenInNew"
22-
Size="@new("16")"
23-
Class="mx-1 text-orange-400" />
2421
</LumexLink>
2522
or later
2623
</li>
2724
<li>
2825
<LumexLink Href="https://tailwindcss.com"
2926
External="@true">
3027
Tailwind CSS 4.0
31-
<LumexIcon Icon="@Icons.Rounded.OpenInNew"
32-
Size="@new("16")"
33-
Class="mx-1 text-orange-400" />
3428
</LumexLink>
3529
</li>
3630
<li>
3731
An existing Blazor project or create
3832
<LumexLink Href="https://dotnet.microsoft.com/en-us/learn/aspnet/blazor-tutorial/intro"
3933
External="@true">
4034
a new one
41-
<LumexIcon Icon="@Icons.Rounded.OpenInNew"
42-
Size="@new("16")"
43-
Class="mx-1 text-orange-400" />
4435
</LumexLink>
4536
</li>
4637
</ul>

docs/LumexUI.Docs.Client/Components/NavMenu.razor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
{
1818
<li>
1919
<div class="flex items-center gap-2 mb-3 text-foreground">
20-
<LumexIcon Icon="@category.Icon" Size="@new("20")" />
2120
<h5 class="text-foreground-900 font-semibold">
2221
@category.Name
2322
</h5>

0 commit comments

Comments
 (0)