diff --git a/ShellUI.slnx b/ShellUI.slnx index 36ca80f..c7b4adc 100644 --- a/ShellUI.slnx +++ b/ShellUI.slnx @@ -8,10 +8,15 @@ + + + + + diff --git a/src/ShellUI.Docs/Components/App.razor b/src/ShellUI.Docs/Components/App.razor new file mode 100644 index 0000000..6d30b55 --- /dev/null +++ b/src/ShellUI.Docs/Components/App.razor @@ -0,0 +1,49 @@ +@using ShellUI.Docs.Components + + + + + + ShellUI — shadcn-flavoured Blazor components + + + @* Cascade order matters — later files override earlier ones: + 1. ShellDocs.Tokens — neutral token baseline (--foreground, --card, …) + 2. ShellDocs theme — docs-chrome-specific extensions + 3. ShellUI theme — brand palette; overrides tokens where they collide + 4. ShellUI utilities — compiled Tailwind classes used by ShellUI components + 5. Site styles — this project's own overrides *@ + + + + + + + + + + + + + + + + + + diff --git a/src/ShellUI.Docs/Components/Pages/DocsPage.razor b/src/ShellUI.Docs/Components/Pages/DocsPage.razor new file mode 100644 index 0000000..41e5724 --- /dev/null +++ b/src/ShellUI.Docs/Components/Pages/DocsPage.razor @@ -0,0 +1,62 @@ +@page "/docs/{*Path:nonfile}" +@layout DocsLayout +@using Microsoft.AspNetCore.Components.Sections +@inject NavigationGraph Graph +@inject MarkdownRenderer Renderer + +@_title + +@if (_document is not null) +{ + + + + + + +} +else +{ +
+

Page not found

+

The page @Path doesn't exist yet.

+

Back to introduction

+
+} + + + +@code { + [Parameter] public string? Path { get; set; } + + private RenderedDocument? _document; + private string _title = ""; + private NavigationNode? _prev; + private NavigationNode? _next; + + protected override void OnParametersSet() + { + var url = "/docs" + (string.IsNullOrEmpty(Path) ? "" : "/" + Path); + var node = Graph.ResolveByUrl(url); + if (node?.Path is not null && System.IO.File.Exists(node.Path)) + { + _document = Renderer.RenderFile(node.Path); + _title = node.Title + " — ShellUI"; + (_prev, _next) = Graph.GetPrevNext(node); + } + else + { + _document = null; + _title = "Not found — ShellUI"; + _prev = null; + _next = null; + } + } +} diff --git a/src/ShellUI.Docs/Components/Pages/Home.razor b/src/ShellUI.Docs/Components/Pages/Home.razor new file mode 100644 index 0000000..da52480 --- /dev/null +++ b/src/ShellUI.Docs/Components/Pages/Home.razor @@ -0,0 +1,46 @@ +@page "/" +@layout HomeLayout + +ShellUI — shadcn-flavoured Blazor components + +@* Placeholder landing until the content branch adds a real hero. Keeps the + scaffold branch focused on wiring; a proper home page ships in + content/intro-and-3-proof-components. *@ +
+

ShellUI

+

shadcn-flavoured Blazor components — the CLI-first component library.

+

+ Read the docs +

+
+ + diff --git a/src/ShellUI.Docs/Components/Routes.razor b/src/ShellUI.Docs/Components/Routes.razor new file mode 100644 index 0000000..efd2153 --- /dev/null +++ b/src/ShellUI.Docs/Components/Routes.razor @@ -0,0 +1,9 @@ + + + + + + Not found — ShellUI +

Page not found.

+
+
diff --git a/src/ShellUI.Docs/Components/_Imports.razor b/src/ShellUI.Docs/Components/_Imports.razor new file mode 100644 index 0000000..1fae973 --- /dev/null +++ b/src/ShellUI.Docs/Components/_Imports.razor @@ -0,0 +1,15 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using ShellDocs.Components +@using ShellDocs.Components.Chrome +@using ShellDocs.Components.Content +@using ShellDocs.Components.Layouts +@using ShellDocs.Core +@using ShellDocs.Markdown +@using ShellUI.Docs.Components diff --git a/src/ShellUI.Docs/Program.cs b/src/ShellUI.Docs/Program.cs new file mode 100644 index 0000000..ae7202e --- /dev/null +++ b/src/ShellUI.Docs/Program.cs @@ -0,0 +1,51 @@ +using ShellDocs.Components; +using ShellUI.Docs.Components; + +var builder = WebApplication.CreateBuilder(args); + +builder.WebHost.UseStaticWebAssets(); + +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); + +builder.Services.AddShellDocs(o => +{ + o.ContentRoot = Path.Combine(builder.Environment.ContentRootPath, "content"); + o.SiteName = "ShellUI"; + o.SiteTagline = "shadcn-flavoured Blazor components"; + o.GitHubRepo = "shellui-dev/shellui"; + o.LayoutVariant = DocsLayoutVariant.Sidebar; + + o.AddNavLink("Documentation", "/docs/introduction"); + o.AddNavLink("Components", "/docs/components"); + + /* Sidebar package selector — one entry per ShellUI monorepo package. + ShellDocs' PackageSelector hides itself if fewer than 2 packages are + declared; four is comfortably above that threshold. RootUrl paths are + matched by longest-prefix against the current URL to resolve which + package is "active". IconPath is optional — omit to fall through to + the default box glyph. */ + o.AddPackage("shellui", "ShellUI", "The component library.", "/docs/introduction", "M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z"); + o.AddPackage("shellui.components", "ShellUI.Components", "60+ Blazor primitives.", "/docs/components", "M12 2 4 6v6c0 5 3.5 9.5 8 10 4.5-.5 8-5 8-10V6z"); + o.AddPackage("shellui.cli", "ShellUI.CLI", "Add, list, scaffold.", "/docs/cli", "m8 6-6 6 6 6 M16 6l6 6-6 6"); + o.AddPackage("shellui.templates", "ShellUI.Templates", "Starter markdown + files.", "/docs/templates", "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z M14 2l6 6 M14 2v6h6"); + + /* Register every public ShellUI component under its type name so any of + them can be embedded in markdown via