Skip to content

Commit 10fe382

Browse files
authored
feat(Icons): add OctIcon component (#5248)
* chore: 增加示例 * chore: 增加菜单 * chore: 增加资源文件 * chore: 增加 IsNew 标志 * chore: 增加依赖包 * chore: 更新键值 * chore: 更新示例
1 parent adc3e46 commit 10fe382

File tree

6 files changed

+70
-2
lines changed

6 files changed

+70
-2
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<PackageReference Include="BootstrapBlazor.Mermaid" Version="9.0.3" />
4949
<PackageReference Include="BootstrapBlazor.MindMap" Version="9.1.3" />
5050
<PackageReference Include="BootstrapBlazor.MouseFollower" Version="9.0.1" />
51+
<PackageReference Include="BootstrapBlazor.OctIcon" Version="9.0.0" />
5152
<PackageReference Include="BootstrapBlazor.OnScreenKeyboard" Version="9.0.1" />
5253
<PackageReference Include="BootstrapBlazor.PdfReader" Version="9.0.0" />
5354
<PackageReference Include="BootstrapBlazor.Player" Version="9.0.0" />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@page "/oct-icon"
2+
@layout MainLayout
3+
@inject IStringLocalizer<OctIcons> Localizer
4+
5+
<HeadContent>
6+
<link rel="stylesheet" href="@Assets["_content/BootstrapBlazor.OctIcon/BootstrapBlazor.OctIcon.bundle.scp.css"]" />
7+
</HeadContent>
8+
9+
<h3>@Localizer["OctIconTitle"]</h3>
10+
11+
<h4>@Localizer["OctIconDescription"]</h4>
12+
13+
<PackageTips Name="BootstrapBlazor.OctIcon" />
14+
15+
<Tips class="mt-3">
16+
<ul class="ul-demo">
17+
<li>@Localizer["P1"]</li>
18+
<li>@Localizer["P2"]</li>
19+
</ul>
20+
<div>@Localizer["P3"]</div>
21+
</Tips>
22+
23+
<Pre>&lt;link href="_content/BootstrapBlazor.OctIcon/BootstrapBlazor.OctIcon.bundle.scp.css" rel="stylesheet"&gt;</Pre>
24+
25+
<Pre>&lt;OctIcon Name="accessibility-16"&gt;&lt;OctIcon&gt;</Pre>
26+
27+
<div>@((MarkupString)Localizer["Icons"].Value)</div>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
5+
6+
namespace BootstrapBlazor.Server.Components.Samples.Icons;
7+
8+
/// <summary>
9+
/// OctIcons 图标示例
10+
/// </summary>
11+
public partial class OctIcons
12+
{
13+
14+
}

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,12 @@ void AddIcons(DemoMenuItem item)
15681568
{
15691569
Text = Localizer["IconPark"],
15701570
Url = "icon-park"
1571+
},
1572+
new()
1573+
{
1574+
IsNew = true,
1575+
Text = Localizer["OctIcon"],
1576+
Url = "oct-icon"
15711577
}
15721578
};
15731579
AddBadge(item);

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4806,7 +4806,8 @@
48064806
"RDKit": "RDKit",
48074807
"SmilesDrawer": "SmilesDrawer",
48084808
"Affix": "Affix",
4809-
"Watermark": "Watermark"
4809+
"Watermark": "Watermark",
4810+
"OctIcon": "OctIcons"
48104811
},
48114812
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
48124813
"TablesHeaderTitle": "Header grouping function",
@@ -6719,6 +6720,15 @@
67196720
"P3": "Please copy the following code segement",
67206721
"Icons": "For icon list, please visit <a href=\"https://ant.design/components/icon\" target=\"_blank\">[portal]</a>"
67216722
},
6723+
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcons": {
6724+
"OctIconTitle": "Oct Svg Icon Lib",
6725+
"OctIconDescription": "A scalable set of icons handcrafted with <3 by GitHub",
6726+
"CopiedTooltipText": "Copied",
6727+
"P1": "1. After referencing the extension package, add the package built-in style file to open the icon",
6728+
"P2": "2. Enable css isolation and automatically reference component styles after compilation",
6729+
"P3": "Please copy the following code segement",
6730+
"Icons": "For icon list, please visit <a href=\"https://primer.style/foundations/icons\" target=\"_blank\">[portal]</a>"
6731+
},
67226732
"BootstrapBlazor.Server.Components.Samples.BootstrapBlazorIcons": {
67236733
"IconsTitle": "Icon",
67246734
"IconsDescription": "Supports font icons, vector SVG icons, and Image pictures",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4806,7 +4806,8 @@
48064806
"RDKit": "分子式组件 RDKit",
48074807
"SmilesDrawer": "分子式组件 SmilesDrawer",
48084808
"Affix": "固钉组件 Affix",
4809-
"Watermark": "水印组件 Watermark"
4809+
"Watermark": "水印组件 Watermark",
4810+
"OctIcon": "OctIcons"
48104811
},
48114812
"BootstrapBlazor.Server.Components.Samples.Table.TablesHeader": {
48124813
"TablesHeaderTitle": "表头分组功能",
@@ -6719,6 +6720,15 @@
67196720
"P3": "请拷贝下方样式即可",
67206721
"Icons": "图标列表请通过 <a href=\"https://ant.design/components/icon\" target=\"_blank\">[传送门]</a> 查看"
67216722
},
6723+
"BootstrapBlazor.Server.Components.Samples.Icons.OctIcons": {
6724+
"OctIconTitle": "Github 图标库",
6725+
"OctIconDescription": "Primer is a set of guidelines, principles, and patterns for designing and building UI at GitHub.",
6726+
"CopiedTooltipText": "拷贝成功",
6727+
"P1": "1. 引用扩展组件包后添加包内置样式文件开启图标",
6728+
"P2": "2. 开启样式隔离,编译后自动引用组件样式",
6729+
"P3": "请拷贝下方样式即可",
6730+
"Icons": "图标列表请通过 <a href=\"https://primer.style/foundations/icons\" target=\"_blank\">[传送门]</a> 查看"
6731+
},
67226732
"BootstrapBlazor.Server.Components.Samples.BootstrapBlazorIcons": {
67236733
"IconsTitle": "Icon 图标",
67246734
"IconsDescription": "同时支持字体图标、矢量 Svg 图标、以及 Image 图片",

0 commit comments

Comments
 (0)