@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
@@ -6,107 +6,159 @@ interface ChatNotificationCardContextValue {
6
6
  setExpanded: (expanded: boolean) => void;
7
7
  toggleExpanded: () => void;
8
8
  }
9
+ /** The card's expanded state and its setters. Throws outside a `ChatNotificationCard`. */
9
10
  export declare function useChatNotificationCardContext(): ChatNotificationCardContextValue;
10
11
  export interface ChatNotificationCardProps {
11
12
  children?: ReactNode;
13
+ /** `default` for a card in a list, `floating` (bordered) for a card shown on its own over the chat. */
12
14
  variant?: 'default' | 'floating';
13
15
  className?: string;
16
+ /** Classes for the hover overlay (`data-slot="chat-notification-card-overlay"`). */
17
+ overlayClassName?: string;
18
+ /** Initial expanded state when uncontrolled. */
14
19
  defaultExpanded?: boolean;
20
+ /** Controlled expanded state; pair it with `onExpandedChange`. */
15
21
  expanded?: boolean;
22
+ /** Called with the next expanded state when the expand button is toggled. */
16
23
  onExpandedChange?: (expanded: boolean) => void;
24
+ /** Called on a click anywhere on the card except its buttons. */
17
25
  onClick?: () => void;
18
26
  }
19
- export declare function ChatNotificationCard({ children, className, defaultExpanded, expanded, onExpandedChange, onClick, }: ChatNotificationCardProps): import('react').JSX.Element;
27
+ /**
28
+ * Root of the notification card. Holds the expanded state and exposes it, with the variant, as
29
+ * `data-expanded` and `data-variant`.
30
+ */
31
+ export declare function ChatNotificationCard({ children, variant, className, overlayClassName, defaultExpanded, expanded, onExpandedChange, onClick, }: ChatNotificationCardProps): import('react').JSX.Element;
20
32
  export interface ChatNotificationCardHeadProps {
21
33
  children?: ReactNode;
22
34
  className?: string;
23
35
  }
36
+ /** Top row of the card: the header on the left, the actions on the right. */
24
37
  export declare function ChatNotificationCardHead({ children, className }: ChatNotificationCardHeadProps): import('react').JSX.Element;
25
38
  export interface ChatNotificationCardHeaderProps {
26
39
  children?: ReactNode;
27
40
  className?: string;
28
41
  }
42
+ /** Left side of the head: the icon and the title. */
29
43
  export declare function ChatNotificationCardHeader({ children, className, }: ChatNotificationCardHeaderProps): import('react').JSX.Element;
30
44
  export interface ChatNotificationCardHeaderIconProps {
31
45
  children?: ReactNode;
32
46
  className?: string;
33
47
  }
48
+ /** Icon that says what kind of notification this is. */
34
49
  export declare function ChatNotificationCardHeaderIcon({ children, className, }: ChatNotificationCardHeaderIconProps): import('react').JSX.Element;
35
50
  export interface ChatNotificationCardHeaderTitleProps {
36
51
  children?: ReactNode;
37
52
  className?: string;
38
53
  }
54
+ /** Holds the title label and the status chip. */
39
55
  export declare function ChatNotificationCardHeaderTitle({ children, className, }: ChatNotificationCardHeaderTitleProps): import('react').JSX.Element;
40
56
  export interface ChatNotificationCardHeaderTitleLabelProps {
41
57
  children?: ReactNode;
42
58
  className?: string;
43
59
  }
60
+ /** Notification type or short subject: semibold, uppercase, truncated to one line. */
44
61
  export declare function ChatNotificationCardHeaderTitleLabel({ children, className, }: ChatNotificationCardHeaderTitleLabelProps): import('react').JSX.Element;
45
62
  export interface ChatNotificationCardHeaderStatusProps extends Omit<ChipProps, 'color' | 'variant' | 'size'> {
46
63
  children?: ReactNode;
47
64
  priority?: ChatNotificationCardPriority;
48
65
  className?: string;
49
66
  }
67
+ /** Priority chip: `high` is an error chip, `medium` a warning chip, `low` renders nothing. */
50
68
  export declare function ChatNotificationCardHeaderStatus({ children, priority, className, ...rest }: ChatNotificationCardHeaderStatusProps): import('react').JSX.Element | null;
51
69
  export interface ChatNotificationCardActionsProps {
52
70
  children?: ReactNode;
53
71
  className?: string;
54
72
  }
73
+ /** Right side of the head: the timestamp and the buttons. */
55
74
  export declare function ChatNotificationCardActions({ children, className, }: ChatNotificationCardActionsProps): import('react').JSX.Element;
56
75
  export interface ChatNotificationCardTimestampProps {
57
76
  children?: ReactNode;
58
77
  className?: string;
59
78
  }
79
+ /** Relative time the notification arrived. */
60
80
  export declare function ChatNotificationCardTimestamp({ children, className, }: ChatNotificationCardTimestampProps): import('react').JSX.Element;
61
81
  export interface ChatNotificationCardButtonsProps {
62
82
  children?: ReactNode;
63
83
  className?: string;
64
84
  }
85
+ /** Group for the action buttons. Stops their clicks from reaching the card's `onClick`. */
65
86
  export declare function ChatNotificationCardButtons({ children, className, }: ChatNotificationCardButtonsProps): import('react').JSX.Element;
66
- type ChatNotificationCardActionButtonProps = Omit<ComponentProps<typeof IconButton>, 'children' | 'size' | 'variant'>;
87
+ interface ChatNotificationCardActionButtonProps extends Omit<ComponentProps<typeof IconButton>, 'children' | 'size' | 'variant'> {
88
+ }
67
89
  export interface ChatNotificationCardReadActionButtonProps extends Omit<ChatNotificationCardActionButtonProps, 'onClick'> {
68
90
  children?: ReactNode;
69
91
  className?: string;
92
+ /** Whether the notification is read. Swaps the icon and sets `data-read`. */
70
93
  isRead?: boolean;
94
+ /** Called with the toggled read state on click. */
71
95
  onRead?: (isRead: boolean) => void;
72
96
  }
97
+ /** Icon button that toggles the notification between read and unread. */
73
98
  export declare const ChatNotificationCardReadActionButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardReadActionButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
74
99
  export interface ChatNotificationCardSnoozeButtonProps extends ChatNotificationCardActionButtonProps {
75
100
  children?: ReactNode;
76
101
  className?: string;
102
+ /** Classes for the time-left label of the snoozed button (`data-slot="chat-notification-card-snooze-button-label"`). */
103
+ labelClassName?: string;
104
+ /** Classes for the cancel label shown on hover (`data-slot="chat-notification-card-snooze-button-cancel-label"`). */
105
+ cancelLabelClassName?: string;
106
+ /** When in the future, the button shows the time left and cancels the snooze on click. */
77
107
  snoozeUntilDate?: Date;
108
+ /** Text that replaces the time left while the snoozed button is hovered. */
78
109
  cancelLabel?: ReactNode;
110
+ /** Formats the time left. Defaults to `formatSnoozeDate` ('in 2 minutes'). */
79
111
  formatDate?: (date: Date) => ReactNode;
112
+ /** Called when the snoozed button is clicked. */
80
113
  onCancel?: () => void;
81
114
  }
115
+ /**
116
+ * Snooze control. An icon button that calls `onClick`; while `snoozeUntilDate` is in the future, a
117
+ * text button with the time left that calls `onCancel`. `data-snoozed` says which one is rendered.
118
+ */
82
119
  export declare const ChatNotificationCardSnoozeButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardSnoozeButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
83
- export declare const ChatNotificationCardDeleteButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardActionButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
84
- export declare const ChatNotificationCardCloseButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardActionButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
120
+ export interface ChatNotificationCardDeleteButtonProps extends ChatNotificationCardActionButtonProps {
121
+ }
122
+ /** Icon button that deletes the notification from a list. */
123
+ export declare const ChatNotificationCardDeleteButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardDeleteButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
124
+ export interface ChatNotificationCardCloseButtonProps extends ChatNotificationCardActionButtonProps {
125
+ }
126
+ /** Icon button that dismisses a floating notification. */
127
+ export declare const ChatNotificationCardCloseButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardCloseButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
85
128
  export interface ChatNotificationCardContentProps {
86
129
  children?: ReactNode;
87
130
  className?: string;
88
131
  }
132
+ /** Body of the card. Renders the expand button at its bottom-right corner. */
89
133
  export declare function ChatNotificationCardContent({ children, className, }: ChatNotificationCardContentProps): import('react').JSX.Element;
90
134
  export interface ChatNotificationCardContentTitleProps {
91
135
  children?: ReactNode;
92
136
  className?: string;
93
137
  }
138
+ /** Subject line of the notification, above the description. */
94
139
  export declare function ChatNotificationCardContentTitle({ children, className, }: ChatNotificationCardContentTitleProps): import('react').JSX.Element;
95
140
  export interface ChatNotificationCardContentDescriptionProps {
96
141
  children?: ReactNode;
97
142
  className?: string;
98
143
  }
144
+ /** Notification text, clamped to two lines until the card is expanded. */
99
145
  export declare function ChatNotificationCardContentDescription({ children, className, }: ChatNotificationCardContentDescriptionProps): import('react').JSX.Element;
100
146
  export interface ChatNotificationCardContentActionsProps {
101
147
  children?: ReactNode;
102
148
  className?: string;
103
149
  }
150
+ /** Follow-up actions, shown only while the card is expanded. */
104
151
  export declare function ChatNotificationCardContentActions({ children, className, }: ChatNotificationCardContentActionsProps): import('react').JSX.Element;
105
152
  export interface ChatNotificationCardExpandButtonProps extends Omit<IconButtonProps, 'children' | 'onClick'> {
106
153
  className?: string;
107
154
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
108
155
  }
156
+ /**
157
+ * Chevron button that toggles the expanded state. `ChatNotificationCardContent` already renders
158
+ * one, so a card needs no second.
159
+ */
109
160
  export declare const ChatNotificationCardExpandButton: import('react').ForwardRefExoticComponent<Omit<ChatNotificationCardExpandButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
161
+ /** Aliases kept for older imports; use the full part names. */
110
162
  export declare const ChatNotificationCardIcon: typeof ChatNotificationCardHeaderIcon;
111
163
  export declare const ChatNotificationCardDescription: typeof ChatNotificationCardContentDescription;
112
164
  export declare const ChatNotificationCardTimeStamp: typeof ChatNotificationCardTimestamp;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-notification-card.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-card/chat-notification-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAWf,OAAO,EAAgB,UAAU,EAAc,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAG5D,UAAU,gCAAgC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAID,wBAAgB,8BAA8B,qCAQ7C;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,gBAAgB,EAChB,OAAO,GACR,EAAE,yBAAyB,+BAsD3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,wBAAwB,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AAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gEAAgE;AAChE,wBAAgB,kCAAkC,CAAC,EACjD,QAAQ,EACR,SAAS,GACV,EAAE,uCAAuC,+BAiBzC;AAED,MAAM,WAAW,qCAAsC,SAAQ,IAAI,CACjE,eAAe,EACf,UAAU,GAAG,SAAS,CACvB;IACC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC1D;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,kJAwC3C,CAAC;AAIH,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB,uCAAiC,CAAC;AACvE,eAAO,MAAM,+BAA+B,+CAAyC,CAAC;AACtF,eAAO,MAAM,6BAA6B,sCAAgC,CAAC"}
@@ -1,10 +1,59 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ChatNotificationCard } from './chat-notification-card';
2
+ import { ReactNode } from 'react';
3
+ import { ChatNotificationCard, ChatNotificationCardProps } from './chat-notification-card';
4
+ import { ChatNotificationCardPriority } from './types';
3
5
  declare const meta: Meta<typeof ChatNotificationCard>;
4
6
  export default meta;
5
7
  type Story = StoryObj<typeof ChatNotificationCard>;
8
+ /** A notification in a list: category and priority, time, the list actions, and a follow-up action that shows on expand. */
6
9
  export declare const Default: Story;
10
+ /** A snoozed notification: the snooze button shows the time left, and cancels the snooze on click. */
7
11
  export declare const Snoozed: Story;
12
+ /** The read toggle, on a notification whose long description clamps to two lines until the card is expanded. */
8
13
  export declare const Read: Story;
14
+ /** One notification shown on its own over the chat: bordered, with snooze and close instead of read and delete. */
9
15
  export declare const Floating: Story;
16
+ /** The expand button reveals the follow-up action and reports the new state without firing the card's `onClick`. */
17
+ export declare const ExpandAndCollapse: Story;
18
+ /** A click on the card body fires `onClick`; a click on a button in `ChatNotificationCardButtons` does not. */
19
+ export declare const CardClick: Story;
20
+ /** Cancelling a snooze brings the icon button back, and snoozing again brings back the time left. */
21
+ export declare const SnoozeAndCancel: Story;
22
+ /** The read button toggles the read state and exposes it as `data-read`. */
23
+ export declare const MarkAsRead: Story;
24
+ /**
25
+ * The card in each place it belongs: the notification centre popover, a floating popup over the
26
+ * chat, the notification panel and a plain notification list.
27
+ */
28
+ export declare const Examples: Story;
29
+ interface ChatNotificationCardPlaygroundProps extends Omit<ChatNotificationCardProps, 'children'> {
30
+ icon: ReactNode;
31
+ label: string;
32
+ hasStatus: boolean;
33
+ status: string;
34
+ priority: ChatNotificationCardPriority;
35
+ hasTimestamp: boolean;
36
+ timestamp: string;
37
+ hasReadButton: boolean;
38
+ isRead: boolean;
39
+ hasSnoozeButton: boolean;
40
+ isSnoozed: boolean;
41
+ cancelLabel: string;
42
+ hasDeleteButton: boolean;
43
+ hasCloseButton: boolean;
44
+ hasContentTitle: boolean;
45
+ title: string;
46
+ description: string;
47
+ hasContentActions: boolean;
48
+ actionLabel: string;
49
+ onRead: (isRead: boolean) => void;
50
+ onSnooze: () => void;
51
+ onCancelSnooze: () => void;
52
+ onDelete: () => void;
53
+ onClose: () => void;
54
+ onAction: () => void;
55
+ }
56
+ declare function ChatNotificationCardPlayground({ icon, label, hasStatus, status, priority, hasTimestamp, timestamp, hasReadButton, isRead, hasSnoozeButton, isSnoozed, cancelLabel, hasDeleteButton, hasCloseButton, hasContentTitle, title, description, hasContentActions, actionLabel, onRead, onSnooze, onCancelSnooze, onDelete, onClose, onAction, ...rest }: ChatNotificationCardPlaygroundProps): import('react').JSX.Element;
57
+ /** Every part of the card at once, with each part and prop on the Controls panel. */
58
+ export declare const Playground: StoryObj<typeof ChatNotificationCardPlayground>;
10
59
  //# sourceMappingURL=chat-notification-card.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-notification-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-card/chat-notification-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,EACL,oBAAoB,EAiBrB,MAAM,0BAA0B,CAAC;AAGlC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,oBAAoB,CAqD3C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnD,eAAO,MAAM,OAAO,EAAE,KAgCrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAiDrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KA2ElB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAyCtB,CAAC"}
1
+ {"version":3,"file":"chat-notification-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-card/chat-notification-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AA0B1D,OAAO,EACL,oBAAoB,EAkBpB,KAAK,yBAAyB,EAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAG5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,oBAAoB,CAyD3C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnD,4HAA4H;AAC5H,eAAO,MAAM,OAAO,EAAE,KAsCrB,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,OAAO,EAAE,KAgDrB,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,IAAI,EAAE,KAoDlB,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,QAAQ,EAAE,KAyCtB,CAAC;AA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,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,aAAa,EACb,MAAM,EACN,eAAe,EACf,SAAS,EACT,WAAW,EACX,eAAe,EACf,cAAc,EACd,eAAe,EACf,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,mCAAmC,+BA0DrC;AAED,qFAAqF;AACrF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,8BAA8B,CAwGtE,CAAC"}
@@ -2,11 +2,17 @@ import { ComponentProps } from 'react';
2
2
  import { Popover, PopoverContent, PopoverTrigger } from '@swisper.ai/ui';
3
3
  export interface ChatNotificationPopupProps extends ComponentProps<typeof Popover> {
4
4
  }
5
+ /**
6
+ * Root of the notification popup. Holds the open state, uncontrolled through `defaultOpen` or
7
+ * controlled through `open` and `onOpenChange`. Renders no element of its own.
8
+ */
5
9
  export declare function ChatNotificationPopup({ children, ...rest }: ChatNotificationPopupProps): import('react').JSX.Element;
6
10
  export interface ChatNotificationPopupTriggerProps extends ComponentProps<typeof PopoverTrigger> {
7
11
  }
12
+ /** The button that opens and closes the popup. Pass `asChild` to use your own button. */
8
13
  export declare const ChatNotificationPopupTrigger: import('react').ForwardRefExoticComponent<Omit<ChatNotificationPopupTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
9
14
  export interface ChatNotificationPopupContentProps extends ComponentProps<typeof PopoverContent> {
10
15
  }
16
+ /** The panel that holds the notifications. Portalled, and 467px wide from `md` up. */
11
17
  export declare const ChatNotificationPopupContent: import('react').ForwardRefExoticComponent<Omit<ChatNotificationPopupContentProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
12
18
  //# sourceMappingURL=chat-notification-popup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-notification-popup.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-popup/chat-notification-popup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGzE,MAAM,WAAW,0BAA2B,SAAQ,cAAc,CAAC,OAAO,OAAO,CAAC;CAAG;AAErF,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,0BAA0B,+BAEtF;AAED,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,cAAc,CAAC;CAAG;AAEnG,eAAO,MAAM,4BAA4B,8IAKvC,CAAC;AAIH,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,cAAc,CAAC;CAAG;AAEnG,eAAO,MAAM,4BAA4B,2IASvC,CAAC"}
1
+ {"version":3,"file":"chat-notification-popup.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-popup/chat-notification-popup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGzE,MAAM,WAAW,0BAA2B,SAAQ,cAAc,CAAC,OAAO,OAAO,CAAC;CAAG;AAErF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,0BAA0B,+BAEtF;AAED,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,cAAc,CAAC;CAAG;AAEnG,yFAAyF;AACzF,eAAO,MAAM,4BAA4B,8IASvC,CAAC;AAIH,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,cAAc,CAAC;CAAG;AAEnG,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,2IAcvC,CAAC"}
@@ -1,8 +1,50 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ChatNotificationPopup } from './chat-notification-popup';
2
+ import { NotificationSignal } from './__stories__/types';
3
+ import { ChatNotificationPopup, ChatNotificationPopupContentProps, ChatNotificationPopupProps } from './chat-notification-popup';
3
4
  declare const meta: Meta<typeof ChatNotificationPopup>;
4
5
  export default meta;
5
6
  type Story = StoryObj<typeof ChatNotificationPopup>;
7
+ interface NotificationCentreProps extends Omit<ChatNotificationPopupProps, 'children'> {
8
+ notifications: NotificationSignal[];
9
+ onRead?: (id: string) => void;
10
+ onMarkAllAsViewed?: () => void;
11
+ onAction?: (notification: NotificationSignal, action: string) => void;
12
+ }
13
+ declare function NotificationCentre({ notifications, open, onRead, onMarkAllAsViewed, onAction, ...rootProps }: NotificationCentreProps): import('react').JSX.Element;
14
+ /**
15
+ * The notification centre opened from the bell in the chat header: the trigger shows there is
16
+ * something unread, and the popup lists the notifications over the chat.
17
+ */
6
18
  export declare const Default: Story;
19
+ /**
20
+ * Open state owned by the parent, so the bell stays active while the popup is open and a follow-up
21
+ * action can close it before the chat it starts takes over.
22
+ */
7
23
  export declare const Controlled: Story;
24
+ /** The bell in each place the popup opens from: the chat header, an app top bar and a toolbar. */
25
+ export declare const Examples: Story;
26
+ type NotificationCentreStory = StoryObj<typeof NotificationCentre>;
27
+ /** Opens from the bell, and closes on Escape with focus back on the bell. */
28
+ export declare const OpenAndCloseWithKeyboard: NotificationCentreStory;
29
+ /** Reading notifications inside the popup updates the bell, and the popup stays open. */
30
+ export declare const MarksNotificationsAsRead: NotificationCentreStory;
31
+ /** A click outside the non-modal popup closes it, so the chat chrome beside the bell stays usable. */
32
+ export declare const ClosesOnOutsideClick: NotificationCentreStory;
33
+ /** A follow-up action in a controlled popup marks the notification as read and closes the popup. */
34
+ export declare const ControlledClosesAfterAction: Story;
35
+ interface ChatNotificationPopupPlaygroundProps extends Omit<ChatNotificationPopupProps, 'children'>, Pick<ChatNotificationPopupContentProps, 'side' | 'align' | 'sideOffset'> {
36
+ triggerLabel: string;
37
+ title: string;
38
+ notificationCount: number;
39
+ hasUnreadMark: boolean;
40
+ hasMarkAllAction: boolean;
41
+ hasFollowUpActions: boolean;
42
+ onRead: (id: string) => void;
43
+ onMarkAllAsViewed: () => void;
44
+ onAction: (action: string) => void;
45
+ }
46
+ /** The notification centre with every allowed child in it, each switchable from the Controls panel. */
47
+ declare function ChatNotificationPopupPlayground({ triggerLabel, title, notificationCount, side, align, sideOffset, hasUnreadMark, hasMarkAllAction, hasFollowUpActions, onRead, onMarkAllAsViewed, onAction, ...rootProps }: ChatNotificationPopupPlaygroundProps): import('react').JSX.Element;
48
+ /** Every allowed child in one popup, with each part and prop on the Controls panel. */
49
+ export declare const Playground: StoryObj<typeof ChatNotificationPopupPlayground>;
8
50
  //# sourceMappingURL=chat-notification-popup.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-notification-popup.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-popup/chat-notification-popup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EACL,qBAAqB,EAGtB,MAAM,2BAA2B,CAAC;AAEnC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,qBAAqB,CAoC5C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC"}
1
+ {"version":3,"file":"chat-notification-popup.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-notification-popup/chat-notification-popup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkB5D,OAAO,KAAK,EAAE,kBAAkB,E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AAU,oCACR,SACE,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,EAC5C,IAAI,CAAC,iCAAiC,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;IAC1E,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,uGAAuG;AACvG,iBAAS,+BAA+B,CAAC,EACvC,YAAY,EACZ,KAAK,EACL,iBAAiB,EACjB,IAAI,EACJ,KAAK,EACL,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,iBAAiB,EACjB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,oCAAoC,+BAwCtC;AAED,uFAAuF;AACvF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,+BAA+B,CAwEvE,CAAC"}
@@ -1,27 +1,47 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  import { ChatInputProps, ChatInputTextareaProps } from '../chat-input';
3
- export type ChatPromptBoxProps = ChatInputProps;
4
- export declare const ChatPromptBox: import('react').ForwardRefExoticComponent<ChatInputProps & import('react').RefAttributes<HTMLDivElement>>;
5
- export interface ChatPromptBoxToolbarProps {
3
+ export interface ChatPromptBoxProps extends ChatInputProps {
4
+ /** Classes merged last onto the inner surface, the element that carries the box's background and padding. */
5
+ innerClassName?: string;
6
+ }
7
+ /**
8
+ * The styled chat composer: a `ChatInput` with the box's border, background and focus glow. Sets
9
+ * `data-compact` on the root, which the parts read to move the actions under the text.
10
+ */
11
+ export declare const ChatPromptBox: import('react').ForwardRefExoticComponent<ChatPromptBoxProps & import('react').RefAttributes<HTMLDivElement>>;
12
+ export interface ChatPromptBoxToolbarProps extends ComponentPropsWithoutRef<'div'> {
6
13
  children: ReactNode;
7
- className?: string;
8
14
  }
9
- export declare function ChatPromptBoxToolbar({ children, className }: ChatPromptBoxToolbarProps): import('react').JSX.Element;
10
- export interface ChatPromptBoxContentProps {
15
+ /** A row above the content for what the message carries, such as the attached files. */
16
+ export declare function ChatPromptBoxToolbar({ className, children, ...rest }: ChatPromptBoxToolbarProps): import('react').JSX.Element;
17
+ export interface ChatPromptBoxContentProps extends ComponentPropsWithoutRef<'div'> {
11
18
  children: ReactNode;
12
- className?: string;
13
19
  }
14
- export declare function ChatPromptBoxContent({ children, className }: ChatPromptBoxContentProps): import('react').JSX.Element;
15
- export type ChatPromptBoxInputProps = ChatInputTextareaProps;
16
- export declare const ChatPromptBoxInput: import('react').ForwardRefExoticComponent<ChatInputTextareaProps & import('react').RefAttributes<HTMLDivElement>>;
17
- export interface ChatPromptBoxActionsLeftProps {
20
+ /** The row holding the input and both action groups. Reserves room under the text once the box expands. */
21
+ export declare function ChatPromptBoxContent({ className, children, ...rest }: ChatPromptBoxContentProps): import('react').JSX.Element;
22
+ export interface ChatPromptBoxInputProps extends ChatInputTextareaProps {
23
+ /** Classes merged last onto the editable element, after its 72px max height. `className` goes to the wrapper around it. */
24
+ textareaClassName?: string;
25
+ }
26
+ /**
27
+ * The box's text input: a `ChatInputTextarea` that reports its height to the box and registers
28
+ * click-to-focus. `children` are rendered inside the editor, for extra Lexical plugins.
29
+ */
30
+ export declare const ChatPromptBoxInput: import('react').ForwardRefExoticComponent<ChatPromptBoxInputProps & import('react').RefAttributes<HTMLDivElement>>;
31
+ export interface ChatPromptBoxActionsLeftProps extends ComponentPropsWithoutRef<'div'> {
18
32
  children: ReactNode;
19
- className?: string;
20
33
  }
21
- export declare function ChatPromptBoxActionsLeft({ children, className }: ChatPromptBoxActionsLeftProps): import('react').JSX.Element;
22
- export interface ChatPromptBoxActionsRightProps {
34
+ /**
35
+ * The `role="group"` of secondary actions before the text, e.g. attach. Moves to the bottom-left
36
+ * when the box expands. Name it with `aria-label`.
37
+ */
38
+ export declare function ChatPromptBoxActionsLeft({ className, children, ...rest }: ChatPromptBoxActionsLeftProps): import('react').JSX.Element;
39
+ export interface ChatPromptBoxActionsRightProps extends ComponentPropsWithoutRef<'div'> {
23
40
  children: ReactNode;
24
- className?: string;
25
41
  }
26
- export declare function ChatPromptBoxActionsRight({ children, className }: ChatPromptBoxActionsRightProps): import('react').JSX.Element;
42
+ /**
43
+ * The `role="group"` of actions after the text, ending in send. Moves to the bottom-right when the
44
+ * box expands. Name it with `aria-label`.
45
+ */
46
+ export declare function ChatPromptBoxActionsRight({ className, children, ...rest }: ChatPromptBoxActionsRightProps): import('react').JSX.Element;
27
47
  //# sourceMappingURL=chat-prompt-box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-prompt-box.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/chat-prompt-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAMnD,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAK5E,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAchD,eAAO,MAAM,aAAa,2GAuBzB,CAAC;AAgGF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,yBAAyB,+BAMtF;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,oBAAo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AC3G,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,yBAAyB,+BAiB/F;AAED,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;IACrE,2HAA2H;IAC3H,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,oHAkE9B,CAAC;AAIF,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACpF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,6BAA6B,+BAoB/B;AAED,MAAM,WAAW,8BAA+B,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,8BAA8B,+BAqBhC"}
@@ -1,9 +1,61 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { KeyboardEvent, MouseEvent } from 'react';
2
3
  import { ChatPromptBox } from './chat-prompt-box';
3
4
  declare const meta: Meta<typeof ChatPromptBox>;
4
5
  export default meta;
5
6
  type Story = StoryObj<typeof ChatPromptBox>;
7
+ /** The composer of a chat page: a question-style placeholder and one primary send action at the end. */
6
8
  export declare const Default: Story;
7
- export declare const Multiline: Story;
9
+ interface ChatComposerProps {
10
+ placeholder: string;
11
+ initialMessage?: string;
12
+ autoFocus?: boolean;
13
+ isDisabled?: boolean;
14
+ isStreaming?: boolean;
15
+ onSend: (message: string) => void;
16
+ onStop: () => void;
17
+ }
18
+ declare function ChatComposer({ placeholder, initialMessage, autoFocus, isDisabled, isStreaming, onSend, onStop, }: ChatComposerProps): import('react').JSX.Element;
19
+ type ComposerStory = StoryObj<typeof ChatComposer>;
20
+ /** A message long enough to wrap: the box expands and moves send under the text, so the text keeps the full width. */
21
+ export declare const Multiline: ComposerStory;
22
+ /** Secondary tools before the text and send alone at the end, written in the order they are shown so Tab follows it. */
8
23
  export declare const WithLeftActions: Story;
24
+ /** A working composer: Enter or the send button sends the message and empties the box, and send stays disabled while there is nothing to send. */
25
+ export declare const SendMessage: ComposerStory;
26
+ /** While a reply is streaming, the send action is replaced by Stop. */
27
+ export declare const Streaming: ComposerStory;
28
+ /** A composer that takes no input, e.g. once the usage limit for the period is reached. */
29
+ export declare const Disabled: ComposerStory;
30
+ /** Types a message, adds a line with Shift+Enter and sends it with Enter, which empties the box. */
31
+ export declare const SendMessageWithEnter: ComposerStory;
32
+ /** A wrapped message puts send under the text; sending it empties the box and brings send back beside the text. */
33
+ export declare const MultilineExpandsAndResets: ComposerStory;
34
+ /** Pressing a button in the box leaves focus on the button; pressing anywhere else in the box focuses the input. */
35
+ export declare const WithLeftActionsClickToFocus: Story;
36
+ /** A disabled composer cannot be edited and has nothing to send. */
37
+ export declare const DisabledBlocksInput: ComposerStory;
38
+ /** A click on Stop while a reply is streaming calls `onStop` and sends nothing. */
39
+ export declare const StreamingStop: ComposerStory;
40
+ /** The prompt box in each place it goes: the prompt slot of a chat container, a canvas footer and the footer of a chat page. */
41
+ export declare const Examples: Story;
42
+ interface ChatPromptBoxPlaygroundProps {
43
+ className?: string;
44
+ innerClassName?: string;
45
+ textareaClassName?: string;
46
+ placeholder: string;
47
+ autoFocus: boolean;
48
+ isDisabled: boolean;
49
+ isReadOnly: boolean;
50
+ hasToolbar: boolean;
51
+ hasActionsLeft: boolean;
52
+ hasActionsRight: boolean;
53
+ onChange: (value: string) => void;
54
+ onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
55
+ onMouseDown: (event: MouseEvent<HTMLDivElement>) => void;
56
+ onRemoveFile: (id: string) => void;
57
+ }
58
+ declare function ChatPromptBoxPlayground({ className, innerClassName, textareaClassName, placeholder, autoFocus, isDisabled, isReadOnly, hasToolbar, hasActionsLeft, hasActionsRight, onChange, onKeyDown, onMouseDown, onRemoveFile, }: ChatPromptBoxPlaygroundProps): import('react').JSX.Element;
59
+ /** Every part of the prompt box at once, toolbar included, with each part and prop on the Controls panel. */
60
+ export declare const Playground: StoryObj<typeof ChatPromptBoxPlayground>;
9
61
  //# sourceMappingURL=chat-prompt-box.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-prompt-box.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/chat-prompt-box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,EACL,aAAa,EAKd,MAAM,mBAAmB,CAAC;AAE3B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAmCpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5C,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAmBvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC"}
1
+ {"version":3,"file":"chat-prompt-box.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/chat-prompt-box.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAiBtE,OAAO,EACL,aAAa,EAMd,MAAM,mBAAmB,CAAC;AAE3B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CA+CpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAA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4B;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACzD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,iBAAS,uBAAuB,CAAC,EAC/B,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,GACb,EAAE,4BAA4B,+BAwD9B;AAED,6GAA6G;AAC7G,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,uBAAuB,CA4D/D,CAAC"}
@@ -1,23 +1,34 @@
1
1
  import { ComponentProps, ReactNode } from 'react';
2
2
  import { Chip, TypographyProps } from '@swisper.ai/ui';
3
3
  export interface ChatRepliesProps {
4
+ /** The `ChatReply` rows. */
4
5
  children: ReactNode;
6
+ /** Classes for the list (`data-slot="chat-replies"`). */
5
7
  className?: string;
8
+ /** Pads the list. Set `false` when the parent already provides the padding. */
6
9
  hasPadding?: boolean;
7
10
  }
11
+ /** The list of rows that summarises a drafted reply; a `ul` that stacks its `ChatReply` rows. */
8
12
  export declare function ChatReplies({ className, children, hasPadding }: ChatRepliesProps): import('react').JSX.Element;
9
13
  export interface ChatReplyProps extends ComponentProps<'li'> {
14
+ /** A `ChatReplyLabel` followed by a `ChatReplyValue`. */
10
15
  children: ReactNode;
16
+ /** Lets the row and its value wrap onto several lines, for a value that is a list of chips. */
11
17
  isMultiline?: boolean;
12
18
  }
19
+ /** One row of the summary: a label and its value. An `li`, so it goes inside `ChatReplies`. */
13
20
  export declare function ChatReply({ className, children, isMultiline, ...rest }: ChatReplyProps): import('react').JSX.Element;
14
21
  export interface ChatReplyLabelProps extends ComponentProps<typeof Chip> {
22
+ /** The field's name, one or two words. */
15
23
  children: ReactNode;
16
24
  }
25
+ /** The name of the row's field, as an outlined chip that keeps its width. */
17
26
  export declare function ChatReplyLabel({ className, children, ...rest }: ChatReplyLabelProps): import('react').JSX.Element;
18
27
  export interface ChatReplyValueProps extends Omit<TypographyProps, 'variant'> {
28
+ /** The field's content: text, or one chip per item in a multiline row. */
19
29
  children: ReactNode;
20
30
  asChild?: boolean;
21
31
  }
32
+ /** The row's value: secondary text cut to one line, or wrapping items when the row is multiline. */
22
33
  export declare function ChatReplyValue({ className, children, asChild, ...rest }: ChatReplyValueProps): import('react').JSX.Element;
23
34
  //# sourceMappingURL=chat-reply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-reply.d.ts","sourceRoot":"","sources":["../../../src/components/chat-reply/chat-reply.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,IAAI,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGxE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,E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B,+BAevF;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,IAAI,CAAC;IAC1D,yDAAyD;IACzD,QAAQ,EAAE,SAAS,CAAC;IACpB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,+FAA+F;AAC/F,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAmB,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAkB9F;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,OAAO,IAAI,CAAC;IACtE,0CAA0C;IAC1C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,mBAAmB,+BAgBnF;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAC3E,0EAA0E;IAC1E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,OAAe,EACf,GAAG,IAAI,EACR,EAAE,mBAAmB,+BAqBrB"}
@@ -3,5 +3,28 @@ import { ChatReply } from './chat-reply';
3
3
  declare const meta: Meta<typeof ChatReply>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof ChatReply>;
6
+ /** The summary of a drafted reply: what it answers on one line, and its recipients as wrapping chips with the invalid address in the error colour. */
6
7
  export declare const Default: Story;
8
+ /** A single-line row keeps a long subject on one line and cuts it at the edge, so the summary stays compact. */
9
+ export declare const LongValue: Story;
10
+ /** Checks the rows are exposed as a padded list, and that the recipients wrap while the single-line row keeps its height. */
11
+ export declare const DefaultListAndWrapping: Story;
12
+ /** Checks a long subject stays on one line and is cut at the row's edge. */
13
+ export declare const LongValueTruncates: Story;
14
+ /** The summary in each place it's allowed: its own list, the body of a chat card and the body of a chat message. */
15
+ export declare const Examples: Story;
16
+ /** Checks the list pads itself on its own and drops the padding with `hasPadding={false}` inside a card or message. */
17
+ export declare const ExamplesPadding: Story;
18
+ interface ChatReplyPlaygroundProps {
19
+ hasPadding: boolean;
20
+ subject: string;
21
+ label: string;
22
+ recipientCount: number;
23
+ isMultiline: boolean;
24
+ className?: string;
25
+ }
26
+ declare function ChatReplyPlayground({ hasPadding, subject, label, recipientCount, isMultiline, className, }: ChatReplyPlaygroundProps): import('react').JSX.Element;
27
+ type PlaygroundStory = StoryObj<typeof ChatReplyPlayground>;
28
+ /** A text row and a chip row at once, with every prop of the list and the row on the Controls panel. */
29
+ export declare const Playground: PlaygroundStory;
7
30
  //# sourceMappingURL=chat-reply.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-reply.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-reply/chat-reply.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAe,SAAS,EAAkC,MAAM,cAAc,CAAC;AAEtF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAoChC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAC"}
1
+ {"version":3,"file":"chat-reply.stories.d.ts","sourceRoot":"","sources":["../../../src/components/chat-reply/chat-reply.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,EAAe,SAAS,EAAkC,MAAM,cAAc,CAAC;AAEtF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA2BhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAkBxC,sJAAsJ;AACtJ,eAAO,MAAM,OAAO,EAAE,KA0BrB,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,SAAS,EAAE,KAcvB,CAAC;AAEF,6HAA6H;AAC7H,eAAO,MAAM,sBAAsB,EAAE,KA+BpC,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC;AAEF,oHAAoH;AACpH,eAAO,MAAM,QAAQ,EAAE,KAmEtB,CAAC;AAEF,uHAAuH;AACvH,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC;AAEF,UAAU,wBAAwB;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,mBAAmB,CAAC,EAC3B,UAAU,EACV,OAAO,EACP,KAAK,EACL,cAAc,EACd,WAAW,EACX,SAAS,GACV,EAAE,wBAAwB,+BAyB1B;AAED,KAAK,eAAe,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE5D,wGAAwG;AACxG,eAAO,MAAM,UAAU,EAAE,eA6BxB,CAAC"}
@@ -1,2 +1,2 @@
1
- export { ChatReplies, ChatReply, ChatReplyLabel, ChatReplyValue } from './chat-reply';
1
+ export { ChatReplies, ChatReply, ChatReplyLabel, ChatReplyValue, type ChatRepliesProps, type ChatReplyProps, type ChatReplyLabelProps, type ChatReplyValueProps, } from './chat-reply';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-reply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-reply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC"}