@kumix/ui 0.3.12 → 0.3.13

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 (530) hide show
  1. package/README.md +1 -1
  2. package/dist/components/agents/agent-activity/activity-row.js +2 -2
  3. package/dist/components/agents/agent-activity/activity-row.js.map +1 -1
  4. package/dist/components/agents/agent-activity/index.js +2 -2
  5. package/dist/components/agents/agent-activity/index.js.map +1 -1
  6. package/dist/components/agents/agent-code.d.ts.map +1 -1
  7. package/dist/components/agents/agent-code.js +2 -2
  8. package/dist/components/agents/agent-code.js.map +1 -1
  9. package/dist/components/agents/agent-disclosure.js +1 -1
  10. package/dist/components/agents/agent-disclosure.js.map +1 -1
  11. package/dist/components/agents/ai-sidebar.js +2 -2
  12. package/dist/components/agents/ai-sidebar.js.map +1 -1
  13. package/dist/components/agents/approval-card/index.js +2 -2
  14. package/dist/components/agents/approval-card/index.js.map +1 -1
  15. package/dist/components/agents/chat-app.js +1 -1
  16. package/dist/components/agents/chat-app.js.map +1 -1
  17. package/dist/components/agents/citations.js +2 -2
  18. package/dist/components/agents/citations.js.map +1 -1
  19. package/dist/components/agents/code-block.js +2 -2
  20. package/dist/components/agents/code-block.js.map +1 -1
  21. package/dist/components/agents/file-diff.js +2 -2
  22. package/dist/components/agents/file-diff.js.map +1 -1
  23. package/dist/components/agents/image-generation.js +2 -2
  24. package/dist/components/agents/image-generation.js.map +1 -1
  25. package/dist/components/agents/loading-states/agent-progress.js +1 -1
  26. package/dist/components/agents/loading-states/agent-progress.js.map +1 -1
  27. package/dist/components/agents/loading-states/reasoning-text.js +1 -1
  28. package/dist/components/agents/loading-states/reasoning-text.js.map +1 -1
  29. package/dist/components/agents/loading-states/thinking-shimmer.js +1 -1
  30. package/dist/components/agents/loading-states/thinking-shimmer.js.map +1 -1
  31. package/dist/components/agents/message-bubble.js +2 -2
  32. package/dist/components/agents/message-bubble.js.map +1 -1
  33. package/dist/components/agents/message-scroller.js +1 -1
  34. package/dist/components/agents/message-scroller.js.map +1 -1
  35. package/dist/components/agents/message.js +1 -1
  36. package/dist/components/agents/message.js.map +1 -1
  37. package/dist/components/agents/prompt-input.js +2 -2
  38. package/dist/components/agents/prompt-input.js.map +1 -1
  39. package/dist/components/agents/streaming-response.js +2 -2
  40. package/dist/components/agents/streaming-response.js.map +1 -1
  41. package/dist/components/agents/todo-list.js +2 -2
  42. package/dist/components/agents/todo-list.js.map +1 -1
  43. package/dist/components/agents/tool-approval.js +2 -2
  44. package/dist/components/agents/tool-approval.js.map +1 -1
  45. package/dist/components/agents/tool-result.js +2 -2
  46. package/dist/components/agents/tool-result.js.map +1 -1
  47. package/dist/components/custom/confirm-dialog.js +1 -1
  48. package/dist/components/motion/action-swap.js +1 -1
  49. package/dist/components/motion/action-swap.js.map +1 -1
  50. package/dist/components/motion/adaptive-stepper.js +2 -2
  51. package/dist/components/motion/adaptive-stepper.js.map +1 -1
  52. package/dist/components/motion/animated-badge.js +2 -2
  53. package/dist/components/motion/animated-badge.js.map +1 -1
  54. package/dist/components/motion/animated-number.js +1 -1
  55. package/dist/components/motion/animated-number.js.map +1 -1
  56. package/dist/components/motion/animated-sidebar.js +2 -2
  57. package/dist/components/motion/animated-sidebar.js.map +1 -1
  58. package/dist/components/motion/animated-toast-stack.js +2 -2
  59. package/dist/components/motion/animated-toast-stack.js.map +1 -1
  60. package/dist/components/motion/attachment-upload.js +2 -2
  61. package/dist/components/motion/attachment-upload.js.map +1 -1
  62. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  63. package/dist/components/motion/availability-scheduler/day-row.js +2 -2
  64. package/dist/components/motion/availability-scheduler/icon-button.js +1 -1
  65. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -1
  66. package/dist/components/motion/availability-scheduler/index.js +2 -2
  67. package/dist/components/motion/availability-scheduler/index.js.map +1 -1
  68. package/dist/components/motion/bloom-menu.js +2 -2
  69. package/dist/components/motion/bloom-menu.js.map +1 -1
  70. package/dist/components/motion/bottom-sheet.js +1 -1
  71. package/dist/components/motion/bottom-sheet.js.map +1 -1
  72. package/dist/components/motion/bounce-sidebar.d.ts.map +1 -1
  73. package/dist/components/motion/bounce-sidebar.js +1 -1
  74. package/dist/components/motion/bounce-sidebar.js.map +1 -1
  75. package/dist/components/motion/bouncy-accordion.js +2 -2
  76. package/dist/components/motion/bouncy-accordion.js.map +1 -1
  77. package/dist/components/motion/button/base.js +1 -1
  78. package/dist/components/motion/button/base.js.map +1 -1
  79. package/dist/components/motion/button/metallic.js +1 -1
  80. package/dist/components/motion/button/metallic.js.map +1 -1
  81. package/dist/components/motion/button/stateful.js +1 -1
  82. package/dist/components/motion/card-folder.d.ts +30 -0
  83. package/dist/components/motion/card-folder.d.ts.map +1 -0
  84. package/dist/components/motion/card-folder.js +254 -0
  85. package/dist/components/motion/card-folder.js.map +1 -0
  86. package/dist/components/motion/center-morph-modal.js +2 -2
  87. package/dist/components/motion/center-morph-modal.js.map +1 -1
  88. package/dist/components/motion/checkbox.js +1 -1
  89. package/dist/components/motion/checkbox.js.map +1 -1
  90. package/dist/components/motion/chromatic-text-reveal.js +1 -1
  91. package/dist/components/motion/chromatic-text-reveal.js.map +1 -1
  92. package/dist/components/motion/combobox/content.js +1 -1
  93. package/dist/components/motion/combobox/content.js.map +1 -1
  94. package/dist/components/motion/combobox/context.js +1 -1
  95. package/dist/components/motion/combobox/context.js.map +1 -1
  96. package/dist/components/motion/combobox/list.js +2 -2
  97. package/dist/components/motion/combobox/list.js.map +1 -1
  98. package/dist/components/motion/combobox/trigger.js +2 -2
  99. package/dist/components/motion/combobox/trigger.js.map +1 -1
  100. package/dist/components/motion/command-palette.js +2 -2
  101. package/dist/components/motion/command-palette.js.map +1 -1
  102. package/dist/components/motion/context-menu.js +2 -2
  103. package/dist/components/motion/context-menu.js.map +1 -1
  104. package/dist/components/motion/cylinder-carousel.js +1 -1
  105. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  106. package/dist/components/motion/digit-swap.d.ts +23 -0
  107. package/dist/components/motion/digit-swap.d.ts.map +1 -0
  108. package/dist/components/motion/digit-swap.js +77 -0
  109. package/dist/components/motion/digit-swap.js.map +1 -0
  110. package/dist/components/motion/dock.js +1 -1
  111. package/dist/components/motion/dock.js.map +1 -1
  112. package/dist/components/motion/drawer.js +1 -1
  113. package/dist/components/motion/drawer.js.map +1 -1
  114. package/dist/components/motion/dynamic-island.js +1 -1
  115. package/dist/components/motion/dynamic-island.js.map +1 -1
  116. package/dist/components/motion/expandable-action-bar.js +1 -1
  117. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  118. package/dist/components/motion/expandable-control.d.ts.map +1 -1
  119. package/dist/components/motion/expandable-control.js +1 -1
  120. package/dist/components/motion/expandable-control.js.map +1 -1
  121. package/dist/components/motion/expandable-tabs.js +1 -1
  122. package/dist/components/motion/expandable-tabs.js.map +1 -1
  123. package/dist/components/motion/expanding-arrow-button.js +1 -1
  124. package/dist/components/motion/expanding-arrow-button.js.map +1 -1
  125. package/dist/components/motion/feedback-widget.js +2 -2
  126. package/dist/components/motion/feedback-widget.js.map +1 -1
  127. package/dist/components/motion/file-tree.js +2 -2
  128. package/dist/components/motion/file-tree.js.map +1 -1
  129. package/dist/components/motion/file-upload.js +2 -2
  130. package/dist/components/motion/file-upload.js.map +1 -1
  131. package/dist/components/motion/hold-action-button.js +1 -1
  132. package/dist/components/motion/hold-action-button.js.map +1 -1
  133. package/dist/components/motion/infinite-masonry.js +2 -2
  134. package/dist/components/motion/infinite-masonry.js.map +1 -1
  135. package/dist/components/motion/input.d.ts.map +1 -1
  136. package/dist/components/motion/input.js +1 -1
  137. package/dist/components/motion/input.js.map +1 -1
  138. package/dist/components/motion/liquid.js +1 -1
  139. package/dist/components/motion/liquid.js.map +1 -1
  140. package/dist/components/motion/loader.js +1 -1
  141. package/dist/components/motion/loader.js.map +1 -1
  142. package/dist/components/motion/magnetic.js +1 -1
  143. package/dist/components/motion/magnetic.js.map +1 -1
  144. package/dist/components/motion/marquee.d.ts.map +1 -1
  145. package/dist/components/motion/marquee.js +1 -1
  146. package/dist/components/motion/marquee.js.map +1 -1
  147. package/dist/components/motion/morphing-modal.js +1 -1
  148. package/dist/components/motion/morphing-modal.js.map +1 -1
  149. package/dist/components/motion/morphing-search.js +2 -2
  150. package/dist/components/motion/morphing-search.js.map +1 -1
  151. package/dist/components/motion/morphing-tabs.js +2 -2
  152. package/dist/components/motion/morphing-tabs.js.map +1 -1
  153. package/dist/components/motion/multi-select/content.js +1 -1
  154. package/dist/components/motion/multi-select/content.js.map +1 -1
  155. package/dist/components/motion/multi-select/context.js +1 -1
  156. package/dist/components/motion/multi-select/context.js.map +1 -1
  157. package/dist/components/motion/multi-select/list.js +2 -2
  158. package/dist/components/motion/multi-select/list.js.map +1 -1
  159. package/dist/components/motion/multi-select/trigger.js +2 -2
  160. package/dist/components/motion/multi-select/trigger.js.map +1 -1
  161. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -1
  162. package/dist/components/motion/not-found/magnetic.js +1 -1
  163. package/dist/components/motion/not-found/magnetic.js.map +1 -1
  164. package/dist/components/motion/not-found/shared.js +1 -1
  165. package/dist/components/motion/not-found/shared.js.map +1 -1
  166. package/dist/components/motion/not-found/spotlight.js +1 -1
  167. package/dist/components/motion/not-found/spotlight.js.map +1 -1
  168. package/dist/components/motion/notification-stack.js +2 -2
  169. package/dist/components/motion/notification-stack.js.map +1 -1
  170. package/dist/components/motion/number-ticker.js +1 -1
  171. package/dist/components/motion/number-ticker.js.map +1 -1
  172. package/dist/components/motion/otp-input.js +1 -1
  173. package/dist/components/motion/otp-input.js.map +1 -1
  174. package/dist/components/motion/overflow-actions.js +2 -2
  175. package/dist/components/motion/overflow-actions.js.map +1 -1
  176. package/dist/components/motion/parallax.d.ts.map +1 -1
  177. package/dist/components/motion/parallax.js +1 -1
  178. package/dist/components/motion/parallax.js.map +1 -1
  179. package/dist/components/motion/popover-morph.js +1 -1
  180. package/dist/components/motion/popover-morph.js.map +1 -1
  181. package/dist/components/motion/popover.js +1 -1
  182. package/dist/components/motion/popover.js.map +1 -1
  183. package/dist/components/motion/preview-rail.js +1 -1
  184. package/dist/components/motion/preview-rail.js.map +1 -1
  185. package/dist/components/motion/project-folder.js +2 -2
  186. package/dist/components/motion/project-folder.js.map +1 -1
  187. package/dist/components/motion/pull-to-refresh.js +1 -1
  188. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  189. package/dist/components/motion/radio.js +1 -1
  190. package/dist/components/motion/radio.js.map +1 -1
  191. package/dist/components/motion/range-slider-bubble.js +1 -1
  192. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  193. package/dist/components/motion/range-slider-fluid.js +1 -1
  194. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  195. package/dist/components/motion/range-slider-ruler.js +1 -1
  196. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  197. package/dist/components/motion/range-slider-wave.js +1 -1
  198. package/dist/components/motion/range-slider-wave.js.map +1 -1
  199. package/dist/components/motion/range-slider.js +1 -1
  200. package/dist/components/motion/range-slider.js.map +1 -1
  201. package/dist/components/motion/scroll-progress.js +1 -1
  202. package/dist/components/motion/scroll-progress.js.map +1 -1
  203. package/dist/components/motion/scroll-reveal.js +1 -1
  204. package/dist/components/motion/scroll-reveal.js.map +1 -1
  205. package/dist/components/motion/scroll-to.js +1 -1
  206. package/dist/components/motion/scroll-to.js.map +1 -1
  207. package/dist/components/motion/select-morph.d.ts.map +1 -1
  208. package/dist/components/motion/select-morph.js +2 -2
  209. package/dist/components/motion/select-morph.js.map +1 -1
  210. package/dist/components/motion/select.js +2 -2
  211. package/dist/components/motion/select.js.map +1 -1
  212. package/dist/components/motion/shader-background.d.ts.map +1 -1
  213. package/dist/components/motion/shader-background.js +1 -1
  214. package/dist/components/motion/shader-background.js.map +1 -1
  215. package/dist/components/motion/shared-layout-bg.js +1 -1
  216. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  217. package/dist/components/motion/signup-form.js +2 -2
  218. package/dist/components/motion/signup-form.js.map +1 -1
  219. package/dist/components/motion/slide-action-button.js +1 -1
  220. package/dist/components/motion/slide-action-button.js.map +1 -1
  221. package/dist/components/motion/swipeable-list.js +1 -1
  222. package/dist/components/motion/swipeable-list.js.map +1 -1
  223. package/dist/components/motion/switch.d.ts.map +1 -1
  224. package/dist/components/motion/switch.js +1 -1
  225. package/dist/components/motion/switch.js.map +1 -1
  226. package/dist/components/motion/table/index.js +1 -1
  227. package/dist/components/motion/table/index.js.map +1 -1
  228. package/dist/components/motion/table/row-handle.js +1 -1
  229. package/dist/components/motion/table/skeleton-rows.d.ts.map +1 -1
  230. package/dist/components/motion/table/skeleton-rows.js +1 -1
  231. package/dist/components/motion/table/skeleton-rows.js.map +1 -1
  232. package/dist/components/motion/table/table-header.js +2 -2
  233. package/dist/components/motion/table/table-header.js.map +1 -1
  234. package/dist/components/motion/table/table-menu.js +1 -1
  235. package/dist/components/motion/table/table-menu.js.map +1 -1
  236. package/dist/components/motion/tabs.js +1 -1
  237. package/dist/components/motion/tabs.js.map +1 -1
  238. package/dist/components/motion/text-reveal.js +1 -1
  239. package/dist/components/motion/text-reveal.js.map +1 -1
  240. package/dist/components/motion/text-scramble.d.ts.map +1 -1
  241. package/dist/components/motion/text-scramble.js +1 -1
  242. package/dist/components/motion/text-scramble.js.map +1 -1
  243. package/dist/components/motion/text-shimmer.js +1 -1
  244. package/dist/components/motion/text-shimmer.js.map +1 -1
  245. package/dist/components/motion/theme-toggle.js +2 -2
  246. package/dist/components/motion/theme-toggle.js.map +1 -1
  247. package/dist/components/motion/tilt-card.js +1 -1
  248. package/dist/components/motion/tilt-card.js.map +1 -1
  249. package/dist/components/motion/tooltip.js +1 -1
  250. package/dist/components/motion/tooltip.js.map +1 -1
  251. package/dist/components/motion/wheel-picker.js +1 -1
  252. package/dist/components/motion/wheel-picker.js.map +1 -1
  253. package/dist/components/reui/alert.d.ts +1 -1
  254. package/dist/components/reui/alert.d.ts.map +1 -1
  255. package/dist/components/reui/alert.js +2 -2
  256. package/dist/components/reui/alert.js.map +1 -1
  257. package/dist/components/reui/autocomplete.d.ts +1 -1
  258. package/dist/components/reui/autocomplete.js +2 -2
  259. package/dist/components/reui/autocomplete.js.map +1 -1
  260. package/dist/components/reui/badge.d.ts +2 -2
  261. package/dist/components/reui/badge.d.ts.map +1 -1
  262. package/dist/components/reui/badge.js +1 -1
  263. package/dist/components/reui/badge.js.map +1 -1
  264. package/dist/components/reui/cascader/cascader-columns.js +2 -2
  265. package/dist/components/reui/cascader/cascader-columns.js.map +1 -1
  266. package/dist/components/reui/cascader/cascader-footer.js +2 -2
  267. package/dist/components/reui/cascader/cascader-footer.js.map +1 -1
  268. package/dist/components/reui/cascader/cascader-item.js +2 -2
  269. package/dist/components/reui/cascader/cascader-item.js.map +1 -1
  270. package/dist/components/reui/cascader/cascader-nav.js +2 -2
  271. package/dist/components/reui/cascader/cascader-nav.js.map +1 -1
  272. package/dist/components/reui/cascader/cascader.js +2 -2
  273. package/dist/components/reui/cascader/cascader.js.map +1 -1
  274. package/dist/components/reui/code-block/code-block.js +1 -1
  275. package/dist/components/reui/code-block/code-block.js.map +1 -1
  276. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1 -1
  277. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -1
  278. package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
  279. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  280. package/dist/components/reui/data-grid/data-grid-column-header.js +2 -2
  281. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  282. package/dist/components/reui/data-grid/data-grid-pagination.js +2 -2
  283. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  284. package/dist/components/reui/data-grid/data-grid-scroll-area.js +1 -1
  285. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  286. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +2 -2
  287. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  288. package/dist/components/reui/data-grid/data-grid-table-dnd.js +1 -1
  289. package/dist/components/reui/data-grid/data-grid-table-virtual.js +1 -1
  290. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  291. package/dist/components/reui/data-grid/data-grid-table.js +2 -2
  292. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  293. package/dist/components/reui/data-grid/data-grid.js +1 -1
  294. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  295. package/dist/components/reui/date-selector.js +2 -2
  296. package/dist/components/reui/date-selector.js.map +1 -1
  297. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +2 -2
  298. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js.map +1 -1
  299. package/dist/components/reui/event-calendar/event-calendar-content.js +1 -1
  300. package/dist/components/reui/event-calendar/event-calendar-content.js.map +1 -1
  301. package/dist/components/reui/event-calendar/event-calendar-event.js +2 -2
  302. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  303. package/dist/components/reui/event-calendar/event-calendar-month-view.js +2 -2
  304. package/dist/components/reui/event-calendar/event-calendar-month-view.js.map +1 -1
  305. package/dist/components/reui/event-calendar/event-calendar-nav.js +2 -2
  306. package/dist/components/reui/event-calendar/event-calendar-nav.js.map +1 -1
  307. package/dist/components/reui/event-calendar/event-calendar-resource-view.js +1 -1
  308. package/dist/components/reui/event-calendar/event-calendar-resource-view.js.map +1 -1
  309. package/dist/components/reui/event-calendar/event-calendar-time-grid.js +1 -1
  310. package/dist/components/reui/event-calendar/event-calendar-time-grid.js.map +1 -1
  311. package/dist/components/reui/event-calendar/event-calendar.js +1 -1
  312. package/dist/components/reui/event-calendar/event-calendar.js.map +1 -1
  313. package/dist/components/reui/filters/filters-advanced.js +2 -2
  314. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  315. package/dist/components/reui/filters/filters-builder.js +3 -3
  316. package/dist/components/reui/filters/filters-builder.js.map +1 -1
  317. package/dist/components/reui/filters/filters-chip.js +2 -2
  318. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  319. package/dist/components/reui/filters/filters-editors.js +3 -3
  320. package/dist/components/reui/filters/filters-editors.js.map +1 -1
  321. package/dist/components/reui/filters/filters.js +2 -2
  322. package/dist/components/reui/filters/filters.js.map +1 -1
  323. package/dist/components/reui/frame.d.ts +2 -2
  324. package/dist/components/reui/frame.d.ts.map +1 -1
  325. package/dist/components/reui/frame.js +2 -2
  326. package/dist/components/reui/frame.js.map +1 -1
  327. package/dist/components/reui/gantt/gantt-bar.js +2 -2
  328. package/dist/components/reui/gantt/gantt-bar.js.map +1 -1
  329. package/dist/components/reui/gantt/gantt-nav.js +2 -2
  330. package/dist/components/reui/gantt/gantt-nav.js.map +1 -1
  331. package/dist/components/reui/gantt/gantt-view.js +2 -2
  332. package/dist/components/reui/gantt/gantt-view.js.map +1 -1
  333. package/dist/components/reui/gantt/gantt.js +1 -1
  334. package/dist/components/reui/gantt/gantt.js.map +1 -1
  335. package/dist/components/reui/icon-stack.js +1 -1
  336. package/dist/components/reui/icon-stack.js.map +1 -1
  337. package/dist/components/reui/icon-tile.d.ts +2 -2
  338. package/dist/components/reui/icon-tile.d.ts.map +1 -1
  339. package/dist/components/reui/icon-tile.js +1 -1
  340. package/dist/components/reui/icon-tile.js.map +1 -1
  341. package/dist/components/reui/kanban.d.ts.map +1 -1
  342. package/dist/components/reui/kanban.js +1 -1
  343. package/dist/components/reui/kanban.js.map +1 -1
  344. package/dist/components/reui/number-field.d.ts +3 -3
  345. package/dist/components/reui/number-field.js +2 -2
  346. package/dist/components/reui/number-field.js.map +1 -1
  347. package/dist/components/reui/phone-input.js +2 -2
  348. package/dist/components/reui/phone-input.js.map +1 -1
  349. package/dist/components/reui/rating.d.ts +1 -1
  350. package/dist/components/reui/rating.d.ts.map +1 -1
  351. package/dist/components/reui/rating.js +2 -2
  352. package/dist/components/reui/rating.js.map +1 -1
  353. package/dist/components/reui/sortable.d.ts.map +1 -1
  354. package/dist/components/reui/sortable.js +1 -1
  355. package/dist/components/reui/sortable.js.map +1 -1
  356. package/dist/components/reui/stepper.d.ts.map +1 -1
  357. package/dist/components/reui/stepper.js +1 -1
  358. package/dist/components/reui/stepper.js.map +1 -1
  359. package/dist/components/reui/timeline.d.ts.map +1 -1
  360. package/dist/components/reui/timeline.js +1 -1
  361. package/dist/components/reui/timeline.js.map +1 -1
  362. package/dist/components/reui/tree.d.ts.map +1 -1
  363. package/dist/components/reui/tree.js +2 -2
  364. package/dist/components/reui/tree.js.map +1 -1
  365. package/dist/components/ui/accordion.d.ts.map +1 -1
  366. package/dist/components/ui/accordion.js +2 -2
  367. package/dist/components/ui/accordion.js.map +1 -1
  368. package/dist/components/ui/alert-dialog.js +2 -2
  369. package/dist/components/ui/alert-dialog.js.map +1 -1
  370. package/dist/components/ui/alert.d.ts.map +1 -1
  371. package/dist/components/ui/alert.js +2 -2
  372. package/dist/components/ui/alert.js.map +1 -1
  373. package/dist/components/ui/aspect-ratio.js +1 -1
  374. package/dist/components/ui/aspect-ratio.js.map +1 -1
  375. package/dist/components/ui/attachment.d.ts +1 -1
  376. package/dist/components/ui/attachment.js +2 -2
  377. package/dist/components/ui/attachment.js.map +1 -1
  378. package/dist/components/ui/avatar.d.ts.map +1 -1
  379. package/dist/components/ui/avatar.js +1 -1
  380. package/dist/components/ui/avatar.js.map +1 -1
  381. package/dist/components/ui/badge.d.ts +1 -1
  382. package/dist/components/ui/badge.d.ts.map +1 -1
  383. package/dist/components/ui/badge.js +1 -1
  384. package/dist/components/ui/badge.js.map +1 -1
  385. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  386. package/dist/components/ui/breadcrumb.js +2 -2
  387. package/dist/components/ui/breadcrumb.js.map +1 -1
  388. package/dist/components/ui/bubble.d.ts +1 -1
  389. package/dist/components/ui/bubble.d.ts.map +1 -1
  390. package/dist/components/ui/bubble.js +2 -2
  391. package/dist/components/ui/bubble.js.map +1 -1
  392. package/dist/components/ui/button-group.js +2 -2
  393. package/dist/components/ui/button-group.js.map +1 -1
  394. package/dist/components/ui/button.d.ts +2 -2
  395. package/dist/components/ui/button.d.ts.map +1 -1
  396. package/dist/components/ui/button.js +2 -2
  397. package/dist/components/ui/button.js.map +1 -1
  398. package/dist/components/ui/calendar.js +2 -2
  399. package/dist/components/ui/calendar.js.map +1 -1
  400. package/dist/components/ui/card.d.ts.map +1 -1
  401. package/dist/components/ui/card.js +1 -1
  402. package/dist/components/ui/card.js.map +1 -1
  403. package/dist/components/ui/carousel.js +2 -2
  404. package/dist/components/ui/carousel.js.map +1 -1
  405. package/dist/components/ui/chart.d.ts.map +1 -1
  406. package/dist/components/ui/chart.js +1 -1
  407. package/dist/components/ui/chart.js.map +1 -1
  408. package/dist/components/ui/checkbox.d.ts.map +1 -1
  409. package/dist/components/ui/checkbox.js +3 -3
  410. package/dist/components/ui/checkbox.js.map +1 -1
  411. package/dist/components/ui/combobox.js +2 -2
  412. package/dist/components/ui/combobox.js.map +1 -1
  413. package/dist/components/ui/command.js +2 -2
  414. package/dist/components/ui/command.js.map +1 -1
  415. package/dist/components/ui/context-menu.d.ts.map +1 -1
  416. package/dist/components/ui/context-menu.js +2 -2
  417. package/dist/components/ui/context-menu.js.map +1 -1
  418. package/dist/components/ui/dialog.js +2 -2
  419. package/dist/components/ui/dialog.js.map +1 -1
  420. package/dist/components/ui/drawer.d.ts.map +1 -1
  421. package/dist/components/ui/drawer.js +1 -1
  422. package/dist/components/ui/drawer.js.map +1 -1
  423. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  424. package/dist/components/ui/dropdown-menu.js +2 -2
  425. package/dist/components/ui/dropdown-menu.js.map +1 -1
  426. package/dist/components/ui/empty.d.ts.map +1 -1
  427. package/dist/components/ui/empty.js +2 -2
  428. package/dist/components/ui/empty.js.map +1 -1
  429. package/dist/components/ui/field.js +3 -3
  430. package/dist/components/ui/field.js.map +1 -1
  431. package/dist/components/ui/hover-card.d.ts.map +1 -1
  432. package/dist/components/ui/hover-card.js +1 -1
  433. package/dist/components/ui/hover-card.js.map +1 -1
  434. package/dist/components/ui/input-group.d.ts +1 -1
  435. package/dist/components/ui/input-group.js +2 -2
  436. package/dist/components/ui/input-group.js.map +1 -1
  437. package/dist/components/ui/input-otp.d.ts.map +1 -1
  438. package/dist/components/ui/input-otp.js +2 -2
  439. package/dist/components/ui/input-otp.js.map +1 -1
  440. package/dist/components/ui/input.d.ts.map +1 -1
  441. package/dist/components/ui/input.js +1 -1
  442. package/dist/components/ui/input.js.map +1 -1
  443. package/dist/components/ui/item.d.ts +1 -1
  444. package/dist/components/ui/item.js +2 -2
  445. package/dist/components/ui/item.js.map +1 -1
  446. package/dist/components/ui/kbd.js +1 -1
  447. package/dist/components/ui/kbd.js.map +1 -1
  448. package/dist/components/ui/label.d.ts.map +1 -1
  449. package/dist/components/ui/label.js +1 -1
  450. package/dist/components/ui/label.js.map +1 -1
  451. package/dist/components/ui/marker.d.ts.map +1 -1
  452. package/dist/components/ui/marker.js +2 -2
  453. package/dist/components/ui/marker.js.map +1 -1
  454. package/dist/components/ui/menubar.js +2 -2
  455. package/dist/components/ui/menubar.js.map +1 -1
  456. package/dist/components/ui/message-scroller.js +2 -2
  457. package/dist/components/ui/message-scroller.js.map +1 -1
  458. package/dist/components/ui/message.d.ts.map +1 -1
  459. package/dist/components/ui/message.js +1 -1
  460. package/dist/components/ui/message.js.map +1 -1
  461. package/dist/components/ui/native-select.d.ts.map +1 -1
  462. package/dist/components/ui/native-select.js +2 -2
  463. package/dist/components/ui/native-select.js.map +1 -1
  464. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  465. package/dist/components/ui/navigation-menu.js +2 -2
  466. package/dist/components/ui/navigation-menu.js.map +1 -1
  467. package/dist/components/ui/pagination.js +2 -2
  468. package/dist/components/ui/pagination.js.map +1 -1
  469. package/dist/components/ui/popover.d.ts.map +1 -1
  470. package/dist/components/ui/popover.js +1 -1
  471. package/dist/components/ui/popover.js.map +1 -1
  472. package/dist/components/ui/progress.d.ts.map +1 -1
  473. package/dist/components/ui/progress.js +1 -1
  474. package/dist/components/ui/progress.js.map +1 -1
  475. package/dist/components/ui/questionnaire.js +4 -4
  476. package/dist/components/ui/questionnaire.js.map +1 -1
  477. package/dist/components/ui/radio-group.d.ts.map +1 -1
  478. package/dist/components/ui/radio-group.js +2 -2
  479. package/dist/components/ui/radio-group.js.map +1 -1
  480. package/dist/components/ui/resizable.d.ts.map +1 -1
  481. package/dist/components/ui/resizable.js +1 -1
  482. package/dist/components/ui/resizable.js.map +1 -1
  483. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  484. package/dist/components/ui/scroll-area.js +1 -1
  485. package/dist/components/ui/scroll-area.js.map +1 -1
  486. package/dist/components/ui/select.d.ts.map +1 -1
  487. package/dist/components/ui/select.js +2 -2
  488. package/dist/components/ui/select.js.map +1 -1
  489. package/dist/components/ui/separator.d.ts.map +1 -1
  490. package/dist/components/ui/separator.js +1 -1
  491. package/dist/components/ui/separator.js.map +1 -1
  492. package/dist/components/ui/sheet.js +2 -2
  493. package/dist/components/ui/sheet.js.map +1 -1
  494. package/dist/components/ui/sidebar.d.ts +1 -1
  495. package/dist/components/ui/sidebar.js +2 -2
  496. package/dist/components/ui/sidebar.js.map +1 -1
  497. package/dist/components/ui/skeleton.js +1 -1
  498. package/dist/components/ui/skeleton.js.map +1 -1
  499. package/dist/components/ui/slider.d.ts.map +1 -1
  500. package/dist/components/ui/slider.js +1 -1
  501. package/dist/components/ui/slider.js.map +1 -1
  502. package/dist/components/ui/spinner.d.ts.map +1 -1
  503. package/dist/components/ui/spinner.js +2 -2
  504. package/dist/components/ui/spinner.js.map +1 -1
  505. package/dist/components/ui/switch.d.ts.map +1 -1
  506. package/dist/components/ui/switch.js +2 -2
  507. package/dist/components/ui/switch.js.map +1 -1
  508. package/dist/components/ui/table.d.ts.map +1 -1
  509. package/dist/components/ui/table.js +1 -1
  510. package/dist/components/ui/table.js.map +1 -1
  511. package/dist/components/ui/tabs.d.ts.map +1 -1
  512. package/dist/components/ui/tabs.js +2 -2
  513. package/dist/components/ui/tabs.js.map +1 -1
  514. package/dist/components/ui/textarea.d.ts.map +1 -1
  515. package/dist/components/ui/textarea.js +1 -1
  516. package/dist/components/ui/textarea.js.map +1 -1
  517. package/dist/components/ui/toast.js +3 -3
  518. package/dist/components/ui/toast.js.map +1 -1
  519. package/dist/components/ui/toggle-group.js +1 -1
  520. package/dist/components/ui/toggle-group.js.map +1 -1
  521. package/dist/components/ui/toggle.d.ts +1 -1
  522. package/dist/components/ui/toggle.d.ts.map +1 -1
  523. package/dist/components/ui/toggle.js +2 -2
  524. package/dist/components/ui/toggle.js.map +1 -1
  525. package/dist/components/ui/tooltip.d.ts.map +1 -1
  526. package/dist/components/ui/tooltip.js +1 -1
  527. package/dist/components/ui/tooltip.js.map +1 -1
  528. package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
  529. package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
  530. package/package.json +5 -3
package/README.md CHANGED
@@ -30,7 +30,7 @@ This package is a maintained distribution: imports rewritten for monorepo (`@kum
30
30
  bun add @kumix/ui @kumix/utils
31
31
  ```
32
32
 
33
- Install peers (see `package.json` → `peerDependencies`). Six peers are **always required**: `react`, `@kumix/utils`, `@base-ui/react`, `class-variance-authority`, `lucide-react`, `motion`. The remaining 21 are **optional** via `peerDependenciesMeta` — install only what your imported components need.
33
+ Install peers (see `package.json` → `peerDependencies`). Seven peers are **always required**: `react`, `@kumix/utils`, `@base-ui/react`, `class-variance-authority`, `cn`, `lucide-react`, `motion`. The remaining 21 are **optional** via `peerDependenciesMeta` — install only what your imported components need.
34
34
 
35
35
  ```bash
36
36
  bun add @base-ui/react class-variance-authority lucide-react motion react @kumix/utils
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { EASE_OUT, SPRING_LAYOUT } from "../../../lib/ease.js";
3
- import { cn } from "@kumix/utils";
4
- import { Check, Circle, FileText, Globe2, ImageIcon, MessageSquare, PencilLine, Search, Sparkles, SquareTerminal, Wrench } from "lucide-react";
3
+ import { cn } from "cn";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
5
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6
+ import { Check, Circle, FileText, Globe2, ImageIcon, MessageSquare, PencilLine, Search, Sparkles, SquareTerminal, Wrench } from "lucide-react";
7
7
  //#region src/components/agents/agent-activity/activity-row.tsx
8
8
  function StepRow({ item }) {
9
9
  const state = item.status ?? "complete";
@@ -1 +1 @@
1
- {"version":3,"file":"activity-row.js","names":[],"sources":["../../../../src/components/agents/agent-activity/activity-row.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Check,\n Circle,\n FileText,\n Globe2,\n ImageIcon,\n MessageSquare,\n PencilLine,\n Search,\n Sparkles,\n SquareTerminal,\n Wrench,\n} from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_LAYOUT } from \"../../../lib/ease\";\nimport type {\n AgentActivityItem,\n AgentActivitySearch,\n AgentActivityStep,\n AgentActivityText,\n AgentActivityTool,\n AgentActivityTrace,\n AgentSearchResult,\n} from \"./types\";\n\nfunction StepRow({ item }: { item: AgentActivityStep }) {\n const state = item.status ?? \"complete\";\n\n return (\n <div className=\"flex min-h-7 items-start gap-2.5 rounded-md px-1.5 py-1\">\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 grid size-4 shrink-0 place-items-center text-muted-foreground/70\"\n >\n {state === \"complete\" ? (\n <Check className=\"size-4\" strokeWidth={1.8} />\n ) : state === \"active\" ? (\n <span className=\"relative grid size-3 place-items-center\">\n <motion.span\n className=\"absolute inset-0 rounded-full bg-foreground/10\"\n animate={{ opacity: [0.35, 0.8, 0.35] }}\n transition={{ duration: 1.5, repeat: Number.POSITIVE_INFINITY }}\n />\n <span className=\"size-1.5 rounded-full bg-foreground/60\" />\n </span>\n ) : (\n <Circle className=\"size-3\" strokeWidth={1.5} />\n )}\n </span>\n <span\n className={cn(\n \"min-w-0 flex-1 leading-5\",\n state === \"pending\" ? \"text-muted-foreground/55\" : \"text-foreground/90\",\n )}\n >\n {item.label}\n </span>\n {item.meta ? (\n <span className=\"shrink-0 text-muted-foreground/55 leading-5\">{item.meta}</span>\n ) : null}\n </div>\n );\n}\n\nfunction TextRow({ item }: { item: AgentActivityText }) {\n return (\n <div className=\"rounded-md px-1.5 py-1 text-muted-foreground leading-5\">{item.content}</div>\n );\n}\n\nfunction SearchResultRow({ result }: { result: AgentSearchResult }) {\n const content = (\n <>\n <span\n aria-hidden=\"true\"\n className=\"grid size-5 shrink-0 place-items-center text-muted-foreground\"\n >\n {result.icon ?? <Globe2 className=\"size-3\" strokeWidth={2} />}\n </span>\n <span className=\"min-w-0 truncate font-medium text-foreground/90\">{result.title}</span>\n {result.domain ? (\n <span className=\"min-w-0 truncate text-muted-foreground/55\">{result.domain}</span>\n ) : null}\n </>\n );\n const className = cn(\n \"flex min-h-7 items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors\",\n result.url && \"focus-visible:ring-2 focus-visible:ring-ring\",\n );\n\n return result.url ? (\n <a href={result.url} className={className}>\n {content}\n </a>\n ) : (\n <div className={className}>{content}</div>\n );\n}\n\nfunction SearchRow({ item }: { item: AgentActivitySearch }) {\n const reduce = useReducedMotion() ?? false;\n const enter = reduce ? { opacity: 1 } : { opacity: 0, y: 6 };\n const visible = { opacity: 1, y: 0 };\n const exit = reduce ? { opacity: 0 } : { opacity: 0, y: -3 };\n const transition = reduce\n ? { duration: 0 }\n : {\n opacity: { duration: 0.18, ease: EASE_OUT },\n y: SPRING_LAYOUT,\n layout: SPRING_LAYOUT,\n };\n\n return (\n <div className=\"space-y-0.5\">\n <div className=\"flex min-h-7 items-center gap-2.5 rounded-md px-1.5 py-1 text-muted-foreground\">\n <Search aria-hidden=\"true\" className=\"size-4 shrink-0\" strokeWidth={1.7} />\n <span className=\"min-w-0 truncate\">{item.query}</span>\n </div>\n {item.results?.length ? (\n <div className=\"space-y-0.5 pl-4\">\n <AnimatePresence initial mode=\"popLayout\">\n {item.results.map((result) => (\n <motion.div\n layout=\"position\"\n key={result.id}\n initial={enter}\n animate={visible}\n exit={exit}\n transition={transition}\n >\n <SearchResultRow result={result} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n ) : null}\n <AnimatePresence initial>\n {item.moreCount ? (\n <motion.div\n key=\"more-results\"\n initial={enter}\n animate={visible}\n exit={exit}\n transition={transition}\n className=\"px-1.5 py-1 pl-8 text-muted-foreground/55\"\n >\n +{item.moreCount} more\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n );\n}\n\nfunction ActionIcon({ action }: { action: string }) {\n if (action === \"read\") return <FileText className=\"size-4\" />;\n if (action === \"edit\" || action === \"write\") {\n return <PencilLine className=\"size-4\" />;\n }\n if (action === \"run\") return <SquareTerminal className=\"size-4\" />;\n return <Wrench className=\"size-4\" />;\n}\n\nfunction ToolRow({ item }: { item: AgentActivityTool }) {\n const action = item.action.charAt(0).toUpperCase() + item.action.slice(1);\n\n return (\n <div className=\"flex min-h-8 min-w-0 items-center gap-2.5 rounded-md px-1.5 py-0.5 leading-5\">\n <span\n aria-hidden=\"true\"\n className=\"grid size-4 shrink-0 place-items-center text-muted-foreground/70\"\n >\n <ActionIcon action={item.action} />\n </span>\n <span className=\"shrink-0 font-medium text-foreground/90\">{action}</span>\n <span className=\"min-w-0 flex-1 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-muted-foreground/70 text-xs\">\n {item.target}\n </span>\n {typeof item.additions === \"number\" || typeof item.deletions === \"number\" ? (\n <span className=\"flex shrink-0 items-center gap-2 font-mono tabular-nums\">\n {typeof item.additions === \"number\" ? (\n <span className=\"text-emerald-500\">+{item.additions}</span>\n ) : null}\n {typeof item.deletions === \"number\" ? (\n <span className=\"text-rose-500\">−{item.deletions}</span>\n ) : null}\n </span>\n ) : null}\n </div>\n );\n}\n\nfunction TraceIcon({ kind }: { kind: AgentActivityTrace[\"kind\"] }) {\n if (kind === \"thinking\") return <Sparkles className=\"size-4\" />;\n if (kind === \"message\") return <MessageSquare className=\"size-4\" />;\n if (kind === \"write\") return <PencilLine className=\"size-4\" />;\n if (kind === \"run\") return <SquareTerminal className=\"size-4\" />;\n if (kind === \"read\") return <ImageIcon className=\"size-4\" />;\n return <Wrench className=\"size-4\" />;\n}\n\nfunction TraceRow({ item }: { item: AgentActivityTrace }) {\n return (\n <div className=\"grid min-h-8 grid-cols-[1rem_auto_minmax(0,1fr)] items-center gap-2.5 rounded-md px-1.5 py-0.5\">\n <span aria-hidden=\"true\" className=\"grid size-4 place-items-center text-muted-foreground/70\">\n {item.icon ?? <TraceIcon kind={item.kind} />}\n </span>\n <span className=\"font-medium text-foreground/90\">{item.label}</span>\n {item.detail ? (\n <span className=\"min-w-0 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-muted-foreground/70 text-xs\">\n {item.detail}\n </span>\n ) : (\n <span />\n )}\n </div>\n );\n}\n\nexport function ActivityRow({ item }: { item: AgentActivityItem }) {\n if (item.type === \"text\") return <TextRow item={item} />;\n if (item.type === \"search\") return <SearchRow item={item} />;\n if (item.type === \"tool\") return <ToolRow item={item} />;\n if (item.type === \"trace\") return <TraceRow item={item} />;\n return <StepRow item={item} />;\n}\n"],"mappings":";;;;;;;AA6BA,SAAS,QAAQ,EAAE,QAAqC;CACtD,MAAM,QAAQ,KAAK,UAAU;CAE7B,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,QAAD;IACE,eAAY;IACZ,WAAU;IAET,UAAA,UAAU,aACT,oBAAC,OAAD;KAAO,WAAU;KAAS,aAAa;IAAM,CAAA,IAC3C,UAAU,WACZ,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CACE,oBAAC,OAAO,MAAR;MACE,WAAU;MACV,SAAS,EAAE,SAAS;OAAC;OAAM;OAAK;MAAI,EAAE;MACtC,YAAY;OAAE,UAAU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;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;IAChC,UAAA,KAAK,QAAQ,oBAAC,WAAD,EAAW,MAAM,KAAK,KAAO,CAAA;GACvC,CAAA;GACN,oBAAC,QAAD;IAAM,WAAU;IAAkC,UAAA,KAAK;GAAY,CAAA;GAClE,KAAK,SACJ,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,KAAK;GACF,CAAA,IAEN,oBAAC,QAAD,CAAO,CAAA;EAEN;;AAET;AAEA,SAAgB,YAAY,EAAE,QAAqC;CACjE,IAAI,KAAK,SAAS,QAAQ,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;CACvD,IAAI,KAAK,SAAS,UAAU,OAAO,oBAAC,WAAD,EAAiB,KAAO,CAAA;CAC3D,IAAI,KAAK,SAAS,QAAQ,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;CACvD,IAAI,KAAK,SAAS,SAAS,OAAO,oBAAC,UAAD,EAAgB,KAAO,CAAA;CACzD,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;AAC/B"}
1
+ {"version":3,"file":"activity-row.js","names":[],"sources":["../../../../src/components/agents/agent-activity/activity-row.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"cn\";\nimport {\n Check,\n Circle,\n FileText,\n Globe2,\n ImageIcon,\n MessageSquare,\n PencilLine,\n Search,\n Sparkles,\n SquareTerminal,\n Wrench,\n} from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT, SPRING_LAYOUT } from \"../../../lib/ease\";\nimport type {\n AgentActivityItem,\n AgentActivitySearch,\n AgentActivityStep,\n AgentActivityText,\n AgentActivityTool,\n AgentActivityTrace,\n AgentSearchResult,\n} from \"./types\";\n\nfunction StepRow({ item }: { item: AgentActivityStep }) {\n const state = item.status ?? \"complete\";\n\n return (\n <div className=\"flex min-h-7 items-start gap-2.5 rounded-md px-1.5 py-1\">\n <span\n aria-hidden=\"true\"\n className=\"mt-0.5 grid size-4 shrink-0 place-items-center text-muted-foreground/70\"\n >\n {state === \"complete\" ? (\n <Check className=\"size-4\" strokeWidth={1.8} />\n ) : state === \"active\" ? (\n <span className=\"relative grid size-3 place-items-center\">\n <motion.span\n className=\"absolute inset-0 rounded-full bg-foreground/10\"\n animate={{ opacity: [0.35, 0.8, 0.35] }}\n transition={{ duration: 1.5, repeat: Number.POSITIVE_INFINITY }}\n />\n <span className=\"size-1.5 rounded-full bg-foreground/60\" />\n </span>\n ) : (\n <Circle className=\"size-3\" strokeWidth={1.5} />\n )}\n </span>\n <span\n className={cn(\n \"min-w-0 flex-1 leading-5\",\n state === \"pending\" ? \"text-muted-foreground/55\" : \"text-foreground/90\",\n )}\n >\n {item.label}\n </span>\n {item.meta ? (\n <span className=\"shrink-0 text-muted-foreground/55 leading-5\">{item.meta}</span>\n ) : null}\n </div>\n );\n}\n\nfunction TextRow({ item }: { item: AgentActivityText }) {\n return (\n <div className=\"rounded-md px-1.5 py-1 text-muted-foreground leading-5\">{item.content}</div>\n );\n}\n\nfunction SearchResultRow({ result }: { result: AgentSearchResult }) {\n const content = (\n <>\n <span\n aria-hidden=\"true\"\n className=\"grid size-5 shrink-0 place-items-center text-muted-foreground\"\n >\n {result.icon ?? <Globe2 className=\"size-3\" strokeWidth={2} />}\n </span>\n <span className=\"min-w-0 truncate font-medium text-foreground/90\">{result.title}</span>\n {result.domain ? (\n <span className=\"min-w-0 truncate text-muted-foreground/55\">{result.domain}</span>\n ) : null}\n </>\n );\n const className = cn(\n \"flex min-h-7 items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors\",\n result.url && \"focus-visible:ring-2 focus-visible:ring-ring\",\n );\n\n return result.url ? (\n <a href={result.url} className={className}>\n {content}\n </a>\n ) : (\n <div className={className}>{content}</div>\n );\n}\n\nfunction SearchRow({ item }: { item: AgentActivitySearch }) {\n const reduce = useReducedMotion() ?? false;\n const enter = reduce ? { opacity: 1 } : { opacity: 0, y: 6 };\n const visible = { opacity: 1, y: 0 };\n const exit = reduce ? { opacity: 0 } : { opacity: 0, y: -3 };\n const transition = reduce\n ? { duration: 0 }\n : {\n opacity: { duration: 0.18, ease: EASE_OUT },\n y: SPRING_LAYOUT,\n layout: SPRING_LAYOUT,\n };\n\n return (\n <div className=\"space-y-0.5\">\n <div className=\"flex min-h-7 items-center gap-2.5 rounded-md px-1.5 py-1 text-muted-foreground\">\n <Search aria-hidden=\"true\" className=\"size-4 shrink-0\" strokeWidth={1.7} />\n <span className=\"min-w-0 truncate\">{item.query}</span>\n </div>\n {item.results?.length ? (\n <div className=\"space-y-0.5 pl-4\">\n <AnimatePresence initial mode=\"popLayout\">\n {item.results.map((result) => (\n <motion.div\n layout=\"position\"\n key={result.id}\n initial={enter}\n animate={visible}\n exit={exit}\n transition={transition}\n >\n <SearchResultRow result={result} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n ) : null}\n <AnimatePresence initial>\n {item.moreCount ? (\n <motion.div\n key=\"more-results\"\n initial={enter}\n animate={visible}\n exit={exit}\n transition={transition}\n className=\"px-1.5 py-1 pl-8 text-muted-foreground/55\"\n >\n +{item.moreCount} more\n </motion.div>\n ) : null}\n </AnimatePresence>\n </div>\n );\n}\n\nfunction ActionIcon({ action }: { action: string }) {\n if (action === \"read\") return <FileText className=\"size-4\" />;\n if (action === \"edit\" || action === \"write\") {\n return <PencilLine className=\"size-4\" />;\n }\n if (action === \"run\") return <SquareTerminal className=\"size-4\" />;\n return <Wrench className=\"size-4\" />;\n}\n\nfunction ToolRow({ item }: { item: AgentActivityTool }) {\n const action = item.action.charAt(0).toUpperCase() + item.action.slice(1);\n\n return (\n <div className=\"flex min-h-8 min-w-0 items-center gap-2.5 rounded-md px-1.5 py-0.5 leading-5\">\n <span\n aria-hidden=\"true\"\n className=\"grid size-4 shrink-0 place-items-center text-muted-foreground/70\"\n >\n <ActionIcon action={item.action} />\n </span>\n <span className=\"shrink-0 font-medium text-foreground/90\">{action}</span>\n <span className=\"min-w-0 flex-1 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-muted-foreground/70 text-xs\">\n {item.target}\n </span>\n {typeof item.additions === \"number\" || typeof item.deletions === \"number\" ? (\n <span className=\"flex shrink-0 items-center gap-2 font-mono tabular-nums\">\n {typeof item.additions === \"number\" ? (\n <span className=\"text-emerald-500\">+{item.additions}</span>\n ) : null}\n {typeof item.deletions === \"number\" ? (\n <span className=\"text-rose-500\">−{item.deletions}</span>\n ) : null}\n </span>\n ) : null}\n </div>\n );\n}\n\nfunction TraceIcon({ kind }: { kind: AgentActivityTrace[\"kind\"] }) {\n if (kind === \"thinking\") return <Sparkles className=\"size-4\" />;\n if (kind === \"message\") return <MessageSquare className=\"size-4\" />;\n if (kind === \"write\") return <PencilLine className=\"size-4\" />;\n if (kind === \"run\") return <SquareTerminal className=\"size-4\" />;\n if (kind === \"read\") return <ImageIcon className=\"size-4\" />;\n return <Wrench className=\"size-4\" />;\n}\n\nfunction TraceRow({ item }: { item: AgentActivityTrace }) {\n return (\n <div className=\"grid min-h-8 grid-cols-[1rem_auto_minmax(0,1fr)] items-center gap-2.5 rounded-md px-1.5 py-0.5\">\n <span aria-hidden=\"true\" className=\"grid size-4 place-items-center text-muted-foreground/70\">\n {item.icon ?? <TraceIcon kind={item.kind} />}\n </span>\n <span className=\"font-medium text-foreground/90\">{item.label}</span>\n {item.detail ? (\n <span className=\"min-w-0 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-muted-foreground/70 text-xs\">\n {item.detail}\n </span>\n ) : (\n <span />\n )}\n </div>\n );\n}\n\nexport function ActivityRow({ item }: { item: AgentActivityItem }) {\n if (item.type === \"text\") return <TextRow item={item} />;\n if (item.type === \"search\") return <SearchRow item={item} />;\n if (item.type === \"tool\") return <ToolRow item={item} />;\n if (item.type === \"trace\") return <TraceRow item={item} />;\n return <StepRow item={item} />;\n}\n"],"mappings":";;;;;;;AA6BA,SAAS,QAAQ,EAAE,QAAqC;CAC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,oBAAC,eAAD,EAAe,WAAU,SAAU,CAAA;CAClE,IAAI,SAAS,SAAS,OAAO,oBAAC,YAAD,EAAY,WAAU,SAAU,CAAA;CAC7D,IAAI,SAAS,OAAO,OAAO,oBAAC,gBAAD,EAAgB,WAAU,SAAU,CAAA;CAC/D,IAAI,SAAS,QAAQ,OAAO,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;CAC3D,OAAO,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA;AACrC;AAEA,SAAS,SAAS,EAAE,QAAsC;CACxD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;IAChC,UAAA,KAAK,QAAQ,oBAAC,WAAD,EAAW,MAAM,KAAK,KAAO,CAAA;GACvC,CAAA;GACN,oBAAC,QAAD;IAAM,WAAU;IAAkC,UAAA,KAAK;GAAY,CAAA;GAClE,KAAK,SACJ,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,KAAK;GACF,CAAA,IAEN,oBAAC,QAAD,CAAO,CAAA;EAEN;;AAET;AAEA,SAAgB,YAAY,EAAE,QAAqC;CACjE,IAAI,KAAK,SAAS,QAAQ,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;CACvD,IAAI,KAAK,SAAS,UAAU,OAAO,oBAAC,WAAD,EAAiB,KAAO,CAAA;CAC3D,IAAI,KAAK,SAAS,QAAQ,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;CACvD,IAAI,KAAK,SAAS,SAAS,OAAO,oBAAC,UAAD,EAAgB,KAAO,CAAA;CACzD,OAAO,oBAAC,SAAD,EAAe,KAAO,CAAA;AAC/B"}
@@ -4,10 +4,10 @@ import { AgentDisclosure } from "../agent-disclosure.js";
4
4
  import { ActivityRow } from "./activity-row.js";
5
5
  import { ThinkingShimmer } from "../loading-states/thinking-shimmer.js";
6
6
  import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
7
- import { cn } from "@kumix/utils";
8
- import { ChevronDown } from "lucide-react";
7
+ import { cn } from "cn";
9
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
9
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
10
+ import { ChevronDown } from "lucide-react";
11
11
  //#region src/components/agents/agent-activity/index.tsx
12
12
  function formatDuration(duration) {
13
13
  const seconds = Math.max(0, Math.round(duration));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/agents/agent-activity/index.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { ChevronDown } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from \"../../../lib/ease\";\nimport { AgentDisclosure } from \"../agent-disclosure\";\nimport { ThinkingShimmer } from \"../loading-states/thinking-shimmer\";\nimport { ActivityRow } from \"./activity-row\";\nimport type { AgentActivityContentType, AgentActivityItem, AgentActivityProps } from \"./types\";\n\nexport type {\n AgentActivityContentType,\n AgentActivityItem,\n AgentActivityProps,\n AgentActivitySearch,\n AgentActivityStatus,\n AgentActivityStep,\n AgentActivityText,\n AgentActivityTool,\n AgentActivityTrace,\n AgentSearchResult,\n AgentStepStatus,\n AgentTraceKind,\n} from \"./types\";\n\nfunction formatDuration(duration: number) {\n const seconds = Math.max(0, Math.round(duration));\n if (seconds < 60) return `${seconds}s`;\n\n const minutes = Math.floor(seconds / 60);\n const remainder = seconds % 60;\n return remainder === 0 ? `${minutes}m` : `${minutes}m ${remainder}s`;\n}\n\nfunction useControllableOpen({\n open,\n defaultOpen,\n onOpenChange,\n}: {\n open?: boolean;\n defaultOpen: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const controlled = open !== undefined;\n const currentOpen = open ?? internalOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!controlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [controlled, onOpenChange],\n );\n\n return [currentOpen, setOpen] as const;\n}\n\nfunction getContentType(items: AgentActivityItem[]): AgentActivityContentType {\n const first = items[0]?.type;\n return first && items.every((item) => item.type === first) ? first : \"mixed\";\n}\n\nfunction getActiveLabel(type: AgentActivityContentType) {\n if (type === \"search\") return \"Searching the web…\";\n if (type === \"tool\") return \"Running tools…\";\n if (type === \"trace\") return \"Working through the run…\";\n if (type === \"mixed\") return \"Working through it…\";\n return \"Thinking…\";\n}\n\nfunction getSummary(\n type: AgentActivityContentType,\n items: AgentActivityItem[],\n duration: number,\n): ReactNode {\n if (type === \"step\" || type === \"text\") {\n return (\n <>\n Thought for <span className=\"tabular-nums\">{formatDuration(duration)}</span>\n </>\n );\n }\n if (type === \"search\") return \"Searched the web\";\n if (type === \"tool\") {\n return `Ran ${items.length} ${items.length === 1 ? \"tool\" : \"tools\"}`;\n }\n if (type === \"trace\") {\n const messages = items.filter(\n (item) => item.type === \"trace\" && (item.kind === \"thinking\" || item.kind === \"message\"),\n ).length;\n const tools = items.length - messages;\n return `${tools} ${tools === 1 ? \"tool call\" : \"tool calls\"}, ${messages} ${messages === 1 ? \"message\" : \"messages\"}`;\n }\n return `Completed ${items.length} ${items.length === 1 ? \"step\" : \"steps\"}`;\n}\n\nexport function AgentActivity({\n items,\n contentType: initialContentType,\n status = \"working\",\n duration = 0,\n open,\n defaultOpen = false,\n onOpenChange,\n collapseOnComplete = true,\n activeLabel,\n summary,\n renderWorkingStatus,\n renderCompletedStatus,\n maxHeight = 208,\n className,\n contentClassName,\n}: AgentActivityProps) {\n const reduce = useReducedMotion() ?? false;\n const baseId = useId();\n const triggerId = `${baseId}-trigger`;\n const contentId = `${baseId}-content`;\n const contentRef = useRef<HTMLDivElement>(null);\n const viewportRef = useRef<HTMLDivElement>(null);\n const previousStatus = useRef(status);\n const [contentHeight, setContentHeight] = useState(0);\n const [currentOpen, setOpen] = useControllableOpen({\n open,\n defaultOpen,\n onOpenChange,\n });\n const working = status === \"working\";\n const expanded = working || currentOpen;\n const contentType = items.length ? getContentType(items) : (initialContentType ?? \"mixed\");\n const cappedHeight = Math.min(contentHeight, Math.max(0, maxHeight));\n const viewportHeight = working ? Math.max(0, maxHeight) : cappedHeight;\n const capped = contentHeight > maxHeight;\n const streamOffset = working ? Math.min(0, viewportHeight - contentHeight) : 0;\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return;\n\n const measure = () => setContentHeight(node.offsetHeight);\n measure();\n\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n if (previousStatus.current === \"working\" && status === \"complete\") {\n setOpen(!collapseOnComplete);\n }\n previousStatus.current = status;\n }, [collapseOnComplete, setOpen, status]);\n\n const toggle = () => {\n const next = !currentOpen;\n setOpen(next);\n if (next) requestAnimationFrame(() => viewportRef.current?.scrollTo({ top: 0 }));\n };\n\n const liveLabel = activeLabel ?? getActiveLabel(contentType);\n const completedSummary = summary ?? getSummary(contentType, items, duration);\n const maskImage = capped\n ? working\n ? \"linear-gradient(to bottom, transparent, black 12px)\"\n : \"linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)\"\n : undefined;\n\n return (\n <div\n data-state={working ? \"working\" : expanded ? \"open\" : \"closed\"}\n data-content={contentType}\n aria-busy={working}\n className={cn(\"w-full text-sm\", className)}\n >\n {working ? (\n <div\n id={triggerId}\n role=\"status\"\n className=\"flex h-7 min-w-0 items-center text-muted-foreground\"\n >\n {renderWorkingStatus ? (\n renderWorkingStatus({ label: liveLabel, duration })\n ) : (\n <ThinkingShimmer>{liveLabel}</ThinkingShimmer>\n )}\n </div>\n ) : (\n <button\n id={triggerId}\n type=\"button\"\n aria-expanded={expanded}\n aria-controls={contentId}\n onClick={toggle}\n className=\"group flex h-7 min-w-0 items-center gap-1.5 rounded-md text-left font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <span className=\"truncate\">\n {renderCompletedStatus\n ? renderCompletedStatus({ summary: completedSummary, duration })\n : completedSummary}\n </span>\n <motion.span\n aria-hidden=\"true\"\n animate={{ rotate: expanded ? 180 : 0 }}\n transition={reduce ? { duration: 0 } : SPRING_SWAP}\n className=\"inline-flex shrink-0 text-muted-foreground/70 group-hover:text-foreground\"\n >\n <ChevronDown className=\"size-3.5\" />\n </motion.span>\n </button>\n )}\n\n <AgentDisclosure\n id={contentId}\n role=\"region\"\n aria-labelledby={triggerId}\n open={expanded}\n openHeight={viewportHeight}\n >\n <div\n ref={viewportRef}\n className={cn(\n \"scrollbar-hide pr-1\",\n capped && expanded && !working ? \"overflow-y-auto\" : \"overflow-y-hidden\",\n )}\n style={{ height: viewportHeight, maskImage, WebkitMaskImage: maskImage }}\n >\n <motion.div\n ref={contentRef}\n role=\"list\"\n initial={false}\n animate={{ y: streamOffset }}\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n className={cn(\"space-y-0.5 py-2\", contentClassName)}\n >\n <AnimatePresence mode=\"popLayout\">\n {items.map((item) => (\n <motion.div\n layout=\"position\"\n key={item.id}\n role=\"listitem\"\n initial={reduce ? { opacity: 1 } : { opacity: 0, y: 6 }}\n animate={{ opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -3 }}\n transition={\n reduce\n ? { duration: 0 }\n : {\n opacity: { duration: 0.18, ease: EASE_OUT },\n y: SPRING_LAYOUT,\n layout: SPRING_LAYOUT,\n }\n }\n >\n <ActivityRow item={item} />\n </motion.div>\n ))}\n </AnimatePresence>\n </motion.div>\n </div>\n </AgentDisclosure>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoCA,SAAS,eAAe,UAAkB;CACxC,MAAM,UAAU,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,OAAD;IACE,KAAK;IACL,WAAW,GACT,uBACA,UAAU,YAAY,CAAC,UAAU,oBAAoB,mBACvD;IACA,OAAO;KAAE,QAAQ;KAAgB;KAAW,iBAAiB;IAAU;IAEvE,UAAA,oBAAC,OAAO,KAAR;KACE,KAAK;KACL,MAAK;KACL,SAAS;KACT,SAAS,EAAE,GAAG,aAAa;KAC3B,YAAY,SAAS,EAAE,UAAU,EAAE,IAAI;KACvC,WAAW,GAAG,oBAAoB,gBAAgB;KAElD,UAAA,oBAAC,iBAAD;MAAiB,MAAK;MACnB,UAAA,MAAM,KAAK,SACV,oBAAC,OAAO,KAAR;OACE,QAAO;OAEP,MAAK;OACL,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;QAAE,SAAS;QAAG,GAAG;OAAE;OACtD,SAAS;QAAE,SAAS;QAAG,GAAG;OAAE;OAC5B,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;QAAE,SAAS;QAAG,GAAG;OAAG;OACpD,YACE,SACI,EAAE,UAAU,EAAE,IACd;QACE,SAAS;SAAE,UAAU;SAAM,MAAM;QAAS;QAC1C,GAAG;QACH,QAAQ;OACV;OAGN,UAAA,oBAAC,aAAD,EAAmB,KAAO,CAAA;MAChB,GAhBL,KAAK,EAgBA,CACb;KACc,CAAA;IACP,CAAA;GACT,CAAA;EACU,CAAA,CACd;;AAET"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/agents/agent-activity/index.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport { ChevronDown } from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from \"../../../lib/ease\";\nimport { AgentDisclosure } from \"../agent-disclosure\";\nimport { ThinkingShimmer } from \"../loading-states/thinking-shimmer\";\nimport { ActivityRow } from \"./activity-row\";\nimport type { AgentActivityContentType, AgentActivityItem, AgentActivityProps } from \"./types\";\n\nexport type {\n AgentActivityContentType,\n AgentActivityItem,\n AgentActivityProps,\n AgentActivitySearch,\n AgentActivityStatus,\n AgentActivityStep,\n AgentActivityText,\n AgentActivityTool,\n AgentActivityTrace,\n AgentSearchResult,\n AgentStepStatus,\n AgentTraceKind,\n} from \"./types\";\n\nfunction formatDuration(duration: number) {\n const seconds = Math.max(0, Math.round(duration));\n if (seconds < 60) return `${seconds}s`;\n\n const minutes = Math.floor(seconds / 60);\n const remainder = seconds % 60;\n return remainder === 0 ? `${minutes}m` : `${minutes}m ${remainder}s`;\n}\n\nfunction useControllableOpen({\n open,\n defaultOpen,\n onOpenChange,\n}: {\n open?: boolean;\n defaultOpen: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const controlled = open !== undefined;\n const currentOpen = open ?? internalOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!controlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [controlled, onOpenChange],\n );\n\n return [currentOpen, setOpen] as const;\n}\n\nfunction getContentType(items: AgentActivityItem[]): AgentActivityContentType {\n const first = items[0]?.type;\n return first && items.every((item) => item.type === first) ? first : \"mixed\";\n}\n\nfunction getActiveLabel(type: AgentActivityContentType) {\n if (type === \"search\") return \"Searching the web…\";\n if (type === \"tool\") return \"Running tools…\";\n if (type === \"trace\") return \"Working through the run…\";\n if (type === \"mixed\") return \"Working through it…\";\n return \"Thinking…\";\n}\n\nfunction getSummary(\n type: AgentActivityContentType,\n items: AgentActivityItem[],\n duration: number,\n): ReactNode {\n if (type === \"step\" || type === \"text\") {\n return (\n <>\n Thought for <span className=\"tabular-nums\">{formatDuration(duration)}</span>\n </>\n );\n }\n if (type === \"search\") return \"Searched the web\";\n if (type === \"tool\") {\n return `Ran ${items.length} ${items.length === 1 ? \"tool\" : \"tools\"}`;\n }\n if (type === \"trace\") {\n const messages = items.filter(\n (item) => item.type === \"trace\" && (item.kind === \"thinking\" || item.kind === \"message\"),\n ).length;\n const tools = items.length - messages;\n return `${tools} ${tools === 1 ? \"tool call\" : \"tool calls\"}, ${messages} ${messages === 1 ? \"message\" : \"messages\"}`;\n }\n return `Completed ${items.length} ${items.length === 1 ? \"step\" : \"steps\"}`;\n}\n\nexport function AgentActivity({\n items,\n contentType: initialContentType,\n status = \"working\",\n duration = 0,\n open,\n defaultOpen = false,\n onOpenChange,\n collapseOnComplete = true,\n activeLabel,\n summary,\n renderWorkingStatus,\n renderCompletedStatus,\n maxHeight = 208,\n className,\n contentClassName,\n}: AgentActivityProps) {\n const reduce = useReducedMotion() ?? false;\n const baseId = useId();\n const triggerId = `${baseId}-trigger`;\n const contentId = `${baseId}-content`;\n const contentRef = useRef<HTMLDivElement>(null);\n const viewportRef = useRef<HTMLDivElement>(null);\n const previousStatus = useRef(status);\n const [contentHeight, setContentHeight] = useState(0);\n const [currentOpen, setOpen] = useControllableOpen({\n open,\n defaultOpen,\n onOpenChange,\n });\n const working = status === \"working\";\n const expanded = working || currentOpen;\n const contentType = items.length ? getContentType(items) : (initialContentType ?? \"mixed\");\n const cappedHeight = Math.min(contentHeight, Math.max(0, maxHeight));\n const viewportHeight = working ? Math.max(0, maxHeight) : cappedHeight;\n const capped = contentHeight > maxHeight;\n const streamOffset = working ? Math.min(0, viewportHeight - contentHeight) : 0;\n\n useLayoutEffect(() => {\n const node = contentRef.current;\n if (!node) return;\n\n const measure = () => setContentHeight(node.offsetHeight);\n measure();\n\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n if (previousStatus.current === \"working\" && status === \"complete\") {\n setOpen(!collapseOnComplete);\n }\n previousStatus.current = status;\n }, [collapseOnComplete, setOpen, status]);\n\n const toggle = () => {\n const next = !currentOpen;\n setOpen(next);\n if (next) requestAnimationFrame(() => viewportRef.current?.scrollTo({ top: 0 }));\n };\n\n const liveLabel = activeLabel ?? getActiveLabel(contentType);\n const completedSummary = summary ?? getSummary(contentType, items, duration);\n const maskImage = capped\n ? working\n ? \"linear-gradient(to bottom, transparent, black 12px)\"\n : \"linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)\"\n : undefined;\n\n return (\n <div\n data-state={working ? \"working\" : expanded ? \"open\" : \"closed\"}\n data-content={contentType}\n aria-busy={working}\n className={cn(\"w-full text-sm\", className)}\n >\n {working ? (\n <div\n id={triggerId}\n role=\"status\"\n className=\"flex h-7 min-w-0 items-center text-muted-foreground\"\n >\n {renderWorkingStatus ? (\n renderWorkingStatus({ label: liveLabel, duration })\n ) : (\n <ThinkingShimmer>{liveLabel}</ThinkingShimmer>\n )}\n </div>\n ) : (\n <button\n id={triggerId}\n type=\"button\"\n aria-expanded={expanded}\n aria-controls={contentId}\n onClick={toggle}\n className=\"group flex h-7 min-w-0 items-center gap-1.5 rounded-md text-left font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n <span className=\"truncate\">\n {renderCompletedStatus\n ? renderCompletedStatus({ summary: completedSummary, duration })\n : completedSummary}\n </span>\n <motion.span\n aria-hidden=\"true\"\n animate={{ rotate: expanded ? 180 : 0 }}\n transition={reduce ? { duration: 0 } : SPRING_SWAP}\n className=\"inline-flex shrink-0 text-muted-foreground/70 group-hover:text-foreground\"\n >\n <ChevronDown className=\"size-3.5\" />\n </motion.span>\n </button>\n )}\n\n <AgentDisclosure\n id={contentId}\n role=\"region\"\n aria-labelledby={triggerId}\n open={expanded}\n openHeight={viewportHeight}\n >\n <div\n ref={viewportRef}\n className={cn(\n \"scrollbar-hide pr-1\",\n capped && expanded && !working ? \"overflow-y-auto\" : \"overflow-y-hidden\",\n )}\n style={{ height: viewportHeight, maskImage, WebkitMaskImage: maskImage }}\n >\n <motion.div\n ref={contentRef}\n role=\"list\"\n initial={false}\n animate={{ y: streamOffset }}\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n className={cn(\"space-y-0.5 py-2\", contentClassName)}\n >\n <AnimatePresence mode=\"popLayout\">\n {items.map((item) => (\n <motion.div\n layout=\"position\"\n key={item.id}\n role=\"listitem\"\n initial={reduce ? { opacity: 1 } : { opacity: 0, y: 6 }}\n animate={{ opacity: 1, y: 0 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, y: -3 }}\n transition={\n reduce\n ? { duration: 0 }\n : {\n opacity: { duration: 0.18, ease: EASE_OUT },\n y: SPRING_LAYOUT,\n layout: SPRING_LAYOUT,\n }\n }\n >\n <ActivityRow item={item} />\n </motion.div>\n ))}\n </AnimatePresence>\n </motion.div>\n </div>\n </AgentDisclosure>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAoCA,SAAS,eAAe,UAAkB;CACxC,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,CAAC;CAChD,IAAI,UAAU,IAAI,OAAO,GAAG,QAAQ;CAEpC,MAAM,UAAU,KAAK,MAAM,UAAU,EAAE;CACvC,MAAM,YAAY,UAAU;CAC5B,OAAO,cAAc,IAAI,GAAG,QAAQ,KAAK,GAAG,QAAQ,IAAI,UAAU;AACpE;AAEA,SAAS,oBAAoB,EAC3B,MACA,aACA,gBAKC;CACD,MAAM,CAAC,cAAc,mBAAmB,SAAS,WAAW;CAC5D,MAAM,aAAa,SAAS,KAAA;CAW5B,OAAO,CAVa,QAAQ,cAEZ,aACb,SAAkB;EACjB,IAAI,CAAC,YAAY,gBAAgB,IAAI;EACrC,eAAe,IAAI;CACrB,GACA,CAAC,YAAY,YAAY,CAGA,CAAC;AAC9B;AAEA,SAAS,eAAe,OAAsD;CAC5E,MAAM,QAAQ,MAAM,EAAE,EAAE;CACxB,OAAO,SAAS,MAAM,OAAO,SAAS,KAAK,SAAS,KAAK,IAAI,QAAQ;AACvE;AAEA,SAAS,eAAe,MAAgC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;SAAM,MAAM;QAAS;QAC1C,GAAG;QACH,QAAQ;OACV;OAGN,UAAA,oBAAC,aAAD,EAAmB,KAAO,CAAA;MAChB,GAhBL,KAAK,EAgBA,CACb;KACc,CAAA;IACP,CAAA;GACT,CAAA;EACU,CAAA,CACd;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-code.d.ts","names":[],"sources":["../../../src/components/agents/agent-code.tsx"],"mappings":";YAOY;iBAEK;EACf;EACA;EACA;EACA;;YAGU,sBAAsB;iBAEjB;EACf;EACA,WAAW;EACX;;iBAGe;EACf;EACA,SAAS;EACT;;wBAsBc,mBAAmB,cAAc,UAAU,oBAAiB;wBAmD5D,gBAAgB,MAAM,QAAQ,aAAa,qCAAkB,IAAA;wBAuB7D,YAAY,MAAM,UAAmB,aAAa,iCAAc,IAAA"}
1
+ {"version":3,"file":"agent-code.d.ts","names":[],"sources":["../../../src/components/agents/agent-code.tsx"],"mappings":";YAMY;iBAEK;EACf;EACA;EACA;EACA;;YAGU,sBAAsB;iBAEjB;EACf;EACA,WAAW;EACX;;iBAGe;EACf;EACA,SAAS;EACT;;wBAsBc,mBAAmB,cAAc,UAAU,oBAAiB;wBAmD5D,gBAAgB,MAAM,QAAQ,aAAa,qCAAkB,IAAA;wBAuB7D,YAAY,MAAM,UAAmB,aAAa,iCAAc,IAAA"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, useEffect, useState } from "react";
3
- import { cn } from "@kumix/utils";
4
- import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cn } from "cn";
5
4
  import { createHighlighter } from "shiki";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/components/agents/agent-code.tsx
7
7
  const LIGHT_THEME = "github-light-high-contrast";
8
8
  const DARK_THEME = "github-dark-high-contrast";
@@ -1 +1 @@
1
- {"version":3,"file":"agent-code.js","names":[],"sources":["../../../src/components/agents/agent-code.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, Fragment, useEffect, useState } from \"react\";\nimport { createHighlighter, type Highlighter } from \"shiki\";\n\nimport { cn } from \"@kumix/utils\";\n\nexport type AgentCodeLanguage = \"bash\" | \"diff\" | \"json\" | \"text\" | \"tsx\" | \"typescript\";\n\nexport interface AgentCodeToken {\n content: string;\n offset: number;\n light?: string;\n dark?: string;\n}\n\nexport type AgentCodeTokenLines = AgentCodeToken[][];\n\nexport interface AgentCodeProps {\n code: string;\n language?: AgentCodeLanguage;\n className?: string;\n}\n\nexport interface AgentCodeLineProps {\n code: string;\n tokens?: AgentCodeToken[];\n className?: string;\n}\n\nconst LIGHT_THEME = \"github-light-high-contrast\";\nconst DARK_THEME = \"github-dark-high-contrast\";\nlet agentCodeHighlighter: Promise<Highlighter> | null = null;\nconst tokenCache = new Map<string, AgentCodeTokenLines>();\n\nfunction getAgentCodeHighlighter() {\n if (!agentCodeHighlighter) {\n agentCodeHighlighter = createHighlighter({\n themes: [LIGHT_THEME, DARK_THEME],\n langs: [\"bash\", \"diff\", \"json\", \"tsx\", \"typescript\"],\n });\n }\n return agentCodeHighlighter;\n}\n\nfunction tokenCacheKey(code: string, language: AgentCodeLanguage) {\n return `${language}\\u0000${code}`;\n}\n\nexport function useAgentCodeTokens(code: string, language: AgentCodeLanguage) {\n const key = tokenCacheKey(code, language);\n const cached = tokenCache.get(key);\n const [result, setResult] = useState<{\n key: string;\n code: string;\n language: AgentCodeLanguage;\n lines: AgentCodeTokenLines;\n } | null>(cached ? { key, code, language, lines: cached } : null);\n\n useEffect(() => {\n const current = tokenCache.get(key);\n if (current) {\n setResult({ key, code, language, lines: current });\n return;\n }\n\n let cancelled = false;\n getAgentCodeHighlighter().then((highlighter) => {\n if (cancelled) return;\n const lines = highlighter\n .codeToTokensWithThemes(code, {\n lang: language,\n themes: {\n light: LIGHT_THEME,\n dark: DARK_THEME,\n },\n })\n .map((line) =>\n line.map((token) => ({\n content: token.content,\n offset: token.offset,\n light: token.variants.light?.color,\n dark: token.variants.dark?.color,\n })),\n );\n tokenCache.set(key, lines);\n setResult({ key, code, language, lines });\n });\n return () => {\n cancelled = true;\n };\n }, [code, key, language]);\n\n if (result?.key === key) return result.lines;\n if (result?.language === language && code.startsWith(result.code)) {\n return result.lines;\n }\n return null;\n}\n\nexport function AgentCodeLine({ code, tokens, className }: AgentCodeLineProps) {\n return (\n <span className={className}>\n {tokens\n ? tokens.map((token) => (\n <span\n key={`${token.offset}-${token.content}`}\n style={\n {\n \"--agent-code-light\": token.light ?? \"currentColor\",\n \"--agent-code-dark\": token.dark ?? token.light ?? \"currentColor\",\n } as CSSProperties\n }\n className=\"text-(--agent-code-light) dark:text-(--agent-code-dark)\"\n >\n {token.content}\n </span>\n ))\n : code}\n </span>\n );\n}\n\nexport function AgentCode({ code, language = \"bash\", className }: AgentCodeProps) {\n const tokens = useAgentCodeTokens(code, language);\n let offset = 0;\n const lines = code.split(\"\\n\").map((content) => {\n const line = { content, offset };\n offset += content.length + 1;\n return line;\n });\n\n return (\n <pre\n className={cn(\n \"m-0 overflow-x-auto whitespace-pre font-mono text-foreground/85 text-xs leading-5\",\n className,\n )}\n >\n <code>\n {lines.map((line, index) => (\n <Fragment key={line.offset}>\n <AgentCodeLine code={line.content} tokens={tokens?.[index]} />\n {index < lines.length - 1 ? \"\\n\" : null}\n </Fragment>\n ))}\n </code>\n </pre>\n );\n}\n"],"mappings":";;;;;;AA8BA,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,IAAI,uBAAoD;AACxD,MAAM,6BAAa,IAAI,IAAiC;AAExD,SAAS,0BAA0B;CACjC,IAAI,CAAC,sBACH,uBAAuB,kBAAkB;EACvC,QAAQ,CAAC,aAAa,UAAU;EAChC,OAAO;GAAC;GAAQ;GAAQ;GAAQ;GAAO;EAAY;CACrD,CAAC;CAEH,OAAO;AACT;AAEA,SAAS,cAAc,MAAc,UAA6B;CAChE,OAAO,GAAG,SAAS,QAAQ;AAC7B;AAEA,SAAgB,mBAAmB,MAAc,UAA6B;CAC5E,MAAM,MAAM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gB,UAAU,EAAE,MAAM,WAAW,QAAQ,aAA6B;CAChF,MAAM,SAAS,mBAAmB,MAAM,QAAQ;CAChD,IAAI,SAAS;CACb,MAAM,QAAQ,KAAK,MAAM,IAAI,CAAC,CAAC,KAAK,YAAY;EAC9C,MAAM,OAAO;GAAE;GAAS;EAAO;EAC/B,UAAU,QAAQ,SAAS;EAC3B,OAAO;CACT,CAAC;CAED,OACE,oBAAC,OAAD;EACE,WAAW,GACT,qFACA,SACF;EAEA,UAAA,oBAAC,QAAD,EAAA,UACG,MAAM,KAAK,MAAM,UAChB,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,eAAD;GAAe,MAAM,KAAK;GAAS,QAAQ,SAAS;EAAS,CAAA,GAC5D,QAAQ,MAAM,SAAS,IAAI,OAAO,IAC3B,EAAA,GAHK,KAAK,MAGV,CACX,EACG,CAAA;CACH,CAAA;AAET"}
1
+ {"version":3,"file":"agent-code.js","names":[],"sources":["../../../src/components/agents/agent-code.tsx"],"sourcesContent":["\"use client\";\n\nimport { type CSSProperties, Fragment, useEffect, useState } from \"react\";\nimport { cn } from \"cn\";\nimport { createHighlighter, type Highlighter } from \"shiki\";\n\nexport type AgentCodeLanguage = \"bash\" | \"diff\" | \"json\" | \"text\" | \"tsx\" | \"typescript\";\n\nexport interface AgentCodeToken {\n content: string;\n offset: number;\n light?: string;\n dark?: string;\n}\n\nexport type AgentCodeTokenLines = AgentCodeToken[][];\n\nexport interface AgentCodeProps {\n code: string;\n language?: AgentCodeLanguage;\n className?: string;\n}\n\nexport interface AgentCodeLineProps {\n code: string;\n tokens?: AgentCodeToken[];\n className?: string;\n}\n\nconst LIGHT_THEME = \"github-light-high-contrast\";\nconst DARK_THEME = \"github-dark-high-contrast\";\nlet agentCodeHighlighter: Promise<Highlighter> | null = null;\nconst tokenCache = new Map<string, AgentCodeTokenLines>();\n\nfunction getAgentCodeHighlighter() {\n if (!agentCodeHighlighter) {\n agentCodeHighlighter = createHighlighter({\n themes: [LIGHT_THEME, DARK_THEME],\n langs: [\"bash\", \"diff\", \"json\", \"tsx\", \"typescript\"],\n });\n }\n return agentCodeHighlighter;\n}\n\nfunction tokenCacheKey(code: string, language: AgentCodeLanguage) {\n return `${language}\\u0000${code}`;\n}\n\nexport function useAgentCodeTokens(code: string, language: AgentCodeLanguage) {\n const key = tokenCacheKey(code, language);\n const cached = tokenCache.get(key);\n const [result, setResult] = useState<{\n key: string;\n code: string;\n language: AgentCodeLanguage;\n lines: AgentCodeTokenLines;\n } | null>(cached ? { key, code, language, lines: cached } : null);\n\n useEffect(() => {\n const current = tokenCache.get(key);\n if (current) {\n setResult({ key, code, language, lines: current });\n return;\n }\n\n let cancelled = false;\n getAgentCodeHighlighter().then((highlighter) => {\n if (cancelled) return;\n const lines = highlighter\n .codeToTokensWithThemes(code, {\n lang: language,\n themes: {\n light: LIGHT_THEME,\n dark: DARK_THEME,\n },\n })\n .map((line) =>\n line.map((token) => ({\n content: token.content,\n offset: token.offset,\n light: token.variants.light?.color,\n dark: token.variants.dark?.color,\n })),\n );\n tokenCache.set(key, lines);\n setResult({ key, code, language, lines });\n });\n return () => {\n cancelled = true;\n };\n }, [code, key, language]);\n\n if (result?.key === key) return result.lines;\n if (result?.language === language && code.startsWith(result.code)) {\n return result.lines;\n }\n return null;\n}\n\nexport function AgentCodeLine({ code, tokens, className }: AgentCodeLineProps) {\n return (\n <span className={className}>\n {tokens\n ? tokens.map((token) => (\n <span\n key={`${token.offset}-${token.content}`}\n style={\n {\n \"--agent-code-light\": token.light ?? \"currentColor\",\n \"--agent-code-dark\": token.dark ?? token.light ?? \"currentColor\",\n } as CSSProperties\n }\n className=\"text-(--agent-code-light) dark:text-(--agent-code-dark)\"\n >\n {token.content}\n </span>\n ))\n : code}\n </span>\n );\n}\n\nexport function AgentCode({ code, language = \"bash\", className }: AgentCodeProps) {\n const tokens = useAgentCodeTokens(code, language);\n let offset = 0;\n const lines = code.split(\"\\n\").map((content) => {\n const line = { content, offset };\n offset += content.length + 1;\n return line;\n });\n\n return (\n <pre\n className={cn(\n \"m-0 overflow-x-auto whitespace-pre font-mono text-foreground/85 text-xs leading-5\",\n className,\n )}\n >\n <code>\n {lines.map((line, index) => (\n <Fragment key={line.offset}>\n <AgentCodeLine code={line.content} tokens={tokens?.[index]} />\n {index < lines.length - 1 ? \"\\n\" : null}\n </Fragment>\n ))}\n </code>\n </pre>\n );\n}\n"],"mappings":";;;;;;AA6BA,MAAM,cAAc;AACpB,MAAM,aAAa;AACnB,IAAI,uBAAoD;AACxD,MAAM,6BAAa,IAAI,IAAiC;AAExD,SAAS,0BAA0B;CACjC,IAAI,CAAC,sBACH,uBAAuB,kBAAkB;EACvC,QAAQ,CAAC,aAAa,UAAU;EAChC,OAAO;GAAC;GAAQ;GAAQ;GAAQ;GAAO;EAAY;CACrD,CAAC;CAEH,OAAO;AACT;AAEA,SAAS,cAAc,MAAc,UAA6B;CAChE,OAAO,GAAG,SAAS,QAAQ;AAC7B;AAEA,SAAgB,mBAAmB,MAAc,UAA6B;CAC5E,MAAM,MAAM,cAAc,MAAM,QAAQ;CACxC,MAAM,SAAS,WAAW,IAAI,GAAG;CACjC,MAAM,CAAC,QAAQ,aAAa,SAKlB,SAAS;EAAE;EAAK;EAAM;EAAU,OAAO;CAAO,IAAI,IAAI;CAEhE,gBAAgB;EACd,MAAM,UAAU,WAAW,IAAI,GAAG;EAClC,IAAI,SAAS;GACX,UAAU;IAAE;IAAK;IAAM;IAAU,OAAO;GAAQ,CAAC;GACjD;EACF;EAEA,IAAI,YAAY;EAChB,wBAAwB,CAAC,CAAC,MAAM,gBAAgB;GAC9C,IAAI,WAAW;GACf,MAAM,QAAQ,YACX,uBAAuB,MAAM;IAC5B,MAAM;IACN,QAAQ;KACN,OAAO;KACP,MAAM;IACR;GACF,CAAC,CAAC,CACD,KAAK,SACJ,KAAK,KAAK,WAAW;IACnB,SAAS,MAAM;IACf,QAAQ,MAAM;IACd,OAAO,MAAM,SAAS,OAAO;IAC7B,MAAM,MAAM,S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2
  import { EASE_OUT } from "../../lib/ease.js";
3
- import { cn } from "@kumix/utils";
3
+ import { cn } from "cn";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { motion, useReducedMotion } from "motion/react";
6
6
  //#region src/components/agents/agent-disclosure.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"agent-disclosure.js","names":[],"sources":["../../../src/components/agents/agent-disclosure.tsx"],"sourcesContent":["\"use client\";\n\nimport type { CSSProperties } from \"react\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport interface AgentDisclosureProps extends Omit<HTMLMotionProps<\"div\">, \"animate\" | \"initial\"> {\n open: boolean;\n openHeight?: CSSProperties[\"height\"];\n}\n\n/** Shared transform-only reveal for collapsible agent content. */\nexport function AgentDisclosure({\n open,\n openHeight = \"auto\",\n className,\n style,\n transition,\n ...props\n}: AgentDisclosureProps) {\n const reduce = useReducedMotion() ?? false;\n\n return (\n <motion.div\n {...props}\n aria-hidden={!open}\n inert={!open}\n initial={false}\n animate={\n reduce\n ? { opacity: open ? 1 : 0 }\n : {\n opacity: open ? 1 : 0,\n clipPath: open ? \"inset(0 0 0% 0)\" : \"inset(0 0 100% 0)\",\n y: open ? 0 : -4,\n }\n }\n transition={\n transition ?? {\n duration: reduce ? 0 : open ? 0.22 : 0.14,\n ease: EASE_OUT,\n }\n }\n className={cn(\"overflow-hidden\", className)}\n style={{\n ...style,\n height: open ? openHeight : 0,\n pointerEvents: open ? undefined : \"none\",\n transformOrigin: \"top\",\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,gBAAgB,EAC9B,MACA,aAAa,QACb,WACA,OACA,YACA,GAAG,SACoB;CACvB,MAAM,SAAS,iBAAiB,KAAK;CAErC,OACE,oBAAC,OAAO,KAAR;EACE,GAAI;EACJ,eAAa,CAAC;EACd,OAAO,CAAC;EACR,SAAS;EACT,SACE,SACI,EAAE,SAAS,OAAO,IAAI,EAAE,IACxB;GACE,SAAS,OAAO,IAAI;GACpB,UAAU,OAAO,oBAAoB;GACrC,GAAG,OAAO,IAAI;EAChB;EAEN,YACE,cAAc;GACZ,UAAU,SAAS,IAAI,OAAO,MAAO;GACrC,MAAM;EACR;EAEF,WAAW,GAAG,mBAAmB,SAAS;EAC1C,OAAO;GACL,GAAG;GACH,QAAQ,OAAO,aAAa;GAC5B,eAAe,OAAO,KAAA,IAAY;GAClC,iBAAiB;EACnB;CACD,CAAA;AAEL"}
1
+ {"version":3,"file":"agent-disclosure.js","names":[],"sources":["../../../src/components/agents/agent-disclosure.tsx"],"sourcesContent":["\"use client\";\n\nimport type { CSSProperties } from \"react\";\nimport { cn } from \"cn\";\nimport { type HTMLMotionProps, motion, useReducedMotion } from \"motion/react\";\n\nimport { EASE_OUT } from \"../../lib/ease\";\n\nexport interface AgentDisclosureProps extends Omit<HTMLMotionProps<\"div\">, \"animate\" | \"initial\"> {\n open: boolean;\n openHeight?: CSSProperties[\"height\"];\n}\n\n/** Shared transform-only reveal for collapsible agent content. */\nexport function AgentDisclosure({\n open,\n openHeight = \"auto\",\n className,\n style,\n transition,\n ...props\n}: AgentDisclosureProps) {\n const reduce = useReducedMotion() ?? false;\n\n return (\n <motion.div\n {...props}\n aria-hidden={!open}\n inert={!open}\n initial={false}\n animate={\n reduce\n ? { opacity: open ? 1 : 0 }\n : {\n opacity: open ? 1 : 0,\n clipPath: open ? \"inset(0 0 0% 0)\" : \"inset(0 0 100% 0)\",\n y: open ? 0 : -4,\n }\n }\n transition={\n transition ?? {\n duration: reduce ? 0 : open ? 0.22 : 0.14,\n ease: EASE_OUT,\n }\n }\n className={cn(\"overflow-hidden\", className)}\n style={{\n ...style,\n height: open ? openHeight : 0,\n pointerEvents: open ? undefined : \"none\",\n transformOrigin: \"top\",\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,gBAAgB,EAC9B,MACA,aAAa,QACb,WACA,OACA,YACA,GAAG,SACoB;CACvB,MAAM,SAAS,iBAAiB,KAAK;CAErC,OACE,oBAAC,OAAO,KAAR;EACE,GAAI;EACJ,eAAa,CAAC;EACd,OAAO,CAAC;EACR,SAAS;EACT,SACE,SACI,EAAE,SAAS,OAAO,IAAI,EAAE,IACxB;GACE,SAAS,OAAO,IAAI;GACpB,UAAU,OAAO,oBAAoB;GACrC,GAAG,OAAO,IAAI;EAChB;EAEN,YACE,cAAc;GACZ,UAAU,SAAS,IAAI,OAAO,MAAO;GACrC,MAAM;EACR;EAEF,WAAW,GAAG,mBAAmB,SAAS;EAC1C,OAAO;GACL,GAAG;GACH,QAAQ,OAAO,aAAa;GAC5B,eAAe,OAAO,KAAA,IAAY;GAClC,iBAAiB;EACnB;CACD,CAAA;AAEL"}
@@ -3,10 +3,10 @@ import { useTouchCapable } from "../../hooks/use-touch-capable.js";
3
3
  import { EASE_OUT, SPRING_LAYOUT } from "../../lib/ease.js";
4
4
  import { MorphPopover, MorphPopoverContent, MorphPopoverTrigger } from "../motion/popover-morph.js";
5
5
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
- import { cn } from "@kumix/utils";
7
- import { ArrowDown, ArrowUp, Bookmark, FileText, Folder, FolderInput, FolderOpen, MoreHorizontal, Pencil, Undo2 } from "lucide-react";
6
+ import { cn } from "cn";
8
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
8
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
9
+ import { ArrowDown, ArrowUp, Bookmark, FileText, Folder, FolderInput, FolderOpen, MoreHorizontal, Pencil, Undo2 } from "lucide-react";
10
10
  //#region src/components/agents/ai-sidebar.tsx
11
11
  const ROW_REVEAL = {
12
12
  duration: .16,
@@ -1 +1 @@
1
- {"version":3,"file":"ai-sidebar.js","names":[],"sources":["../../../src/components/agents/ai-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type DragEvent,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n ArrowDown,\n ArrowUp,\n Bookmark,\n FileText,\n Folder,\n FolderInput,\n FolderOpen,\n type LucideIcon,\n MoreHorizontal,\n Pencil,\n Undo2,\n} from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useTouchCapable } from \"../../hooks/use-touch-capable\";\nimport { EASE_OUT, SPRING_LAYOUT } from \"../../lib/ease\";\nimport { MorphPopover, MorphPopoverContent, MorphPopoverTrigger } from \"../motion/popover-morph\";\n\nexport type SidebarResourceKind = \"folder\" | \"project\" | \"file\" | \"bookmark\";\n\nexport interface SidebarResource {\n id: string;\n label: string;\n kind: SidebarResourceKind;\n children?: SidebarResource[];\n disabled?: boolean;\n}\n\nexport type SidebarResourceDropPosition = \"before\" | \"inside\" | \"after\";\n\nexport interface SidebarResourceMove {\n itemId: string;\n targetId: string | null;\n position: SidebarResourceDropPosition;\n}\n\n/**\n * The moves this row can make right now, the same four the keyboard offers on\n * `Alt+Shift+Arrow`. A pointer drag is the fast path for them; a finger has no\n * drag to give, so the row menu carries them too. Absent keys are moves this\n * row cannot make from where it sits.\n */\nexport interface SidebarResourceMoveCommands {\n up?: () => void;\n down?: () => void;\n into?: { label: string; run: () => void };\n out?: () => void;\n}\n\nexport interface SidebarResourceMenuControls {\n close: () => void;\n rename: () => void;\n moves: SidebarResourceMoveCommands;\n}\n\nexport interface AISidebarProps {\n items?: SidebarResource[];\n defaultItems?: SidebarResource[];\n onItemsChange?: (items: SidebarResource[]) => void;\n /** Reject the promise to roll the optimistic move back. */\n onMove?: (move: SidebarResourceMove) => void | Promise<void>;\n onMoveError?: (error: unknown, move: SidebarResourceMove) => void;\n onRename?: (item: SidebarResource, label: string) => void | Promise<void>;\n activeId?: string | null;\n defaultActiveId?: string | null;\n onActiveChange?: (id: string) => void;\n defaultExpandedIds?: string[];\n renderIcon?: (item: SidebarResource) => ReactNode;\n renderMenu?: (item: SidebarResource, controls: SidebarResourceMenuControls) => ReactNode;\n ariaLabel?: string;\n className?: string;\n}\n\ninterface FlatResource {\n item: SidebarResource;\n depth: number;\n parentId: string | null;\n}\n\ninterface DropTarget {\n id: string | null;\n position: SidebarResourceDropPosition;\n}\n\nconst ROW_REVEAL = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nfunction canContain(item: SidebarResource) {\n return item.kind === \"folder\" || item.kind === \"project\";\n}\n\nfunction flattenResources(\n items: SidebarResource[],\n expanded: Set<string>,\n depth = 0,\n parentId: string | null = null,\n): FlatResource[] {\n return items.flatMap((item) => {\n const row = { item, depth, parentId };\n if (!item.children?.length || !expanded.has(item.id)) return [row];\n return [row, ...flattenResources(item.children, expanded, depth + 1, item.id)];\n });\n}\n\nfunction findResource(items: SidebarResource[], id: string): SidebarResource | undefined {\n for (const item of items) {\n if (item.id === id) return item;\n const child = item.children ? findResource(item.children, id) : undefined;\n if (child) return child;\n }\n}\n\nfunction containsResource(item: SidebarResource, id: string): boolean {\n return item.id === id || item.children?.some((child) => containsResource(child, id)) === true;\n}\n\nfunction removeResource(\n items: SidebarResource[],\n id: string,\n): { items: SidebarResource[]; removed?: SidebarResource } {\n let removed: SidebarResource | undefined;\n const next: SidebarResource[] = [];\n\n for (const item of items) {\n if (item.id === id) {\n removed = item;\n continue;\n }\n\n if (item.children?.length) {\n const childResult = removeResource(item.children, id);\n if (childResult.removed) {\n removed = childResult.removed;\n next.push({ ...item, children: childResult.items });\n continue;\n }\n }\n\n next.push(item);\n }\n\n return { items: next, removed };\n}\n\nfunction insertResource(\n items: SidebarResource[],\n resource: SidebarResource,\n targetId: string | null,\n position: SidebarResourceDropPosition,\n): SidebarResource[] {\n if (targetId === null) return [...items, resource];\n\n const next: SidebarResource[] = [];\n for (const item of items) {\n if (item.id === targetId) {\n if (position === \"before\") next.push(resource, item);\n else if (position === \"after\") next.push(item, resource);\n else next.push({ ...item, children: [...(item.children ?? []), resource] });\n continue;\n }\n\n if (item.children?.length) {\n next.push({\n ...item,\n children: insertResource(item.children, resource, targetId, position),\n });\n } else {\n next.push(item);\n }\n }\n return next;\n}\n\nfunction moveResource(\n items: SidebarResource[],\n move: SidebarResourceMove,\n): SidebarResource[] | null {\n const source = findResource(items, move.itemId);\n if (!source || source.disabled) return null;\n if (move.targetId && containsResource(source, move.targetId)) return null;\n\n const target = move.targetId ? findResource(items, move.targetId) : undefined;\n if (move.position === \"inside\" && (!target || target.disabled || !canContain(target)))\n return null;\n\n const removed = removeResource(items, move.itemId);\n if (!removed.removed) return null;\n return insertResource(removed.items, removed.removed, move.targetId, move.position);\n}\n\nfunction renameResource(items: SidebarResource[], id: string, label: string): SidebarResource[] {\n return items.map((item) => ({\n ...item,\n label: item.id === id ? label : item.label,\n children: item.children ? renameResource(item.children, id, label) : undefined,\n }));\n}\n\nfunction defaultIcon(item: SidebarResource, expanded: boolean) {\n const Icon =\n item.kind === \"folder\" || item.kind === \"project\"\n ? expanded\n ? FolderOpen\n : Folder\n : item.kind === \"bookmark\"\n ? Bookmark\n : FileText;\n return <Icon className=\"size-4\" />;\n}\n\nfunction MarqueeLabel({ active, children }: { active: boolean; children: string }) {\n const reduce = useReducedMotion() ?? false;\n const viewportRef = useRef<HTMLSpanElement>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const [distance, setDistance] = useState(0);\n\n useEffect(() => {\n const measure = () => {\n const viewport = viewportRef.current;\n const label = labelRef.current;\n if (!viewport || !label) return;\n setDistance(label.scrollWidth > viewport.clientWidth ? label.scrollWidth + 24 : 0);\n };\n measure();\n const observer = new ResizeObserver(measure);\n if (viewportRef.current) observer.observe(viewportRef.current);\n if (labelRef.current) observer.observe(labelRef.current);\n return () => observer.disconnect();\n }, []);\n\n const running = active && distance > 0 && !reduce;\n\n return (\n <span ref={viewportRef} className=\"block min-w-0 flex-1 overflow-hidden\">\n <motion.span\n className=\"flex w-max items-center gap-6 whitespace-nowrap\"\n animate={{ x: running ? [0, -distance] : 0 }}\n transition={\n running\n ? {\n duration: Math.max(2.4, distance / 34),\n ease: \"linear\",\n repeat: Number.POSITIVE_INFINITY,\n repeatDelay: 2,\n }\n : ROW_REVEAL\n }\n >\n <span ref={labelRef}>{children}</span>\n {running ? <span aria-hidden=\"true\">{children}</span> : null}\n </motion.span>\n </span>\n );\n}\n\nfunction ResourceMenuAction({\n icon: Icon,\n onSelect,\n children,\n}: {\n icon: LucideIcon;\n onSelect: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n className=\"flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-foreground text-xs outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Icon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n <span className=\"min-w-0 truncate\">{children}</span>\n </button>\n );\n}\n\ninterface ResourceRowProps {\n row: FlatResource;\n active: boolean;\n expanded: boolean;\n focused: boolean;\n draggingId: string | null;\n dropTarget: DropTarget | null;\n menuOpen: boolean;\n moves: SidebarResourceMoveCommands;\n renaming: boolean;\n onDragEnd: () => void;\n onDragOver: (event: DragEvent<HTMLDivElement>, row: FlatResource) => void;\n onDragStart: (event: DragEvent<HTMLDivElement>, id: string) => void;\n onDrop: (event: DragEvent<HTMLDivElement>) => void;\n onFocus: () => void;\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;\n onMenuOpenChange: (open: boolean) => void;\n onRenameCancel: () => void;\n onRenameCommit: (label: string) => void;\n onRenameStart: () => void;\n onSelect: () => void;\n onToggle: () => void;\n renderIcon?: (item: SidebarResource) => ReactNode;\n renderMenu?: AISidebarProps[\"renderMenu\"];\n setRef: (node: HTMLDivElement | null) => void;\n}\n\nfunction ResourceRow({\n row,\n active,\n expanded,\n focused,\n draggingId,\n dropTarget,\n menuOpen,\n moves,\n renaming,\n onDragEnd,\n onDragOver,\n onDragStart,\n onDrop,\n onFocus,\n onKeyDown,\n onMenuOpenChange,\n onRenameCancel,\n onRenameCommit,\n onRenameStart,\n onSelect,\n onToggle,\n renderIcon,\n renderMenu,\n setRef,\n}: ResourceRowProps) {\n const reduce = useReducedMotion() ?? false;\n const canTouch = useTouchCapable();\n const [hovered, setHovered] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const skipRenameBlurRef = useRef(false);\n const draggedRef = useRef(false);\n const [draft, setDraft] = useState(row.item.label);\n const acceptsChildren = canContain(row.item);\n const isDragging = draggingId === row.item.id;\n const dropPosition = dropTarget?.id === row.item.id ? dropTarget.position : null;\n\n useEffect(() => {\n if (!renaming) return;\n skipRenameBlurRef.current = false;\n setDraft(row.item.label);\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n inputRef.current?.select();\n });\n }, [renaming, row.item.label]);\n\n const runFromMenu = (action: () => void) => () => {\n onMenuOpenChange(false);\n action();\n };\n\n const menu = renderMenu?.(row.item, {\n close: () => onMenuOpenChange(false),\n rename: () => {\n onMenuOpenChange(false);\n onRenameStart();\n },\n moves,\n }) ?? (\n <>\n <ResourceMenuAction icon={Pencil} onSelect={runFromMenu(onRenameStart)}>\n Rename\n </ResourceMenuAction>\n {moves.up || moves.down || moves.into || moves.out ? (\n <div aria-hidden=\"true\" className=\"my-1 h-px bg-border\" />\n ) : null}\n {moves.up ? (\n <ResourceMenuAction icon={ArrowUp} onSelect={runFromMenu(moves.up)}>\n Move up\n </ResourceMenuAction>\n ) : null}\n {moves.down ? (\n <ResourceMenuAction icon={ArrowDown} onSelect={runFromMenu(moves.down)}>\n Move down\n </ResourceMenuAction>\n ) : null}\n {moves.into ? (\n <ResourceMenuAction icon={FolderInput} onSelect={runFromMenu(moves.into.run)}>\n Move into {moves.into.label}\n </ResourceMenuAction>\n ) : null}\n {moves.out ? (\n <ResourceMenuAction icon={Undo2} onSelect={runFromMenu(moves.out)}>\n Move out\n </ResourceMenuAction>\n ) : null}\n </>\n );\n\n return (\n <motion.div\n ref={setRef}\n layout=\"position\"\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n role=\"treeitem\"\n aria-level={row.depth + 1}\n aria-selected={acceptsChildren ? undefined : active}\n aria-expanded={acceptsChildren ? expanded : undefined}\n aria-disabled={row.item.disabled || undefined}\n tabIndex={focused ? 0 : -1}\n draggable={!row.item.disabled && !renaming}\n data-menu-open={menuOpen || undefined}\n data-drop={dropPosition ?? undefined}\n data-dragging={isDragging || undefined}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onClick={(event) => {\n if (event.defaultPrevented || draggedRef.current || renaming || row.item.disabled) return;\n if (acceptsChildren) onToggle();\n else onSelect();\n }}\n onDoubleClick={(event) => {\n if (acceptsChildren || row.item.disabled) return;\n event.preventDefault();\n onRenameStart();\n }}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onDragStartCapture={(event) => {\n draggedRef.current = true;\n onDragStart(event, row.item.id);\n }}\n onDragEndCapture={() => {\n onDragEnd();\n requestAnimationFrame(() => {\n draggedRef.current = false;\n });\n }}\n onDragOver={(event) => onDragOver(event, row)}\n onDrop={onDrop}\n className={cn(\n \"group/resource relative flex min-h-9 min-w-0 cursor-pointer items-center gap-2.5 rounded-xl pr-3 text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset\",\n \"data-[menu-open=true]:bg-muted data-[menu-open=true]:text-foreground\",\n \"data-[dragging=true]:opacity-40\",\n \"data-[drop=inside]:bg-primary/10 data-[drop=inside]:ring-1 data-[drop=inside]:ring-primary/45\",\n \"data-[drop=before]:before:absolute data-[drop=before]:before:-top-0.5 data-[drop=before]:before:right-2 data-[drop=before]:before:left-2 data-[drop=before]:before:h-0.5 data-[drop=before]:before:rounded-full data-[drop=before]:before:bg-primary\",\n \"data-[drop=after]:after:absolute data-[drop=after]:after:right-2 data-[drop=after]:after:-bottom-0.5 data-[drop=after]:after:left-2 data-[drop=after]:after:h-0.5 data-[drop=after]:after:rounded-full data-[drop=after]:after:bg-primary\",\n !acceptsChildren && active && \"bg-muted text-foreground\",\n row.item.disabled && \"cursor-not-allowed opacity-45\",\n )}\n style={{ paddingLeft: `${12 + row.depth * 16}px` }}\n >\n <span aria-hidden=\"true\" className=\"grid size-5 shrink-0 place-items-center\">\n {renderIcon?.(row.item) ?? defaultIcon(row.item, expanded)}\n </span>\n\n {renaming ? (\n <input\n ref={inputRef}\n value={draft}\n aria-label={`Rename ${row.item.label}`}\n onChange={(event) => setDraft(event.target.value)}\n draggable={false}\n onClick={(event) => event.stopPropagation()}\n onDoubleClick={(event) => event.stopPropagation()}\n onBlur={() => {\n if (!skipRenameBlurRef.current) onRenameCommit(draft);\n }}\n onKeyDown={(event) => {\n event.stopPropagation();\n if (event.key === \"Enter\") {\n skipRenameBlurRef.current = true;\n onRenameCommit(draft);\n }\n if (event.key === \"Escape\") {\n skipRenameBlurRef.current = true;\n onRenameCancel();\n }\n }}\n className=\"mx-1 h-7 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-foreground text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n ) : (\n <MarqueeLabel active={hovered || menuOpen}>{row.item.label}</MarqueeLabel>\n )}\n\n {!renaming && !row.item.disabled ? (\n <MorphPopover open={menuOpen} onOpenChange={onMenuOpenChange}>\n <MorphPopoverTrigger>\n <button\n type=\"button\"\n draggable={false}\n tabIndex={-1}\n aria-label={`Actions for ${row.item.label}`}\n onClick={(event) => event.stopPropagation()}\n className={cn(\n \"grid size-7 shrink-0 place-items-center rounded-lg outline-none transition-opacity hover:bg-foreground/5 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring group-hover/resource:opacity-100 group-data-[menu-open=true]/resource:opacity-100\",\n // A finger never hovers, and this menu is the only path to\n // rename and move without a drag — keep it on screen there.\n canTouch ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <MoreHorizontal aria-hidden=\"true\" className=\"size-4\" />\n </button>\n </MorphPopoverTrigger>\n <MorphPopoverContent\n side=\"bottom\"\n align=\"end\"\n sideOffset={8}\n radius={12}\n className=\"w-40 p-1.5\"\n >\n <div data-sidebar-resource-menu={row.item.id}>{menu}</div>\n </MorphPopoverContent>\n </MorphPopover>\n ) : null}\n </motion.div>\n );\n}\n\nexport function AISidebar({\n items,\n defaultItems = [],\n onItemsChange,\n onMove,\n onMoveError,\n onRename,\n activeId,\n defaultActiveId = null,\n onActiveChange,\n defaultExpandedIds = [],\n renderIcon,\n renderMenu,\n ariaLabel = \"Resources\",\n className,\n}: AISidebarProps) {\n const [internalItems, setInternalItems] = useState(items ?? defaultItems);\n const [internalActiveId, setInternalActiveId] = useState(defaultActiveId);\n const [expandedIds, setExpandedIds] = useState(() => new Set(defaultExpandedIds));\n const [focusedId, setFocusedId] = useState<string | null>(activeId ?? defaultActiveId);\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dropTarget, setDropTarget] = useState<DropTarget | null>(null);\n const [menuOpenId, setMenuOpenId] = useState<string | null>(null);\n const [renamingId, setRenamingId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState(\"\");\n const rowRefs = useRef(new Map<string, HTMLDivElement>());\n const movePendingRef = useRef(false);\n const renderedItems = internalItems;\n const selectedId = activeId ?? internalActiveId;\n\n useEffect(() => {\n if (items) setInternalItems(items);\n }, [items]);\n\n const flat = useMemo(\n () => flattenResources(renderedItems, expandedIds),\n [expandedIds, renderedItems],\n );\n\n // Which row carries the roving tabindex is resolved during render, never in\n // a passive effect: an effect lands after the browser paints, so the first\n // commit — and, on a server-rendered page, the markup itself — would have no\n // tabbable row and Tab would skip the whole tree. The same hole opens again\n // whenever a collapse or a rolled-back move takes the focused row out of it.\n const focusedRow =\n focusedId !== null && flat.some((row) => row.item.id === focusedId)\n ? focusedId\n : (flat[0]?.item.id ?? null);\n if (focusedId !== focusedRow) setFocusedId(focusedRow);\n\n useEffect(() => {\n if (!menuOpenId) return;\n const frame = requestAnimationFrame(() => {\n const menus = Array.from(\n document.querySelectorAll<HTMLElement>(\"[data-sidebar-resource-menu]\"),\n );\n menus\n .find((menu) => menu.dataset.sidebarResourceMenu === menuOpenId)\n ?.querySelector<HTMLElement>(\"button, a[href]\")\n ?.focus();\n });\n return () => cancelAnimationFrame(frame);\n }, [menuOpenId]);\n\n const updateItems = useCallback(\n (next: SidebarResource[]) => {\n setInternalItems(next);\n onItemsChange?.(next);\n },\n [onItemsChange],\n );\n\n const performMove = useCallback(\n async (move: SidebarResourceMove) => {\n if (movePendingRef.current) {\n setAnnouncement(\"Wait for the current move to finish.\");\n return;\n }\n const before = renderedItems;\n const next = moveResource(before, move);\n if (!next || next === before) return;\n\n movePendingRef.current = true;\n updateItems(next);\n setDropTarget(null);\n setDraggingId(null);\n const moved = findResource(before, move.itemId);\n const target = move.targetId ? findResource(before, move.targetId) : null;\n setAnnouncement(\n target\n ? `Moved ${moved?.label ?? \"item\"} ${move.position} ${target.label}.`\n : `Moved ${moved?.label ?? \"item\"} to the top level.`,\n );\n\n try {\n await onMove?.(move);\n } catch (error) {\n updateItems(before);\n setAnnouncement(`Move failed. ${moved?.label ?? \"Item\"} was restored.`);\n onMoveError?.(error, move);\n } finally {\n movePendingRef.current = false;\n }\n },\n [onMove, onMoveError, renderedItems, updateItems],\n );\n\n const focusRow = useCallback((id: string) => {\n setFocusedId(id);\n requestAnimationFrame(() => rowRefs.current.get(id)?.focus());\n }, []);\n\n const select = useCallback(\n (id: string) => {\n if (activeId === undefined) setInternalActiveId(id);\n onActiveChange?.(id);\n },\n [activeId, onActiveChange],\n );\n\n const toggle = useCallback((id: string) => {\n setExpandedIds((current) => {\n const next = new Set(current);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n // The same four moves `Alt+Shift+Arrow` performs, handed to the row menu so\n // they survive on a device with no drag and no modifier keys.\n const moveCommands = useCallback(\n (row: FlatResource): SidebarResourceMoveCommands => {\n if (row.item.disabled) return {};\n const index = flat.findIndex(({ item }) => item.id === row.item.id);\n const previous = flat[index - 1];\n const next = flat[index + 1];\n const parentId = row.parentId;\n const commands: SidebarResourceMoveCommands = {};\n\n if (previous) {\n commands.up = () =>\n void performMove({\n itemId: row.item.id,\n targetId: previous.item.id,\n position: \"before\",\n });\n }\n if (next) {\n commands.down = () =>\n void performMove({\n itemId: row.item.id,\n targetId: next.item.id,\n position: \"after\",\n });\n }\n // Only offer the reparent when it lands somewhere new — the row above a\n // folder's first child is the folder it already lives in.\n if (previous && canContain(previous.item) && previous.item.id !== parentId) {\n commands.into = {\n label: previous.item.label,\n run: () => {\n setExpandedIds((current) => new Set(current).add(previous.item.id));\n void performMove({\n itemId: row.item.id,\n targetId: previous.item.id,\n position: \"inside\",\n });\n },\n };\n }\n if (parentId) {\n commands.out = () =>\n void performMove({\n itemId: row.item.id,\n targetId: parentId,\n position: \"after\",\n });\n }\n\n return commands;\n },\n [flat, performMove],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>, row: FlatResource) => {\n const index = flat.findIndex(({ item }) => item.id === row.item.id);\n const previous = flat[index - 1];\n const next = flat[index + 1];\n const moveModifier = event.altKey && event.shiftKey;\n\n if (event.key === \"ArrowDown\" && !moveModifier && next) {\n event.preventDefault();\n focusRow(next.item.id);\n return;\n }\n if (event.key === \"ArrowUp\" && !moveModifier && previous) {\n event.preventDefault();\n focusRow(previous.item.id);\n return;\n }\n if (event.key === \"Home\" && flat[0]) {\n event.preventDefault();\n focusRow(flat[0].item.id);\n return;\n }\n if (event.key === \"End\" && flat.at(-1)) {\n event.preventDefault();\n focusRow(flat.at(-1)?.item.id ?? row.item.id);\n return;\n }\n\n if (row.item.disabled) {\n if (event.key === \"ArrowLeft\" && row.parentId) {\n event.preventDefault();\n focusRow(row.parentId);\n } else if (\n moveModifier ||\n [\"ArrowRight\", \"Enter\", \" \", \"F2\", \"ContextMenu\"].includes(event.key) ||\n (event.shiftKey && event.key === \"F10\")\n ) {\n event.preventDefault();\n }\n return;\n }\n\n if (moveModifier && event.key === \"ArrowUp\" && previous) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: previous.item.id, position: \"before\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowDown\" && next) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: next.item.id, position: \"after\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowRight\" && previous && canContain(previous.item)) {\n event.preventDefault();\n setExpandedIds((current) => new Set(current).add(previous.item.id));\n void performMove({ itemId: row.item.id, targetId: previous.item.id, position: \"inside\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowLeft\" && row.parentId) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: row.parentId, position: \"after\" });\n return;\n }\n\n if (event.key === \"ArrowRight\" && canContain(row.item)) {\n event.preventDefault();\n if (!expandedIds.has(row.item.id)) toggle(row.item.id);\n else if (next?.parentId === row.item.id) focusRow(next.item.id);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n if (expandedIds.has(row.item.id)) toggle(row.item.id);\n else if (row.parentId) focusRow(row.parentId);\n } else if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (canContain(row.item)) toggle(row.item.id);\n else select(row.item.id);\n } else if (event.key === \"F2\") {\n event.preventDefault();\n setRenamingId(row.item.id);\n } else if (event.key === \"ContextMenu\" || (event.shiftKey && event.key === \"F10\")) {\n event.preventDefault();\n setMenuOpenId(row.item.id);\n }\n },\n [expandedIds, flat, focusRow, performMove, select, toggle],\n );\n\n return (\n <>\n <div\n role=\"tree\"\n aria-label={ariaLabel}\n aria-multiselectable=\"false\"\n onDragOver={(event) => {\n if (!draggingId || event.target !== event.currentTarget) return;\n event.preventDefault();\n setDropTarget({ id: null, position: \"after\" });\n }}\n onDrop={(event) => {\n event.preventDefault();\n if (draggingId && dropTarget) {\n void performMove({\n itemId: draggingId,\n targetId: dropTarget.id,\n position: dropTarget.position,\n });\n }\n }}\n className={cn(\n \"relative flex min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden\",\n draggingId && \"select-none pb-9\",\n className,\n )}\n >\n <AnimatePresence initial={false}>\n {flat.map((row) => (\n <ResourceRow\n key={row.item.id}\n row={row}\n active={selectedId === row.item.id}\n expanded={expandedIds.has(row.item.id)}\n focused={focusedRow === row.item.id}\n draggingId={draggingId}\n dropTarget={dropTarget}\n menuOpen={menuOpenId === row.item.id}\n moves={moveCommands(row)}\n renaming={renamingId === row.item.id}\n onFocus={() => setFocusedId(row.item.id)}\n onSelect={() => select(row.item.id)}\n onToggle={() => toggle(row.item.id)}\n onKeyDown={(event) => handleKeyDown(event, row)}\n onRenameStart={() => setRenamingId(row.item.id)}\n onRenameCancel={() => setRenamingId(null)}\n onRenameCommit={(label) => {\n const trimmed = label.trim();\n setRenamingId(null);\n if (!trimmed || trimmed === row.item.label) return;\n const before = renderedItems;\n updateItems(renameResource(before, row.item.id, trimmed));\n void Promise.resolve(onRename?.(row.item, trimmed)).catch(() => {\n updateItems(before);\n setAnnouncement(`Rename failed. ${row.item.label} was restored.`);\n });\n }}\n onMenuOpenChange={(open) => {\n setMenuOpenId(open ? row.item.id : null);\n if (!open) focusRow(row.item.id);\n }}\n onDragStart={(event, id) => {\n setDraggingId(id);\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(\"text/plain\", id);\n }}\n onDragEnd={() => {\n setDraggingId(null);\n setDropTarget(null);\n }}\n onDragOver={(event, targetRow) => {\n if (!draggingId || draggingId === targetRow.item.id) return;\n const source = findResource(renderedItems, draggingId);\n if (source && containsResource(source, targetRow.item.id)) return;\n event.preventDefault();\n event.stopPropagation();\n const rect = event.currentTarget.getBoundingClientRect();\n const ratio = (event.clientY - rect.top) / rect.height;\n const position =\n !targetRow.item.disabled &&\n canContain(targetRow.item) &&\n ratio >= 0.25 &&\n ratio <= 0.75\n ? \"inside\"\n : ratio < 0.5\n ? \"before\"\n : \"after\";\n setDropTarget({ id: targetRow.item.id, position });\n }}\n onDrop={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (draggingId && dropTarget) {\n void performMove({\n itemId: draggingId,\n targetId: dropTarget.id,\n position: dropTarget.position,\n });\n }\n }}\n renderIcon={renderIcon}\n renderMenu={renderMenu}\n setRef={(node) => {\n if (node) rowRefs.current.set(row.item.id, node);\n else rowRefs.current.delete(row.item.id);\n }}\n />\n ))}\n </AnimatePresence>\n\n {draggingId ? (\n <div\n aria-hidden=\"true\"\n data-active={dropTarget?.id === null || undefined}\n className=\"absolute inset-x-1 bottom-0 flex h-8 items-center justify-center rounded-lg border border-border border-dashed text-[10px] text-muted-foreground data-[active=true]:border-primary/50 data-[active=true]:bg-primary/10 data-[active=true]:text-foreground\"\n >\n Move to top level\n </div>\n ) : null}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </span>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAkGA,MAAM,aAAa;CACjB,UAAU;CACV,MAAM;AACR;AAEA,SAAS,WAAW,MAAuB;CACzC,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS;AACjD;AAEA,SAAS,iBACP,OACA,UACA,QAAQ,GACR,WAA0B,MACV;CAChB,OAAO,MAAM,SAAS,SAAS;EAC7B,MAAM,MAAM;GAAE;GAAM;GAAO;EAAS;EACpC,IAAI,CAAC,KAAK,UAAU,UAAU,CAAC,SAAS,IAAI,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG;EACjE,OAAO,CAAC,KAAK,GAAG,iBAAiB,KAAK,UAAU,UAAU,QAAQ,GAAG,KAAK,EAAE,CAAC;CAC/E,CAAC;AACH;AAEA,SAAS,aAAa,OAA0B,IAAyC;CACvF,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,OAAO,IAAI,OAAO;EAC3B,MAAM,QAAQ,KAAK,WAAW,aAAa,KAAK,UAAU,EAAE,IAAI,KAAA;EAChE,IAAI,OAAO,OAAO;CACpB;AACF;AAEA,SAAS,iBAAiB,MAAuB,IAAqB;CACpE,OAA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,MAAM,SAAS,aAAa,eAAe,UAAU;KACrD,IAAI,UAAU,iBAAiB,QAAQ,UAAU,KAAK,EAAE,GAAG;KAC3D,MAAM,eAAe;KACrB,MAAM,gBAAgB;KACtB,MAAM,OAAO,MAAM,cAAc,sBAAsB;KACvD,MAAM,SAAS,MAAM,UAAU,KAAK,OAAO,KAAK;KAChD,MAAM,WACJ,CAAC,UAAU,KAAK,YAChB,WAAW,UAAU,IAAI,KACzB,SAAS,OACT,SAAS,MACL,WACA,QAAQ,KACN,WACA;KACR,cAAc;MAAE,IAAI,UAAU,KAAK;MAAI;KAAS,CAAC;IACnD;IACA,SAAS,UAAU;KACjB,MAAM,eAAe;KACrB,MAAM,gBAAgB;KACtB,IAAI,cAAc,YAChB,YAAiB;MACf,QAAQ;MACR,UAAU,WAAW;MACrB,UAAU,WAAW;KACvB,CAAC;IAEL;IACY;IACA;IACZ,SAAS,SAAS;KAChB,IAAI,MAAM,QAAQ,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI;UAC1C,QAAQ,QAAQ,OAAO,IAAI,KAAK,EAAE;IACzC;GACD,GA5EM,IAAI,KAAK,EA4Ef,CACF;EACc,CAAA,GAEhB,aACC,oBAAC,OAAD;GACE,eAAY;GACZ,eAAa,YAAY,OAAO,QAAQ,KAAA;GACxC,WAAU;GACX,UAAA;EAEI,CAAA,IACH,IACD;CACL,CAAA,GAAA,oBAAC,QAAD;EAAM,WAAU;EAAU,aAAU;EACjC,UAAA;CACG,CAAA,CACN,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"ai-sidebar.js","names":[],"sources":["../../../src/components/agents/ai-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type DragEvent,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { cn } from \"cn\";\nimport {\n ArrowDown,\n ArrowUp,\n Bookmark,\n FileText,\n Folder,\n FolderInput,\n FolderOpen,\n type LucideIcon,\n MoreHorizontal,\n Pencil,\n Undo2,\n} from \"lucide-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\n\nimport { useTouchCapable } from \"../../hooks/use-touch-capable\";\nimport { EASE_OUT, SPRING_LAYOUT } from \"../../lib/ease\";\nimport { MorphPopover, MorphPopoverContent, MorphPopoverTrigger } from \"../motion/popover-morph\";\n\nexport type SidebarResourceKind = \"folder\" | \"project\" | \"file\" | \"bookmark\";\n\nexport interface SidebarResource {\n id: string;\n label: string;\n kind: SidebarResourceKind;\n children?: SidebarResource[];\n disabled?: boolean;\n}\n\nexport type SidebarResourceDropPosition = \"before\" | \"inside\" | \"after\";\n\nexport interface SidebarResourceMove {\n itemId: string;\n targetId: string | null;\n position: SidebarResourceDropPosition;\n}\n\n/**\n * The moves this row can make right now, the same four the keyboard offers on\n * `Alt+Shift+Arrow`. A pointer drag is the fast path for them; a finger has no\n * drag to give, so the row menu carries them too. Absent keys are moves this\n * row cannot make from where it sits.\n */\nexport interface SidebarResourceMoveCommands {\n up?: () => void;\n down?: () => void;\n into?: { label: string; run: () => void };\n out?: () => void;\n}\n\nexport interface SidebarResourceMenuControls {\n close: () => void;\n rename: () => void;\n moves: SidebarResourceMoveCommands;\n}\n\nexport interface AISidebarProps {\n items?: SidebarResource[];\n defaultItems?: SidebarResource[];\n onItemsChange?: (items: SidebarResource[]) => void;\n /** Reject the promise to roll the optimistic move back. */\n onMove?: (move: SidebarResourceMove) => void | Promise<void>;\n onMoveError?: (error: unknown, move: SidebarResourceMove) => void;\n onRename?: (item: SidebarResource, label: string) => void | Promise<void>;\n activeId?: string | null;\n defaultActiveId?: string | null;\n onActiveChange?: (id: string) => void;\n defaultExpandedIds?: string[];\n renderIcon?: (item: SidebarResource) => ReactNode;\n renderMenu?: (item: SidebarResource, controls: SidebarResourceMenuControls) => ReactNode;\n ariaLabel?: string;\n className?: string;\n}\n\ninterface FlatResource {\n item: SidebarResource;\n depth: number;\n parentId: string | null;\n}\n\ninterface DropTarget {\n id: string | null;\n position: SidebarResourceDropPosition;\n}\n\nconst ROW_REVEAL = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nfunction canContain(item: SidebarResource) {\n return item.kind === \"folder\" || item.kind === \"project\";\n}\n\nfunction flattenResources(\n items: SidebarResource[],\n expanded: Set<string>,\n depth = 0,\n parentId: string | null = null,\n): FlatResource[] {\n return items.flatMap((item) => {\n const row = { item, depth, parentId };\n if (!item.children?.length || !expanded.has(item.id)) return [row];\n return [row, ...flattenResources(item.children, expanded, depth + 1, item.id)];\n });\n}\n\nfunction findResource(items: SidebarResource[], id: string): SidebarResource | undefined {\n for (const item of items) {\n if (item.id === id) return item;\n const child = item.children ? findResource(item.children, id) : undefined;\n if (child) return child;\n }\n}\n\nfunction containsResource(item: SidebarResource, id: string): boolean {\n return item.id === id || item.children?.some((child) => containsResource(child, id)) === true;\n}\n\nfunction removeResource(\n items: SidebarResource[],\n id: string,\n): { items: SidebarResource[]; removed?: SidebarResource } {\n let removed: SidebarResource | undefined;\n const next: SidebarResource[] = [];\n\n for (const item of items) {\n if (item.id === id) {\n removed = item;\n continue;\n }\n\n if (item.children?.length) {\n const childResult = removeResource(item.children, id);\n if (childResult.removed) {\n removed = childResult.removed;\n next.push({ ...item, children: childResult.items });\n continue;\n }\n }\n\n next.push(item);\n }\n\n return { items: next, removed };\n}\n\nfunction insertResource(\n items: SidebarResource[],\n resource: SidebarResource,\n targetId: string | null,\n position: SidebarResourceDropPosition,\n): SidebarResource[] {\n if (targetId === null) return [...items, resource];\n\n const next: SidebarResource[] = [];\n for (const item of items) {\n if (item.id === targetId) {\n if (position === \"before\") next.push(resource, item);\n else if (position === \"after\") next.push(item, resource);\n else next.push({ ...item, children: [...(item.children ?? []), resource] });\n continue;\n }\n\n if (item.children?.length) {\n next.push({\n ...item,\n children: insertResource(item.children, resource, targetId, position),\n });\n } else {\n next.push(item);\n }\n }\n return next;\n}\n\nfunction moveResource(\n items: SidebarResource[],\n move: SidebarResourceMove,\n): SidebarResource[] | null {\n const source = findResource(items, move.itemId);\n if (!source || source.disabled) return null;\n if (move.targetId && containsResource(source, move.targetId)) return null;\n\n const target = move.targetId ? findResource(items, move.targetId) : undefined;\n if (move.position === \"inside\" && (!target || target.disabled || !canContain(target)))\n return null;\n\n const removed = removeResource(items, move.itemId);\n if (!removed.removed) return null;\n return insertResource(removed.items, removed.removed, move.targetId, move.position);\n}\n\nfunction renameResource(items: SidebarResource[], id: string, label: string): SidebarResource[] {\n return items.map((item) => ({\n ...item,\n label: item.id === id ? label : item.label,\n children: item.children ? renameResource(item.children, id, label) : undefined,\n }));\n}\n\nfunction defaultIcon(item: SidebarResource, expanded: boolean) {\n const Icon =\n item.kind === \"folder\" || item.kind === \"project\"\n ? expanded\n ? FolderOpen\n : Folder\n : item.kind === \"bookmark\"\n ? Bookmark\n : FileText;\n return <Icon className=\"size-4\" />;\n}\n\nfunction MarqueeLabel({ active, children }: { active: boolean; children: string }) {\n const reduce = useReducedMotion() ?? false;\n const viewportRef = useRef<HTMLSpanElement>(null);\n const labelRef = useRef<HTMLSpanElement>(null);\n const [distance, setDistance] = useState(0);\n\n useEffect(() => {\n const measure = () => {\n const viewport = viewportRef.current;\n const label = labelRef.current;\n if (!viewport || !label) return;\n setDistance(label.scrollWidth > viewport.clientWidth ? label.scrollWidth + 24 : 0);\n };\n measure();\n const observer = new ResizeObserver(measure);\n if (viewportRef.current) observer.observe(viewportRef.current);\n if (labelRef.current) observer.observe(labelRef.current);\n return () => observer.disconnect();\n }, []);\n\n const running = active && distance > 0 && !reduce;\n\n return (\n <span ref={viewportRef} className=\"block min-w-0 flex-1 overflow-hidden\">\n <motion.span\n className=\"flex w-max items-center gap-6 whitespace-nowrap\"\n animate={{ x: running ? [0, -distance] : 0 }}\n transition={\n running\n ? {\n duration: Math.max(2.4, distance / 34),\n ease: \"linear\",\n repeat: Number.POSITIVE_INFINITY,\n repeatDelay: 2,\n }\n : ROW_REVEAL\n }\n >\n <span ref={labelRef}>{children}</span>\n {running ? <span aria-hidden=\"true\">{children}</span> : null}\n </motion.span>\n </span>\n );\n}\n\nfunction ResourceMenuAction({\n icon: Icon,\n onSelect,\n children,\n}: {\n icon: LucideIcon;\n onSelect: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n className=\"flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-foreground text-xs outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Icon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n <span className=\"min-w-0 truncate\">{children}</span>\n </button>\n );\n}\n\ninterface ResourceRowProps {\n row: FlatResource;\n active: boolean;\n expanded: boolean;\n focused: boolean;\n draggingId: string | null;\n dropTarget: DropTarget | null;\n menuOpen: boolean;\n moves: SidebarResourceMoveCommands;\n renaming: boolean;\n onDragEnd: () => void;\n onDragOver: (event: DragEvent<HTMLDivElement>, row: FlatResource) => void;\n onDragStart: (event: DragEvent<HTMLDivElement>, id: string) => void;\n onDrop: (event: DragEvent<HTMLDivElement>) => void;\n onFocus: () => void;\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;\n onMenuOpenChange: (open: boolean) => void;\n onRenameCancel: () => void;\n onRenameCommit: (label: string) => void;\n onRenameStart: () => void;\n onSelect: () => void;\n onToggle: () => void;\n renderIcon?: (item: SidebarResource) => ReactNode;\n renderMenu?: AISidebarProps[\"renderMenu\"];\n setRef: (node: HTMLDivElement | null) => void;\n}\n\nfunction ResourceRow({\n row,\n active,\n expanded,\n focused,\n draggingId,\n dropTarget,\n menuOpen,\n moves,\n renaming,\n onDragEnd,\n onDragOver,\n onDragStart,\n onDrop,\n onFocus,\n onKeyDown,\n onMenuOpenChange,\n onRenameCancel,\n onRenameCommit,\n onRenameStart,\n onSelect,\n onToggle,\n renderIcon,\n renderMenu,\n setRef,\n}: ResourceRowProps) {\n const reduce = useReducedMotion() ?? false;\n const canTouch = useTouchCapable();\n const [hovered, setHovered] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const skipRenameBlurRef = useRef(false);\n const draggedRef = useRef(false);\n const [draft, setDraft] = useState(row.item.label);\n const acceptsChildren = canContain(row.item);\n const isDragging = draggingId === row.item.id;\n const dropPosition = dropTarget?.id === row.item.id ? dropTarget.position : null;\n\n useEffect(() => {\n if (!renaming) return;\n skipRenameBlurRef.current = false;\n setDraft(row.item.label);\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n inputRef.current?.select();\n });\n }, [renaming, row.item.label]);\n\n const runFromMenu = (action: () => void) => () => {\n onMenuOpenChange(false);\n action();\n };\n\n const menu = renderMenu?.(row.item, {\n close: () => onMenuOpenChange(false),\n rename: () => {\n onMenuOpenChange(false);\n onRenameStart();\n },\n moves,\n }) ?? (\n <>\n <ResourceMenuAction icon={Pencil} onSelect={runFromMenu(onRenameStart)}>\n Rename\n </ResourceMenuAction>\n {moves.up || moves.down || moves.into || moves.out ? (\n <div aria-hidden=\"true\" className=\"my-1 h-px bg-border\" />\n ) : null}\n {moves.up ? (\n <ResourceMenuAction icon={ArrowUp} onSelect={runFromMenu(moves.up)}>\n Move up\n </ResourceMenuAction>\n ) : null}\n {moves.down ? (\n <ResourceMenuAction icon={ArrowDown} onSelect={runFromMenu(moves.down)}>\n Move down\n </ResourceMenuAction>\n ) : null}\n {moves.into ? (\n <ResourceMenuAction icon={FolderInput} onSelect={runFromMenu(moves.into.run)}>\n Move into {moves.into.label}\n </ResourceMenuAction>\n ) : null}\n {moves.out ? (\n <ResourceMenuAction icon={Undo2} onSelect={runFromMenu(moves.out)}>\n Move out\n </ResourceMenuAction>\n ) : null}\n </>\n );\n\n return (\n <motion.div\n ref={setRef}\n layout=\"position\"\n transition={reduce ? { duration: 0 } : SPRING_LAYOUT}\n role=\"treeitem\"\n aria-level={row.depth + 1}\n aria-selected={acceptsChildren ? undefined : active}\n aria-expanded={acceptsChildren ? expanded : undefined}\n aria-disabled={row.item.disabled || undefined}\n tabIndex={focused ? 0 : -1}\n draggable={!row.item.disabled && !renaming}\n data-menu-open={menuOpen || undefined}\n data-drop={dropPosition ?? undefined}\n data-dragging={isDragging || undefined}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onClick={(event) => {\n if (event.defaultPrevented || draggedRef.current || renaming || row.item.disabled) return;\n if (acceptsChildren) onToggle();\n else onSelect();\n }}\n onDoubleClick={(event) => {\n if (acceptsChildren || row.item.disabled) return;\n event.preventDefault();\n onRenameStart();\n }}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onDragStartCapture={(event) => {\n draggedRef.current = true;\n onDragStart(event, row.item.id);\n }}\n onDragEndCapture={() => {\n onDragEnd();\n requestAnimationFrame(() => {\n draggedRef.current = false;\n });\n }}\n onDragOver={(event) => onDragOver(event, row)}\n onDrop={onDrop}\n className={cn(\n \"group/resource relative flex min-h-9 min-w-0 cursor-pointer items-center gap-2.5 rounded-xl pr-3 text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset\",\n \"data-[menu-open=true]:bg-muted data-[menu-open=true]:text-foreground\",\n \"data-[dragging=true]:opacity-40\",\n \"data-[drop=inside]:bg-primary/10 data-[drop=inside]:ring-1 data-[drop=inside]:ring-primary/45\",\n \"data-[drop=before]:before:absolute data-[drop=before]:before:-top-0.5 data-[drop=before]:before:right-2 data-[drop=before]:before:left-2 data-[drop=before]:before:h-0.5 data-[drop=before]:before:rounded-full data-[drop=before]:before:bg-primary\",\n \"data-[drop=after]:after:absolute data-[drop=after]:after:right-2 data-[drop=after]:after:-bottom-0.5 data-[drop=after]:after:left-2 data-[drop=after]:after:h-0.5 data-[drop=after]:after:rounded-full data-[drop=after]:after:bg-primary\",\n !acceptsChildren && active && \"bg-muted text-foreground\",\n row.item.disabled && \"cursor-not-allowed opacity-45\",\n )}\n style={{ paddingLeft: `${12 + row.depth * 16}px` }}\n >\n <span aria-hidden=\"true\" className=\"grid size-5 shrink-0 place-items-center\">\n {renderIcon?.(row.item) ?? defaultIcon(row.item, expanded)}\n </span>\n\n {renaming ? (\n <input\n ref={inputRef}\n value={draft}\n aria-label={`Rename ${row.item.label}`}\n onChange={(event) => setDraft(event.target.value)}\n draggable={false}\n onClick={(event) => event.stopPropagation()}\n onDoubleClick={(event) => event.stopPropagation()}\n onBlur={() => {\n if (!skipRenameBlurRef.current) onRenameCommit(draft);\n }}\n onKeyDown={(event) => {\n event.stopPropagation();\n if (event.key === \"Enter\") {\n skipRenameBlurRef.current = true;\n onRenameCommit(draft);\n }\n if (event.key === \"Escape\") {\n skipRenameBlurRef.current = true;\n onRenameCancel();\n }\n }}\n className=\"mx-1 h-7 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-foreground text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n ) : (\n <MarqueeLabel active={hovered || menuOpen}>{row.item.label}</MarqueeLabel>\n )}\n\n {!renaming && !row.item.disabled ? (\n <MorphPopover open={menuOpen} onOpenChange={onMenuOpenChange}>\n <MorphPopoverTrigger>\n <button\n type=\"button\"\n draggable={false}\n tabIndex={-1}\n aria-label={`Actions for ${row.item.label}`}\n onClick={(event) => event.stopPropagation()}\n className={cn(\n \"grid size-7 shrink-0 place-items-center rounded-lg outline-none transition-opacity hover:bg-foreground/5 focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring group-hover/resource:opacity-100 group-data-[menu-open=true]/resource:opacity-100\",\n // A finger never hovers, and this menu is the only path to\n // rename and move without a drag — keep it on screen there.\n canTouch ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <MoreHorizontal aria-hidden=\"true\" className=\"size-4\" />\n </button>\n </MorphPopoverTrigger>\n <MorphPopoverContent\n side=\"bottom\"\n align=\"end\"\n sideOffset={8}\n radius={12}\n className=\"w-40 p-1.5\"\n >\n <div data-sidebar-resource-menu={row.item.id}>{menu}</div>\n </MorphPopoverContent>\n </MorphPopover>\n ) : null}\n </motion.div>\n );\n}\n\nexport function AISidebar({\n items,\n defaultItems = [],\n onItemsChange,\n onMove,\n onMoveError,\n onRename,\n activeId,\n defaultActiveId = null,\n onActiveChange,\n defaultExpandedIds = [],\n renderIcon,\n renderMenu,\n ariaLabel = \"Resources\",\n className,\n}: AISidebarProps) {\n const [internalItems, setInternalItems] = useState(items ?? defaultItems);\n const [internalActiveId, setInternalActiveId] = useState(defaultActiveId);\n const [expandedIds, setExpandedIds] = useState(() => new Set(defaultExpandedIds));\n const [focusedId, setFocusedId] = useState<string | null>(activeId ?? defaultActiveId);\n const [draggingId, setDraggingId] = useState<string | null>(null);\n const [dropTarget, setDropTarget] = useState<DropTarget | null>(null);\n const [menuOpenId, setMenuOpenId] = useState<string | null>(null);\n const [renamingId, setRenamingId] = useState<string | null>(null);\n const [announcement, setAnnouncement] = useState(\"\");\n const rowRefs = useRef(new Map<string, HTMLDivElement>());\n const movePendingRef = useRef(false);\n const renderedItems = internalItems;\n const selectedId = activeId ?? internalActiveId;\n\n useEffect(() => {\n if (items) setInternalItems(items);\n }, [items]);\n\n const flat = useMemo(\n () => flattenResources(renderedItems, expandedIds),\n [expandedIds, renderedItems],\n );\n\n // Which row carries the roving tabindex is resolved during render, never in\n // a passive effect: an effect lands after the browser paints, so the first\n // commit — and, on a server-rendered page, the markup itself — would have no\n // tabbable row and Tab would skip the whole tree. The same hole opens again\n // whenever a collapse or a rolled-back move takes the focused row out of it.\n const focusedRow =\n focusedId !== null && flat.some((row) => row.item.id === focusedId)\n ? focusedId\n : (flat[0]?.item.id ?? null);\n if (focusedId !== focusedRow) setFocusedId(focusedRow);\n\n useEffect(() => {\n if (!menuOpenId) return;\n const frame = requestAnimationFrame(() => {\n const menus = Array.from(\n document.querySelectorAll<HTMLElement>(\"[data-sidebar-resource-menu]\"),\n );\n menus\n .find((menu) => menu.dataset.sidebarResourceMenu === menuOpenId)\n ?.querySelector<HTMLElement>(\"button, a[href]\")\n ?.focus();\n });\n return () => cancelAnimationFrame(frame);\n }, [menuOpenId]);\n\n const updateItems = useCallback(\n (next: SidebarResource[]) => {\n setInternalItems(next);\n onItemsChange?.(next);\n },\n [onItemsChange],\n );\n\n const performMove = useCallback(\n async (move: SidebarResourceMove) => {\n if (movePendingRef.current) {\n setAnnouncement(\"Wait for the current move to finish.\");\n return;\n }\n const before = renderedItems;\n const next = moveResource(before, move);\n if (!next || next === before) return;\n\n movePendingRef.current = true;\n updateItems(next);\n setDropTarget(null);\n setDraggingId(null);\n const moved = findResource(before, move.itemId);\n const target = move.targetId ? findResource(before, move.targetId) : null;\n setAnnouncement(\n target\n ? `Moved ${moved?.label ?? \"item\"} ${move.position} ${target.label}.`\n : `Moved ${moved?.label ?? \"item\"} to the top level.`,\n );\n\n try {\n await onMove?.(move);\n } catch (error) {\n updateItems(before);\n setAnnouncement(`Move failed. ${moved?.label ?? \"Item\"} was restored.`);\n onMoveError?.(error, move);\n } finally {\n movePendingRef.current = false;\n }\n },\n [onMove, onMoveError, renderedItems, updateItems],\n );\n\n const focusRow = useCallback((id: string) => {\n setFocusedId(id);\n requestAnimationFrame(() => rowRefs.current.get(id)?.focus());\n }, []);\n\n const select = useCallback(\n (id: string) => {\n if (activeId === undefined) setInternalActiveId(id);\n onActiveChange?.(id);\n },\n [activeId, onActiveChange],\n );\n\n const toggle = useCallback((id: string) => {\n setExpandedIds((current) => {\n const next = new Set(current);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n return next;\n });\n }, []);\n\n // The same four moves `Alt+Shift+Arrow` performs, handed to the row menu so\n // they survive on a device with no drag and no modifier keys.\n const moveCommands = useCallback(\n (row: FlatResource): SidebarResourceMoveCommands => {\n if (row.item.disabled) return {};\n const index = flat.findIndex(({ item }) => item.id === row.item.id);\n const previous = flat[index - 1];\n const next = flat[index + 1];\n const parentId = row.parentId;\n const commands: SidebarResourceMoveCommands = {};\n\n if (previous) {\n commands.up = () =>\n void performMove({\n itemId: row.item.id,\n targetId: previous.item.id,\n position: \"before\",\n });\n }\n if (next) {\n commands.down = () =>\n void performMove({\n itemId: row.item.id,\n targetId: next.item.id,\n position: \"after\",\n });\n }\n // Only offer the reparent when it lands somewhere new — the row above a\n // folder's first child is the folder it already lives in.\n if (previous && canContain(previous.item) && previous.item.id !== parentId) {\n commands.into = {\n label: previous.item.label,\n run: () => {\n setExpandedIds((current) => new Set(current).add(previous.item.id));\n void performMove({\n itemId: row.item.id,\n targetId: previous.item.id,\n position: \"inside\",\n });\n },\n };\n }\n if (parentId) {\n commands.out = () =>\n void performMove({\n itemId: row.item.id,\n targetId: parentId,\n position: \"after\",\n });\n }\n\n return commands;\n },\n [flat, performMove],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>, row: FlatResource) => {\n const index = flat.findIndex(({ item }) => item.id === row.item.id);\n const previous = flat[index - 1];\n const next = flat[index + 1];\n const moveModifier = event.altKey && event.shiftKey;\n\n if (event.key === \"ArrowDown\" && !moveModifier && next) {\n event.preventDefault();\n focusRow(next.item.id);\n return;\n }\n if (event.key === \"ArrowUp\" && !moveModifier && previous) {\n event.preventDefault();\n focusRow(previous.item.id);\n return;\n }\n if (event.key === \"Home\" && flat[0]) {\n event.preventDefault();\n focusRow(flat[0].item.id);\n return;\n }\n if (event.key === \"End\" && flat.at(-1)) {\n event.preventDefault();\n focusRow(flat.at(-1)?.item.id ?? row.item.id);\n return;\n }\n\n if (row.item.disabled) {\n if (event.key === \"ArrowLeft\" && row.parentId) {\n event.preventDefault();\n focusRow(row.parentId);\n } else if (\n moveModifier ||\n [\"ArrowRight\", \"Enter\", \" \", \"F2\", \"ContextMenu\"].includes(event.key) ||\n (event.shiftKey && event.key === \"F10\")\n ) {\n event.preventDefault();\n }\n return;\n }\n\n if (moveModifier && event.key === \"ArrowUp\" && previous) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: previous.item.id, position: \"before\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowDown\" && next) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: next.item.id, position: \"after\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowRight\" && previous && canContain(previous.item)) {\n event.preventDefault();\n setExpandedIds((current) => new Set(current).add(previous.item.id));\n void performMove({ itemId: row.item.id, targetId: previous.item.id, position: \"inside\" });\n return;\n }\n if (moveModifier && event.key === \"ArrowLeft\" && row.parentId) {\n event.preventDefault();\n void performMove({ itemId: row.item.id, targetId: row.parentId, position: \"after\" });\n return;\n }\n\n if (event.key === \"ArrowRight\" && canContain(row.item)) {\n event.preventDefault();\n if (!expandedIds.has(row.item.id)) toggle(row.item.id);\n else if (next?.parentId === row.item.id) focusRow(next.item.id);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n if (expandedIds.has(row.item.id)) toggle(row.item.id);\n else if (row.parentId) focusRow(row.parentId);\n } else if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (canContain(row.item)) toggle(row.item.id);\n else select(row.item.id);\n } else if (event.key === \"F2\") {\n event.preventDefault();\n setRenamingId(row.item.id);\n } else if (event.key === \"ContextMenu\" || (event.shiftKey && event.key === \"F10\")) {\n event.preventDefault();\n setMenuOpenId(row.item.id);\n }\n },\n [expandedIds, flat, focusRow, performMove, select, toggle],\n );\n\n return (\n <>\n <div\n role=\"tree\"\n aria-label={ariaLabel}\n aria-multiselectable=\"false\"\n onDragOver={(event) => {\n if (!draggingId || event.target !== event.currentTarget) return;\n event.preventDefault();\n setDropTarget({ id: null, position: \"after\" });\n }}\n onDrop={(event) => {\n event.preventDefault();\n if (draggingId && dropTarget) {\n void performMove({\n itemId: draggingId,\n targetId: dropTarget.id,\n position: dropTarget.position,\n });\n }\n }}\n className={cn(\n \"relative flex min-w-0 flex-col gap-0.5 [overflow-anchor:none] group-data-[state=collapsed]/sidebar:hidden\",\n draggingId && \"select-none pb-9\",\n className,\n )}\n >\n <AnimatePresence initial={false}>\n {flat.map((row) => (\n <ResourceRow\n key={row.item.id}\n row={row}\n active={selectedId === row.item.id}\n expanded={expandedIds.has(row.item.id)}\n focused={focusedRow === row.item.id}\n draggingId={draggingId}\n dropTarget={dropTarget}\n menuOpen={menuOpenId === row.item.id}\n moves={moveCommands(row)}\n renaming={renamingId === row.item.id}\n onFocus={() => setFocusedId(row.item.id)}\n onSelect={() => select(row.item.id)}\n onToggle={() => toggle(row.item.id)}\n onKeyDown={(event) => handleKeyDown(event, row)}\n onRenameStart={() => setRenamingId(row.item.id)}\n onRenameCancel={() => setRenamingId(null)}\n onRenameCommit={(label) => {\n const trimmed = label.trim();\n setRenamingId(null);\n if (!trimmed || trimmed === row.item.label) return;\n const before = renderedItems;\n updateItems(renameResource(before, row.item.id, trimmed));\n void Promise.resolve(onRename?.(row.item, trimmed)).catch(() => {\n updateItems(before);\n setAnnouncement(`Rename failed. ${row.item.label} was restored.`);\n });\n }}\n onMenuOpenChange={(open) => {\n setMenuOpenId(open ? row.item.id : null);\n if (!open) focusRow(row.item.id);\n }}\n onDragStart={(event, id) => {\n setDraggingId(id);\n event.dataTransfer.effectAllowed = \"move\";\n event.dataTransfer.setData(\"text/plain\", id);\n }}\n onDragEnd={() => {\n setDraggingId(null);\n setDropTarget(null);\n }}\n onDragOver={(event, targetRow) => {\n if (!draggingId || draggingId === targetRow.item.id) return;\n const source = findResource(renderedItems, draggingId);\n if (source && containsResource(source, targetRow.item.id)) return;\n event.preventDefault();\n event.stopPropagation();\n const rect = event.currentTarget.getBoundingClientRect();\n const ratio = (event.clientY - rect.top) / rect.height;\n const position =\n !targetRow.item.disabled &&\n canContain(targetRow.item) &&\n ratio >= 0.25 &&\n ratio <= 0.75\n ? \"inside\"\n : ratio < 0.5\n ? \"before\"\n : \"after\";\n setDropTarget({ id: targetRow.item.id, position });\n }}\n onDrop={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (draggingId && dropTarget) {\n void performMove({\n itemId: draggingId,\n targetId: dropTarget.id,\n position: dropTarget.position,\n });\n }\n }}\n renderIcon={renderIcon}\n renderMenu={renderMenu}\n setRef={(node) => {\n if (node) rowRefs.current.set(row.item.id, node);\n else rowRefs.current.delete(row.item.id);\n }}\n />\n ))}\n </AnimatePresence>\n\n {draggingId ? (\n <div\n aria-hidden=\"true\"\n data-active={dropTarget?.id === null || undefined}\n className=\"absolute inset-x-1 bottom-0 flex h-8 items-center justify-center rounded-lg border border-border border-dashed text-[10px] text-muted-foreground data-[active=true]:border-primary/50 data-[active=true]:bg-primary/10 data-[active=true]:text-foreground\"\n >\n Move to top level\n </div>\n ) : null}\n </div>\n <span className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </span>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAkGA,MAAM,aAAa;CACjB,UAAU;CACV,MAAM;AACR;AAEA,SAAS,WAAW,MAAuB;CACzC,OAAO,KAAK,SAAS,YAAY,KAAK,SAAS;AACjD;AAEA,SAAS,iBACP,OACA,UACA,QAAQ,GACR,WAA0B,MACV;CAChB,OAAO,MAAM,SAAS,SAAS;EAC7B,MAAM,MAAM;GAAE;GAAM;GAAO;EAAS;EACpC,IAAI,CAAC,KAAK,UAAU,UAAU,CAAC,SAAS,IAAI,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG;EACjE,OAAO,CAAC,KAAK,GAAG,iBAAiB,KAAK,UAAU,UAAU,QAAQ,GAAG,KAAK,EAAE,CAAC;CAC/E,CAAC;AACH;AAEA,SAAS,aAAa,OAA0B,IAAyC;CACvF,KAAK,MAAM,QAAQ,OAAO;EACxB,IAAI,KAAK,OAAO,IAAI,OAAO;EAC3B,MAAM,QAAQ,KAAK,WAAW,aAAa,KAAK,UAAU,EAAE,IAAI,KAAA;EAChE,IAAI,OAAO,OAAO;CACpB;AACF;AAEA,SAAS,iBAAiB,MAAuB,IAAqB;CACpE,OAAO,KAAK,OAAO,MAAM,KAAK,UAAU,MAAM,UAAU,iBAAiB,OAAO,EAAE,CAAC,MAAM;AAC3F;AAEA,SAAS,eACP,OACA,IACyD;CACzD,IAAI;CACJ,MAAM,OAA0B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AAO,MAAM,cAAc,sBAAsB;KACvD,MAAM,SAAS,MAAM,UAAU,KAAK,OAAO,KAAK;KAChD,MAAM,WACJ,CAAC,UAAU,KAAK,YAChB,WAAW,UAAU,IAAI,KACzB,SAAS,OACT,SAAS,MACL,WACA,QAAQ,KACN,WACA;KACR,cAAc;MAAE,IAAI,UAAU,KAAK;MAAI;KAAS,CAAC;IACnD;IACA,SAAS,UAAU;KACjB,MAAM,eAAe;KACrB,MAAM,gBAAgB;KACtB,IAAI,cAAc,YAChB,YAAiB;MACf,QAAQ;MACR,UAAU,WAAW;MACrB,UAAU,WAAW;KACvB,CAAC;IAEL;IACY;IACA;IACZ,SAAS,SAAS;KAChB,IAAI,MAAM,QAAQ,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI;UAC1C,QAAQ,QAAQ,OAAO,IAAI,KAAK,EAAE;IACzC;GACD,GA5EM,IAAI,KAAK,EA4Ef,CACF;EACc,CAAA,GAEhB,aACC,oBAAC,OAAD;GACE,eAAY;GACZ,eAAa,YAAY,OAAO,QAAQ,KAAA;GACxC,WAAU;GACX,UAAA;EAEI,CAAA,IACH,IACD;CACL,CAAA,GAAA,oBAAC,QAAD;EAAM,WAAU;EAAU,aAAU;EACjC,UAAA;CACG,CAAA,CACN,EAAA,CAAA;AAEN"}
@@ -8,10 +8,10 @@ import { Checkbox } from "../../motion/checkbox.js";
8
8
  import { Input } from "../../motion/input.js";
9
9
  import { RadioGroup, RadioGroupItem } from "../../motion/radio.js";
10
10
  import { useCallback, useEffect, useRef, useState } from "react";
11
- import { cn } from "@kumix/utils";
12
- import { ArrowLeft, ArrowRight, Check, CircleHelp, LoaderCircle, MessageSquareText, X } from "lucide-react";
11
+ import { cn } from "cn";
13
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
13
  import { AnimatePresence, motion, useReducedMotion } from "motion/react";
14
+ import { ArrowLeft, ArrowRight, Check, CircleHelp, LoaderCircle, MessageSquareText, X } from "lucide-react";
15
15
  //#region src/components/agents/approval-card/index.tsx
16
16
  const EMPTY_ANSWER = {
17
17
  selected: [],