Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@
<img src="@imageUrl" class="img-fluid" alt="@metaTitle" />
</Section>

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

<Section Class="p-0" Size="HeadingSize.H3" Name="IconColor Enum" PageUrl="@pageUrl" Link="icon-color-enum">
<DocxTable TItem="IconColor" DocType="DocType.Enum" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="IconSize Enum" PageUrl="@pageUrl" Link="icon-size-enum">
<DocxTable TItem="IconSize" DocType="DocType.Enum" />
</Section>

<Section Class="p-0" Size="HeadingSize.H3" Name="IconName Enum" PageUrl="@pageUrl" Link="icon-name-enum">
<DocxTable TItem="IconName" DocType="DocType.Enum" />
</Section>

@code {
private const string componentName = nameof(Icon);
private const string pageUrl = DemoRouteConstants.Docs_URL_Icons;
Expand Down
36 changes: 24 additions & 12 deletions blazorbootstrap/Components/Icon/Icon.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,50 @@ public partial class Icon : BlazorBootstrapComponentBase

/// <summary>
/// Gets or sets the icon color.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="IconColor.None" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.9.0")]
[DefaultValue(IconColor.None)]
[Description("Gets or sets the icon color.")]
[Parameter]
public IconColor Color { get; set; } = IconColor.None;

/// <summary>
/// Gets or sets the custom icon name.
/// Specify custom icons of your own, like `fontawesome`. Example: `fas fa-alarm-clock`.
/// <para>
/// Default value is <see langword="null"/>.
/// </para>
/// </summary>
/// <remarks>
/// Default value is null.
/// </remarks>
[AddedVersion("1.0.0")]
[DefaultValue(null)]
[Description("Gets or sets the custom icon name. Specify custom icons of your own, like `fontawesome`. Example: `fas fa-alarm-clock`.")]
[Parameter]
public string? CustomIconName { get; set; }

/// <summary>
/// Gets or sets the icon name.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="IconName.None" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue(IconName.None)]
[Description("Gets or sets the icon name.")]
[Parameter]
public IconName Name { get; set; } = IconName.None;

/// <summary>
/// Gets or sets the icon size.
/// </summary>
/// <remarks>
/// <para>
/// Default value is <see cref="IconSize.None" />.
/// </remarks>
/// </para>
/// </summary>
[AddedVersion("1.0.0")]
[DefaultValue(IconSize.None)]
[Description("Gets or sets the icon size.")]
[Parameter]
public IconSize Size { get; set; } = IconSize.None;

Expand Down
71 changes: 71 additions & 0 deletions blazorbootstrap/Enums/Color/IconColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,87 @@

public enum IconColor
{
/// <summary>
/// Indicates no color is applied. Default color is inherited from parent element.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates no color is applied. Default color is inherited from parent element.")]
None,

/// <summary>
/// Indicates the icon should use the primary color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the primary color.")]
Primary,

/// <summary>
/// Indicates the icon should use the secondary color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the secondary color.")]
Secondary,

/// <summary>
/// Indicates the icon should use the success color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the success color.")]
Success,

/// <summary>
/// Indicates the icon should use the danger color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the danger color.")]
Danger,

/// <summary>
/// Indicates the icon should use the warning color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the warning color.")]
Warning,

/// <summary>
/// Indicates the icon should use the info color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the info color.")]
Info,

/// <summary>
/// Indicates the icon should use the light color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the light color.")]
Light,

/// <summary>
/// Indicates the icon should use the dark color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the dark color.")]
Dark,

/// <summary>
/// Indicates the icon should use the body color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the body color.")]
Body,

/// <summary>
/// Indicates the icon should use the muted color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the muted color.")]
Muted,

/// <summary>
/// Indicates the icon should use the white color.
/// </summary>
[AddedVersion("1.9.0")]
[Description("Indicates the icon should use the white color.")]
White
}
14 changes: 14 additions & 0 deletions blazorbootstrap/Enums/IconSize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,49 @@ public enum IconSize
/// <summary>
/// The default icon size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("")]
None,

/// <summary>
/// An extra large icon, 2.5rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("An extra large icon, 2.5rem in size.")]
x1,

/// <summary>
/// A large icon, 2rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("A large icon, 2rem in size.")]
x2,

/// <summary>
/// A medium icon, 1.75rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("A medium icon, 1.75rem in size.")]
x3,

/// <summary>
/// A small icon, 1.5rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("A small icon, 1.5rem in size.")]
x4,

/// <summary>
/// A very small icon, 1.25rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("A very small icon, 1.25rem in size.")]
x5,

/// <summary>
/// The smallest icon, 1rem in size.
/// </summary>
[AddedVersion("1.0.0")]
[Description("The smallest icon, 1rem in size.")]
x6
}
Loading