@envive-ai/react-toolkit-v3 0.3.8 → 0.3.10

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 (238) hide show
  1. package/dist/AnimatedText/AnimatedText.cjs +1 -0
  2. package/dist/AnimatedText/AnimatedText.d.cts +3 -3
  3. package/dist/AnimatedText/AnimatedText.js +1 -0
  4. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  5. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  6. package/dist/Carousel/Carousel.cjs +1 -1
  7. package/dist/Carousel/Carousel.d.cts +2 -2
  8. package/dist/Carousel/Carousel.d.ts +2 -2
  9. package/dist/Carousel/Carousel.js +1 -1
  10. package/dist/Carousel/components/Container.cjs +2 -2
  11. package/dist/Carousel/components/Container.js +2 -2
  12. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  13. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  14. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  15. package/dist/ChatFooter/ChatFooter.js +1 -1
  16. package/dist/ChatFooter/components/Layout.cjs +2 -2
  17. package/dist/ChatFooter/components/Layout.js +2 -2
  18. package/dist/ChatFooter/components/index.d.cts +5 -5
  19. package/dist/ChatFooter/components/index.d.ts +5 -5
  20. package/dist/ChatHeader/ChatHeader.d.cts +2 -2
  21. package/dist/ChatHeader/ChatHeader.d.ts +2 -2
  22. package/dist/ChatHeader/components/Handle.cjs +2 -2
  23. package/dist/ChatHeader/components/Handle.js +2 -2
  24. package/dist/ChatHeader/components/Toggle.cjs +3 -3
  25. package/dist/ChatHeader/components/Toggle.js +3 -3
  26. package/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
  27. package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
  28. package/dist/ChatPreview/ChatPreview.cjs +14 -4
  29. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  30. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  31. package/dist/ChatPreview/ChatPreview.js +14 -4
  32. package/dist/ChatPreview/types/types.d.cts +5 -4
  33. package/dist/ChatPreview/types/types.d.ts +5 -4
  34. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +14 -4
  35. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  36. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  37. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +14 -4
  38. package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
  39. package/dist/ChatPreviewComparison/components/Headline.js +2 -2
  40. package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
  41. package/dist/ChatPreviewComparison/components/Layout.js +4 -4
  42. package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
  43. package/dist/ChatPreviewComparison/components/Message.js +2 -2
  44. package/dist/ChatPreviewComparison/types/types.d.cts +4 -4
  45. package/dist/ChatPreviewComparison/types/types.d.ts +4 -4
  46. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
  47. package/dist/Container/Container.d.cts +5 -5
  48. package/dist/Container/Container.d.ts +176 -176
  49. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  50. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  51. package/dist/Disclaimer/components/Container.cjs +2 -2
  52. package/dist/Disclaimer/components/Container.js +2 -2
  53. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  54. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  55. package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
  56. package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
  57. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
  58. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
  59. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  60. package/dist/FloatingChat/FloatingChat.cjs +3 -2
  61. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  62. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  63. package/dist/FloatingChat/FloatingChat.js +3 -2
  64. package/dist/FloatingChat/components/AgentMessage.cjs +9 -5
  65. package/dist/FloatingChat/components/AgentMessage.js +9 -5
  66. package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
  67. package/dist/FloatingChat/components/ChatMessages.js +1 -1
  68. package/dist/FloatingChat/components/Layout.cjs +13 -13
  69. package/dist/FloatingChat/components/Layout.js +13 -13
  70. package/dist/FloatingChat/components/ModalSheet.cjs +5 -6
  71. package/dist/FloatingChat/components/ModalSheet.js +5 -6
  72. package/dist/FloatingChat/components/ReviewCardsCarousel.cjs +2 -1
  73. package/dist/FloatingChat/components/ReviewCardsCarousel.js +2 -1
  74. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +0 -3
  75. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +0 -3
  76. package/dist/Image/Image.d.cts +2 -2
  77. package/dist/Image/Image.d.ts +2 -2
  78. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  79. package/dist/ImageGallery/ImageGallery.d.ts +2 -2
  80. package/dist/ImageGallery/components/Layout.cjs +1 -1
  81. package/dist/ImageGallery/components/Layout.js +1 -1
  82. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
  83. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
  84. package/dist/Message/components/LinkButton.cjs +1 -1
  85. package/dist/Message/components/LinkButton.js +1 -1
  86. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  87. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  88. package/dist/ProductCard/ProductCard.cjs +10 -6
  89. package/dist/ProductCard/ProductCard.d.cts +2 -2
  90. package/dist/ProductCard/ProductCard.d.ts +2 -2
  91. package/dist/ProductCard/ProductCard.js +5 -2
  92. package/dist/ProductCard/components/Header.cjs +2 -2
  93. package/dist/ProductCard/components/Header.js +2 -2
  94. package/dist/PromptButton/PromptButton.d.cts +2 -2
  95. package/dist/PromptButton/PromptButton.d.ts +2 -2
  96. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +3 -2
  97. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  98. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  99. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +3 -2
  100. package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +7 -2
  101. package/dist/PromptButtonCarouselWithImage/components/Layout.js +8 -3
  102. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +53 -3
  103. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +53 -3
  104. package/dist/PromptCarousel/PromptCarousel.cjs +71 -33
  105. package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
  106. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  107. package/dist/PromptCarousel/PromptCarousel.js +73 -35
  108. package/dist/PromptCarousel/hooks/index.cjs +2 -4
  109. package/dist/PromptCarousel/hooks/index.js +2 -4
  110. package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.cjs +91 -0
  111. package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.js +90 -0
  112. package/dist/PromptCarousel/hooks/useScrollSync.cjs +65 -0
  113. package/dist/PromptCarousel/hooks/useScrollSync.js +64 -0
  114. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  115. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  116. package/dist/ReviewCard/components/Container.cjs +2 -2
  117. package/dist/ReviewCard/components/Container.js +2 -2
  118. package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
  119. package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
  120. package/dist/ReviewCard/components/index.d.cts +4 -4
  121. package/dist/ReviewCard/components/index.d.ts +6 -6
  122. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  123. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  124. package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
  125. package/dist/SalesAgentProductCard/components/Container.js +2 -2
  126. package/dist/SalesAgentProductCard/components/index.d.cts +6 -6
  127. package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
  128. package/dist/SocialProof/SocialProof.cjs +1 -1
  129. package/dist/SocialProof/SocialProof.d.cts +2 -2
  130. package/dist/SocialProof/SocialProof.d.ts +2 -2
  131. package/dist/SocialProof/SocialProof.js +1 -1
  132. package/dist/SocialProof/components/Headline.cjs +3 -3
  133. package/dist/SocialProof/components/Headline.js +3 -3
  134. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  135. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  136. package/dist/SocialProof/components/Subheadline.cjs +1 -1
  137. package/dist/SocialProof/components/Subheadline.js +1 -1
  138. package/dist/Stack/Stack.d.cts +2 -2
  139. package/dist/TextField/utils/getIconColor.cjs +1 -1
  140. package/dist/TextField/utils/getIconColor.js +1 -1
  141. package/dist/TextField/utils/getSendIconElement.cjs +1 -1
  142. package/dist/TextField/utils/getSendIconElement.js +1 -1
  143. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  144. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  145. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
  146. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  147. package/dist/Tokens/index.cjs +1 -1
  148. package/dist/Tokens/index.js +1 -1
  149. package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
  150. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  151. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  152. package/dist/TypingAnimation/TypingAnimation.js +1 -1
  153. package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
  154. package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
  155. package/dist/Typography/Typography.d.cts +4 -4
  156. package/dist/Typography/Typography.d.ts +4 -4
  157. package/dist/WelcomeMessage/components/Container.cjs +2 -2
  158. package/dist/WelcomeMessage/components/Container.js +2 -2
  159. package/dist/WidgetTextField/WidgetTextField.cjs +11 -6
  160. package/dist/WidgetTextField/WidgetTextField.d.cts +3 -2
  161. package/dist/WidgetTextField/WidgetTextField.d.ts +3 -2
  162. package/dist/WidgetTextField/WidgetTextField.js +7 -2
  163. package/dist/WidgetTextField/components/Container.cjs +2 -2
  164. package/dist/WidgetTextField/components/Container.js +2 -2
  165. package/dist/WidgetTextField/components/FakeTextInput.cjs +2 -2
  166. package/dist/WidgetTextField/components/FakeTextInput.js +2 -2
  167. package/dist/WidgetTextField/components/Icon.cjs +11 -9
  168. package/dist/WidgetTextField/components/Icon.js +11 -9
  169. package/dist/WidgetTextField/types/types.d.cts +3 -0
  170. package/dist/WidgetTextField/types/types.d.ts +3 -0
  171. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  172. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  173. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  174. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  175. package/dist/styles.css +1 -1
  176. package/dist/utils/CustomIcon.cjs +1 -1
  177. package/dist/utils/CustomIcon.js +1 -1
  178. package/dist/utils/useDragToScroll.cjs +68 -0
  179. package/dist/utils/useDragToScroll.js +67 -0
  180. package/package.json +1 -1
  181. package/src/components/AnimatedText/AnimatedText.tsx +2 -0
  182. package/src/components/ChatHeader/hooks/useGetCloseButtonProperties.ts +1 -1
  183. package/src/components/ChatPreview/ChatPreview.tsx +20 -3
  184. package/src/components/ChatPreview/types/types.ts +5 -4
  185. package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +20 -3
  186. package/src/components/ChatPreviewComparison/types/types.ts +4 -4
  187. package/src/components/FloatingChat/FloatingChat.tsx +3 -2
  188. package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
  189. package/src/components/FloatingChat/components/Layout.tsx +7 -2
  190. package/src/components/FloatingChat/components/ModalSheet.tsx +5 -7
  191. package/src/components/FloatingChat/components/ReviewCardsCarousel.tsx +3 -0
  192. package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +0 -3
  193. package/src/components/ProductCard/ProductCard.tsx +12 -1
  194. package/src/components/ProductCard/components/Header.tsx +10 -8
  195. package/src/components/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.tsx +6 -3
  196. package/src/components/PromptButtonCarouselWithImage/components/Layout.tsx +13 -4
  197. package/src/components/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +63 -20
  198. package/src/components/PromptCarousel/PromptCarousel.tsx +89 -51
  199. package/src/components/PromptCarousel/hooks/index.ts +2 -4
  200. package/src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts +115 -0
  201. package/src/components/PromptCarousel/hooks/useHorizontalScrollAnimation.ts +71 -78
  202. package/src/components/PromptCarousel/hooks/useScrollSync.ts +83 -0
  203. package/src/components/TextField/utils/getIconColor.ts +1 -1
  204. package/src/components/TextField/utils/getSendIconElement.tsx +3 -1
  205. package/src/components/WidgetTextField/WidgetTextField.tsx +9 -1
  206. package/src/components/WidgetTextField/components/FakeTextInput.tsx +6 -2
  207. package/src/components/WidgetTextField/components/Icon.tsx +44 -9
  208. package/src/components/WidgetTextField/types/types.ts +3 -0
  209. package/src/components/utils/CustomIcon.tsx +1 -1
  210. package/src/components/utils/useDragToScroll.ts +83 -0
  211. package/dist/PromptCarousel/components/BlockScrollContainer.cjs +0 -23
  212. package/dist/PromptCarousel/components/BlockScrollContainer.js +0 -21
  213. package/dist/PromptCarousel/components/ButtonContainerRow.cjs +0 -34
  214. package/dist/PromptCarousel/components/ButtonContainerRow.js +0 -32
  215. package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.cjs +0 -45
  216. package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.js +0 -44
  217. package/dist/PromptCarousel/components/CarouselContentWithRowScroll.cjs +0 -33
  218. package/dist/PromptCarousel/components/CarouselContentWithRowScroll.js +0 -32
  219. package/dist/PromptCarousel/components/index.cjs +0 -13
  220. package/dist/PromptCarousel/components/index.js +0 -13
  221. package/dist/PromptCarousel/hooks/useButtonScrollPosition.cjs +0 -79
  222. package/dist/PromptCarousel/hooks/useButtonScrollPosition.js +0 -78
  223. package/dist/PromptCarousel/hooks/useCarouselAnimation.cjs +0 -23
  224. package/dist/PromptCarousel/hooks/useCarouselAnimation.js +0 -22
  225. package/dist/PromptCarousel/hooks/useCarouselRefs.cjs +0 -20
  226. package/dist/PromptCarousel/hooks/useCarouselRefs.js +0 -19
  227. package/dist/PromptCarousel/hooks/useGetScrollProperties.cjs +0 -18
  228. package/dist/PromptCarousel/hooks/useGetScrollProperties.js +0 -17
  229. package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.cjs +0 -78
  230. package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.js +0 -77
  231. package/src/components/PromptCarousel/components/BlockScrollContainer.tsx +0 -34
  232. package/src/components/PromptCarousel/components/ButtonContainerRow.tsx +0 -46
  233. package/src/components/PromptCarousel/components/CarouselContentWithBlockScroll.tsx +0 -83
  234. package/src/components/PromptCarousel/components/CarouselContentWithRowScroll.tsx +0 -71
  235. package/src/components/PromptCarousel/components/index.ts +0 -9
  236. package/src/components/PromptCarousel/hooks/useButtonScrollPosition.ts +0 -128
  237. package/src/components/PromptCarousel/hooks/useCarouselAnimation.ts +0 -47
  238. package/src/components/PromptCarousel/hooks/useCarouselRefs.ts +0 -27
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../packages/components-v3/tokens/theme/theme.cjs');
3
- require('../Tokens/index.cjs');
4
3
  const require_resolveTheme = require('../utils/resolveTheme.cjs');
4
+ require('../Tokens/index.cjs');
5
5
  const require_PromptButton_types_index = require('../PromptButton/types/index.cjs');
6
6
  require('../PromptButton/index.cjs');
7
7
  const require_PromptCarousel_types_types = require('../PromptCarousel/types/types.cjs');
@@ -12,15 +12,25 @@ const require_WidgetTextField = require('../WidgetTextField/WidgetTextField.cjs'
12
12
  require('../WidgetTextField/index.cjs');
13
13
  const require_WidgetWrapperWithTitle = require('../WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs');
14
14
  const require_index = require('./components/index.cjs');
15
+ let react = require("react");
15
16
  let react_jsx_runtime = require("react/jsx-runtime");
16
17
 
17
18
  //#region src/components/ChatPreviewComparison/ChatPreviewComparison.tsx
18
19
  const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEventProps }) => {
19
20
  const { id, testId, className, style } = baseProps ?? {};
20
21
  const { theme = require_theme.Theme.GLOBAL_CUSTOM, variant = require_types.WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
21
- const { headlineText, messageText, promptButtonTexts, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
22
+ const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
22
23
  const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
23
24
  const finalTheme = require_resolveTheme.resolveTheme(theme);
25
+ const suggestionTextMap = (0, react.useMemo)(() => {
26
+ return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
27
+ }, [promptButtons]);
28
+ const promptButtonTexts = (0, react.useMemo)(() => {
29
+ return Object.keys(suggestionTextMap);
30
+ }, [suggestionTextMap]);
31
+ const handleSuggestionButtonClick = (0, react.useCallback)((text) => {
32
+ handlePromptButtonClick?.(suggestionTextMap[text]);
33
+ }, [handlePromptButtonClick, suggestionTextMap]);
24
34
  const headline = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.ChatPreviewComparisonComponents.Headline, {
25
35
  headlineText: headlineText ?? "",
26
36
  theme: finalTheme
@@ -33,12 +43,12 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
33
43
  promptButtonTexts: promptButtonTexts ?? [],
34
44
  promptButtonType: require_PromptButton_types_index.PromptButtonVariant.SUGGESTED_RESPONSE,
35
45
  promptCarouselRows: require_PromptCarousel_types_types.PromptCarouselRows.ALWAYS_ONE,
36
- handleButtonClick: handlePromptButtonClick
46
+ handleButtonClick: handleSuggestionButtonClick
37
47
  });
38
48
  const widgetTextField = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetTextField.WidgetTextField, {
39
49
  theme: finalTheme,
40
50
  placeholder: textFieldPlaceholderText ?? "",
41
- onClick: () => handleTextFieldClick?.(textFieldPlaceholderText)
51
+ onClick: () => handleTextFieldClick?.()
42
52
  });
43
53
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_WidgetWrapperWithTitle.WidgetWrapperWithTitle, {
44
54
  id,
@@ -1,5 +1,5 @@
1
1
  import { ChatPreviewComparisonProps } from "./types/types.cjs";
2
- import * as react_jsx_runtime31 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime21 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
5
5
  declare const ChatPreviewComparison: ({
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
7
7
  widgetContentProps,
8
8
  widgetStyleProps,
9
9
  widgetEventProps
10
- }: ChatPreviewComparisonProps) => react_jsx_runtime31.JSX.Element;
10
+ }: ChatPreviewComparisonProps) => react_jsx_runtime21.JSX.Element;
11
11
  //#endregion
12
12
  export { ChatPreviewComparison };
@@ -1,5 +1,5 @@
1
1
  import { ChatPreviewComparisonProps } from "./types/types.js";
2
- import * as react_jsx_runtime34 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime31 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ChatPreviewComparison/ChatPreviewComparison.d.ts
5
5
  declare const ChatPreviewComparison: ({
@@ -7,6 +7,6 @@ declare const ChatPreviewComparison: ({
7
7
  widgetContentProps,
8
8
  widgetStyleProps,
9
9
  widgetEventProps
10
- }: ChatPreviewComparisonProps) => react_jsx_runtime34.JSX.Element;
10
+ }: ChatPreviewComparisonProps) => react_jsx_runtime31.JSX.Element;
11
11
  //#endregion
12
12
  export { ChatPreviewComparison };
@@ -1,6 +1,6 @@
1
1
  import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
2
- import "../Tokens/index.js";
3
2
  import { resolveTheme } from "../utils/resolveTheme.js";
3
+ import "../Tokens/index.js";
4
4
  import { PromptButtonVariant } from "../PromptButton/types/index.js";
5
5
  import "../PromptButton/index.js";
6
6
  import { PromptCarouselRows } from "../PromptCarousel/types/types.js";
@@ -11,15 +11,25 @@ import { WidgetTextField } from "../WidgetTextField/WidgetTextField.js";
11
11
  import "../WidgetTextField/index.js";
12
12
  import { WidgetWrapperWithTitle } from "../WidgetWrapperWithTitle/WidgetWrapperWithTitle.js";
13
13
  import { ChatPreviewComparisonComponents } from "./components/index.js";
14
+ import { useCallback, useMemo } from "react";
14
15
  import { jsx } from "react/jsx-runtime";
15
16
 
16
17
  //#region src/components/ChatPreviewComparison/ChatPreviewComparison.tsx
17
18
  const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps, widgetEventProps }) => {
18
19
  const { id, testId, className, style } = baseProps ?? {};
19
20
  const { theme = Theme.GLOBAL_CUSTOM, variant = WidgetWrapperVariant.CARD_WITH_BORDER, hideImage, hideTextField, hideLogo, hexCardColor } = widgetStyleProps ?? {};
20
- const { headlineText, messageText, promptButtonTexts, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
21
+ const { headlineText, messageText, promptButtons, textFieldPlaceholderText, images, logoSrc, titleLabel } = widgetContentProps ?? {};
21
22
  const { handlePromptButtonClick, handleTextFieldClick } = widgetEventProps ?? {};
22
23
  const finalTheme = resolveTheme(theme);
24
+ const suggestionTextMap = useMemo(() => {
25
+ return Object.fromEntries(promptButtons?.map((suggestion) => [suggestion.content, suggestion]) ?? []);
26
+ }, [promptButtons]);
27
+ const promptButtonTexts = useMemo(() => {
28
+ return Object.keys(suggestionTextMap);
29
+ }, [suggestionTextMap]);
30
+ const handleSuggestionButtonClick = useCallback((text) => {
31
+ handlePromptButtonClick?.(suggestionTextMap[text]);
32
+ }, [handlePromptButtonClick, suggestionTextMap]);
23
33
  const headline = /* @__PURE__ */ jsx(ChatPreviewComparisonComponents.Headline, {
24
34
  headlineText: headlineText ?? "",
25
35
  theme: finalTheme
@@ -32,12 +42,12 @@ const ChatPreviewComparison = ({ baseProps, widgetContentProps, widgetStyleProps
32
42
  promptButtonTexts: promptButtonTexts ?? [],
33
43
  promptButtonType: PromptButtonVariant.SUGGESTED_RESPONSE,
34
44
  promptCarouselRows: PromptCarouselRows.ALWAYS_ONE,
35
- handleButtonClick: handlePromptButtonClick
45
+ handleButtonClick: handleSuggestionButtonClick
36
46
  });
37
47
  const widgetTextField = /* @__PURE__ */ jsx(WidgetTextField, {
38
48
  theme: finalTheme,
39
49
  placeholder: textFieldPlaceholderText ?? "",
40
- onClick: () => handleTextFieldClick?.(textFieldPlaceholderText)
50
+ onClick: () => handleTextFieldClick?.()
41
51
  });
42
52
  return /* @__PURE__ */ jsx(WidgetWrapperWithTitle, {
43
53
  id,
@@ -1,10 +1,10 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
3
- require('../../Tokens/index.cjs');
4
- const require_resolveTheme = require('../../utils/resolveTheme.cjs');
5
3
  const require_index = require('../../Typography/types/index.cjs');
6
4
  const require_Typography = require('../../Typography/Typography.cjs');
7
5
  require('../../Typography/index.cjs');
6
+ const require_resolveTheme = require('../../utils/resolveTheme.cjs');
7
+ require('../../Tokens/index.cjs');
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
 
10
10
  //#region src/components/ChatPreviewComparison/components/Headline.tsx
@@ -1,9 +1,9 @@
1
1
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
- import "../../Tokens/index.js";
3
- import { resolveTheme } from "../../utils/resolveTheme.js";
4
2
  import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
5
3
  import { Typography } from "../../Typography/Typography.js";
6
4
  import "../../Typography/index.js";
5
+ import { resolveTheme } from "../../utils/resolveTheme.js";
6
+ import "../../Tokens/index.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
 
9
9
  //#region src/components/ChatPreviewComparison/components/Headline.tsx
@@ -3,12 +3,12 @@ const require_utils = require('../../DesignTokens/components/utils.cjs');
3
3
  const require_aspectRatio = require('../../packages/components-v3/tokens/aspectRatio/aspectRatio.cjs');
4
4
  const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
5
5
  const require_breakpoints = require('../../packages/components-v3/tokens/breakpoints/breakpoints.cjs');
6
- require('../../Tokens/index.cjs');
7
- const require_resolveTheme = require('../../utils/resolveTheme.cjs');
8
- const require_Container = require('../../Container/Container.cjs');
9
- require('../../Container/index.cjs');
10
6
  const require_Stack = require('../../Stack/Stack.cjs');
11
7
  require('../../Stack/index.cjs');
8
+ const require_Container = require('../../Container/Container.cjs');
9
+ require('../../Container/index.cjs');
10
+ const require_resolveTheme = require('../../utils/resolveTheme.cjs');
11
+ require('../../Tokens/index.cjs');
12
12
  const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
13
13
  const require_useGetContentSize = require('../../utils/useGetContentSize.cjs');
14
14
  const require_functions = require('../../SocialProof/utils/functions.cjs');
@@ -2,12 +2,12 @@ import { getCSSVariable } from "../../DesignTokens/components/utils.js";
2
2
  import { AspectRatioCSSVar } from "../../packages/components-v3/tokens/aspectRatio/aspectRatio.js";
3
3
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
4
4
  import { screensBreakpointsVariables } from "../../packages/components-v3/tokens/breakpoints/breakpoints.js";
5
- import "../../Tokens/index.js";
6
- import { resolveTheme } from "../../utils/resolveTheme.js";
7
- import { Container } from "../../Container/Container.js";
8
- import "../../Container/index.js";
9
5
  import { Stack } from "../../Stack/Stack.js";
10
6
  import "../../Stack/index.js";
7
+ import { Container } from "../../Container/Container.js";
8
+ import "../../Container/index.js";
9
+ import { resolveTheme } from "../../utils/resolveTheme.js";
10
+ import "../../Tokens/index.js";
11
11
  import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
12
12
  import { useGetContentSize } from "../../utils/useGetContentSize.js";
13
13
  import { calculateWidthImageGallery } from "../../SocialProof/utils/functions.js";
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../../packages/components-v3/tokens/theme/theme.cjs');
3
- require('../../Tokens/index.cjs');
4
- const require_resolveTheme = require('../../utils/resolveTheme.cjs');
5
3
  const require_index = require('../../Typography/types/index.cjs');
6
4
  require('../../Typography/index.cjs');
5
+ const require_resolveTheme = require('../../utils/resolveTheme.cjs');
6
+ require('../../Tokens/index.cjs');
7
7
  const require_useCheckIsMobile = require('../../utils/useCheckIsMobile.cjs');
8
8
  let react = require("react");
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -1,8 +1,8 @@
1
1
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
- import "../../Tokens/index.js";
3
- import { resolveTheme } from "../../utils/resolveTheme.js";
4
2
  import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
5
3
  import "../../Typography/index.js";
4
+ import { resolveTheme } from "../../utils/resolveTheme.js";
5
+ import "../../Tokens/index.js";
6
6
  import { useCheckIsMobile } from "../../utils/useCheckIsMobile.js";
7
7
  import { Suspense, lazy } from "react";
8
8
  import { jsx } from "react/jsx-runtime";
@@ -1,6 +1,7 @@
1
1
  import { Theme } from "../../tokens/theme/theme.cjs";
2
2
  import { WidgetWrapperVariant } from "../../WidgetWrapper/types/types.cjs";
3
3
  import { ImageGalleryImage } from "../../ImageGallery/types/types.cjs";
4
+ import { Suggestion } from "@envive-ai/react-hooks/application/models";
4
5
 
5
6
  //#region src/components/ChatPreviewComparison/types/types.d.ts
6
7
 
@@ -53,7 +54,7 @@ type WidgetContentProps = {
53
54
  /**
54
55
  * Array of text labels for the prompt buttons.
55
56
  */
56
- promptButtonTexts?: string[];
57
+ promptButtons?: Suggestion[];
57
58
  /**
58
59
  * Placeholder text for the text field input.
59
60
  * Displayed when the text field is visible.
@@ -119,13 +120,12 @@ type WidgetEventProps = {
119
120
  *
120
121
  * @param text - The text label of the clicked prompt button
121
122
  */
122
- handlePromptButtonClick?: (text: string) => void;
123
+ handlePromptButtonClick?: (suggestion: Suggestion) => void;
123
124
  /**
124
125
  * Callback function invoked when the text field is clicked.
125
126
  *
126
- * @param text - The placeholder text of the text field
127
127
  */
128
- handleTextFieldClick?: (text: string) => void;
128
+ handleTextFieldClick?: () => void;
129
129
  };
130
130
  /**
131
131
  * Props for the ChatPreviewComparison component.
@@ -1,6 +1,7 @@
1
1
  import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
2
  import { WidgetWrapperVariant } from "../../WidgetWrapper/types/types.js";
3
3
  import { ImageGalleryImage } from "../../ImageGallery/types/types.js";
4
+ import { Suggestion } from "@envive-ai/react-hooks/application/models";
4
5
 
5
6
  //#region src/components/ChatPreviewComparison/types/types.d.ts
6
7
 
@@ -53,7 +54,7 @@ type WidgetContentProps = {
53
54
  /**
54
55
  * Array of text labels for the prompt buttons.
55
56
  */
56
- promptButtonTexts?: string[];
57
+ promptButtons?: Suggestion[];
57
58
  /**
58
59
  * Placeholder text for the text field input.
59
60
  * Displayed when the text field is visible.
@@ -119,13 +120,12 @@ type WidgetEventProps = {
119
120
  *
120
121
  * @param text - The text label of the clicked prompt button
121
122
  */
122
- handlePromptButtonClick?: (text: string) => void;
123
+ handlePromptButtonClick?: (suggestion: Suggestion) => void;
123
124
  /**
124
125
  * Callback function invoked when the text field is clicked.
125
126
  *
126
- * @param text - The placeholder text of the text field
127
127
  */
128
- handleTextFieldClick?: (text: string) => void;
128
+ handleTextFieldClick?: () => void;
129
129
  };
130
130
  /**
131
131
  * Props for the ChatPreviewComparison component.
@@ -1,5 +1,5 @@
1
1
  import { ChatPreviewLoadingProps } from "./types/types.cjs";
2
- import * as react_jsx_runtime27 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ChatPreviewLoading/ChatPreviewLoading.d.ts
5
5
  declare const ChatPreviewLoading: ({
@@ -15,6 +15,6 @@ declare const ChatPreviewLoading: ({
15
15
  hideLogo,
16
16
  logoSrc,
17
17
  titleLabel
18
- }: ChatPreviewLoadingProps) => react_jsx_runtime27.JSX.Element;
18
+ }: ChatPreviewLoadingProps) => react_jsx_runtime18.JSX.Element;
19
19
  //#endregion
20
20
  export { ChatPreviewLoading };
@@ -18,9 +18,11 @@ declare const Container: ({
18
18
  centerContent,
19
19
  ...props
20
20
  }: ContainerProps & Omit<React.HTMLAttributes<HTMLElement>, "className" | "style" | "component">) => react10.DetailedReactHTMLElement<{
21
- title?: string | undefined;
22
- content?: string | undefined;
23
21
  onClick?: react10.MouseEventHandler<HTMLElement>;
22
+ color?: string | undefined;
23
+ slot?: string | undefined;
24
+ title?: string | undefined;
25
+ "aria-label"?: string | undefined;
24
26
  defaultChecked?: boolean | undefined;
25
27
  defaultValue?: string | number | readonly string[] | undefined;
26
28
  suppressContentEditableWarning?: boolean | undefined;
@@ -36,13 +38,13 @@ declare const Container: ({
36
38
  hidden?: boolean | undefined;
37
39
  lang?: string | undefined;
38
40
  nonce?: string | undefined;
39
- slot?: string | undefined;
40
41
  spellCheck?: (boolean | "true" | "false") | undefined;
41
42
  tabIndex?: number | undefined;
42
43
  translate?: "yes" | "no" | undefined;
43
44
  radioGroup?: string | undefined;
44
45
  role?: react10.AriaRole | undefined;
45
46
  about?: string | undefined;
47
+ content?: string | undefined;
46
48
  datatype?: string | undefined;
47
49
  inlist?: any;
48
50
  prefix?: string | undefined;
@@ -54,7 +56,6 @@ declare const Container: ({
54
56
  vocab?: string | undefined;
55
57
  autoCorrect?: string | undefined;
56
58
  autoSave?: string | undefined;
57
- color?: string | undefined;
58
59
  itemProp?: string | undefined;
59
60
  itemScope?: boolean | undefined;
60
61
  itemType?: string | undefined;
@@ -97,7 +98,6 @@ declare const Container: ({
97
98
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
98
99
  "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
99
100
  "aria-keyshortcuts"?: string | undefined;
100
- "aria-label"?: string | undefined;
101
101
  "aria-labelledby"?: string | undefined;
102
102
  "aria-level"?: number | undefined;
103
103
  "aria-live"?: "off" | "assertive" | "polite" | undefined;