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