@major-tech/ui 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/CHANGELOG.md +107 -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 +159 -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 +284 -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,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createContext, useContext } from "react";
4
+ import { cn } from "../lib/cn.js";
5
+ import { ENTITY_CARD_ACTIVATIONS, ENTITY_FOCUS_RING, ENTITY_LAYOUTS, EntityItemProvider, } from "./entity-card.js";
6
+ /** What takes the rest of the row: the name's column, and any other column without a width. */
7
+ const FLEXIBLE_TRACK = "minmax(0,1fr)";
8
+ /** The menu's column at the end of every row; it has no name in the header. */
9
+ const MENU_TRACK = "1.75rem";
10
+ /** The header and every row share the list's columns, so they line up without a table. */
11
+ const ROW_GRID = "grid gap-x-7 grid-cols-(--entity-list-columns) @max-[720px]:grid-cols-(--entity-list-columns-narrow)";
12
+ const WIDE_ONLY = "@max-[720px]:hidden";
13
+ const EntityListContext = createContext(null);
14
+ function useEntityListColumns(part) {
15
+ const columns = useContext(EntityListContext);
16
+ if (columns === null) {
17
+ throw new Error(`${part} must be used inside <EntityList>.`);
18
+ }
19
+ return columns;
20
+ }
21
+ function buildTrackList(columns) {
22
+ return [...columns.map((column) => column.width ?? FLEXIBLE_TRACK), MENU_TRACK].join(" ");
23
+ }
24
+ /**
25
+ * The list view of a library: the columns it declares, their names in a light header, and the EntityRows under it.
26
+ * Under 720px of list width the wide columns drop out.
27
+ */
28
+ export function EntityList({ columns, className, style, children, ...props }) {
29
+ const listStyle = {
30
+ "--entity-list-columns": buildTrackList(columns),
31
+ "--entity-list-columns-narrow": buildTrackList(columns.filter((column) => !column.isWide)),
32
+ ...style,
33
+ };
34
+ return (_jsx(EntityListContext.Provider, { value: columns, children: _jsxs("div", { "data-slot": "entity-list", role: "list", className: cn("@container", className), style: listStyle, ...props, children: [_jsx("div", { "data-slot": "entity-list-header", "aria-hidden": "true", className: cn(ROW_GRID, "items-center border-b border-line px-space-12 pb-space-8 text-small text-muted"), children: columns.map((column) => (_jsx("span", { className: cn("truncate", column.isWide && WIDE_ONLY), children: column.label }, column.key))) }), children] }) }));
35
+ }
36
+ /**
37
+ * One object in an EntityList: its EntityRowCells in the list's columns, then its EntityMenu at the end. The parts are
38
+ * EntityCard's, drawn for a row: one line of description, the editors' faces with a count.
39
+ */
40
+ export function EntityRow({ onOpen, href, linkAs, activation = ENTITY_CARD_ACTIVATIONS.ENABLED, className, children, ...props }) {
41
+ useEntityListColumns("EntityRow");
42
+ const isOpenable = Boolean(onOpen || href);
43
+ const isEnabled = activation === ENTITY_CARD_ACTIVATIONS.ENABLED;
44
+ return (_jsx(EntityItemProvider, { value: { layout: ENTITY_LAYOUTS.ROW, activation, onOpen, href, linkAs }, children: _jsx("div", { "data-slot": "entity-row", "data-activation": activation, role: "listitem", className: cn(
45
+ // Square, like a table row: the fill runs edge to edge and the line stays.
46
+ "relative items-center border-b border-line px-space-12 py-space-14 transition-colors duration-120", ROW_GRID, ENTITY_FOCUS_RING, "has-[[data-slot=entity-open]:focus-visible]:ring-inset", isOpenable && isEnabled && "hover:bg-hover", !isEnabled && "opacity-60", className), ...props, children: children }) }));
47
+ }
48
+ /** What one column of the row shows: any parts, in any order. A wide column's cell drops out with its column. */
49
+ export function EntityRowCell({ column, className, style, children, ...props }) {
50
+ const columns = useEntityListColumns("EntityRowCell");
51
+ const index = columns.findIndex((candidate) => candidate.key === column);
52
+ if (index === -1) {
53
+ throw new Error(`EntityRowCell: the list has no column "${column}".`);
54
+ }
55
+ const isWide = columns[index].isWide === true;
56
+ const narrowIndex = columns.filter((candidate) => !candidate.isWide).findIndex((candidate) => candidate.key === column);
57
+ // Placed by its column, not by its order, so a row may leave a column empty.
58
+ const cellStyle = {
59
+ "--entity-cell-column": index + 1,
60
+ "--entity-cell-column-narrow": narrowIndex + 1,
61
+ ...style,
62
+ };
63
+ return (_jsx("div", { "data-slot": "entity-row-cell", className: cn("row-start-1 col-start-(--entity-cell-column) @max-[720px]:col-start-(--entity-cell-column-narrow) min-w-0", isWide && WIDE_ONLY, className), style: cellStyle, ...props, children: children }));
64
+ }
65
+ //# sourceMappingURL=entity-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-row.js","sourceRoot":"","sources":["../../src/components/entity-row.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAA2C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C1B,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACL,GACa,CACtB,CAAC;AACJ,CAAC;AAOD,iHAAiH;AACjH,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsB;IAChG,MAAM,OAAO,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC;IAEzE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC;IAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC;IACxH,6EAA6E;IAC7E,MAAM,SAAS,GAAG;QAChB,sBAAsB,EAAE,KAAK,GAAG,CAAC;QACjC,6BAA6B,EAAE,WAAW,GAAG,CAAC;QAC9C,GAAG,KAAK;KACQ,CAAC;IAEnB,OAAO,CACL,2BACY,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,2GAA2G,EAC3G,MAAM,IAAI,SAAS,EACnB,SAAS,CACV,EACD,KAAK,EAAE,SAAS,KACZ,KAAK,YAER,QAAQ,GACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport { createContext, useContext, type ComponentProps, type CSSProperties } from \"react\";\nimport { cn } from \"../lib/cn.ts\";\nimport {\n ENTITY_CARD_ACTIVATIONS,\n ENTITY_FOCUS_RING,\n ENTITY_LAYOUTS,\n EntityItemProvider,\n type EntityCardProps,\n} from \"./entity-card.tsx\";\n\n/** One column of a library's list: its name in the header, its width, and whether it drops out on a narrow list. */\nexport interface EntityListColumn {\n /** What a row's EntityRowCell names to land in it. */\n key: string;\n /** The column's name in the header. */\n label: string;\n /** Its CSS track: \"7rem\", \"11.875rem\". Without it the column shares what's left with the others that have none. */\n width?: string;\n /** Drops out when the list is under 720px wide: the details (the last use, the editors), never the name. */\n isWide?: boolean;\n}\n\n/** What takes the rest of the row: the name's column, and any other column without a width. */\nconst FLEXIBLE_TRACK = \"minmax(0,1fr)\";\n/** The menu's column at the end of every row; it has no name in the header. */\nconst MENU_TRACK = \"1.75rem\";\n/** The header and every row share the list's columns, so they line up without a table. */\nconst ROW_GRID = \"grid gap-x-7 grid-cols-(--entity-list-columns) @max-[720px]:grid-cols-(--entity-list-columns-narrow)\";\nconst WIDE_ONLY = \"@max-[720px]:hidden\";\n\nconst EntityListContext = createContext<EntityListColumn[] | null>(null);\n\nfunction useEntityListColumns(part: string) {\n const columns = useContext(EntityListContext);\n\n if (columns === null) {\n throw new Error(`${part} must be used inside <EntityList>.`);\n }\n\n return columns;\n}\n\nfunction buildTrackList(columns: EntityListColumn[]) {\n return [...columns.map((column) => column.width ?? FLEXIBLE_TRACK), MENU_TRACK].join(\" \");\n}\n\nexport interface EntityListProps extends ComponentProps<\"div\"> {\n /** The library's columns, in order. Every row puts its cells in them; the menu's column is added at the end. */\n columns: EntityListColumn[];\n /** The list's name for screen readers: the library's, \"Agents\". */\n \"aria-label\": string;\n}\n\n/**\n * The list view of a library: the columns it declares, their names in a light header, and the EntityRows under it.\n * Under 720px of list width the wide columns drop out.\n */\nexport function EntityList({ columns, className, style, children, ...props }: EntityListProps) {\n const listStyle = {\n \"--entity-list-columns\": buildTrackList(columns),\n \"--entity-list-columns-narrow\": buildTrackList(columns.filter((column) => !column.isWide)),\n ...style,\n } as CSSProperties;\n\n return (\n <EntityListContext.Provider value={columns}>\n <div data-slot=\"entity-list\" role=\"list\" className={cn(\"@container\", className)} style={listStyle} {...props}>\n {/* Hidden from screen readers: each row reads on its own, its name first. */}\n <div\n data-slot=\"entity-list-header\"\n aria-hidden=\"true\"\n className={cn(ROW_GRID, \"items-center border-b border-line px-space-12 pb-space-8 text-small text-muted\")}\n >\n {columns.map((column) => (\n <span key={column.key} className={cn(\"truncate\", column.isWide && WIDE_ONLY)}>\n {column.label}\n </span>\n ))}\n </div>\n {children}\n </div>\n </EntityListContext.Provider>\n );\n}\n\nexport type EntityRowProps = EntityCardProps;\n\n/**\n * One object in an EntityList: its EntityRowCells in the list's columns, then its EntityMenu at the end. The parts are\n * EntityCard's, drawn for a row: one line of description, the editors' faces with a count.\n */\nexport function EntityRow({\n onOpen,\n href,\n linkAs,\n activation = ENTITY_CARD_ACTIVATIONS.ENABLED,\n className,\n children,\n ...props\n}: EntityRowProps) {\n useEntityListColumns(\"EntityRow\");\n const isOpenable = Boolean(onOpen || href);\n const isEnabled = activation === ENTITY_CARD_ACTIVATIONS.ENABLED;\n\n return (\n <EntityItemProvider value={{ layout: ENTITY_LAYOUTS.ROW, activation, onOpen, href, linkAs }}>\n <div\n data-slot=\"entity-row\"\n data-activation={activation}\n role=\"listitem\"\n className={cn(\n // Square, like a table row: the fill runs edge to edge and the line stays.\n \"relative items-center border-b border-line px-space-12 py-space-14 transition-colors duration-120\",\n ROW_GRID,\n ENTITY_FOCUS_RING,\n \"has-[[data-slot=entity-open]:focus-visible]:ring-inset\",\n isOpenable && isEnabled && \"hover:bg-hover\",\n !isEnabled && \"opacity-60\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </EntityItemProvider>\n );\n}\n\nexport interface EntityRowCellProps extends ComponentProps<\"div\"> {\n /** The key of the list's column it lands in. */\n column: string;\n}\n\n/** What one column of the row shows: any parts, in any order. A wide column's cell drops out with its column. */\nexport function EntityRowCell({ column, className, style, children, ...props }: EntityRowCellProps) {\n const columns = useEntityListColumns(\"EntityRowCell\");\n const index = columns.findIndex((candidate) => candidate.key === column);\n\n if (index === -1) {\n throw new Error(`EntityRowCell: the list has no column \"${column}\".`);\n }\n\n const isWide = columns[index].isWide === true;\n const narrowIndex = columns.filter((candidate) => !candidate.isWide).findIndex((candidate) => candidate.key === column);\n // Placed by its column, not by its order, so a row may leave a column empty.\n const cellStyle = {\n \"--entity-cell-column\": index + 1,\n \"--entity-cell-column-narrow\": narrowIndex + 1,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n data-slot=\"entity-row-cell\"\n className={cn(\n \"row-start-1 col-start-(--entity-cell-column) @max-[720px]:col-start-(--entity-cell-column-narrow) min-w-0\",\n isWide && WIDE_ONLY,\n className\n )}\n style={cellStyle}\n {...props}\n >\n {children}\n </div>\n );\n}\n"]}
@@ -0,0 +1,51 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import { RequestCard } from "./request-card.tsx";
3
+ /** One of the app's environments: a column of values the request asks for. */
4
+ export interface EnvVarRequestEnvironment {
5
+ id: string;
6
+ /** “Development”, “Production”. */
7
+ name: string;
8
+ }
9
+ /** The typed values: key, then environment id, then value (`{ OPENAI_API_KEY: { "env-dev": "sk-…" } }`). */
10
+ export type EnvVarRequestValues = Record<string, Record<string, string>>;
11
+ export type EnvVarRequestProps = Omit<ComponentProps<typeof RequestCard>, "children" | "onSubmit"> & {
12
+ /** The keys Major asks for (`OPENAI_API_KEY`). None: the request couldn't be read, and the card offers Dismiss. */
13
+ keys: string[];
14
+ /** The app's environments: one input per key in each. */
15
+ environments?: EnvVarRequestEnvironment[];
16
+ /** A spinner stands in for the inputs while the environments load; Save waits. */
17
+ isLoading?: boolean;
18
+ /** The typed values, when the product holds them; pair with `onValuesChange`. */
19
+ values?: EnvVarRequestValues;
20
+ /** Values the inputs start with (a value Major proposed), when the card holds them itself. */
21
+ defaultValues?: EnvVarRequestValues;
22
+ onValuesChange?: (values: EnvVarRequestValues) => void;
23
+ /** Saving runs: Save shows its spinner, Skip waits. */
24
+ isSaving?: boolean;
25
+ /** What went wrong, under the inputs (“At least one environment variable must have a value”). */
26
+ error?: ReactNode;
27
+ /** Save with the typed values. Checking and saving them is the product's. */
28
+ onSave?: (values: EnvVarRequestValues) => void;
29
+ /** Skip the request; also the Dismiss of one that couldn't be read. */
30
+ onSkip?: () => void;
31
+ };
32
+ /**
33
+ * Major asks for an app's environment variables, in its reply: every key in mono with one input per environment,
34
+ * then Skip and Save. Values are uncontrolled (`defaultValues`) or controlled (`values` + `onValuesChange`); the
35
+ * product checks and saves them in `onSave` and passes back `error`. With no `keys` the card says the request
36
+ * couldn't be read and offers Dismiss.
37
+ */
38
+ export declare function EnvVarRequest({ keys, environments, isLoading, values, defaultValues, onValuesChange, isSaving, error, onSave, onSkip, ...props }: EnvVarRequestProps): import("react").JSX.Element;
39
+ export declare const ENV_VAR_REQUEST_OUTCOMES: {
40
+ /** The values were saved. */
41
+ readonly CONFIGURED: "configured";
42
+ /** The request was skipped or dismissed. */
43
+ readonly SKIPPED: "skipped";
44
+ };
45
+ export type EnvVarRequestOutcomeValue = (typeof ENV_VAR_REQUEST_OUTCOMES)[keyof typeof ENV_VAR_REQUEST_OUTCOMES];
46
+ export type EnvVarRequestOutcomeProps = Omit<ComponentProps<"div">, "children"> & {
47
+ outcome: EnvVarRequestOutcomeValue;
48
+ };
49
+ /** The request once decided, as one 12px `muted` line where the card stood: configured, or skipped (its icon `faint`). */
50
+ export declare function EnvVarRequestOutcome({ outcome, className, ...props }: EnvVarRequestOutcomeProps): import("react").JSX.Element;
51
+ //# sourceMappingURL=env-var-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-var-request.d.ts","sourceRoot":"","sources":["../../src/components/env-var-request.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAM7E,OAAO,EACL,WAAW,EAOZ,MAAM,oBAAoB,CAAC;AAG5B,8EAA8E;AAC9E,MAAM,WA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C,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAOjH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAChF,OAAO,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,0HAA0H;AAC1H,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,yBAAyB,+BAc/F"}
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useId, useState } from "react";
4
+ import { KeyRound, MessageSquare } from "lucide-react";
5
+ import { cn } from "../lib/cn.js";
6
+ import { BUTTON_SIZES, BUTTON_VARIANTS, Button } from "./button.js";
7
+ import { Field, FieldError, FieldLabel } from "./field.js";
8
+ import { Input } from "./input.js";
9
+ import { RequestCard, RequestCardBody, RequestCardDescription, RequestCardFooter, RequestCardHeader, RequestCardKicker, RequestCardTitle, } from "./request-card.js";
10
+ import { Spinner } from "./spinner.js";
11
+ const NO_ENVIRONMENTS = [];
12
+ const NO_VALUES = {};
13
+ /**
14
+ * Major asks for an app's environment variables, in its reply: every key in mono with one input per environment,
15
+ * then Skip and Save. Values are uncontrolled (`defaultValues`) or controlled (`values` + `onValuesChange`); the
16
+ * product checks and saves them in `onSave` and passes back `error`. With no `keys` the card says the request
17
+ * couldn't be read and offers Dismiss.
18
+ */
19
+ export function EnvVarRequest({ keys, environments = NO_ENVIRONMENTS, isLoading = false, values, defaultValues = NO_VALUES, onValuesChange, isSaving = false, error, onSave, onSkip, ...props }) {
20
+ const inputIdPrefix = useId();
21
+ const [ownValues, setOwnValues] = useState(defaultValues);
22
+ const currentValues = values ?? ownValues;
23
+ const setValue = (key, environmentId, value) => {
24
+ const nextValues = { ...currentValues, [key]: { ...currentValues[key], [environmentId]: value } };
25
+ setOwnValues(nextValues);
26
+ onValuesChange?.(nextValues);
27
+ };
28
+ if (keys.length === 0) {
29
+ return (_jsxs(RequestCard, { "aria-label": "Environment variables", ...props, children: [_jsxs(RequestCardKicker, { children: [_jsx(KeyRound, {}), "Environment variables"] }), _jsx(RequestCardHeader, { children: _jsx(RequestCardDescription, { children: "Something went wrong loading this environment-variable request." }) }), _jsx(RequestCardFooter, { children: _jsx(Button, { variant: BUTTON_VARIANTS.OUTLINE, size: BUTTON_SIZES.SM, onClick: onSkip, children: "Dismiss" }) })] }));
30
+ }
31
+ return (_jsxs(RequestCard, { "aria-label": "Environment variables", ...props, children: [_jsxs(RequestCardKicker, { children: [_jsx(KeyRound, {}), "Environment variables"] }), _jsx(RequestCardHeader, { children: _jsx(RequestCardTitle, { children: "The agent needs you to add environment variables." }) }), isLoading ? (_jsx(RequestCardBody, { className: "flex justify-center pt-space-16", children: _jsx(Spinner, { className: "size-4 text-muted" }) })) : (_jsxs(RequestCardBody, { className: "flex flex-col gap-space-14", children: [keys.map((key) => (_jsxs("div", { className: "flex flex-col gap-space-8", children: [_jsx("p", { className: "m-0 font-mono text-code-small font-medium text-ink", children: key }), environments.map((environment) => {
32
+ const inputId = `${inputIdPrefix}-${key}-${environment.id}`;
33
+ return (_jsxs(Field, { children: [_jsx(FieldLabel, { htmlFor: inputId, className: "text-small font-normal text-muted", children: environment.name }), _jsx(Input, { id: inputId, placeholder: "Value", value: currentValues[key]?.[environment.id] ?? "", onChange: (event) => setValue(key, environment.id, event.target.value), className: "font-mono" })] }, environment.id));
34
+ })] }, key))), _jsx(FieldError, { children: error })] })), _jsxs(RequestCardFooter, { children: [_jsx(Button, { variant: BUTTON_VARIANTS.GHOST, size: BUTTON_SIZES.SM, className: "me-auto", onClick: onSkip, disabled: isSaving, children: "Skip" }), _jsx(Button, { size: BUTTON_SIZES.SM, onClick: () => onSave?.(currentValues), loading: isSaving, disabled: isLoading, children: "Save" })] })] }));
35
+ }
36
+ export const ENV_VAR_REQUEST_OUTCOMES = {
37
+ /** The values were saved. */
38
+ CONFIGURED: "configured",
39
+ /** The request was skipped or dismissed. */
40
+ SKIPPED: "skipped",
41
+ };
42
+ const OUTCOME_LABELS = {
43
+ [ENV_VAR_REQUEST_OUTCOMES.CONFIGURED]: "Environment variables configured",
44
+ [ENV_VAR_REQUEST_OUTCOMES.SKIPPED]: "Environment variable setup skipped",
45
+ };
46
+ /** The request once decided, as one 12px `muted` line where the card stood: configured, or skipped (its icon `faint`). */
47
+ export function EnvVarRequestOutcome({ outcome, className, ...props }) {
48
+ return (_jsx("div", { "data-slot": "env-var-request-outcome", "data-outcome": outcome, className: cn("flex flex-col gap-0.5 py-0.5 font-sans text-small text-muted", className), ...props, children: _jsxs("div", { className: "flex items-center gap-space-6 [&>svg]:size-3.5 [&>svg]:shrink-0", children: [_jsx(MessageSquare, { "aria-hidden": true, className: cn(outcome === ENV_VAR_REQUEST_OUTCOMES.SKIPPED && "text-faint") }), _jsx("span", { children: OUTCOME_LABELS[outcome] })] }) }));
49
+ }
50
+ //# sourceMappingURL=env-var-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env-var-request.js","sourceRoot":"","sources":["../../src/components/env-var-request.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,aAAc,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAa,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AACpC,OAAO,EACL,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MA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,CAAC,EACF,KAAC,UAAU,cAAE,KAAK,GAAc,IAChB,CACnB,EACD,MAAC,iBAAiB,eAChB,KAAC,MAAM,IAAC,OAAO,EAAE,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,EAAE,EAAE,SAAS,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,qBAE7G,EACT,KAAC,MAAM,IAAC,IAAI,EAAE,YAAY,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,qBAEpG,IACS,IACR,CACf,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,6BAA6B;IAC7B,UAAU,EAAE,YAAY;IACxB,4CAA4C;IAC5C,OAAO,EAAE,SAAS;CACV,CAAC;AAIX,MAAM,cAAc,GAAG;IACrB,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,kCAAkC;IACzE,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,oCAAoC;CACrB,CAAC;AAMtD,0HAA0H;AAC1H,MAAM,UAAU,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6B;IAC9F,OAAO,CACL,2BACY,yBAAyB,kBACrB,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,8DAA8D,EAAE,SAAS,CAAC,KACpF,KAAK,YAET,eAAK,SAAS,EAAC,iEAAiE,aAC9E,KAAC,aAAa,yBAAa,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,wBAAwB,CAAC,OAAO,IAAI,YAAY,CAAC,GAAI,EAC1G,yBAAO,cAAc,CAAC,OAAO,CAAC,GAAQ,IAClC,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport { useId, useState, type ComponentProps, type ReactNode } from \"react\";\nimport { KeyRound, MessageSquare } from \"lucide-react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { BUTTON_SIZES, BUTTON_VARIANTS, Button } from \"./button.tsx\";\nimport { Field, FieldError, FieldLabel } from \"./field.tsx\";\nimport { Input } from \"./input.tsx\";\nimport {\n RequestCard,\n RequestCardBody,\n RequestCardDescription,\n RequestCardFooter,\n RequestCardHeader,\n RequestCardKicker,\n RequestCardTitle,\n} from \"./request-card.tsx\";\nimport { Spinner } from \"./spinner.tsx\";\n\n/** One of the app's environments: a column of values the request asks for. */\nexport interface EnvVarRequestEnvironment {\n id: string;\n /** “Development”, “Production”. */\n name: string;\n}\n\n/** The typed values: key, then environment id, then value (`{ OPENAI_API_KEY: { \"env-dev\": \"sk-…\" } }`). */\nexport type EnvVarRequestValues = Record<string, Record<string, string>>;\n\nexport type EnvVarRequestProps = Omit<ComponentProps<typeof RequestCard>, \"children\" | \"onSubmit\"> & {\n /** The keys Major asks for (`OPENAI_API_KEY`). None: the request couldn't be read, and the card offers Dismiss. */\n keys: string[];\n /** The app's environments: one input per key in each. */\n environments?: EnvVarRequestEnvironment[];\n /** A spinner stands in for the inputs while the environments load; Save waits. */\n isLoading?: boolean;\n /** The typed values, when the product holds them; pair with `onValuesChange`. */\n values?: EnvVarRequestValues;\n /** Values the inputs start with (a value Major proposed), when the card holds them itself. */\n defaultValues?: EnvVarRequestValues;\n onValuesChange?: (values: EnvVarRequestValues) => void;\n /** Saving runs: Save shows its spinner, Skip waits. */\n isSaving?: boolean;\n /** What went wrong, under the inputs (“At least one environment variable must have a value”). */\n error?: ReactNode;\n /** Save with the typed values. Checking and saving them is the product's. */\n onSave?: (values: EnvVarRequestValues) => void;\n /** Skip the request; also the Dismiss of one that couldn't be read. */\n onSkip?: () => void;\n};\n\nconst NO_ENVIRONMENTS: EnvVarRequestEnvironment[] = [];\nconst NO_VALUES: EnvVarRequestValues = {};\n\n/**\n * Major asks for an app's environment variables, in its reply: every key in mono with one input per environment,\n * then Skip and Save. Values are uncontrolled (`defaultValues`) or controlled (`values` + `onValuesChange`); the\n * product checks and saves them in `onSave` and passes back `error`. With no `keys` the card says the request\n * couldn't be read and offers Dismiss.\n */\nexport function EnvVarRequest({\n keys,\n environments = NO_ENVIRONMENTS,\n isLoading = false,\n values,\n defaultValues = NO_VALUES,\n onValuesChange,\n isSaving = false,\n error,\n onSave,\n onSkip,\n ...props\n}: EnvVarRequestProps) {\n const inputIdPrefix = useId();\n const [ownValues, setOwnValues] = useState(defaultValues);\n const currentValues = values ?? ownValues;\n\n const setValue = (key: string, environmentId: string, value: string) => {\n const nextValues = { ...currentValues, [key]: { ...currentValues[key], [environmentId]: value } };\n\n setOwnValues(nextValues);\n onValuesChange?.(nextValues);\n };\n\n if (keys.length === 0) {\n return (\n <RequestCard aria-label=\"Environment variables\" {...props}>\n <RequestCardKicker>\n <KeyRound />\n Environment variables\n </RequestCardKicker>\n <RequestCardHeader>\n <RequestCardDescription>Something went wrong loading this environment-variable request.</RequestCardDescription>\n </RequestCardHeader>\n <RequestCardFooter>\n <Button variant={BUTTON_VARIANTS.OUTLINE} size={BUTTON_SIZES.SM} onClick={onSkip}>\n Dismiss\n </Button>\n </RequestCardFooter>\n </RequestCard>\n );\n }\n\n return (\n <RequestCard aria-label=\"Environment variables\" {...props}>\n <RequestCardKicker>\n <KeyRound />\n Environment variables\n </RequestCardKicker>\n <RequestCardHeader>\n <RequestCardTitle>The agent needs you to add environment variables.</RequestCardTitle>\n </RequestCardHeader>\n {isLoading ? (\n <RequestCardBody className=\"flex justify-center pt-space-16\">\n <Spinner className=\"size-4 text-muted\" />\n </RequestCardBody>\n ) : (\n <RequestCardBody className=\"flex flex-col gap-space-14\">\n {keys.map((key) => (\n <div key={key} className=\"flex flex-col gap-space-8\">\n <p className=\"m-0 font-mono text-code-small font-medium text-ink\">{key}</p>\n {environments.map((environment) => {\n const inputId = `${inputIdPrefix}-${key}-${environment.id}`;\n\n return (\n <Field key={environment.id}>\n <FieldLabel htmlFor={inputId} className=\"text-small font-normal text-muted\">\n {environment.name}\n </FieldLabel>\n <Input\n id={inputId}\n placeholder=\"Value\"\n value={currentValues[key]?.[environment.id] ?? \"\"}\n onChange={(event) => setValue(key, environment.id, event.target.value)}\n className=\"font-mono\"\n />\n </Field>\n );\n })}\n </div>\n ))}\n <FieldError>{error}</FieldError>\n </RequestCardBody>\n )}\n <RequestCardFooter>\n <Button variant={BUTTON_VARIANTS.GHOST} size={BUTTON_SIZES.SM} className=\"me-auto\" onClick={onSkip} disabled={isSaving}>\n Skip\n </Button>\n <Button size={BUTTON_SIZES.SM} onClick={() => onSave?.(currentValues)} loading={isSaving} disabled={isLoading}>\n Save\n </Button>\n </RequestCardFooter>\n </RequestCard>\n );\n}\n\nexport const ENV_VAR_REQUEST_OUTCOMES = {\n /** The values were saved. */\n CONFIGURED: \"configured\",\n /** The request was skipped or dismissed. */\n SKIPPED: \"skipped\",\n} as const;\n\nexport type EnvVarRequestOutcomeValue = (typeof ENV_VAR_REQUEST_OUTCOMES)[keyof typeof ENV_VAR_REQUEST_OUTCOMES];\n\nconst OUTCOME_LABELS = {\n [ENV_VAR_REQUEST_OUTCOMES.CONFIGURED]: \"Environment variables configured\",\n [ENV_VAR_REQUEST_OUTCOMES.SKIPPED]: \"Environment variable setup skipped\",\n} satisfies Record<EnvVarRequestOutcomeValue, string>;\n\nexport type EnvVarRequestOutcomeProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n outcome: EnvVarRequestOutcomeValue;\n};\n\n/** The request once decided, as one 12px `muted` line where the card stood: configured, or skipped (its icon `faint`). */\nexport function EnvVarRequestOutcome({ outcome, className, ...props }: EnvVarRequestOutcomeProps) {\n return (\n <div\n data-slot=\"env-var-request-outcome\"\n data-outcome={outcome}\n className={cn(\"flex flex-col gap-0.5 py-0.5 font-sans text-small text-muted\", className)}\n {...props}\n >\n <div className=\"flex items-center gap-space-6 [&>svg]:size-3.5 [&>svg]:shrink-0\">\n <MessageSquare aria-hidden className={cn(outcome === ENV_VAR_REQUEST_OUTCOMES.SKIPPED && \"text-faint\")} />\n <span>{OUTCOME_LABELS[outcome]}</span>\n </div>\n </div>\n );\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { ComponentProps } from "react";
2
+ import { Label } from "./label.tsx";
3
+ export declare const FIELD_ORIENTATIONS: {
4
+ /** Label above, the control, then a hint or an error: inputs, textareas, selects. */
5
+ readonly VERTICAL: "vertical";
6
+ /** The control first, its label (and a description) beside it: Checkbox, Switch and RadioGroupItem rows. */
7
+ readonly HORIZONTAL: "horizontal";
8
+ };
9
+ type FieldOrientation = (typeof FIELD_ORIENTATIONS)[keyof typeof FIELD_ORIENTATIONS];
10
+ /**
11
+ * One labelled control. Vertical (default): label above, the control, then a hint or an error.
12
+ * Horizontal: a Checkbox, Switch or RadioGroupItem with its 13px label to the right.
13
+ */
14
+ declare function Field({ className, orientation, ...props }: ComponentProps<"div"> & {
15
+ orientation?: FieldOrientation;
16
+ }): import("react").JSX.Element;
17
+ /** 12px medium `ink-2` above the control; 13px `ink` beside a check. `required` adds the `danger` asterisk. */
18
+ declare function FieldLabel({ className, required, children, ...props }: ComponentProps<typeof Label> & {
19
+ required?: boolean;
20
+ }): import("react").JSX.Element;
21
+ /** In a horizontal Field: the label and its description, stacked beside the control. Dims with a disabled control. */
22
+ declare function FieldContent({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
23
+ /** A hint under the control. For a success hint pass `className="text-success"` and a `CircleCheck`. */
24
+ declare function FieldDescription({ className, ...props }: ComponentProps<"p">): import("react").JSX.Element;
25
+ /** Says what to do ("Fill in username first"). Renders nothing without children. */
26
+ declare function FieldError({ className, children, ...props }: ComponentProps<"p">): import("react").JSX.Element | null;
27
+ /** The two-column form grid: short fields pair up (Host + Port); `className="col-span-full"` on a Field spans both. */
28
+ declare function FieldGroup({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
29
+ export { Field, FieldLabel, FieldContent, FieldDescription, FieldError, FieldGroup };
30
+ //# sourceMappingURL=field.d.ts.map
@@ -0,0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Y,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CircleAlert } from "lucide-react";
4
+ import { cn } from "../lib/cn.js";
5
+ import { Label } from "./label.js";
6
+ export const FIELD_ORIENTATIONS = {
7
+ /** Label above, the control, then a hint or an error: inputs, textareas, selects. */
8
+ VERTICAL: "vertical",
9
+ /** The control first, its label (and a description) beside it: Checkbox, Switch and RadioGroupItem rows. */
10
+ HORIZONTAL: "horizontal",
11
+ };
12
+ const ORIENTATION_CLASSES = {
13
+ [FIELD_ORIENTATIONS.VERTICAL]: "flex-col gap-space-6",
14
+ // The label line is 18px: the 16px check centres on it with its own 1px top margin, the 15px switch with 2px.
15
+ [FIELD_ORIENTATIONS.HORIZONTAL]: "flex-row items-start gap-space-8 *:data-[slot=switch]:mt-0.5",
16
+ };
17
+ /**
18
+ * One labelled control. Vertical (default): label above, the control, then a hint or an error.
19
+ * Horizontal: a Checkbox, Switch or RadioGroupItem with its 13px label to the right.
20
+ */
21
+ function Field({ className, orientation = FIELD_ORIENTATIONS.VERTICAL, ...props }) {
22
+ return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn("group/field flex min-w-0", ORIENTATION_CLASSES[orientation], className), ...props }));
23
+ }
24
+ /** 12px medium `ink-2` above the control; 13px `ink` beside a check. `required` adds the `danger` asterisk. */
25
+ function FieldLabel({ className, required, children, ...props }) {
26
+ return (_jsxs(Label, { "data-slot": "field-label", className: cn("group-data-[orientation=horizontal]/field:text-ui group-data-[orientation=horizontal]/field:leading-4.5 group-data-[orientation=horizontal]/field:font-normal group-data-[orientation=horizontal]/field:text-ink", className), ...props, children: [children, required && (_jsx("span", { className: "text-danger", "aria-hidden": true, children: "*" }))] }));
27
+ }
28
+ /** In a horizontal Field: the label and its description, stacked beside the control. Dims with a disabled control. */
29
+ function FieldContent({ className, ...props }) {
30
+ return (_jsx("div", { "data-slot": "field-content", className: cn("flex min-w-0 flex-1 flex-col gap-space-2 peer-disabled:opacity-50 peer-data-disabled:opacity-50", className), ...props }));
31
+ }
32
+ /** A hint under the control. For a success hint pass `className="text-success"` and a `CircleCheck`. */
33
+ function FieldDescription({ className, ...props }) {
34
+ return (_jsx("p", { "data-slot": "field-description", className: cn("m-0 flex items-center gap-space-6 text-small text-muted [&_svg]:size-3.5 [&_svg]:shrink-0", className), ...props }));
35
+ }
36
+ /** Says what to do ("Fill in username first"). Renders nothing without children. */
37
+ function FieldError({ className, children, ...props }) {
38
+ if (!children) {
39
+ return null;
40
+ }
41
+ return (_jsxs("p", { role: "alert", "data-slot": "field-error", className: cn("m-0 flex items-center gap-space-6 text-small text-danger [&_svg]:size-3.5", className), ...props, children: [_jsx(CircleAlert, { "aria-hidden": true }), children] }));
42
+ }
43
+ /** The two-column form grid: short fields pair up (Host + Port); `className="col-span-full"` on a Field spans both. */
44
+ function FieldGroup({ className, ...props }) {
45
+ return (_jsx("div", { "data-slot": "field-group", className: cn("grid w-full grid-cols-2 gap-x-space-16 gap-y-space-14", className), ...props }));
46
+ }
47
+ export { Field, FieldLabel, FieldContent, FieldDescription, FieldError, FieldGroup };
48
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,qFAAqF;IACrF,QAAQ,EAAE,UAAU;IACpB,4GAA4G;IAC5G,UAAU,EAAE,YAAY;CAChB,CAAC;AAIX,MAAM,mBAAmB,GAAG;IAC1B,CAAC,kBAAkB,CAAC,QAAQ,CAA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AE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,aACE,IAAI,EAAC,OAAO,eACF,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,2EAA2E,EAAE,SAAS,CAAC,KACjG,KAAK,aAET,KAAC,WAAW,0BAAe,EAC1B,QAAQ,IACP,CACL,CAAC;AACJ,CAAC;AAED,uHAAuH;AACvH,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChE,OAAO,CACL,2BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,uDAAuD,EAAE,SAAS,CAAC,KAC7E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC","sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { CircleAlert } from \"lucide-react\";\nimport { cn } from \"../lib/cn.ts\";\nimport { Label } from \"./label.tsx\";\n\nexport const FIELD_ORIENTATIONS = {\n /** Label above, the control, then a hint or an error: inputs, textareas, selects. */\n VERTICAL: \"vertical\",\n /** The control first, its label (and a description) beside it: Checkbox, Switch and RadioGroupItem rows. */\n HORIZONTAL: \"horizontal\",\n} as const;\n\ntype FieldOrientation = (typeof FIELD_ORIENTATIONS)[keyof typeof FIELD_ORIENTATIONS];\n\nconst ORIENTATION_CLASSES = {\n [FIELD_ORIENTATIONS.VERTICAL]: \"flex-col gap-space-6\",\n // The label line is 18px: the 16px check centres on it with its own 1px top margin, the 15px switch with 2px.\n [FIELD_ORIENTATIONS.HORIZONTAL]: \"flex-row items-start gap-space-8 *:data-[slot=switch]:mt-0.5\",\n} satisfies Record<FieldOrientation, string>;\n\n/**\n * One labelled control. Vertical (default): label above, the control, then a hint or an error.\n * Horizontal: a Checkbox, Switch or RadioGroupItem with its 13px label to the right.\n */\nfunction Field({\n className,\n orientation = FIELD_ORIENTATIONS.VERTICAL,\n ...props\n}: ComponentProps<\"div\"> & { orientation?: FieldOrientation }) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(\"group/field flex min-w-0\", ORIENTATION_CLASSES[orientation], className)}\n {...props}\n />\n );\n}\n\n/** 12px medium `ink-2` above the control; 13px `ink` beside a check. `required` adds the `danger` asterisk. */\nfunction FieldLabel({ className, required, children, ...props }: ComponentProps<typeof Label> & { required?: boolean }) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group-data-[orientation=horizontal]/field:text-ui group-data-[orientation=horizontal]/field:leading-4.5 group-data-[orientation=horizontal]/field:font-normal group-data-[orientation=horizontal]/field:text-ink\",\n className\n )}\n {...props}\n >\n {children}\n {required && (\n <span className=\"text-danger\" aria-hidden>\n *\n </span>\n )}\n </Label>\n );\n}\n\n/** In a horizontal Field: the label and its description, stacked beside the control. Dims with a disabled control. */\nfunction FieldContent({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"flex min-w-0 flex-1 flex-col gap-space-2 peer-disabled:opacity-50 peer-data-disabled:opacity-50\", className)}\n {...props}\n />\n );\n}\n\n/** A hint under the control. For a success hint pass `className=\"text-success\"` and a `CircleCheck`. */\nfunction FieldDescription({ className, ...props }: ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\"m-0 flex items-center gap-space-6 text-small text-muted [&_svg]:size-3.5 [&_svg]:shrink-0\", className)}\n {...props}\n />\n );\n}\n\n/** Says what to do (\"Fill in username first\"). Renders nothing without children. */\nfunction FieldError({ className, children, ...props }: ComponentProps<\"p\">) {\n if (!children) {\n return null;\n }\n\n return (\n <p\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"m-0 flex items-center gap-space-6 text-small text-danger [&_svg]:size-3.5\", className)}\n {...props}\n >\n <CircleAlert aria-hidden />\n {children}\n </p>\n );\n}\n\n/** The two-column form grid: short fields pair up (Host + Port); `className=\"col-span-full\"` on a Field spans both. */\nfunction FieldGroup({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\"grid w-full grid-cols-2 gap-x-space-16 gap-y-space-14\", className)}\n {...props}\n />\n );\n}\n\nexport { Field, FieldLabel, FieldContent, FieldDescription, FieldError, FieldGroup };\n"]}
@@ -0,0 +1,108 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ export declare const FILE_UPLOAD_VARIANTS: {
3
+ /** An outline Button with the upload icon, the accepted types beside it: a row in settings. */
4
+ readonly BUTTON: "button";
5
+ /** A dashed drop zone: larger areas. */
6
+ readonly DROPZONE: "dropzone";
7
+ };
8
+ export declare const FILE_UPLOAD_PREVIEWS: {
9
+ /** A logo in a 34px box. */
10
+ readonly IMAGE: "image";
11
+ /** A favicon in a browser-tab mock. */
12
+ readonly FAVICON: "favicon";
13
+ /** The file's name. */
14
+ readonly FILE: "file";
15
+ };
16
+ type FileUploadVariant = (typeof FILE_UPLOAD_VARIANTS)[keyof typeof FILE_UPLOAD_VARIANTS];
17
+ type FileUploadPreview = (typeof FILE_UPLOAD_PREVIEWS)[keyof typeof FILE_UPLOAD_PREVIEWS];
18
+ type FileUploadProps = {
19
+ /** The empty state: an outline `button` (default), or a dashed `dropzone` for larger areas. */
20
+ variant?: FileUploadVariant;
21
+ /** After upload: an `image` preview (logo box, default), a `favicon` in a browser-tab mock, or the `file` name. */
22
+ preview?: FileUploadPreview;
23
+ /** Button label ("Upload logo"). The dropzone always reads "Drop a file or browse". */
24
+ label?: string;
25
+ /** Accepted types and sizes, in words: "PNG or SVG, up to 2 MB". */
26
+ hint?: ReactNode;
27
+ /** Native accept string: "image/png,image/svg+xml". */
28
+ accept?: string;
29
+ /** Maximum size in bytes; a larger file shows an error instead of being picked. */
30
+ maxSize?: number;
31
+ /** Controlled value: a File, an existing URL, or null. */
32
+ value?: File | string | null;
33
+ defaultValue?: File | string | null;
34
+ /** Called with the picked file, or null on Remove. Confirm with a toast ("Logo removed"). */
35
+ onValueChange?: (file: File | null) => void;
36
+ /** Page name in the favicon tab mock. */
37
+ tabTitle?: string;
38
+ disabled?: boolean;
39
+ className?: string;
40
+ /** Id of the hidden file input, for a FieldLabel's `htmlFor`. */
41
+ id?: string;
42
+ };
43
+ /** 512 → "512 B", 840_000 → "820 KB", 1_887_437 → "1.8 MB". Whole numbers up to KB, one decimal from MB. */
44
+ export declare function formatFileSize(bytes: number): string;
45
+ /** Whether a file fits a native accept string ("image/*,.pdf"); no accept takes anything. */
46
+ export declare function matchesAccept(file: File, accept?: string): boolean;
47
+ export declare const FILE_REJECTIONS: {
48
+ /** Larger than maxSize. */
49
+ readonly TOO_LARGE: "too-large";
50
+ /** Not in accept. */
51
+ readonly TYPE: "type";
52
+ /** Past maxFiles. */
53
+ readonly TOO_MANY: "too-many";
54
+ };
55
+ export type FileRejectionCode = (typeof FILE_REJECTIONS)[keyof typeof FILE_REJECTIONS];
56
+ export interface FileRejection {
57
+ file: File;
58
+ code: FileRejectionCode;
59
+ /** A few words for the tile or a toast: "Larger than 100 MB". */
60
+ message: string;
61
+ }
62
+ export interface FileLimits {
63
+ /** Native accept string: "image/*,.pdf". */
64
+ accept?: string;
65
+ /** Maximum size of one file, in bytes. */
66
+ maxSize?: number;
67
+ /** Maximum number of files, counting the ones already attached. */
68
+ maxFiles?: number;
69
+ /** How many are attached already. Default: 0. */
70
+ attachedCount?: number;
71
+ }
72
+ /**
73
+ * Sorts picked, dropped or pasted files into the ones to upload and the ones to refuse, with a reason each. Show a
74
+ * refused file as a failed tile (too large, wrong type) so the person sees why; say "Up to 30 files" in a toast.
75
+ */
76
+ export declare function validateFiles(files: File[], { accept, maxSize, maxFiles, attachedCount }?: FileLimits): {
77
+ accepted: File[];
78
+ rejected: FileRejection[];
79
+ };
80
+ /**
81
+ * Whether a FileDropArea took this drag event: the innermost one under the pointer does. A drop zone of the product's
82
+ * own around one (a chat panel's) checks it and lets the drop go. FileDropArea claims in its React handlers, so check
83
+ * from a React handler on an outer element, or a native listener on `document` or `window`: a native listener inside
84
+ * the React root runs before the claim.
85
+ */
86
+ export declare function checkIfFileDragClaimed(event: Event): boolean;
87
+ export interface FileDropAreaProps extends Omit<ComponentProps<"div">, "onDrop"> {
88
+ /** Called with the dropped files. Check them with validateFiles, then upload. */
89
+ onFiles: (files: File[]) => void;
90
+ /** Default: "Drop files to attach". */
91
+ label?: ReactNode;
92
+ /** A second line: where they go ("to “Who will look at it?”") or the limits ("Up to 30 files, 100 MB each"). */
93
+ hint?: ReactNode;
94
+ disabled?: boolean;
95
+ }
96
+ /**
97
+ * Takes files dropped anywhere on its children: while files are over it, a dashed field covers the area and says
98
+ * where they go. The same field in the chat panel, the composer and AskUserQuestion. Nested areas work: the innermost
99
+ * one under the pointer takes the drop.
100
+ */
101
+ export declare function FileDropArea({ onFiles, label, hint, disabled, className, children, ...props }: FileDropAreaProps): import("react").JSX.Element;
102
+ /**
103
+ * Adding one image or file: logo, favicon, a brief. Starts as a button or a drop zone; after upload
104
+ * shows a preview followed by Replace (outline) and Remove (ghost).
105
+ */
106
+ declare function FileUpload({ variant, preview, label, hint, accept, maxSize, value: valueProp, defaultValue, onValueChange, tabTitle, disabled, className, id, }: FileUploadProps): import("react").JSX.Element;
107
+ export { FileUpload };
108
+ //# sourceMappingURL=file-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/components/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,eAAO,MAAM,oBAAoB;IAC/B,+FAA+F;;IAE/F,wCAAwC;;CAEhC,CAAC;AAEX,eAAO,MAAM,oBAAoB;IAC/B,4BAA4B;;IAE5B,uCAAuC;;IAEvC,uBAAuB;;CAEf,CAAC;AAEX,KAAK,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,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