@justanarthur/modo-ui-ai 0.0.0-stage → 0.2.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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.fluid-functionalism +21 -0
  3. package/README.md +105 -2
  4. package/blocks/conversation/agent-prompt/examples.mdx +44 -0
  5. package/blocks/conversation/agent-prompt/index.tsx +114 -0
  6. package/blocks/conversation/composer/draft.css +25 -0
  7. package/blocks/conversation/composer/draft.tsx +589 -0
  8. package/blocks/conversation/composer/examples.mdx +114 -0
  9. package/blocks/conversation/composer/file-preview-tile.tsx +59 -0
  10. package/blocks/conversation/composer/file-thumbnail.tsx +146 -0
  11. package/blocks/conversation/composer/index.tsx +517 -0
  12. package/blocks/conversation/composer/queued-row.tsx +102 -0
  13. package/blocks/conversation/composer/shared.ts +38 -0
  14. package/blocks/conversation/composer/suggestion-row.tsx +64 -0
  15. package/blocks/conversation/composer/use-composer-files.ts +142 -0
  16. package/blocks/conversation/composer/use-history-nav.ts +60 -0
  17. package/blocks/conversation/composer/use-message-queue.ts +108 -0
  18. package/blocks/conversation/composer/use-region-height.ts +34 -0
  19. package/blocks/conversation/failure-states/examples.mdx +58 -0
  20. package/blocks/conversation/failure-states/index.tsx +274 -0
  21. package/blocks/conversation/transcript/examples.mdx +43 -0
  22. package/blocks/conversation/transcript/index.tsx +204 -0
  23. package/blocks/conversation/transcript-search/examples.mdx +50 -0
  24. package/blocks/conversation/transcript-search/index.tsx +469 -0
  25. package/blocks/dialogs/command-palette/examples.mdx +33 -0
  26. package/blocks/dialogs/command-palette/index.tsx +232 -0
  27. package/blocks/dialogs/hook-dialog/examples.mdx +44 -0
  28. package/blocks/dialogs/hook-dialog/index.tsx +286 -0
  29. package/blocks/dialogs/mcp-server-dialog/examples.mdx +57 -0
  30. package/blocks/dialogs/mcp-server-dialog/index.tsx +415 -0
  31. package/blocks/dialogs/shortcuts-sheet/examples.mdx +36 -0
  32. package/blocks/dialogs/shortcuts-sheet/index.tsx +186 -0
  33. package/blocks/panes/artifacts-pane/examples.mdx +23 -0
  34. package/blocks/panes/artifacts-pane/index.tsx +82 -0
  35. package/blocks/panes/changes-pane/examples.mdx +23 -0
  36. package/blocks/panes/changes-pane/index.tsx +248 -0
  37. package/blocks/panes/file-pane/examples.mdx +13 -0
  38. package/blocks/panes/file-pane/index.tsx +102 -0
  39. package/blocks/panes/pr-pane/examples.mdx +13 -0
  40. package/blocks/panes/pr-pane/index.tsx +191 -0
  41. package/blocks/panes/side-pane/examples.mdx +58 -0
  42. package/blocks/panes/side-pane/index.tsx +187 -0
  43. package/blocks/panes/tasks-pane/examples.mdx +23 -0
  44. package/blocks/panes/tasks-pane/index.tsx +127 -0
  45. package/blocks/panes/terminal-pane/examples.mdx +13 -0
  46. package/blocks/panes/terminal-pane/index.tsx +99 -0
  47. package/blocks/panes/usage-pane/examples.mdx +13 -0
  48. package/blocks/panes/usage-pane/index.tsx +75 -0
  49. package/blocks/profiles/profile-onboarding/examples.mdx +80 -0
  50. package/blocks/profiles/profile-onboarding/index.tsx +580 -0
  51. package/blocks/profiles/profile-switcher/examples.mdx +18 -0
  52. package/blocks/profiles/profile-switcher/index.tsx +197 -0
  53. package/blocks/profiles/profile-usage/examples.mdx +21 -0
  54. package/blocks/profiles/profile-usage/index.tsx +127 -0
  55. package/blocks/sessions/inbox/examples.mdx +35 -0
  56. package/blocks/sessions/inbox/index.tsx +372 -0
  57. package/blocks/sessions/session-board/examples.mdx +34 -0
  58. package/blocks/sessions/session-board/index.tsx +570 -0
  59. package/blocks/sessions/session-sidebar/examples.mdx +43 -0
  60. package/blocks/sessions/session-sidebar/index.tsx +442 -0
  61. package/blocks/settings/extensions/examples.mdx +10 -0
  62. package/blocks/settings/extensions/index.tsx +72 -0
  63. package/blocks/settings/hooks/examples.mdx +16 -0
  64. package/blocks/settings/hooks/index.tsx +127 -0
  65. package/blocks/settings/mcp-servers/examples.mdx +26 -0
  66. package/blocks/settings/mcp-servers/index.tsx +204 -0
  67. package/blocks/settings/memory/examples.mdx +22 -0
  68. package/blocks/settings/memory/index.tsx +113 -0
  69. package/blocks/settings/notifications/examples.mdx +8 -0
  70. package/blocks/settings/notifications/index.tsx +63 -0
  71. package/blocks/settings/permission-rules/examples.mdx +37 -0
  72. package/blocks/settings/permission-rules/index.tsx +317 -0
  73. package/blocks/settings/plugin-catalog/examples.mdx +52 -0
  74. package/blocks/settings/plugin-catalog/index.tsx +407 -0
  75. package/blocks/settings/plugins/examples.mdx +10 -0
  76. package/blocks/settings/plugins/index.tsx +72 -0
  77. package/blocks/settings/settings-window/examples.mdx +40 -0
  78. package/blocks/settings/settings-window/index.tsx +188 -0
  79. package/blocks/settings/worktrees/examples.mdx +17 -0
  80. package/blocks/settings/worktrees/index.tsx +145 -0
  81. package/components/conversation/agent-run/examples.mdx +30 -0
  82. package/components/conversation/agent-run/index.tsx +82 -0
  83. package/components/conversation/chapter-nav/examples.mdx +30 -0
  84. package/components/conversation/chapter-nav/index.tsx +123 -0
  85. package/components/conversation/message/examples.mdx +53 -0
  86. package/components/conversation/message/index.tsx +128 -0
  87. package/components/conversation/message/working.tsx +102 -0
  88. package/components/conversation/reasoning/examples.mdx +22 -0
  89. package/components/conversation/reasoning/index.tsx +54 -0
  90. package/components/conversation/recap/examples.mdx +21 -0
  91. package/components/conversation/recap/index.tsx +67 -0
  92. package/components/conversation/todo-list/examples.mdx +32 -0
  93. package/components/conversation/todo-list/index.tsx +106 -0
  94. package/components/conversation/tool-call/examples.mdx +48 -0
  95. package/components/conversation/tool-call/index.tsx +142 -0
  96. package/components/conversation/work-summary/examples.mdx +50 -0
  97. package/components/conversation/work-summary/index.tsx +87 -0
  98. package/components/prompts/permission-request/examples.mdx +32 -0
  99. package/components/prompts/permission-request/index.tsx +74 -0
  100. package/components/prompts/plan-approval/examples.mdx +37 -0
  101. package/components/prompts/plan-approval/index.tsx +76 -0
  102. package/components/prompts/prompt-card/examples.mdx +31 -0
  103. package/components/prompts/prompt-card/index.tsx +82 -0
  104. package/components/prompts/question-prompt/examples.mdx +46 -0
  105. package/components/prompts/question-prompt/index.tsx +118 -0
  106. package/dist/blocks/conversation/agent-prompt/index.d.ts +7 -0
  107. package/dist/blocks/conversation/agent-prompt/index.js +13 -0
  108. package/dist/blocks/conversation/composer/index.d.ts +4 -0
  109. package/dist/blocks/conversation/composer/index.js +15 -0
  110. package/dist/blocks/conversation/failure-states/index.d.ts +4 -0
  111. package/dist/blocks/conversation/failure-states/index.js +8 -0
  112. package/dist/blocks/conversation/transcript/index.d.ts +50 -0
  113. package/dist/blocks/conversation/transcript/index.js +17 -0
  114. package/dist/blocks/conversation/transcript-search/index.d.ts +4 -0
  115. package/dist/blocks/conversation/transcript-search/index.js +11 -0
  116. package/dist/blocks/dialogs/command-palette/index.d.ts +5 -0
  117. package/dist/blocks/dialogs/command-palette/index.js +20 -0
  118. package/dist/blocks/dialogs/hook-dialog/index.d.ts +3 -0
  119. package/dist/blocks/dialogs/hook-dialog/index.js +12 -0
  120. package/dist/blocks/dialogs/mcp-server-dialog/index.d.ts +5 -0
  121. package/dist/blocks/dialogs/mcp-server-dialog/index.js +12 -0
  122. package/dist/blocks/dialogs/shortcuts-sheet/index.d.ts +2 -0
  123. package/dist/blocks/dialogs/shortcuts-sheet/index.js +11 -0
  124. package/dist/blocks/panes/artifacts-pane/index.d.ts +3 -0
  125. package/dist/blocks/panes/artifacts-pane/index.js +9 -0
  126. package/dist/blocks/panes/changes-pane/index.d.ts +3 -0
  127. package/dist/blocks/panes/changes-pane/index.js +9 -0
  128. package/dist/blocks/panes/file-pane/index.d.ts +3 -0
  129. package/dist/blocks/panes/file-pane/index.js +9 -0
  130. package/dist/blocks/panes/pr-pane/index.d.ts +3 -0
  131. package/dist/blocks/panes/pr-pane/index.js +10 -0
  132. package/dist/blocks/panes/side-pane/index.d.ts +5 -0
  133. package/dist/blocks/panes/side-pane/index.js +21 -0
  134. package/dist/blocks/panes/tasks-pane/index.d.ts +3 -0
  135. package/dist/blocks/panes/tasks-pane/index.js +10 -0
  136. package/dist/blocks/panes/terminal-pane/index.d.ts +3 -0
  137. package/dist/blocks/panes/terminal-pane/index.js +9 -0
  138. package/dist/blocks/panes/usage-pane/index.d.ts +4 -0
  139. package/dist/blocks/panes/usage-pane/index.js +11 -0
  140. package/dist/blocks/profiles/profile-onboarding/index.d.ts +4 -0
  141. package/dist/blocks/profiles/profile-onboarding/index.js +11 -0
  142. package/dist/blocks/profiles/profile-switcher/index.d.ts +4 -0
  143. package/dist/blocks/profiles/profile-switcher/index.js +11 -0
  144. package/dist/blocks/profiles/profile-usage/index.d.ts +4 -0
  145. package/dist/blocks/profiles/profile-usage/index.js +10 -0
  146. package/dist/blocks/sessions/inbox/index.d.ts +2 -0
  147. package/dist/blocks/sessions/inbox/index.js +11 -0
  148. package/dist/blocks/sessions/session-board/index.d.ts +4 -0
  149. package/dist/blocks/sessions/session-board/index.js +26 -0
  150. package/dist/blocks/sessions/session-sidebar/index.d.ts +5 -0
  151. package/dist/blocks/sessions/session-sidebar/index.js +15 -0
  152. package/dist/blocks/settings/extensions/index.d.ts +2 -0
  153. package/dist/blocks/settings/extensions/index.js +9 -0
  154. package/dist/blocks/settings/hooks/index.d.ts +4 -0
  155. package/dist/blocks/settings/hooks/index.js +9 -0
  156. package/dist/blocks/settings/mcp-servers/index.d.ts +4 -0
  157. package/dist/blocks/settings/mcp-servers/index.js +9 -0
  158. package/dist/blocks/settings/memory/index.d.ts +4 -0
  159. package/dist/blocks/settings/memory/index.js +8 -0
  160. package/dist/blocks/settings/notifications/index.d.ts +2 -0
  161. package/dist/blocks/settings/notifications/index.js +8 -0
  162. package/dist/blocks/settings/permission-rules/index.d.ts +3 -0
  163. package/dist/blocks/settings/permission-rules/index.js +10 -0
  164. package/dist/blocks/settings/plugin-catalog/index.d.ts +2 -0
  165. package/dist/blocks/settings/plugin-catalog/index.js +11 -0
  166. package/dist/blocks/settings/plugins/index.d.ts +4 -0
  167. package/dist/blocks/settings/plugins/index.js +9 -0
  168. package/dist/blocks/settings/settings-window/index.d.ts +4 -0
  169. package/dist/blocks/settings/settings-window/index.js +8 -0
  170. package/dist/blocks/settings/worktrees/index.d.ts +4 -0
  171. package/dist/blocks/settings/worktrees/index.js +9 -0
  172. package/dist/components/conversation/agent-run/index.d.ts +3 -0
  173. package/dist/components/conversation/agent-run/index.js +10 -0
  174. package/dist/components/conversation/chapter-nav/index.d.ts +2 -0
  175. package/dist/components/conversation/chapter-nav/index.js +11 -0
  176. package/dist/components/conversation/message/index.d.ts +2 -0
  177. package/dist/components/conversation/message/index.js +15 -0
  178. package/dist/components/conversation/reasoning/index.d.ts +2 -0
  179. package/dist/components/conversation/reasoning/index.js +8 -0
  180. package/dist/components/conversation/recap/index.d.ts +2 -0
  181. package/dist/components/conversation/recap/index.js +9 -0
  182. package/dist/components/conversation/todo-list/index.d.ts +2 -0
  183. package/dist/components/conversation/todo-list/index.js +9 -0
  184. package/dist/components/conversation/tool-call/index.d.ts +3 -0
  185. package/dist/components/conversation/tool-call/index.js +13 -0
  186. package/dist/components/conversation/work-summary/index.d.ts +2 -0
  187. package/dist/components/conversation/work-summary/index.js +10 -0
  188. package/dist/components/prompts/permission-request/index.d.ts +2 -0
  189. package/dist/components/prompts/permission-request/index.js +9 -0
  190. package/dist/components/prompts/plan-approval/index.d.ts +2 -0
  191. package/dist/components/prompts/plan-approval/index.js +9 -0
  192. package/dist/components/prompts/prompt-card/index.d.ts +3 -0
  193. package/dist/components/prompts/prompt-card/index.js +8 -0
  194. package/dist/components/prompts/question-prompt/index.d.ts +2 -0
  195. package/dist/components/prompts/question-prompt/index.js +9 -0
  196. package/dist/index.d.ts +50 -0
  197. package/dist/index.js +231 -0
  198. package/dist/lib/config-parts.d.ts +2 -0
  199. package/dist/lib/config-parts.js +16 -0
  200. package/dist/lib/icons.d.ts +2 -0
  201. package/dist/lib/icons.js +10 -0
  202. package/dist/lib/pace-bar.d.ts +11 -0
  203. package/dist/lib/pace-bar.js +6 -0
  204. package/dist/lib/pace.d.ts +4 -0
  205. package/dist/lib/pace.js +12 -0
  206. package/dist/lib/pane-parts.d.ts +25 -0
  207. package/dist/lib/pane-parts.js +11 -0
  208. package/dist/lib/row-trigger.d.ts +5 -0
  209. package/dist/lib/row-trigger.js +7 -0
  210. package/dist/lib/settings-parts.d.ts +70 -0
  211. package/dist/lib/settings-parts.js +24 -0
  212. package/dist/lib/side-pane-types.d.ts +2 -0
  213. package/dist/lib/side-pane-types.js +1 -0
  214. package/dist/lib/status-glyph.d.ts +8 -0
  215. package/dist/lib/status-glyph.js +12 -0
  216. package/dist/lib/types.d.ts +3 -0
  217. package/dist/lib/types.js +1 -0
  218. package/dist/shared/chunk-04a497rr.js +21 -0
  219. package/dist/shared/chunk-13yf0mza.d.ts +70 -0
  220. package/dist/shared/chunk-1aq2xzv5.js +558 -0
  221. package/dist/shared/chunk-1f96cz69.js +45 -0
  222. package/dist/shared/chunk-1yt061np.d.ts +64 -0
  223. package/dist/shared/chunk-218qabm5.js +250 -0
  224. package/dist/shared/chunk-2fk5aq60.js +313 -0
  225. package/dist/shared/chunk-4248zvmh.js +177 -0
  226. package/dist/shared/chunk-45rqgey6.d.ts +25 -0
  227. package/dist/shared/chunk-4n0v64qx.js +179 -0
  228. package/dist/shared/chunk-4zvhpf2x.js +55 -0
  229. package/dist/shared/chunk-57hzzmjd.d.ts +67 -0
  230. package/dist/shared/chunk-58qvny6a.d.ts +29 -0
  231. package/dist/shared/chunk-5fhkkn39.js +130 -0
  232. package/dist/shared/chunk-5hw0525a.d.ts +33 -0
  233. package/dist/shared/chunk-5k6xwqfj.d.ts +68 -0
  234. package/dist/shared/chunk-5meda998.js +238 -0
  235. package/dist/shared/chunk-5pqksw7z.js +91 -0
  236. package/dist/shared/chunk-6220dy5n.js +70 -0
  237. package/dist/shared/chunk-64bnh22t.d.ts +59 -0
  238. package/dist/shared/chunk-66sh633m.d.ts +60 -0
  239. package/dist/shared/chunk-6cmf27g3.d.ts +81 -0
  240. package/dist/shared/chunk-6g4970a6.d.ts +20 -0
  241. package/dist/shared/chunk-75zwypyr.d.ts +43 -0
  242. package/dist/shared/chunk-7rzjmcnh.d.ts +30 -0
  243. package/dist/shared/chunk-7zvb39cf.d.ts +26 -0
  244. package/dist/shared/chunk-8mecznyr.js +357 -0
  245. package/dist/shared/chunk-8pag6vmd.js +255 -0
  246. package/dist/shared/chunk-8xg5gwwy.js +38 -0
  247. package/dist/shared/chunk-9kw6m047.d.ts +32 -0
  248. package/dist/shared/chunk-a4s440b6.js +79 -0
  249. package/dist/shared/chunk-at0jje23.d.ts +110 -0
  250. package/dist/shared/chunk-awd573h9.js +34 -0
  251. package/dist/shared/chunk-b171wjge.d.ts +25 -0
  252. package/dist/shared/chunk-bh2b5d1z.js +98 -0
  253. package/dist/shared/chunk-bzs6amnv.js +187 -0
  254. package/dist/shared/chunk-c36qvrwq.d.ts +30 -0
  255. package/dist/shared/chunk-c8wp058j.js +153 -0
  256. package/dist/shared/chunk-cd4f87as.d.ts +28 -0
  257. package/dist/shared/chunk-cmwby8f9.js +467 -0
  258. package/dist/shared/chunk-d2t72h4x.d.ts +35 -0
  259. package/dist/shared/chunk-dh3qy5fj.js +49 -0
  260. package/dist/shared/chunk-e46apgve.d.ts +40 -0
  261. package/dist/shared/chunk-ejtknc0w.js +21 -0
  262. package/dist/shared/chunk-eqajdxn8.js +82 -0
  263. package/dist/shared/chunk-fbn0h7cr.js +123 -0
  264. package/dist/shared/chunk-fqhcz6ss.d.ts +29 -0
  265. package/dist/shared/chunk-g28hweee.d.ts +35 -0
  266. package/dist/shared/chunk-g88hweqh.d.ts +70 -0
  267. package/dist/shared/chunk-gewnsgza.js +61 -0
  268. package/dist/shared/chunk-gkyk663q.d.ts +53 -0
  269. package/dist/shared/chunk-hd4gtj5z.d.ts +23 -0
  270. package/dist/shared/chunk-hxjgey30.d.ts +36 -0
  271. package/dist/shared/chunk-jkkdq1mh.d.ts +213 -0
  272. package/dist/shared/chunk-jpq101w3.js +91 -0
  273. package/dist/shared/chunk-k3bv9k1v.d.ts +56 -0
  274. package/dist/shared/chunk-k5zegxje.d.ts +81 -0
  275. package/dist/shared/chunk-kreypnzp.d.ts +34 -0
  276. package/dist/shared/chunk-kw9npka5.js +224 -0
  277. package/dist/shared/chunk-mrb3fp2f.d.ts +30 -0
  278. package/dist/shared/chunk-n1qq2wp9.js +6 -0
  279. package/dist/shared/chunk-n4742y54.js +39 -0
  280. package/dist/shared/chunk-ndjvdkv7.d.ts +29 -0
  281. package/dist/shared/chunk-nk4578dr.js +73 -0
  282. package/dist/shared/chunk-paezqfg1.js +106 -0
  283. package/dist/shared/chunk-qemm9e3r.d.ts +21 -0
  284. package/dist/shared/chunk-qhxz1etk.js +96 -0
  285. package/dist/shared/chunk-qj5ev9ak.js +531 -0
  286. package/dist/shared/chunk-qnwggvjy.js +150 -0
  287. package/dist/shared/chunk-r5hz78pb.js +129 -0
  288. package/dist/shared/chunk-r6nb21kz.d.ts +102 -0
  289. package/dist/shared/chunk-rjfwje37.d.ts +234 -0
  290. package/dist/shared/chunk-rqrpvvz4.d.ts +107 -0
  291. package/dist/shared/chunk-rzajcn44.d.ts +49 -0
  292. package/dist/shared/chunk-s3r759ec.js +80 -0
  293. package/dist/shared/chunk-sdtjrw9w.d.ts +98 -0
  294. package/dist/shared/chunk-sfqvyzcs.d.ts +68 -0
  295. package/dist/shared/chunk-skg3m9m0.js +56 -0
  296. package/dist/shared/chunk-szkvrqg1.d.ts +54 -0
  297. package/dist/shared/chunk-t21t9x7e.js +188 -0
  298. package/dist/shared/chunk-tc75ng2c.js +235 -0
  299. package/dist/shared/chunk-tkx1krwc.js +88 -0
  300. package/dist/shared/chunk-tprdqtb1.d.ts +30 -0
  301. package/dist/shared/chunk-tv9a1sek.js +137 -0
  302. package/dist/shared/chunk-tvbd27hg.d.ts +43 -0
  303. package/dist/shared/chunk-v6yevw62.d.ts +28 -0
  304. package/dist/shared/chunk-v9q38p0x.js +258 -0
  305. package/dist/shared/chunk-vd59gzzd.js +86 -0
  306. package/dist/shared/chunk-vgh4f3sv.js +118 -0
  307. package/dist/shared/chunk-vjht1zn1.js +391 -0
  308. package/dist/shared/chunk-vsrkb0sp.d.ts +21 -0
  309. package/dist/shared/chunk-w5z8qnf8.js +175 -0
  310. package/dist/shared/chunk-wgvzavx1.js +1488 -0
  311. package/dist/shared/chunk-whsx7yp9.d.ts +37 -0
  312. package/dist/shared/chunk-x7az5x1y.d.ts +57 -0
  313. package/dist/shared/chunk-x9jf26yb.js +318 -0
  314. package/dist/shared/chunk-xbrrt07s.d.ts +23 -0
  315. package/dist/shared/chunk-xkchhs2z.js +129 -0
  316. package/dist/shared/chunk-xzfrskd7.js +202 -0
  317. package/dist/shared/chunk-y4cj4y54.js +423 -0
  318. package/dist/shared/chunk-y934at6m.js +7 -0
  319. package/dist/shared/chunk-zbpwhpjy.d.ts +75 -0
  320. package/dist/shared/chunk-zfhmbb7n.js +63 -0
  321. package/dist/shared/chunk-zk0t4vq5.js +71 -0
  322. package/dist/shared/chunk-znp9gna7.d.ts +23 -0
  323. package/dist/styles.css +467 -0
  324. package/index.ts +49 -0
  325. package/lib/config-parts.tsx +97 -0
  326. package/lib/icons.tsx +149 -0
  327. package/lib/pace-bar.tsx +24 -0
  328. package/lib/pace.ts +74 -0
  329. package/lib/pane-parts.tsx +76 -0
  330. package/lib/row-trigger.tsx +44 -0
  331. package/lib/settings-parts.tsx +232 -0
  332. package/lib/side-pane-types.ts +75 -0
  333. package/lib/status-glyph.tsx +25 -0
  334. package/lib/types.ts +204 -0
  335. package/mock/demo-reply.tsx +33 -0
  336. package/mock/demo-session.tsx +150 -0
  337. package/mock/mock-config.ts +173 -0
  338. package/mock/mock-extras.ts +288 -0
  339. package/mock/mock-panes.ts +190 -0
  340. package/mock/mock-settings.ts +92 -0
  341. package/mock/mock.ts +548 -0
  342. package/mock/screen-frame.tsx +49 -0
  343. package/package.json +114 -4
package/mock/mock.ts ADDED
@@ -0,0 +1,548 @@
1
+ /*!
2
+ * Local addition: the AI app's mock data for the pages under pages/ and
3
+ * the AI blocks' docs examples. Everything here is made up; nothing talks to
4
+ * a backend.
5
+ */
6
+
7
+ import type {
8
+ Artifact,
9
+ BackgroundTask,
10
+ Change,
11
+ Check,
12
+ Command,
13
+ Hook,
14
+ McpServer,
15
+ MemoryFile,
16
+ Model,
17
+ PermissionMode,
18
+ Plugin,
19
+ Profile,
20
+ Project,
21
+ Session,
22
+ SessionGroup,
23
+ Worktree,
24
+ } from '../lib/types'
25
+
26
+ export const PROFILES: Profile[] = [
27
+ {
28
+ id: 'jobiflow',
29
+ name: 'jobiflow',
30
+ configDir: '~/.claude-jobiflow',
31
+ plan: 'Max 20×',
32
+ provider: 'anthropic',
33
+ account: 'Jobiflow',
34
+ defaultModel: 'Opus 5.5',
35
+ limits: [
36
+ { label: 'Session (5h)', value: 0.42, detail: '42% · resets 16:20', windowHours: 5, resetsInHours: 2.3 },
37
+ { label: 'Weekly, all models', value: 0.61, detail: '61% · resets Mon', windowHours: 168, resetsInHours: 20 },
38
+ { label: 'Weekly, Opus', value: 0.78, detail: '78% · resets Mon', windowHours: 168, resetsInHours: 20 },
39
+ ],
40
+ running: 2,
41
+ },
42
+ {
43
+ id: 'work',
44
+ name: 'work',
45
+ configDir: '~/.claude-work',
46
+ plan: 'Team',
47
+ provider: 'anthropic',
48
+ account: 'Acme Corp',
49
+ defaultModel: 'Sonnet 5.5',
50
+ limits: [
51
+ { label: 'Session (5h)', value: 0.93, detail: '93% · resets 14:05', windowHours: 5, resetsInHours: 1.2 },
52
+ { label: 'Weekly, all models', value: 0.4, detail: '40% · resets Thu', windowHours: 168, resetsInHours: 100 },
53
+ ],
54
+ running: 1,
55
+ },
56
+ {
57
+ id: 'work-personal',
58
+ name: 'work-personal',
59
+ configDir: '~/.claude-work-personal',
60
+ plan: 'Pro',
61
+ provider: 'anthropic',
62
+ account: 'Personal',
63
+ defaultModel: 'Sonnet 5.5',
64
+ limits: [
65
+ { label: 'Session (5h)', value: 0.08, detail: '8% · resets 18:40', windowHours: 5, resetsInHours: 4.4 },
66
+ { label: 'Weekly, all models', value: 0.22, detail: '22% · resets Sat', windowHours: 168, resetsInHours: 110 },
67
+ ],
68
+ running: 0,
69
+ },
70
+ {
71
+ id: 'zcode',
72
+ name: 'zcode',
73
+ configDir: '~/.claude-zcode',
74
+ plan: 'GLM Coding Pro',
75
+ provider: 'compatible',
76
+ baseUrl: 'https://api.z.ai/api/anthropic',
77
+ account: 'Z.ai',
78
+ defaultModel: 'GLM-4.6',
79
+ limits: [
80
+ { label: 'Prompts (5h)', value: 0.35, detail: '210 / 600 · resets 15:00', windowHours: 5, resetsInHours: 3 },
81
+ ],
82
+ running: 0,
83
+ },
84
+ ]
85
+
86
+ export const PINNED: Session[] = [
87
+ {
88
+ id: 'ai-app',
89
+ title: 'Design the AI app',
90
+ status: 'running',
91
+ profile: 'jobiflow',
92
+ updated: 'now',
93
+ branch: 'claude/ai-app',
94
+ pinned: true,
95
+ project: 'modo',
96
+ tasks: { done: 3, total: 6 },
97
+ lastLine: 'Running bun run check',
98
+ reply: 'The board now follows the sidebar: same groups, same glyphs. Typechecking before the narrow pass.',
99
+ work: {
100
+ summary: 'Working…',
101
+ detail: '3 tool calls',
102
+ tools: [
103
+ { tool: 'Edit', summary: 'ui/blocks/AI/session-board/index.tsx', meta: '+214 −160' },
104
+ { tool: 'Bash', summary: 'bunx tsc -p ui --noEmit' },
105
+ ],
106
+ },
107
+ },
108
+ {
109
+ id: 'release-notes',
110
+ title: 'Weekly release notes',
111
+ status: 'idle',
112
+ profile: 'work',
113
+ updated: '2d',
114
+ pinned: true,
115
+ project: 'jobiflow-api',
116
+ lastLine: 'Posted to #releases',
117
+ reply: 'Posted the notes to #releases: 14 merged PRs, two of them breaking, each with its migration line.',
118
+ work: {
119
+ summary: 'Worked for 1m 12s',
120
+ detail: '3 tool calls',
121
+ tools: [
122
+ { tool: 'Bash', summary: 'gh pr list --state merged --search "merged:>=2026-11-08"', meta: '14 PRs' },
123
+ { tool: 'MCP', summary: 'slack · post_message #releases' },
124
+ ],
125
+ },
126
+ },
127
+ ]
128
+
129
+ export const GROUPS: SessionGroup[] = [
130
+ {
131
+ label: 'modo',
132
+ kind: 'project',
133
+ path: '~/Projects/justanarthur/modo',
134
+ sessions: [
135
+ {
136
+ id: 'canvas',
137
+ title: 'Canvas page and pages tier',
138
+ status: 'waiting',
139
+ profile: 'jobiflow',
140
+ updated: '3m',
141
+ branch: 'feat/lib-canvas',
142
+ waitingOn: 'Permission · Bash: git worktree prune',
143
+ tasks: { done: 4, total: 5 },
144
+ reply: 'The pages tier renders on the canvas. The lib-canvas worktree is merged, so I want to prune it.',
145
+ work: {
146
+ summary: 'Worked for 2m 04s',
147
+ detail: '11 tool calls · 1 agent',
148
+ tools: [
149
+ { tool: 'Edit', summary: 'lib/src/runtime/canvas/CanvasPage.tsx', meta: '+48 −12' },
150
+ { tool: 'Bash', summary: 'git branch --merged main', meta: '3 branches' },
151
+ ],
152
+ },
153
+ prompt: { kind: 'permission', tool: 'Bash', command: 'git worktree prune', rule: 'git worktree *' },
154
+ children: [
155
+ {
156
+ id: 'canvas-zoom',
157
+ title: 'Zoom controls follow the cursor',
158
+ status: 'running',
159
+ profile: 'jobiflow',
160
+ updated: '1m',
161
+ tasks: { done: 1, total: 4 },
162
+ lastLine: 'Editing CanvasPage.tsx',
163
+ },
164
+ {
165
+ id: 'canvas-docs',
166
+ title: 'Document the canvas hooks',
167
+ status: 'unread',
168
+ profile: 'jobiflow',
169
+ updated: '6m',
170
+ lastLine: 'Added the canvas hooks to AGENTS.md',
171
+ },
172
+ ],
173
+ },
174
+ {
175
+ id: 'meter',
176
+ title: 'Add a Meter component',
177
+ status: 'unread',
178
+ profile: 'jobiflow',
179
+ updated: '12m',
180
+ lastLine: 'Meter is in, with bar and ring variants',
181
+ reply:
182
+ 'Meter is in, with bar, line and ring variants. It turns amber at 80% and red at 95% unless told otherwise.',
183
+ work: {
184
+ summary: 'Worked for 4m 30s',
185
+ detail: '18 tool calls',
186
+ tools: [
187
+ { tool: 'Write', summary: 'ui/components/meter/index.tsx', meta: '+186' },
188
+ { tool: 'Bash', summary: 'bun run lint', meta: 'clean' },
189
+ ],
190
+ },
191
+ },
192
+ {
193
+ id: 'parser',
194
+ title: 'TSDoc parser drops @values',
195
+ status: 'idle',
196
+ profile: 'work-personal',
197
+ updated: '1h',
198
+ lastLine: 'Waiting for a repro',
199
+ },
200
+ ],
201
+ },
202
+ {
203
+ label: 'jobiflow-api',
204
+ kind: 'project',
205
+ path: '~/Projects/jobiflow/api',
206
+ sessions: [
207
+ {
208
+ id: 'billing',
209
+ title: 'Stripe webhook retries',
210
+ status: 'running',
211
+ profile: 'work',
212
+ updated: 'now',
213
+ branch: 'fix/webhook-retries',
214
+ tasks: { done: 2, total: 3 },
215
+ lastLine: 'Running the webhook tests',
216
+ reply: 'Retries now back off exponentially and stop after five attempts. Running the webhook tests.',
217
+ work: {
218
+ summary: 'Working…',
219
+ detail: '7 tool calls',
220
+ tools: [
221
+ { tool: 'Edit', summary: 'src/billing/webhooks.ts', meta: '+31 −9' },
222
+ { tool: 'Bash', summary: 'bun test webhooks' },
223
+ ],
224
+ },
225
+ },
226
+ {
227
+ id: 'pg',
228
+ title: 'Migrate to Postgres 17',
229
+ status: 'waiting',
230
+ profile: 'work',
231
+ updated: '3h',
232
+ waitingOn: 'Question · Run the migration on staging first?',
233
+ reply: 'The migration script is ready and passes against a local Postgres 17. Where should it run first?',
234
+ work: {
235
+ summary: 'Worked for 3m 41s',
236
+ detail: '9 tool calls',
237
+ tools: [
238
+ { tool: 'Write', summary: 'migrations/0042_pg17.sql', meta: '+64' },
239
+ { tool: 'Bash', summary: 'docker compose run db-17 psql -f migrations/0042_pg17.sql', meta: 'ok' },
240
+ ],
241
+ },
242
+ prompt: {
243
+ kind: 'question',
244
+ tag: 'Migration',
245
+ question: 'Run the migration on staging first?',
246
+ options: [
247
+ { label: 'Staging first (Recommended)', description: 'Run it there, compare row counts, then production' },
248
+ { label: 'Straight to production', description: 'In the next maintenance window' },
249
+ { label: 'Dry run only', description: 'Print the plan and stop' },
250
+ ],
251
+ },
252
+ },
253
+ ],
254
+ },
255
+ {
256
+ label: 'Review queue',
257
+ kind: 'section',
258
+ sessions: [
259
+ {
260
+ id: 'glm',
261
+ title: 'Try GLM on the lint pass',
262
+ status: 'idle',
263
+ profile: 'zcode',
264
+ updated: '1d',
265
+ lastLine: 'Lint pass done, 3 fixes',
266
+ },
267
+ {
268
+ id: 'a11y',
269
+ title: 'Keyboard audit of the sidebar',
270
+ status: 'unread',
271
+ profile: 'work-personal',
272
+ updated: '1d',
273
+ lastLine: 'Found 2 focus traps',
274
+ },
275
+ ],
276
+ },
277
+ ]
278
+
279
+ export const ARCHIVED: Session[] = [
280
+ { id: 'old-1', title: 'Port the toast component', status: 'idle', profile: 'jobiflow', updated: '2w' },
281
+ { id: 'old-2', title: 'Bump UnoCSS to 66', status: 'idle', profile: 'jobiflow', updated: '3w' },
282
+ ]
283
+
284
+ export const PROJECTS: Project[] = GROUPS.flatMap(g =>
285
+ g.kind === 'project' && g.path ? [{ label: g.label, path: g.path }] : [],
286
+ )
287
+
288
+ export const BRANCHES = ['main', 'feat/v1-lib-fixes', 'refactor/clean-ds']
289
+
290
+ export const MODELS: Model[] = [
291
+ { name: 'Opus 5.5', note: 'Most capable' },
292
+ { name: 'Sonnet 5.5', note: 'Fast and capable' },
293
+ { name: 'Haiku 5.5', note: 'Fastest, lightest' },
294
+ { name: 'Fable 5.2', note: 'Long context' },
295
+ ]
296
+ export const ZCODE_MODELS: Model[] = [
297
+ { name: 'GLM-4.6', note: 'Z.ai flagship' },
298
+ { name: 'GLM-4.5-Air', note: 'Z.ai, lighter' },
299
+ ]
300
+ export const EFFORTS = ['Low', 'Medium', 'High', 'Extra high', 'Max']
301
+ export const PERMISSION_MODES: PermissionMode[] = [
302
+ { label: 'Ask before edits', note: 'Asks before every edit and command', icon: 'shield-check' },
303
+ { label: 'Accept edits', note: 'Edits freely, asks before commands', icon: 'pen-line' },
304
+ { label: 'Plan mode', note: 'Reads and plans, changes nothing', icon: 'list-checks' },
305
+ { label: 'Auto', note: 'Runs safe actions, asks for risky ones', icon: 'zap' },
306
+ { label: 'Bypass permissions', note: 'Never asks; for sandboxes only', icon: 'triangle-alert' },
307
+ ]
308
+ export const OUTPUT_STYLES = ['Default', 'Concise', 'Explanatory', 'Learning']
309
+
310
+ export const COMMANDS: Command[] = [
311
+ { name: '/compact', description: 'Summarize the conversation to free context', kind: 'command' },
312
+ { name: '/clear', description: 'Start over in this session', kind: 'command' },
313
+ { name: '/model', description: 'Switch the model', kind: 'command' },
314
+ { name: '/review', description: 'Review the current diff', kind: 'command' },
315
+ { name: '/init', description: 'Write a CLAUDE.md for this repo', kind: 'command' },
316
+ { name: '/modo-ui', description: 'Craft UI in the ui design system', kind: 'skill' },
317
+ { name: '/sparse', description: 'Right-sized, readable code', kind: 'skill' },
318
+ { name: '/graphify', description: 'Turn any input into a knowledge graph', kind: 'skill' },
319
+ { name: '/ship', description: 'Merge, test, bump and open a PR', kind: 'plugin' },
320
+ { name: '/usage-report', description: 'Usage across all profiles', kind: 'plugin' },
321
+ ]
322
+
323
+ export const CHANGES: Change[] = [
324
+ {
325
+ path: 'ui/components/meter/index.tsx',
326
+ status: 'added',
327
+ added: 6,
328
+ removed: 0,
329
+ patch: `@@ -0,0 +1,6 @@
330
+ +const BAR_FILL: Record<MeterTone, string> = {
331
+ + default: 'bg-muted-foreground',
332
+ + warning: 'bg-status-warning',
333
+ + error: 'bg-status-error',
334
+ +}
335
+ +`,
336
+ },
337
+ {
338
+ path: 'ui/lib/icon-context.tsx',
339
+ status: 'modified',
340
+ added: 3,
341
+ removed: 1,
342
+ patch: `@@ -208,4 +208,6 @@ export const defaultIcons = {
343
+ folder: Folder,
344
+ - 'sliders-horizontal': SlidersHorizontal,
345
+ + 'sliders-horizontal': SlidersHorizontal,
346
+ + terminal: Terminal,
347
+ + 'git-branch': GitBranch,
348
+ }`,
349
+ },
350
+ {
351
+ path: 'ui/uno.config.ts',
352
+ status: 'modified',
353
+ added: 1,
354
+ removed: 1,
355
+ patch: `@@ -25,3 +25,3 @@ const root = dirname(fileURLToPath(import.meta.url))
356
+ -const sources = resolve(root, '{lib,primitives,components,blocks}/**/*.{ts,tsx,mdx}')
357
+ +const sources = resolve(root, '{lib,primitives,components,blocks,pages}/**/*.{ts,tsx,mdx}')
358
+ const chrome = resolve(root, 'modo.components.tsx')`,
359
+ },
360
+ ]
361
+
362
+ export const TERMINAL_LINES = [
363
+ '$ bun run lint',
364
+ 'Checked 412 files in 1.2s. No fixes applied.',
365
+ '$ bun run check',
366
+ '@justanarthur/modo-ui check: tsc --noEmit',
367
+ '@justanarthur/modo-ui check: Exited with code 0',
368
+ '$ bun run test',
369
+ ' 128 pass',
370
+ ' 0 fail',
371
+ 'Ran 128 tests across 9 files. [1.84s]',
372
+ ]
373
+
374
+ export const PR = {
375
+ number: 23,
376
+ title: 'feat(ui): AI app screens',
377
+ branch: 'claude/ai-app-design',
378
+ base: 'main',
379
+ checks: [
380
+ { name: 'lint', status: 'success', detail: '18s' },
381
+ { name: 'check', status: 'success', detail: '1m 02s' },
382
+ { name: 'test', status: 'failed', detail: 'parser › keeps @values' },
383
+ { name: 'pages / build', status: 'running', detail: 'Building 5 design systems' },
384
+ ] satisfies Check[],
385
+ comments: 2,
386
+ }
387
+
388
+ export const ARTIFACTS: Artifact[] = [
389
+ { title: 'AI app: screen map', kind: 'Page', updated: '10m' },
390
+ { title: 'Profile usage this week', kind: 'Dashboard', updated: '1h' },
391
+ { title: 'Settings IA', kind: 'Document', updated: 'Yesterday' },
392
+ ]
393
+
394
+ export const TASKS: BackgroundTask[] = [
395
+ { title: 'Explore: how pages render', kind: 'agent', status: 'done', detail: '14 tool uses · 38s' },
396
+ { title: 'bun dev ui', kind: 'shell', status: 'running', detail: 'port 5173' },
397
+ { title: 'Zoom controls follow the cursor', kind: 'session', status: 'running', detail: 'jobiflow · worktree' },
398
+ { title: 'bun run test --watch', kind: 'shell', status: 'failed', detail: 'exit 1' },
399
+ ]
400
+
401
+ export const MCP_SERVERS: McpServer[] = [
402
+ {
403
+ name: 'ai-app',
404
+ transport: 'stdio',
405
+ status: 'connected',
406
+ tools: 4,
407
+ scope: 'user',
408
+ target: 'ai-app mcp',
409
+ toolNames: ['approve_permission', 'open_pane', 'notify', 'hand_off'],
410
+ },
411
+ {
412
+ name: 'github',
413
+ transport: 'http',
414
+ status: 'connected',
415
+ tools: 38,
416
+ scope: 'user',
417
+ target: 'https://api.githubcopilot.com/mcp/',
418
+ env: ['GITHUB_TOKEN'],
419
+ toolNames: ['create_pull_request', 'get_issue', 'list_commits', 'search_code', 'merge_pull_request'],
420
+ },
421
+ {
422
+ name: 'linear',
423
+ transport: 'sse',
424
+ status: 'needs-auth',
425
+ tools: 0,
426
+ scope: 'user',
427
+ target: 'https://mcp.linear.app/sse',
428
+ authHost: 'linear.app',
429
+ },
430
+ {
431
+ name: 'postgres',
432
+ transport: 'stdio',
433
+ status: 'failed',
434
+ tools: 0,
435
+ scope: 'project',
436
+ target: 'bunx @modelcontextprotocol/server-postgres $DATABASE_URL',
437
+ env: ['DATABASE_URL'],
438
+ error:
439
+ 'Error: connect ECONNREFUSED 127.0.0.1:5432\n at TCPConnectWrap.afterConnect [as oncomplete]\nserver exited with code 1',
440
+ },
441
+ {
442
+ name: 'vercel',
443
+ transport: 'http',
444
+ status: 'needs-auth',
445
+ tools: 0,
446
+ scope: 'plugin',
447
+ target: 'https://mcp.vercel.com',
448
+ authHost: 'vercel.com',
449
+ },
450
+ ]
451
+
452
+ export const HOOKS: Hook[] = [
453
+ {
454
+ event: 'PreToolUse',
455
+ matcher: 'Bash',
456
+ command: '~/.claude/hooks/guard-rm.sh',
457
+ scope: 'user',
458
+ timeout: 10,
459
+ lastRun: { when: '2 min ago', exit: 0 },
460
+ },
461
+ {
462
+ event: 'PostToolUse',
463
+ matcher: 'Edit|Write',
464
+ command: 'bunx biome format --write $FILE',
465
+ scope: 'project',
466
+ timeout: 30,
467
+ lastRun: { when: '4 min ago', exit: 0 },
468
+ },
469
+ {
470
+ event: 'Stop',
471
+ matcher: '*',
472
+ command: 'ai-app notify --sound',
473
+ scope: 'user',
474
+ lastRun: { when: '12 min ago', exit: 0 },
475
+ },
476
+ {
477
+ event: 'SessionStart',
478
+ matcher: 'startup',
479
+ command: 'cat .claude/brief.md',
480
+ scope: 'project',
481
+ lastRun: { when: 'today 09:12', exit: 1 },
482
+ },
483
+ ]
484
+
485
+ export const PLUGINS: Plugin[] = [
486
+ { name: 'modo-ui', description: 'Craft UI in the ui design system', kind: 'skill', enabled: true },
487
+ { name: 'sparse', description: 'Right-sized, readable code', kind: 'skill', enabled: true },
488
+ { name: 'gstack', description: 'Review, QA, ship and deploy workflows', kind: 'plugin', enabled: true },
489
+ { name: 'vercel', description: 'Deployments, env vars and logs', kind: 'plugin', enabled: false },
490
+ { name: 'Browser pane', description: 'Drive a built-in browser beside the chat', kind: 'plugin', enabled: false },
491
+ { name: 'iOS simulator', description: 'Run and tap through iOS apps', kind: 'plugin', enabled: false },
492
+ ]
493
+
494
+ export const MEMORY: MemoryFile[] = [
495
+ { name: 'no-ai-coauthor', description: 'Never add AI attribution to commits or PRs', type: 'feedback' },
496
+ { name: 'disk-hygiene', description: 'Work under ~/Projects, remove worktrees when done', type: 'feedback' },
497
+ { name: 'modo-releases', description: 'Scoped commits publish lib and ui', type: 'project' },
498
+ { name: 'arthur', description: 'Builds modo; prefers terse, token-only UI', type: 'user' },
499
+ ]
500
+
501
+ export const WORKTREES: Worktree[] = [
502
+ {
503
+ path: '.claude/worktrees/ai-app',
504
+ branch: 'claude/ai-app',
505
+ session: 'Design the AI app',
506
+ size: '1.2 GB',
507
+ state: 'active',
508
+ },
509
+ {
510
+ path: '.claude/worktrees/canvas-zoom',
511
+ branch: 'claude/canvas-zoom',
512
+ session: 'Zoom controls follow the cursor',
513
+ size: '940 MB',
514
+ state: 'active',
515
+ },
516
+ {
517
+ path: '.worktrees/lib-canvas',
518
+ branch: 'feat/lib-canvas',
519
+ session: 'Canvas page and pages tier',
520
+ size: '1.4 GB',
521
+ state: 'merged',
522
+ },
523
+ {
524
+ path: '.worktrees/old-toast',
525
+ branch: 'feat/toast',
526
+ session: 'Port the toast component',
527
+ size: '880 MB',
528
+ state: 'stale',
529
+ },
530
+ ]
531
+
532
+ export const FILES = [...CHANGES.map(c => c.path), 'ui/DESIGN.md', 'ui/AGENTS.md', 'lib/src/runtime/routes.tsx']
533
+
534
+ /** The session lists every sessions block takes: spread it, `<SessionSidebar {...SESSIONS} />`. */
535
+ export const SESSIONS = { pinned: PINNED, groups: GROUPS, archived: ARCHIVED, profiles: PROFILES }
536
+
537
+ /** What the composer's menus offer: spread it, `<Composer {...COMPOSER} />`. */
538
+ export const COMPOSER = {
539
+ models: MODELS,
540
+ efforts: EFFORTS,
541
+ permissionModes: PERMISSION_MODES,
542
+ outputStyles: OUTPUT_STYLES,
543
+ commands: COMMANDS,
544
+ files: FILES,
545
+ projects: PROJECTS,
546
+ branches: BRANCHES,
547
+ profiles: PROFILES,
548
+ }
@@ -0,0 +1,49 @@
1
+ /*!
2
+ * Local addition: a window-sized stage for the AI app's screens. It
3
+ * lays the screen out at a fixed window size and scales the whole thing down
4
+ * to the width it gets (CSS zoom, as the docs' bento previews do), so a
5
+ * 1280px desktop window reads whole inside a docs column. Below that size it
6
+ * stays at 1:1.
7
+ */
8
+
9
+ 'use client'
10
+
11
+ import { useShape } from '@justanarthur/modo-ui/lib/shape-context'
12
+ import { cn } from '@justanarthur/modo-ui/lib/utils'
13
+ import { type ReactNode, useLayoutEffect, useRef, useState } from 'react'
14
+
15
+ export interface ScreenFrameProps {
16
+ /** The window's width in px. Defaults to `1280`. */
17
+ width?: number
18
+ /** The window's height in px. Defaults to `800`. */
19
+ height?: number
20
+ children: ReactNode
21
+ className?: string
22
+ }
23
+
24
+ export function ScreenFrame({ width = 1280, height = 800, children, className }: ScreenFrameProps) {
25
+ const shape = useShape()
26
+ const outer = useRef<HTMLDivElement | null>(null)
27
+ const [scale, setScale] = useState(1)
28
+
29
+ useLayoutEffect(() => {
30
+ const el = outer.current
31
+ if (!el) return
32
+ const observer = new ResizeObserver(([entry]) => {
33
+ if (entry) setScale(Math.min(1, entry.contentRect.width / width))
34
+ })
35
+ observer.observe(el)
36
+ return () => observer.disconnect()
37
+ }, [width])
38
+
39
+ return (
40
+ <div ref={outer} className="w-full" style={{ height: height * scale }}>
41
+ <div
42
+ className={cn('overflow-hidden border border-border bg-background', shape.container, className)}
43
+ style={{ width, height, zoom: scale }}
44
+ >
45
+ {children}
46
+ </div>
47
+ </div>
48
+ )
49
+ }