From 3d2257ae3cbd6acc071be57c96d4b01bfd0a992b Mon Sep 17 00:00:00 2001 From: Mats Bosson Date: Mon, 30 Mar 2026 03:15:24 +0700 Subject: [PATCH] Showcase layout and navigation --- packages/showcase/src/app.tsx | 87 +++++++++++++++++++++++- packages/showcase/src/component-demo.tsx | 21 ++++++ 2 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 packages/showcase/src/component-demo.tsx diff --git a/packages/showcase/src/app.tsx b/packages/showcase/src/app.tsx index e178981..0e0bc80 100644 --- a/packages/showcase/src/app.tsx +++ b/packages/showcase/src/app.tsx @@ -1,4 +1,85 @@ -/** Root application component for the PettyUI kitchen-sink showcase. */ -export function App() { - return
PettyUI Showcase
; +import type { JSX } from "solid-js"; + +const categories = [ + { id: "layout-display", label: "Layout & Display" }, + { id: "inputs-basic", label: "Inputs: Basic" }, + { id: "inputs-selection", label: "Inputs: Selection" }, + { id: "inputs-advanced", label: "Inputs: Advanced" }, + { id: "navigation", label: "Navigation" }, + { id: "overlays", label: "Overlays" }, + { id: "feedback-status", label: "Feedback & Status" }, + { id: "data", label: "Data" }, +] as const; + +type Category = (typeof categories)[number]; + +/** Renders a single nav anchor link for a category. */ +function NavLink(props: { cat: Category }) { + const link = ( + + {props.cat.label} + + ); + return link; +} + +/** Section wrapper with category heading and anchor target. */ +function Section(props: { id: string; title: string; children: JSX.Element }) { + const content = ( +
+
+

{props.title}

+
+ {props.children} +
+ ); + return content; +} + +const navLinks = categories.map((cat) => ); + +/** Kitchen sink showcase page with all PettyUI components. */ +export function App() { + const page = ( +
+
+
+

+ PettyUI Kitchen Sink +

+ +
+
+ +
+
+

Coming soon...

+
+
+

Coming soon...

+
+
+

Coming soon...

+
+
+

Coming soon...

+
+ +
+

Coming soon...

+
+
+

Coming soon...

+
+
+

Coming soon...

+
+
+
+ ); + return page; } diff --git a/packages/showcase/src/component-demo.tsx b/packages/showcase/src/component-demo.tsx new file mode 100644 index 0000000..2a338e3 --- /dev/null +++ b/packages/showcase/src/component-demo.tsx @@ -0,0 +1,21 @@ +import type { JSX } from "solid-js"; + +interface ComponentDemoProps { + name: string; + description: string; + children: JSX.Element; +} + +/** Renders a titled component demo block with description and bordered demo area. */ +export function ComponentDemo(props: ComponentDemoProps) { + const wrapper = ( +
+

{props.name}

+

{props.description}

+
+ {props.children} +
+
+ ); + return wrapper; +}