@swisper.ai/web-chat-ui 0.0.2 → 0.0.4
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.
- package/README.md +9 -12
- package/dist/components/canvas-shell/canvas-shell.d.ts +32 -10
- package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -1
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts +49 -17
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -1
- package/dist/components/chat-card/chat-card.d.ts +1 -0
- package/dist/components/chat-card/chat-card.d.ts.map +1 -1
- package/dist/components/chat-card/chat-card.stories.d.ts +47 -1
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-body.d.ts +8 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-footer.d.ts +8 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-form.d.ts +15 -2
- package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -1
- package/dist/components/chat-card/components/chat-card-header.d.ts +23 -2
- package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -1
- package/dist/components/chat-card/contexts.d.ts +2 -0
- package/dist/components/chat-card/contexts.d.ts.map +1 -1
- package/dist/components/chat-card/hooks.d.ts +1 -0
- package/dist/components/chat-card/hooks.d.ts.map +1 -1
- package/dist/components/chat-card/types.d.ts +3 -0
- package/dist/components/chat-card/types.d.ts.map +1 -1
- package/dist/components/chat-card-container/chat-card-container.d.ts +4 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -1
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts +12 -1
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -1
- package/dist/components/chat-container/chat-container.d.ts.map +1 -1
- package/dist/components/chat-container/chat-container.stories.d.ts +36 -11
- package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -1
- package/dist/components/chat-input/chat-input.d.ts +27 -2
- package/dist/components/chat-input/chat-input.d.ts.map +1 -1
- package/dist/components/chat-input/chat-input.stories.d.ts +63 -3
- package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list-item.d.ts +6 -0
- package/dist/components/chat-list/chat-list-item.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list-items.d.ts +12 -1
- package/dist/components/chat-list/chat-list-items.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list.d.ts +36 -2
- package/dist/components/chat-list/chat-list.d.ts.map +1 -1
- package/dist/components/chat-list/chat-list.stories.d.ts +67 -9
- package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.d.ts +12 -1
- package/dist/components/chat-message/chat-message.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.stories.d.ts +31 -0
- package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -1
- package/dist/components/chat-message/index.d.ts +1 -1
- package/dist/components/chat-message/index.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +3 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +25 -5
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +32 -1
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/index.d.ts +2 -2
- package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -1
- package/dist/components/chat-message-attachment-card/utils.d.ts +1 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -1
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts +13 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +22 -5
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +42 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -1
- package/dist/components/chat-message-toolbar/index.d.ts +1 -1
- package/dist/components/chat-message-toolbar/index.d.ts.map +1 -1
- package/dist/components/chat-messages/chat-messages.d.ts +34 -2
- package/dist/components/chat-messages/chat-messages.d.ts.map +1 -1
- package/dist/components/chat-messages/chat-messages.stories.d.ts +33 -2
- package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -1
- package/dist/components/chat-notification-card/chat-notification-card.d.ts +56 -4
- package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -1
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +50 -1
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +6 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +43 -1
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +37 -17
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +53 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -1
- package/dist/components/chat-reply/chat-reply.d.ts +11 -0
- package/dist/components/chat-reply/chat-reply.d.ts.map +1 -1
- package/dist/components/chat-reply/chat-reply.stories.d.ts +23 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -1
- package/dist/components/chat-reply/index.d.ts +1 -1
- package/dist/components/chat-reply/index.d.ts.map +1 -1
- package/dist/components/chat-suggestion/chat-suggestion.d.ts +36 -10
- package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -1
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +66 -2
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -1
- package/dist/components/chat-suggestion/index.d.ts +2 -1
- package/dist/components/chat-suggestion/index.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +26 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +25 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -1
- package/dist/components/chat-thread/chat-thread.d.ts +17 -2
- package/dist/components/chat-thread/chat-thread.d.ts.map +1 -1
- package/dist/components/chat-thread/chat-thread.stories.d.ts +75 -10
- package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/markdown-viewer/markdown-viewer.d.ts +8 -1
- package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -1
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +18 -1
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -1
- package/dist/components/rich-text-area/rich-text-area.d.ts +17 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -1
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts +52 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -1
- package/dist/components/rich-text-area/styled.d.ts +6 -2
- package/dist/components/rich-text-area/styled.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +9 -2
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/index.d.ts +5 -5
- package/dist/components/rich-text-field/components/index.d.ts.map +1 -1
- package/dist/components/rich-text-field/components/text-color-button.d.ts +12 -1
- package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -1
- package/dist/components/rich-text-field/rich-text-field.d.ts +22 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -1
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts +28 -1
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -1
- package/dist/components/topmenu/index.d.ts +2 -0
- package/dist/components/topmenu/index.d.ts.map +1 -0
- package/dist/components/topmenu/topmenu.d.ts +22 -0
- package/dist/components/topmenu/topmenu.d.ts.map +1 -0
- package/dist/components/topmenu/topmenu.stories.d.ts +31 -0
- package/dist/components/topmenu/topmenu.stories.d.ts.map +1 -0
- package/dist/docs/agent.stories.d.ts.map +1 -1
- package/dist/docs/chat-panel.d.ts +7 -5
- package/dist/docs/chat-panel.d.ts.map +1 -1
- package/dist/docs/chatbot-panel.d.ts.map +1 -1
- package/dist/docs/chatbot.stories.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1227 -1260
- package/dist/index.es.js.map +1 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +9 -7
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +37 -9
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +41 -16
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +6 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +22 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -1
- package/package.json +15 -9
- package/src/__storybook__/parent-block.tsx +21 -0
- package/src/components/canvas-shell/__stories__/canvas-panel.tsx +25 -0
- package/src/components/canvas-shell/__stories__/document-list.tsx +29 -0
- package/src/components/canvas-shell/__stories__/fixtures.ts +222 -0
- package/src/components/canvas-shell/__stories__/holdings-table.tsx +56 -0
- package/src/components/canvas-shell/__stories__/types.ts +47 -0
- package/src/components/canvas-shell/{canvas-shell.test.tsx → __tests__/canvas-shell.spec.tsx} +1 -1
- package/src/components/canvas-shell/canvas-shell.json +24 -0
- package/src/components/canvas-shell/canvas-shell.stories.tsx +581 -122
- package/src/components/canvas-shell/canvas-shell.tsx +44 -17
- package/src/components/chat-card/__stories__/fixtures.ts +119 -0
- package/src/components/chat-card/__stories__/types.ts +44 -0
- package/src/components/chat-card/chat-card.json +67 -3
- package/src/components/chat-card/chat-card.stories.tsx +872 -148
- package/src/components/chat-card/chat-card.tsx +2 -0
- package/src/components/chat-card/components/chat-card-body.tsx +12 -0
- package/src/components/chat-card/components/chat-card-footer.tsx +11 -0
- package/src/components/chat-card/components/chat-card-form.tsx +21 -2
- package/src/components/chat-card/components/chat-card-header.tsx +39 -2
- package/src/components/chat-card/contexts.tsx +2 -0
- package/src/components/chat-card/hooks.ts +1 -0
- package/src/components/chat-card/types.ts +3 -0
- package/src/components/chat-card-container/__stories__/fixtures.ts +54 -0
- package/src/components/chat-card-container/__stories__/resizable-chat-window.tsx +19 -0
- package/src/components/chat-card-container/__stories__/result-card.tsx +31 -0
- package/src/components/chat-card-container/__stories__/types.ts +16 -0
- package/src/components/chat-card-container/chat-card-container.json +7 -0
- package/src/components/chat-card-container/chat-card-container.stories.tsx +209 -56
- package/src/components/chat-card-container/chat-card-container.tsx +5 -0
- package/src/components/chat-container/__stories__/chat-composer.tsx +67 -0
- package/src/components/chat-container/__stories__/fixtures.ts +27 -0
- package/src/components/chat-container/__stories__/measure.ts +22 -0
- package/src/components/chat-container/__stories__/types.ts +7 -0
- package/src/components/chat-container/__stories__/variable-readout.tsx +64 -0
- package/src/components/chat-container/chat-container.json +9 -1
- package/src/components/chat-container/chat-container.stories.tsx +538 -106
- package/src/components/chat-container/chat-container.tsx +3 -0
- package/src/components/chat-input/__stories__/fixtures.ts +31 -0
- package/src/components/chat-input/chat-input.json +10 -2
- package/src/components/chat-input/chat-input.stories.tsx +660 -197
- package/src/components/chat-input/chat-input.tsx +32 -2
- package/src/components/chat-list/__stories__/chat-row.tsx +41 -0
- package/src/components/chat-list/__stories__/fixtures.ts +94 -0
- package/src/components/chat-list/__stories__/types.ts +13 -0
- package/src/components/chat-list/chat-list-item.tsx +6 -0
- package/src/components/chat-list/chat-list-items.tsx +16 -0
- package/src/components/chat-list/chat-list.json +24 -2
- package/src/components/chat-list/chat-list.stories.tsx +631 -215
- package/src/components/chat-list/chat-list.tsx +51 -4
- package/src/components/chat-message/__stories__/fixtures.ts +53 -0
- package/src/components/chat-message/__stories__/sent-attachment.tsx +22 -0
- package/src/components/chat-message/__stories__/tool-steps.tsx +37 -0
- package/src/components/chat-message/chat-message.json +10 -1
- package/src/components/chat-message/chat-message.stories.tsx +282 -20
- package/src/components/chat-message/chat-message.tsx +16 -1
- package/src/components/chat-message/index.ts +8 -1
- package/src/components/chat-message-attachment-card/__stories__/fixtures.ts +30 -0
- package/src/components/chat-message-attachment-card/__stories__/types.ts +14 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +4 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +20 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +266 -51
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +37 -4
- package/src/components/chat-message-attachment-card/index.ts +6 -0
- package/src/components/chat-message-attachment-card/utils.ts +1 -0
- package/src/components/chat-message-response/__stories__/fixtures.ts +50 -0
- package/src/components/chat-message-response/chat-message-response.json +5 -0
- package/src/components/chat-message-response/chat-message-response.stories.tsx +135 -26
- package/src/components/chat-message-toolbar/chat-message-toolbar.json +21 -3
- package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +377 -6
- package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +47 -12
- package/src/components/chat-message-toolbar/index.ts +4 -0
- package/src/components/chat-messages/__stories__/conversation-frame.tsx +25 -0
- package/src/components/chat-messages/__stories__/conversation-group.tsx +22 -0
- package/src/components/chat-messages/__stories__/fixtures.ts +70 -0
- package/src/components/chat-messages/__stories__/types.ts +5 -0
- package/src/components/chat-messages/chat-messages.json +30 -12
- package/src/components/chat-messages/chat-messages.stories.tsx +439 -212
- package/src/components/chat-messages/chat-messages.tsx +46 -3
- package/src/components/chat-notification-card/__stories__/fixtures.ts +38 -0
- package/src/components/chat-notification-card/__stories__/types.ts +13 -0
- package/src/components/chat-notification-card/chat-notification-card.json +52 -2
- package/src/components/chat-notification-card/chat-notification-card.stories.tsx +542 -62
- package/src/components/chat-notification-card/chat-notification-card.tsx +97 -6
- package/src/components/chat-notification-popup/__stories__/fixtures.ts +36 -0
- package/src/components/chat-notification-popup/__stories__/notification-item.tsx +93 -0
- package/src/components/chat-notification-popup/__stories__/types.ts +14 -0
- package/src/components/chat-notification-popup/chat-notification-popup.json +14 -1
- package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +467 -17
- package/src/components/chat-notification-popup/chat-notification-popup.tsx +18 -3
- package/src/components/chat-prompt-box/__stories__/fixtures.ts +16 -0
- package/src/components/chat-prompt-box/__stories__/types.ts +8 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +25 -2
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +535 -43
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +73 -19
- package/src/components/chat-reply/chat-reply.json +10 -0
- package/src/components/chat-reply/chat-reply.stories.tsx +264 -21
- package/src/components/chat-reply/chat-reply.tsx +15 -0
- package/src/components/chat-reply/index.ts +10 -1
- package/src/components/chat-suggestion/__stories__/fixtures.ts +16 -0
- package/src/components/chat-suggestion/__tests__/chat-suggestion.spec.tsx +185 -0
- package/src/components/chat-suggestion/chat-suggestion.json +62 -20
- package/src/components/chat-suggestion/chat-suggestion.stories.tsx +542 -58
- package/src/components/chat-suggestion/chat-suggestion.tsx +154 -65
- package/src/components/chat-suggestion/index.ts +9 -0
- package/src/components/chat-thinking-process/__stories__/fixtures.ts +56 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +28 -3
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +354 -78
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +55 -4
- package/src/components/chat-thread/__stories__/fixtures.ts +171 -0
- package/src/components/chat-thread/__stories__/scroll-position.ts +9 -0
- package/src/components/chat-thread/__stories__/snippets.ts +129 -0
- package/src/components/chat-thread/__stories__/thread-frame.tsx +22 -0
- package/src/components/chat-thread/__stories__/thread-turns.tsx +35 -0
- package/src/components/chat-thread/__stories__/types.ts +12 -0
- package/src/components/chat-thread/__stories__/use-turn-stream.ts +78 -0
- package/src/components/chat-thread/chat-thread.json +23 -3
- package/src/components/chat-thread/chat-thread.stories.tsx +804 -142
- package/src/components/chat-thread/chat-thread.tsx +64 -16
- package/src/components/index.ts +1 -3
- package/src/components/markdown-viewer/__stories__/fixtures.ts +67 -0
- package/src/components/markdown-viewer/markdown-viewer.json +7 -1
- package/src/components/markdown-viewer/markdown-viewer.stories.tsx +219 -50
- package/src/components/markdown-viewer/markdown-viewer.tsx +9 -0
- package/src/components/rich-text-area/__stories__/fixtures.ts +30 -0
- package/src/components/rich-text-area/rich-text-area.json +6 -4
- package/src/components/rich-text-area/rich-text-area.stories.tsx +597 -41
- package/src/components/rich-text-area/rich-text-area.tsx +22 -1
- package/src/components/rich-text-area/styled.tsx +11 -5
- package/src/components/rich-text-field/__stories__/fixtures.ts +29 -0
- package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +10 -1
- package/src/components/rich-text-field/components/index.ts +8 -5
- package/src/components/rich-text-field/components/text-color-button.tsx +16 -2
- package/src/components/rich-text-field/rich-text-field.json +3 -1
- package/src/components/rich-text-field/rich-text-field.stories.tsx +452 -61
- package/src/components/rich-text-field/rich-text-field.tsx +23 -0
- package/src/components/topmenu/index.ts +1 -0
- package/src/components/topmenu/topmenu.json +107 -0
- package/src/components/topmenu/topmenu.stories.tsx +334 -0
- package/src/components/topmenu/topmenu.tsx +71 -0
- package/src/docs/agent.stories.tsx +16 -16
- package/src/docs/chat-panel.tsx +37 -32
- package/src/docs/chatbot-panel.tsx +11 -2
- package/src/docs/chatbot.mdx +17 -12
- package/src/docs/chatbot.stories.tsx +7 -8
- package/src/layouts/chat-card-list-layout/__stories__/fixtures.ts +112 -0
- package/src/layouts/chat-card-list-layout/__stories__/result-card.tsx +36 -0
- package/src/layouts/chat-card-list-layout/__stories__/types.ts +31 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +14 -1
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +316 -84
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +11 -7
- package/src/layouts/chat-card-three-column-layout/__stories__/fixtures.ts +117 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/resizable-chat-window.tsx +18 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-details.tsx +85 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +50 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-map.tsx +44 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-rooms.tsx +61 -0
- package/src/layouts/chat-card-three-column-layout/__stories__/types.ts +35 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +16 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +603 -182
- package/src/layouts/chat-card-two-column-layout/__stories__/connection-itinerary.tsx +51 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/fixtures.ts +83 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +24 -0
- package/src/layouts/chat-card-two-column-layout/__stories__/types.ts +15 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +13 -1
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +368 -67
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +11 -2
- package/dist/components/card-item-picker/card-item-picker-context.d.ts +0 -21
- package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-list.d.ts +0 -24
- package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +0 -28
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker-row.d.ts +0 -12
- package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +0 -1
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts +0 -19
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +0 -1
- package/dist/components/card-item-picker/index.d.ts +0 -9
- package/dist/components/card-item-picker/index.d.ts.map +0 -1
- package/dist/components/chat-message-history/chat-message-history.d.ts +0 -48
- package/dist/components/chat-message-history/chat-message-history.d.ts.map +0 -1
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts +0 -7
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +0 -1
- package/dist/components/chat-message-history/index.d.ts +0 -2
- package/dist/components/chat-message-history/index.d.ts.map +0 -1
- package/dist/components/spinner/index.d.ts +0 -2
- package/dist/components/spinner/index.d.ts.map +0 -1
- package/dist/components/spinner/spinner.d.ts +0 -9
- package/dist/components/spinner/spinner.d.ts.map +0 -1
- package/dist/components/spinner/spinner.stories.d.ts +0 -8
- package/dist/components/spinner/spinner.stories.d.ts.map +0 -1
- package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +0 -279
- package/src/components/card-item-picker/card-item-picker-context.tsx +0 -44
- package/src/components/card-item-picker/card-item-picker-list.tsx +0 -95
- package/src/components/card-item-picker/card-item-picker-row-parts.tsx +0 -96
- package/src/components/card-item-picker/card-item-picker-row.tsx +0 -109
- package/src/components/card-item-picker/card-item-picker.json +0 -147
- package/src/components/card-item-picker/card-item-picker.stories.tsx +0 -158
- package/src/components/card-item-picker/index.ts +0 -24
- package/src/components/chat-message-history/chat-message-history.json +0 -99
- package/src/components/chat-message-history/chat-message-history.stories.tsx +0 -136
- package/src/components/chat-message-history/chat-message-history.tsx +0 -277
- package/src/components/chat-message-history/index.ts +0 -13
- package/src/components/spinner/index.ts +0 -1
- package/src/components/spinner/spinner.json +0 -73
- package/src/components/spinner/spinner.stories.tsx +0 -41
- package/src/components/spinner/spinner.tsx +0 -32
|
@@ -2,14 +2,28 @@ import {
|
|
|
2
2
|
Children,
|
|
3
3
|
cloneElement,
|
|
4
4
|
createContext,
|
|
5
|
+
forwardRef,
|
|
5
6
|
isValidElement,
|
|
6
7
|
useContext,
|
|
7
8
|
useMemo,
|
|
9
|
+
type MouseEvent,
|
|
8
10
|
type ReactElement,
|
|
9
11
|
type ReactNode,
|
|
10
12
|
} from 'react';
|
|
11
13
|
|
|
12
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
List,
|
|
16
|
+
ListItem,
|
|
17
|
+
ListItemAction,
|
|
18
|
+
ListItemTitle,
|
|
19
|
+
ListItemTrigger,
|
|
20
|
+
listItemVariants,
|
|
21
|
+
OrderChip,
|
|
22
|
+
Typography,
|
|
23
|
+
type ListItemActionProps,
|
|
24
|
+
type ListItemProps,
|
|
25
|
+
type ListProps,
|
|
26
|
+
} from '@swisper.ai/ui';
|
|
13
27
|
import { cn } from '@swisper.ai/web-core';
|
|
14
28
|
|
|
15
29
|
interface ChatSuggestionContextValue {
|
|
@@ -28,83 +42,122 @@ export function useChatSuggestionContext() {
|
|
|
28
42
|
return context;
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onMouseLeave?: () => void;
|
|
35
|
-
}
|
|
45
|
+
/* -------------------------------------------------------------------------------------------------
|
|
46
|
+
* ChatSuggestions
|
|
47
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
36
48
|
|
|
37
|
-
export
|
|
38
|
-
return (
|
|
39
|
-
<div
|
|
40
|
-
role="list"
|
|
41
|
-
data-testid="chat-suggestions"
|
|
42
|
-
className={cn('list-none flex flex-col flex-wrap align-start items-stretch gap-0', className)}
|
|
43
|
-
onMouseLeave={onMouseLeave}
|
|
44
|
-
>
|
|
45
|
-
{Children.map(children, (child, index) => {
|
|
46
|
-
if (!isValidElement(child)) {
|
|
47
|
-
return child;
|
|
48
|
-
}
|
|
49
|
+
export interface ChatSuggestionsProps extends Omit<ListProps, 'asChild'> {}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The numbered list of suggestions, an `<ol>` built on `ui/List`: one Tab stop, arrow keys between
|
|
53
|
+
* suggestions (wrapping at the ends unless `hasLoop={false}`), one highlighted suggestion. Name it
|
|
54
|
+
* with `aria-label` or `aria-labelledby`. It gives each direct child its zero-based `index`.
|
|
55
|
+
*/
|
|
56
|
+
export const ChatSuggestions = forwardRef<HTMLOListElement, ChatSuggestionsProps>(
|
|
57
|
+
function ChatSuggestions({ children, className, hasLoop = true, ...props }, ref) {
|
|
58
|
+
return (
|
|
59
|
+
<List asChild hasLoop={hasLoop} ref={ref} {...props}>
|
|
60
|
+
<ol
|
|
61
|
+
data-slot="chat-suggestions"
|
|
62
|
+
data-testid="chat-suggestions"
|
|
63
|
+
className={cn('m-0 p-0 list-none flex flex-col items-stretch gap-0', className)}
|
|
64
|
+
>
|
|
65
|
+
{Children.map(children, (child, index) => {
|
|
66
|
+
if (!isValidElement(child)) {
|
|
67
|
+
return child;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return cloneElement(child as ReactElement<ChatSuggestionProps>, { index });
|
|
71
|
+
})}
|
|
72
|
+
</ol>
|
|
73
|
+
</List>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
ChatSuggestions.displayName = 'ChatSuggestions';
|
|
79
|
+
|
|
80
|
+
/* -------------------------------------------------------------------------------------------------
|
|
81
|
+
* ChatSuggestion
|
|
82
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
55
83
|
|
|
56
|
-
export interface ChatSuggestionProps
|
|
84
|
+
export interface ChatSuggestionProps extends Omit<
|
|
85
|
+
ListItemProps,
|
|
86
|
+
'asChild' | 'className' | 'isSelected'
|
|
87
|
+
> {
|
|
88
|
+
/** Zero-based position in the list. `ChatSuggestions` sets it on its direct children. */
|
|
57
89
|
index?: number;
|
|
58
|
-
children: ReactNode;
|
|
59
90
|
className?: string;
|
|
91
|
+
/** Classes for the overlay `role="button"` that covers the suggestion. */
|
|
92
|
+
triggerClassName?: string;
|
|
93
|
+
/** The pointer entered the suggestion. Keyboard highlight does not call it. */
|
|
60
94
|
onHover?: () => void;
|
|
61
|
-
onClick?: () => void;
|
|
62
95
|
}
|
|
63
96
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
97
|
+
/**
|
|
98
|
+
* One suggestion: an `<li>` whose whole surface is the selectable element (an overlay
|
|
99
|
+
* `role="button"` named by `ChatSuggestionLabel`). `onSelect` fires on click, Enter and Space.
|
|
100
|
+
* Controls in the row go in `ChatSuggestionAction`, which stacks above the overlay.
|
|
101
|
+
*/
|
|
102
|
+
export const ChatSuggestion = forwardRef<HTMLLIElement, ChatSuggestionProps>(
|
|
103
|
+
function ChatSuggestion(
|
|
104
|
+
{ index, children, className, triggerClassName, onHover, onMouseEnter, ...props },
|
|
105
|
+
ref,
|
|
106
|
+
) {
|
|
107
|
+
const contextValue = useMemo(() => ({ index }), [index]);
|
|
72
108
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
109
|
+
function handleMouseEnter(event: MouseEvent<HTMLLIElement>) {
|
|
110
|
+
onMouseEnter?.(event);
|
|
111
|
+
onHover?.();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<ChatSuggestionContext.Provider value={contextValue}>
|
|
116
|
+
<ListItem
|
|
117
|
+
ref={ref}
|
|
118
|
+
data-slot="chat-suggestion"
|
|
119
|
+
className={listItemVariants(
|
|
120
|
+
cn('relative items-start gap-0 p-4 text-typography-text-secondary', className),
|
|
121
|
+
{ highlighted: 'bg-layout-accent-low-background-hover-default' },
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
onMouseEnter={handleMouseEnter}
|
|
125
|
+
>
|
|
126
|
+
<ListItemTrigger
|
|
127
|
+
className={cn('absolute inset-0 rounded-[inherit] outline-none', triggerClassName)}
|
|
128
|
+
/>
|
|
129
|
+
{children}
|
|
130
|
+
</ListItem>
|
|
131
|
+
</ChatSuggestionContext.Provider>
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
ChatSuggestion.displayName = 'ChatSuggestion';
|
|
137
|
+
|
|
138
|
+
/* -------------------------------------------------------------------------------------------------
|
|
139
|
+
* ChatSuggestionLabelIcon / ChatSuggestionLabel
|
|
140
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
96
141
|
|
|
97
142
|
export interface ChatSuggestionLabelIconProps {
|
|
98
143
|
children?: ReactNode;
|
|
99
144
|
className?: string;
|
|
145
|
+
/** Classes for the 32px box that holds the number or the icon. */
|
|
146
|
+
innerClassName?: string;
|
|
100
147
|
}
|
|
101
148
|
|
|
102
|
-
|
|
149
|
+
/** The leading slot: the suggestion's number in an `OrderChip`, or the icon passed as children. */
|
|
150
|
+
export function ChatSuggestionLabelIcon({
|
|
151
|
+
children,
|
|
152
|
+
className,
|
|
153
|
+
innerClassName,
|
|
154
|
+
}: ChatSuggestionLabelIconProps) {
|
|
103
155
|
const { index = 0 } = useChatSuggestionContext();
|
|
104
156
|
|
|
105
157
|
return (
|
|
106
158
|
<span
|
|
107
159
|
aria-hidden="true"
|
|
160
|
+
data-slot="chat-suggestion-label-icon"
|
|
108
161
|
className={cn(
|
|
109
162
|
'inline-flex flex-row justify-center items-center shrink-0 size-auto text-inherit',
|
|
110
163
|
className,
|
|
@@ -112,17 +165,21 @@ export function ChatSuggestionLabelIcon({ children, className }: ChatSuggestionL
|
|
|
112
165
|
>
|
|
113
166
|
<span
|
|
114
167
|
aria-hidden="true"
|
|
168
|
+
data-slot="chat-suggestion-label-icon-inner"
|
|
115
169
|
className={cn(
|
|
116
170
|
'size-[32px]',
|
|
117
171
|
'inline-flex items-center justify-center',
|
|
118
172
|
'px-8 py-[7px]',
|
|
119
173
|
'[&_svg]:size-[18px]!',
|
|
174
|
+
innerClassName,
|
|
120
175
|
)}
|
|
121
176
|
>
|
|
122
177
|
{children || (
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
178
|
+
<OrderChip>
|
|
179
|
+
<Typography variant="caption-md" fontWeight="semibold" className="text-inherit" asChild>
|
|
180
|
+
<span>{index + 1}</span>
|
|
181
|
+
</Typography>
|
|
182
|
+
</OrderChip>
|
|
126
183
|
)}
|
|
127
184
|
</span>
|
|
128
185
|
</span>
|
|
@@ -135,6 +192,7 @@ export interface ChatSuggestionLabelProps {
|
|
|
135
192
|
isMultiline?: boolean;
|
|
136
193
|
}
|
|
137
194
|
|
|
195
|
+
/** The suggestion's text and its accessible name. Up to three lines, or one with `isMultiline={false}`. */
|
|
138
196
|
export function ChatSuggestionLabel({
|
|
139
197
|
children,
|
|
140
198
|
className,
|
|
@@ -143,38 +201,50 @@ export function ChatSuggestionLabel({
|
|
|
143
201
|
return (
|
|
144
202
|
<Typography
|
|
145
203
|
variant="body-small-low"
|
|
204
|
+
data-slot="chat-suggestion-label"
|
|
146
205
|
data-multiline={isMultiline}
|
|
147
206
|
className={cn(
|
|
148
207
|
'gap-0 px-4 my-[7px]',
|
|
149
|
-
'h-full flex-1 items-center justify-center text-left text-inherit',
|
|
208
|
+
'h-full min-w-0 flex-1 items-center justify-center text-left text-inherit',
|
|
150
209
|
'data-[multiline=false]:truncate',
|
|
151
210
|
'data-[multiline=true]:line-clamp-3',
|
|
152
211
|
className,
|
|
153
212
|
)}
|
|
213
|
+
asChild
|
|
154
214
|
>
|
|
155
|
-
{children}
|
|
215
|
+
<ListItemTitle>{children}</ListItemTitle>
|
|
156
216
|
</Typography>
|
|
157
217
|
);
|
|
158
218
|
}
|
|
159
219
|
|
|
220
|
+
/* -------------------------------------------------------------------------------------------------
|
|
221
|
+
* ChatSuggestionActions / ChatSuggestionAction
|
|
222
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
223
|
+
|
|
160
224
|
export interface ChatSuggestionActionsProps {
|
|
161
225
|
children: ReactNode;
|
|
162
226
|
className?: string;
|
|
163
227
|
}
|
|
164
228
|
|
|
229
|
+
/**
|
|
230
|
+
* The trailing slot, shown while the suggestion is highlighted (pointer over it or focus inside
|
|
231
|
+
* it). Holds a hint icon, or controls each wrapped in `ChatSuggestionAction`.
|
|
232
|
+
*/
|
|
165
233
|
export function ChatSuggestionActions({ children, className }: ChatSuggestionActionsProps) {
|
|
166
234
|
return (
|
|
167
235
|
<div
|
|
168
236
|
role="group"
|
|
237
|
+
data-slot="chat-suggestion-actions"
|
|
169
238
|
className={cn(
|
|
170
239
|
'shrink-0 flex items-center justify-center gap-8',
|
|
171
240
|
'self-start',
|
|
172
241
|
'min-w-[32px] h-[32px]',
|
|
242
|
+
// Clicks on the hint icon fall through to the overlay trigger.
|
|
243
|
+
'pointer-events-none',
|
|
173
244
|
'*:text-secondary-main',
|
|
174
245
|
'[&>svg]:size-[18px]!',
|
|
175
246
|
'opacity-0',
|
|
176
|
-
'group-
|
|
177
|
-
'group-focus-visible/suggestion:opacity-100',
|
|
247
|
+
'group-data-highlighted/list-item:opacity-100',
|
|
178
248
|
className,
|
|
179
249
|
)}
|
|
180
250
|
>
|
|
@@ -182,3 +252,22 @@ export function ChatSuggestionActions({ children, className }: ChatSuggestionAct
|
|
|
182
252
|
</div>
|
|
183
253
|
);
|
|
184
254
|
}
|
|
255
|
+
|
|
256
|
+
export interface ChatSuggestionActionProps extends ListItemActionProps {}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Wraps one control in `ChatSuggestionActions` (a dismiss `IconButton`). The control stacks above
|
|
260
|
+
* the suggestion's overlay, never selects the suggestion, and is in the Tab order only in the row
|
|
261
|
+
* that holds the list's Tab stop.
|
|
262
|
+
*/
|
|
263
|
+
export const ChatSuggestionAction = forwardRef<HTMLElement, ChatSuggestionActionProps>(
|
|
264
|
+
function ChatSuggestionAction({ className, children, ...rest }, ref) {
|
|
265
|
+
return (
|
|
266
|
+
<ListItemAction ref={ref} className={cn('pointer-events-auto', className)} {...rest}>
|
|
267
|
+
{children}
|
|
268
|
+
</ListItemAction>
|
|
269
|
+
);
|
|
270
|
+
},
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
ChatSuggestionAction.displayName = 'ChatSuggestionAction';
|
|
@@ -4,5 +4,14 @@ export {
|
|
|
4
4
|
ChatSuggestionLabelIcon,
|
|
5
5
|
ChatSuggestionLabel,
|
|
6
6
|
ChatSuggestionActions,
|
|
7
|
+
ChatSuggestionAction,
|
|
7
8
|
useChatSuggestionContext,
|
|
8
9
|
} from './chat-suggestion';
|
|
10
|
+
export type {
|
|
11
|
+
ChatSuggestionsProps,
|
|
12
|
+
ChatSuggestionProps,
|
|
13
|
+
ChatSuggestionLabelIconProps,
|
|
14
|
+
ChatSuggestionLabelProps,
|
|
15
|
+
ChatSuggestionActionsProps,
|
|
16
|
+
ChatSuggestionActionProps,
|
|
17
|
+
} from './chat-suggestion';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** What the assistant did before answering "What were my biggest expenses this month?". */
|
|
2
|
+
export const EXPENSE_STEPS = [
|
|
3
|
+
'Searching transactions for May…',
|
|
4
|
+
'Reading 214 card and account transactions…',
|
|
5
|
+
// The awkward row: a step long enough to wrap beside its timeline dot.
|
|
6
|
+
'Comparing each category with your three-month average, leaving out rent and the SBB travelcard because those are the same every month…',
|
|
7
|
+
'Sorting by amount…',
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
/** One turn of a coding agent: the request, its reasoning and the answer the reasoning led to. */
|
|
11
|
+
export const AGENT_REQUEST = 'Add document upload to the knowledge base.';
|
|
12
|
+
|
|
13
|
+
export const AGENT_REASONING =
|
|
14
|
+
'Brownfield extension: reusing the existing vector store client and the upload route patterns rather than introducing new ones.';
|
|
15
|
+
|
|
16
|
+
export const AGENT_ANSWER =
|
|
17
|
+
'I will extend the existing upload route and store the embeddings with the vector store client that is already there. No new service is needed.';
|
|
18
|
+
|
|
19
|
+
/** A long tool log that arrives a character at a time while the assistant reads a mailbox. */
|
|
20
|
+
export const MAILBOX_LOOKUP_LOG = `Processing your request to retrieve your email list...
|
|
21
|
+
|
|
22
|
+
Understanding intent
|
|
23
|
+
- Parsed: "show me my emails" → list inbox messages for the connected account
|
|
24
|
+
- Scope: Inbox only (excluding Sent, Drafts, Junk unless user asks otherwise)
|
|
25
|
+
- Time window: last 7 days, newest first
|
|
26
|
+
|
|
27
|
+
Checking access
|
|
28
|
+
- Account: alex.morgan@company.com (Microsoft 365)
|
|
29
|
+
- OAuth token present and not expired
|
|
30
|
+
- Required scope Mail.Read confirmed
|
|
31
|
+
|
|
32
|
+
Connecting to mailbox
|
|
33
|
+
- Endpoint: https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages
|
|
34
|
+
- Building OData query:
|
|
35
|
+
- $filter: receivedDateTime ge 2026-05-21T00:00:00Z
|
|
36
|
+
- $orderby: receivedDateTime desc
|
|
37
|
+
- $top: 50
|
|
38
|
+
- $select: id,subject,from,receivedDateTime,isRead,hasAttachments,bodyPreview
|
|
39
|
+
|
|
40
|
+
Fetching messages (page 1 of 1)
|
|
41
|
+
- Request sent… waiting for response
|
|
42
|
+
- HTTP 200 — 47 messages returned in 312ms
|
|
43
|
+
|
|
44
|
+
Normalizing results
|
|
45
|
+
- Mapping sender display names and email addresses
|
|
46
|
+
- Trimming body previews to 120 characters
|
|
47
|
+
- Flagging 12 unread, 8 with attachments
|
|
48
|
+
|
|
49
|
+
Ranking for display
|
|
50
|
+
- Prioritizing unread and messages from known contacts
|
|
51
|
+
- Deprioritizing newsletters and automated notifications (noreply@, no-reply@)
|
|
52
|
+
|
|
53
|
+
Preparing summary
|
|
54
|
+
- Grouping: 12 unread · 35 read · 8 with attachments
|
|
55
|
+
- Top threads: "Q2 budget review", "Design sign-off", "Invoice #4821"
|
|
56
|
+
- Ready to present the email list to the user`;
|
|
@@ -2,13 +2,35 @@
|
|
|
2
2
|
"$schema": "../../../../int-eslint-config/schemas/component.schema.json",
|
|
3
3
|
"component": "chat-thinking-process",
|
|
4
4
|
"purpose": "Collapsible disclosure of the assistant's reasoning or tool-use steps above its answer: a trigger (icon, label, chevron) and a timeline of steps, with a shimmering label and a preview of the latest step while the model is still thinking. Parts: ChatThinkingProcessTrigger, ChatThinkingProcessTriggerIcon, ChatThinkingProcessTriggerLabel, ChatThinkingProcessTriggerArrow, ChatThinkingProcessContent, ChatThinkingProcessContentItem.",
|
|
5
|
+
"anatomy": [
|
|
6
|
+
"import {",
|
|
7
|
+
" ChatThinkingProcess,",
|
|
8
|
+
" ChatThinkingProcessTrigger,",
|
|
9
|
+
" ChatThinkingProcessTriggerIcon,",
|
|
10
|
+
" ChatThinkingProcessTriggerLabel,",
|
|
11
|
+
" ChatThinkingProcessTriggerArrow,",
|
|
12
|
+
" ChatThinkingProcessContent,",
|
|
13
|
+
" ChatThinkingProcessContentItem,",
|
|
14
|
+
"} from '@swisper.ai/web-chat-ui';",
|
|
15
|
+
"",
|
|
16
|
+
"<ChatThinkingProcess>",
|
|
17
|
+
" <ChatThinkingProcessTrigger>",
|
|
18
|
+
" <ChatThinkingProcessTriggerIcon />",
|
|
19
|
+
" <ChatThinkingProcessTriggerLabel />",
|
|
20
|
+
" <ChatThinkingProcessTriggerArrow />",
|
|
21
|
+
" </ChatThinkingProcessTrigger>",
|
|
22
|
+
" <ChatThinkingProcessContent>",
|
|
23
|
+
" <ChatThinkingProcessContentItem />",
|
|
24
|
+
" </ChatThinkingProcessContent>",
|
|
25
|
+
"</ChatThinkingProcess>"
|
|
26
|
+
],
|
|
5
27
|
"useWhen": [
|
|
6
28
|
"An assistant answer is preceded by reasoning, searches or tool calls the user may want to inspect",
|
|
7
29
|
"Showing live progress while the model thinks, before the first answer text arrives",
|
|
8
30
|
"Keeping the steps available but out of the way once the answer is shown"
|
|
9
31
|
],
|
|
10
32
|
"avoidWhen": [
|
|
11
|
-
"A plain wait with no steps to show — use
|
|
33
|
+
"A plain wait with no steps to show — use ui/spinner",
|
|
12
34
|
"Collapsible content that is not the assistant's process (settings, FAQs, details) — use ui/collapsible",
|
|
13
35
|
"The answer itself — render it with web-chat-ui/markdown-viewer in the message content"
|
|
14
36
|
],
|
|
@@ -49,7 +71,10 @@
|
|
|
49
71
|
"The preview shows the last child of ChatThinkingProcessContent, faded, and cross-fades each time a new step is added; it is hidden when expanded or not streaming. hasLastMessagePreview=false turns it off",
|
|
50
72
|
"Expanded, every child of ChatThinkingProcessContent becomes a timeline row with a dot, joined to the next row by a line; the last row has no connector",
|
|
51
73
|
"ChatThinkingProcessTriggerArrow rotates 180° when expanded",
|
|
52
|
-
"itemsClassName
|
|
74
|
+
"ChatThinkingProcessContent takes a class per element it renders: className (outer wrapper), itemsClassName (the expanded list of steps), rowClassName (each timeline row), markerClassName (the dot), connectorClassName (the line to the next dot) and previewClassName (the streaming preview)",
|
|
75
|
+
"Every part takes a className, merged last so it replaces the part's own classes, and sets a data-slot: chat-thinking-process, -trigger, -trigger-icon, -trigger-label, -trigger-arrow, -content, -content-items, -content-row, -content-marker, -content-connector, -content-preview, -content-item",
|
|
76
|
+
"The root carries the state as data-state (open / closed) and data-streaming (true / false); style a part from it with group-data-[state=open]/thinking-process: or group-data-[streaming=true]/thinking-process:",
|
|
77
|
+
"Other props on ChatThinkingProcessContent go to the expanded list of steps, not to its rows",
|
|
53
78
|
"A step's content can be any node, including streamed text that grows as it arrives"
|
|
54
79
|
]
|
|
55
80
|
},
|
|
@@ -104,7 +129,7 @@
|
|
|
104
129
|
"ui/collapsible",
|
|
105
130
|
"web-chat-ui/chat-message",
|
|
106
131
|
"web-chat-ui/markdown-viewer",
|
|
107
|
-
"
|
|
132
|
+
"ui/spinner",
|
|
108
133
|
"ui/timeline"
|
|
109
134
|
]
|
|
110
135
|
}
|