@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
@@ -42,11 +42,12 @@ export interface ChatCardListLayoutProps extends ComponentProps<'div'> {
42
42
  /**
43
43
  * Holds a list of chat cards and reveals the overflow behind a one-way "show more".
44
44
  *
45
- * Structure and state only — the sole class it emits is the `group/chat-card-list-layout`
46
- * marker, which paints nothing and exists so descendants can react to the expanded state
47
- * with `group-data-[expanded=true]/chat-card-list-layout:…`. Direction, gap and every
48
- * other visual decision come from the consumer's `className`, so the same layout serves
49
- * a stacked card list and a horizontal strip without a variant prop.
45
+ * Structure and state only. By default the root stacks its children in a left-aligned
46
+ * column with an 8px gap; `className` is merged last, so the consumer's direction, gap and
47
+ * alignment replace those and the same layout serves a stacked card list and a horizontal
48
+ * strip without a variant prop. The `group/chat-card-list-layout` marker paints nothing
49
+ * and exists so descendants can react to the expanded state with
50
+ * `group-data-[expanded=true]/chat-card-list-layout:…`.
50
51
  *
51
52
  * The three parts exist because the pieces of information live in different places: only
52
53
  * `ChatCardListLayoutItems` knows how many children there are, only
@@ -87,8 +88,9 @@ export interface ChatCardListLayoutShowMoreProps extends Omit<ButtonProps, 'chil
87
88
  * list is expanded, or it never overflowed — which is what makes the button a one-shot
88
89
  * affordance rather than a toggle.
89
90
  *
90
- * It sets no `variant`, `size` or `className` of its own so the design system's `Button`
91
- * defaults apply untouched and a consumer's props are not fighting ours.
91
+ * By default it is a small tertiary `Button` centred under the cards. Every `Button` prop
92
+ * is forwarded after those defaults and `className` is merged last, so a consumer's
93
+ * `variant`, `size` or classes win.
92
94
  */
93
95
  export declare const ChatCardListLayoutShowMore: import('react').ForwardRefExoticComponent<Omit<ChatCardListLayoutShowMoreProps, "ref"> & import('react').RefAttributes<HTMLButtonElement | HTMLSpanElement>>;
94
96
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"chat-card-list-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAanE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAalD,UAAU,8BAA8B;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAID;;;;;;GAMG;AACH,wBAAgB,4BAA4B,mCAY3C;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,iIA0D9B,CAAC;AAIF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,4BAA4B,+BAkBjF;AAED,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IACpF;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,8JA+BrC,CAAC"}
1
+ {"version":3,"file":"chat-card-list-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAanE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAalD,UAAU,8BAA8B;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAID;;;;;;GAMG;AACH,wBAAgB,4BAA4B,mCAY3C;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,iIA2D9B,CAAC;AAIF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,4BAA4B,+BAkBjF;AAED,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IACpF;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,8JAgCrC,CAAC"}
@@ -1,24 +1,52 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { ButtonProps } from '@swisper.ai/ui';
2
3
  import { ChatCardListLayout } from './chat-card-list-layout';
3
4
  declare const meta: Meta<typeof ChatCardListLayout>;
4
5
  export default meta;
5
6
  type Story = StoryObj<typeof ChatCardListLayout>;
6
7
  /**
7
- * Eight cards, three shown. The stacking and the gap come from the `className` on the
8
- * layout — it contributes no spacing of its own — and the five hidden cards are not in
9
- * the DOM until the button is clicked.
8
+ * Six emails, three shown. The other three are not in the DOM until the button is clicked, and
9
+ * the button removes itself once they are.
10
10
  */
11
11
  export declare const Default: Story;
12
+ /** Checks that only the visible slice mounts, and that the button reveals the rest from the keyboard and then removes itself. */
13
+ export declare const ShowMoreRevealsCards: Story;
12
14
  /**
13
- * Two cards under a limit of three. The button is never rendered, so a short list carries
14
- * no dead affordance.
15
+ * Two events under the default limit of three. The button is never rendered, so a short list
16
+ * carries no dead affordance.
15
17
  */
16
18
  export declare const ShorterThanLimit: Story;
19
+ /** Checks that a list shorter than the limit mounts every card and no button. */
20
+ export declare const ShorterThanLimitHasNoButton: Story;
17
21
  /**
18
- * The label is a required child rather than a built-in string, so it can be translated
19
- * and can carry the count. `useChatCardListLayoutContext` publishes `hiddenCount` for
20
- * exactly this; `variant` is forwarded straight to the design system's `Button`.
22
+ * A list that starts expanded, as in a message restored from history that the reader had already
23
+ * expanded: every card is mounted and there is no button.
24
+ */
25
+ export declare const Expanded: Story;
26
+ /**
27
+ * The label is a required child rather than a built-in string, so it can be translated and can
28
+ * carry the count: `useChatCardListLayoutContext` publishes `hiddenCount` for exactly this.
21
29
  */
22
30
  export declare const CountInLabel: Story;
23
- export declare const Playground: Story;
31
+ /** Checks that the label counts the hidden cards and that a click reveals them. */
32
+ export declare const CountInLabelCountsHiddenCards: Story;
33
+ /** The list in the parent it's allowed in, then in a chat thread and in an assistant message. */
34
+ export declare const Examples: Story;
35
+ interface ChatCardListLayoutPlaygroundProps {
36
+ visibleCount: number;
37
+ defaultExpanded: boolean;
38
+ expanded?: boolean;
39
+ asChild: boolean;
40
+ className: string;
41
+ itemCount: number;
42
+ label: string;
43
+ variant: ButtonProps['variant'];
44
+ size: ButtonProps['size'];
45
+ hasCountInLabel: boolean;
46
+ onExpandedChange: (expanded: boolean) => void;
47
+ onClick: () => void;
48
+ }
49
+ declare function ChatCardListLayoutPlayground({ visibleCount, defaultExpanded, expanded, asChild, className, itemCount, label, variant, size, hasCountInLabel, onExpandedChange, onClick, }: ChatCardListLayoutPlaygroundProps): import('react').JSX.Element;
50
+ /** Every part of the list at once, with each prop, the card count and both kinds of trigger on the Controls panel. */
51
+ export declare const Playground: StoryObj<typeof ChatCardListLayoutPlayground>;
24
52
  //# sourceMappingURL=chat-card-list-layout.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-card-list-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAc5D,OAAO,EACL,kBAAkB,EAInB,MAAM,yBAAyB,CAAC;AAoCjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAgDzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC"}
1
+ {"version":3,"file":"chat-card-list-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AASlD,OAAO,EACL,kBAAkB,EAInB,MAAM,yBAAyB,CAAC;AAGjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAuDzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAmBrB,CAAC;AAEF,iIAAiI;AACjI,eAAO,MAAM,oBAAoB,EAAE,KAyBlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,EAAE,KAQzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC;AAWF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAoB1B,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,6BAA6B,EAAE,KAiB3C,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,QAAQ,EAAE,KAoEtB,CAAC;AAEF,UAAU,iCAAiC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,iBAAS,4BAA4B,CAAC,EACpC,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,OAAO,EACP,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,EACJ,eAAe,EACf,gBAAgB,EAChB,OAAO,GACR,EAAE,iCAAiC,+BAwCnC;AAED,sHAAsH;AACtH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,4BAA4B,CAiDpE,CAAC"}
@@ -1,37 +1,62 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { ChatCardThreeColumnLayout } from './chat-card-three-column-layout';
3
+ import { ChatCardThreeColumnLayoutDetailsPlacement } from './chat-card-three-column-layout.variants';
3
4
  declare const meta: Meta<typeof ChatCardThreeColumnLayout>;
4
5
  export default meta;
5
6
  type Story = StoryObj<typeof ChatCardThreeColumnLayout>;
6
7
  /**
7
- * The places card. Below 698px the list becomes a swipe strip over the map, and its render
8
- * prop swaps the content; from 698px it is a 290px column, and from 1132px a 358px one.
9
- * Click a place to open Details: it floats over the map until 1132px, then takes a 358px
10
- * third column. All thresholds are the layout's own width, not the viewport's.
8
+ * An accommodation search. Below 698px of layout width the list is a swipe strip over the map,
9
+ * and its render prop swaps the content; from 698px it is a 290px column, and from 1132px a
10
+ * 358px one. Open a place for its Details: they float over the map until 1132px, then take a
11
+ * 358px third column. Every threshold is the layout's own width, not the viewport's.
11
12
  */
12
13
  export declare const Default: Story;
13
- /** Details always floats over Main, even on a wide screen. */
14
+ /** Details always floats over Main, even in a wide chat window. */
14
15
  export declare const DetailsFloating: Story;
15
16
  /**
16
- * Panel covers everything but the List column, and the whole layout when List floats
17
- * (below 698px). Main and Details stay mounted under it: close it and the open place is
18
- * still there. Open it again from Details with "All reviews".
17
+ * Panel covers everything but the List column, and the whole layout when List floats (below
18
+ * 698px). Main and Details stay mounted under it: go back and the open place is still there.
19
+ * Open it again from Details with "Check other rooms".
19
20
  */
20
21
  export declare const Panel: Story;
21
22
  /** Drag the right edge across 698px: the Panel grows over the List once it floats. */
22
23
  export declare const PanelResizable: Story;
23
24
  /**
24
- * Collapse the card from its header: the minimum widths are gated on `data-state=open`, so
25
- * the collapsed card shrinks back to its header.
25
+ * A card that starts collapsed. The card's minimum width is gated on `data-state=open`, so the
26
+ * collapsed card is only as wide as the reading column; expand it from the header and it takes
27
+ * the chat window's width.
26
28
  */
27
29
  export declare const CollapsedCard: Story;
28
30
  /**
29
- * Drag the dashed wrapper's right edge. The panes switch on the layout's own width: List
30
- * becomes a 290px column at 698px, and at 1132px List widens to 358px and Details takes
31
- * its 358px column, with the render-prop text changing at
32
- * the same moment. No window resize needed, which is the point: the viewport never changes
33
- * here.
31
+ * Drag the dashed window's right edge. The panes switch on the layout's own width: List becomes
32
+ * a 290px column at 698px, and at 1132px List widens to 358px and Details takes its 358px
33
+ * column, with the render-prop content changing at the same moment. No browser resize needed,
34
+ * which is the point: the viewport never changes here.
34
35
  */
35
36
  export declare const ResizableContainer: Story;
36
- export declare const Playground: Story;
37
+ /** Opens a place from the list and from the map, then closes Details, which unmounts the pane. */
38
+ export declare const DefaultOpenAndCloseDetails: Story;
39
+ /** Closes the rooms Panel and checks that the map and the open place were mounted under it all along. */
40
+ export declare const PanelBackKeepsDetails: Story;
41
+ /** Resizes the chat window through the tiers and checks where each pane is drawn and what its render prop shows. */
42
+ export declare const ResizableContainerSwitchesPanes: Story;
43
+ /** Expands the collapsed card from its header and checks it only then claims the chat window's width. */
44
+ export declare const CollapsedCardExpands: Story;
45
+ /** The layout in each place it's allowed: a card's content, a card body with a note and a footer around it, and a chat thread. */
46
+ export declare const Examples: Story;
47
+ interface ChatCardThreeColumnLayoutPlaygroundProps {
48
+ detailsPlacement: ChatCardThreeColumnLayoutDetailsPlacement;
49
+ className: string;
50
+ chatWindowWidth: number;
51
+ stayCount: number;
52
+ hasDetails: boolean;
53
+ hasPanel: boolean;
54
+ onOpenStay: (stayId: string) => void;
55
+ onCloseDetails: () => void;
56
+ onCheckRooms: () => void;
57
+ onCloseRooms: () => void;
58
+ }
59
+ declare function ChatCardThreeColumnLayoutPlayground({ detailsPlacement, className, chatWindowWidth, stayCount, hasDetails, hasPanel, onOpenStay, onCloseDetails, onCheckRooms, onCloseRooms, }: ChatCardThreeColumnLayoutPlaygroundProps): import('react').JSX.Element;
60
+ /** All four panes at once, with the root's props, the chat window's width and each optional pane on the Controls panel. */
61
+ export declare const Playground: StoryObj<typeof ChatCardThreeColumnLayoutPlayground>;
37
62
  //# sourceMappingURL=chat-card-three-column-layout.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-card-three-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgB5D,OAAO,EACL,yBAAyB,EAK1B,MAAM,iCAAiC,CAAC;AAqIzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAiChD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,EAAE,KAe5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
1
+ {"version":3,"file":"chat-card-three-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,OAAO,EACL,yBAAyB,EAK1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAE1G,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAyChD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAsHxD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAQhC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,0BAA0B,EAAE,KAqCxC,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,qBAAqB,EAAE,KAoCnC,CAAC;AAEF,oHAAoH;AACpH,eAAO,MAAM,+BAA+B,EAAE,KAiE7C,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,EAAE,KA2BlC,CAAC;AAEF,kIAAkI;AAClI,eAAO,MAAM,QAAQ,EAAE,KAoGtB,CAAC;AAEF,UAAU,wCAAwC;IAChD,gBAAgB,EAAE,yCAAyC,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,iBAAS,mCAAmC,CAAC,EAC3C,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,GACb,EAAE,wCAAwC,+BA8D1C;AAED,2HAA2H;AAC3H,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,mCAAmC,CAwC3E,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { ComponentProps, ReactNode } from 'react';
2
2
  export interface ChatCardTwoColumnLayoutProps extends ComponentProps<'div'> {
3
3
  children: ReactNode;
4
+ /**
5
+ * Classes for the grid the root renders around its children, merged after its defaults, e.g.
6
+ * `gap-8` for a tighter gutter. Keep the column and row templates: the panes rely on them.
7
+ */
8
+ gridClassName?: string;
4
9
  asChild?: boolean;
5
10
  }
6
11
  /**
@@ -14,6 +19,7 @@ export interface ChatCardTwoColumnLayoutProps extends ComponentProps<'div'> {
14
19
  * The root is the query container and renders the grid inside itself: an element cannot
15
20
  * query its own width. `className` goes on the root, so a height set there reaches the grid.
16
21
  * Height is not set here, because it belongs to the content, so pass it in `className`.
22
+ * `gridClassName` reaches the grid itself.
17
23
  */
18
24
  export declare const ChatCardTwoColumnLayout: import('react').ForwardRefExoticComponent<Omit<ChatCardTwoColumnLayoutProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
19
25
  export interface ChatCardTwoColumnLayoutAsideProps extends ComponentProps<'aside'> {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-card-two-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA4BvD,MAAM,WAAW,4BAA6B,SAAQ,cAAc,CAAC,KAAK,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,sIAwBnC,CAAC;AAIF,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,CAAC;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yFAAyF;AACzF,eAAO,MAAM,4BAA4B,wIAmBvC,CAAC;AAIH,MAAM,WAAW,gCAAiC,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC9E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,2FAA2F;AAC3F,eAAO,MAAM,2BAA2B,uIAmBtC,CAAC"}
1
+ {"version":3,"file":"chat-card-two-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA4BvD,MAAM,WAAW,4BAA6B,SAAQ,cAAc,CAAC,KAAK,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,sIA2BnC,CAAC;AAIF,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,CAAC;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yFAAyF;AACzF,eAAO,MAAM,4BAA4B,wIAmBvC,CAAC;AAIH,MAAM,WAAW,gCAAiC,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC9E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,2FAA2F;AAC3F,eAAO,MAAM,2BAA2B,uIAmBtC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ChatCardTwoColumnLayout } from './chat-card-two-column-layout';
2
+ import { ChatCardTwoColumnLayout, ChatCardTwoColumnLayoutProps } from './chat-card-two-column-layout';
3
3
  declare const meta: Meta<typeof ChatCardTwoColumnLayout>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof ChatCardTwoColumnLayout>;
@@ -16,4 +16,25 @@ export declare const Stacked: Story;
16
16
  * changing, which is the point.
17
17
  */
18
18
  export declare const ResizableContainer: Story;
19
+ /** Checks that a 1000px card puts Aside in a 336px column beside Main, both at the root's height. */
20
+ export declare const SideBySideColumns: Story;
21
+ /** Checks that a 500px card stacks Aside over Main at one width, and Main takes the height Aside leaves. */
22
+ export declare const StackedRows: Story;
23
+ /** Checks that an itinerary longer than the card scrolls inside the Aside column instead of growing the card. */
24
+ export declare const LongAsideScrolls: Story;
25
+ /** Checks that `gridClassName` reaches the grid: `gap-8` halves the gutter between the columns. */
26
+ export declare const GridClassNameGutter: Story;
27
+ /** The layout in each place it's allowed: straight in a card's content, in a card body with a footer under it, and in a chat thread. */
28
+ export declare const Examples: Story;
29
+ interface ChatCardTwoColumnLayoutPlaygroundProps extends Omit<ChatCardTwoColumnLayoutProps, 'children'> {
30
+ width: number;
31
+ title: string;
32
+ stepCount: number;
33
+ hasScrollArea: boolean;
34
+ asideClassName: string;
35
+ mainClassName: string;
36
+ }
37
+ declare function ChatCardTwoColumnLayoutPlayground({ width, title, stepCount, hasScrollArea, asideClassName, mainClassName, ...rest }: ChatCardTwoColumnLayoutPlaygroundProps): import('react').JSX.Element;
38
+ /** Both panes with the door-to-door itinerary, and the card width, the classes of every part and the Aside scroll on the Controls panel. */
39
+ export declare const Playground: StoryObj<typeof ChatCardTwoColumnLayoutPlayground>;
19
40
  //# sourceMappingURL=chat-card-two-column-layout.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-card-two-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAa5D,OAAO,EACL,uBAAuB,EAGxB,MAAM,+BAA+B,CAAC;AAsDvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,uBAAuB,CAwB9C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC"}
1
+ {"version":3,"file":"chat-card-two-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA0B5D,OAAO,EACL,uBAAuB,EAGxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAGlF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,uBAAuB,CA8B9C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAsDtD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAShC,CAAC;AAOF,qGAAqG;AACrG,eAAO,MAAM,iBAAiB,EAAE,KAkC/B,CAAC;AAEF,4GAA4G;AAC5G,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,gBAAgB,EAAE,KAoB9B,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,mBAAmB,EAAE,KAajC,CAAC;AAEF,wIAAwI;AACxI,eAAO,MAAM,QAAQ,EAAE,KAoEtB,CAAC;AAEF,UAAU,sCAAuC,SAAQ,IAAI,CAC3D,4BAA4B,EAC5B,UAAU,CACX;IACC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,iBAAS,iCAAiC,CAAC,EACzC,KAAK,EACL,KAAK,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,GAAG,IAAI,EACR,EAAE,sCAAsC,+BAsCxC;AAED,4IAA4I;AAC5I,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,iCAAiC,CAsCzE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swisper.ai/web-chat-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "React components for the Swisper chat: messages, composer and cards",
5
5
  "keywords": [
6
6
  "react",
@@ -58,19 +58,17 @@
58
58
  "@lexical/selection": "^0.46.0",
59
59
  "@lexical/table": "^0.46.0",
60
60
  "@lexical/utils": "^0.46.0",
61
- "@lottiefiles/dotlottie-react": "^0.18.1",
62
61
  "@lottiefiles/react-lottie-player": "^3.6.0",
63
62
  "@mui/material": "7.0.2",
64
63
  "@radix-ui/react-collapsible": "^1.1.2",
65
- "@radix-ui/react-roving-focus": "^1.1.11",
66
64
  "@radix-ui/react-scroll-area": "^1.2.10",
67
65
  "@radix-ui/react-slot": "^1.1.0",
68
66
  "@shadcn/react": "^0.3.1",
69
- "@swisper.ai/design-system": "0.0.2",
70
- "@swisper.ai/icons": "0.0.2",
71
- "@swisper.ai/tailwind-config": "0.0.2",
72
- "@swisper.ai/ui": "0.0.2",
73
- "@swisper.ai/web-core": "0.0.2",
67
+ "@swisper.ai/design-system": "0.0.3",
68
+ "@swisper.ai/icons": "0.0.3",
69
+ "@swisper.ai/tailwind-config": "0.0.3",
70
+ "@swisper.ai/ui": "0.1.2",
71
+ "@swisper.ai/web-core": "0.0.3",
74
72
  "@tanstack/react-virtual": "^3.14.5",
75
73
  "chroma-js": "^3.2.0",
76
74
  "class-variance-authority": "^0.7.1",
@@ -99,8 +97,12 @@
99
97
  "zustand": "^5.0.5"
100
98
  },
101
99
  "devDependencies": {
102
- "@fintama/vite-config": "0.1.1",
103
- "@fintama/vitest-config": "0.1.1",
100
+ "@fintama/swisper-int-storybook-theme": "0.0.1",
101
+ "@fintama/swisper-int-vite-config": "0.0.1",
102
+ "@fintama/swisper-int-vitest-config": "0.0.1",
103
+ "@storybook/addon-a11y": "10.6.0",
104
+ "@storybook/addon-docs": "10.6.0",
105
+ "@storybook/addon-vitest": "10.6.0",
104
106
  "@storybook/react-vite": "10.6.0",
105
107
  "@swisper.ai/int-eslint-config": "0.0.1",
106
108
  "@swisper.ai/int-typescript-config": "0.0.1",
@@ -116,10 +118,12 @@
116
118
  "@types/react-dom": "18.3.7",
117
119
  "@types/sanitize-html": "2.16.1",
118
120
  "@typescript/typescript6": "6.0.2",
121
+ "@vitest/browser-playwright": "4.1.11",
119
122
  "concurrently": "^9.1.2",
120
123
  "csstype": "^3.2.3",
121
124
  "eslint": "10.9.1",
122
125
  "jsdom": "30.1.1",
126
+ "playwright": "1.63.0",
123
127
  "react": "18.3.1",
124
128
  "react-dom": "18.3.1",
125
129
  "rimraf": "^6.0.1",
@@ -148,6 +152,8 @@
148
152
  "dev": "concurrently \"pnpm run dev:css\" \"pnpm run dev:ts\"",
149
153
  "lint": "eslint . --max-warnings=0",
150
154
  "test": "vitest run",
155
+ "test:unit": "vitest run --project unit",
156
+ "test:e2e": "vitest run --project storybook",
151
157
  "typecheck": "tsc --noEmit",
152
158
  "dev:ts": "vite build --mode development --watch",
153
159
  "dev:css": "tailwindcss -i ./src/index.css -o ./dist/index.css --watch"
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ import { Typography } from '@swisper.ai/ui';
4
+
5
+ export interface ParentBlockProps {
6
+ /** The parent or context exactly as the component's `<name>.json` spells it. */
7
+ parent: string;
8
+ children: ReactNode;
9
+ }
10
+
11
+ /** One block of an `Examples` story: the spec's parent name above the component in that parent. */
12
+ export function ParentBlock({ parent, children }: ParentBlockProps) {
13
+ return (
14
+ <div className="flex flex-col gap-8">
15
+ <Typography variant="caption-md" className="text-text-tertiary">
16
+ {parent}
17
+ </Typography>
18
+ {children}
19
+ </div>
20
+ );
21
+ }
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface CanvasPanelProps {
4
+ /** Accessible name of the panel, e.g. what the canvas shows. */
5
+ label: string;
6
+ /** Lets the panel take the full width, the way the host widens it for full screen. */
7
+ isFullScreen?: boolean;
8
+ children: ReactNode;
9
+ }
10
+
11
+ /**
12
+ * Stands in for the host's side panel: it has the height and the width the shell fills, and it is
13
+ * what gets wider in full screen. The shell itself never resizes.
14
+ */
15
+ export function CanvasPanel({ label, isFullScreen = false, children }: CanvasPanelProps) {
16
+ return (
17
+ <aside
18
+ aria-label={label}
19
+ data-full-screen={isFullScreen}
20
+ className="mx-auto h-150 max-w-105 border-x border-divider-border-base data-[full-screen=true]:max-w-none"
21
+ >
22
+ {children}
23
+ </aside>
24
+ );
25
+ }
@@ -0,0 +1,29 @@
1
+ import { Typography } from '@swisper.ai/ui';
2
+
3
+ import type { LibraryDocument } from './types';
4
+
5
+ export interface DocumentListProps {
6
+ documents: readonly LibraryDocument[];
7
+ className?: string;
8
+ }
9
+
10
+ /** The documents library's rows: file name, type and the date the file was shared. */
11
+ export function DocumentList({ documents, className }: DocumentListProps) {
12
+ return (
13
+ <ul aria-label="Documents" className={className}>
14
+ {documents.map((document) => (
15
+ <li
16
+ key={document.id}
17
+ className="flex flex-col gap-4 border-b border-component-divider py-10 last:border-b-0"
18
+ >
19
+ <Typography variant="body-small-high" className="truncate">
20
+ {document.name}
21
+ </Typography>
22
+ <Typography variant="caption-md" className="text-text-tertiary">
23
+ <span className="uppercase">{document.extension}</span> · {document.addedAt}
24
+ </Typography>
25
+ </li>
26
+ ))}
27
+ </ul>
28
+ );
29
+ }
@@ -0,0 +1,222 @@
1
+ import type { ChatTurn, Holding, LibraryDocument, TicketChange, WalletTicket } from './types';
2
+
3
+ const TICKET_CHANGES: TicketChange[] = [
4
+ { station: 'Bern', arrival: '08:58 (Pl. 6)', departure: '09:07 (Pl. 4)' },
5
+ { station: 'Visp', arrival: '10:02 (Pl. 5)', departure: '10:08 (Pl. 3)' },
6
+ ];
7
+
8
+ // Mirrors a booked train ticket in the wallet: date, time, class and the journey with its changes.
9
+ export const WALLET_TICKET: WalletTicket = {
10
+ title: 'Zürich HB → Zermatt',
11
+ fields: [
12
+ { label: 'Date', value: '14 Oct 2026' },
13
+ { label: 'Time', value: '08:02 ➔ 11:14' },
14
+ { label: 'Class', value: '2nd class' },
15
+ { label: 'Journey', value: 'Zürich HB → Zermatt', isWide: true },
16
+ ],
17
+ changes: TICKET_CHANGES,
18
+ };
19
+
20
+ // Mirrors the documents shared in one chat: mixed file types, one name too long for its row.
21
+ export const LIBRARY_DOCUMENTS: LibraryDocument[] = [
22
+ { id: 'doc_01', name: 'Rental agreement', extension: 'pdf', addedAt: '2 Oct 2026' },
23
+ { id: 'doc_02', name: 'Household budget 2026', extension: 'xlsx', addedAt: '30 Sep 2026' },
24
+ {
25
+ id: 'doc_03',
26
+ name: 'Health insurance policy and supplementary cover, signed copy with annexes',
27
+ extension: 'pdf',
28
+ addedAt: '28 Sep 2026',
29
+ },
30
+ { id: 'doc_04', name: 'Tax return 2025', extension: 'pdf', addedAt: '21 Sep 2026' },
31
+ { id: 'doc_05', name: 'Salary statement August', extension: 'pdf', addedAt: '19 Sep 2026' },
32
+ { id: 'doc_06', name: 'Meeting notes', extension: 'md', addedAt: '15 Sep 2026' },
33
+ { id: 'doc_07', name: 'Flat handover checklist', extension: 'docx', addedAt: '11 Sep 2026' },
34
+ { id: 'doc_08', name: 'Pension fund statement', extension: 'pdf', addedAt: '4 Sep 2026' },
35
+ { id: 'doc_09', name: 'Car insurance quote', extension: 'pdf', addedAt: '29 Aug 2026' },
36
+ { id: 'doc_10', name: 'Trip itinerary', extension: 'md', addedAt: '22 Aug 2026' },
37
+ { id: 'doc_11', name: 'Utility bill July', extension: 'pdf', addedAt: '6 Aug 2026' },
38
+ { id: 'doc_12', name: 'Moving expenses', extension: 'csv', addedAt: '31 Jul 2026' },
39
+ { id: 'doc_13', name: 'Employment contract', extension: 'pdf', addedAt: '14 Jul 2026' },
40
+ { id: 'doc_14', name: 'Residence permit scan', extension: 'png', addedAt: '2 Jul 2026' },
41
+ ];
42
+
43
+ /** Filename of the previewed document; the long one is what a scanned or exported file is called. */
44
+ export const PREVIEW_FILENAME = 'Trip itinerary.md';
45
+ export const LONG_PREVIEW_FILENAME =
46
+ 'Health insurance policy and supplementary cover, signed copy with annexes 2026-09-28.pdf';
47
+
48
+ // The text of the previewed markdown document, one entry per paragraph.
49
+ export const PREVIEW_PARAGRAPHS: string[] = [
50
+ 'Day 1. Take the 08:02 from Zürich HB and change in Bern and Visp. The mountain train reaches Zermatt at 11:14, in time to drop the bags at the hotel before lunch.',
51
+ 'Day 2. Ride the first cable car to the glacier while the sky is clear. Keep the afternoon free: the weather turns after 14:00 at this time of year.',
52
+ 'Day 3. Walk the five lakes trail if the path is open, otherwise take the valley route. Check out by 11:00 and leave the bags at the station lockers.',
53
+ 'Return. The 16:37 from Zermatt connects in Visp with seven minutes to change, and arrives at Zürich HB at 19:58.',
54
+ ];
55
+
56
+ export const HOLDING_COLUMNS: string[] = [
57
+ 'Position',
58
+ 'ISIN',
59
+ 'Asset class',
60
+ 'Currency',
61
+ 'Quantity',
62
+ 'Price',
63
+ 'Value',
64
+ 'Weight',
65
+ ];
66
+
67
+ /** Builds one table row from its cells, in column order. */
68
+ function holding(
69
+ ...cells: [string, string, string, string, string, string, string, string]
70
+ ): Holding {
71
+ const [position, isin, assetClass, currency, quantity, price, value, weight] = cells;
72
+ return { position, isin, assetClass, currency, quantity, price, value, weight };
73
+ }
74
+
75
+ // Mirrors a table the assistant answered with: more columns than the panel is wide, more rows than it is tall.
76
+ export const HOLDINGS: Holding[] = [
77
+ holding(
78
+ 'Swiss equity index fund',
79
+ 'CH0000000011',
80
+ 'Equities',
81
+ 'CHF',
82
+ '420',
83
+ '148.20',
84
+ '62,244.00',
85
+ '18.4%',
86
+ ),
87
+ holding(
88
+ 'Global equity fund, hedged',
89
+ 'IE0000000022',
90
+ 'Equities',
91
+ 'CHF',
92
+ '310',
93
+ '176.05',
94
+ '54,575.50',
95
+ '16.1%',
96
+ ),
97
+ holding(
98
+ 'Emerging markets equity fund',
99
+ 'LU0000000033',
100
+ 'Equities',
101
+ 'USD',
102
+ '260',
103
+ '92.40',
104
+ '24,024.00',
105
+ '7.1%',
106
+ ),
107
+ holding(
108
+ 'Swiss small and mid cap fund',
109
+ 'CH0000000044',
110
+ 'Equities',
111
+ 'CHF',
112
+ '95',
113
+ '241.80',
114
+ '22,971.00',
115
+ '6.8%',
116
+ ),
117
+ holding(
118
+ 'Swiss government bond fund',
119
+ 'CH0000000055',
120
+ 'Bonds',
121
+ 'CHF',
122
+ '510',
123
+ '101.35',
124
+ '51,688.50',
125
+ '15.3%',
126
+ ),
127
+ holding(
128
+ 'Global corporate bond fund',
129
+ 'LU0000000066',
130
+ 'Bonds',
131
+ 'EUR',
132
+ '380',
133
+ '97.12',
134
+ '36,905.60',
135
+ '10.9%',
136
+ ),
137
+ holding(
138
+ 'Inflation-linked bond fund',
139
+ 'IE0000000077',
140
+ 'Bonds',
141
+ 'USD',
142
+ '140',
143
+ '108.90',
144
+ '15,246.00',
145
+ '4.5%',
146
+ ),
147
+ holding(
148
+ 'Swiss real estate fund',
149
+ 'CH0000000088',
150
+ 'Real estate',
151
+ 'CHF',
152
+ '175',
153
+ '132.60',
154
+ '23,205.00',
155
+ '6.9%',
156
+ ),
157
+ holding(
158
+ 'Global listed property fund',
159
+ 'IE0000000099',
160
+ 'Real estate',
161
+ 'USD',
162
+ '120',
163
+ '64.75',
164
+ '7,770.00',
165
+ '2.3%',
166
+ ),
167
+ holding(
168
+ 'Physical gold fund',
169
+ 'CH0000000101',
170
+ 'Commodities',
171
+ 'CHF',
172
+ '48',
173
+ '312.40',
174
+ '14,995.20',
175
+ '4.4%',
176
+ ),
177
+ holding(
178
+ 'Broad commodities fund',
179
+ 'LU0000000112',
180
+ 'Commodities',
181
+ 'USD',
182
+ '210',
183
+ '28.15',
184
+ '5,911.50',
185
+ '1.7%',
186
+ ),
187
+ holding(
188
+ 'Money market fund',
189
+ 'CH0000000123',
190
+ 'Liquidity',
191
+ 'CHF',
192
+ '90',
193
+ '100.02',
194
+ '9,001.80',
195
+ '2.7%',
196
+ ),
197
+ holding('Savings account', '—', 'Liquidity', 'CHF', '1', '6,480.00', '6,480.00', '1.9%'),
198
+ holding('Foreign currency account', '—', 'Liquidity', 'EUR', '1', '3,360.00', '3,360.00', '1.0%'),
199
+ ];
200
+
201
+ // The conversation of a side-panel chat about the trip, with the follow-ups offered after it.
202
+ export const TRIP_CHAT_TITLE = 'Zermatt trip';
203
+
204
+ export const TRIP_CHAT_TURNS: ChatTurn[] = [
205
+ {
206
+ id: 'turn_01',
207
+ question: 'How long do I have to change in Bern?',
208
+ answer:
209
+ 'Nine minutes. You arrive on platform 6 at 08:58 and leave from platform 4 at 09:07; both are reached through the same underpass.',
210
+ },
211
+ {
212
+ id: 'turn_02',
213
+ question: 'And if I miss it?',
214
+ answer:
215
+ 'The next train to Visp leaves at 09:37 and your ticket stays valid. You would reach Zermatt at 11:44 instead of 11:14.',
216
+ },
217
+ ];
218
+
219
+ export const TRIP_CHAT_FOLLOW_UPS: string[] = [
220
+ 'Is there a restaurant car on the train?',
221
+ 'What is the weather in Zermatt on Wednesday?',
222
+ ];