All blocks
Side Nav Shell
Left-rail application shell pairing a full-height collapsible sidebar (workspace switcher, quick actions, grouped route navigation, collapsible pinned collections with row menus, and user footer menu) with a mobile drawer fallback and interactive creative workspace views.
Built withAlert DialogApp ShellAvatarBadgeButtonCardCodeCollapsibleColor SwatchDialogDrawerGridHeadingIconIcon ButtonInputKbdMenuProgressSeparatorSidebarSidebar Nav ItemStackStatStatusSwitchTableTextToast
Looma Core · Projects
Looma CoreStudio ProWorkspaceProjects
Projects
Organize campaign libraries, track asset readiness, and pin active collections to the rail.
Active Projects
6
4 pinned to sidebar
Assets in Library
1,284
Q4 Campaigns
Pending Reviews
2
Awaiting creative sign-off
Storage Used
1.42 TB
Of 2.00 TB Studio Pro
| Project | Stage | Assets | Readiness | Owner | Actions |
|---|---|---|---|---|---|
Autumn LookbookEditorial · Updated 18m ago | Active | 148 | MCMina Castillo | ||
Packaging System v3Print & 3D · Updated 1h ago | In review | 94 | SLSoren Lind | ||
Motion Reels · SocialVideo · Updated 3h ago | Active | 62 | PNPriya Nair | ||
Retail Signage KitEnvironmental · Updated Yesterday | Blocked | 37 | DCDarius Cole | ||
Solstice Hero StillsPhotography · Updated 4h ago | In review | 215 | MCMina Castillo | ||
Type Specimen PostersTypography · Updated 2d ago | Draft | 28 | HOHana Okafor |
Install
1npx stylexblocks add shell-side-navSource
components/blocks/ui-sdk/shell-side-nav.tsx
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307import * as stylex from "@stylexjs/stylex";import { useCallback, useEffect, useMemo, useState } from "react";import { AlertDialog } from "#components/ui/ui-sdk/alert-dialog.tsx";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 { Code } from "#components/ui/ui-sdk/code.tsx";import { Collapsible } from "#components/ui/ui-sdk/collapsible.tsx";import { ColorSwatch } from "#components/ui/ui-sdk/color-swatch.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 { 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, violetPalette,} from "@stylexblocks/ui/themes/palettes.ts";import { fontSizes } from "@stylexblocks/ui/tokens/font-sizes.stylex.ts";import { fontWeights } from "@stylexblocks/ui/tokens/font-weights.stylex.ts";import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";import { lineHeights } from "@stylexblocks/ui/tokens/line-heights.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 ShellSideNavRoute = | "projects" | "reviews" | "releases" | "brand-kit" | "members" | "billing";
interface StudioWorkspace { id: string; name: string; tier: string; season: string; storageUsed: string; assetCount: string; palette: "accent" | "violet" | "green";}
interface CreativeProject { id: string; workspaceId: string; name: string; collection: string; stage: "active" | "in-review" | "draft" | "blocked"; assets: number; readiness: number; owner: string; ownerInitials: string; updatedAt: string; pinned: boolean;}
interface ReviewItem { id: string; assetName: string; projectName: string; format: string; version: string; reviewer: string; reviewerInitials: string; note: string; status: "pending" | "changes" | "approved"; submittedAt: string;}
interface ReleaseBundle { id: string; version: string; title: string; channel: "Web" | "Retail" | "Social" | "Print"; assetCount: number; publishedBy: string; status: "published" | "scheduled"; publishedAt: string;}
interface MemberItem { id: string; name: string; email: string; initials: string; role: "Admin" | "Editor" | "Reviewer"; status: "active" | "invited"; lastActive: string;}
interface BrandColorToken { id: string; name: string; token: string; hex: string; usage: string; swatchKey: | "terracotta" | "obsidian" | "linen" | "sage" | "cobalt" | "ochre";}
const NARROW = "@container shell-side-nav (max-width: 768px)";const COMPACT = "@container shell-side-nav (max-width: 560px)";const MEDIUM = "@container shell-side-nav (max-width: 1024px)";
const WORKSPACES: StudioWorkspace[] = [ { id: "looma-core", name: "Looma Core", tier: "Studio Pro", season: "Q4 Campaigns", storageUsed: "1.42 TB", assetCount: "1,284", palette: "accent", }, { id: "solstice-26", name: "Solstice '26", tier: "Client Space", season: "Spring Launch", storageUsed: "640 GB", assetCount: "518", palette: "violet", }, { id: "editorial-lab", name: "Editorial Lab", tier: "Archive & R&D", season: "Evergreen", storageUsed: "310 GB", assetCount: "296", palette: "green", },];
const INITIAL_PROJECTS: CreativeProject[] = [ { id: "proj-1", workspaceId: "looma-core", name: "Autumn Lookbook", collection: "Editorial", stage: "active", assets: 148, readiness: 86, owner: "Mina Castillo", ownerInitials: "MC", updatedAt: "18m ago", pinned: true, }, { id: "proj-2", workspaceId: "looma-core", name: "Packaging System v3", collection: "Print & 3D", stage: "in-review", assets: 94, readiness: 72, owner: "Soren Lind", ownerInitials: "SL", updatedAt: "1h ago", pinned: true, }, { id: "proj-3", workspaceId: "looma-core", name: "Motion Reels · Social", collection: "Video", stage: "active", assets: 62, readiness: 91, owner: "Priya Nair", ownerInitials: "PN", updatedAt: "3h ago", pinned: true, }, { id: "proj-4", workspaceId: "looma-core", name: "Retail Signage Kit", collection: "Environmental", stage: "blocked", assets: 37, readiness: 44, owner: "Darius Cole", ownerInitials: "DC", updatedAt: "Yesterday", pinned: true, }, { id: "proj-5", workspaceId: "solstice-26", name: "Solstice Hero Stills", collection: "Photography", stage: "in-review", assets: 215, readiness: 78, owner: "Mina Castillo", ownerInitials: "MC", updatedAt: "4h ago", pinned: false, }, { id: "proj-6", workspaceId: "editorial-lab", name: "Type Specimen Posters", collection: "Typography", stage: "draft", assets: 28, readiness: 35, owner: "Hana Okafor", ownerInitials: "HO", updatedAt: "2d ago", pinned: false, },];
const INITIAL_REVIEWS: ReviewItem[] = [ { id: "rev-1", assetName: "hero-key-visual-master.tif", projectName: "Autumn Lookbook", format: "TIFF · 64MP CMYK", version: "v3.2", reviewer: "Soren Lind", reviewerInitials: "SL", note: "Check shadow lift on warm linen backdrop before sign-off.", status: "pending", submittedAt: "24m ago", }, { id: "rev-2", assetName: "carton-dieline-outer-box.ai", projectName: "Packaging System v3", format: "AI + PDF/X-4", version: "v2.4", reviewer: "Darius Cole", reviewerInitials: "DC", note: "Bleed margin on left flap needs an extra 2mm for foil stamping.", status: "changes", submittedAt: "2h ago", }, { id: "rev-3", assetName: "launch-teaser-cut-15s.mov", projectName: "Motion Reels · Social", format: "4K ProRes · 9:16", version: "v4.0", reviewer: "Priya Nair", reviewerInitials: "PN", note: "Audio ducking and end-card lockup match brand timing guidelines.", status: "approved", submittedAt: "5h ago", }, { id: "rev-4", assetName: "storefront-vinyl-banner.pdf", projectName: "Retail Signage Kit", format: "PDF · 300 DPI", version: "v1.6", reviewer: "Hana Okafor", reviewerInitials: "HO", note: "Awaiting final store window measurements from flagship team.", status: "pending", submittedAt: "Yesterday", },];
const INITIAL_RELEASES: ReleaseBundle[] = [ { id: "rel-1", version: "bundle-2.14", title: "Autumn Lookbook — Web & Press Delivery", channel: "Web", assetCount: 84, publishedBy: "Mina Castillo", status: "published", publishedAt: "Today · 11:20", }, { id: "rel-2", version: "bundle-2.13", title: "Paid Social Vertical Cuts (Wave 1)", channel: "Social", assetCount: 36, publishedBy: "Priya Nair", status: "published", publishedAt: "Yesterday", }, { id: "rel-3", version: "bundle-2.12", title: "Flagship Window Graphics & Look Cards", channel: "Retail", assetCount: 52, publishedBy: "Darius Cole", status: "scheduled", publishedAt: "Dec 5 · 09:00", }, { id: "rel-4", version: "bundle-2.11", title: "Wholesale Catalog Print Masters", channel: "Print", assetCount: 118, publishedBy: "Soren Lind", status: "published", publishedAt: "Nov 26", },];
const BRAND_COLORS: BrandColorToken[] = [ { id: "clr-1", name: "Studio Terracotta", token: "--brand-primary", hex: "#C85A32", usage: "Primary accent & editorial callouts", swatchKey: "terracotta", }, { id: "clr-2", name: "Obsidian Ink", token: "--brand-ink", hex: "#1B1B1F", usage: "Display headlines & packaging marks", swatchKey: "obsidian", }, { id: "clr-3", name: "Warm Linen", token: "--brand-canvas", hex: "#F4EFE6", usage: "Lookbook backdrops & print stock", swatchKey: "linen", }, { id: "clr-4", name: "Sage Leaf", token: "--brand-secondary", hex: "#5E7C68", usage: "Botanical series & packaging seals", swatchKey: "sage", }, { id: "clr-5", name: "Cobalt Signal", token: "--brand-highlight", hex: "#2F5CE0", usage: "Digital interactive states & badges", swatchKey: "cobalt", }, { id: "clr-6", name: "Ochre Brass", token: "--brand-warm", hex: "#D49B35", usage: "Foil accents & limited edition stamps", swatchKey: "ochre", },];
const INITIAL_MEMBERS: MemberItem[] = [ { id: "mem-1", name: "Mina Castillo", email: "mina@looma.studio", initials: "MC", role: "Admin", status: "active", lastActive: "Online now", }, { id: "mem-2", name: "Soren Lind", email: "soren@looma.studio", initials: "SL", role: "Editor", status: "active", lastActive: "12m ago", }, { id: "mem-3", name: "Priya Nair", email: "priya@looma.studio", initials: "PN", role: "Editor", status: "active", lastActive: "42m ago", }, { id: "mem-4", name: "Darius Cole", email: "darius@looma.studio", initials: "DC", role: "Reviewer", status: "active", lastActive: "3h ago", }, { id: "mem-5", name: "Hana Okafor", email: "hana@looma.studio", initials: "HO", role: "Reviewer", status: "invited", lastActive: "Invite sent 1d ago", },];
const BILLING_QUOTAS = [ { label: "Asset Storage", used: "1.42 TB", limit: "2.00 TB", percent: 71 }, { label: "Video Transcode", used: "680 min", limit: "1,000 min", percent: 68, }, { label: "Studio Seats", used: "8 seats", limit: "12 seats", percent: 67 }, { label: "CDN Delivery", used: "820 GB", limit: "1.00 TB", percent: 82 },] as const;
const INVOICES = [ { id: "LM-2026-11", period: "Nov 2026", amount: "$89.00", status: "Paid" }, { id: "LM-2026-10", period: "Oct 2026", amount: "$89.00", status: "Paid" }, { id: "LM-2026-09", period: "Sep 2026", amount: "$79.00", status: "Paid" },] as const;
const ROUTE_META: Record< ShellSideNavRoute, { label: string; group: "Workspace" | "Studio"; description: string }> = { projects: { label: "Projects", group: "Workspace", description: "Organize campaign libraries, track asset readiness, and pin active collections to the rail.", }, reviews: { label: "Reviews", group: "Workspace", description: "Approve master stills, motion cuts, and print mechanicals before bundle publication.", }, releases: { label: "Releases", group: "Workspace", description: "Versioned asset bundles delivered to web, retail, print, and social distribution channels.", }, "brand-kit": { label: "Brand Kit", group: "Studio", description: "Canonical studio color tokens, typographic scales, and automated export guardrails.", }, members: { label: "Members", group: "Studio", description: "Manage creative seats, review permissions, and external collaborator invitations.", }, billing: { label: "Billing", group: "Studio", description: "Studio Pro subscription, monthly storage & transcode quotas, and downloadable receipts.", },};
const WORKSPACE_ROUTES: ShellSideNavRoute[] = [ "projects", "reviews", "releases",];const STUDIO_ROUTES: ShellSideNavRoute[] = ["brand-kit", "members", "billing"];
function RouteGlyph({ route }: { route: ShellSideNavRoute }) { switch (route) { case "projects": return ( <> <path d="M3 5.5a1.5 1.5 0 0 1 1.5-1.5h3.25l1.5 1.75h6.25A1.5 1.5 0 0 1 17 7.25v7.25A1.5 1.5 0 0 1 15.5 16h-11A1.5 1.5 0 0 1 3 14.5v-9Z" /> </> ); case "reviews": return ( <> <circle cx="10" cy="10" r="6.75" /> <path d="m7.25 10.25 2 2 3.75-4.25" /> </> ); case "releases": return ( <> <path d="M10 3.25 16.5 6.75v6.5L10 16.75 3.5 13.25v-6.5L10 3.25Z" /> <path d="M10 10v6.75" /> <path d="M16.5 6.75 10 10 3.5 6.75" /> </> ); case "brand-kit": return ( <> <circle cx="7" cy="7" r="3.25" /> <circle cx="13" cy="7" r="3.25" /> <circle cx="10" cy="12.75" r="3.25" /> </> ); case "members": return ( <> <circle cx="8" cy="7" r="2.75" /> <path d="M3.25 15.75c.5-2.5 2.25-3.75 4.75-3.75s4.25 1.25 4.75 3.75" /> <circle cx="13.75" cy="8" r="2" /> <path d="M14 12.25c1.5.25 2.5 1.25 2.75 3.25" /> </> ); 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 LoomaMark() { return ( <svg width="22" height="22" viewBox="0 0 22 22" fill="none" aria-hidden="true" > <rect width="22" height="22" rx="6" fill="currentColor" /> <circle cx="8.25" cy="8.25" r="2.75" fill="var(--sui-colors-bg, #ffffff)" /> <rect x="11.75" y="5.5" width="4.75" height="11" rx="2.375" fill="var(--sui-colors-bg, #ffffff)" fillOpacity="0.86" /> <circle cx="8.25" cy="14.25" r="2.25" fill="var(--sui-colors-bg, #ffffff)" fillOpacity="0.55" /> </svg> );}
const swatchColors = stylex.create({ terracotta: { "--color": "#C85A32" }, obsidian: { "--color": "#1B1B1F" }, linen: { "--color": "#F4EFE6" }, sage: { "--color": "#5E7C68" }, cobalt: { "--color": "#2F5CE0" }, ochre: { "--color": "#D49B35" },});
const styles = stylex.create({ root: { backgroundColor: semanticColors.bg, color: semanticColors.fg, containerName: "shell-side-nav", containerType: "inline-size", fontFamily: fonts.body, height: "100%", minHeight: 0, overflow: "hidden", width: "100%", }, textStart: { textAlign: "start", }, tightLine: { lineHeight: lineHeights.xs, }, sidebar: { "--sidebar-width": "16.5rem", "--sidebar-min-width": "16.5rem", borderRightStyle: "solid", display: { default: "flex", [NARROW]: "none", }, flexShrink: 0, transitionDuration: "180ms", transitionProperty: "width, min-width", }, sidebarCollapsed: { "--sidebar-width": "4rem", "--sidebar-min-width": "4rem", }, sidebarHeader: { alignItems: "center", borderBottomColor: semanticColors.sidebarBorder, borderBottomStyle: "solid", borderBottomWidth: "1px", gap: spacing._1_5, justifyContent: "space-between", minHeight: "3.5rem", paddingBlock: spacing._2, paddingInline: spacing._2_5, }, sidebarHeaderCollapsed: { justifyContent: "center", paddingInline: spacing._2, }, workspaceTrigger: { flexGrow: 1, gap: spacing._2, height: "auto", justifyContent: "flex-start", minWidth: 0, paddingBlock: spacing._1_5, paddingInline: spacing._1_5, }, workspaceChevron: { color: semanticColors.fgSubtle, marginInlineStart: "auto", }, brandMark: { alignItems: "center", color: semanticColors.accentSolid, display: "inline-flex", flexShrink: 0, }, sidebarBodyCollapsed: { paddingInline: spacing._2, }, newProjectBtn: { justifyContent: "flex-start", width: "100%", }, newProjectBtnCollapsed: { justifyContent: "center", paddingInline: 0, width: sizes.controlSm, }, searchTrigger: { alignItems: "center", backgroundColor: { default: semanticColors.bgPanel, ":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: "100%", }, searchTriggerCollapsed: { justifyContent: "center", paddingInline: 0, width: sizes.controlSm, }, searchTriggerLabel: { alignItems: "center", display: "inline-flex", gap: spacing._2, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", }, navList: { listStyle: "none", marginBlock: 0, marginInline: 0, paddingBlock: 0, paddingInline: 0, }, navButtonCollapsed: { justifyContent: "center", paddingInline: 0, }, collapsibleTriggerBtn: { alignItems: "center", backgroundColor: { default: "transparent", ":hover": semanticColors.bgSubtle, }, borderRadius: semanticRadii.control, borderStyle: "none", color: semanticColors.fgMuted, cursor: "pointer", display: "flex", fontSize: fontSizes.xs, fontWeight: fontWeights.medium, gap: spacing._1_5, height: sizes._6, justifyContent: "space-between", paddingInline: spacing._2, textAlign: "start", width: "100%", }, chevronRotated: { transform: "rotate(90deg)", }, chevronIcon: { transitionDuration: "150ms", transitionProperty: "transform", }, pinnedItemWrap: { flexGrow: 1, minWidth: 0, }, pinnedMoreBtn: { color: semanticColors.fgSubtle, }, sidebarFooter: { borderTopColor: semanticColors.sidebarBorder, borderTopStyle: "solid", borderTopWidth: "1px", paddingBlock: spacing._2, paddingInline: spacing._2_5, }, sidebarFooterCollapsed: { alignItems: "center", paddingInline: spacing._2, }, userFooterTrigger: { gap: spacing._2_5, height: "auto", justifyContent: "flex-start", paddingBlock: spacing._1_5, paddingInline: spacing._1_5, width: "100%", }, userFooterTriggerCollapsed: { justifyContent: "center", paddingInline: 0, width: sizes.controlMd, }, mobileTopBar: { backgroundColor: semanticColors.bgPanel, borderBottomColor: semanticColors.border, borderBottomStyle: "solid", borderBottomWidth: "1px", display: { default: "none", [NARROW]: "flex", }, flexShrink: 0, height: "3.25rem", 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)", }, }, inlineSearch: { flexGrow: 1, maxWidth: "18rem", minWidth: "12rem", }, tableWrap: { overflowX: "auto", width: "100%", }, progressCell: { minWidth: "7rem", }, cardHeaderRow: { alignItems: "center", display: "flex", flexDirection: "row", gap: spacing._3, justifyContent: "space-between", }, cardTitleReset: { marginBlock: 0, }, cardDescReset: { marginBlock: 0, }, reviewCardBody: { alignItems: { default: "center", [MEDIUM]: "flex-start", }, flexDirection: { default: "row", [MEDIUM]: "column", }, }, swatchGrid: { gridTemplateColumns: { default: "repeat(3, minmax(0, 1fr))", [MEDIUM]: "repeat(2, minmax(0, 1fr))", [COMPACT]: "minmax(0, 1fr)", }, }, swatchButton: { alignItems: "center", backgroundColor: { default: semanticColors.bg, ":hover": semanticColors.bgSubtle, }, borderColor: semanticColors.border, borderRadius: semanticRadii.control, borderStyle: "solid", borderWidth: "1px", color: semanticColors.fg, cursor: "pointer", display: "flex", gap: spacing._3, paddingBlock: spacing._3, paddingInline: spacing._3, textAlign: "start", width: "100%", }, typeSpecimenGrid: { gridTemplateColumns: { default: "repeat(2, minmax(0, 1fr))", [NARROW]: "minmax(0, 1fr)", }, }, specimenBox: { backgroundColor: semanticColors.bgMuted, borderColor: semanticColors.border, borderRadius: semanticRadii.control, borderStyle: "solid", borderWidth: "1px", paddingBlock: spacing._4, paddingInline: spacing._4, }, specimenDisplay: { fontFamily: fonts.heading, fontSize: fontSizes._2xl, fontWeight: fontWeights.semibold, letterSpacing: "-0.02em", lineHeight: lineHeights._2xl, }, inlineInput: { flexGrow: 1, minWidth: "12rem", }, quotaGrid: { gridTemplateColumns: { default: "repeat(2, minmax(0, 1fr))", [COMPACT]: "minmax(0, 1fr)", }, }, planPrice: { letterSpacing: "-0.02em", }, menuWidth: { minWidth: "14rem", }, userMenuHeader: { paddingBlock: spacing._1_5, paddingInline: spacing._2, }, drawerBody: { display: "flex", flexDirection: "column", gap: spacing._4, paddingInline: spacing._3, }, drawerFooter: { borderTopColor: semanticColors.border, borderTopStyle: "solid", borderTopWidth: "1px", justifyContent: "flex-start", paddingBlock: spacing._3, paddingInline: spacing._3, }, dialogFormBody: { 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 ShellSideNavProps extends StyleOverrideProps { /** Initial active route (`projects` | `reviews` | `releases` | `brand-kit` | `members` | `billing`). */ defaultRoute?: ShellSideNavRoute; /** Initial active workspace id (`looma-core` | `solstice-26` | `editorial-lab`). */ defaultWorkspaceId?: string; /** Start with the left sidebar collapsed to an icon rail on desktop. */ defaultSidebarCollapsed?: boolean; /** Called whenever the user navigates to a different route. */ onRouteChange?: (route: ShellSideNavRoute) => void; /** Called whenever the user switches studio workspaces. */ onWorkspaceChange?: (workspaceId: string) => void;}
/** * ShellSideNav — full-height left-rail application shell for Looma Studio * (Creative Asset Workspace). Pairs a collapsible sidebar (workspace switcher, * quick actions, grouped route sections, collapsible pinned collections with * status dots & row menus, and anchored user footer menu) with a mobile * slide-over drawer fallback and interactive route views. */export function ShellSideNav({ defaultRoute = "projects", defaultWorkspaceId = "looma-core", defaultSidebarCollapsed = false, onRouteChange, onWorkspaceChange, palette, style,}: ShellSideNavProps) { const queue = useMemo(() => Toast.createToaster(), []);
const [activeRoute, setActiveRoute] = useState<ShellSideNavRoute>(defaultRoute); const [workspaceId, setWorkspaceId] = useState<string>(defaultWorkspaceId); const [sidebarCollapsed, setSidebarCollapsed] = useState<boolean>( defaultSidebarCollapsed, ); const [collectionsOpen, setCollectionsOpen] = useState(true); const [mobileNavOpen, setMobileNavOpen] = useState(false);
const [searchOpen, setSearchOpen] = useState(false); const [searchQuery, setSearchQuery] = useState("");
const [newProjectOpen, setNewProjectOpen] = useState(false); const [newProjectName, setNewProjectName] = useState(""); const [newProjectCollection, setNewProjectCollection] = useState("Editorial");
const [pendingDelete, setPendingDelete] = useState<CreativeProject | null>( null, );
const [projects, setProjects] = useState<CreativeProject[]>(INITIAL_PROJECTS); const [focusedProjectId, setFocusedProjectId] = useState<string | null>(null); const [projectStageFilter, setProjectStageFilter] = useState< "all" | "active" | "in-review" | "draft" | "blocked" >("all"); const [projectSearch, setProjectSearch] = useState("");
const [reviews, setReviews] = useState<ReviewItem[]>(INITIAL_REVIEWS); const [reviewFilter, setReviewFilter] = useState< "all" | "pending" | "changes" | "approved" >("all");
const [releases, setReleases] = useState<ReleaseBundle[]>(INITIAL_RELEASES);
const [autoWebp, setAutoWebp] = useState(true); const [watermarkExternal, setWatermarkExternal] = useState(true); const [strictColorProfile, setStrictColorProfile] = useState(false);
const [members, setMembers] = useState<MemberItem[]>(INITIAL_MEMBERS); const [inviteEmail, setInviteEmail] = useState(""); const [inviteRole, setInviteRole] = useState<"Editor" | "Reviewer" | "Admin">( "Editor", );
const activeWorkspace = useMemo( () => WORKSPACES.find((w) => w.id === workspaceId) ?? WORKSPACES[0], [workspaceId], );
const workspacePalette = activeWorkspace.palette === "violet" ? violetPalette : activeWorkspace.palette === "green" ? greenPalette : accentPalette;
const pinnedProjects = useMemo( () => projects.filter((p) => p.pinned), [projects], );
const pendingReviewsCount = useMemo( () => reviews.filter((r) => r.status === "pending").length, [reviews], );
const navigateTo = useCallback( (route: ShellSideNavRoute) => { 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); setFocusedProjectId(null); onWorkspaceChange?.(nextId); queue.info(`Switched to ${target.name}`, { description: `${target.tier} · ${target.season} (${target.assetCount} assets)`, }); }, [onWorkspaceChange, queue], );
useEffect(() => { const onKeyDown = (event: KeyboardEvent) => { if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") { event.preventDefault(); setSearchOpen((prev) => !prev); } }; window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); }, []);
const handleCreateProject = (event: React.FormEvent) => { event.preventDefault(); const trimmed = newProjectName.trim(); if (!trimmed) { queue.warning("Enter a project title to create it"); return; } const created: CreativeProject = { id: `proj-${Date.now()}`, workspaceId: activeWorkspace.id, name: trimmed, collection: newProjectCollection.trim() || "Editorial", stage: "draft", assets: 0, readiness: 10, owner: "Mina Castillo", ownerInitials: "MC", updatedAt: "Just now", pinned: true, }; setProjects((prev) => [created, ...prev]); setNewProjectName(""); setNewProjectOpen(false); setFocusedProjectId(created.id); navigateTo("projects"); queue.success(`Created "${created.name}"`, { description: `Pinned to ${activeWorkspace.name} sidebar.`, }); };
const handleDuplicateProject = useCallback( (project: CreativeProject) => { const copy: CreativeProject = { ...project, id: `proj-${Date.now()}`, name: `${project.name} (Copy)`, stage: "draft", updatedAt: "Just now", }; setProjects((prev) => [copy, ...prev]); queue.info(`Duplicated "${project.name}"`, { description: "Saved as a draft in your studio library.", }); }, [queue], );
const handleTogglePin = useCallback( (project: CreativeProject) => { setProjects((prev) => prev.map((item) => item.id === project.id ? { ...item, pinned: !item.pinned } : item, ), ); queue.info( project.pinned ? `Unpinned "${project.name}"` : `Pinned "${project.name}"`, { description: project.pinned ? "Removed from the sidebar rail." : "Added to Pinned Collections in the sidebar.", }, ); }, [queue], );
const handleConfirmDelete = () => { if (!pendingDelete) return; const deleted = pendingDelete; setProjects((prev) => prev.filter((item) => item.id !== deleted.id)); if (focusedProjectId === deleted.id) { setFocusedProjectId(null); } setPendingDelete(null); queue.success(`Deleted "${deleted.name}"`, { description: "Removed project and unlinked its sidebar shortcut.", }); };
const handleUpdateReview = ( review: ReviewItem, nextStatus: "approved" | "changes", ) => { setReviews((prev) => prev.map((item) => item.id === review.id ? { ...item, status: nextStatus } : item, ), ); if (nextStatus === "approved") { queue.success(`Approved ${review.assetName}`, { description: `Ready to include in the next ${review.projectName} release.`, }); } else { queue.warning(`Requested changes on ${review.assetName}`, { description: `Notified ${review.reviewer} with review status update.`, }); } };
const handlePublishBundle = useCallback(() => { const nextMinor = 15 + (releases.length - INITIAL_RELEASES.length); const nextBundle: ReleaseBundle = { id: `rel-${Date.now()}`, version: `bundle-2.${nextMinor}`, title: `${activeWorkspace.name} — Approved Masters`, channel: "Web", assetCount: 42, publishedBy: "Mina Castillo", status: "published", publishedAt: "Just now", }; setReleases((prev) => [nextBundle, ...prev]); queue.success(`Published ${nextBundle.version}`, { description: `42 assets synced to CDN for ${activeWorkspace.name}.`, }); }, [activeWorkspace.name, queue, releases.length]);
const handleInviteMember = (event: React.FormEvent) => { event.preventDefault(); const cleaned = inviteEmail.trim().toLowerCase(); if (!cleaned || !cleaned.includes("@")) { queue.warning("Enter a valid studio email address"); return; } if (members.some((m) => m.email === cleaned)) { queue.warning(`${cleaned} is already in this workspace`); return; } const localName = cleaned .split("@")[0] .split(/[._-]/) .filter(Boolean) .map((part) => part[0].toUpperCase() + part.slice(1)) .join(" "); const initials = localName .split(" ") .map((p) => p[0]) .join("") .slice(0, 2) .toUpperCase(); setMembers((prev) => [ { id: `mem-${Date.now()}`, name: localName || cleaned, email: cleaned, initials: initials || "ST", role: inviteRole, status: "invited", lastActive: "Invite sent just now", }, ...prev, ]); setInviteEmail(""); queue.success(`Invited ${cleaned}`, { description: `Assigned ${inviteRole} access to ${activeWorkspace.name}.`, }); };
const filteredProjects = useMemo(() => { const q = projectSearch.trim().toLowerCase(); return projects.filter((proj) => { if (focusedProjectId && proj.id !== focusedProjectId) return false; if (projectStageFilter !== "all" && proj.stage !== projectStageFilter) { return false; } if (!q) return true; return ( proj.name.toLowerCase().includes(q) || proj.collection.toLowerCase().includes(q) || proj.owner.toLowerCase().includes(q) ); }); }, [focusedProjectId, projectSearch, projectStageFilter, projects]);
const filteredReviews = useMemo(() => { if (reviewFilter === "all") return reviews; return reviews.filter((item) => item.status === reviewFilter); }, [reviewFilter, reviews]);
const paletteCommands = useMemo(() => { const items: Array<{ id: string; label: string; category: string; hint?: string; run: () => void; }> = [ ...(Object.keys(ROUTE_META) as ShellSideNavRoute[]).map((route) => ({ id: `route-${route}`, label: ROUTE_META[route].label, category: "Route", hint: ROUTE_META[route].group, run: () => navigateTo(route), })), ...WORKSPACES.map((ws) => ({ id: `ws-${ws.id}`, label: `Switch workspace: ${ws.name}`, category: "Workspace", hint: ws.tier, run: () => selectWorkspace(ws.id), })), ...pinnedProjects.map((proj) => ({ id: `pin-${proj.id}`, label: `Open collection: ${proj.name}`, category: "Pinned", hint: proj.collection, run: () => { setFocusedProjectId(proj.id); navigateTo("projects"); }, })), { id: "action-new-project", label: "Create new studio project", category: "Action", hint: activeWorkspace.name, run: () => setNewProjectOpen(true), }, { id: "action-publish", label: "Publish approved asset bundle", category: "Action", hint: "Releases", run: () => { navigateTo("releases"); handlePublishBundle(); }, }, { id: "action-toggle-sidebar", label: sidebarCollapsed ? "Expand left sidebar" : "Collapse left sidebar", category: "View", hint: "Layout", run: () => setSidebarCollapsed((prev) => !prev), }, ]; const q = searchQuery.trim().toLowerCase(); if (!q) return items; return items.filter( (item) => item.label.toLowerCase().includes(q) || item.category.toLowerCase().includes(q) || (item.hint?.toLowerCase().includes(q) ?? false), ); }, [ activeWorkspace.name, handlePublishBundle, navigateTo, pinnedProjects, searchQuery, selectWorkspace, sidebarCollapsed, ]);
const stagePalette = (stage: CreativeProject["stage"]) => { switch (stage) { case "active": return greenPalette; case "in-review": return amberPalette; case "blocked": return redPalette; case "draft": return bluePalette; } };
const stageLabel = (stage: CreativeProject["stage"]) => { switch (stage) { case "active": return "Active"; case "in-review": return "In review"; case "blocked": return "Blocked"; case "draft": return "Draft"; } };
const renderWorkspaceSwitcher = (collapsed: boolean) => ( <Menu.Root size="md"> <Menu.Trigger render={ <Button variant="ghost" size="sm" aria-label="Switch studio workspace" style={styles.workspaceTrigger} /> } > <span {...stylex.props(styles.brandMark)}> <LoomaMark /> </span> {!collapsed ? ( <> <VStack render={<span />} gap="0" style={styles.textStart}> <Text render={<span />} size="sm" weight="semibold" truncate="true" style={styles.tightLine} > {activeWorkspace.name} </Text> <Text render={<span />} size="xs" tone="muted" truncate="true"> Looma Studio · {activeWorkspace.tier} </Text> </VStack> <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" style={styles.workspaceChevron} > <path d="m5 6 3-3 3 3" /> <path d="m5 10 3 3 3-3" /> </Icon> </> ) : null} </Menu.Trigger> <Menu.Content align="start" style={styles.menuWidth}> <Menu.Group> <Menu.GroupLabel>Studio 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.season}</Menu.ItemCommand> </Menu.RadioItem> ))} </Menu.RadioGroup> </Menu.Group> <Menu.Separator /> <Menu.Item onSelect={() => { setMobileNavOpen(false); setNewProjectOpen(true); }} > <Menu.ItemText>New project…</Menu.ItemText> </Menu.Item> </Menu.Content> </Menu.Root> );
const renderSidebarNavigation = (collapsed: boolean) => ( <> <VStack gap="1.5" align={collapsed ? "center" : "stretch"}> <Button variant="solid" size="sm" palette={accentPalette} aria-label="New project" title={collapsed ? "New project" : undefined} style={[ styles.newProjectBtn, collapsed && styles.newProjectBtnCollapsed, ]} onClick={() => { setMobileNavOpen(false); setNewProjectOpen(true); }} > <Icon size="sm" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" aria-hidden="true" > <path d="M8 3.25v9.5" /> <path d="M3.25 8h9.5" /> </Icon> {!collapsed ? <span>New project</span> : null} </Button>
<button type="button" aria-label="Quick search" title={collapsed ? "Search workspace (⌘K)" : undefined} onClick={() => { setMobileNavOpen(false); setSearchOpen(true); }} {...stylex.props( styles.searchTrigger, collapsed && styles.searchTriggerCollapsed, )} > <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> {!collapsed ? <span>Search assets…</span> : null} </span> {!collapsed ? ( <Kbd size="xs" variant="outline"> ⌘K </Kbd> ) : null} </button> </VStack>
<Separator />
<Sidebar.Group> {!collapsed ? ( <Sidebar.GroupHeader> <Sidebar.GroupTitle>Workspace</Sidebar.GroupTitle> </Sidebar.GroupHeader> ) : null} <Sidebar.GroupContent> <VStack render={<ul />} gap="0.5" style={styles.navList}> {WORKSPACE_ROUTES.map((route) => { const active = activeRoute === route && !(route === "projects" && focusedProjectId !== null); 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={() => { if (route === "projects") setFocusedProjectId(null); 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 === "projects" ? ( <SidebarNavItem.EndElement> <Badge variant="subtle" size="xs"> {projects.length} </Badge> </SidebarNavItem.EndElement> ) : null} {route === "reviews" && pendingReviewsCount > 0 ? ( <SidebarNavItem.EndElement> <Badge variant="subtle" size="xs" palette={amberPalette} > {pendingReviewsCount} </Badge> </SidebarNavItem.EndElement> ) : null} </> ) : null} </SidebarNavItem.Button> </SidebarNavItem.Item> ); })} </VStack> </Sidebar.GroupContent> </Sidebar.Group>
<Sidebar.Group> {!collapsed ? ( <Sidebar.GroupHeader> <Sidebar.GroupTitle>Studio</Sidebar.GroupTitle> </Sidebar.GroupHeader> ) : null} <Sidebar.GroupContent> <VStack render={<ul />} gap="0.5" style={styles.navList}> {STUDIO_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>
{!collapsed && pinnedProjects.length > 0 ? ( <> <Separator /> <Sidebar.Group> <Collapsible.Root open={collectionsOpen} onOpenChange={setCollectionsOpen} > <Collapsible.Trigger render={ <button type="button" {...stylex.props(styles.collapsibleTriggerBtn)} /> } > <HStack render={<span />} gap="1.5"> <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" style={[ styles.chevronIcon, collectionsOpen && styles.chevronRotated, ]} > <path d="m6 4 4 4-4 4" /> </Icon> <span>Pinned Collections</span> </HStack> <Badge variant="plain" size="xs"> {pinnedProjects.length} </Badge> </Collapsible.Trigger> <Collapsible.Panel> <Sidebar.GroupContent> <VStack render={<ul />} gap="0.5" style={styles.navList}> {pinnedProjects.map((proj) => { const isSelected = activeRoute === "projects" && focusedProjectId === proj.id; return ( <HStack key={proj.id} render={<li />} gap="0.5"> <div {...stylex.props(styles.pinnedItemWrap)}> <SidebarNavItem.Item render={<div />} variant="muted" size="sm" > <SidebarNavItem.Button type="button" aria-current={isSelected ? "page" : undefined} style={ isSelected ? sidebarNavItemActive : undefined } onClick={() => { setFocusedProjectId(proj.id); navigateTo("projects"); }} > <Status.Root size="sm" palette={stagePalette(proj.stage)} aria-label={stageLabel(proj.stage)} > <Status.Indicator /> </Status.Root> <Text render={<span />} size="sm" truncate="true" > {proj.name} </Text> </SidebarNavItem.Button> </SidebarNavItem.Item> </div>
<Menu.Root size="sm"> <Menu.Trigger render={ <IconButton variant="ghost" size="xs" aria-label={`Options for ${proj.name}`} style={styles.pinnedMoreBtn} /> } > <Icon size="xs" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" > <circle cx="3.5" cy="8" r="1.25" /> <circle cx="8" cy="8" r="1.25" /> <circle cx="12.5" cy="8" r="1.25" /> </Icon> </Menu.Trigger> <Menu.Content align="end"> <Menu.Item onSelect={() => { setFocusedProjectId(proj.id); navigateTo("projects"); }} > <Menu.ItemText>Open collection</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => handleDuplicateProject(proj)} > <Menu.ItemText>Duplicate</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => handleTogglePin(proj)} > <Menu.ItemText>Unpin from rail</Menu.ItemText> </Menu.Item> <Menu.Separator /> <Menu.Item destructive onSelect={() => setPendingDelete(proj)} > <Menu.ItemText>Delete</Menu.ItemText> </Menu.Item> </Menu.Content> </Menu.Root> </HStack> ); })} </VStack> </Sidebar.GroupContent> </Collapsible.Panel> </Collapsible.Root> </Sidebar.Group> </> ) : null} </> );
const renderUserFooterMenu = (collapsed: boolean) => ( <Menu.Root size="md"> <Menu.Trigger render={ <Button variant="ghost" size="sm" aria-label="Account menu" style={[ styles.userFooterTrigger, collapsed && styles.userFooterTriggerCollapsed, ]} /> } > <Avatar.Root size="sm" variant="subtle" palette={accentPalette}> <Avatar.Fallback>MC</Avatar.Fallback> </Avatar.Root> {!collapsed ? ( <> <VStack render={<span />} gap="0" style={styles.textStart}> <Text render={<span />} size="sm" weight="medium" truncate="true" style={styles.tightLine} > Mina Castillo </Text> <Text render={<span />} size="xs" tone="muted" truncate="true"> Creative Director </Text> </VStack> <Icon size="xs" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" style={styles.workspaceChevron} > <path d="m5 6 3-3 3 3" /> <path d="m5 10 3 3 3-3" /> </Icon> </> ) : null} </Menu.Trigger> <Menu.Content side="top" align="start" style={styles.menuWidth}> <VStack gap="0.5" style={styles.userMenuHeader}> <Text render={<span />} size="sm" weight="medium"> Mina Castillo </Text> <Text render={<span />} size="xs" tone="muted"> mina@looma.studio </Text> </VStack> <Menu.Separator /> <Menu.Item onSelect={() => navigateTo("brand-kit")}> <Menu.ItemText>Brand Kit & tokens</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => navigateTo("members")}> <Menu.ItemText>Team & permissions</Menu.ItemText> </Menu.Item> <Menu.Item onSelect={() => navigateTo("billing")}> <Menu.ItemText>Billing & storage</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 Looma Studio", { description: "Creative session ended on this device.", }) } > <Menu.ItemText>Sign out</Menu.ItemText> </Menu.Item> </Menu.Content> </Menu.Root> );
const focusedProject = useMemo( () => projects.find((p) => p.id === focusedProjectId) ?? null, [focusedProjectId, projects], );
return ( <AppShell.Root palette={palette} style={[styles.root, style]}> <AppShell.Content> <Sidebar.Root variant="sidebar" mode="collapsible" size="md" aria-label="Looma Studio navigation" style={[styles.sidebar, sidebarCollapsed && styles.sidebarCollapsed]} > <Sidebar.Header style={[ styles.sidebarHeader, sidebarCollapsed && styles.sidebarHeaderCollapsed, ]} > {sidebarCollapsed ? ( <IconButton variant="ghost" size="sm" aria-label="Expand navigation sidebar" aria-expanded={false} onClick={() => setSidebarCollapsed(false)} > <span {...stylex.props(styles.brandMark)}> <LoomaMark /> </span> </IconButton> ) : ( <> {renderWorkspaceSwitcher(false)} <IconButton variant="ghost" size="xs" aria-label="Collapse navigation sidebar" aria-expanded={true} onClick={() => setSidebarCollapsed(true)} > <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> </> )} </Sidebar.Header>
<Sidebar.Body style={sidebarCollapsed ? styles.sidebarBodyCollapsed : undefined} > {renderSidebarNavigation(sidebarCollapsed)} </Sidebar.Body>
<Sidebar.Footer style={[ styles.sidebarFooter, sidebarCollapsed && styles.sidebarFooterCollapsed, ]} > {renderUserFooterMenu(sidebarCollapsed)} </Sidebar.Footer> </Sidebar.Root>
<AppShell.Main style={styles.main}> <HStack gap="2" justify="between" style={styles.mobileTopBar}> <HStack gap="2"> <IconButton variant="ghost" size="sm" aria-label="Open navigation drawer" 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> <span {...stylex.props(styles.brandMark)}> <LoomaMark /> </span> <Text render={<span />} size="sm" weight="semibold" truncate="true"> {activeWorkspace.name} · {ROUTE_META[activeRoute].label} </Text> </HStack>
<IconButton variant="ghost" size="sm" aria-label="Open quick search" onClick={() => setSearchOpen(true)} > <Icon size="sm" 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> </IconButton> </HStack>
<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> <Badge variant="subtle" size="xs" palette={workspacePalette} > {activeWorkspace.tier} </Badge> <span aria-hidden="true">/</span> <span>{ROUTE_META[activeRoute].group}</span> <span aria-hidden="true">/</span> <span>{ROUTE_META[activeRoute].label}</span> {focusedProject && activeRoute === "projects" ? ( <> <span aria-hidden="true">/</span> <span>{focusedProject.name}</span> </> ) : null} </HStack> <Heading render={<h1 />} size="2xl" style={styles.pageTitle}> {focusedProject && activeRoute === "projects" ? focusedProject.name : ROUTE_META[activeRoute].label} </Heading> <Text size="sm" tone="muted"> {ROUTE_META[activeRoute].description} </Text> </VStack>
<HStack gap="2" wrap="wrap"> {activeRoute === "projects" ? ( <> {focusedProject ? ( <Button variant="surface" size="sm" onClick={() => setFocusedProjectId(null)} > Show all projects </Button> ) : null} <Button variant="solid" size="sm" palette={accentPalette} onClick={() => setNewProjectOpen(true)} > New project </Button> </> ) : null}
{activeRoute === "reviews" ? ( <Button variant="surface" size="sm" onClick={() => queue.info("Shareable proof link copied", { description: `External reviewers can comment on ${pendingReviewsCount} pending files.`, }) } > Copy review link </Button> ) : null}
{activeRoute === "releases" ? ( <Button variant="solid" size="sm" palette={accentPalette} onClick={handlePublishBundle} > Publish bundle </Button> ) : null}
{activeRoute === "brand-kit" ? ( <Button variant="surface" size="sm" onClick={() => queue.success("Exported brand-tokens.json", { description: "Includes 6 color tokens and typography scales.", }) } > Export tokens </Button> ) : null} </HStack> </HStack>
{activeRoute === "projects" ? ( <> <Grid gap="4" style={styles.statGrid}> <Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Active Projects</Stat.Label> <Stat.ValueText>{projects.length}</Stat.ValueText> <Stat.HelpText> {pinnedProjects.length} pinned to sidebar </Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Assets in Library</Stat.Label> <Stat.ValueText> {activeWorkspace.assetCount} </Stat.ValueText> <Stat.HelpText>{activeWorkspace.season}</Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Pending Reviews</Stat.Label> <Stat.ValueText>{pendingReviewsCount}</Stat.ValueText> <Stat.HelpText> Awaiting creative sign-off </Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Body> <Stat.Root size="md"> <Stat.Label>Storage Used</Stat.Label> <Stat.ValueText> {activeWorkspace.storageUsed} </Stat.ValueText> <Stat.HelpText>Of 2.00 TB Studio Pro</Stat.HelpText> </Stat.Root> </Card.Body> </Card.Root> </Grid>
<Card.Root variant="outline" size="md"> <Card.Header> <HStack gap="3" wrap="wrap" justify="between"> <HStack gap="1.5" wrap="wrap"> {( [ "all", "active", "in-review", "draft", "blocked", ] as const ).map((stage) => ( <Button key={stage} variant={ projectStageFilter === stage ? "solid" : "surface" } size="xs" palette={ projectStageFilter === stage ? accentPalette : undefined } onClick={() => setProjectStageFilter(stage)} > {stage === "all" ? "All" : stageLabel(stage)} </Button> ))} </HStack> <div {...stylex.props(styles.inlineSearch)}> <Input size="sm" placeholder="Filter projects or owners…" value={projectSearch} onChange={(event) => setProjectSearch(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>Project</Table.ColumnHeader> <Table.ColumnHeader>Stage</Table.ColumnHeader> <Table.ColumnHeader>Assets</Table.ColumnHeader> <Table.ColumnHeader>Readiness</Table.ColumnHeader> <Table.ColumnHeader>Owner</Table.ColumnHeader> <Table.ColumnHeader>Actions</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {filteredProjects.map((proj) => ( <Table.Row key={proj.id}> <Table.Cell> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium" > {proj.name} </Text> <Text render={<span />} size="xs" tone="muted"> {proj.collection} · Updated {proj.updatedAt} </Text> </VStack> </Table.Cell> <Table.Cell> <Status.Root size="sm" palette={stagePalette(proj.stage)} > <Status.Indicator /> {stageLabel(proj.stage)} </Status.Root> </Table.Cell> <Table.Cell>{proj.assets}</Table.Cell> <Table.Cell> <VStack gap="1" style={styles.progressCell}> <Progress.Root value={proj.readiness} variant="subtle" size="xs" shape="full" palette={stagePalette(proj.stage)} > <Progress.Track> <Progress.Range /> </Progress.Track> </Progress.Root> <Text render={<span />} size="xs" tone="muted"> {proj.readiness}% ready </Text> </VStack> </Table.Cell> <Table.Cell> <HStack render={<span />} gap="2"> <Avatar.Root size="xs" variant="subtle"> <Avatar.Fallback> {proj.ownerInitials} </Avatar.Fallback> </Avatar.Root> <span>{proj.owner}</span> </HStack> </Table.Cell> <Table.Cell> <HStack gap="1.5" wrap="wrap"> <Button variant="ghost" size="xs" onClick={() => handleTogglePin(proj)} > {proj.pinned ? "Unpin" : "Pin"} </Button> <Button variant="ghost" size="xs" palette={redPalette} onClick={() => setPendingDelete(proj)} > Delete </Button> </HStack> </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> {filteredProjects.length === 0 ? ( <Text size="sm" tone="muted" align="center" style={styles.emptyStateText} > No projects match the current filter. </Text> ) : null} </div> </Card.Body> </Card.Root> </> ) : null}
{activeRoute === "reviews" ? ( <> <HStack gap="1.5" wrap="wrap"> {( [ { id: "all", label: "All proofs" }, { id: "pending", label: "Pending" }, { id: "changes", label: "Changes requested" }, { id: "approved", label: "Approved" }, ] as const ).map((tab) => ( <Button key={tab.id} variant={reviewFilter === tab.id ? "solid" : "surface"} size="xs" palette={ reviewFilter === tab.id ? accentPalette : undefined } onClick={() => setReviewFilter(tab.id)} > {tab.label} </Button> ))} </HStack>
<VStack gap="3"> {filteredReviews.map((review) => ( <Card.Root key={review.id} variant="outline" size="md"> <Card.Body> <HStack gap="4" justify="between" style={styles.reviewCardBody} > <VStack gap="1.5"> <HStack gap="1.5" wrap="wrap"> <Text render={<span />} size="sm" weight="medium" > {review.assetName} </Text> <Code size="xs">{review.version}</Code> <Badge variant="subtle" size="xs"> {review.format} </Badge> <Status.Root size="sm" palette={ review.status === "approved" ? greenPalette : review.status === "changes" ? redPalette : amberPalette } > <Status.Indicator /> {review.status === "approved" ? "Approved" : review.status === "changes" ? "Changes requested" : "Pending review"} </Status.Root> </HStack> <Text size="sm" tone="muted"> {review.note} </Text> <HStack render={<span />} gap="2"> <Avatar.Root size="xs" variant="subtle"> <Avatar.Fallback> {review.reviewerInitials} </Avatar.Fallback> </Avatar.Root> <Text render={<span />} size="xs" tone="muted"> {review.reviewer} · {review.projectName} ·{" "} {review.submittedAt} </Text> </HStack> </VStack>
<HStack gap="1.5" wrap="wrap"> {review.status !== "approved" ? ( <Button variant="solid" size="xs" palette={greenPalette} onClick={() => handleUpdateReview(review, "approved") } > Approve </Button> ) : null} {review.status !== "changes" ? ( <Button variant="surface" size="xs" onClick={() => handleUpdateReview(review, "changes") } > Request changes </Button> ) : null} </HStack> </HStack> </Card.Body> </Card.Root> ))} </VStack> </> ) : null}
{activeRoute === "releases" ? ( <Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Asset Delivery Bundles </Card.Title> <Card.Description style={styles.cardDescReset}> Immutable release snapshots distributed from{" "} {activeWorkspace.name} </Card.Description> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Bundle</Table.ColumnHeader> <Table.ColumnHeader>Delivery</Table.ColumnHeader> <Table.ColumnHeader>Channel</Table.ColumnHeader> <Table.ColumnHeader>Assets</Table.ColumnHeader> <Table.ColumnHeader>Status</Table.ColumnHeader> <Table.ColumnHeader>Action</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {releases.map((rel) => ( <Table.Row key={rel.id}> <Table.Cell> <Code size="xs">{rel.version}</Code> </Table.Cell> <Table.Cell> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium" > {rel.title} </Text> <Text render={<span />} size="xs" tone="muted"> {rel.publishedBy} · {rel.publishedAt} </Text> </VStack> </Table.Cell> <Table.Cell> <Badge variant="subtle" size="xs"> {rel.channel} </Badge> </Table.Cell> <Table.Cell>{rel.assetCount}</Table.Cell> <Table.Cell> <Status.Root size="sm" palette={ rel.status === "published" ? greenPalette : bluePalette } > <Status.Indicator /> {rel.status === "published" ? "Published" : "Scheduled"} </Status.Root> </Table.Cell> <Table.Cell> <Button variant="ghost" size="xs" onClick={() => queue.info( `Copied CDN link for ${rel.version}`, { description: `https://cdn.looma.studio/${rel.version}/manifest.json`, }, ) } > Copy manifest </Button> </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> </div> </Card.Body> </Card.Root> ) : null}
{activeRoute === "brand-kit" ? ( <> <Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Color Palette Tokens </Card.Title> <Card.Description style={styles.cardDescReset}> Click any swatch to copy its canonical hex value </Card.Description> </Card.Header> <Card.Body> <Grid gap="3" style={styles.swatchGrid}> {BRAND_COLORS.map((color) => ( <button key={color.id} type="button" onClick={() => queue.info(`Copied ${color.name} (${color.hex})`, { description: `CSS variable: ${color.token}`, }) } {...stylex.props(styles.swatchButton)} > <ColorSwatch size="2xl" shape="rounded" style={swatchColors[color.swatchKey]} /> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> {color.name} </Text> <HStack gap="1.5" wrap="wrap"> <Code size="xs">{color.hex}</Code> <Text render={<span />} size="xs" tone="muted"> {color.token} </Text> </HStack> <Text render={<span />} size="xs" tone="muted"> {color.usage} </Text> </VStack> </button> ))} </Grid> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Typography Specimens </Card.Title> <Card.Description style={styles.cardDescReset}> Display and interface pairing across web and editorial deliverables </Card.Description> </Card.Header> <Card.Body> <Grid gap="4" style={styles.typeSpecimenGrid}> <VStack gap="2" style={styles.specimenBox}> <Badge variant="subtle" size="xs"> Heading Scale </Badge> <span {...stylex.props(styles.specimenDisplay)}> Crafted for tactile clarity. </span> <Text render={<span />} size="xs" tone="muted"> Tracking -0.02em · Medium / Semibold </Text> </VStack> <VStack gap="2" style={styles.specimenBox}> <Badge variant="subtle" size="xs"> Interface Copy </Badge> <Text render={<span />} size="md"> Balanced optical readability across dense studio inspectors, review threads, and release notes. </Text> <Text render={<span />} size="xs" tone="muted"> Line height 1.5 · Regular / Medium </Text> </VStack> </Grid> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Export Guardrails </Card.Title> <Card.Description style={styles.cardDescReset}> Automated checks enforced when publishing bundles </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"> Auto-generate lossless WebP renditions </Text> <Text render={<span />} size="xs" tone="muted"> Produce optimized web exports alongside master TIFF uploads. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={autoWebp} onCheckedChange={(checked) => { setAutoWebp(checked); queue.info( `Lossless WebP renditions ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack>
<Separator />
<HStack gap="4" justify="between"> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> Watermark external client proofs </Text> <Text render={<span />} size="xs" tone="muted"> Stamp recipient email and version number on unapproved share links. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={watermarkExternal} onCheckedChange={(checked) => { setWatermarkExternal(checked); queue.info( `Proof watermarking ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack>
<Separator />
<HStack gap="4" justify="between"> <VStack gap="0.5"> <Text render={<span />} size="sm" weight="medium"> Strict CMYK / Display-P3 profile gate </Text> <Text render={<span />} size="xs" tone="muted"> Block print bundle releases if an asset lacks an embedded ICC profile. </Text> </VStack> <Switch.Root size="md" palette={accentPalette}> <Switch.Control checked={strictColorProfile} onCheckedChange={(checked) => { setStrictColorProfile(checked); queue.info( `Color profile gate ${checked ? "enabled" : "disabled"}`, ); }} /> </Switch.Root> </HStack> </VStack> </Card.Body> </Card.Root> </> ) : null}
{activeRoute === "members" ? ( <> <Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Invite Collaborator </Card.Title> <Card.Description style={styles.cardDescReset}> Add designers, art directors, or external reviewers to{" "} {activeWorkspace.name} </Card.Description> </Card.Header> <Card.Body> <HStack render={<form onSubmit={handleInviteMember} />} gap="2" wrap="wrap" > <div {...stylex.props(styles.inlineInput)}> <Input size="sm" type="email" placeholder="collaborator@looma.studio" value={inviteEmail} onChange={(event) => setInviteEmail(event.target.value) } /> </div> <HStack gap="1.5" wrap="wrap"> {(["Editor", "Reviewer", "Admin"] as const).map( (role) => ( <Button key={role} type="button" variant={ inviteRole === role ? "solid" : "surface" } size="xs" palette={ inviteRole === role ? accentPalette : undefined } onClick={() => setInviteRole(role)} > {role} </Button> ), )} </HStack> <Button type="submit" variant="solid" size="sm" palette={accentPalette} > Send invite </Button> </HStack> </Card.Body> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Studio Directory ({members.length}) </Card.Title> </Card.Header> <Card.Body> <div {...stylex.props(styles.tableWrap)}> <Table.Root variant="line" size="md"> <Table.Header> <Table.Row> <Table.ColumnHeader>Member</Table.ColumnHeader> <Table.ColumnHeader>Role</Table.ColumnHeader> <Table.ColumnHeader>Status</Table.ColumnHeader> <Table.ColumnHeader>Activity</Table.ColumnHeader> <Table.ColumnHeader>Action</Table.ColumnHeader> </Table.Row> </Table.Header> <Table.Body> {members.map((member) => ( <Table.Row key={member.id}> <Table.Cell> <HStack render={<span />} gap="2"> <Avatar.Root size="sm" variant="subtle" palette={ member.role === "Admin" ? accentPalette : undefined } > <Avatar.Fallback> {member.initials} </Avatar.Fallback> </Avatar.Root> <VStack render={<span />} gap="0.5"> <Text render={<span />} size="sm" weight="medium" > {member.name} </Text> <Text render={<span />} size="xs" tone="muted" > {member.email} </Text> </VStack> </HStack> </Table.Cell> <Table.Cell> <Badge variant="subtle" size="xs"> {member.role} </Badge> </Table.Cell> <Table.Cell> <Status.Root size="sm" palette={ member.status === "active" ? greenPalette : amberPalette } > <Status.Indicator /> {member.status === "active" ? "Active" : "Pending invite"} </Status.Root> </Table.Cell> <Table.Cell> <Text render={<span />} size="xs" tone="muted"> {member.lastActive} </Text> </Table.Cell> <Table.Cell> {member.status === "invited" ? ( <Button variant="ghost" size="xs" onClick={() => queue.info( `Resent invite to ${member.email}`, ) } > Resend </Button> ) : ( <Button variant="ghost" size="xs" onClick={() => queue.info( `Opened permissions for ${member.name}`, ) } > Manage </Button> )} </Table.Cell> </Table.Row> ))} </Table.Body> </Table.Root> </div> </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}> Studio Pro Plan </Card.Title> <Badge variant="subtle" size="xs" palette={greenPalette} > Active </Badge> </HStack> <Card.Description style={styles.cardDescReset}> Renews on Dec 31, 2026 · Mastercard ending in 9104 </Card.Description> </VStack> <HStack align="baseline" gap="2"> <Text render={<span />} size="2xl" weight="semibold" style={styles.planPrice} > $89 </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("Agency tier comparison opened", { description: "Includes 10 TB vault storage, SSO, and unlimited client guest links.", }) } > Upgrade to Agency </Button> <Button variant="surface" size="sm" onClick={() => queue.info("Billing portal opened", { description: "Update cards, tax IDs, and invoice recipients.", }) } > Update payment method </Button> </Card.Footer> </Card.Root>
<Card.Root variant="outline" size="md"> <Card.Header> <Card.Title style={styles.cardTitleReset}> Monthly Storage & Delivery Quotas </Card.Title> <Card.Description style={styles.cardDescReset}> 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 >= 80 ? 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">{renderWorkspaceSwitcher(false)}</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}> {renderSidebarNavigation(false)} </Drawer.Body> <Drawer.Footer style={styles.drawerFooter}> {renderUserFooterMenu(false)} </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>Jump to Route, Collection, or Action</Dialog.Title> </Dialog.Header> <Dialog.Body style={styles.dialogFormBody}> <Input size="md" placeholder="Search Looma Studio routes, workspaces, or pinned collections…" 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 matches 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>
<Dialog.Root open={newProjectOpen} onOpenChange={setNewProjectOpen} size="sm" placement="center" > <Dialog.Backdrop /> <Dialog.Content> <Dialog.Header> <Dialog.Title>Create Studio Project</Dialog.Title> </Dialog.Header> <form onSubmit={handleCreateProject}> <Dialog.Body style={styles.dialogFormBody}> <VStack gap="1.5"> <Text render={<label htmlFor="looma-project-name" />} variant="label" size="sm" > Project name </Text> <Input id="looma-project-name" size="md" placeholder="e.g. Winter Capsule Film" value={newProjectName} onChange={(event) => setNewProjectName(event.target.value)} autoFocus /> </VStack> <VStack gap="1.5"> <Text render={<label htmlFor="looma-project-collection" />} variant="label" size="sm" > Collection type </Text> <Input id="looma-project-collection" size="md" placeholder="Editorial, Photography, Video, Print…" value={newProjectCollection} onChange={(event) => setNewProjectCollection(event.target.value) } /> </VStack> </Dialog.Body> <Dialog.Footer> <Button type="button" variant="ghost" size="sm" onClick={() => setNewProjectOpen(false)} > Cancel </Button> <Button type="submit" variant="solid" size="sm" palette={accentPalette} > Create & pin </Button> </Dialog.Footer> </form> </Dialog.Content> </Dialog.Root>
<AlertDialog.Root open={pendingDelete !== null} onOpenChange={(open) => { if (!open) setPendingDelete(null); }} size="sm" > <AlertDialog.Backdrop /> <AlertDialog.Content> <AlertDialog.Header> <AlertDialog.Icon palette={redPalette}> <Icon size="md" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" > <path d="M10 3.25 17 16H3L10 3.25Z" /> <path d="M10 8v3.5" /> <path d="M10 14h.01" /> </Icon> </AlertDialog.Icon> <AlertDialog.Title> Delete “{pendingDelete?.name}”? </AlertDialog.Title> </AlertDialog.Header> <AlertDialog.Body> <AlertDialog.Description> This removes the project from {activeWorkspace.name} and unpins it from the left sidebar rail. You can recreate it anytime in this demo. </AlertDialog.Description> </AlertDialog.Body> <AlertDialog.Footer> <AlertDialog.Cancel render={<Button variant="surface" size="sm" />}> Cancel </AlertDialog.Cancel> <Button variant="solid" size="sm" palette={redPalette} onClick={handleConfirmDelete} > Delete project </Button> </AlertDialog.Footer> </AlertDialog.Content> </AlertDialog.Root>
<Toaster toaster={queue} /> </AppShell.Root> );}
Inspired by the Side Nav template from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.).