Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore(*): minor adjustments
  • Loading branch information
desmondinho committed Sep 17, 2025
commit 4b009eab7811280473bee6c4c34249662dd4ad1b
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class NavigationStore
.Add( new( nameof( LumexTabs ) ) )
.Add( new( nameof( LumexTextbox ) ) )
.Add( new( nameof( LumexThemeProvider ) ) )
.Add( new( nameof( LumexTooltip ) ) )
.Add( new( nameof( LumexTooltip ) ) )
.Add( new( nameof( LumexUser ) ) );

public static Navigation GetNavigation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<LumexAvatar Src="https://avatars.githubusercontent.com/u/68395709?v=4" />
</AvatarContent>
<DescriptionContent>
<LumexLink External Href="https://github.com/desmondinho">
<LumexLink Href="https://github.com/desmondinho" External="@true">
@@desmondinho
</LumexLink>
</DescriptionContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<LumexUser Name="Jane Doe" Description="Product Designer">
<AvatarContent>
<LumexAvatar Src="https://i.pravatar.cc/300" />
<LumexAvatar Src="https://i.pravatar.cc/150?img=2" />
</AvatarContent>
</LumexUser>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@rendermode InteractiveWebAssembly

<PreviewCode Code="@new( name: null, snippet: "User.Code.CustomDescription" )">
<LumexUI.Docs.Client.Pages.Components.User.Examples.CustomDescription />
</PreviewCode>

This file was deleted.

93 changes: 48 additions & 45 deletions docs/LumexUI.Docs.Client/Pages/Components/User/User.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,67 @@
@using LumexUI.Docs.Client.Pages.Components.User.PreviewCodes

<DocsSection Title="Usage">
<Usage />
<Usage />

<DocsSection Title="Link Description">
<LinkDescription />
<DocsSection Title="Custom Description">
<p>Use the <code>DescriptionContent</code> parameter to provide custom content for the user description.</p>
<CustomDescription />
</DocsSection>

<LumexAlert Radius="@Radius.Large" Class="my-6">
<DescriptionContent>
When both <code>Description</code> and <code>DescriptionContent</code> are provided, <code>DescriptionContent</code> takes precedence.
</DescriptionContent>
</LumexAlert>

<LumexAlert Radius="@Radius.Large" Class="my-6">
<DescriptionContent>
When both <code>Description</code> and <code>DescriptionContent</code> are provided, <code>DescriptionContent</code> takes precedence.
</DescriptionContent>
</LumexAlert>
</DocsSection>

<DocsSlotsSection Slots="@_slots">
<div>
<h4 class="font-semibold">User</h4>
<ul>
<li><code>Class</code>: The basic CSS class name styles the wrapper of the user contents.</li>
<li><code>Classes</code>: The CSS class names for the user slots style the entire user at once.</li>
</ul>
</div>
<div>
<h4 class="font-semibold">User</h4>
<ul>
<li><code>Class</code>: The basic CSS class name styles the wrapper of the user contents.</li>
<li><code>Classes</code>: The CSS class names for the user slots style the entire user at once.</li>
</ul>
</div>
</DocsSlotsSection>

<DocsApiSection Components="@_apiComponents" />

@code {
[CascadingParameter] private DocsContentLayout Layout { get; set; } = default!;
[CascadingParameter] private DocsContentLayout Layout { get; set; } = default!;

private readonly Heading[] _headings = new Heading[]
{
new("Usage", [
new("Link Description")
]),
new("API")
};
private readonly Heading[] _headings = new Heading[]
{
new("Usage", [
new("Link Description")
]),
new("Custom Styles"),
new("API")
};

private readonly Slot[] _slots = new Slot[]
{
new(nameof( UserSlots.Base ), "The base slot of the user, it is the main container."),
new(nameof( UserSlots.Wrapper ), "The name and description wrapper."),
new(nameof( UserSlots.Name ), "The name of the user."),
new(nameof( UserSlots.Description ), "The description of the user."),
};
private readonly Slot[] _slots = new Slot[]
{
new(nameof( UserSlots.Base ), "The base slot of the user, it is the main container."),
new(nameof( UserSlots.Wrapper ), "The name and description wrapper."),
new(nameof( UserSlots.Name ), "The name of the user."),
new(nameof( UserSlots.Description ), "The description of the user."),
};

private readonly string[] _apiComponents = new string[]
{
nameof(LumexUser)
};
private readonly string[] _apiComponents = new string[]
{
nameof(LumexUser),
nameof(LumexAvatar),
nameof(LumexLink)
};

protected override void OnInitialized()
{
Layout.Initialize(
title: "User",
category: "Components",
description: "Display user information with avatar and name.",
headings: _headings,
linksProps: new ComponentLinksProps("Usr", isServer: true)
);
}
protected override void OnInitialized()
{
Layout.Initialize(
title: "User",
category: "Components",
description: "Display user information with avatar and name.",
headings: _headings,
linksProps: new ComponentLinksProps( "User", isServer: false )
);
}
}
3 changes: 1 addition & 2 deletions src/LumexUI/Components/User/LumexUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Class="@GetStyles( nameof(S.Base) )"
Style="@RootStyle"
data-slot="base"
@attributes="AdditionalAttributes">
@attributes="@AdditionalAttributes">
@AvatarContent
<div class="@GetStyles( nameof( S.Wrapper ) )" data-slot="wrapper">

Expand All @@ -25,6 +25,5 @@
@Description
}
</span>

</div>
</LumexComponent>
6 changes: 3 additions & 3 deletions tests/LumexUI.Tests/Components/User/UserTests.razor
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
</LumexLink>
</DescriptionContent>
</LumexUser>
);
);

cut.FindByTestId("user-root").Should().NotBeNull();
cut.FindByTestId("user-link").Should().NotBeNull();
cut.FindByTestId( "user-root" ).Should().NotBeNull();
cut.FindByTestId( "user-link" ).Should().NotBeNull();
}
}
Loading