@conscience-technology/ovenn 0.6.7 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/assets/components/AIMessage/AIMessage.module.css +2 -1
  2. package/assets/components/Accordion/Accordion.module.css +3 -0
  3. package/assets/components/AppFrame/AppFrame.module.css +2 -0
  4. package/assets/components/AttachmentItem/AttachmentItem.module.css +9 -3
  5. package/assets/components/AttachmentThumb/AttachmentThumb.module.css +4 -0
  6. package/assets/components/Avatar/Avatar.module.css +26 -11
  7. package/assets/components/Avatar/Avatar.tsx +1 -1
  8. package/assets/components/AvatarUpload/AvatarUpload.module.css +4 -3
  9. package/assets/components/Badge/Badge.module.css +96 -70
  10. package/assets/components/Badge/Badge.tsx +33 -25
  11. package/assets/components/Breadcrumb/Breadcrumb.module.css +8 -4
  12. package/assets/components/Breadcrumb/Breadcrumb.tsx +1 -1
  13. package/assets/components/Bubble/Bubble.module.css +6 -0
  14. package/assets/components/Button/Button.module.css +6 -0
  15. package/assets/components/Calendar/Calendar.module.css +244 -0
  16. package/assets/components/Calendar/Calendar.tsx +419 -0
  17. package/assets/components/Calendar/index.ts +2 -0
  18. package/assets/components/Callout/Callout.module.css +1 -0
  19. package/assets/components/Canvas/Canvas.module.css +75 -0
  20. package/assets/components/Canvas/Canvas.tsx +699 -0
  21. package/assets/components/Canvas/alignment.ts +34 -0
  22. package/assets/components/Canvas/clipboard.ts +30 -0
  23. package/assets/components/Canvas/collision.ts +67 -0
  24. package/assets/components/Canvas/edgeOptions.ts +11 -0
  25. package/assets/components/Canvas/graph.ts +11 -0
  26. package/assets/components/Canvas/history.ts +41 -0
  27. package/assets/components/Canvas/index.ts +4 -0
  28. package/assets/components/Canvas/selection.ts +56 -0
  29. package/assets/components/Canvas/tokens.css +61 -0
  30. package/assets/components/Canvas/types.ts +27 -0
  31. package/assets/components/Canvas/useCanvasSettlement.ts +79 -0
  32. package/assets/components/CanvasEdge/CanvasEdge.module.css +62 -0
  33. package/assets/components/CanvasEdge/CanvasEdge.tsx +121 -0
  34. package/assets/components/CanvasEdge/geometry.ts +350 -0
  35. package/assets/components/CanvasEdge/index.ts +4 -0
  36. package/assets/components/CanvasEdge/interactions.ts +14 -0
  37. package/assets/components/CanvasEdge/tokens.css +29 -0
  38. package/assets/components/CanvasNode/CanvasNode.module.css +234 -30
  39. package/assets/components/CanvasNode/CanvasNode.tsx +95 -28
  40. package/assets/components/CanvasNode/index.ts +1 -1
  41. package/assets/components/CanvasNode/runningOutline.ts +59 -0
  42. package/assets/components/CanvasNode/tokens.css +76 -13
  43. package/assets/components/Card/Card.module.css +5 -0
  44. package/assets/components/Chart/Chart.module.css +278 -0
  45. package/assets/components/Chart/Chart.tsx +385 -0
  46. package/assets/components/Chart/entrance.tsx +57 -0
  47. package/assets/components/Chart/index.ts +14 -0
  48. package/assets/components/ChatInput/ChatInput.module.css +5 -0
  49. package/assets/components/Checkbox/Checkbox.module.css +39 -0
  50. package/assets/components/Checkbox/Checkbox.tsx +99 -14
  51. package/assets/components/Checkbox/index.ts +1 -1
  52. package/assets/components/CheckboxCard/CheckboxCard.module.css +1 -177
  53. package/assets/components/CheckboxCard/CheckboxCard.tsx +6 -72
  54. package/assets/components/Chip/Chip.module.css +20 -30
  55. package/assets/components/Code/Code.module.css +1 -0
  56. package/assets/components/CodeBlock/CodeBlock.module.css +7 -3
  57. package/assets/components/ColorArea/ColorArea.module.css +3 -0
  58. package/assets/components/ColorField/ColorField.module.css +6 -0
  59. package/assets/components/ColorField/ColorField.tsx +3 -1
  60. package/assets/components/ColorPicker/ColorPicker.module.css +310 -0
  61. package/assets/components/ColorPicker/ColorPicker.tsx +387 -0
  62. package/assets/components/ColorPicker/index.ts +16 -0
  63. package/assets/components/ColorSlider/ColorSlider.module.css +15 -12
  64. package/assets/components/ColorSlider/ColorSlider.tsx +3 -3
  65. package/assets/components/ColorSwatch/ColorSwatch.module.css +2 -2
  66. package/assets/components/ColorSwatchPicker/ColorSwatchPicker.module.css +4 -3
  67. package/assets/components/Combobox/Combobox.module.css +1 -1
  68. package/assets/components/Combobox/Combobox.tsx +1 -1
  69. package/assets/components/CommandPalette/CommandPalette.module.css +18 -23
  70. package/assets/components/CommandPalette/CommandPalette.tsx +7 -5
  71. package/assets/components/Comment/Comment.module.css +25 -0
  72. package/assets/components/Comment/Comment.tsx +44 -0
  73. package/assets/components/Comment/CommentComposer.module.css +26 -0
  74. package/assets/components/Comment/CommentComposer.tsx +56 -0
  75. package/assets/components/Comment/CommentEditor.module.css +8 -0
  76. package/assets/components/Comment/CommentEditor.tsx +43 -0
  77. package/assets/components/Comment/CommentMentionInput.module.css +9 -0
  78. package/assets/components/Comment/CommentMentionInput.tsx +150 -0
  79. package/assets/components/Comment/index.ts +9 -0
  80. package/assets/components/Comment/types.ts +1 -0
  81. package/assets/components/ContextMenu/ContextMenu.module.css +5 -2
  82. package/assets/components/ContextMenu/ContextMenu.tsx +5 -0
  83. package/assets/components/ControlGroup/ControlGroup.module.css +7 -1
  84. package/assets/components/DataTable/DataTable.module.css +2 -0
  85. package/assets/components/DatePicker/DatePicker.module.css +36 -3
  86. package/assets/components/DatePicker/DatePicker.tsx +11 -1
  87. package/assets/components/DatePicker/TimeSelector.tsx +1 -1
  88. package/assets/components/Disclosure/Disclosure.module.css +1 -0
  89. package/assets/components/Drawer/Drawer.module.css +11 -4
  90. package/assets/components/Drawer/Drawer.tsx +5 -1
  91. package/assets/components/DropdownMenu/DropdownMenu.tsx +5 -0
  92. package/assets/components/EventChip/EventChip.module.css +120 -53
  93. package/assets/components/EventChip/EventChip.tsx +54 -6
  94. package/assets/components/EventChip/index.ts +1 -1
  95. package/assets/components/EventListItem/EventListItem.module.css +3 -0
  96. package/assets/components/EventListItem/EventListItem.tsx +15 -8
  97. package/assets/components/FileIcon/FileIcon.module.css +2 -0
  98. package/assets/components/FileUpload/FileUpload.module.css +10 -3
  99. package/assets/components/FileUpload/FileUpload.tsx +5 -9
  100. package/assets/components/FileUpload/FileUploadItem.tsx +34 -0
  101. package/assets/components/GalleryItem/GalleryItem.module.css +16 -19
  102. package/assets/components/GeneratedImage/GeneratedImage.module.css +2 -0
  103. package/assets/components/Icon/Icon.tsx +264 -1088
  104. package/assets/components/Icon/LucideFamilyIcon.tsx +434 -0
  105. package/assets/components/Icon/MissingIcon.tsx +25 -0
  106. package/assets/components/Icon/SolarFamilyIcon.tsx +439 -0
  107. package/assets/components/Icon/catalogNames.ts +8 -0
  108. package/assets/components/Icon/context.tsx +1 -1
  109. package/assets/components/Icon/index.ts +2 -0
  110. package/assets/components/Icon/lucideCatalog.ts +11358 -0
  111. package/assets/components/Icon/phosphorCatalog.ts +3052 -0
  112. package/assets/components/Icon/solarCatalog.ts +16064 -0
  113. package/assets/components/IconButton/IconButton.module.css +3 -2
  114. package/assets/components/Input/Input.module.css +30 -12
  115. package/assets/components/Input/Input.tsx +1 -1
  116. package/assets/components/Kanban/Kanban.module.css +6 -0
  117. package/assets/components/ListItem/ListItem.module.css +9 -6
  118. package/assets/components/MenuItem/MenuItem.module.css +24 -22
  119. package/assets/components/MenuItem/MenuItem.tsx +12 -12
  120. package/assets/components/MessageActions/MessageActions.module.css +36 -0
  121. package/assets/components/MessageActions/MessageActions.tsx +53 -28
  122. package/assets/components/MessageQuote/MessageQuote.module.css +1 -0
  123. package/assets/components/MessageSources/MessageSources.module.css +2 -0
  124. package/assets/components/MessageState/MessageState.module.css +1 -1
  125. package/assets/components/MetricCard/MetricCard.module.css +96 -108
  126. package/assets/components/MetricCard/MetricCard.tsx +45 -23
  127. package/assets/components/MetricCard/tokens.css +10 -0
  128. package/assets/components/MiniCalendar/MiniCalendar.module.css +130 -0
  129. package/assets/components/MiniCalendar/MiniCalendar.tsx +161 -0
  130. package/assets/components/MiniCalendar/index.ts +2 -0
  131. package/assets/components/Modal/Modal.module.css +13 -4
  132. package/assets/components/Modal/Modal.tsx +4 -0
  133. package/assets/components/Onboarding/LayoutBuilder.tsx +12 -50
  134. package/assets/components/Onboarding/Onboarding.module.css +211 -278
  135. package/assets/components/Onboarding/OnboardingAxisPanel.tsx +81 -125
  136. package/assets/components/Onboarding/OnboardingPage.tsx +244 -467
  137. package/assets/components/Onboarding/actions.ts +5 -0
  138. package/assets/components/Onboarding/palette.css +8 -0
  139. package/assets/components/Onboarding/wizardData.ts +8 -8
  140. package/assets/components/ProgressBar/ProgressBar.module.css +8 -8
  141. package/assets/components/ProgressBar/ProgressBar.tsx +0 -5
  142. package/assets/components/ProgressBar/index.ts +0 -1
  143. package/assets/components/QuotationBar/QuotationBar.module.css +2 -0
  144. package/assets/components/Radio/Radio.module.css +2 -0
  145. package/assets/components/RadioCard/RadioCard.module.css +78 -3
  146. package/assets/components/RadioCard/RadioCard.tsx +34 -12
  147. package/assets/components/RadioCard/index.ts +1 -1
  148. package/assets/components/SegmentedChart/SegmentedChart.module.css +16 -0
  149. package/assets/components/SegmentedChart/SegmentedChart.tsx +25 -8
  150. package/assets/components/Select/Select.tsx +7 -4
  151. package/assets/components/Shortcut/Shortcut.module.css +2 -0
  152. package/assets/components/Sidebar/Sidebar.module.css +1 -0
  153. package/assets/components/Sidebar/Sidebar.tsx +2 -2
  154. package/assets/components/Skeleton/Skeleton.module.css +33 -0
  155. package/assets/components/Skeleton/Skeleton.tsx +20 -0
  156. package/assets/components/Skeleton/index.ts +2 -0
  157. package/assets/components/Skeleton/tokens.css +11 -0
  158. package/assets/components/Slider/Slider.module.css +3 -0
  159. package/assets/components/Slider/Slider.tsx +7 -2
  160. package/assets/components/Spinner/LottiePlayer.tsx +4 -4
  161. package/assets/components/Spinner/Spinner.module.css +3 -0
  162. package/assets/components/Spinner/lottieManifest.ts +3 -0
  163. package/assets/components/Stepper/Stepper.module.css +56 -8
  164. package/assets/components/Stepper/Stepper.tsx +13 -4
  165. package/assets/components/Switch/Switch.module.css +55 -42
  166. package/assets/components/Switch/Switch.tsx +6 -2
  167. package/assets/components/Switch/index.ts +1 -1
  168. package/assets/components/TabStrip/TabStrip.module.css +5 -1
  169. package/assets/components/TableCell/TableCell.module.css +8 -1
  170. package/assets/components/TableCell/TableCellBadge.tsx +7 -3
  171. package/assets/components/TableCell/TableCellImage.tsx +1 -1
  172. package/assets/components/TableCell/TableCellTag.tsx +23 -0
  173. package/assets/components/TableCell/index.ts +3 -0
  174. package/assets/components/TableHeader/TableHeader.module.css +4 -0
  175. package/assets/components/TableRow/TableRow.module.css +3 -0
  176. package/assets/components/TableRowEdit/TableRowEdit.module.css +2 -0
  177. package/assets/components/TableToolbar/TableToolbar.module.css +1 -0
  178. package/assets/components/Tabs/Tabs.module.css +22 -7
  179. package/assets/components/Tabs/Tabs.tsx +2 -1
  180. package/assets/components/Tag/Tag.module.css +101 -0
  181. package/assets/components/Tag/Tag.tsx +55 -0
  182. package/assets/components/Tag/index.ts +2 -0
  183. package/assets/components/TemplateBoundary/TemplateBoundary.tsx +22 -18
  184. package/assets/components/TemplateBoundary/types.ts +2 -0
  185. package/assets/components/Textarea/Textarea.module.css +7 -0
  186. package/assets/components/ThemeController.tsx +30 -3
  187. package/assets/components/TimePicker/TimePicker.module.css +1 -0
  188. package/assets/components/TimePicker/TimePicker.tsx +37 -16
  189. package/assets/components/TimelineView/TimelineEventBar.tsx +109 -0
  190. package/assets/components/TimelineView/TimelineView.module.css +203 -0
  191. package/assets/components/TimelineView/TimelineView.tsx +137 -0
  192. package/assets/components/TimelineView/axis.ts +62 -0
  193. package/assets/components/TimelineView/index.ts +3 -0
  194. package/assets/components/TimelineView/layout.ts +56 -0
  195. package/assets/components/TimelineView/move.ts +51 -0
  196. package/assets/components/TimelineView/useTimelineDrag.ts +215 -0
  197. package/assets/components/TimelineView/useTimelineZoom.ts +92 -0
  198. package/assets/components/Toast/Toast.module.css +2 -0
  199. package/assets/components/Toolbar/Toolbar.module.css +31 -24
  200. package/assets/components/Toolbar/Toolbar.tsx +4 -3
  201. package/assets/components/Tooltip/Tooltip.module.css +10 -0
  202. package/assets/components/Tooltip/Tooltip.tsx +17 -8
  203. package/assets/components/TopLoader/TopLoader.module.css +1 -0
  204. package/assets/components/TreeNav/TreeNav.module.css +1 -0
  205. package/assets/components/_color.ts +2 -2
  206. package/assets/components/_data.ts +33 -32
  207. package/assets/components/_utils.css +5 -0
  208. package/assets/components/axisOptions.ts +2 -0
  209. package/assets/components/component-registry.json +151 -2
  210. package/assets/components/index.ts +16 -0
  211. package/assets/components/materialScope.tsx +11 -0
  212. package/assets/components/reset.css +1 -0
  213. package/assets/components/themeBootScript.ts +3 -2
  214. package/assets/components/tokens.css +225 -71
  215. package/assets/components/useChartEntrance.ts +119 -0
  216. package/assets/prompts/ASSEMBLY.md +9 -7
  217. package/assets/prompts/CATALOG.md +18 -4
  218. package/assets/prompts/FEEDBACK_PROCESS.md +19 -0
  219. package/assets/prompts/PRINCIPLES.md +14 -0
  220. package/assets/prompts/WORKFLOW_DESIGN.md +46 -70
  221. package/assets/prompts/axes/font.md +6 -1
  222. package/assets/prompts/axes/icon.md +6 -4
  223. package/assets/prompts/axes/material.md +40 -0
  224. package/assets/prompts/axes/palette.md +2 -1
  225. package/assets/prompts/axes/shape.md +8 -0
  226. package/assets/prompts/components/attachment-item.md +2 -1
  227. package/assets/prompts/components/badge.md +32 -97
  228. package/assets/prompts/components/breadcrumb.md +1 -0
  229. package/assets/prompts/components/calendar.md +151 -0
  230. package/assets/prompts/components/canvas-edge.md +67 -0
  231. package/assets/prompts/components/canvas-node.md +25 -8
  232. package/assets/prompts/components/canvas.md +82 -0
  233. package/assets/prompts/components/card.md +10 -10
  234. package/assets/prompts/components/chart-bar.md +77 -0
  235. package/assets/prompts/components/chart-pie.md +63 -0
  236. package/assets/prompts/components/chart-radar.md +56 -0
  237. package/assets/prompts/components/chart-radial.md +56 -0
  238. package/assets/prompts/components/chart.md +129 -0
  239. package/assets/prompts/components/checkbox-card.md +26 -45
  240. package/assets/prompts/components/checkbox.md +23 -0
  241. package/assets/prompts/components/chip.md +6 -6
  242. package/assets/prompts/components/code-block.md +1 -0
  243. package/assets/prompts/components/color-picker.md +173 -0
  244. package/assets/prompts/components/color-slider.md +7 -7
  245. package/assets/prompts/components/command-palette.md +7 -6
  246. package/assets/prompts/components/comment.md +72 -0
  247. package/assets/prompts/components/context-menu.md +6 -3
  248. package/assets/prompts/components/data-table.md +9 -0
  249. package/assets/prompts/components/date-picker.md +10 -0
  250. package/assets/prompts/components/drawer.md +10 -0
  251. package/assets/prompts/components/dropdown-menu.md +3 -1
  252. package/assets/prompts/components/event-chip.md +60 -18
  253. package/assets/prompts/components/event-list-item.md +14 -10
  254. package/assets/prompts/components/file-upload.md +1 -1
  255. package/assets/prompts/components/gallery-item.md +5 -4
  256. package/assets/prompts/components/icon.md +30 -8
  257. package/assets/prompts/components/kanban.md +1 -1
  258. package/assets/prompts/components/list-item.md +11 -2
  259. package/assets/prompts/components/menu-item.md +8 -3
  260. package/assets/prompts/components/message-actions.md +9 -0
  261. package/assets/prompts/components/metric-card.md +57 -109
  262. package/assets/prompts/components/mini-calendar.md +72 -0
  263. package/assets/prompts/components/modal.md +1 -0
  264. package/assets/prompts/components/onboarding.md +11 -7
  265. package/assets/prompts/components/page-header.md +11 -2
  266. package/assets/prompts/components/progress-bar.md +12 -2
  267. package/assets/prompts/components/radio-card.md +33 -117
  268. package/assets/prompts/components/segmented-chart.md +19 -5
  269. package/assets/prompts/components/select.md +1 -0
  270. package/assets/prompts/components/sidebar.md +12 -3
  271. package/assets/prompts/components/skeleton.md +44 -0
  272. package/assets/prompts/components/stepper.md +15 -1
  273. package/assets/prompts/components/switch.md +15 -10
  274. package/assets/prompts/components/tab-strip.md +1 -0
  275. package/assets/prompts/components/table-cell.md +6 -4
  276. package/assets/prompts/components/table-row.md +12 -3
  277. package/assets/prompts/components/table-toolbar.md +9 -0
  278. package/assets/prompts/components/tabs.md +4 -2
  279. package/assets/prompts/components/tag.md +54 -0
  280. package/assets/prompts/components/time-picker.md +1 -0
  281. package/assets/prompts/components/timeline-view.md +129 -0
  282. package/assets/prompts/components/toast.md +1 -1
  283. package/assets/prompts/components/toolbar.md +17 -4
  284. package/assets/prompts/components/tooltip.md +21 -3
  285. package/assets/prompts/components/top-loader.md +1 -1
  286. package/assets/prompts/components/topbar.md +9 -0
  287. package/assets/prompts/components/tree-nav.md +1 -1
  288. package/assets/prompts/templates/ains.md +2 -1
  289. package/assets/prompts/templates/aurora.md +5 -4
  290. package/assets/prompts/templates/glass-button.md +6 -5
  291. package/assets/prompts/templates/minimal.md +8 -6
  292. package/assets/prompts/templates/workspace.md +3 -3
  293. package/assets/prompts/tokens/color.md +4 -2
  294. package/assets/prompts/tokens/material.md +51 -0
  295. package/assets/prompts/tokens/radius.md +12 -0
  296. package/assets/prompts/tokens/typography.md +24 -2
  297. package/assets/prompts/use-cases/chart-chart-area.md +1334 -0
  298. package/assets/prompts/use-cases/chart-chart-bar.md +1886 -0
  299. package/assets/prompts/use-cases/chart-chart-pie.md +1031 -0
  300. package/assets/prompts/use-cases/chart-chart-radar.md +785 -0
  301. package/assets/prompts/use-cases/chart-chart-radial.md +988 -0
  302. package/assets/prompts/use-cases/chart-segmented-chart.md +262 -0
  303. package/assets/prompts/use-cases/data-comment.md +360 -0
  304. package/assets/prompts/use-cases/data-data-table.md +249 -0
  305. package/assets/prompts/use-cases/data-list-item.md +1056 -0
  306. package/assets/prompts/use-cases/data-metric-card.md +673 -0
  307. package/assets/prompts/use-cases/data-table-row.md +966 -0
  308. package/assets/prompts/use-cases/data-table-toolbar.md +481 -0
  309. package/assets/prompts/use-cases/feedback-drawer.md +1163 -0
  310. package/assets/prompts/use-cases/feedback-progress-bar.md +427 -0
  311. package/assets/prompts/use-cases/general-toolbar.md +854 -0
  312. package/assets/prompts/use-cases/general-tooltip.md +652 -0
  313. package/assets/prompts/use-cases/input-checkbox.md +443 -0
  314. package/assets/prompts/use-cases/structure-card.md +603 -0
  315. package/assets/prompts/use-cases/structure-page-header.md +755 -0
  316. package/assets/prompts/use-cases/structure-sidebar.md +1132 -0
  317. package/assets/prompts/use-cases/structure-topbar.md +1200 -0
  318. package/assets/public/ovenn-wordmark.svg +19 -0
  319. package/package.json +6 -2
  320. package/src/commands/info.js +1 -1
@@ -0,0 +1,1132 @@
1
+ # Sidebar 사용 사례 소스
2
+
3
+ <!-- Generated by scripts/build-use-cases.mjs. Edit original TSX/CSS, then regenerate. -->
4
+
5
+ ### 사례 목록
6
+
7
+ - AI chat — conversations
8
+ - Workspace — teams and projects
9
+ - File cabinet — folder hierarchy
10
+
11
+ 문서: /en/components/structure/sidebar#use-cases
12
+
13
+ 문서 페이지에서 렌더하는 사례입니다.
14
+
15
+ ### 조회 방법
16
+
17
+ get_guide(topic="use-cases/structure-sidebar", sections=["사례 목록", "파일 목록"])로 먼저 확인하고, 필요한 Section 또는 Source 파일 헤딩만 sections로 조회하세요. 전체 문서는 문서 페이지의 다른 예제도 포함합니다. 공용 컴포넌트 계약은 get_component로 읽고, 예제의 docs 전용 셸·locale·import 경로는 대상 프로젝트에 맞게 조합하세요. 이 연결은 디자인 승인이나 기능 검증을 뜻하지 않습니다.
18
+
19
+ ### 파일 목록
20
+
21
+ - `web/app/[lang]/components/structure/sidebar/_strings.tsx`
22
+ - `web/app/[lang]/components/structure/sidebar/page.module.css`
23
+ - `web/app/[lang]/components/structure/sidebar/page.tsx`
24
+ - `web/app/[lang]/components/structure/sidebar/SidebarUseCases.tsx`
25
+
26
+ ### Section: web/app/[lang]/components/structure/sidebar/SidebarUseCases.tsx#use-cases
27
+
28
+ ```tsx
29
+ <section id="use-cases">
30
+ <h2>{t.useCases.heading}</h2>
31
+ <h3 className={styles.useCaseTitle}>{t.useCases.chat}</h3>
32
+ <ExampleBlock align="column"><ChatExample t={strings.en} c={c} /></ExampleBlock>
33
+ <h3 className={styles.useCaseTitle}>{t.useCases.workspace}</h3>
34
+ <ExampleBlock align="column"><WorkspaceExample t={strings.en} c={c} /></ExampleBlock>
35
+ <h3 className={styles.useCaseTitle}>{t.useCases.files}</h3>
36
+ <ExampleBlock align="column"><FilesExample t={strings.en} c={c} /></ExampleBlock>
37
+ </section>
38
+ ```
39
+
40
+ ### Source: web/app/[lang]/components/structure/sidebar/_strings.tsx
41
+
42
+ ````tsx
43
+ import { Code } from "@/components/Code";
44
+ import type { ReactNode } from "react";
45
+
46
+ type Strings = {
47
+ title: string;
48
+ lead: ReactNode;
49
+ usage: { heading: string; desc: ReactNode };
50
+ playgroundDesc: string;
51
+ withSections: { heading: string; desc: ReactNode };
52
+ withRail: { heading: string; desc: ReactNode };
53
+ collapsed: { heading: string; desc: ReactNode };
54
+ useCases: { heading: string; chat: string; workspace: string; files: string };
55
+ api: {
56
+ heading: string;
57
+ desc: ReactNode;
58
+ columns: { prop: string; type: string; default: string; desc: string };
59
+ rows: {
60
+ collapsed: string;
61
+ fade: string;
62
+ itemIcon: string;
63
+ itemLabel: string;
64
+ itemActive: string;
65
+ itemTrailing: string;
66
+ itemShortcut: string;
67
+ itemHasSubmenu: string;
68
+ };
69
+ };
70
+ templateBanner: { eyebrow: string; title: string; sub: string };
71
+ profile: { name: string; emailSub: string; railSub: string };
72
+ };
73
+
74
+ const en: Strings = {
75
+ useCases: { heading: "Use Cases", chat: "AI chat — conversations", workspace: "Workspace — teams and projects", files: "File cabinet — folder hierarchy" },
76
+ title: "Sidebar",
77
+ lead: (
78
+ <>
79
+ The left nav for page-to-page movement. Items reuse <Code>MenuItem</Code>, and{" "}
80
+ <Code>collapsed</Code> switches to icon-only mode.
81
+ </>
82
+ ),
83
+ usage: {
84
+ heading: "Usage",
85
+ desc: (
86
+ <>
87
+ Assemble <Code>Sidebar.Header</Code>, <Code>Sidebar.Body</Code>, and
88
+ <Code>Sidebar.Footer</Code>. The consumer supplies padding.
89
+ </>
90
+ ),
91
+ },
92
+ playgroundDesc:
93
+ "Toggle props and slots to compare. Turning on rail switches to a two-pane shell with an activity rail on the left.",
94
+ withSections: {
95
+ heading: "With Sections",
96
+ desc: (
97
+ <>
98
+ Group with <Code>Sidebar.Section</Code> and divide with <Code>Sidebar.Separator</Code>.
99
+ The Section header uses a low tone and reads as a natural group label.
100
+ </>
101
+ ),
102
+ },
103
+ withRail: {
104
+ heading: "With Rail",
105
+ desc: (
106
+ <>
107
+ A VS Code or Linear-style two-pane shell. <Code>Sidebar.Rail</Code> supplies the vertical
108
+ icon track and <Code>Sidebar.Main</Code> holds Header, Body, and Footer. Rail items switch
109
+ to icon-only plus Tooltip automatically.
110
+ </>
111
+ ),
112
+ },
113
+ collapsed: {
114
+ heading: "Collapsed",
115
+ desc: (
116
+ <>
117
+ <Code>collapsed</Code> flips to icon-only mode. Labels hide, the width shrinks, and Item
118
+ goes into Tooltip mode. The outer shell handles the width transition.
119
+ </>
120
+ ),
121
+ },
122
+ api: {
123
+ heading: "API Reference",
124
+ desc: (
125
+ <>
126
+ Sidebar follows a compound pattern. Subcomponents are <Code>Rail</Code>, <Code>Main</Code>,
127
+ <Code>Header</Code>, <Code>Body</Code>, <Code>Footer</Code>, <Code>Section</Code>,
128
+ <Code>Separator</Code>, <Code>Item</Code>, <Code>Brand</Code>, <Code>Profile</Code>.
129
+ </>
130
+ ),
131
+ columns: { prop: "Prop", type: "Type", default: "Default", desc: "Description" },
132
+ rows: {
133
+ collapsed:
134
+ "Icon-only mode. Labels hide, the width shrinks, and Item switches to Tooltip mode.",
135
+ fade: "Scroll fade mask at the top or bottom of Body.",
136
+ itemIcon: "Icon to the left of the label.",
137
+ itemLabel: "The item label. Reused as the Tooltip when collapsed.",
138
+ itemActive: "Marks the current selection.",
139
+ itemTrailing: "Content on the right of the label, such as Badge or meta text.",
140
+ itemShortcut: "A shortcut key inserted into trailing automatically.",
141
+ itemHasSubmenu: "Inserts a caret into trailing automatically.",
142
+ },
143
+ },
144
+ templateBanner: {
145
+ eyebrow: "Templates",
146
+ title: "There are sidebar templates too",
147
+ sub: "Copy-paste starters to begin instantly",
148
+ },
149
+ profile: {
150
+ name: "Alex Lee",
151
+ emailSub: "alex@example.com",
152
+ railSub: "Two-pane shell demo",
153
+ },
154
+ };
155
+
156
+ const ko: Strings = {
157
+ useCases: { heading: "사용 사례", chat: "AI 챗 — 대화 이력", workspace: "워크스페이스 — 팀과 프로젝트", files: "파일함 — 폴더 계층" },
158
+ title: "Sidebar",
159
+ lead: (
160
+ <>
161
+ 페이지 간 이동을 담당하는 좌측 네비게이션. 항목은 <Code>MenuItem</Code>을 재사용하고
162
+ <Code>collapsed</Code>로 icon-only 축소 상태에 들어갈 수 있습니다.
163
+ </>
164
+ ),
165
+ usage: {
166
+ heading: "Usage",
167
+ desc: (
168
+ <>
169
+ <Code>Sidebar.Header</Code>, <Code>Sidebar.Body</Code>, <Code>Sidebar.Footer</Code> 세
170
+ 구역을 조립합니다. padding은 소비처가 공급합니다.
171
+ </>
172
+ ),
173
+ },
174
+ playgroundDesc:
175
+ "prop·슬롯 조합을 토글해 비교해보세요. rail을 켜면 좌측 활동 바가 붙은 2단 쉘로 전환.",
176
+ withSections: {
177
+ heading: "With Sections",
178
+ desc: (
179
+ <>
180
+ <Code>Sidebar.Section</Code>으로 묶고 <Code>Sidebar.Separator</Code>로 그룹을 나눕니다.
181
+ Section 헤더는 색상 톤이 낮아 자연스러운 그룹 라벨 역할.
182
+ </>
183
+ ),
184
+ },
185
+ withRail: {
186
+ heading: "With Rail",
187
+ desc: (
188
+ <>
189
+ VS Code나 Linear 스타일 2단 쉘. <Code>Sidebar.Rail</Code>이 세로 아이콘 트랙을 공급하고
190
+ <Code>Sidebar.Main</Code>이 Header·Body·Footer를 담습니다. Rail 안 Item은 icon-only + Tooltip
191
+ 모드로 자동 전환.
192
+ </>
193
+ ),
194
+ },
195
+ collapsed: {
196
+ heading: "Collapsed",
197
+ desc: (
198
+ <>
199
+ <Code>collapsed</Code> prop으로 icon-only 축소 상태. 라벨 숨기고 폭이 좁아지며 Item은
200
+ 자동으로 Tooltip 모드. 바깥 Shell이 애니메이션으로 폭을 전환합니다.
201
+ </>
202
+ ),
203
+ },
204
+ api: {
205
+ heading: "API Reference",
206
+ desc: (
207
+ <>
208
+ Sidebar는 compound 패턴. 서브컴포넌트는 <Code>Rail</Code>, <Code>Main</Code>,
209
+ <Code>Header</Code>, <Code>Body</Code>, <Code>Footer</Code>, <Code>Section</Code>,
210
+ <Code>Separator</Code>, <Code>Item</Code>, <Code>Brand</Code>, <Code>Profile</Code>.
211
+ </>
212
+ ),
213
+ columns: { prop: "Prop", type: "Type", default: "Default", desc: "Description" },
214
+ rows: {
215
+ collapsed: "icon-only 축소 상태. 라벨 숨기고 폭 좁아지며 Item 자동 Tooltip 모드.",
216
+ fade: "Body 상단·하단 스크롤 fade mask.",
217
+ itemIcon: "라벨 왼쪽 아이콘.",
218
+ itemLabel: "항목 라벨. collapsed일 때 Tooltip으로 사용.",
219
+ itemActive: "현재 선택 상태.",
220
+ itemTrailing: "라벨 오른쪽 요소. Badge·메타 텍스트 등.",
221
+ itemShortcut: "trailing에 자동 삽입되는 단축키.",
222
+ itemHasSubmenu: "trailing에 caret 자동 삽입.",
223
+ },
224
+ },
225
+ templateBanner: {
226
+ eyebrow: "Templates",
227
+ title: "사이드바 템플릿도 있어요",
228
+ sub: "복붙해서 바로 시작할 수 있는 스타터들",
229
+ },
230
+ profile: {
231
+ name: "희영",
232
+ emailSub: "conscience.partners@gmail.com",
233
+ railSub: "2단 쉘 데모",
234
+ },
235
+ };
236
+
237
+ export const strings = { en, ko };
238
+ export type { Strings };
239
+ ````
240
+
241
+ ### Source: web/app/[lang]/components/structure/sidebar/page.module.css
242
+
243
+ ````css
244
+ /* Sidebar 데모 로컬 레이아웃. */
245
+
246
+ /* Sidebar 데모 stage — 가운데 정렬 + 최소 높이. */
247
+ .stage {
248
+ display: flex;
249
+ justify-content: center;
250
+ min-height: calc(var(--size-24) * 7);
251
+ }
252
+
253
+ /* Sidebar 벤더는 좌우/상하 padding을 공급하지 않음. 데모에서 교과서 공급 패턴. */
254
+ .header {
255
+ padding: var(--space-3) var(--space-3) var(--space-1);
256
+ }
257
+ .headerToggle {
258
+ margin-inline-start: auto;
259
+ }
260
+ .bodyInner {
261
+ display: flex;
262
+ flex-direction: column;
263
+ gap: var(--space-2);
264
+ padding: var(--space-2) var(--space-3) var(--space-3);
265
+ }
266
+ .footer {
267
+ padding: var(--space-2) var(--space-3) var(--space-3);
268
+ }
269
+
270
+ /* collapsed일 땐 Header/Footer 좌우 padding을 0으로 — symbol 축을 사이드바 외곽으로 통일. */
271
+ .sidebar[data-collapsed] .header,
272
+ .sidebar[data-collapsed] .bodyInner,
273
+ .sidebar[data-collapsed] .footer {
274
+ padding-inline: 0;
275
+ }
276
+ /* collapsed 아이콘 시각적 확대 — Phosphor viewBox의 geometry attribute가 CSS width 안 먹을 때 보완. */
277
+ .sidebar[data-collapsed] [role="menuitem"] svg {
278
+ transform: scale(1.15);
279
+ transform-origin: center;
280
+ }
281
+
282
+ /* Brand 모노그램 — collapsed일 때 가운데가 자연스럽도록 완전 대칭 svg. */
283
+ .brandLogo {
284
+ width: var(--size-5);
285
+ height: var(--size-5);
286
+ color: var(--fg);
287
+ }
288
+
289
+ /* 부품 미리보기: 고정 높이 AppFrame 안에서 Body만 스크롤한다. */
290
+ .useCaseStage {
291
+ width: 100%;
292
+ display: flex;
293
+ justify-content: center;
294
+ min-width: 0;
295
+ scroll-margin-block: var(--space-20);
296
+ }
297
+ .useCaseFrame {
298
+ --fg-subtle: var(--fg-muted);
299
+ --sidebar-example-width: calc(var(--size-20) * 4);
300
+ --sidebar-example-height: calc(var(--size-24) * 5);
301
+ width: 100%;
302
+ max-width: var(--sidebar-example-width);
303
+ height: var(--sidebar-example-height);
304
+ border: 1px solid var(--border);
305
+ corner-shape: var(--corner-shape);
306
+ border-radius: var(--radius-lg);
307
+ }
308
+ /* 모바일에서 Sidebar를 숨기는 앱 기본값 대신 부품 자체를 보여준다. */
309
+ .useCaseFrame[data-layout][data-has-sidebar] {
310
+ grid-template-columns: minmax(0, 1fr);
311
+ grid-template-rows: minmax(0, 1fr);
312
+ grid-template-areas: "sidebar";
313
+ }
314
+ .useCaseFrame[data-layout] :global([data-slot="app-frame-sidebar"]) {
315
+ display: flex;
316
+ border: 0;
317
+ }
318
+ .useCaseFrame .useCaseSidebar {
319
+ width: 100%;
320
+ min-width: 0;
321
+ }
322
+ .useCaseHeader,
323
+ .useCaseBody,
324
+ .useCaseFooter { padding: var(--space-3); min-width: 0; width: 100%; }
325
+ .useCaseFooter :global([data-slot="avatar"]) { background: var(--bg-muted); color: var(--fg-strong); }
326
+ .useCaseHeader { display: flex; flex-direction: column; gap: var(--space-3); }
327
+ .useCaseBody { display: flex; flex-direction: column; gap: var(--space-3); }
328
+ .useCaseNavLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
329
+ .workspaceTrigger { justify-content: flex-start; }
330
+ .workspaceTrigger > :global([data-slot="button-label"]) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: start; }
331
+ .profileDetails { display: grid; gap: var(--space-2); margin: 0; }
332
+ .profileDetails dt { color: var(--fg-muted); font-size: var(--text-sm); }
333
+ .profileDetails dd { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
334
+ .useCaseTitle { margin-top: var(--space-6); margin-bottom: var(--space-3); font-size: var(--text-base); font-weight: var(--font-weight-medium); }
335
+
336
+ /* AI 챗: 좁고 긴 이력 패널. 작성과 검색은 상단, 날짜별 목록만 스크롤. */
337
+ .chatLayout {
338
+ --sidebar-example-height: calc(var(--size-20) * 7);
339
+ }
340
+ .chatBrandRow { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
341
+ .chatLayout .useCaseHeader { padding: var(--space-4); }
342
+ .chatLayout :global([data-slot="input-root"]) { --border: var(--border-strong); }
343
+ .chatLayout .useCaseBody { gap: var(--space-4); padding-block-start: 0; }
344
+ .chatDateHeader { font-weight: var(--font-weight-regular); }
345
+
346
+ /* 워크스페이스: 넓고 낮은 탐색 패널. 팀 전환과 프로젝트별 하위 경로. */
347
+ .workspaceLayout {
348
+ --sidebar-example-width: calc(var(--size-24) * 4);
349
+ }
350
+ .workspaceLayout .useCaseHeader { padding: var(--space-4) var(--space-3); }
351
+ .workspaceLayout .useCaseBody { gap: var(--space-5); }
352
+ .workspaceLayout .workspaceTrigger { padding-inline: var(--space-2); }
353
+ .workspaceMark { display: inline-flex; align-items: center; justify-content: center; width: var(--size-8); height: var(--size-8); }
354
+ .workspaceMark > svg { width: var(--size-6); height: var(--size-6); }
355
+ .workspaceTree { display: flex; flex-direction: column; gap: var(--space-0_5); }
356
+ .workspaceProject { display: flex; flex-direction: column; gap: var(--space-0_5); }
357
+ .workspaceProjectPanel { padding-inline-start: var(--space-5); }
358
+ .favoriteLink { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
359
+ .favoriteEmpty { margin: 0; padding: var(--space-2); color: var(--fg-muted); font-size: var(--text-sm); }
360
+ .workspaceLayout .useCaseFooter { padding-block: var(--space-2); }
361
+
362
+ /* 파일함: 행과 독립된 직선으로 폴더 계층을 연결한다. 선택 표시가 아니다. */
363
+ .fileLayout {
364
+ --sidebar-example-width: calc(var(--size-16) * 5.5);
365
+ --sidebar-example-height: calc(var(--size-20) * 7);
366
+ }
367
+ .fileLayout .useCaseFooter { padding-block: var(--space-2); }
368
+ ````
369
+
370
+ ### Source: web/app/[lang]/components/structure/sidebar/page.tsx
371
+
372
+ ````tsx
373
+ "use client";
374
+
375
+ import { useState } from "react";
376
+ import { LocaleLink as Link } from "../../../../_components/LocaleLink";
377
+ import { usePathname } from "next/navigation";
378
+ import { Sidebar } from "@/components/Sidebar";
379
+ import { Icon } from "@/components/Icon";
380
+ import { Code } from "@/components/Code";
381
+ import { Badge } from "@/components/Badge";
382
+ import { ExampleBlock } from "../../../../_components/ExampleBlock";
383
+ import { Playground } from "../../../../_components/Playground";
384
+ import { DocsTable } from "../../../../_components/DocsTable";
385
+ import { localeFromPathname } from "../../../../_dict";
386
+ import { strings, type Strings } from "./_strings";
387
+ import styles from "./page.module.css";
388
+ import { SidebarUseCases } from "./SidebarUseCases";
389
+
390
+ const FADE_OPTIONS = ["none", "top", "bottom", "both"] as const;
391
+ type FadeOption = (typeof FADE_OPTIONS)[number];
392
+
393
+ export default function SidebarPage() {
394
+ const pathname = usePathname() ?? "/";
395
+ const t = strings[localeFromPathname(pathname)];
396
+ const [collapsed, setCollapsed] = useState(false);
397
+ const [active, setActive] = useState("home");
398
+ const [fade, setFade] = useState<FadeOption>("none");
399
+ const [showRail, setShowRail] = useState(false);
400
+ const [showProfile, setShowProfile] = useState(true);
401
+ const [showSeparator, setShowSeparator] = useState(true);
402
+ const [showSecondSection, setShowSecondSection] = useState(true);
403
+ const [railActive, setRailActive] = useState<"inbox" | "projects" | "chat">("projects");
404
+
405
+ return (
406
+ <>
407
+ <h1 className="page-title">{t.title}</h1>
408
+ <p className="page-lead">{t.lead}</p>
409
+
410
+ <section id="usage" className="section-first">
411
+ <h2>{t.usage.heading}</h2>
412
+ <p className="desc">{t.usage.desc}</p>
413
+ <ExampleBlock
414
+ align="column"
415
+ code={`import { Sidebar } from "@/components/Sidebar";
416
+
417
+ <Sidebar>
418
+ <Sidebar.Header>
419
+ <Sidebar.Brand symbol={<Logo />} wordmark="Acme" />
420
+ </Sidebar.Header>
421
+ <Sidebar.Body>
422
+ <Sidebar.Section title="Workspace">
423
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" active />
424
+ <Sidebar.Item icon={<Icon name="calendar" />} label="Calendar" />
425
+ </Sidebar.Section>
426
+ </Sidebar.Body>
427
+ <Sidebar.Footer>
428
+ <Sidebar.Profile name="${strings.en.profile.name}" sub="${strings.en.profile.emailSub}" />
429
+ </Sidebar.Footer>
430
+ </Sidebar>`}
431
+ >
432
+ <div className={styles.stage}>
433
+ <Sidebar className={styles.sidebar}>
434
+ <Sidebar.Header className={styles.header}>
435
+ <Sidebar.Brand symbol={<BrandLogo />} wordmark="Acme" />
436
+ </Sidebar.Header>
437
+ <Sidebar.Body>
438
+ <div className={styles.bodyInner}>
439
+ <Sidebar.Section title="Workspace">
440
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" active />
441
+ <Sidebar.Item icon={<Icon name="calendar" />} label="Calendar" />
442
+ </Sidebar.Section>
443
+ </div>
444
+ </Sidebar.Body>
445
+ <Sidebar.Footer className={styles.footer}>
446
+ <Sidebar.Profile name={strings.en.profile.name} sub={strings.en.profile.emailSub} />
447
+ </Sidebar.Footer>
448
+ </Sidebar>
449
+ </div>
450
+ </ExampleBlock>
451
+ </section>
452
+
453
+ <Playground
454
+ desc={t.playgroundDesc}
455
+ axes={[
456
+ {
457
+ label: "body fade",
458
+ value: fade,
459
+ onChange: (v) => setFade(v as FadeOption),
460
+ options: FADE_OPTIONS,
461
+ },
462
+ ]}
463
+ toggles={[
464
+ { label: "rail", value: showRail, onChange: setShowRail },
465
+ { label: "collapsed", value: collapsed, onChange: setCollapsed },
466
+ { label: "second section", value: showSecondSection, onChange: setShowSecondSection },
467
+ { label: "separator", value: showSeparator, onChange: setShowSeparator },
468
+ { label: "profile footer", value: showProfile, onChange: setShowProfile },
469
+ ]}
470
+ >
471
+ <div className={styles.stage}>
472
+ <Sidebar
473
+ collapsed={collapsed}
474
+ onCollapsedChange={setCollapsed}
475
+ className={styles.sidebar}
476
+ >
477
+ {showRail && (
478
+ <Sidebar.Rail>
479
+ <Sidebar.Brand symbol={<BrandLogo />} />
480
+
481
+ <Sidebar.RailGroup role="tablist" aria-orientation="vertical">
482
+ <Sidebar.Item
483
+ icon={<Icon name="envelope" />}
484
+ label="Inbox"
485
+ active={railActive === "inbox"}
486
+ onClick={() => setRailActive("inbox")}
487
+ />
488
+ <Sidebar.Item
489
+ icon={<Icon name="folder" />}
490
+ label="Projects"
491
+ active={railActive === "projects"}
492
+ onClick={() => setRailActive("projects")}
493
+ />
494
+ <Sidebar.Item
495
+ icon={<Icon name="chat-circle" />}
496
+ label="Chat"
497
+ active={railActive === "chat"}
498
+ onClick={() => setRailActive("chat")}
499
+ />
500
+ </Sidebar.RailGroup>
501
+
502
+ <Sidebar.RailFooter>
503
+ <Sidebar.Item icon={<Icon name="gear" />} label="Settings" />
504
+ </Sidebar.RailFooter>
505
+ </Sidebar.Rail>
506
+ )}
507
+
508
+ {showRail ? (
509
+ <Sidebar.Main>
510
+ <PlaygroundInner
511
+ t={strings.en}
512
+ fade={fade}
513
+ active={active}
514
+ setActive={setActive}
515
+ showSeparator={showSeparator}
516
+ showSecondSection={showSecondSection}
517
+ showProfile={showProfile}
518
+ />
519
+ </Sidebar.Main>
520
+ ) : (
521
+ <PlaygroundInner
522
+ t={strings.en}
523
+ fade={fade}
524
+ active={active}
525
+ setActive={setActive}
526
+ showSeparator={showSeparator}
527
+ showSecondSection={showSecondSection}
528
+ showProfile={showProfile}
529
+ />
530
+ )}
531
+ </Sidebar>
532
+ </div>
533
+ </Playground>
534
+
535
+ <section id="with-sections">
536
+ <h2>{t.withSections.heading}</h2>
537
+ <p className="desc">{t.withSections.desc}</p>
538
+ <ExampleBlock
539
+ align="column"
540
+ code={`<Sidebar.Section title="Workspace">
541
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" />
542
+ <Sidebar.Item icon={<Icon name="stack" />} label="Projects" />
543
+ </Sidebar.Section>
544
+ <Sidebar.Separator />
545
+ <Sidebar.Section title="Settings">
546
+ <Sidebar.Item icon={<Icon name="user" />} label="Account" />
547
+ </Sidebar.Section>`}
548
+ >
549
+ <div className={styles.stage}>
550
+ <Sidebar className={styles.sidebar}>
551
+ <Sidebar.Body>
552
+ <div className={styles.bodyInner}>
553
+ <Sidebar.Section title="Workspace">
554
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" />
555
+ <Sidebar.Item icon={<Icon name="stack" />} label="Projects" />
556
+ </Sidebar.Section>
557
+ <Sidebar.Separator />
558
+ <Sidebar.Section title="Settings">
559
+ <Sidebar.Item icon={<Icon name="user" />} label="Account" />
560
+ <Sidebar.Item icon={<Icon name="gear" />} label="Preferences" />
561
+ </Sidebar.Section>
562
+ </div>
563
+ </Sidebar.Body>
564
+ </Sidebar>
565
+ </div>
566
+ </ExampleBlock>
567
+ </section>
568
+
569
+ <section id="with-rail">
570
+ <h2>{t.withRail.heading}</h2>
571
+ <p className="desc">{t.withRail.desc}</p>
572
+ <ExampleBlock
573
+ align="column"
574
+ code={`<Sidebar>
575
+ <Sidebar.Rail>
576
+ <Sidebar.Brand symbol={<Icon name="stack" />} />
577
+ <Sidebar.RailGroup>
578
+ <Sidebar.Item icon={<Icon name="envelope" />} label="Inbox" />
579
+ <Sidebar.Item icon={<Icon name="folder" />} label="Projects" active />
580
+ <Sidebar.Item icon={<Icon name="chat-circle" />} label="Chat" />
581
+ </Sidebar.RailGroup>
582
+ </Sidebar.Rail>
583
+
584
+ <Sidebar.Main>
585
+ <Sidebar.Header>...</Sidebar.Header>
586
+ <Sidebar.Body>...</Sidebar.Body>
587
+ <Sidebar.Footer>...</Sidebar.Footer>
588
+ </Sidebar.Main>
589
+ </Sidebar>`}
590
+ >
591
+ <div className={styles.stage}>
592
+ <SidebarRailExample t={strings.en} />
593
+ </div>
594
+ </ExampleBlock>
595
+ </section>
596
+
597
+ <section id="collapsed">
598
+ <h2>{t.collapsed.heading}</h2>
599
+ <p className="desc">{t.collapsed.desc}</p>
600
+ <ExampleBlock
601
+ align="column"
602
+ code={`<Sidebar collapsed>
603
+ <Sidebar.Header>
604
+ <Sidebar.Brand symbol={<Logo />} />
605
+ </Sidebar.Header>
606
+ <Sidebar.Body>
607
+ <Sidebar.Section>
608
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" />
609
+ </Sidebar.Section>
610
+ </Sidebar.Body>
611
+ </Sidebar>`}
612
+ >
613
+ <div className={styles.stage}>
614
+ <Sidebar collapsed className={styles.sidebar}>
615
+ <Sidebar.Header className={styles.header}>
616
+ <Sidebar.Brand symbol={<BrandLogo />} />
617
+ </Sidebar.Header>
618
+ <Sidebar.Body>
619
+ <div className={styles.bodyInner}>
620
+ <Sidebar.Section>
621
+ <Sidebar.Item icon={<Icon name="house" />} label="Home" active />
622
+ <Sidebar.Item icon={<Icon name="calendar" />} label="Calendar" />
623
+ <Sidebar.Item icon={<Icon name="stack" />} label="Projects" />
624
+ <Sidebar.Item icon={<Icon name="gear" />} label="Preferences" />
625
+ </Sidebar.Section>
626
+ </div>
627
+ </Sidebar.Body>
628
+ </Sidebar>
629
+ </div>
630
+ </ExampleBlock>
631
+ </section>
632
+
633
+ <SidebarUseCases key={localeFromPathname(pathname)} t={t} locale={localeFromPathname(pathname)} />
634
+
635
+ <section id="api">
636
+ <h2>{t.api.heading}</h2>
637
+ <p className="desc">{t.api.desc}</p>
638
+ <DocsTable
639
+ columns={[
640
+ { key: "prop", label: t.api.columns.prop, width: 160 },
641
+ { key: "type", label: t.api.columns.type, flex: true, minWidth: 200 },
642
+ { key: "default", label: t.api.columns.default, width: 120 },
643
+ { key: "desc", label: t.api.columns.desc, flex: true, minWidth: 240 },
644
+ ]}
645
+ rows={[
646
+ {
647
+ prop: <Code>collapsed</Code>,
648
+ type: <Code>boolean</Code>,
649
+ default: <Code>false</Code>,
650
+ desc: t.api.rows.collapsed,
651
+ },
652
+ {
653
+ prop: <Code>Body.fade</Code>,
654
+ type: <Code>&apos;none&apos; | &apos;top&apos; | &apos;bottom&apos; | &apos;both&apos;</Code>,
655
+ default: <Code>&apos;none&apos;</Code>,
656
+ desc: t.api.rows.fade,
657
+ },
658
+ {
659
+ prop: <Code>Item.icon</Code>,
660
+ type: <Code>ReactNode</Code>,
661
+ default: "",
662
+ desc: t.api.rows.itemIcon,
663
+ },
664
+ {
665
+ prop: <Code>Item.label</Code>,
666
+ type: <Code>string</Code>,
667
+ default: "",
668
+ desc: t.api.rows.itemLabel,
669
+ },
670
+ {
671
+ prop: <Code>Item.active</Code>,
672
+ type: <Code>boolean</Code>,
673
+ default: <Code>false</Code>,
674
+ desc: t.api.rows.itemActive,
675
+ },
676
+ {
677
+ prop: <Code>Item.trailing</Code>,
678
+ type: <Code>ReactNode</Code>,
679
+ default: "",
680
+ desc: t.api.rows.itemTrailing,
681
+ },
682
+ {
683
+ prop: <Code>Item.shortcut</Code>,
684
+ type: <Code>string</Code>,
685
+ default: "",
686
+ desc: t.api.rows.itemShortcut,
687
+ },
688
+ {
689
+ prop: <Code>Item.hasSubmenu</Code>,
690
+ type: <Code>boolean</Code>,
691
+ default: <Code>false</Code>,
692
+ desc: t.api.rows.itemHasSubmenu,
693
+ },
694
+ ]}
695
+ />
696
+ </section>
697
+
698
+ <Link href="/templates/sidebar" className="template-banner">
699
+ <span className="template-banner-thumb" aria-hidden="true">
700
+ <Icon name="placeholder" size={20} />
701
+ </span>
702
+ <span className="template-banner-body">
703
+ <span className="template-banner-eyebrow">{t.templateBanner.eyebrow}</span>
704
+ <strong className="template-banner-title">{t.templateBanner.title}</strong>
705
+ <span className="template-banner-sub">{t.templateBanner.sub}</span>
706
+ </span>
707
+ <span className="template-banner-cta" aria-hidden="true">
708
+ <Icon name="caret-right" size={16} />
709
+ </span>
710
+ </Link>
711
+ </>
712
+ );
713
+ }
714
+
715
+ function PlaygroundInner({
716
+ t,
717
+ fade,
718
+ active,
719
+ setActive,
720
+ showSeparator,
721
+ showSecondSection,
722
+ showProfile,
723
+ }: {
724
+ t: Strings;
725
+ fade: FadeOption;
726
+ active: string;
727
+ setActive: (v: string) => void;
728
+ showSeparator: boolean;
729
+ showSecondSection: boolean;
730
+ showProfile: boolean;
731
+ }) {
732
+ return (
733
+ <>
734
+ <Sidebar.Header className={styles.header}>
735
+ <Sidebar.Brand symbol={<BrandLogo />} wordmark="Acme" toggleOnHover />
736
+ <Sidebar.CollapseToggle className={styles.headerToggle} />
737
+ </Sidebar.Header>
738
+
739
+ <Sidebar.Body fade={fade}>
740
+ <div className={styles.bodyInner}>
741
+ <Sidebar.Section title="Workspace">
742
+ <Sidebar.Item
743
+ icon={<Icon name="house" />}
744
+ label="Home"
745
+ active={active === "home"}
746
+ onClick={() => setActive("home")}
747
+ />
748
+ <Sidebar.Item
749
+ icon={<Icon name="calendar" />}
750
+ label="Calendar"
751
+ active={active === "calendar"}
752
+ onClick={() => setActive("calendar")}
753
+ />
754
+ <Sidebar.Item
755
+ icon={<Icon name="stack" />}
756
+ label="Projects"
757
+ active={active === "projects"}
758
+ trailing={<Badge size="sm">12</Badge>}
759
+ onClick={() => setActive("projects")}
760
+ />
761
+ <Sidebar.Item
762
+ icon={<Icon name="search" />}
763
+ label="Search"
764
+ active={active === "search"}
765
+ shortcut="⌘K"
766
+ onClick={() => setActive("search")}
767
+ />
768
+ </Sidebar.Section>
769
+
770
+ {showSeparator && showSecondSection && <Sidebar.Separator />}
771
+
772
+ {showSecondSection && (
773
+ <Sidebar.Section title="Settings">
774
+ <Sidebar.Item
775
+ icon={<Icon name="user" />}
776
+ label="Account"
777
+ active={active === "account"}
778
+ onClick={() => setActive("account")}
779
+ />
780
+ <Sidebar.Item
781
+ icon={<Icon name="gear" />}
782
+ label="Preferences"
783
+ active={active === "preferences"}
784
+ hasSubmenu
785
+ onClick={() => setActive("preferences")}
786
+ />
787
+ </Sidebar.Section>
788
+ )}
789
+ </div>
790
+ </Sidebar.Body>
791
+
792
+ {showProfile && (
793
+ <Sidebar.Footer className={styles.footer}>
794
+ <Sidebar.Profile name={t.profile.name} sub="conscience.partners@gmail.com" />
795
+ </Sidebar.Footer>
796
+ )}
797
+ </>
798
+ );
799
+ }
800
+
801
+ function BrandLogo() {
802
+ return (
803
+ <svg
804
+ className={styles.brandLogo}
805
+ viewBox="0 0 20 20"
806
+ aria-hidden="true"
807
+ focusable="false"
808
+ >
809
+ <rect x="0" y="0" width="20" height="20" rx="3" fill="currentColor" />
810
+ <text
811
+ x="10"
812
+ y="10"
813
+ textAnchor="middle"
814
+ dominantBaseline="central"
815
+ fontSize="11"
816
+ fontWeight="600"
817
+ fill="var(--bg)"
818
+ fontFamily="var(--font-normal)"
819
+ >
820
+ A
821
+ </text>
822
+ </svg>
823
+ );
824
+ }
825
+
826
+ function SidebarRailExample({ t }: { t: Strings }) {
827
+ const [rail, setRail] = useState<"inbox" | "projects" | "chat">("projects");
828
+ const [active, setActive] = useState("board");
829
+ return (
830
+ <Sidebar className={styles.sidebar}>
831
+ <Sidebar.Rail>
832
+ <Sidebar.Brand symbol={<Icon name="stack" />} />
833
+
834
+ <Sidebar.RailGroup role="tablist" aria-orientation="vertical">
835
+ <Sidebar.Item
836
+ icon={<Icon name="envelope" />}
837
+ label="Inbox"
838
+ active={rail === "inbox"}
839
+ onClick={() => setRail("inbox")}
840
+ />
841
+ <Sidebar.Item
842
+ icon={<Icon name="folder" />}
843
+ label="Projects"
844
+ active={rail === "projects"}
845
+ onClick={() => setRail("projects")}
846
+ />
847
+ <Sidebar.Item
848
+ icon={<Icon name="chat-circle" />}
849
+ label="Chat"
850
+ active={rail === "chat"}
851
+ onClick={() => setRail("chat")}
852
+ />
853
+ </Sidebar.RailGroup>
854
+
855
+ <Sidebar.RailFooter>
856
+ <Sidebar.Item icon={<Icon name="gear" />} label="Settings" />
857
+ </Sidebar.RailFooter>
858
+ </Sidebar.Rail>
859
+
860
+ <Sidebar.Main>
861
+ <Sidebar.Header className={styles.header}>
862
+ <Sidebar.Brand symbol={<Icon name="folder" />} wordmark="Projects" />
863
+ </Sidebar.Header>
864
+ <Sidebar.Body>
865
+ <div className={styles.bodyInner}>
866
+ <Sidebar.Section title="View">
867
+ <Sidebar.Item
868
+ icon={<Icon name="columns" />}
869
+ label="Board"
870
+ active={active === "board"}
871
+ onClick={() => setActive("board")}
872
+ />
873
+ <Sidebar.Item
874
+ icon={<Icon name="list" />}
875
+ label="List"
876
+ active={active === "list"}
877
+ onClick={() => setActive("list")}
878
+ />
879
+ <Sidebar.Item
880
+ icon={<Icon name="line-segments" />}
881
+ label="Timeline"
882
+ active={active === "timeline"}
883
+ onClick={() => setActive("timeline")}
884
+ />
885
+ </Sidebar.Section>
886
+ </div>
887
+ </Sidebar.Body>
888
+ <Sidebar.Footer className={styles.footer}>
889
+ <Sidebar.Profile name={t.profile.name} sub={t.profile.railSub} />
890
+ </Sidebar.Footer>
891
+ </Sidebar.Main>
892
+ </Sidebar>
893
+ );
894
+ }
895
+ ````
896
+
897
+ ### Source: web/app/[lang]/components/structure/sidebar/SidebarUseCases.tsx
898
+
899
+ ````tsx
900
+ "use client";
901
+
902
+ import { useRef, useState, type ReactNode } from "react";
903
+ import { AppFrame } from "@/components/AppFrame";
904
+ import { Sidebar } from "@/components/Sidebar";
905
+ import { MenuItem } from "@/components/MenuItem";
906
+ import { FileIcon } from "@/components/FileIcon";
907
+ import { TreeNav, type TreeNavItem } from "@/components/TreeNav";
908
+ import { Icon } from "@/components/Icon";
909
+ import { IconButton } from "@/components/IconButton";
910
+ import { Button } from "@/components/Button";
911
+ import { Input } from "@/components/Input";
912
+ import { DropdownMenu } from "@/components/DropdownMenu";
913
+ import { EmptyState } from "@/components/EmptyState";
914
+ import { Modal } from "@/components/Modal";
915
+ import { ExampleBlock } from "../../../../_components/ExampleBlock";
916
+ import { strings, type Strings } from "./_strings";
917
+ import styles from "./page.module.css";
918
+
919
+ const copy = {
920
+ en: {
921
+ fileCabinet: "Files", sharedFiles: "Shared files", archive: "Archive", designFolder: "Design", researchFolder: "Research", brief: "Design brief.pdf", wireframes: "Wireframes.fig", interview: "Interview notes.md", findings: "Findings.pdf", contract: "Contract.pdf", invoice: "Invoice.xlsx",
922
+ overview: "Overview", tasks: "Tasks", files: "Files", today: "Today", yesterday: "Yesterday", older: "December 12", research: "Research board", assets: "Brand assets", documentation: "API documentation", release: "Release notes", newChat: "New conversation", search: "Search conversations", recent: "Recent", untitled: "Untitled conversation", noChats: "No conversations found", profile: "Account", name: "Name", email: "Email",
923
+ favorites: "Favorites", removeFavorite: "Remove from favorites", noFavorites: "No favorites", projects: "Projects", switchWorkspace: "Switch workspace", design: "Design team", engineering: "Engineering", website: "Website redesign", system: "Design system", mobile: "Mobile app",
924
+ chats: ["Product launch plan", "Website copy review", "Design system roadmap", "Customer interview questions", "Release notes", "Navigation ideas", "Accessibility review", "Sprint planning", "Onboarding flow", "API documentation", "Research summary", "Team retrospective"],
925
+ },
926
+ ko: {
927
+ fileCabinet: "파일함", sharedFiles: "공유 파일", archive: "보관함", designFolder: "디자인", researchFolder: "리서치", brief: "디자인 브리프.pdf", wireframes: "와이어프레임.fig", interview: "인터뷰 기록.md", findings: "리서치 결과.pdf", contract: "계약서.pdf", invoice: "청구서.xlsx",
928
+ overview: "개요", tasks: "작업", files: "파일", today: "오늘", yesterday: "어제", older: "12월 12일", research: "리서치 보드", assets: "브랜드 에셋", documentation: "API 문서", release: "릴리스 노트", newChat: "새 대화", search: "대화 검색", recent: "최근 대화", untitled: "새로운 대화", noChats: "검색된 대화가 없습니다", profile: "계정", name: "이름", email: "이메일",
929
+ favorites: "즐겨찾기", removeFavorite: "즐겨찾기 해제", noFavorites: "즐겨찾기가 없습니다", projects: "프로젝트", switchWorkspace: "워크스페이스 전환", design: "디자인팀", engineering: "개발팀", website: "웹사이트 개편", system: "디자인 시스템", mobile: "모바일 앱",
930
+ chats: ["제품 출시 계획", "웹사이트 문구 검토", "디자인 시스템 로드맵", "고객 인터뷰 질문", "릴리스 노트", "탐색 구조 아이디어", "접근성 검토", "스프린트 계획", "온보딩 흐름", "API 문서", "리서치 요약", "팀 회고"],
931
+ },
932
+ };
933
+ type Copy = typeof copy.en;
934
+
935
+ function DemoFrame({ id, label, layout, children }: { id: string; label: string; layout: "chat" | "workspace" | "files"; children: ReactNode }) {
936
+ const layoutClass = { chat: styles.chatLayout, workspace: styles.workspaceLayout, files: styles.fileLayout }[layout];
937
+ return (
938
+ <div className={styles.useCaseStage} id={id} role="region" aria-label={label}>
939
+ <AppFrame variant="flat" className={`${styles.useCaseFrame} ${layoutClass}`}>
940
+ <AppFrame.Sidebar><Sidebar className={styles.useCaseSidebar} aria-label={label}>{children}</Sidebar></AppFrame.Sidebar>
941
+ </AppFrame>
942
+ </div>
943
+ );
944
+ }
945
+
946
+ function NavItem({ label, icon, active, onSelect, target, tabIndex = 0 }: { label: string; icon?: string; active: boolean; onSelect: () => void; target: string; tabIndex?: number }) {
947
+ return (
948
+ <MenuItem asChild role="link" size="sm" tabIndex={tabIndex} active={active} leadingActions={icon ? [<Icon key="icon" name={icon} />] : undefined}>
949
+ <a href={`#${target}`} tabIndex={tabIndex} aria-current={active ? "page" : undefined} onClick={onSelect}>
950
+ <span className={styles.useCaseNavLabel}>{label}</span>
951
+ </a>
952
+ </MenuItem>
953
+ );
954
+ }
955
+
956
+ function ProfileFooter({ t, c, compact = false }: { t: Strings; c: Copy; compact?: boolean }) {
957
+ const [open, setOpen] = useState(false);
958
+ const opener = useRef<HTMLElement | null>(null);
959
+ return (
960
+ <Sidebar.Footer>
961
+ <div className={styles.useCaseFooter}>
962
+ <Sidebar.Profile name={t.profile.name} sub={compact ? undefined : t.profile.emailSub} avatar={{ initials: t.profile.name.slice(0, 2), "aria-label": t.profile.name }} onClick={(event) => { opener.current = event.currentTarget; setOpen(true); }} />
963
+ </div>
964
+ <Modal title={c.profile} size="sm" backdrop="scrim" open={open} onOpenChange={(next) => { setOpen(next); if (!next) requestAnimationFrame(() => opener.current?.focus()); }}>
965
+ <dl className={styles.profileDetails}><dt>{c.name}</dt><dd>{t.profile.name}</dd><dt>{c.email}</dt><dd>{t.profile.emailSub}</dd></dl>
966
+ </Modal>
967
+ </Sidebar.Footer>
968
+ );
969
+ }
970
+
971
+ function ChatExample({ t, c }: { t: Strings; c: Copy }) {
972
+ const [days] = useState(() => {
973
+ const today = new Intl.DateTimeFormat("en-CA", { timeZone: "Asia/Seoul", year: "numeric", month: "2-digit", day: "2-digit" }).format(new Date());
974
+ const yesterday = new Date(Date.parse(`${today}T12:00:00Z`) - 86400000).toISOString().slice(0, 10);
975
+ return { today, yesterday, older: `${Number(today.slice(0, 4)) - 1}-12-12` };
976
+ });
977
+ const [chats, setChats] = useState(() => c.chats.map((title, id) => ({ id, title, day: id < 3 ? days.today : id < 7 ? days.yesterday : days.older })));
978
+ const [selected, setSelected] = useState(0);
979
+ const [query, setQuery] = useState("");
980
+ const [openGroups, setOpenGroups] = useState<Record<string, boolean>>({ [days.today]: true, [days.yesterday]: false, [days.older]: false });
981
+ const nextId = useRef(chats.length);
982
+ const history = useRef<HTMLDivElement>(null);
983
+ const groups = [{ day: days.today, label: c.today }, { day: days.yesterday, label: c.yesterday }, { day: days.older, label: c.older }]
984
+ .map(group => ({ ...group, chats: chats.filter(chat => chat.day === group.day && chat.title.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase())) }))
985
+ .filter(group => group.chats.length);
986
+
987
+ function createConversation() {
988
+ const id = nextId.current++;
989
+ setChats(previous => [{ id, title: `${c.untitled} ${id - c.chats.length + 1}`, day: days.today }, ...previous]);
990
+ setSelected(id);
991
+ setQuery("");
992
+ setOpenGroups(previous => ({ ...previous, [days.today]: true }));
993
+ requestAnimationFrame(() => {
994
+ const body = history.current?.closest('[data-sidebar-slot="body"]');
995
+ if (body) body.scrollTop = 0;
996
+ });
997
+ }
998
+
999
+ return (
1000
+ <DemoFrame id="sidebar-chat" label={t.useCases.chat} layout="chat">
1001
+ <Sidebar.Header>
1002
+ <div className={styles.useCaseHeader}>
1003
+ <div className={styles.chatBrandRow}>
1004
+ <Sidebar.Brand symbol={<Icon name="chat-circle" />} wordmark="Ovenn AI" />
1005
+ <IconButton size="sm" variant="ghost" icon={<Icon name="plus" />} aria-label={c.newChat} onClick={createConversation} />
1006
+ </div>
1007
+ <Input size="md" variant="outline" leftIcon={<Icon name="search" />} aria-label={c.search} placeholder={c.search} value={query} onChange={event => {
1008
+ const value = event.target.value;
1009
+ setQuery(value);
1010
+ if (value.trim()) setOpenGroups({ [days.today]: true, [days.yesterday]: true, [days.older]: true });
1011
+ }} />
1012
+ </div>
1013
+ </Sidebar.Header>
1014
+ <Sidebar.Body>
1015
+ <div role="group" ref={history} className={styles.useCaseBody} aria-label={c.recent}>
1016
+ {groups.length ? groups.map(group => (
1017
+ <MenuItem.Section key={group.day} title={<time dateTime={group.day}>{group.label}</time>} open={!!openGroups[group.day]} onOpenChange={open => setOpenGroups(previous => ({ ...previous, [group.day]: open }))} headerClassName={styles.chatDateHeader}>
1018
+ {group.chats.map(chat => <NavItem key={chat.id} label={chat.title} active={selected === chat.id} onSelect={() => setSelected(chat.id)} target="sidebar-chat" tabIndex={openGroups[group.day] ? 0 : -1} />)}
1019
+ </MenuItem.Section>
1020
+ )) : <EmptyState size="sm" title={c.noChats} />}
1021
+ </div>
1022
+ </Sidebar.Body>
1023
+ <ProfileFooter t={t} c={c} />
1024
+ </DemoFrame>
1025
+ );
1026
+ }
1027
+
1028
+ function WorkspaceExample({ t, c }: { t: Strings; c: Copy }) {
1029
+ const [workspace, setWorkspace] = useState("design");
1030
+ const [active, setActive] = useState("website-overview");
1031
+ const [openProjects, setOpenProjects] = useState<Record<string, boolean>>({ website: true });
1032
+ const [removedFavorites, setRemovedFavorites] = useState<Record<string, string[]>>({});
1033
+ const favoriteList = useRef<HTMLDivElement>(null);
1034
+ const favoriteHeading = useRef<HTMLSpanElement>(null);
1035
+ const workspaces = [{ id: "design", label: c.design, icon: "palette" }, { id: "engineering", label: c.engineering, icon: "code" }];
1036
+ const current = workspaces.find(item => item.id === workspace)!;
1037
+ const projects = workspace === "design" ? [{ id: "website", label: c.website }, { id: "system", label: c.system }] : [{ id: "mobile", label: c.mobile }, { id: "system", label: c.system }];
1038
+ const favorites = (workspace === "design" ? [{ id: "research", label: c.research }, { id: "assets", label: c.assets }] : [{ id: "documentation", label: c.documentation }, { id: "release", label: c.release }])
1039
+ .filter(item => !removedFavorites[workspace]?.includes(item.id));
1040
+
1041
+ function removeFavorite(id: string) {
1042
+ const index = favorites.findIndex(item => item.id === id);
1043
+ const next = favorites[index + 1] ?? favorites[index - 1];
1044
+ setRemovedFavorites(previous => ({ ...previous, [workspace]: [...(previous[workspace] ?? []), id] }));
1045
+ requestAnimationFrame(() => {
1046
+ const target = next ? favoriteList.current?.querySelector<HTMLElement>(`[data-favorite-id="${next.id}"] a`) : favoriteHeading.current;
1047
+ target?.focus({ preventScroll: true });
1048
+ });
1049
+ }
1050
+ return (
1051
+ <DemoFrame id="sidebar-workspace" label={t.useCases.workspace} layout="workspace">
1052
+ <Sidebar.Header><div className={styles.useCaseHeader}>
1053
+ <DropdownMenu><DropdownMenu.Trigger asChild><Button variant="ghost" fullWidth leftIcon={<span className={styles.workspaceMark}><Icon name={current.icon} /></span>} rightIcon={<Icon name="caret-up-down" />} aria-label={`${c.switchWorkspace}: ${current.label}`} className={styles.workspaceTrigger}>{current.label}</Button></DropdownMenu.Trigger>
1054
+ <DropdownMenu.Content align="start"><DropdownMenu.Label>{c.switchWorkspace}</DropdownMenu.Label>{workspaces.map(item => <DropdownMenu.Item key={item.id} leadingActions={[<Icon key="icon" name={item.icon} />]} trailingActions={workspace === item.id ? [<Icon key="check" name="check" />] : undefined} onSelect={() => { setWorkspace(item.id); const first = item.id === "design" ? "website" : "mobile"; setActive(`${first}-overview`); setOpenProjects({ [first]: true }); }}>{item.label}</DropdownMenu.Item>)}</DropdownMenu.Content>
1055
+ </DropdownMenu>
1056
+ </div></Sidebar.Header>
1057
+ <Sidebar.Body><div role="group" className={styles.useCaseBody} aria-label={current.label}>
1058
+ <div ref={favoriteList}>
1059
+ <MenuItem.Section title={<span ref={favoriteHeading} tabIndex={-1}>{c.favorites}</span>} collapsible={false}>
1060
+ {favorites.length ? favorites.map(item => (
1061
+ <MenuItem key={item.id} role="group" tabIndex={-1} size="sm" active={active === item.id} data-favorite-id={item.id} onClick={() => setActive(item.id)} leadingActions={[
1062
+ <IconButton key="favorite" size="sm" variant="ghost" icon={<Icon name="star" weight="fill" />} aria-label={`${c.removeFavorite}: ${item.label}`} onClick={event => { event.stopPropagation(); removeFavorite(item.id); }} />,
1063
+ ]}>
1064
+ <a className={styles.favoriteLink} href="#sidebar-workspace" aria-current={active === item.id ? "page" : undefined} onClick={event => { event.stopPropagation(); setActive(item.id); }}>{item.label}</a>
1065
+ </MenuItem>
1066
+ )) : <p className={styles.favoriteEmpty} role="status">{c.noFavorites}</p>}
1067
+ </MenuItem.Section>
1068
+ </div>
1069
+ <MenuItem.Section title={c.projects} collapsible={false}>
1070
+ <div className={styles.workspaceTree}>
1071
+ {projects.map(project => (
1072
+ <div key={`${workspace}-${project.id}`} className={styles.workspaceProject}>
1073
+ <MenuItem role="button" size="sm" truncateTooltip aria-expanded={!!openProjects[project.id]} aria-controls={`sidebar-project-${workspace}-${project.id}`} active={!openProjects[project.id] && active.startsWith(`${project.id}-`)} leadingActions={[<Icon key="folder" name="folder" />]} trailingActions={[<Icon key="caret" name={openProjects[project.id] ? "caret-down" : "caret-right"} />]} onClick={() => setOpenProjects(previous => ({ ...previous, [project.id]: !previous[project.id] }))}>
1074
+ {project.label}
1075
+ </MenuItem>
1076
+ <div id={`sidebar-project-${workspace}-${project.id}`} className={styles.workspaceProjectPanel} hidden={!openProjects[project.id]}>
1077
+ {[{ id: "overview", label: c.overview }, { id: "tasks", label: c.tasks }, { id: "files", label: c.files }].map(page => (
1078
+ <NavItem key={page.id} label={page.label} active={active === `${project.id}-${page.id}`} onSelect={() => setActive(`${project.id}-${page.id}`)} target="sidebar-workspace" tabIndex={openProjects[project.id] ? 0 : -1} />
1079
+ ))}
1080
+ </div>
1081
+ </div>
1082
+ ))}
1083
+ </div>
1084
+ </MenuItem.Section>
1085
+ </div></Sidebar.Body>
1086
+ <ProfileFooter t={t} c={c} compact />
1087
+ </DemoFrame>
1088
+ );
1089
+ }
1090
+
1091
+ function FilesExample({ t, c }: { t: Strings; c: Copy }) {
1092
+ const nodes: TreeNavItem[] = [
1093
+ { id: "projects", label: c.projects, children: [
1094
+ { id: "website", label: c.website, children: [
1095
+ { id: "design", label: c.designFolder, children: [{ id: "wireframes", label: c.wireframes }, { id: "brief", label: c.brief }] },
1096
+ { id: "research", label: c.researchFolder, children: [{ id: "interview", label: c.interview }, { id: "findings", label: c.findings }] },
1097
+ ] },
1098
+ ] },
1099
+ { id: "shared", label: c.sharedFiles, children: [{ id: "contract", label: c.contract }, { id: "invoice", label: c.invoice }] },
1100
+ { id: "archive", label: c.archive, children: [{ id: "release", label: `${c.release}.md` }] },
1101
+ { id: "readme", label: "README.md" },
1102
+ ];
1103
+
1104
+ return (
1105
+ <DemoFrame id="sidebar-files" label={t.useCases.files} layout="files">
1106
+ <Sidebar.Header><div className={styles.useCaseHeader}><Sidebar.Brand symbol={<Icon name="folder-open" />} wordmark={c.fileCabinet} /></div></Sidebar.Header>
1107
+ <Sidebar.Body><div className={styles.useCaseBody}>
1108
+ <TreeNav aria-label={c.fileCabinet} items={nodes.map(function withLinks(node): TreeNavItem {
1109
+ return node.children ? { ...node, children: node.children.map(withLinks) } : { ...node, href: "#sidebar-files" };
1110
+ })} defaultExpandedIds={["projects", "website", "design"]} defaultSelectedId="wireframes"
1111
+ renderIcon={(item, { branch, expanded }) => <FileIcon type={branch ? "folder" : item.id === "wireframes" || item.id === "invoice" ? "file" : "document"} open={expanded} size="sm" />} />
1112
+ </div></Sidebar.Body>
1113
+ <ProfileFooter t={t} c={c} compact />
1114
+ </DemoFrame>
1115
+ );
1116
+ }
1117
+
1118
+ export function SidebarUseCases({ t, locale }: { t: Strings; locale: "en" | "ko" }) {
1119
+ const c = copy.en;
1120
+ return (
1121
+ <section id="use-cases">
1122
+ <h2>{t.useCases.heading}</h2>
1123
+ <h3 className={styles.useCaseTitle}>{t.useCases.chat}</h3>
1124
+ <ExampleBlock align="column"><ChatExample t={strings.en} c={c} /></ExampleBlock>
1125
+ <h3 className={styles.useCaseTitle}>{t.useCases.workspace}</h3>
1126
+ <ExampleBlock align="column"><WorkspaceExample t={strings.en} c={c} /></ExampleBlock>
1127
+ <h3 className={styles.useCaseTitle}>{t.useCases.files}</h3>
1128
+ <ExampleBlock align="column"><FilesExample t={strings.en} c={c} /></ExampleBlock>
1129
+ </section>
1130
+ );
1131
+ }
1132
+ ````