@envive-ai/react-toolkit-v3 0.3.15 → 0.3.16

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 (216) hide show
  1. package/dist/AnimatedText/AnimatedText.d.cts +3 -3
  2. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  3. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  4. package/dist/Carousel/Carousel.cjs +1 -1
  5. package/dist/Carousel/Carousel.d.cts +2 -2
  6. package/dist/Carousel/Carousel.d.ts +2 -2
  7. package/dist/Carousel/Carousel.js +1 -1
  8. package/dist/Carousel/components/Container.cjs +2 -2
  9. package/dist/Carousel/components/Container.js +2 -2
  10. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  11. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  12. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  13. package/dist/ChatFooter/ChatFooter.js +1 -1
  14. package/dist/ChatFooter/components/Layout.cjs +2 -2
  15. package/dist/ChatFooter/components/Layout.js +2 -2
  16. package/dist/ChatFooter/components/index.d.cts +5 -5
  17. package/dist/ChatFooter/components/index.d.ts +5 -5
  18. package/dist/ChatFooter/hooks/useGetContainerProperties.cjs +1 -1
  19. package/dist/ChatFooter/hooks/useGetContainerProperties.js +1 -1
  20. package/dist/ChatHeader/ChatHeader.d.cts +2 -2
  21. package/dist/ChatHeader/components/Handle.cjs +8 -6
  22. package/dist/ChatHeader/components/Handle.js +8 -6
  23. package/dist/ChatHeader/components/Toggle.cjs +3 -3
  24. package/dist/ChatHeader/components/Toggle.js +3 -3
  25. package/dist/ChatPreview/ChatPreview.cjs +15 -6
  26. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  27. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  28. package/dist/ChatPreview/ChatPreview.js +15 -6
  29. package/dist/ChatPreview/components/Message.cjs +3 -2
  30. package/dist/ChatPreview/components/Message.js +3 -2
  31. package/dist/ChatPreview/types/types.d.cts +34 -2
  32. package/dist/ChatPreview/types/types.d.ts +34 -2
  33. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +12 -5
  34. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  35. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  36. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +12 -5
  37. package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
  38. package/dist/ChatPreviewComparison/components/Headline.js +2 -2
  39. package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
  40. package/dist/ChatPreviewComparison/components/Layout.js +4 -4
  41. package/dist/ChatPreviewComparison/components/Message.cjs +5 -4
  42. package/dist/ChatPreviewComparison/components/Message.js +5 -4
  43. package/dist/ChatPreviewComparison/types/types.d.cts +34 -1
  44. package/dist/ChatPreviewComparison/types/types.d.ts +34 -1
  45. package/dist/ChatPreviewLoading/ChatPreviewLoading.cjs +1 -1
  46. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
  47. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  48. package/dist/ChatPreviewLoading/ChatPreviewLoading.js +1 -1
  49. package/dist/Container/Container.d.cts +173 -173
  50. package/dist/Container/Container.d.ts +173 -173
  51. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  52. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  53. package/dist/Disclaimer/components/Container.cjs +2 -2
  54. package/dist/Disclaimer/components/Container.js +2 -2
  55. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  56. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  57. package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
  58. package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
  59. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
  60. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
  61. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  62. package/dist/FloatingButton/FloatingButton.d.ts +2 -2
  63. package/dist/FloatingChat/FloatingChat.cjs +4 -8
  64. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  65. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  66. package/dist/FloatingChat/FloatingChat.js +4 -8
  67. package/dist/FloatingChat/components/AgentMessage.cjs +1 -2
  68. package/dist/FloatingChat/components/AgentMessage.js +1 -2
  69. package/dist/FloatingChat/components/ChatMessages.cjs +2 -3
  70. package/dist/FloatingChat/components/ChatMessages.js +2 -3
  71. package/dist/FloatingChat/components/Layout.cjs +3 -3
  72. package/dist/FloatingChat/components/Layout.js +3 -3
  73. package/dist/FloatingChat/components/ModalSheet.cjs +13 -3
  74. package/dist/FloatingChat/components/ModalSheet.js +14 -4
  75. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +2 -3
  76. package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +2 -3
  77. package/dist/FloatingChat/hooks/useFilteredChatMessages.cjs +1 -1
  78. package/dist/FloatingChat/hooks/useFilteredChatMessages.js +1 -1
  79. package/dist/FloatingChat/hooks/useSnapControl.cjs +17 -16
  80. package/dist/FloatingChat/hooks/useSnapControl.js +17 -16
  81. package/dist/FloatingChat/hooks/useSnapSetup.cjs +9 -27
  82. package/dist/FloatingChat/hooks/useSnapSetup.js +10 -28
  83. package/dist/FloatingChat/snapConstants.cjs +10 -0
  84. package/dist/FloatingChat/snapConstants.js +7 -0
  85. package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +6 -3
  86. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
  87. package/dist/FullPageSalesAgent/FullPageSalesAgent.js +6 -3
  88. package/dist/FullPageSalesAgent/components/Layout.cjs +3 -1
  89. package/dist/FullPageSalesAgent/components/Layout.js +3 -1
  90. package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +2 -1
  91. package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +2 -1
  92. package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.cjs +10 -0
  93. package/dist/FullPageSalesAgent/hooks/useGetMessagesStyles.js +10 -0
  94. package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.cjs +4 -2
  95. package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.js +4 -2
  96. package/dist/Image/Image.d.cts +2 -2
  97. package/dist/Image/Image.d.ts +2 -2
  98. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  99. package/dist/ImageGallery/components/Layout.cjs +1 -1
  100. package/dist/ImageGallery/components/Layout.js +1 -1
  101. package/dist/MarkdownProcessor/MarkdownProcessor.cjs +2 -1
  102. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
  103. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
  104. package/dist/MarkdownProcessor/MarkdownProcessor.js +2 -1
  105. package/dist/Message/components/LinkButton.cjs +1 -1
  106. package/dist/Message/components/LinkButton.js +1 -1
  107. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  108. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  109. package/dist/ProductCard/ProductCard.cjs +10 -4
  110. package/dist/ProductCard/ProductCard.d.cts +8 -2
  111. package/dist/ProductCard/ProductCard.d.ts +8 -2
  112. package/dist/ProductCard/ProductCard.js +10 -4
  113. package/dist/ProductCard/components/Carousel.cjs +9 -3
  114. package/dist/ProductCard/components/Carousel.js +9 -3
  115. package/dist/ProductCard/types/index.d.cts +34 -0
  116. package/dist/ProductCard/types/index.d.ts +34 -0
  117. package/dist/PromptButton/PromptButton.d.cts +2 -2
  118. package/dist/PromptButton/PromptButton.d.ts +2 -2
  119. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  120. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  121. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
  122. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
  123. package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
  124. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  125. package/dist/PromptCarousel/PromptCarousel.js +3 -3
  126. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  127. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  128. package/dist/ReviewCard/components/Container.cjs +2 -2
  129. package/dist/ReviewCard/components/Container.js +2 -2
  130. package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
  131. package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
  132. package/dist/ReviewCard/components/index.d.cts +6 -6
  133. package/dist/ReviewCard/components/index.d.ts +4 -4
  134. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  135. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  136. package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
  137. package/dist/SalesAgentProductCard/components/Container.js +2 -2
  138. package/dist/SalesAgentProductCard/components/index.d.cts +6 -6
  139. package/dist/SalesAgentProductCard/components/index.d.ts +6 -6
  140. package/dist/SocialProof/SocialProof.cjs +5 -5
  141. package/dist/SocialProof/SocialProof.d.cts +2 -2
  142. package/dist/SocialProof/SocialProof.d.ts +2 -2
  143. package/dist/SocialProof/SocialProof.js +2 -2
  144. package/dist/SocialProof/components/Headline.cjs +3 -3
  145. package/dist/SocialProof/components/Headline.js +3 -3
  146. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  147. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  148. package/dist/SocialProof/components/Subheadline.cjs +1 -1
  149. package/dist/SocialProof/components/Subheadline.js +1 -1
  150. package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
  151. package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
  152. package/dist/Stack/Stack.d.ts +2 -2
  153. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  154. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  155. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  156. package/dist/Tokens/index.cjs +1 -1
  157. package/dist/Tokens/index.js +1 -1
  158. package/dist/TypingAnimation/TypingAnimation.cjs +9 -3
  159. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  160. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  161. package/dist/TypingAnimation/TypingAnimation.js +9 -3
  162. package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
  163. package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
  164. package/dist/TypingAnimation/types/index.d.cts +28 -0
  165. package/dist/TypingAnimation/types/index.d.ts +28 -0
  166. package/dist/Typography/Typography.d.ts +4 -4
  167. package/dist/WelcomeMessage/components/Container.cjs +2 -2
  168. package/dist/WelcomeMessage/components/Container.js +2 -2
  169. package/dist/WidgetTextField/WidgetTextField.cjs +1 -1
  170. package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
  171. package/dist/WidgetTextField/WidgetTextField.js +1 -1
  172. package/dist/WidgetTextField/components/Container.cjs +2 -2
  173. package/dist/WidgetTextField/components/Container.js +2 -2
  174. package/dist/WidgetTextField/components/Icon.cjs +3 -3
  175. package/dist/WidgetTextField/components/Icon.js +3 -3
  176. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  177. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  178. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  179. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  180. package/dist/styles.css +1 -1
  181. package/package.json +1 -1
  182. package/src/components/ChatFooter/__tests__/ChatFooter.test.tsx +3 -0
  183. package/src/components/ChatFooter/hooks/useGetContainerProperties.ts +1 -1
  184. package/src/components/ChatHeader/components/Handle.tsx +14 -4
  185. package/src/components/ChatPreview/ChatPreview.tsx +27 -6
  186. package/src/components/ChatPreview/__tests__/ChatPreview.test.tsx +16 -5
  187. package/src/components/ChatPreview/components/Message.tsx +3 -1
  188. package/src/components/ChatPreview/types/types.ts +35 -2
  189. package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +23 -6
  190. package/src/components/ChatPreviewComparison/__tests__/ChatPreviewComparison.test.tsx +16 -5
  191. package/src/components/ChatPreviewComparison/components/Message.tsx +7 -1
  192. package/src/components/ChatPreviewComparison/types/types.ts +35 -1
  193. package/src/components/FloatingChat/FloatingChat.tsx +3 -9
  194. package/src/components/FloatingChat/components/AgentMessage.tsx +0 -3
  195. package/src/components/FloatingChat/components/ChatMessages.tsx +0 -3
  196. package/src/components/FloatingChat/components/ModalSheet.tsx +18 -10
  197. package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +1 -5
  198. package/src/components/FloatingChat/hooks/useFilteredChatMessages.ts +2 -2
  199. package/src/components/FloatingChat/hooks/useScrollToBottom.ts +1 -0
  200. package/src/components/FloatingChat/hooks/useSnapControl.ts +17 -22
  201. package/src/components/FloatingChat/hooks/useSnapSetup.ts +16 -37
  202. package/src/components/FloatingChat/snapConstants.ts +7 -0
  203. package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +5 -2
  204. package/src/components/FullPageSalesAgent/components/Layout.tsx +3 -1
  205. package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +7 -2
  206. package/src/components/FullPageSalesAgent/hooks/useGetMessagesStyles.ts +11 -0
  207. package/src/components/FullPageSalesAgent/hooks/useGetScrollContentStyles.ts +5 -1
  208. package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +1 -1
  209. package/src/components/Message/__tests__/Message.test.tsx +3 -3
  210. package/src/components/ProductCard/ProductCard.tsx +13 -1
  211. package/src/components/ProductCard/__tests__/ProductCard.test.tsx +73 -1
  212. package/src/components/ProductCard/components/Carousel.tsx +13 -1
  213. package/src/components/ProductCard/types/index.ts +34 -0
  214. package/src/components/TypingAnimation/TypingAnimation.tsx +22 -7
  215. package/src/components/TypingAnimation/types/index.ts +29 -0
  216. package/src/components/WidgetTextField/components/Icon.tsx +2 -2
@@ -1,6 +1,6 @@
1
1
  import '@testing-library/jest-dom';
2
2
  import { beforeEach, describe, expect, it, vi } from 'vitest';
3
- import { render, screen } from '@testing-library/react';
3
+ import { fireEvent, render, screen } from '@testing-library/react';
4
4
  import { Theme } from '../../../../tokens/theme/theme';
5
5
  import { PromptButtonVariant } from '../../PromptButton';
6
6
  import { ProductCard } from '../ProductCard';
@@ -73,6 +73,22 @@ describe('ProductCard', () => {
73
73
  });
74
74
 
75
75
  describe('Callback handlers', () => {
76
+ it('should call onSelect when a prompt is clicked', () => {
77
+ const handleSelect = vi.fn();
78
+ render(
79
+ <ProductCard
80
+ {...defaultProps}
81
+ onSelect={handleSelect}
82
+ />,
83
+ );
84
+
85
+ const promptButton = screen.getByText('Prompt 1');
86
+ promptButton.click();
87
+
88
+ expect(handleSelect).toHaveBeenCalledTimes(1);
89
+ expect(handleSelect).toHaveBeenCalledWith('Prompt 1');
90
+ });
91
+
76
92
  it('should call onInputClick when input is clicked', () => {
77
93
  const handleInputClick = vi.fn();
78
94
  render(
@@ -88,6 +104,62 @@ describe('ProductCard', () => {
88
104
  expect(handleInputClick).toHaveBeenCalledTimes(1);
89
105
  });
90
106
 
107
+ it('should call onHover when a prompt is hovered', () => {
108
+ const handleHover = vi.fn();
109
+ render(
110
+ <ProductCard
111
+ {...defaultProps}
112
+ onHover={handleHover}
113
+ />,
114
+ );
115
+
116
+ const promptButton = screen.getByText('Prompt 1');
117
+ fireEvent.mouseOver(promptButton);
118
+
119
+ expect(handleHover).toHaveBeenCalledTimes(1);
120
+ expect(handleHover).toHaveBeenCalledWith('Prompt 1');
121
+ });
122
+
123
+ it('should call onMouseDown and onMouseUp when interacting with a prompt via mouse', () => {
124
+ const handleMouseDown = vi.fn();
125
+ const handleMouseUp = vi.fn();
126
+ render(
127
+ <ProductCard
128
+ {...defaultProps}
129
+ onMouseDown={handleMouseDown}
130
+ onMouseUp={handleMouseUp}
131
+ />,
132
+ );
133
+
134
+ const promptButton = screen.getByText('Prompt 1');
135
+ fireEvent.mouseDown(promptButton);
136
+ fireEvent.mouseUp(promptButton);
137
+
138
+ expect(handleMouseDown).toHaveBeenCalledTimes(1);
139
+ expect(handleMouseDown).toHaveBeenCalledWith('Prompt 1');
140
+ expect(handleMouseUp).toHaveBeenCalledTimes(1);
141
+ });
142
+
143
+ it('should call onTouchStart and onTouchEnd when interacting with a prompt via touch', () => {
144
+ const handleTouchStart = vi.fn();
145
+ const handleTouchEnd = vi.fn();
146
+ render(
147
+ <ProductCard
148
+ {...defaultProps}
149
+ onTouchStart={handleTouchStart}
150
+ onTouchEnd={handleTouchEnd}
151
+ />,
152
+ );
153
+
154
+ const promptButton = screen.getByText('Prompt 1');
155
+ fireEvent.touchStart(promptButton);
156
+ fireEvent.touchEnd(promptButton);
157
+
158
+ expect(handleTouchStart).toHaveBeenCalledTimes(1);
159
+ expect(handleTouchStart).toHaveBeenCalledWith('Prompt 1');
160
+ expect(handleTouchEnd).toHaveBeenCalledTimes(1);
161
+ });
162
+
91
163
  it('should render prompts in carousel', () => {
92
164
  render(
93
165
  <ProductCard
@@ -9,18 +9,30 @@ export const Carousel = ({
9
9
  prompts,
10
10
  promptButtonType,
11
11
  onSelect,
12
+ onDrag,
13
+ onHover,
14
+ onMouseDown,
15
+ onMouseUp,
16
+ onTouchStart,
17
+ onTouchEnd,
12
18
  }: CarouselProps) => {
13
19
  const resolvedTheme = resolveTheme(theme);
14
20
  const { carouselClasses } = useGetCarouselProperties();
15
21
  return (
16
22
  <PromptCarousel
17
23
  className={carouselClasses}
18
- handleButtonClick={onSelect}
19
24
  id={carouselId}
20
25
  promptCarouselRows={PromptCarouselRows.ALWAYS_TWO}
21
26
  theme={resolvedTheme}
22
27
  promptButtonType={promptButtonType}
23
28
  promptButtonTexts={prompts}
29
+ handleButtonClick={onSelect}
30
+ handleButtonDrag={onDrag}
31
+ handleButtonHover={onHover}
32
+ handleButtonMouseDown={onMouseDown}
33
+ handleButtonMouseUp={onMouseUp}
34
+ handleButtonTouchStart={onTouchStart}
35
+ handleButtonTouchEnd={onTouchEnd}
24
36
  />
25
37
  );
26
38
  };
@@ -18,6 +18,40 @@ export interface CarouselProps {
18
18
  * Callback function invoked when a prompt is selected.
19
19
  */
20
20
  onSelect: (prompt: string) => void;
21
+ /**
22
+ * Callback invoked when the user drags/swipes the carousel.
23
+ * Typically used for analytics or to pause other interactions while dragging.
24
+ */
25
+ onDrag?: () => void;
26
+ /**
27
+ * Callback invoked when the user hovers a specific prompt item.
28
+ *
29
+ * @param prompt The prompt currently being hovered.
30
+ */
31
+ onHover?: (prompt: string) => void;
32
+ /**
33
+ * Callback invoked when the user presses down on a specific prompt item.
34
+ * Useful for distinguishing a click/tap from a drag and for interaction tracking.
35
+ *
36
+ * @param prompt The prompt the user pressed down on.
37
+ */
38
+ onMouseDown?: (prompt: string) => void;
39
+ /**
40
+ * Callback invoked when the user releases the mouse button after interacting
41
+ * with the carousel or a prompt item.
42
+ */
43
+ onMouseUp?: () => void;
44
+ /**
45
+ * Callback invoked when the user starts a touch gesture on a specific prompt.
46
+ *
47
+ * @param prompt The prompt the user touched.
48
+ */
49
+ onTouchStart?: (prompt: string) => void;
50
+ /**
51
+ * Callback invoked when the user ends a touch gesture after interacting with
52
+ * the carousel or a prompt item.
53
+ */
54
+ onTouchEnd?: () => void;
21
55
  }
22
56
 
23
57
  /**
@@ -1,16 +1,16 @@
1
1
  import { useCallback, useMemo } from 'react';
2
2
  import { AnimatedText } from '../AnimatedText';
3
- import { Typography, TypographyColor } from '../Typography';
3
+ import { PromptButtonVariant } from '../PromptButton/types';
4
4
  import { PromptCarousel, PromptCarouselRows } from '../PromptCarousel';
5
+ import { Stack } from '../Stack';
6
+ import { Theme } from '../Tokens';
7
+ import { Typography, TypographyColor } from '../Typography';
8
+ import { useAnimatedTextMinHeight } from '../utils/useAnimatedTextMinHeight';
5
9
  import { WidgetTextField } from '../WidgetTextField';
6
10
  import { WidgetWrapperVariant } from '../WidgetWrapper';
7
- import { PromptButtonVariant } from '../PromptButton/types';
8
- import { Theme } from '../Tokens';
9
11
  import { WidgetWrapperWithTitle } from '../WidgetWrapperWithTitle';
10
- import type { TypingAnimationProps } from './types';
11
12
  import { useGetTypographyVariant } from './hooks/useGetTypographyVariant';
12
- import { useAnimatedTextMinHeight } from '../utils/useAnimatedTextMinHeight';
13
- import { Stack } from '../Stack';
13
+ import type { TypingAnimationProps } from './types';
14
14
 
15
15
  export const TypingAnimation = ({
16
16
  baseProps,
@@ -41,7 +41,16 @@ export const TypingAnimation = ({
41
41
  isLoading = false,
42
42
  } = widgetStyleProps || {};
43
43
 
44
- const { handleButtonClick, handleTextFieldClick } = widgetEventProps || {};
44
+ const {
45
+ handleButtonClick,
46
+ handleButtonDrag,
47
+ handleButtonHover,
48
+ handleButtonMouseDown,
49
+ handleButtonMouseUp,
50
+ handleButtonTouchStart,
51
+ handleButtonTouchEnd,
52
+ handleTextFieldClick,
53
+ } = widgetEventProps || {};
45
54
  const typographyVariant = useGetTypographyVariant(theme);
46
55
  const { measuringRef, minHeight } = useAnimatedTextMinHeight(animatedTextSequence ?? []);
47
56
 
@@ -153,6 +162,12 @@ export const TypingAnimation = ({
153
162
  promptButtonType={promptButtonType}
154
163
  promptCarouselRows={promptCarouselRows}
155
164
  handleButtonClick={handleButtonClick}
165
+ handleButtonDrag={handleButtonDrag}
166
+ handleButtonHover={handleButtonHover}
167
+ handleButtonMouseDown={handleButtonMouseDown}
168
+ handleButtonMouseUp={handleButtonMouseUp}
169
+ handleButtonTouchStart={handleButtonTouchStart}
170
+ handleButtonTouchEnd={handleButtonTouchEnd}
156
171
  promptButtonTexts={promptButtonTexts}
157
172
  />
158
173
  )}
@@ -133,6 +133,35 @@ export type WidgetEventProps = {
133
133
  */
134
134
  handleButtonClick?: (text: string) => void;
135
135
 
136
+ /**
137
+ * Callback function invoked when the prompt buttons carousel is dragged.
138
+ * Useful for tracking drag-to-scroll interactions.
139
+ */
140
+ handleButtonDrag?: () => void;
141
+ /**
142
+ * Callback function invoked when the user hovers over a prompt button.
143
+ * Receives the hovered button's text as a parameter.
144
+ */
145
+ handleButtonHover?: (text: string) => void;
146
+ /**
147
+ * Callback function invoked when the mouse button is pressed down on a prompt button.
148
+ * Receives the pressed button's text as a parameter.
149
+ */
150
+ handleButtonMouseDown?: (text: string) => void;
151
+ /**
152
+ * Callback function invoked when the mouse button is released after pressing a prompt button.
153
+ */
154
+ handleButtonMouseUp?: () => void;
155
+ /**
156
+ * Callback function invoked when a touch interaction starts on a prompt button.
157
+ * Receives the touched button's text as a parameter.
158
+ */
159
+ handleButtonTouchStart?: (text: string) => void;
160
+ /**
161
+ * Callback function invoked when a touch interaction ends after touching a prompt button.
162
+ */
163
+ handleButtonTouchEnd?: () => void;
164
+
136
165
  /**
137
166
  * Callback function invoked when the TextField is clicked.
138
167
  */
@@ -86,12 +86,12 @@ export const Icon = ({ variant, theme, textColor }: IconProps) => {
86
86
  }
87
87
  return (
88
88
  <CustomIcon
89
- IconComponent={<SendMinimalist />}
89
+ IconComponent={<SvgSendModern />}
90
90
  className="envive-tw-h-6 envive-tw-w-6"
91
91
  stroke={
92
92
  textColor !== TypographyColor.TEXT_SECONDARY
93
93
  ? `var(--envive-colors-${textColor})`
94
- : 'var(--envive-colors-text-light)'
94
+ : 'var(--envive-colors-border-medium)'
95
95
  }
96
96
  />
97
97
  );