@major-tech/ui 0.0.0-stage → 1.0.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 (495) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/THIRD_PARTY_NOTICES.md +27 -0
  3. package/dist/components/accordion.d.ts +33 -0
  4. package/dist/components/accordion.d.ts.map +1 -0
  5. package/dist/components/accordion.js +51 -0
  6. package/dist/components/accordion.js.map +1 -0
  7. package/dist/components/activity-chart.d.ts +26 -0
  8. package/dist/components/activity-chart.d.ts.map +1 -0
  9. package/dist/components/activity-chart.js +56 -0
  10. package/dist/components/activity-chart.js.map +1 -0
  11. package/dist/components/alert-dialog.d.ts +28 -0
  12. package/dist/components/alert-dialog.d.ts.map +1 -0
  13. package/dist/components/alert-dialog.js +51 -0
  14. package/dist/components/alert-dialog.js.map +1 -0
  15. package/dist/components/alert.d.ts +34 -0
  16. package/dist/components/alert.d.ts.map +1 -0
  17. package/dist/components/alert.js +59 -0
  18. package/dist/components/alert.js.map +1 -0
  19. package/dist/components/ask-user-question.d.ts +103 -0
  20. package/dist/components/ask-user-question.d.ts.map +1 -0
  21. package/dist/components/ask-user-question.js +401 -0
  22. package/dist/components/ask-user-question.js.map +1 -0
  23. package/dist/components/attachment-gallery.d.ts +137 -0
  24. package/dist/components/attachment-gallery.d.ts.map +1 -0
  25. package/dist/components/attachment-gallery.js +317 -0
  26. package/dist/components/attachment-gallery.js.map +1 -0
  27. package/dist/components/avatar.d.ts +37 -0
  28. package/dist/components/avatar.d.ts.map +1 -0
  29. package/dist/components/avatar.js +62 -0
  30. package/dist/components/avatar.js.map +1 -0
  31. package/dist/components/badge.d.ts +29 -0
  32. package/dist/components/badge.d.ts.map +1 -0
  33. package/dist/components/badge.js +50 -0
  34. package/dist/components/badge.js.map +1 -0
  35. package/dist/components/brand-tile.d.ts +33 -0
  36. package/dist/components/brand-tile.d.ts.map +1 -0
  37. package/dist/components/brand-tile.js +36 -0
  38. package/dist/components/brand-tile.js.map +1 -0
  39. package/dist/components/button.d.ts +51 -0
  40. package/dist/components/button.d.ts.map +1 -0
  41. package/dist/components/button.js +90 -0
  42. package/dist/components/button.js.map +1 -0
  43. package/dist/components/calendar.d.ts +18 -0
  44. package/dist/components/calendar.d.ts.map +1 -0
  45. package/dist/components/calendar.js +78 -0
  46. package/dist/components/calendar.js.map +1 -0
  47. package/dist/components/card.d.ts +18 -0
  48. package/dist/components/card.d.ts.map +1 -0
  49. package/dist/components/card.js +34 -0
  50. package/dist/components/card.js.map +1 -0
  51. package/dist/components/carousel.d.ts +48 -0
  52. package/dist/components/carousel.d.ts.map +1 -0
  53. package/dist/components/carousel.js +227 -0
  54. package/dist/components/carousel.js.map +1 -0
  55. package/dist/components/catalog-card.d.ts +29 -0
  56. package/dist/components/catalog-card.d.ts.map +1 -0
  57. package/dist/components/catalog-card.js +20 -0
  58. package/dist/components/catalog-card.js.map +1 -0
  59. package/dist/components/chart.d.ts +118 -0
  60. package/dist/components/chart.d.ts.map +1 -0
  61. package/dist/components/chart.js +209 -0
  62. package/dist/components/chart.js.map +1 -0
  63. package/dist/components/checkbox.d.ts +8 -0
  64. package/dist/components/checkbox.d.ts.map +1 -0
  65. package/dist/components/checkbox.js +14 -0
  66. package/dist/components/checkbox.js.map +1 -0
  67. package/dist/components/chip.d.ts +68 -0
  68. package/dist/components/chip.d.ts.map +1 -0
  69. package/dist/components/chip.js +100 -0
  70. package/dist/components/chip.js.map +1 -0
  71. package/dist/components/code-block.d.ts +99 -0
  72. package/dist/components/code-block.d.ts.map +1 -0
  73. package/dist/components/code-block.js +144 -0
  74. package/dist/components/code-block.js.map +1 -0
  75. package/dist/components/collapsible.d.ts +17 -0
  76. package/dist/components/collapsible.d.ts.map +1 -0
  77. package/dist/components/collapsible.js +25 -0
  78. package/dist/components/collapsible.js.map +1 -0
  79. package/dist/components/command.d.ts +51 -0
  80. package/dist/components/command.d.ts.map +1 -0
  81. package/dist/components/command.js +120 -0
  82. package/dist/components/command.js.map +1 -0
  83. package/dist/components/composer.d.ts +211 -0
  84. package/dist/components/composer.d.ts.map +1 -0
  85. package/dist/components/composer.js +605 -0
  86. package/dist/components/composer.js.map +1 -0
  87. package/dist/components/connector-request.d.ts +63 -0
  88. package/dist/components/connector-request.d.ts.map +1 -0
  89. package/dist/components/connector-request.js +57 -0
  90. package/dist/components/connector-request.js.map +1 -0
  91. package/dist/components/context-menu.d.ts +26 -0
  92. package/dist/components/context-menu.d.ts.map +1 -0
  93. package/dist/components/context-menu.js +33 -0
  94. package/dist/components/context-menu.js.map +1 -0
  95. package/dist/components/data-table.d.ts +61 -0
  96. package/dist/components/data-table.d.ts.map +1 -0
  97. package/dist/components/data-table.js +79 -0
  98. package/dist/components/data-table.js.map +1 -0
  99. package/dist/components/date-range-picker.d.ts +54 -0
  100. package/dist/components/date-range-picker.d.ts.map +1 -0
  101. package/dist/components/date-range-picker.js +451 -0
  102. package/dist/components/date-range-picker.js.map +1 -0
  103. package/dist/components/dialog.d.ts +46 -0
  104. package/dist/components/dialog.d.ts.map +1 -0
  105. package/dist/components/dialog.js +75 -0
  106. package/dist/components/dialog.js.map +1 -0
  107. package/dist/components/drawer.d.ts +85 -0
  108. package/dist/components/drawer.d.ts.map +1 -0
  109. package/dist/components/drawer.js +166 -0
  110. package/dist/components/drawer.js.map +1 -0
  111. package/dist/components/dropdown-menu.d.ts +77 -0
  112. package/dist/components/dropdown-menu.d.ts.map +1 -0
  113. package/dist/components/dropdown-menu.js +112 -0
  114. package/dist/components/dropdown-menu.js.map +1 -0
  115. package/dist/components/editor-tabs.d.ts +49 -0
  116. package/dist/components/editor-tabs.d.ts.map +1 -0
  117. package/dist/components/editor-tabs.js +157 -0
  118. package/dist/components/editor-tabs.js.map +1 -0
  119. package/dist/components/empty-state.d.ts +21 -0
  120. package/dist/components/empty-state.d.ts.map +1 -0
  121. package/dist/components/empty-state.js +14 -0
  122. package/dist/components/empty-state.js.map +1 -0
  123. package/dist/components/entity-card.d.ts +301 -0
  124. package/dist/components/entity-card.d.ts.map +1 -0
  125. package/dist/components/entity-card.js +392 -0
  126. package/dist/components/entity-card.js.map +1 -0
  127. package/dist/components/entity-row.d.ts +37 -0
  128. package/dist/components/entity-row.d.ts.map +1 -0
  129. package/dist/components/entity-row.js +65 -0
  130. package/dist/components/entity-row.js.map +1 -0
  131. package/dist/components/env-var-request.d.ts +51 -0
  132. package/dist/components/env-var-request.d.ts.map +1 -0
  133. package/dist/components/env-var-request.js +50 -0
  134. package/dist/components/env-var-request.js.map +1 -0
  135. package/dist/components/field.d.ts +30 -0
  136. package/dist/components/field.d.ts.map +1 -0
  137. package/dist/components/field.js +48 -0
  138. package/dist/components/field.js.map +1 -0
  139. package/dist/components/file-upload.d.ts +108 -0
  140. package/dist/components/file-upload.d.ts.map +1 -0
  141. package/dist/components/file-upload.js +217 -0
  142. package/dist/components/file-upload.js.map +1 -0
  143. package/dist/components/hover-card.d.ts +18 -0
  144. package/dist/components/hover-card.d.ts.map +1 -0
  145. package/dist/components/hover-card.js +84 -0
  146. package/dist/components/hover-card.js.map +1 -0
  147. package/dist/components/input-group.d.ts +29 -0
  148. package/dist/components/input-group.d.ts.map +1 -0
  149. package/dist/components/input-group.js +61 -0
  150. package/dist/components/input-group.js.map +1 -0
  151. package/dist/components/input.d.ts +9 -0
  152. package/dist/components/input.d.ts.map +1 -0
  153. package/dist/components/input.js +13 -0
  154. package/dist/components/input.js.map +1 -0
  155. package/dist/components/island.d.ts +18 -0
  156. package/dist/components/island.d.ts.map +1 -0
  157. package/dist/components/island.js +30 -0
  158. package/dist/components/island.js.map +1 -0
  159. package/dist/components/kbd.d.ts +7 -0
  160. package/dist/components/kbd.d.ts.map +1 -0
  161. package/dist/components/kbd.js +11 -0
  162. package/dist/components/kbd.js.map +1 -0
  163. package/dist/components/label.d.ts +8 -0
  164. package/dist/components/label.d.ts.map +1 -0
  165. package/dist/components/label.js +12 -0
  166. package/dist/components/label.js.map +1 -0
  167. package/dist/components/markdown.d.ts +24 -0
  168. package/dist/components/markdown.d.ts.map +1 -0
  169. package/dist/components/markdown.js +38 -0
  170. package/dist/components/markdown.js.map +1 -0
  171. package/dist/components/message.d.ts +38 -0
  172. package/dist/components/message.d.ts.map +1 -0
  173. package/dist/components/message.js +25 -0
  174. package/dist/components/message.js.map +1 -0
  175. package/dist/components/page-header.d.ts +31 -0
  176. package/dist/components/page-header.d.ts.map +1 -0
  177. package/dist/components/page-header.js +94 -0
  178. package/dist/components/page-header.js.map +1 -0
  179. package/dist/components/pagination.d.ts +22 -0
  180. package/dist/components/pagination.d.ts.map +1 -0
  181. package/dist/components/pagination.js +36 -0
  182. package/dist/components/pagination.js.map +1 -0
  183. package/dist/components/password-input.d.ts +5 -0
  184. package/dist/components/password-input.d.ts.map +1 -0
  185. package/dist/components/password-input.js +12 -0
  186. package/dist/components/password-input.js.map +1 -0
  187. package/dist/components/pepper.d.ts +92 -0
  188. package/dist/components/pepper.d.ts.map +1 -0
  189. package/dist/components/pepper.js +1279 -0
  190. package/dist/components/pepper.js.map +1 -0
  191. package/dist/components/permission-request.d.ts +53 -0
  192. package/dist/components/permission-request.d.ts.map +1 -0
  193. package/dist/components/permission-request.js +54 -0
  194. package/dist/components/permission-request.js.map +1 -0
  195. package/dist/components/popover.d.ts +42 -0
  196. package/dist/components/popover.d.ts.map +1 -0
  197. package/dist/components/popover.js +76 -0
  198. package/dist/components/popover.js.map +1 -0
  199. package/dist/components/progress.d.ts +9 -0
  200. package/dist/components/progress.d.ts.map +1 -0
  201. package/dist/components/progress.js +12 -0
  202. package/dist/components/progress.js.map +1 -0
  203. package/dist/components/progressive-blur.d.ts +31 -0
  204. package/dist/components/progressive-blur.d.ts.map +1 -0
  205. package/dist/components/progressive-blur.js +44 -0
  206. package/dist/components/progressive-blur.js.map +1 -0
  207. package/dist/components/radio-group.d.ts +8 -0
  208. package/dist/components/radio-group.d.ts.map +1 -0
  209. package/dist/components/radio-group.js +15 -0
  210. package/dist/components/radio-group.js.map +1 -0
  211. package/dist/components/request-card.d.ts +34 -0
  212. package/dist/components/request-card.d.ts.map +1 -0
  213. package/dist/components/request-card.js +50 -0
  214. package/dist/components/request-card.js.map +1 -0
  215. package/dist/components/resizable.d.ts +24 -0
  216. package/dist/components/resizable.d.ts.map +1 -0
  217. package/dist/components/resizable.js +40 -0
  218. package/dist/components/resizable.js.map +1 -0
  219. package/dist/components/responsive-overlay.d.ts +136 -0
  220. package/dist/components/responsive-overlay.d.ts.map +1 -0
  221. package/dist/components/responsive-overlay.js +302 -0
  222. package/dist/components/responsive-overlay.js.map +1 -0
  223. package/dist/components/scroll-shadows.d.ts +11 -0
  224. package/dist/components/scroll-shadows.d.ts.map +1 -0
  225. package/dist/components/scroll-shadows.js +53 -0
  226. package/dist/components/scroll-shadows.js.map +1 -0
  227. package/dist/components/search-field.d.ts +16 -0
  228. package/dist/components/search-field.d.ts.map +1 -0
  229. package/dist/components/search-field.js +50 -0
  230. package/dist/components/search-field.js.map +1 -0
  231. package/dist/components/searchable-select.d.ts +43 -0
  232. package/dist/components/searchable-select.d.ts.map +1 -0
  233. package/dist/components/searchable-select.js +39 -0
  234. package/dist/components/searchable-select.js.map +1 -0
  235. package/dist/components/select.d.ts +60 -0
  236. package/dist/components/select.d.ts.map +1 -0
  237. package/dist/components/select.js +94 -0
  238. package/dist/components/select.js.map +1 -0
  239. package/dist/components/separator.d.ts +7 -0
  240. package/dist/components/separator.d.ts.map +1 -0
  241. package/dist/components/separator.js +12 -0
  242. package/dist/components/separator.js.map +1 -0
  243. package/dist/components/settings-section.d.ts +41 -0
  244. package/dist/components/settings-section.d.ts.map +1 -0
  245. package/dist/components/settings-section.js +50 -0
  246. package/dist/components/settings-section.js.map +1 -0
  247. package/dist/components/sidebar-item.d.ts +41 -0
  248. package/dist/components/sidebar-item.d.ts.map +1 -0
  249. package/dist/components/sidebar-item.js +59 -0
  250. package/dist/components/sidebar-item.js.map +1 -0
  251. package/dist/components/skeleton.d.ts +7 -0
  252. package/dist/components/skeleton.d.ts.map +1 -0
  253. package/dist/components/skeleton.js +11 -0
  254. package/dist/components/skeleton.js.map +1 -0
  255. package/dist/components/slider.d.ts +10 -0
  256. package/dist/components/slider.d.ts.map +1 -0
  257. package/dist/components/slider.js +36 -0
  258. package/dist/components/slider.js.map +1 -0
  259. package/dist/components/sonner.d.ts +8 -0
  260. package/dist/components/sonner.d.ts.map +1 -0
  261. package/dist/components/sonner.js +21 -0
  262. package/dist/components/sonner.js.map +1 -0
  263. package/dist/components/spinner.d.ts +7 -0
  264. package/dist/components/spinner.d.ts.map +1 -0
  265. package/dist/components/spinner.js +12 -0
  266. package/dist/components/spinner.js.map +1 -0
  267. package/dist/components/stat-strip.d.ts +20 -0
  268. package/dist/components/stat-strip.d.ts.map +1 -0
  269. package/dist/components/stat-strip.js +11 -0
  270. package/dist/components/stat-strip.js.map +1 -0
  271. package/dist/components/status-dot.d.ts +25 -0
  272. package/dist/components/status-dot.d.ts.map +1 -0
  273. package/dist/components/status-dot.js +31 -0
  274. package/dist/components/status-dot.js.map +1 -0
  275. package/dist/components/subagent-run.d.ts +27 -0
  276. package/dist/components/subagent-run.d.ts.map +1 -0
  277. package/dist/components/subagent-run.js +38 -0
  278. package/dist/components/subagent-run.js.map +1 -0
  279. package/dist/components/switch.d.ts +8 -0
  280. package/dist/components/switch.d.ts.map +1 -0
  281. package/dist/components/switch.js +13 -0
  282. package/dist/components/switch.js.map +1 -0
  283. package/dist/components/system-notice.d.ts +34 -0
  284. package/dist/components/system-notice.d.ts.map +1 -0
  285. package/dist/components/system-notice.js +52 -0
  286. package/dist/components/system-notice.js.map +1 -0
  287. package/dist/components/table.d.ts +27 -0
  288. package/dist/components/table.d.ts.map +1 -0
  289. package/dist/components/table.js +37 -0
  290. package/dist/components/table.js.map +1 -0
  291. package/dist/components/tabs.d.ts +40 -0
  292. package/dist/components/tabs.d.ts.map +1 -0
  293. package/dist/components/tabs.js +52 -0
  294. package/dist/components/tabs.js.map +1 -0
  295. package/dist/components/textarea.d.ts +5 -0
  296. package/dist/components/textarea.d.ts.map +1 -0
  297. package/dist/components/textarea.js +9 -0
  298. package/dist/components/textarea.js.map +1 -0
  299. package/dist/components/thinking-indicator.d.ts +21 -0
  300. package/dist/components/thinking-indicator.d.ts.map +1 -0
  301. package/dist/components/thinking-indicator.js +136 -0
  302. package/dist/components/thinking-indicator.js.map +1 -0
  303. package/dist/components/thread-status.d.ts +25 -0
  304. package/dist/components/thread-status.d.ts.map +1 -0
  305. package/dist/components/thread-status.js +41 -0
  306. package/dist/components/thread-status.js.map +1 -0
  307. package/dist/components/todo-list.d.ts +52 -0
  308. package/dist/components/todo-list.d.ts.map +1 -0
  309. package/dist/components/todo-list.js +137 -0
  310. package/dist/components/todo-list.js.map +1 -0
  311. package/dist/components/toggle-group.d.ts +17 -0
  312. package/dist/components/toggle-group.d.ts.map +1 -0
  313. package/dist/components/toggle-group.js +26 -0
  314. package/dist/components/toggle-group.js.map +1 -0
  315. package/dist/components/toggle.d.ts +27 -0
  316. package/dist/components/toggle.d.ts.map +1 -0
  317. package/dist/components/toggle.js +44 -0
  318. package/dist/components/toggle.js.map +1 -0
  319. package/dist/components/tool-call.d.ts +60 -0
  320. package/dist/components/tool-call.d.ts.map +1 -0
  321. package/dist/components/tool-call.js +94 -0
  322. package/dist/components/tool-call.js.map +1 -0
  323. package/dist/components/tool-result.d.ts +127 -0
  324. package/dist/components/tool-result.d.ts.map +1 -0
  325. package/dist/components/tool-result.js +155 -0
  326. package/dist/components/tool-result.js.map +1 -0
  327. package/dist/components/tooltip.d.ts +18 -0
  328. package/dist/components/tooltip.d.ts.map +1 -0
  329. package/dist/components/tooltip.js +38 -0
  330. package/dist/components/tooltip.js.map +1 -0
  331. package/dist/components/trace.d.ts +38 -0
  332. package/dist/components/trace.d.ts.map +1 -0
  333. package/dist/components/trace.js +52 -0
  334. package/dist/components/trace.js.map +1 -0
  335. package/dist/components/turn-summary.d.ts +17 -0
  336. package/dist/components/turn-summary.d.ts.map +1 -0
  337. package/dist/components/turn-summary.js +19 -0
  338. package/dist/components/turn-summary.js.map +1 -0
  339. package/dist/components/usage-meter.d.ts +16 -0
  340. package/dist/components/usage-meter.d.ts.map +1 -0
  341. package/dist/components/usage-meter.js +10 -0
  342. package/dist/components/usage-meter.js.map +1 -0
  343. package/dist/components/view-switcher.d.ts +25 -0
  344. package/dist/components/view-switcher.d.ts.map +1 -0
  345. package/dist/components/view-switcher.js +196 -0
  346. package/dist/components/view-switcher.js.map +1 -0
  347. package/dist/docs/components/accordion.md +151 -0
  348. package/dist/docs/components/activity-chart.md +104 -0
  349. package/dist/docs/components/alert-dialog.md +216 -0
  350. package/dist/docs/components/alert.md +203 -0
  351. package/dist/docs/components/ask-user-question.md +429 -0
  352. package/dist/docs/components/attachment-gallery.md +377 -0
  353. package/dist/docs/components/avatar.md +197 -0
  354. package/dist/docs/components/badge.md +162 -0
  355. package/dist/docs/components/brand-tile.md +138 -0
  356. package/dist/docs/components/button.md +392 -0
  357. package/dist/docs/components/calendar.md +113 -0
  358. package/dist/docs/components/card.md +157 -0
  359. package/dist/docs/components/carousel.md +144 -0
  360. package/dist/docs/components/catalog-card.md +136 -0
  361. package/dist/docs/components/chart.md +608 -0
  362. package/dist/docs/components/checkbox.md +164 -0
  363. package/dist/docs/components/chip.md +411 -0
  364. package/dist/docs/components/code-block.md +389 -0
  365. package/dist/docs/components/collapsible.md +93 -0
  366. package/dist/docs/components/command.md +276 -0
  367. package/dist/docs/components/composer.md +1092 -0
  368. package/dist/docs/components/connector-request.md +497 -0
  369. package/dist/docs/components/context-menu.md +127 -0
  370. package/dist/docs/components/data-table.md +462 -0
  371. package/dist/docs/components/date-range-picker.md +425 -0
  372. package/dist/docs/components/dialog.md +263 -0
  373. package/dist/docs/components/drawer.md +505 -0
  374. package/dist/docs/components/dropdown-menu.md +336 -0
  375. package/dist/docs/components/editor-tabs.md +283 -0
  376. package/dist/docs/components/empty-state.md +134 -0
  377. package/dist/docs/components/entity-card.md +640 -0
  378. package/dist/docs/components/entity-row.md +291 -0
  379. package/dist/docs/components/env-var-request.md +223 -0
  380. package/dist/docs/components/field.md +272 -0
  381. package/dist/docs/components/file-upload.md +255 -0
  382. package/dist/docs/components/hover-card.md +335 -0
  383. package/dist/docs/components/input-group.md +134 -0
  384. package/dist/docs/components/input.md +97 -0
  385. package/dist/docs/components/island.md +97 -0
  386. package/dist/docs/components/kbd.md +91 -0
  387. package/dist/docs/components/markdown.md +180 -0
  388. package/dist/docs/components/message.md +336 -0
  389. package/dist/docs/components/page-header.md +203 -0
  390. package/dist/docs/components/pagination.md +211 -0
  391. package/dist/docs/components/password-input.md +68 -0
  392. package/dist/docs/components/pepper.md +238 -0
  393. package/dist/docs/components/permission-request.md +265 -0
  394. package/dist/docs/components/popover.md +206 -0
  395. package/dist/docs/components/progress.md +142 -0
  396. package/dist/docs/components/progressive-blur.md +195 -0
  397. package/dist/docs/components/radio-group.md +129 -0
  398. package/dist/docs/components/request-card.md +305 -0
  399. package/dist/docs/components/resizable.md +318 -0
  400. package/dist/docs/components/responsive-overlay.md +449 -0
  401. package/dist/docs/components/scroll-shadows.md +161 -0
  402. package/dist/docs/components/search-field.md +86 -0
  403. package/dist/docs/components/searchable-select.md +144 -0
  404. package/dist/docs/components/select.md +331 -0
  405. package/dist/docs/components/separator.md +80 -0
  406. package/dist/docs/components/settings-section.md +246 -0
  407. package/dist/docs/components/sidebar-item.md +307 -0
  408. package/dist/docs/components/skeleton.md +107 -0
  409. package/dist/docs/components/slider.md +171 -0
  410. package/dist/docs/components/sonner.md +122 -0
  411. package/dist/docs/components/spinner.md +112 -0
  412. package/dist/docs/components/stat-strip.md +85 -0
  413. package/dist/docs/components/status-dot.md +190 -0
  414. package/dist/docs/components/subagent-run.md +196 -0
  415. package/dist/docs/components/switch.md +91 -0
  416. package/dist/docs/components/system-notice.md +144 -0
  417. package/dist/docs/components/table.md +201 -0
  418. package/dist/docs/components/tabs.md +233 -0
  419. package/dist/docs/components/textarea.md +89 -0
  420. package/dist/docs/components/thinking-indicator.md +164 -0
  421. package/dist/docs/components/thread-status.md +143 -0
  422. package/dist/docs/components/todo-list.md +225 -0
  423. package/dist/docs/components/toggle-group.md +117 -0
  424. package/dist/docs/components/toggle.md +132 -0
  425. package/dist/docs/components/tool-call.md +237 -0
  426. package/dist/docs/components/tool-result.md +418 -0
  427. package/dist/docs/components/tooltip.md +136 -0
  428. package/dist/docs/components/trace.md +319 -0
  429. package/dist/docs/components/turn-summary.md +218 -0
  430. package/dist/docs/components/usage-meter.md +69 -0
  431. package/dist/docs/components/view-switcher.md +193 -0
  432. package/dist/docs/foundations/colors.md +83 -0
  433. package/dist/docs/foundations/elevation.md +19 -0
  434. package/dist/docs/foundations/iconography.md +34 -0
  435. package/dist/docs/foundations/layout.md +42 -0
  436. package/dist/docs/foundations/logo.md +111 -0
  437. package/dist/docs/foundations/motion.md +91 -0
  438. package/dist/docs/foundations/radius.md +13 -0
  439. package/dist/docs/foundations/spacing.md +23 -0
  440. package/dist/docs/foundations/typography.md +42 -0
  441. package/dist/docs/getting-started/installation.md +116 -0
  442. package/dist/docs/getting-started/releases.md +59 -0
  443. package/dist/docs/getting-started/theming.md +58 -0
  444. package/dist/docs/guidelines/accessibility.md +28 -0
  445. package/dist/docs/guidelines/content.md +36 -0
  446. package/dist/docs/guidelines/forms.md +36 -0
  447. package/dist/docs/guidelines/principles.md +30 -0
  448. package/dist/docs/hooks/use-is-mobile.md +134 -0
  449. package/dist/docs/index.md +182 -0
  450. package/dist/docs/overview.md +35 -0
  451. package/dist/docs/patterns/chat.md +477 -0
  452. package/dist/docs/patterns/index.md +13 -0
  453. package/dist/docs/patterns/login.md +311 -0
  454. package/dist/docs/patterns/share.md +415 -0
  455. package/dist/hooks/use-is-mobile.d.ts +9 -0
  456. package/dist/hooks/use-is-mobile.d.ts.map +1 -0
  457. package/dist/hooks/use-is-mobile.js +26 -0
  458. package/dist/hooks/use-is-mobile.js.map +1 -0
  459. package/dist/lib/cn.d.ts +4 -0
  460. package/dist/lib/cn.d.ts.map +1 -0
  461. package/dist/lib/cn.js +31 -0
  462. package/dist/lib/cn.js.map +1 -0
  463. package/dist/lib/code-language.d.ts +8 -0
  464. package/dist/lib/code-language.d.ts.map +1 -0
  465. package/dist/lib/code-language.js +48 -0
  466. package/dist/lib/code-language.js.map +1 -0
  467. package/dist/lib/date-range.d.ts +122 -0
  468. package/dist/lib/date-range.d.ts.map +1 -0
  469. package/dist/lib/date-range.js +281 -0
  470. package/dist/lib/date-range.js.map +1 -0
  471. package/dist/lib/major-tokens.d.ts +40 -0
  472. package/dist/lib/major-tokens.d.ts.map +1 -0
  473. package/dist/lib/major-tokens.js +602 -0
  474. package/dist/lib/major-tokens.js.map +1 -0
  475. package/dist/lib/markdown.d.ts +25 -0
  476. package/dist/lib/markdown.d.ts.map +1 -0
  477. package/dist/lib/markdown.js +87 -0
  478. package/dist/lib/markdown.js.map +1 -0
  479. package/dist/lib/overlay-portal-branch.d.ts +6 -0
  480. package/dist/lib/overlay-portal-branch.d.ts.map +1 -0
  481. package/dist/lib/overlay-portal-branch.js +15 -0
  482. package/dist/lib/overlay-portal-branch.js.map +1 -0
  483. package/dist/lib/pepper-matcap.d.ts +2 -0
  484. package/dist/lib/pepper-matcap.d.ts.map +1 -0
  485. package/dist/lib/pepper-matcap.js +4 -0
  486. package/dist/lib/pepper-matcap.js.map +1 -0
  487. package/dist/lib/scroll-fade.d.ts +28 -0
  488. package/dist/lib/scroll-fade.d.ts.map +1 -0
  489. package/dist/lib/scroll-fade.js +57 -0
  490. package/dist/lib/scroll-fade.js.map +1 -0
  491. package/dist/tailwind.css +7 -0
  492. package/dist/theme.css +428 -0
  493. package/package.json +145 -3
  494. package/tokens.json +841 -0
  495. package/README.md +0 -3
@@ -0,0 +1,1092 @@
1
+ ---
2
+ name: Composer
3
+ slug: composer
4
+ description: "The message box at the bottom of the chat panel, built from parts: the box, the text with @ mentions, files, chips, Send and the settings row."
5
+ group: AI
6
+ layer: composed
7
+ status: stable
8
+ since: 0.1.0
9
+ import: import { Composer, ComposerBox, ComposerFiles, ComposerChips, ComposerEditor, ComposerActions, ComposerActionGroup, ComposerAttachButton, ComposerAttachFileItem, ComposerPicker, ComposerSend, ComposerContextRing, ComposerFooter, COMPOSER_STATUSES, COMPOSER_BOX_VARIANTS, COMPOSER_SEND_VARIANTS } from "@major-tech/ui/composer";
10
+ requires: "@tiptap/core, @tiptap/react, @tiptap/pm, @tiptap/extension-document, @tiptap/extension-paragraph, @tiptap/extension-text, @tiptap/extension-hard-break, @tiptap/extensions, @tiptap/extension-mention, @tiptap/suggestion"
11
+ source: packages/ui/src/components/composer.tsx
12
+ ---
13
+
14
+ # Composer
15
+
16
+ > **Install `@tiptap/core` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/core` (^3.30 or later).
17
+
18
+ > **Install `@tiptap/react` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/react` (^3.30 or later).
19
+
20
+ > **Install `@tiptap/pm` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/pm` (^3.30 or later).
21
+
22
+ > **Install `@tiptap/extension-document` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extension-document` (^3.30 or later).
23
+
24
+ > **Install `@tiptap/extension-paragraph` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extension-paragraph` (^3.30 or later).
25
+
26
+ > **Install `@tiptap/extension-text` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extension-text` (^3.30 or later).
27
+
28
+ > **Install `@tiptap/extension-hard-break` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extension-hard-break` (^3.30 or later).
29
+
30
+ > **Install `@tiptap/extensions` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extensions` (^3.30 or later).
31
+
32
+ > **Install `@tiptap/extension-mention` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/extension-mention` (^3.30 or later).
33
+
34
+ > **Install `@tiptap/suggestion` too.** Composer doesn't work without it, and the package doesn't install it for you: `pnpm add @tiptap/suggestion` (^3.30 or later).
35
+
36
+ ## Usage
37
+
38
+ Composer is built from parts, so the chat panel, Pepper's conversation and a page that starts something put together the composer each needs from the same pieces. The root keeps what they share: the text, the files, the status and sending.
39
+
40
+ ```tsx
41
+ <Composer onSubmit={send} status={status} onStop={stop} files={files} onAddFiles={upload}>
42
+ <ComposerBox>
43
+ <ComposerFiles />
44
+ <ComposerChips>{/* picked elements */}</ComposerChips>
45
+ <ComposerEditor placeholder="Ask anything" mentionGroups={groups} onMentionQueryChange={search} />
46
+ <ComposerActions>
47
+ <ComposerActionGroup>
48
+ <ComposerAttachButton />
49
+ <ComposerPicker active={isPicking} onActiveChange={setIsPicking} />
50
+ </ComposerActionGroup>
51
+ <ComposerSend />
52
+ </ComposerActions>
53
+ </ComposerBox>
54
+ <ComposerFooter>{/* the session's settings, the context ring */}</ComposerFooter>
55
+ </Composer>
56
+ ```
57
+
58
+ ### Basic
59
+
60
+ The text grows with what is typed (14/20, up to 160px), under the italic placeholder “Ask anything”. Enter sends, Shift+Enter adds a line. Send is grey when there is nothing to send and green when there is.
61
+
62
+ Example: `basic`
63
+
64
+ ```tsx
65
+ "use client";
66
+
67
+ import { useState } from "react";
68
+ import { Message } from "@major-tech/ui/message";
69
+ import {
70
+ Composer,
71
+ ComposerActionGroup,
72
+ ComposerActions,
73
+ ComposerAttachButton,
74
+ ComposerBox,
75
+ ComposerEditor,
76
+ ComposerSend,
77
+ type ComposerMessage,
78
+ } from "@major-tech/ui/composer";
79
+
80
+ export default function ComposerBasic() {
81
+ const [sent, setSent] = useState<string[]>([]);
82
+
83
+ const handleSubmit = (message: ComposerMessage) => setSent((messages) => [...messages, message.text]);
84
+
85
+ return (
86
+ <div className="flex w-full max-w-90 flex-col gap-space-32">
87
+ {sent.length > 0 && (
88
+ <div className="flex flex-col gap-space-12">
89
+ {sent.map((text, index) => (
90
+ <Message key={index} from="user" time="now">
91
+ {text}
92
+ </Message>
93
+ ))}
94
+ </div>
95
+ )}
96
+ {/* No onAddFiles here, so (+) stays off: the product takes files the way the Files example does. */}
97
+ <Composer onSubmit={handleSubmit}>
98
+ <ComposerBox>
99
+ <ComposerEditor />
100
+ <ComposerActions>
101
+ <ComposerActionGroup>
102
+ <ComposerAttachButton />
103
+ </ComposerActionGroup>
104
+ <ComposerSend />
105
+ </ComposerActions>
106
+ </ComposerBox>
107
+ </Composer>
108
+ </div>
109
+ );
110
+ }
111
+ ```
112
+
113
+ - The box: surface, `rounded-panel` on all four corners, `shadow-card`, a 6px inset.
114
+ - (+) is a 28px ghost icon Button. Alone it opens the file picker and hands the files to the root's `onAddFiles`; it's off without it.
115
+ - Send is 26px: secondary with a faint arrow when empty, accent with a white arrow when not.
116
+
117
+ ### Mentions
118
+
119
+ @ opens a menu at the caret with the product's sections: connectors, apps, agents, files. The product searches as the query changes (`onMentionQueryChange`) and passes the sections back (`mentionGroups`). A picked mention sits in the text as an inline Chip, in its kind's colours.
120
+
121
+ Example: `mentions`
122
+
123
+ ```tsx
124
+ "use client";
125
+
126
+ import { useRef, useState, type ReactNode } from "react";
127
+ import { AtSign, Bot, Database, FileCode, LayoutGrid } from "lucide-react";
128
+ import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "@major-tech/ui/button";
129
+ import { Chip, CHIP_KINDS } from "@major-tech/ui/chip";
130
+ import { Message } from "@major-tech/ui/message";
131
+ import {
132
+ Composer,
133
+ ComposerActions,
134
+ ComposerBox,
135
+ ComposerEditor,
136
+ ComposerSend,
137
+ type ComposerHandle,
138
+ type ComposerMention,
139
+ type ComposerMentionGroup,
140
+ type ComposerMessage,
141
+ } from "@major-tech/ui/composer";
142
+
143
+ const MENTION_TYPES = {
144
+ CONNECTOR: "connector",
145
+ APP: "app",
146
+ AGENT: "agent",
147
+ FILE: "file",
148
+ } as const;
149
+
150
+ type MentionType = (typeof MENTION_TYPES)[keyof typeof MENTION_TYPES];
151
+
152
+ const MENTION_ICONS = {
153
+ [MENTION_TYPES.CONNECTOR]: <Database />,
154
+ [MENTION_TYPES.APP]: <LayoutGrid />,
155
+ [MENTION_TYPES.AGENT]: <Bot />,
156
+ [MENTION_TYPES.FILE]: <FileCode />,
157
+ } satisfies Record<MentionType, ReactNode>;
158
+
159
+ /** What the workspace has; the product searches its own. */
160
+ const WORKSPACE: {
161
+ label: string;
162
+ type: MentionType;
163
+ items: ComposerMention[];
164
+ }[] = [
165
+ {
166
+ label: "Connectors",
167
+ type: MENTION_TYPES.CONNECTOR,
168
+ items: [
169
+ {
170
+ id: "pg",
171
+ label: "Sales DB",
172
+ kind: CHIP_KINDS.CONNECTOR,
173
+ type: MENTION_TYPES.CONNECTOR,
174
+ },
175
+ {
176
+ id: "hubspot",
177
+ label: "HubSpot",
178
+ kind: CHIP_KINDS.CONNECTOR,
179
+ type: MENTION_TYPES.CONNECTOR,
180
+ },
181
+ ],
182
+ },
183
+ {
184
+ label: "Apps",
185
+ type: MENTION_TYPES.APP,
186
+ items: [
187
+ {
188
+ id: "pipeline",
189
+ label: "Pipeline tracker",
190
+ kind: CHIP_KINDS.APPLICATION,
191
+ type: MENTION_TYPES.APP,
192
+ },
193
+ ],
194
+ },
195
+ {
196
+ label: "Agents",
197
+ type: MENTION_TYPES.AGENT,
198
+ items: [
199
+ {
200
+ id: "digest",
201
+ label: "Daily digest",
202
+ kind: CHIP_KINDS.AGENT,
203
+ type: MENTION_TYPES.AGENT,
204
+ },
205
+ ],
206
+ },
207
+ {
208
+ label: "Files",
209
+ type: MENTION_TYPES.FILE,
210
+ items: [{ id: "app/page.tsx", label: "page.tsx", type: MENTION_TYPES.FILE }],
211
+ },
212
+ ];
213
+
214
+ const getMentionIcon = (mention: ComposerMention) => MENTION_ICONS[mention.type as MentionType];
215
+
216
+ /** A file the file tree's "Mention in chat" hands the composer from outside its text. */
217
+ const TREE_FILE: ComposerMention = { id: "app/layout.tsx", label: "layout.tsx", type: MENTION_TYPES.FILE };
218
+
219
+ /** How the product writes a mention in the sent text, so the agent knows what it points to. */
220
+ const serializeMention = (mention: ComposerMention) => `@${mention.type}:${mention.label}`;
221
+
222
+ interface SentMessage {
223
+ text: string;
224
+ mentions: ComposerMention[];
225
+ }
226
+
227
+ /** The sent text with its mentions back as chips. */
228
+ function SentText({ text, mentions }: SentMessage) {
229
+ const parts = mentions.reduce<ReactNode[]>(
230
+ (nodes, mention, index) =>
231
+ nodes.flatMap((node): ReactNode[] => {
232
+ if (typeof node !== "string") {
233
+ return [node];
234
+ }
235
+
236
+ const [before, ...after] = node.split(serializeMention(mention));
237
+
238
+ if (after.length === 0) {
239
+ return [node];
240
+ }
241
+
242
+ return [
243
+ before,
244
+ <Chip inline key={`${mention.id}-${index}`} kind={mention.kind} icon={getMentionIcon(mention)}>
245
+ {mention.label}
246
+ </Chip>,
247
+ after.join(serializeMention(mention)),
248
+ ];
249
+ }),
250
+ [text],
251
+ );
252
+
253
+ return <>{parts}</>;
254
+ }
255
+
256
+ export default function ComposerMentions() {
257
+ const [query, setQuery] = useState<string | null>(null);
258
+ const [sent, setSent] = useState<SentMessage[]>([]);
259
+ const composerRef = useRef<ComposerHandle>(null);
260
+
261
+ // The file tree's "Mention in chat": the file joins the text at the caret, as a mention, not as a chip above it.
262
+ const handleMentionInChat = () => composerRef.current?.insertMention(TREE_FILE);
263
+
264
+ const search = (query ?? "").toLowerCase();
265
+ const groups: ComposerMentionGroup[] = WORKSPACE.map((group) => ({
266
+ label: group.label,
267
+ items: group.items.filter((item) => item.label.toLowerCase().includes(search)),
268
+ }));
269
+
270
+ const handleSubmit = ({ text, mentions }: ComposerMessage) =>
271
+ setSent((messages) => [...messages, { text, mentions }]);
272
+
273
+ return (
274
+ <div className="flex w-full max-w-100 flex-col gap-space-32">
275
+ {sent.length > 0 && (
276
+ <div className="flex flex-col gap-space-12">
277
+ {sent.map((message, index) => (
278
+ <Message key={index} from="user" time="now">
279
+ <SentText {...message} />
280
+ </Message>
281
+ ))}
282
+ </div>
283
+ )}
284
+ <Composer ref={composerRef} onSubmit={handleSubmit} serializeMention={serializeMention}>
285
+ <ComposerBox>
286
+ <ComposerEditor
287
+ placeholder="Type @ to mention a connector, an app or a file"
288
+ mentionGroups={groups}
289
+ onMentionQueryChange={setQuery}
290
+ getMentionIcon={getMentionIcon}
291
+ />
292
+ <ComposerActions>
293
+ <ComposerSend />
294
+ </ComposerActions>
295
+ </ComposerBox>
296
+ </Composer>
297
+ <Button
298
+ variant={BUTTON_VARIANTS.OUTLINE}
299
+ size={BUTTON_SIZES.SM}
300
+ onClick={handleMentionInChat}
301
+ className="self-start"
302
+ >
303
+ <AtSign />
304
+ Mention layout.tsx in chat
305
+ </Button>
306
+ </div>
307
+ );
308
+ }
309
+ ```
310
+
311
+ - The arrows move in the menu, Enter or Tab picks, Esc closes it; with no matches Enter sends as usual.
312
+ - A mention's `description` (a connector's type, a file's folder) sits after its label in the menu, muted; `mentionHint` heads the menu before anything is typed after @.
313
+ - **From outside the text**: the file tree's “Mention in chat” puts its file in with the handle's `insertMention`, at the caret, or at the end when the composer isn't focused. It's a mention like any other, in the text, not a chip above it.
314
+ - A chip is one step for the arrows and has ✕ to remove it; Backspace takes it out too.
315
+ - `serializeMention` writes each mention into the sent text the way the agent reads it (`@connector:Sales DB`), and `setText` turns the same tokens back into chips: a queued message put back to edit.
316
+ - Pasted text comes in plain, and formatting shortcuts do nothing: the text is paragraphs and mentions only.
317
+
318
+ ### App editor
319
+
320
+ Screenshots of the preview sit above the text in ComposerFiles; picked elements sit under them as removable element Chips in ComposerChips, like “DateRangePicker > button”, with the comment written on it as its dot. A chip goes with the message, so Send works with chips alone. Click and ask (⌘⇧C) toggles the element picker. Under the box, ComposerFooter holds the session's settings and the context ring.
321
+
322
+ Example: `app-editor`
323
+
324
+ ```tsx
325
+ "use client";
326
+
327
+ import { useState } from "react";
328
+ import { Hand, ImageIcon, MousePointerClick, Scale, Sparkles, Telescope, Zap } from "lucide-react";
329
+ import type { AttachmentItem } from "@major-tech/ui/attachment-gallery";
330
+ import {
331
+ Composer,
332
+ ComposerActionGroup,
333
+ ComposerActions,
334
+ ComposerAttachButton,
335
+ ComposerAttachFileItem,
336
+ ComposerBox,
337
+ ComposerChips,
338
+ ComposerContextRing,
339
+ ComposerEditor,
340
+ ComposerFiles,
341
+ ComposerFooter,
342
+ ComposerPicker,
343
+ ComposerSend,
344
+ } from "@major-tech/ui/composer";
345
+ import { DropdownMenuItem } from "@major-tech/ui/dropdown-menu";
346
+ import { CHIP_KINDS, Chip } from "@major-tech/ui/chip";
347
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@major-tech/ui/select";
348
+
349
+ const EFFORTS = {
350
+ FAST: "fast",
351
+ BALANCED: "balanced",
352
+ THOROUGH: "thorough",
353
+ } as const;
354
+
355
+ const APPROVALS = {
356
+ MANUAL: "manual",
357
+ AUTO: "auto",
358
+ } as const;
359
+
360
+ /** What each Select's trigger shows for a value. */
361
+ const EFFORT_LABELS = {
362
+ [EFFORTS.FAST]: "Fast",
363
+ [EFFORTS.BALANCED]: "Balanced",
364
+ [EFFORTS.THOROUGH]: "Thorough",
365
+ };
366
+ const APPROVAL_LABELS = {
367
+ [APPROVALS.MANUAL]: "Manual",
368
+ [APPROVALS.AUTO]: "Auto",
369
+ };
370
+
371
+ const CONTEXT_USAGE_PERCENT = 23;
372
+
373
+ interface PickedElement {
374
+ id: string;
375
+ label: string;
376
+ /** Its text and page. */
377
+ note: string;
378
+ /** What the person wrote about it in Click and ask. */
379
+ comment?: string;
380
+ }
381
+
382
+ const INITIAL_PICKS: PickedElement[] = [
383
+ {
384
+ id: "pick-1",
385
+ label: "DateRangePicker > button",
386
+ note: "“Today” · /reports",
387
+ comment: "Make this the default range",
388
+ },
389
+ ];
390
+
391
+ /** Stands in for the product's screenshot of the preview, already uploaded. */
392
+ const SCREENSHOT_URL = "/major-mark.svg";
393
+
394
+ export default function ComposerAppEditor() {
395
+ const [isPickerActive, setIsPickerActive] = useState(false);
396
+ const [picks, setPicks] = useState(INITIAL_PICKS);
397
+ const [files, setFiles] = useState<AttachmentItem[]>([]);
398
+
399
+ // The upload belongs to the product: here a picked file shows as done at once.
400
+ const addFiles = (picked: File[]) =>
401
+ setFiles((current) => [
402
+ ...current,
403
+ ...picked.map((file) => ({
404
+ id: `${file.name}-${current.length}`,
405
+ name: file.name,
406
+ type: file.type,
407
+ size: file.size,
408
+ })),
409
+ ]);
410
+
411
+ const addScreenshot = () =>
412
+ setFiles((current) => [
413
+ ...current,
414
+ {
415
+ id: `screenshot-${current.length}`,
416
+ name: "Preview screenshot.png",
417
+ url: SCREENSHOT_URL,
418
+ },
419
+ ]);
420
+
421
+ const removeFile = (id: string) => setFiles((current) => current.filter((file) => file.id !== id));
422
+
423
+ const removePick = (id: string) => setPicks((current) => current.filter((pick) => pick.id !== id));
424
+
425
+ return (
426
+ <div className="w-90">
427
+ <Composer files={files} onAddFiles={addFiles} onRemoveFile={removeFile}>
428
+ <ComposerBox>
429
+ <ComposerFiles />
430
+ <ComposerChips>
431
+ {picks.map((pick) => (
432
+ <Chip
433
+ key={pick.id}
434
+ kind={CHIP_KINDS.ELEMENT}
435
+ icon={<MousePointerClick />}
436
+ note={pick.note}
437
+ dot={pick.comment}
438
+ onRemove={() => removePick(pick.id)}
439
+ removeLabel={`Remove ${pick.label}`}
440
+ title={`${pick.label} ${pick.note}`}
441
+ className="max-w-60"
442
+ >
443
+ {pick.label}
444
+ </Chip>
445
+ ))}
446
+ </ComposerChips>
447
+ <ComposerEditor defaultValue="Make this the default range" />
448
+ <ComposerActions>
449
+ <ComposerActionGroup>
450
+ <ComposerAttachButton>
451
+ <ComposerAttachFileItem />
452
+ <DropdownMenuItem onClick={addScreenshot}>
453
+ <ImageIcon />
454
+ Add screenshot of the preview
455
+ </DropdownMenuItem>
456
+ </ComposerAttachButton>
457
+ <ComposerPicker active={isPickerActive} onActiveChange={setIsPickerActive} />
458
+ </ComposerActionGroup>
459
+ <ComposerSend />
460
+ </ComposerActions>
461
+ </ComposerBox>
462
+ <ComposerFooter>
463
+ <ComposerActionGroup>
464
+ <Select items={EFFORT_LABELS} defaultValue={EFFORTS.BALANCED}>
465
+ <SelectTrigger variant="ghost" aria-label="Effort">
466
+ <SelectValue />
467
+ </SelectTrigger>
468
+ <SelectContent side="top" align="start" className="w-73.5">
469
+ <SelectItem value={EFFORTS.FAST} icon={<Zap />} description="Quick edits, lowest cost">
470
+ Fast
471
+ </SelectItem>
472
+ <SelectItem value={EFFORTS.BALANCED} icon={<Scale />} description="Most changes">
473
+ Balanced
474
+ </SelectItem>
475
+ <SelectItem value={EFFORTS.THOROUGH} icon={<Telescope />} description="Bigger features, takes longer">
476
+ Thorough
477
+ </SelectItem>
478
+ </SelectContent>
479
+ </Select>
480
+ <Select items={APPROVAL_LABELS} defaultValue={APPROVALS.MANUAL}>
481
+ <SelectTrigger variant="ghost" aria-label="Approval">
482
+ <SelectValue />
483
+ </SelectTrigger>
484
+ <SelectContent side="top" align="start" className="w-78.5">
485
+ <SelectItem
486
+ value={APPROVALS.MANUAL}
487
+ icon={<Hand />}
488
+ description="Manually approve: asks before applying each change"
489
+ >
490
+ Manual
491
+ </SelectItem>
492
+ <SelectItem
493
+ value={APPROVALS.AUTO}
494
+ icon={<Sparkles />}
495
+ description="Automatically approve: asks you only for dangerous requests"
496
+ >
497
+ Auto
498
+ </SelectItem>
499
+ </SelectContent>
500
+ </Select>
501
+ </ComposerActionGroup>
502
+ <ComposerContextRing value={CONTEXT_USAGE_PERCENT} />
503
+ </ComposerFooter>
504
+ </Composer>
505
+ </div>
506
+ );
507
+ }
508
+ ```
509
+
510
+ - **The box** holds only what belongs to this message: files, chips, the text, (+), Click and ask, Send.
511
+ - **(+) with children** opens them as a menu, upward: ComposerAttachFileItem, and in the app editor Add screenshot of the preview. Agents, skills and workflows offer Add file only.
512
+ - **Click and ask** (app editor only): while on it takes a secondary fill and a selection icon. Esc, ⌘⇧C or the button turns it off.
513
+ - **Two kinds of chips**: what is picked outside the text (an element in the preview with Click and ask, a node on a workflow canvas with its “Mention in chat”) sits in ComposerChips above it, as an element Chip with its text and page and the comment written on it; what the message names inside the text (a connector, an app, an agent, a file, including a file from the tree's “Mention in chat”) is a mention in ComposerEditor. Both are Chips.
514
+ - **The row under it** holds the session's settings: Effort and Approval as ghost Selects (`variant="ghost"`) that open upward, in muted 12px text that darkens on hover.
515
+ - **Context usage**: an 18px ring, ok until 80%, then warn, when the tooltip adds that older messages get summarised, and danger from 95%. As a Popover's trigger it opens a breakdown of what fills it.
516
+
517
+ ### A conversation (Pepper)
518
+
519
+ A conversation runs on its own model in auto mode: there is nothing to set, so there is no row under the box and the context ring sits in it, beside Send.
520
+
521
+ Example: `pepper`
522
+
523
+ ```tsx
524
+ "use client";
525
+
526
+ import { useState } from "react";
527
+ import { Message } from "@major-tech/ui/message";
528
+ import {
529
+ Composer,
530
+ ComposerActionGroup,
531
+ ComposerActions,
532
+ ComposerAttachButton,
533
+ ComposerBox,
534
+ ComposerContextRing,
535
+ ComposerEditor,
536
+ ComposerSend,
537
+ type ComposerMessage,
538
+ } from "@major-tech/ui/composer";
539
+
540
+ /** Pepper runs on its own model in auto mode: nothing to set, so the ring sits in the box beside Send. */
541
+ const CONTEXT_USAGE_PERCENT = 41;
542
+
543
+ export default function ComposerPepper() {
544
+ const [sent, setSent] = useState<string[]>([]);
545
+
546
+ const handleSubmit = (message: ComposerMessage) => setSent((messages) => [...messages, message.text]);
547
+
548
+ return (
549
+ <div className="flex w-full max-w-90 flex-col gap-space-32">
550
+ {sent.length > 0 && (
551
+ <div className="flex flex-col gap-space-12">
552
+ {sent.map((text, index) => (
553
+ <Message key={index} from="user" time="now">
554
+ {text}
555
+ </Message>
556
+ ))}
557
+ </div>
558
+ )}
559
+ <Composer onSubmit={handleSubmit} onAddFiles={() => undefined}>
560
+ <ComposerBox>
561
+ <ComposerEditor placeholder="Message Pepper" />
562
+ <ComposerActions>
563
+ <ComposerActionGroup>
564
+ <ComposerAttachButton />
565
+ </ComposerActionGroup>
566
+ <ComposerActionGroup>
567
+ <ComposerContextRing value={CONTEXT_USAGE_PERCENT} />
568
+ <ComposerSend />
569
+ </ComposerActionGroup>
570
+ </ComposerActions>
571
+ </ComposerBox>
572
+ </Composer>
573
+ </div>
574
+ );
575
+ }
576
+ ```
577
+
578
+ ### Starting something
579
+
580
+ A composer that starts something (Build, a new chat) sends with the 34px glass tile. It goes away on send, so it keeps its text (`clearOnSubmit={false}`), and `submitting` spins Send until the product moves on.
581
+
582
+ Example: `start`
583
+
584
+ ```tsx
585
+ "use client";
586
+
587
+ import { useEffect, useRef, useState } from "react";
588
+ import {
589
+ COMPOSER_SEND_VARIANTS,
590
+ COMPOSER_STATUSES,
591
+ Composer,
592
+ ComposerActionGroup,
593
+ ComposerActions,
594
+ ComposerAttachButton,
595
+ ComposerBox,
596
+ ComposerEditor,
597
+ ComposerSend,
598
+ } from "@major-tech/ui/composer";
599
+
600
+ /** Stands in for creating the chat, after which the product navigates away. */
601
+ const CREATE_MS = 2000;
602
+
603
+ export default function ComposerStart() {
604
+ const [isCreating, setIsCreating] = useState(false);
605
+ const timer = useRef<ReturnType<typeof setTimeout>>(undefined);
606
+
607
+ useEffect(() => () => clearTimeout(timer.current), []);
608
+
609
+ const handleSubmit = () => {
610
+ setIsCreating(true);
611
+ timer.current = setTimeout(() => setIsCreating(false), CREATE_MS);
612
+ };
613
+
614
+ return (
615
+ <div className="w-full max-w-120">
616
+ {/* It goes away on send, so it keeps the text instead of flashing empty. */}
617
+ <Composer
618
+ status={isCreating ? COMPOSER_STATUSES.SUBMITTING : COMPOSER_STATUSES.IDLE}
619
+ onSubmit={handleSubmit}
620
+ onAddFiles={() => undefined}
621
+ clearOnSubmit={false}
622
+ >
623
+ <ComposerBox>
624
+ <ComposerEditor placeholder="What do you want to build?" />
625
+ <ComposerActions>
626
+ <ComposerActionGroup>
627
+ <ComposerAttachButton />
628
+ </ComposerActionGroup>
629
+ <ComposerSend variant={COMPOSER_SEND_VARIANTS.GLASS} />
630
+ </ComposerActions>
631
+ </ComposerBox>
632
+ </Composer>
633
+ </div>
634
+ );
635
+ }
636
+ ```
637
+
638
+ ### Files
639
+
640
+ With `onAddFiles` the root takes files from (+), a drop on the box and images pasted into the text (⌘V). They show above the text in ComposerFiles, with their upload state. Wrap the whole chat panel in a FileDropArea too, so a drop anywhere in it lands in the composer, under the same field.
641
+
642
+ Example: `files`
643
+
644
+ ```tsx
645
+ "use client";
646
+
647
+ import { useEffect, useRef, useState } from "react";
648
+ import {
649
+ ATTACHMENT_GALLERY_SIZES,
650
+ ATTACHMENT_STATUSES,
651
+ AttachmentGallery,
652
+ type AttachmentItem,
653
+ } from "@major-tech/ui/attachment-gallery";
654
+ import { MESSAGE_AUTHORS, Message } from "@major-tech/ui/message";
655
+ import {
656
+ Composer,
657
+ ComposerActionGroup,
658
+ ComposerActions,
659
+ ComposerAttachButton,
660
+ ComposerBox,
661
+ ComposerEditor,
662
+ ComposerFiles,
663
+ ComposerSend,
664
+ type ComposerMessage,
665
+ } from "@major-tech/ui/composer";
666
+ import { FILE_REJECTIONS, FileDropArea, validateFiles } from "@major-tech/ui/file-upload";
667
+ import { toast } from "@major-tech/ui/sonner";
668
+
669
+ const MAX_FILES = 30;
670
+ const MAX_FILE_BYTES = 100 * 1024 * 1024;
671
+ const DROP_HINT = "Up to 30 files, 100 MB each";
672
+
673
+ /** Stands in for the product's upload: a second of "uploading", a moment of "processing", then the file is done. */
674
+ const UPLOAD_MS = 1000;
675
+ const PROCESSING_MS = 800;
676
+
677
+ interface SentMessage {
678
+ id: number;
679
+ text: string;
680
+ files: AttachmentItem[];
681
+ }
682
+
683
+ export default function ComposerWithFiles() {
684
+ const [files, setFiles] = useState<AttachmentItem[]>([]);
685
+ const [sent, setSent] = useState<SentMessage[]>([]);
686
+ const urls = useRef(new Set<string>());
687
+
688
+ useEffect(() => {
689
+ const created = urls.current;
690
+
691
+ return () => created.forEach((url) => URL.revokeObjectURL(url));
692
+ }, []);
693
+
694
+ const toAttachment = (file: File): AttachmentItem => {
695
+ const url = URL.createObjectURL(file);
696
+ urls.current.add(url);
697
+
698
+ return {
699
+ id: url,
700
+ name: file.name,
701
+ type: file.type,
702
+ size: file.size,
703
+ url,
704
+ status: ATTACHMENT_STATUSES.UPLOADING,
705
+ };
706
+ };
707
+
708
+ const upload = (ids: string[]) => {
709
+ const uploading = new Set(ids);
710
+
711
+ setFiles((current) =>
712
+ current.map((item) => (uploading.has(item.id) ? { ...item, status: ATTACHMENT_STATUSES.UPLOADING } : item)),
713
+ );
714
+ setTimeout(() => {
715
+ setFiles((current) =>
716
+ current.map((item) => (uploading.has(item.id) ? { ...item, status: ATTACHMENT_STATUSES.PROCESSING } : item)),
717
+ );
718
+ }, UPLOAD_MS);
719
+ setTimeout(() => {
720
+ setFiles((current) =>
721
+ current.map((item) => (uploading.has(item.id) ? { ...item, status: ATTACHMENT_STATUSES.DONE } : item)),
722
+ );
723
+ }, UPLOAD_MS + PROCESSING_MS);
724
+ };
725
+
726
+ const addFiles = (picked: File[]) => {
727
+ const { accepted, rejected } = validateFiles(picked, {
728
+ maxSize: MAX_FILE_BYTES,
729
+ maxFiles: MAX_FILES,
730
+ attachedCount: files.length,
731
+ });
732
+ const tooMany = rejected.find(({ code }) => code === FILE_REJECTIONS.TOO_MANY);
733
+ const failed = rejected
734
+ .filter(({ code }) => code !== FILE_REJECTIONS.TOO_MANY)
735
+ .map(({ file, message }): AttachmentItem => ({
736
+ ...toAttachment(file),
737
+ status: ATTACHMENT_STATUSES.ERROR,
738
+ error: message,
739
+ }));
740
+ const added = accepted.map(toAttachment);
741
+
742
+ if (tooMany) {
743
+ toast(tooMany.message);
744
+ }
745
+
746
+ setFiles((current) => [...current, ...added, ...failed]);
747
+ upload(added.map(({ id }) => id));
748
+ };
749
+
750
+ const handleSubmit = ({ text }: ComposerMessage) => {
751
+ const ready = files.filter((item) => (item.status ?? ATTACHMENT_STATUSES.DONE) === ATTACHMENT_STATUSES.DONE);
752
+
753
+ setSent((messages) => [...messages, { id: messages.length, text, files: ready }]);
754
+ // Files that failed stay in the box with the reason; the message goes without them.
755
+ setFiles((current) => current.filter((item) => !ready.includes(item)));
756
+ };
757
+
758
+ return (
759
+ <FileDropArea
760
+ onFiles={addFiles}
761
+ hint={DROP_HINT}
762
+ className="flex min-h-110 w-full max-w-100 flex-col justify-end gap-space-32 rounded-xl border border-line bg-surface p-space-16"
763
+ >
764
+ {sent.length > 0 && (
765
+ <div className="flex flex-col gap-space-12">
766
+ {sent.map((message) => (
767
+ <Message key={message.id} from={MESSAGE_AUTHORS.USER} time="now">
768
+ <div className="flex flex-col gap-space-6">
769
+ <AttachmentGallery items={message.files} size={ATTACHMENT_GALLERY_SIZES.SM} />
770
+ {message.text}
771
+ </div>
772
+ </Message>
773
+ ))}
774
+ </div>
775
+ )}
776
+ <Composer
777
+ files={files}
778
+ onAddFiles={addFiles}
779
+ onRemoveFile={(id) => setFiles((current) => current.filter((item) => item.id !== id))}
780
+ onRetryFile={(id) => upload([id])}
781
+ onSubmit={handleSubmit}
782
+ >
783
+ <ComposerBox dropHint={DROP_HINT}>
784
+ <ComposerFiles />
785
+ <ComposerEditor placeholder="Drop or paste files, or use (+)" />
786
+ <ComposerActions>
787
+ <ComposerActionGroup>
788
+ <ComposerAttachButton />
789
+ </ComposerActionGroup>
790
+ <ComposerSend />
791
+ </ComposerActions>
792
+ </ComposerBox>
793
+ </Composer>
794
+ </FileDropArea>
795
+ );
796
+ }
797
+ ```
798
+
799
+ - Check every file with validateFiles before uploading: one that’s too large stays in the box as a failed tile with the reason; more than the limit is said once in a toast.
800
+ - Major’s chat takes any file type, up to 100 MB a file and 30 files a message. Say them in the drop field’s second line (ComposerBox's `dropHint`).
801
+ - Send waits while a file uploads or processes; files alone can be sent. Failed files are left out, and the message shows the rest in its bubble.
802
+ - Picked elements stay Chips, under the files: they aren’t files.
803
+
804
+ ### Files and their states
805
+
806
+ Each file in the box shows where its upload is: ready to upload, uploading, processing, failed or done, the same tiles as in AttachmentGallery. Send waits until nothing uploads or processes; files that failed stay in the box with the reason, and the message goes without them.
807
+
808
+ Example: `file-states`
809
+
810
+ ```tsx
811
+ "use client";
812
+
813
+ import { useState } from "react";
814
+ import { ATTACHMENT_STATUSES, type AttachmentItem } from "@major-tech/ui/attachment-gallery";
815
+ import {
816
+ Composer,
817
+ ComposerActions,
818
+ ComposerBox,
819
+ ComposerEditor,
820
+ ComposerFiles,
821
+ ComposerSend,
822
+ } from "@major-tech/ui/composer";
823
+
824
+ const DROP_HINT = "Up to 30 files, 100 MB each";
825
+
826
+ /** Send waits: one file still uploads, one is being read. */
827
+ const BUSY_FILES: AttachmentItem[] = [
828
+ {
829
+ id: "selected",
830
+ name: "pricing-notes.pdf",
831
+ status: ATTACHMENT_STATUSES.IDLE,
832
+ size: 640_000,
833
+ },
834
+ {
835
+ id: "uploading",
836
+ name: "q4-pipeline.xlsx",
837
+ status: ATTACHMENT_STATUSES.UPLOADING,
838
+ progress: 48,
839
+ size: 2_400_000,
840
+ },
841
+ {
842
+ id: "processing",
843
+ name: "sales-calls.csv",
844
+ status: ATTACHMENT_STATUSES.PROCESSING,
845
+ size: 880_000,
846
+ },
847
+ {
848
+ id: "picture",
849
+ name: "dashboard-sketch.png",
850
+ url: "/major-mark.svg",
851
+ status: ATTACHMENT_STATUSES.UPLOADING,
852
+ progress: 72,
853
+ },
854
+ ];
855
+
856
+ /** Send works: the uploaded files go, the failed one is left out. */
857
+ const READY_FILES: AttachmentItem[] = [
858
+ {
859
+ id: "brief",
860
+ name: "Sales dashboard brief.pdf",
861
+ url: "/major-mark.svg",
862
+ size: 2_516_582,
863
+ },
864
+ { id: "logo", name: "major-mark.svg", url: "/major-mark.svg", size: 1_204 },
865
+ {
866
+ id: "too-large",
867
+ name: "call-recording.mov",
868
+ status: ATTACHMENT_STATUSES.ERROR,
869
+ error: "Larger than 100 MB",
870
+ size: 182_000_000,
871
+ },
872
+ {
873
+ id: "dropped",
874
+ name: "leads-november.csv",
875
+ status: ATTACHMENT_STATUSES.ERROR,
876
+ error: "Upload failed. Try again.",
877
+ isRetryable: true,
878
+ size: 18_432,
879
+ },
880
+ ];
881
+
882
+ export default function ComposerFileStates() {
883
+ const [busyFiles, setBusyFiles] = useState(BUSY_FILES);
884
+ const [readyFiles, setReadyFiles] = useState(READY_FILES);
885
+
886
+ const removeBusy = (id: string) => setBusyFiles((current) => current.filter((item) => item.id !== id));
887
+ const removeReady = (id: string) => setReadyFiles((current) => current.filter((item) => item.id !== id));
888
+
889
+ const retry = (id: string) =>
890
+ setReadyFiles((current) =>
891
+ current.map((item) => (item.id === id ? { ...item, status: ATTACHMENT_STATUSES.DONE, error: undefined } : item)),
892
+ );
893
+
894
+ return (
895
+ <div className="flex w-full max-w-100 flex-col gap-space-24">
896
+ <Composer files={busyFiles} onAddFiles={() => undefined} onRemoveFile={removeBusy}>
897
+ <ComposerBox dropHint={DROP_HINT}>
898
+ <ComposerFiles />
899
+ <ComposerEditor placeholder="Send waits for the uploads" />
900
+ <ComposerActions>
901
+ <ComposerSend />
902
+ </ComposerActions>
903
+ </ComposerBox>
904
+ </Composer>
905
+ <Composer files={readyFiles} onAddFiles={() => undefined} onRemoveFile={removeReady} onRetryFile={retry}>
906
+ <ComposerBox dropHint={DROP_HINT}>
907
+ <ComposerFiles />
908
+ <ComposerEditor placeholder="Failed files are left out" defaultValue="Build a sales dashboard from these" />
909
+ <ComposerActions>
910
+ <ComposerSend />
911
+ </ComposerActions>
912
+ </ComposerBox>
913
+ </Composer>
914
+ </div>
915
+ );
916
+ }
917
+ ```
918
+
919
+ - Top: one file uploads, one is being read and a picture uploads with its progress bar, so Send is off.
920
+ - Bottom: two files are done and two failed: one too large (no Retry), one dropped (Retry). Send sends the text with the two done files.
921
+ - Failed files keep their remove button visible, so the person can clear them before sending.
922
+
923
+ ### While Major works
924
+
925
+ Stop shows (a 9px ink square on secondary: never green, never inverted; Esc in the text works too), and once something is typed Send stands beside it. While Major waits on its questions (the root's `onRespond`), Enter and Send answer them: Send is Respond, with “Skip questions and send” in its menu. An answer that doesn't go through (someone else answered first) returns `false`, and the text stays. A message sent while Major works is queued in the conversation, as a Message with `queued` (its files and chips go with it), not in the composer.
926
+
927
+ Example: `working`
928
+
929
+ ```tsx
930
+ "use client";
931
+
932
+ import { useState } from "react";
933
+ import {
934
+ COMPOSER_STATUSES,
935
+ Composer,
936
+ ComposerActionGroup,
937
+ ComposerActions,
938
+ ComposerAttachButton,
939
+ ComposerBox,
940
+ ComposerContextRing,
941
+ ComposerEditor,
942
+ ComposerFooter,
943
+ ComposerSend,
944
+ } from "@major-tech/ui/composer";
945
+ import { Switch } from "@major-tech/ui/switch";
946
+
947
+ const CONTEXT_USAGE_PERCENT = 86;
948
+
949
+ export default function ComposerWorking() {
950
+ const [isWorking, setIsWorking] = useState(true);
951
+ const [isAsking, setIsAsking] = useState(false);
952
+
953
+ // While Major works, the product queues the message in the conversation; otherwise it starts the work.
954
+ const handleSubmit = () => setIsWorking(true);
955
+
956
+ // The answer to Major's questions: the reply goes on.
957
+ const handleRespond = () => setIsAsking(false);
958
+
959
+ return (
960
+ <div className="flex w-90 flex-col gap-space-12">
961
+ <Composer
962
+ status={isWorking ? COMPOSER_STATUSES.WORKING : COMPOSER_STATUSES.IDLE}
963
+ onStop={() => setIsWorking(false)}
964
+ onSubmit={handleSubmit}
965
+ onRespond={isAsking ? handleRespond : undefined}
966
+ onAddFiles={() => undefined}
967
+ >
968
+ <ComposerBox>
969
+ <ComposerEditor />
970
+ <ComposerActions>
971
+ <ComposerActionGroup>
972
+ <ComposerAttachButton />
973
+ </ComposerActionGroup>
974
+ <ComposerSend />
975
+ </ComposerActions>
976
+ </ComposerBox>
977
+ <ComposerFooter>
978
+ <ComposerContextRing value={CONTEXT_USAGE_PERCENT} />
979
+ </ComposerFooter>
980
+ </Composer>
981
+ <label className="flex items-center gap-space-8 text-small text-muted">
982
+ <Switch checked={isAsking} onCheckedChange={setIsAsking} />
983
+ Major waits on its questions
984
+ </label>
985
+ </div>
986
+ );
987
+ }
988
+ ```
989
+
990
+ ### On a phone
991
+
992
+ ComposerBox's `docked` variant sits on the bottom of the screen: no side or bottom edge, square corners and room for the home bar. Settings that live in the row under the box move into ComposerActions there, beside Send.
993
+
994
+ ### Guidelines
995
+
996
+ Do:
997
+
998
+ - One composer per chat panel, at the bottom, 32px under the last message.
999
+ - Confirm a stop in the reply: “Stopped after 3s”, “Stopped. Nothing was changed.”
1000
+ - Send queued messages by themselves, in order, when the current reply ends.
1001
+
1002
+ Don't:
1003
+
1004
+ - Put session settings inside the box on a wide screen: they belong to ComposerFooter.
1005
+ - Make Stop red or green.
1006
+ - Use the composer as a search field; filtering lists uses SearchField.
1007
+
1008
+ ## API
1009
+
1010
+ ```bash
1011
+ yarn add @tiptap/core @tiptap/react @tiptap/pm @tiptap/extension-document @tiptap/extension-paragraph @tiptap/extension-text @tiptap/extension-hard-break @tiptap/extensions @tiptap/extension-mention @tiptap/suggestion
1012
+ # or: pnpm add @tiptap/core @tiptap/react @tiptap/pm @tiptap/extension-document @tiptap/extension-paragraph @tiptap/extension-text @tiptap/extension-hard-break @tiptap/extensions @tiptap/extension-mention @tiptap/suggestion
1013
+ ```
1014
+
1015
+ ```tsx
1016
+ import { Composer, ComposerBox, ComposerFiles, ComposerChips, ComposerEditor, ComposerActions, ComposerActionGroup, ComposerAttachButton, ComposerAttachFileItem, ComposerPicker, ComposerSend, ComposerContextRing, ComposerFooter, COMPOSER_STATUSES, COMPOSER_BOX_VARIANTS, COMPOSER_SEND_VARIANTS } from "@major-tech/ui/composer";
1017
+ ```
1018
+
1019
+ ### `<Composer />`
1020
+
1021
+ The root: the parts go inside it. Other `<div>` attributes go to its column.
1022
+
1023
+ | Prop | Type | Default | Description |
1024
+ | --- | --- | --- | --- |
1025
+ | `ref` | `Ref<ComposerHandle>` | — | `focus`, `clear`, `insertMention`, `setText(text, mentions?)`, `getMessage`, `setDocument` and `openFilePicker`, for what happens outside: the file tree's “Mention in chat”, a queued message to edit, a draft. |
1026
+ | `onSubmit` | `(message: ComposerMessage) => void \| boolean \| Promise<…>` | — | Enter or Send with text, done files or chips: `{ text, mentions, document }`. Return `false` (or a promise of it) when it didn't go, and the text stays. |
1027
+ | `onRespond` | Same as `onSubmit` | — | While Major waits on its questions: Enter and Send answer them; Send's menu has Skip questions and send for `onSubmit`. |
1028
+ | `onValueChange` | `(message: ComposerMessage) => void` | — | Every edit, and once with the text the editor starts from: for a draft. |
1029
+ | `status` | `"idle" \| "submitting" \| "working"` | `"idle"` | Submitting spins Send; working shows Stop. `COMPOSER_STATUSES` holds the values. |
1030
+ | `onStop` | `() => void` | — | Stop, and Esc in the text while working. |
1031
+ | `files` | `AttachmentItem[]` | — | Attached files and screenshots, for ComposerFiles. Send waits while one uploads. |
1032
+ | `onRemoveFile / onRetryFile` | `(id: string) => void` | — | Remove on each file; Retry on a failed one that can be retried. |
1033
+ | `onAddFiles` | `(files: File[]) => void` | — | Takes files from (+), a drop on the box and images pasted into the text. Check them, upload, pass them in `files`. |
1034
+ | `serializeMention` | `(mention: ComposerMention) => string` | `@label` | How a mention reads in the sent text and in `setText`. |
1035
+ | `clearOnSubmit` | `boolean` | `true` | False where the composer goes away on send. |
1036
+ | `disabled` | `boolean` | `false` | Dims the box; nothing can be typed or sent. |
1037
+
1038
+ ### `<ComposerBox />`
1039
+
1040
+ | Prop | Type | Default | Description |
1041
+ | --- | --- | --- | --- |
1042
+ | `variant` | `"card" \| "docked"` | `"card"` | A card, or docked to the bottom of a phone's screen. `COMPOSER_BOX_VARIANTS` holds the values. |
1043
+ | `dropHint` | `ReactNode` | — | The drop field’s second line: the limits. |
1044
+
1045
+ A click on its empty space puts the caret in the text.
1046
+
1047
+ ### `<ComposerEditor />`
1048
+
1049
+ | Prop | Type | Default | Description |
1050
+ | --- | --- | --- | --- |
1051
+ | `placeholder` | `string` | `"Ask anything"` | Italic, in muted. |
1052
+ | `defaultValue` | `string \| ComposerDocument` | — | What the text starts with: a prompt carried over, or a saved draft's document. Read on mount; a new `key` starts over. |
1053
+ | `defaultMentions` | `ComposerMention[]` | — | With a string `defaultValue`: the mentions whose tokens in it start as chips. |
1054
+ | `autoFocus` | `boolean` | `false` | The caret in the text on mount. |
1055
+ | `maxHeight` | `number` | `160` | Height before the text scrolls. |
1056
+ | `mentionGroups` | `ComposerMentionGroup[]` | — | The @ menu's sections for the current query: `{ label?, items }`. Without it and `onMentionQueryChange`, @ is just a character. |
1057
+ | `onMentionQueryChange` | `(query: string \| null) => void` | — | The query after @, "" right after it, null once the menu closes. |
1058
+ | `isMentionLoading` | `boolean` | `false` | A spinner in the menu while the product searches. |
1059
+ | `mentionEmptyText` | `string` | `"No matches"` | The menu with nothing to show. |
1060
+ | `mentionHint` | `string` | — | A muted line atop the menu before anything is typed after @. |
1061
+ | `getMentionIcon` | `(mention: ComposerMention) => ReactNode` | — | A 14px mark for a mention, in the menu and on its chip. |
1062
+ | `aria-label` | `string` | `"Message"` | The text field's name. |
1063
+
1064
+ A mention is `{ id, label, kind?, type?, data?, description? }`: `kind` gives the chip Chip's colours (neutral without it, as for a file), `description` shows in the menu only, `type` and `data` come back as they went in.
1065
+
1066
+ ### `<ComposerSend />`
1067
+
1068
+ | Prop | Type | Default | Description |
1069
+ | --- | --- | --- | --- |
1070
+ | `variant` | `"default" \| "glass"` | `"default"` | The chat's 26px tile, or the 34px glass tile of a composer that starts something. `COMPOSER_SEND_VARIANTS` holds the values. |
1071
+
1072
+ ### Other parts
1073
+
1074
+ | Part | Props | Description |
1075
+ | --- | --- | --- |
1076
+ | `ComposerFiles` | AttachmentGallery's, but `items` | The root's files as md tiles. |
1077
+ | `ComposerChips` | `<div>` | A wrapping row of Chips above the text; nothing when empty. Chips go with the message, so Send works with them alone. |
1078
+ | `ComposerActions` | `<div>` | The row under the text: two ComposerActionGroups, or Send alone on the right. |
1079
+ | `ComposerActionGroup` | `<div>` | A run of controls, 4px apart. |
1080
+ | `ComposerAttachButton` | `label?`, `children?`, Button's | (+): the file picker, a menu of its children, or what `onClick` says (also as a Popover's trigger). |
1081
+ | `ComposerAttachFileItem` | DropdownMenuItem's | The (+) menu's row that opens the file picker. |
1082
+ | `ComposerPicker` | `active`, `onActiveChange` | Click and ask, with ⌘⇧C anywhere on the page and Esc. |
1083
+ | `ComposerContextRing` | `value` (0–100), button's | The context ring; a button with `onClick` or as a Popover's trigger. |
1084
+ | `ComposerFooter` | `<div>` | The quiet row under the box. |
1085
+
1086
+ ### Accessibility
1087
+
1088
+ - The text is a multi-line textbox labelled “Message”. With mentions it owns the menu: `aria-expanded`, `aria-controls` and `aria-activedescendant` follow the open menu and its current row, so the focus never leaves the text.
1089
+ - Send's name follows its state (Send, Sending, Stop, Respond).
1090
+ - Every tool is a labelled button with a tooltip that opens upward; shortcuts show as a key hint.
1091
+ - Click and ask exposes `aria-pressed`; IME composition never sends early.
1092
+ - Files can always be added with (+), not only by dragging.