@adea-ai/ui 0.154.0 → 0.154.2

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 (554) hide show
  1. package/README.md +10 -10
  2. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js +3 -1
  4. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  5. package/dist/components/composites/accent-picker/accent-picker.js +20 -9
  6. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  8. package/dist/components/composites/account-menu/account-menu.js +20 -10
  9. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  10. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  11. package/dist/components/composites/action-button/action-button.js +37 -24
  12. package/dist/components/composites/action-button/action-button.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/appearance-choices.js +7 -3
  15. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-editor.js +11 -6
  18. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-rows.js +8 -3
  21. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  23. package/dist/components/composites/appearance-editor/font-settings-group.js +8 -4
  24. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -1
  26. package/dist/components/composites/catalog-browser/catalog-browser-group.js +7 -3
  27. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  29. package/dist/components/composites/catalog-browser/catalog-browser.js +8 -4
  30. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  31. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
  32. package/dist/components/composites/chain-of-thought/chain-of-thought.js +3 -1
  33. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  34. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  35. package/dist/components/composites/chat/chat.js +5 -1
  36. package/dist/components/composites/chat/chat.js.map +1 -1
  37. package/dist/components/composites/checkpoint/checkpoint.d.ts.map +1 -1
  38. package/dist/components/composites/checkpoint/checkpoint.js +3 -1
  39. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  40. package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
  41. package/dist/components/composites/confirmation/confirmation.js +11 -5
  42. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  43. package/dist/components/composites/context/context.d.ts.map +1 -1
  44. package/dist/components/composites/context/context.js +7 -4
  45. package/dist/components/composites/context/context.js.map +1 -1
  46. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  47. package/dist/components/composites/file-tree/file-tree.js +7 -3
  48. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  49. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  50. package/dist/components/composites/help-center/help-center.js +3 -1
  51. package/dist/components/composites/help-center/help-center.js.map +1 -1
  52. package/dist/components/composites/icon-picker/icon-picker.d.ts +2 -2
  53. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
  54. package/dist/components/composites/icon-picker/icon-picker.js +77 -71
  55. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  56. package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -1
  57. package/dist/components/composites/icon-picker/shell-icons.js +119 -59
  58. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  59. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  60. package/dist/components/composites/inline-citation/inline-citation.js +5 -2
  61. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  62. package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
  63. package/dist/components/composites/list-row/list-row-control.js +3 -4
  64. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  65. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
  66. package/dist/components/composites/message-scroller/message-scroller.js +5 -2
  67. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  68. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
  69. package/dist/components/composites/model-selector/model-selector.js +9 -5
  70. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  71. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  72. package/dist/components/composites/plan/plan.js +3 -1
  73. package/dist/components/composites/plan/plan.js.map +1 -1
  74. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  75. package/dist/components/composites/queue/queue.js +11 -5
  76. package/dist/components/composites/queue/queue.js.map +1 -1
  77. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
  78. package/dist/components/composites/reasoning/reasoning.js +3 -1
  79. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  80. package/dist/components/composites/scene-controls/scene-controls.d.ts.map +1 -1
  81. package/dist/components/composites/scene-controls/scene-controls.js +14 -7
  82. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  83. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  84. package/dist/components/composites/settings/settings.js +77 -67
  85. package/dist/components/composites/settings/settings.js.map +1 -1
  86. package/dist/components/composites/sources/sources.d.ts.map +1 -1
  87. package/dist/components/composites/sources/sources.js +39 -39
  88. package/dist/components/composites/sources/sources.js.map +1 -1
  89. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
  90. package/dist/components/composites/stack-trace/stack-trace.js +9 -4
  91. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  92. package/dist/components/composites/stat/stat.d.ts.map +1 -1
  93. package/dist/components/composites/stat/stat.js +4 -1
  94. package/dist/components/composites/stat/stat.js.map +1 -1
  95. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  96. package/dist/components/composites/subagent/subagent.js +3 -1
  97. package/dist/components/composites/subagent/subagent.js.map +1 -1
  98. package/dist/components/composites/task/task.d.ts.map +1 -1
  99. package/dist/components/composites/task/task.js +3 -1
  100. package/dist/components/composites/task/task.js.map +1 -1
  101. package/dist/components/composites/terminal/ansi.d.ts.map +1 -1
  102. package/dist/components/composites/terminal/ansi.js +16 -0
  103. package/dist/components/composites/terminal/ansi.js.map +1 -1
  104. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  105. package/dist/components/composites/terminal/terminal.js +15 -7
  106. package/dist/components/composites/terminal/terminal.js.map +1 -1
  107. package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
  108. package/dist/components/composites/test-results/test-results.js +15 -7
  109. package/dist/components/composites/test-results/test-results.js.map +1 -1
  110. package/dist/components/composites/tool/tool.d.ts.map +1 -1
  111. package/dist/components/composites/tool/tool.js +3 -1
  112. package/dist/components/composites/tool/tool.js.map +1 -1
  113. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  114. package/dist/components/composites/tree/tree.js +3 -1
  115. package/dist/components/composites/tree/tree.js.map +1 -1
  116. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  117. package/dist/components/composites/update-dialog/update-dialog.js +34 -24
  118. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  119. package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
  120. package/dist/components/composites/workspace-mark/workspace-mark.js +17 -12
  121. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  122. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
  123. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +5 -2
  124. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  125. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
  126. package/dist/components/composites/workspace-switcher/workspace-switcher.js +9 -4
  127. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  128. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  129. package/dist/components/conversation/busy-send-button.js +9 -5
  130. package/dist/components/conversation/busy-send-button.js.map +1 -1
  131. package/dist/components/conversation/conversation-avatar.d.ts.map +1 -1
  132. package/dist/components/conversation/conversation-avatar.js +6 -3
  133. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  134. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  135. package/dist/components/conversation/conversation-surface.js +3 -1
  136. package/dist/components/conversation/conversation-surface.js.map +1 -1
  137. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  138. package/dist/components/conversation/internal/chat-composer-shell.js +9 -4
  139. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  140. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  141. package/dist/components/conversation/message-composer.js +9 -4
  142. package/dist/components/conversation/message-composer.js.map +1 -1
  143. package/dist/components/conversation/message-row.d.ts.map +1 -1
  144. package/dist/components/conversation/message-row.js +11 -5
  145. package/dist/components/conversation/message-row.js.map +1 -1
  146. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  147. package/dist/components/conversation/thread-panel.js +3 -1
  148. package/dist/components/conversation/thread-panel.js.map +1 -1
  149. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  150. package/dist/components/conversation/transcript-composition.js +3 -1
  151. package/dist/components/conversation/transcript-composition.js.map +1 -1
  152. package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -1
  153. package/dist/components/layout/floating-preview/floating-preview.js +5 -2
  154. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  156. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
  157. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  158. package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -1
  159. package/dist/components/layout/shell-rail/shell-rail.js +3 -1
  160. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  161. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav.js +3 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  164. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  165. package/dist/components/layout/split-layout/split-layout.js +5 -2
  166. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  167. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  168. package/dist/components/layout/top-bar/top-bar.js +3 -1
  169. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  170. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  171. package/dist/components/theme/appearance-panel.js +3 -1
  172. package/dist/components/theme/appearance-panel.js.map +1 -1
  173. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
  174. package/dist/components/theme/theme-mode-toggle.js +6 -3
  175. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  176. package/dist/components/theme/theme-toggle.d.ts.map +1 -1
  177. package/dist/components/theme/theme-toggle.js +6 -3
  178. package/dist/components/theme/theme-toggle.js.map +1 -1
  179. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  180. package/dist/components/ui/accordion/accordion.js +3 -1
  181. package/dist/components/ui/accordion/accordion.js.map +1 -1
  182. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  183. package/dist/components/ui/alert/alert.js +15 -9
  184. package/dist/components/ui/alert/alert.js.map +1 -1
  185. package/dist/components/ui/annotation-surface/annotation-surface.d.ts.map +1 -1
  186. package/dist/components/ui/annotation-surface/annotation-surface.js +5 -4
  187. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  188. package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
  189. package/dist/components/ui/attachment/attachment.js +18 -9
  190. package/dist/components/ui/attachment/attachment.js.map +1 -1
  191. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  192. package/dist/components/ui/badge/badge.js +30 -11
  193. package/dist/components/ui/badge/badge.js.map +1 -1
  194. package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
  195. package/dist/components/ui/breadcrumb/breadcrumb.js +5 -2
  196. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  197. package/dist/components/ui/button/button.d.ts.map +1 -1
  198. package/dist/components/ui/button/button.js +37 -13
  199. package/dist/components/ui/button/button.js.map +1 -1
  200. package/dist/components/ui/calendar/calendar.d.ts.map +1 -1
  201. package/dist/components/ui/calendar/calendar.js +5 -2
  202. package/dist/components/ui/calendar/calendar.js.map +1 -1
  203. package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
  204. package/dist/components/ui/carousel/carousel.js +12 -6
  205. package/dist/components/ui/carousel/carousel.js.map +1 -1
  206. package/dist/components/ui/checkbox/checkbox.d.ts +13 -0
  207. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  208. package/dist/components/ui/checkbox/checkbox.js +296 -21
  209. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  210. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  211. package/dist/components/ui/code-block/code-block.js +9 -6
  212. package/dist/components/ui/code-block/code-block.js.map +1 -1
  213. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  214. package/dist/components/ui/combobox/combobox.js +8 -11
  215. package/dist/components/ui/combobox/combobox.js.map +1 -1
  216. package/dist/components/ui/command/command.d.ts.map +1 -1
  217. package/dist/components/ui/command/command.js +4 -2
  218. package/dist/components/ui/command/command.js.map +1 -1
  219. package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
  220. package/dist/components/ui/detail-panel/detail-panel.js +3 -1
  221. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  222. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  223. package/dist/components/ui/dialog/dialog.js +3 -1
  224. package/dist/components/ui/dialog/dialog.js.map +1 -1
  225. package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -1
  226. package/dist/components/ui/dropdown-menu/menu-parts.js +7 -3
  227. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  228. package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
  229. package/dist/components/ui/empty/empty-state.js +3 -1
  230. package/dist/components/ui/empty/empty-state.js.map +1 -1
  231. package/dist/components/ui/field/field.d.ts.map +1 -1
  232. package/dist/components/ui/field/field.js +12 -6
  233. package/dist/components/ui/field/field.js.map +1 -1
  234. package/dist/components/ui/input/input-control.d.ts +2 -0
  235. package/dist/components/ui/input/input-control.d.ts.map +1 -1
  236. package/dist/components/ui/input/input-control.js +24 -6
  237. package/dist/components/ui/input/input-control.js.map +1 -1
  238. package/dist/components/ui/input/input.d.ts.map +1 -1
  239. package/dist/components/ui/input/input.js +47 -48
  240. package/dist/components/ui/input/input.js.map +1 -1
  241. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  242. package/dist/components/ui/input-group/input-group.js +1 -8
  243. package/dist/components/ui/input-group/input-group.js.map +1 -1
  244. package/dist/components/ui/message/index.d.ts +1 -1
  245. package/dist/components/ui/message/index.d.ts.map +1 -1
  246. package/dist/components/ui/message/index.js +2 -2
  247. package/dist/components/ui/message/message.d.ts.map +1 -1
  248. package/dist/components/ui/message/message.js +5 -3
  249. package/dist/components/ui/message/message.js.map +1 -1
  250. package/dist/components/ui/message/parse-message-text.d.ts +32 -0
  251. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
  252. package/dist/components/ui/message/parse-message-text.js +63 -3
  253. package/dist/components/ui/message/parse-message-text.js.map +1 -1
  254. package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
  255. package/dist/components/ui/native-select/native-select.js +4 -9
  256. package/dist/components/ui/native-select/native-select.js.map +1 -1
  257. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  258. package/dist/components/ui/navigation-menu/navigation-menu.js +3 -1
  259. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  260. package/dist/components/ui/pagination/pagination.d.ts.map +1 -1
  261. package/dist/components/ui/pagination/pagination.js +7 -3
  262. package/dist/components/ui/pagination/pagination.js.map +1 -1
  263. package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
  264. package/dist/components/ui/questionnaire/questionnaire.js +9 -4
  265. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  266. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  267. package/dist/components/ui/radio-group/radio-group.js +4 -9
  268. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  269. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  270. package/dist/components/ui/resizable/resizable.js +3 -1
  271. package/dist/components/ui/resizable/resizable.js.map +1 -1
  272. package/dist/components/ui/select/select.d.ts.map +1 -1
  273. package/dist/components/ui/select/select.js +7 -3
  274. package/dist/components/ui/select/select.js.map +1 -1
  275. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  276. package/dist/components/ui/sheet/sheet.js +3 -1
  277. package/dist/components/ui/sheet/sheet.js.map +1 -1
  278. package/dist/components/ui/spinner/spinner.d.ts.map +1 -1
  279. package/dist/components/ui/spinner/spinner.js +3 -1
  280. package/dist/components/ui/spinner/spinner.js.map +1 -1
  281. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  282. package/dist/components/ui/status-chip/status-chip.js +35 -30
  283. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  284. package/dist/components/ui/switch/switch.d.ts +7 -0
  285. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  286. package/dist/components/ui/switch/switch.js +255 -17
  287. package/dist/components/ui/switch/switch.js.map +1 -1
  288. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  289. package/dist/components/ui/textarea/textarea.js +1 -8
  290. package/dist/components/ui/textarea/textarea.js.map +1 -1
  291. package/dist/components/ui/toast/toast.d.ts.map +1 -1
  292. package/dist/components/ui/toast/toast.js +3 -1
  293. package/dist/components/ui/toast/toast.js.map +1 -1
  294. package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -1
  295. package/dist/components/ui/tooltip/deferred-tooltip.js +10 -4
  296. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  297. package/dist/components/ui/tooltip/index.d.ts +1 -0
  298. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  299. package/dist/components/ui/tooltip/index.js +2 -1
  300. package/dist/components/ui/tooltip/lazy-tooltip.d.ts +40 -0
  301. package/dist/components/ui/tooltip/lazy-tooltip.d.ts.map +1 -0
  302. package/dist/components/ui/tooltip/lazy-tooltip.js +61 -0
  303. package/dist/components/ui/tooltip/lazy-tooltip.js.map +1 -0
  304. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  305. package/dist/components/ui/trace/trace.js +82 -68
  306. package/dist/components/ui/trace/trace.js.map +1 -1
  307. package/dist/components/ui/typography/typography.d.ts +1 -1
  308. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  309. package/dist/components/ui/typography/typography.js +5 -6
  310. package/dist/components/ui/typography/typography.js.map +1 -1
  311. package/dist/index.js +3 -2
  312. package/dist/lib/clipboard.d.ts.map +1 -1
  313. package/dist/lib/clipboard.js +3 -0
  314. package/dist/lib/clipboard.js.map +1 -1
  315. package/dist/lib/fast-icon.d.ts +18 -0
  316. package/dist/lib/fast-icon.d.ts.map +1 -0
  317. package/dist/lib/fast-icon.js +75 -0
  318. package/dist/lib/fast-icon.js.map +1 -0
  319. package/dist/lib/form-field.d.ts +1 -1
  320. package/dist/lib/form-field.js +3 -1
  321. package/dist/lib/form-field.js.map +1 -1
  322. package/dist/lib/observe-resize.d.ts +14 -0
  323. package/dist/lib/observe-resize.d.ts.map +1 -0
  324. package/dist/lib/observe-resize.js +19 -0
  325. package/dist/lib/observe-resize.js.map +1 -0
  326. package/dist/lint/index.d.ts +1 -0
  327. package/dist/lint/index.d.ts.map +1 -1
  328. package/dist/lint.js +251 -118
  329. package/dist/lint.js.map +1 -1
  330. package/dist/r/action-button.json +3 -1
  331. package/dist/r/floating-preview.json +2 -1
  332. package/dist/r/icon-picker.json +0 -1
  333. package/dist/r/lib.json +10 -0
  334. package/dist/r/plan.json +2 -1
  335. package/dist/r/queue.json +2 -1
  336. package/dist/r/registry.json +30 -9
  337. package/dist/r/scene-controls.json +2 -1
  338. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  339. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  340. package/dist/r/src/components/composites/account-menu/account-menu.tsx +21 -9
  341. package/dist/r/src/components/composites/action-button/action-button.tsx +38 -21
  342. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  343. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  344. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  345. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  346. package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  347. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  348. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  349. package/dist/r/src/components/composites/chat/chat.tsx +11 -1
  350. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  351. package/dist/r/src/components/composites/confirmation/confirmation.tsx +15 -1
  352. package/dist/r/src/components/composites/context/context.tsx +9 -1
  353. package/dist/r/src/components/composites/file-tree/file-tree.tsx +11 -1
  354. package/dist/r/src/components/composites/help-center/help-center.tsx +5 -1
  355. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  356. package/dist/r/src/components/composites/icon-picker/shell-icons.ts +121 -59
  357. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  358. package/dist/r/src/components/composites/list-row/list-row-control.tsx +7 -5
  359. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  360. package/dist/r/src/components/composites/model-selector/model-selector.tsx +11 -1
  361. package/dist/r/src/components/composites/plan/plan.tsx +5 -1
  362. package/dist/r/src/components/composites/queue/queue.tsx +15 -1
  363. package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -1
  364. package/dist/r/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  365. package/dist/r/src/components/composites/settings/settings.tsx +23 -14
  366. package/dist/r/src/components/composites/sources/sources.tsx +27 -20
  367. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  368. package/dist/r/src/components/composites/stat/stat.tsx +9 -1
  369. package/dist/r/src/components/composites/subagent/subagent.tsx +5 -1
  370. package/dist/r/src/components/composites/task/task.tsx +5 -1
  371. package/dist/r/src/components/composites/terminal/ansi.ts +18 -0
  372. package/dist/r/src/components/composites/terminal/terminal.tsx +17 -7
  373. package/dist/r/src/components/composites/test-results/test-results.tsx +17 -7
  374. package/dist/r/src/components/composites/tool/tool.tsx +5 -1
  375. package/dist/r/src/components/composites/tree/tree.tsx +5 -1
  376. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  377. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  378. package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  379. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  380. package/dist/r/src/components/conversation/busy-send-button.tsx +11 -1
  381. package/dist/r/src/components/conversation/conversation-avatar.tsx +7 -1
  382. package/dist/r/src/components/conversation/conversation-surface.tsx +5 -1
  383. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  384. package/dist/r/src/components/conversation/message-composer.tsx +13 -1
  385. package/dist/r/src/components/conversation/message-row.tsx +15 -1
  386. package/dist/r/src/components/conversation/thread-panel.tsx +5 -1
  387. package/dist/r/src/components/conversation/transcript-composition.tsx +5 -1
  388. package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  389. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  390. package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  391. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  392. package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -1
  393. package/dist/r/src/components/layout/top-bar/top-bar.tsx +5 -1
  394. package/dist/r/src/components/theme/appearance-panel.tsx +6 -1
  395. package/dist/r/src/components/theme/theme-mode-toggle.tsx +7 -1
  396. package/dist/r/src/components/theme/theme-toggle.tsx +7 -1
  397. package/dist/r/src/components/ui/accordion/accordion.tsx +5 -1
  398. package/dist/r/src/components/ui/alert/alert.tsx +20 -3
  399. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  400. package/dist/r/src/components/ui/attachment/attachment.tsx +19 -8
  401. package/dist/r/src/components/ui/badge/badge.tsx +24 -8
  402. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  403. package/dist/r/src/components/ui/button/button.tsx +47 -16
  404. package/dist/r/src/components/ui/calendar/calendar.tsx +6 -1
  405. package/dist/r/src/components/ui/carousel/carousel.tsx +15 -5
  406. package/dist/r/src/components/ui/checkbox/checkbox.tsx +260 -22
  407. package/dist/r/src/components/ui/code-block/code-block.tsx +11 -5
  408. package/dist/r/src/components/ui/combobox/combobox.tsx +8 -9
  409. package/dist/r/src/components/ui/command/command.tsx +8 -4
  410. package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  411. package/dist/r/src/components/ui/dialog/dialog.tsx +5 -1
  412. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  413. package/dist/r/src/components/ui/empty/empty-state.tsx +5 -1
  414. package/dist/r/src/components/ui/field/field.tsx +14 -5
  415. package/dist/r/src/components/ui/input/input-control.tsx +28 -19
  416. package/dist/r/src/components/ui/input/input.tsx +9 -12
  417. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -8
  418. package/dist/r/src/components/ui/message/index.ts +3 -0
  419. package/dist/r/src/components/ui/message/message.tsx +11 -2
  420. package/dist/r/src/components/ui/message/parse-message-text.ts +94 -2
  421. package/dist/r/src/components/ui/native-select/native-select.tsx +6 -9
  422. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  423. package/dist/r/src/components/ui/pagination/pagination.tsx +11 -1
  424. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  425. package/dist/r/src/components/ui/radio-group/radio-group.tsx +6 -9
  426. package/dist/r/src/components/ui/resizable/resizable.tsx +5 -1
  427. package/dist/r/src/components/ui/select/select.tsx +11 -1
  428. package/dist/r/src/components/ui/sheet/sheet.tsx +5 -1
  429. package/dist/r/src/components/ui/spinner/spinner.tsx +5 -1
  430. package/dist/r/src/components/ui/status-chip/status-chip.tsx +14 -7
  431. package/dist/r/src/components/ui/switch/switch.tsx +235 -28
  432. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -8
  433. package/dist/r/src/components/ui/toast/toast.tsx +5 -1
  434. package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  435. package/dist/r/src/components/ui/tooltip/index.ts +1 -0
  436. package/dist/r/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  437. package/dist/r/src/components/ui/trace/trace.tsx +61 -28
  438. package/dist/r/src/components/ui/typography/typography.tsx +6 -5
  439. package/dist/r/src/lib/clipboard.ts +4 -0
  440. package/dist/r/src/lib/fast-icon.ts +88 -0
  441. package/dist/r/src/lib/form-field.ts +7 -7
  442. package/dist/r/src/lib/observe-resize.ts +28 -0
  443. package/dist/r/subagent.json +2 -1
  444. package/dist/r/tool.json +2 -1
  445. package/dist/r/tooltip.json +5 -0
  446. package/dist/r/trace.json +0 -1
  447. package/package.json +1 -1
  448. package/registry.json +30 -9
  449. package/src/components/composites/about-dialog/about-dialog.tsx +5 -1
  450. package/src/components/composites/accent-picker/accent-picker.tsx +22 -17
  451. package/src/components/composites/account-menu/account-menu.tsx +21 -9
  452. package/src/components/composites/action-button/action-button.tsx +38 -21
  453. package/src/components/composites/appearance-editor/appearance-choices.tsx +7 -1
  454. package/src/components/composites/appearance-editor/appearance-editor.tsx +13 -1
  455. package/src/components/composites/appearance-editor/appearance-rows.tsx +13 -1
  456. package/src/components/composites/appearance-editor/font-settings-group.tsx +13 -1
  457. package/src/components/composites/catalog-browser/catalog-browser-group.tsx +11 -1
  458. package/src/components/composites/catalog-browser/catalog-browser.tsx +11 -1
  459. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +5 -1
  460. package/src/components/composites/chat/chat.tsx +11 -1
  461. package/src/components/composites/checkpoint/checkpoint.tsx +5 -1
  462. package/src/components/composites/confirmation/confirmation.tsx +15 -1
  463. package/src/components/composites/context/context.tsx +9 -1
  464. package/src/components/composites/file-tree/file-tree.tsx +11 -1
  465. package/src/components/composites/help-center/help-center.tsx +5 -1
  466. package/src/components/composites/icon-picker/icon-picker.tsx +59 -31
  467. package/src/components/composites/icon-picker/shell-icons.ts +121 -59
  468. package/src/components/composites/inline-citation/inline-citation.tsx +6 -1
  469. package/src/components/composites/list-row/list-row-control.tsx +7 -5
  470. package/src/components/composites/message-scroller/message-scroller.tsx +6 -1
  471. package/src/components/composites/model-selector/model-selector.tsx +11 -1
  472. package/src/components/composites/plan/plan.tsx +5 -1
  473. package/src/components/composites/queue/queue.tsx +15 -1
  474. package/src/components/composites/reasoning/reasoning.tsx +5 -1
  475. package/src/components/composites/scene-controls/scene-controls.tsx +17 -1
  476. package/src/components/composites/settings/settings.tsx +23 -14
  477. package/src/components/composites/sources/sources.tsx +27 -20
  478. package/src/components/composites/stack-trace/stack-trace.tsx +13 -1
  479. package/src/components/composites/stat/stat.tsx +9 -1
  480. package/src/components/composites/subagent/subagent.tsx +5 -1
  481. package/src/components/composites/task/task.tsx +5 -1
  482. package/src/components/composites/terminal/ansi.ts +18 -0
  483. package/src/components/composites/terminal/terminal.tsx +17 -7
  484. package/src/components/composites/test-results/test-results.tsx +17 -7
  485. package/src/components/composites/tool/tool.tsx +5 -1
  486. package/src/components/composites/tree/tree.tsx +5 -1
  487. package/src/components/composites/update-dialog/update-dialog.tsx +35 -15
  488. package/src/components/composites/workspace-mark/workspace-mark.tsx +14 -7
  489. package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +6 -1
  490. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +13 -1
  491. package/src/components/conversation/busy-send-button.tsx +11 -1
  492. package/src/components/conversation/conversation-avatar.tsx +7 -1
  493. package/src/components/conversation/conversation-surface.tsx +5 -1
  494. package/src/components/conversation/internal/chat-composer-shell.tsx +13 -1
  495. package/src/components/conversation/message-composer.tsx +13 -1
  496. package/src/components/conversation/message-row.tsx +15 -1
  497. package/src/components/conversation/thread-panel.tsx +5 -1
  498. package/src/components/conversation/transcript-composition.tsx +5 -1
  499. package/src/components/layout/floating-preview/floating-preview.tsx +6 -1
  500. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +5 -1
  501. package/src/components/layout/shell-rail/shell-rail.tsx +5 -1
  502. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +5 -1
  503. package/src/components/layout/split-layout/split-layout.tsx +6 -1
  504. package/src/components/layout/top-bar/top-bar.tsx +5 -1
  505. package/src/components/theme/appearance-panel.tsx +6 -1
  506. package/src/components/theme/theme-mode-toggle.tsx +7 -1
  507. package/src/components/theme/theme-toggle.tsx +7 -1
  508. package/src/components/ui/accordion/accordion.tsx +5 -1
  509. package/src/components/ui/alert/alert.tsx +20 -3
  510. package/src/components/ui/annotation-surface/annotation-surface.tsx +6 -3
  511. package/src/components/ui/attachment/attachment.tsx +19 -8
  512. package/src/components/ui/badge/badge.tsx +24 -8
  513. package/src/components/ui/breadcrumb/breadcrumb.tsx +9 -1
  514. package/src/components/ui/button/button.tsx +47 -16
  515. package/src/components/ui/calendar/calendar.tsx +6 -1
  516. package/src/components/ui/carousel/carousel.tsx +15 -5
  517. package/src/components/ui/checkbox/checkbox.tsx +260 -22
  518. package/src/components/ui/code-block/code-block.tsx +11 -5
  519. package/src/components/ui/combobox/combobox.tsx +8 -9
  520. package/src/components/ui/command/command.tsx +8 -4
  521. package/src/components/ui/detail-panel/detail-panel.tsx +5 -1
  522. package/src/components/ui/dialog/dialog.tsx +5 -1
  523. package/src/components/ui/dropdown-menu/menu-parts.tsx +11 -1
  524. package/src/components/ui/empty/empty-state.tsx +5 -1
  525. package/src/components/ui/field/field.tsx +14 -5
  526. package/src/components/ui/input/input-control.tsx +28 -19
  527. package/src/components/ui/input/input.tsx +9 -12
  528. package/src/components/ui/input-group/input-group.tsx +1 -8
  529. package/src/components/ui/message/index.ts +3 -0
  530. package/src/components/ui/message/message.tsx +11 -2
  531. package/src/components/ui/message/parse-message-text.ts +94 -2
  532. package/src/components/ui/native-select/native-select.tsx +6 -9
  533. package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -1
  534. package/src/components/ui/pagination/pagination.tsx +11 -1
  535. package/src/components/ui/questionnaire/questionnaire.tsx +13 -1
  536. package/src/components/ui/radio-group/radio-group.tsx +6 -9
  537. package/src/components/ui/resizable/resizable.tsx +5 -1
  538. package/src/components/ui/select/select.tsx +11 -1
  539. package/src/components/ui/sheet/sheet.tsx +5 -1
  540. package/src/components/ui/spinner/spinner.tsx +5 -1
  541. package/src/components/ui/status-chip/status-chip.tsx +14 -7
  542. package/src/components/ui/switch/switch.tsx +235 -28
  543. package/src/components/ui/textarea/textarea.tsx +1 -8
  544. package/src/components/ui/toast/toast.tsx +5 -1
  545. package/src/components/ui/tooltip/deferred-tooltip.tsx +14 -8
  546. package/src/components/ui/tooltip/index.ts +1 -0
  547. package/src/components/ui/tooltip/lazy-tooltip.tsx +73 -0
  548. package/src/components/ui/trace/trace.tsx +61 -28
  549. package/src/components/ui/typography/typography.tsx +6 -5
  550. package/src/lib/clipboard.ts +4 -0
  551. package/src/lib/fast-icon.ts +88 -0
  552. package/src/lib/form-field.ts +7 -7
  553. package/src/lib/observe-resize.ts +28 -0
  554. package/src/lint/index.ts +199 -0
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-reorder-dialog.js","names":["ArrowDown","ArrowUp","For","Show","createEffect","createSignal","on","onCleanup","Button","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","ActionButton","moveTarget","moveWorkspace","id","name","fixed","open","onOpenChange","workspaces","onReorder","title","restoreFocusRef","WorkspaceReorderDialog","props","status","setStatus","error","setError","pending","setPending","list","session","disposed","frame","undefined","cancelAnimationFrame","defer","focusMove","owner","direction","restore","row","querySelector","CSS","escape","wanted","other","target","getAttribute","document","activeElement","focus","preventScroll","requestAnimationFrame","move","item","next","current","indexOf","length","_$createComponent","children","_el$","_tmpl$","_$use","el","_$insert","each","_el$4","_tmpl$4","_el$5","firstChild","when","fallback","_tmpl$5","variant","size","tooltip","disabled","onClick","_$effect","_$setAttribute","_el$2","_tmpl$2","_el$3","_tmpl$3","as"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx"],"sourcesContent":["import { ArrowDown, ArrowUp } from 'lucide-solid'\nimport { For, Show, createEffect, createSignal, on, onCleanup, type Accessor } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../../ui/dialog'\nimport { ActionButton } from '../action-button'\nimport { moveTarget, moveWorkspace, type WorkspaceMoveDirection } from './workspace-order'\n\nexport type WorkspaceReorderItem = {\n id: string\n name: string\n fixed?: boolean\n}\n\nexport type WorkspaceReorderDialogProps = {\n open: boolean\n onOpenChange(open: boolean): void\n workspaces: readonly WorkspaceReorderItem[]\n /** Receives the full id order after one move. May be async; a rejection shows an error. */\n onReorder(ids: readonly string[]): void | Promise<void>\n title?: string\n /** Where focus returns on close; the menu item that opened the dialog is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\n/**\n * WorkspaceReorderDialog.\n *\n * Ordering by buttons, not by dragging, so it works from the keyboard and with\n * a screen reader: every row has a labelled Move up and Move down. Each move is\n * reported to the host straight away (there is no Save), the moved row keeps\n * focus on the control that was used, and the new position is announced.\n *\n * One save runs at a time, even across a close and reopen: the moves stay\n * disabled until the host's promise settles. A save that finishes after the\n * dialog has closed reports nothing here (the host owns any failure it wants\n * to surface) and never moves focus.\n */\nexport function WorkspaceReorderDialog(props: WorkspaceReorderDialogProps) {\n const [status, setStatus] = createSignal('')\n const [error, setError] = createSignal('')\n const [pending, setPending] = createSignal(false)\n let list: HTMLOListElement | undefined\n // Each open and each close starts a new session. A save belongs to the session\n // it began in; once the dialog has closed (or closed and reopened) its result\n // no longer speaks for what is on screen, so it must not touch the status\n // line or focus. `pending` is deliberately not reset with the session: the\n // host's save is still running, so the next move waits for it instead of\n // running a second save beside it.\n let session = 0\n let disposed = false\n let frame: number | undefined\n\n createEffect(\n on(\n () => props.open,\n () => {\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n setStatus('')\n setError('')\n },\n { defer: true }\n )\n )\n onCleanup(() => {\n disposed = true\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n })\n\n const focusMove = (owner: number, id: string, direction: WorkspaceMoveDirection) => {\n // The host re-renders the rows with the new order, which replaces the control\n // that had focus; focus the same control once it exists, or its sibling when\n // the move reached an edge. Try at once so keys pressed right after a save\n // still reach the dialog, and again next frame for a host that renders later.\n if (frame !== undefined) cancelAnimationFrame(frame)\n const restore = () => {\n if (disposed || owner !== session || !props.open) return\n const row = list?.querySelector<HTMLElement>(`[data-reorder-id=\"${CSS.escape(id)}\"]`)\n const wanted = row?.querySelector<HTMLElement>(`[data-move=\"${direction}\"]`)\n const other = row?.querySelector<HTMLElement>(\n `[data-move=\"${direction === 'up' ? 'down' : 'up'}\"]`\n )\n const target = wanted?.getAttribute('aria-disabled') === 'true' ? other : wanted\n if (target && document.activeElement !== target) target.focus({ preventScroll: true })\n }\n restore()\n frame = requestAnimationFrame(() => {\n frame = undefined\n restore()\n })\n }\n\n const move = async (item: WorkspaceReorderItem, direction: WorkspaceMoveDirection) => {\n if (pending()) return\n const next = moveWorkspace(props.workspaces, item.id, direction)\n if (!next) return\n const owner = session\n const current = () => !disposed && owner === session && props.open\n setError('')\n setPending(true)\n try {\n await props.onReorder(next)\n if (current())\n setStatus(`Moved ${item.name} to position ${next.indexOf(item.id) + 1} of ${next.length}.`)\n } catch {\n if (current()) {\n setStatus('')\n setError('Could not save the order. Try again.')\n }\n } finally {\n if (!disposed) setPending(false)\n if (current()) focusMove(owner, item.id, direction)\n }\n }\n\n return (\n <Dialog open={props.open} onOpenChange={props.onOpenChange}>\n <DialogContent class=\"w-full max-w-sm\" restoreFocusRef={props.restoreFocusRef}>\n <DialogHeader>\n <DialogTitle>{props.title ?? 'Reorder workspaces'}</DialogTitle>\n <DialogDescription>\n Move a workspace up or down. The order is saved as you go.\n </DialogDescription>\n </DialogHeader>\n <ol\n ref={(el) => (list = el)}\n class=\"flex flex-col gap-1\"\n aria-label=\"Workspace order\"\n aria-busy={pending()}\n >\n <For each={props.workspaces}>\n {(item) => (\n <li\n data-reorder-id={item.id}\n class=\"flex items-center gap-2 rounded-md border border-border px-3 py-1.5\"\n >\n <span class=\"min-w-0 flex-1 truncate text-sm\">{item.name}</span>\n <Show\n when={!item.fixed}\n fallback={<span class=\"text-xs text-muted-foreground\">Always first</span>}\n >\n <For each={['up', 'down'] as const}>\n {(direction) => (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-sm\"\n data-move={direction}\n aria-label={`Move ${item.name} ${direction}`}\n tooltip={`Move ${direction}`}\n disabled={\n pending() ||\n moveTarget(props.workspaces, item.id, direction) === undefined\n }\n onClick={() => void move(item, direction)}\n >\n <Show when={direction === 'up'} fallback={<ArrowDown aria-hidden=\"true\" />}>\n <ArrowUp aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n )}\n </For>\n </Show>\n </li>\n )}\n </For>\n </ol>\n <p role=\"status\" aria-live=\"polite\" class=\"min-h-5 text-xs text-muted-foreground\">\n {status()}\n </p>\n <Show when={error()}>\n <p role=\"alert\" class=\"text-xs text-destructive\">\n {error()}\n </p>\n </Show>\n <DialogFooter>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Done\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB4B,uBAAuBC,OAAoC;CACzE,MAAM,CAACC,QAAQC,aAAa1B,aAAa,EAAE;CAC3C,MAAM,CAAC2B,OAAOC,YAAY5B,aAAa,EAAE;CACzC,MAAM,CAAC6B,SAASC,cAAc9B,aAAa,KAAK;CAChD,IAAI+B;CAOJ,IAAIC,UAAU;CACd,IAAIC,WAAW;CACf,IAAIC;CAEJnC,aACEE,SACQuB,MAAMP,YACN;EACJe,WAAW;EACX,IAAIE,UAAUC,KAAAA,GAAWC,qBAAqBF,KAAK;EACnDA,QAAQC,KAAAA;EACRT,UAAU,EAAE;EACZE,SAAS,EAAE;CACb,GACA,EAAES,OAAO,KAAK,CAChB,CACF;CACAnC,gBAAgB;EACd+B,WAAW;EACXD,WAAW;EACX,IAAIE,UAAUC,KAAAA,GAAWC,qBAAqBF,KAAK;CACrD,CAAC;CAED,MAAMI,aAAaC,OAAezB,IAAY0B,cAAsC;EAKlF,IAAIN,UAAUC,KAAAA,GAAWC,qBAAqBF,KAAK;EACnD,MAAMO,gBAAgB;GACpB,IAAIR,YAAYM,UAAUP,WAAW,CAACR,MAAMP,MAAM;GAClD,MAAMyB,MAAMX,MAAMY,cAA2B,qBAAqBC,IAAIC,OAAO/B,EAAE,EAAC,GAAI;GACpF,MAAMgC,SAASJ,KAAKC,cAA2B,eAAeH,UAAS,GAAI;GAC3E,MAAMO,QAAQL,KAAKC,c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A,eAAA,OAAA,CAAA;eAAA;cAAA,CAAA;aAAA;YAAA,CAAA;WAGb,CAAA;UAAA;SAAA,CAAA,GAAA,IAAA;SAAAqF,aAAAC,aAAAb,OAAA,mBA1BYb,KAAK1C,EAAE,CAAA;SAAA,OAAAuD;QAAA,EAAA,CAAA;OA8B3B,CAAA,CAAA;OAAAY,aAAAC,aAAAnB,MAAA,aAnCQlC,QAAQ,CAAC,CAAA;OAAA,OAAAkC;MAAA,EAAA,CAAA;aAAA;OAAA,IAAAoB,QAAAC,QAAA;OAAAjB,OAAAgB,OAuCnB1D,MAAM;OAAA,OAAA0D;MAAA,EAAA,CAAA;MAAAtB,gBAER/D,MAAI;OAAA,IAAC2E,OAAI;QAAA,OAAE9C,MAAM;OAAC;OAAA,IAAAmC,WAAA;QAAA,IAAAuB,QAAAC,QAAA;QAAAnB,OAAAkB,OAEd1D,KAAK;QAAA,OAAA0D;OAAA;MAAA,CAAA;MAAAxB,gBAGTrD,cAAY,EAAA,IAAAsD,WAAA;OAAA,OAAAD,gBACVxD,aAAW;QAACkF,IAAIpF;QAAQyE,SAAO;QAAWC,MAAI;QAAAf,UAAA;OAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
1
+ {"version":3,"file":"workspace-reorder-dialog.js","names":["ArrowDown","LucideArrowDown","ArrowUp","LucideArrowUp","For","Show","createEffect","createSignal","on","onCleanup","Button","Dialog","DialogClose","DialogContent","DialogDescription","DialogFooter","DialogHeader","DialogTitle","ActionButton","moveTarget","moveWorkspace","fastIcon","id","name","fixed","open","onOpenChange","workspaces","onReorder","title","restoreFocusRef","WorkspaceReorderDialog","props","status","setStatus","error","setError","pending","setPending","list","session","disposed","frame","undefined","cancelAnimationFrame","defer","focusMove","owner","direction","restore","row","querySelector","CSS","escape","wanted","other","target","getAttribute","document","activeElement","focus","preventScroll","requestAnimationFrame","move","item","next","current","indexOf","length","_$createComponent","children","_el$","_tmpl$","_$use","el","_$insert","each","_el$4","_tmpl$4","_el$5","firstChild","when","fallback","_tmpl$5","variant","size","tooltip","disabled","onClick","_$effect","_$setAttribute","_el$2","_tmpl$2","_el$3","_tmpl$3","as"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx"],"sourcesContent":["import { ArrowDown as LucideArrowDown, ArrowUp as LucideArrowUp } from 'lucide-solid'\nimport { For, Show, createEffect, createSignal, on, onCleanup, type Accessor } from 'solid-js'\nimport { Button } from '../../ui/button'\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../../ui/dialog'\nimport { ActionButton } from '../action-button'\nimport { moveTarget, moveWorkspace, type WorkspaceMoveDirection } from './workspace-order'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ArrowDown = fastIcon(LucideArrowDown)\nconst ArrowUp = fastIcon(LucideArrowUp)\n\nexport type WorkspaceReorderItem = {\n id: string\n name: string\n fixed?: boolean\n}\n\nexport type WorkspaceReorderDialogProps = {\n open: boolean\n onOpenChange(open: boolean): void\n workspaces: readonly WorkspaceReorderItem[]\n /** Receives the full id order after one move. May be async; a rejection shows an error. */\n onReorder(ids: readonly string[]): void | Promise<void>\n title?: string\n /** Where focus returns on close; the menu item that opened the dialog is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n}\n\n/**\n * WorkspaceReorderDialog.\n *\n * Ordering by buttons, not by dragging, so it works from the keyboard and with\n * a screen reader: every row has a labelled Move up and Move down. Each move is\n * reported to the host straight away (there is no Save), the moved row keeps\n * focus on the control that was used, and the new position is announced.\n *\n * One save runs at a time, even across a close and reopen: the moves stay\n * disabled until the host's promise settles. A save that finishes after the\n * dialog has closed reports nothing here (the host owns any failure it wants\n * to surface) and never moves focus.\n */\nexport function WorkspaceReorderDialog(props: WorkspaceReorderDialogProps) {\n const [status, setStatus] = createSignal('')\n const [error, setError] = createSignal('')\n const [pending, setPending] = createSignal(false)\n let list: HTMLOListElement | undefined\n // Each open and each close starts a new session. A save belongs to the session\n // it began in; once the dialog has closed (or closed and reopened) its result\n // no longer speaks for what is on screen, so it must not touch the status\n // line or focus. `pending` is deliberately not reset with the session: the\n // host's save is still running, so the next move waits for it instead of\n // running a second save beside it.\n let session = 0\n let disposed = false\n let frame: number | undefined\n\n createEffect(\n on(\n () => props.open,\n () => {\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n frame = undefined\n setStatus('')\n setError('')\n },\n { defer: true }\n )\n )\n onCleanup(() => {\n disposed = true\n session += 1\n if (frame !== undefined) cancelAnimationFrame(frame)\n })\n\n const focusMove = (owner: number, id: string, direction: WorkspaceMoveDirection) => {\n // The host re-renders the rows with the new order, which replaces the control\n // that had focus; focus the same control once it exists, or its sibling when\n // the move reached an edge. Try at once so keys pressed right after a save\n // still reach the dialog, and again next frame for a host that renders later.\n if (frame !== undefined) cancelAnimationFrame(frame)\n const restore = () => {\n if (disposed || owner !== session || !props.open) return\n const row = list?.querySelector<HTMLElement>(`[data-reorder-id=\"${CSS.escape(id)}\"]`)\n const wanted = row?.querySelector<HTMLElement>(`[data-move=\"${direction}\"]`)\n const other = row?.querySelector<HTMLElement>(\n `[data-move=\"${direction === 'up' ? 'down' : 'up'}\"]`\n )\n const target = wanted?.getAttribute('aria-disabled') === 'true' ? other : wanted\n if (target && document.activeElement !== target) target.focus({ preventScroll: true })\n }\n restore()\n frame = requestAnimationFrame(() => {\n frame = undefined\n restore()\n })\n }\n\n const move = async (item: WorkspaceReorderItem, direction: WorkspaceMoveDirection) => {\n if (pending()) return\n const next = moveWorkspace(props.workspaces, item.id, direction)\n if (!next) return\n const owner = session\n const current = () => !disposed && owner === session && props.open\n setError('')\n setPending(true)\n try {\n await props.onReorder(next)\n if (current())\n setStatus(`Moved ${item.name} to position ${next.indexOf(item.id) + 1} of ${next.length}.`)\n } catch {\n if (current()) {\n setStatus('')\n setError('Could not save the order. Try again.')\n }\n } finally {\n if (!disposed) setPending(false)\n if (current()) focusMove(owner, item.id, direction)\n }\n }\n\n return (\n <Dialog open={props.open} onOpenChange={props.onOpenChange}>\n <DialogContent class=\"w-full max-w-sm\" restoreFocusRef={props.restoreFocusRef}>\n <DialogHeader>\n <DialogTitle>{props.title ?? 'Reorder workspaces'}</DialogTitle>\n <DialogDescription>\n Move a workspace up or down. The order is saved as you go.\n </DialogDescription>\n </DialogHeader>\n <ol\n ref={(el) => (list = el)}\n class=\"flex flex-col gap-1\"\n aria-label=\"Workspace order\"\n aria-busy={pending()}\n >\n <For each={props.workspaces}>\n {(item) => (\n <li\n data-reorder-id={item.id}\n class=\"flex items-center gap-2 rounded-md border border-border px-3 py-1.5\"\n >\n <span class=\"min-w-0 flex-1 truncate text-sm\">{item.name}</span>\n <Show\n when={!item.fixed}\n fallback={<span class=\"text-xs text-muted-foreground\">Always first</span>}\n >\n <For each={['up', 'down'] as const}>\n {(direction) => (\n <ActionButton\n variant=\"ghost\"\n size=\"icon-sm\"\n data-move={direction}\n aria-label={`Move ${item.name} ${direction}`}\n tooltip={`Move ${direction}`}\n disabled={\n pending() ||\n moveTarget(props.workspaces, item.id, direction) === undefined\n }\n onClick={() => void move(item, direction)}\n >\n <Show when={direction === 'up'} fallback={<ArrowDown aria-hidden=\"true\" />}>\n <ArrowUp aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n )}\n </For>\n </Show>\n </li>\n )}\n </For>\n </ol>\n <p role=\"status\" aria-live=\"polite\" class=\"min-h-5 text-xs text-muted-foreground\">\n {status()}\n </p>\n <Show when={error()}>\n <p role=\"alert\" class=\"text-xs text-destructive\">\n {error()}\n </p>\n </Show>\n <DialogFooter>\n <DialogClose as={Button} variant=\"outline\" size=\"sm\">\n Done\n </DialogClose>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAMA,cAAYqB,SAASpB,SAAe;AAC1C,IAAMC,YAAUmB,SAASlB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OAAAgB,OAuCnB1D,MAAM;OAAA,OAAA0D;MAAA,EAAA,CAAA;MAAAtB,gBAERhE,MAAI;OAAA,IAAC4E,OAAI;QAAA,OAAE9C,MAAM;OAAC;OAAA,IAAAmC,WAAA;QAAA,IAAAuB,QAAAC,QAAA;QAAAnB,OAAAkB,OAEd1D,KAAK;QAAA,OAAA0D;OAAA;MAAA,CAAA;MAAAxB,gBAGTtD,cAAY,EAAA,IAAAuD,WAAA;OAAA,OAAAD,gBACVzD,aAAW;QAACmF,IAAIrF;QAAQ0E,SAAO;QAAWC,MAAI;QAAAf,UAAA;OAAA,CAAA;MAAA,EAAA,CAAA;KAAA;IAAA;GAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAsBnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,IAAI,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;IACvC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC5C,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAWD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA+K9D"}
1
+ {"version":3,"file":"workspace-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AA6BnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;OAQG;IACH,IAAI,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;IACvC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,gGAAgG;IAChG,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC5C,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAWD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA+K9D"}
@@ -1,6 +1,7 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu/dropdown-menu.js";
3
3
  import { ActionButton } from "../action-button/action-button.js";
4
+ import { fastIcon } from "../../../lib/fast-icon.js";
4
5
  import { Dynamic, createComponent, insert, memo, setAttribute, template } from "solid-js/web";
5
6
  import { ArrowDownUp, ChevronDown, Plus, Settings } from "lucide-solid";
6
7
  import { For, Show, createSignal, createUniqueId, onCleanup } from "solid-js";
@@ -9,6 +10,10 @@ var _tmpl$ = /*#__PURE__*/ template(`<span class=sr-only>Switch workspace, curre
9
10
  var _tmpl$2 = /*#__PURE__*/ template(`<span aria-hidden=true class="flex shrink-0">`);
10
11
  var _tmpl$3 = /*#__PURE__*/ template(`<span class="min-w-0 max-w-40 truncate">`);
11
12
  var _tmpl$4 = /*#__PURE__*/ template(`<span class="min-w-0 flex-1 truncate">`);
13
+ var ArrowDownUp$1 = fastIcon(ArrowDownUp);
14
+ var ChevronDown$1 = fastIcon(ChevronDown);
15
+ var Plus$1 = fastIcon(Plus);
16
+ var Settings$1 = fastIcon(Settings);
12
17
  var loadReorderDialog = () => import("./workspace-reorder-dialog.js");
13
18
  /**
14
19
  * Draws one placement of a mark. A function draws anew each time; a node that is
@@ -125,7 +130,7 @@ function WorkspaceSwitcher(props) {
125
130
  insert(_el$3, () => current()?.name ?? props.placeholder ?? "Choose workspace");
126
131
  return _el$3;
127
132
  })(),
128
- createComponent(ChevronDown, {
133
+ createComponent(ChevronDown$1, {
129
134
  "aria-hidden": "true",
130
135
  "class": "size-3.5 shrink-0 text-muted-foreground"
131
136
  })
@@ -202,7 +207,7 @@ function WorkspaceSwitcher(props) {
202
207
  return createComponent(DropdownMenuItem, {
203
208
  onSelect: () => props.onCreate?.(),
204
209
  get children() {
205
- return [createComponent(Plus, { "aria-hidden": "true" }), memo(() => props.createLabel ?? "New workspace")];
210
+ return [createComponent(Plus$1, { "aria-hidden": "true" }), memo(() => props.createLabel ?? "New workspace")];
206
211
  }
207
212
  });
208
213
  }
@@ -219,7 +224,7 @@ function WorkspaceSwitcher(props) {
219
224
  onSelect: requestReorder,
220
225
  onSelectAfterClose: () => openPending?.(),
221
226
  get children() {
222
- return [createComponent(ArrowDownUp, { "aria-hidden": "true" }), memo(() => memo(() => !!reorderFailed())() ? props.reorderErrorLabel ?? "Couldn’t load reordering. Reload to try again." : props.reorderLabel ?? "Reorder workspaces…")];
227
+ return [createComponent(ArrowDownUp$1, { "aria-hidden": "true" }), memo(() => memo(() => !!reorderFailed())() ? props.reorderErrorLabel ?? "Couldn’t load reordering. Reload to try again." : props.reorderLabel ?? "Reorder workspaces…")];
223
228
  }
224
229
  });
225
230
  }
@@ -232,7 +237,7 @@ function WorkspaceSwitcher(props) {
232
237
  return createComponent(DropdownMenuItem, {
233
238
  onSelect: () => props.onManage?.(),
234
239
  get children() {
235
- return [createComponent(Settings, { "aria-hidden": "true" }), memo(() => props.manageLabel ?? "Workspace settings…")];
240
+ return [createComponent(Settings$1, { "aria-hidden": "true" }), memo(() => props.manageLabel ?? "Workspace settings…")];
236
241
  }
237
242
  });
238
243
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-switcher.js","names":["ArrowDownUp","ChevronDown","Plus","Settings","Dynamic","For","Show","createSignal","createUniqueId","onCleanup","cn","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","ActionButton","loadReorderDialog","id","name","mark","detail","fixed","workspaces","value","onValueChange","onCreate","createLabel","onManage","manageLabel","onReorder","reorderLabel","reorderErrorLabel","label","placeholder","disabled","class","drawMark","copy","Node","cloneNode","WorkspaceSwitcher","props","labelId","open","setOpen","reordering","setReordering","reorderDialog","setReorderDialog","reorderFailed","setReorderFailed","cancelPending","openPending","trigger","current","find","item","canReorder","undefined","filter","length","loadDialog","then","module","WorkspaceReorderDialog","warm","next","requestReorder","waiting","loaded","menuClosed","stop","document","removeEventListener","onKey","afterMenuClose","openWhenReady","event","key","addEventListener","success","_$createComponent","modal","onOpenChange","children","as","variant","size","ref","el","tooltip","_el$","_tmpl$","_$setAttribute","_el$2","_tmpl$2","_$insert","_c$","_$memo","_el$3","_tmpl$3","align","sideOffset","onChange","String","each","closeOnSelect","_el$4","_el$5","_tmpl$4","when","onSelect","onSelectAfterClose","component","restoreFocusRef"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"sourcesContent":["import { ArrowDownUp, ChevronDown, Plus, Settings } from 'lucide-solid'\nimport type { JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { For, Show, createSignal, createUniqueId, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { ActionButton } from '../action-button'\n\n// The dialog is only reachable from a menu item, so it stays out of the code\n// that ships with the switcher and loads on demand.\nconst loadReorderDialog = () => import('./workspace-reorder-dialog')\ntype ReorderDialog = Awaited<ReturnType<typeof loadReorderDialog>>['WorkspaceReorderDialog']\n\n/**\n * WorkspaceSwitcher.\n *\n * The workspace picker that sits in the top bar beside the sidebar toggle. One\n * ghost button shows the current workspace's mark and name; pressing it opens a\n * radio list of the others. Choosing one only changes what the window is\n * looking at: the switcher reports the id and the host decides what that means,\n * which is why it carries no status of its own and never closes, restarts or\n * moves anything.\n *\n * It is deliberately the simple interaction (a single menu, not a nested\n * accordion): the sidebar below it already shows what is inside the chosen\n * workspace, so the switcher's only job is to name the workspace and let the\n * user change it.\n */\nexport type WorkspaceSwitcherItem = {\n id: string\n name: string\n /**\n * The workspace's mark, drawn in the trigger and in its row. Decorative.\n *\n * A DOM node can sit in one place, so the current workspace's mark would have\n * to be in the trigger and its menu row at once. Pass a function to draw a\n * fresh mark in each place (the preferred form). A node built once is also\n * safe: the trigger keeps it and the current row gets a copy, which carries\n * no event handlers or reactive bindings, so keep marks static.\n */\n mark: JSX.Element | (() => JSX.Element)\n /** A quiet trailing readout in the row, e.g. an unread count. Optional. */\n detail?: JSX.Element\n /** Pinned to the top of the order, e.g. Home: it cannot be moved and nothing moves above it. */\n fixed?: boolean\n}\n\nexport type WorkspaceSwitcherProps = {\n workspaces: readonly WorkspaceSwitcherItem[]\n /** The current workspace's id. */\n value: string | undefined\n onValueChange(id: string): void\n /** Offered at the foot of the menu when present. */\n onCreate?(): void\n createLabel?: string\n /** Offered beside the create action when present: open the current workspace's settings. */\n onManage?(): void\n manageLabel?: string\n /**\n * Offered when present and at least two workspaces can move: opens a dialog\n * with Move up and Move down on each row. Receives the full id order after\n * each move; the host saves it and passes the workspaces back in that order.\n */\n onReorder?(ids: readonly string[]): void | Promise<void>\n reorderLabel?: string\n /** Replaces the \"Reorder workspaces…\" item when the dialog could not be loaded. */\n reorderErrorLabel?: string\n /** The menu's heading; also the trigger's accessible-name prefix. */\n label?: string\n /** Shown while no workspace is current. */\n placeholder?: string\n disabled?: boolean\n class?: string\n}\n\n/**\n * Draws one placement of a mark. A function draws anew each time; a node that is\n * already placed elsewhere is copied so the original stays where it is.\n */\nfunction drawMark(mark: WorkspaceSwitcherItem['mark'], copy: boolean): JSX.Element {\n if (typeof mark === 'function') return mark()\n return copy && mark instanceof Node ? mark.cloneNode(true) : mark\n}\n\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n // Reference visible mark text as well as the workspace name for speech-input matching.\n const labelId = createUniqueId()\n const [open, setOpen] = createSignal(false)\n const [reordering, setReordering] = createSignal(false)\n const [reorderDialog, setReorderDialog] = createSignal<ReorderDialog>()\n const [reorderFailed, setReorderFailed] = createSignal(false)\n let cancelPending: (() => void) | undefined\n let openPending: (() => void) | undefined\n let trigger: HTMLElement | undefined\n const current = () => props.workspaces.find((item) => item.id === props.value)\n const label = () => props.label ?? 'Workspaces'\n const canReorder = () =>\n props.onReorder !== undefined && props.workspaces.filter((item) => !item.fixed).length > 1\n\n // Fetch the dialog's code. Safe to call early and often: the browser keeps one\n // copy, and a failure is remembered here instead of surfacing as an unhandled\n // rejection, so the switcher keeps working without reordering.\n const loadDialog = () =>\n loadReorderDialog().then(\n (module) => {\n setReorderDialog(() => module.WorkspaceReorderDialog)\n return true\n },\n () => {\n setReorderFailed(true)\n return false\n }\n )\n // Warm the chunk while the menu is open, so choosing the item rarely waits.\n const warm = (next: boolean) => {\n if (next) {\n // Reopening is new intent, including keyboard activation: an older\n // delayed reorder must not open after another workspace or action wins.\n cancelPending?.()\n }\n setOpen(next)\n if (next && canReorder() && !reorderDialog()) void loadDialog()\n }\n // Choosing the item while the code is still arriving must not open the dialog\n // late: nothing on screen can take Escape or an outside click yet, so either\n // of them withdraws the request, and the dialog opens only if the user waits.\n // The request starts on select; the dialog opens only once the menu has\n // closed, so it captures the trigger as its opener.\n const requestReorder = () => {\n cancelPending?.()\n let waiting = true\n let loaded = !!reorderDialog()\n let menuClosed = false\n const stop = () => {\n waiting = false\n document.removeEventListener('keydown', onKey, true)\n document.removeEventListener('pointerdown', stop, true)\n if (cancelPending === stop) cancelPending = undefined\n if (openPending === afterMenuClose) openPending = undefined\n }\n const openWhenReady = () => {\n if (!waiting || !loaded || !menuClosed) return\n stop()\n setReordering(true)\n }\n const afterMenuClose = () => {\n menuClosed = true\n openWhenReady()\n }\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') stop()\n }\n document.addEventListener('keydown', onKey, true)\n document.addEventListener('pointerdown', stop, true)\n cancelPending = stop\n openPending = afterMenuClose\n if (!loaded)\n void loadDialog().then((success) => {\n if (!success) stop()\n else {\n loaded = true\n openWhenReady()\n }\n })\n }\n onCleanup(() => cancelPending?.())\n\n return (\n <>\n <DropdownMenu modal={false} open={open()} onOpenChange={warm}>\n <DropdownMenuTrigger\n as={ActionButton}\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled}\n ref={(el: HTMLElement) => (trigger = el)}\n data-slot=\"workspace-switcher\"\n tooltip={`Workspace: ${current()?.name ?? props.placeholder ?? 'Choose workspace'}`}\n aria-labelledby={`${labelId}-action ${labelId}-mark ${labelId}-name`}\n class={cn('max-w-full min-w-0 shrink', props.class)}\n >\n <span id={`${labelId}-action`} class=\"sr-only\">\n Switch workspace, current:\n </span>\n <span id={`${labelId}-mark`} aria-hidden=\"true\" class=\"flex shrink-0\">\n {current() && drawMark(current()!.mark, false)}\n </span>{' '}\n <span id={`${labelId}-name`} class=\"min-w-0 max-w-40 truncate\">\n {current()?.name ?? props.placeholder ?? 'Choose workspace'}\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" sideOffset={6} class=\"min-w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{label()}</DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={props.value}\n onChange={(value) => {\n setOpen(false)\n const id = String(value)\n if (id !== props.value) props.onValueChange(id)\n }}\n >\n <For each={props.workspaces}>\n {(item) => (\n <DropdownMenuRadioItem value={item.id} closeOnSelect data-workspace-id={item.id}>\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {drawMark(item.mark, item.id === props.value)}\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{item.name}</span>\n <Show when={item.detail}>{item.detail}</Show>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuGroup>\n <Show when={props.onCreate || props.onManage || canReorder()}>\n <DropdownMenuSeparator />\n <Show when={props.onCreate}>\n <DropdownMenuItem onSelect={() => props.onCreate?.()}>\n <Plus aria-hidden=\"true\" />\n {props.createLabel ?? 'New workspace'}\n </DropdownMenuItem>\n </Show>\n <Show when={canReorder()}>\n <DropdownMenuItem\n disabled={reorderFailed()}\n onSelect={requestReorder}\n onSelectAfterClose={() => openPending?.()}\n >\n <ArrowDownUp aria-hidden=\"true\" />\n {reorderFailed()\n ? (props.reorderErrorLabel ?? 'Couldn’t load reordering. Reload to try again.')\n : (props.reorderLabel ?? 'Reorder workspaces…')}\n </DropdownMenuItem>\n </Show>\n <Show when={props.onManage}>\n <DropdownMenuItem onSelect={() => props.onManage?.()}>\n <Settings aria-hidden=\"true\" />\n {props.manageLabel ?? 'Workspace settings…'}\n </DropdownMenuItem>\n </Show>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n <Show when={reorderDialog() && props.onReorder}>\n {(onReorder) => (\n <Dynamic\n component={reorderDialog()}\n open={reordering()}\n onOpenChange={setReordering}\n workspaces={props.workspaces}\n onReorder={onReorder()}\n restoreFocusRef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"file":"workspace-switcher.js","names":["ArrowDownUp","LucideArrowDownUp","ChevronDown","LucideChevronDown","Plus","LucidePlus","Settings","LucideSettings","Dynamic","For","Show","createSignal","createUniqueId","onCleanup","cn","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","ActionButton","fastIcon","loadReorderDialog","id","name","mark","detail","fixed","workspaces","value","onValueChange","onCreate","createLabel","onManage","manageLabel","onReorder","reorderLabel","reorderErrorLabel","label","placeholder","disabled","class","drawMark","copy","Node","cloneNode","WorkspaceSwitcher","props","labelId","open","setOpen","reordering","setReordering","reorderDialog","setReorderDialog","reorderFailed","setReorderFailed","cancelPending","openPending","trigger","current","find","item","canReorder","undefined","filter","length","loadDialog","then","module","WorkspaceReorderDialog","warm","next","requestReorder","waiting","loaded","menuClosed","stop","document","removeEventListener","onKey","afterMenuClose","openWhenReady","event","key","addEventListener","success","_$createComponent","modal","onOpenChange","children","as","variant","size","ref","el","tooltip","_el$","_tmpl$","_$setAttribute","_el$2","_tmpl$2","_$insert","_c$","_$memo","_el$3","_tmpl$3","align","sideOffset","onChange","String","each","closeOnSelect","_el$4","_el$5","_tmpl$4","when","onSelect","onSelectAfterClose","component","restoreFocusRef"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"sourcesContent":["import {\n ArrowDownUp as LucideArrowDownUp,\n ChevronDown as LucideChevronDown,\n Plus as LucidePlus,\n Settings as LucideSettings,\n} from 'lucide-solid'\nimport type { JSX } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { For, Show, createSignal, createUniqueId, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { ActionButton } from '../action-button'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ArrowDownUp = fastIcon(LucideArrowDownUp)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Plus = fastIcon(LucidePlus)\nconst Settings = fastIcon(LucideSettings)\n\n// The dialog is only reachable from a menu item, so it stays out of the code\n// that ships with the switcher and loads on demand.\nconst loadReorderDialog = () => import('./workspace-reorder-dialog')\ntype ReorderDialog = Awaited<ReturnType<typeof loadReorderDialog>>['WorkspaceReorderDialog']\n\n/**\n * WorkspaceSwitcher.\n *\n * The workspace picker that sits in the top bar beside the sidebar toggle. One\n * ghost button shows the current workspace's mark and name; pressing it opens a\n * radio list of the others. Choosing one only changes what the window is\n * looking at: the switcher reports the id and the host decides what that means,\n * which is why it carries no status of its own and never closes, restarts or\n * moves anything.\n *\n * It is deliberately the simple interaction (a single menu, not a nested\n * accordion): the sidebar below it already shows what is inside the chosen\n * workspace, so the switcher's only job is to name the workspace and let the\n * user change it.\n */\nexport type WorkspaceSwitcherItem = {\n id: string\n name: string\n /**\n * The workspace's mark, drawn in the trigger and in its row. Decorative.\n *\n * A DOM node can sit in one place, so the current workspace's mark would have\n * to be in the trigger and its menu row at once. Pass a function to draw a\n * fresh mark in each place (the preferred form). A node built once is also\n * safe: the trigger keeps it and the current row gets a copy, which carries\n * no event handlers or reactive bindings, so keep marks static.\n */\n mark: JSX.Element | (() => JSX.Element)\n /** A quiet trailing readout in the row, e.g. an unread count. Optional. */\n detail?: JSX.Element\n /** Pinned to the top of the order, e.g. Home: it cannot be moved and nothing moves above it. */\n fixed?: boolean\n}\n\nexport type WorkspaceSwitcherProps = {\n workspaces: readonly WorkspaceSwitcherItem[]\n /** The current workspace's id. */\n value: string | undefined\n onValueChange(id: string): void\n /** Offered at the foot of the menu when present. */\n onCreate?(): void\n createLabel?: string\n /** Offered beside the create action when present: open the current workspace's settings. */\n onManage?(): void\n manageLabel?: string\n /**\n * Offered when present and at least two workspaces can move: opens a dialog\n * with Move up and Move down on each row. Receives the full id order after\n * each move; the host saves it and passes the workspaces back in that order.\n */\n onReorder?(ids: readonly string[]): void | Promise<void>\n reorderLabel?: string\n /** Replaces the \"Reorder workspaces…\" item when the dialog could not be loaded. */\n reorderErrorLabel?: string\n /** The menu's heading; also the trigger's accessible-name prefix. */\n label?: string\n /** Shown while no workspace is current. */\n placeholder?: string\n disabled?: boolean\n class?: string\n}\n\n/**\n * Draws one placement of a mark. A function draws anew each time; a node that is\n * already placed elsewhere is copied so the original stays where it is.\n */\nfunction drawMark(mark: WorkspaceSwitcherItem['mark'], copy: boolean): JSX.Element {\n if (typeof mark === 'function') return mark()\n return copy && mark instanceof Node ? mark.cloneNode(true) : mark\n}\n\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n // Reference visible mark text as well as the workspace name for speech-input matching.\n const labelId = createUniqueId()\n const [open, setOpen] = createSignal(false)\n const [reordering, setReordering] = createSignal(false)\n const [reorderDialog, setReorderDialog] = createSignal<ReorderDialog>()\n const [reorderFailed, setReorderFailed] = createSignal(false)\n let cancelPending: (() => void) | undefined\n let openPending: (() => void) | undefined\n let trigger: HTMLElement | undefined\n const current = () => props.workspaces.find((item) => item.id === props.value)\n const label = () => props.label ?? 'Workspaces'\n const canReorder = () =>\n props.onReorder !== undefined && props.workspaces.filter((item) => !item.fixed).length > 1\n\n // Fetch the dialog's code. Safe to call early and often: the browser keeps one\n // copy, and a failure is remembered here instead of surfacing as an unhandled\n // rejection, so the switcher keeps working without reordering.\n const loadDialog = () =>\n loadReorderDialog().then(\n (module) => {\n setReorderDialog(() => module.WorkspaceReorderDialog)\n return true\n },\n () => {\n setReorderFailed(true)\n return false\n }\n )\n // Warm the chunk while the menu is open, so choosing the item rarely waits.\n const warm = (next: boolean) => {\n if (next) {\n // Reopening is new intent, including keyboard activation: an older\n // delayed reorder must not open after another workspace or action wins.\n cancelPending?.()\n }\n setOpen(next)\n if (next && canReorder() && !reorderDialog()) void loadDialog()\n }\n // Choosing the item while the code is still arriving must not open the dialog\n // late: nothing on screen can take Escape or an outside click yet, so either\n // of them withdraws the request, and the dialog opens only if the user waits.\n // The request starts on select; the dialog opens only once the menu has\n // closed, so it captures the trigger as its opener.\n const requestReorder = () => {\n cancelPending?.()\n let waiting = true\n let loaded = !!reorderDialog()\n let menuClosed = false\n const stop = () => {\n waiting = false\n document.removeEventListener('keydown', onKey, true)\n document.removeEventListener('pointerdown', stop, true)\n if (cancelPending === stop) cancelPending = undefined\n if (openPending === afterMenuClose) openPending = undefined\n }\n const openWhenReady = () => {\n if (!waiting || !loaded || !menuClosed) return\n stop()\n setReordering(true)\n }\n const afterMenuClose = () => {\n menuClosed = true\n openWhenReady()\n }\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') stop()\n }\n document.addEventListener('keydown', onKey, true)\n document.addEventListener('pointerdown', stop, true)\n cancelPending = stop\n openPending = afterMenuClose\n if (!loaded)\n void loadDialog().then((success) => {\n if (!success) stop()\n else {\n loaded = true\n openWhenReady()\n }\n })\n }\n onCleanup(() => cancelPending?.())\n\n return (\n <>\n <DropdownMenu modal={false} open={open()} onOpenChange={warm}>\n <DropdownMenuTrigger\n as={ActionButton}\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled}\n ref={(el: HTMLElement) => (trigger = el)}\n data-slot=\"workspace-switcher\"\n tooltip={`Workspace: ${current()?.name ?? props.placeholder ?? 'Choose workspace'}`}\n aria-labelledby={`${labelId}-action ${labelId}-mark ${labelId}-name`}\n class={cn('max-w-full min-w-0 shrink', props.class)}\n >\n <span id={`${labelId}-action`} class=\"sr-only\">\n Switch workspace, current:\n </span>\n <span id={`${labelId}-mark`} aria-hidden=\"true\" class=\"flex shrink-0\">\n {current() && drawMark(current()!.mark, false)}\n </span>{' '}\n <span id={`${labelId}-name`} class=\"min-w-0 max-w-40 truncate\">\n {current()?.name ?? props.placeholder ?? 'Choose workspace'}\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" sideOffset={6} class=\"min-w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{label()}</DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={props.value}\n onChange={(value) => {\n setOpen(false)\n const id = String(value)\n if (id !== props.value) props.onValueChange(id)\n }}\n >\n <For each={props.workspaces}>\n {(item) => (\n <DropdownMenuRadioItem value={item.id} closeOnSelect data-workspace-id={item.id}>\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {drawMark(item.mark, item.id === props.value)}\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{item.name}</span>\n <Show when={item.detail}>{item.detail}</Show>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuGroup>\n <Show when={props.onCreate || props.onManage || canReorder()}>\n <DropdownMenuSeparator />\n <Show when={props.onCreate}>\n <DropdownMenuItem onSelect={() => props.onCreate?.()}>\n <Plus aria-hidden=\"true\" />\n {props.createLabel ?? 'New workspace'}\n </DropdownMenuItem>\n </Show>\n <Show when={canReorder()}>\n <DropdownMenuItem\n disabled={reorderFailed()}\n onSelect={requestReorder}\n onSelectAfterClose={() => openPending?.()}\n >\n <ArrowDownUp aria-hidden=\"true\" />\n {reorderFailed()\n ? (props.reorderErrorLabel ?? 'Couldn’t load reordering. Reload to try again.')\n : (props.reorderLabel ?? 'Reorder workspaces…')}\n </DropdownMenuItem>\n </Show>\n <Show when={props.onManage}>\n <DropdownMenuItem onSelect={() => props.onManage?.()}>\n <Settings aria-hidden=\"true\" />\n {props.manageLabel ?? 'Workspace settings…'}\n </DropdownMenuItem>\n </Show>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n <Show when={reorderDialog() && props.onReorder}>\n {(onReorder) => (\n <Dynamic\n component={reorderDialog()}\n open={reordering()}\n onOpenChange={setReordering}\n workspaces={props.workspaces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BsC,cAAcrC;GAAa,IAC3BxB,aAAU;IAAA,OAAEmB,MAAMnB;GAAU;GAAA,IAC5BO,YAAS;IAAA,OAAEA,UAAU;GAAC;GACtBqF,uBAAuB7D;EAAO,CAAA;CAEjC,CAAA,CAAA;AAIT"}
@@ -1 +1 @@
1
- {"version":3,"file":"busy-send-button.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/busy-send-button.tsx"],"names":[],"mappings":"AAmBA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,CAAA;AAC5C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAA;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IAC1C,8EAA8E;IAC9E,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;IACnD,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AASD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAsFxD"}
1
+ {"version":3,"file":"busy-send-button.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/busy-send-button.tsx"],"names":[],"mappings":"AA6BA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,CAAA;AAC5C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAA;IAClB,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IAC1C,8EAA8E;IAC9E,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;IACnD,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AASD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,kCAsFxD"}
@@ -1,6 +1,7 @@
1
1
  import { Button } from "../ui/button/button.js";
2
2
  import { ButtonGroup } from "../ui/button-group/button-group.js";
3
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown-menu/dropdown-menu.js";
4
+ import { fastIcon } from "../../lib/fast-icon.js";
4
5
  import { createComponent, insert, setAttribute, template } from "solid-js/web";
5
6
  import { ArrowUpFromLine, ChevronDown, Target } from "lucide-solid";
6
7
  import { For, Show, createUniqueId } from "solid-js";
@@ -10,6 +11,9 @@ var _tmpl$2 = /*#__PURE__*/ template(`<div class="flex min-w-0 flex-col gap-1"><
10
11
  var _tmpl$3 = /*#__PURE__*/ template(`<span class="text-muted-foreground text-xs">`);
11
12
  var _tmpl$4 = /*#__PURE__*/ template(`<p class="text-muted-foreground px-2 py-1 text-xs">`);
12
13
  var _tmpl$5 = /*#__PURE__*/ template(`<p class="text-muted-foreground text-xs">`);
14
+ var ArrowUpFromLine$1 = fastIcon(ArrowUpFromLine);
15
+ var ChevronDown$1 = fastIcon(ChevronDown);
16
+ var Target$1 = fastIcon(Target);
13
17
  var modes = ["steer", "queue"];
14
18
  var labels = {
15
19
  steer: "Steer",
@@ -65,10 +69,10 @@ function BusySendButton(props) {
65
69
  return props.mode === "steer";
66
70
  },
67
71
  get fallback() {
68
- return createComponent(ArrowUpFromLine, {});
72
+ return createComponent(ArrowUpFromLine$1, {});
69
73
  },
70
74
  get children() {
71
- return createComponent(Target, {});
75
+ return createComponent(Target$1, {});
72
76
  }
73
77
  });
74
78
  }
@@ -84,7 +88,7 @@ function BusySendButton(props) {
84
88
  return props.selectionDisabled;
85
89
  },
86
90
  get children() {
87
- return createComponent(ChevronDown, {});
91
+ return createComponent(ChevronDown$1, {});
88
92
  }
89
93
  })];
90
94
  }
@@ -112,10 +116,10 @@ function BusySendButton(props) {
112
116
  return [createComponent(Show, {
113
117
  when: mode === "steer",
114
118
  get fallback() {
115
- return createComponent(ArrowUpFromLine, {});
119
+ return createComponent(ArrowUpFromLine$1, {});
116
120
  },
117
121
  get children() {
118
- return createComponent(Target, {});
122
+ return createComponent(Target$1, {});
119
123
  }
120
124
  }), (() => {
121
125
  var _el$2 = _tmpl$2(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
@@ -1 +1 @@
1
- {"version":3,"file":"busy-send-button.js","names":["ArrowUpFromLine","ChevronDown","Target","For","Show","createUniqueId","Button","ButtonGroup","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","mode","onModeChange","onFire","disabled","selectionDisabled","unavailable","alternateActionHint","modes","labels","steer","queue","descriptions","BusySendButton","props","reasonId","reason","variant","_el$","_tmpl$","_$insert","_$createComponent","placement","modal","children","label","type","size","undefined","onClick","when","fallback","as","hideArrow","tabKey","value","onChange","each","closeOnSelect","_el$2","_tmpl$2","_el$3","firstChild","_el$4","nextSibling","message","_el$5","_tmpl$3","alternateActionHintSlot","_el$6","_tmpl$4","_el$7","_tmpl$5","_$setAttribute"],"sources":["../../../src/components/conversation/busy-send-button.tsx"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/components/BusySendButton.tsx\n * at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under Apache-2.0; see LICENSE and NOTICE.\n */\nimport { ArrowUpFromLine, ChevronDown, Target } from 'lucide-solid'\nimport { For, Show, createUniqueId } from 'solid-js'\nimport { Button } from '../ui/button'\nimport { ButtonGroup } from '../ui/button-group'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/dropdown-menu'\n\nexport type BusySendMode = 'steer' | 'queue'\nexport type BusySendButtonProps = {\n mode: BusySendMode\n onModeChange: (mode: BusySendMode) => void\n /** Executes only the selected action. The host owns the draft and command. */\n onFire: () => void\n /** An empty draft or pending delivery disables fire, but not choosing a mode. */\n disabled?: boolean\n /** Disable mode selection when the host has no authority to change preferences. */\n selectionDisabled?: boolean\n /** Host capability/authority failures: unavailable rows remain visible. */\n unavailable?: Partial<Record<BusySendMode, string>>\n /** Supply only when the host implements this alternate-action keyboard chord. */\n alternateActionHint?: string\n}\n\nconst modes: BusySendMode[] = ['steer', 'queue']\nconst labels = { steer: 'Steer', queue: 'Queue' }\nconst descriptions = {\n steer: 'Act on this right away',\n queue: 'Run after the current work finishes',\n}\n\n/**\n * Kiro's split action/menu composition, with app-owned mode and availability.\n * Picking a mode never fires it. Persistence, migration and same-session\n * broadcasts belong to the consumer; this component has no storage or global listeners.\n * Kobalte replaces the donor manual portal/positioning and document listeners:\n * arrows wrap and selection/Escape return focus, and Tab cycles the enabled\n * rows as the donor's did (`tabKey=\"cycle\"`). No force-reset timer or runtime\n * authority is translated from the adjacent donor stop flow.\n */\nexport function BusySendButton(props: BusySendButtonProps) {\n const reasonId = createUniqueId()\n const reason = () => props.unavailable?.[props.mode]\n const variant = () => (props.mode === 'steer' ? ('default' as const) : ('secondary' as const))\n return (\n <div data-slot=\"busy-send-button\" class=\"flex w-fit flex-col gap-1\">\n <DropdownMenu placement=\"top-end\" modal={false}>\n <ButtonGroup label=\"Send while busy\">\n <Button\n type=\"button\"\n size=\"icon-sm\"\n variant={variant()}\n aria-label={props.mode === 'steer' ? 'Steer' : 'Queue message'}\n aria-describedby={reason() ? reasonId : undefined}\n disabled={props.disabled || !!reason()}\n onClick={() => {\n if (!props.disabled && !reason()) props.onFire()\n }}\n >\n <Show when={props.mode === 'steer'} fallback={<ArrowUpFromLine />}>\n <Target />\n </Show>\n </Button>\n <DropdownMenuTrigger\n as={Button}\n type=\"button\"\n size=\"icon-sm\"\n variant={variant()}\n aria-label=\"Send options\"\n disabled={props.selectionDisabled}\n >\n <ChevronDown />\n </DropdownMenuTrigger>\n </ButtonGroup>\n <DropdownMenuContent hideArrow tabKey=\"cycle\">\n <DropdownMenuRadioGroup\n value={props.mode}\n onChange={(value) => {\n if (\n (value === 'steer' || value === 'queue') &&\n !props.selectionDisabled &&\n !props.unavailable?.[value]\n )\n props.onModeChange(value)\n }}\n >\n <For each={modes}>\n {(mode) => (\n <DropdownMenuRadioItem\n value={mode}\n closeOnSelect\n disabled={props.selectionDisabled || !!props.unavailable?.[mode]}\n >\n <Show when={mode === 'steer'} fallback={<ArrowUpFromLine />}>\n <Target />\n </Show>\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span>{labels[mode]}</span>\n <span class=\"text-muted-foreground text-xs\">{descriptions[mode]}</span>\n <Show when={props.unavailable?.[mode]}>\n {(message) => <span class=\"text-muted-foreground text-xs\">{message()}</span>}\n </Show>\n </div>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n <Show when={props.alternateActionHint}>\n {(alternateActionHintSlot) => (\n <>\n <DropdownMenuSeparator />\n <p class=\"text-muted-foreground px-2 py-1 text-xs\">{alternateActionHintSlot()}</p>\n </>\n )}\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n <Show when={reason()}>\n {(message) => (\n <p id={reasonId} class=\"text-muted-foreground text-xs\">\n {message()}\n </p>\n )}\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAmCA,IAAMqB,QAAwB,CAAC,SAAS,OAAO;AAC/C,IAAMC,SAAS;CAAEC,OAAO;CAASC,OAAO;AAAQ;AAChD,IAAMC,eAAe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;WAAA,EAAA,CAAA,CAAA;UAAA;SAAA,CAAA;QAInF,CAAA;OAAA;MAAA,CAAA,GAAAlB,gBAGJ9B,MAAI;OAAA,IAACuC,OAAI;QAAA,OAAEhB,MAAMP;OAAmB;OAAAiB,WACjCwB,4BAAuB,CAAA3B,gBAEpBtB,uBAAqB,CAAA,CAAA,UAAA;QAAA,IAAAkD,QAAAC,QAAA;QAAA9B,OAAA6B,OAC8BD,uBAAuB;QAAA,OAAAC;OAAA,EAAA,CAAA,CAAA;MAE9E,CAAA,CAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA7B,OAAAF,MAAAG,gBAIN9B,MAAI;GAAA,IAACuC,OAAI;IAAA,OAAEd,OAAO;GAAC;GAAAQ,WAChBqB,mBAAO;IAAA,IAAAM,QAAAC,QAAA;IAAAC,aAAAF,OAAA,MACApC,QAAQ;IAAAK,OAAA+B,OACZN,OAAO;IAAA,OAAAM;GAAA,EAAA,CAAA;EAEX,CAAA,GAAA,IAAA;EAAA,OAAAjC;CAAA,EAAA,CAAA;AAIT"}
1
+ {"version":3,"file":"busy-send-button.js","names":["ArrowUpFromLine","LucideArrowUpFromLine","ChevronDown","LucideChevronDown","Target","LucideTarget","For","Show","createUniqueId","Button","ButtonGroup","DropdownMenu","DropdownMenuContent","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","fastIcon","mode","onModeChange","onFire","disabled","selectionDisabled","unavailable","alternateActionHint","modes","labels","steer","queue","descriptions","BusySendButton","props","reasonId","reason","variant","_el$","_tmpl$","_$insert","_$createComponent","placement","modal","children","label","type","size","undefined","onClick","when","fallback","as","hideArrow","tabKey","value","onChange","each","closeOnSelect","_el$2","_tmpl$2","_el$3","firstChild","_el$4","nextSibling","message","_el$5","_tmpl$3","alternateActionHintSlot","_el$6","_tmpl$4","_el$7","_tmpl$5","_$setAttribute"],"sources":["../../../src/components/conversation/busy-send-button.tsx"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/components/BusySendButton.tsx\n * at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under Apache-2.0; see LICENSE and NOTICE.\n */\nimport {\n ArrowUpFromLine as LucideArrowUpFromLine,\n ChevronDown as LucideChevronDown,\n Target as LucideTarget,\n} from 'lucide-solid'\nimport { For, Show, createUniqueId } from 'solid-js'\nimport { Button } from '../ui/button'\nimport { ButtonGroup } from '../ui/button-group'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/dropdown-menu'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ArrowUpFromLine = fastIcon(LucideArrowUpFromLine)\nconst ChevronDown = fastIcon(LucideChevronDown)\nconst Target = fastIcon(LucideTarget)\n\nexport type BusySendMode = 'steer' | 'queue'\nexport type BusySendButtonProps = {\n mode: BusySendMode\n onModeChange: (mode: BusySendMode) => void\n /** Executes only the selected action. The host owns the draft and command. */\n onFire: () => void\n /** An empty draft or pending delivery disables fire, but not choosing a mode. */\n disabled?: boolean\n /** Disable mode selection when the host has no authority to change preferences. */\n selectionDisabled?: boolean\n /** Host capability/authority failures: unavailable rows remain visible. */\n unavailable?: Partial<Record<BusySendMode, string>>\n /** Supply only when the host implements this alternate-action keyboard chord. */\n alternateActionHint?: string\n}\n\nconst modes: BusySendMode[] = ['steer', 'queue']\nconst labels = { steer: 'Steer', queue: 'Queue' }\nconst descriptions = {\n steer: 'Act on this right away',\n queue: 'Run after the current work finishes',\n}\n\n/**\n * Kiro's split action/menu composition, with app-owned mode and availability.\n * Picking a mode never fires it. Persistence, migration and same-session\n * broadcasts belong to the consumer; this component has no storage or global listeners.\n * Kobalte replaces the donor manual portal/positioning and document listeners:\n * arrows wrap and selection/Escape return focus, and Tab cycles the enabled\n * rows as the donor's did (`tabKey=\"cycle\"`). No force-reset timer or runtime\n * authority is translated from the adjacent donor stop flow.\n */\nexport function BusySendButton(props: BusySendButtonProps) {\n const reasonId = createUniqueId()\n const reason = () => props.unavailable?.[props.mode]\n const variant = () => (props.mode === 'steer' ? ('default' as const) : ('secondary' as const))\n return (\n <div data-slot=\"busy-send-button\" class=\"flex w-fit flex-col gap-1\">\n <DropdownMenu placement=\"top-end\" modal={false}>\n <ButtonGroup label=\"Send while busy\">\n <Button\n type=\"button\"\n size=\"icon-sm\"\n variant={variant()}\n aria-label={props.mode === 'steer' ? 'Steer' : 'Queue message'}\n aria-describedby={reason() ? reasonId : undefined}\n disabled={props.disabled || !!reason()}\n onClick={() => {\n if (!props.disabled && !reason()) props.onFire()\n }}\n >\n <Show when={props.mode === 'steer'} fallback={<ArrowUpFromLine />}>\n <Target />\n </Show>\n </Button>\n <DropdownMenuTrigger\n as={Button}\n type=\"button\"\n size=\"icon-sm\"\n variant={variant()}\n aria-label=\"Send options\"\n disabled={props.selectionDisabled}\n >\n <ChevronDown />\n </DropdownMenuTrigger>\n </ButtonGroup>\n <DropdownMenuContent hideArrow tabKey=\"cycle\">\n <DropdownMenuRadioGroup\n value={props.mode}\n onChange={(value) => {\n if (\n (value === 'steer' || value === 'queue') &&\n !props.selectionDisabled &&\n !props.unavailable?.[value]\n )\n props.onModeChange(value)\n }}\n >\n <For each={modes}>\n {(mode) => (\n <DropdownMenuRadioItem\n value={mode}\n closeOnSelect\n disabled={props.selectionDisabled || !!props.unavailable?.[mode]}\n >\n <Show when={mode === 'steer'} fallback={<ArrowUpFromLine />}>\n <Target />\n </Show>\n <div class=\"flex min-w-0 flex-col gap-1\">\n <span>{labels[mode]}</span>\n <span class=\"text-muted-foreground text-xs\">{descriptions[mode]}</span>\n <Show when={props.unavailable?.[mode]}>\n {(message) => <span class=\"text-muted-foreground text-xs\">{message()}</span>}\n </Show>\n </div>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n <Show when={props.alternateActionHint}>\n {(alternateActionHintSlot) => (\n <>\n <DropdownMenuSeparator />\n <p class=\"text-muted-foreground px-2 py-1 text-xs\">{alternateActionHintSlot()}</p>\n </>\n )}\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n <Show when={reason()}>\n {(message) => (\n <p id={reasonId} class=\"text-muted-foreground text-xs\">\n {message()}\n </p>\n )}\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAyBA,IAAMA,oBAAkBiB,SAAShB,eAAqB;AACtD,IAAMC,gBAAce,SAASd,WAAiB;AAC9C,IAAMC,WAASa,SAASZ,MAAY;AAkBpC,IAAMoB,QAAwB,CAAC,SAAS,OAAO;AAC/C,IAAMC,SAAS;CAAEC,OAAO;CAASC,OAAO;AAAQ;AAChD,IAAMC,eAAe;CACnBF,OAAO;CACPC,OAAO;AACT;;;;;;;;;;AAWA,SAAgBE,eAAeC,OAA4B;CACzD,MAAMC,WAAWxB,eAAe;CAChC,MAAMyB,eAAeF,MAAMR,cAAcQ,MAAMb;CAC/C,MAAMgB,gBAAiBH,MAAMb,SAAS,UAAW,YAAuB;CACxE,cAAA;EAAA,IAAAiB,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,gBAEK3B,cAAY;GAAC4B,WAAS;GAAWC,OAAO;GAAK,IAAAC,WAAA;IAAA,OAAA,CAAAH,gBAC3C5B,aAAW;KAACgC,OAAK;KAAA,IAAAD,WAAA;MAAA,OAAA,CAAAH,gBACf7B,QAAM;OACLkC,MAAI;OACJC,MAAI;OAAA,IACJV,UAAO;QAAA,OAAEA,QAAQ;OAAC;OAAA,KAAA,gBAAA;QAAA,OACNH,MAAMb,SAAS,UAAU,UAAU;OAAe;OAAA,KAAA,sBAAA;QAAA,OAC5Ce,OAAO,IAAID,WAAWa,KAAAA;OAAS;OAAA,IACjDxB,WAAQ;QAAA,OAAEU,MAAMV,YAAY,CAAC,CAACY,OAAO;OAAC;OACtCa,eAAe;QACb,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ation-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/conversation-avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAM9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC7D,IAAI,EAAE,sBAAsB,CAAA;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,CAAA;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,kCA+BhE"}
1
+ {"version":3,"file":"conversation-avatar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/conversation-avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAY9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC7D,IAAI,EAAE,sBAAsB,CAAA;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,CAAA;AAID,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,kCA+BhE"}
@@ -1,14 +1,17 @@
1
1
  import { cn } from "../../lib/utils.js";
2
+ import { fastIcon } from "../../lib/fast-icon.js";
2
3
  import { Dynamic, createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
3
4
  import { Bot, Sparkles, User } from "lucide-solid";
4
5
  import { Show, splitProps } from "solid-js";
5
6
  // src/components/conversation/conversation-avatar.tsx
6
7
  var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=conversation-avatar aria-hidden=true>`);
7
8
  var _tmpl$2 = /*#__PURE__*/ template(`<span class="grid size-4 place-items-center [&amp;_svg]:size-4">`);
9
+ var Bot$1 = fastIcon(Bot);
10
+ var Sparkles$1 = fastIcon(Sparkles);
8
11
  var GLYPHS = {
9
- user: User,
10
- agent: Bot,
11
- system: Sparkles
12
+ user: fastIcon(User),
13
+ agent: Bot$1,
14
+ system: Sparkles$1
12
15
  };
13
16
  function ConversationAvatar(props) {
14
17
  const [local, rest] = splitProps(props, [
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-avatar.js","names":["Show","splitProps","Dynamic","Bot","Sparkles","User","cn","kind","size","GLYPHS","user","agent","system","ConversationAvatar","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","children","fallback","_el$2","_tmpl$2","component","childrenSlot","_$memo"],"sources":["../../../src/components/conversation/conversation-avatar.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bot, Sparkles, User } from 'lucide-solid'\nimport { cn } from '#lib/utils'\n\n/**\n * ConversationAvatar.\n *\n * The speaker's mark in a transcript. Three kinds, and the distinction matters\n * visually: a person, an agent, and the system itself are different *voices*, and a\n * transcript where all three look alike is one the reader has to decode line by\n * line.\n *\n * The avatar is decorative — the speaker's name is in the message's accessible name\n * — so it is `aria-hidden` and carries no text of its own. A caller with a real\n * image passes it as children.\n */\nexport type ConversationAvatarKind = 'user' | 'agent' | 'system'\n\nexport type ConversationAvatarProps = ComponentProps<'span'> & {\n kind: ConversationAvatarKind\n /** Draw the mark larger, for the sender's own messages. */\n size?: 'md' | 'lg'\n}\n\nconst GLYPHS = { user: User, agent: Bot, system: Sparkles } as const\n\nexport function ConversationAvatar(props: ConversationAvatarProps) {\n const [local, rest] = splitProps(props, ['class', 'kind', 'size', 'children'])\n\n return (\n <span\n data-slot=\"conversation-avatar\"\n aria-hidden=\"true\"\n class={cn(\n 'grid shrink-0 place-items-center rounded-full border border-border',\n local.size === 'lg' ? 'size-8' : 'size-7',\n {\n 'bg-primary-subtle text-primary': local.kind === 'user',\n 'bg-card text-foreground': local.kind === 'agent',\n 'bg-muted text-muted-foreground': local.kind === 'system',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={local.children}\n fallback={\n <span class=\"grid size-4 place-items-center [&_svg]:size-4\">\n <Dynamic component={GLYPHS[local.kind]} />\n </span>\n }\n >\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;;;AA0BA,IAAMS,SAAS;CAAEC,MAAML;CAAMM,OAAOR;CAAKS,QAAQR;AAAS;AAE1D,SAAgBS,mBAAmBC,OAAgC;CACjE,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO;EAAC;EAAS;EAAQ;EAAQ;CAAU,CAAC;CAE7E,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWd,GACL,sEACAS,MAAMP,SAAS,OAAO,WAAW,UACjC;IACE,kCAAkCO,MAAMR,SAAS;IACjD,2BAA2BQ,MAAMR,SAAS;IAC1C,kCAAkCQ,MAAMR,SAAS;GACnD,GACAQ,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAM,OAAAL,MAAAM,gBAEPvB,MAAI;GAAA,IACHwB,OAAI;IAAA,OAAET,MAAMU;GAAQ;GAAA,IACpBC,WAAQ;IAAA,cAAA;KAAA,IAAAC,QAAAC,QAAA;KAAAN,OAAAK,OAAAJ,gBAEHrB,SAAO,EAAA,IAAC2B,YAAS;MAAA,OAAEpB,OAAOM,MAAMR;KAAK,EAAA,CAAA,CAAA;KAAA,OAAAoB;IAAA,EAAA,CAAA;GAAA;GAAAF,WAIxCK,iBAAYC,KAAQD,YAAY;EAAM,CAAA,CAAA;EAAA,OAAAb;CAAA,EAAA,CAAA;AAIhD"}
1
+ {"version":3,"file":"conversation-avatar.js","names":["Show","splitProps","Dynamic","Bot","LucideBot","Sparkles","LucideSparkles","User","LucideUser","cn","fastIcon","kind","size","GLYPHS","user","agent","system","ConversationAvatar","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_$createComponent","when","children","fallback","_el$2","_tmpl$2","component","childrenSlot","_$memo"],"sources":["../../../src/components/conversation/conversation-avatar.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { Bot as LucideBot, Sparkles as LucideSparkles, User as LucideUser } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Bot = fastIcon(LucideBot)\nconst Sparkles = fastIcon(LucideSparkles)\nconst User = fastIcon(LucideUser)\n\n/**\n * ConversationAvatar.\n *\n * The speaker's mark in a transcript. Three kinds, and the distinction matters\n * visually: a person, an agent, and the system itself are different *voices*, and a\n * transcript where all three look alike is one the reader has to decode line by\n * line.\n *\n * The avatar is decorative — the speaker's name is in the message's accessible name\n * — so it is `aria-hidden` and carries no text of its own. A caller with a real\n * image passes it as children.\n */\nexport type ConversationAvatarKind = 'user' | 'agent' | 'system'\n\nexport type ConversationAvatarProps = ComponentProps<'span'> & {\n kind: ConversationAvatarKind\n /** Draw the mark larger, for the sender's own messages. */\n size?: 'md' | 'lg'\n}\n\nconst GLYPHS = { user: User, agent: Bot, system: Sparkles } as const\n\nexport function ConversationAvatar(props: ConversationAvatarProps) {\n const [local, rest] = splitProps(props, ['class', 'kind', 'size', 'children'])\n\n return (\n <span\n data-slot=\"conversation-avatar\"\n aria-hidden=\"true\"\n class={cn(\n 'grid shrink-0 place-items-center rounded-full border border-border',\n local.size === 'lg' ? 'size-8' : 'size-7',\n {\n 'bg-primary-subtle text-primary': local.kind === 'user',\n 'bg-card text-foreground': local.kind === 'agent',\n 'bg-muted text-muted-foreground': local.kind === 'system',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={local.children}\n fallback={\n <span class=\"grid size-4 place-items-center [&_svg]:size-4\">\n <Dynamic component={GLYPHS[local.kind]} />\n </span>\n }\n >\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n </span>\n )\n}\n"],"mappings":";;;;;;;;AAQA,IAAMG,QAAMO,SAASN,GAAS;AAC9B,IAAMC,aAAWK,SAASJ,QAAc;AAuBxC,IAAMO,SAAS;CAAEC,MAtBJJ,SAASF,IAsBCD;CAAMQ,OAAOZ;CAAKa,QAAQX;AAAS;AAE1D,SAAgBY,mBAAmBC,OAAgC;CACjE,MAAM,CAACC,OAAOC,QAAQnB,WAAWiB,OAAO;EAAC;EAAS;EAAQ;EAAQ;CAAU,CAAC;CAE7E,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWf,GACL,sEACAU,MAAMP,SAAS,OAAO,WAAW,UACjC;IACE,kCAAkCO,MAAMR,SAAS;IACjD,2BAA2BQ,MAAMR,SAAS;IAC1C,kCAAkCQ,MAAMR,SAAS;GACnD,GACAQ,MAAMM,KACR;EAAC,EAAA,GACGL,IAAI,GAAA,OAAA,IAAA;EAAAM,OAAAL,MAAAM,gBAEP3B,MAAI;GAAA,IACH4B,OAAI;IAAA,OAAET,MAAMU;GAAQ;GAAA,IACpBC,WAAQ;IAAA,cAAA;KAAA,IAAAC,QAAAC,QAAA;KAAAN,OAAAK,OAAAJ,gBAEHzB,SAAO,EAAA,IAAC+B,YAAS;MAAA,OAAEpB,OAAOM,MAAMR;KAAK,EAAA,CAAA,CAAA;KAAA,OAAAoB;IAAA,EAAA,CAAA;GAAA;GAAAF,WAIxCK,iBAAYC,KAAQD,YAAY;EAAM,CAAA,CAAA;EAAA,OAAAb;CAAA,EAAA,CAAA;AAIhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-surface.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/conversation-surface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAGpF,YAAY,EAAE,2BAA2B,EAAE,CAAA;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7D,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sFAAsF;IACtF,sBAAsB,CAAC,EAAE,2BAA2B,CAAA;IACpD,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAA;IACzE,iEAAiE;IACjE,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,iFAAiF;IACjF,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC/C;;;;OAIG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CACjC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eAmFlE"}
1
+ {"version":3,"file":"conversation-surface.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/conversation-surface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAOpF,YAAY,EAAE,2BAA2B,EAAE,CAAA;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7D,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sFAAsF;IACtF,sBAAsB,CAAC,EAAE,2BAA2B,CAAA;IACpD,kFAAkF;IAClF,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAA;IACzE,iEAAiE;IACjE,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,iFAAiF;IACjF,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC/C;;;;OAIG;IACH,UAAU,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CACjC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eAmFlE"}
@@ -2,6 +2,7 @@ import { callHandler } from "../../lib/events.js";
2
2
  import { cn } from "../../lib/utils.js";
3
3
  import { Button } from "../ui/button/button.js";
4
4
  import { createScrollFollow } from "./scroll-follow.js";
5
+ import { fastIcon } from "../../lib/fast-icon.js";
5
6
  import { className, createComponent, effect, insert, memo, mergeProps, spread, template, use } from "solid-js/web";
6
7
  import { ArrowDown } from "lucide-solid";
7
8
  import { Show, splitProps } from "solid-js";
@@ -9,6 +10,7 @@ import { Show, splitProps } from "solid-js";
9
10
  var _tmpl$ = /*#__PURE__*/ template(`<div class="pointer-events-none absolute inset-x-0 bottom-3 flex justify-center">`);
10
11
  var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=conversation-surface><div><div data-slot=conversation-content>`);
11
12
  var _tmpl$3 = /*#__PURE__*/ template(`<div class=p-4>`);
13
+ var ArrowDown$1 = fastIcon(ArrowDown);
12
14
  function ConversationSurface(props) {
13
15
  const [local, rest] = splitProps(props, [
14
16
  "class",
@@ -92,7 +94,7 @@ function ConversationSurface(props) {
92
94
  return follow.jump;
93
95
  },
94
96
  get children() {
95
- return [createComponent(ArrowDown, {}), "Jump to latest"];
97
+ return [createComponent(ArrowDown$1, {}), "Jump to latest"];
96
98
  }
97
99
  }));
98
100
  return _el$4;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-surface.js","names":["ArrowDown","Show","splitProps","callHandler","cn","Button","createScrollFollow","threshold","follow","resetKey","initialReadingPosition","onReadingPositionChange","position","empty","header","gutter","onFollowHold","hold","contentRef","ConversationSurface","props","local","rest","enabled","initialPosition","onPositionChange","onScroll","event","_el$","_tmpl$2","_el$2","firstChild","_el$3","addEventListener","_$use","element","bindScroller","ref","_$spread","_$mergeProps","tabindex","class","bindContent","_$insert","_$createComponent","when","children","headerSlot","_$memo","fallback","_el$5","_tmpl$3","childrenSlot","atBottom","_el$4","_tmpl$","type","size","variant","onClick","jump","_$effect","_$className"],"sources":["../../../src/components/conversation/conversation-surface.tsx"],"sourcesContent":["import { ArrowDown } from 'lucide-solid'\nimport type { ComponentProps, JSX, Ref } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button'\nimport { createScrollFollow } from './scroll-follow'\nimport type { ConversationReadingPosition, ScrollFollowHold } from './scroll-follow'\nimport { DEFAULT_BOTTOM_THRESHOLD } from './scroll-follow-core'\n\nexport type { ConversationReadingPosition }\n\n/**\n * ConversationSurface.\n *\n * The scrolling transcript. Its job is small and it is the difference between a\n * transcript that stays readable as it grows and one that fights the reader:\n *\n * - **Stick to the bottom.** New messages scroll into view only when the reader is\n * already at the bottom. Someone reading back through history must not be yanked\n * to the end by an arriving message, and that is the single most common way a\n * chat surface is made unusable.\n * - **Offer a way back.** Once the reader is not at the bottom, a control appears\n * that returns them. Pixel distance cannot prove an unread message count.\n * - **`overscroll-contain`.** The transcript scrolls to its end and stops, rather\n * than dragging the pane behind it — which in a desktop shell means the whole\n * window moves.\n */\nexport type ConversationSurfaceProps = ComponentProps<'div'> & {\n /** How far from the bottom still counts as \"at the bottom\", in px. */\n threshold?: number\n /** Disable automatic positioning while the host owns scroll restoration. */\n follow?: boolean\n /** Optional conversation identity: changing it re-arms follow at the bottom. */\n resetKey?: string\n /** Host snapshot consumed on mount/identity reset, never on ordinary prop updates. */\n initialReadingPosition?: ConversationReadingPosition\n /** Actual follow intent and native offset; storage/identity remain host-owned. */\n onReadingPositionChange?: (position: ConversationReadingPosition) => void\n /** Rendered above the transcript when there is nothing in it. */\n empty?: JSX.Element\n /** A header that scrolls with the transcript, e.g. a day divider or a banner. */\n header?: JSX.Element\n /**\n * The shared page gutter: reading padding inside the scroller plus a stable\n * gutter, so the scrollbar never shifts the text when it appears. The page\n * frame around the surface is `ConversationPane`'s job.\n */\n gutter?: boolean\n /**\n * Receives the surface's `hold`, once, when it is created. A host that moves content\n * under a reader who is following (a history load that lands after the conversation\n * changed) opens a hold around it, so the move is not read as the reader scrolling away.\n */\n onFollowHold?: (hold: ScrollFollowHold) => void\n /**\n * The element that wraps the transcript's rows (header included). A host that\n * keeps the reader's place across an insert observes its size, because rows that\n * size themselves late move the reader without adding or removing a node.\n */\n contentRef?: Ref<HTMLDivElement>\n}\n\nexport function ConversationSurface(props: ConversationSurfaceProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'threshold',\n 'follow',\n 'resetKey',\n 'initialReadingPosition',\n 'onReadingPositionChange',\n 'empty',\n 'header',\n 'gutter',\n 'onFollowHold',\n 'contentRef',\n 'children',\n 'onScroll',\n 'ref',\n 'tabindex',\n ])\n // Kobalte provides the control's semantics; transcript follow is a native\n // geometry contract. KiroCrew's plain-scroller controller handles streaming,\n // content collapse and pane resizing without treating them as user consent.\n const follow = createScrollFollow({\n enabled: () => local.follow !== false,\n resetKey: () => local.resetKey,\n threshold: () => local.threshold ?? DEFAULT_BOTTOM_THRESHOLD,\n initialPosition: () => local.initialReadingPosition,\n onPositionChange: (position) => local.onReadingPositionChange?.(position),\n })\n local.onFollowHold?.(follow.hold)\n const onScroll: JSX.EventHandlerUnion<HTMLDivElement, Event> = (event) => {\n follow.onScroll()\n callHandler(local.onScroll, event)\n }\n\n return (\n <div\n data-slot=\"conversation-surface\"\n class={cn('relative flex min-h-0 flex-1 flex-col', local.class)}\n >\n <div\n ref={(element) => {\n follow.bindScroller(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onScroll={onScroll}\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'min-h-0 flex-1 overflow-y-auto overscroll-contain',\n local.gutter &&\n 'px-[clamp(0.8rem,3vw,2.5rem)] pt-[1.35rem] pb-[1.1rem] [scrollbar-gutter:stable] max-[30rem]:px-2'\n )}\n {...rest}\n >\n <div\n ref={(element) => {\n follow.bindContent(element)\n if (typeof local.contentRef === 'function') local.contentRef(element)\n }}\n data-slot=\"conversation-content\"\n >\n <Show when={local.header}>{(headerSlot) => <>{headerSlot()}</>}</Show>\n <Show when={local.children} fallback={<div class=\"p-4\">{local.empty}</div>}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n </div>\n </div>\n\n <Show when={!follow.atBottom()}>\n <div class=\"pointer-events-none absolute inset-x-0 bottom-3 flex justify-center\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"secondary\"\n class=\"pointer-events-auto gap-1.5 shadow-md\"\n onClick={follow.jump}\n >\n <ArrowDown />\n Jump to latest\n </Button>\n </div>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;AA+DA,SAAgBmB,oBAAoBC,OAAiC;CACnE,MAAM,CAACC,OAAOC,QAAQp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;GAAQ;GAAA,IAAEG,WAAQ;IAAA,cAAA;KAAA,IAAAC,QAAAC,QAAA;KAAAR,OAAAO,aAAoB7B,MAAMR,KAAK;KAAA,OAAAqC;IAAA,EAAA,CAAA;GAAA;GAAAJ,WAC/DM,iBAAYJ,KAAQI,YAAY;EAAM,CAAA,GAAA,IAAA;EAAAT,OAAAf,MAAAgB,gBAK7C3C,MAAI;GAAA,IAAC4C,OAAI;IAAA,OAAE,CAACrC,OAAO6C,SAAS;GAAC;GAAA,IAAAP,WAAA;IAAA,IAAAQ,QAAAC,OAAA;IAAAZ,OAAAW,OAAAV,gBAEzBvC,QAAM;KACLmD,MAAI;KACJC,MAAI;KACJC,SAAO;KAAA,SAAA;KAAA,IAEPC,UAAO;MAAA,OAAEnD,OAAOoD;KAAI;KAAA,IAAAd,WAAA;MAAA,OAAA,CAAAF,gBAEnB5C,WAAS,CAAA,CAAA,GAAA,gBAAA;KAAA;IAAA,CAAA,CAAA;IAAA,OAAAsD;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAO,aAAAC,UAAAlC,MAvCTxB,GAAG,yCAAyCiB,MAAMoB,KAAK,CAAC,CAAA;EAAA,OAAAb;CAAA,EAAA,CAAA;AA8CrE"}
1
+ {"version":3,"file":"conversation-surface.js","names":["ArrowDown","LucideArrowDown","Show","splitProps","callHandler","cn","Button","createScrollFollow","fastIcon","threshold","follow","resetKey","initialReadingPosition","onReadingPositionChange","position","empty","header","gutter","onFollowHold","hold","contentRef","ConversationSurface","props","local","rest","enabled","initialPosition","onPositionChange","onScroll","event","_el$","_tmpl$2","_el$2","firstChild","_el$3","addEventListener","_$use","element","bindScroller","ref","_$spread","_$mergeProps","tabindex","class","bindContent","_$insert","_$createComponent","when","children","headerSlot","_$memo","fallback","_el$5","_tmpl$3","childrenSlot","atBottom","_el$4","_tmpl$","type","size","variant","onClick","jump","_$effect","_$className"],"sources":["../../../src/components/conversation/conversation-surface.tsx"],"sourcesContent":["import { ArrowDown as LucideArrowDown } from 'lucide-solid'\nimport type { ComponentProps, JSX, Ref } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button'\nimport { createScrollFollow } from './scroll-follow'\nimport type { ConversationReadingPosition, ScrollFollowHold } from './scroll-follow'\nimport { DEFAULT_BOTTOM_THRESHOLD } from './scroll-follow-core'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ArrowDown = fastIcon(LucideArrowDown)\n\nexport type { ConversationReadingPosition }\n\n/**\n * ConversationSurface.\n *\n * The scrolling transcript. Its job is small and it is the difference between a\n * transcript that stays readable as it grows and one that fights the reader:\n *\n * - **Stick to the bottom.** New messages scroll into view only when the reader is\n * already at the bottom. Someone reading back through history must not be yanked\n * to the end by an arriving message, and that is the single most common way a\n * chat surface is made unusable.\n * - **Offer a way back.** Once the reader is not at the bottom, a control appears\n * that returns them. Pixel distance cannot prove an unread message count.\n * - **`overscroll-contain`.** The transcript scrolls to its end and stops, rather\n * than dragging the pane behind it — which in a desktop shell means the whole\n * window moves.\n */\nexport type ConversationSurfaceProps = ComponentProps<'div'> & {\n /** How far from the bottom still counts as \"at the bottom\", in px. */\n threshold?: number\n /** Disable automatic positioning while the host owns scroll restoration. */\n follow?: boolean\n /** Optional conversation identity: changing it re-arms follow at the bottom. */\n resetKey?: string\n /** Host snapshot consumed on mount/identity reset, never on ordinary prop updates. */\n initialReadingPosition?: ConversationReadingPosition\n /** Actual follow intent and native offset; storage/identity remain host-owned. */\n onReadingPositionChange?: (position: ConversationReadingPosition) => void\n /** Rendered above the transcript when there is nothing in it. */\n empty?: JSX.Element\n /** A header that scrolls with the transcript, e.g. a day divider or a banner. */\n header?: JSX.Element\n /**\n * The shared page gutter: reading padding inside the scroller plus a stable\n * gutter, so the scrollbar never shifts the text when it appears. The page\n * frame around the surface is `ConversationPane`'s job.\n */\n gutter?: boolean\n /**\n * Receives the surface's `hold`, once, when it is created. A host that moves content\n * under a reader who is following (a history load that lands after the conversation\n * changed) opens a hold around it, so the move is not read as the reader scrolling away.\n */\n onFollowHold?: (hold: ScrollFollowHold) => void\n /**\n * The element that wraps the transcript's rows (header included). A host that\n * keeps the reader's place across an insert observes its size, because rows that\n * size themselves late move the reader without adding or removing a node.\n */\n contentRef?: Ref<HTMLDivElement>\n}\n\nexport function ConversationSurface(props: ConversationSurfaceProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'threshold',\n 'follow',\n 'resetKey',\n 'initialReadingPosition',\n 'onReadingPositionChange',\n 'empty',\n 'header',\n 'gutter',\n 'onFollowHold',\n 'contentRef',\n 'children',\n 'onScroll',\n 'ref',\n 'tabindex',\n ])\n // Kobalte provides the control's semantics; transcript follow is a native\n // geometry contract. KiroCrew's plain-scroller controller handles streaming,\n // content collapse and pane resizing without treating them as user consent.\n const follow = createScrollFollow({\n enabled: () => local.follow !== false,\n resetKey: () => local.resetKey,\n threshold: () => local.threshold ?? DEFAULT_BOTTOM_THRESHOLD,\n initialPosition: () => local.initialReadingPosition,\n onPositionChange: (position) => local.onReadingPositionChange?.(position),\n })\n local.onFollowHold?.(follow.hold)\n const onScroll: JSX.EventHandlerUnion<HTMLDivElement, Event> = (event) => {\n follow.onScroll()\n callHandler(local.onScroll, event)\n }\n\n return (\n <div\n data-slot=\"conversation-surface\"\n class={cn('relative flex min-h-0 flex-1 flex-col', local.class)}\n >\n <div\n ref={(element) => {\n follow.bindScroller(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onScroll={onScroll}\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'min-h-0 flex-1 overflow-y-auto overscroll-contain',\n local.gutter &&\n 'px-[clamp(0.8rem,3vw,2.5rem)] pt-[1.35rem] pb-[1.1rem] [scrollbar-gutter:stable] max-[30rem]:px-2'\n )}\n {...rest}\n >\n <div\n ref={(element) => {\n follow.bindContent(element)\n if (typeof local.contentRef === 'function') local.contentRef(element)\n }}\n data-slot=\"conversation-content\"\n >\n <Show when={local.header}>{(headerSlot) => <>{headerSlot()}</>}</Show>\n <Show when={local.children} fallback={<div class=\"p-4\">{local.empty}</div>}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n </div>\n </div>\n\n <Show when={!follow.atBottom()}>\n <div class=\"pointer-events-none absolute inset-x-0 bottom-3 flex justify-center\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"secondary\"\n class=\"pointer-events-auto gap-1.5 shadow-md\"\n onClick={follow.jump}\n >\n <ArrowDown />\n Jump to latest\n </Button>\n </div>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAMA,cAAYQ,SAASP,SAAe;AAuD1C,SAAgBoB,oBAAoBC,OAAiC;CACnE,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAID,MAAMZ,SAASH,mBAAmB;EAChCkB,eAAeF,MAAMb,WAAW;EAChCC,gBAAgBY,MAAMZ;EACtBF,iBAAiBc,MAAMd,aAAAA;EACvBiB,uBAAuBH,MAAMX;EAC7Be,mBAAmBb,aAAaS,MAAMV,0BAA0BC,QAAQ;CAC1E,CAAC;CACDS,MAAML,eAAeR,OAAOS,IAAI;CAChC,MAAMS,YAA0DC,UAAU;EACxEnB,OAAOkB,SAAS;EAChBxB,YAAYmB,MAAMK,UAAUC,KAAK;CACnC;CAEA,cAAA;EAAA,IAAAC,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC;EAAAD,MAAAG,iBAAA,UAUgBP,QAAQ;EAAAQ,KAJZC,YAAY;GAChB3B,OAAO4B,aAAaD,OAAO;GAC3B,IAAI,OAAOd,MAAMgB,QAAQ,YAAYhB,MAAMgB,IAAIF,OAAO;EACxD,GAACL,KAAA;EAAAQ,OAAAR,OAAAS,WAAA;GAAA,IAEDC,WAAQ;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;IAC5E,iBAAiB,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,KAAK,CAAA;IAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,GAAG,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1E,WAAW,EAAE,CAAC,KAAK,EAAE,4BAA4B,KAAK,GAAG,CAAC,OAAO,CAAA;CAClE,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,MAAM,EAAE,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,eAyU3F"}
@@ -3,6 +3,7 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigge
3
3
  import { Spinner } from "../../ui/spinner/spinner.js";
4
4
  import { BusySendButton } from "../busy-send-button.js";
5
5
  import { createComposerCore } from "../composer-core.js";
6
+ import { fastIcon } from "../../../lib/fast-icon.js";
6
7
  import { createComponent, insert, memo, mergeProps, template, use } from "solid-js/web";
7
8
  import { ArrowUp, ChevronsDownUp, ChevronsUpDown, MoreHorizontal } from "lucide-solid";
8
9
  import { Show, createEffect, on, onCleanup, onMount } from "solid-js";
@@ -21,6 +22,10 @@ var _tmpl$1 = /*#__PURE__*/ template(`<span aria-hidden=true class=shrink-0>Show
21
22
  var _tmpl$10 = /*#__PURE__*/ template(`<span aria-hidden=true class="min-w-0 flex-1 truncate">`);
22
23
  var _tmpl$11 = /*#__PURE__*/ template(`<div data-slot=composer-staged-content>`);
23
24
  var _tmpl$12 = /*#__PURE__*/ template(`<div data-slot=composer-context class="flex min-w-0 items-center gap-2 pt-1">`);
25
+ var ChevronsDownUp$1 = fastIcon(ChevronsDownUp);
26
+ var ChevronsUpDown$1 = fastIcon(ChevronsUpDown);
27
+ var MoreHorizontal$1 = fastIcon(MoreHorizontal);
28
+ var ArrowUp$1 = fastIcon(ArrowUp);
24
29
  /**
25
30
  * Kiro's composer assembly: context/options, adjacent band, approval/notices,
26
31
  * staged content, input/action groups and a context shelf. Reading collapse
@@ -249,7 +254,7 @@ function ChatComposerShell(props) {
249
254
  onClick: () => changeCollapsed(false),
250
255
  get children() {
251
256
  return [
252
- createComponent(ChevronsUpDown, {}),
257
+ createComponent(ChevronsUpDown$1, {}),
253
258
  _tmpl$1(),
254
259
  " ",
255
260
  createComponent(Show, {
@@ -322,7 +327,7 @@ function ChatComposerShell(props) {
322
327
  size: "icon-sm",
323
328
  "aria-label": "Message input options",
324
329
  get children() {
325
- return createComponent(MoreHorizontal, {});
330
+ return createComponent(MoreHorizontal$1, {});
326
331
  }
327
332
  }), createComponent(DropdownMenuContent, {
328
333
  onCloseAutoFocus: (event) => {
@@ -337,7 +342,7 @@ function ChatComposerShell(props) {
337
342
  return createComponent(DropdownMenuItem, {
338
343
  onSelect: () => changeCollapsed(true),
339
344
  get children() {
340
- return [createComponent(ChevronsDownUp, {}), _tmpl$()];
345
+ return [createComponent(ChevronsDownUp$1, {}), _tmpl$()];
341
346
  }
342
347
  });
343
348
  }
@@ -370,7 +375,7 @@ function ChatComposerShell(props) {
370
375
  return pending();
371
376
  },
372
377
  get fallback() {
373
- return createComponent(ArrowUp, {});
378
+ return createComponent(ArrowUp$1, {});
374
379
  },
375
380
  get children() {
376
381
  return createComponent(Spinner, {