@envive-ai/react-toolkit-v3 0.3.12 → 0.3.14

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 (269) hide show
  1. package/dist/AnimatedText/AnimatedText.d.cts +3 -3
  2. package/dist/AnimatedText/AnimatedText.d.ts +3 -3
  3. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  4. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  5. package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.cjs +1 -1
  6. package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.js +1 -1
  7. package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.cjs +1 -1
  8. package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.js +1 -1
  9. package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.cjs +1 -1
  10. package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +1 -1
  11. package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +1 -1
  12. package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +1 -1
  13. package/dist/Carousel/Carousel.d.cts +2 -2
  14. package/dist/Carousel/Carousel.d.ts +2 -2
  15. package/dist/Carousel/components/Badge.cjs +1 -1
  16. package/dist/Carousel/components/Badge.js +1 -1
  17. package/dist/Carousel/components/Container.cjs +1 -1
  18. package/dist/Carousel/components/Container.js +1 -1
  19. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  20. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  21. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  22. package/dist/ChatFooter/ChatFooter.js +1 -1
  23. package/dist/ChatFooter/components/Layout.cjs +1 -1
  24. package/dist/ChatFooter/components/Layout.js +1 -1
  25. package/dist/ChatFooter/components/index.d.cts +5 -5
  26. package/dist/ChatFooter/components/index.d.ts +5 -5
  27. package/dist/ChatHeader/ChatHeader.d.cts +2 -2
  28. package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +1 -1
  29. package/dist/ChatHeader/hooks/useGetLayoutProperties.js +1 -1
  30. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  31. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  32. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  33. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  34. package/dist/ChatPreviewComparison/components/Layout.cjs +6 -5
  35. package/dist/ChatPreviewComparison/components/Layout.js +6 -5
  36. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  37. package/dist/Container/Container.d.cts +173 -173
  38. package/dist/Container/Container.d.ts +173 -173
  39. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  40. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  41. package/dist/DesignTokens/components/FontFamily.cjs +1 -1
  42. package/dist/DesignTokens/components/FontFamily.js +1 -1
  43. package/dist/DesignTokens/components/FontSize.cjs +1 -1
  44. package/dist/DesignTokens/components/FontSize.js +1 -1
  45. package/dist/DesignTokens/components/FontWeight.cjs +1 -1
  46. package/dist/DesignTokens/components/FontWeight.js +1 -1
  47. package/dist/DesignTokens/components/LetterSpacing.cjs +1 -1
  48. package/dist/DesignTokens/components/LetterSpacing.js +1 -1
  49. package/dist/DesignTokens/components/LineHeight.cjs +1 -1
  50. package/dist/DesignTokens/components/LineHeight.js +1 -1
  51. package/dist/DesignTokens/components/Typography.cjs +1 -1
  52. package/dist/DesignTokens/components/Typography.js +1 -1
  53. package/dist/Disclaimer/components/Container.cjs +1 -1
  54. package/dist/Disclaimer/components/Container.js +1 -1
  55. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  56. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  57. package/dist/DocumentRetrievalCard/components/Image.cjs +1 -1
  58. package/dist/DocumentRetrievalCard/components/Image.js +1 -1
  59. package/dist/DocumentRetrievalCard/components/Layout.cjs +1 -1
  60. package/dist/DocumentRetrievalCard/components/Layout.js +1 -1
  61. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
  62. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
  63. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.cjs +1 -1
  64. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.js +1 -1
  65. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.cjs +1 -1
  66. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.js +1 -1
  67. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  68. package/dist/FloatingButton/FloatingButton.d.ts +2 -2
  69. package/dist/FloatingButton/components/Button.cjs +1 -1
  70. package/dist/FloatingButton/components/Button.js +1 -1
  71. package/dist/FloatingButton/components/Container.cjs +1 -1
  72. package/dist/FloatingButton/components/Container.js +1 -1
  73. package/dist/FloatingButton/components/Wrapper.cjs +1 -1
  74. package/dist/FloatingButton/components/Wrapper.js +1 -1
  75. package/dist/FloatingChat/FloatingChat.cjs +12 -5
  76. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  77. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  78. package/dist/FloatingChat/FloatingChat.js +12 -5
  79. package/dist/FloatingChat/components/AgentMessage.cjs +2 -2
  80. package/dist/FloatingChat/components/AgentMessage.js +2 -2
  81. package/dist/FloatingChat/components/ChatMessages.cjs +2 -2
  82. package/dist/FloatingChat/components/ChatMessages.js +2 -2
  83. package/dist/FloatingChat/components/Layout.cjs +1 -1
  84. package/dist/FloatingChat/components/Layout.js +1 -1
  85. package/dist/FloatingChat/hooks/useSnapSetup.cjs +10 -7
  86. package/dist/FloatingChat/hooks/useSnapSetup.js +10 -7
  87. package/dist/Form/Form.cjs +1 -1
  88. package/dist/Form/Form.js +1 -1
  89. package/dist/Form/components/Layout.cjs +1 -1
  90. package/dist/Form/components/Layout.js +1 -1
  91. package/dist/Form/components/SubmitButtonItem.cjs +1 -1
  92. package/dist/Form/components/SubmitButtonItem.js +1 -1
  93. package/dist/Form/components/TextFieldItem.cjs +1 -1
  94. package/dist/Form/components/TextFieldItem.js +1 -1
  95. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
  96. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
  97. package/dist/FullPageSalesAgent/components/Layout.cjs +1 -1
  98. package/dist/FullPageSalesAgent/components/Layout.js +1 -1
  99. package/dist/Image/Image.cjs +1 -1
  100. package/dist/Image/Image.d.cts +2 -2
  101. package/dist/Image/Image.js +1 -1
  102. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  103. package/dist/ImageGallery/ImageGallery.d.ts +2 -2
  104. package/dist/ImageGallery/components/Layout.cjs +1 -1
  105. package/dist/ImageGallery/components/Layout.js +1 -1
  106. package/dist/ImageGallery/utils/functions.cjs +1 -1
  107. package/dist/ImageGallery/utils/functions.js +1 -1
  108. package/dist/MarkdownProcessor/MarkdownProcessor.cjs +14 -27
  109. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +3 -5
  110. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +3 -5
  111. package/dist/MarkdownProcessor/MarkdownProcessor.js +15 -26
  112. package/dist/MarkdownProcessor/components/index.cjs +1 -3
  113. package/dist/MarkdownProcessor/components/index.js +1 -3
  114. package/dist/MarkdownProcessor/utils/functions.cjs +1 -11
  115. package/dist/MarkdownProcessor/utils/functions.js +1 -10
  116. package/dist/Message/components/AgentHeader.cjs +6 -2
  117. package/dist/Message/components/AgentHeader.js +6 -2
  118. package/dist/Message/components/Layout.cjs +1 -1
  119. package/dist/Message/components/Layout.js +1 -1
  120. package/dist/Message/components/index.cjs +1 -1
  121. package/dist/Message/components/index.js +1 -1
  122. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  123. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  124. package/dist/OrderLookupCard/components/Layout.cjs +1 -1
  125. package/dist/OrderLookupCard/components/Layout.js +1 -1
  126. package/dist/OrderLookupCard/components/MoreProductsOverlay.cjs +1 -1
  127. package/dist/OrderLookupCard/components/MoreProductsOverlay.js +1 -1
  128. package/dist/OrderLookupCard/components/ProductImageGridItem.cjs +1 -1
  129. package/dist/OrderLookupCard/components/ProductImageGridItem.js +1 -1
  130. package/dist/OrderLookupCard/components/ProductImageItem.cjs +1 -1
  131. package/dist/OrderLookupCard/components/ProductImageItem.js +1 -1
  132. package/dist/OrderLookupCard/components/ProductImagesGrid.cjs +1 -1
  133. package/dist/OrderLookupCard/components/ProductImagesGrid.js +1 -1
  134. package/dist/OrderLookupCard/components/StatusLabel.cjs +1 -1
  135. package/dist/OrderLookupCard/components/StatusLabel.js +1 -1
  136. package/dist/OrderLookupCard/components/TrackOrderLink.cjs +1 -1
  137. package/dist/OrderLookupCard/components/TrackOrderLink.js +1 -1
  138. package/dist/ProductCard/ProductCard.cjs +1 -1
  139. package/dist/ProductCard/ProductCard.d.cts +2 -2
  140. package/dist/ProductCard/ProductCard.d.ts +2 -2
  141. package/dist/ProductCard/ProductCard.js +1 -1
  142. package/dist/ProductCard/components/Header.cjs +33 -7
  143. package/dist/ProductCard/components/Header.js +34 -8
  144. package/dist/PromptButton/PromptButton.cjs +1 -1
  145. package/dist/PromptButton/PromptButton.d.cts +2 -2
  146. package/dist/PromptButton/PromptButton.d.ts +2 -2
  147. package/dist/PromptButton/PromptButton.js +1 -1
  148. package/dist/PromptButton/components/Layout.cjs +1 -1
  149. package/dist/PromptButton/components/Layout.js +1 -1
  150. package/dist/PromptButton/components/Loading.cjs +1 -1
  151. package/dist/PromptButton/components/Loading.js +1 -1
  152. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  153. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  154. package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +1 -1
  155. package/dist/PromptButtonCarouselWithImage/components/Layout.js +1 -1
  156. package/dist/PromptButtonCarouselWithImage/components/Skeleton.cjs +1 -1
  157. package/dist/PromptButtonCarouselWithImage/components/Skeleton.js +1 -1
  158. package/dist/PromptCarousel/PromptCarousel.cjs +1 -1
  159. package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
  160. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  161. package/dist/PromptCarousel/PromptCarousel.js +1 -1
  162. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  163. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  164. package/dist/ReviewCard/components/Container.cjs +1 -1
  165. package/dist/ReviewCard/components/Container.js +1 -1
  166. package/dist/ReviewCard/components/Rating.cjs +1 -1
  167. package/dist/ReviewCard/components/Rating.js +1 -1
  168. package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
  169. package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
  170. package/dist/ReviewCard/components/index.d.cts +6 -6
  171. package/dist/ReviewCard/components/index.d.ts +6 -6
  172. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  173. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  174. package/dist/SalesAgentProductCard/components/Container.cjs +1 -1
  175. package/dist/SalesAgentProductCard/components/Container.js +1 -1
  176. package/dist/SalesAgentProductCard/components/ProductImage.cjs +1 -1
  177. package/dist/SalesAgentProductCard/components/ProductImage.js +1 -1
  178. package/dist/SalesAgentProductCard/components/ProductName.cjs +1 -1
  179. package/dist/SalesAgentProductCard/components/ProductName.js +1 -1
  180. package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
  181. package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
  182. package/dist/SocialProof/SocialProof.d.cts +2 -2
  183. package/dist/SocialProof/SocialProof.d.ts +2 -2
  184. package/dist/SocialProof/components/Headline.cjs +1 -1
  185. package/dist/SocialProof/components/Headline.js +1 -1
  186. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  187. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  188. package/dist/SparkleAnimation/SparkleAnimation.cjs +107 -0
  189. package/dist/SparkleAnimation/SparkleAnimation.d.cts +15 -0
  190. package/dist/SparkleAnimation/SparkleAnimation.d.ts +15 -0
  191. package/dist/SparkleAnimation/SparkleAnimation.js +105 -0
  192. package/dist/SparkleAnimation/index.cjs +5 -0
  193. package/dist/SparkleAnimation/index.d.cts +3 -0
  194. package/dist/SparkleAnimation/index.d.ts +3 -0
  195. package/dist/SparkleAnimation/index.js +4 -0
  196. package/dist/SparkleAnimation/types.cjs +12 -0
  197. package/dist/SparkleAnimation/types.d.cts +9 -0
  198. package/dist/SparkleAnimation/types.d.ts +9 -0
  199. package/dist/SparkleAnimation/types.js +11 -0
  200. package/dist/Stack/Stack.d.cts +2 -2
  201. package/dist/Stack/Stack.d.ts +2 -2
  202. package/dist/TextField/TextField.cjs +1 -1
  203. package/dist/TextField/TextField.js +1 -1
  204. package/dist/TextField/components/Input.cjs +1 -1
  205. package/dist/TextField/components/Input.js +1 -1
  206. package/dist/TextField/components/Layout.cjs +1 -1
  207. package/dist/TextField/components/Layout.js +1 -1
  208. package/dist/TextField/components/SendIcon.cjs +1 -1
  209. package/dist/TextField/components/SendIcon.js +1 -1
  210. package/dist/Title/Title.cjs +1 -1
  211. package/dist/Title/Title.js +1 -1
  212. package/dist/Title/components/Layout.cjs +1 -1
  213. package/dist/Title/components/Layout.js +1 -1
  214. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  215. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  216. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
  217. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  218. package/dist/Tokens/index.cjs +2 -2
  219. package/dist/Tokens/index.js +2 -2
  220. package/dist/TypingAnimation/TypingAnimation.cjs +61 -19
  221. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  222. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  223. package/dist/TypingAnimation/TypingAnimation.js +62 -20
  224. package/dist/TypingAnimation/types/index.d.cts +8 -0
  225. package/dist/TypingAnimation/types/index.d.ts +8 -0
  226. package/dist/Typography/Typography.d.ts +4 -4
  227. package/dist/WelcomeMessage/components/Container.cjs +1 -1
  228. package/dist/WelcomeMessage/components/Container.js +1 -1
  229. package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
  230. package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
  231. package/dist/WidgetTextField/components/Container.cjs +1 -1
  232. package/dist/WidgetTextField/components/Container.js +1 -1
  233. package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
  234. package/dist/WidgetTextField/components/Skeleton.js +1 -1
  235. package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +1 -1
  236. package/dist/WidgetTextField/hooks/useGetContainerProperties.js +1 -1
  237. package/dist/WidgetWrapper/WidgetWrapper.cjs +1 -1
  238. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  239. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  240. package/dist/WidgetWrapper/WidgetWrapper.js +1 -1
  241. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  242. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  243. package/dist/styles.css +1 -1
  244. package/dist/utils/resolveTheme.cjs +1 -1
  245. package/dist/utils/resolveTheme.js +1 -1
  246. package/dist/utils/useAnimatedTextMinHeight.cjs +28 -0
  247. package/dist/utils/useAnimatedTextMinHeight.js +27 -0
  248. package/package.json +5 -3
  249. package/src/components/ChatPreviewComparison/components/Layout.tsx +2 -2
  250. package/src/components/FloatingChat/FloatingChat.tsx +10 -1
  251. package/src/components/FloatingChat/components/AgentMessage.tsx +3 -1
  252. package/src/components/FloatingChat/components/ChatMessages.tsx +1 -1
  253. package/src/components/FloatingChat/hooks/useSnapSetup.ts +11 -4
  254. package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +3 -19
  255. package/src/components/MarkdownProcessor/__tests__/MarkdownProcessor.test.tsx +1 -39
  256. package/src/components/MarkdownProcessor/components/index.ts +0 -2
  257. package/src/components/MarkdownProcessor/utils/functions.tsx +0 -19
  258. package/src/components/Message/components/AgentHeader.tsx +7 -2
  259. package/src/components/ProductCard/components/Header.tsx +39 -9
  260. package/src/components/SparkleAnimation/SparkleAnimation.tsx +102 -0
  261. package/src/components/SparkleAnimation/index.ts +2 -0
  262. package/src/components/SparkleAnimation/types.ts +6 -0
  263. package/src/components/TypingAnimation/TypingAnimation.tsx +72 -22
  264. package/src/components/TypingAnimation/types/index.ts +10 -0
  265. package/src/components/WidgetTextField/hooks/useGetContainerProperties.ts +1 -1
  266. package/src/components/utils/useAnimatedTextMinHeight.ts +29 -0
  267. package/dist/MarkdownProcessor/components/MarkdownSubscript.cjs +0 -15
  268. package/dist/MarkdownProcessor/components/MarkdownSubscript.js +0 -14
  269. package/src/components/MarkdownProcessor/components/MarkdownSubscript.tsx +0 -22
@@ -69,22 +69,6 @@ describe('MarkdownProcessor', () => {
69
69
  });
70
70
  });
71
71
 
72
- describe('Subscript', () => {
73
- it('should render subscript text', () => {
74
- const content = 'Regular text<sub>subscript</sub>';
75
- render(<MarkdownProcessor content={content} />);
76
- expect(screen.getByText('Regular text')).toBeInTheDocument();
77
- expect(screen.getByText('subscript')).toBeInTheDocument();
78
- });
79
-
80
- it('should render multiple subscript elements', () => {
81
- const content = 'First<sub>sub1</sub> and second<sub>sub2</sub>';
82
- render(<MarkdownProcessor content={content} />);
83
- expect(screen.getByText('sub1')).toBeInTheDocument();
84
- expect(screen.getByText('sub2')).toBeInTheDocument();
85
- });
86
- });
87
-
88
72
  describe('Paragraph clamping', () => {
89
73
  it('should not clamp paragraphs when clampParagraphs is undefined', () => {
90
74
  const content =
@@ -131,34 +115,12 @@ describe('MarkdownProcessor', () => {
131
115
  );
132
116
  expect(screen.getByText('Custom color text')).toBeInTheDocument();
133
117
  });
134
-
135
- it('should apply custom subTextVariant', () => {
136
- const content = 'Text<sub>subscript</sub>';
137
- render(
138
- <MarkdownProcessor
139
- content={content}
140
- subTextVariant={TypographyVariant.B4_RG}
141
- />,
142
- );
143
- expect(screen.getByText('subscript')).toBeInTheDocument();
144
- });
145
-
146
- it('should apply custom subTextColor', () => {
147
- const content = 'Text<sub>subscript</sub>';
148
- render(
149
- <MarkdownProcessor
150
- content={content}
151
- subTextColor={TypographyColor.TEXT_ACCENT}
152
- />,
153
- );
154
- expect(screen.getByText('subscript')).toBeInTheDocument();
155
- });
156
118
  });
157
119
 
158
120
  describe('Complex content', () => {
159
121
  it('should render complex markdown with multiple elements', () => {
160
122
  const content =
161
- '# Heading\n\nThis is a paragraph with **bold** and *italic*.\n\n- List item 1\n- List item 2\n\n1. Ordered item 1\n2. Ordered item 2\n\n[Link text](https://example.com)\n\nText with<sub>subscript</sub>.';
123
+ '# Heading\n\nThis is a paragraph with **bold** and *italic*.\n\n- List item 1\n- List item 2\n\n1. Ordered item 1\n2. Ordered item 2\n\n[Link text](https://example.com)';
162
124
  render(<MarkdownProcessor content={content} />);
163
125
  expect(screen.getByText(/This is a paragraph/i)).toBeInTheDocument();
164
126
  expect(screen.getByText('List item 1')).toBeInTheDocument();
@@ -3,7 +3,6 @@ import { MarkdownLink } from './MarkdownLink';
3
3
  import { MarkdownOrderedList } from './MarkdownOrderedList';
4
4
  import { MarkdownUnorderedList } from './MarkdownUnorderedList';
5
5
  import { MarkdownParagraph } from './MarkdownParagraph';
6
- import { MarkdownSubscript } from './MarkdownSubscript';
7
6
 
8
7
  export const MarkdownProcessorComponents = {
9
8
  MarkdownListItem,
@@ -11,5 +10,4 @@ export const MarkdownProcessorComponents = {
11
10
  MarkdownOrderedList,
12
11
  MarkdownUnorderedList,
13
12
  MarkdownParagraph,
14
- MarkdownSubscript,
15
13
  };
@@ -22,22 +22,3 @@ export const createMarkdownParagraphComponent = ({
22
22
  Component.displayName = 'MarkdownParagraphComponent';
23
23
  return Component;
24
24
  };
25
-
26
- export const createMarkdownSubscriptComponent = ({
27
- subTextVariant,
28
- subTextColor,
29
- }: {
30
- subTextVariant?: TypographyVariant;
31
- subTextColor?: TypographyColor;
32
- }) => {
33
- const Component = ({ children }: { children?: React.ReactNode }) => (
34
- <MarkdownProcessorComponents.MarkdownSubscript
35
- subTextVariant={subTextVariant}
36
- subTextColor={subTextColor}
37
- >
38
- {children}
39
- </MarkdownProcessorComponents.MarkdownSubscript>
40
- );
41
- Component.displayName = 'MarkdownSubscriptComponent';
42
- return Component;
43
- };
@@ -1,6 +1,6 @@
1
1
  import { Stack } from '../../Stack';
2
+ import { SparkleAnimation } from '../../SparkleAnimation';
2
3
  import { Typography, TypographyColor, TypographyVariant } from '../../Typography';
3
- import { SparkleIcon } from './SparkleIcon';
4
4
 
5
5
  type AgentHeaderProps = {
6
6
  agentName: string;
@@ -28,7 +28,12 @@ export const AgentHeader = ({
28
28
  >
29
29
  {agentName}
30
30
  </Typography>
31
- <SparkleIcon isLoading={isLoading || showSparkle} />
31
+ {(isLoading || showSparkle) && (
32
+ <SparkleAnimation
33
+ color="var(--envive-colors-accent-primary)"
34
+ animate
35
+ />
36
+ )}
32
37
  </Stack>
33
38
  );
34
39
  };
@@ -1,7 +1,8 @@
1
- import { useCallback } from 'react';
1
+ import { useCallback, useMemo } from 'react';
2
2
  import { AnimatedText } from '../../AnimatedText';
3
3
  import { Stack } from '../../Stack';
4
4
  import { Typography, TypographyColor, TypographyVariant } from '../../Typography';
5
+ import { useAnimatedTextMinHeight } from '../../utils/useAnimatedTextMinHeight';
5
6
  import { useGetHeaderProperties } from '../hooks/useGetHeaderProperties';
6
7
  import { HeaderProps } from '../types';
7
8
 
@@ -14,13 +15,19 @@ export const Header = ({
14
15
  loop,
15
16
  }: HeaderProps) => {
16
17
  const { stackClasses, headlineClasses } = useGetHeaderProperties(italicizeHeadline);
18
+ const { measuringRef, minHeight } = useAnimatedTextMinHeight(animatedText);
19
+
20
+ const biggestText = useMemo(() => {
21
+ return animatedText.reduce((maxText, currText) => {
22
+ return currText.length > maxText.length ? currText : maxText;
23
+ }, '');
24
+ }, [animatedText]);
17
25
 
18
26
  const animatedTextWrapper = useCallback(
19
27
  (text: string) => (
20
28
  <Typography
21
29
  variant={TypographyVariant.B3_MD}
22
30
  color={TypographyColor.TEXT_LIGHT}
23
- numberOfLines={2}
24
31
  >
25
32
  {text}
26
33
  </Typography>
@@ -42,13 +49,36 @@ export const Header = ({
42
49
  {headline}
43
50
  </Typography>
44
51
  {animatedText.length > 0 && (
45
- <AnimatedText
46
- sequence={animatedText}
47
- getNodeWrapper={animatedTextWrapper}
48
- typingDuration={textTypingDuration}
49
- transition={textTransition}
50
- loop={loop}
51
- />
52
+ <div style={{ position: 'relative' }}>
53
+ <div
54
+ ref={measuringRef}
55
+ aria-hidden="true"
56
+ style={{
57
+ position: 'absolute',
58
+ visibility: 'hidden',
59
+ pointerEvents: 'none',
60
+ width: '100%',
61
+ }}
62
+ >
63
+ <div>
64
+ <Typography
65
+ variant={TypographyVariant.B3_MD}
66
+ color={TypographyColor.TEXT_LIGHT}
67
+ >
68
+ {biggestText}
69
+ </Typography>
70
+ </div>
71
+ </div>
72
+ <div style={{ minHeight }}>
73
+ <AnimatedText
74
+ sequence={animatedText}
75
+ getNodeWrapper={animatedTextWrapper}
76
+ typingDuration={textTypingDuration}
77
+ transition={textTransition}
78
+ loop={loop}
79
+ />
80
+ </div>
81
+ </div>
52
82
  )}
53
83
  </Stack>
54
84
  );
@@ -0,0 +1,102 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { type Transition, motion } from 'framer-motion';
3
+
4
+ import FourPointStar from '@envive-ai/react-icons/FourPointStar';
5
+ import { SparkleAnimationOverride } from './types';
6
+
7
+ // Animation timing constants
8
+ const ANIMATION_CYCLE_TIME = 1000; // 1 second between cycles
9
+ const STAR_DELAY_OFFSET = 250; // 250ms delay between each star
10
+
11
+ interface SparkleAnimationProps {
12
+ color: string;
13
+ className?: string;
14
+ animate?: boolean; // Whether to animate the sparkles, defaults to true
15
+ }
16
+
17
+ export const SparkleAnimation = ({ color, className, animate = true }: SparkleAnimationProps) => {
18
+ // Star visibility states - start visible if not animating, invisible if animating
19
+ const [mainStarScale, setMainStarScale] = useState(animate ? 0 : 1);
20
+ const [smallStar1Scale, setSmallStar1Scale] = useState(animate ? 0 : 1);
21
+ const [smallStar2Scale, setSmallStar2Scale] = useState(animate ? 0 : 1);
22
+
23
+ // When animation is disabled, ensure all stars are visible
24
+ useEffect(() => {
25
+ if (!animate) {
26
+ setMainStarScale(1);
27
+ setSmallStar1Scale(1);
28
+ setSmallStar2Scale(1);
29
+ }
30
+ }, [animate]);
31
+
32
+ // Animation cycle effect
33
+ useEffect(() => {
34
+ if (!animate) return;
35
+
36
+ // Toggle between visible (1) and invisible (0)
37
+ const newScale = mainStarScale === 1 ? 0 : 1;
38
+
39
+ // Stagger the star animations
40
+ setTimeout(() => setMainStarScale(newScale), ANIMATION_CYCLE_TIME);
41
+ setTimeout(() => setSmallStar1Scale(newScale), ANIMATION_CYCLE_TIME + STAR_DELAY_OFFSET);
42
+ setTimeout(() => setSmallStar2Scale(newScale), ANIMATION_CYCLE_TIME + 2 * STAR_DELAY_OFFSET);
43
+ }, [mainStarScale, animate]);
44
+
45
+ // Animation transition settings
46
+ const starTransition: Transition = { duration: 0.3, ease: 'easeOut' };
47
+
48
+ return (
49
+ <div
50
+ className={`${SparkleAnimationOverride.CONTAINER} ${className || ''}`}
51
+ style={{ width: '24px', height: '24px', position: 'relative' }}
52
+ >
53
+ {/* Main star - center, slightly above container */}
54
+ <div
55
+ className={SparkleAnimationOverride.STAR_ONE_CONTAINER}
56
+ style={{ position: 'absolute', left: 0, top: '-2px' }}
57
+ >
58
+ <motion.div
59
+ animate={{ scale: mainStarScale }}
60
+ transition={starTransition}
61
+ >
62
+ <FourPointStar
63
+ fill={color}
64
+ style={{ display: 'inline-block', height: '16px', width: '16px' }}
65
+ />
66
+ </motion.div>
67
+ </div>
68
+
69
+ {/* Small star 1 - upper right */}
70
+ <div
71
+ className={SparkleAnimationOverride.STAR_TWO_CONTAINER}
72
+ style={{ position: 'absolute', top: '-7px', left: '10px' }}
73
+ >
74
+ <motion.div
75
+ animate={{ scale: smallStar1Scale }}
76
+ transition={starTransition}
77
+ >
78
+ <FourPointStar
79
+ fill={color}
80
+ style={{ display: 'inline-block', height: '8px', width: '8px' }}
81
+ />
82
+ </motion.div>
83
+ </div>
84
+
85
+ {/* Small star 2 - lower right */}
86
+ <div
87
+ className={SparkleAnimationOverride.STAR_THREE_CONTAINER}
88
+ style={{ position: 'absolute', left: '12px', top: '1px' }}
89
+ >
90
+ <motion.div
91
+ animate={{ scale: smallStar2Scale }}
92
+ transition={starTransition}
93
+ >
94
+ <FourPointStar
95
+ fill={color}
96
+ style={{ display: 'inline-block', height: '8px', width: '8px' }}
97
+ />
98
+ </motion.div>
99
+ </div>
100
+ </div>
101
+ );
102
+ };
@@ -0,0 +1,2 @@
1
+ export * from './SparkleAnimation';
2
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ export enum SparkleAnimationOverride {
2
+ CONTAINER = 'spiffy-sparkle-animation-container',
3
+ STAR_ONE_CONTAINER = 'spiffy-sparkle-animation-star-one-container',
4
+ STAR_TWO_CONTAINER = 'spiffy-sparkle-animation-star-two-container',
5
+ STAR_THREE_CONTAINER = 'spiffy-sparkle-animation-star-three-container',
6
+ }
@@ -1,4 +1,4 @@
1
- import { useCallback } from 'react';
1
+ import { useCallback, useMemo } from 'react';
2
2
  import { AnimatedText } from '../AnimatedText';
3
3
  import { Typography, TypographyColor } from '../Typography';
4
4
  import { PromptCarousel, PromptCarouselRows } from '../PromptCarousel';
@@ -9,6 +9,7 @@ import { Theme } from '../Tokens';
9
9
  import { WidgetWrapperWithTitle } from '../WidgetWrapperWithTitle';
10
10
  import type { TypingAnimationProps } from './types';
11
11
  import { useGetTypographyVariant } from './hooks/useGetTypographyVariant';
12
+ import { useAnimatedTextMinHeight } from '../utils/useAnimatedTextMinHeight';
12
13
  import { Stack } from '../Stack';
13
14
 
14
15
  export const TypingAnimation = ({
@@ -26,6 +27,8 @@ export const TypingAnimation = ({
26
27
  promptButtonTexts,
27
28
  hintText,
28
29
  textFieldAriaLabel,
30
+ logoSrc,
31
+ hideLogo,
29
32
  } = widgetContentProps || {};
30
33
 
31
34
  const {
@@ -40,6 +43,15 @@ export const TypingAnimation = ({
40
43
 
41
44
  const { handleButtonClick, handleTextFieldClick } = widgetEventProps || {};
42
45
  const typographyVariant = useGetTypographyVariant(theme);
46
+ const { measuringRef, minHeight } = useAnimatedTextMinHeight(animatedTextSequence ?? []);
47
+
48
+ const biggestAnimatedText = useMemo(() => {
49
+ if (!animatedTextSequence || animatedTextSequence.length === 0) return '';
50
+ return animatedTextSequence.reduce(
51
+ (maxText, currText) => (currText.length > maxText.length ? currText : maxText),
52
+ '',
53
+ );
54
+ }, [animatedTextSequence]);
43
55
 
44
56
  const getAnimatedTextWrapper = useCallback(
45
57
  (text: string) => (
@@ -62,6 +74,8 @@ export const TypingAnimation = ({
62
74
  className={className}
63
75
  style={style}
64
76
  titleLabel={titleLabel}
77
+ logoSrc={logoSrc}
78
+ hideLogo={hideLogo}
65
79
  hexCardColor={cardColor}
66
80
  fullIsLoading={isLoading}
67
81
  >
@@ -71,28 +85,64 @@ export const TypingAnimation = ({
71
85
  >
72
86
  {(headlineText || (animatedTextSequence && animatedTextSequence.length > 0)) &&
73
87
  !isLoading && (
74
- <p
75
- data-testid="typing-animation-headline-text"
76
- className="envive-tw-max-w-[90ch] envive-tw-overflow-hidden envive-tw-text-ellipsis envive-tw-whitespace-nowrap"
77
- style={{ textAlign: 'left' }}
78
- >
79
- {headlineText && (
80
- <Typography
81
- variant={typographyVariant}
82
- color={TypographyColor.TEXT_PRIMARY}
83
- as="span"
88
+ <div style={{ position: 'relative' }}>
89
+ <div
90
+ ref={measuringRef}
91
+ aria-hidden="true"
92
+ style={{
93
+ position: 'absolute',
94
+ visibility: 'hidden',
95
+ pointerEvents: 'none',
96
+ width: '100%',
97
+ }}
98
+ >
99
+ <p
100
+ className="envive-tw-max-w-[90ch]"
101
+ style={{ textAlign: 'left' }}
102
+ >
103
+ {headlineText && (
104
+ <Typography
105
+ variant={typographyVariant}
106
+ color={TypographyColor.TEXT_PRIMARY}
107
+ as="span"
108
+ >
109
+ {headlineText}
110
+ </Typography>
111
+ )}{' '}
112
+ <Typography
113
+ variant={typographyVariant}
114
+ color={TypographyColor.TEXT_ACCENT}
115
+ as="span"
116
+ >
117
+ {biggestAnimatedText}
118
+ </Typography>
119
+ </p>
120
+ </div>
121
+ <div style={{ minHeight }}>
122
+ <p
123
+ data-testid="typing-animation-headline-text"
124
+ className="envive-tw-max-w-[90ch]"
125
+ style={{ textAlign: 'left' }}
84
126
  >
85
- {headlineText}
86
- </Typography>
87
- )}{' '}
88
- {animatedTextSequence && animatedTextSequence.length > 0 ? (
89
- <AnimatedText
90
- sequence={animatedTextSequence}
91
- loop
92
- getNodeWrapper={getAnimatedTextWrapper}
93
- />
94
- ) : null}
95
- </p>
127
+ {headlineText && (
128
+ <Typography
129
+ variant={typographyVariant}
130
+ color={TypographyColor.TEXT_PRIMARY}
131
+ as="span"
132
+ >
133
+ {headlineText}
134
+ </Typography>
135
+ )}{' '}
136
+ {animatedTextSequence && animatedTextSequence.length > 0 ? (
137
+ <AnimatedText
138
+ sequence={animatedTextSequence}
139
+ loop
140
+ getNodeWrapper={getAnimatedTextWrapper}
141
+ />
142
+ ) : null}
143
+ </p>
144
+ </div>
145
+ </div>
96
146
  )}
97
147
  {promptButtonTexts && promptButtonTexts.length > 0 && handleButtonClick && (
98
148
  <PromptCarousel
@@ -63,6 +63,16 @@ export type WidgetContentProps = {
63
63
  * Accessibility: Provides an accessible name for the TextField.
64
64
  */
65
65
  textFieldAriaLabel?: string;
66
+
67
+ /**
68
+ * Source URL of the logo image displayed in the widget title.
69
+ */
70
+ logoSrc?: string;
71
+
72
+ /**
73
+ * When `true`, hides the logo in the title even if logoSrc is provided.
74
+ */
75
+ hideLogo?: boolean;
66
76
  };
67
77
 
68
78
  /**
@@ -14,7 +14,7 @@ export const useGetContainerProperties = ({ theme }: UseGetContainerPropertiesPr
14
14
  [Theme.STANDARD]:
15
15
  'envive-tw-border-[1px] envive-tw-border-border-light envive-tw-rounded-global-custom',
16
16
  [Theme.MODERN]: 'envive-tw-border-[1px] envive-tw-border-border-light envive-tw-rounded-4',
17
- [Theme.MINIMAL]: 'envive-tw-border-b-[1px] envive-tw-border-text-light',
17
+ [Theme.MINIMAL]: 'envive-tw-border-[1px] envive-tw-border-border-light',
18
18
  };
19
19
  return themeCotainerMap[theme] ?? '';
20
20
  }, [theme]);
@@ -0,0 +1,29 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+
3
+ export const useAnimatedTextMinHeight = (animatedText: string[]) => {
4
+ const measuringRef = useRef<HTMLDivElement>(null);
5
+ const [minHeight, setMinHeight] = useState(0);
6
+
7
+ useEffect(() => {
8
+ const updateMinHeight = () => {
9
+ if (!measuringRef.current) return;
10
+ let maxHeight = 0;
11
+ const { children } = measuringRef.current;
12
+ for (let i = 0; i < children.length; i += 1) {
13
+ maxHeight = Math.max(maxHeight, (children[i] as HTMLElement).offsetHeight);
14
+ }
15
+ setMinHeight(maxHeight);
16
+ };
17
+
18
+ updateMinHeight();
19
+
20
+ const observer = new ResizeObserver(updateMinHeight);
21
+ if (measuringRef.current) {
22
+ observer.observe(measuringRef.current);
23
+ }
24
+
25
+ return () => observer.disconnect();
26
+ }, [animatedText]);
27
+
28
+ return { measuringRef, minHeight };
29
+ };
@@ -1,15 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require_index = require('../../Typography/types/index.cjs');
3
- const require_Typography = require('../../Typography/Typography.cjs');
4
- let react_jsx_runtime = require("react/jsx-runtime");
5
-
6
- //#region src/components/MarkdownProcessor/components/MarkdownSubscript.tsx
7
- const MarkdownSubscript = ({ children, subTextVariant, subTextColor }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
8
- variant: subTextVariant ?? require_index.TypographyVariant.B5_RG,
9
- color: subTextColor ?? require_index.TypographyColor.TEXT_SECONDARY,
10
- className: "envive-tw-inline",
11
- children
12
- });
13
-
14
- //#endregion
15
- exports.MarkdownSubscript = MarkdownSubscript;
@@ -1,14 +0,0 @@
1
- import { TypographyColor, TypographyVariant } from "../../Typography/types/index.js";
2
- import { Typography } from "../../Typography/Typography.js";
3
- import { jsx } from "react/jsx-runtime";
4
-
5
- //#region src/components/MarkdownProcessor/components/MarkdownSubscript.tsx
6
- const MarkdownSubscript = ({ children, subTextVariant, subTextColor }) => /* @__PURE__ */ jsx(Typography, {
7
- variant: subTextVariant ?? TypographyVariant.B5_RG,
8
- color: subTextColor ?? TypographyColor.TEXT_SECONDARY,
9
- className: "envive-tw-inline",
10
- children
11
- });
12
-
13
- //#endregion
14
- export { MarkdownSubscript };
@@ -1,22 +0,0 @@
1
- import { TypographyColor, TypographyVariant } from '../../Typography/types';
2
- import { Typography } from '../../Typography/Typography';
3
-
4
- export type MarkdownSubscriptProps = {
5
- subTextVariant?: TypographyVariant;
6
- subTextColor?: TypographyColor;
7
- children?: React.ReactNode;
8
- };
9
-
10
- export const MarkdownSubscript = ({
11
- children,
12
- subTextVariant,
13
- subTextColor,
14
- }: MarkdownSubscriptProps) => (
15
- <Typography
16
- variant={subTextVariant ?? TypographyVariant.B5_RG}
17
- color={subTextColor ?? TypographyColor.TEXT_SECONDARY}
18
- className="envive-tw-inline"
19
- >
20
- {children}
21
- </Typography>
22
- );