@swisper.ai/web-chat-ui 0.0.2 → 0.0.5

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 (369) hide show
  1. package/README.md +9 -12
  2. package/dist/components/canvas-shell/canvas-shell.d.ts +32 -10
  3. package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -1
  4. package/dist/components/canvas-shell/canvas-shell.stories.d.ts +49 -17
  5. package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -1
  6. package/dist/components/chat-card/chat-card.d.ts +1 -0
  7. package/dist/components/chat-card/chat-card.d.ts.map +1 -1
  8. package/dist/components/chat-card/chat-card.stories.d.ts +47 -1
  9. package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -1
  10. package/dist/components/chat-card/components/chat-card-body.d.ts +8 -0
  11. package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -1
  12. package/dist/components/chat-card/components/chat-card-footer.d.ts +8 -0
  13. package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -1
  14. package/dist/components/chat-card/components/chat-card-form.d.ts +15 -2
  15. package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -1
  16. package/dist/components/chat-card/components/chat-card-header.d.ts +23 -2
  17. package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -1
  18. package/dist/components/chat-card/contexts.d.ts +2 -0
  19. package/dist/components/chat-card/contexts.d.ts.map +1 -1
  20. package/dist/components/chat-card/hooks.d.ts +1 -0
  21. package/dist/components/chat-card/hooks.d.ts.map +1 -1
  22. package/dist/components/chat-card/types.d.ts +3 -0
  23. package/dist/components/chat-card/types.d.ts.map +1 -1
  24. package/dist/components/chat-card-container/chat-card-container.d.ts +4 -0
  25. package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -1
  26. package/dist/components/chat-card-container/chat-card-container.stories.d.ts +12 -1
  27. package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -1
  28. package/dist/components/chat-container/chat-container.d.ts.map +1 -1
  29. package/dist/components/chat-container/chat-container.stories.d.ts +36 -11
  30. package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -1
  31. package/dist/components/chat-input/chat-input.d.ts +30 -2
  32. package/dist/components/chat-input/chat-input.d.ts.map +1 -1
  33. package/dist/components/chat-input/chat-input.stories.d.ts +63 -3
  34. package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -1
  35. package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts +4 -1
  36. package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts.map +1 -1
  37. package/dist/components/chat-input/plugins/value-plugin.d.ts +4 -1
  38. package/dist/components/chat-input/plugins/value-plugin.d.ts.map +1 -1
  39. package/dist/components/chat-list/chat-list-item.d.ts +6 -0
  40. package/dist/components/chat-list/chat-list-item.d.ts.map +1 -1
  41. package/dist/components/chat-list/chat-list-items.d.ts +12 -1
  42. package/dist/components/chat-list/chat-list-items.d.ts.map +1 -1
  43. package/dist/components/chat-list/chat-list.d.ts +36 -2
  44. package/dist/components/chat-list/chat-list.d.ts.map +1 -1
  45. package/dist/components/chat-list/chat-list.stories.d.ts +67 -9
  46. package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -1
  47. package/dist/components/chat-message/chat-message.d.ts +12 -1
  48. package/dist/components/chat-message/chat-message.d.ts.map +1 -1
  49. package/dist/components/chat-message/chat-message.stories.d.ts +31 -0
  50. package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -1
  51. package/dist/components/chat-message/index.d.ts +1 -1
  52. package/dist/components/chat-message/index.d.ts.map +1 -1
  53. package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +3 -0
  54. package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -1
  55. package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +25 -5
  56. package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -1
  57. package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +32 -1
  58. package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -1
  59. package/dist/components/chat-message-attachment-card/index.d.ts +2 -2
  60. package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -1
  61. package/dist/components/chat-message-attachment-card/utils.d.ts +1 -0
  62. package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -1
  63. package/dist/components/chat-message-response/chat-message-response.stories.d.ts +13 -0
  64. package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -1
  65. package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +22 -5
  66. package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -1
  67. package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +42 -0
  68. package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -1
  69. package/dist/components/chat-message-toolbar/index.d.ts +1 -1
  70. package/dist/components/chat-message-toolbar/index.d.ts.map +1 -1
  71. package/dist/components/chat-messages/chat-messages.d.ts +34 -2
  72. package/dist/components/chat-messages/chat-messages.d.ts.map +1 -1
  73. package/dist/components/chat-messages/chat-messages.stories.d.ts +33 -2
  74. package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -1
  75. package/dist/components/chat-notification-card/chat-notification-card.d.ts +56 -4
  76. package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -1
  77. package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +50 -1
  78. package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -1
  79. package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +6 -0
  80. package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -1
  81. package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +43 -1
  82. package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -1
  83. package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +37 -17
  84. package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -1
  85. package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +53 -1
  86. package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -1
  87. package/dist/components/chat-reply/chat-reply.d.ts +11 -0
  88. package/dist/components/chat-reply/chat-reply.d.ts.map +1 -1
  89. package/dist/components/chat-reply/chat-reply.stories.d.ts +23 -0
  90. package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -1
  91. package/dist/components/chat-reply/index.d.ts +1 -1
  92. package/dist/components/chat-reply/index.d.ts.map +1 -1
  93. package/dist/components/chat-suggestion/chat-suggestion.d.ts +36 -10
  94. package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -1
  95. package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +66 -2
  96. package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -1
  97. package/dist/components/chat-suggestion/index.d.ts +2 -1
  98. package/dist/components/chat-suggestion/index.d.ts.map +1 -1
  99. package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +26 -1
  100. package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
  101. package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +25 -1
  102. package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -1
  103. package/dist/components/chat-thread/chat-thread.d.ts +17 -2
  104. package/dist/components/chat-thread/chat-thread.d.ts.map +1 -1
  105. package/dist/components/chat-thread/chat-thread.stories.d.ts +75 -10
  106. package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -1
  107. package/dist/components/index.d.ts +1 -3
  108. package/dist/components/index.d.ts.map +1 -1
  109. package/dist/components/markdown-viewer/markdown-viewer.d.ts +8 -1
  110. package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -1
  111. package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +18 -1
  112. package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -1
  113. package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts +4 -1
  114. package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts.map +1 -1
  115. package/dist/components/rich-text-area/plugins/value-plugin.d.ts +4 -1
  116. package/dist/components/rich-text-area/plugins/value-plugin.d.ts.map +1 -1
  117. package/dist/components/rich-text-area/rich-text-area.d.ts +17 -0
  118. package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -1
  119. package/dist/components/rich-text-area/rich-text-area.stories.d.ts +52 -0
  120. package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -1
  121. package/dist/components/rich-text-area/styled.d.ts +6 -2
  122. package/dist/components/rich-text-area/styled.d.ts.map +1 -1
  123. package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +9 -2
  124. package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -1
  125. package/dist/components/rich-text-field/components/index.d.ts +5 -5
  126. package/dist/components/rich-text-field/components/index.d.ts.map +1 -1
  127. package/dist/components/rich-text-field/components/text-color-button.d.ts +12 -1
  128. package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -1
  129. package/dist/components/rich-text-field/rich-text-field.d.ts +22 -0
  130. package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -1
  131. package/dist/components/rich-text-field/rich-text-field.stories.d.ts +28 -1
  132. package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -1
  133. package/dist/components/topmenu/index.d.ts +2 -0
  134. package/dist/components/topmenu/index.d.ts.map +1 -0
  135. package/dist/components/topmenu/topmenu.d.ts +22 -0
  136. package/dist/components/topmenu/topmenu.d.ts.map +1 -0
  137. package/dist/components/topmenu/topmenu.stories.d.ts +31 -0
  138. package/dist/components/topmenu/topmenu.stories.d.ts.map +1 -0
  139. package/dist/docs/agent.stories.d.ts.map +1 -1
  140. package/dist/docs/chat-panel.d.ts +7 -5
  141. package/dist/docs/chat-panel.d.ts.map +1 -1
  142. package/dist/docs/chatbot-panel.d.ts.map +1 -1
  143. package/dist/docs/chatbot.stories.d.ts.map +1 -1
  144. package/dist/index.css +1 -1
  145. package/dist/index.es.js +1801 -1806
  146. package/dist/index.es.js.map +1 -1
  147. package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +9 -7
  148. package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -1
  149. package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +37 -9
  150. package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -1
  151. package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +41 -16
  152. package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -1
  153. package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +6 -0
  154. package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -1
  155. package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +22 -1
  156. package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -1
  157. package/package.json +16 -10
  158. package/src/__storybook__/parent-block.tsx +21 -0
  159. package/src/components/canvas-shell/__stories__/canvas-panel.tsx +25 -0
  160. package/src/components/canvas-shell/__stories__/document-list.tsx +29 -0
  161. package/src/components/canvas-shell/__stories__/fixtures.ts +222 -0
  162. package/src/components/canvas-shell/__stories__/holdings-table.tsx +56 -0
  163. package/src/components/canvas-shell/__stories__/types.ts +47 -0
  164. package/src/components/canvas-shell/{canvas-shell.test.tsx → __tests__/canvas-shell.spec.tsx} +1 -1
  165. package/src/components/canvas-shell/canvas-shell.json +24 -0
  166. package/src/components/canvas-shell/canvas-shell.stories.tsx +581 -122
  167. package/src/components/canvas-shell/canvas-shell.tsx +44 -17
  168. package/src/components/chat-card/__stories__/fixtures.ts +119 -0
  169. package/src/components/chat-card/__stories__/types.ts +44 -0
  170. package/src/components/chat-card/chat-card.json +67 -3
  171. package/src/components/chat-card/chat-card.stories.tsx +872 -148
  172. package/src/components/chat-card/chat-card.tsx +2 -0
  173. package/src/components/chat-card/components/chat-card-body.tsx +12 -0
  174. package/src/components/chat-card/components/chat-card-footer.tsx +11 -0
  175. package/src/components/chat-card/components/chat-card-form.tsx +21 -2
  176. package/src/components/chat-card/components/chat-card-header.tsx +39 -2
  177. package/src/components/chat-card/contexts.tsx +2 -0
  178. package/src/components/chat-card/hooks.ts +1 -0
  179. package/src/components/chat-card/types.ts +3 -0
  180. package/src/components/chat-card-container/__stories__/fixtures.ts +54 -0
  181. package/src/components/chat-card-container/__stories__/resizable-chat-window.tsx +19 -0
  182. package/src/components/chat-card-container/__stories__/result-card.tsx +31 -0
  183. package/src/components/chat-card-container/__stories__/types.ts +16 -0
  184. package/src/components/chat-card-container/chat-card-container.json +7 -0
  185. package/src/components/chat-card-container/chat-card-container.stories.tsx +209 -56
  186. package/src/components/chat-card-container/chat-card-container.tsx +5 -0
  187. package/src/components/chat-container/__stories__/chat-composer.tsx +67 -0
  188. package/src/components/chat-container/__stories__/fixtures.ts +27 -0
  189. package/src/components/chat-container/__stories__/measure.ts +22 -0
  190. package/src/components/chat-container/__stories__/types.ts +7 -0
  191. package/src/components/chat-container/__stories__/variable-readout.tsx +64 -0
  192. package/src/components/chat-container/chat-container.json +9 -1
  193. package/src/components/chat-container/chat-container.stories.tsx +538 -106
  194. package/src/components/chat-container/chat-container.tsx +3 -0
  195. package/src/components/chat-input/__stories__/fixtures.ts +31 -0
  196. package/src/components/chat-input/__tests__/chat-input.spec.tsx +100 -0
  197. package/src/components/chat-input/chat-input.json +11 -2
  198. package/src/components/chat-input/chat-input.stories.tsx +660 -197
  199. package/src/components/chat-input/chat-input.tsx +39 -5
  200. package/src/components/chat-input/plugins/controlled-value-plugin.tsx +16 -3
  201. package/src/components/chat-input/plugins/value-plugin.tsx +19 -4
  202. package/src/components/chat-list/__stories__/chat-row.tsx +41 -0
  203. package/src/components/chat-list/__stories__/fixtures.ts +94 -0
  204. package/src/components/chat-list/__stories__/types.ts +13 -0
  205. package/src/components/chat-list/chat-list-item.tsx +6 -0
  206. package/src/components/chat-list/chat-list-items.tsx +16 -0
  207. package/src/components/chat-list/chat-list.json +24 -2
  208. package/src/components/chat-list/chat-list.stories.tsx +631 -215
  209. package/src/components/chat-list/chat-list.tsx +51 -4
  210. package/src/components/chat-message/__stories__/fixtures.ts +53 -0
  211. package/src/components/chat-message/__stories__/sent-attachment.tsx +22 -0
  212. package/src/components/chat-message/__stories__/tool-steps.tsx +37 -0
  213. package/src/components/chat-message/chat-message.json +10 -1
  214. package/src/components/chat-message/chat-message.stories.tsx +282 -20
  215. package/src/components/chat-message/chat-message.tsx +16 -1
  216. package/src/components/chat-message/index.ts +8 -1
  217. package/src/components/chat-message-attachment-card/__stories__/fixtures.ts +30 -0
  218. package/src/components/chat-message-attachment-card/__stories__/types.ts +14 -0
  219. package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +4 -0
  220. package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +20 -0
  221. package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +266 -51
  222. package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +37 -4
  223. package/src/components/chat-message-attachment-card/index.ts +6 -0
  224. package/src/components/chat-message-attachment-card/utils.ts +1 -0
  225. package/src/components/chat-message-response/__stories__/fixtures.ts +50 -0
  226. package/src/components/chat-message-response/chat-message-response.json +5 -0
  227. package/src/components/chat-message-response/chat-message-response.stories.tsx +135 -26
  228. package/src/components/chat-message-toolbar/chat-message-toolbar.json +21 -3
  229. package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +377 -6
  230. package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +47 -12
  231. package/src/components/chat-message-toolbar/index.ts +4 -0
  232. package/src/components/chat-messages/__stories__/conversation-frame.tsx +25 -0
  233. package/src/components/chat-messages/__stories__/conversation-group.tsx +22 -0
  234. package/src/components/chat-messages/__stories__/fixtures.ts +70 -0
  235. package/src/components/chat-messages/__stories__/types.ts +5 -0
  236. package/src/components/chat-messages/chat-messages.json +30 -12
  237. package/src/components/chat-messages/chat-messages.stories.tsx +439 -212
  238. package/src/components/chat-messages/chat-messages.tsx +46 -3
  239. package/src/components/chat-notification-card/__stories__/fixtures.ts +38 -0
  240. package/src/components/chat-notification-card/__stories__/types.ts +13 -0
  241. package/src/components/chat-notification-card/chat-notification-card.json +52 -2
  242. package/src/components/chat-notification-card/chat-notification-card.stories.tsx +542 -62
  243. package/src/components/chat-notification-card/chat-notification-card.tsx +97 -6
  244. package/src/components/chat-notification-popup/__stories__/fixtures.ts +36 -0
  245. package/src/components/chat-notification-popup/__stories__/notification-item.tsx +93 -0
  246. package/src/components/chat-notification-popup/__stories__/types.ts +14 -0
  247. package/src/components/chat-notification-popup/chat-notification-popup.json +14 -1
  248. package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +467 -17
  249. package/src/components/chat-notification-popup/chat-notification-popup.tsx +18 -3
  250. package/src/components/chat-prompt-box/__stories__/fixtures.ts +16 -0
  251. package/src/components/chat-prompt-box/__stories__/types.ts +8 -0
  252. package/src/components/chat-prompt-box/chat-prompt-box.json +25 -2
  253. package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +535 -43
  254. package/src/components/chat-prompt-box/chat-prompt-box.tsx +73 -19
  255. package/src/components/chat-reply/chat-reply.json +10 -0
  256. package/src/components/chat-reply/chat-reply.stories.tsx +264 -21
  257. package/src/components/chat-reply/chat-reply.tsx +15 -0
  258. package/src/components/chat-reply/index.ts +10 -1
  259. package/src/components/chat-suggestion/__stories__/fixtures.ts +16 -0
  260. package/src/components/chat-suggestion/__tests__/chat-suggestion.spec.tsx +185 -0
  261. package/src/components/chat-suggestion/chat-suggestion.json +62 -20
  262. package/src/components/chat-suggestion/chat-suggestion.stories.tsx +542 -58
  263. package/src/components/chat-suggestion/chat-suggestion.tsx +154 -65
  264. package/src/components/chat-suggestion/index.ts +9 -0
  265. package/src/components/chat-thinking-process/__stories__/fixtures.ts +56 -0
  266. package/src/components/chat-thinking-process/chat-thinking-process.json +28 -3
  267. package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +354 -78
  268. package/src/components/chat-thinking-process/chat-thinking-process.tsx +55 -4
  269. package/src/components/chat-thread/__stories__/fixtures.ts +171 -0
  270. package/src/components/chat-thread/__stories__/scroll-position.ts +9 -0
  271. package/src/components/chat-thread/__stories__/snippets.ts +129 -0
  272. package/src/components/chat-thread/__stories__/thread-frame.tsx +22 -0
  273. package/src/components/chat-thread/__stories__/thread-turns.tsx +35 -0
  274. package/src/components/chat-thread/__stories__/types.ts +12 -0
  275. package/src/components/chat-thread/__stories__/use-turn-stream.ts +78 -0
  276. package/src/components/chat-thread/chat-thread.json +23 -3
  277. package/src/components/chat-thread/chat-thread.stories.tsx +804 -142
  278. package/src/components/chat-thread/chat-thread.tsx +64 -16
  279. package/src/components/index.ts +1 -3
  280. package/src/components/markdown-viewer/__stories__/fixtures.ts +67 -0
  281. package/src/components/markdown-viewer/markdown-viewer.json +7 -1
  282. package/src/components/markdown-viewer/markdown-viewer.stories.tsx +219 -50
  283. package/src/components/markdown-viewer/markdown-viewer.tsx +9 -0
  284. package/src/components/rich-text-area/__stories__/fixtures.ts +30 -0
  285. package/src/components/rich-text-area/__tests__/rich-text-area.spec.tsx +114 -0
  286. package/src/components/rich-text-area/plugins/controlled-value-plugin.tsx +20 -3
  287. package/src/components/rich-text-area/plugins/value-plugin.tsx +16 -3
  288. package/src/components/rich-text-area/rich-text-area.json +7 -4
  289. package/src/components/rich-text-area/rich-text-area.stories.tsx +597 -41
  290. package/src/components/rich-text-area/rich-text-area.tsx +27 -4
  291. package/src/components/rich-text-area/styled.tsx +11 -5
  292. package/src/components/rich-text-field/__stories__/fixtures.ts +29 -0
  293. package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +10 -1
  294. package/src/components/rich-text-field/components/index.ts +8 -5
  295. package/src/components/rich-text-field/components/text-color-button.tsx +16 -2
  296. package/src/components/rich-text-field/rich-text-field.json +3 -1
  297. package/src/components/rich-text-field/rich-text-field.stories.tsx +452 -61
  298. package/src/components/rich-text-field/rich-text-field.tsx +23 -0
  299. package/src/components/topmenu/index.ts +1 -0
  300. package/src/components/topmenu/topmenu.json +107 -0
  301. package/src/components/topmenu/topmenu.stories.tsx +334 -0
  302. package/src/components/topmenu/topmenu.tsx +71 -0
  303. package/src/docs/agent.stories.tsx +16 -16
  304. package/src/docs/chat-panel.tsx +37 -32
  305. package/src/docs/chatbot-panel.tsx +11 -2
  306. package/src/docs/chatbot.mdx +17 -12
  307. package/src/docs/chatbot.stories.tsx +7 -8
  308. package/src/layouts/chat-card-list-layout/__stories__/fixtures.ts +112 -0
  309. package/src/layouts/chat-card-list-layout/__stories__/result-card.tsx +36 -0
  310. package/src/layouts/chat-card-list-layout/__stories__/types.ts +31 -0
  311. package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +14 -1
  312. package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +316 -84
  313. package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +11 -7
  314. package/src/layouts/chat-card-three-column-layout/__stories__/fixtures.ts +117 -0
  315. package/src/layouts/chat-card-three-column-layout/__stories__/resizable-chat-window.tsx +18 -0
  316. package/src/layouts/chat-card-three-column-layout/__stories__/stay-details.tsx +85 -0
  317. package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +50 -0
  318. package/src/layouts/chat-card-three-column-layout/__stories__/stay-map.tsx +44 -0
  319. package/src/layouts/chat-card-three-column-layout/__stories__/stay-rooms.tsx +61 -0
  320. package/src/layouts/chat-card-three-column-layout/__stories__/types.ts +35 -0
  321. package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +16 -0
  322. package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +603 -182
  323. package/src/layouts/chat-card-two-column-layout/__stories__/connection-itinerary.tsx +51 -0
  324. package/src/layouts/chat-card-two-column-layout/__stories__/fixtures.ts +83 -0
  325. package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +24 -0
  326. package/src/layouts/chat-card-two-column-layout/__stories__/types.ts +15 -0
  327. package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +13 -1
  328. package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +368 -67
  329. package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +11 -2
  330. package/dist/components/card-item-picker/card-item-picker-context.d.ts +0 -21
  331. package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +0 -1
  332. package/dist/components/card-item-picker/card-item-picker-list.d.ts +0 -24
  333. package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +0 -1
  334. package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +0 -28
  335. package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +0 -1
  336. package/dist/components/card-item-picker/card-item-picker-row.d.ts +0 -12
  337. package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +0 -1
  338. package/dist/components/card-item-picker/card-item-picker.stories.d.ts +0 -19
  339. package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +0 -1
  340. package/dist/components/card-item-picker/index.d.ts +0 -9
  341. package/dist/components/card-item-picker/index.d.ts.map +0 -1
  342. package/dist/components/chat-message-history/chat-message-history.d.ts +0 -48
  343. package/dist/components/chat-message-history/chat-message-history.d.ts.map +0 -1
  344. package/dist/components/chat-message-history/chat-message-history.stories.d.ts +0 -7
  345. package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +0 -1
  346. package/dist/components/chat-message-history/index.d.ts +0 -2
  347. package/dist/components/chat-message-history/index.d.ts.map +0 -1
  348. package/dist/components/spinner/index.d.ts +0 -2
  349. package/dist/components/spinner/index.d.ts.map +0 -1
  350. package/dist/components/spinner/spinner.d.ts +0 -9
  351. package/dist/components/spinner/spinner.d.ts.map +0 -1
  352. package/dist/components/spinner/spinner.stories.d.ts +0 -8
  353. package/dist/components/spinner/spinner.stories.d.ts.map +0 -1
  354. package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +0 -279
  355. package/src/components/card-item-picker/card-item-picker-context.tsx +0 -44
  356. package/src/components/card-item-picker/card-item-picker-list.tsx +0 -95
  357. package/src/components/card-item-picker/card-item-picker-row-parts.tsx +0 -96
  358. package/src/components/card-item-picker/card-item-picker-row.tsx +0 -109
  359. package/src/components/card-item-picker/card-item-picker.json +0 -147
  360. package/src/components/card-item-picker/card-item-picker.stories.tsx +0 -158
  361. package/src/components/card-item-picker/index.ts +0 -24
  362. package/src/components/chat-message-history/chat-message-history.json +0 -99
  363. package/src/components/chat-message-history/chat-message-history.stories.tsx +0 -136
  364. package/src/components/chat-message-history/chat-message-history.tsx +0 -277
  365. package/src/components/chat-message-history/index.ts +0 -13
  366. package/src/components/spinner/index.ts +0 -1
  367. package/src/components/spinner/spinner.json +0 -73
  368. package/src/components/spinner/spinner.stories.tsx +0 -41
  369. package/src/components/spinner/spinner.tsx +0 -32
@@ -8,6 +8,7 @@ import type { ChatCardProps } from './types';
8
8
 
9
9
  export { useChatCardContext } from './context';
10
10
 
11
+ /** @deprecated Use `Card` from `@swisper.ai/cards-ui`. */
11
12
  export const ChatCard = forwardRef<HTMLElement, ChatCardProps>(function ChatCard(
12
13
  {
13
14
  className,
@@ -68,6 +69,7 @@ export const ChatCard = forwardRef<HTMLElement, ChatCardProps>(function ChatCard
68
69
  <section
69
70
  ref={ref}
70
71
  role="region"
72
+ data-slot="chat-card"
71
73
  aria-current={isSelected}
72
74
  data-testid="chat-card"
73
75
  data-variant={variant}
@@ -6,13 +6,16 @@ import { cn } from '@swisper.ai/web-core';
6
6
 
7
7
  import { useChatCardContext } from '../context';
8
8
 
9
+ /** @deprecated Use `CardMediaProps` from `@swisper.ai/cards-ui`. */
9
10
  export interface ChatCardMediaProps extends Omit<ComponentProps<'figure'>, 'aria-label'> {
10
11
  children: ReactNode;
11
12
  }
12
13
 
14
+ /** @deprecated Use `CardMedia` from `@swisper.ai/cards-ui`. */
13
15
  export function ChatCardMedia({ className, children, ...rest }: ChatCardMediaProps) {
14
16
  return (
15
17
  <figure
18
+ data-slot="chat-card-media"
16
19
  data-testid="chat-card-media"
17
20
  className={cn('min-h-0 shrink-0 h-[222px]', className)}
18
21
  {...rest}
@@ -22,16 +25,19 @@ export function ChatCardMedia({ className, children, ...rest }: ChatCardMediaPro
22
25
  );
23
26
  }
24
27
 
28
+ /** @deprecated Use `CardBodyProps` from `@swisper.ai/cards-ui`. */
25
29
  export interface ChatCardBodyProps extends Omit<ComponentProps<'div'>, 'aria-label'> {
26
30
  children: ReactNode;
27
31
  asChild?: boolean;
28
32
  }
29
33
 
34
+ /** @deprecated Use `CardBody` from `@swisper.ai/cards-ui`. */
30
35
  export function ChatCardBody({ className, children, asChild = false, ...rest }: ChatCardBodyProps) {
31
36
  const Component = asChild ? Slot : 'div';
32
37
 
33
38
  return (
34
39
  <CollapsibleContent
40
+ data-slot="chat-card-body"
35
41
  data-testid="chat-card-body"
36
42
  className={cn(
37
43
  'flex flex-1 flex-col',
@@ -48,6 +54,7 @@ export function ChatCardBody({ className, children, asChild = false, ...rest }:
48
54
  );
49
55
  }
50
56
 
57
+ /** @deprecated Use `CardContentProps` from `@swisper.ai/cards-ui`. */
51
58
  export interface ChatCardContentProps extends Omit<ComponentProps<'div'>, 'aria-label'> {
52
59
  children: ReactNode;
53
60
  asChild?: boolean;
@@ -55,6 +62,7 @@ export interface ChatCardContentProps extends Omit<ComponentProps<'div'>, 'aria-
55
62
  hasHeaderPadding?: boolean;
56
63
  }
57
64
 
65
+ /** @deprecated Use `CardContent` from `@swisper.ai/cards-ui`. */
58
66
  export function ChatCardContent({
59
67
  className,
60
68
  children,
@@ -68,6 +76,7 @@ export function ChatCardContent({
68
76
 
69
77
  return (
70
78
  <Component
79
+ data-slot="chat-card-content"
71
80
  data-testid="chat-card-content"
72
81
  data-padding={hasPadding}
73
82
  data-has-header-padding={hasHeaderPadding}
@@ -88,15 +97,18 @@ export function ChatCardContent({
88
97
  );
89
98
  }
90
99
 
100
+ /** @deprecated Use `CardPreviewProps` from `@swisper.ai/cards-ui`. */
91
101
  export interface ChatCardPreviewProps extends ComponentProps<'div'> {
92
102
  children: ReactNode;
93
103
  }
94
104
 
105
+ /** @deprecated Use `CardPreview` from `@swisper.ai/cards-ui`. */
95
106
  export function ChatCardPreview({ className, children, ...rest }: ChatCardPreviewProps) {
96
107
  const { level } = useChatCardContext();
97
108
 
98
109
  return (
99
110
  <div
111
+ data-slot="chat-card-preview"
100
112
  data-testid="chat-card-preview"
101
113
  data-level={level}
102
114
  className={cn(
@@ -4,10 +4,12 @@ import { cn } from '@swisper.ai/web-core';
4
4
 
5
5
  import { useChatCardContext } from '../context';
6
6
 
7
+ /** @deprecated Use `CardFooterProps` from `@swisper.ai/cards-ui`. */
7
8
  export interface ChatCardFooterProps extends ComponentProps<'footer'> {
8
9
  children: ReactNode;
9
10
  }
10
11
 
12
+ /** @deprecated Use `CardFooter` from `@swisper.ai/cards-ui`. */
11
13
  export function ChatCardFooter({ className, children, ...rest }: ChatCardFooterProps) {
12
14
  const { level } = useChatCardContext();
13
15
 
@@ -31,14 +33,17 @@ export function ChatCardFooter({ className, children, ...rest }: ChatCardFooterP
31
33
  );
32
34
  }
33
35
 
36
+ /** @deprecated Put your own block in `CardFooterLeft` from `@swisper.ai/cards-ui`. */
34
37
  export interface ChatCardFooterNotesProps {
35
38
  children: ReactNode;
36
39
  className?: string;
37
40
  }
38
41
 
42
+ /** @deprecated Put your own block in `CardFooterLeft` from `@swisper.ai/cards-ui`. */
39
43
  export function ChatCardFooterNotes({ className, children }: ChatCardFooterNotesProps) {
40
44
  return (
41
45
  <div
46
+ data-slot="chat-card-footer-notes"
42
47
  data-testid="chat-card-footer-notes"
43
48
  className={cn(
44
49
  'mr-auto shrink-0',
@@ -52,14 +57,17 @@ export function ChatCardFooterNotes({ className, children }: ChatCardFooterNotes
52
57
  );
53
58
  }
54
59
 
60
+ /** @deprecated Put your own block in `CardFooterRight` from `@swisper.ai/cards-ui`. */
55
61
  export interface ChatCardFooterPriceProps {
56
62
  children: ReactNode;
57
63
  className?: string;
58
64
  }
59
65
 
66
+ /** @deprecated Put your own block in `CardFooterRight` from `@swisper.ai/cards-ui`. */
60
67
  export function ChatCardFooterPrice({ className, children }: ChatCardFooterPriceProps) {
61
68
  return (
62
69
  <div
70
+ data-slot="chat-card-footer-price"
63
71
  data-testid="chat-card-footer-price"
64
72
  className={cn(
65
73
  'flex flex-col items-end justify-center',
@@ -73,10 +81,12 @@ export function ChatCardFooterPrice({ className, children }: ChatCardFooterPrice
73
81
  );
74
82
  }
75
83
 
84
+ /** @deprecated Use `CardFooterActionsProps` from `@swisper.ai/cards-ui`. */
76
85
  export interface ChatCardFooterActionsProps extends Omit<ComponentProps<'div'>, 'aria-label'> {
77
86
  children: ReactNode;
78
87
  }
79
88
 
89
+ /** @deprecated Use `CardFooterActions` from `@swisper.ai/cards-ui`. */
80
90
  export function ChatCardFooterActions({
81
91
  className,
82
92
  children,
@@ -85,6 +95,7 @@ export function ChatCardFooterActions({
85
95
  return (
86
96
  <div
87
97
  role="group"
98
+ data-slot="chat-card-footer-actions"
88
99
  data-testid="chat-card-footer-actions"
89
100
  className={cn('flex items-center gap-card-footer-gap shrink-0', className)}
90
101
  {...rest}
@@ -5,12 +5,17 @@ import type { ComponentProps, ReactNode } from 'react';
5
5
  import { Chip, Typography } from '@swisper.ai/ui';
6
6
  import { cn } from '@swisper.ai/web-core';
7
7
 
8
- export interface ChatCardForm extends ComponentProps<'form'> {
8
+ /** @deprecated Use `CardFieldsProps` from `@swisper.ai/cards-ui`. */
9
+ export interface ChatCardFormProps extends ComponentProps<'form'> {
9
10
  children: ReactNode;
10
11
  asChild?: boolean;
11
12
  }
12
13
 
13
- export const ChatCardForm = forwardRef<HTMLFormElement, ChatCardForm>(function ChatCardForm(
14
+ /** @deprecated The props of `ChatCardForm` under the component's own name; use `ChatCardFormProps`. */
15
+ export interface ChatCardForm extends ChatCardFormProps {}
16
+
17
+ /** @deprecated Use `CardFields` from `@swisper.ai/cards-ui`. */
18
+ export const ChatCardForm = forwardRef<HTMLFormElement, ChatCardFormProps>(function ChatCardForm(
14
19
  { className, children, asChild, ...rest },
15
20
  ref,
16
21
  ) {
@@ -19,6 +24,7 @@ export const ChatCardForm = forwardRef<HTMLFormElement, ChatCardForm>(function C
19
24
  return (
20
25
  <Component
21
26
  ref={ref}
27
+ data-slot="chat-card-form"
22
28
  data-testid="chat-card-form"
23
29
  className={cn(
24
30
  'bg-steel-900 border border-steel-700',
@@ -34,14 +40,19 @@ export const ChatCardForm = forwardRef<HTMLFormElement, ChatCardForm>(function C
34
40
  );
35
41
  });
36
42
 
43
+ ChatCardForm.displayName = 'ChatCardForm';
44
+
45
+ /** @deprecated Use `CardAttributesProps` from `@swisper.ai/cards-ui`. */
37
46
  export interface ChatCardAttributesProps {
38
47
  children: ReactNode;
39
48
  className?: string;
40
49
  }
41
50
 
51
+ /** @deprecated Use `CardAttributes` from `@swisper.ai/cards-ui`. */
42
52
  export function ChatCardAttributes({ className, children }: ChatCardAttributesProps) {
43
53
  return (
44
54
  <ul
55
+ data-slot="chat-card-attributes"
45
56
  data-testid="chat-card-attributes"
46
57
  className={cn('flex flex-col justify-start items-start gap-8', 'mb-24', className)}
47
58
  >
@@ -50,14 +61,17 @@ export function ChatCardAttributes({ className, children }: ChatCardAttributesPr
50
61
  );
51
62
  }
52
63
 
64
+ /** @deprecated Use `CardAttributeProps` from `@swisper.ai/cards-ui`. */
53
65
  export interface ChatCardAttributeProps {
54
66
  className?: string;
55
67
  children: ReactNode;
56
68
  }
57
69
 
70
+ /** @deprecated Use `CardAttribute` from `@swisper.ai/cards-ui`. */
58
71
  export function ChatCardAttribute({ className, children, ...rest }: ChatCardAttributeProps) {
59
72
  return (
60
73
  <li
74
+ data-slot="chat-card-attribute"
61
75
  data-testid="chat-card-attribute-item"
62
76
  className={cn('grid grid-cols-[66px_1fr] gap-8', 'w-full', 'min-h-24', className)}
63
77
  {...rest}
@@ -67,12 +81,14 @@ export function ChatCardAttribute({ className, children, ...rest }: ChatCardAttr
67
81
  );
68
82
  }
69
83
 
84
+ /** @deprecated Use `CardAttributeLabelProps` from `@swisper.ai/cards-ui`. */
70
85
  export interface ChatCardAttributeLabelProps {
71
86
  children: ReactNode;
72
87
  className?: string;
73
88
  hasPadding?: boolean;
74
89
  }
75
90
 
91
+ /** @deprecated Use `CardAttributeLabel` from `@swisper.ai/cards-ui`. */
76
92
  export function ChatCardAttributeLabel({
77
93
  className,
78
94
  children,
@@ -84,6 +100,7 @@ export function ChatCardAttributeLabel({
84
100
  variant="outlined"
85
101
  size="md"
86
102
  color="info"
103
+ data-slot="chat-card-attribute-label"
87
104
  data-has-padding={hasPadding}
88
105
  className={cn('w-full', 'data-[has-padding=true]:my-[5px]', className)}
89
106
  data-testid="chat-card-attribute-label"
@@ -94,11 +111,13 @@ export function ChatCardAttributeLabel({
94
111
  );
95
112
  }
96
113
 
114
+ /** @deprecated Use `CardAttributeValueProps` from `@swisper.ai/cards-ui`. */
97
115
  export interface ChatCardAttributeValueProps extends Omit<ComponentProps<'dt'>, 'aria-Value'> {
98
116
  children: ReactNode;
99
117
  asChild?: boolean;
100
118
  }
101
119
 
120
+ /** @deprecated Use `CardAttributeValue` from `@swisper.ai/cards-ui`. */
102
121
  export function ChatCardAttributeValue({
103
122
  className,
104
123
  children,
@@ -13,11 +13,23 @@ import { cn } from '@swisper.ai/web-core';
13
13
 
14
14
  import { useChatCardContext } from '../context';
15
15
 
16
+ /** @deprecated Use `CardHeaderProps` from `@swisper.ai/cards-ui`. */
16
17
  export interface ChatCardHeaderProps extends Omit<ComponentProps<'header'>, 'aria-label'> {
17
18
  children: ReactNode;
19
+ /**
20
+ * Classes for the inner row that wraps the children (`data-slot="chat-card-header-hover-area"`):
21
+ * the element that highlights on hover and, in a collapsible card, toggles it.
22
+ */
23
+ hoverAreaClassName?: string;
18
24
  }
19
25
 
20
- export function ChatCardHeader({ className, children, ...rest }: ChatCardHeaderProps) {
26
+ /** @deprecated Use `CardHeader` from `@swisper.ai/cards-ui`. */
27
+ export function ChatCardHeader({
28
+ className,
29
+ children,
30
+ hoverAreaClassName,
31
+ ...rest
32
+ }: ChatCardHeaderProps) {
21
33
  const { isCollapsible, level } = useChatCardContext();
22
34
 
23
35
  const inner = (
@@ -31,6 +43,7 @@ export function ChatCardHeader({ className, children, ...rest }: ChatCardHeaderP
31
43
  level === 1 && isCollapsible && 'hover:bg-layout-accent-low-background-hover-base',
32
44
  level === 1 && 'group-hover/chat-card:bg-layout-accent-low-background-hover-base',
33
45
  !isCollapsible && 'cursor-default',
46
+ hoverAreaClassName,
34
47
  )}
35
48
  >
36
49
  {children}
@@ -40,6 +53,8 @@ export function ChatCardHeader({ className, children, ...rest }: ChatCardHeaderP
40
53
  return (
41
54
  <header
42
55
  data-slot="chat-card-header"
56
+ data-level={level}
57
+ data-collapsible={isCollapsible}
43
58
  className={cn(
44
59
  'flex items-start',
45
60
  level === 1 ? 'p-card-header-lvl-1' : 'px-card-header-lvl-2',
@@ -58,16 +73,20 @@ export function ChatCardHeader({ className, children, ...rest }: ChatCardHeaderP
58
73
  );
59
74
  }
60
75
 
76
+ /** @deprecated Use `CardIconProps` from `@swisper.ai/cards-ui`. */
61
77
  export interface ChatCardIconProps extends ComponentProps<'div'> {
62
78
  children: ReactNode;
63
79
  }
64
80
 
81
+ /** @deprecated Use `CardIcon` from `@swisper.ai/cards-ui`. */
65
82
  export function ChatCardIcon({ className, children, ...rest }: ChatCardIconProps) {
66
83
  const { level } = useChatCardContext();
67
84
 
68
85
  return (
69
86
  <div
87
+ data-slot="chat-card-icon"
70
88
  data-testid="chat-card-icon"
89
+ data-level={level}
71
90
  className={cn(
72
91
  'shrink-0',
73
92
  'inline-flex items-center justify-center self-center',
@@ -84,10 +103,12 @@ export function ChatCardIcon({ className, children, ...rest }: ChatCardIconProps
84
103
  );
85
104
  }
86
105
 
106
+ /** @deprecated Use `CardHeaderContentProps` from `@swisper.ai/cards-ui`. */
87
107
  export interface ChatCardHeaderContentProps extends ComponentProps<'div'> {
88
108
  children: ReactNode;
89
109
  }
90
110
 
111
+ /** @deprecated Use `CardHeaderContent` from `@swisper.ai/cards-ui`. */
91
112
  export function ChatCardHeaderContent({
92
113
  className,
93
114
  children,
@@ -97,7 +118,9 @@ export function ChatCardHeaderContent({
97
118
 
98
119
  return (
99
120
  <div
121
+ data-slot="chat-card-header-content"
100
122
  data-testid="chat-card-header-content"
123
+ data-level={level}
101
124
  className={cn(
102
125
  'flex-1',
103
126
  'flex flex-col gap-0 items-start justify-center',
@@ -111,10 +134,12 @@ export function ChatCardHeaderContent({
111
134
  );
112
135
  }
113
136
 
137
+ /** @deprecated Use `CardTitleProps` from `@swisper.ai/cards-ui`. */
114
138
  export interface ChatCardTitleProps extends Omit<TypographyProps, 'variant'> {
115
139
  children: ReactNode;
116
140
  }
117
141
 
142
+ /** @deprecated Use `CardTitle` from `@swisper.ai/cards-ui`. */
118
143
  export function ChatCardTitle({ className, children, ...rest }: ChatCardTitleProps) {
119
144
  return (
120
145
  <Typography
@@ -128,10 +153,12 @@ export function ChatCardTitle({ className, children, ...rest }: ChatCardTitlePro
128
153
  );
129
154
  }
130
155
 
156
+ /** @deprecated Use `CardSubTitleProps` from `@swisper.ai/cards-ui`. */
131
157
  export interface ChatCardSubTitleProps extends Omit<TypographyProps, 'variant'> {
132
158
  children: ReactNode;
133
159
  }
134
160
 
161
+ /** @deprecated Use `CardSubTitle` from `@swisper.ai/cards-ui`. */
135
162
  export function ChatCardSubTitle({ className, children, ...rest }: ChatCardSubTitleProps) {
136
163
  return (
137
164
  <Typography
@@ -145,17 +172,21 @@ export function ChatCardSubTitle({ className, children, ...rest }: ChatCardSubTi
145
172
  );
146
173
  }
147
174
 
175
+ /** @deprecated Use `CardActionsProps` from `@swisper.ai/cards-ui`. */
148
176
  export interface ChatCardActionsProps extends Omit<ComponentProps<'div'>, 'aria-label'> {
149
177
  children: ReactNode;
150
178
  }
151
179
 
180
+ /** @deprecated Use `CardActions` from `@swisper.ai/cards-ui`. */
152
181
  export function ChatCardActions({ className, children, ...rest }: ChatCardActionsProps) {
153
182
  const { level } = useChatCardContext();
154
183
 
155
184
  return (
156
185
  <div
157
186
  role="group"
187
+ data-slot="chat-card-actions"
158
188
  data-testid="chat-card-actions"
189
+ data-level={level}
159
190
  className={cn(
160
191
  'ml-auto shrink-0',
161
192
  'flex items-center self-center gap-card-header-gap-icon-buttons',
@@ -171,12 +202,14 @@ export function ChatCardActions({ className, children, ...rest }: ChatCardAction
171
202
  );
172
203
  }
173
204
 
205
+ /** @deprecated Use `CardActionButtonProps` from `@swisper.ai/cards-ui`. */
174
206
  export interface ChatCardActionButtonProps extends Omit<IconButtonProps, 'variant' | 'size'> {
175
207
  children: ReactNode;
176
208
  shouldPreventCollapse?: boolean;
177
209
  tooltip?: ReactNode;
178
210
  }
179
211
 
212
+ /** @deprecated Use `CardActionButton` from `@swisper.ai/cards-ui`. */
180
213
  export function ChatCardActionButton({
181
214
  className,
182
215
  children,
@@ -195,6 +228,7 @@ export function ChatCardActionButton({
195
228
 
196
229
  const content = (
197
230
  <IconButton
231
+ data-slot="chat-card-action-button"
198
232
  variant="tertiary"
199
233
  size="sm"
200
234
  className={cn(className)}
@@ -212,11 +246,13 @@ export function ChatCardActionButton({
212
246
  return <Tooltip tooltip={tooltip}>{content}</Tooltip>;
213
247
  }
214
248
 
249
+ /** @deprecated Use `CardCollapsibleButtonProps` from `@swisper.ai/cards-ui`. */
215
250
  export interface ChatCardCollapsibleButtonProps extends Omit<
216
251
  ChatCardActionButtonProps,
217
252
  'children' | 'shouldPreventCollapse'
218
253
  > {}
219
254
 
255
+ /** @deprecated Use `CardCollapsibleButton` from `@swisper.ai/cards-ui`. */
220
256
  export function ChatCardCollapsibleButton({ className, ...rest }: ChatCardCollapsibleButtonProps) {
221
257
  const { isCollapsible } = useChatCardContext();
222
258
  if (!isCollapsible) {
@@ -225,12 +261,13 @@ export function ChatCardCollapsibleButton({ className, ...rest }: ChatCardCollap
225
261
 
226
262
  return (
227
263
  <ChatCardActionButton
264
+ data-slot="chat-card-collapsible-button"
228
265
  shouldPreventCollapse={false}
229
266
  isSemantic={false}
230
267
  className={cn(
231
- className,
232
268
  'transition-transform duration-300',
233
269
  'group-data-[state=open]/collapsible:rotate-180',
270
+ className,
234
271
  )}
235
272
  {...rest}
236
273
  >
@@ -6,6 +6,7 @@ type EditableChatCardContextValue = ReturnType<typeof useEditChatCard>;
6
6
 
7
7
  const EditableChatCardContext = createContext<EditableChatCardContextValue>(null!);
8
8
 
9
+ /** @deprecated `@swisper.ai/cards-ui` holds no edit state: keep `isEditing` in the app and pass it to `Card`'s `isSelected`. */
9
10
  export function useEditableChatCardContext() {
10
11
  const context = useContext(EditableChatCardContext);
11
12
 
@@ -24,6 +25,7 @@ interface EditableChatCardContextProviderProps {
24
25
  isEditable?: boolean;
25
26
  }
26
27
 
28
+ /** @deprecated `@swisper.ai/cards-ui` holds no edit state: keep `isEditing` in the app and pass it to `Card`'s `isSelected`. */
27
29
  export function EditableChatCardContextProvider({
28
30
  children,
29
31
  defaultEditing = false,
@@ -5,6 +5,7 @@ interface UseEditChatCardProps {
5
5
  defaultEditing?: boolean;
6
6
  }
7
7
 
8
+ /** @deprecated `@swisper.ai/cards-ui` holds no edit state: keep `isEditing` in the app and pass it to `Card`'s `isSelected`. */
8
9
  export function useEditChatCard({ isEditable, defaultEditing = false }: UseEditChatCardProps) {
9
10
  const [isEditing, setIsEditing] = useState(defaultEditing);
10
11
 
@@ -1,9 +1,12 @@
1
1
  import type { ComponentProps, ReactNode } from 'react';
2
2
 
3
+ /** @deprecated Use `CardVariant` from `@swisper.ai/cards-ui`. */
3
4
  export type ChatCardVariant = 'default' | 'action';
4
5
 
6
+ /** @deprecated Use `CardLevel` from `@swisper.ai/cards-ui`. */
5
7
  export type ChatCardLevel = 1 | 2;
6
8
 
9
+ /** @deprecated Use `CardProps` from `@swisper.ai/cards-ui`. */
7
10
  export interface ChatCardProps extends Omit<ComponentProps<'section'>, 'aria-label'> {
8
11
  children: ReactNode;
9
12
  variant?: ChatCardVariant;
@@ -0,0 +1,54 @@
1
+ import type { NewsArticle, TrainConnection } from './types';
2
+
3
+ export const WEATHER_SUMMARY =
4
+ 'Today partly cloudy, 18°C. Tomorrow light rain, 14°C. Sunday sunny, 21°C.';
5
+
6
+ // Shaped like the rows a transport search returns; the last one has no platform yet.
7
+ export const TRAIN_CONNECTIONS: TrainConnection[] = [
8
+ {
9
+ train: 'IC 1',
10
+ route: 'Zurich HB → Geneva Airport',
11
+ departure: '08:02',
12
+ arrival: '10:57',
13
+ duration: '2h 55m',
14
+ platform: '7',
15
+ price: 'CHF 89.00',
16
+ },
17
+ {
18
+ train: 'IR 15',
19
+ route: 'Zurich HB → Geneva',
20
+ departure: '08:32',
21
+ arrival: '11:16',
22
+ duration: '2h 44m',
23
+ platform: '12',
24
+ price: 'CHF 89.00',
25
+ },
26
+ {
27
+ train: 'IC 5',
28
+ route: 'Zurich HB → Geneva Airport via Biel/Bienne and Neuchâtel',
29
+ departure: '09:03',
30
+ arrival: '11:58',
31
+ duration: '2h 55m',
32
+ platform: null,
33
+ price: 'CHF 44.50',
34
+ },
35
+ ];
36
+
37
+ export const NEWS_ARTICLES: NewsArticle[] = [
38
+ {
39
+ id: 'news_01',
40
+ source: 'Alpine Daily',
41
+ headline: 'Gotthard night trains return with the December timetable',
42
+ },
43
+ {
44
+ id: 'news_02',
45
+ source: 'The Lakeside Post',
46
+ headline: 'Zurich opens its first car-free quarter to residents',
47
+ },
48
+ {
49
+ id: 'news_03',
50
+ source: 'Valley Courier',
51
+ headline:
52
+ 'Early snow closes three passes and reroutes weekend traffic through the Rhine valley',
53
+ },
54
+ ];
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import { ChatContainer } from '../../chat-container';
4
+
5
+ export interface ResizableChatWindowProps {
6
+ children: ReactNode;
7
+ }
8
+
9
+ /**
10
+ * A chat window with a drag handle on its right edge. The `md` breakpoint is 820px in this
11
+ * design system, so the handle has to cross that width for the variants to separate.
12
+ */
13
+ export function ResizableChatWindow({ children }: ResizableChatWindowProps) {
14
+ return (
15
+ <div className="w-225 max-w-full min-w-80 resize-x overflow-auto border border-dashed border-steel-700">
16
+ <ChatContainer className="h-auto py-16">{children}</ChatContainer>
17
+ </div>
18
+ );
19
+ }
@@ -0,0 +1,31 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import {
4
+ ChatCard,
5
+ ChatCardBody,
6
+ ChatCardContent,
7
+ ChatCardHeader,
8
+ ChatCardHeaderContent,
9
+ ChatCardTitle,
10
+ } from '../../chat-card';
11
+
12
+ export interface ResultCardProps {
13
+ title: string;
14
+ children: ReactNode;
15
+ }
16
+
17
+ /** A result card as the assistant returns it: a title and one body. */
18
+ export function ResultCard({ title, children }: ResultCardProps) {
19
+ return (
20
+ <ChatCard fullWidth>
21
+ <ChatCardHeader>
22
+ <ChatCardHeaderContent>
23
+ <ChatCardTitle>{title}</ChatCardTitle>
24
+ </ChatCardHeaderContent>
25
+ </ChatCardHeader>
26
+ <ChatCardBody>
27
+ <ChatCardContent>{children}</ChatCardContent>
28
+ </ChatCardBody>
29
+ </ChatCard>
30
+ );
31
+ }
@@ -0,0 +1,16 @@
1
+ export interface TrainConnection {
2
+ train: string;
3
+ route: string;
4
+ departure: string;
5
+ arrival: string;
6
+ duration: string;
7
+ /** `null` until the operator announces it. */
8
+ platform: string | null;
9
+ price: string;
10
+ }
11
+
12
+ export interface NewsArticle {
13
+ id: string;
14
+ source: string;
15
+ headline: string;
16
+ }
@@ -2,6 +2,11 @@
2
2
  "$schema": "../../../../int-eslint-config/schemas/component.schema.json",
3
3
  "component": "chat-card-container",
4
4
  "purpose": "Sizes a chat card against the chat window and reading-column widths that ChatContainer publishes, so cards line up with the message text.",
5
+ "anatomy": [
6
+ "import { ChatCardContainer } from '@swisper.ai/web-chat-ui';",
7
+ "",
8
+ "<ChatCardContainer />"
9
+ ],
5
10
  "useWhen": [
6
11
  "Placing a ChatCard (or a ChatCardListLayout of cards) in a chat message list",
7
12
  "A card should match the reading column of the messages around it (variant fixed)",
@@ -9,6 +14,7 @@
9
14
  "A card is rendered inside a message body next to text and must share its inset (inline)"
10
15
  ],
11
16
  "avoidWhen": [
17
+ "Deprecated — use cards-ui/flexible-container for new code; ChatCardContainer stays only so existing imports keep compiling",
12
18
  "Sizing content that is not a card, such as message text — ChatMessage and the thread already handle the reading column",
13
19
  "Outside a chat surface — without ChatContainer's variables it just takes its parent's width; use plain layout classes instead"
14
20
  ],
@@ -70,6 +76,7 @@
70
76
  }
71
77
  ],
72
78
  "relatedComponents": [
79
+ "cards-ui/flexible-container",
73
80
  "web-chat-ui/chat-card",
74
81
  "web-chat-ui/chat-container",
75
82
  "web-chat-ui/chat-card-list-layout",