Skip to content

Commit 41f82fd

Browse files
authored
Enhance Icon component docs and add enum metadata (#1232)
Improved documentation for Icon component and its parameters, including new sections for IconColor, IconSize, and IconName enums. Added XML comments and attributes ([AddedVersion], [DefaultValue], [Description]) to parameters and enum values for better API reference and IntelliSense support.
1 parent 96128dd commit 41f82fd

4 files changed

Lines changed: 122 additions & 13 deletions

File tree

BlazorBootstrap.Demo.RCL/Components/Pages/Docs/Icons/Icon_Doc_01_Documentation.razor

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,22 @@
1414
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
1515
</Section>
1616

17-
<Section Class="p-0" Size="HeadingSize.H3" Name="Parameters" PageUrl="@pageUrl" Link="parameters">
17+
<Section Class="p-0" Size="HeadingSize.H3" Name="Icon Parameters" PageUrl="@pageUrl" Link="icon-parameters">
1818
<DocxTable TItem="Icon" DocType="DocType.Parameters" />
1919
</Section>
2020

21+
<Section Class="p-0" Size="HeadingSize.H3" Name="IconColor Enum" PageUrl="@pageUrl" Link="icon-color-enum">
22+
<DocxTable TItem="IconColor" DocType="DocType.Enum" />
23+
</Section>
24+
25+
<Section Class="p-0" Size="HeadingSize.H3" Name="IconSize Enum" PageUrl="@pageUrl" Link="icon-size-enum">
26+
<DocxTable TItem="IconSize" DocType="DocType.Enum" />
27+
</Section>
28+
29+
<Section Class="p-0" Size="HeadingSize.H3" Name="IconName Enum" PageUrl="@pageUrl" Link="icon-name-enum">
30+
<DocxTable TItem="IconName" DocType="DocType.Enum" />
31+
</Section>
32+
2133
@code {
2234
private const string componentName = nameof(Icon);
2335
private const string pageUrl = DemoRouteConstants.Docs_URL_Icons;

blazorbootstrap/Components/Icon/Icon.razor.cs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,50 @@ public partial class Icon : BlazorBootstrapComponentBase
1414

1515
/// <summary>
1616
/// Gets or sets the icon color.
17-
/// </summary>
18-
/// <remarks>
17+
/// <para>
1918
/// Default value is <see cref="IconColor.None" />.
20-
/// </remarks>
19+
/// </para>
20+
/// </summary>
21+
[AddedVersion("1.9.0")]
22+
[DefaultValue(IconColor.None)]
23+
[Description("Gets or sets the icon color.")]
2124
[Parameter]
2225
public IconColor Color { get; set; } = IconColor.None;
2326

2427
/// <summary>
2528
/// Gets or sets the custom icon name.
2629
/// Specify custom icons of your own, like `fontawesome`. Example: `fas fa-alarm-clock`.
30+
/// <para>
31+
/// Default value is <see langword="null"/>.
32+
/// </para>
2733
/// </summary>
28-
/// <remarks>
29-
/// Default value is null.
30-
/// </remarks>
34+
[AddedVersion("1.0.0")]
35+
[DefaultValue(null)]
36+
[Description("Gets or sets the custom icon name. Specify custom icons of your own, like `fontawesome`. Example: `fas fa-alarm-clock`.")]
3137
[Parameter]
3238
public string? CustomIconName { get; set; }
3339

3440
/// <summary>
3541
/// Gets or sets the icon name.
36-
/// </summary>
37-
/// <remarks>
42+
/// <para>
3843
/// Default value is <see cref="IconName.None" />.
39-
/// </remarks>
44+
/// </para>
45+
/// </summary>
46+
[AddedVersion("1.0.0")]
47+
[DefaultValue(IconName.None)]
48+
[Description("Gets or sets the icon name.")]
4049
[Parameter]
4150
public IconName Name { get; set; } = IconName.None;
4251

4352
/// <summary>
4453
/// Gets or sets the icon size.
45-
/// </summary>
46-
/// <remarks>
54+
/// <para>
4755
/// Default value is <see cref="IconSize.None" />.
48-
/// </remarks>
56+
/// </para>
57+
/// </summary>
58+
[AddedVersion("1.0.0")]
59+
[DefaultValue(IconSize.None)]
60+
[Description("Gets or sets the icon size.")]
4961
[Parameter]
5062
public IconSize Size { get; set; } = IconSize.None;
5163

blazorbootstrap/Enums/Color/IconColor.cs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,87 @@
22

33
public enum IconColor
44
{
5+
/// <summary>
6+
/// Indicates no color is applied. Default color is inherited from parent element.
7+
/// </summary>
8+
[AddedVersion("1.9.0")]
9+
[Description("Indicates no color is applied. Default color is inherited from parent element.")]
510
None,
11+
12+
/// <summary>
13+
/// Indicates the icon should use the primary color.
14+
/// </summary>
15+
[AddedVersion("1.9.0")]
16+
[Description("Indicates the icon should use the primary color.")]
617
Primary,
18+
19+
/// <summary>
20+
/// Indicates the icon should use the secondary color.
21+
/// </summary>
22+
[AddedVersion("1.9.0")]
23+
[Description("Indicates the icon should use the secondary color.")]
724
Secondary,
25+
26+
/// <summary>
27+
/// Indicates the icon should use the success color.
28+
/// </summary>
29+
[AddedVersion("1.9.0")]
30+
[Description("Indicates the icon should use the success color.")]
831
Success,
32+
33+
/// <summary>
34+
/// Indicates the icon should use the danger color.
35+
/// </summary>
36+
[AddedVersion("1.9.0")]
37+
[Description("Indicates the icon should use the danger color.")]
938
Danger,
39+
40+
/// <summary>
41+
/// Indicates the icon should use the warning color.
42+
/// </summary>
43+
[AddedVersion("1.9.0")]
44+
[Description("Indicates the icon should use the warning color.")]
1045
Warning,
46+
47+
/// <summary>
48+
/// Indicates the icon should use the info color.
49+
/// </summary>
50+
[AddedVersion("1.9.0")]
51+
[Description("Indicates the icon should use the info color.")]
1152
Info,
53+
54+
/// <summary>
55+
/// Indicates the icon should use the light color.
56+
/// </summary>
57+
[AddedVersion("1.9.0")]
58+
[Description("Indicates the icon should use the light color.")]
1259
Light,
60+
61+
/// <summary>
62+
/// Indicates the icon should use the dark color.
63+
/// </summary>
64+
[AddedVersion("1.9.0")]
65+
[Description("Indicates the icon should use the dark color.")]
1366
Dark,
67+
68+
/// <summary>
69+
/// Indicates the icon should use the body color.
70+
/// </summary>
71+
[AddedVersion("1.9.0")]
72+
[Description("Indicates the icon should use the body color.")]
1473
Body,
74+
75+
/// <summary>
76+
/// Indicates the icon should use the muted color.
77+
/// </summary>
78+
[AddedVersion("1.9.0")]
79+
[Description("Indicates the icon should use the muted color.")]
1580
Muted,
81+
82+
/// <summary>
83+
/// Indicates the icon should use the white color.
84+
/// </summary>
85+
[AddedVersion("1.9.0")]
86+
[Description("Indicates the icon should use the white color.")]
1687
White
1788
}

blazorbootstrap/Enums/IconSize.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,49 @@ public enum IconSize
55
/// <summary>
66
/// The default icon size.
77
/// </summary>
8+
[AddedVersion("1.0.0")]
9+
[Description("")]
810
None,
911

1012
/// <summary>
1113
/// An extra large icon, 2.5rem in size.
1214
/// </summary>
15+
[AddedVersion("1.0.0")]
16+
[Description("An extra large icon, 2.5rem in size.")]
1317
x1,
1418

1519
/// <summary>
1620
/// A large icon, 2rem in size.
1721
/// </summary>
22+
[AddedVersion("1.0.0")]
23+
[Description("A large icon, 2rem in size.")]
1824
x2,
1925

2026
/// <summary>
2127
/// A medium icon, 1.75rem in size.
2228
/// </summary>
29+
[AddedVersion("1.0.0")]
30+
[Description("A medium icon, 1.75rem in size.")]
2331
x3,
2432

2533
/// <summary>
2634
/// A small icon, 1.5rem in size.
2735
/// </summary>
36+
[AddedVersion("1.0.0")]
37+
[Description("A small icon, 1.5rem in size.")]
2838
x4,
2939

3040
/// <summary>
3141
/// A very small icon, 1.25rem in size.
3242
/// </summary>
43+
[AddedVersion("1.0.0")]
44+
[Description("A very small icon, 1.25rem in size.")]
3345
x5,
3446

3547
/// <summary>
3648
/// The smallest icon, 1rem in size.
3749
/// </summary>
50+
[AddedVersion("1.0.0")]
51+
[Description("The smallest icon, 1rem in size.")]
3852
x6
3953
}

0 commit comments

Comments
 (0)