Skip to content

Commit

Permalink
feat(docs): add the Navbar page (#87)
Browse files Browse the repository at this point in the history
* components(navbar): takes full-width of the parent container

* components(navbar): nits

* fix(docs): small adjustments on some of the pages and components

* dosc(preview-code): add the `Class` parameter

* feat(docs): add the Navbar page

* docs(navbar): update API component references
  • Loading branch information
desmondinho authored Oct 27, 2024
1 parent 030de4f commit 91345fc
Show file tree
Hide file tree
Showing 40 changed files with 625 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class NavigationStore
.Add( new( nameof( LumexDivider ) ) )
.Add( new( nameof( LumexIcon ), locked: true ) )
.Add( new( nameof( LumexLink ) ) )
.Add( new( nameof( LumexNavbar ), locked: true ) )
.Add( new( nameof( LumexNavbar ) ) )
.Add( new( nameof( LumexNumbox<T> ), locked: true ) )
.Add( new( nameof( LumexPopover ), locked: true ) )
.Add( new( nameof( LumexSwitch ), locked: true ) )
Expand Down
2 changes: 1 addition & 1 deletion docs/LumexUI.Docs.Client/Components/DocsSlotsSection.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@foreach( var slot in Slots )
{
<li>
<strong class="text-orange-500">@slot.Name</strong>: @slot.Description
<strong class="text-orange-500">@slot.Name:</strong> @slot.Description
</li>
}
</ul>
Expand Down
14 changes: 6 additions & 8 deletions docs/LumexUI.Docs.Client/Components/Header.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
Bordered="@true"
MaxWidth="@MaxWidth.XLarge"
Classes="@_navbarClasses">
<LumexNavbarContent>
<LumexNavbarBrand>
<LumexLink Href="/"
Class="font-bold text-xl text-foreground-900">
Lumex<span class="font-normal">UI</span>
</LumexLink>
</LumexNavbarBrand>
</LumexNavbarContent>
<LumexNavbarBrand>
<LumexLink Href="/"
Class="font-bold text-xl text-foreground-900">
Lumex<span class="font-normal">UI</span>
</LumexLink>
</LumexNavbarBrand>

<LumexNavbarContent Align="@Align.End" Class="hidden sm:flex">
@foreach( var item in _navItems )
Expand Down
2 changes: 1 addition & 1 deletion docs/LumexUI.Docs.Client/Components/PreviewCode.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@rendermode InteractiveWebAssembly
@inject IJSRuntime JSRuntime

<div class="rounded-2xl ring-1 ring-foreground-950/5 shadow-sm overflow-hidden">
<div class="@BaseClass">
<Preview Classes="@_previewClasses">
@ChildContent
</Preview>
Expand Down
10 changes: 10 additions & 0 deletions docs/LumexUI.Docs.Client/Components/PreviewCode.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ public partial class PreviewCode
[Parameter] public RenderFragment? ChildContent { get; set; }
[Parameter, EditorRequired] public CodeBlock Code { get; set; } = default!;
[Parameter] public Preview.Slots? PreviewClasses { get; set; }
[Parameter] public string? Class { get; set; }

private string? BaseClass => ElementClass.Empty()
.Add( "rounded-2xl" )
.Add( "ring-1" )
.Add( "ring-foreground-950/5" )
.Add( "shadow-sm" )
.Add( "overflow-hidden" )
.Add( Class )
.ToString();

private string ToolbarClass => ElementClass.Empty()
.Add( "p-2" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
category: "Components",
description: "The checkbox group allows users to select or deselect options from a set.",
headings: _headings,
linksProps: new ComponentLinksProps( "Checkbox", isServer: true )
linksProps: new ComponentLinksProps( "Checkbox", isServer: false )
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="grid max-w-sm gap-4 p-4 rounded-xl bg-white ring-1 ring-black/5 shadow-lg">
<div class="grid max-w-sm gap-4 p-4 rounded-xl bg-white ring-1 ring-black/5 shadow-md">
<div class="flex gap-4">
<div class="flex w-12 h-12 items-center justify-center shrink-0 rounded-full bg-violet-200 text-black">
<span class="font-semibold text-lg">RG</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/LumexUI.Docs.Client/Pages/Components/Link/Link.razor
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<DocsSection Title="Custom Styles">
<p>
You can customize the divider component by passing any Tailwind CSS
You can customize the link component by passing any Tailwind CSS
classes to the component's <Code>Class</Code> and/or <Code>Style</Code> parameters.
</p>
<CustomStyles />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<LumexNavbar Blurred="@false"
Bordered="@true"
Sticky="@true">
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>

<LumexNavbarContent Class="hidden sm:flex">
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/blurred#"
Color="@ThemeColor.None">
Home
</LumexLink>
</LumexNavbarItem>
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/blurred#"
Color="@ThemeColor.None">
About
</LumexLink>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexNavbarItem>
<LumexButton Size="@Size.Small"
Color="@ThemeColor.Primary"
Variant="@Variant.Flat">
Log In
</LumexButton>
</LumexNavbarItem>
</LumexNavbarContent>
</LumexNavbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<LumexNavbar Bordered="@true"
Sticky="@true">
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>

<LumexNavbarContent Class="hidden sm:flex">
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/bordered#"
Color="@ThemeColor.None">
Home
</LumexLink>
</LumexNavbarItem>
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/bordered#"
Color="@ThemeColor.None">
About
</LumexLink>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexNavbarItem>
<LumexButton Size="@Size.Small"
Color="@ThemeColor.Primary"
Variant="@Variant.Flat">
Log In
</LumexButton>
</LumexNavbarItem>
</LumexNavbarContent>
</LumexNavbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<LumexNavbar>
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>

<LumexNavbarContent Class="hidden sm:flex">
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/brand#"
Color="@ThemeColor.None">
Home
</LumexLink>
</LumexNavbarItem>
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/brand#"
Color="@ThemeColor.None">
About
</LumexLink>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexNavbarItem>
<LumexButton Size="@Size.Small"
Color="@ThemeColor.Primary"
Variant="@Variant.Flat">
Log In
</LumexButton>
</LumexNavbarItem>
</LumexNavbarContent>
</LumexNavbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<LumexNavbar Bordered="@true"
Sticky="@true"
Classes="@_navbarClasses">
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>

<LumexNavbarContent Class="hidden sm:flex">
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/custom-styles#"
Color="@ThemeColor.None">
Home
</LumexLink>
</LumexNavbarItem>
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/custom-styles#"
Color="@ThemeColor.None">
About
</LumexLink>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexTextbox Type="@InputType.Search"
Color="@ThemeColor.Info"
Variant="@InputVariant.Flat"
Size="@Size.Small"
Placeholder="Type to search..."
Classes="@_inputClasses">
<StartContent>
<LumexIcon Icon="@Icons.Rounded.Search" />
</StartContent>
</LumexTextbox>
</LumexNavbarContent>
</LumexNavbar>

@code {
private NavbarSlots _navbarClasses = new()
{
Root = "border-b-2 border-sky-100",
Brand = "bg-clip-text bg-gradient-to-r from-sky-900 to-sky-600 text-transparent",
Content = "gap-3",
Item = "px-4 py-1.5 rounded-lg text-sky-600 bg-sky-50 font-medium"
};

private InputFieldSlots _inputClasses = new()
{
Root = "max-w-full sm:max-w-[10rem] h-8",
Input = "text-tiny"
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<LumexNavbar Height="3rem"
Bordered="@true"
Sticky="@true">
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>

<LumexNavbarContent Class="hidden sm:flex">
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/height#"
Color="@ThemeColor.None">
Home
</LumexLink>
</LumexNavbarItem>
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/height#"
Color="@ThemeColor.None">
About
</LumexLink>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexNavbarItem>
<LumexButton Size="@Size.Small"
Color="@ThemeColor.Primary"
Variant="@Variant.Flat">
Log In
</LumexButton>
</LumexNavbarItem>
</LumexNavbarContent>
</LumexNavbar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<LumexNavbar>
<LumexNavbarContent>
<LumexNavbarMenuToggle Class="sm:hidden" />
<LumexNavbarBrand>
<span class="font-bold text-xl">
Lumex<span class="font-normal">UI</span>
</span>
</LumexNavbarBrand>
</LumexNavbarContent>

<LumexNavbarContent Class="hidden sm:flex">
@foreach( var link in _navItems )
{
<LumexNavbarItem>
<LumexLink Href="/examples/navbar/menu#"
Color="@ThemeColor.None">
@link
</LumexLink>
</LumexNavbarItem>
}
</LumexNavbarContent>

<LumexNavbarContent Align="@Align.End">
<LumexNavbarItem>
<LumexButton Size="@Size.Small"
Color="@ThemeColor.Primary"
Variant="@Variant.Flat">
Log In
</LumexButton>
</LumexNavbarItem>
</LumexNavbarContent>

<LumexNavbarMenu>
@foreach( var link in _navItems )
{
<LumexNavbarMenuItem>
<LumexLink Color="@ThemeColor.None">@link</LumexLink>
</LumexNavbarMenuItem>
}
</LumexNavbarMenu>
</LumexNavbar>

@code {
private string[] _navItems = [
"Home",
"About",
"Contact"
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/blurred"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.Blurred />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/bordered"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.Bordered />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/brand"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.Brand />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/custom-styles"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.CustomStyles />
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@inherits LayoutComponentBase
@layout MainLayout

@Body

<article class="p-6 space-y-4">
<h1 class="text-center text-2xl font-bold mb-2">A Cool Story</h1>
<p>
Jake was preparing his morning smoothie when he accidentally added his dog Max’s kibble instead of chia seeds. Halfway through blending, he realized his mistake. Curious and not wanting to waste food, he decided to take a small sip. To his surprise, Max watched him with a puzzled expression.
</p>
<p>
The next morning, as a joke, Jake made two breakfasts—one for himself with kibble and another for Max with chia seeds. He posted the swap on social media, and people loved it. Encouraged by the reaction, Jake started experimenting with different smoothie flavors, incorporating kibble in creative ways.
</p>
<p>
His new vlog, 'Kibble Kitchen,' featured him taste-testing these unusual recipes and capturing Max’s reactions. The concept went viral, and Jake and Max quickly became a sensation. Before long, they landed a sponsorship from a pet food company, turning their accidental smoothie swap into a full-fledged business. Together, they became an influencer duo, delighting fans with their daily breakfast adventures.
</p>
</article>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/height"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.Height />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/max-width"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples._MaxWidth />
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page "/examples/navbar/menu"
@layout ExampleLayout
@rendermode InteractiveWebAssembly

<LumexUI.Docs.Client.Pages.Components.Navbar.Examples.Menu />
Loading

0 comments on commit 91345fc

Please sign in to comment.