@envive-ai/react-toolkit-v3 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AnimatedText/AnimatedText.cjs +1 -0
- package/dist/AnimatedText/AnimatedText.d.cts +3 -3
- package/dist/AnimatedText/AnimatedText.js +1 -0
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/Carousel/Carousel.cjs +1 -1
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/Carousel.d.ts +2 -2
- package/dist/Carousel/Carousel.js +1 -1
- package/dist/Carousel/components/Container.cjs +2 -2
- package/dist/Carousel/components/Container.js +2 -2
- package/dist/ChatFooter/ChatFooter.cjs +1 -1
- package/dist/ChatFooter/ChatFooter.d.cts +2 -2
- package/dist/ChatFooter/ChatFooter.d.ts +2 -2
- package/dist/ChatFooter/ChatFooter.js +1 -1
- package/dist/ChatFooter/components/Layout.cjs +2 -2
- package/dist/ChatFooter/components/Layout.js +2 -2
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatHeader/ChatHeader.d.cts +2 -2
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/components/Handle.cjs +2 -2
- package/dist/ChatHeader/components/Handle.js +2 -2
- package/dist/ChatHeader/components/Toggle.cjs +3 -3
- package/dist/ChatHeader/components/Toggle.js +3 -3
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetCloseButtonProperties.js +1 -1
- package/dist/ChatPreview/ChatPreview.cjs +14 -4
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +14 -4
- package/dist/ChatPreview/types/types.d.cts +5 -4
- package/dist/ChatPreview/types/types.d.ts +5 -4
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +14 -4
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +14 -4
- package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Headline.js +2 -2
- package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
- package/dist/ChatPreviewComparison/components/Layout.js +4 -4
- package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Message.js +2 -2
- package/dist/ChatPreviewComparison/types/types.d.cts +4 -4
- package/dist/ChatPreviewComparison/types/types.d.ts +4 -4
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/Container/Container.d.cts +5 -5
- package/dist/Container/Container.d.ts +176 -176
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/Disclaimer/components/Container.cjs +2 -2
- package/dist/Disclaimer/components/Container.js +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
- package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.cjs +3 -2
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.js +3 -2
- package/dist/FloatingChat/components/AgentMessage.cjs +9 -5
- package/dist/FloatingChat/components/AgentMessage.js +9 -5
- package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
- package/dist/FloatingChat/components/ChatMessages.js +1 -1
- package/dist/FloatingChat/components/Layout.cjs +13 -13
- package/dist/FloatingChat/components/Layout.js +13 -13
- package/dist/FloatingChat/components/ModalSheet.cjs +5 -6
- package/dist/FloatingChat/components/ModalSheet.js +5 -6
- package/dist/FloatingChat/components/ReviewCardsCarousel.cjs +2 -1
- package/dist/FloatingChat/components/ReviewCardsCarousel.js +2 -1
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +0 -3
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +0 -3
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/ImageGallery/ImageGallery.d.cts +2 -2
- package/dist/ImageGallery/ImageGallery.d.ts +2 -2
- package/dist/ImageGallery/components/Layout.cjs +1 -1
- package/dist/ImageGallery/components/Layout.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/LinkButton.cjs +1 -1
- package/dist/Message/components/LinkButton.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +10 -6
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +5 -2
- package/dist/ProductCard/components/Header.cjs +2 -2
- package/dist/ProductCard/components/Header.js +2 -2
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.cjs +3 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.js +3 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +7 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +8 -3
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +53 -3
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +53 -3
- package/dist/PromptCarousel/PromptCarousel.cjs +71 -33
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +73 -35
- package/dist/PromptCarousel/hooks/index.cjs +2 -4
- package/dist/PromptCarousel/hooks/index.js +2 -4
- package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.cjs +91 -0
- package/dist/PromptCarousel/hooks/useCoordinatedScrollAnimation.js +90 -0
- package/dist/PromptCarousel/hooks/useScrollSync.cjs +65 -0
- package/dist/PromptCarousel/hooks/useScrollSync.js +64 -0
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +2 -2
- package/dist/ReviewCard/components/Container.js +2 -2
- package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
- package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
- package/dist/ReviewCard/components/index.d.cts +4 -4
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
- package/dist/SalesAgentProductCard/components/Container.js +2 -2
- package/dist/SalesAgentProductCard/components/index.d.cts +6 -6
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.cjs +1 -1
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/SocialProof.js +1 -1
- package/dist/SocialProof/components/Headline.cjs +3 -3
- package/dist/SocialProof/components/Headline.js +3 -3
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/Subheadline.cjs +1 -1
- package/dist/SocialProof/components/Subheadline.js +1 -1
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/TextField/utils/getIconColor.cjs +1 -1
- package/dist/TextField/utils/getIconColor.js +1 -1
- package/dist/TextField/utils/getSendIconElement.cjs +1 -1
- package/dist/TextField/utils/getSendIconElement.js +1 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
- package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
- package/dist/Tokens/index.cjs +1 -1
- package/dist/Tokens/index.js +1 -1
- package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
- package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
- package/dist/Typography/Typography.d.cts +4 -4
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +2 -2
- package/dist/WelcomeMessage/components/Container.js +2 -2
- package/dist/WidgetTextField/WidgetTextField.cjs +11 -6
- package/dist/WidgetTextField/WidgetTextField.d.cts +3 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +3 -2
- package/dist/WidgetTextField/WidgetTextField.js +7 -2
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/FakeTextInput.cjs +2 -2
- package/dist/WidgetTextField/components/FakeTextInput.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +11 -9
- package/dist/WidgetTextField/components/Icon.js +11 -9
- package/dist/WidgetTextField/types/types.d.cts +3 -0
- package/dist/WidgetTextField/types/types.d.ts +3 -0
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/styles.css +1 -1
- package/dist/utils/CustomIcon.cjs +1 -1
- package/dist/utils/CustomIcon.js +1 -1
- package/dist/utils/useDragToScroll.cjs +68 -0
- package/dist/utils/useDragToScroll.js +67 -0
- package/package.json +1 -1
- package/src/components/AnimatedText/AnimatedText.tsx +2 -0
- package/src/components/ChatHeader/hooks/useGetCloseButtonProperties.ts +1 -1
- package/src/components/ChatPreview/ChatPreview.tsx +20 -3
- package/src/components/ChatPreview/types/types.ts +5 -4
- package/src/components/ChatPreviewComparison/ChatPreviewComparison.tsx +20 -3
- package/src/components/ChatPreviewComparison/types/types.ts +4 -4
- package/src/components/FloatingChat/FloatingChat.tsx +3 -2
- package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
- package/src/components/FloatingChat/components/Layout.tsx +7 -2
- package/src/components/FloatingChat/components/ModalSheet.tsx +5 -7
- package/src/components/FloatingChat/components/ReviewCardsCarousel.tsx +3 -0
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +0 -3
- package/src/components/ProductCard/ProductCard.tsx +12 -1
- package/src/components/ProductCard/components/Header.tsx +10 -8
- package/src/components/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.tsx +6 -3
- package/src/components/PromptButtonCarouselWithImage/components/Layout.tsx +13 -4
- package/src/components/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.tsx +63 -20
- package/src/components/PromptCarousel/PromptCarousel.tsx +89 -51
- package/src/components/PromptCarousel/hooks/index.ts +2 -4
- package/src/components/PromptCarousel/hooks/useCoordinatedScrollAnimation.ts +115 -0
- package/src/components/PromptCarousel/hooks/useHorizontalScrollAnimation.ts +71 -78
- package/src/components/PromptCarousel/hooks/useScrollSync.ts +83 -0
- package/src/components/TextField/utils/getIconColor.ts +1 -1
- package/src/components/TextField/utils/getSendIconElement.tsx +3 -1
- package/src/components/WidgetTextField/WidgetTextField.tsx +9 -1
- package/src/components/WidgetTextField/components/FakeTextInput.tsx +6 -2
- package/src/components/WidgetTextField/components/Icon.tsx +44 -9
- package/src/components/WidgetTextField/types/types.ts +3 -0
- package/src/components/utils/CustomIcon.tsx +1 -1
- package/src/components/utils/useDragToScroll.ts +83 -0
- package/dist/PromptCarousel/components/BlockScrollContainer.cjs +0 -23
- package/dist/PromptCarousel/components/BlockScrollContainer.js +0 -21
- package/dist/PromptCarousel/components/ButtonContainerRow.cjs +0 -34
- package/dist/PromptCarousel/components/ButtonContainerRow.js +0 -32
- package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.cjs +0 -45
- package/dist/PromptCarousel/components/CarouselContentWithBlockScroll.js +0 -44
- package/dist/PromptCarousel/components/CarouselContentWithRowScroll.cjs +0 -33
- package/dist/PromptCarousel/components/CarouselContentWithRowScroll.js +0 -32
- package/dist/PromptCarousel/components/index.cjs +0 -13
- package/dist/PromptCarousel/components/index.js +0 -13
- package/dist/PromptCarousel/hooks/useButtonScrollPosition.cjs +0 -79
- package/dist/PromptCarousel/hooks/useButtonScrollPosition.js +0 -78
- package/dist/PromptCarousel/hooks/useCarouselAnimation.cjs +0 -23
- package/dist/PromptCarousel/hooks/useCarouselAnimation.js +0 -22
- package/dist/PromptCarousel/hooks/useCarouselRefs.cjs +0 -20
- package/dist/PromptCarousel/hooks/useCarouselRefs.js +0 -19
- package/dist/PromptCarousel/hooks/useGetScrollProperties.cjs +0 -18
- package/dist/PromptCarousel/hooks/useGetScrollProperties.js +0 -17
- package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.cjs +0 -78
- package/dist/PromptCarousel/hooks/useHorizontalScrollAnimation.js +0 -77
- package/src/components/PromptCarousel/components/BlockScrollContainer.tsx +0 -34
- package/src/components/PromptCarousel/components/ButtonContainerRow.tsx +0 -46
- package/src/components/PromptCarousel/components/CarouselContentWithBlockScroll.tsx +0 -83
- package/src/components/PromptCarousel/components/CarouselContentWithRowScroll.tsx +0 -71
- package/src/components/PromptCarousel/components/index.ts +0 -9
- package/src/components/PromptCarousel/hooks/useButtonScrollPosition.ts +0 -128
- package/src/components/PromptCarousel/hooks/useCarouselAnimation.ts +0 -47
- package/src/components/PromptCarousel/hooks/useCarouselRefs.ts +0 -27
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
import { useScrollContainer } from 'react-indiana-drag-scroll';
|
|
2
3
|
import { Theme } from '../../../tokens/theme/theme';
|
|
3
4
|
import { PromptButton, PromptButtonVariant } from '../PromptButton';
|
|
4
5
|
import { useCheckIsMobile } from '../utils/useCheckIsMobile';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
PromptCarouselProps,
|
|
8
|
-
PromptCarouselRows,
|
|
9
|
-
RepetitionNumberSuffix,
|
|
10
|
-
} from './types/types';
|
|
11
|
-
import { useCarouselAnimation, useCarouselButtons, useCarouselRefs } from './hooks';
|
|
12
|
-
import { PromptCarouselComponents } from './components';
|
|
6
|
+
import { AnimationSpeed, PromptCarouselProps, PromptCarouselRows } from './types/types';
|
|
7
|
+
import { useCarouselButtons, useCoordinatedScrollAnimation, useScrollSync } from './hooks';
|
|
13
8
|
import { Container } from '../Container';
|
|
14
9
|
import { isAnimated, removeSpaces, shouldShowTwoRows } from './utils/functions';
|
|
15
10
|
import { resolveTheme } from '../utils/resolveTheme';
|
|
11
|
+
import { Stack } from '../Stack';
|
|
16
12
|
|
|
17
13
|
export const PromptCarousel = ({
|
|
18
14
|
id,
|
|
@@ -37,21 +33,39 @@ export const PromptCarousel = ({
|
|
|
37
33
|
const shouldShowTwoRowsValue = shouldShowTwoRows(promptCarouselRows, isMobile);
|
|
38
34
|
const finalTheme = resolveTheme(theme);
|
|
39
35
|
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
blockScrollRef,
|
|
45
|
-
blockFirstRowStackRef,
|
|
46
|
-
scrollRefs,
|
|
47
|
-
} = useCarouselRefs({ shouldShowTwoRows: shouldShowTwoRowsValue });
|
|
36
|
+
const { ref: dragScrollRef1 } = useScrollContainer();
|
|
37
|
+
const { ref: dragScrollRef2 } = useScrollContainer();
|
|
38
|
+
const scrollContainerRef1 = useRef<HTMLDivElement>(null);
|
|
39
|
+
const scrollContainerRef2 = useRef<HTMLDivElement>(null);
|
|
48
40
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
const setRef1 = useCallback(
|
|
42
|
+
(el: HTMLDivElement | null) => {
|
|
43
|
+
if (typeof dragScrollRef1 === 'function') dragScrollRef1(el);
|
|
44
|
+
scrollContainerRef1.current = el;
|
|
45
|
+
},
|
|
46
|
+
[dragScrollRef1],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const setRef2 = useCallback(
|
|
50
|
+
(el: HTMLDivElement | null) => {
|
|
51
|
+
if (typeof dragScrollRef2 === 'function') dragScrollRef2(el);
|
|
52
|
+
scrollContainerRef2.current = el;
|
|
53
|
+
},
|
|
54
|
+
[dragScrollRef2],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const scrollContainerRefs = shouldShowTwoRowsValue
|
|
58
|
+
? [scrollContainerRef1, scrollContainerRef2]
|
|
59
|
+
: [scrollContainerRef1];
|
|
60
|
+
|
|
61
|
+
useCoordinatedScrollAnimation({
|
|
62
|
+
scrollContainerRefs,
|
|
53
63
|
animationSpeed,
|
|
54
|
-
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
useScrollSync({
|
|
67
|
+
scrollContainerRefs,
|
|
68
|
+
enabled: true,
|
|
55
69
|
});
|
|
56
70
|
|
|
57
71
|
const { visibleButtonsFirstRow, visibleButtonsSecondRow } = useCarouselButtons({
|
|
@@ -60,11 +74,12 @@ export const PromptCarousel = ({
|
|
|
60
74
|
});
|
|
61
75
|
|
|
62
76
|
const renderButton = useCallback(
|
|
63
|
-
(text: string, index: number,
|
|
77
|
+
(text: string, index: number, duplicateIndex = 0) => {
|
|
64
78
|
const textWithoutSpaces = removeSpaces(text);
|
|
65
|
-
const buttonId =
|
|
66
|
-
|
|
67
|
-
|
|
79
|
+
const buttonId =
|
|
80
|
+
duplicateIndex > 0
|
|
81
|
+
? `${id}-${textWithoutSpaces}-duplicate-${duplicateIndex}`
|
|
82
|
+
: `${id}-${textWithoutSpaces}`;
|
|
68
83
|
const buttonKey = `button-${buttonId}`;
|
|
69
84
|
|
|
70
85
|
return (
|
|
@@ -75,7 +90,7 @@ export const PromptCarousel = ({
|
|
|
75
90
|
variant={promptButtonType}
|
|
76
91
|
theme={finalTheme}
|
|
77
92
|
isLoading={isLoading}
|
|
78
|
-
bold={boldFirstButton && index === 0}
|
|
93
|
+
bold={boldFirstButton && index === 0 && duplicateIndex === 0}
|
|
79
94
|
onClick={() => handleButtonClick?.(text)}
|
|
80
95
|
/>
|
|
81
96
|
);
|
|
@@ -83,6 +98,14 @@ export const PromptCarousel = ({
|
|
|
83
98
|
[id, promptButtonType, boldFirstButton, handleButtonClick, isLoading, finalTheme],
|
|
84
99
|
);
|
|
85
100
|
|
|
101
|
+
const renderButtonRow = (buttons: string[], startIndex: number) => (
|
|
102
|
+
<>
|
|
103
|
+
{buttons.map((text, i) => renderButton(text, startIndex + i, 0))}
|
|
104
|
+
{isAnimatedValue && buttons.map((text, i) => renderButton(text, startIndex + i, 1))}
|
|
105
|
+
{isAnimatedValue && buttons.map((text, i) => renderButton(text, startIndex + i, 2))}
|
|
106
|
+
</>
|
|
107
|
+
);
|
|
108
|
+
|
|
86
109
|
const defaultAriaLabel = ariaLabel || 'Prompt carousel with suggested actions';
|
|
87
110
|
|
|
88
111
|
return (
|
|
@@ -98,30 +121,45 @@ export const PromptCarousel = ({
|
|
|
98
121
|
aria-busy={isLoading}
|
|
99
122
|
aria-live={isAnimatedValue && !isLoading ? 'polite' : undefined}
|
|
100
123
|
>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
<Stack
|
|
125
|
+
direction="column"
|
|
126
|
+
className={animationSpeed === AnimationSpeed.NONE ? 'envive-tw-w-full' : ''}
|
|
127
|
+
gap="2"
|
|
128
|
+
>
|
|
129
|
+
<div
|
|
130
|
+
className="envive-tw-no-scrollbar envive-tw-relative envive-tw-w-full envive-tw-overflow-x-scroll"
|
|
131
|
+
ref={setRef1}
|
|
132
|
+
style={{ cursor: 'grab', userSelect: 'none' }}
|
|
133
|
+
>
|
|
134
|
+
<div className="envive-tw-relative envive-tw-inline-block envive-tw-whitespace-nowrap">
|
|
135
|
+
<Stack
|
|
136
|
+
direction="row"
|
|
137
|
+
gap="2"
|
|
138
|
+
className="envive-tw-pl-0 envive-tw-h-full envive-tw-items-center"
|
|
139
|
+
>
|
|
140
|
+
{renderButtonRow(visibleButtonsFirstRow, 0)}
|
|
141
|
+
</Stack>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
{shouldShowTwoRowsValue && (
|
|
146
|
+
<div
|
|
147
|
+
className="envive-tw-no-scrollbar envive-tw-relative envive-tw-w-full envive-tw-overflow-x-scroll"
|
|
148
|
+
ref={setRef2}
|
|
149
|
+
style={{ cursor: 'grab', userSelect: 'none' }}
|
|
150
|
+
>
|
|
151
|
+
<div className="envive-tw-relative envive-tw-inline-block envive-tw-whitespace-nowrap">
|
|
152
|
+
<Stack
|
|
153
|
+
direction="row"
|
|
154
|
+
gap="2"
|
|
155
|
+
className="envive-tw-pl-0 envive-tw-h-full envive-tw-items-center"
|
|
156
|
+
>
|
|
157
|
+
{renderButtonRow(visibleButtonsSecondRow, visibleButtonsFirstRow.length)}
|
|
158
|
+
</Stack>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
)}
|
|
162
|
+
</Stack>
|
|
125
163
|
</Container>
|
|
126
164
|
);
|
|
127
165
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { useHorizontalScrollAnimation } from './useHorizontalScrollAnimation';
|
|
2
|
-
export { useButtonScrollPosition } from './useButtonScrollPosition';
|
|
3
|
-
export { useCarouselRefs } from './useCarouselRefs';
|
|
4
1
|
export { useCarouselButtons } from './useCarouselButtons';
|
|
5
|
-
export {
|
|
2
|
+
export { useCoordinatedScrollAnimation } from './useCoordinatedScrollAnimation';
|
|
3
|
+
export { useScrollSync } from './useScrollSync';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { AnimationSpeed } from '../types/types';
|
|
3
|
+
|
|
4
|
+
interface UseCoordinatedScrollAnimationOptions {
|
|
5
|
+
scrollContainerRefs: React.RefObject<HTMLDivElement>[];
|
|
6
|
+
animationSpeed?: `${AnimationSpeed}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function useCoordinatedScrollAnimation({
|
|
10
|
+
scrollContainerRefs,
|
|
11
|
+
animationSpeed = AnimationSpeed.NONE,
|
|
12
|
+
}: UseCoordinatedScrollAnimationOptions): void {
|
|
13
|
+
const resumeTimeoutRef = useRef<number | null>(null);
|
|
14
|
+
const scrollAnimationRefs = useRef<number[]>([]);
|
|
15
|
+
const isPausedRef = useRef(false);
|
|
16
|
+
|
|
17
|
+
let PIXELS_PER_SECOND = 0;
|
|
18
|
+
switch (animationSpeed) {
|
|
19
|
+
case AnimationSpeed.FAST:
|
|
20
|
+
PIXELS_PER_SECOND = 60;
|
|
21
|
+
break;
|
|
22
|
+
case AnimationSpeed.SLOW:
|
|
23
|
+
PIXELS_PER_SECOND = 30;
|
|
24
|
+
break;
|
|
25
|
+
default:
|
|
26
|
+
PIXELS_PER_SECOND = 0;
|
|
27
|
+
}
|
|
28
|
+
const RESUME_DELAY_MS = 1500;
|
|
29
|
+
const isAnimated = animationSpeed !== AnimationSpeed.NONE;
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!isAnimated || scrollContainerRefs.length === 0) return undefined;
|
|
33
|
+
|
|
34
|
+
const containers = scrollContainerRefs
|
|
35
|
+
.map(ref => ref.current)
|
|
36
|
+
.filter((el): el is HTMLDivElement => el !== null);
|
|
37
|
+
|
|
38
|
+
if (containers.length === 0) return undefined;
|
|
39
|
+
|
|
40
|
+
const animationStates = containers.map(() => ({
|
|
41
|
+
lastTimestamp: null as number | null,
|
|
42
|
+
accumulatedScroll: 0,
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
const step = (timestamp: number) => {
|
|
46
|
+
if (!isPausedRef.current) {
|
|
47
|
+
containers.forEach((containerElement, index) => {
|
|
48
|
+
const container = containerElement;
|
|
49
|
+
if (container.scrollWidth <= container.clientWidth) return;
|
|
50
|
+
|
|
51
|
+
const stateElement = animationStates[index];
|
|
52
|
+
const state = stateElement;
|
|
53
|
+
if (state.lastTimestamp === null) state.lastTimestamp = timestamp;
|
|
54
|
+
|
|
55
|
+
const delta = timestamp - state.lastTimestamp;
|
|
56
|
+
state.lastTimestamp = timestamp;
|
|
57
|
+
|
|
58
|
+
state.accumulatedScroll += PIXELS_PER_SECOND * (delta / 1000);
|
|
59
|
+
|
|
60
|
+
const pixelsToScroll = Math.floor(state.accumulatedScroll);
|
|
61
|
+
if (pixelsToScroll > 0) {
|
|
62
|
+
container.scrollLeft += pixelsToScroll;
|
|
63
|
+
state.accumulatedScroll -= pixelsToScroll;
|
|
64
|
+
|
|
65
|
+
if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
|
|
66
|
+
container.scrollLeft = 0;
|
|
67
|
+
state.accumulatedScroll = 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const rafId = requestAnimationFrame(step);
|
|
74
|
+
scrollAnimationRefs.current[0] = rafId;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
scrollAnimationRefs.current[0] = requestAnimationFrame(step);
|
|
78
|
+
|
|
79
|
+
const pauseAnimation = () => {
|
|
80
|
+
isPausedRef.current = true;
|
|
81
|
+
if (resumeTimeoutRef.current) {
|
|
82
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
83
|
+
resumeTimeoutRef.current = null;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const scheduleResumeAnimation = () => {
|
|
88
|
+
resumeTimeoutRef.current = window.setTimeout(() => {
|
|
89
|
+
isPausedRef.current = false;
|
|
90
|
+
animationStates.forEach(stateElement => {
|
|
91
|
+
const state = stateElement;
|
|
92
|
+
state.lastTimestamp = null;
|
|
93
|
+
});
|
|
94
|
+
}, RESUME_DELAY_MS);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
containers.forEach(container => {
|
|
98
|
+
container.addEventListener('mouseenter', pauseAnimation);
|
|
99
|
+
container.addEventListener('mouseleave', scheduleResumeAnimation);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
return () => {
|
|
103
|
+
scrollAnimationRefs.current.forEach(rafId => {
|
|
104
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
105
|
+
});
|
|
106
|
+
containers.forEach(container => {
|
|
107
|
+
container.removeEventListener('mouseenter', pauseAnimation);
|
|
108
|
+
container.removeEventListener('mouseleave', scheduleResumeAnimation);
|
|
109
|
+
});
|
|
110
|
+
if (resumeTimeoutRef.current) {
|
|
111
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}, [isAnimated, PIXELS_PER_SECOND, scrollContainerRefs]);
|
|
115
|
+
}
|
|
@@ -1,103 +1,96 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { AnimationSpeed } from '../types/types';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
) {
|
|
9
|
-
const animationRefs = useRef<(number | null)[]>([]);
|
|
10
|
-
const lastTimestampRefs = useRef<(number | null)[]>([]);
|
|
11
|
-
const accumulatedScrollRefs = useRef<number[]>([]);
|
|
12
|
-
const isStoppedRef = useRef(false);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (animationSpeed === AnimationSpeed.NONE) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const containers = scrollContainerRefs
|
|
20
|
-
.map(ref => ref.current)
|
|
21
|
-
.filter((container): container is HTMLDivElement => container !== null);
|
|
22
|
-
|
|
23
|
-
if (containers.length === 0) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
animationRefs.current = containers.map(() => null);
|
|
28
|
-
lastTimestampRefs.current = containers.map(() => null);
|
|
29
|
-
accumulatedScrollRefs.current = containers.map(() => 0);
|
|
4
|
+
interface UseHorizontalScrollAnimationOptions {
|
|
5
|
+
scrollContainerRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
animationSpeed?: `${AnimationSpeed}`;
|
|
7
|
+
}
|
|
30
8
|
|
|
31
|
-
|
|
9
|
+
export function useHorizontalScrollAnimation({
|
|
10
|
+
scrollContainerRef,
|
|
11
|
+
animationSpeed = AnimationSpeed.NONE,
|
|
12
|
+
}: UseHorizontalScrollAnimationOptions): void {
|
|
13
|
+
const resumeTimeoutRef = useRef<number | null>(null);
|
|
14
|
+
const scrollAnimationRef = useRef<number | null>(null);
|
|
15
|
+
|
|
16
|
+
let PIXELS_PER_SECOND = 0;
|
|
17
|
+
switch (animationSpeed) {
|
|
18
|
+
case AnimationSpeed.FAST:
|
|
19
|
+
PIXELS_PER_SECOND = 60;
|
|
20
|
+
break;
|
|
21
|
+
case AnimationSpeed.SLOW:
|
|
22
|
+
PIXELS_PER_SECOND = 30;
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
PIXELS_PER_SECOND = 0;
|
|
26
|
+
}
|
|
27
|
+
const RESUME_DELAY_MS = 1500;
|
|
28
|
+
const isAnimated = animationSpeed !== AnimationSpeed.NONE;
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (rafId !== null) {
|
|
36
|
-
cancelAnimationFrame(rafId);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!isAnimated || !scrollContainerRef) return undefined;
|
|
40
32
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
const container = scrollContainerRef.current;
|
|
34
|
+
if (!container) return undefined;
|
|
35
|
+
if (container.scrollWidth <= container.clientWidth) return undefined;
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
37
|
+
let isPaused = false;
|
|
38
|
+
let lastTimestamp: number | null = null;
|
|
39
|
+
let accumulatedScroll = 0;
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
const step = (timestamp: number) => {
|
|
42
|
+
if (lastTimestamp === null) lastTimestamp = timestamp;
|
|
43
|
+
if (!isPaused) {
|
|
44
|
+
const delta = timestamp - lastTimestamp;
|
|
45
|
+
lastTimestamp = timestamp;
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
lastTimestampRefs.current[index] = timestamp;
|
|
57
|
-
accumulatedScrollRefs.current[index] += PIXELS_PER_SECOND * (delta / 1000);
|
|
47
|
+
accumulatedScroll += PIXELS_PER_SECOND * (delta / 1000);
|
|
58
48
|
|
|
59
|
-
const pixelsToScroll = Math.floor(
|
|
49
|
+
const pixelsToScroll = Math.floor(accumulatedScroll);
|
|
60
50
|
if (pixelsToScroll > 0) {
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
container.scrollLeft += pixelsToScroll;
|
|
52
|
+
accumulatedScroll -= pixelsToScroll;
|
|
63
53
|
|
|
64
|
-
if (Math.ceil(
|
|
54
|
+
if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
|
|
65
55
|
container.scrollLeft = 0;
|
|
66
|
-
|
|
67
|
-
} else {
|
|
68
|
-
container.scrollLeft = newScrollLeft;
|
|
69
|
-
accumulatedScrollRefs.current[index] -= pixelsToScroll;
|
|
56
|
+
accumulatedScroll = 0;
|
|
70
57
|
}
|
|
71
58
|
}
|
|
59
|
+
}
|
|
60
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
61
|
+
};
|
|
72
62
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
};
|
|
63
|
+
// Start animation
|
|
64
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
77
65
|
|
|
78
|
-
|
|
66
|
+
const pauseAnimation = () => {
|
|
67
|
+
isPaused = true;
|
|
68
|
+
if (resumeTimeoutRef.current) {
|
|
69
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
70
|
+
resumeTimeoutRef.current = null;
|
|
71
|
+
}
|
|
79
72
|
};
|
|
80
73
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
isStoppedRef.current = true;
|
|
87
|
-
onStopAll(event.clientX, event.clientY);
|
|
88
|
-
cancelAllAnimations();
|
|
74
|
+
const scheduleResumeAnimation = () => {
|
|
75
|
+
resumeTimeoutRef.current = window.setTimeout(() => {
|
|
76
|
+
isPaused = false;
|
|
77
|
+
lastTimestamp = null;
|
|
78
|
+
}, RESUME_DELAY_MS);
|
|
89
79
|
};
|
|
90
80
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
// Attach pause/resume listeners for hover behavior
|
|
82
|
+
container.addEventListener('mouseenter', pauseAnimation);
|
|
83
|
+
container.addEventListener('mouseleave', scheduleResumeAnimation);
|
|
94
84
|
|
|
95
85
|
return () => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
86
|
+
if (scrollAnimationRef.current) {
|
|
87
|
+
cancelAnimationFrame(scrollAnimationRef.current);
|
|
88
|
+
}
|
|
89
|
+
container.removeEventListener('mouseenter', pauseAnimation);
|
|
90
|
+
container.removeEventListener('mouseleave', scheduleResumeAnimation);
|
|
91
|
+
if (resumeTimeoutRef.current) {
|
|
92
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
93
|
+
}
|
|
101
94
|
};
|
|
102
|
-
}, [
|
|
95
|
+
}, [isAnimated, PIXELS_PER_SECOND, scrollContainerRef]);
|
|
103
96
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UseScrollSyncOptions {
|
|
4
|
+
scrollContainerRefs: React.RefObject<HTMLDivElement>[];
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function useScrollSync({ scrollContainerRefs, enabled }: UseScrollSyncOptions): void {
|
|
9
|
+
const isSyncingRef = useRef(false);
|
|
10
|
+
const isDraggingRef = useRef(false);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!enabled || scrollContainerRefs.length === 0) return undefined;
|
|
14
|
+
|
|
15
|
+
const containers = scrollContainerRefs
|
|
16
|
+
.map(ref => ref.current)
|
|
17
|
+
.filter((el): el is HTMLDivElement => el !== null);
|
|
18
|
+
|
|
19
|
+
if (containers.length === 0) return undefined;
|
|
20
|
+
|
|
21
|
+
const handleScroll = (sourceContainer: HTMLDivElement) => {
|
|
22
|
+
// Only sync when user is actively dragging, not during auto-scroll animation
|
|
23
|
+
if (!isDraggingRef.current) return;
|
|
24
|
+
if (isSyncingRef.current) return;
|
|
25
|
+
|
|
26
|
+
isSyncingRef.current = true;
|
|
27
|
+
const { scrollLeft } = sourceContainer;
|
|
28
|
+
|
|
29
|
+
containers.forEach(container => {
|
|
30
|
+
if (container !== sourceContainer) {
|
|
31
|
+
const element = container;
|
|
32
|
+
element.scrollLeft = scrollLeft;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
requestAnimationFrame(() => {
|
|
37
|
+
isSyncingRef.current = false;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const handleMouseDown = () => {
|
|
42
|
+
isDraggingRef.current = true;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleMouseUp = () => {
|
|
46
|
+
isDraggingRef.current = false;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Prevent all trackpad and mouse wheel scrolling
|
|
50
|
+
const handleWheel = (e: WheelEvent) => {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const scrollListeners = containers.map(container => {
|
|
55
|
+
const listener = () => handleScroll(container);
|
|
56
|
+
container.addEventListener('scroll', listener);
|
|
57
|
+
return { container, listener };
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Track mouse events to detect when user is dragging
|
|
61
|
+
containers.forEach(container => {
|
|
62
|
+
container.addEventListener('mousedown', handleMouseDown);
|
|
63
|
+
container.addEventListener('mouseup', handleMouseUp);
|
|
64
|
+
// Disable trackpad and mouse wheel scrolling
|
|
65
|
+
container.addEventListener('wheel', handleWheel, { passive: false });
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Also listen for mouseup on document in case user releases outside container
|
|
69
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
scrollListeners.forEach(({ container, listener }) => {
|
|
73
|
+
container.removeEventListener('scroll', listener);
|
|
74
|
+
});
|
|
75
|
+
containers.forEach(container => {
|
|
76
|
+
container.removeEventListener('mousedown', handleMouseDown);
|
|
77
|
+
container.removeEventListener('mouseup', handleMouseUp);
|
|
78
|
+
container.removeEventListener('wheel', handleWheel);
|
|
79
|
+
});
|
|
80
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
81
|
+
};
|
|
82
|
+
}, [enabled, scrollContainerRefs]);
|
|
83
|
+
}
|
|
@@ -30,7 +30,9 @@ export const getSendIconElement = (
|
|
|
30
30
|
<CustomIcon
|
|
31
31
|
IconComponent={<SendModern />}
|
|
32
32
|
fill={iconColor}
|
|
33
|
-
stroke={
|
|
33
|
+
stroke={
|
|
34
|
+
hasValue ? 'var(--envive-colors-background-light)' : 'var(--envive-colors-border-dark)'
|
|
35
|
+
}
|
|
34
36
|
/>
|
|
35
37
|
);
|
|
36
38
|
case Theme.MINIMAL:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Theme } from '../../../tokens/theme/theme';
|
|
2
|
+
import { TypographyColor } from '../Typography/types';
|
|
2
3
|
import { resolveTheme } from '../utils/resolveTheme';
|
|
3
4
|
import { WidgetTextFieldComponents } from './components';
|
|
4
5
|
import { IconVariant, type WidgetTextFieldProps } from './types/types';
|
|
@@ -10,6 +11,7 @@ export const WidgetTextField = ({
|
|
|
10
11
|
className,
|
|
11
12
|
theme = Theme.GLOBAL_CUSTOM,
|
|
12
13
|
iconVariant = IconVariant.DEFAULT,
|
|
14
|
+
textColor = TypographyColor.TEXT_SECONDARY,
|
|
13
15
|
placeholder,
|
|
14
16
|
ariaLabel,
|
|
15
17
|
disabled,
|
|
@@ -34,11 +36,17 @@ export const WidgetTextField = ({
|
|
|
34
36
|
ariaLabel={ariaLabel}
|
|
35
37
|
icon={
|
|
36
38
|
<WidgetTextFieldComponents.Icon
|
|
39
|
+
textColor={textColor}
|
|
37
40
|
variant={iconVariant}
|
|
38
41
|
theme={resolvedTheme}
|
|
39
42
|
/>
|
|
40
43
|
}
|
|
41
|
-
text={
|
|
44
|
+
text={
|
|
45
|
+
<WidgetTextFieldComponents.FakeTextInput
|
|
46
|
+
placeholder={placeholder}
|
|
47
|
+
textColor={textColor}
|
|
48
|
+
/>
|
|
49
|
+
}
|
|
42
50
|
/>
|
|
43
51
|
);
|
|
44
52
|
};
|
|
@@ -3,13 +3,17 @@ import { TypographyColor, TypographyVariant } from '../../Typography/types';
|
|
|
3
3
|
|
|
4
4
|
type FakeTextInputProps = {
|
|
5
5
|
placeholder: string;
|
|
6
|
+
textColor: TypographyColor;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
|
-
export const FakeTextInput = ({
|
|
9
|
+
export const FakeTextInput = ({
|
|
10
|
+
placeholder,
|
|
11
|
+
textColor = TypographyColor.TEXT_SECONDARY,
|
|
12
|
+
}: FakeTextInputProps) => {
|
|
9
13
|
return (
|
|
10
14
|
<Typography
|
|
11
15
|
variant={TypographyVariant.B3_RG}
|
|
12
|
-
color={
|
|
16
|
+
color={textColor}
|
|
13
17
|
noWrap
|
|
14
18
|
>
|
|
15
19
|
{placeholder}
|