@swisper.ai/web-chat-ui 0.0.2
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/LICENSE +202 -0
- package/README.md +251 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts +64 -0
- package/dist/components/canvas-shell/canvas-shell.d.ts.map +1 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts +26 -0
- package/dist/components/canvas-shell/canvas-shell.stories.d.ts.map +1 -0
- package/dist/components/canvas-shell/index.d.ts +2 -0
- package/dist/components/canvas-shell/index.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts +21 -0
- package/dist/components/card-item-picker/card-item-picker-context.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts +24 -0
- package/dist/components/card-item-picker/card-item-picker-list.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts +28 -0
- package/dist/components/card-item-picker/card-item-picker-row-parts.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts +12 -0
- package/dist/components/card-item-picker/card-item-picker-row.d.ts.map +1 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts +19 -0
- package/dist/components/card-item-picker/card-item-picker.stories.d.ts.map +1 -0
- package/dist/components/card-item-picker/index.d.ts +9 -0
- package/dist/components/card-item-picker/index.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.d.ts +4 -0
- package/dist/components/chat-card/chat-card.d.ts.map +1 -0
- package/dist/components/chat-card/chat-card.stories.d.ts +11 -0
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts +22 -0
- package/dist/components/chat-card/components/chat-card-body.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts +20 -0
- package/dist/components/chat-card/components/chat-card-footer.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts +28 -0
- package/dist/components/chat-card/components/chat-card-form.d.ts.map +1 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts +36 -0
- package/dist/components/chat-card/components/chat-card-header.d.ts.map +1 -0
- package/dist/components/chat-card/components/index.d.ts +5 -0
- package/dist/components/chat-card/components/index.d.ts.map +1 -0
- package/dist/components/chat-card/context.d.ts +13 -0
- package/dist/components/chat-card/context.d.ts.map +1 -0
- package/dist/components/chat-card/contexts.d.ts +16 -0
- package/dist/components/chat-card/contexts.d.ts.map +1 -0
- package/dist/components/chat-card/hooks.d.ts +13 -0
- package/dist/components/chat-card/hooks.d.ts.map +1 -0
- package/dist/components/chat-card/index.d.ts +6 -0
- package/dist/components/chat-card/index.d.ts.map +1 -0
- package/dist/components/chat-card/types.d.ts +21 -0
- package/dist/components/chat-card/types.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts +43 -0
- package/dist/components/chat-card-container/chat-card-container.d.ts.map +1 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts +17 -0
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -0
- package/dist/components/chat-card-container/index.d.ts +3 -0
- package/dist/components/chat-card-container/index.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.d.ts +51 -0
- package/dist/components/chat-container/chat-container.d.ts.map +1 -0
- package/dist/components/chat-container/chat-container.stories.d.ts +21 -0
- package/dist/components/chat-container/chat-container.stories.d.ts.map +1 -0
- package/dist/components/chat-container/index.d.ts +3 -0
- package/dist/components/chat-container/index.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.d.ts +35 -0
- package/dist/components/chat-input/chat-input.d.ts.map +1 -0
- package/dist/components/chat-input/chat-input.stories.d.ts +14 -0
- package/dist/components/chat-input/chat-input.stories.d.ts.map +1 -0
- package/dist/components/chat-input/index.d.ts +3 -0
- package/dist/components/chat-input/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts +8 -0
- package/dist/components/chat-input/plugins/auto-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts +7 -0
- package/dist/components/chat-input/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/has-value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/hooks.d.ts +2 -0
- package/dist/components/chat-input/plugins/hooks.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/index.d.ts +8 -0
- package/dist/components/chat-input/plugins/index.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/chat-input/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/utils.d.ts +4 -0
- package/dist/components/chat-input/plugins/utils.d.ts.map +1 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts +6 -0
- package/dist/components/chat-input/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/chat-input/transformers.d.ts +3 -0
- package/dist/components/chat-input/transformers.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-item.d.ts +8 -0
- package/dist/components/chat-list/chat-list-item.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list-items.d.ts +11 -0
- package/dist/components/chat-list/chat-list-items.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.d.ts +63 -0
- package/dist/components/chat-list/chat-list.d.ts.map +1 -0
- package/dist/components/chat-list/chat-list.stories.d.ts +13 -0
- package/dist/components/chat-list/chat-list.stories.d.ts.map +1 -0
- package/dist/components/chat-list/index.d.ts +4 -0
- package/dist/components/chat-list/index.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.d.ts +17 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -0
- package/dist/components/chat-message/chat-message.stories.d.ts +11 -0
- package/dist/components/chat-message/chat-message.stories.d.ts.map +1 -0
- package/dist/components/chat-message/index.d.ts +2 -0
- package/dist/components/chat-message/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts +9 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card-icon.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts +30 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts +11 -0
- package/dist/components/chat-message-attachment-card/chat-message-attachment-card.stories.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/index.d.ts +4 -0
- package/dist/components/chat-message-attachment-card/index.d.ts.map +1 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts +5 -0
- package/dist/components/chat-message-attachment-card/utils.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts +48 -0
- package/dist/components/chat-message-history/chat-message-history.d.ts.map +1 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts +7 -0
- package/dist/components/chat-message-history/chat-message-history.stories.d.ts.map +1 -0
- package/dist/components/chat-message-history/index.d.ts +2 -0
- package/dist/components/chat-message-history/index.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.d.ts.map +1 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts +7 -0
- package/dist/components/chat-message-response/chat-message-response.stories.d.ts.map +1 -0
- package/dist/components/chat-message-response/index.d.ts +2 -0
- package/dist/components/chat-message-response/index.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts +25 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts +7 -0
- package/dist/components/chat-message-toolbar/chat-message-toolbar.stories.d.ts.map +1 -0
- package/dist/components/chat-message-toolbar/index.d.ts +2 -0
- package/dist/components/chat-message-toolbar/index.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.d.ts +24 -0
- package/dist/components/chat-messages/chat-messages.d.ts.map +1 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts +8 -0
- package/dist/components/chat-messages/chat-messages.stories.d.ts.map +1 -0
- package/dist/components/chat-messages/index.d.ts +2 -0
- package/dist/components/chat-messages/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts +114 -0
- package/dist/components/chat-notification-card/chat-notification-card.d.ts.map +1 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts +10 -0
- package/dist/components/chat-notification-card/chat-notification-card.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-card/index.d.ts +4 -0
- package/dist/components/chat-notification-card/index.d.ts.map +1 -0
- package/dist/components/chat-notification-card/types.d.ts +2 -0
- package/dist/components/chat-notification-card/types.d.ts.map +1 -0
- package/dist/components/chat-notification-card/utils.d.ts +3 -0
- package/dist/components/chat-notification-card/utils.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts +12 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts +8 -0
- package/dist/components/chat-notification-popup/chat-notification-popup.stories.d.ts.map +1 -0
- package/dist/components/chat-notification-popup/index.d.ts +2 -0
- package/dist/components/chat-notification-popup/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts +17 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts +2 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-focus-plugin.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +27 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts +9 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/index.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.d.ts +23 -0
- package/dist/components/chat-reply/chat-reply.d.ts.map +1 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts +7 -0
- package/dist/components/chat-reply/chat-reply.stories.d.ts.map +1 -0
- package/dist/components/chat-reply/index.d.ts +2 -0
- package/dist/components/chat-reply/index.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts +37 -0
- package/dist/components/chat-suggestion/chat-suggestion.d.ts.map +1 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts +9 -0
- package/dist/components/chat-suggestion/chat-suggestion.stories.d.ts.map +1 -0
- package/dist/components/chat-suggestion/index.d.ts +2 -0
- package/dist/components/chat-suggestion/index.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts +47 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts +10 -0
- package/dist/components/chat-thinking-process/chat-thinking-process.stories.d.ts.map +1 -0
- package/dist/components/chat-thinking-process/index.d.ts +2 -0
- package/dist/components/chat-thinking-process/index.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.d.ts +78 -0
- package/dist/components/chat-thread/chat-thread.d.ts.map +1 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts +14 -0
- package/dist/components/chat-thread/chat-thread.stories.d.ts.map +1 -0
- package/dist/components/chat-thread/index.d.ts +2 -0
- package/dist/components/chat-thread/index.d.ts.map +1 -0
- package/dist/components/deprecated-empty-state.d.ts +22 -0
- package/dist/components/deprecated-empty-state.d.ts.map +1 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/hooks.d.ts +9 -0
- package/dist/components/markdown-viewer/hooks.d.ts.map +1 -0
- package/dist/components/markdown-viewer/index.d.ts +3 -0
- package/dist/components/markdown-viewer/index.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts +10 -0
- package/dist/components/markdown-viewer/markdown-viewer.d.ts.map +1 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts +9 -0
- package/dist/components/markdown-viewer/markdown-viewer.stories.d.ts.map +1 -0
- package/dist/components/markdown-viewer/types.d.ts +9 -0
- package/dist/components/markdown-viewer/types.d.ts.map +1 -0
- package/dist/components/markdown-viewer/utils.d.ts +3 -0
- package/dist/components/markdown-viewer/utils.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/index.d.ts +2 -0
- package/dist/components/new-chat-trigger/index.d.ts.map +1 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts +8 -0
- package/dist/components/new-chat-trigger/new-chat-trigger.d.ts.map +1 -0
- package/dist/components/rich-text-area/constants/index.d.ts +3 -0
- package/dist/components/rich-text-area/constants/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/hooks.d.ts +3 -0
- package/dist/components/rich-text-area/hooks.d.ts.map +1 -0
- package/dist/components/rich-text-area/html-config.d.ts +4 -0
- package/dist/components/rich-text-area/html-config.d.ts.map +1 -0
- package/dist/components/rich-text-area/index.d.ts +7 -0
- package/dist/components/rich-text-area/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts +18 -0
- package/dist/components/rich-text-area/nodes/div-block-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts +24 -0
- package/dist/components/rich-text-area/nodes/image-node.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/blur-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/controlled-value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/disabled-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts +10 -0
- package/dist/components/rich-text-area/plugins/file-attachment-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts +6 -0
- package/dist/components/rich-text-area/plugins/focus-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts +19 -0
- package/dist/components/rich-text-area/plugins/html-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts +12 -0
- package/dist/components/rich-text-area/plugins/image-drop-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/index.d.ts +11 -0
- package/dist/components/rich-text-area/plugins/index.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts +2 -0
- package/dist/components/rich-text-area/plugins/markdown-plain-paste-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts +7 -0
- package/dist/components/rich-text-area/plugins/value-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts +20 -0
- package/dist/components/rich-text-area/rich-text-area.d.ts.map +1 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts +7 -0
- package/dist/components/rich-text-area/rich-text-area.stories.d.ts.map +1 -0
- package/dist/components/rich-text-area/styled.d.ts +3 -0
- package/dist/components/rich-text-area/styled.d.ts.map +1 -0
- package/dist/components/rich-text-area/transformers.d.ts +16 -0
- package/dist/components/rich-text-area/transformers.d.ts.map +1 -0
- package/dist/components/rich-text-area/types.d.ts +8 -0
- package/dist/components/rich-text-area/types.d.ts.map +1 -0
- package/dist/components/rich-text-area/utils/index.d.ts +6 -0
- package/dist/components/rich-text-area/utils/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/alignment-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/attachment-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/bold-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/clean-format-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts +11 -0
- package/dist/components/rich-text-field/components/formatting-toolbar-plugin.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/image-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/image-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/index.d.ts +14 -0
- package/dist/components/rich-text-field/components/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/italic-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/link-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/link-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/size-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/size-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/text-color-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts +6 -0
- package/dist/components/rich-text-field/components/toolbar-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/toolbar-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts +5 -0
- package/dist/components/rich-text-field/components/typography-select.d.ts.map +1 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts +3 -0
- package/dist/components/rich-text-field/components/underline-button.d.ts.map +1 -0
- package/dist/components/rich-text-field/constants.d.ts +57 -0
- package/dist/components/rich-text-field/constants.d.ts.map +1 -0
- package/dist/components/rich-text-field/context.d.ts +26 -0
- package/dist/components/rich-text-field/context.d.ts.map +1 -0
- package/dist/components/rich-text-field/index.d.ts +3 -0
- package/dist/components/rich-text-field/index.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts +17 -0
- package/dist/components/rich-text-field/rich-text-field.d.ts.map +1 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts +10 -0
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -0
- package/dist/components/rich-text-field/utils.d.ts +1759 -0
- package/dist/components/rich-text-field/utils.d.ts.map +1 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.d.ts.map +1 -0
- package/dist/components/spinner/spinner.d.ts +9 -0
- package/dist/components/spinner/spinner.d.ts.map +1 -0
- package/dist/components/spinner/spinner.stories.d.ts +8 -0
- package/dist/components/spinner/spinner.stories.d.ts.map +1 -0
- package/dist/contexts/chat-context/chat-context.d.ts +20 -0
- package/dist/contexts/chat-context/chat-context.d.ts.map +1 -0
- package/dist/contexts/chat-context/index.d.ts +2 -0
- package/dist/contexts/chat-context/index.d.ts.map +1 -0
- package/dist/contexts/chat-context/utils.d.ts +3 -0
- package/dist/contexts/chat-context/utils.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts +20 -0
- package/dist/contexts/chat-conversation-context/chat-conversation-context.d.ts.map +1 -0
- package/dist/contexts/chat-conversation-context/index.d.ts +2 -0
- package/dist/contexts/chat-conversation-context/index.d.ts.map +1 -0
- package/dist/contexts/index.d.ts +3 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/docs/agent.stories.d.ts +41 -0
- package/dist/docs/agent.stories.d.ts.map +1 -0
- package/dist/docs/chat-panel.d.ts +33 -0
- package/dist/docs/chat-panel.d.ts.map +1 -0
- package/dist/docs/chatbot-panel.d.ts +20 -0
- package/dist/docs/chatbot-panel.d.ts.map +1 -0
- package/dist/docs/chatbot.stories.d.ts +11 -0
- package/dist/docs/chatbot.stories.d.ts.map +1 -0
- package/dist/domain/actions/constants.d.ts +2 -0
- package/dist/domain/actions/constants.d.ts.map +1 -0
- package/dist/domain/actions/hooks/index.d.ts +3 -0
- package/dist/domain/actions/hooks/index.d.ts.map +1 -0
- package/dist/domain/actions/index.d.ts +5 -0
- package/dist/domain/actions/index.d.ts.map +1 -0
- package/dist/domain/actions/types.d.ts +7 -0
- package/dist/domain/actions/types.d.ts.map +1 -0
- package/dist/domain/actions/utils/index.d.ts +11 -0
- package/dist/domain/actions/utils/index.d.ts.map +1 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts +6 -0
- package/dist/hooks/use-chat-prompt-placeholder.d.ts.map +1 -0
- package/dist/hooks/use-chat-stream-message.d.ts +42 -0
- package/dist/hooks/use-chat-stream-message.d.ts.map +1 -0
- package/dist/hooks/use-current-chat-id.d.ts +2 -0
- package/dist/hooks/use-current-chat-id.d.ts.map +1 -0
- package/dist/hooks/use-is-current-chat-new.d.ts +2 -0
- package/dist/hooks/use-is-current-chat-new.d.ts.map +1 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts +9 -0
- package/dist/hooks/use-loaded-chat-ids.d.ts.map +1 -0
- package/dist/hooks/use-on-chat-changed.d.ts +9 -0
- package/dist/hooks/use-on-chat-changed.d.ts.map +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +4404 -0
- package/dist/index.es.js.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +95 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +24 -0
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts +3 -0
- package/dist/layouts/chat-card-list-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +84 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +45 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +37 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +81 -0
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts +5 -0
- package/dist/layouts/chat-card-three-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +31 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts +12 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +19 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts +35 -0
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts.map +1 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts +4 -0
- package/dist/layouts/chat-card-two-column-layout/index.d.ts.map +1 -0
- package/dist/layouts/index.d.ts +4 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/use-streaming-markdown.d.ts +18 -0
- package/dist/utils/use-streaming-markdown.d.ts.map +1 -0
- package/package.json +155 -0
- package/src/__tests__/setup.ts +5 -0
- package/src/components/canvas-shell/canvas-shell.json +126 -0
- package/src/components/canvas-shell/canvas-shell.stories.tsx +194 -0
- package/src/components/canvas-shell/canvas-shell.test.tsx +205 -0
- package/src/components/canvas-shell/canvas-shell.tsx +250 -0
- package/src/components/canvas-shell/index.ts +19 -0
- package/src/components/card-item-picker/__tests__/card-item-picker.spec.tsx +279 -0
- package/src/components/card-item-picker/card-item-picker-context.tsx +44 -0
- package/src/components/card-item-picker/card-item-picker-list.tsx +95 -0
- package/src/components/card-item-picker/card-item-picker-row-parts.tsx +96 -0
- package/src/components/card-item-picker/card-item-picker-row.tsx +109 -0
- package/src/components/card-item-picker/card-item-picker.json +147 -0
- package/src/components/card-item-picker/card-item-picker.stories.tsx +158 -0
- package/src/components/card-item-picker/index.ts +24 -0
- package/src/components/chat-card/__tests__/chat-card.spec.tsx +118 -0
- package/src/components/chat-card/chat-card.json +162 -0
- package/src/components/chat-card/chat-card.stories.tsx +349 -0
- package/src/components/chat-card/chat-card.tsx +106 -0
- package/src/components/chat-card/components/chat-card-body.tsx +115 -0
- package/src/components/chat-card/components/chat-card-footer.tsx +95 -0
- package/src/components/chat-card/components/chat-card-form.tsx +120 -0
- package/src/components/chat-card/components/chat-card-header.tsx +240 -0
- package/src/components/chat-card/components/index.ts +4 -0
- package/src/components/chat-card/context.tsx +34 -0
- package/src/components/chat-card/contexts.tsx +42 -0
- package/src/components/chat-card/hooks.ts +51 -0
- package/src/components/chat-card/index.ts +5 -0
- package/src/components/chat-card/types.ts +23 -0
- package/src/components/chat-card-container/chat-card-container.json +84 -0
- package/src/components/chat-card-container/chat-card-container.stories.tsx +149 -0
- package/src/components/chat-card-container/chat-card-container.tsx +75 -0
- package/src/components/chat-card-container/index.ts +2 -0
- package/src/components/chat-container/chat-container.json +93 -0
- package/src/components/chat-container/chat-container.stories.tsx +179 -0
- package/src/components/chat-container/chat-container.tsx +231 -0
- package/src/components/chat-container/index.ts +2 -0
- package/src/components/chat-input/chat-input.json +106 -0
- package/src/components/chat-input/chat-input.stories.tsx +291 -0
- package/src/components/chat-input/chat-input.tsx +220 -0
- package/src/components/chat-input/index.ts +2 -0
- package/src/components/chat-input/plugins/auto-focus-plugin.tsx +43 -0
- package/src/components/chat-input/plugins/controlled-value-plugin.tsx +47 -0
- package/src/components/chat-input/plugins/disabled-plugin.tsx +18 -0
- package/src/components/chat-input/plugins/focus-plugin.tsx +44 -0
- package/src/components/chat-input/plugins/has-value-plugin.tsx +51 -0
- package/src/components/chat-input/plugins/hooks.ts +7 -0
- package/src/components/chat-input/plugins/index.ts +7 -0
- package/src/components/chat-input/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/chat-input/plugins/utils.ts +48 -0
- package/src/components/chat-input/plugins/value-plugin.tsx +35 -0
- package/src/components/chat-input/transformers.ts +4 -0
- package/src/components/chat-list/chat-list-item.tsx +33 -0
- package/src/components/chat-list/chat-list-items.tsx +144 -0
- package/src/components/chat-list/chat-list.json +117 -0
- package/src/components/chat-list/chat-list.stories.tsx +332 -0
- package/src/components/chat-list/chat-list.tsx +278 -0
- package/src/components/chat-list/index.ts +18 -0
- package/src/components/chat-message/chat-message.json +105 -0
- package/src/components/chat-message/chat-message.stories.tsx +95 -0
- package/src/components/chat-message/chat-message.tsx +66 -0
- package/src/components/chat-message/index.ts +1 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card-icon.tsx +74 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.json +110 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.stories.tsx +131 -0
- package/src/components/chat-message-attachment-card/chat-message-attachment-card.tsx +142 -0
- package/src/components/chat-message-attachment-card/index.ts +12 -0
- package/src/components/chat-message-attachment-card/utils.ts +41 -0
- package/src/components/chat-message-history/chat-message-history.json +99 -0
- package/src/components/chat-message-history/chat-message-history.stories.tsx +136 -0
- package/src/components/chat-message-history/chat-message-history.tsx +277 -0
- package/src/components/chat-message-history/index.ts +13 -0
- package/src/components/chat-message-response/chat-message-response.json +68 -0
- package/src/components/chat-message-response/chat-message-response.stories.tsx +63 -0
- package/src/components/chat-message-response/chat-message-response.tsx +24 -0
- package/src/components/chat-message-response/index.ts +1 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.json +100 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.stories.tsx +62 -0
- package/src/components/chat-message-toolbar/chat-message-toolbar.tsx +97 -0
- package/src/components/chat-message-toolbar/index.ts +6 -0
- package/src/components/chat-messages/chat-messages.json +95 -0
- package/src/components/chat-messages/chat-messages.stories.tsx +284 -0
- package/src/components/chat-messages/chat-messages.tsx +264 -0
- package/src/components/chat-messages/index.ts +10 -0
- package/src/components/chat-notification-card/chat-notification-card.json +135 -0
- package/src/components/chat-notification-card/chat-notification-card.stories.tsx +290 -0
- package/src/components/chat-notification-card/chat-notification-card.tsx +684 -0
- package/src/components/chat-notification-card/index.ts +3 -0
- package/src/components/chat-notification-card/types.ts +1 -0
- package/src/components/chat-notification-card/utils.ts +34 -0
- package/src/components/chat-notification-popup/chat-notification-popup.json +97 -0
- package/src/components/chat-notification-popup/chat-notification-popup.stories.tsx +80 -0
- package/src/components/chat-notification-popup/chat-notification-popup.tsx +36 -0
- package/src/components/chat-notification-popup/index.ts +1 -0
- package/src/components/chat-prompt-box/chat-prompt-box-context.tsx +62 -0
- package/src/components/chat-prompt-box/chat-prompt-box-focus-plugin.tsx +22 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +106 -0
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +117 -0
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +296 -0
- package/src/components/chat-prompt-box/index.ts +16 -0
- package/src/components/chat-reply/chat-reply.json +79 -0
- package/src/components/chat-reply/chat-reply.stories.tsx +72 -0
- package/src/components/chat-reply/chat-reply.tsx +103 -0
- package/src/components/chat-reply/index.ts +1 -0
- package/src/components/chat-suggestion/chat-suggestion.json +108 -0
- package/src/components/chat-suggestion/chat-suggestion.stories.tsx +147 -0
- package/src/components/chat-suggestion/chat-suggestion.tsx +184 -0
- package/src/components/chat-suggestion/index.ts +8 -0
- package/src/components/chat-thinking-process/chat-thinking-process.json +110 -0
- package/src/components/chat-thinking-process/chat-thinking-process.stories.tsx +202 -0
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +268 -0
- package/src/components/chat-thinking-process/index.ts +9 -0
- package/src/components/chat-thread/__tests__/chat-thread.spec.tsx +385 -0
- package/src/components/chat-thread/chat-thread.json +120 -0
- package/src/components/chat-thread/chat-thread.stories.tsx +218 -0
- package/src/components/chat-thread/chat-thread.tsx +549 -0
- package/src/components/chat-thread/index.ts +18 -0
- package/src/components/deprecated-empty-state.ts +39 -0
- package/src/components/index.ts +26 -0
- package/src/components/markdown-viewer/hooks.ts +59 -0
- package/src/components/markdown-viewer/index.ts +2 -0
- package/src/components/markdown-viewer/markdown-viewer.json +84 -0
- package/src/components/markdown-viewer/markdown-viewer.stories.tsx +110 -0
- package/src/components/markdown-viewer/markdown-viewer.tsx +95 -0
- package/src/components/markdown-viewer/types.ts +10 -0
- package/src/components/markdown-viewer/utils.ts +5 -0
- package/src/components/new-chat-trigger/index.ts +1 -0
- package/src/components/new-chat-trigger/new-chat-trigger.tsx +29 -0
- package/src/components/rich-text-area/constants/index.ts +10 -0
- package/src/components/rich-text-area/hooks.ts +24 -0
- package/src/components/rich-text-area/html-config.ts +195 -0
- package/src/components/rich-text-area/index.ts +6 -0
- package/src/components/rich-text-area/nodes/div-block-node.tsx +145 -0
- package/src/components/rich-text-area/nodes/image-node.tsx +100 -0
- package/src/components/rich-text-area/plugins/blur-plugin.tsx +36 -0
- package/src/components/rich-text-area/plugins/controlled-plugin.tsx +23 -0
- package/src/components/rich-text-area/plugins/controlled-value-plugin.tsx +101 -0
- package/src/components/rich-text-area/plugins/disabled-plugin.tsx +17 -0
- package/src/components/rich-text-area/plugins/file-attachment-plugin.tsx +57 -0
- package/src/components/rich-text-area/plugins/focus-plugin.tsx +44 -0
- package/src/components/rich-text-area/plugins/html-paste-plugin.tsx +104 -0
- package/src/components/rich-text-area/plugins/image-drop-plugin.tsx +56 -0
- package/src/components/rich-text-area/plugins/index.ts +10 -0
- package/src/components/rich-text-area/plugins/markdown-plain-paste-plugin.tsx +63 -0
- package/src/components/rich-text-area/plugins/value-plugin.tsx +46 -0
- package/src/components/rich-text-area/rich-text-area.json +102 -0
- package/src/components/rich-text-area/rich-text-area.stories.tsx +140 -0
- package/src/components/rich-text-area/rich-text-area.tsx +156 -0
- package/src/components/rich-text-area/styled.tsx +20 -0
- package/src/components/rich-text-area/transformers.ts +175 -0
- package/src/components/rich-text-area/types.ts +8 -0
- package/src/components/rich-text-area/utils/index.ts +77 -0
- package/src/components/rich-text-field/components/alignment-select.tsx +103 -0
- package/src/components/rich-text-field/components/attachment-button.tsx +25 -0
- package/src/components/rich-text-field/components/bold-button.tsx +21 -0
- package/src/components/rich-text-field/components/clean-format-button.tsx +44 -0
- package/src/components/rich-text-field/components/formatting-toolbar-plugin.tsx +69 -0
- package/src/components/rich-text-field/components/image-button.tsx +11 -0
- package/src/components/rich-text-field/components/index.ts +14 -0
- package/src/components/rich-text-field/components/italic-button.tsx +21 -0
- package/src/components/rich-text-field/components/link-button.tsx +11 -0
- package/src/components/rich-text-field/components/size-select.tsx +27 -0
- package/src/components/rich-text-field/components/text-color-button.tsx +41 -0
- package/src/components/rich-text-field/components/toolbar-button.tsx +27 -0
- package/src/components/rich-text-field/components/toolbar-select.tsx +19 -0
- package/src/components/rich-text-field/components/typography-select.tsx +27 -0
- package/src/components/rich-text-field/components/underline-button.tsx +21 -0
- package/src/components/rich-text-field/constants.ts +33 -0
- package/src/components/rich-text-field/context.tsx +251 -0
- package/src/components/rich-text-field/index.tsx +6 -0
- package/src/components/rich-text-field/rich-text-field.json +118 -0
- package/src/components/rich-text-field/rich-text-field.stories.tsx +218 -0
- package/src/components/rich-text-field/rich-text-field.tsx +93 -0
- package/src/components/rich-text-field/utils.ts +532 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/spinner/spinner.json +73 -0
- package/src/components/spinner/spinner.stories.tsx +41 -0
- package/src/components/spinner/spinner.tsx +32 -0
- package/src/contexts/chat-context/chat-context.tsx +97 -0
- package/src/contexts/chat-context/index.ts +1 -0
- package/src/contexts/chat-context/utils.ts +7 -0
- package/src/contexts/chat-conversation-context/chat-conversation-context.tsx +608 -0
- package/src/contexts/chat-conversation-context/index.ts +1 -0
- package/src/contexts/index.ts +2 -0
- package/src/docs/agent.stories.tsx +567 -0
- package/src/docs/chat-panel.tsx +174 -0
- package/src/docs/chatbot-panel.tsx +381 -0
- package/src/docs/chatbot.mdx +144 -0
- package/src/docs/chatbot.stories.tsx +63 -0
- package/src/domain/actions/constants.ts +1 -0
- package/src/domain/actions/hooks/index.ts +22 -0
- package/src/domain/actions/index.ts +4 -0
- package/src/domain/actions/types.ts +6 -0
- package/src/domain/actions/utils/index.ts +112 -0
- package/src/domain/index.ts +1 -0
- package/src/hooks/index.tsx +10 -0
- package/src/hooks/use-chat-prompt-placeholder.ts +7 -0
- package/src/hooks/use-chat-stream-message.ts +189 -0
- package/src/hooks/use-current-chat-id.ts +6 -0
- package/src/hooks/use-is-current-chat-new.ts +6 -0
- package/src/hooks/use-loaded-chat-ids.ts +32 -0
- package/src/hooks/use-on-chat-changed.ts +33 -0
- package/src/index.css +1 -0
- package/src/index.ts +6 -0
- package/src/layouts/chat-card-list-layout/__tests__/chat-card-list-layout.spec.tsx +204 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +116 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +190 -0
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +250 -0
- package/src/layouts/chat-card-list-layout/index.ts +11 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +73 -0
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +282 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +131 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +78 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +273 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +291 -0
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +135 -0
- package/src/layouts/chat-card-three-column-layout/index.ts +24 -0
- package/src/layouts/chat-card-two-column-layout/__tests__/chat-card-two-column-layout.spec.tsx +109 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +97 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.ts +21 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +138 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +132 -0
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts +65 -0
- package/src/layouts/chat-card-two-column-layout/index.ts +17 -0
- package/src/layouts/index.ts +3 -0
- package/src/types.ts +29 -0
- package/src/utils/use-streaming-markdown.ts +113 -0
- package/tailwind.css +7 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '@swisper.ai/ui';
|
|
3
|
+
interface ChatCardListLayoutContextValue {
|
|
4
|
+
visibleCount: number;
|
|
5
|
+
isExpanded: boolean;
|
|
6
|
+
expand: () => void;
|
|
7
|
+
hiddenCount: number;
|
|
8
|
+
setHiddenCount: (count: number) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Reads the layout's state from any descendant.
|
|
12
|
+
*
|
|
13
|
+
* Exported so a consumer can put the hidden count in their own label ("Show 5 more") or
|
|
14
|
+
* build a trigger that isn't a `Button`. `hiddenCount` is `0` on the first render and
|
|
15
|
+
* correct from the first layout effect onwards — see `ChatCardListLayoutItems`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useChatCardListLayoutContext(): ChatCardListLayoutContextValue;
|
|
18
|
+
export interface ChatCardListLayoutProps extends ComponentProps<'div'> {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* How many items `ChatCardListLayoutItems` renders while collapsed.
|
|
22
|
+
*
|
|
23
|
+
* Clamped at zero: a negative value would reach `Array.slice` as a count from the end
|
|
24
|
+
* and quietly render the *last* n items, which is the opposite of what the caller
|
|
25
|
+
* asked for.
|
|
26
|
+
*/
|
|
27
|
+
visibleCount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Expanded state for the uncontrolled case. Set it when the surrounding message is
|
|
30
|
+
* restored from history and the reader had already expanded this list.
|
|
31
|
+
*/
|
|
32
|
+
defaultExpanded?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Controlled expanded state. Pass it only if something outside owns the state —
|
|
35
|
+
* driving it back to `false` re-collapses the list and brings the button back, which
|
|
36
|
+
* the uncontrolled component deliberately cannot do.
|
|
37
|
+
*/
|
|
38
|
+
expanded?: boolean;
|
|
39
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Holds a list of chat cards and reveals the overflow behind a one-way "show more".
|
|
44
|
+
*
|
|
45
|
+
* Structure and state only — the sole class it emits is the `group/chat-card-list-layout`
|
|
46
|
+
* marker, which paints nothing and exists so descendants can react to the expanded state
|
|
47
|
+
* with `group-data-[expanded=true]/chat-card-list-layout:…`. Direction, gap and every
|
|
48
|
+
* other visual decision come from the consumer's `className`, so the same layout serves
|
|
49
|
+
* a stacked card list and a horizontal strip without a variant prop.
|
|
50
|
+
*
|
|
51
|
+
* The three parts exist because the pieces of information live in different places: only
|
|
52
|
+
* `ChatCardListLayoutItems` knows how many children there are, only
|
|
53
|
+
* `ChatCardListLayoutShowMore` needs to know whether any are hidden, and this root owns
|
|
54
|
+
* the state that joins them. Slicing here instead would mean telling item children apart
|
|
55
|
+
* from the button by inspecting `child.type`, which breaks the moment either is wrapped.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ChatCardListLayout: import('react').ForwardRefExoticComponent<Omit<ChatCardListLayoutProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export interface ChatCardListLayoutItemsProps {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Renders the visible slice of the list, and nothing else — no wrapper element.
|
|
63
|
+
*
|
|
64
|
+
* A `div` here would sit between the root's `className` and the cards, so a consumer's
|
|
65
|
+
* `flex`/`grid` on the root would apply to this one wrapper instead of to the items and
|
|
66
|
+
* the layout would silently collapse to a single column. There is no `className` prop
|
|
67
|
+
* for the same reason: there is no node to hang it on.
|
|
68
|
+
*
|
|
69
|
+
* Hidden items are sliced away rather than hidden with CSS, so they never mount: no DOM,
|
|
70
|
+
* no image or data fetches from cards nobody has asked for, and nothing invisible in the
|
|
71
|
+
* tab order.
|
|
72
|
+
*
|
|
73
|
+
* Only one of these per layout. Two would race on `hiddenCount` and the last effect
|
|
74
|
+
* would win; summing across instances is buildable but nothing needs it yet.
|
|
75
|
+
*/
|
|
76
|
+
export declare function ChatCardListLayoutItems({ children }: ChatCardListLayoutItemsProps): import('react').JSX.Element;
|
|
77
|
+
export interface ChatCardListLayoutShowMoreProps extends Omit<ButtonProps, 'children'> {
|
|
78
|
+
/**
|
|
79
|
+
* The label. Required on purpose: a default `'Show more'` baked into the package would
|
|
80
|
+
* be untranslatable by the app that ships it, and this is the one string in the layout
|
|
81
|
+
* a reader actually sees.
|
|
82
|
+
*/
|
|
83
|
+
children: ReactNode;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The reveal trigger. Renders nothing once there is nothing left to reveal — either the
|
|
87
|
+
* list is expanded, or it never overflowed — which is what makes the button a one-shot
|
|
88
|
+
* affordance rather than a toggle.
|
|
89
|
+
*
|
|
90
|
+
* It sets no `variant`, `size` or `className` of its own so the design system's `Button`
|
|
91
|
+
* defaults apply untouched and a consumer's props are not fighting ours.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ChatCardListLayoutShowMore: import('react').ForwardRefExoticComponent<Omit<ChatCardListLayoutShowMoreProps, "ref"> & import('react').RefAttributes<HTMLButtonElement | HTMLSpanElement>>;
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=chat-card-list-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-list-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAanE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAalD,UAAU,8BAA8B;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAID;;;;;;GAMG;AACH,wBAAgB,4BAA4B,mCAY3C;AAED,MAAM,WAAW,uBAAwB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,iIA0D9B,CAAC;AAIF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,4BAA4B,+BAkBjF;AAED,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IACpF;;;;OAIG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,8JA+BrC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ChatCardListLayout } from './chat-card-list-layout';
|
|
3
|
+
declare const meta: Meta<typeof ChatCardListLayout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ChatCardListLayout>;
|
|
6
|
+
/**
|
|
7
|
+
* Eight cards, three shown. The stacking and the gap come from the `className` on the
|
|
8
|
+
* layout — it contributes no spacing of its own — and the five hidden cards are not in
|
|
9
|
+
* the DOM until the button is clicked.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
/**
|
|
13
|
+
* Two cards under a limit of three. The button is never rendered, so a short list carries
|
|
14
|
+
* no dead affordance.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ShorterThanLimit: Story;
|
|
17
|
+
/**
|
|
18
|
+
* The label is a required child rather than a built-in string, so it can be translated
|
|
19
|
+
* and can carry the count. `useChatCardListLayoutContext` publishes `hiddenCount` for
|
|
20
|
+
* exactly this; `variant` is forwarded straight to the design system's `Button`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CountInLabel: Story;
|
|
23
|
+
export declare const Playground: Story;
|
|
24
|
+
//# sourceMappingURL=chat-card-list-layout.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-list-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAc5D,OAAO,EACL,kBAAkB,EAInB,MAAM,yBAAyB,CAAC;AAoCjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAgDzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAa9B,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAcxB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ChatCardListLayout, ChatCardListLayoutItems, ChatCardListLayoutShowMore, useChatCardListLayoutContext, } from './chat-card-list-layout';
|
|
2
|
+
export type { ChatCardListLayoutProps, ChatCardListLayoutItemsProps, ChatCardListLayoutShowMoreProps, } from './chat-card-list-layout';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-list-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,uBAAuB,EACvB,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { ChatCardThreeColumnLayoutDetailsPlacement } from './chat-card-three-column-layout.variants';
|
|
3
|
+
/**
|
|
4
|
+
* A pane's content, or a function of whether the pane is currently floating.
|
|
5
|
+
*
|
|
6
|
+
* The function form exists because a floating pane usually needs different content, not
|
|
7
|
+
* just different styling: the places card shows a vertical list in the column and a
|
|
8
|
+
* horizontal swipe strip when floating. CSS alone cannot swap the component tree.
|
|
9
|
+
*/
|
|
10
|
+
export type ChatCardThreeColumnLayoutPaneChildren = ReactNode | ((isFloating: boolean) => ReactNode);
|
|
11
|
+
export interface ChatCardThreeColumnLayoutProps extends ComponentProps<'div'> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Whether Details may take its own column. See `ChatCardThreeColumnLayoutDetailsPlacement`.
|
|
15
|
+
* It is on the root, not on Details, because the root's grid template has to change
|
|
16
|
+
* with it.
|
|
17
|
+
*/
|
|
18
|
+
detailsPlacement?: ChatCardThreeColumnLayoutDetailsPlacement;
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A three-pane card body: List (fixed column), Main (flexible), Details (floating or a
|
|
23
|
+
* right column).
|
|
24
|
+
*
|
|
25
|
+
* Which panes fit is decided by the layout's **own measured width**, not by viewport
|
|
26
|
+
* breakpoints. The card is sized by the chat window, and a sidebar, a split view or the
|
|
27
|
+
* Storybook panel all make the viewport claim room the card doesn't have (or the
|
|
28
|
+
* reverse). The root measures itself, resolves the panes once (`resolveLayout`), and
|
|
29
|
+
* publishes the result twice: as data attributes for the CSS, and through context for the render props. Both read the same numbers, so the content a
|
|
30
|
+
* render prop picks always matches where its pane is drawn.
|
|
31
|
+
*
|
|
32
|
+
* Height is not set here, because it belongs to the content (a map needs a fixed height, a
|
|
33
|
+
* table might not), so pass it in `className`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ChatCardThreeColumnLayout: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
+
export interface ChatCardThreeColumnLayoutListProps extends Omit<ComponentProps<'aside'>, 'children'> {
|
|
37
|
+
children: ChatCardThreeColumnLayoutPaneChildren;
|
|
38
|
+
asChild?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Column 1 when the layout has room for it beside a usable Main; otherwise a strip pinned
|
|
42
|
+
* to the bottom, over Main. It is the same element either way, so only the render prop's
|
|
43
|
+
* output changes when it switches.
|
|
44
|
+
*
|
|
45
|
+
* `data-floating` is set too, for styling the pane itself without a render prop.
|
|
46
|
+
*/
|
|
47
|
+
export declare const ChatCardThreeColumnLayoutList: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
48
|
+
export interface ChatCardThreeColumnLayoutMainProps extends ComponentProps<'main'> {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Column 2, the flexible track. It never floats, so it takes plain children. It still
|
|
54
|
+
* requires the layout, because outside the grid its `[grid-area:main]` means nothing and
|
|
55
|
+
* the pane collapses without any error.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ChatCardThreeColumnLayoutMain: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutMainProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
58
|
+
export interface ChatCardThreeColumnLayoutDetailsProps extends Omit<ComponentProps<'aside'>, 'children'> {
|
|
59
|
+
children: ChatCardThreeColumnLayoutPaneChildren;
|
|
60
|
+
asChild?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Column 3. Mount it only while there is something to show: its presence is what adds the
|
|
64
|
+
* third grid track, so rendering it empty would reserve a blank column.
|
|
65
|
+
*
|
|
66
|
+
* It takes a column when the layout is wide enough and `detailsPlacement` allows it, and
|
|
67
|
+
* floats over Main otherwise: pinned to Main's right edge, or a bottom sheet on a narrow
|
|
68
|
+
* layout (`data-sheet`). `isFloating` in the render prop reflects all of that.
|
|
69
|
+
*/
|
|
70
|
+
export declare const ChatCardThreeColumnLayoutDetails: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutDetailsProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
71
|
+
export interface ChatCardThreeColumnLayoutPanelProps extends ComponentProps<'section'> {
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
asChild?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* An overlay covering everything but the List column (the whole layout when List floats),
|
|
77
|
+
* inset 12px. Mount it only while it is open. Main and Details stay mounted under it, so
|
|
78
|
+
* a map keeps its viewport and the open Details item survives closing the Panel.
|
|
79
|
+
*
|
|
80
|
+
* The pane is transparent: draw the surface (background, radius, shadow) in its content,
|
|
81
|
+
* as for Details.
|
|
82
|
+
*/
|
|
83
|
+
export declare const ChatCardThreeColumnLayoutPanel: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutPanelProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
84
|
+
//# sourceMappingURL=chat-card-three-column-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAarE,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AA0B1G;;;;;;GAMG;AACH,MAAM,MAAM,qCAAqC,GAC/C,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC;AAMnD,MAAM,WAAW,8BAA+B,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,yCAAyC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkBD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,wIAsCrC,CAAC;AAIF,MAAM,WAAW,kCAAmC,SAAQ,IAAI,CAC9D,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,CACX;IACC,QAAQ,EAAE,qCAAqC,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,4IAoBxC,CAAC;AAIH,MAAM,WAAW,kCAAmC,SAAQ,cAAc,CAAC,MAAM,CAAC;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,4IAmBxC,CAAC;AAIH,MAAM,WAAW,qCAAsC,SAAQ,IAAI,CACjE,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,CACX;IACC,QAAQ,EAAE,qCAAqC,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,+IA0B3C,CAAC;AAIH,MAAM,WAAW,mCAAoC,SAAQ,cAAc,CAAC,SAAS,CAAC;IACpF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,0IAmBzC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChatCardThreeColumnLayoutDetailsPlacement } from './chat-card-three-column-layout.variants';
|
|
2
|
+
export declare const LIST_WIDTH_LG = 290;
|
|
3
|
+
/** List at `xl`, and Details at every tier (as a column and as a pinned floating pane). */
|
|
4
|
+
export declare const PANE_WIDTH_XL = 358;
|
|
5
|
+
/**
|
|
6
|
+
* Narrowest Main may get before a pane has to float over it instead of sitting beside it.
|
|
7
|
+
* Main is usually a map or a chart, and below ~400px a map shows too little context to
|
|
8
|
+
* pick a place from. This is the one number to tune when a card feels cramped.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MIN_MAIN_WIDTH = 400;
|
|
11
|
+
/** Must equal the `gap-[8px]` on the root grid, or the thresholds are off by that much. */
|
|
12
|
+
export declare const GAP = 8;
|
|
13
|
+
/**
|
|
14
|
+
* Below this, a floating Details is a bottom sheet (`sm`). Pinned to Main's right edge at
|
|
15
|
+
* 358px, it would leave a sliver of Main too thin to read or tap.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MD_MIN_WIDTH = 640;
|
|
18
|
+
/** `lg`: a 290px List column fits beside a usable Main. */
|
|
19
|
+
export declare const LG_MIN_WIDTH: number;
|
|
20
|
+
/**
|
|
21
|
+
* `xl`: a Details column fits beside a 358px List and a usable Main. List widens to 358px at
|
|
22
|
+
* the same point, as in the original, where both changed at the `xl` breakpoint.
|
|
23
|
+
*/
|
|
24
|
+
export declare const XL_MIN_WIDTH: number;
|
|
25
|
+
/** Size tier, named after the viewport breakpoints the original card used. */
|
|
26
|
+
export type ChatCardThreeColumnLayoutSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
27
|
+
export interface ChatCardThreeColumnLayoutResolved {
|
|
28
|
+
size: ChatCardThreeColumnLayoutSize;
|
|
29
|
+
isListFloating: boolean;
|
|
30
|
+
isDetailsFloating: boolean;
|
|
31
|
+
isDetailsSheet: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Where each pane goes, given the width the layout actually has.
|
|
35
|
+
*
|
|
36
|
+
* The tiers are the original card's `md` / `lg` / `xl`, but measured on the layout, not
|
|
37
|
+
* the viewport. The card is sized by the chat window, and a sidebar, a split view or the
|
|
38
|
+
* Storybook panel all make the viewport claim room the card doesn't have (or the reverse).
|
|
39
|
+
*
|
|
40
|
+
* `'unset'` means the layout has not been measured yet (on the server, or before the first
|
|
41
|
+
* layout effect). It resolves to `xl`: SSR HTML is mostly seen on desktops, and on the
|
|
42
|
+
* client the measurement lands before paint.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveLayout(width: number | 'unset', detailsPlacement: ChatCardThreeColumnLayoutDetailsPlacement): ChatCardThreeColumnLayoutResolved;
|
|
45
|
+
//# sourceMappingURL=chat-card-three-column-layout.sizing.d.ts.map
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.sizing.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAQ1G,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,2FAA2F;AAC3F,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,2FAA2F;AAC3F,eAAO,MAAM,GAAG,IAAI,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,2DAA2D;AAC3D,eAAO,MAAM,YAAY,QAAuC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA+C,CAAC;AAEzE,8EAA8E;AAC9E,MAAM,MAAM,6BAA6B,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtE,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,6BAA6B,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,gBAAgB,EAAE,yCAAyC,GAC1D,iCAAiC,CASnC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ChatCardThreeColumnLayout } from './chat-card-three-column-layout';
|
|
3
|
+
declare const meta: Meta<typeof ChatCardThreeColumnLayout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ChatCardThreeColumnLayout>;
|
|
6
|
+
/**
|
|
7
|
+
* The places card. Below 698px the list becomes a swipe strip over the map, and its render
|
|
8
|
+
* prop swaps the content; from 698px it is a 290px column, and from 1132px a 358px one.
|
|
9
|
+
* Click a place to open Details: it floats over the map until 1132px, then takes a 358px
|
|
10
|
+
* third column. All thresholds are the layout's own width, not the viewport's.
|
|
11
|
+
*/
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
/** Details always floats over Main, even on a wide screen. */
|
|
14
|
+
export declare const DetailsFloating: Story;
|
|
15
|
+
/**
|
|
16
|
+
* Panel covers everything but the List column, and the whole layout when List floats
|
|
17
|
+
* (below 698px). Main and Details stay mounted under it: close it and the open place is
|
|
18
|
+
* still there. Open it again from Details with "All reviews".
|
|
19
|
+
*/
|
|
20
|
+
export declare const Panel: Story;
|
|
21
|
+
/** Drag the right edge across 698px: the Panel grows over the List once it floats. */
|
|
22
|
+
export declare const PanelResizable: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Collapse the card from its header: the minimum widths are gated on `data-state=open`, so
|
|
25
|
+
* the collapsed card shrinks back to its header.
|
|
26
|
+
*/
|
|
27
|
+
export declare const CollapsedCard: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Drag the dashed wrapper's right edge. The panes switch on the layout's own width: List
|
|
30
|
+
* becomes a 290px column at 698px, and at 1132px List widens to 358px and Details takes
|
|
31
|
+
* its 358px column, with the render-prop text changing at
|
|
32
|
+
* the same moment. No window resize needed, which is the point: the viewport never changes
|
|
33
|
+
* here.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ResizableContainer: Story;
|
|
36
|
+
export declare const Playground: Story;
|
|
37
|
+
//# 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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAgB5D,OAAO,EACL,yBAAyB,EAK1B,MAAM,iCAAiC,CAAC;AAqIzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAiChD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,EAAE,KAe5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether Details may take its own right column.
|
|
3
|
+
*
|
|
4
|
+
* - `responsive` — a column whenever the layout is wide enough for List, Details and a
|
|
5
|
+
* usable Main side by side; floating over Main otherwise.
|
|
6
|
+
* - `floating` — always over Main, for a pane that is secondary at every size.
|
|
7
|
+
*
|
|
8
|
+
* There is no "always a column": at widths where it would not fit, Main would be squeezed
|
|
9
|
+
* below usefulness, which is exactly what the width check exists to prevent.
|
|
10
|
+
*/
|
|
11
|
+
export type ChatCardThreeColumnLayoutDetailsPlacement = 'responsive' | 'floating';
|
|
12
|
+
/**
|
|
13
|
+
* `responsive` because it uses the room when it is there: `floating` would cover Main on
|
|
14
|
+
* a card with space to spare.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DEFAULT_DETAILS_PLACEMENT: ChatCardThreeColumnLayoutDetailsPlacement;
|
|
17
|
+
/**
|
|
18
|
+
* Root grid.
|
|
19
|
+
*
|
|
20
|
+
* The third track needs both "Details fits" (`data-details-floating=false`, from the
|
|
21
|
+
* width) and "Details is mounted" (`:has(> [data-slot=…-details])`). The second is CSS, not
|
|
22
|
+
* a prop, because consumers mount Details conditionally and a `hasDetails` prop could
|
|
23
|
+
* disagree with what is rendered.
|
|
24
|
+
*/
|
|
25
|
+
export declare const chatCardThreeColumnLayoutVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Column 1, or, when there is no room for it, a strip pinned to the bottom of the layout
|
|
28
|
+
* over Main. One element for both, so the pane never remounts when it switches; only what
|
|
29
|
+
* the consumer's render prop returns changes.
|
|
30
|
+
*
|
|
31
|
+
* Floating is `absolute` rather than a grid row so Main keeps the full height. In the
|
|
32
|
+
* column, `min-h-0` + `overflow-hidden` keep a long list inside the row. Without them the
|
|
33
|
+
* grid item grows to its content and the card gets taller instead of scrolling.
|
|
34
|
+
*/
|
|
35
|
+
export declare const chatCardThreeColumnLayoutListVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Column 2, the flexible `1fr` track. `min-w-0` because a grid item's minimum width is its
|
|
38
|
+
* content by default: a map or a wide table would push the track past the card. `relative`
|
|
39
|
+
* so the consumer can anchor their own overlays to Main.
|
|
40
|
+
*/
|
|
41
|
+
export declare const chatCardThreeColumnLayoutMainVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Column 3, or floating over Main. Floating shares Main's grid area instead of being
|
|
44
|
+
* `absolute`, so it is sized by the same track Main is.
|
|
45
|
+
*
|
|
46
|
+
* - pinned: the right edge of Main, at the same width the column would have, inset 12px
|
|
47
|
+
* - sheet: on a narrow layout, a bottom sheet at a fixed 85% height, so the pane does not
|
|
48
|
+
* change height as its content changes (the content scrolls instead)
|
|
49
|
+
*
|
|
50
|
+
* `z-20` keeps a floating Details above the floating List (`z-10`): an open Details is
|
|
51
|
+
* what the reader asked for last. `min-w-0` + `max-w-full` stop the fixed width from
|
|
52
|
+
* widening the `1fr` track past the card.
|
|
53
|
+
*/
|
|
54
|
+
export declare const chatCardThreeColumnLayoutDetailsVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
55
|
+
/**
|
|
56
|
+
* An overlay over everything but the List column, inset 12px, for a view that takes over the
|
|
57
|
+
* card (all reviews, a filter form) while Main and Details stay mounted underneath.
|
|
58
|
+
*
|
|
59
|
+
* It spans columns in row 1 instead of being `absolute`, so it follows the grid template:
|
|
60
|
+
* from column 2 to the last one when List is a column, all of them when List floats. It
|
|
61
|
+
* never adds a track, so mounting it doesn't move Main. `z-30` keeps it above floating
|
|
62
|
+
* Details (`z-20`) and the List strip (`z-10`).
|
|
63
|
+
*/
|
|
64
|
+
export declare const chatCardThreeColumnLayoutPanelVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Width recipe for the `ChatCard` that wraps the layout.
|
|
67
|
+
*
|
|
68
|
+
* A grid of `1fr` tracks has no intrinsic width, so inside a shrink-to-fit message the card
|
|
69
|
+
* would collapse to nothing. It takes the whole chat window instead, minus the message
|
|
70
|
+
* gutter on both sides, up to 1432px (four 358px columns). The layout then decides which
|
|
71
|
+
* panes fit in whatever width that gives it. `ChatContainer` sets both variables.
|
|
72
|
+
*
|
|
73
|
+
* One cap, not a ladder of viewport steps: a step like `lg:min-w-[1074px]` held the card
|
|
74
|
+
* narrower than the chat window between breakpoints, and Details floated for no reason.
|
|
75
|
+
*
|
|
76
|
+
* Gated on `data-state=open`, which `ChatCard`'s `Collapsible` puts on the card element
|
|
77
|
+
* itself: a collapsed card is only a header, and holding it at full width would leave a
|
|
78
|
+
* wide empty bar in the thread. A non-collapsible card is always `open`.
|
|
79
|
+
*/
|
|
80
|
+
export declare const chatCardThreeColumnLayoutCardVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
81
|
+
//# sourceMappingURL=chat-card-three-column-layout.variants.d.ts.map
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.variants.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,yCAAyC,GAAG,YAAY,GAAG,UAAU,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,yCAAwD,CAAC;AAmBjG;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,oFAS5C,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC,oFAIhD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,oFAEhD,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wCAAwC,oFAMnD,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC,oFAIjD,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qCAAqC,oFAIhD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ChatCardThreeColumnLayout, ChatCardThreeColumnLayoutList, ChatCardThreeColumnLayoutMain, ChatCardThreeColumnLayoutDetails, ChatCardThreeColumnLayoutPanel, } from './chat-card-three-column-layout';
|
|
2
|
+
export type { ChatCardThreeColumnLayoutProps, ChatCardThreeColumnLayoutListProps, ChatCardThreeColumnLayoutMainProps, ChatCardThreeColumnLayoutDetailsProps, ChatCardThreeColumnLayoutPanelProps, ChatCardThreeColumnLayoutPaneChildren, } from './chat-card-three-column-layout';
|
|
3
|
+
export { chatCardThreeColumnLayoutVariants, chatCardThreeColumnLayoutListVariants, chatCardThreeColumnLayoutMainVariants, chatCardThreeColumnLayoutDetailsVariants, chatCardThreeColumnLayoutPanelVariants, chatCardThreeColumnLayoutCardVariants, } from './chat-card-three-column-layout.variants';
|
|
4
|
+
export type { ChatCardThreeColumnLayoutDetailsPlacement } from './chat-card-three-column-layout.variants';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,gCAAgC,EAChC,8BAA8B,GAC/B,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACrC,qCAAqC,EACrC,wCAAwC,EACxC,sCAAsC,EACtC,qCAAqC,GACtC,MAAM,0CAA0C,CAAC;AAClD,YAAY,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export interface ChatCardTwoColumnLayoutProps extends ComponentProps<'div'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A two-pane card body: Aside (a 336px column) beside Main (flexible), stacked as Aside over
|
|
8
|
+
* Main when the layout is narrower than 744px.
|
|
9
|
+
*
|
|
10
|
+
* The switch is a container query on the layout's **own width**, not a viewport breakpoint,
|
|
11
|
+
* because the card is sized by the chat window, not the viewport. Nothing floats, so unlike
|
|
12
|
+
* the three-column layout there is no measuring and no render prop.
|
|
13
|
+
*
|
|
14
|
+
* The root is the query container and renders the grid inside itself: an element cannot
|
|
15
|
+
* query its own width. `className` goes on the root, so a height set there reaches the grid.
|
|
16
|
+
* Height is not set here, because it belongs to the content, so pass it in `className`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ChatCardTwoColumnLayout: import('react').ForwardRefExoticComponent<Omit<ChatCardTwoColumnLayoutProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export interface ChatCardTwoColumnLayoutAsideProps extends ComponentProps<'aside'> {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Column 1 (336px) when the layout is at least 744px wide; the first row below that. */
|
|
24
|
+
export declare const ChatCardTwoColumnLayoutAside: import('react').ForwardRefExoticComponent<Omit<ChatCardTwoColumnLayoutAsideProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
25
|
+
export interface ChatCardTwoColumnLayoutMainProps extends ComponentProps<'main'> {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** The flexible track: column 2 side by side, the second row (taking the rest) stacked. */
|
|
30
|
+
export declare const ChatCardTwoColumnLayoutMain: import('react').ForwardRefExoticComponent<Omit<ChatCardTwoColumnLayoutMainProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
31
|
+
//# sourceMappingURL=chat-card-two-column-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-two-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA4BvD,MAAM,WAAW,4BAA6B,SAAQ,cAAc,CAAC,KAAK,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,sIAwBnC,CAAC;AAIF,MAAM,WAAW,iCAAkC,SAAQ,cAAc,CAAC,OAAO,CAAC;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yFAAyF;AACzF,eAAO,MAAM,4BAA4B,wIAmBvC,CAAC;AAIH,MAAM,WAAW,gCAAiC,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC9E,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,2FAA2F;AAC3F,eAAO,MAAM,2BAA2B,uIAmBtC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Aside's fixed column width once the layout is wide enough for two columns. */
|
|
2
|
+
export declare const ASIDE_WIDTH = 336;
|
|
3
|
+
/**
|
|
4
|
+
* Narrowest Main may get beside the Aside column. The same 400px as the three-column
|
|
5
|
+
* layout: below it a map or a chart shows too little to be worth sitting beside anything.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MIN_MAIN_WIDTH = 400;
|
|
8
|
+
/** Must equal the `gap-[8px]` on the grid, or the threshold is off by that much. */
|
|
9
|
+
export declare const GAP = 8;
|
|
10
|
+
/** From this layout width, Aside and Main sit side by side; below it they stack. */
|
|
11
|
+
export declare const TWO_COLUMN_MIN_WIDTH: number;
|
|
12
|
+
//# sourceMappingURL=chat-card-two-column-layout.sizing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-two-column-layout.sizing.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.ts"],"names":[],"mappings":"AAOA,iFAAiF;AACjF,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,oFAAoF;AACpF,eAAO,MAAM,GAAG,IAAI,CAAC;AAErB,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,QAAqC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ChatCardTwoColumnLayout } from './chat-card-two-column-layout';
|
|
3
|
+
declare const meta: Meta<typeof ChatCardTwoColumnLayout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ChatCardTwoColumnLayout>;
|
|
6
|
+
/**
|
|
7
|
+
* From 744px of layout width, Aside is a 336px column beside Main; below it, Aside stacks
|
|
8
|
+
* above Main and Main takes the rest of the height. The threshold is the layout's own width,
|
|
9
|
+
* not the viewport's.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
/** A narrow card: Aside stacks above Main although the viewport is wide. */
|
|
13
|
+
export declare const Stacked: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Drag the dashed wrapper's right edge across 744px: the columns switch without the viewport
|
|
16
|
+
* changing, which is the point.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ResizableContainer: Story;
|
|
19
|
+
//# sourceMappingURL=chat-card-two-column-layout.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-two-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAa5D,OAAO,EACL,uBAAuB,EAGxB,MAAM,+BAA+B,CAAC;AAsDvC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,uBAAuB,CAwB9C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAehC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root: the query container, nothing else. An element cannot match a container query
|
|
3
|
+
* against its own width, so the grid lives one level down, in `…GridVariants`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const chatCardTwoColumnLayoutVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
6
|
+
/**
|
|
7
|
+
* The grid, rendered by the root around its children.
|
|
8
|
+
*
|
|
9
|
+
* Stacked, the rows are `auto 1fr`, so with a height on the root Main takes whatever Aside
|
|
10
|
+
* leaves. Side by side there is one `1fr` row; the stacked template would otherwise leave an
|
|
11
|
+
* empty `1fr` second row taking the height.
|
|
12
|
+
*/
|
|
13
|
+
export declare const chatCardTwoColumnLayoutGridVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Row 1 when stacked, column 1 when side by side. In the column, `min-h-0` + `overflow-hidden`
|
|
16
|
+
* keep a long list inside the row. Without them the grid item grows to its content and the
|
|
17
|
+
* card gets taller instead of scrolling.
|
|
18
|
+
*/
|
|
19
|
+
export declare const chatCardTwoColumnLayoutAsideVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
20
|
+
/**
|
|
21
|
+
* The flexible track. `min-w-0` because a grid item's minimum width is its content by
|
|
22
|
+
* default: a map or a wide table would push the track past the card. `relative` so the
|
|
23
|
+
* consumer can anchor their own overlays to Main.
|
|
24
|
+
*/
|
|
25
|
+
export declare const chatCardTwoColumnLayoutMainVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Width recipe for the `ChatCard` that wraps the layout. The same recipe, for the same
|
|
28
|
+
* reason, as `chatCardThreeColumnLayoutCardVariants`: a grid of `1fr` tracks has no intrinsic
|
|
29
|
+
* width, so inside a shrink-to-fit message the card would collapse to nothing. It takes the
|
|
30
|
+
* whole chat window instead, and the layout decides whether two columns fit.
|
|
31
|
+
*
|
|
32
|
+
* Gated on `data-state=open` so a collapsed card goes back to header width.
|
|
33
|
+
*/
|
|
34
|
+
export declare const chatCardTwoColumnLayoutCardVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
35
|
+
//# sourceMappingURL=chat-card-two-column-layout.variants.d.ts.map
|
package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card-two-column-layout.variants.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oFAAkD,CAAC;AAE/F;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,oFAI9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,oFAG/C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,oFAA2C,CAAC;AAE5F;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC,oFAI9C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ChatCardTwoColumnLayout, ChatCardTwoColumnLayoutAside, ChatCardTwoColumnLayoutMain, } from './chat-card-two-column-layout';
|
|
2
|
+
export type { ChatCardTwoColumnLayoutProps, ChatCardTwoColumnLayoutAsideProps, ChatCardTwoColumnLayoutMainProps, } from './chat-card-two-column-layout';
|
|
3
|
+
export { chatCardTwoColumnLayoutVariants, chatCardTwoColumnLayoutGridVariants, chatCardTwoColumnLayoutAsideVariants, chatCardTwoColumnLayoutMainVariants, chatCardTwoColumnLayoutCardVariants, } from './chat-card-two-column-layout.variants';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-two-column-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,4BAA4B,EAC5B,iCAAiC,EACjC,gCAAgC,GACjC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { z, ZodType } from 'zod/v4';
|
|
3
|
+
/** Markdown source text, as rendered by `MarkdownViewer`. */
|
|
4
|
+
export type Markdown = string;
|
|
5
|
+
export type SwiTagName = `swi-${string}`;
|
|
6
|
+
export type SwiCardVersion = `${number}.${number}.${number}`;
|
|
7
|
+
export type ChatMessageCardPluginSchema = ZodType;
|
|
8
|
+
export type ChatMessageCardData<TSchema extends ChatMessageCardPluginSchema> = z.infer<TSchema>;
|
|
9
|
+
export type ChatMessageCardComponent<TSchema extends ChatMessageCardPluginSchema> = ComponentType<{
|
|
10
|
+
className?: string;
|
|
11
|
+
version: SwiCardVersion;
|
|
12
|
+
parsedData: ChatMessageCardData<TSchema>;
|
|
13
|
+
elementName: SwiTagName;
|
|
14
|
+
isInline?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type ChatId = string;
|
|
17
|
+
export interface ChatPromptPayload {
|
|
18
|
+
files?: File[];
|
|
19
|
+
prompt: string;
|
|
20
|
+
previousAiMessage?: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,UAAU,GAAG,OAAO,MAAM,EAAE,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE7D,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAAC;AAElD,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,2BAA2B,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAEhG,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,2BAA2B,IAAI,aAAa,CAAC;IAChG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface UseStreamingMarkdownReturn {
|
|
2
|
+
markdown: string;
|
|
3
|
+
isStreaming: boolean;
|
|
4
|
+
pause: () => void;
|
|
5
|
+
resume: () => void;
|
|
6
|
+
reset: () => void;
|
|
7
|
+
stop: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to simulate streaming markdown text character by character.
|
|
11
|
+
* Provides controls to pause, resume, reset, and stop the streaming.
|
|
12
|
+
*
|
|
13
|
+
* @param text - The text to stream
|
|
14
|
+
* @param interval - Milliseconds between each character (default: 30)
|
|
15
|
+
* @returns Object with markdown, isStreaming state, and control methods
|
|
16
|
+
*/
|
|
17
|
+
export declare function useStreamingMarkdown(text: string, interval?: number): UseStreamingMarkdownReturn;
|
|
18
|
+
//# sourceMappingURL=use-streaming-markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-streaming-markdown.d.ts","sourceRoot":"","sources":["../../src/utils/use-streaming-markdown.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,0BAA0B,CA6F5F"}
|