@gravity-ui/aikit 0.0.1

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.
Files changed (334) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/dist/.storybook/theme.d.ts +6 -0
  4. package/dist/.storybook/theme.js +28 -0
  5. package/dist/package.json +111 -0
  6. package/dist/src/components/atoms/ActionButton/ActionButton.d.ts +47 -0
  7. package/dist/src/components/atoms/ActionButton/ActionButton.js +34 -0
  8. package/dist/src/components/atoms/ActionButton/__stories__/ActionButton.stories.d.ts +8 -0
  9. package/dist/src/components/atoms/ActionButton/__stories__/ActionButton.stories.js +48 -0
  10. package/dist/src/components/atoms/ActionButton/index.d.ts +2 -0
  11. package/dist/src/components/atoms/ActionButton/index.js +1 -0
  12. package/dist/src/components/atoms/Alert/__stories__/Alert.stories.d.ts +9 -0
  13. package/dist/src/components/atoms/Alert/__stories__/Alert.stories.js +56 -0
  14. package/dist/src/components/atoms/Alert/index.d.ts +13 -0
  15. package/dist/src/components/atoms/Alert/index.js +25 -0
  16. package/dist/src/components/atoms/ChatDate/ChatDate.d.ts +19 -0
  17. package/dist/src/components/atoms/ChatDate/ChatDate.js +24 -0
  18. package/dist/src/components/atoms/ChatDate/__stories__/ChatDate.stories.d.ts +16 -0
  19. package/dist/src/components/atoms/ChatDate/__stories__/ChatDate.stories.js +83 -0
  20. package/dist/src/components/atoms/ChatDate/i18n/en.json +8 -0
  21. package/dist/src/components/atoms/ChatDate/i18n/index.d.ts +13 -0
  22. package/dist/src/components/atoms/ChatDate/i18n/index.js +5 -0
  23. package/dist/src/components/atoms/ChatDate/i18n/ru.json +10 -0
  24. package/dist/src/components/atoms/ChatDate/index.d.ts +1 -0
  25. package/dist/src/components/atoms/ChatDate/index.js +1 -0
  26. package/dist/src/components/atoms/ContextIndicator/__stories__/ContextIndicator.stories.d.ts +17 -0
  27. package/dist/src/components/atoms/ContextIndicator/__stories__/ContextIndicator.stories.js +72 -0
  28. package/dist/src/components/atoms/ContextIndicator/index.d.ts +19 -0
  29. package/dist/src/components/atoms/ContextIndicator/index.js +16 -0
  30. package/dist/src/components/atoms/ContextIndicator/utils.d.ts +1 -0
  31. package/dist/src/components/atoms/ContextIndicator/utils.js +9 -0
  32. package/dist/src/components/atoms/ContextItem/__stories__/ContextItem.stories.d.ts +6 -0
  33. package/dist/src/components/atoms/ContextItem/__stories__/ContextItem.stories.js +32 -0
  34. package/dist/src/components/atoms/ContextItem/index.d.ts +9 -0
  35. package/dist/src/components/atoms/ContextItem/index.js +8 -0
  36. package/dist/src/components/atoms/DiffStat/__stories__/DiffStat.stories.d.ts +7 -0
  37. package/dist/src/components/atoms/DiffStat/__stories__/DiffStat.stories.js +45 -0
  38. package/dist/src/components/atoms/DiffStat/index.d.ts +8 -0
  39. package/dist/src/components/atoms/DiffStat/index.js +8 -0
  40. package/dist/src/components/atoms/Disclaimer/Disclaimer.d.ts +19 -0
  41. package/dist/src/components/atoms/Disclaimer/Disclaimer.js +15 -0
  42. package/dist/src/components/atoms/Disclaimer/__stories__/Disclaimer.stories.d.ts +8 -0
  43. package/dist/src/components/atoms/Disclaimer/__stories__/Disclaimer.stories.js +32 -0
  44. package/dist/src/components/atoms/Disclaimer/index.d.ts +1 -0
  45. package/dist/src/components/atoms/Disclaimer/index.js +1 -0
  46. package/dist/src/components/atoms/InlineCitation/index.d.ts +1 -0
  47. package/dist/src/components/atoms/InlineCitation/index.js +1 -0
  48. package/dist/src/components/atoms/Loader/Loader.d.ts +9 -0
  49. package/dist/src/components/atoms/Loader/Loader.js +11 -0
  50. package/dist/src/components/atoms/Loader/__stories__/Loader.stories.d.ts +8 -0
  51. package/dist/src/components/atoms/Loader/__stories__/Loader.stories.js +47 -0
  52. package/dist/src/components/atoms/Loader/index.d.ts +1 -0
  53. package/dist/src/components/atoms/Loader/index.js +1 -0
  54. package/dist/src/components/atoms/MarkdownRenderer/MarkdownRenderer.d.ts +10 -0
  55. package/dist/src/components/atoms/MarkdownRenderer/MarkdownRenderer.js +24 -0
  56. package/dist/src/components/atoms/MarkdownRenderer/__stories__/MarkdownRenderer.stories.d.ts +6 -0
  57. package/dist/src/components/atoms/MarkdownRenderer/__stories__/MarkdownRenderer.stories.js +49 -0
  58. package/dist/src/components/atoms/MarkdownRenderer/index.d.ts +1 -0
  59. package/dist/src/components/atoms/MarkdownRenderer/index.js +1 -0
  60. package/dist/src/components/atoms/MessageBalloon/__stories__/MessageBalloon.stories.d.ts +6 -0
  61. package/dist/src/components/atoms/MessageBalloon/__stories__/MessageBalloon.stories.js +32 -0
  62. package/dist/src/components/atoms/MessageBalloon/index.d.ts +7 -0
  63. package/dist/src/components/atoms/MessageBalloon/index.js +8 -0
  64. package/dist/src/components/atoms/Shimmer/__stories__/Shimmer.stories.d.ts +5 -0
  65. package/dist/src/components/atoms/Shimmer/__stories__/Shimmer.stories.js +28 -0
  66. package/dist/src/components/atoms/Shimmer/index.d.ts +6 -0
  67. package/dist/src/components/atoms/Shimmer/index.js +8 -0
  68. package/dist/src/components/atoms/SubmitButton/SubmitButton.d.ts +37 -0
  69. package/dist/src/components/atoms/SubmitButton/SubmitButton.js +33 -0
  70. package/dist/src/components/atoms/SubmitButton/__stories__/SubmitButton.stories.d.ts +12 -0
  71. package/dist/src/components/atoms/SubmitButton/__stories__/SubmitButton.stories.js +95 -0
  72. package/dist/src/components/atoms/SubmitButton/i18n/en.json +3 -0
  73. package/dist/src/components/atoms/SubmitButton/i18n/index.d.ts +13 -0
  74. package/dist/src/components/atoms/SubmitButton/i18n/index.js +5 -0
  75. package/dist/src/components/atoms/SubmitButton/i18n/ru.json +3 -0
  76. package/dist/src/components/atoms/SubmitButton/index.d.ts +1 -0
  77. package/dist/src/components/atoms/SubmitButton/index.js +1 -0
  78. package/dist/src/components/atoms/ToolIndicator/__stories__/ToolIndicator.stories.d.ts +9 -0
  79. package/dist/src/components/atoms/ToolIndicator/__stories__/ToolIndicator.stories.js +34 -0
  80. package/dist/src/components/atoms/ToolIndicator/index.d.ts +7 -0
  81. package/dist/src/components/atoms/ToolIndicator/index.js +26 -0
  82. package/dist/src/components/atoms/index.d.ts +14 -0
  83. package/dist/src/components/atoms/index.js +15 -0
  84. package/dist/src/components/index.d.ts +5 -0
  85. package/dist/src/components/index.js +6 -0
  86. package/dist/src/components/molecules/BaseMessage/__stories__/BaseMessage.stories.d.ts +8 -0
  87. package/dist/src/components/molecules/BaseMessage/__stories__/BaseMessage.stories.js +66 -0
  88. package/dist/src/components/molecules/BaseMessage/i18n/en.json +8 -0
  89. package/dist/src/components/molecules/BaseMessage/i18n/index.d.ts +13 -0
  90. package/dist/src/components/molecules/BaseMessage/i18n/index.js +5 -0
  91. package/dist/src/components/molecules/BaseMessage/i18n/ru.json +8 -0
  92. package/dist/src/components/molecules/BaseMessage/index.d.ts +11 -0
  93. package/dist/src/components/molecules/BaseMessage/index.js +48 -0
  94. package/dist/src/components/molecules/ButtonGroup/__stories__/ButtonGroup.stories.d.ts +6 -0
  95. package/dist/src/components/molecules/ButtonGroup/__stories__/ButtonGroup.stories.js +44 -0
  96. package/dist/src/components/molecules/ButtonGroup/index.d.ts +8 -0
  97. package/dist/src/components/molecules/ButtonGroup/index.js +8 -0
  98. package/dist/src/components/molecules/InputContext/index.d.ts +1 -0
  99. package/dist/src/components/molecules/InputContext/index.js +1 -0
  100. package/dist/src/components/molecules/PromptInputBody/PromptInputBody.d.ts +39 -0
  101. package/dist/src/components/molecules/PromptInputBody/PromptInputBody.js +26 -0
  102. package/dist/src/components/molecules/PromptInputBody/__stories__/PromptInputBody.stories.d.ts +11 -0
  103. package/dist/src/components/molecules/PromptInputBody/__stories__/PromptInputBody.stories.js +62 -0
  104. package/dist/src/components/molecules/PromptInputBody/index.d.ts +1 -0
  105. package/dist/src/components/molecules/PromptInputBody/index.js +1 -0
  106. package/dist/src/components/molecules/PromptInputFooter/PromptInputFooter.d.ts +39 -0
  107. package/dist/src/components/molecules/PromptInputFooter/PromptInputFooter.js +26 -0
  108. package/dist/src/components/molecules/PromptInputFooter/__stories__/PromptInputFooter.stories.d.ts +11 -0
  109. package/dist/src/components/molecules/PromptInputFooter/__stories__/PromptInputFooter.stories.js +96 -0
  110. package/dist/src/components/molecules/PromptInputFooter/i18n/en.json +5 -0
  111. package/dist/src/components/molecules/PromptInputFooter/i18n/index.d.ts +13 -0
  112. package/dist/src/components/molecules/PromptInputFooter/i18n/index.js +5 -0
  113. package/dist/src/components/molecules/PromptInputFooter/i18n/ru.json +5 -0
  114. package/dist/src/components/molecules/PromptInputFooter/index.d.ts +1 -0
  115. package/dist/src/components/molecules/PromptInputFooter/index.js +1 -0
  116. package/dist/src/components/molecules/PromptInputHeader/PromptInputHeader.d.ts +39 -0
  117. package/dist/src/components/molecules/PromptInputHeader/PromptInputHeader.js +28 -0
  118. package/dist/src/components/molecules/PromptInputHeader/__stories__/PromptInputHeader.stories.d.ts +13 -0
  119. package/dist/src/components/molecules/PromptInputHeader/__stories__/PromptInputHeader.stories.js +103 -0
  120. package/dist/src/components/molecules/PromptInputHeader/index.d.ts +1 -0
  121. package/dist/src/components/molecules/PromptInputHeader/index.js +1 -0
  122. package/dist/src/components/molecules/PromptInputPanel/PromptInputPanel.d.ts +20 -0
  123. package/dist/src/components/molecules/PromptInputPanel/PromptInputPanel.js +14 -0
  124. package/dist/src/components/molecules/PromptInputPanel/__stories__/PromptInputPanel.stories.d.ts +8 -0
  125. package/dist/src/components/molecules/PromptInputPanel/__stories__/PromptInputPanel.stories.js +38 -0
  126. package/dist/src/components/molecules/PromptInputPanel/index.d.ts +2 -0
  127. package/dist/src/components/molecules/PromptInputPanel/index.js +1 -0
  128. package/dist/src/components/molecules/Suggestions/Suggestions.d.ts +37 -0
  129. package/dist/src/components/molecules/Suggestions/Suggestions.js +27 -0
  130. package/dist/src/components/molecules/Suggestions/__stories__/Suggestions.stories.d.ts +19 -0
  131. package/dist/src/components/molecules/Suggestions/__stories__/Suggestions.stories.js +143 -0
  132. package/dist/src/components/molecules/Suggestions/index.d.ts +1 -0
  133. package/dist/src/components/molecules/Suggestions/index.js +1 -0
  134. package/dist/src/components/molecules/Tabs/Tabs.d.ts +15 -0
  135. package/dist/src/components/molecules/Tabs/Tabs.js +24 -0
  136. package/dist/src/components/molecules/Tabs/__stories__/Tabs.stories.d.ts +9 -0
  137. package/dist/src/components/molecules/Tabs/__stories__/Tabs.stories.js +103 -0
  138. package/dist/src/components/molecules/Tabs/i18n/en.json +3 -0
  139. package/dist/src/components/molecules/Tabs/i18n/index.d.ts +13 -0
  140. package/dist/src/components/molecules/Tabs/i18n/index.js +5 -0
  141. package/dist/src/components/molecules/Tabs/i18n/ru.json +3 -0
  142. package/dist/src/components/molecules/Tabs/index.d.ts +1 -0
  143. package/dist/src/components/molecules/Tabs/index.js +1 -0
  144. package/dist/src/components/molecules/ToolFooter/__stories__/ToolFooter.stories.d.ts +7 -0
  145. package/dist/src/components/molecules/ToolFooter/__stories__/ToolFooter.stories.js +58 -0
  146. package/dist/src/components/molecules/ToolFooter/index.d.ts +3 -0
  147. package/dist/src/components/molecules/ToolFooter/index.js +10 -0
  148. package/dist/src/components/molecules/ToolHeader/__stories__/ToolHeader.stories.d.ts +7 -0
  149. package/dist/src/components/molecules/ToolHeader/__stories__/ToolHeader.stories.js +55 -0
  150. package/dist/src/components/molecules/ToolHeader/index.d.ts +3 -0
  151. package/dist/src/components/molecules/ToolHeader/index.js +19 -0
  152. package/dist/src/components/molecules/index.d.ts +11 -0
  153. package/dist/src/components/molecules/index.js +12 -0
  154. package/dist/src/components/organisms/AssistantMessage/AssistantMessage.d.ts +14 -0
  155. package/dist/src/components/organisms/AssistantMessage/AssistantMessage.js +31 -0
  156. package/dist/src/components/organisms/AssistantMessage/__stories__/AssistantMessage.stories.d.ts +13 -0
  157. package/dist/src/components/organisms/AssistantMessage/__stories__/AssistantMessage.stories.js +151 -0
  158. package/dist/src/components/organisms/AssistantMessage/defaultMessageTypeRegistry.d.ts +3 -0
  159. package/dist/src/components/organisms/AssistantMessage/defaultMessageTypeRegistry.js +18 -0
  160. package/dist/src/components/organisms/AssistantMessage/index.d.ts +1 -0
  161. package/dist/src/components/organisms/AssistantMessage/index.js +1 -0
  162. package/dist/src/components/organisms/Header/Header.d.ts +9 -0
  163. package/dist/src/components/organisms/Header/Header.js +65 -0
  164. package/dist/src/components/organisms/Header/__stories__/Header.stories.d.ts +13 -0
  165. package/dist/src/components/organisms/Header/__stories__/Header.stories.js +130 -0
  166. package/dist/src/components/organisms/Header/i18n/en.json +7 -0
  167. package/dist/src/components/organisms/Header/i18n/index.d.ts +13 -0
  168. package/dist/src/components/organisms/Header/i18n/index.js +5 -0
  169. package/dist/src/components/organisms/Header/i18n/ru.json +7 -0
  170. package/dist/src/components/organisms/Header/index.d.ts +4 -0
  171. package/dist/src/components/organisms/Header/index.js +6 -0
  172. package/dist/src/components/organisms/Header/types.d.ts +23 -0
  173. package/dist/src/components/organisms/Header/types.js +7 -0
  174. package/dist/src/components/organisms/Header/useHeader.d.ts +21 -0
  175. package/dist/src/components/organisms/Header/useHeader.js +71 -0
  176. package/dist/src/components/organisms/MessageList/ErrorAlert.d.ts +6 -0
  177. package/dist/src/components/organisms/MessageList/ErrorAlert.js +15 -0
  178. package/dist/src/components/organisms/MessageList/MessageList.d.ts +20 -0
  179. package/dist/src/components/organisms/MessageList/MessageList.js +21 -0
  180. package/dist/src/components/organisms/MessageList/__stories__/MessageList.stories.d.ts +22 -0
  181. package/dist/src/components/organisms/MessageList/__stories__/MessageList.stories.js +168 -0
  182. package/dist/src/components/organisms/MessageList/i18n/en.json +4 -0
  183. package/dist/src/components/organisms/MessageList/i18n/index.d.ts +13 -0
  184. package/dist/src/components/organisms/MessageList/i18n/index.js +5 -0
  185. package/dist/src/components/organisms/MessageList/i18n/ru.json +4 -0
  186. package/dist/src/components/organisms/MessageList/index.d.ts +1 -0
  187. package/dist/src/components/organisms/MessageList/index.js +1 -0
  188. package/dist/src/components/organisms/PromptInput/PromptInput.d.ts +44 -0
  189. package/dist/src/components/organisms/PromptInput/PromptInput.js +38 -0
  190. package/dist/src/components/organisms/PromptInput/PromptInputFull.d.ts +26 -0
  191. package/dist/src/components/organisms/PromptInput/PromptInputFull.js +25 -0
  192. package/dist/src/components/organisms/PromptInput/PromptInputSimple.d.ts +24 -0
  193. package/dist/src/components/organisms/PromptInput/PromptInputSimple.js +21 -0
  194. package/dist/src/components/organisms/PromptInput/PromptInputWithPanels.d.ts +24 -0
  195. package/dist/src/components/organisms/PromptInput/PromptInputWithPanels.js +19 -0
  196. package/dist/src/components/organisms/PromptInput/PromptInputWithSuggestions.d.ts +22 -0
  197. package/dist/src/components/organisms/PromptInput/PromptInputWithSuggestions.js +16 -0
  198. package/dist/src/components/organisms/PromptInput/__stories__/PromptInput.stories.d.ts +18 -0
  199. package/dist/src/components/organisms/PromptInput/__stories__/PromptInput.stories.js +278 -0
  200. package/dist/src/components/organisms/PromptInput/index.d.ts +8 -0
  201. package/dist/src/components/organisms/PromptInput/index.js +7 -0
  202. package/dist/src/components/organisms/PromptInput/types.d.ts +72 -0
  203. package/dist/src/components/organisms/PromptInput/types.js +1 -0
  204. package/dist/src/components/organisms/PromptInput/useDelayedUnmount.d.ts +8 -0
  205. package/dist/src/components/organisms/PromptInput/useDelayedUnmount.js +26 -0
  206. package/dist/src/components/organisms/PromptInput/usePromptInput.d.ts +52 -0
  207. package/dist/src/components/organisms/PromptInput/usePromptInput.js +102 -0
  208. package/dist/src/components/organisms/ThinkingMessage/__stories__/ThinkingMessage.stories.d.ts +12 -0
  209. package/dist/src/components/organisms/ThinkingMessage/__stories__/ThinkingMessage.stories.js +107 -0
  210. package/dist/src/components/organisms/ThinkingMessage/i18n/en.json +4 -0
  211. package/dist/src/components/organisms/ThinkingMessage/i18n/index.d.ts +13 -0
  212. package/dist/src/components/organisms/ThinkingMessage/i18n/index.js +5 -0
  213. package/dist/src/components/organisms/ThinkingMessage/i18n/ru.json +4 -0
  214. package/dist/src/components/organisms/ThinkingMessage/index.d.ts +24 -0
  215. package/dist/src/components/organisms/ThinkingMessage/index.js +34 -0
  216. package/dist/src/components/organisms/ThinkingMessage/useThinkingMessage.d.ts +18 -0
  217. package/dist/src/components/organisms/ThinkingMessage/useThinkingMessage.js +23 -0
  218. package/dist/src/components/organisms/ToolMessage/__stories__/ToolMessage.stories.d.ts +11 -0
  219. package/dist/src/components/organisms/ToolMessage/__stories__/ToolMessage.stories.js +70 -0
  220. package/dist/src/components/organisms/ToolMessage/i18n/en.json +9 -0
  221. package/dist/src/components/organisms/ToolMessage/i18n/index.d.ts +13 -0
  222. package/dist/src/components/organisms/ToolMessage/i18n/index.js +5 -0
  223. package/dist/src/components/organisms/ToolMessage/i18n/ru.json +9 -0
  224. package/dist/src/components/organisms/ToolMessage/index.d.ts +3 -0
  225. package/dist/src/components/organisms/ToolMessage/index.js +12 -0
  226. package/dist/src/components/organisms/UserMessage/__stories__/UserMessage.stories.d.ts +7 -0
  227. package/dist/src/components/organisms/UserMessage/__stories__/UserMessage.stories.js +70 -0
  228. package/dist/src/components/organisms/UserMessage/index.d.ts +13 -0
  229. package/dist/src/components/organisms/UserMessage/index.js +12 -0
  230. package/dist/src/components/organisms/index.d.ts +7 -0
  231. package/dist/src/components/organisms/index.js +8 -0
  232. package/dist/src/components/pages/ChatContainer/ChatContainer.d.ts +10 -0
  233. package/dist/src/components/pages/ChatContainer/ChatContainer.js +110 -0
  234. package/dist/src/components/pages/ChatContainer/__stories__/ChatContainer.stories.d.ts +53 -0
  235. package/dist/src/components/pages/ChatContainer/__stories__/ChatContainer.stories.js +707 -0
  236. package/dist/src/components/pages/ChatContainer/i18n/en.json +10 -0
  237. package/dist/src/components/pages/ChatContainer/i18n/index.d.ts +13 -0
  238. package/dist/src/components/pages/ChatContainer/i18n/index.js +5 -0
  239. package/dist/src/components/pages/ChatContainer/i18n/ru.json +10 -0
  240. package/dist/src/components/pages/ChatContainer/index.d.ts +2 -0
  241. package/dist/src/components/pages/ChatContainer/index.js +1 -0
  242. package/dist/src/components/pages/ChatContainer/types.d.ts +143 -0
  243. package/dist/src/components/pages/ChatContainer/types.js +1 -0
  244. package/dist/src/components/pages/ChatContainer/useChatContainer.d.ts +20 -0
  245. package/dist/src/components/pages/ChatContainer/useChatContainer.js +77 -0
  246. package/dist/src/components/pages/index.d.ts +1 -0
  247. package/dist/src/components/pages/index.js +2 -0
  248. package/dist/src/components/templates/ChatContent/ChatContent.d.ts +29 -0
  249. package/dist/src/components/templates/ChatContent/ChatContent.js +19 -0
  250. package/dist/src/components/templates/ChatContent/__stories__/ChatContent.stories.d.ts +14 -0
  251. package/dist/src/components/templates/ChatContent/__stories__/ChatContent.stories.js +315 -0
  252. package/dist/src/components/templates/ChatContent/index.d.ts +1 -0
  253. package/dist/src/components/templates/ChatContent/index.js +1 -0
  254. package/dist/src/components/templates/EmptyContainer/EmptyContainer.d.ts +57 -0
  255. package/dist/src/components/templates/EmptyContainer/EmptyContainer.js +26 -0
  256. package/dist/src/components/templates/EmptyContainer/__stories__/EmptyContainer.stories.d.ts +20 -0
  257. package/dist/src/components/templates/EmptyContainer/__stories__/EmptyContainer.stories.js +250 -0
  258. package/dist/src/components/templates/EmptyContainer/i18n/en.json +3 -0
  259. package/dist/src/components/templates/EmptyContainer/i18n/index.d.ts +13 -0
  260. package/dist/src/components/templates/EmptyContainer/i18n/index.js +5 -0
  261. package/dist/src/components/templates/EmptyContainer/i18n/ru.json +3 -0
  262. package/dist/src/components/templates/EmptyContainer/index.d.ts +1 -0
  263. package/dist/src/components/templates/EmptyContainer/index.js +1 -0
  264. package/dist/src/components/templates/History/ChatItem.d.ts +17 -0
  265. package/dist/src/components/templates/History/ChatItem.js +18 -0
  266. package/dist/src/components/templates/History/DateHeaderItem.d.ts +12 -0
  267. package/dist/src/components/templates/History/DateHeaderItem.js +12 -0
  268. package/dist/src/components/templates/History/History.d.ts +46 -0
  269. package/dist/src/components/templates/History/History.js +16 -0
  270. package/dist/src/components/templates/History/HistoryList.d.ts +43 -0
  271. package/dist/src/components/templates/History/HistoryList.js +87 -0
  272. package/dist/src/components/templates/History/__stories__/History.stories.d.ts +17 -0
  273. package/dist/src/components/templates/History/__stories__/History.stories.js +281 -0
  274. package/dist/src/components/templates/History/i18n/en.json +7 -0
  275. package/dist/src/components/templates/History/i18n/index.d.ts +13 -0
  276. package/dist/src/components/templates/History/i18n/index.js +5 -0
  277. package/dist/src/components/templates/History/i18n/ru.json +7 -0
  278. package/dist/src/components/templates/History/index.d.ts +8 -0
  279. package/dist/src/components/templates/History/index.js +4 -0
  280. package/dist/src/components/templates/index.d.ts +3 -0
  281. package/dist/src/components/templates/index.js +4 -0
  282. package/dist/src/constants/index.d.ts +1 -0
  283. package/dist/src/constants/index.js +1 -0
  284. package/dist/src/demo/ContentWrapper/ContentWrapper.d.ts +7 -0
  285. package/dist/src/demo/ContentWrapper/ContentWrapper.js +7 -0
  286. package/dist/src/demo/ContentWrapper/index.d.ts +1 -0
  287. package/dist/src/demo/ContentWrapper/index.js +1 -0
  288. package/dist/src/demo/DocsDecorator/DocsDecorator.d.ts +6 -0
  289. package/dist/src/demo/DocsDecorator/DocsDecorator.js +12 -0
  290. package/dist/src/demo/DocsDecorator/ThemeContext.d.ts +2 -0
  291. package/dist/src/demo/DocsDecorator/ThemeContext.js +2 -0
  292. package/dist/src/demo/Showcase/Showcase.d.ts +9 -0
  293. package/dist/src/demo/Showcase/Showcase.js +7 -0
  294. package/dist/src/demo/Showcase/index.d.ts +1 -0
  295. package/dist/src/demo/Showcase/index.js +1 -0
  296. package/dist/src/demo/ShowcaseItem/ShowcaseItem.d.ts +7 -0
  297. package/dist/src/demo/ShowcaseItem/ShowcaseItem.js +7 -0
  298. package/dist/src/demo/ShowcaseItem/index.d.ts +1 -0
  299. package/dist/src/demo/ShowcaseItem/index.js +1 -0
  300. package/dist/src/demo/SwapArea/SwapArea.d.ts +2 -0
  301. package/dist/src/demo/SwapArea/SwapArea.js +7 -0
  302. package/dist/src/demo/SwapArea/index.d.ts +1 -0
  303. package/dist/src/demo/SwapArea/index.js +1 -0
  304. package/dist/src/hooks/index.d.ts +2 -0
  305. package/dist/src/hooks/index.js +2 -0
  306. package/dist/src/hooks/useDateFormatter/index.d.ts +34 -0
  307. package/dist/src/hooks/useDateFormatter/index.js +101 -0
  308. package/dist/src/hooks/useToolMessage.d.ts +11 -0
  309. package/dist/src/hooks/useToolMessage.js +96 -0
  310. package/dist/src/index.d.ts +11 -0
  311. package/dist/src/index.js +19 -0
  312. package/dist/src/types/chat.d.ts +17 -0
  313. package/dist/src/types/chat.js +1 -0
  314. package/dist/src/types/common.d.ts +7 -0
  315. package/dist/src/types/common.js +1 -0
  316. package/dist/src/types/index.d.ts +4 -0
  317. package/dist/src/types/index.js +4 -0
  318. package/dist/src/types/messages.d.ts +62 -0
  319. package/dist/src/types/messages.js +1 -0
  320. package/dist/src/types/tool.d.ts +34 -0
  321. package/dist/src/types/tool.js +1 -0
  322. package/dist/src/utils/chatUtils.d.ts +23 -0
  323. package/dist/src/utils/chatUtils.js +43 -0
  324. package/dist/src/utils/cn.d.ts +11 -0
  325. package/dist/src/utils/cn.js +12 -0
  326. package/dist/src/utils/index.d.ts +4 -0
  327. package/dist/src/utils/index.js +5 -0
  328. package/dist/src/utils/messageTypeRegistry.d.ts +13 -0
  329. package/dist/src/utils/messageTypeRegistry.js +16 -0
  330. package/dist/src/utils/messageUtils.d.ts +4 -0
  331. package/dist/src/utils/messageUtils.js +25 -0
  332. package/dist/src/utils/validation.d.ts +16 -0
  333. package/dist/src/utils/validation.js +24 -0
  334. package/package.json +111 -0
@@ -0,0 +1,315 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /* eslint-disable no-console */
3
+ import { useState } from 'react';
4
+ import { CircleInfo } from '@gravity-ui/icons';
5
+ import { Icon } from '@gravity-ui/uikit';
6
+ import { ChatContent } from '..';
7
+ import { BaseMessageAction } from '../../../../components/molecules/BaseMessage';
8
+ import { ContentWrapper } from '../../../../demo/ContentWrapper';
9
+ import MDXDocs from './Docs.mdx';
10
+ export default {
11
+ title: 'templates/ChatContent',
12
+ component: ChatContent,
13
+ parameters: {
14
+ docs: {
15
+ page: MDXDocs,
16
+ },
17
+ },
18
+ };
19
+ const defaultDecorators = [
20
+ (Story) => (_jsx(ContentWrapper, { width: "600px", height: "800px", children: _jsx(Story, {}) })),
21
+ ];
22
+ const sampleActions = [
23
+ {
24
+ type: BaseMessageAction.Copy,
25
+ onClick: () => console.log('Copy clicked'),
26
+ },
27
+ {
28
+ type: BaseMessageAction.Edit,
29
+ onClick: () => console.log('Edit clicked'),
30
+ },
31
+ {
32
+ type: BaseMessageAction.Retry,
33
+ onClick: () => console.log('Retry clicked'),
34
+ },
35
+ {
36
+ type: BaseMessageAction.Like,
37
+ onClick: () => console.log('Like clicked'),
38
+ },
39
+ {
40
+ type: BaseMessageAction.Unlike,
41
+ onClick: () => console.log('Unlike clicked'),
42
+ },
43
+ {
44
+ type: BaseMessageAction.Delete,
45
+ onClick: () => console.log('Delete clicked'),
46
+ },
47
+ ];
48
+ // Sample messages for stories
49
+ const sampleMessages = [
50
+ {
51
+ id: '1',
52
+ role: 'user',
53
+ content: 'Hello! Can you help me with React?',
54
+ timestamp: '2024-01-01T12:00:00Z',
55
+ actions: sampleActions,
56
+ },
57
+ {
58
+ id: '2',
59
+ role: 'assistant',
60
+ content: 'Of course! I would be happy to help you with React. What would you like to know?',
61
+ timestamp: '2024-01-01T12:00:05Z',
62
+ actions: sampleActions,
63
+ },
64
+ {
65
+ id: '3',
66
+ role: 'user',
67
+ content: 'How do I use hooks?',
68
+ timestamp: '2024-01-01T12:01:00Z',
69
+ actions: sampleActions,
70
+ },
71
+ {
72
+ id: '4',
73
+ role: 'assistant',
74
+ content: 'React Hooks are functions that let you use state and other React features without writing a class. The most commonly used hooks are:\n\n1. **useState** - for managing component state\n2. **useEffect** - for side effects\n3. **useContext** - for consuming context\n\nWould you like examples of how to use any of these?',
75
+ timestamp: '2024-01-01T12:01:10Z',
76
+ actions: sampleActions,
77
+ },
78
+ ];
79
+ // Sample suggestions for empty state
80
+ const sampleSuggestions = [
81
+ { id: '1', title: 'Explain React hooks' },
82
+ { id: '2', title: 'How to use TypeScript with React?' },
83
+ { id: '3', title: 'Best practices for component structure' },
84
+ { id: '4', title: 'State management options' },
85
+ ];
86
+ export const Playground = {
87
+ args: {
88
+ view: 'empty',
89
+ emptyContainerProps: {
90
+ image: (_jsx(Icon, { data: CircleInfo, size: 120, style: { color: 'var(--g-color-text-complementary)' } })),
91
+ title: 'Welcome to AI Chat',
92
+ description: 'Start a conversation or choose a suggestion below',
93
+ suggestionTitle: "Don't know where to start? Try this:",
94
+ suggestions: sampleSuggestions,
95
+ onSuggestionClick: (content, id) => {
96
+ console.log('Suggestion clicked:', content, id);
97
+ },
98
+ },
99
+ },
100
+ decorators: defaultDecorators,
101
+ };
102
+ export const EmptyState = {
103
+ args: {
104
+ view: 'empty',
105
+ emptyContainerProps: {
106
+ title: 'Welcome to AI Assistant',
107
+ description: 'I can help you with coding questions, explain concepts, and assist with your development tasks.',
108
+ },
109
+ },
110
+ decorators: defaultDecorators,
111
+ };
112
+ export const EmptyStateWithSuggestions = {
113
+ args: {
114
+ view: 'empty',
115
+ emptyContainerProps: {
116
+ image: (_jsx(Icon, { data: CircleInfo, size: 100, style: { color: 'var(--g-color-text-complementary)' } })),
117
+ title: 'AI Development Assistant',
118
+ description: 'Ask questions, get code suggestions, or explore best practices.',
119
+ suggestionTitle: 'Popular topics:',
120
+ suggestions: sampleSuggestions,
121
+ onSuggestionClick: (content, id) => {
122
+ console.log('Suggestion clicked:', content, id);
123
+ },
124
+ },
125
+ },
126
+ decorators: defaultDecorators,
127
+ };
128
+ export const ChatStateWithMessages = {
129
+ args: {
130
+ view: 'chat',
131
+ messageListProps: {
132
+ messages: sampleMessages,
133
+ showTimestamp: true,
134
+ showAvatar: false,
135
+ },
136
+ },
137
+ decorators: defaultDecorators,
138
+ };
139
+ export const ChatStateWithActionsOnHover = {
140
+ args: {
141
+ view: 'chat',
142
+ messageListProps: {
143
+ messages: sampleMessages,
144
+ showTimestamp: true,
145
+ showActionsOnHover: true,
146
+ showAvatar: true,
147
+ },
148
+ },
149
+ decorators: defaultDecorators,
150
+ };
151
+ export const WithLongMessages = {
152
+ args: {
153
+ view: 'chat',
154
+ messageListProps: {
155
+ messages: sampleMessages,
156
+ showTimestamp: true,
157
+ },
158
+ },
159
+ decorators: defaultDecorators,
160
+ };
161
+ export const WithManyMessages = {
162
+ args: {
163
+ view: 'chat',
164
+ messageListProps: {
165
+ messages: [
166
+ ...sampleMessages,
167
+ {
168
+ id: '5',
169
+ role: 'user',
170
+ content: 'Can you show me an example?',
171
+ timestamp: '2024-01-01T12:02:00Z',
172
+ actions: sampleActions,
173
+ },
174
+ {
175
+ id: '6',
176
+ role: 'assistant',
177
+ content: `Here's a simple useState example:
178
+
179
+ \`\`\`tsx
180
+ import { useState } from 'react';
181
+
182
+ function Counter() {
183
+ const [count, setCount] = useState(0);
184
+
185
+ return (
186
+ <div>
187
+ <p>Count: {count}</p>
188
+ <button onClick={() => setCount(count + 1)}>Increment</button>
189
+ </div>
190
+ );
191
+ }
192
+ \`\`\`
193
+
194
+ This component maintains a count state and updates it when the button is clicked.`,
195
+ timestamp: '2024-01-01T12:02:05Z',
196
+ actions: sampleActions,
197
+ },
198
+ ],
199
+ showTimestamp: true,
200
+ },
201
+ },
202
+ decorators: defaultDecorators,
203
+ };
204
+ export const Interactive = {
205
+ render: () => {
206
+ const [view, setView] = useState('empty');
207
+ const [messages, setMessages] = useState([]);
208
+ const handleSuggestionClick = (content) => {
209
+ // Add user message
210
+ const userMessage = {
211
+ id: Date.now().toString(),
212
+ role: 'user',
213
+ content,
214
+ timestamp: new Date().toISOString(),
215
+ };
216
+ setMessages([userMessage]);
217
+ setView('chat');
218
+ // Simulate assistant response
219
+ setTimeout(() => {
220
+ const assistantMessage = {
221
+ id: (Date.now() + 1).toString(),
222
+ role: 'assistant',
223
+ content: `I received your message: "${content}". How can I help you further?`,
224
+ timestamp: new Date().toISOString(),
225
+ };
226
+ setMessages((prev) => [...prev, assistantMessage]);
227
+ }, 1000);
228
+ };
229
+ return (_jsx(ChatContent, { view: view, emptyContainerProps: {
230
+ title: 'Welcome to AI Chat',
231
+ description: 'Start a conversation or choose a suggestion below',
232
+ suggestionTitle: 'Try asking:',
233
+ suggestions: sampleSuggestions,
234
+ onSuggestionClick: handleSuggestionClick,
235
+ }, messageListProps: {
236
+ messages,
237
+ showTimestamp: true,
238
+ } }));
239
+ },
240
+ decorators: defaultDecorators,
241
+ };
242
+ export const LongConversation = {
243
+ args: {
244
+ view: 'chat',
245
+ messageListProps: {
246
+ messages: [
247
+ ...sampleMessages,
248
+ {
249
+ id: '5',
250
+ role: 'user',
251
+ content: 'Can you show me an example?',
252
+ timestamp: '2024-01-01T12:02:00Z',
253
+ actions: sampleActions,
254
+ },
255
+ {
256
+ id: '6',
257
+ role: 'assistant',
258
+ content: `Here's a simple useState example:
259
+
260
+ \`\`\`tsx
261
+ import { useState } from 'react';
262
+
263
+ function Counter() {
264
+ const [count, setCount] = useState(0);
265
+
266
+ return (
267
+ <div>
268
+ <p>Count: {count}</p>
269
+ <button onClick={() => setCount(count + 1)}>Increment</button>
270
+ </div>
271
+ );
272
+ }
273
+ \`\`\`
274
+
275
+ This component maintains a count state and updates it when the button is clicked.`,
276
+ timestamp: '2024-01-01T12:02:05Z',
277
+ actions: sampleActions,
278
+ },
279
+ {
280
+ id: '7',
281
+ role: 'user',
282
+ content: 'What about useEffect?',
283
+ timestamp: '2024-01-01T12:03:00Z',
284
+ actions: sampleActions,
285
+ },
286
+ {
287
+ id: '8',
288
+ role: 'assistant',
289
+ content: `useEffect is used for side effects. Here's an example:
290
+
291
+ \`\`\`tsx
292
+ import { useState, useEffect } from 'react';
293
+
294
+ function DataFetcher() {
295
+ const [data, setData] = useState(null);
296
+
297
+ useEffect(() => {
298
+ fetch('https://api.example.com/data')
299
+ .then(response => response.json())
300
+ .then(data => setData(data));
301
+ }, []); // Empty array means run once on mount
302
+
303
+ return <div>{data ? JSON.stringify(data) : 'Loading...'}</div>;
304
+ }
305
+ \`\`\``,
306
+ timestamp: '2024-01-01T12:03:10Z',
307
+ actions: sampleActions,
308
+ },
309
+ ],
310
+ showTimestamp: true,
311
+ showActionsOnHover: true,
312
+ },
313
+ },
314
+ decorators: defaultDecorators,
315
+ };
@@ -0,0 +1 @@
1
+ export { ChatContent, type ChatContentProps, type ChatContentView } from './ChatContent';
@@ -0,0 +1 @@
1
+ export { ChatContent } from './ChatContent';
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import { SuggestionsItem } from '../../molecules/Suggestions';
3
+ import './EmptyContainer.scss';
4
+ /**
5
+ * Suggestion item for EmptyContainer
6
+ */
7
+ export type Suggestion = SuggestionsItem;
8
+ /**
9
+ * Alignment options for content elements
10
+ */
11
+ export type ContentAlignment = 'left' | 'center' | 'right';
12
+ /**
13
+ * Alignment configuration for different sections
14
+ */
15
+ export interface AlignmentConfig {
16
+ /** Alignment for the image */
17
+ image?: ContentAlignment;
18
+ /** Alignment for the title */
19
+ title?: ContentAlignment;
20
+ /** Alignment for the description */
21
+ description?: ContentAlignment;
22
+ }
23
+ /**
24
+ * Props for the EmptyContainer component
25
+ */
26
+ export interface EmptyContainerProps {
27
+ /** Image or icon to display at the top */
28
+ image?: React.ReactNode;
29
+ /** Title text for the welcome screen */
30
+ title?: string;
31
+ /** Description text explaining the functionality */
32
+ description?: string;
33
+ /** Title for the suggestions section */
34
+ suggestionTitle?: string;
35
+ /** Array of suggestion items */
36
+ suggestions?: Suggestion[];
37
+ /** Callback when a suggestion is clicked */
38
+ onSuggestionClick?: (content: string, id?: string) => void;
39
+ /** Alignment configuration for image, title, and description */
40
+ alignment?: AlignmentConfig;
41
+ /** Callback for showing more suggestions */
42
+ showMore?: () => void;
43
+ /** Custom text for the show more button */
44
+ showMoreText?: string;
45
+ /** Additional CSS class */
46
+ className?: string;
47
+ /** QA/test identifier */
48
+ qa?: string;
49
+ }
50
+ /**
51
+ * EmptyContainer component - displays a welcome screen with image, title, description,
52
+ * and suggestions
53
+ *
54
+ * @param props - Component props
55
+ * @returns React component
56
+ */
57
+ export declare function EmptyContainer(props: EmptyContainerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ArrowRotateRight } from '@gravity-ui/icons';
3
+ import { Button, Text } from '@gravity-ui/uikit';
4
+ import { block } from '../../../utils/cn';
5
+ import { Suggestions } from '../../molecules/Suggestions';
6
+ import { i18n } from './i18n';
7
+ import './EmptyContainer.scss';
8
+ const b = block('empty-container');
9
+ /**
10
+ * EmptyContainer component - displays a welcome screen with image, title, description,
11
+ * and suggestions
12
+ *
13
+ * @param props - Component props
14
+ * @returns React component
15
+ */
16
+ export function EmptyContainer(props) {
17
+ const { image, title, description, suggestionTitle, suggestions = [], onSuggestionClick, alignment, showMore, showMoreText, className, qa, } = props;
18
+ const hasContent = title || description || (suggestions && suggestions.length > 0);
19
+ // Define alignment for each element
20
+ const imageAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.image) || 'left';
21
+ const titleAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.title) || 'left';
22
+ const descriptionAlignment = (alignment === null || alignment === void 0 ? void 0 : alignment.description) || 'left';
23
+ // Define text for "Show more" button with localization support
24
+ const showMoreButtonText = showMoreText || i18n('show-more-button');
25
+ return (_jsx("div", { className: b(null, className), "data-qa": qa, children: _jsx("div", { className: b('content'), children: hasContent && (_jsxs(_Fragment, { children: [_jsxs("div", { className: b('welcome-section'), children: [image && (_jsx("div", { className: b('image-container', { align: imageAlignment }), children: image })), _jsxs("div", { className: b('text-container'), children: [title && (_jsx(Text, { variant: "header-2", className: b('title', { align: titleAlignment }), children: title })), description && (_jsx(Text, { variant: "body-2", color: "complementary", className: b('description', { align: descriptionAlignment }), children: description }))] })] }), suggestions && suggestions.length > 0 && onSuggestionClick && (_jsxs("div", { className: b('suggestions-section'), children: [suggestionTitle && (_jsx("div", { className: b('suggestions-title'), children: _jsx(Text, { variant: "subheader-3", color: "primary", children: suggestionTitle }) })), _jsx("div", { children: _jsx(Suggestions, { items: suggestions, onClick: onSuggestionClick, layout: "grid" }) }), showMore && (_jsx("div", { className: b('show-more'), children: _jsxs(Button, { view: "flat-secondary", size: "l", onClick: showMore, className: b('show-more-button'), children: [_jsx(Button.Icon, { children: _jsx(ArrowRotateRight, {}) }), showMoreButtonText] }) }))] }))] })) }) }));
26
+ }
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import { EmptyContainer } from '..';
3
+ declare const _default: Meta;
4
+ export default _default;
5
+ type Story = StoryObj<typeof EmptyContainer>;
6
+ export declare const Playground: Story;
7
+ export declare const Default: Story;
8
+ export declare const WithImage: Story;
9
+ export declare const WithSuggestions: Story;
10
+ export declare const MinimalContent: Story;
11
+ export declare const OnlyDescription: Story;
12
+ export declare const CustomSuggestions: Story;
13
+ export declare const LongContent: Story;
14
+ export declare const WithLeftAlignment: Story;
15
+ export declare const WithRightAlignment: Story;
16
+ export declare const WithMixedAlignment: Story;
17
+ export declare const WithShowMoreButton: Story;
18
+ export declare const WithShowMoreButtonCustomText: Story;
19
+ export declare const WithShowMoreInteractive: Story;
20
+ export declare const CompleteExample: Story;
@@ -0,0 +1,250 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /* eslint-disable no-console */
3
+ import { useState } from 'react';
4
+ import { CircleInfo } from '@gravity-ui/icons';
5
+ import { Icon } from '@gravity-ui/uikit';
6
+ import { EmptyContainer } from '..';
7
+ import { ContentWrapper } from '../../../../demo/ContentWrapper';
8
+ import MDXDocs from './Docs.mdx';
9
+ export default {
10
+ title: 'templates/EmptyContainer',
11
+ component: EmptyContainer,
12
+ parameters: {
13
+ docs: {
14
+ page: MDXDocs,
15
+ },
16
+ },
17
+ };
18
+ const defaultDecorators = [
19
+ (Story) => (_jsx(ContentWrapper, { width: "600px", children: _jsx(Story, {}) })),
20
+ ];
21
+ const sampleSuggestions = [
22
+ { id: '1', title: 'Summarize recent activity' },
23
+ { id: '2', title: 'Check code for vulnerabilities' },
24
+ { id: '3', title: 'Explain project structure' },
25
+ { id: '4', title: 'Generate documentation' },
26
+ ];
27
+ export const Playground = {
28
+ args: {
29
+ image: (_jsx(Icon, { data: CircleInfo, size: 120, style: { color: 'var(--g-color-text-complementary)' } })),
30
+ title: 'Welcome to AI Chat',
31
+ description: 'Experience smarter, faster teamwork right inside your product! AI chat seamlessly integrates with your workflow – helping you with answering technical questions and much more.',
32
+ suggestionTitle: "Don't know where to start from? Try this:",
33
+ suggestions: sampleSuggestions,
34
+ onSuggestionClick: (content, id) => {
35
+ console.log('Suggestion clicked:', content, id);
36
+ },
37
+ },
38
+ decorators: defaultDecorators,
39
+ };
40
+ export const Default = {
41
+ args: {
42
+ title: 'Welcome to AI Chat',
43
+ description: 'Experience smarter, faster teamwork right inside your product! AI chat seamlessly integrates with your workflow – helping you with answering technical questions and much more.',
44
+ },
45
+ decorators: defaultDecorators,
46
+ };
47
+ export const WithImage = {
48
+ args: {
49
+ image: (_jsx(Icon, { data: CircleInfo, size: 120, style: { color: 'var(--g-color-text-complementary)' } })),
50
+ title: 'Welcome to AI Chat',
51
+ description: 'Ask me anything and I will help you with your tasks.',
52
+ },
53
+ decorators: defaultDecorators,
54
+ };
55
+ export const WithSuggestions = {
56
+ args: {
57
+ title: 'Welcome to AI Chat',
58
+ description: 'Get started with these helpful suggestions.',
59
+ suggestionTitle: "Don't know where to start from? Try this:",
60
+ suggestions: sampleSuggestions,
61
+ onSuggestionClick: (content, id) => {
62
+ console.log('Suggestion clicked:', content, id);
63
+ },
64
+ },
65
+ decorators: defaultDecorators,
66
+ };
67
+ export const MinimalContent = {
68
+ args: {
69
+ title: 'Welcome',
70
+ },
71
+ decorators: defaultDecorators,
72
+ };
73
+ export const OnlyDescription = {
74
+ args: {
75
+ description: 'This is a simple empty state with only a description.',
76
+ },
77
+ decorators: defaultDecorators,
78
+ };
79
+ export const CustomSuggestions = {
80
+ args: {
81
+ title: 'Quick Actions',
82
+ suggestionTitle: 'Choose an action:',
83
+ suggestions: [
84
+ { id: '1', title: 'Start new conversation', view: 'outlined' },
85
+ { id: '2', title: 'View history', view: 'flat', icon: 'right' },
86
+ { id: '3', title: 'Settings', view: 'flat', icon: 'left' },
87
+ ],
88
+ onSuggestionClick: (content, id) => {
89
+ console.log('Action clicked:', content, id);
90
+ },
91
+ },
92
+ decorators: defaultDecorators,
93
+ };
94
+ export const LongContent = {
95
+ args: {
96
+ title: 'Welcome to Our Advanced AI-Powered Chat Interface',
97
+ description: 'Experience the next generation of conversational AI technology that seamlessly integrates with your existing workflow. Our platform offers intelligent responses, context-aware suggestions, and advanced natural language processing capabilities to help you accomplish tasks faster and more efficiently. Whether you need help with code reviews, documentation, project planning, or answering complex technical questions, our AI assistant is here to support you every step of the way.',
98
+ suggestionTitle: 'Here are some popular ways to get started with the platform:',
99
+ suggestions: [
100
+ { id: '1', title: 'Analyze and summarize recent project activity and changes' },
101
+ {
102
+ id: '2',
103
+ title: 'Run comprehensive security audit and check code for vulnerabilities',
104
+ },
105
+ { id: '3', title: 'Generate detailed explanation of project structure and architecture' },
106
+ {
107
+ id: '4',
108
+ title: 'Create comprehensive documentation for all public APIs and methods',
109
+ },
110
+ ],
111
+ onSuggestionClick: (content, id) => {
112
+ console.log('Suggestion clicked:', content, id);
113
+ },
114
+ },
115
+ decorators: defaultDecorators,
116
+ };
117
+ export const WithLeftAlignment = {
118
+ args: {
119
+ image: (_jsx(Icon, { data: CircleInfo, size: 120, style: { color: 'var(--g-color-text-complementary)' } })),
120
+ title: 'Welcome to AI Chat',
121
+ description: 'Experience smarter, faster teamwork right inside your product! All content is aligned to the left.',
122
+ alignment: {
123
+ image: 'left',
124
+ title: 'left',
125
+ description: 'left',
126
+ },
127
+ suggestionTitle: "Don't know where to start from? Try this:",
128
+ suggestions: sampleSuggestions.slice(0, 3),
129
+ onSuggestionClick: (content, id) => {
130
+ console.log('Suggestion clicked:', content, id);
131
+ },
132
+ },
133
+ decorators: defaultDecorators,
134
+ };
135
+ export const WithRightAlignment = {
136
+ args: {
137
+ image: (_jsx(Icon, { data: CircleInfo, size: 80, style: { color: 'var(--g-color-text-complementary)' } })),
138
+ title: 'Welcome to AI Chat',
139
+ description: 'Experience smarter, faster teamwork right inside your product! All content is aligned to the right.',
140
+ alignment: {
141
+ image: 'right',
142
+ title: 'right',
143
+ description: 'right',
144
+ },
145
+ suggestionTitle: "Don't know where to start from? Try this:",
146
+ suggestions: sampleSuggestions.slice(0, 3),
147
+ onSuggestionClick: (content, id) => {
148
+ console.log('Suggestion clicked:', content, id);
149
+ },
150
+ },
151
+ decorators: defaultDecorators,
152
+ };
153
+ export const WithMixedAlignment = {
154
+ args: {
155
+ image: (_jsx(Icon, { data: CircleInfo, size: 64, style: { color: 'var(--g-color-text-complementary)' } })),
156
+ title: 'Welcome to AI Chat',
157
+ description: 'This example demonstrates mixed alignment: left title, right description.',
158
+ alignment: {
159
+ image: 'center',
160
+ title: 'left',
161
+ description: 'right',
162
+ },
163
+ suggestionTitle: "Don't know where to start from? Try this:",
164
+ suggestions: sampleSuggestions.slice(0, 2),
165
+ onSuggestionClick: (content, id) => {
166
+ console.log('Suggestion clicked:', content, id);
167
+ },
168
+ },
169
+ decorators: defaultDecorators,
170
+ };
171
+ export const WithShowMoreButton = {
172
+ args: {
173
+ title: 'Welcome to AI Chat',
174
+ description: 'Click the button below to load more suggestions.',
175
+ suggestionTitle: "Don't know where to start from? Try this:",
176
+ suggestions: sampleSuggestions.slice(0, 2),
177
+ onSuggestionClick: (content, id) => {
178
+ console.log('Suggestion clicked:', content, id);
179
+ },
180
+ showMore: () => {
181
+ console.log('Show more clicked');
182
+ },
183
+ },
184
+ decorators: defaultDecorators,
185
+ };
186
+ export const WithShowMoreButtonCustomText = {
187
+ args: {
188
+ title: 'Welcome to AI Chat',
189
+ description: 'Custom button text for loading more suggestions.',
190
+ suggestionTitle: 'Popular actions:',
191
+ suggestions: sampleSuggestions.slice(0, 2),
192
+ onSuggestionClick: (content, id) => {
193
+ console.log('Suggestion clicked:', content, id);
194
+ },
195
+ showMore: () => {
196
+ console.log('Show more clicked');
197
+ },
198
+ showMoreText: 'Load more suggestions',
199
+ },
200
+ decorators: defaultDecorators,
201
+ };
202
+ export const WithShowMoreInteractive = {
203
+ render: (args) => {
204
+ const [suggestions, setSuggestions] = useState(sampleSuggestions.slice(0, 2));
205
+ const [hasMore, setHasMore] = useState(true);
206
+ const loadMore = () => {
207
+ if (suggestions.length < sampleSuggestions.length) {
208
+ setSuggestions([
209
+ ...suggestions,
210
+ ...sampleSuggestions.slice(suggestions.length, suggestions.length + 2),
211
+ ]);
212
+ }
213
+ if (suggestions.length + 2 >= sampleSuggestions.length) {
214
+ setHasMore(false);
215
+ }
216
+ };
217
+ return (_jsx(EmptyContainer, Object.assign({}, args, { suggestions: suggestions, showMore: hasMore ? loadMore : undefined })));
218
+ },
219
+ args: {
220
+ title: 'Welcome to AI Chat',
221
+ description: 'Interactive example: click "Show more" to load additional suggestions.',
222
+ suggestionTitle: "Don't know where to start from? Try this:",
223
+ onSuggestionClick: (content, id) => {
224
+ console.log('Suggestion clicked:', content, id);
225
+ },
226
+ },
227
+ decorators: defaultDecorators,
228
+ };
229
+ export const CompleteExample = {
230
+ args: {
231
+ image: (_jsx(Icon, { data: CircleInfo, size: 120, style: { color: 'var(--g-color-text-complementary)' } })),
232
+ title: 'Welcome to AI Chat',
233
+ description: 'Experience smarter, faster teamwork right inside your product! This example combines alignment and show more button.',
234
+ alignment: {
235
+ image: 'left',
236
+ title: 'left',
237
+ description: 'left',
238
+ },
239
+ suggestionTitle: "Don't know where to start from? Try this:",
240
+ suggestions: sampleSuggestions.slice(0, 2),
241
+ onSuggestionClick: (content, id) => {
242
+ console.log('Suggestion clicked:', content, id);
243
+ },
244
+ showMore: () => {
245
+ console.log('Show more clicked');
246
+ },
247
+ showMoreText: 'View all suggestions',
248
+ },
249
+ decorators: defaultDecorators,
250
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "show-more-button": "Show more examples"
3
+ }