2026-03-18 15:17:40 +01:00
|
|
|
import styles from './LayoutSection.module.css'
|
|
|
|
|
import { Sidebar } from '../../../design-system/layout/Sidebar/Sidebar'
|
2026-03-18 17:50:41 +01:00
|
|
|
import type { SidebarApp } from '../../../design-system/layout/Sidebar/Sidebar'
|
2026-03-18 15:17:40 +01:00
|
|
|
import { TopBar } from '../../../design-system/layout/TopBar/TopBar'
|
|
|
|
|
|
|
|
|
|
// ── DemoCard helper ──────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
interface DemoCardProps {
|
|
|
|
|
id: string
|
|
|
|
|
title: string
|
|
|
|
|
description: string
|
|
|
|
|
children: React.ReactNode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DemoCard({ id, title, description, children }: DemoCardProps) {
|
|
|
|
|
return (
|
|
|
|
|
<div id={id} className={styles.componentCard}>
|
|
|
|
|
<h3 className={styles.componentTitle}>{title}</h3>
|
|
|
|
|
<p className={styles.componentDesc}>{description}</p>
|
|
|
|
|
<div className={styles.demoArea}>{children}</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-18 17:50:41 +01:00
|
|
|
// ── Sample data (hierarchical) ───────────────────────────────────────────────
|
2026-03-18 15:17:40 +01:00
|
|
|
|
2026-03-18 17:50:41 +01:00
|
|
|
const SAMPLE_APPS: SidebarApp[] = [
|
2026-03-18 15:17:40 +01:00
|
|
|
{
|
2026-03-18 17:50:41 +01:00
|
|
|
id: 'app1',
|
|
|
|
|
name: 'cameleer-prod',
|
|
|
|
|
health: 'live' as const,
|
|
|
|
|
exchangeCount: 14320,
|
|
|
|
|
routes: [
|
|
|
|
|
{ id: 'r1', name: 'order-ingest', exchangeCount: 5421 },
|
|
|
|
|
{ id: 'r2', name: 'payment-validate', exchangeCount: 3102 },
|
|
|
|
|
],
|
|
|
|
|
agents: [
|
2026-03-18 18:22:14 +01:00
|
|
|
{ id: 'ag1', name: 'agent-prod-1', status: 'live' as const, tps: 42 },
|
|
|
|
|
{ id: 'ag2', name: 'agent-prod-2', status: 'live' as const, tps: 38 },
|
2026-03-18 17:50:41 +01:00
|
|
|
],
|
2026-03-18 15:17:40 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-03-18 17:50:41 +01:00
|
|
|
id: 'app2',
|
|
|
|
|
name: 'cameleer-staging',
|
|
|
|
|
health: 'stale' as const,
|
|
|
|
|
exchangeCount: 871,
|
|
|
|
|
routes: [
|
|
|
|
|
{ id: 'r3', name: 'notify-customer', exchangeCount: 2201 },
|
|
|
|
|
],
|
|
|
|
|
agents: [
|
2026-03-18 18:22:14 +01:00
|
|
|
{ id: 'ag3', name: 'agent-staging-1', status: 'stale' as const, tps: 5 },
|
2026-03-18 17:50:41 +01:00
|
|
|
],
|
2026-03-18 15:17:40 +01:00
|
|
|
},
|
|
|
|
|
{
|
2026-03-18 17:50:41 +01:00
|
|
|
id: 'app3',
|
|
|
|
|
name: 'cameleer-dev',
|
|
|
|
|
health: 'dead' as const,
|
|
|
|
|
exchangeCount: 42,
|
|
|
|
|
routes: [],
|
|
|
|
|
agents: [],
|
2026-03-18 15:17:40 +01:00
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// ── LayoutSection ─────────────────────────────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
export function LayoutSection() {
|
|
|
|
|
return (
|
|
|
|
|
<section id="layout" className={styles.section}>
|
|
|
|
|
<h2 className={styles.sectionTitle}>Layout</h2>
|
|
|
|
|
|
|
|
|
|
{/* 1. AppShell */}
|
|
|
|
|
<DemoCard
|
|
|
|
|
id="appshell"
|
|
|
|
|
title="AppShell"
|
|
|
|
|
description="Full-page shell that composes Sidebar + TopBar + main content area. Cannot be nested — shown as a structural diagram."
|
|
|
|
|
>
|
|
|
|
|
<div className={styles.shellDiagram}>
|
|
|
|
|
<div className={styles.shellDiagramTop}>
|
2026-03-19 16:33:34 +01:00
|
|
|
TopBar — breadcrumb · search · filters · time range · env badge · user avatar
|
2026-03-18 15:17:40 +01:00
|
|
|
</div>
|
|
|
|
|
<div className={styles.shellDiagramBody}>
|
|
|
|
|
<div className={styles.shellDiagramSide}>
|
|
|
|
|
<span>Sidebar</span>
|
|
|
|
|
<span style={{ fontWeight: 400, fontSize: 10, marginTop: 4 }}>Logo</span>
|
|
|
|
|
<span style={{ fontWeight: 400, fontSize: 10 }}>Search</span>
|
|
|
|
|
<span style={{ fontWeight: 400, fontSize: 10 }}>Navigation</span>
|
2026-03-18 17:50:41 +01:00
|
|
|
<span style={{ fontWeight: 400, fontSize: 10 }}>Applications tree</span>
|
|
|
|
|
<span style={{ fontWeight: 400, fontSize: 10 }}>Agents tree</span>
|
|
|
|
|
<span style={{ fontWeight: 400, fontSize: 10 }}>Starred</span>
|
2026-03-18 15:17:40 +01:00
|
|
|
</div>
|
|
|
|
|
<div className={styles.shellDiagramMain}>
|
|
|
|
|
<children> — page content rendered here
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</DemoCard>
|
|
|
|
|
|
|
|
|
|
{/* 2. Sidebar */}
|
|
|
|
|
<DemoCard
|
|
|
|
|
id="sidebar"
|
|
|
|
|
title="Sidebar"
|
2026-03-18 17:50:41 +01:00
|
|
|
description="Navigation sidebar with hierarchical app/route/agent trees, starring, search filter, and bottom links."
|
2026-03-18 15:17:40 +01:00
|
|
|
>
|
|
|
|
|
<div className={styles.sidebarPreview}>
|
2026-03-18 17:50:41 +01:00
|
|
|
<Sidebar apps={SAMPLE_APPS} />
|
2026-03-18 15:17:40 +01:00
|
|
|
</div>
|
|
|
|
|
</DemoCard>
|
|
|
|
|
|
|
|
|
|
{/* 3. TopBar */}
|
|
|
|
|
<DemoCard
|
|
|
|
|
id="topbar"
|
|
|
|
|
title="TopBar"
|
2026-03-19 16:33:34 +01:00
|
|
|
description="Top navigation bar with breadcrumb, search trigger, status filters, time range, environment badge, and user avatar."
|
2026-03-18 15:17:40 +01:00
|
|
|
>
|
|
|
|
|
<div className={styles.topbarPreview}>
|
|
|
|
|
<TopBar
|
|
|
|
|
breadcrumb={[
|
|
|
|
|
{ label: 'Dashboard', href: '#' },
|
|
|
|
|
{ label: 'Applications', href: '#' },
|
|
|
|
|
{ label: 'order-ingest' },
|
|
|
|
|
]}
|
|
|
|
|
environment="production"
|
2026-03-18 20:06:25 +01:00
|
|
|
|
2026-03-18 15:17:40 +01:00
|
|
|
user={{ name: 'Hendrik' }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</DemoCard>
|
|
|
|
|
</section>
|
|
|
|
|
)
|
|
|
|
|
}
|