@asanchez-sa/abby 0.0.0-stage → 0.1.1

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 (391) hide show
  1. package/README.md +245 -2
  2. package/dist/_virtual/_rolldown/runtime.js +26 -0
  3. package/dist/agents/approvals.d.ts +46 -0
  4. package/dist/agents/approvals.js +58 -0
  5. package/dist/agents/changes.d.ts +21 -0
  6. package/dist/agents/changes.js +21 -0
  7. package/dist/agents/hooks.d.ts +20 -0
  8. package/dist/agents/hooks.js +58 -0
  9. package/dist/agents/index.d.ts +11 -0
  10. package/dist/agents/index.js +9 -0
  11. package/dist/agents/run-tool.d.ts +44 -0
  12. package/dist/agents/run-tool.js +79 -0
  13. package/dist/agents/ui-sdk.d.ts +5 -0
  14. package/dist/agents/ui-sdk.js +3 -0
  15. package/dist/behaviors/canvas/index.d.ts +2 -0
  16. package/dist/behaviors/canvas/index.js +1 -0
  17. package/dist/behaviors/canvas/ui-sdk.d.ts +2 -0
  18. package/dist/behaviors/canvas/ui-sdk.js +1 -0
  19. package/dist/behaviors/drag-and-drop/index.d.ts +2 -0
  20. package/dist/behaviors/drag-and-drop/index.js +1 -0
  21. package/dist/behaviors/drag-and-drop/ui-sdk.d.ts +2 -0
  22. package/dist/behaviors/drag-and-drop/ui-sdk.js +1 -0
  23. package/dist/behaviors/dragging/index.d.ts +2 -0
  24. package/dist/behaviors/dragging/index.js +1 -0
  25. package/dist/behaviors/dragging/ui-sdk.d.ts +2 -0
  26. package/dist/behaviors/dragging/ui-sdk.js +1 -0
  27. package/dist/behaviors/focus/index.d.ts +2 -0
  28. package/dist/behaviors/focus/index.js +1 -0
  29. package/dist/behaviors/focus/ui-sdk.d.ts +2 -0
  30. package/dist/behaviors/focus/ui-sdk.js +1 -0
  31. package/dist/behaviors/lists/index.d.ts +3 -0
  32. package/dist/behaviors/lists/index.js +3 -0
  33. package/dist/behaviors/lists/ui-sdk.d.ts +3 -0
  34. package/dist/behaviors/lists/ui-sdk.js +3 -0
  35. package/dist/behaviors/popups/index.d.ts +3 -0
  36. package/dist/behaviors/popups/index.js +3 -0
  37. package/dist/behaviors/popups/ui-sdk.d.ts +3 -0
  38. package/dist/behaviors/popups/ui-sdk.js +3 -0
  39. package/dist/behaviors/preferences/index.d.ts +3 -0
  40. package/dist/behaviors/preferences/index.js +3 -0
  41. package/dist/behaviors/preferences/ui-sdk.d.ts +3 -0
  42. package/dist/behaviors/preferences/ui-sdk.js +3 -0
  43. package/dist/behaviors/selection/index.d.ts +3 -0
  44. package/dist/behaviors/selection/index.js +3 -0
  45. package/dist/behaviors/selection/indicator.d.ts +13 -0
  46. package/dist/behaviors/selection/indicator.js +20 -0
  47. package/dist/behaviors/selection/ui-sdk.d.ts +2 -0
  48. package/dist/behaviors/selection/ui-sdk.js +1 -0
  49. package/dist/behaviors/transitions/index.d.ts +3 -0
  50. package/dist/behaviors/transitions/index.js +3 -0
  51. package/dist/behaviors/transitions/ui-sdk.d.ts +3 -0
  52. package/dist/behaviors/transitions/ui-sdk.js +3 -0
  53. package/dist/behaviors/trees/index.d.ts +2 -0
  54. package/dist/behaviors/trees/index.js +1 -0
  55. package/dist/behaviors/trees/ui-sdk.d.ts +2 -0
  56. package/dist/behaviors/trees/ui-sdk.js +1 -0
  57. package/dist/components/accordion/accordion.d.ts +13 -0
  58. package/dist/components/accordion/accordion.js +165 -0
  59. package/dist/components/alert/alert.d.ts +13 -0
  60. package/dist/components/alert/alert.js +131 -0
  61. package/dist/components/alert-dialog/alert-dialog.d.ts +15 -0
  62. package/dist/components/alert-dialog/alert-dialog.js +257 -0
  63. package/dist/components/aspect-ratio/aspect-ratio.d.ts +7 -0
  64. package/dist/components/aspect-ratio/aspect-ratio.js +57 -0
  65. package/dist/components/attachment/attachment.d.ts +48 -0
  66. package/dist/components/attachment/attachment.js +372 -0
  67. package/dist/components/autocomplete/autocomplete.d.ts +32 -0
  68. package/dist/components/autocomplete/autocomplete.js +466 -0
  69. package/dist/components/avatar/avatar.d.ts +6 -0
  70. package/dist/components/avatar/avatar.js +100 -0
  71. package/dist/components/avatar-group/avatar-group.d.ts +9 -0
  72. package/dist/components/avatar-group/avatar-group.js +75 -0
  73. package/dist/components/badge/badge.d.ts +15 -0
  74. package/dist/components/badge/badge.js +31 -0
  75. package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
  76. package/dist/components/breadcrumb/breadcrumb.js +279 -0
  77. package/dist/components/bubble/bubble.d.ts +26 -0
  78. package/dist/components/bubble/bubble.js +173 -0
  79. package/dist/components/button/button.d.ts +18 -0
  80. package/dist/components/button/button.js +91 -0
  81. package/dist/components/button-group/button-group.d.ts +15 -0
  82. package/dist/components/button-group/button-group.js +71 -0
  83. package/dist/components/calendar/calendar.d.ts +29 -0
  84. package/dist/components/calendar/calendar.js +453 -0
  85. package/dist/components/card/card.d.ts +14 -0
  86. package/dist/components/card/card.js +213 -0
  87. package/dist/components/carousel/carousel.d.ts +16 -0
  88. package/dist/components/carousel/carousel.js +364 -0
  89. package/dist/components/chain-of-thought/chain-of-thought.d.ts +72 -0
  90. package/dist/components/chain-of-thought/chain-of-thought.js +491 -0
  91. package/dist/components/chat/chat.d.ts +48 -0
  92. package/dist/components/chat/chat.js +207 -0
  93. package/dist/components/checkbox/checkbox.d.ts +10 -0
  94. package/dist/components/checkbox/checkbox.js +118 -0
  95. package/dist/components/checkpoint/checkpoint.d.ts +24 -0
  96. package/dist/components/checkpoint/checkpoint.js +178 -0
  97. package/dist/components/choice-cards/choice-cards.d.ts +38 -0
  98. package/dist/components/choice-cards/choice-cards.js +255 -0
  99. package/dist/components/code-block/code-block.d.ts +58 -0
  100. package/dist/components/code-block/code-block.js +506 -0
  101. package/dist/components/code-block/highlighter.js +96 -0
  102. package/dist/components/code-block/use-highlighted-code.d.ts +11 -0
  103. package/dist/components/code-block/use-highlighted-code.js +54 -0
  104. package/dist/components/collapsible/collapsible.d.ts +10 -0
  105. package/dist/components/collapsible/collapsible.js +92 -0
  106. package/dist/components/color-picker/color-picker.d.ts +17 -0
  107. package/dist/components/color-picker/color-picker.js +395 -0
  108. package/dist/components/combobox/combobox.d.ts +54 -0
  109. package/dist/components/combobox/combobox.js +683 -0
  110. package/dist/components/command/command.d.ts +23 -0
  111. package/dist/components/command/command.js +373 -0
  112. package/dist/components/command-dock/command-dock.d.ts +118 -0
  113. package/dist/components/command-dock/command-dock.js +944 -0
  114. package/dist/components/confirmation/confirmation.d.ts +58 -0
  115. package/dist/components/confirmation/confirmation.js +181 -0
  116. package/dist/components/context/context.d.ts +82 -0
  117. package/dist/components/context/context.js +490 -0
  118. package/dist/components/date-input/date-input.d.ts +16 -0
  119. package/dist/components/date-input/date-input.js +89 -0
  120. package/dist/components/date-picker/date-picker.d.ts +28 -0
  121. package/dist/components/date-picker/date-picker.js +361 -0
  122. package/dist/components/dialog/dialog.d.ts +14 -0
  123. package/dist/components/dialog/dialog.js +261 -0
  124. package/dist/components/drawer/drawer.d.ts +16 -0
  125. package/dist/components/drawer/drawer.js +309 -0
  126. package/dist/components/empty/empty.d.ts +18 -0
  127. package/dist/components/empty/empty.js +192 -0
  128. package/dist/components/field/field.d.ts +15 -0
  129. package/dist/components/field/field.js +261 -0
  130. package/dist/components/file-input/file-input.d.ts +12 -0
  131. package/dist/components/file-input/file-input.js +216 -0
  132. package/dist/components/file-tree/file-tree.d.ts +45 -0
  133. package/dist/components/file-tree/file-tree.js +283 -0
  134. package/dist/components/hover-card/hover-card.d.ts +10 -0
  135. package/dist/components/hover-card/hover-card.js +118 -0
  136. package/dist/components/icon/icon.d.ts +14 -0
  137. package/dist/components/icon/icon.js +60 -0
  138. package/dist/components/image-cropper/image-cropper.d.ts +15 -0
  139. package/dist/components/image-cropper/image-cropper.js +334 -0
  140. package/dist/components/inline-citation/inline-citation.d.ts +46 -0
  141. package/dist/components/inline-citation/inline-citation.js +269 -0
  142. package/dist/components/input/input.d.ts +9 -0
  143. package/dist/components/input/input.js +43 -0
  144. package/dist/components/input-group/input-group.d.ts +42 -0
  145. package/dist/components/input-group/input-group.js +192 -0
  146. package/dist/components/item/item.d.ts +32 -0
  147. package/dist/components/item/item.js +394 -0
  148. package/dist/components/kbd/kbd.d.ts +9 -0
  149. package/dist/components/kbd/kbd.js +75 -0
  150. package/dist/components/label/label.d.ts +6 -0
  151. package/dist/components/label/label.js +40 -0
  152. package/dist/components/link/link.d.ts +21 -0
  153. package/dist/components/link/link.js +126 -0
  154. package/dist/components/listbox/listbox.d.ts +20 -0
  155. package/dist/components/listbox/listbox.js +199 -0
  156. package/dist/components/marker/marker.d.ts +11 -0
  157. package/dist/components/marker/marker.js +88 -0
  158. package/dist/components/menu/menu.d.ts +38 -0
  159. package/dist/components/menu/menu.js +553 -0
  160. package/dist/components/menubar/menubar.d.ts +9 -0
  161. package/dist/components/menubar/menubar.js +47 -0
  162. package/dist/components/message/message.d.ts +44 -0
  163. package/dist/components/message/message.js +328 -0
  164. package/dist/components/message-scroller/message-scroller.d.ts +111 -0
  165. package/dist/components/message-scroller/message-scroller.js +957 -0
  166. package/dist/components/meter/meter.d.ts +8 -0
  167. package/dist/components/meter/meter.js +162 -0
  168. package/dist/components/model-selector/model-selector.d.ts +155 -0
  169. package/dist/components/model-selector/model-selector.js +905 -0
  170. package/dist/components/native-select/native-select.d.ts +27 -0
  171. package/dist/components/native-select/native-select.js +226 -0
  172. package/dist/components/navigation-menu/navigation-menu.d.ts +29 -0
  173. package/dist/components/navigation-menu/navigation-menu.js +318 -0
  174. package/dist/components/not-label.js +9 -0
  175. package/dist/components/note-editor/blocks.d.ts +22 -0
  176. package/dist/components/note-editor/blocks.js +245 -0
  177. package/dist/components/note-editor/diff.d.ts +19 -0
  178. package/dist/components/note-editor/diff.js +64 -0
  179. package/dist/components/note-editor/editor.js +249 -0
  180. package/dist/components/note-editor/note-editor.d.ts +109 -0
  181. package/dist/components/note-editor/note-editor.js +954 -0
  182. package/dist/components/note-editor/parts/comments.d.ts +24 -0
  183. package/dist/components/note-editor/parts/comments.js +337 -0
  184. package/dist/components/note-editor/parts/header.d.ts +25 -0
  185. package/dist/components/note-editor/parts/header.js +263 -0
  186. package/dist/components/note-editor/parts/history.d.ts +56 -0
  187. package/dist/components/note-editor/parts/history.js +409 -0
  188. package/dist/components/note-editor/parts/presence.d.ts +31 -0
  189. package/dist/components/note-editor/parts/presence.js +140 -0
  190. package/dist/components/note-editor/parts/suggestions.d.ts +45 -0
  191. package/dist/components/note-editor/parts/suggestions.js +316 -0
  192. package/dist/components/note-editor/parts/toolbar.d.ts +38 -0
  193. package/dist/components/note-editor/parts/toolbar.js +687 -0
  194. package/dist/components/note-editor/people.d.ts +84 -0
  195. package/dist/components/note-editor/people.js +276 -0
  196. package/dist/components/note-editor/person.d.ts +11 -0
  197. package/dist/components/note-editor/person.js +15 -0
  198. package/dist/components/note-place/note-place.d.ts +42 -0
  199. package/dist/components/note-place/note-place.js +256 -0
  200. package/dist/components/note-status/note-status.d.ts +59 -0
  201. package/dist/components/note-status/note-status.js +380 -0
  202. package/dist/components/number-input/number-input.d.ts +12 -0
  203. package/dist/components/number-input/number-input.js +252 -0
  204. package/dist/components/otp-input/otp-input.d.ts +12 -0
  205. package/dist/components/otp-input/otp-input.js +136 -0
  206. package/dist/components/pagination/pagination.d.ts +23 -0
  207. package/dist/components/pagination/pagination.js +218 -0
  208. package/dist/components/password-input/password-input.d.ts +11 -0
  209. package/dist/components/password-input/password-input.js +117 -0
  210. package/dist/components/plan/plan.d.ts +51 -0
  211. package/dist/components/plan/plan.js +320 -0
  212. package/dist/components/popover/popover.d.ts +16 -0
  213. package/dist/components/popover/popover.js +268 -0
  214. package/dist/components/preferences/preferences.d.ts +5 -0
  215. package/dist/components/preferences/preferences.js +18 -0
  216. package/dist/components/progress/progress.d.ts +8 -0
  217. package/dist/components/progress/progress.js +162 -0
  218. package/dist/components/prompt-input/prompt-input.d.ts +247 -0
  219. package/dist/components/prompt-input/prompt-input.js +1367 -0
  220. package/dist/components/questionnaire/questionnaire.d.ts +174 -0
  221. package/dist/components/questionnaire/questionnaire.js +1628 -0
  222. package/dist/components/queue/queue.d.ts +82 -0
  223. package/dist/components/queue/queue.js +471 -0
  224. package/dist/components/radio/radio.d.ts +7 -0
  225. package/dist/components/radio/radio.js +101 -0
  226. package/dist/components/rating/rating.d.ts +10 -0
  227. package/dist/components/rating/rating.js +95 -0
  228. package/dist/components/reasoning/reasoning.d.ts +50 -0
  229. package/dist/components/reasoning/reasoning.js +233 -0
  230. package/dist/components/resizable/resizable.d.ts +6 -0
  231. package/dist/components/resizable/resizable.js +100 -0
  232. package/dist/components/scroll-area/scroll-area.d.ts +17 -0
  233. package/dist/components/scroll-area/scroll-area.js +211 -0
  234. package/dist/components/segmented-control/segmented-control.d.ts +16 -0
  235. package/dist/components/segmented-control/segmented-control.js +142 -0
  236. package/dist/components/select/select.d.ts +43 -0
  237. package/dist/components/select/select.js +577 -0
  238. package/dist/components/separator/separator.d.ts +4 -0
  239. package/dist/components/separator/separator.js +38 -0
  240. package/dist/components/sheet/sheet.d.ts +24 -0
  241. package/dist/components/sheet/sheet.js +330 -0
  242. package/dist/components/sidebar/sidebar.d.ts +138 -0
  243. package/dist/components/sidebar/sidebar.js +1374 -0
  244. package/dist/components/skeleton/skeleton.d.ts +4 -0
  245. package/dist/components/skeleton/skeleton.js +40 -0
  246. package/dist/components/slider/slider.d.ts +9 -0
  247. package/dist/components/slider/slider.js +193 -0
  248. package/dist/components/sources/sources.d.ts +35 -0
  249. package/dist/components/sources/sources.js +209 -0
  250. package/dist/components/spinner/spinner.d.ts +11 -0
  251. package/dist/components/spinner/spinner.js +59 -0
  252. package/dist/components/stack-trace/parse-stack-trace.d.ts +21 -0
  253. package/dist/components/stack-trace/parse-stack-trace.js +61 -0
  254. package/dist/components/stack-trace/stack-trace.d.ts +79 -0
  255. package/dist/components/stack-trace/stack-trace.js +434 -0
  256. package/dist/components/subagent/subagent.d.ts +71 -0
  257. package/dist/components/subagent/subagent.js +450 -0
  258. package/dist/components/suggestion/suggestion.d.ts +21 -0
  259. package/dist/components/suggestion/suggestion.js +130 -0
  260. package/dist/components/switch/switch.d.ts +6 -0
  261. package/dist/components/switch/switch.js +70 -0
  262. package/dist/components/table/table.d.ts +19 -0
  263. package/dist/components/table/table.js +284 -0
  264. package/dist/components/table-of-contents/spy.js +84 -0
  265. package/dist/components/table-of-contents/table-of-contents.d.ts +92 -0
  266. package/dist/components/table-of-contents/table-of-contents.js +787 -0
  267. package/dist/components/tabs/tabs.d.ts +25 -0
  268. package/dist/components/tabs/tabs.js +273 -0
  269. package/dist/components/task/task.d.ts +40 -0
  270. package/dist/components/task/task.js +262 -0
  271. package/dist/components/terminal/terminal.d.ts +82 -0
  272. package/dist/components/terminal/terminal.js +457 -0
  273. package/dist/components/test-results/test-results.d.ts +127 -0
  274. package/dist/components/test-results/test-results.js +687 -0
  275. package/dist/components/textarea/textarea.d.ts +8 -0
  276. package/dist/components/textarea/textarea.js +43 -0
  277. package/dist/components/time-input/time-input.d.ts +7 -0
  278. package/dist/components/time-input/time-input.js +82 -0
  279. package/dist/components/timeline/timeline.d.ts +19 -0
  280. package/dist/components/timeline/timeline.js +247 -0
  281. package/dist/components/toast/toast.d.ts +12 -0
  282. package/dist/components/toast/toast.js +285 -0
  283. package/dist/components/toggle/toggle.d.ts +15 -0
  284. package/dist/components/toggle/toggle.js +137 -0
  285. package/dist/components/token-input/token-input.d.ts +7 -0
  286. package/dist/components/token-input/token-input.js +117 -0
  287. package/dist/components/tool/tool.d.ts +66 -0
  288. package/dist/components/tool/tool.js +413 -0
  289. package/dist/components/toolbar/toolbar.d.ts +91 -0
  290. package/dist/components/toolbar/toolbar.js +655 -0
  291. package/dist/components/tooltip/tooltip.d.ts +8 -0
  292. package/dist/components/tooltip/tooltip.js +97 -0
  293. package/dist/components/trace/trace.d.ts +31 -0
  294. package/dist/components/trace/trace.js +309 -0
  295. package/dist/components/tree/tree.d.ts +13 -0
  296. package/dist/components/tree/tree.js +258 -0
  297. package/dist/components/trigger-menu/trigger-menu.d.ts +30 -0
  298. package/dist/components/trigger-menu/trigger-menu.js +352 -0
  299. package/dist/components/usage/usage.d.ts +132 -0
  300. package/dist/components/usage/usage.js +1368 -0
  301. package/dist/components/waterfall/waterfall.d.ts +20 -0
  302. package/dist/components/waterfall/waterfall.js +360 -0
  303. package/dist/components/week-strip/week-strip.d.ts +177 -0
  304. package/dist/components/week-strip/week-strip.js +1081 -0
  305. package/dist/core/index.d.ts +7 -0
  306. package/dist/core/index.js +27 -0
  307. package/dist/core/ui-sdk.d.ts +3 -0
  308. package/dist/core/ui-sdk.js +3 -0
  309. package/dist/core/use-primitive-state.d.ts +14 -0
  310. package/dist/core/use-primitive-state.js +25 -0
  311. package/dist/styles/LICENSE-shadcn.md +21 -0
  312. package/dist/styles/color-scheme.css +32 -0
  313. package/dist/styles/components.css +303 -0
  314. package/dist/styles/index.css +41 -0
  315. package/dist/styles/tokens.css +474 -0
  316. package/dist/styles/typeset/shadcn.css +506 -0
  317. package/dist/styles/typeset.css +70 -0
  318. package/dist/styles/utilities.css +555 -0
  319. package/dist/tools/observe/index.d.ts +2 -0
  320. package/dist/tools/observe/index.js +3 -0
  321. package/dist/tools/observe/ui-sdk.d.ts +1 -0
  322. package/dist/tools/observe/ui-sdk.js +2 -0
  323. package/dist/tools/testing/check-agent.d.ts +28 -0
  324. package/dist/tools/testing/check-agent.js +42 -0
  325. package/dist/tools/testing/index.d.ts +4 -0
  326. package/dist/tools/testing/index.js +4 -0
  327. package/dist/tools/testing/ui-sdk.d.ts +1 -0
  328. package/dist/tools/testing/ui-sdk.js +2 -0
  329. package/dist/utilities/cn/index.d.ts +12 -0
  330. package/dist/utilities/cn/index.js +47 -0
  331. package/dist/utilities/color/index.d.ts +2 -0
  332. package/dist/utilities/color/index.js +3 -0
  333. package/dist/utilities/color/ui-sdk.d.ts +1 -0
  334. package/dist/utilities/color/ui-sdk.js +2 -0
  335. package/dist/utilities/date/index.d.ts +2 -0
  336. package/dist/utilities/date/index.js +6 -0
  337. package/dist/utilities/date/ui-sdk.d.ts +1 -0
  338. package/dist/utilities/date/ui-sdk.js +2 -0
  339. package/dist/utilities/image/index.d.ts +2 -0
  340. package/dist/utilities/image/index.js +3 -0
  341. package/dist/utilities/image/ui-sdk.d.ts +1 -0
  342. package/dist/utilities/image/ui-sdk.js +2 -0
  343. package/dist/utilities/mobile/index.d.ts +2 -0
  344. package/dist/utilities/mobile/index.js +1 -0
  345. package/dist/utilities/mobile/ui-sdk.d.ts +2 -0
  346. package/dist/utilities/mobile/ui-sdk.js +1 -0
  347. package/dist/utilities/number/index.d.ts +2 -0
  348. package/dist/utilities/number/index.js +3 -0
  349. package/dist/utilities/number/ui-sdk.d.ts +1 -0
  350. package/dist/utilities/number/ui-sdk.js +2 -0
  351. package/dist/utilities/platform/index.d.ts +3 -0
  352. package/dist/utilities/platform/index.js +14 -0
  353. package/dist/utilities/platform/ui-sdk.d.ts +3 -0
  354. package/dist/utilities/platform/ui-sdk.js +3 -0
  355. package/dist/utilities/storage/index.d.ts +2 -0
  356. package/dist/utilities/storage/index.js +1 -0
  357. package/dist/utilities/storage/ui-sdk.d.ts +2 -0
  358. package/dist/utilities/storage/ui-sdk.js +1 -0
  359. package/dist/utilities/text/index.d.ts +3 -0
  360. package/dist/utilities/text/index.js +3 -0
  361. package/dist/utilities/text/ui-sdk.d.ts +3 -0
  362. package/dist/utilities/text/ui-sdk.js +3 -0
  363. package/package.json +192 -4
  364. package/skills/agent-ready-ui/SKILL.md +229 -0
  365. package/skills/blocks/SKILL.md +262 -0
  366. package/skills/compose-screens/SKILL.md +354 -0
  367. package/skills/note-editor/SKILL.md +493 -0
  368. package/skills/note-status/SKILL.md +295 -0
  369. package/skills/setup/SKILL.md +136 -0
  370. package/skills/theming/SKILL.md +216 -0
  371. package/src/blocks/notes/adapters.ts +77 -0
  372. package/src/blocks/notes/data.ts +508 -0
  373. package/src/blocks/notes/notes-block.tsx +244 -0
  374. package/src/blocks/notes/parts/home.tsx +219 -0
  375. package/src/blocks/notes/parts/no-access.tsx +84 -0
  376. package/src/blocks/notes/parts/note-screen.tsx +412 -0
  377. package/src/blocks/notes/parts/notes-sidebar.tsx +277 -0
  378. package/src/blocks/notes/parts/panels.tsx +393 -0
  379. package/src/blocks/notes/parts/place.ts +15 -0
  380. package/src/blocks/notes/parts/review-dialog.tsx +159 -0
  381. package/src/blocks/notes/parts/share.tsx +172 -0
  382. package/src/blocks/notes/texts.ts +135 -0
  383. package/src/blocks/shell/adapters.ts +69 -0
  384. package/src/blocks/shell/data.ts +281 -0
  385. package/src/blocks/shell/parts/compose.tsx +292 -0
  386. package/src/blocks/shell/parts/home.tsx +203 -0
  387. package/src/blocks/shell/parts/marks.tsx +144 -0
  388. package/src/blocks/shell/parts/rail.tsx +166 -0
  389. package/src/blocks/shell/parts/rooms-column.tsx +326 -0
  390. package/src/blocks/shell/shell-block.tsx +210 -0
  391. package/src/blocks/shell/texts.ts +80 -0
@@ -0,0 +1,166 @@
1
+ "use client";
2
+
3
+ import {
4
+ BubbleChatIcon,
5
+ DatabaseIcon,
6
+ GridViewIcon,
7
+ Home01Icon,
8
+ Moon02Icon,
9
+ Note01Icon,
10
+ Plug01Icon,
11
+ Robot01Icon,
12
+ Settings01Icon,
13
+ } from "@hugeicons/core-free-icons";
14
+ import { Icon } from "abby/icon";
15
+ import {
16
+ Sidebar,
17
+ SidebarMenu,
18
+ SidebarMenuBadge,
19
+ SidebarMenuButton,
20
+ SidebarMenuItem,
21
+ } from "abby/sidebar";
22
+ import type { ShellWorkspace } from "../data.ts";
23
+ import type { ShellTexts } from "../texts.ts";
24
+ import { initialsOf, tint } from "./marks.tsx";
25
+
26
+ // The rail: the team, the views and, at its foot, the team's tools and the
27
+ // person. Each view is a 36px circle on the rail's axis, 26px in, with its
28
+ // name in a tooltip. Salas counts what waits for the person: a dot while the
29
+ // column is open, the number once it's collapsed.
30
+
31
+ export type ShellPage =
32
+ | "home"
33
+ | "rooms"
34
+ | "notes"
35
+ | "memory"
36
+ | "dream"
37
+ | "areas"
38
+ | "connectors"
39
+ | "agents"
40
+ | "settings";
41
+
42
+ const views = [
43
+ { page: "home", icon: Home01Icon },
44
+ { page: "rooms", icon: BubbleChatIcon },
45
+ { page: "notes", icon: Note01Icon },
46
+ { page: "memory", icon: DatabaseIcon },
47
+ { page: "dream", icon: Moon02Icon },
48
+ { page: "areas", icon: GridViewIcon },
49
+ ] as const;
50
+
51
+ const tools = [
52
+ { page: "connectors", icon: Plug01Icon },
53
+ { page: "agents", icon: Robot01Icon },
54
+ { page: "settings", icon: Settings01Icon },
55
+ ] as const;
56
+
57
+ type RailProps = {
58
+ workspace: ShellWorkspace;
59
+ texts: ShellTexts;
60
+ page: ShellPage;
61
+ href: (page: ShellPage) => string;
62
+ };
63
+
64
+ export function Rail({ workspace, texts, page, href }: RailProps) {
65
+ const waiting = workspace.rooms.filter((room) => room.status === "waiting").length;
66
+ const { team, me } = workspace;
67
+
68
+ const view = (item: (typeof views)[number] | (typeof tools)[number]) => {
69
+ const badge =
70
+ item.page === "rooms" && waiting > 0
71
+ ? { id: "rail-rooms-badge", text: texts.waitingCount(waiting) }
72
+ : item.page === "dream" && workspace.dream
73
+ ? { id: "rail-dream-badge", text: texts.dreamNews }
74
+ : undefined;
75
+ return (
76
+ <SidebarMenuItem key={item.page}>
77
+ <SidebarMenuButton
78
+ size="icon"
79
+ tooltip={texts[item.page]}
80
+ isActive={item.page === page}
81
+ render={<a href={href(item.page)} />}
82
+ aria-describedby={badge?.id}
83
+ >
84
+ <Icon icon={item.icon} />
85
+ <span>{texts[item.page]}</span>
86
+ </SidebarMenuButton>
87
+ {badge && (
88
+ <>
89
+ {item.page === "rooms" ? (
90
+ // Alma's group orange while it's a dot; the number takes
91
+ // `warning`, whose white figure keeps 4.5:1.
92
+ <SidebarMenuBadge
93
+ variant="dot"
94
+ className="bg-warning text-warning-foreground data-dot:bg-chart-3"
95
+ >
96
+ {waiting}
97
+ </SidebarMenuBadge>
98
+ ) : (
99
+ // Something new from the night: a dot, open or collapsed.
100
+ <span
101
+ aria-hidden="true"
102
+ className="pointer-events-none absolute top-1.75 right-1.75 size-2 rounded-full border-2 border-sidebar bg-foreground"
103
+ />
104
+ )}
105
+ <span id={badge.id} hidden aria-hidden="true">
106
+ {badge.text}
107
+ </span>
108
+ </>
109
+ )}
110
+ </SidebarMenuItem>
111
+ );
112
+ };
113
+
114
+ return (
115
+ <Sidebar collapsible="none" className="w-(--sidebar-width-icon)">
116
+ {/* One column on the rail's axis, 4px apart, from right under the title bar. */}
117
+ <SidebarMenu aria-label={texts.pages} className="flex-1 items-center pb-2">
118
+ <SidebarMenuItem>
119
+ <SidebarMenuButton
120
+ size="icon"
121
+ tooltip={team.name}
122
+ render={<a href={href("home")} />}
123
+ data-team=""
124
+ >
125
+ <span
126
+ aria-hidden="true"
127
+ className="grid size-full place-items-center rounded-lg text-xs font-semibold"
128
+ style={tint(team.color, "var(--sidebar)")}
129
+ >
130
+ {team.initials}
131
+ </span>
132
+ <span>{team.name}</span>
133
+ </SidebarMenuButton>
134
+ </SidebarMenuItem>
135
+ <li aria-hidden="true" className="-mb-px h-px w-5 shrink-0 bg-sidebar-border" />
136
+ {views.map(view)}
137
+ <li aria-hidden="true" className="flex-1" />
138
+ {tools.map(view)}
139
+ <SidebarMenuItem>
140
+ <SidebarMenuButton
141
+ size="icon"
142
+ tooltip={me.name}
143
+ render={<a href={href("settings")} />}
144
+ aria-describedby="rail-me-online"
145
+ >
146
+ <span
147
+ aria-hidden="true"
148
+ className="grid size-full place-items-center rounded-full text-footnote font-semibold"
149
+ style={tint(me.color, "var(--sidebar)")}
150
+ >
151
+ {initialsOf(me)}
152
+ </span>
153
+ <span>{me.name}</span>
154
+ </SidebarMenuButton>
155
+ <span
156
+ aria-hidden="true"
157
+ className="pointer-events-none absolute end-0 bottom-0 size-2.5 rounded-full border-2 border-sidebar bg-success"
158
+ />
159
+ <span id="rail-me-online" hidden aria-hidden="true">
160
+ {texts.online}
161
+ </span>
162
+ </SidebarMenuItem>
163
+ </SidebarMenu>
164
+ </Sidebar>
165
+ );
166
+ }
@@ -0,0 +1,326 @@
1
+ "use client";
2
+
3
+ import {
4
+ Add01Icon,
5
+ ArrowDown01Icon,
6
+ MoreHorizontalIcon,
7
+ Search01Icon,
8
+ Tick02Icon,
9
+ UserIcon,
10
+ } from "@hugeicons/core-free-icons";
11
+ import { Button } from "abby/button";
12
+ import { Icon } from "abby/icon";
13
+ import { Menu, MenuContent, MenuItem, MenuRadioGroup, MenuRadioItem, MenuTrigger } from "abby/menu";
14
+ import {
15
+ Sidebar,
16
+ SidebarContent,
17
+ SidebarFooter,
18
+ SidebarGroup,
19
+ SidebarGroupLabel,
20
+ SidebarHeader,
21
+ SidebarMenu,
22
+ SidebarMenuButton,
23
+ SidebarMenuItem,
24
+ } from "abby/sidebar";
25
+ import { Toggle } from "abby/toggle";
26
+ import type { ReactNode } from "react";
27
+ import type { ShellArea, ShellRoom, ShellWorkspace } from "../data.ts";
28
+ import type { ShellTexts } from "../texts.ts";
29
+ import { AreaMark, AssistantMark, Face, RoomStatusMark, WorkingArc } from "./marks.tsx";
30
+
31
+ // The column beside the rail: the team, ⌘N, how the rooms are grouped, the
32
+ // rooms and, at its foot, the assistant's night. Every row hangs from Alma's
33
+ // lines: its status on the mark column, 20px in, its name on the text column,
34
+ // 44px in, and a group's count on the trailing axis.
35
+
36
+ export type ShellGrouping = "area" | "status";
37
+
38
+ type RoomsColumnProps = {
39
+ workspace: ShellWorkspace;
40
+ texts: ShellTexts;
41
+ grouping: ShellGrouping;
42
+ onGroupingChange: (grouping: ShellGrouping) => void;
43
+ mine: boolean;
44
+ onMineChange: (mine: boolean) => void;
45
+ /** The room on screen, marked active. */
46
+ room?: string;
47
+ roomHref: (id: string) => string;
48
+ /** The ⌘N button and its popover. */
49
+ compose: ReactNode;
50
+ onNewRoom: () => void;
51
+ onMarkAllRead: () => void;
52
+ onSearch: () => void;
53
+ };
54
+
55
+ export function RoomsColumn({
56
+ workspace,
57
+ texts,
58
+ grouping,
59
+ onGroupingChange,
60
+ mine,
61
+ onMineChange,
62
+ room: current,
63
+ roomHref,
64
+ compose,
65
+ onNewRoom,
66
+ onMarkAllRead,
67
+ onSearch,
68
+ }: RoomsColumnProps) {
69
+ const rooms = workspace.rooms.filter((room) => !mine || room.mine);
70
+ const people = new Map(workspace.people.map((person) => [person.id, person]));
71
+ const empty = workspace.rooms.length === 0;
72
+
73
+ const row = (room: ShellRoom) => {
74
+ const describedBy = `room-${room.id}-line`;
75
+ return (
76
+ <SidebarMenuItem key={room.id}>
77
+ <SidebarMenuButton
78
+ size="lg"
79
+ isActive={room.id === current}
80
+ render={<a href={roomHref(room.id)} />}
81
+ aria-describedby={describedBy}
82
+ data-room={room.id}
83
+ >
84
+ <RoomStatusMark status={room.status} />
85
+ <span className="flex min-w-0 flex-1 flex-col gap-0.5">
86
+ <span className={`truncate ${room.unread ? "font-medium" : ""}`}>{room.title}</span>
87
+ <span aria-hidden="true" className="flex min-w-0 items-center gap-1.25">
88
+ {room.people.map((id) => {
89
+ const person = people.get(id);
90
+ return person && <Face key={id} person={person} />;
91
+ })}
92
+ <span className="text-subtle">·</span>
93
+ <span
94
+ className={`truncate text-supporting ${
95
+ room.status === "waiting" ? "text-warning" : "text-muted-foreground"
96
+ }`}
97
+ >
98
+ {room.line}
99
+ </span>
100
+ </span>
101
+ </span>
102
+ </SidebarMenuButton>
103
+ <span id={describedBy} hidden aria-hidden="true">
104
+ {room.line}
105
+ </span>
106
+ </SidebarMenuItem>
107
+ );
108
+ };
109
+
110
+ const group = (
111
+ key: string,
112
+ label: ReactNode,
113
+ list: ShellRoom[],
114
+ options: { area?: ShellArea; warning?: boolean } = {},
115
+ ) => {
116
+ if (list.length === 0) return null;
117
+ const working = list.filter((room) => room.status === "working").length;
118
+ const labelId = `rooms-group-${key}`;
119
+ return (
120
+ <SidebarGroup key={key} data-group={key}>
121
+ <SidebarGroupLabel className={options.warning ? "text-warning" : undefined}>
122
+ {options.area && (
123
+ <span aria-hidden="true" data-group-mark="" className="flex w-4 justify-center">
124
+ <AreaMark color={options.area.color} />
125
+ </span>
126
+ )}
127
+ <span id={labelId} className="min-w-0 flex-1 truncate">
128
+ {label}
129
+ </span>
130
+ {options.area && working > 0 && (
131
+ <span className="flex items-center gap-0.75 font-normal">
132
+ <WorkingArc />
133
+ <span aria-hidden="true">{working}</span>
134
+ <span className="sr-only">{texts.working(working)}</span>
135
+ </span>
136
+ )}
137
+ <span
138
+ className={`w-7 shrink-0 text-center font-normal ${
139
+ options.warning ? "" : "text-subtle"
140
+ }`}
141
+ >
142
+ <span aria-hidden="true">{list.length}</span>
143
+ <span className="sr-only">{texts.roomCount(list.length)}</span>
144
+ </span>
145
+ </SidebarGroupLabel>
146
+ {/* Alma's rooms touch, 48px apart: no 2px between them. */}
147
+ <SidebarMenu aria-labelledby={labelId} className="gap-0">
148
+ {list.map(row)}
149
+ </SidebarMenu>
150
+ </SidebarGroup>
151
+ );
152
+ };
153
+
154
+ const waiting = rooms.filter((room) => room.status === "waiting");
155
+ const groups =
156
+ grouping === "area"
157
+ ? [
158
+ group("for-you", texts.forYou, waiting, { warning: true }),
159
+ ...workspace.areas.map((area) =>
160
+ group(
161
+ area.id,
162
+ area.name,
163
+ rooms.filter((room) => room.area === area.id && room.status !== "waiting"),
164
+ { area },
165
+ ),
166
+ ),
167
+ ]
168
+ : [
169
+ group("waiting", texts.waitingGroup, waiting, { warning: true }),
170
+ group(
171
+ "working",
172
+ texts.workingGroup,
173
+ rooms.filter((room) => room.status === "working"),
174
+ ),
175
+ group(
176
+ "news",
177
+ texts.newsGroup,
178
+ rooms.filter((room) => room.status === "news"),
179
+ ),
180
+ group(
181
+ "quiet",
182
+ texts.quietGroup,
183
+ rooms.filter((room) => room.status === "quiet"),
184
+ ),
185
+ ];
186
+
187
+ return (
188
+ <Sidebar collapsible="none" peek>
189
+ <SidebarHeader>
190
+ <div className="flex h-9 items-center gap-2 ps-3">
191
+ <h2 data-team-name="" className="min-w-0 flex-1 truncate text-heading-3 font-medium">
192
+ {workspace.team.name}
193
+ </h2>
194
+ <Button variant="ghost" size="icon-sm" aria-label={texts.search} onClick={onSearch}>
195
+ <Icon icon={Search01Icon} />
196
+ </Button>
197
+ </div>
198
+ {compose}
199
+ {!empty && (
200
+ <div className="flex h-7 items-center gap-1" data-toolbar="">
201
+ <Menu>
202
+ <MenuTrigger
203
+ variant="ghost"
204
+ size="sm"
205
+ className="gap-1 ps-3 pe-2.5 font-normal text-muted-foreground"
206
+ >
207
+ {grouping === "area" ? texts.byArea : texts.byStatus}
208
+ <Icon icon={ArrowDown01Icon} className="size-2.5" />
209
+ </MenuTrigger>
210
+ <MenuContent align="start" aria-label={texts.groupBy}>
211
+ <MenuRadioGroup
212
+ value={grouping}
213
+ onValueChange={(value) => onGroupingChange(value as ShellGrouping)}
214
+ >
215
+ <MenuRadioItem value="area">{texts.byArea}</MenuRadioItem>
216
+ <MenuRadioItem value="status">{texts.byStatus}</MenuRadioItem>
217
+ </MenuRadioGroup>
218
+ </MenuContent>
219
+ </Menu>
220
+ {/* Alma's pressed option: the row's track and medium weight, not ink. */}
221
+ <Toggle
222
+ size="sm"
223
+ pressed={mine}
224
+ onPressedChange={onMineChange}
225
+ className="gap-1.5 ps-2.5 pe-3 font-normal text-muted-foreground data-pressed:bg-sidebar-accent data-pressed:font-medium data-pressed:text-foreground data-pressed:hover:bg-sidebar-accent"
226
+ >
227
+ <Icon icon={UserIcon} className="size-3" />
228
+ {texts.mine}
229
+ </Toggle>
230
+ <span className="flex-1" />
231
+ <Button variant="ghost" size="icon-sm" aria-label={texts.newRoom} onClick={onNewRoom}>
232
+ <Icon icon={Add01Icon} className="size-3.5" />
233
+ </Button>
234
+ <Menu>
235
+ <MenuTrigger variant="ghost" size="icon-sm" aria-label={texts.more}>
236
+ <Icon icon={MoreHorizontalIcon} />
237
+ </MenuTrigger>
238
+ <MenuContent align="end">
239
+ <MenuItem onClick={onMarkAllRead}>{texts.markAllRead}</MenuItem>
240
+ </MenuContent>
241
+ </Menu>
242
+ </div>
243
+ )}
244
+ </SidebarHeader>
245
+ {empty ? (
246
+ <Setup workspace={workspace} texts={texts} />
247
+ ) : (
248
+ <SidebarContent>{groups}</SidebarContent>
249
+ )}
250
+ {workspace.dream && (
251
+ <SidebarFooter>
252
+ <Dream workspace={workspace} texts={texts} />
253
+ </SidebarFooter>
254
+ )}
255
+ </Sidebar>
256
+ );
257
+ }
258
+
259
+ /** The assistant's night: what it did, what it asks, and how far the week went. */
260
+ function Dream({ workspace, texts }: { workspace: ShellWorkspace; texts: ShellTexts }) {
261
+ const dream = workspace.dream!;
262
+ return (
263
+ <section
264
+ aria-labelledby="shell-dream"
265
+ data-dream=""
266
+ className="flex flex-col gap-2 rounded-xl border border-border bg-background p-2.75"
267
+ >
268
+ <div className="flex items-center gap-2">
269
+ <AssistantMark className="size-4 shrink-0" />
270
+ <h2 id="shell-dream" className="min-w-0 flex-1 truncate text-label">
271
+ {texts.dreamTitle}
272
+ </h2>
273
+ <span className="font-mono text-footnote text-muted-foreground">{dream.version}</span>
274
+ </div>
275
+ <p className="text-supporting text-muted-foreground">
276
+ {dream.text} {dream.question && <span className="text-warning">{dream.question}</span>}.
277
+ </p>
278
+ <div aria-hidden="true" className="flex items-center gap-0.75">
279
+ {Array.from({ length: dream.of }, (_, index) => (
280
+ <span
281
+ key={index}
282
+ className={`h-1 flex-1 rounded-2xs ${index < dream.nights ? "bg-foreground" : "bg-sidebar-accent"}`}
283
+ />
284
+ ))}
285
+ </div>
286
+ <p className="font-mono text-footnote tracking-wide text-muted-foreground uppercase">
287
+ {texts.nights(dream.nights, dream.of, dream.learnings)}
288
+ </p>
289
+ </section>
290
+ );
291
+ }
292
+
293
+ /** A team with no rooms: the first step is to write, then the steps left. */
294
+ function Setup({ workspace, texts }: { workspace: ShellWorkspace; texts: ShellTexts }) {
295
+ return (
296
+ <SidebarContent>
297
+ <div className="flex flex-col gap-4 px-5 pt-4" data-setup="">
298
+ <h3 className="text-heading-3">{texts.setupTitle}</h3>
299
+ <p className="text-sm text-muted-foreground">{texts.setupBody}</p>
300
+ <ol aria-label={texts.setupSteps} className="flex flex-col gap-0.5">
301
+ {workspace.setup?.map((step) => (
302
+ <li key={step.label} className="flex items-center gap-2.5 py-2 text-sm">
303
+ {step.done ? (
304
+ <span
305
+ aria-hidden="true"
306
+ className="grid size-4.5 shrink-0 place-items-center rounded-full bg-foreground text-background"
307
+ >
308
+ <Icon icon={Tick02Icon} className="size-2.5" />
309
+ </span>
310
+ ) : (
311
+ <span
312
+ aria-hidden="true"
313
+ className="size-4.5 shrink-0 rounded-full border-[1.5px] border-muted-foreground/40"
314
+ />
315
+ )}
316
+ <span className={step.done ? "text-muted-foreground line-through" : undefined}>
317
+ {step.label}
318
+ {step.done && <span className="sr-only"> ({texts.done})</span>}
319
+ </span>
320
+ </li>
321
+ ))}
322
+ </ol>
323
+ </div>
324
+ </SidebarContent>
325
+ );
326
+ }
@@ -0,0 +1,210 @@
1
+ "use client";
2
+
3
+ import { Button } from "abby/button";
4
+ import { Kbd } from "abby/kbd";
5
+ import {
6
+ Sidebar,
7
+ SidebarInset,
8
+ SidebarInsetHeader,
9
+ SidebarProvider,
10
+ SidebarTitlebar,
11
+ SidebarTrigger,
12
+ useSidebar,
13
+ } from "abby/sidebar";
14
+ import { useShortcut, useShortcutHint } from "abby/utilities/platform";
15
+ import { useRef, useState, type CSSProperties, type ReactNode } from "react";
16
+ import type { ShellAdapter } from "./adapters.ts";
17
+ import type { ShellWorkspace } from "./data.ts";
18
+ import { Compose } from "./parts/compose.tsx";
19
+ import { Home } from "./parts/home.tsx";
20
+ import { Face } from "./parts/marks.tsx";
21
+ import { Rail, type ShellPage } from "./parts/rail.tsx";
22
+ import { RoomsColumn, type ShellGrouping } from "./parts/rooms-column.tsx";
23
+ import { shellTexts, type ShellTexts } from "./texts.ts";
24
+
25
+ // The Shell block: the window of a team app, Alma's, from abby's public
26
+ // entries only, so this folder can be copied into an app as it is. A rail of
27
+ // views and a column of rooms share one sidebar, on the window's paper; the
28
+ // page is a white card beside them, home by default. Collapsed (⌘B), only the
29
+ // rail stays, and the column peeks out when the pointer rests on it.
30
+
31
+ export type { ShellPage } from "./parts/rail.tsx";
32
+ export type { ShellGrouping } from "./parts/rooms-column.tsx";
33
+
34
+ /** Where a view or a room lives, for its link. */
35
+ export type ShellTarget = { page: ShellPage } | { room: string };
36
+
37
+ type ShellStart = {
38
+ grouping?: ShellGrouping;
39
+ /** Only the person's rooms. On by default, as in the design. */
40
+ mine?: boolean;
41
+ /** Starts with only the rail. */
42
+ collapsed?: boolean;
43
+ /** Starts with this text in ⌘N's field and its choices open. */
44
+ compose?: string;
45
+ };
46
+
47
+ export type ShellBlockProps = {
48
+ workspace: ShellWorkspace;
49
+ adapter: ShellAdapter;
50
+ /** Replaces any of the block's texts, to translate it. */
51
+ texts?: Partial<ShellTexts>;
52
+ /** The view on screen: its rail button is active and its name titles the page. */
53
+ page?: ShellPage;
54
+ /** The room on screen, marked in the column. */
55
+ room?: string;
56
+ href?: (target: ShellTarget) => string;
57
+ /** What the block shows first. */
58
+ initial?: ShellStart;
59
+ /**
60
+ * In a desktop window, where the operating system draws its controls over
61
+ * the title bar, leave this out. A story or a web build can draw them here.
62
+ */
63
+ windowControls?: ReactNode;
64
+ /**
65
+ * The sidebar opened or collapsed. Collapsed, its title bar folds away: a
66
+ * desktop app hides the window's controls meanwhile (Electron's
67
+ * `setWindowButtonVisibility(open)`).
68
+ */
69
+ onSidebarOpenChange?: (open: boolean) => void;
70
+ /** The page of a view other than home. Home's page by default. */
71
+ children?: ReactNode;
72
+ };
73
+
74
+ const defaultHref = (target: ShellTarget) =>
75
+ "room" in target ? `#room-${target.room}` : `#${target.page}`;
76
+
77
+ // Alma's sidebar: a 52px rail and a 288px column.
78
+ const width = { "--sidebar-width": "calc(18rem + var(--sidebar-width-icon))" } as CSSProperties;
79
+
80
+ export function ShellBlock({
81
+ workspace,
82
+ adapter,
83
+ texts: own,
84
+ page = "home",
85
+ room,
86
+ href = defaultHref,
87
+ initial = {},
88
+ windowControls,
89
+ onSidebarOpenChange,
90
+ children,
91
+ }: ShellBlockProps) {
92
+ const texts = { ...shellTexts, ...own };
93
+ const [grouping, setGrouping] = useState<ShellGrouping>(initial.grouping ?? "area");
94
+ const [mine, setMine] = useState(initial.mine ?? true);
95
+ const composeInput = useRef<HTMLInputElement>(null);
96
+ const roomHref = (id: string) => href({ room: id });
97
+
98
+ return (
99
+ <SidebarProvider
100
+ defaultOpen={!initial.collapsed}
101
+ onOpenChange={(open) => onSidebarOpenChange?.(open)}
102
+ style={width}
103
+ >
104
+ <Sidebar variant="inset" collapsible="icon">
105
+ <SidebarTitlebar className="relative">
106
+ {windowControls}
107
+ <SidebarTrigger />
108
+ </SidebarTitlebar>
109
+ <div className="flex min-h-0 flex-1">
110
+ <Rail
111
+ workspace={workspace}
112
+ texts={texts}
113
+ page={page}
114
+ href={(target) => href({ page: target })}
115
+ />
116
+ <RoomsColumn
117
+ workspace={workspace}
118
+ texts={texts}
119
+ grouping={grouping}
120
+ onGroupingChange={setGrouping}
121
+ mine={mine}
122
+ onMineChange={setMine}
123
+ room={room}
124
+ roomHref={roomHref}
125
+ onNewRoom={() => composeInput.current?.focus()}
126
+ onMarkAllRead={() => {
127
+ adapter.markAllRead().catch(() => {});
128
+ }}
129
+ onSearch={() => adapter.openSearch()}
130
+ compose={
131
+ <Compose
132
+ workspace={workspace}
133
+ adapter={adapter}
134
+ texts={texts}
135
+ inputRef={composeInput}
136
+ defaultText={initial.compose}
137
+ />
138
+ }
139
+ />
140
+ </div>
141
+ </Sidebar>
142
+ <SidebarInset>
143
+ <PageHeader workspace={workspace} adapter={adapter} texts={texts} title={texts[page]} />
144
+ {children ?? (
145
+ <Home
146
+ workspace={workspace}
147
+ adapter={adapter}
148
+ texts={texts}
149
+ roomHref={roomHref}
150
+ learnedHref={href({ page: "dream" })}
151
+ />
152
+ )}
153
+ </SidebarInset>
154
+ </SidebarProvider>
155
+ );
156
+ }
157
+
158
+ /** The page's top bar: its title, who's in today, and the memory's search (⌘K). */
159
+ function PageHeader({
160
+ workspace,
161
+ adapter,
162
+ texts,
163
+ title,
164
+ }: {
165
+ workspace: ShellWorkspace;
166
+ adapter: ShellAdapter;
167
+ texts: ShellTexts;
168
+ title: string;
169
+ }) {
170
+ const { open } = useSidebar();
171
+ const hint = useShortcutHint("mod+k");
172
+ useShortcut("mod+k", () => adapter.openSearch(), { description: texts.searchMemory });
173
+ const people = new Map(workspace.people.map((person) => [person.id, person]));
174
+ return (
175
+ <SidebarInsetHeader>
176
+ {!open && <SidebarTrigger />}
177
+ <h1 className="min-w-0 flex-1 truncate text-label">{title}</h1>
178
+ {workspace.today.people.length > 0 && (
179
+ <>
180
+ <span aria-hidden="true" className="flex items-center">
181
+ {workspace.today.people.map((id) => {
182
+ const person = people.get(id);
183
+ return (
184
+ person && (
185
+ <Face key={id} person={person} size="md" className="border-2 border-background" />
186
+ )
187
+ );
188
+ })}
189
+ </span>
190
+ <span className="text-xs text-muted-foreground">
191
+ {texts.peopleToday(workspace.today.count)}
192
+ </span>
193
+ <span aria-hidden="true" className="h-4 w-px shrink-0 bg-border" />
194
+ </>
195
+ )}
196
+ <Button
197
+ variant="outline"
198
+ size="sm"
199
+ onClick={() => adapter.openSearch()}
200
+ aria-keyshortcuts={hint.ariaKeyshortcuts}
201
+ className="gap-2 ps-3 pe-1.5 text-xs font-normal text-muted-foreground"
202
+ >
203
+ {texts.searchMemory}
204
+ <Kbd aria-hidden="true" className="h-auto rounded-sm px-1.25 py-px font-normal">
205
+ {hint.text}
206
+ </Kbd>
207
+ </Button>
208
+ </SidebarInsetHeader>
209
+ );
210
+ }