@gravity-ui/aikit 0.1.1 → 0.2.0
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/dist/components/atoms/Alert/Alert.scss +29 -0
- package/dist/components/atoms/ChatDate/ChatDate.scss +15 -0
- package/dist/components/atoms/ChatDate/i18n/en.json +8 -0
- package/dist/components/atoms/ChatDate/i18n/ru.json +10 -0
- package/dist/components/atoms/ContextIndicator/ContextIndicator.scss +93 -0
- package/dist/components/atoms/DiffStat/DiffStat.scss +36 -0
- package/dist/components/atoms/Disclaimer/Disclaimer.scss +13 -0
- package/dist/components/atoms/Loader/Loader.scss +72 -0
- package/dist/components/atoms/MarkdownRenderer/MarkdownRenderer.scss +5 -0
- package/dist/components/atoms/MessageBalloon/MessageBalloon.scss +11 -0
- package/dist/components/atoms/Shimmer/Shimmer.scss +32 -0
- package/dist/components/atoms/SubmitButton/SubmitButton.scss +29 -0
- package/dist/components/atoms/SubmitButton/i18n/en.json +3 -0
- package/dist/components/atoms/SubmitButton/i18n/ru.json +3 -0
- package/dist/components/atoms/ToolIndicator/ToolIndicator.scss +15 -0
- package/dist/components/molecules/BaseMessage/BaseMessage.scss +41 -0
- package/dist/components/molecules/BaseMessage/i18n/en.json +8 -0
- package/dist/components/molecules/BaseMessage/i18n/ru.json +8 -0
- package/dist/components/molecules/ButtonGroup/ButtonGroup.scss +19 -0
- package/dist/components/molecules/PromptInputBody/PromptInputBody.scss +22 -0
- package/dist/components/molecules/PromptInputFooter/PromptInputFooter.scss +25 -0
- package/dist/components/molecules/PromptInputFooter/i18n/en.json +5 -0
- package/dist/components/molecules/PromptInputFooter/i18n/ru.json +5 -0
- package/dist/components/molecules/PromptInputHeader/PromptInputHeader.scss +27 -0
- package/dist/components/molecules/PromptInputPanel/PromptInputPanel.scss +11 -0
- package/dist/{src/components → components}/molecules/Suggestions/Suggestions.d.ts +4 -0
- package/dist/{src/components → components}/molecules/Suggestions/Suggestions.js +3 -3
- package/dist/components/molecules/Suggestions/Suggestions.scss +90 -0
- package/dist/components/molecules/Tabs/Tabs.scss +46 -0
- package/dist/components/molecules/Tabs/i18n/en.json +3 -0
- package/dist/components/molecules/Tabs/i18n/ru.json +3 -0
- package/dist/components/molecules/ToolFooter/ToolFooter.scss +15 -0
- package/dist/components/molecules/ToolHeader/ToolHeader.scss +24 -0
- package/dist/components/organisms/AssistantMessage/AssistantMessage.scss +10 -0
- package/dist/components/organisms/Header/Header.scss +51 -0
- package/dist/components/organisms/Header/i18n/en.json +7 -0
- package/dist/components/organisms/Header/i18n/ru.json +7 -0
- package/dist/components/organisms/MessageList/MessageList.scss +30 -0
- package/dist/components/organisms/MessageList/i18n/en.json +4 -0
- package/dist/components/organisms/MessageList/i18n/ru.json +4 -0
- package/dist/components/organisms/PromptInput/PromptInput.scss +73 -0
- package/dist/{src/components → components}/organisms/PromptInput/PromptInputWithSuggestions.js +2 -2
- package/dist/{src/components → components}/organisms/PromptInput/types.d.ts +2 -0
- package/dist/components/organisms/ThinkingMessage/ThinkingMessage.scss +27 -0
- package/dist/components/organisms/ThinkingMessage/i18n/en.json +4 -0
- package/dist/components/organisms/ThinkingMessage/i18n/ru.json +4 -0
- package/dist/{src/components → components}/organisms/ThinkingMessage/index.js +1 -1
- package/dist/components/organisms/ToolMessage/ToolMessage.scss +19 -0
- package/dist/components/organisms/ToolMessage/i18n/en.json +9 -0
- package/dist/components/organisms/ToolMessage/i18n/ru.json +9 -0
- package/dist/components/organisms/UserMessage/UserMessage.scss +10 -0
- package/dist/components/pages/ChatContainer/ChatContainer.scss +44 -0
- package/dist/components/pages/ChatContainer/i18n/en.json +10 -0
- package/dist/components/pages/ChatContainer/i18n/ru.json +10 -0
- package/dist/components/templates/ChatContent/ChatContent.scss +27 -0
- package/dist/components/templates/EmptyContainer/EmptyContainer.scss +86 -0
- package/dist/components/templates/EmptyContainer/i18n/en.json +3 -0
- package/dist/components/templates/EmptyContainer/i18n/ru.json +3 -0
- package/dist/components/templates/History/History.scss +90 -0
- package/dist/components/templates/History/i18n/en.json +7 -0
- package/dist/components/templates/History/i18n/ru.json +7 -0
- package/dist/styles/_functions.scss +5 -0
- package/dist/styles/styles.scss +1 -0
- package/dist/styles/variables.scss +1 -0
- package/dist/themes/dark.css +19 -0
- package/dist/themes/light.css +19 -0
- package/dist/themes/variables.css +69 -0
- package/package.json +22 -4
- package/dist/.storybook/theme.d.ts +0 -6
- package/dist/.storybook/theme.js +0 -28
- package/dist/package.json +0 -123
- package/dist/src/components/atoms/ActionButton/__stories__/ActionButton.stories.d.ts +0 -8
- package/dist/src/components/atoms/ActionButton/__stories__/ActionButton.stories.js +0 -48
- package/dist/src/components/atoms/Alert/__stories__/Alert.stories.d.ts +0 -9
- package/dist/src/components/atoms/Alert/__stories__/Alert.stories.js +0 -56
- package/dist/src/components/atoms/ChatDate/__stories__/ChatDate.stories.d.ts +0 -16
- package/dist/src/components/atoms/ChatDate/__stories__/ChatDate.stories.js +0 -83
- package/dist/src/components/atoms/ChatDate/i18n/en.json +0 -8
- package/dist/src/components/atoms/ChatDate/i18n/ru.json +0 -10
- package/dist/src/components/atoms/ContextIndicator/__stories__/ContextIndicator.stories.d.ts +0 -17
- package/dist/src/components/atoms/ContextIndicator/__stories__/ContextIndicator.stories.js +0 -72
- package/dist/src/components/atoms/ContextItem/__stories__/ContextItem.stories.d.ts +0 -6
- package/dist/src/components/atoms/ContextItem/__stories__/ContextItem.stories.js +0 -32
- package/dist/src/components/atoms/DiffStat/__stories__/DiffStat.stories.d.ts +0 -7
- package/dist/src/components/atoms/DiffStat/__stories__/DiffStat.stories.js +0 -45
- package/dist/src/components/atoms/Disclaimer/__stories__/Disclaimer.stories.d.ts +0 -8
- package/dist/src/components/atoms/Disclaimer/__stories__/Disclaimer.stories.js +0 -32
- package/dist/src/components/atoms/Loader/__stories__/Loader.stories.d.ts +0 -8
- package/dist/src/components/atoms/Loader/__stories__/Loader.stories.js +0 -47
- package/dist/src/components/atoms/MarkdownRenderer/__stories__/MarkdownRenderer.stories.d.ts +0 -6
- package/dist/src/components/atoms/MarkdownRenderer/__stories__/MarkdownRenderer.stories.js +0 -49
- package/dist/src/components/atoms/MessageBalloon/__stories__/MessageBalloon.stories.d.ts +0 -6
- package/dist/src/components/atoms/MessageBalloon/__stories__/MessageBalloon.stories.js +0 -32
- package/dist/src/components/atoms/Shimmer/__stories__/Shimmer.stories.d.ts +0 -5
- package/dist/src/components/atoms/Shimmer/__stories__/Shimmer.stories.js +0 -28
- package/dist/src/components/atoms/SubmitButton/__stories__/SubmitButton.stories.d.ts +0 -12
- package/dist/src/components/atoms/SubmitButton/__stories__/SubmitButton.stories.js +0 -95
- package/dist/src/components/atoms/SubmitButton/i18n/en.json +0 -3
- package/dist/src/components/atoms/SubmitButton/i18n/ru.json +0 -3
- package/dist/src/components/atoms/ToolIndicator/__stories__/ToolIndicator.stories.d.ts +0 -9
- package/dist/src/components/atoms/ToolIndicator/__stories__/ToolIndicator.stories.js +0 -34
- package/dist/src/components/molecules/BaseMessage/__stories__/BaseMessage.stories.d.ts +0 -8
- package/dist/src/components/molecules/BaseMessage/__stories__/BaseMessage.stories.js +0 -66
- package/dist/src/components/molecules/BaseMessage/i18n/en.json +0 -8
- package/dist/src/components/molecules/BaseMessage/i18n/ru.json +0 -8
- package/dist/src/components/molecules/ButtonGroup/__stories__/ButtonGroup.stories.d.ts +0 -6
- package/dist/src/components/molecules/ButtonGroup/__stories__/ButtonGroup.stories.js +0 -44
- package/dist/src/components/molecules/PromptInputBody/__stories__/PromptInputBody.stories.d.ts +0 -11
- package/dist/src/components/molecules/PromptInputBody/__stories__/PromptInputBody.stories.js +0 -62
- package/dist/src/components/molecules/PromptInputFooter/__stories__/PromptInputFooter.stories.d.ts +0 -11
- package/dist/src/components/molecules/PromptInputFooter/__stories__/PromptInputFooter.stories.js +0 -96
- package/dist/src/components/molecules/PromptInputFooter/i18n/en.json +0 -5
- package/dist/src/components/molecules/PromptInputFooter/i18n/ru.json +0 -5
- package/dist/src/components/molecules/PromptInputHeader/__stories__/PromptInputHeader.stories.d.ts +0 -13
- package/dist/src/components/molecules/PromptInputHeader/__stories__/PromptInputHeader.stories.js +0 -103
- package/dist/src/components/molecules/PromptInputPanel/__stories__/PromptInputPanel.stories.d.ts +0 -8
- package/dist/src/components/molecules/PromptInputPanel/__stories__/PromptInputPanel.stories.js +0 -38
- package/dist/src/components/molecules/Suggestions/__stories__/Suggestions.stories.d.ts +0 -19
- package/dist/src/components/molecules/Suggestions/__stories__/Suggestions.stories.js +0 -143
- package/dist/src/components/molecules/Tabs/__stories__/Tabs.stories.d.ts +0 -9
- package/dist/src/components/molecules/Tabs/__stories__/Tabs.stories.js +0 -103
- package/dist/src/components/molecules/Tabs/i18n/en.json +0 -3
- package/dist/src/components/molecules/Tabs/i18n/ru.json +0 -3
- package/dist/src/components/molecules/ToolFooter/__stories__/ToolFooter.stories.d.ts +0 -7
- package/dist/src/components/molecules/ToolFooter/__stories__/ToolFooter.stories.js +0 -58
- package/dist/src/components/molecules/ToolHeader/__stories__/ToolHeader.stories.d.ts +0 -7
- package/dist/src/components/molecules/ToolHeader/__stories__/ToolHeader.stories.js +0 -55
- package/dist/src/components/organisms/AssistantMessage/__stories__/AssistantMessage.stories.d.ts +0 -13
- package/dist/src/components/organisms/AssistantMessage/__stories__/AssistantMessage.stories.js +0 -151
- package/dist/src/components/organisms/Header/__stories__/Header.stories.d.ts +0 -13
- package/dist/src/components/organisms/Header/__stories__/Header.stories.js +0 -130
- package/dist/src/components/organisms/Header/i18n/en.json +0 -7
- package/dist/src/components/organisms/Header/i18n/ru.json +0 -7
- package/dist/src/components/organisms/MessageList/__stories__/MessageList.stories.d.ts +0 -24
- package/dist/src/components/organisms/MessageList/__stories__/MessageList.stories.js +0 -288
- package/dist/src/components/organisms/MessageList/i18n/en.json +0 -4
- package/dist/src/components/organisms/MessageList/i18n/ru.json +0 -4
- package/dist/src/components/organisms/PromptInput/__stories__/PromptInput.stories.d.ts +0 -18
- package/dist/src/components/organisms/PromptInput/__stories__/PromptInput.stories.js +0 -278
- package/dist/src/components/organisms/ThinkingMessage/__stories__/ThinkingMessage.stories.d.ts +0 -12
- package/dist/src/components/organisms/ThinkingMessage/__stories__/ThinkingMessage.stories.js +0 -107
- package/dist/src/components/organisms/ThinkingMessage/i18n/en.json +0 -4
- package/dist/src/components/organisms/ThinkingMessage/i18n/ru.json +0 -4
- package/dist/src/components/organisms/ToolMessage/__stories__/ToolMessage.stories.d.ts +0 -11
- package/dist/src/components/organisms/ToolMessage/__stories__/ToolMessage.stories.js +0 -70
- package/dist/src/components/organisms/ToolMessage/i18n/en.json +0 -9
- package/dist/src/components/organisms/ToolMessage/i18n/ru.json +0 -9
- package/dist/src/components/organisms/UserMessage/__stories__/UserMessage.stories.d.ts +0 -7
- package/dist/src/components/organisms/UserMessage/__stories__/UserMessage.stories.js +0 -70
- package/dist/src/components/pages/ChatContainer/__stories__/ChatContainer.stories.d.ts +0 -53
- package/dist/src/components/pages/ChatContainer/__stories__/ChatContainer.stories.js +0 -743
- package/dist/src/components/pages/ChatContainer/i18n/en.json +0 -10
- package/dist/src/components/pages/ChatContainer/i18n/ru.json +0 -10
- package/dist/src/components/templates/ChatContent/__stories__/ChatContent.stories.d.ts +0 -14
- package/dist/src/components/templates/ChatContent/__stories__/ChatContent.stories.js +0 -327
- package/dist/src/components/templates/EmptyContainer/__stories__/EmptyContainer.stories.d.ts +0 -20
- package/dist/src/components/templates/EmptyContainer/__stories__/EmptyContainer.stories.js +0 -250
- package/dist/src/components/templates/EmptyContainer/i18n/en.json +0 -3
- package/dist/src/components/templates/EmptyContainer/i18n/ru.json +0 -3
- package/dist/src/components/templates/History/__stories__/History.stories.d.ts +0 -17
- package/dist/src/components/templates/History/__stories__/History.stories.js +0 -271
- package/dist/src/components/templates/History/i18n/en.json +0 -7
- package/dist/src/components/templates/History/i18n/ru.json +0 -7
- package/dist/src/demo/ContentWrapper/ContentWrapper.d.ts +0 -4
- package/dist/src/demo/ContentWrapper/ContentWrapper.js +0 -9
- package/dist/src/demo/ContentWrapper/index.d.ts +0 -1
- package/dist/src/demo/ContentWrapper/index.js +0 -1
- package/dist/src/demo/DocsDecorator/DocsDecorator.d.ts +0 -6
- package/dist/src/demo/DocsDecorator/DocsDecorator.js +0 -12
- package/dist/src/demo/DocsDecorator/ThemeContext.d.ts +0 -2
- package/dist/src/demo/DocsDecorator/ThemeContext.js +0 -2
- package/dist/src/demo/Showcase/Showcase.d.ts +0 -9
- package/dist/src/demo/Showcase/Showcase.js +0 -7
- package/dist/src/demo/Showcase/index.d.ts +0 -1
- package/dist/src/demo/Showcase/index.js +0 -1
- package/dist/src/demo/ShowcaseItem/ShowcaseItem.d.ts +0 -7
- package/dist/src/demo/ShowcaseItem/ShowcaseItem.js +0 -7
- package/dist/src/demo/ShowcaseItem/index.d.ts +0 -1
- package/dist/src/demo/ShowcaseItem/index.js +0 -1
- package/dist/src/demo/SwapArea/SwapArea.d.ts +0 -2
- package/dist/src/demo/SwapArea/SwapArea.js +0 -7
- package/dist/src/demo/SwapArea/index.d.ts +0 -1
- package/dist/src/demo/SwapArea/index.js +0 -1
- /package/dist/{src/components → components}/atoms/ActionButton/ActionButton.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ActionButton/ActionButton.js +0 -0
- /package/dist/{src/components → components}/atoms/ActionButton/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ActionButton/index.js +0 -0
- /package/dist/{src/components → components}/atoms/Alert/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Alert/index.js +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/ChatDate.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/ChatDate.js +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/i18n/index.js +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ChatDate/index.js +0 -0
- /package/dist/{src/components → components}/atoms/ContextIndicator/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ContextIndicator/index.js +0 -0
- /package/dist/{src/components → components}/atoms/ContextIndicator/utils.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ContextIndicator/utils.js +0 -0
- /package/dist/{src/components → components}/atoms/ContextItem/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ContextItem/index.js +0 -0
- /package/dist/{src/components → components}/atoms/DiffStat/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/DiffStat/index.js +0 -0
- /package/dist/{src/components → components}/atoms/Disclaimer/Disclaimer.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Disclaimer/Disclaimer.js +0 -0
- /package/dist/{src/components → components}/atoms/Disclaimer/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Disclaimer/index.js +0 -0
- /package/dist/{src/components → components}/atoms/InlineCitation/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/InlineCitation/index.js +0 -0
- /package/dist/{src/components → components}/atoms/Loader/Loader.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Loader/Loader.js +0 -0
- /package/dist/{src/components → components}/atoms/Loader/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Loader/index.js +0 -0
- /package/dist/{src/components → components}/atoms/MarkdownRenderer/MarkdownRenderer.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/MarkdownRenderer/MarkdownRenderer.js +0 -0
- /package/dist/{src/components → components}/atoms/MarkdownRenderer/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/MarkdownRenderer/index.js +0 -0
- /package/dist/{src/components → components}/atoms/MessageBalloon/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/MessageBalloon/index.js +0 -0
- /package/dist/{src/components → components}/atoms/Shimmer/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/Shimmer/index.js +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/SubmitButton.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/SubmitButton.js +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/i18n/index.js +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/SubmitButton/index.js +0 -0
- /package/dist/{src/components → components}/atoms/ToolIndicator/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/ToolIndicator/index.js +0 -0
- /package/dist/{src/components → components}/atoms/index.d.ts +0 -0
- /package/dist/{src/components → components}/atoms/index.js +0 -0
- /package/dist/{src/components → components}/index.d.ts +0 -0
- /package/dist/{src/components → components}/index.js +0 -0
- /package/dist/{src/components → components}/molecules/BaseMessage/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/BaseMessage/i18n/index.js +0 -0
- /package/dist/{src/components → components}/molecules/BaseMessage/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/BaseMessage/index.js +0 -0
- /package/dist/{src/components → components}/molecules/ButtonGroup/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/ButtonGroup/index.js +0 -0
- /package/dist/{src/components → components}/molecules/InputContext/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/InputContext/index.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputBody/PromptInputBody.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputBody/PromptInputBody.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputBody/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputBody/index.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/PromptInputFooter.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/PromptInputFooter.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/i18n/index.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputFooter/index.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputHeader/PromptInputHeader.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputHeader/PromptInputHeader.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputHeader/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputHeader/index.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputPanel/PromptInputPanel.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputPanel/PromptInputPanel.js +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputPanel/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/PromptInputPanel/index.js +0 -0
- /package/dist/{src/components → components}/molecules/Suggestions/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/Suggestions/index.js +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/Tabs.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/Tabs.js +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/i18n/index.js +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/Tabs/index.js +0 -0
- /package/dist/{src/components → components}/molecules/ToolFooter/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/ToolFooter/index.js +0 -0
- /package/dist/{src/components → components}/molecules/ToolHeader/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/ToolHeader/index.js +0 -0
- /package/dist/{src/components → components}/molecules/index.d.ts +0 -0
- /package/dist/{src/components → components}/molecules/index.js +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/AssistantMessage.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/AssistantMessage.js +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/defaultMessageTypeRegistry.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/defaultMessageTypeRegistry.js +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/AssistantMessage/index.js +0 -0
- /package/dist/{src/components → components}/organisms/Header/Header.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/Header/Header.js +0 -0
- /package/dist/{src/components → components}/organisms/Header/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/Header/i18n/index.js +0 -0
- /package/dist/{src/components → components}/organisms/Header/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/Header/index.js +0 -0
- /package/dist/{src/components → components}/organisms/Header/types.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/Header/types.js +0 -0
- /package/dist/{src/components → components}/organisms/Header/useHeader.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/Header/useHeader.js +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/ErrorAlert.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/ErrorAlert.js +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/MessageList.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/MessageList.js +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/i18n/index.js +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/MessageList/index.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInput.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInput.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputFull.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputFull.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputSimple.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputSimple.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputWithPanels.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputWithPanels.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/PromptInputWithSuggestions.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/index.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/types.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/useDelayedUnmount.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/useDelayedUnmount.js +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/usePromptInput.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/PromptInput/usePromptInput.js +0 -0
- /package/dist/{src/components → components}/organisms/ThinkingMessage/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/ThinkingMessage/i18n/index.js +0 -0
- /package/dist/{src/components → components}/organisms/ThinkingMessage/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/ThinkingMessage/useThinkingMessage.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/ThinkingMessage/useThinkingMessage.js +0 -0
- /package/dist/{src/components → components}/organisms/ToolMessage/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/ToolMessage/i18n/index.js +0 -0
- /package/dist/{src/components → components}/organisms/ToolMessage/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/ToolMessage/index.js +0 -0
- /package/dist/{src/components → components}/organisms/UserMessage/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/UserMessage/index.js +0 -0
- /package/dist/{src/components → components}/organisms/index.d.ts +0 -0
- /package/dist/{src/components → components}/organisms/index.js +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/ChatContainer.d.ts +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/ChatContainer.js +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/i18n/index.js +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/index.js +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/types.d.ts +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/types.js +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/useChatContainer.d.ts +0 -0
- /package/dist/{src/components → components}/pages/ChatContainer/useChatContainer.js +0 -0
- /package/dist/{src/components → components}/pages/index.d.ts +0 -0
- /package/dist/{src/components → components}/pages/index.js +0 -0
- /package/dist/{src/components → components}/templates/ChatContent/ChatContent.d.ts +0 -0
- /package/dist/{src/components → components}/templates/ChatContent/ChatContent.js +0 -0
- /package/dist/{src/components → components}/templates/ChatContent/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/ChatContent/index.js +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/EmptyContainer.d.ts +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/EmptyContainer.js +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/i18n/index.js +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/EmptyContainer/index.js +0 -0
- /package/dist/{src/components → components}/templates/History/ChatItem.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/ChatItem.js +0 -0
- /package/dist/{src/components → components}/templates/History/DateHeaderItem.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/DateHeaderItem.js +0 -0
- /package/dist/{src/components → components}/templates/History/History.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/History.js +0 -0
- /package/dist/{src/components → components}/templates/History/HistoryList.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/HistoryList.js +0 -0
- /package/dist/{src/components → components}/templates/History/i18n/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/i18n/index.js +0 -0
- /package/dist/{src/components → components}/templates/History/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/History/index.js +0 -0
- /package/dist/{src/components → components}/templates/index.d.ts +0 -0
- /package/dist/{src/components → components}/templates/index.js +0 -0
- /package/dist/{src/constants → constants}/index.d.ts +0 -0
- /package/dist/{src/constants → constants}/index.js +0 -0
- /package/dist/{src/hooks → hooks}/index.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/index.js +0 -0
- /package/dist/{src/hooks → hooks}/useDateFormatter/index.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useDateFormatter/index.js +0 -0
- /package/dist/{src/hooks → hooks}/useSmartScroll.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useSmartScroll.js +0 -0
- /package/dist/{src/hooks → hooks}/useToolMessage.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useToolMessage.js +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/types → types}/chat.d.ts +0 -0
- /package/dist/{src/types → types}/chat.js +0 -0
- /package/dist/{src/types → types}/common.d.ts +0 -0
- /package/dist/{src/types → types}/common.js +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /package/dist/{src/types → types}/index.js +0 -0
- /package/dist/{src/types → types}/messages.d.ts +0 -0
- /package/dist/{src/types → types}/messages.js +0 -0
- /package/dist/{src/types → types}/tool.d.ts +0 -0
- /package/dist/{src/types → types}/tool.js +0 -0
- /package/dist/{src/utils → utils}/chatUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/chatUtils.js +0 -0
- /package/dist/{src/utils → utils}/cn.d.ts +0 -0
- /package/dist/{src/utils → utils}/cn.js +0 -0
- /package/dist/{src/utils → utils}/index.d.ts +0 -0
- /package/dist/{src/utils → utils}/index.js +0 -0
- /package/dist/{src/utils → utils}/messageTypeRegistry.d.ts +0 -0
- /package/dist/{src/utils → utils}/messageTypeRegistry.js +0 -0
- /package/dist/{src/utils → utils}/messageUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/messageUtils.js +0 -0
- /package/dist/{src/utils → utils}/validation.d.ts +0 -0
- /package/dist/{src/utils → utils}/validation.js +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Gear } from '@gravity-ui/icons';
|
|
4
|
-
import { Button, Icon } from '@gravity-ui/uikit';
|
|
5
|
-
import { ContentWrapper } from '../../../../demo/ContentWrapper';
|
|
6
|
-
import { Showcase } from '../../../../demo/Showcase';
|
|
7
|
-
import { ShowcaseItem } from '../../../../demo/ShowcaseItem';
|
|
8
|
-
import { Header, HeaderAction } from '../index';
|
|
9
|
-
import MDXDocs from './Docs.mdx';
|
|
10
|
-
export default {
|
|
11
|
-
title: 'organisms/Header',
|
|
12
|
-
component: Header,
|
|
13
|
-
parameters: {
|
|
14
|
-
docs: {
|
|
15
|
-
page: MDXDocs,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
argTypes: {
|
|
19
|
-
titlePosition: {
|
|
20
|
-
control: 'radio',
|
|
21
|
-
options: ['left', 'center'],
|
|
22
|
-
description: 'Title position',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const defaultDecorators = [
|
|
27
|
-
(Story) => (_jsx(Showcase, { children: _jsx(Story, {}) })),
|
|
28
|
-
];
|
|
29
|
-
// Mock handlers for actions
|
|
30
|
-
const mockHandlers = {
|
|
31
|
-
handleNewChat: () => {
|
|
32
|
-
// eslint-disable-next-line no-console
|
|
33
|
-
console.log('New chat clicked');
|
|
34
|
-
},
|
|
35
|
-
handleHistoryToggle: () => {
|
|
36
|
-
// eslint-disable-next-line no-console
|
|
37
|
-
console.log('History toggle clicked');
|
|
38
|
-
},
|
|
39
|
-
handleFolding: (value) => {
|
|
40
|
-
// eslint-disable-next-line no-console
|
|
41
|
-
console.log('Folding clicked:', value);
|
|
42
|
-
},
|
|
43
|
-
handleClose: () => {
|
|
44
|
-
// eslint-disable-next-line no-console
|
|
45
|
-
console.log('Close clicked');
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
export const Playground = (args) => {
|
|
49
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({}, args)) }));
|
|
50
|
-
};
|
|
51
|
-
Playground.args = Object.assign({ title: 'Chat Header', baseActions: [
|
|
52
|
-
HeaderAction.NewChat,
|
|
53
|
-
HeaderAction.History,
|
|
54
|
-
HeaderAction.Folding,
|
|
55
|
-
HeaderAction.Close,
|
|
56
|
-
], foldingState: 'opened' }, mockHandlers);
|
|
57
|
-
export const WithTitle = (args) => {
|
|
58
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "Chat Header", baseActions: [HeaderAction.NewChat, HeaderAction.History, HeaderAction.Close] }, mockHandlers, args)) }));
|
|
59
|
-
};
|
|
60
|
-
export const WithIcon = (args) => {
|
|
61
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ icon: _jsx("div", { style: { width: 24, height: 24, background: '#ccc', borderRadius: 4 } }), title: "Chat Header", baseActions: [HeaderAction.NewChat, HeaderAction.History, HeaderAction.Close] }, mockHandlers, args)) }));
|
|
62
|
-
};
|
|
63
|
-
export const WithPreview = (args) => {
|
|
64
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "Chat Header", preview: _jsx("div", { children: "Preview" }), baseActions: [HeaderAction.NewChat, HeaderAction.History, HeaderAction.Close] }, mockHandlers, args)) }));
|
|
65
|
-
};
|
|
66
|
-
export const TitlePositions = {
|
|
67
|
-
render: (args) => {
|
|
68
|
-
return (_jsxs(_Fragment, { children: [_jsx(ShowcaseItem, { title: "Left", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "Left Title", titlePosition: "left", baseActions: [HeaderAction.NewChat, HeaderAction.Close] }, mockHandlers, args)) }) }), _jsx(ShowcaseItem, { title: "Center", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "Center Title", titlePosition: "center", baseActions: [HeaderAction.NewChat, HeaderAction.Close] }, mockHandlers, args)) }) })] }));
|
|
69
|
-
},
|
|
70
|
-
decorators: defaultDecorators,
|
|
71
|
-
};
|
|
72
|
-
export const BaseActions = {
|
|
73
|
-
render: (args) => {
|
|
74
|
-
return (_jsxs(_Fragment, { children: [_jsx(ShowcaseItem, { title: "All actions", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "All Actions", baseActions: [
|
|
75
|
-
HeaderAction.NewChat,
|
|
76
|
-
HeaderAction.History,
|
|
77
|
-
HeaderAction.Folding,
|
|
78
|
-
HeaderAction.Close,
|
|
79
|
-
], foldingState: "opened" }, mockHandlers)) }) }), _jsx(ShowcaseItem, { title: "Folding opened", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "With Folding (opened)", baseActions: [
|
|
80
|
-
HeaderAction.NewChat,
|
|
81
|
-
HeaderAction.History,
|
|
82
|
-
HeaderAction.Folding,
|
|
83
|
-
], foldingState: "opened" }, mockHandlers)) }) }), _jsx(ShowcaseItem, { title: "Folding collapsed", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "With Folding (collapsed)", baseActions: [
|
|
84
|
-
HeaderAction.NewChat,
|
|
85
|
-
HeaderAction.History,
|
|
86
|
-
HeaderAction.Folding,
|
|
87
|
-
], foldingState: "collapsed" }, mockHandlers, args)) }) })] }));
|
|
88
|
-
},
|
|
89
|
-
decorators: defaultDecorators,
|
|
90
|
-
};
|
|
91
|
-
export const AdditionalActions = (args) => {
|
|
92
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "With Additional Actions", baseActions: [HeaderAction.NewChat, HeaderAction.History, HeaderAction.Close], additionalActions: [
|
|
93
|
-
{
|
|
94
|
-
children: 'Action 1',
|
|
95
|
-
onClick: () => {
|
|
96
|
-
// eslint-disable-next-line no-console
|
|
97
|
-
console.log('Additional action 1');
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
_jsx(Button, { size: "m", view: "flat", children: _jsx(Icon, { data: Gear, size: 16 }) }, "settings"),
|
|
101
|
-
] }, mockHandlers, args)) }));
|
|
102
|
-
};
|
|
103
|
-
export const FullExample = (args) => {
|
|
104
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ icon: _jsx("div", { style: { width: 24, height: 24, background: '#ccc', borderRadius: 4 } }), title: "Chat Header", preview: _jsx("div", { children: "Preview" }), baseActions: [HeaderAction.NewChat, HeaderAction.History, HeaderAction.Close], additionalActions: [
|
|
105
|
-
{
|
|
106
|
-
children: 'Settings',
|
|
107
|
-
view: 'outlined',
|
|
108
|
-
size: 'm',
|
|
109
|
-
onClick: () => {
|
|
110
|
-
// eslint-disable-next-line no-console
|
|
111
|
-
console.log('Settings clicked');
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
_jsx(Button, { size: "m", view: "flat", children: _jsx(Icon, { data: Gear, size: 16 }) }, "settings"),
|
|
115
|
-
], titlePosition: "center" }, mockHandlers, args)) }));
|
|
116
|
-
};
|
|
117
|
-
// Interactive story to demonstrate folding state toggle
|
|
118
|
-
export const FoldingInteractive = (args) => {
|
|
119
|
-
const [foldingState, setFoldingState] = useState('opened');
|
|
120
|
-
return (_jsx(ContentWrapper, { width: "480px", children: _jsx(Header, Object.assign({ title: "Interactive Folding", baseActions: [
|
|
121
|
-
HeaderAction.NewChat,
|
|
122
|
-
HeaderAction.History,
|
|
123
|
-
HeaderAction.Folding,
|
|
124
|
-
HeaderAction.Close,
|
|
125
|
-
], foldingState: foldingState, handleFolding: (value) => {
|
|
126
|
-
setFoldingState(value);
|
|
127
|
-
// eslint-disable-next-line no-console
|
|
128
|
-
console.log('Folding state changed to:', value);
|
|
129
|
-
}, handleNewChat: mockHandlers.handleNewChat, handleHistoryToggle: mockHandlers.handleHistoryToggle, handleClose: mockHandlers.handleClose }, args)) }));
|
|
130
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { type MessageListProps } from '..';
|
|
3
|
-
import type { TMessageContent } from '../../../../types/messages';
|
|
4
|
-
declare const _default: Meta;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Playground: StoryFn<MessageListProps>;
|
|
7
|
-
export declare const WithSubmittedStatus: StoryObj<MessageListProps>;
|
|
8
|
-
export declare const WithErrorMessage: StoryObj<MessageListProps>;
|
|
9
|
-
export declare const WithToolMessage: StoryObj<MessageListProps>;
|
|
10
|
-
interface ChartMessageData {
|
|
11
|
-
chartData: {
|
|
12
|
-
labels: string[];
|
|
13
|
-
datasets: Array<{
|
|
14
|
-
label: string;
|
|
15
|
-
data: number[];
|
|
16
|
-
color?: string;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
chartType: 'line' | 'bar' | 'pie';
|
|
20
|
-
}
|
|
21
|
-
type ChartMessageContent = TMessageContent<'chart', ChartMessageData>;
|
|
22
|
-
export declare const WithCustomMessageType: StoryObj<MessageListProps<ChartMessageContent>>;
|
|
23
|
-
export declare const WithStreamingMessage: StoryObj<MessageListProps>;
|
|
24
|
-
export declare const WithDefaultActions: StoryObj<MessageListProps>;
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Pencil } from '@gravity-ui/icons';
|
|
4
|
-
import { Icon, Text } from '@gravity-ui/uikit';
|
|
5
|
-
import { MessageList } from '..';
|
|
6
|
-
import { ContentWrapper } from '../../../../demo/ContentWrapper';
|
|
7
|
-
import { Showcase } from '../../../../demo/Showcase';
|
|
8
|
-
import { ShowcaseItem } from '../../../../demo/ShowcaseItem';
|
|
9
|
-
import { createMessageRendererRegistry, registerMessageRenderer, } from '../../../../utils/messageTypeRegistry';
|
|
10
|
-
import { BaseMessageAction } from '../../../molecules/BaseMessage';
|
|
11
|
-
import MDXDocs from './Docs.mdx';
|
|
12
|
-
export default {
|
|
13
|
-
title: 'organisms/MessageList',
|
|
14
|
-
component: MessageList,
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
page: MDXDocs,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
messages: {
|
|
22
|
-
control: 'object',
|
|
23
|
-
description: 'Array of messages to render',
|
|
24
|
-
},
|
|
25
|
-
messageRendererRegistry: {
|
|
26
|
-
control: false,
|
|
27
|
-
description: 'Custom message renderer registry',
|
|
28
|
-
},
|
|
29
|
-
showActionsOnHover: {
|
|
30
|
-
control: 'boolean',
|
|
31
|
-
description: 'Show action buttons on hover for all messages',
|
|
32
|
-
},
|
|
33
|
-
showTimestamp: {
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
description: 'Show timestamp for all messages',
|
|
36
|
-
},
|
|
37
|
-
showAvatar: {
|
|
38
|
-
control: 'boolean',
|
|
39
|
-
description: 'Show avatar for user messages',
|
|
40
|
-
},
|
|
41
|
-
className: {
|
|
42
|
-
control: 'text',
|
|
43
|
-
description: 'Additional CSS class',
|
|
44
|
-
},
|
|
45
|
-
qa: {
|
|
46
|
-
control: 'text',
|
|
47
|
-
description: 'QA/test identifier',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
const defaultDecorators = [
|
|
52
|
-
(StoryComponent) => (_jsx(Showcase, { children: _jsx(StoryComponent, {}) })),
|
|
53
|
-
];
|
|
54
|
-
const userMessage = {
|
|
55
|
-
id: '1',
|
|
56
|
-
role: 'user',
|
|
57
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
58
|
-
content: 'Hello, how are you?',
|
|
59
|
-
};
|
|
60
|
-
const assistantMessage = {
|
|
61
|
-
id: '2',
|
|
62
|
-
role: 'assistant',
|
|
63
|
-
timestamp: '2024-01-01T00:00:01Z',
|
|
64
|
-
content: 'Hi! I am doing well, thank you for asking.',
|
|
65
|
-
};
|
|
66
|
-
export const Playground = (args) => (_jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args)) }));
|
|
67
|
-
Playground.args = {
|
|
68
|
-
messages: [userMessage, assistantMessage],
|
|
69
|
-
};
|
|
70
|
-
export const WithSubmittedStatus = {
|
|
71
|
-
render: (args) => (_jsx(ShowcaseItem, { title: "With Submitted Status", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args, { messages: [userMessage], status: "submitted" })) }) })),
|
|
72
|
-
};
|
|
73
|
-
export const WithErrorMessage = {
|
|
74
|
-
render: (args) => (_jsx(ShowcaseItem, { title: "With Error Message", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args, { messages: [userMessage], status: "error",
|
|
75
|
-
// eslint-disable-next-line no-console
|
|
76
|
-
onRetry: () => console.log('retry') })) }) })),
|
|
77
|
-
};
|
|
78
|
-
const toolIcon = _jsx(Icon, { data: Pencil });
|
|
79
|
-
const toolHeaderContent = (_jsx(Text, { color: "secondary", variant: "body-1", children: "expectScreenshotFixture.ts" }));
|
|
80
|
-
export const WithToolMessage = {
|
|
81
|
-
render: (args) => (_jsx(ShowcaseItem, { title: "With Tool Message", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args, { messages: [
|
|
82
|
-
{
|
|
83
|
-
role: 'user',
|
|
84
|
-
content: 'Analyze the project and suggest a better solution to implement a feature-name',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
role: 'assistant',
|
|
88
|
-
content: [
|
|
89
|
-
{
|
|
90
|
-
type: 'text',
|
|
91
|
-
data: {
|
|
92
|
-
text: "I'll scan the SCSS structure: global styles and mixins, theme files, and a couple of component styles. I'll also search for the custom Sass function usage and theming patterns.",
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
type: 'tool',
|
|
97
|
-
data: {
|
|
98
|
-
toolName: 'Reading',
|
|
99
|
-
status: 'success',
|
|
100
|
-
toolIcon,
|
|
101
|
-
expandable: true,
|
|
102
|
-
headerContent: toolHeaderContent,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
type: 'text',
|
|
107
|
-
data: {
|
|
108
|
-
text: "Absolutely! Here are some suggestions for improving the SCSS structure: \n\n- Consider organizing global styles and mixins into separate directories for better modularity. \n- Group theme files and component styles to simplify maintenance. \n- Use consistent naming patterns for custom Sass functions and variables. \n- Leverage nesting carefully to avoid deeply nested selectors and improve readability. \n- Document theming patterns to ease onboarding for new contributors.\n\nLet me know if you'd like examples or more details on any point!",
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
] })) }) })),
|
|
114
|
-
decorators: defaultDecorators,
|
|
115
|
-
};
|
|
116
|
-
const ChartMessageView = ({ part }) => {
|
|
117
|
-
const { chartData, chartType } = part.data;
|
|
118
|
-
return (_jsxs("div", { style: {
|
|
119
|
-
padding: '16px',
|
|
120
|
-
border: '1px solid var(--g-color-line-generic)',
|
|
121
|
-
borderRadius: '8px',
|
|
122
|
-
backgroundColor: 'var(--g-color-base-float)',
|
|
123
|
-
}, children: [_jsxs("div", { style: { marginBottom: '8px', fontWeight: 'bold' }, children: ["Chart: ", chartType] }), _jsxs("div", { style: { fontSize: '12px', color: 'var(--g-color-text-secondary)' }, children: ["Labels: ", chartData.labels.join(', ')] }), _jsxs("div", { style: { fontSize: '12px', color: 'var(--g-color-text-secondary)' }, children: ["Datasets: ", chartData.datasets.length] })] }));
|
|
124
|
-
};
|
|
125
|
-
export const WithCustomMessageType = {
|
|
126
|
-
render: (args) => {
|
|
127
|
-
const customRegistry = createMessageRendererRegistry();
|
|
128
|
-
registerMessageRenderer(customRegistry, 'chart', {
|
|
129
|
-
component: ChartMessageView,
|
|
130
|
-
});
|
|
131
|
-
return (_jsx(ShowcaseItem, { title: "With Custom Message Type", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args, { messages: [
|
|
132
|
-
{
|
|
133
|
-
id: 'user-1',
|
|
134
|
-
role: 'user',
|
|
135
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
136
|
-
content: 'Hi! Can you show me the sales statistics for the first months of the year?',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 'assistant-1',
|
|
140
|
-
role: 'assistant',
|
|
141
|
-
timestamp: '2024-01-01T00:00:02Z',
|
|
142
|
-
content: [
|
|
143
|
-
{
|
|
144
|
-
type: 'text',
|
|
145
|
-
data: {
|
|
146
|
-
text: 'Sure! Here is a bar chart showing sales statistics by month. As you can see, February had the highest sales.',
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
type: 'chart',
|
|
151
|
-
data: {
|
|
152
|
-
chartData: {
|
|
153
|
-
labels: ['January', 'February', 'March', 'April'],
|
|
154
|
-
datasets: [
|
|
155
|
-
{
|
|
156
|
-
label: 'Sales',
|
|
157
|
-
data: [12, 19, 3, 5],
|
|
158
|
-
color: '#0077ff',
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
chartType: 'bar',
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
], messageRendererRegistry: customRegistry })) }) }));
|
|
168
|
-
},
|
|
169
|
-
decorators: defaultDecorators,
|
|
170
|
-
};
|
|
171
|
-
const streamingText = 'React Hooks are functions that let you use state and other React features without writing a class. ' +
|
|
172
|
-
'The most commonly used hooks are:\n\n' +
|
|
173
|
-
'1. **useState** - for managing component state\n' +
|
|
174
|
-
'2. **useEffect** - for side effects like data fetching or subscriptions\n' +
|
|
175
|
-
'3. **useContext** - for consuming context values\n' +
|
|
176
|
-
'4. **useCallback** - for memoizing functions\n' +
|
|
177
|
-
'5. **useMemo** - for memoizing computed values\n\n' +
|
|
178
|
-
'Each hook serves a specific purpose and helps you write cleaner, more maintainable React code. ' +
|
|
179
|
-
'Would you like examples of how to use any of these hooks?';
|
|
180
|
-
export const WithStreamingMessage = {
|
|
181
|
-
render: (args) => {
|
|
182
|
-
const [streamedText, setStreamedText] = useState('');
|
|
183
|
-
const [isStreaming, setIsStreaming] = useState(true);
|
|
184
|
-
useEffect(() => {
|
|
185
|
-
setStreamedText('');
|
|
186
|
-
setIsStreaming(true);
|
|
187
|
-
const resultText = streamingText.repeat(10);
|
|
188
|
-
let currentIndex = 0;
|
|
189
|
-
const interval = setInterval(() => {
|
|
190
|
-
if (currentIndex < resultText.length) {
|
|
191
|
-
const nextChunk = resultText.slice(0, currentIndex + 1);
|
|
192
|
-
setStreamedText(nextChunk);
|
|
193
|
-
currentIndex += Math.floor(Math.random() * 4) + 3;
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
setIsStreaming(false);
|
|
197
|
-
clearInterval(interval);
|
|
198
|
-
}
|
|
199
|
-
}, 20);
|
|
200
|
-
return () => {
|
|
201
|
-
clearInterval(interval);
|
|
202
|
-
};
|
|
203
|
-
}, []);
|
|
204
|
-
const messages = [
|
|
205
|
-
{
|
|
206
|
-
id: 'user-1',
|
|
207
|
-
role: 'user',
|
|
208
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
209
|
-
content: 'Can you explain React Hooks to me?',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: 'assistant-1',
|
|
213
|
-
role: 'assistant',
|
|
214
|
-
timestamp: '2024-01-01T00:00:01Z',
|
|
215
|
-
content: streamedText || ' ',
|
|
216
|
-
},
|
|
217
|
-
];
|
|
218
|
-
return (_jsx(ShowcaseItem, { title: "With Streaming Message", children: _jsx(ContentWrapper, { width: "480px", height: "200px", display: "flex", children: _jsx(MessageList, Object.assign({}, args, { messages: messages, status: isStreaming ? 'streaming' : 'ready' })) }) }));
|
|
219
|
-
},
|
|
220
|
-
decorators: defaultDecorators,
|
|
221
|
-
};
|
|
222
|
-
export const WithDefaultActions = {
|
|
223
|
-
render: (args) => {
|
|
224
|
-
const userActions = [
|
|
225
|
-
{
|
|
226
|
-
type: BaseMessageAction.Edit,
|
|
227
|
-
onClick: (message) => {
|
|
228
|
-
// eslint-disable-next-line no-console
|
|
229
|
-
console.log('Edit user message:', message.id);
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
type: BaseMessageAction.Delete,
|
|
234
|
-
onClick: (message) => {
|
|
235
|
-
// eslint-disable-next-line no-console
|
|
236
|
-
console.log('Delete user message:', message.id);
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
];
|
|
240
|
-
const assistantActions = [
|
|
241
|
-
{
|
|
242
|
-
type: BaseMessageAction.Copy,
|
|
243
|
-
onClick: (message) => {
|
|
244
|
-
// eslint-disable-next-line no-console
|
|
245
|
-
console.log('Copy assistant message:', message.id);
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
type: BaseMessageAction.Like,
|
|
250
|
-
onClick: (message) => {
|
|
251
|
-
// eslint-disable-next-line no-console
|
|
252
|
-
console.log('Like assistant message:', message.id);
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
];
|
|
256
|
-
return (_jsx(ShowcaseItem, { title: "With Default Actions", children: _jsx(ContentWrapper, { width: "480px", children: _jsx(MessageList, Object.assign({}, args, { messages: [
|
|
257
|
-
{
|
|
258
|
-
id: 'user-1',
|
|
259
|
-
role: 'user',
|
|
260
|
-
timestamp: '2024-01-01T00:00:00Z',
|
|
261
|
-
content: 'Hello! This message has default actions.',
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
id: 'assistant-1',
|
|
265
|
-
role: 'assistant',
|
|
266
|
-
timestamp: '2024-01-01T00:00:01Z',
|
|
267
|
-
content: 'Hi! This message also has default actions.',
|
|
268
|
-
status: 'complete',
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
id: 'user-2',
|
|
272
|
-
role: 'user',
|
|
273
|
-
timestamp: '2024-01-01T00:00:02Z',
|
|
274
|
-
content: 'This message has custom actions.',
|
|
275
|
-
actions: [
|
|
276
|
-
{
|
|
277
|
-
type: 'custom',
|
|
278
|
-
onClick: () => {
|
|
279
|
-
// eslint-disable-next-line no-console
|
|
280
|
-
console.log('Custom action clicked');
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
],
|
|
284
|
-
},
|
|
285
|
-
], userActions: userActions, assistantActions: assistantActions })) }) }));
|
|
286
|
-
},
|
|
287
|
-
decorators: defaultDecorators,
|
|
288
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { PromptInput } from '../PromptInput';
|
|
3
|
-
declare const _default: Meta;
|
|
4
|
-
export default _default;
|
|
5
|
-
type Story = StoryObj<typeof PromptInput>;
|
|
6
|
-
export declare const Playground: Story;
|
|
7
|
-
export declare const FullView: Story;
|
|
8
|
-
export declare const WithSuggestions: Story;
|
|
9
|
-
export declare const WithContextIndicator: Story;
|
|
10
|
-
export declare const WithCustomTopContent: Story;
|
|
11
|
-
export declare const WithCustomBottomContent: Story;
|
|
12
|
-
export declare const WithTopPanel: Story;
|
|
13
|
-
export declare const WithBottomPanel: Story;
|
|
14
|
-
export declare const WithBothPanels: Story;
|
|
15
|
-
export declare const WithPanelToggle: Story;
|
|
16
|
-
export declare const Disabled: Story;
|
|
17
|
-
export declare const Streaming: Story;
|
|
18
|
-
export declare const ComplexExample: Story;
|