@stack-spot/ai-chat-widget 1.38.2-beta.2 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/CHANGELOG.md +33 -32
  2. package/dist/StackspotAIWidget.d.ts +14 -2
  3. package/dist/StackspotAIWidget.d.ts.map +1 -1
  4. package/dist/StackspotAIWidget.js +7 -8
  5. package/dist/StackspotAIWidget.js.map +1 -1
  6. package/dist/app-metadata.json +13 -5
  7. package/dist/chat-interceptors/quick-commands.js +3 -3
  8. package/dist/chat-interceptors/quick-commands.js.map +1 -1
  9. package/dist/components/AdaptiveTextArea.d.ts +1 -1
  10. package/dist/components/AdaptiveTextArea.d.ts.map +1 -1
  11. package/dist/components/AdaptiveTextArea.js +1 -1
  12. package/dist/components/AdaptiveTextArea.js.map +1 -1
  13. package/dist/components/AgentCard/AgentCardCreate.d.ts.map +1 -1
  14. package/dist/components/AgentCard/AgentCardCreate.js +4 -5
  15. package/dist/components/AgentCard/AgentCardCreate.js.map +1 -1
  16. package/dist/components/AgentCard/index.d.ts.map +1 -1
  17. package/dist/components/AgentCard/index.js +5 -6
  18. package/dist/components/AgentCard/index.js.map +1 -1
  19. package/dist/components/ButtonFavorite.d.ts +8 -7
  20. package/dist/components/ButtonFavorite.d.ts.map +1 -1
  21. package/dist/components/ButtonFavorite.js +5 -14
  22. package/dist/components/ButtonFavorite.js.map +1 -1
  23. package/dist/components/Code.d.ts.map +1 -1
  24. package/dist/components/Code.js +11 -9
  25. package/dist/components/Code.js.map +1 -1
  26. package/dist/components/ComponentNavigator.d.ts.map +1 -1
  27. package/dist/components/ComponentNavigator.js +2 -4
  28. package/dist/components/ComponentNavigator.js.map +1 -1
  29. package/dist/components/FadingOverflow.d.ts.map +1 -1
  30. package/dist/components/FadingOverflow.js +3 -4
  31. package/dist/components/FadingOverflow.js.map +1 -1
  32. package/dist/components/FileDescription.d.ts.map +1 -1
  33. package/dist/components/FileDescription.js +3 -4
  34. package/dist/components/FileDescription.js.map +1 -1
  35. package/dist/components/HistoryList.d.ts.map +1 -1
  36. package/dist/components/HistoryList.js +3 -1
  37. package/dist/components/HistoryList.js.map +1 -1
  38. package/dist/components/ListResource.js +3 -3
  39. package/dist/components/ListResource.js.map +1 -1
  40. package/dist/components/Markdown.js +1 -1
  41. package/dist/components/Markdown.js.map +1 -1
  42. package/dist/components/Modal.d.ts.map +1 -1
  43. package/dist/components/Modal.js +2 -4
  44. package/dist/components/Modal.js.map +1 -1
  45. package/dist/components/QuickStartButton.d.ts +2 -3
  46. package/dist/components/QuickStartButton.d.ts.map +1 -1
  47. package/dist/components/QuickStartButton.js +4 -3
  48. package/dist/components/QuickStartButton.js.map +1 -1
  49. package/dist/components/RightPanelForm.d.ts.map +1 -1
  50. package/dist/components/RightPanelForm.js +20 -13
  51. package/dist/components/RightPanelForm.js.map +1 -1
  52. package/dist/components/RightPanelTabs.d.ts +1 -4
  53. package/dist/components/RightPanelTabs.d.ts.map +1 -1
  54. package/dist/components/RightPanelTabs.js +4 -16
  55. package/dist/components/RightPanelTabs.js.map +1 -1
  56. package/dist/components/Selector/index.d.ts.map +1 -1
  57. package/dist/components/Selector/index.js +5 -8
  58. package/dist/components/Selector/index.js.map +1 -1
  59. package/dist/components/Selector/styled.d.ts.map +1 -1
  60. package/dist/components/Selector/styled.js +8 -5
  61. package/dist/components/Selector/styled.js.map +1 -1
  62. package/dist/components/StackedBadge.js +5 -5
  63. package/dist/components/StackedBadge.js.map +1 -1
  64. package/dist/components/TabManager.d.ts.map +1 -1
  65. package/dist/components/TabManager.js +9 -32
  66. package/dist/components/TabManager.js.map +1 -1
  67. package/dist/components/ToolBadge.d.ts +3 -8
  68. package/dist/components/ToolBadge.d.ts.map +1 -1
  69. package/dist/components/ToolBadge.js +23 -99
  70. package/dist/components/ToolBadge.js.map +1 -1
  71. package/dist/components/WorkspaceTabNavigator.d.ts.map +1 -1
  72. package/dist/components/WorkspaceTabNavigator.js +7 -9
  73. package/dist/components/WorkspaceTabNavigator.js.map +1 -1
  74. package/dist/components/form/DescribedCheckboxGroup.d.ts +24 -2
  75. package/dist/components/form/DescribedCheckboxGroup.d.ts.map +1 -1
  76. package/dist/components/form/DescribedCheckboxGroup.js +46 -29
  77. package/dist/components/form/DescribedCheckboxGroup.js.map +1 -1
  78. package/dist/components/form/DescribedRadioGroup.d.ts +24 -4
  79. package/dist/components/form/DescribedRadioGroup.d.ts.map +1 -1
  80. package/dist/components/form/DescribedRadioGroup.js +39 -18
  81. package/dist/components/form/DescribedRadioGroup.js.map +1 -1
  82. package/dist/context/hooks.d.ts +6 -1
  83. package/dist/context/hooks.d.ts.map +1 -1
  84. package/dist/context/hooks.js +4 -1
  85. package/dist/context/hooks.js.map +1 -1
  86. package/dist/hooks/midnight-update-view.d.ts +5 -0
  87. package/dist/hooks/midnight-update-view.d.ts.map +1 -0
  88. package/dist/hooks/midnight-update-view.js +30 -0
  89. package/dist/hooks/midnight-update-view.js.map +1 -0
  90. package/dist/index.d.ts +4 -2
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1 -1
  93. package/dist/index.js.map +1 -1
  94. package/dist/layout.css +0 -26
  95. package/dist/right-panel/DefaultPanel.d.ts.map +1 -1
  96. package/dist/right-panel/DefaultPanel.js +2 -4
  97. package/dist/right-panel/DefaultPanel.js.map +1 -1
  98. package/dist/state/ChatEntry.d.ts +3 -4
  99. package/dist/state/ChatEntry.d.ts.map +1 -1
  100. package/dist/state/ChatEntry.js.map +1 -1
  101. package/dist/state/constants.d.ts.map +1 -1
  102. package/dist/state/constants.js +1 -0
  103. package/dist/state/constants.js.map +1 -1
  104. package/dist/types.d.ts +8 -3
  105. package/dist/types.d.ts.map +1 -1
  106. package/dist/utils/tools.d.ts +9 -3
  107. package/dist/utils/tools.d.ts.map +1 -1
  108. package/dist/utils/tools.js +1 -6
  109. package/dist/utils/tools.js.map +1 -1
  110. package/dist/views/Agents/AgentDescription.d.ts.map +1 -1
  111. package/dist/views/Agents/AgentDescription.js +8 -13
  112. package/dist/views/Agents/AgentDescription.js.map +1 -1
  113. package/dist/views/Agents/AgentsPanel.d.ts.map +1 -1
  114. package/dist/views/Agents/AgentsPanel.js +7 -7
  115. package/dist/views/Agents/AgentsPanel.js.map +1 -1
  116. package/dist/views/Agents/AgentsTab.d.ts.map +1 -1
  117. package/dist/views/Agents/AgentsTab.js +30 -29
  118. package/dist/views/Agents/AgentsTab.js.map +1 -1
  119. package/dist/views/Agents/dictionary.d.ts +1 -1
  120. package/dist/views/Agents/useAgentFavorites.js +3 -3
  121. package/dist/views/Agents/useAgentFavorites.js.map +1 -1
  122. package/dist/views/Chat/AgentInfo.d.ts.map +1 -1
  123. package/dist/views/Chat/AgentInfo.js +3 -5
  124. package/dist/views/Chat/AgentInfo.js.map +1 -1
  125. package/dist/views/Chat/ChatMessage.d.ts +24 -2
  126. package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
  127. package/dist/views/Chat/ChatMessage.js +36 -47
  128. package/dist/views/Chat/ChatMessage.js.map +1 -1
  129. package/dist/views/Chat/ChatMessages.d.ts +1 -1
  130. package/dist/views/Chat/ChatMessages.d.ts.map +1 -1
  131. package/dist/views/Chat/ChatMessages.js +2 -2
  132. package/dist/views/Chat/ChatMessages.js.map +1 -1
  133. package/dist/views/Chat/StepsList.d.ts.map +1 -1
  134. package/dist/views/Chat/StepsList.js +10 -10
  135. package/dist/views/Chat/StepsList.js.map +1 -1
  136. package/dist/views/Chat/index.d.ts +1 -1
  137. package/dist/views/Chat/index.d.ts.map +1 -1
  138. package/dist/views/Chat/index.js +2 -2
  139. package/dist/views/Chat/index.js.map +1 -1
  140. package/dist/views/Chat/styled.d.ts.map +1 -1
  141. package/dist/views/Chat/styled.js +11 -16
  142. package/dist/views/Chat/styled.js.map +1 -1
  143. package/dist/views/ChatHistory/HistoryItem.d.ts.map +1 -1
  144. package/dist/views/ChatHistory/HistoryItem.js +10 -48
  145. package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
  146. package/dist/views/ChatHistory/index.js +1 -1
  147. package/dist/views/ChatHistory/index.js.map +1 -1
  148. package/dist/views/ChatHistory/styled.d.ts.map +1 -1
  149. package/dist/views/ChatHistory/styled.js +3 -5
  150. package/dist/views/ChatHistory/styled.js.map +1 -1
  151. package/dist/views/ChatHistory/utils.d.ts +7 -0
  152. package/dist/views/ChatHistory/utils.d.ts.map +1 -1
  153. package/dist/views/ChatHistory/utils.js +40 -1
  154. package/dist/views/ChatHistory/utils.js.map +1 -1
  155. package/dist/views/ChatTabSelection.d.ts +6 -1
  156. package/dist/views/ChatTabSelection.d.ts.map +1 -1
  157. package/dist/views/ChatTabSelection.js +13 -8
  158. package/dist/views/ChatTabSelection.js.map +1 -1
  159. package/dist/views/Editor.d.ts.map +1 -1
  160. package/dist/views/Editor.js +6 -12
  161. package/dist/views/Editor.js.map +1 -1
  162. package/dist/views/Home/BuiltInAgent.d.ts.map +1 -1
  163. package/dist/views/Home/BuiltInAgent.js +2 -3
  164. package/dist/views/Home/BuiltInAgent.js.map +1 -1
  165. package/dist/views/Home/CustomAgent.js +3 -3
  166. package/dist/views/Home/CustomAgent.js.map +1 -1
  167. package/dist/views/Home/index.js +2 -2
  168. package/dist/views/Home/index.js.map +1 -1
  169. package/dist/views/Home/styled.d.ts.map +1 -1
  170. package/dist/views/Home/styled.js +21 -22
  171. package/dist/views/Home/styled.js.map +1 -1
  172. package/dist/views/KSDocument.d.ts.map +1 -1
  173. package/dist/views/KSDocument.js +3 -4
  174. package/dist/views/KSDocument.js.map +1 -1
  175. package/dist/views/KnowledgeSources.d.ts.map +1 -1
  176. package/dist/views/KnowledgeSources.js +14 -36
  177. package/dist/views/KnowledgeSources.js.map +1 -1
  178. package/dist/views/MessageInput/AgentSelector.d.ts.map +1 -1
  179. package/dist/views/MessageInput/AgentSelector.js +7 -5
  180. package/dist/views/MessageInput/AgentSelector.js.map +1 -1
  181. package/dist/views/MessageInput/ButtonAgent.d.ts.map +1 -1
  182. package/dist/views/MessageInput/ButtonAgent.js +4 -5
  183. package/dist/views/MessageInput/ButtonAgent.js.map +1 -1
  184. package/dist/views/MessageInput/ButtonBar.d.ts.map +1 -1
  185. package/dist/views/MessageInput/ButtonBar.js +2 -4
  186. package/dist/views/MessageInput/ButtonBar.js.map +1 -1
  187. package/dist/views/MessageInput/ContextBar.d.ts.map +1 -1
  188. package/dist/views/MessageInput/ContextBar.js +3 -6
  189. package/dist/views/MessageInput/ContextBar.js.map +1 -1
  190. package/dist/views/MessageInput/QuickCommandSelector.js +2 -2
  191. package/dist/views/MessageInput/QuickCommandSelector.js.map +1 -1
  192. package/dist/views/MessageInput/SelectContent.d.ts.map +1 -1
  193. package/dist/views/MessageInput/SelectContent.js +30 -29
  194. package/dist/views/MessageInput/SelectContent.js.map +1 -1
  195. package/dist/views/MessageInput/UploadDragNDrop.d.ts.map +1 -1
  196. package/dist/views/MessageInput/UploadDragNDrop.js +2 -3
  197. package/dist/views/MessageInput/UploadDragNDrop.js.map +1 -1
  198. package/dist/views/MessageInput/dictionary.d.ts +1 -1
  199. package/dist/views/MessageInput/index.d.ts +2 -1
  200. package/dist/views/MessageInput/index.d.ts.map +1 -1
  201. package/dist/views/MessageInput/index.js +5 -6
  202. package/dist/views/MessageInput/index.js.map +1 -1
  203. package/dist/views/MessageInput/styled.d.ts +1 -3
  204. package/dist/views/MessageInput/styled.d.ts.map +1 -1
  205. package/dist/views/MessageInput/styled.js +11 -15
  206. package/dist/views/MessageInput/styled.js.map +1 -1
  207. package/dist/views/MinimizedHeader.d.ts.map +1 -1
  208. package/dist/views/MinimizedHeader.js +3 -4
  209. package/dist/views/MinimizedHeader.js.map +1 -1
  210. package/dist/views/Resources.d.ts.map +1 -1
  211. package/dist/views/Resources.js +11 -8
  212. package/dist/views/Resources.js.map +1 -1
  213. package/dist/views/Stacks.d.ts.map +1 -1
  214. package/dist/views/Stacks.js +23 -28
  215. package/dist/views/Stacks.js.map +1 -1
  216. package/dist/views/Steps/FlowChart/NodeStep.d.ts.map +1 -1
  217. package/dist/views/Steps/FlowChart/NodeStep.js +3 -3
  218. package/dist/views/Steps/FlowChart/NodeStep.js.map +1 -1
  219. package/dist/views/Steps/StepModal.d.ts.map +1 -1
  220. package/dist/views/Steps/StepModal.js +4 -6
  221. package/dist/views/Steps/StepModal.js.map +1 -1
  222. package/dist/views/Steps/dictionary.d.ts +1 -1
  223. package/dist/views/Steps/index.d.ts.map +1 -1
  224. package/dist/views/Steps/index.js +3 -4
  225. package/dist/views/Steps/index.js.map +1 -1
  226. package/dist/views/Steps/utils.d.ts +2 -1
  227. package/dist/views/Steps/utils.d.ts.map +1 -1
  228. package/dist/views/Steps/utils.js +8 -8
  229. package/dist/views/Steps/utils.js.map +1 -1
  230. package/dist/views/Tools.js +1 -1
  231. package/dist/views/Tools.js.map +1 -1
  232. package/dist/views/Workspaces/WorkspacesTab.d.ts.map +1 -1
  233. package/dist/views/Workspaces/WorkspacesTab.js +7 -10
  234. package/dist/views/Workspaces/WorkspacesTab.js.map +1 -1
  235. package/dist/views/Workspaces/index.js +4 -2
  236. package/dist/views/Workspaces/index.js.map +1 -1
  237. package/package.json +5 -3
  238. package/src/StackspotAIWidget.tsx +51 -37
  239. package/src/app-metadata.json +13 -5
  240. package/src/chat-interceptors/quick-commands.ts +3 -3
  241. package/src/components/AdaptiveTextArea.tsx +1 -1
  242. package/src/components/AgentCard/AgentCardCreate.tsx +4 -7
  243. package/src/components/AgentCard/index.tsx +7 -7
  244. package/src/components/ButtonFavorite.tsx +20 -47
  245. package/src/components/Code.tsx +31 -36
  246. package/src/components/ComponentNavigator.tsx +4 -8
  247. package/src/components/FadingOverflow.tsx +6 -7
  248. package/src/components/FileDescription.tsx +14 -10
  249. package/src/components/HistoryList.tsx +4 -1
  250. package/src/components/ListResource.tsx +5 -5
  251. package/src/components/Markdown.tsx +1 -1
  252. package/src/components/Modal.tsx +2 -4
  253. package/src/components/QuickStartButton.tsx +5 -4
  254. package/src/components/RightPanelForm.tsx +20 -13
  255. package/src/components/RightPanelTabs.tsx +4 -32
  256. package/src/components/Selector/index.tsx +17 -13
  257. package/src/components/Selector/styled.ts +8 -5
  258. package/src/components/StackedBadge.tsx +5 -5
  259. package/src/components/TabManager.tsx +31 -55
  260. package/src/components/ToolBadge.tsx +48 -129
  261. package/src/components/WorkspaceTabNavigator.tsx +22 -25
  262. package/src/components/form/DescribedCheckboxGroup.tsx +90 -65
  263. package/src/components/form/DescribedRadioGroup.tsx +78 -46
  264. package/src/context/hooks.ts +4 -1
  265. package/src/hooks/midnight-update-view.ts +36 -0
  266. package/src/index.ts +4 -2
  267. package/src/layout.css +0 -26
  268. package/src/right-panel/DefaultPanel.tsx +3 -7
  269. package/src/state/ChatEntry.ts +3 -4
  270. package/src/state/constants.ts +2 -1
  271. package/src/types.ts +9 -3
  272. package/src/utils/tools.ts +3 -12
  273. package/src/views/Agents/AgentDescription.tsx +20 -36
  274. package/src/views/Agents/AgentsPanel.tsx +11 -12
  275. package/src/views/Agents/AgentsTab.tsx +38 -57
  276. package/src/views/Agents/useAgentFavorites.ts +3 -3
  277. package/src/views/Chat/AgentInfo.tsx +7 -6
  278. package/src/views/Chat/ChatMessage.tsx +163 -145
  279. package/src/views/Chat/ChatMessages.tsx +2 -1
  280. package/src/views/Chat/StepsList.tsx +10 -11
  281. package/src/views/Chat/index.tsx +9 -2
  282. package/src/views/Chat/styled.ts +11 -16
  283. package/src/views/ChatHistory/HistoryItem.tsx +15 -54
  284. package/src/views/ChatHistory/index.tsx +1 -1
  285. package/src/views/ChatHistory/styled.ts +3 -5
  286. package/src/views/ChatHistory/utils.ts +43 -2
  287. package/src/views/ChatTabSelection.tsx +18 -10
  288. package/src/views/Editor.tsx +9 -14
  289. package/src/views/Home/BuiltInAgent.tsx +7 -8
  290. package/src/views/Home/CustomAgent.tsx +3 -3
  291. package/src/views/Home/index.tsx +2 -2
  292. package/src/views/Home/styled.ts +21 -22
  293. package/src/views/KSDocument.tsx +7 -8
  294. package/src/views/KnowledgeSources.tsx +24 -66
  295. package/src/views/MessageInput/AgentSelector.tsx +10 -8
  296. package/src/views/MessageInput/ButtonAgent.tsx +24 -12
  297. package/src/views/MessageInput/ButtonBar.tsx +25 -21
  298. package/src/views/MessageInput/ContextBar.tsx +16 -14
  299. package/src/views/MessageInput/QuickCommandSelector.tsx +2 -2
  300. package/src/views/MessageInput/SelectContent.tsx +39 -62
  301. package/src/views/MessageInput/UploadDragNDrop.tsx +2 -5
  302. package/src/views/MessageInput/index.tsx +8 -9
  303. package/src/views/MessageInput/styled.ts +12 -16
  304. package/src/views/MinimizedHeader.tsx +5 -7
  305. package/src/views/Resources.tsx +31 -30
  306. package/src/views/Stacks.tsx +31 -54
  307. package/src/views/Steps/FlowChart/NodeStep.tsx +6 -4
  308. package/src/views/Steps/StepModal.tsx +14 -18
  309. package/src/views/Steps/index.tsx +4 -5
  310. package/src/views/Steps/utils.tsx +9 -9
  311. package/src/views/Tools.tsx +0 -1
  312. package/src/views/Workspaces/WorkspacesTab.tsx +17 -21
  313. package/src/views/Workspaces/index.tsx +4 -2
  314. package/dist/components/Accordion.d.ts +0 -20
  315. package/dist/components/Accordion.d.ts.map +0 -1
  316. package/dist/components/Accordion.js +0 -51
  317. package/dist/components/Accordion.js.map +0 -1
  318. package/dist/components/FallbackBoundary/ErrorBoundary.d.ts +0 -33
  319. package/dist/components/FallbackBoundary/ErrorBoundary.d.ts.map +0 -1
  320. package/dist/components/FallbackBoundary/ErrorBoundary.js +0 -52
  321. package/dist/components/FallbackBoundary/ErrorBoundary.js.map +0 -1
  322. package/dist/components/FallbackBoundary/Loading.d.ts +0 -2
  323. package/dist/components/FallbackBoundary/Loading.d.ts.map +0 -1
  324. package/dist/components/FallbackBoundary/Loading.js +0 -12
  325. package/dist/components/FallbackBoundary/Loading.js.map +0 -1
  326. package/dist/components/FallbackBoundary/index.d.ts +0 -17
  327. package/dist/components/FallbackBoundary/index.d.ts.map +0 -1
  328. package/dist/components/FallbackBoundary/index.js +0 -9
  329. package/dist/components/FallbackBoundary/index.js.map +0 -1
  330. package/dist/components/IconInput.d.ts +0 -10
  331. package/dist/components/IconInput.d.ts.map +0 -1
  332. package/dist/components/IconInput.js +0 -61
  333. package/dist/components/IconInput.js.map +0 -1
  334. package/dist/components/OverlayMenu.d.ts +0 -21
  335. package/dist/components/OverlayMenu.d.ts.map +0 -1
  336. package/dist/components/OverlayMenu.js +0 -79
  337. package/dist/components/OverlayMenu.js.map +0 -1
  338. package/dist/components/ProgressBar.d.ts +0 -37
  339. package/dist/components/ProgressBar.d.ts.map +0 -1
  340. package/dist/components/ProgressBar.js +0 -131
  341. package/dist/components/ProgressBar.js.map +0 -1
  342. package/dist/components/Tooltip/Tooltip.d.ts +0 -37
  343. package/dist/components/Tooltip/Tooltip.d.ts.map +0 -1
  344. package/dist/components/Tooltip/Tooltip.js +0 -30
  345. package/dist/components/Tooltip/Tooltip.js.map +0 -1
  346. package/dist/components/Tooltip/TooltipAPI.d.ts +0 -29
  347. package/dist/components/Tooltip/TooltipAPI.d.ts.map +0 -1
  348. package/dist/components/Tooltip/TooltipAPI.js +0 -107
  349. package/dist/components/Tooltip/TooltipAPI.js.map +0 -1
  350. package/dist/components/Tooltip/context.d.ts +0 -5
  351. package/dist/components/Tooltip/context.d.ts.map +0 -1
  352. package/dist/components/Tooltip/context.js +0 -18
  353. package/dist/components/Tooltip/context.js.map +0 -1
  354. package/dist/components/Tooltip/index.d.ts +0 -3
  355. package/dist/components/Tooltip/index.d.ts.map +0 -1
  356. package/dist/components/Tooltip/index.js +0 -3
  357. package/dist/components/Tooltip/index.js.map +0 -1
  358. package/dist/components/Tooltip/style.d.ts +0 -4
  359. package/dist/components/Tooltip/style.d.ts.map +0 -1
  360. package/dist/components/Tooltip/style.js +0 -22
  361. package/dist/components/Tooltip/style.js.map +0 -1
  362. package/dist/components/Tooltip/types.d.ts +0 -27
  363. package/dist/components/Tooltip/types.d.ts.map +0 -1
  364. package/dist/components/Tooltip/types.js +0 -2
  365. package/dist/components/Tooltip/types.js.map +0 -1
  366. package/src/components/Accordion.tsx +0 -75
  367. package/src/components/FallbackBoundary/ErrorBoundary.tsx +0 -71
  368. package/src/components/FallbackBoundary/Loading.tsx +0 -14
  369. package/src/components/FallbackBoundary/index.tsx +0 -26
  370. package/src/components/IconInput.tsx +0 -73
  371. package/src/components/OverlayMenu.tsx +0 -133
  372. package/src/components/ProgressBar.tsx +0 -183
  373. package/src/components/Tooltip/Tooltip.tsx +0 -78
  374. package/src/components/Tooltip/TooltipAPI.ts +0 -101
  375. package/src/components/Tooltip/context.tsx +0 -24
  376. package/src/components/Tooltip/index.ts +0 -2
  377. package/src/components/Tooltip/style.tsx +0 -24
  378. package/src/components/Tooltip/types.ts +0 -28
@@ -1,4 +1,3 @@
1
- import { IconButton } from '@citric/ui'
2
1
  import { theme } from '@stack-spot/portal-theme'
3
2
  import { styled } from 'styled-components'
4
3
 
@@ -51,7 +50,7 @@ export const SelectionBarWrapper = styled.div`
51
50
  }
52
51
  `
53
52
 
54
- export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
53
+ export const MessageInputBox = styled.div`
55
54
  display: flex;
56
55
  flex-direction: column;
57
56
 
@@ -127,7 +126,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
127
126
  line-height: 0.75rem;
128
127
  white-space: nowrap;
129
128
 
130
- ${IconButton} {
129
+ /* $ {IconButton} {
131
130
  padding: 4px 0;
132
131
  background: none;
133
132
  border: none;
@@ -138,7 +137,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
138
137
  width: auto;
139
138
  height: 12px;
140
139
  }
141
- }
140
+ } */
142
141
  }
143
142
  }
144
143
 
@@ -175,18 +174,15 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
175
174
  background-color: ${theme.color.light[300]};
176
175
  padding: 10px 8px;
177
176
  transition: border-color 0.3s, background-color 0.3s;
178
-
179
- &.focused {
180
- border: 2px solid ${theme.color.light[300]};
181
- }
182
-
183
-
184
- &.disabled {
185
- background-color: ${theme.color.light[300]};
186
- }
187
177
  }
188
178
  }
189
179
 
180
+ [data-citric="progress-bar"] {
181
+ background-color: ${theme.color.light[500]};
182
+ border: 0;
183
+ padding: 0;
184
+ }
185
+
190
186
  .button-group {
191
187
  display: flex;
192
188
  flex-direction: row;
@@ -239,10 +235,10 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
239
235
  }
240
236
  }
241
237
 
242
- ${IconButton} {
238
+ /* $ {IconButton} {
243
239
  width: 24px;
244
240
  height: 24px;
245
- }
241
+ } */
246
242
 
247
243
  .group-agent {
248
244
  display: flex;
@@ -302,7 +298,7 @@ export const MessageInputBox = styled.div<{$inputFocused?: boolean}>`
302
298
  transition: height 0.3s;
303
299
  background-color: transparent;
304
300
  &:focus {
305
- box-shadow: none;
301
+ box-shadow: none !important;
306
302
  }
307
303
  }
308
304
  `
@@ -1,6 +1,4 @@
1
- import { Text } from '@citric/core'
2
- import { ChevronDown, Times } from '@citric/icons'
3
- import { IconButton } from '@citric/ui'
1
+ import { IconButton, Text } from '@stack-spot/citric-react'
4
2
  import { listToClass } from '@stack-spot/portal-theme'
5
3
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
6
4
  import { useCallback, useRef, useState } from 'react'
@@ -24,6 +22,7 @@ const Header = styled.header`
24
22
  white-space: nowrap;
25
23
  max-width: calc(100% - 78px); // size of the button-group + gap
26
24
  height: 15px; // fixes weird problem where the text has 14px instead of 15px of height
25
+ line-height: 1;
27
26
  }
28
27
 
29
28
  .button-group {
@@ -69,14 +68,13 @@ export const MinimizedHeader = ({ onClose, onCollapse, onExpand }: MinimizedActi
69
68
  <FadingOverflow className="title"><Text title={label}>{label}</Text></FadingOverflow>
70
69
  {showButtons && <div className="button-group">
71
70
  {(onExpand || onCollapse) && <IconButton
71
+ icon="ChevronDown"
72
72
  title={collapsed ? t.expand : t.collapse}
73
73
  aria-label={collapsed ? t.expand : t.collapse}
74
74
  className={listToClass(['collapse', collapsed && 'collapsed'])}
75
75
  onClick={toggleCollapsed}
76
- >
77
- <ChevronDown />
78
- </IconButton>}
79
- {onClose && <IconButton title={t.close} aria-label={t.close} onClick={onClose}><Times /></IconButton>}
76
+ />}
77
+ {onClose && <IconButton icon="Times" title={t.close} aria-label={t.close} onClick={onClose} />}
80
78
  </div>}
81
79
  </Header>
82
80
  )
@@ -1,10 +1,9 @@
1
- import { Box, Flex, IconBox, Text } from '@citric/core'
2
- import { Agent } from '@citric/icons'
3
- import { Avatar } from '@citric/ui'
1
+ import { Accordion, Icon, ImageBox, ImageWithFallback, Row, Text } from '@stack-spot/citric-react'
4
2
  import { agentToolsClient } from '@stack-spot/portal-network'
3
+ import { theme } from '@stack-spot/portal-theme'
5
4
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
6
5
  import { useEffect, useMemo } from 'react'
7
- import { Accordion } from '../components/Accordion'
6
+ import { styled } from 'styled-components'
8
7
  import { useWidget, useWidgetState } from '../context/hooks'
9
8
  import { useRightPanel } from '../right-panel/hooks'
10
9
  import { toolById } from '../utils/tools'
@@ -27,6 +26,12 @@ export const Resources = () => {
27
26
  return null
28
27
  }
29
28
 
29
+ const StyledAccordion = styled(Accordion)`
30
+ &[data-citric="accordion"] {
31
+ background-color: ${theme.color.light[400]};
32
+ }
33
+ `
34
+
30
35
  const ResourcesPanel = () => {
31
36
  const { chatId, messageId } = useWidgetState('currentMessageInPanel') ?? {}
32
37
  const widget = useWidget()
@@ -46,13 +51,12 @@ const ResourcesPanel = () => {
46
51
  const hasAgentTool = useMemo(() => message?.tools?.some(id => agentsTools?.find((agent) => agent.id === id)), [messageId, toolKits])
47
52
 
48
53
  const header = (image?: string, label?: string) => (
49
- <Flex alignItems="center">
50
- {image ? <Avatar size="xxs">
51
- <img title={label} src={image} />
52
- </Avatar> :
53
- <IconBox appearance="circle" title={label} color="gray"><Agent /></IconBox>}
54
- <Text ml={3}>{label}</Text>
55
- </Flex>
54
+ <Row gap="10px">
55
+ <ImageBox>
56
+ <ImageWithFallback src={image} fallback={<Icon icon="Agent" />} aria-label={label} title={label} />
57
+ </ImageBox>
58
+ <Text>{label}</Text>
59
+ </Row>
56
60
  )
57
61
 
58
62
  return !!(tools?.length || customTools?.length) && (
@@ -61,28 +65,25 @@ const ResourcesPanel = () => {
61
65
  {[...(tools || []), ...(customTools || [])].map(
62
66
  (tool) =>
63
67
  tool && (
64
- <Box key={tool.id} mt={3}>
65
- <Accordion header={header(tool?.image, tool?.name)}>
66
- <Box sx={{ backgroundColor: 'light.400', m: '-10px', p: '16px' }}>
67
- {tool?.description}
68
- </Box>
69
- </Accordion>
70
- </Box>))}
68
+ <StyledAccordion key={tool.id} header={header(tool?.image, tool?.name)} appearance="card">
69
+ {tool?.description}
70
+ </StyledAccordion>
71
+ ))}
71
72
  </>
72
- {hasAgentTool &&
73
- <>
74
- {message?.tools?.map((id) => {
75
- const agentTool = agentsTools?.find((agent) => agent.id === id)
76
- return (
77
- <Box key={id} mt={3}>
78
- <Accordion header={header(agentTool?.avatar || undefined, agentTool?.name)}>
73
+ {
74
+ hasAgentTool &&
75
+ <>
76
+ {message?.tools?.map((id) => {
77
+ const agentTool = agentsTools?.find((agent) => agent.id === id)
78
+ return (
79
+ <StyledAccordion key={id} header={header(agentTool?.avatar || undefined, agentTool?.name)}>
79
80
  <AgentDescription agentId={id} />
80
- </Accordion>
81
- </Box>)},
82
- )}
83
- </>}
81
+ </StyledAccordion>
82
+ )},
83
+ )}
84
+ </>
85
+ }
84
86
  </>
85
-
86
87
  )
87
88
  }
88
89
 
@@ -1,15 +1,12 @@
1
- import { Button } from '@citric/core'
2
- import { Search } from '@citric/icons'
1
+ import { Button, Tab } from '@stack-spot/citric-react'
3
2
  import { Placeholder } from '@stack-spot/portal-components/Placeholder'
4
3
  import { aiClient, workspaceAiClient } from '@stack-spot/portal-network'
5
- import { GetAiStackResponse, VisibilityLevelEnum } from '@stack-spot/portal-network/api/ai'
4
+ import { VisibilityLevelEnum } from '@stack-spot/portal-network/api/ai'
6
5
  import { WorkspaceResponse } from '@stack-spot/portal-network/api/workspace-ai'
7
6
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
8
- import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react'
9
- import { ButtonFavorite } from '../components/ButtonFavorite'
7
+ import { useEffect, useMemo, useRef, useState } from 'react'
10
8
  import { NavigationComponent } from '../components/ComponentNavigator'
11
9
  import { DescribedRadioGroup } from '../components/form/DescribedRadioGroup'
12
- import { IconInput } from '../components/IconInput'
13
10
  import { RightPanelContentList } from '../components/RightPanelContentList'
14
11
  import { RightPanelTabs } from '../components/RightPanelTabs'
15
12
  import { WorkspaceTabNavigator } from '../components/WorkspaceTabNavigator'
@@ -19,8 +16,6 @@ import { useRightPanel } from '../right-panel/hooks'
19
16
  import { ChatProperties } from '../state/ChatState'
20
17
  import { checkIsTrial } from '../utils/check-is-trial'
21
18
 
22
- type TabElement = { title: string, content: ReactElement }
23
-
24
19
  /**
25
20
  * Renders the Stack selection form in the Right Panel if this is the panel that is currently opened.
26
21
  */
@@ -54,12 +49,12 @@ const StacksPanel = () => {
54
49
  stack.current = chat.get('stack')
55
50
  }, [chat])
56
51
 
57
- const allTabsMap: Partial<Record<Scope, TabElement>> = {
58
- favorite: { title: t.favorites, content: <StacksTab key="favorites" visibility="favorite" stack={stack} /> },
59
- personal: { title: t.personal, content: <StacksTab key="personal" visibility="personal" stack={stack} /> },
60
- shared: { title: t.shared, content: <StacksTab key="shared" visibility="shared" stack={stack} /> },
61
- workspace: { title: t.spots, content: <StacksTabWorkspace key="workspace" visibility="workspace" stack={stack} /> },
62
- account: { title: t.account, content: <StacksTab key="account" visibility="account" stack={stack} /> },
52
+ const allTabsMap: Partial<Record<Scope, Omit<Tab, 'key'>>> = {
53
+ favorite: { label: t.favorites, content: <StacksTab key="favorites" visibility="favorite" stack={stack} /> },
54
+ personal: { label: t.personal, content: <StacksTab key="personal" visibility="personal" stack={stack} /> },
55
+ shared: { label: t.shared, content: <StacksTab key="shared" visibility="shared" stack={stack} /> },
56
+ workspace: { label: t.spots, content: <StacksTabWorkspace key="workspace" visibility="workspace" stack={stack} /> },
57
+ account: { label: t.account, content: <StacksTab key="account" visibility="account" stack={stack} /> },
63
58
  }
64
59
  const defaultScopes: Scope[] = ['favorite', 'personal', 'shared', 'workspace', 'account']
65
60
 
@@ -70,8 +65,8 @@ const StacksPanel = () => {
70
65
  : rawScopes
71
66
 
72
67
  const tabs = scopesToRender
73
- .map(scope => allTabsMap[scope])
74
- .filter(Boolean) as TabElement[]
68
+ .map(scope => scope in allTabsMap ? { key: scope, ...allTabsMap[scope] } : undefined)
69
+ .filter(Boolean) as Tab[]
75
70
 
76
71
  return (isGroupResourcesByScope ? (
77
72
  <RightPanelTabs key={chat.id} tabs={tabs} />
@@ -91,11 +86,10 @@ export const StacksTab = ({ visibility, workspaceId, stack, showSubmitButton = t
91
86
  const t = useTranslate(dictionary)
92
87
  const { close } = useRightPanel()
93
88
  const chat = useCurrentChat()
94
- const [filter, setFilter] = useState('')
95
-
96
89
  const listFavorites = aiClient.aiStacks.useQuery({ visibility: 'favorite' })
97
90
  const [addFavorite, pendingAddFav] = aiClient.addFavoriteStackAi.useMutation()
98
91
  const [removeFavorite, pendingRemoveFav] = aiClient.removeFavoriteStackAi.useMutation()
92
+ const [submitEnabled, setSubmitEnabled] = useState(false)
99
93
 
100
94
  const removeFavoriteStack = async (idOrSlug: string) => {
101
95
  try {
@@ -146,57 +140,40 @@ export const StacksTab = ({ visibility, workspaceId, stack, showSubmitButton = t
146
140
  reject(error)
147
141
  }
148
142
  })
149
-
150
-
151
143
 
152
144
  const stacks = workspaceId
153
145
  ? workspaceAiClient.getStackFromWorkspaceAi.useQuery({ workspaceId })
154
146
  //@ts-ignore
155
147
  : aiClient.aiStacks.useQuery({ visibility, order: 'a-to-z' })
156
148
 
157
- const currentStackId = stack.current ? stack.current.id : chat.get('stack')?.id
158
- const [value, setValue] = useState<GetAiStackResponse | undefined>(stacks.find(s => s.id === currentStackId))
159
- const filtered = useMemo(() => filter ?
160
- // Recreate the list so that the favorites list is taken into account
161
- stacks.filter(s => s === value || s.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase())) : [...stacks],
162
- [stacks, listFavorites, filter, value],
163
- )
149
+ const initialValue = useMemo(() => {
150
+ const currentStackId = stack.current ? stack.current.id : chat.get('stack')?.id
151
+ const initial = stacks.find(s => s.id === currentStackId)
152
+ if (initial) setSubmitEnabled(true)
153
+ return initial
154
+ }, [stacks])
164
155
 
165
156
  function submit() {
166
- if (value) chat.set('stack', { id: value.id, label: value.name })
157
+ if (stack.current) chat.set('stack', stack.current)
167
158
  close()
168
159
  }
169
160
 
170
- const onChange = useCallback((newValue: GetAiStackResponse) => {
171
- setValue(newValue)
172
- stack.current = { ...newValue, label: newValue.name }
173
- }, [])
174
-
175
161
  return (
176
162
  <>
177
163
  <div className="content">
178
- <IconInput icon={<Search />} value={filter} onChange={setFilter} className="search" />
179
- {!!filtered.length && <DescribedRadioGroup
180
- options={filtered}
181
- renderAfterElement={({ id }) =>
182
- <ButtonFavorite favorite={{ idOrSlug:id, listFavorites, onAddFavorite, onRemoveFavorite }} />
183
- }
184
- keygen={s => s.id}
185
- value={value}
186
- onChange={onChange}
187
- renderLabel={s => s.name}
188
- renderDescription={s => s.use_case}
189
- optionClassName={s => (s === value && filter && !s.name.toLocaleLowerCase().includes(filter.toLocaleLowerCase()))
190
- ? 'filtered-out'
191
- : ''
192
- }
193
- className="option-list"
194
- />}
195
- {!!stacks.length && !filtered.length &&
196
- <Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} className="no-data-placeholder"/>}
197
- {!stacks.length && <Placeholder title={t.noData} description={t.noDataDescription} />}
164
+ <DescribedRadioGroup
165
+ options={stacks}
166
+ initialValue={initialValue}
167
+ data={s => ({ idOrSlug: s.id, description: s.use_case, name: s.name, listFavorites, onAddFavorite, onRemoveFavorite })}
168
+ emptyResults={<Placeholder title={t.noSearchResults} description={t.noSearchResultsDescription} className="no-data-placeholder"/>}
169
+ emptyDataset={<Placeholder title={t.noData} description={t.noDataDescription} />}
170
+ onChange={(s) => {
171
+ stack.current = s ? { ...s, label: s.name } : undefined
172
+ setSubmitEnabled(true)
173
+ }}
174
+ />
198
175
  </div>
199
- {!!filtered.length && showSubmitButton && <Button onClick={submit} disabled={!value}>{t.apply}</Button>}
176
+ {!!stacks.length && showSubmitButton && <Button onClick={submit} disabled={!submitEnabled}>{t.apply}</Button>}
200
177
  </>
201
178
  )
202
179
  }
@@ -1,5 +1,5 @@
1
- import { IconBox, Text } from '@citric/core'
2
- import { Cog } from '@citric/icons'
1
+ import { Icon } from '@stack-spot/citric-icons'
2
+ import { Text } from '@stack-spot/citric-react'
3
3
  import { listToClass } from '@stack-spot/portal-theme'
4
4
  import { StackedBadge } from '../../../components/StackedBadge'
5
5
  import { useStepsDictionary } from '../dictionary'
@@ -24,7 +24,7 @@ export const NodeStep = ({ data: { step, index, nextStatus, onClick } }: Props)
24
24
  aria-label={getTitle(t, step, index)}
25
25
  >
26
26
  <header>
27
- <IconBox>{getTypeIcon(step.type)}</IconBox>
27
+ <Icon {...getTypeIcon(step.type)} />
28
28
  <Text className="step-index">{getTitle(t, step, index)}</Text>
29
29
  {getStatusIcon(step.status)}
30
30
  </header>
@@ -36,7 +36,9 @@ export const NodeStep = ({ data: { step, index, nextStatus, onClick } }: Props)
36
36
  </Text>
37
37
  {!!step.attempts[0].tools?.length && <StackedBadge
38
38
  label={t.tools}
39
- images={step.attempts[0].tools?.slice(0, 3).map(tool => ({ key: tool.id, name: tool.name, url: tool.image, icon: <Cog /> }))}
39
+ images={step.attempts[0].tools?.slice(0, 3).map(
40
+ tool => ({ key: tool.id, name: tool.name, url: tool.image, icon: <Icon icon="Cog" /> }),
41
+ )}
40
42
  />}
41
43
  </div>}
42
44
  <HandleGroup renderSource={step.type !== 'answer'} renderTarget={step.type !== 'planning'} />
@@ -1,6 +1,4 @@
1
- import { Flex, Text } from '@citric/core'
2
- import { ChevronLeft, ChevronRight } from '@citric/icons'
3
- import { Badge, IconButton } from '@citric/ui'
1
+ import { Badge, IconButton, Row, Text } from '@stack-spot/citric-react'
4
2
  import { theme } from '@stack-spot/portal-theme'
5
3
  import { useMemo, useState } from 'react'
6
4
  import { styled } from 'styled-components'
@@ -131,18 +129,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
131
129
  <div className="tool" key={tool.id}>
132
130
  <ToolBadge name={tool.name} duration={tool.duration} image={tool.image} description={tool.description} />
133
131
  {tool.input && <>
134
- <Text appearance="microtext1" colorScheme="light.700">{t.input}:</Text>
132
+ <Text appearance="microtext1" color="light.700">{t.input}:</Text>
135
133
  <Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.input}</Code>
136
134
  </>}
137
135
  {tool.output && <>
138
- <Text appearance="microtext1" colorScheme="light.700">{t.response}:</Text>
136
+ <Text appearance="microtext1" color="light.700">{t.response}:</Text>
139
137
  <Code language="json" className="tool-input" showLineNumbers={false} showActionBar>{tool.output}</Code>
140
138
  </>}
141
139
  </div>
142
140
  )) : undefined
143
141
 
144
142
  const title = (
145
- <Flex flex={1} justifyContent="space-between" alignItems="center">
143
+ <Row flex={1} justifyContent="space-between">
146
144
  <Text appearance="h6">{getTitle(t, step, stepIndex)}</Text>
147
145
  <ExecutionBox>
148
146
  <Text className="time" appearance="microtext1">
@@ -153,28 +151,26 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
153
151
  {step?.type === 'step' && step.attempts.length > 1 && <div className="navigator">
154
152
  {attempt > 0 && (
155
153
  <IconButton
154
+ icon="ChevronLeft"
156
155
  size="xs"
157
156
  title={t.previousAttempt}
158
157
  aria-label={t.previousAttempt}
159
158
  onClick={() => setAttempt(attempt - 1)}
160
- >
161
- <ChevronLeft />
162
- </IconButton>
159
+ />
163
160
  )}
164
161
  <Text appearance="microtext1">{attempt + 1}/{step.attempts.length}</Text>
165
162
  {attempt < step.attempts.length - 1 && (
166
163
  <IconButton
164
+ icon="ChevronRight"
167
165
  size="xs"
168
166
  title={t.nextAttempt}
169
167
  aria-label={t.nextAttempt}
170
168
  onClick={() => setAttempt(attempt + 1)}
171
- >
172
- <ChevronRight />
173
- </IconButton>
169
+ />
174
170
  )}
175
171
  </div>}
176
172
  </ExecutionBox>
177
- </Flex>
173
+ </Row>
178
174
  )
179
175
 
180
176
  return (
@@ -184,18 +180,18 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
184
180
  </StyledSection>}
185
181
 
186
182
  {step?.type === 'planning' && <StyledSection style={{ alignItems: 'stretch' }}>
187
- <Badge appearance="square" palette="blue" style={{ alignSelf: 'start' }}>Prompt</Badge>
183
+ <Badge appearance="square" colorPalette="blue" style={{ alignSelf: 'start' }}>Prompt</Badge>
188
184
  <Text>{step.goal}</Text>
189
185
  <ul className="steps">
190
186
  {entry.steps?.filter(s => s.type === 'step').map((s, index) => (
191
187
  <li key={index}>
192
- <Flex mb={2}>
188
+ <Row mb={2}>
193
189
  <Text>{t.step} {index + 1}: <span className="step-description">{s.input}</span></Text>
194
- </Flex>
190
+ </Row>
195
191
  {!!s.attempts[0].tools?.length && <ul className="side-by-side-tools">
196
192
  {s.attempts[0].tools.map((tool) => (
197
193
  <li key={tool.id}>
198
- <ToolBadge name={tool.name} image={tool.image} appearance="round" />
194
+ <ToolBadge name={tool.name} image={tool.image} />
199
195
  </li>
200
196
  ))}
201
197
  </ul>}
@@ -205,7 +201,7 @@ export const StepModal = ({ message, stepId, onClose }: Props) => {
205
201
  </StyledSection>}
206
202
 
207
203
  {step?.type === 'step' && step?.input && <StyledSection>
208
- <Badge appearance="square" palette="blue">Prompt</Badge>
204
+ <Badge appearance="square" colorPalette="blue">Prompt</Badge>
209
205
  <Text>{step.input}</Text>
210
206
  </StyledSection>}
211
207
  {!!tools?.length && <StyledSection>{tools}</StyledSection>}
@@ -1,6 +1,5 @@
1
- import { Flex } from '@citric/core'
2
- import { LoadingCircular } from '@citric/ui'
3
- import { lazy, Suspense, useEffect } from 'react'
1
+ import { FallbackBoundary } from '@stack-spot/citric-react'
2
+ import { lazy, useEffect } from 'react'
4
3
  import { useWidget, useWidgetState } from '../../context/hooks'
5
4
  import { useRightPanel } from '../../right-panel/hooks'
6
5
  import { useStepsDictionary } from './dictionary'
@@ -19,9 +18,9 @@ export const Steps = () => {
19
18
 
20
19
  useEffect(() => {
21
20
  if (panel === 'steps' && message) open(
22
- <Suspense fallback={<Flex alignItems="center" justifyContent="center" flex={1}><LoadingCircular /></Flex>}>
21
+ <FallbackBoundary>
23
22
  <LazyStepsPanel key={message.messageId} chatId={message.chatId} messageId={message.messageId} />
24
- </Suspense>,
23
+ </FallbackBoundary>,
25
24
  {
26
25
  title: t.steps,
27
26
  description: t.stepsPanelDescription,
@@ -1,21 +1,21 @@
1
- import { IconBox } from '@citric/core'
2
- import { CheckCircleFill, ListUnordered, PlayFill, TimesCircleFill } from '@citric/icons'
3
- import { LoadingCircular } from '@citric/ui'
1
+ import { Icon, WithIcon } from '@stack-spot/citric-icons'
2
+ import { ProgressCircular } from '@stack-spot/citric-react'
4
3
  import { ChatStep } from '@stack-spot/portal-network'
4
+ import { theme } from '@stack-spot/portal-theme'
5
5
 
6
6
  export function getStatusIcon(status: ChatStep['status']) {
7
7
  switch (status) {
8
- case 'success': return <IconBox colorIcon="success.500"><CheckCircleFill /></IconBox>
9
- case 'error': return <IconBox colorIcon="danger.500"><TimesCircleFill /></IconBox>
10
- case 'running': return <LoadingCircular colorScheme="inverse" size="xs" />
8
+ case 'success': return <Icon group="fill" icon="CheckCircle" style={{ color: theme.color.success[500] }} />
9
+ case 'error': return <Icon group="fill" icon="TimesCircle" style={{ color: theme.color.danger[500] }} />
10
+ case 'running': return <ProgressCircular colorScheme="inverse" size="xs" />
11
11
  default: return null
12
12
  }
13
13
  }
14
14
 
15
- export function getTypeIcon(type: ChatStep['type']) {
15
+ export function getTypeIcon(type: ChatStep['type']): WithIcon {
16
16
  switch (type) {
17
- case 'planning': return <ListUnordered />
18
- default: return <PlayFill />
17
+ case 'planning': return { group: 'outline', icon: 'ListUnordered' }
18
+ default: return { group: 'fill', icon: 'Play' }
19
19
  }
20
20
  }
21
21
 
@@ -57,7 +57,6 @@ const ToolsPanel = () => {
57
57
  name={tool.name || tool.id}
58
58
  image={tool.image ?? ''}
59
59
  description={tool.description ?? ''}
60
- backgroundColor="light.500"
61
60
  />
62
61
  </li>
63
62
  ),
@@ -1,12 +1,10 @@
1
- import { Button, Flex, IconBox, Image, Text } from '@citric/core'
2
- import { Agent, KnowledgeSource, Spaces, Stack } from '@citric/icons'
3
- import { Avatar } from '@citric/ui'
1
+ import { Icon } from '@stack-spot/citric-icons'
2
+ import { AsyncContent, Button, Center, Column, ImageBox, ImageWithFallback, Text } from '@stack-spot/citric-react'
4
3
  import { workspaceAiClient } from '@stack-spot/portal-network'
5
4
  import { WorkspaceResponse, WorkspaceVisibilityLevelEnum } from '@stack-spot/portal-network/api/workspace-ai'
6
5
  import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
7
6
  import { useTransition } from 'react'
8
7
  import { useComponentNavigation } from '../../components/ComponentNavigator'
9
- import { Loading } from '../../components/FallbackBoundary/Loading'
10
8
  import { ListResource } from '../../components/ListResource'
11
9
  import { CardSpace, WorkspaceTabNavigator } from '../../components/WorkspaceTabNavigator'
12
10
  import { ChatProperties } from '../../state/ChatState'
@@ -16,17 +14,15 @@ import { StacksTab } from '../Stacks'
16
14
 
17
15
  const SpaceCard = ({ workspaceId }: { workspaceId: string }) => {
18
16
  const workspace = workspaceAiClient.workspaceAi.useQuery({ id: workspaceId })
19
- return <Flex flexDirection="column" sx={{ gap: '8px' }}>
20
- <Flex flexDirection="column" sx={{ gap: '4px' }}>
21
- <Flex alignContent="center" alignItems="center" sx={{ gap: '8px', m: 1 }} >
22
- <Avatar size="xxs" appearance="square" sx={{ bg: 'light.600', r: 'xxs' }}>
23
- {workspace.logo ? <Image src={workspace.logo} /> : <IconBox> <Spaces /> </IconBox>}
24
- </Avatar>
25
- <Text appearance="body2" weight="medium">{workspace.name} </Text>
26
- </Flex>
27
- <Text colorScheme="light.700">{workspace.description}</Text>
28
- </Flex>
29
- </Flex>
17
+ return <Column gap="4px">
18
+ <Center gap="8px">
19
+ <ImageBox size="sm" appearance="square">
20
+ <ImageWithFallback src={workspace.logo ?? ''} fallback={<Icon icon="Spaces" />} />
21
+ </ImageBox>
22
+ <Text appearance="body2" weight="medium">{workspace.name}</Text>
23
+ </Center>
24
+ <Text color="light.700">{workspace.description}</Text>
25
+ </Column>
30
26
  }
31
27
 
32
28
  export interface TabProps {
@@ -52,9 +48,9 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
52
48
  const { navigate } = useComponentNavigation<typeof workspaceTabComponents>()
53
49
  const [isPending, startTransition] = useTransition()
54
50
  const resourceTypes: WorkspaceResource[] = [
55
- { id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Agent /> },
56
- { id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <KnowledgeSource /> },
57
- { id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Stack /> },
51
+ { id: 'agents', resourceType: 'agent', displayName: 'Agents', workspaceId, icon: <Icon icon="Agent" /> },
52
+ { id: 'ks', resourceType: 'ks', displayName: 'Knowledge Sources', workspaceId, icon: <Icon icon="KnowledgeSource" /> },
53
+ { id: 'stack', resourceType: 'stack', displayName: 'Stacks', workspaceId, icon: <Icon icon="Stack" /> },
58
54
  ]
59
55
 
60
56
  const handleNavigate = (resource: WorkspaceResource) => {
@@ -72,14 +68,14 @@ export const WorkspaceResources = ({ workspaceId, allKS, agent, stack }: Omit<Ta
72
68
 
73
69
  return (<>
74
70
  {workspaceId && <SpaceCard workspaceId={workspaceId} />}
75
- {isPending ? <Loading /> :
71
+ {<AsyncContent loading={isPending}>
76
72
  <ListResource
77
73
  list={resourceTypes}
78
74
  keygen={w => w.id}
79
75
  renderLabel={r => <CardSpace name={r.displayName} icon={r.icon} onClick={() => handleNavigate(r)} />}
80
76
  style={{ gap: '6px', display: 'flex', flexDirection: 'column' }}
81
77
  />
82
- }
78
+ </AsyncContent>}
83
79
  </>
84
80
  )
85
81
  }
@@ -105,7 +101,7 @@ export function WorkspacesTab({ visibility, allKS, agent, stack, onSubmit }: Tab
105
101
  getNavigateParam={buildNavigateParams}
106
102
  visibility={visibility}
107
103
  />
108
- <Button className="workspace-submit" onClick={onSubmit} >{t.apply}</Button>
104
+ <Button className="workspace-submit" onClick={onSubmit}>{t.apply}</Button>
109
105
  </>
110
106
  )
111
107
  }
@@ -48,11 +48,13 @@ const WorkspacesPanel = () => {
48
48
 
49
49
  return <RightPanelTabs key={chat.id} tabs={[
50
50
  {
51
- title: t.favorites,
51
+ key: 'favorites',
52
+ label: t.favorites,
52
53
  content: <WorkspacesTab key="favorite" visibility="favorite" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
53
54
  },
54
55
  {
55
- title: t.all,
56
+ key: 'all',
57
+ label: t.all,
56
58
  content: <WorkspacesTab key="all" visibility="all" allKS={allKS} agent={agent} stack={stack} onSubmit={onSubmit} />,
57
59
  },
58
60
  ]}