@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
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CloseIcon } from '@swisper.ai/icons';
|
|
2
|
+
import { Button, Chip, IconButton, ScrollArea, Typography } from '@swisper.ai/ui';
|
|
3
|
+
import { cn } from '@swisper.ai/web-core';
|
|
4
|
+
|
|
5
|
+
import type { Stay } from './types';
|
|
6
|
+
|
|
7
|
+
export interface StayDetailsProps {
|
|
8
|
+
stay: Stay;
|
|
9
|
+
/** Whether the Details pane floats over the map; the surface then lifts off it with a shadow. */
|
|
10
|
+
isFloating?: boolean;
|
|
11
|
+
/** Leave out on a card about one property, where there is no list to go back to. */
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
onCheckRooms?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** What the Details pane shows for the open property. The pane is transparent, so this draws the surface. */
|
|
17
|
+
export function StayDetails({ stay, isFloating = false, onClose, onCheckRooms }: StayDetailsProps) {
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className={cn(
|
|
21
|
+
'flex h-full min-h-0 flex-col gap-12 rounded-10 border border-card-border-base bg-card-background-base p-12',
|
|
22
|
+
isFloating && 'shadow-md',
|
|
23
|
+
)}
|
|
24
|
+
>
|
|
25
|
+
<div className="flex items-center gap-8">
|
|
26
|
+
<Typography variant="body-medium" fontWeight="semibold" asChild>
|
|
27
|
+
<h3 className="line-clamp-1 min-w-0 flex-1" title={stay.name}>
|
|
28
|
+
{stay.name}
|
|
29
|
+
</h3>
|
|
30
|
+
</Typography>
|
|
31
|
+
{onClose && (
|
|
32
|
+
<IconButton variant="tertiary" size="sm" aria-label="Close details" onClick={onClose}>
|
|
33
|
+
<CloseIcon />
|
|
34
|
+
</IconButton>
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<ScrollArea className="min-h-0 flex-1">
|
|
39
|
+
<div className="flex flex-col gap-12">
|
|
40
|
+
<Typography variant="body-small-low" className="text-text-secondary">
|
|
41
|
+
{stay.description}
|
|
42
|
+
</Typography>
|
|
43
|
+
|
|
44
|
+
<ul aria-label="Amenities" className="flex flex-wrap gap-4">
|
|
45
|
+
{stay.amenities.map((amenity) => (
|
|
46
|
+
<li key={amenity}>
|
|
47
|
+
<Chip variant="outlined" size="2xs">
|
|
48
|
+
{amenity}
|
|
49
|
+
</Chip>
|
|
50
|
+
</li>
|
|
51
|
+
))}
|
|
52
|
+
</ul>
|
|
53
|
+
|
|
54
|
+
<Typography variant="caption-md" className="text-text-tertiary">
|
|
55
|
+
Check-in {stay.checkIn} · Check-out {stay.checkOut}
|
|
56
|
+
</Typography>
|
|
57
|
+
|
|
58
|
+
<div className="flex flex-col gap-4">
|
|
59
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
60
|
+
From
|
|
61
|
+
</Typography>
|
|
62
|
+
<Typography variant="body-medium" fontWeight="semibold">
|
|
63
|
+
{stay.pricePerNight} avg / night
|
|
64
|
+
</Typography>
|
|
65
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
66
|
+
{stay.total} total · {stay.nights} nights
|
|
67
|
+
</Typography>
|
|
68
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
69
|
+
{stay.room}
|
|
70
|
+
</Typography>
|
|
71
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
72
|
+
{stay.cancellation}
|
|
73
|
+
</Typography>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</ScrollArea>
|
|
77
|
+
|
|
78
|
+
{onCheckRooms && (
|
|
79
|
+
<Button variant="secondary" size="md" onClick={onCheckRooms}>
|
|
80
|
+
Check other rooms
|
|
81
|
+
</Button>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ScrollArea, Typography } from '@swisper.ai/ui';
|
|
2
|
+
import { cn } from '@swisper.ai/web-core';
|
|
3
|
+
|
|
4
|
+
import type { Stay } from './types';
|
|
5
|
+
|
|
6
|
+
export interface StayListProps {
|
|
7
|
+
stays: Stay[];
|
|
8
|
+
/** Whether the List pane floats: a swipe strip over the map, not a scrolling column. */
|
|
9
|
+
isFloating: boolean;
|
|
10
|
+
selectedId: string | null;
|
|
11
|
+
onOpen: (stayId: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The search results: a scrolling column of rows, or a horizontal swipe strip when the pane floats. */
|
|
15
|
+
export function StayList({ stays, isFloating, selectedId, onOpen }: StayListProps) {
|
|
16
|
+
const list = (
|
|
17
|
+
<ul className={cn('flex gap-8', isFloating ? 'overflow-x-auto p-12' : 'flex-col')}>
|
|
18
|
+
{stays.map((stay) => (
|
|
19
|
+
<li key={stay.id} className={cn(isFloating && 'w-60 shrink-0')}>
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
aria-pressed={stay.id === selectedId}
|
|
23
|
+
onClick={() => onOpen(stay.id)}
|
|
24
|
+
className="flex w-full flex-col gap-2 rounded-10 border border-card-border-base bg-card-background-base p-12 text-left hover:bg-card-background-lvl-2 focus-visible:ring-2 focus-visible:ring-primary-focus-visible focus-visible:outline-none aria-pressed:border-primary-main"
|
|
25
|
+
>
|
|
26
|
+
<Typography
|
|
27
|
+
variant="body-small-high"
|
|
28
|
+
fontWeight="medium"
|
|
29
|
+
className="line-clamp-1"
|
|
30
|
+
asChild
|
|
31
|
+
>
|
|
32
|
+
<span>{stay.name}</span>
|
|
33
|
+
</Typography>
|
|
34
|
+
<Typography variant="caption-md" className="line-clamp-1 text-text-secondary" asChild>
|
|
35
|
+
<span>{stay.pin ? stay.area : `${stay.area} · Not on the map`}</span>
|
|
36
|
+
</Typography>
|
|
37
|
+
<Typography variant="caption-md" className="text-text-secondary" asChild>
|
|
38
|
+
<span>
|
|
39
|
+
{stay.pricePerNight} avg / night · {stay.total} total
|
|
40
|
+
</span>
|
|
41
|
+
</Typography>
|
|
42
|
+
</button>
|
|
43
|
+
</li>
|
|
44
|
+
))}
|
|
45
|
+
</ul>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// The strip scrolls sideways by itself; only the column needs a scroll area to stay in its row.
|
|
49
|
+
return isFloating ? list : <ScrollArea className="h-full">{list}</ScrollArea>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Button, Typography } from '@swisper.ai/ui';
|
|
2
|
+
|
|
3
|
+
import type { Stay } from './types';
|
|
4
|
+
|
|
5
|
+
export interface StayMapProps {
|
|
6
|
+
stays: Stay[];
|
|
7
|
+
selectedId: string | null;
|
|
8
|
+
onOpen: (stayId: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Stands in for the map: one price pin per property that has a location, and a note for the rest. */
|
|
12
|
+
export function StayMap({ stays, selectedId, onOpen }: StayMapProps) {
|
|
13
|
+
const unpinnedCount = stays.filter((stay) => stay.pin === null).length;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className="relative h-full w-full overflow-hidden rounded-10 bg-card-background-lvl-2">
|
|
17
|
+
{stays.map(
|
|
18
|
+
(stay) =>
|
|
19
|
+
stay.pin && (
|
|
20
|
+
<Button
|
|
21
|
+
key={stay.id}
|
|
22
|
+
size="sm"
|
|
23
|
+
variant={stay.id === selectedId ? 'primary' : 'secondary'}
|
|
24
|
+
aria-label={`${stay.name}, ${stay.pricePerNight} avg / night`}
|
|
25
|
+
className="absolute"
|
|
26
|
+
style={{ left: `${stay.pin.left}%`, top: `${stay.pin.top}%` }}
|
|
27
|
+
onClick={() => onOpen(stay.id)}
|
|
28
|
+
>
|
|
29
|
+
{stay.pricePerNight}
|
|
30
|
+
</Button>
|
|
31
|
+
),
|
|
32
|
+
)}
|
|
33
|
+
|
|
34
|
+
{unpinnedCount > 0 && (
|
|
35
|
+
<Typography
|
|
36
|
+
variant="caption-md"
|
|
37
|
+
className="absolute top-10 left-10 rounded-10 bg-global-bg/90 px-10 py-4 text-text-secondary"
|
|
38
|
+
>
|
|
39
|
+
{unpinnedCount} of these {unpinnedCount === 1 ? 'has' : 'have'} no map location
|
|
40
|
+
</Typography>
|
|
41
|
+
)}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Button, ScrollArea, Typography } from '@swisper.ai/ui';
|
|
2
|
+
|
|
3
|
+
import type { RoomRate, Stay } from './types';
|
|
4
|
+
|
|
5
|
+
export interface StayRoomsProps {
|
|
6
|
+
stay: Stay;
|
|
7
|
+
rates: RoomRate[];
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The view the Panel holds: every rate of the open property, and the control that closes the Panel. */
|
|
12
|
+
export function StayRooms({ stay, rates, onBack }: StayRoomsProps) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="flex h-full min-h-0 flex-col gap-12 rounded-10 border border-card-border-base bg-card-background-base p-12 shadow-md">
|
|
15
|
+
<div className="flex items-center justify-between gap-12">
|
|
16
|
+
<Typography variant="body-medium" fontWeight="semibold" asChild>
|
|
17
|
+
<h3 className="line-clamp-1 min-w-0">Rooms at {stay.name}</h3>
|
|
18
|
+
</Typography>
|
|
19
|
+
<Button variant="tertiary" size="sm" className="shrink-0" onClick={onBack}>
|
|
20
|
+
Back to the property
|
|
21
|
+
</Button>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<ScrollArea className="min-h-0 flex-1">
|
|
25
|
+
<ul className="flex flex-col gap-8">
|
|
26
|
+
{rates.map((rate) => (
|
|
27
|
+
<li
|
|
28
|
+
key={rate.id}
|
|
29
|
+
className="flex items-start justify-between gap-12 rounded-10 border border-card-border-base p-12"
|
|
30
|
+
>
|
|
31
|
+
<div className="flex min-w-0 flex-col gap-2">
|
|
32
|
+
<Typography variant="body-small-high" fontWeight="medium">
|
|
33
|
+
{rate.room}
|
|
34
|
+
</Typography>
|
|
35
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
36
|
+
{rate.bedding}
|
|
37
|
+
</Typography>
|
|
38
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
39
|
+
{rate.cancellation}
|
|
40
|
+
</Typography>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="flex shrink-0 flex-col items-end gap-2">
|
|
43
|
+
<Typography variant="body-small-high" fontWeight="semibold">
|
|
44
|
+
{rate.pricePerNight} avg / night
|
|
45
|
+
</Typography>
|
|
46
|
+
<Typography variant="caption-md" className="text-text-secondary">
|
|
47
|
+
{rate.total} total
|
|
48
|
+
</Typography>
|
|
49
|
+
{rate.roomsLeft !== null && (
|
|
50
|
+
<Typography variant="caption-md" className="text-text-tertiary">
|
|
51
|
+
{rate.roomsLeft} left
|
|
52
|
+
</Typography>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
</li>
|
|
56
|
+
))}
|
|
57
|
+
</ul>
|
|
58
|
+
</ScrollArea>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Where a stay's price pin sits on the map stand-in, in percent of the map's box. */
|
|
2
|
+
export interface StayPin {
|
|
3
|
+
left: number;
|
|
4
|
+
top: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** One property of an accommodation search, trimmed to what the list, the map and Details render. */
|
|
8
|
+
export interface Stay {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
area: string;
|
|
12
|
+
pricePerNight: string;
|
|
13
|
+
total: string;
|
|
14
|
+
nights: number;
|
|
15
|
+
description: string;
|
|
16
|
+
amenities: string[];
|
|
17
|
+
checkIn: string;
|
|
18
|
+
checkOut: string;
|
|
19
|
+
room: string;
|
|
20
|
+
cancellation: string;
|
|
21
|
+
/** `null` when the property has no map location, so it gets a row but no pin. */
|
|
22
|
+
pin: StayPin | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** One bookable rate of a property, as the rooms view lists it. */
|
|
26
|
+
export interface RoomRate {
|
|
27
|
+
id: string;
|
|
28
|
+
room: string;
|
|
29
|
+
bedding: string;
|
|
30
|
+
cancellation: string;
|
|
31
|
+
pricePerNight: string;
|
|
32
|
+
total: string;
|
|
33
|
+
/** `null` when the supplier does not say how many are left. */
|
|
34
|
+
roomsLeft: number | null;
|
|
35
|
+
}
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
"$schema": "../../../../int-eslint-config/schemas/component.schema.json",
|
|
3
3
|
"component": "chat-card-three-column-layout",
|
|
4
4
|
"purpose": "Responsive three-pane body for a chat card: List (a fixed column, or a strip floating over Main), Main (flexible), Details (its own right column, or floating over Main), plus an optional Panel that covers everything but the List column while Main and Details stay mounted. Panes switch on the layout's own measured width. Parts: ChatCardThreeColumnLayout, ChatCardThreeColumnLayoutList, ChatCardThreeColumnLayoutMain, ChatCardThreeColumnLayoutDetails, ChatCardThreeColumnLayoutPanel, plus chatCardThreeColumnLayoutCardVariants for the wrapping ChatCard.",
|
|
5
|
+
"anatomy": [
|
|
6
|
+
"import {",
|
|
7
|
+
" ChatCardThreeColumnLayout,",
|
|
8
|
+
" ChatCardThreeColumnLayoutList,",
|
|
9
|
+
" ChatCardThreeColumnLayoutMain,",
|
|
10
|
+
" ChatCardThreeColumnLayoutDetails,",
|
|
11
|
+
" ChatCardThreeColumnLayoutPanel,",
|
|
12
|
+
"} from '@swisper.ai/web-chat-ui';",
|
|
13
|
+
"",
|
|
14
|
+
"<ChatCardThreeColumnLayout>",
|
|
15
|
+
" <ChatCardThreeColumnLayoutList />",
|
|
16
|
+
" <ChatCardThreeColumnLayoutMain />",
|
|
17
|
+
" <ChatCardThreeColumnLayoutDetails />",
|
|
18
|
+
" <ChatCardThreeColumnLayoutPanel />",
|
|
19
|
+
"</ChatCardThreeColumnLayout>"
|
|
20
|
+
],
|
|
5
21
|
"useWhen": [
|
|
6
22
|
"A chat card shaped like \"a collection + a canvas + a selected item\", e.g. places on a map, or rows next to a chart with a detail pane",
|
|
7
23
|
"The list must stay usable on a narrow card as a strip over the canvas, and the selected item must float over it or become a bottom sheet",
|