All blocks
Shell Nav
Application shell pairing a top navigation bar (workspace switcher, command search dialog, notifications popover, account menu) with a collapsible left sidebar, mobile slide-over drawer, and interactive cloud deployment views.
Built withApp ShellAvatarBadgeButtonCardCenterCodeDialogDrawerGridHeadingIconIcon ButtonInputKbdMenuNavbarPopoverProgressSeparatorSidebarSidebar Nav ItemStackStatStatusSwitchTableTextToast
Harbor Deploy
Harbor CloudPlatformOverview
Overview
Cluster health, recent releases, and edge throughput across regions.
Active Deployments
14
Latest: rel-482
P95 Edge Latency
42 ms
-14% vs last 7 days
30d Availability
99.98%
Zero severity-1 incidents
Monthly Bandwidth
1.84 TB
61% of 3.00 TB allowance
Recent Deployments
Latest builds promoted across Harbor Cloud
| Release | Branch | Status | Time |
|---|---|---|---|
rel-482Enable Brotli level-6 streaming on edge gateway | main | Live | 12m ago |
rel-481Rotate webhook HMAC verifier keys with dual-window grace | main | Live | 2h ago |
rel-480Add regional read-replica failover probe for Postgres pool | feat/replica-probe | Building | 3h ago |
rel-479Test HTTP/3 early hints for static asset preloading | exp/early-hints | Live | 5h ago |
Edge Regions
Live capacity and routing latency per PoP cluster
Frankfurt
eu-west-124 ms · 62% loadVirginia
us-east-138 ms · 48% loadTokyo
ap-northeast-131 ms · 34% loadInstall
1npx stylexblocks add shell-navSource
components/blocks/ui-sdk/shell-nav.tsx
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884import * as stylex from "@stylexjs/stylex";import { useCallback, useEffect, useMemo, useState } from "react";import { AppShell } from "#components/ui/ui-sdk/app-shell.tsx";import { Avatar } from "#components/ui/ui-sdk/avatar.tsx";import { Badge } from "#components/ui/ui-sdk/badge.tsx";import { Button } from "#components/ui/ui-sdk/button.tsx";import { Card } from "#components/ui/ui-sdk/card.tsx";import { Center } from "#components/ui/ui-sdk/center.tsx";import { Code } from "#components/ui/ui-sdk/code.tsx";import { Dialog } from "#components/ui/ui-sdk/dialog.tsx";import { Drawer } from "#components/ui/ui-sdk/drawer.tsx";import { Grid } from "#components/ui/ui-sdk/grid.tsx";import { Heading } from "#components/ui/ui-sdk/heading.tsx";import { Icon } from "#components/ui/ui-sdk/icon.tsx";import { IconButton } from "#components/ui/ui-sdk/icon-button.tsx";import { Input } from "#components/ui/ui-sdk/input.tsx";import { Kbd } from "#components/ui/ui-sdk/kbd.tsx";import { Menu } from "#components/ui/ui-sdk/menu.tsx";import { Navbar } from "#components/ui/ui-sdk/navbar.tsx";import { Popover } from "#components/ui/ui-sdk/popover.tsx";import { Progress } from "#components/ui/ui-sdk/progress.tsx";import { Separator } from "#components/ui/ui-sdk/separator.tsx";import { Sidebar } from "#components/ui/ui-sdk/sidebar.tsx";import { SidebarNavItem, sidebarNavItemActive,} from "#components/ui/ui-sdk/sidebar-nav-item.tsx";import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";import { Stat } from "#components/ui/ui-sdk/stat.tsx";import { Status } from "#components/ui/ui-sdk/status.tsx";import { Switch } from "#components/ui/ui-sdk/switch.tsx";import { Table } from "#components/ui/ui-sdk/table.tsx";import { Text } from "#components/ui/ui-sdk/text.tsx";import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";import { semanticRadii } from "@stylexblocks/ui/semantic-tokens/radii.stylex.ts";import { accentPalette, amberPalette, bluePalette, greenPalette, redPalette,} from "@stylexblocks/ui/themes/palettes.ts";import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";import { lineHeights } from "@stylexblocks/ui/tokens/line-heights.stylex.ts";import { radii } from "@stylexblocks/ui/tokens/radii.stylex.ts";import { sizes } from "@stylexblocks/ui/tokens/sizes.stylex.ts";import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";import type { StyleOverrideProps } from "#lib/recipe-props.ts";
export type ShellNavRoute = | "overview" | "deployments" | "logs" | "domains" | "environment" | "billing";
interface WorkspaceConfig { id: string; name: string; env: "Production" | "Staging" | "Preview"; region: string; release: string; uptime: string; p95Latency: string; bandwidth: string; activeDeployments: string; palette: "green" | "amber" | "blue";}
interface DeploymentItem { id: string; workspaceId: string; commit: string; message: string; branch: string; author: string; status: "live" | "building" | "failed"; region: string; duration: string; createdAt: string;}
interface LogEntry { id: string; timestamp: string; level: "info" | "warn" | "error"; region: string; service: string; message: string;}
interface DomainItem { id: string; host: string; target: string; tls: "Valid · Auto-renew" | "Provisioning"; status: "verified" | "pending"; primary?: boolean;}
interface EnvVarItem { id: string; key: string; value: string; scope: "Production" | "Preview" | "Development"; secret: boolean; updatedAt: string;}
interface NotificationItem { id: string; title: string; detail: string; time: string; route: ShellNavRoute; unread: boolean;}
const NARROW = "@container shell-nav (max-width: 768px)";const COMPACT = "@container shell-nav (max-width: 560px)";const MEDIUM = "@container shell-nav (max-width: 1024px)";
const WORKSPACES: WorkspaceConfig[] = [ { id: "harbor-prod", name: "Harbor Cloud", env: "Production", region: "eu-west-1", release: "rel-482", uptime: "99.98%", p95Latency: "42 ms", bandwidth: "1.84 TB", activeDeployments: "14", palette: "green", }, { id: "harbor-staging", name: "Harbor Staging", env: "Staging", region: "us-east-1", release: "rel-485-rc", uptime: "99.91%", p95Latency: "56 ms", bandwidth: "420 GB", activeDeployments: "6", palette: "amber", }, { id: "harbor-edge", name: "Harbor Edge Lab", env: "Preview", region: "ap-northeast-1", release: "rel-486-exp", uptime: "99.74%", p95Latency: "31 ms", bandwidth: "118 GB", activeDeployments: "4", palette: "blue", },];
const INITIAL_DEPLOYMENTS: DeploymentItem[] = [ { id: "rel-482", workspaceId: "harbor-prod", commit: "9f4c2a1", message: "Enable Brotli level-6 streaming on edge gateway", branch: "main", author: "Nora Lindholm", status: "live", region: "eu-west-1", duration: "38s", createdAt: "12m ago", }, { id: "rel-481", workspaceId: "harbor-prod", commit: "4b8e110", message: "Rotate webhook HMAC verifier keys with dual-window grace", branch: "main", author: "Marek Nowak", status: "live", region: "us-east-1", duration: "44s", createdAt: "2h ago", }, { id: "rel-480", workspaceId: "harbor-staging", commit: "c17d9a4", message: "Add regional read-replica failover probe for Postgres pool", branch: "feat/replica-probe", author: "Tessa Vermeer", status: "building", region: "us-east-1", duration: "29s", createdAt: "3h ago", }, { id: "rel-479", workspaceId: "harbor-edge", commit: "77a3f5e", message: "Test HTTP/3 early hints for static asset preloading", branch: "exp/early-hints", author: "Kenji Sato", status: "live", region: "ap-northeast-1", duration: "33s", createdAt: "5h ago", }, { id: "rel-478", workspaceId: "harbor-prod", commit: "2e09ab8", message: "Upgrade worker runtime to v22.14 LTS", branch: "chore/runtime-22", author: "Nora Lindholm", status: "failed", region: "eu-west-1", duration: "1m 14s", createdAt: "Yesterday", },];
const INITIAL_LOGS: LogEntry[] = [ { id: "log-1", timestamp: "14:22:08.412", level: "info", region: "eu-west-1", service: "edge-router", message: "Promoted release rel-482 across 18 edge PoPs with 0 dropped connections", }, { id: "log-2", timestamp: "14:22:06.104", level: "info", region: "us-east-1", service: "tls-manager", message: "OCSP staple refreshed for api.harbor.app (valid 89 days)", }, { id: "log-3", timestamp: "14:21:54.889", level: "warn", region: "eu-west-1", service: "worker-pool", message: "Cold-start duration peaked at 142ms during autoscaling burst (8 → 14 instances)", }, { id: "log-4", timestamp: "14:21:41.203", level: "info", region: "ap-northeast-1", service: "cache-layer", message: "Edge cache hit ratio stabilized at 96.4% after stale-while-revalidate tune", }, { id: "log-5", timestamp: "14:20:59.017", level: "error", region: "eu-west-1", service: "build-runner", message: "Release rel-478 failed healthcheck on /readyz: upstream timeout after 5000ms", }, { id: "log-6", timestamp: "14:20:12.641", level: "info", region: "us-east-1", service: "billing-meter", message: "Hourly bandwidth rollup committed (14.2 GB egress, 0 quota alerts)", },];
const INITIAL_DOMAINS: DomainItem[] = [ { id: "dom-1", host: "harbor.app", target: "main · eu-west-1", tls: "Valid · Auto-renew", status: "verified", primary: true, }, { id: "dom-2", host: "api.harbor.app", target: "main · global anycast", tls: "Valid · Auto-renew", status: "verified", }, { id: "dom-3", host: "docs.harbor.app", target: "main · static edge", tls: "Valid · Auto-renew", status: "verified", }, { id: "dom-4", host: "preview.harbor.app", target: "staging · us-east-1", tls: "Provisioning", status: "pending", },];
const INITIAL_ENV_VARS: EnvVarItem[] = [ { id: "env-1", key: "DATABASE_POOL_URL", value: "postgres://harbor_prod@pg-eu.internal:6432/core?sslmode=require", scope: "Production", secret: true, updatedAt: "3d ago", }, { id: "env-2", key: "EDGE_CACHE_TTL_SECONDS", value: "300", scope: "Production", secret: false, updatedAt: "5d ago", }, { id: "env-3", key: "WEBHOOK_SIGNING_SECRET", value: "whsec_harbor_9f82c41e09b74a22c81d7e30", scope: "Production", secret: true, updatedAt: "2h ago", }, { id: "env-4", key: "TELEMETRY_SAMPLE_RATE", value: "0.25", scope: "Preview", secret: false, updatedAt: "1w ago", }, { id: "env-5", key: "OAUTH_CALLBACK_ORIGIN", value: "https://preview.harbor.app", scope: "Development", secret: false, updatedAt: "2w ago", },];
const INITIAL_NOTIFICATIONS: NotificationItem[] = [ { id: "notif-1", title: "Release rel-482 is live", detail: "Brotli level-6 streaming promoted to eu-west-1 in 38s.", time: "12m ago", route: "deployments", unread: true, }, { id: "notif-2", title: "Worker burst warning", detail: "Cold-start latency briefly reached 142ms during scale-out.", time: "15m ago", route: "logs", unread: true, }, { id: "notif-3", title: "Pending DNS verification", detail: "Add the CNAME record for preview.harbor.app to issue TLS.", time: "1h ago", route: "domains", unread: false, },];
const EDGE_REGIONS = [ { id: "eu-west-1", city: "Frankfurt", latency: "24 ms", load: 62 }, { id: "us-east-1", city: "Virginia", latency: "38 ms", load: 48 }, { id: "ap-northeast-1", city: "Tokyo", latency: "31 ms", load: 34 },] as const;
const BILLING_QUOTAS = [ { label: "Compute Hours", used: "1,420 hrs", limit: "2,000 hrs", percent: 71 }, { label: "Edge Bandwidth", used: "1.84 TB", limit: "3.00 TB", percent: 61 }, { label: "Build Minutes", used: "890 min", limit: "2,500 min", percent: 36 }, { label: "Team Seats", used: "9 seats", limit: "12 seats", percent: 75 },] as const;
const INVOICES = [ { id: "INV-2026-11", period: "Nov 2026", amount: "$149.00", status: "Paid" }, { id: "INV-2026-10", period: "Oct 2026", amount: "$149.00", status: "Paid" }, { id: "INV-2026-09", period: "Sep 2026", amount: "$129.00", status: "Paid" },] as const;
const ROUTE_META: Record< ShellNavRoute, { label: string; group: "Platform" | "Configuration"; description: string }> = { overview: { label: "Overview", group: "Platform", description: "Cluster health, recent releases, and edge throughput across regions.", }, deployments: { label: "Deployments", group: "Platform", description: "Inspect build pipelines, promote releases, or roll back instant snapshots.", }, logs: { label: "Logs", group: "Platform", description: "Real-time structured runtime and build stream across edge regions.", }, domains: { label: "Domains", group: "Configuration", description: "Custom hostnames, DNS verification, and managed TLS certificates.", }, environment: { label: "Environment", group: "Configuration", description: "Scoped runtime variables, encrypted secrets, and rollout guardrails.", }, billing: { label: "Billing", group: "Configuration", description: "Plan allocation, monthly consumption quotas, and invoice history.", },};
const PLATFORM_ROUTES: ShellNavRoute[] = ["overview", "deployments", "logs"];const CONFIG_ROUTES: ShellNavRoute[] = ["domains", "environment", "billing"];
function RouteGlyph({ route }: { route: ShellNavRoute }) { switch (route) { case "overview": return ( <> <rect x="3" y="3" width="6" height="6" rx="1.25" /> <rect x="11" y="3" width="6" height="6" rx="1.25" /> <rect x="3" y="11" width="6" height="6" rx="1.25" /> <rect x="11" y="11" width="6" height="6" rx="1.25" /> </> ); case "deployments": return ( <> <path d="M10 3.25v9.5" /> <path d="M6.25 7 10 3.25 13.75 7" /> <path d="M4 15.75h12" /> </> ); case "logs": return ( <> <rect x="2.75" y="3.75" width="14.5" height="12.5" rx="2" /> <path d="m6.25 8 2.25 2-2.25 2" /> <path d="M10.75 12h3" /> </> ); case "domains": return ( <> <circle cx="10" cy="10" r="7" /> <ellipse cx="10" cy="10" rx="3.25" ry="7" /> <path d="M3.25 10h13.5" /> </> ); case "environment": return ( <> <path d="M4 6h12" /> <path d="M4 14h12" /> <circle cx="7.5" cy="6" r="1.75" fill="currentColor" /> <circle cx="12.5" cy="14" r="1.75" fill="currentColor" /> </> ); case "billing": return ( <> <rect x="2.75" y="4.5" width="14.5" height="11" rx="2" /> <path d="M2.75 8.5h14.5" /> <path d="M6 12.25h3.5" /> </> ); }}
function HarborMark() { return ( <svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true" > <rect width="20" height="20" rx="5" fill="currentColor" /> <path d="M5.75 13.5V6.5h2.1v2.65h4.3V6.5h2.1v7h-2.1v-2.6h-4.3v2.6h-2.1Z" fill="var(--sui-colors-bg, #ffffff)" /> </svg> );}
const styles = stylex.create({ root: { backgroundColor: semanticColors.bg, color: semanticColors.fg, containerName: "shell-nav", containerType: "inline-size", fontFamily: fonts.body, height: "100%", minHeight: 0, overflow: "hidden", width: "100%", }, shrink0: { flexShrink: 0, }, fullWidth: { width: "100%", }, navbar: { "--navbar-height": "3.5rem", borderBottomColor: semanticColors.border, borderBottomStyle: "solid", borderBottomWidth: "1px", flexShrink: 0, paddingInline: spacing._4, }, mobileMenuTrigger: { display: { default: "none", [NARROW]: "inline-flex", }, }, desktopCollapseTrigger: { display: { default: "inline-flex", [NARROW]: "none", }, }, brandMark: { alignItems: "center", color: semanticColors.accentSolid, display: "inline-flex", flexShrink: 0, }, brandTitle: { letterSpacing: "-0.01em", display: { default: "inline", [COMPACT]: "none", }, }, brandDivider: { display: { default: "inline", [COMPACT]: "none", }, }, workspaceTrigger: { gap: spacing._2, maxWidth: "15rem", }, workspaceEnvBadge: { display: { default: "inline-flex", [COMPACT]: "none", }, }, searchTrigger: { alignItems: "center", backgroundColor: { default: semanticColors.bgMuted, ":hover": semanticColors.bgSubtle, }, borderColor: semanticColors.border, borderRadius: semanticRadii.control, borderStyle: "solid", borderWidth: "1px", color: semanticColors.fgMuted, cursor: "pointer", display: "inline-flex", fontSize: fontSizes.sm, gap: spacing._2, height: sizes.controlSm, justifyContent: "space-between", paddingInline: spacing._2_5, width: { default: "15.5rem", [MEDIUM]: "11rem", [NARROW]: "auto", }, }, searchTriggerLabel: { alignItems: "center", display: "inline-flex", gap: spacing._2, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", }, searchPlaceholderText: { display: { default: "inline", [NARROW]: "none", }, }, searchKbd: { display: { default: "inline-flex", [NARROW]: "none", }, }, deployButton: { display: { default: "inline-flex", [COMPACT]: "none", }, }, iconButtonWrap: { position: "relative", display: "inline-flex", }, unreadDot: { backgroundColor: semanticColors.accentSolid, borderColor: semanticColors.bgPanel, borderRadius: radii.full, borderStyle: "solid", borderWidth: "1.5px", height: "0.5rem", pointerEvents: "none", position: "absolute", right: "0.35rem", top: "0.35rem", width: "0.5rem", }, avatarTrigger: { paddingInline: spacing._1, }, sidebar: { "--sidebar-width": "15rem", "--sidebar-min-width": "15rem", borderRightStyle: "solid", display: { default: "flex", [NARROW]: "none", }, flexShrink: 0, transitionDuration: "180ms", transitionProperty: "width, min-width", }, sidebarCollapsed: { "--sidebar-width": "3.75rem", "--sidebar-min-width": "3.75rem", }, sidebarBodyCollapsed: { paddingInline: spacing._2, }, navList: { listStyle: "none", marginBlock: 0, marginInline: 0, paddingBlock: 0, paddingInline: 0, }, navButtonCollapsed: { justifyContent: "center", paddingInline: 0, }, sidebarFooter: { borderTopColor: semanticColors.sidebarBorder, borderTopStyle: "solid", borderTopWidth: "1px", gap: spacing._2, paddingBlock: spacing._3, }, clusterCard: { backgroundColor: semanticColors.bgPanel, borderColor: semanticColors.border, borderRadius: semanticRadii.control, borderStyle: "solid", borderWidth: "1px", paddingBlock: spacing._2_5, paddingInline: spacing._3, }, clusterCardCollapsed: { paddingBlock: spacing._1, }, drawerBody: { display: "flex", flexDirection: "column", gap: spacing._4, paddingInline: spacing._3, }, main: { backgroundColor: semanticColors.bgContent, overflowY: "auto", }, mainInner: { marginInline: "auto", maxWidth: "70rem", paddingBlock: spacing._6, paddingInline: { default: spacing._6, [NARROW]: spacing._4, }, width: "100%", }, pageHeader: { alignItems: { default: "flex-end", [NARROW]: "flex-start", }, flexDirection: { default: "row", [NARROW]: "column", }, }, breadcrumbRow: { color: semanticColors.fgMuted, fontSize: fontSizes.xs, }, pageTitle: { marginBlock: 0, }, statGrid: { gridTemplateColumns: { default: "repeat(4, minmax(0, 1fr))", [MEDIUM]: "repeat(2, minmax(0, 1fr))", [COMPACT]: "minmax(0, 1fr)", }, }, twoColGrid: { gridTemplateColumns: { default: "minmax(0, 1.5fr) minmax(0, 1fr)", [MEDIUM]: "minmax(0, 1fr)", }, }, cardHeaderRow: { alignItems: "center", display: "flex", flexDirection: "row", gap: spacing._3, justifyContent: "space-between", }, cardTitleReset: { marginBlock: 0, }, cardDescReset: { marginBlock: 0, }, tableWrap: { overflowX: "auto", width: "100%", }, quickActionGrid: { paddingTop: spacing._2, }, inlineSearch: { maxWidth: "18rem", minWidth: "12rem", flexGrow: 1, }, inlineInput: { flexGrow: 1, minWidth: "11rem", }, logStream: { backgroundColor: semanticColors.bgInset, borderColor: semanticColors.border, borderRadius: semanticRadii.control, borderStyle: "solid", borderWidth: "1px", fontFamily: fonts.mono, fontSize: fontSizes.xs, lineHeight: lineHeights.md, overflow: "hidden", }, logRow: { alignItems: "baseline", borderBottomColor: semanticColors.borderMuted, borderBottomStyle: "solid", borderBottomWidth: "1px", gridTemplateColumns: { default: "6.5rem 3.5rem 7rem minmax(0, 1fr)", [NARROW]: "minmax(0, 1fr)", }, paddingBlock: spacing._2, paddingInline: spacing._3, }, logMessage: { wordBreak: "break-word", }, quotaGrid: { gridTemplateColumns: { default: "repeat(2, minmax(0, 1fr))", [COMPACT]: "minmax(0, 1fr)", }, }, planPrice: { letterSpacing: "-0.02em", }, popoverContent: { "--popover-size": "21rem", }, popoverHeaderRow: { paddingBottom: spacing._2, }, notifButton: { alignItems: "flex-start", backgroundColor: { default: "transparent", ":hover": semanticColors.bgSubtle, }, borderRadius: semanticRadii.control, borderStyle: "none", color: semanticColors.fg, cursor: "pointer", display: "flex", flexDirection: "column", gap: spacing._0_5, paddingBlock: spacing._2, paddingInline: spacing._2_5, textAlign: "start", width: "100%", }, menuWidth: { minWidth: "14rem", }, userMenuHeader: { paddingBlock: spacing._1_5, paddingInline: spacing._2, }, paletteDialogBody: { display: "flex", flexDirection: "column", gap: spacing._3, paddingBlock: spacing._4, }, paletteResults: { maxHeight: "18rem", overflowY: "auto", }, paletteItem: { alignItems: "center", backgroundColor: { default: "transparent", ":hover": semanticColors.bgSubtle, }, borderRadius: semanticRadii.control, borderStyle: "none", color: semanticColors.fg, cursor: "pointer", display: "flex", gap: spacing._2_5, justifyContent: "space-between", paddingBlock: spacing._2, paddingInline: spacing._2_5, textAlign: "start", width: "100%", }, emptyStateText: { paddingBlock: spacing._6, },});
export interface ShellNavProps extends StyleOverrideProps { /** Initial active navigation route. */ defaultRoute?: ShellNavRoute; /** Initial active workspace id (`harbor-prod` | `harbor-staging` | `harbor-edge`). */ defaultWorkspaceId?: string; /** Start with the desktop sidebar collapsed to an icon rail. */ defaultSidebarCollapsed?: boolean; /** Called whenever the user switches the active route. */ onRouteChange?: (route: ShellNavRoute) => void; /** Called whenever the user switches the active workspace. */ onWorkspaceChange?: (workspaceId: string) => void;}
/** * ShellNav — full application shell combining a top navigation bar (workspace * switcher, quick search dialog, notifications popover, user menu), a * collapsible left sidebar with grouped route navigation, a mobile slide-over * drawer fallback, and interactive multi-route views for Harbor Deploy. */export function ShellNav({ defaultRoute = "overview", defaultWorkspaceId = "harbor-prod", defaultSidebarCollapsed = false, onRouteChange, onWorkspaceChange, palette, style,}: ShellNavProps) { const queue = useMemo(() => Toast.createToaster(), []);
const [activeRoute, setActiveRoute] = useState<ShellNavRoute>(defaultRoute); const [workspaceId, setWorkspaceId] = useState<string>(defaultWorkspaceId); const [sidebarCollapsed, setSidebarCollapsed] = useState<boolean>( defaultSidebarCollapsed, ); const [mobileNavOpen, setMobileNavOpen] = useState(false); const [searchOpen, setSearchOpen] = useState(false); const [searchQuery, setSearchQuery] = useState("");
const [deployments, setDeployments] = useState<DeploymentItem[]>(INITIAL_DEPLOYMENTS); const [deployFilter, setDeployFilter] = useState< "all" | "live" | "building" | "failed" >("all"); const [deploySearch, setDeploySearch] = useState("");
const [logs, setLogs] = useState<LogEntry[]>(INITIAL_LOGS); const [logLevelFilter, setLogLevelFilter] = useState< "all" | "info" | "warn" | "error" >("all"); const [logSearch, setLogSearch] = useState(""); const [liveTail, setLiveTail] = useState(true);
const [domains, setDomains] = useState<DomainItem[]>(INITIAL_DOMAINS); const [newDomainHost, setNewDomainHost] = useState("");
const [envVars, setEnvVars] = useState<EnvVarItem[]>(INITIAL_ENV_VARS); const [envScopeFilter, setEnvScopeFilter] = useState< "All" | "Production" | "Preview" | "Development" >("All"); const [revealedIds, setRevealedIds] = useState<Record<string, boolean>>({}); const [newEnvKey, setNewEnvKey] = useState(""); const [newEnvValue, setNewEnvValue] = useState(""); const [edgeCacheEnabled, setEdgeCacheEnabled] = useState(true); const [autoRollbackEnabled, setAutoRollbackEnabled] = useState(true); const [zeroDowntimeEnabled, setZeroDowntimeEnabled] = useState(true);
const [notifications, setNotifications] = useState<NotificationItem[]>( INITIAL_NOTIFICATIONS, );
const activeWorkspace = useMemo( () => WORKSPACES.find((w) => w.id === workspaceId) ?? WORKSPACES[0], [workspaceId], );
const unreadCount = useMemo( () => notifications.filter((n) => n.unread).length, [notifications], );
const navigateTo = useCallback( (route: ShellNavRoute) => { setActiveRoute(route); setMobileNavOpen(false); onRouteChange?.(route); }, [onRouteChange], );
const selectWorkspace = useCallback( (nextId: string) => { const target = WORKSPACES.find((w) => w.id === nextId); if (!target) return; setWorkspaceId(nextId); onWorkspaceChange?.(nextId); queue.info(`Switched to ${target.name}`, { description: `${target.env} · ${target.region} (${target.release})`, }); }, [onWorkspaceChange, queue], );
const triggerDeploy = useCallback(() => { const nextNum = 483 + (deployments.length - INITIAL_DEPLOYMENTS.length); const nextId = `rel-${nextNum}`; const newDeployment: DeploymentItem = { id: nextId, workspaceId: activeWorkspace.id, commit: Math.random().toString(16).slice(2, 9), message: `Manual promotion to ${activeWorkspace.name} (${activeWorkspace.region})`, branch: activeWorkspace.env === "Production" ? "main" : "staging", author: "Nora Lindholm", status: "live", region: activeWorkspace.region, duration: "31s", createdAt: "Just now", }; setDeployments((prev) => [newDeployment, ...prev]); setLogs((prev) => [ { id: `log-${Date.now()}`, timestamp: new Date().toTimeString().slice(0, 8) + ".120", level: "info", region: activeWorkspace.region, service: "edge-router", message: `Promoted ${nextId} to ${activeWorkspace.name} with zero downtime`, }, ...prev, ]); queue.success(`Deployed ${nextId} to ${activeWorkspace.name}`, { description: `Live in ${activeWorkspace.region} · completed in 31s.`, }); }, [activeWorkspace, deployments.length, queue]);
useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") { event.preventDefault(); setSearchOpen((prev) => !prev); } }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); }, []);
const paletteCommands = useMemo(() => { const items: Array<{ id: string; label: string; category: string; hint?: string; run: () => void; }> = [ ...(Object.keys(ROUTE_META) as ShellNavRoute[]).map((route) => ({ id: `route-${route}`, label: ROUTE_META[route].label, category: "Navigate", hint: ROUTE_META[route].group, run: () => navigateTo(route), })), ...WORKSPACES.map((ws) => ({ id: `ws-${ws.id}`, label: `Switch workspace: ${ws.name}`, category: "Workspace", hint: ws.region, run: () => selectWorkspace(ws.id), })), { id: "action-deploy", label: `Deploy latest build to ${activeWorkspace.name}`, category: "Action", hint: activeWorkspace.region, run: () => triggerDeploy(), }, { id: "action-sidebar", label: sidebarCollapsed ? "Expand navigation sidebar" : "Collapse navigation sidebar", category: "View", hint: "Layout", run: () => setSidebarCollapsed((prev) => !prev), }, ]; const query = searchQuery.trim().toLowerCase(); if (!query) return items; return items.filter( (item) => item.label.toLowerCase().includes(query) || item.category.toLowerCase().includes(query) || (item.hint?.toLowerCase().includes(query) ?? false), ); }, [ activeWorkspace.name, activeWorkspace.region, navigateTo, searchQuery, selectWorkspace, sidebarCollapsed, triggerDeploy, ]);
const filteredDeployments = useMemo(() => { const q = deploySearch.trim().toLowerCase(); return deployments.filter((item) => { if (deployFilter !== "all" && item.status !== deployFilter) return false; if (!q) return true; return ( item.id.toLowerCase().includes(q) || item.message.toLowerCase().includes(q) || item.branch.toLowerCase().includes(q) || item.commit.toLowerCase().includes(q) ); }); }, [deployFilter, deploySearch, deployments]);
const filteredLogs = useMemo(() => { const q = logSearch.trim().toLowerCase(); return logs.filter((entry) => { if (logLevelFilter !== "all" && entry.level !== logLevelFilter) { return false; } if (!q) return true; return ( entry.message.toLowerCase().includes(q) || entry.service.toLowerCase().includes(q) || entry.region.toLowerCase().includes(q) ); }); }, [logLevelFilter, logSearch, logs]);
const filteredEnvVars = useMemo(() => { if (envScopeFilter === "All") return envVars; return envVars.filter((item) => item.scope === envScopeFilter); }, [envScopeFilter, envVars]);
const handleAddDomain = (event: React.FormEvent) => { event.preventDefault(); const cleaned = newDomainHost.trim().toLowerCase(); if (!cleaned) return; if (domains.some((d) => d.host === cleaned)) { queue.warning(`${cleaned} is already configured`); return; } setDomains((prev) => [ { id: `dom-${Date.now()}`, host: cleaned, target: `${activeWorkspace.env.toLowerCase()} · ${activeWorkspace.region}`, tls: "Provisioning", status: "pending", }, ...prev, ]); setNewDomainHost(""); queue.success(`Added ${cleaned}`, { description: "Point a CNAME record to edge.harbordeploy.net to finish verification.", }); };
const handleVerifyDomain = (domain: DomainItem) => { setDomains((prev) => prev.map((item) => item.id === domain.id ? { ...item, status: "verified", tls: "Valid · Auto-renew" } : item, ), ); queue.success(`Verified ${domain.host}`, { description: "TLS certificate issued and edge routing active.", }); };
const handleAddEnvVar = (event: React.FormEvent) => { event.preventDefault(); const key = newEnvKey.trim().toUpperCase().replace(/[^A-Z0-9_]/g, "_"); const value = newEnvValue.trim(); if (!key || !value) { queue.warning("Enter both a variable name and value"); return; } setEnvVars((prev) => [ { id: `env-${Date.now()}`, key, value, scope: envScopeFilter === "All" ? "Production" : envScopeFilter, secret: key.includes("SECRET") || key.includes("TOKEN") || key.includes("KEY"), updatedAt: "Just now", }, ...prev, ]); setNewEnvKey(""); setNewEnvValue(""); queue.success(`Saved ${key}`, { description: "Encrypted at rest and queued for the next release.", }); };
const workspaceBadgePalette = activeWorkspace.palette === "green" ? greenPalette : activeWorkspace.palette === "amber" ? amberPalette : bluePalette;
const renderNavGroups = (collapsed: boolean) => ( <> <Sidebar.Group> {!collapsed ? ( <Sidebar.GroupHeader> <Sidebar.GroupTitle>Platform</Sidebar.GroupTitle> </Sidebar.GroupHeader> ) : null} <Sidebar.GroupContent> <VStack render={<ul />} gap="0.5" style={styles.navList}> {PLATFORM_ROUTES.map((route) => { const active = activeRoute === route; const meta = ROUTE_META[route]; return ( <SidebarNavItem.Item key={route} variant="muted" size="md"> <SidebarNavItem.Button type="button" aria-current={active ? "page" : undefined} aria-label={collapsed ? meta.label : undefined} title={collapsed ? meta.label : undefined} style={[ active && sidebarNavItemActive, collapsed && styles.navButtonCollapsed, ]} onClick={() => navigateTo(route)} > <SidebarNavItem.Icon viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <RouteGlyph route={route} /> </SidebarNavItem.Icon> {!collapsed ? ( <> <Text render={<span />} size="sm" truncate="true"> {meta.label} </Text> {route === "deployments" ? ( <SidebarNavItem.EndElement> <Badge variant="subtle" size="xs"> {deployments.length} </Badge> </SidebarNavItem.EndElement> ) : null} {route === "logs" && liveTail ? ( <SidebarNavItem.EndElement> <Status.Root size="sm" palette={greenPalette}> <Status.Indicator /> </Status.Root> </SidebarNavItem.EndElement> ) : null} </> ) : null} </SidebarNavItem.Button> </SidebarNavItem.Item> ); })} </VStack> </Sidebar.GroupContent> </Sidebar.Group>
<Sidebar.Group> {!collapsed ? ( <Sidebar.GroupHeader> <Sidebar.GroupTitle>Configuration</Sidebar.GroupTitle> </Sidebar.GroupHeader> ) : null} <Sidebar.GroupContent> <VStack render={<ul />} gap="0.5" style={styles.navList}> {CONFIG_ROUTES.map((route) => { const active = activeRoute === route; const meta = ROUTE_META[route]; return ( <SidebarNavItem.Item key={route} variant="muted" size="md"> <SidebarNavItem.Button type="button" aria-current={active ? "page" : undefined} aria-label={collapsed ? meta.label : undefined} title={collapsed ? meta.label : undefined} style={[ active && sidebarNavItemActive, collapsed && styles.navButtonCollapsed, ]} onClick={() => navigateTo(route)} > <SidebarNavItem.Icon viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <RouteGlyph route={route} /> </SidebarNavItem.Icon> {!collapsed ? ( <Text render={<span />} size="sm" truncate="true"> {meta.label} </Text> ) : null} </SidebarNavItem.Button> </SidebarNavItem.Item> ); })} </VStack> </Sidebar.GroupContent> </Sidebar.Group> </> );
return ( <AppShell.Root palette={palette} style={[styles.root, style]}> <Navbar.Root variant="neutral" size="md" style={styles.navbar}> <Navbar.Content> <HStack gap="2"> <IconButton variant="ghost" size="sm" aria-label="Open navigation menu" style={styles.mobileMenuTrigger} onClick={() => setMobileNavOpen(true)} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" aria-hidden="true" > <path d="M3.5 5.5h13" /> <path d="M3.5 10h13" /> <path d="M3.5 14.5h13" /> </Icon> </IconButton>
<IconButton variant="ghost" size="sm" aria-label={ sidebarCollapsed ? "Expand sidebar" : "Collapse sidebar" } aria-expanded={!sidebarCollapsed} style={styles.desktopCollapseTrigger} onClick={() => setSidebarCollapsed((prev) => !prev)} > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <rect x="3" y="3.5" width="14" height="13" rx="2" /> <path d="M7.5 3.5v13" /> </Icon> </IconButton>
<span {...stylex.props(styles.brandMark)}> <HarborMark /> </span> <Text render={<span />} size="sm" weight="semibold" style={styles.brandTitle} > Harbor Deploy </Text> <Text render={<span />} size="sm" tone="subtle" aria-hidden="true" style={styles.brandDivider} > / </Text>
<Menu.Root size="md"> <Menu.Trigger render={ <Button variant="ghost" size="sm" style={styles.workspaceTrigger} /> } > <Text render={<span />} size="sm" truncate="true"> {activeWorkspace.name} </Text> <Badge variant="subtle" size="xs" palette={workspaceBadgePalette} style={styles.workspaceEnvBadge} > {activeWorkspace.env} </Badge> <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="m4.5 6.25 3.5 3.5 3.5-3.5" /> </Icon> </Menu.Trigger> <Menu.Content align="start" style={styles.menuWidth}> <Menu.Group> <Menu.GroupLabel>Workspaces</Menu.GroupLabel> <Menu.RadioGroup value={workspaceId} onValueChange={(next) => selectWorkspace(next)} > {WORKSPACES.map((ws) => ( <Menu.RadioItem key={ws.id} value={ws.id}> <Menu.ItemIndicator /> <Menu.ItemText>{ws.name}</Menu.ItemText> <Menu.ItemCommand>{ws.region}</Menu.ItemCommand> </Menu.RadioItem> ))} </Menu.RadioGroup> </Menu.Group> <Menu.Separator /> <Menu.Item onSelect={() => queue.info("New workspace wizard", { description: "Provision isolated regions, domains, and IAM policies.", }) } > <Menu.ItemText>Create workspace…</Menu.ItemText> </Menu.Item> </Menu.Content> </Menu.Root> </HStack>
<HStack gap="2" style={styles.shrink0}> <button type="button" aria-label="Search routes, workspaces, and commands" onClick={() => setSearchOpen(true)} {...stylex.props(styles.searchTrigger)} > <span {...stylex.props(styles.searchTriggerLabel)}> <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" aria-hidden="true" > <circle cx="7.25" cy="7.25" r="4.5" /> <path d="m10.75 10.75 2.75 2.75" /> </Icon> <span {...stylex.props(styles.searchPlaceholderText)}> Search workspace… </span> </span> <Kbd size="xs" variant="outline" style={styles.searchKbd}> ⌘K </Kbd> </button>
<Popover.Root size="sm"> <div {...stylex.props(styles.iconButtonWrap)}> <Popover.Trigger render={ <IconButton variant="ghost" size="sm" aria-label={`Notifications (${unreadCount} unread)`} /> } > <Icon size="sm" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M5.5 8.5a4.5 4.5 0 1 1 9 0c0 3 1.25 4.5 1.75 5.25H3.75C4.25 13 5.5 11.5 5.5 8.5Z" /> <path d="M8.5 16a1.75 1.75 0 0 0 3 0" /> </Icon> </Popover.Trigger> {unreadCount > 0 ? ( <span {...stylex.props(styles.unreadDot)} aria-hidden="true" /> ) : null} </div> <Popover.Content align="end" style={styles.popoverContent}> <Popover.Header> <HStack justify="between" style={styles.popoverHeaderRow}> <Popover.Title>Notifications</Popover.Title> {unreadCount > 0 ? ( <Button variant="plain" size="xs" onClick={() => { setNotifications((prev) => prev.map((n) => ({ ...n, unread: false })), ); queue.info("All notifications marked as read"); }} > Mark all read </Button> ) : null} </HStack> </Popover.Header> <Separator /> <Popover.Body> <VStack gap="1.5"> {notifications.map((notif) => ( <button key={notif.id} type="button" onClick={() => { setNotifications((prev) => prev.map((n) => n.id === notif.id ? { ...n, unread: false } : n, ), ); navigateTo(notif.route); }} {...stylex.props(styles.notifButton)} > <HStack gap="2" justify="between" style={styles.fullWidth} > <Text render={<span />} size="sm" weight="medium"> {notif.title} </Text> {notif.unread ? ( <Badge variant="subtle" size="xs" palette={accentPalette} > New </Badge> ) : ( <Text render={<span />} size="xs" tone="muted"> {notif.time} </Text> )} </HStack> <Text render={<span />} size="xs" tone="muted"> {notif.detail} </Text> </button> ))} </VStack> </Popover.Body> </Popover.Content> </Popover.Root>
<Button variant="solid" size="sm" palette={accentPalette} style={styles.deployButton} onClick={triggerDeploy} > Deploy </Button>
<Menu.Root size="md"> <Menu.Trigger render={ <Button variant="ghost" size="sm" aria-label="Account menu" style={styles.avatarTrigger} /> } > <Avatar.Root size="sm" variant="subtle" palette={accentPalette} > <Avatar.Fallback>NL</Avatar.Fallback> </Avatar.Root> </Menu.Trigger> <Menu.Content align="end" style={styles.menuWidth}> <VStack gap="0.5" style={styles.userMenuHeader}> <Text render={<span />} size="sm" weight="medium"> Nora Lindholm </Text> <Text render={<span />} size="xs" tone="muted"> nora@harbordeploy.dev </Text> </VStack> <Menu.Separator /> <Menu.Item onSelect={() => navigateTo("environment")}> <Menu.ItemText>Environment & secrets</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => navigateTo("billing")}> <Menu.ItemText>Billing & quotas</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => setSearchOpen(true)}> <Menu.ItemText>Command palette</Menu.ItemText> <Menu.ItemCommand>⌘K</Menu.ItemCommand> </Menu.Item> <Menu.Separator /> <Menu.Item destructive onSelect={() => queue.info("Signed out of Harbor Deploy", { description: "Session tokens cleared for this browser.", }) } > <Menu.ItemText>Sign out</Menu.ItemText> </Menu.Item> </Menu.Content> </Menu.Root> </HStack> </Navbar.Content> </Navbar.Root>
<AppShell.Content> <Sidebar.Root variant="sidebar" mode="collapsible" size="md" aria-label="Workspace navigation" style={[styles.sidebar, sidebarCollapsed && styles.sidebarCollapsed]} > <Sidebar.Body style={sidebarCollapsed ? styles.sidebarBodyCollapsed : undefined} > {renderNavGroups(sidebarCollapsed)} </Sidebar.Body> <Sidebar.Footer style={styles.sidebarFooter}> {sidebarCollapsed ? ( <Center style={styles.clusterCardCollapsed} title={`${activeWorkspace.region} · All systems operational`} > <Status.Root size="sm" palette={greenPalette}> <Status.Indicator /> </Status.Root> </Center> ) : ( <VStack gap="1" style={styles.clusterCard}> <Status.Root size="sm" palette={greenPalette}> <Status.Indicator /> All regions healthy </Status.Root> <Text render={<span />} size="xs" tone="muted"> {activeWorkspace.region} · {activeWorkspace.release} ·{" "} {activeWorkspace.uptime} </Text> </VStack> )} </Sidebar.Footer> </Sidebar.Root>
<AppShell.Main style={styles.main}> <VStack gap="6" style={styles.mainInner}> <HStack render={<header />} gap="4" justify="between" style={styles.pageHeader} > <VStack gap="1"> <HStack gap="1.5" style={styles.breadcrumbRow}> <span>{activeWorkspace.name}</span> <span aria-hidden="true">/</span> <span>{ROUTE_META[activeRoute].group}</span> <span aria-hidden="true">/</span> <span>{ROUTE_META[activeRoute].label}</span> </HStack> <Heading render={<h1 />} size="2xl" style={styles.pageTitle}> {ROUTE_META[activeRoute].label} </Heading> <Text size="sm" tone="muted"> {ROUTE_META[activeRoute].description} </Text> </VStack>
<HStack gap="2" wrap="wrap"> {activeRoute === "overview" ? ( <> <Button variant="surface" size="sm" onClick={() => navigateTo("logs")} > Tail live logs </Button> <Button variant="solid" size="sm" palette={accentPalette} onClick={triggerDeploy} > New deployment </Button> </> ) : null} {activeRoute === "deployments" ? ( <Button variant="solid" size="sm" palette={accentPalette} onClick={triggerDeploy} > Trigger deployment </Button> ) : null} {activeRoute === "logs" ? ( <Button variant="surface" size="sm" onClick={() => { const entry: LogEntry = { id: `log-${Date.now()}`, timestamp: new Date().toTimeString().slice(0, 8) + ".408", level: "info", region: activeWorkspace.region, service: "edge-probe", message: `Synthetic health check succeeded on ${activeWorkspace.name} (200 OK · 19ms)`, }; setLogs((prev) => [entry, ...prev]); queue.info("Synthetic health check logged"); }} > Emit test event </Button> ) : null} {activeRoute === "billing" ? ( <Button variant="surface" size="sm" onClick={() => queue.info("Invoice archive exported", { description: "CSV summary ready for November 2026.", }) } > Export statements </Button> ) : null} </HStack> </HStack>
{activeRoute === "overview" ? ( <> <Grid gap="4" style={styles.statGrid}> <Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Active Deployments</Stat.Label> <Stat.ValueText> {activeWorkspace.activeDeployments} </Stat.ValueText> <Stat.HelpText> Latest: {activeWorkspace.release} </Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>P95 Edge Latency</Stat.Label> <Stat.ValueText> {activeWorkspace.p95Latency} </Stat.ValueText> <Stat.HelpText>-14% vs last 7 days</Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>30d Availability</Stat.Label> <Stat.ValueText>{activeWorkspace.uptime}</Stat.ValueText> <Stat.HelpText>Zero severity-1 incidents</Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Monthly Bandwidth</Stat.Label> <Stat.ValueText> {activeWorkspace.bandwidth} </Stat.ValueText> <Stat.HelpText>61% of 3.00 TB allowance</Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root> </Grid>
<Grid gap="4" style={styles.twoColGrid}> <Card.Root variant="outline" size="md"> <Card.Header style={styles.cardHeaderRow}> <VStack gap="1"> <Card.Title style={styles.cardTitleReset}> Recent Deployments </Card.Title> <Card.Description style={styles.cardDescReset}> Latest builds promoted across {activeWorkspace.name} </Card.Description> </VStack> <Button variant="ghost" size="xs" onClick={() => navigateTo("deployments")} > View all </Button> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="sm"> <Table.Header> <Table.Row> <Table.ColumnHeader>Release</Table.ColumnHeader> <Table.ColumnHeader>Branch</Table.ColumnHeader> <Table.ColumnHeader>Status</Table.ColumnHeader> <Table.ColumnHeader>Time</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {deployments.slice(0, 4).map((item) => ( <Table.Row key={item.id}> <Table.Cell> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium" > {item.id} </Text> <Text render={<span />} size="xs" tone="muted" > {item.message} </Text> </VStack> </Table.Cell> <Table.Cell> <Code size="xs">{item.branch}</Code> </Table.Cell> <Table.Cell> <Status.Root size="sm" palette={ item.status === "live" ? greenPalette : item.status === "building" ? amberPalette : redPalette } > <Status.Indicator /> {item.status === "live" ? "Live" : item.status === "building" ? "Building" : "Failed"} </Status.Root> </Table.Cell> <Table.Cell> <Text render={<span />} size="xs" tone="muted"> {item.createdAt} </Text> </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> </div> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Edge Regions </Card.Title> <Card.Description style={styles.cardDescReset}> Live capacity and routing latency per PoP cluster </Card.Description> </Card.Header> <Card.Body> <VStack gap="4"> {EDGE_REGIONS.map((region) => ( <VStack key={region.id} gap="1.5"> <HStack gap="2" justify="between"> <HStack render={<span />} gap="2"> <Status.Root size="sm" palette={greenPalette}> <Status.Indicator /> </Status.Root> <Text render={<span />} size="sm" weight="medium" > {region.city} </Text> <Code size="xs">{region.id}</Code> </HStack> <Text render={<span />} size="xs" tone="muted"> {region.latency} · {region.load}% load </Text> </HStack> <Progress.Root value={region.load} variant="subtle" size="xs" shape="full" palette={accentPalette} > <Progress.Track> <Progress.Range /> </Progress.Track> </Progress.Root> </VStack> ))}
<Separator />
<HStack gap="2" wrap="wrap" style={styles.quickActionGrid} > <Button variant="surface" size="xs" onClick={() => navigateTo("domains")} > Manage domains </Button> <Button variant="surface" size="xs" onClick={() => navigateTo("environment")} > Edit secrets </Button> <Button variant="surface" size="xs" onClick={() => navigateTo("billing")} > Inspect quotas </Button> </HStack> </VStack> </Card.Body> </Card.Root> </Grid> </> ) : null}
{activeRoute === "deployments" ? ( <Card.Root variant="outline" size="md"> <Card.Header> <HStack gap="3" wrap="wrap" justify="between"> <HStack gap="1.5" wrap="wrap"> {(["all", "live", "building", "failed"] as const).map( (status) => ( <Button key={status} variant={deployFilter === status ? "solid" : "surface"} size="xs" palette={ deployFilter === status ? accentPalette : undefined } onClick={() => setDeployFilter(status)} > {status === "all" ? "All" : status[0].toUpperCase() + status.slice(1)} </Button> ), )} </HStack> <div {...stylex.props(styles.inlineSearch)}> <Input size="sm" placeholder="Filter by release, branch, or commit…" value={deploySearch} onChange={(event) => setDeploySearch(event.target.value)} /> </div> </HStack> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Release</Table.ColumnHeader> <Table.ColumnHeader>Commit</Table.ColumnHeader> <Table.ColumnHeader>Status</Table.ColumnHeader> <Table.ColumnHeader>Region</Table.ColumnHeader> <Table.ColumnHeader>Duration</Table.ColumnHeader> <Table.ColumnHeader>Action</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {filteredDeployments.map((item) => ( <Table.Row key={item.id}> <Table.Cell> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium" > {item.id} </Text> <Text render={<span />} size="xs" tone="muted"> {item.message} </Text> </VStack> </Table.Cell> <Table.Cell> <VStack gap="0.5"> <Code size="xs">{item.branch}</Code> <Text render={<span />} variant="mono" size="xs"> {item.commit} · {item.author} </Text> </VStack> </Table.Cell> <Table.Cell> <Badge variant="subtle" size="sm" palette={ item.status === "live" ? greenPalette : item.status === "building" ? amberPalette : redPalette } > {item.status === "live" ? "Live" : item.status === "building" ? "Building" : "Failed"} </Badge> </Table.Cell> <Table.Cell> <Code size="xs">{item.region}</Code> </Table.Cell> <Table.Cell> <VStack gap="0.5"> <span>{item.duration}</span> <Text render={<span />} size="xs" tone="muted"> {item.createdAt} </Text> </VStack> </Table.Cell> <Table.Cell> <Button variant="ghost" size="xs" onClick={() => { setDeployments((prev) => prev.map((d) => d.id === item.id ? { ...d, status: "live", createdAt: "Just now" } : d, ), ); queue.success(`Promoted ${item.id}`, { description: `Traffic routed to ${item.commit} in ${item.region}.`, }); }} > {item.status === "live" ? "Redeploy" : "Promote"} </Button> </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> {filteredDeployments.length === 0 ? ( <Text size="sm" tone="muted" align="center" style={styles.emptyStateText} > No deployments match the current filter. </Text> ) : null} </div> </Card.Body> </Card.Root> ) : null}
{activeRoute === "logs" ? ( <Card.Root variant="outline" size="md"> <Card.Header> <HStack gap="3" wrap="wrap" justify="between"> <HStack gap="1.5" wrap="wrap"> {(["all", "info", "warn", "error"] as const).map((lvl) => ( <Button key={lvl} variant={logLevelFilter === lvl ? "solid" : "surface"} size="xs" palette={ logLevelFilter === lvl ? accentPalette : undefined } onClick={() => setLogLevelFilter(lvl)} > {lvl.toUpperCase()} </Button> ))} <Switch.Root size="sm" palette={greenPalette} > <Switch.Control checked={liveTail} onCheckedChange={(checked) => { setLiveTail(checked); queue.info( checked ? "Live log stream resumed" : "Log stream paused", ); }} /> <Switch.Label>Live tail</Switch.Label> </Switch.Root> </HStack> <div {...stylex.props(styles.inlineSearch)}> <Input size="sm" placeholder="Search service, region, or message…" value={logSearch} onChange={(event) => setLogSearch(event.target.value)} /> </div> </HStack> </Card.Header> <Card.Body> <VStack gap="0" role="log" style={styles.logStream}> {filteredLogs.map((entry) => ( <Grid key={entry.id} gap="3" style={styles.logRow}> <Text render={<span />} variant="mono" size="xs" tone="subtle" tabular="true" > {entry.timestamp} </Text> <span> <Badge variant="subtle" size="xs" palette={ entry.level === "error" ? redPalette : entry.level === "warn" ? amberPalette : bluePalette } > {entry.level.toUpperCase()} </Badge> </span> <Text render={<span />} variant="mono" size="xs" tone="muted" > {entry.service} </Text> <Text render={<span />} variant="mono" size="xs" style={styles.logMessage} > [{entry.region}] {entry.message} </Text> </Grid> ))} {filteredLogs.length === 0 ? ( <Text size="sm" tone="muted" align="center" style={styles.emptyStateText} > No log lines match your query. </Text> ) : null} </VStack> </Card.Body> </Card.Root> ) : null}
{activeRoute === "domains" ? ( <> <Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Add Custom Domain </Card.Title> <Card.Description style={styles.cardDescReset}> Attach an apex domain or subdomain with automatic edge TLS </Card.Description> </Card.Header> <Card.Body> <HStack render={<form onSubmit={handleAddDomain} />} gap="2" wrap="wrap" > <div {...stylex.props(styles.inlineInput)}> <Input size="sm" placeholder="e.g. status.harbor.app" value={newDomainHost} onChange={(event) => setNewDomainHost(event.target.value)} /> </div> <Button type="submit" variant="solid" size="sm" palette={accentPalette} > Add domain </Button> </HStack> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Configured Domains </Card.Title> <Card.Description style={styles.cardDescReset}> CNAME target: <Code size="xs">edge.harbordeploy.net</Code> </Card.Description> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Hostname</Table.ColumnHeader> <Table.ColumnHeader>Target</Table.ColumnHeader> <Table.ColumnHeader>TLS Certificate</Table.ColumnHeader> <Table.ColumnHeader>DNS</Table.ColumnHeader> <Table.ColumnHeader>Action</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {domains.map((domain) => ( <Table.Row key={domain.id}> <Table.Cell> <HStack gap="1.5" wrap="wrap"> <Text render={<span />} size="sm" weight="medium" > {domain.host} </Text> {domain.primary ? ( <Badge variant="subtle" size="xs" palette={accentPalette} > Primary </Badge> ) : null} </HStack> </Table.Cell> <Table.Cell> <Code size="xs">{domain.target}</Code> </Table.Cell> <Table.Cell> <Badge variant="subtle" size="xs" palette={ domain.status === "verified" ? greenPalette : amberPalette } > {domain.tls} </Badge> </Table.Cell> <Table.Cell> <Status.Root size="sm" palette={ domain.status === "verified" ? greenPalette : amberPalette } > <Status.Indicator /> {domain.status === "verified" ? "Verified" : "Pending"} </Status.Root> </Table.Cell> <Table.Cell> {domain.status === "pending" ? ( <Button variant="surface" size="xs" onClick={() => handleVerifyDomain(domain)} > Verify DNS </Button> ) : ( <Button variant="ghost" size="xs" onClick={() => queue.info(`Copied CNAME for ${domain.host}`, { description: "edge.harbordeploy.net", }) } > Copy CNAME </Button> )} </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> </div> </Card.Body> </Card.Root> </> ) : null}
{activeRoute === "environment" ? ( <> <Card.Root variant="outline" size="md"> <Card.Header> <HStack gap="3" wrap="wrap" justify="between"> <VStack gap="1"> <Card.Title style={styles.cardTitleReset}> Variables & Secrets </Card.Title> <Card.Description style={styles.cardDescReset}> Injected at build and runtime for {activeWorkspace.name} </Card.Description> </VStack> <HStack gap="1.5" wrap="wrap"> {( ["All", "Production", "Preview", "Development"] as const ).map((scope) => ( <Button key={scope} variant={envScopeFilter === scope ? "solid" : "surface"} size="xs" palette={ envScopeFilter === scope ? accentPalette : undefined } onClick={() => setEnvScopeFilter(scope)} > {scope} </Button> ))} </HStack> </HStack> </Card.Header> <Card.Body> <VStack gap="4"> <HStack render={<form onSubmit={handleAddEnvVar} />} gap="2" wrap="wrap" > <div {...stylex.props(styles.inlineInput)}> <Input size="sm" placeholder="VARIABLE_NAME" value={newEnvKey} onChange={(event) => setNewEnvKey(event.target.value)} /> </div> <div {...stylex.props(styles.inlineInput)}> <Input size="sm" placeholder="Value or secret" value={newEnvValue} onChange={(event) => setNewEnvValue(event.target.value)} /> </div> <Button type="submit" variant="solid" size="sm" palette={accentPalette} > Add variable </Button> </HStack>
<div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Key</Table.ColumnHeader> <Table.ColumnHeader>Value</Table.ColumnHeader> <Table.ColumnHeader>Scope</Table.ColumnHeader> <Table.ColumnHeader>Actions</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {filteredEnvVars.map((envVar) => { const isRevealed = Boolean(revealedIds[envVar.id]); return ( <Table.Row key={envVar.id}> <Table.Cell> <Code size="xs">{envVar.key}</Code> </Table.Cell> <Table.Cell> <Text render={<span />} variant="mono" size="xs" > {envVar.secret && !isRevealed ? "••••••••••••••••••••" : envVar.value} </Text> </Table.Cell> <Table.Cell> <Badge variant="subtle" size="xs"> {envVar.scope} </Badge> </Table.Cell> <Table.Cell> <HStack gap="1.5" wrap="wrap"> {envVar.secret ? ( <Button variant="ghost" size="xs" onClick={() => setRevealedIds((prev) => ({ ...prev, [envVar.id]: !prev[envVar.id], })) } > {isRevealed ? "Hide" : "Reveal"} </Button> ) : null} <Button variant="ghost" size="xs" onClick={() => queue.info(`Copied ${envVar.key}`) } > Copy </Button> </HStack> </Table.Cell> </Table.Row> ); })} </Table.Body> </Table.Root> </div> </VStack> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Runtime Guardrails </Card.Title> <Card.Description style={styles.cardDescReset}> Configure automated edge protection and rollout behavior </Card.Description> </Card.Header> <Card.Body> <VStack gap="4"> <HStack gap="4" justify="between"> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> Edge response caching </Text> <Text render={<span />} size="xs" tone="muted"> Serve stale-while-revalidate responses from nearest PoP. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={edgeCacheEnabled} onCheckedChange={(checked) => { setEdgeCacheEnabled(checked); queue.info( `Edge response caching ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack>
<Separator />
<HStack gap="4" justify="between"> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> Automatic canary rollback </Text> <Text render={<span />} size="xs" tone="muted"> Revert release immediately if 5xx error rate exceeds 1.5%. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={autoRollbackEnabled} onCheckedChange={(checked) => { setAutoRollbackEnabled(checked); queue.info( `Automatic canary rollback ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack>
<Separator />
<HStack gap="4" justify="between"> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> Zero-downtime connection draining </Text> <Text render={<span />} size="xs" tone="muted"> Wait up to 30 seconds for active WebSocket and HTTP streams. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={zeroDowntimeEnabled} onCheckedChange={(checked) => { setZeroDowntimeEnabled(checked); queue.info( `Connection draining ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack> </VStack> </Card.Body> </Card.Root> </> ) : null}
{activeRoute === "billing" ? ( <> <Card.Root variant="outline" size="md"> <Card.Header style={styles.cardHeaderRow}> <VStack gap="1"> <HStack gap="1.5" wrap="wrap"> <Card.Title style={styles.cardTitleReset}> Scale Team Plan </Card.Title> <Badge variant="subtle" size="xs" palette={greenPalette} > Active </Badge> </HStack> <Card.Description style={styles.cardDescReset}> Renews on Dec 31, 2026 · Visa ending in 4821 </Card.Description> </VStack> <HStack align="baseline" gap="2"> <Text render={<span />} size="2xl" weight="semibold" style={styles.planPrice} > $149 </Text> <Text render={<span />} size="xs" tone="muted"> / month </Text> </HStack> </Card.Header> <Card.Footer> <Button variant="solid" size="sm" palette={accentPalette} onClick={() => queue.info("Upgrade comparison opened", { description: "Enterprise plan includes dedicated PoPs and 99.99% SLA.", }) } > Upgrade plan </Button> <Button variant="surface" size="sm" onClick={() => queue.info("Payment portal opened", { description: "Manage cards, billing contacts, and VAT details.", }) } > Update payment method </Button> </Card.Footer> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Monthly Usage & Quotas </Card.Title> <Card.Description style={styles.cardDescReset}> Billing cycle Nov 1 – Nov 30, 2026 </Card.Description> </Card.Header> <Card.Body> <Grid gap="4" style={styles.quotaGrid}> {BILLING_QUOTAS.map((quota) => ( <VStack key={quota.label} gap="2"> <HStack justify="between"> <Text render={<span />} size="sm" weight="medium"> {quota.label} </Text> <Text render={<span />} size="xs" tone="muted"> {quota.used} / {quota.limit} </Text> </HStack> <Progress.Root value={quota.percent} variant="subtle" size="sm" shape="full" palette={ quota.percent >= 75 ? amberPalette : accentPalette } > <Progress.Track> <Progress.Range /> </Progress.Track> </Progress.Root> </VStack> ))} </Grid> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Recent Invoices </Card.Title> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Invoice</Table.ColumnHeader> <Table.ColumnHeader>Period</Table.ColumnHeader> <Table.ColumnHeader>Amount</Table.ColumnHeader> <Table.ColumnHeader>Status</Table.ColumnHeader> <Table.ColumnHeader>Receipt</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {INVOICES.map((inv) => ( <Table.Row key={inv.id}> <Table.Cell> <Code size="xs">{inv.id}</Code> </Table.Cell> <Table.Cell>{inv.period}</Table.Cell> <Table.Cell>{inv.amount}</Table.Cell> <Table.Cell> <Badge variant="subtle" size="xs" palette={greenPalette} > {inv.status} </Badge> </Table.Cell> <Table.Cell> <Button variant="ghost" size="xs" onClick={() => queue.success(`Downloaded ${inv.id}.pdf`) } > Download PDF </Button> </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> </div> </Card.Body> </Card.Root> </> ) : null} </VStack> </AppShell.Main> </AppShell.Content>
<Drawer.Root open={mobileNavOpen} onOpenChange={setMobileNavOpen} placement="start" size="xs" > <Drawer.Backdrop /> <Drawer.Content> <Drawer.Header> <HStack gap="2"> <span {...stylex.props(styles.brandMark)}> <HarborMark /> </span> <Drawer.Title>Harbor Deploy</Drawer.Title> </HStack> <Drawer.Close render={ <IconButton variant="ghost" size="xs" aria-label="Close navigation drawer" /> } > <Icon size="sm" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" aria-hidden="true" > <path d="m4 4 8 8" /> <path d="m12 4-8 8" /> </Icon> </Drawer.Close> </Drawer.Header> <Separator /> <Drawer.Body style={styles.drawerBody}> {renderNavGroups(false)} </Drawer.Body> <Drawer.Footer> <Button variant="solid" size="sm" palette={accentPalette} onClick={() => { setMobileNavOpen(false); triggerDeploy(); }} > Deploy {activeWorkspace.name} </Button> </Drawer.Footer> </Drawer.Content> </Drawer.Root>
<Dialog.Root open={searchOpen} onOpenChange={(next) => { setSearchOpen(next); if (!next) setSearchQuery(""); }} size="md" placement="top" > <Dialog.Backdrop /> <Dialog.Content> <Dialog.Header> <Dialog.Title>Quick Jump & Commands</Dialog.Title> </Dialog.Header> <Dialog.Body style={styles.paletteDialogBody}> <Input size="md" placeholder="Jump to route, switch workspace, or run a command…" value={searchQuery} onChange={(event) => setSearchQuery(event.target.value)} autoFocus /> <VStack gap="1" style={styles.paletteResults}> {paletteCommands.map((cmd) => ( <button key={cmd.id} type="button" onClick={() => { cmd.run(); setSearchOpen(false); setSearchQuery(""); }} {...stylex.props(styles.paletteItem)} > <HStack render={<span />} gap="2.5"> <Badge variant="subtle" size="xs"> {cmd.category} </Badge> <span>{cmd.label}</span> </HStack> {cmd.hint ? ( <Text render={<span />} size="xs" tone="muted"> {cmd.hint} </Text> ) : null} </button> ))} {paletteCommands.length === 0 ? ( <Text size="sm" tone="muted" align="center" style={styles.emptyStateText} > No matching commands for “{searchQuery}”. </Text> ) : null} </VStack> </Dialog.Body> <Dialog.Footer> <Button variant="ghost" size="sm" onClick={() => { setSearchOpen(false); setSearchQuery(""); }} > Close </Button> </Dialog.Footer> </Dialog.Content> </Dialog.Root>
<Toaster toaster={queue} /> </AppShell.Root> );}
Inspired by the Shell Nav template from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.).