{"name":"sidebar-nav","title":"Sidebar Nav","description":"","kind":"block","category":"navigation","status":"beta","props":{"workspace":{"type":"string","model":true,"description":"Value of the current workspace."},"workspaces":{"type":"array","items":{"value":"string","label":"string"},"description":"Workspaces offered by the switcher (a radio group in the menu)."},"actions":{"type":"array","items":{"value":"string","label":"string","icon":"string? (an icon name) or an icon","tone":"'danger'?","type":"'separator'?"},"description":"Menu actions under the workspaces. Defaults to New workspace, Workspace settings, a separator and Sign out."},"items":{"type":"array","items":{"value":"string","label":"string","href":"string","icon":"icon name or icon","badge":"string?"},"description":"Primary links, each with an icon."},"sections":{"type":"array","items":{"value":"string","label":"string","items":"{ value, label, href, icon? }[]"},"description":"Labelled groups of links under the primary ones (projects, teams, saved views): each a collapsible section with its own label, open until the reader folds it. A link with an icon shows it; without, its text lines up with the labels."},"chats":{"type":"array","items":{"value":"string","label":"string","href":"string","icon":"icon name or icon?"},"description":"Recent chats. A chat with an icon shows it; one without is indented to the label column. Without sections the Chats section is always shown (empty shows the empty text); with sections only when chats is given."},"current":{"type":"string","model":true,"attr":"aria-current","part":"item","description":"Value of the current link (an item or a chat): aria-current=page."},"collapsed":{"type":"boolean","model":true,"default":false,"description":"Rail of icons only."},"chatsOpen":{"type":"boolean","model":true,"default":true,"description":"Whether the chats list is shown (the collapsible's open state)."},"logo":{"type":"string","default":"squares-four","description":"Icon in front of the workspace name (an icon name, or an icon)."},"label":{"type":"string","default":"Workspace navigation","description":"Accessible name of the nav."},"chatsLabel":{"type":"string","default":"Chats"},"emptyLabel":{"type":"string","default":"No chats yet"},"size":{"type":"enum","values":["sm","md"],"default":"md","description":"Dimensions only (the control scale). md: 32px rows, 14px text, 18px glyphs, the control radius. sm: 28px rows, 13px text, 16px glyphs (and the toggle's), the chip radius on the rows, their fill and ring, the highlight and the switcher (as every control up to 28px), for a dense app whose content is 13px. Both keep the 20px glyph box, so the glyphs' 26px centre, the 52px rail and the 34px label column do not move; collapsed rows stay 36px wide."}},"playground":{"name":"Playground","props":{"workspace":"harbor","workspaces":[{"value":"harbor","label":"Harbor"},{"value":"harbor-eu","label":"Harbor EU"},{"value":"sandbox","label":"Maya's sandbox"}],"logo":"calendar","items":[{"value":"new","label":"New chat","href":"#new","icon":"note-pencil"},{"value":"home","label":"Home","href":"#home","icon":"house"},{"value":"invite","label":"Invite teammates","href":"#invite","icon":"user-plus","badge":"3/10"}],"chats":[{"value":"deploy","label":"Failed deploy on harbor/api","href":"#deploy"},{"value":"refund","label":"Refund for Brightline Dental","href":"#refund"}],"current":"home","collapsed":false,"chatsOpen":true}},"exampleFiles":[{"file":"expanded","title":"Assistant sidebar"},{"file":"issue-tracker","title":"Issue tracker with project sections"},{"file":"collapsed","title":"Collapsed to an icon rail"},{"file":"no-chats","title":"First day in a new workspace"}],"worstCase":[{"name":"Long names and many chats","props":{"workspace":"long","workspaces":[{"value":"long","label":"Seasonal pricing for the northern summer launch — draft 12 ok"},{"value":"platform","label":"Platform Ops"},{"value":"aurora","label":"Aurora Health"},{"value":"kumo","label":"Kumo Capital"}],"items":[{"value":"new","label":"New chat","href":"#new","icon":"note-pencil"},{"value":"home","label":"Home","href":"#home","icon":"house"},{"value":"invite","label":"Invite users","href":"#invite","icon":"user-plus","badge":"128"}],"chats":[{"value":"c1","label":"Supplier records 1","href":"#c1"},{"value":"c2","label":"Rollout plan 1","href":"#c2"},{"value":"c3","label":"Pricing ticket 1","href":"#c3"},{"value":"c4","label":"Margin review 1","href":"#c4"},{"value":"c5","label":"Meeting notes 1","href":"#c5"},{"value":"c6","label":"Access audit 1","href":"#c6"},{"value":"c7","label":"Holiday plan 1","href":"#c7"},{"value":"c8","label":"Price list 1","href":"#c8"},{"value":"c9","label":"Cloud supplier 1","href":"#c9"},{"value":"c10","label":"Beta launch 1","href":"#c10"},{"value":"c11","label":"Supplier records 2","href":"#c11"},{"value":"c12","label":"Rollout plan 2","href":"#c12"},{"value":"c13","label":"Pricing ticket 2","href":"#c13"},{"value":"c14","label":"Margin review 2","href":"#c14"},{"value":"c15","label":"Meeting notes 2","href":"#c15"},{"value":"c16","label":"Access audit 2","href":"#c16"},{"value":"c17","label":"Holiday plan 2","href":"#c17"},{"value":"c18","label":"Price list 2","href":"#c18"},{"value":"c19","label":"Cloud supplier 2","href":"#c19"},{"value":"c20","label":"Beta launch 2","href":"#c20"},{"value":"c21","label":"Supplier records 3","href":"#c21"},{"value":"c22","label":"Rollout plan 3","href":"#c22"},{"value":"c23","label":"Pricing ticket 3","href":"#c23"},{"value":"c24","label":"Margin review 3","href":"#c24"},{"value":"c25","label":"Meeting notes 3","href":"#c25"},{"value":"c26","label":"Access audit 3","href":"#c26"},{"value":"c27","label":"Holiday plan 3","href":"#c27"},{"value":"c28","label":"Price list 3","href":"#c28"},{"value":"c29","label":"Cloud supplier 3","href":"#c29"},{"value":"c30","label":"Beta launch 3","href":"#c30"},{"value":"c31","label":"Supplier records 4","href":"#c31"},{"value":"c32","label":"Rollout plan 4","href":"#c32"},{"value":"c33","label":"Pricing ticket 4","href":"#c33"},{"value":"c34","label":"Margin review 4","href":"#c34"},{"value":"c35","label":"Meeting notes 4","href":"#c35"},{"value":"c36","label":"Access audit 4","href":"#c36"},{"value":"c37","label":"Holiday plan 4","href":"#c37"},{"value":"c38","label":"Price list 4","href":"#c38"},{"value":"c39","label":"Cloud supplier 4","href":"#c39"},{"value":"c40","label":"Beta launch 4","href":"#c40"}],"current":"c3","collapsed":false,"chatsOpen":true}},{"name":"No chats","props":{"workspace":"platform","workspaces":[{"value":"platform","label":"Platform Ops"},{"value":"aurora","label":"Aurora Health"},{"value":"kumo","label":"Kumo Capital"}],"items":[{"value":"new","label":"New chat","href":"#new","icon":"note-pencil"},{"value":"home","label":"Home","href":"#home","icon":"house"},{"value":"invite","label":"Invite users","href":"#invite","icon":"user-plus","badge":"3/10"}],"chats":[],"current":"home","collapsed":false,"chatsOpen":true}},{"name":"Right to left","props":{"workspace":"ar","workspaces":[{"value":"ar","label":"عمليات المصنع"}],"items":[{"value":"new","label":"محادثة جديدة","href":"#new","icon":"note-pencil"},{"value":"home","label":"الرئيسية","href":"#home","icon":"house"},{"value":"invite","label":"دعوة مستخدمين","href":"#invite","icon":"user-plus","badge":"٣/١٠"}],"chats":[{"value":"a","label":"سجلات الموردين","href":"#a"},{"value":"b","label":"مهام عاجلة هذا الصباح","href":"#b"}],"current":"home","collapsed":false,"chatsOpen":true,"chatsLabel":"المحادثات","label":"تنقل مساحة العمل"}}],"anatomy":[{"part":"root","element":"nav","description":"aria-label; data-collapsed while collapsed; carries kbd-instant. Its width is the only thing that changes size (224px ↔ 52px); it clips the panel"},{"part":"panel","element":"div","description":"The fixed 224px tree; never re-laid out by a collapse"},{"part":"header","element":"div"},{"part":"switcher","element":"div","description":"The menu root (the Menu's root); its popup is portaled"},{"part":"workspace","element":"button","description":"The menu trigger (the Menu's trigger): logo, workspace name and caret Marked data-menu=\"trigger\" (the menu's trigger part, written here)."},{"part":"logo","element":"span"},{"part":"workspace-name","element":"span","description":"Truncates; title carries the full name"},{"part":"caret","element":"span"},{"part":"toggle","element":"button","description":"Collapse / expand: a Button (ghost, md, square, rounded, muted) with our tooltip naming its action. Pinned to the root's inline-end edge, so it rides the edge and lands on the logo's spot Marked data-sidebar-nav=\"toggle\"."},{"part":"group","element":"div","repeat":true,"description":"Offset parent of a gliding highlight and its list"},{"part":"highlight","element":"span","repeat":true,"description":"Gliding highlight (`glideLayer` of `lib/glide.ts`): follows pointer and focus and glides for both"},{"part":"list","element":"ul","repeat":true},{"part":"item","element":"a","repeat":true,"description":"A link; aria-current=page on the current one. An optional badge is a plain Count (also data-sidebar-nav=\"copy\"). Collapsed: aria-label carries the name and our tooltip shows it Every link's text starts on one edge: with an icon, the icon sits in the icon column; a chat or section link without one is indented to the label column."},{"part":"item-icon","element":"span","optional":true},{"part":"label","element":"span","description":"Also data-sidebar-nav=\"copy\""},{"part":"copy","element":"span","repeat":true,"description":"Anything that fades out on collapse; aria-hidden while collapsed Every element that fades carries data-sidebar-nav=\"copy\" (labels, the switcher name and caret, a badge Count)."},{"part":"sections","element":"div","description":"Holds the sections and the chats: with sections, one scroller (overscroll contained) where each section takes its own height, 12px apart; without, no box of its own (display: contents)."},{"part":"section","element":"div","description":"A Collapsible (variant section, caret at the start): the chats, or one of the sections (its own label, open until folded). The chats' body holds a group of links, or an EmptyState row when there are none. Without sections the chats section scrolls itself; with sections every section is as tall as its rows and the sections part scrolls. Hidden while collapsed"}],"events":{"workspaceChange":"(value: string) a workspace was picked; the menu closes","workspaceAction":"(value: string) a menu action was chosen","currentChange":"(value: string) a link was followed","collapsedChange":"(collapsed: boolean)","chatsOpenChange":"(open: boolean)","navigate":"(value: string, href: string, event) a link was followed, before it becomes current; event.preventDefault() lets the app route without loading href"},"states":["hover","press","focus-visible","current","collapsed","expanded"],"tokens":["color.ink","color.ink-2","color.ink-3","color.hover","color.hover-2","color.accent","radius.control","radius.chip","text.xs","text.md","duration.fast","duration.base","duration.press","duration.move","easing.out-strong","motion.press-scale","motion.enter-shift"],"a11y":{"role":"navigation","keyboard":["Tab order: workspace switcher, collapse toggle, links, then each section's disclosure and its links, then Chats and the chat links. Collapsed: toggle, then the icon links","Enter on a link follows it and makes it current (aria-current=page)","Enter / Space / ArrowDown on the switcher open the menu; arrows move, Enter picks a workspace (the menu closes and focus returns to the switcher), Escape closes","Enter / Space on the toggle collapse or expand the rail; focus stays on the toggle, which keeps its place under the pointer of the rail","Enter / Space on Chats show or hide the list; focus stays on the trigger"],"notes":["Collapsed, the labels are aria-hidden and every icon link is named by aria-label; our tooltip shows that name on hover and keyboard focus (on the inline-end side). The toggle's tooltip names its action.","The collapse and the caret are instant from the keyboard; the highlight glides for keyboard moves too."]},"motion":["collapse: the root's width over duration.move with easing.out-strong (the one layout transition: the page beside it has to reflow; the 224px tree inside never re-lays out). Instant from the keyboard; jumps under reduced motion","copy: opacity over duration.base and an enter-shift drift over duration.move","row backgrounds (current, press): a childless pseudo-element shrinks to 36px with the rail","toggle glyph flips with scaleX over duration.move","highlight: glides between rows under the pointer and with keyboard focus (duration.move easing.out-strong); hover-gated","chats: the collapsible's reveal recipe and caret","picking a link changes state instantly: no motion on navigation"]}