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
fix: moved focus handling down to variants
  • Loading branch information
Denny09310 committed Sep 15, 2025
commit 7e8dc81ead110a51c7fa82db9e46378c3f7229fd
5 changes: 4 additions & 1 deletion src/LumexUI/Components/User/LumexUser.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public partial class LumexUser : LumexComponentBase, ISlotComponent<UserSlots>
protected override void OnParametersSet()
{
var user = Styles.User.Style( TwMerge );
_slots = user();
_slots = user( new()
{
[nameof( IsFocusable )] = IsFocusable.ToString(),
} );
}

[ExcludeFromCodeCoverage]
Expand Down
15 changes: 12 additions & 3 deletions src/LumexUI/Styles/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[ExcludeFromCodeCoverage]
internal static class User
{
private static ComponentVariant? _variant;

Check warning on line 16 in src/LumexUI/Styles/User.cs

View workflow job for this annotation

GitHub Actions / build-test

Field 'User._variant' is never assigned to, and will always have its default value null

public static ComponentVariant Style( TwMerge twMerge )
{
Expand All @@ -30,15 +30,24 @@
.Add( "gap-2" )
.Add( "rounded-small" )
.Add( "outline-solid" )
.Add( "outline-transparent" )
// focus ring
.Add( Utils.FocusVisible ),
.Add( "outline-transparent" ),

[nameof(UserSlots.Wrapper)] = "inline-flex flex-col items-start",

[nameof(UserSlots.Name)] = "text-small text-inherit",

[nameof(UserSlots.Description)] = "text-tiny text-foreground-400",
},

Variants = new VariantCollection
{
[nameof(LumexUser.IsFocusable)] = new VariantValueCollection
{
[bool.TrueString] = new SlotCollection
{
[nameof(UserSlots.Base)] = Utils.FocusVisible,
}
}
}
} );
}
Expand Down
Loading