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

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 (203) hide show
  1. package/dist/AnimatedText/AnimatedText.cjs +1 -0
  2. package/dist/AnimatedText/AnimatedText.js +1 -0
  3. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  4. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  5. package/dist/CSSVariablesEditor/components/CSSVariablesEditor.cjs +1 -1
  6. package/dist/CSSVariablesEditor/components/CSSVariablesEditor.js +1 -1
  7. package/dist/Carousel/Carousel.d.cts +2 -2
  8. package/dist/Carousel/Carousel.d.ts +2 -2
  9. package/dist/Carousel/components/Container.cjs +1 -1
  10. package/dist/Carousel/components/Container.js +1 -1
  11. package/dist/ChatFooter/ChatFooter.d.cts +2 -2
  12. package/dist/ChatFooter/components/index.d.cts +3 -3
  13. package/dist/ChatFooter/components/index.d.ts +5 -5
  14. package/dist/ChatHeader/ChatHeader.d.cts +2 -2
  15. package/dist/ChatHeader/ChatHeader.d.ts +2 -2
  16. package/dist/ChatPreview/ChatPreview.cjs +13 -3
  17. package/dist/ChatPreview/ChatPreview.d.cts +2 -2
  18. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  19. package/dist/ChatPreview/ChatPreview.js +13 -3
  20. package/dist/ChatPreview/components/Message.cjs +1 -1
  21. package/dist/ChatPreview/components/Message.js +1 -1
  22. package/dist/ChatPreview/types/types.d.cts +5 -4
  23. package/dist/ChatPreview/types/types.d.ts +5 -4
  24. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +13 -3
  25. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  26. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  27. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +13 -3
  28. package/dist/ChatPreviewComparison/components/Message.cjs +1 -1
  29. package/dist/ChatPreviewComparison/components/Message.js +1 -1
  30. package/dist/ChatPreviewComparison/types/types.d.cts +4 -4
  31. package/dist/ChatPreviewComparison/types/types.d.ts +4 -4
  32. package/dist/ChatPreviewLoading/ChatPreviewLoading.cjs +1 -1
  33. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
  34. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  35. package/dist/ChatPreviewLoading/ChatPreviewLoading.js +1 -1
  36. package/dist/Container/Container.d.cts +174 -174
  37. package/dist/Container/Container.d.ts +174 -174
  38. package/dist/DesignTokens/DesignTokensComponent.cjs +1 -1
  39. package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
  40. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  41. package/dist/DesignTokens/DesignTokensComponent.js +1 -1
  42. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  43. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  44. package/dist/FloatingButton/FloatingButton.d.ts +2 -2
  45. package/dist/FloatingChat/FloatingChat.cjs +4 -3
  46. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  47. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  48. package/dist/FloatingChat/FloatingChat.js +4 -3
  49. package/dist/FloatingChat/components/AgentMessage.cjs +9 -5
  50. package/dist/FloatingChat/components/AgentMessage.js +9 -5
  51. package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
  52. package/dist/FloatingChat/components/ChatMessages.js +1 -1
  53. package/dist/FloatingChat/components/Layout.cjs +11 -11
  54. package/dist/FloatingChat/components/Layout.js +11 -11
  55. package/dist/FloatingChat/components/ModalSheet.cjs +1 -1
  56. package/dist/FloatingChat/components/ModalSheet.js +1 -1
  57. package/dist/FloatingChat/components/ReviewCardsCarousel.cjs +2 -1
  58. package/dist/FloatingChat/components/ReviewCardsCarousel.js +2 -1
  59. package/dist/FloatingChat/components/ScrollToBottomButton.cjs +1 -1
  60. package/dist/FloatingChat/components/ScrollToBottomButton.js +1 -1
  61. package/dist/Form/Form.cjs +1 -1
  62. package/dist/Form/Form.js +1 -1
  63. package/dist/Image/Image.d.cts +2 -2
  64. package/dist/Image/Image.d.ts +2 -2
  65. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  66. package/dist/ImageGallery/ImageGallery.d.ts +2 -2
  67. package/dist/ImageGallery/components/NormalLayout.cjs +1 -1
  68. package/dist/ImageGallery/components/NormalLayout.js +1 -1
  69. package/dist/MarkdownProcessor/MarkdownProcessor.cjs +1 -1
  70. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
  71. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
  72. package/dist/MarkdownProcessor/MarkdownProcessor.js +1 -1
  73. package/dist/Message/components/AgentContent.cjs +1 -1
  74. package/dist/Message/components/AgentContent.js +1 -1
  75. package/dist/ProductCard/ProductCard.cjs +9 -5
  76. package/dist/ProductCard/ProductCard.d.cts +2 -2
  77. package/dist/ProductCard/ProductCard.d.ts +2 -2
  78. package/dist/ProductCard/ProductCard.js +4 -1
  79. package/dist/ProductCard/components/Header.cjs +3 -3
  80. package/dist/ProductCard/components/Header.js +3 -3
  81. package/dist/PromptButton/PromptButton.d.cts +2 -2
  82. package/dist/PromptButton/PromptButton.d.ts +2 -2
  83. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +3 -2
  84. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  85. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  86. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +3 -2
  87. package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +8 -3
  88. package/dist/PromptButtonCarouselWithImage/components/Layout.js +8 -3
  89. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +53 -3
  90. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +53 -3
  91. package/dist/PromptCarousel/PromptCarousel.cjs +70 -33
  92. package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
  93. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  94. package/dist/PromptCarousel/PromptCarousel.js +71 -34
  95. package/dist/PromptCarousel/hooks/index.cjs +2 -4
  96. package/dist/PromptCarousel/hooks/index.js +2 -4
  97. package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.cjs +91 -0
  98. package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.js +90 -0
  99. package/dist/PromptCarousel/hooks/useScrollSync.cjs +65 -0
  100. package/dist/PromptCarousel/hooks/useScrollSync.js +64 -0
  101. package/dist/ReviewCard/ReviewCard.cjs +1 -1
  102. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  103. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  104. package/dist/ReviewCard/ReviewCard.js +1 -1
  105. package/dist/ReviewCard/components/index.d.cts +6 -6
  106. package/dist/ReviewCard/components/index.d.ts +6 -6
  107. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  108. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  109. package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
  110. package/dist/SalesAgentProductCard/components/index.d.ts +6 -6
  111. package/dist/SocialProof/SocialProof.d.cts +2 -2
  112. package/dist/SocialProof/SocialProof.d.ts +2 -2
  113. package/dist/SocialProof/components/Headline.cjs +1 -1
  114. package/dist/SocialProof/components/Headline.js +1 -1
  115. package/dist/SocialProof/components/LayoutSingle.cjs +1 -1
  116. package/dist/SocialProof/components/LayoutSingle.js +1 -1
  117. package/dist/Stack/Stack.d.cts +2 -2
  118. package/dist/Stack/Stack.d.ts +2 -2
  119. package/dist/Stack/hooks/useFormatStackChildren.cjs +1 -1
  120. package/dist/Stack/hooks/useFormatStackChildren.js +1 -1
  121. package/dist/Title/components/Image.cjs +1 -1
  122. package/dist/Title/components/Image.js +1 -1
  123. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  124. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
  125. package/dist/TypingAnimation/TypingAnimation.cjs +2 -2
  126. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  127. package/dist/TypingAnimation/TypingAnimation.js +2 -2
  128. package/dist/Typography/Typography.d.cts +4 -4
  129. package/dist/Typography/Typography.d.ts +4 -4
  130. package/dist/WidgetTextField/WidgetTextField.cjs +11 -6
  131. package/dist/WidgetTextField/WidgetTextField.d.cts +3 -2
  132. package/dist/WidgetTextField/WidgetTextField.d.ts +3 -2
  133. package/dist/WidgetTextField/WidgetTextField.js +7 -2
  134. package/dist/WidgetTextField/components/FakeTextInput.cjs +2 -2
  135. package/dist/WidgetTextField/components/FakeTextInput.js +2 -2
  136. package/dist/WidgetTextField/components/Icon.cjs +10 -9
  137. package/dist/WidgetTextField/components/Icon.js +10 -9
  138. package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
  139. package/dist/WidgetTextField/components/Skeleton.js +1 -1
  140. package/dist/WidgetTextField/types/types.d.cts +3 -0
  141. package/dist/WidgetTextField/types/types.d.ts +3 -0
  142. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  143. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  144. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  145. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  146. package/dist/styles.css +1 -1
  147. package/dist/utils/CustomIcon.cjs +1 -1
  148. package/dist/utils/CustomIcon.js +1 -1
  149. package/dist/utils/useDragToScroll.cjs +68 -0
  150. package/dist/utils/useDragToScroll.js +67 -0
  151. package/package.json +1 -1
  152. package/src/components/AnimatedText/AnimatedText.tsx +2 -0
  153. package/src/components/ChatPreview/ChatPreview.tsx +20 -3
  154. package/src/components/ChatPreview/types/types.ts +5 -4
  155. package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +20 -3
  156. package/src/components/ChatPreviewComparison/types/types.ts +4 -4
  157. package/src/components/FloatingChat/FloatingChat.tsx +3 -2
  158. package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
  159. package/src/components/FloatingChat/components/Layout.tsx +7 -2
  160. package/src/components/FloatingChat/components/ReviewCardsCarousel.tsx +3 -0
  161. package/src/components/ProductCard/ProductCard.tsx +12 -1
  162. package/src/components/ProductCard/components/Header.tsx +10 -8
  163. package/src/components/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.tsx +6 -3
  164. package/src/components/PromptButtonCarouselWithImage/components/Layout.tsx +13 -4
  165. package/src/components/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +63 -20
  166. package/src/components/PromptCarousel/PromptCarousel.tsx +88 -51
  167. package/src/components/PromptCarousel/hooks/index.ts +2 -4
  168. package/src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts +115 -0
  169. package/src/components/PromptCarousel/hooks/useHorizontalScrollAnimation.ts +71 -78
  170. package/src/components/PromptCarousel/hooks/useScrollSync.ts +83 -0
  171. package/src/components/WidgetTextField/WidgetTextField.tsx +9 -1
  172. package/src/components/WidgetTextField/components/FakeTextInput.tsx +6 -2
  173. package/src/components/WidgetTextField/components/Icon.tsx +43 -9
  174. package/src/components/WidgetTextField/types/types.ts +3 -0
  175. package/src/components/utils/useDragToScroll.ts +83 -0
  176. package/dist/PromptCarousel/components/BlockScrollContainer.cjs +0 -23
  177. package/dist/PromptCarousel/components/BlockScrollContainer.js +0 -21
  178. package/dist/PromptCarousel/components/ButtonContainerRow.cjs +0 -34
  179. package/dist/PromptCarousel/components/ButtonContainerRow.js +0 -32
  180. package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.cjs +0 -45
  181. package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.js +0 -44
  182. package/dist/PromptCarousel/components/CarouselContentWithRowScroll.cjs +0 -33
  183. package/dist/PromptCarousel/components/CarouselContentWithRowScroll.js +0 -32
  184. package/dist/PromptCarousel/components/index.cjs +0 -13
  185. package/dist/PromptCarousel/components/index.js +0 -13
  186. package/dist/PromptCarousel/hooks/useButtonScrollPosition.cjs +0 -79
  187. package/dist/PromptCarousel/hooks/useButtonScrollPosition.js +0 -78
  188. package/dist/PromptCarousel/hooks/useCarouselAnimation.cjs +0 -23
  189. package/dist/PromptCarousel/hooks/useCarouselAnimation.js +0 -22
  190. package/dist/PromptCarousel/hooks/useCarouselRefs.cjs +0 -20
  191. package/dist/PromptCarousel/hooks/useCarouselRefs.js +0 -19
  192. package/dist/PromptCarousel/hooks/useGetScrollProperties.cjs +0 -18
  193. package/dist/PromptCarousel/hooks/useGetScrollProperties.js +0 -17
  194. package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.cjs +0 -78
  195. package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.js +0 -77
  196. package/src/components/PromptCarousel/components/BlockScrollContainer.tsx +0 -34
  197. package/src/components/PromptCarousel/components/ButtonContainerRow.tsx +0 -46
  198. package/src/components/PromptCarousel/components/CarouselContentWithBlockScroll.tsx +0 -83
  199. package/src/components/PromptCarousel/components/CarouselContentWithRowScroll.tsx +0 -71
  200. package/src/components/PromptCarousel/components/index.ts +0 -9
  201. package/src/components/PromptCarousel/hooks/useButtonScrollPosition.ts +0 -128
  202. package/src/components/PromptCarousel/hooks/useCarouselAnimation.ts +0 -47
  203. package/src/components/PromptCarousel/hooks/useCarouselRefs.ts +0 -27
@@ -0,0 +1,91 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_PromptCarousel_types_types = require('../types/types.cjs');
3
+ let react = require("react");
4
+
5
+ //#region src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts
6
+ function useCoordinatedScrollAnimation({ scrollContainerRefs, animationSpeed = require_PromptCarousel_types_types.AnimationSpeed.NONE }) {
7
+ const resumeTimeoutRef = (0, react.useRef)(null);
8
+ const scrollAnimationRefs = (0, react.useRef)([]);
9
+ const isPausedRef = (0, react.useRef)(false);
10
+ let PIXELS_PER_SECOND = 0;
11
+ switch (animationSpeed) {
12
+ case require_PromptCarousel_types_types.AnimationSpeed.FAST:
13
+ PIXELS_PER_SECOND = 60;
14
+ break;
15
+ case require_PromptCarousel_types_types.AnimationSpeed.SLOW:
16
+ PIXELS_PER_SECOND = 30;
17
+ break;
18
+ default: PIXELS_PER_SECOND = 0;
19
+ }
20
+ const RESUME_DELAY_MS = 1500;
21
+ const isAnimated = animationSpeed !== require_PromptCarousel_types_types.AnimationSpeed.NONE;
22
+ (0, react.useEffect)(() => {
23
+ if (!isAnimated || scrollContainerRefs.length === 0) return void 0;
24
+ const containers = scrollContainerRefs.map((ref) => ref.current).filter((el) => el !== null);
25
+ if (containers.length === 0) return void 0;
26
+ const animationStates = containers.map(() => ({
27
+ lastTimestamp: null,
28
+ accumulatedScroll: 0
29
+ }));
30
+ const step = (timestamp) => {
31
+ if (!isPausedRef.current) containers.forEach((containerElement, index) => {
32
+ const container = containerElement;
33
+ if (container.scrollWidth <= container.clientWidth) return;
34
+ const state = animationStates[index];
35
+ if (state.lastTimestamp === null) state.lastTimestamp = timestamp;
36
+ const delta = timestamp - state.lastTimestamp;
37
+ state.lastTimestamp = timestamp;
38
+ state.accumulatedScroll += PIXELS_PER_SECOND * (delta / 1e3);
39
+ const pixelsToScroll = Math.floor(state.accumulatedScroll);
40
+ if (pixelsToScroll > 0) {
41
+ container.scrollLeft += pixelsToScroll;
42
+ state.accumulatedScroll -= pixelsToScroll;
43
+ if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
44
+ container.scrollLeft = 0;
45
+ state.accumulatedScroll = 0;
46
+ }
47
+ }
48
+ });
49
+ const rafId = requestAnimationFrame(step);
50
+ scrollAnimationRefs.current[0] = rafId;
51
+ };
52
+ scrollAnimationRefs.current[0] = requestAnimationFrame(step);
53
+ const pauseAnimation = () => {
54
+ isPausedRef.current = true;
55
+ if (resumeTimeoutRef.current) {
56
+ clearTimeout(resumeTimeoutRef.current);
57
+ resumeTimeoutRef.current = null;
58
+ }
59
+ };
60
+ const scheduleResumeAnimation = () => {
61
+ resumeTimeoutRef.current = window.setTimeout(() => {
62
+ isPausedRef.current = false;
63
+ animationStates.forEach((stateElement) => {
64
+ const state = stateElement;
65
+ state.lastTimestamp = null;
66
+ });
67
+ }, RESUME_DELAY_MS);
68
+ };
69
+ containers.forEach((container) => {
70
+ container.addEventListener("mouseenter", pauseAnimation);
71
+ container.addEventListener("mouseleave", scheduleResumeAnimation);
72
+ });
73
+ return () => {
74
+ scrollAnimationRefs.current.forEach((rafId) => {
75
+ if (rafId) cancelAnimationFrame(rafId);
76
+ });
77
+ containers.forEach((container) => {
78
+ container.removeEventListener("mouseenter", pauseAnimation);
79
+ container.removeEventListener("mouseleave", scheduleResumeAnimation);
80
+ });
81
+ if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
82
+ };
83
+ }, [
84
+ isAnimated,
85
+ PIXELS_PER_SECOND,
86
+ scrollContainerRefs
87
+ ]);
88
+ }
89
+
90
+ //#endregion
91
+ exports.useCoordinatedScrollAnimation = useCoordinatedScrollAnimation;
@@ -0,0 +1,90 @@
1
+ import { AnimationSpeed } from "../types/types.js";
2
+ import { useEffect, useRef } from "react";
3
+
4
+ //#region src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts
5
+ function useCoordinatedScrollAnimation({ scrollContainerRefs, animationSpeed = AnimationSpeed.NONE }) {
6
+ const resumeTimeoutRef = useRef(null);
7
+ const scrollAnimationRefs = useRef([]);
8
+ const isPausedRef = useRef(false);
9
+ let PIXELS_PER_SECOND = 0;
10
+ switch (animationSpeed) {
11
+ case AnimationSpeed.FAST:
12
+ PIXELS_PER_SECOND = 60;
13
+ break;
14
+ case AnimationSpeed.SLOW:
15
+ PIXELS_PER_SECOND = 30;
16
+ break;
17
+ default: PIXELS_PER_SECOND = 0;
18
+ }
19
+ const RESUME_DELAY_MS = 1500;
20
+ const isAnimated = animationSpeed !== AnimationSpeed.NONE;
21
+ useEffect(() => {
22
+ if (!isAnimated || scrollContainerRefs.length === 0) return void 0;
23
+ const containers = scrollContainerRefs.map((ref) => ref.current).filter((el) => el !== null);
24
+ if (containers.length === 0) return void 0;
25
+ const animationStates = containers.map(() => ({
26
+ lastTimestamp: null,
27
+ accumulatedScroll: 0
28
+ }));
29
+ const step = (timestamp) => {
30
+ if (!isPausedRef.current) containers.forEach((containerElement, index) => {
31
+ const container = containerElement;
32
+ if (container.scrollWidth <= container.clientWidth) return;
33
+ const state = animationStates[index];
34
+ if (state.lastTimestamp === null) state.lastTimestamp = timestamp;
35
+ const delta = timestamp - state.lastTimestamp;
36
+ state.lastTimestamp = timestamp;
37
+ state.accumulatedScroll += PIXELS_PER_SECOND * (delta / 1e3);
38
+ const pixelsToScroll = Math.floor(state.accumulatedScroll);
39
+ if (pixelsToScroll > 0) {
40
+ container.scrollLeft += pixelsToScroll;
41
+ state.accumulatedScroll -= pixelsToScroll;
42
+ if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
43
+ container.scrollLeft = 0;
44
+ state.accumulatedScroll = 0;
45
+ }
46
+ }
47
+ });
48
+ const rafId = requestAnimationFrame(step);
49
+ scrollAnimationRefs.current[0] = rafId;
50
+ };
51
+ scrollAnimationRefs.current[0] = requestAnimationFrame(step);
52
+ const pauseAnimation = () => {
53
+ isPausedRef.current = true;
54
+ if (resumeTimeoutRef.current) {
55
+ clearTimeout(resumeTimeoutRef.current);
56
+ resumeTimeoutRef.current = null;
57
+ }
58
+ };
59
+ const scheduleResumeAnimation = () => {
60
+ resumeTimeoutRef.current = window.setTimeout(() => {
61
+ isPausedRef.current = false;
62
+ animationStates.forEach((stateElement) => {
63
+ const state = stateElement;
64
+ state.lastTimestamp = null;
65
+ });
66
+ }, RESUME_DELAY_MS);
67
+ };
68
+ containers.forEach((container) => {
69
+ container.addEventListener("mouseenter", pauseAnimation);
70
+ container.addEventListener("mouseleave", scheduleResumeAnimation);
71
+ });
72
+ return () => {
73
+ scrollAnimationRefs.current.forEach((rafId) => {
74
+ if (rafId) cancelAnimationFrame(rafId);
75
+ });
76
+ containers.forEach((container) => {
77
+ container.removeEventListener("mouseenter", pauseAnimation);
78
+ container.removeEventListener("mouseleave", scheduleResumeAnimation);
79
+ });
80
+ if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
81
+ };
82
+ }, [
83
+ isAnimated,
84
+ PIXELS_PER_SECOND,
85
+ scrollContainerRefs
86
+ ]);
87
+ }
88
+
89
+ //#endregion
90
+ export { useCoordinatedScrollAnimation };
@@ -0,0 +1,65 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let react = require("react");
3
+
4
+ //#region src/components/PromptCarousel/hooks/useScrollSync.ts
5
+ function useScrollSync({ scrollContainerRefs, enabled }) {
6
+ const isSyncingRef = (0, react.useRef)(false);
7
+ const isDraggingRef = (0, react.useRef)(false);
8
+ (0, react.useEffect)(() => {
9
+ if (!enabled || scrollContainerRefs.length === 0) return void 0;
10
+ const containers = scrollContainerRefs.map((ref) => ref.current).filter((el) => el !== null);
11
+ if (containers.length === 0) return void 0;
12
+ const handleScroll = (sourceContainer) => {
13
+ if (!isDraggingRef.current) return;
14
+ if (isSyncingRef.current) return;
15
+ isSyncingRef.current = true;
16
+ const { scrollLeft } = sourceContainer;
17
+ containers.forEach((container) => {
18
+ if (container !== sourceContainer) {
19
+ const element = container;
20
+ element.scrollLeft = scrollLeft;
21
+ }
22
+ });
23
+ requestAnimationFrame(() => {
24
+ isSyncingRef.current = false;
25
+ });
26
+ };
27
+ const handleMouseDown = () => {
28
+ isDraggingRef.current = true;
29
+ };
30
+ const handleMouseUp = () => {
31
+ isDraggingRef.current = false;
32
+ };
33
+ const handleWheel = (e) => {
34
+ e.preventDefault();
35
+ };
36
+ const scrollListeners = containers.map((container) => {
37
+ const listener = () => handleScroll(container);
38
+ container.addEventListener("scroll", listener);
39
+ return {
40
+ container,
41
+ listener
42
+ };
43
+ });
44
+ containers.forEach((container) => {
45
+ container.addEventListener("mousedown", handleMouseDown);
46
+ container.addEventListener("mouseup", handleMouseUp);
47
+ container.addEventListener("wheel", handleWheel, { passive: false });
48
+ });
49
+ document.addEventListener("mouseup", handleMouseUp);
50
+ return () => {
51
+ scrollListeners.forEach(({ container, listener }) => {
52
+ container.removeEventListener("scroll", listener);
53
+ });
54
+ containers.forEach((container) => {
55
+ container.removeEventListener("mousedown", handleMouseDown);
56
+ container.removeEventListener("mouseup", handleMouseUp);
57
+ container.removeEventListener("wheel", handleWheel);
58
+ });
59
+ document.removeEventListener("mouseup", handleMouseUp);
60
+ };
61
+ }, [enabled, scrollContainerRefs]);
62
+ }
63
+
64
+ //#endregion
65
+ exports.useScrollSync = useScrollSync;
@@ -0,0 +1,64 @@
1
+ import { useEffect, useRef } from "react";
2
+
3
+ //#region src/components/PromptCarousel/hooks/useScrollSync.ts
4
+ function useScrollSync({ scrollContainerRefs, enabled }) {
5
+ const isSyncingRef = useRef(false);
6
+ const isDraggingRef = useRef(false);
7
+ useEffect(() => {
8
+ if (!enabled || scrollContainerRefs.length === 0) return void 0;
9
+ const containers = scrollContainerRefs.map((ref) => ref.current).filter((el) => el !== null);
10
+ if (containers.length === 0) return void 0;
11
+ const handleScroll = (sourceContainer) => {
12
+ if (!isDraggingRef.current) return;
13
+ if (isSyncingRef.current) return;
14
+ isSyncingRef.current = true;
15
+ const { scrollLeft } = sourceContainer;
16
+ containers.forEach((container) => {
17
+ if (container !== sourceContainer) {
18
+ const element = container;
19
+ element.scrollLeft = scrollLeft;
20
+ }
21
+ });
22
+ requestAnimationFrame(() => {
23
+ isSyncingRef.current = false;
24
+ });
25
+ };
26
+ const handleMouseDown = () => {
27
+ isDraggingRef.current = true;
28
+ };
29
+ const handleMouseUp = () => {
30
+ isDraggingRef.current = false;
31
+ };
32
+ const handleWheel = (e) => {
33
+ e.preventDefault();
34
+ };
35
+ const scrollListeners = containers.map((container) => {
36
+ const listener = () => handleScroll(container);
37
+ container.addEventListener("scroll", listener);
38
+ return {
39
+ container,
40
+ listener
41
+ };
42
+ });
43
+ containers.forEach((container) => {
44
+ container.addEventListener("mousedown", handleMouseDown);
45
+ container.addEventListener("mouseup", handleMouseUp);
46
+ container.addEventListener("wheel", handleWheel, { passive: false });
47
+ });
48
+ document.addEventListener("mouseup", handleMouseUp);
49
+ return () => {
50
+ scrollListeners.forEach(({ container, listener }) => {
51
+ container.removeEventListener("scroll", listener);
52
+ });
53
+ containers.forEach((container) => {
54
+ container.removeEventListener("mousedown", handleMouseDown);
55
+ container.removeEventListener("mouseup", handleMouseUp);
56
+ container.removeEventListener("wheel", handleWheel);
57
+ });
58
+ document.removeEventListener("mouseup", handleMouseUp);
59
+ };
60
+ }, [enabled, scrollContainerRefs]);
61
+ }
62
+
63
+ //#endregion
64
+ export { useScrollSync };
@@ -2,8 +2,8 @@ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
2
  const require_theme = require('../packages/components-v3/tokens/theme/theme.cjs');
3
3
  const require_resolveTheme = require('../utils/resolveTheme.cjs');
4
4
  const require_index = require('./components/index.cjs');
5
- let react = require("react");
6
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
+ let react = require("react");
7
7
 
8
8
  //#region src/components/ReviewCard/ReviewCard.tsx
9
9
  /**
@@ -1,5 +1,5 @@
1
1
  import { ReviewCardProps } from "./types/types.cjs";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ReviewCard/ReviewCard.d.ts
5
5
 
@@ -25,6 +25,6 @@ declare const ReviewCard: ({
25
25
  readMoreLabel,
26
26
  readLessLabel,
27
27
  verifiedBuyerLabel
28
- }: ReviewCardProps) => react_jsx_runtime8.JSX.Element;
28
+ }: ReviewCardProps) => react_jsx_runtime3.JSX.Element;
29
29
  //#endregion
30
30
  export { ReviewCard };
@@ -1,5 +1,5 @@
1
1
  import { ReviewCardProps } from "./types/types.js";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/ReviewCard/ReviewCard.d.ts
5
5
 
@@ -25,6 +25,6 @@ declare const ReviewCard: ({
25
25
  readMoreLabel,
26
26
  readLessLabel,
27
27
  verifiedBuyerLabel
28
- }: ReviewCardProps) => react_jsx_runtime15.JSX.Element;
28
+ }: ReviewCardProps) => react_jsx_runtime16.JSX.Element;
29
29
  //#endregion
30
30
  export { ReviewCard };
@@ -1,8 +1,8 @@
1
1
  import { Theme } from "../packages/components-v3/tokens/theme/theme.js";
2
2
  import { resolveTheme } from "../utils/resolveTheme.js";
3
3
  import { ReviewCardComponents } from "./components/index.js";
4
- import { useState } from "react";
5
4
  import { jsx } from "react/jsx-runtime";
5
+ import { useState } from "react";
6
6
 
7
7
  //#region src/components/ReviewCard/ReviewCard.tsx
8
8
  /**
@@ -2,8 +2,8 @@ import { Theme } from "../../tokens/theme/theme.cjs";
2
2
  import { ContainerProps } from "./Container.cjs";
3
3
  import { RatingProps } from "./Rating.cjs";
4
4
  import { ReadMoreButtonProps } from "./ReadMoreButton.cjs";
5
- import * as react2 from "react";
6
- import * as react_jsx_runtime9 from "react/jsx-runtime";
5
+ import * as react170 from "react";
6
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
7
7
 
8
8
  //#region src/components/ReviewCard/components/index.d.ts
9
9
  declare const ReviewCardComponents: {
@@ -31,12 +31,12 @@ declare const ReviewCardComponents: {
31
31
  verifiedBuyerLabel?: string;
32
32
  className?: string;
33
33
  style?: React.CSSProperties;
34
- }) => react_jsx_runtime9.JSX.Element;
34
+ }) => react_jsx_runtime4.JSX.Element;
35
35
  Rating: ({
36
36
  rating,
37
37
  theme,
38
38
  style
39
- }: RatingProps) => react_jsx_runtime9.JSX.Element;
39
+ }: RatingProps) => react_jsx_runtime4.JSX.Element;
40
40
  StarIcon: ({
41
41
  theme,
42
42
  style,
@@ -45,7 +45,7 @@ declare const ReviewCardComponents: {
45
45
  theme: Theme;
46
46
  style?: React.CSSProperties;
47
47
  className?: string;
48
- }) => react2.ReactElement<react2.SVGProps<SVGSVGElement>, string | react2.JSXElementConstructor<any>>;
48
+ }) => react170.ReactElement<react170.SVGProps<SVGSVGElement>, string | react170.JSXElementConstructor<any>>;
49
49
  ReviewText: ({
50
50
  reviewText,
51
51
  isExpanded,
@@ -56,7 +56,7 @@ declare const ReviewCardComponents: {
56
56
  isExpanded: boolean;
57
57
  className?: string;
58
58
  style?: React.CSSProperties;
59
- }) => react_jsx_runtime9.JSX.Element;
59
+ }) => react_jsx_runtime4.JSX.Element;
60
60
  ReadMoreButton: ({
61
61
  isExpanded,
62
62
  onToggle,
@@ -2,8 +2,8 @@ import { Theme } from "../../packages/components-v3/tokens/theme/theme.js";
2
2
  import { ContainerProps } from "./Container.js";
3
3
  import { RatingProps } from "./Rating.js";
4
4
  import { ReadMoreButtonProps } from "./ReadMoreButton.js";
5
- import * as react2 from "react";
6
- import * as react_jsx_runtime16 from "react/jsx-runtime";
5
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
6
+ import * as react5 from "react";
7
7
 
8
8
  //#region src/components/ReviewCard/components/index.d.ts
9
9
  declare const ReviewCardComponents: {
@@ -31,12 +31,12 @@ declare const ReviewCardComponents: {
31
31
  verifiedBuyerLabel?: string;
32
32
  className?: string;
33
33
  style?: React.CSSProperties;
34
- }) => react_jsx_runtime16.JSX.Element;
34
+ }) => react_jsx_runtime13.JSX.Element;
35
35
  Rating: ({
36
36
  rating,
37
37
  theme,
38
38
  style
39
- }: RatingProps) => react_jsx_runtime16.JSX.Element;
39
+ }: RatingProps) => react_jsx_runtime13.JSX.Element;
40
40
  StarIcon: ({
41
41
  theme,
42
42
  style,
@@ -45,7 +45,7 @@ declare const ReviewCardComponents: {
45
45
  theme: Theme;
46
46
  style?: React.CSSProperties;
47
47
  className?: string;
48
- }) => react2.ReactElement<react2.SVGProps<SVGSVGElement>, string | react2.JSXElementConstructor<any>>;
48
+ }) => react5.ReactElement<react5.SVGProps<SVGSVGElement>, string | react5.JSXElementConstructor<any>>;
49
49
  ReviewText: ({
50
50
  reviewText,
51
51
  isExpanded,
@@ -56,7 +56,7 @@ declare const ReviewCardComponents: {
56
56
  isExpanded: boolean;
57
57
  className?: string;
58
58
  style?: React.CSSProperties;
59
- }) => react_jsx_runtime16.JSX.Element;
59
+ }) => react_jsx_runtime13.JSX.Element;
60
60
  ReadMoreButton: ({
61
61
  isExpanded,
62
62
  onToggle,
@@ -1,5 +1,5 @@
1
1
  import { SalesAgentProductCardProps } from "./types/types.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/SalesAgentProductCard/SalesAgentProductCard.d.ts
5
5
 
@@ -29,6 +29,6 @@ declare const SalesAgentProductCard: ({
29
29
  image,
30
30
  url,
31
31
  onClick
32
- }: SalesAgentProductCardProps) => react_jsx_runtime0.JSX.Element;
32
+ }: SalesAgentProductCardProps) => react_jsx_runtime13.JSX.Element;
33
33
  //#endregion
34
34
  export { SalesAgentProductCard };
@@ -1,5 +1,5 @@
1
1
  import { SalesAgentProductCardProps } from "./types/types.js";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/SalesAgentProductCard/SalesAgentProductCard.d.ts
5
5
 
@@ -29,6 +29,6 @@ declare const SalesAgentProductCard: ({
29
29
  image,
30
30
  url,
31
31
  onClick
32
- }: SalesAgentProductCardProps) => react_jsx_runtime14.JSX.Element;
32
+ }: SalesAgentProductCardProps) => react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  export { SalesAgentProductCard };
@@ -4,8 +4,8 @@ import { ProductNameProps } from "./ProductName.cjs";
4
4
  import { PriceProps } from "./Price.cjs";
5
5
  import { RateProps } from "./Rate.cjs";
6
6
  import { ProductImageProps } from "./ProductImage.cjs";
7
- import * as react0 from "react";
8
- import * as react_jsx_runtime0 from "react/jsx-runtime";
7
+ import * as react176 from "react";
8
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/SalesAgentProductCard/components/index.d.ts
11
11
  declare const SalesAgentProductCardComponents: {
@@ -22,24 +22,24 @@ declare const SalesAgentProductCardComponents: {
22
22
  image,
23
23
  url,
24
24
  onClick
25
- }: ContainerProps) => react_jsx_runtime0.JSX.Element;
25
+ }: ContainerProps) => react_jsx_runtime8.JSX.Element;
26
26
  ProductName: ({
27
27
  label,
28
28
  theme,
29
29
  style,
30
30
  className
31
- }: ProductNameProps) => react_jsx_runtime0.JSX.Element;
31
+ }: ProductNameProps) => react_jsx_runtime8.JSX.Element;
32
32
  Price: ({
33
33
  previousPrice,
34
34
  currentPrice,
35
35
  pricePrefix,
36
36
  forceShowCurrentPriceSpace
37
- }: PriceProps) => react_jsx_runtime0.JSX.Element;
37
+ }: PriceProps) => react_jsx_runtime8.JSX.Element;
38
38
  Rate: ({
39
39
  rate,
40
40
  numberOfReviews,
41
41
  theme
42
- }: RateProps) => react_jsx_runtime0.JSX.Element;
42
+ }: RateProps) => react_jsx_runtime8.JSX.Element;
43
43
  ProductImage: ({
44
44
  src,
45
45
  alt,
@@ -47,14 +47,14 @@ declare const SalesAgentProductCardComponents: {
47
47
  aspectRatio,
48
48
  className,
49
49
  ...props
50
- }: ProductImageProps) => react_jsx_runtime0.JSX.Element;
50
+ }: ProductImageProps) => react_jsx_runtime8.JSX.Element;
51
51
  StarIcon: ({
52
52
  theme,
53
53
  style
54
54
  }: {
55
55
  theme: Theme;
56
56
  style?: React.CSSProperties;
57
- }) => react0.ReactElement<react0.SVGProps<SVGSVGElement>, string | react0.JSXElementConstructor<any>>;
57
+ }) => react176.ReactElement<react176.SVGProps<SVGSVGElement>, string | react176.JSXElementConstructor<any>>;
58
58
  };
59
59
  //#endregion
60
60
  export { SalesAgentProductCardComponents };
@@ -4,8 +4,8 @@ import { ProductNameProps } from "./ProductName.js";
4
4
  import { PriceProps } from "./Price.js";
5
5
  import { RateProps } from "./Rate.js";
6
6
  import { ProductImageProps } from "./ProductImage.js";
7
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
8
  import * as react0 from "react";
8
- import * as react_jsx_runtime9 from "react/jsx-runtime";
9
9
 
10
10
  //#region src/components/SalesAgentProductCard/components/index.d.ts
11
11
  declare const SalesAgentProductCardComponents: {
@@ -22,24 +22,24 @@ declare const SalesAgentProductCardComponents: {
22
22
  image,
23
23
  url,
24
24
  onClick
25
- }: ContainerProps) => react_jsx_runtime9.JSX.Element;
25
+ }: ContainerProps) => react_jsx_runtime0.JSX.Element;
26
26
  ProductName: ({
27
27
  label,
28
28
  theme,
29
29
  style,
30
30
  className
31
- }: ProductNameProps) => react_jsx_runtime9.JSX.Element;
31
+ }: ProductNameProps) => react_jsx_runtime0.JSX.Element;
32
32
  Price: ({
33
33
  previousPrice,
34
34
  currentPrice,
35
35
  pricePrefix,
36
36
  forceShowCurrentPriceSpace
37
- }: PriceProps) => react_jsx_runtime9.JSX.Element;
37
+ }: PriceProps) => react_jsx_runtime0.JSX.Element;
38
38
  Rate: ({
39
39
  rate,
40
40
  numberOfReviews,
41
41
  theme
42
- }: RateProps) => react_jsx_runtime9.JSX.Element;
42
+ }: RateProps) => react_jsx_runtime0.JSX.Element;
43
43
  ProductImage: ({
44
44
  src,
45
45
  alt,
@@ -47,7 +47,7 @@ declare const SalesAgentProductCardComponents: {
47
47
  aspectRatio,
48
48
  className,
49
49
  ...props
50
- }: ProductImageProps) => react_jsx_runtime9.JSX.Element;
50
+ }: ProductImageProps) => react_jsx_runtime0.JSX.Element;
51
51
  StarIcon: ({
52
52
  theme,
53
53
  style
@@ -1,5 +1,5 @@
1
1
  import { SocialProofProps } from "./types/types.cjs";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime26 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/SocialProof/SocialProof.d.ts
5
5
  declare const SocialProof: ({
@@ -7,6 +7,6 @@ declare const SocialProof: ({
7
7
  widgetContentProps,
8
8
  widgetStyleProps,
9
9
  widgetEventProps
10
- }: SocialProofProps) => react_jsx_runtime6.JSX.Element;
10
+ }: SocialProofProps) => react_jsx_runtime26.JSX.Element;
11
11
  //#endregion
12
12
  export { SocialProof };
@@ -1,5 +1,5 @@
1
1
  import { SocialProofProps } from "./types/types.js";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/SocialProof/SocialProof.d.ts
5
5
  declare const SocialProof: ({
@@ -7,6 +7,6 @@ declare const SocialProof: ({
7
7
  widgetContentProps,
8
8
  widgetStyleProps,
9
9
  widgetEventProps
10
- }: SocialProofProps) => react_jsx_runtime2.JSX.Element;
10
+ }: SocialProofProps) => react_jsx_runtime7.JSX.Element;
11
11
  //#endregion
12
12
  export { SocialProof };
@@ -11,8 +11,8 @@ require('../../Typography/index.cjs');
11
11
  const require_PromptButton_types_index = require('../../PromptButton/types/index.cjs');
12
12
  const require_PromptButton = require('../../PromptButton/PromptButton.cjs');
13
13
  require('../../PromptButton/index.cjs');
14
- let react = require("react");
15
14
  let react_jsx_runtime = require("react/jsx-runtime");
15
+ let react = require("react");
16
16
  let classnames = require("classnames");
17
17
  classnames = require_rolldown_runtime.__toESM(classnames);
18
18
 
@@ -10,8 +10,8 @@ import "../../Typography/index.js";
10
10
  import { PromptButtonVariant } from "../../PromptButton/types/index.js";
11
11
  import { PromptButton } from "../../PromptButton/PromptButton.js";
12
12
  import "../../PromptButton/index.js";
13
- import { forwardRef } from "react";
14
13
  import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { forwardRef } from "react";
15
15
  import classNames from "classnames";
16
16
 
17
17
  //#region src/components/SocialProof/components/Headline.tsx
@@ -7,8 +7,8 @@ const require_functions = require('../utils/functions.cjs');
7
7
  const require_types = require('../../ImageGallery/types/types.cjs');
8
8
  const require_ImageGallery = require('./ImageGallery.cjs');
9
9
  const require_types$1 = require('../types/types.cjs');
10
- let react = require("react");
11
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
+ let react = require("react");
12
12
 
13
13
  //#region src/components/SocialProof/components/LayoutSingle.tsx
14
14
  const LayoutSingle = ({ dynamicLayout, hideImage, images, headline, subheadline, textfield }) => {
@@ -6,8 +6,8 @@ import { calculateWidthImageGallery } from "../utils/functions.js";
6
6
  import { ImageGalleryLayout } from "../../ImageGallery/types/types.js";
7
7
  import { ImageGallery } from "./ImageGallery.js";
8
8
  import { DynamicLayout } from "../types/types.js";
9
- import { cloneElement } from "react";
10
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
+ import { cloneElement } from "react";
11
11
 
12
12
  //#region src/components/SocialProof/components/LayoutSingle.tsx
13
13
  const LayoutSingle = ({ dynamicLayout, hideImage, images, headline, subheadline, textfield }) => {