@envive-ai/react-toolkit-v3 0.3.9 → 0.3.11
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.d.cts +3 -3
- package/dist/AnimatedText/AnimatedText.d.ts +3 -3
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/CSSVariablesEditor/components/CSSVariablesEditor.cjs +1 -1
- package/dist/CSSVariablesEditor/components/CSSVariablesEditor.js +1 -1
- 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 +3 -3
- package/dist/Carousel/components/Container.js +3 -3
- package/dist/ChatFooter/ChatFooter.cjs +1 -1
- package/dist/ChatFooter/ChatFooter.d.cts +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 +2 -2
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreview/ChatPreview.js +2 -2
- package/dist/ChatPreview/components/Message.cjs +1 -1
- package/dist/ChatPreview/components/Message.js +1 -1
- package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.js +2 -2
- 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 +3 -3
- package/dist/ChatPreviewComparison/components/Message.js +3 -3
- package/dist/ChatPreviewLoading/ChatPreviewLoading.cjs +1 -1
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.js +1 -1
- package/dist/Container/Container.d.cts +178 -178
- package/dist/Container/Container.d.ts +7 -7
- package/dist/DesignTokens/DesignTokensComponent.cjs +1 -1
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.js +1 -1
- 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/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingChat/FloatingChat.cjs +6 -4
- package/dist/FloatingChat/FloatingChat.d.cts +3 -2
- package/dist/FloatingChat/FloatingChat.d.ts +3 -2
- package/dist/FloatingChat/FloatingChat.js +6 -4
- package/dist/FloatingChat/components/ChatMessages.cjs +2 -2
- package/dist/FloatingChat/components/ChatMessages.js +2 -2
- package/dist/FloatingChat/components/Layout.cjs +9 -5
- package/dist/FloatingChat/components/Layout.js +9 -5
- package/dist/FloatingChat/components/ModalSheet.cjs +6 -7
- package/dist/FloatingChat/components/ModalSheet.js +6 -7
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +1 -3
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +1 -3
- package/dist/FloatingChat/components/ScrollToBottomButton.cjs +1 -1
- package/dist/FloatingChat/components/ScrollToBottomButton.js +1 -1
- package/dist/FloatingChat/types/types.d.cts +4 -0
- package/dist/FloatingChat/types/types.d.ts +4 -0
- package/dist/Form/Form.cjs +1 -1
- package/dist/Form/Form.js +1 -1
- package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +131 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +24 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +24 -0
- package/dist/FullPageSalesAgent/FullPageSalesAgent.js +130 -0
- package/dist/FullPageSalesAgent/components/Layout.cjs +53 -0
- package/dist/FullPageSalesAgent/components/Layout.js +51 -0
- package/dist/FullPageSalesAgent/components/index.cjs +7 -0
- package/dist/FullPageSalesAgent/components/index.js +7 -0
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.cjs +23 -0
- package/dist/FullPageSalesAgent/hooks/useContainerResizerObserver.js +22 -0
- package/dist/FullPageSalesAgent/hooks/useGetContainerStyles.cjs +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetContainerStyles.js +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.cjs +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetFooterStyles.js +16 -0
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.cjs +19 -0
- package/dist/FullPageSalesAgent/hooks/useGetScrollContentStyles.js +17 -0
- package/dist/FullPageSalesAgent/hooks/useIsMobile.cjs +7 -0
- package/dist/FullPageSalesAgent/hooks/useIsMobile.js +7 -0
- package/dist/FullPageSalesAgent/index.cjs +3 -0
- package/dist/FullPageSalesAgent/index.d.cts +2 -0
- package/dist/FullPageSalesAgent/index.d.ts +2 -0
- package/dist/FullPageSalesAgent/index.js +3 -0
- 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/ImageGallery/components/NormalLayout.cjs +1 -1
- package/dist/ImageGallery/components/NormalLayout.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.cjs +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.js +1 -1
- package/dist/Message/components/AgentContent.cjs +1 -1
- package/dist/Message/components/AgentContent.js +1 -1
- package/dist/Message/components/LinkButton.cjs +1 -1
- package/dist/Message/components/LinkButton.js +1 -1
- package/dist/Message/hooks/useVariantStyleProperties.cjs +1 -1
- package/dist/Message/hooks/useVariantStyleProperties.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +2 -2
- package/dist/ProductCard/ProductCard.d.cts +2 -2
- package/dist/ProductCard/ProductCard.d.ts +2 -2
- package/dist/ProductCard/ProductCard.js +2 -2
- package/dist/ProductCard/components/Header.cjs +1 -1
- package/dist/ProductCard/components/Header.js +1 -1
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
- package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
- package/dist/PromptButtonCarouselWithImage/components/Layout.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Layout.js +1 -1
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +5 -4
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +5 -4
- package/dist/ReviewCard/ReviewCard.cjs +1 -1
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/ReviewCard.js +1 -1
- 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 +6 -6
- package/dist/ReviewCard/components/index.d.ts +6 -6
- package/dist/SalesAgentProductCard/SalesAgentProductCard.cjs +2 -1
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +3 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +3 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.js +2 -1
- package/dist/SalesAgentProductCard/components/Container.cjs +9 -7
- package/dist/SalesAgentProductCard/components/Container.d.cts +2 -1
- package/dist/SalesAgentProductCard/components/Container.d.ts +2 -1
- package/dist/SalesAgentProductCard/components/Container.js +9 -7
- package/dist/SalesAgentProductCard/components/index.d.cts +9 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +9 -8
- package/dist/SalesAgentProductCard/types/types.d.cts +4 -0
- package/dist/SalesAgentProductCard/types/types.d.ts +4 -0
- 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 +4 -4
- package/dist/SocialProof/components/Headline.js +4 -4
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SocialProof/components/LayoutSingle.cjs +1 -1
- package/dist/SocialProof/components/LayoutSingle.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/Stack/Stack.d.ts +2 -2
- package/dist/Stack/hooks/useFormatStackChildren.cjs +1 -1
- package/dist/Stack/hooks/useFormatStackChildren.js +1 -1
- 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/Title/components/Image.cjs +1 -1
- package/dist/Title/components/Image.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 +3 -3
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/TypingAnimation/TypingAnimation.js +3 -3
- 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 +1 -1
- package/dist/WidgetTextField/WidgetTextField.d.cts +2 -2
- package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
- package/dist/WidgetTextField/WidgetTextField.js +1 -1
- package/dist/WidgetTextField/components/Container.cjs +2 -2
- package/dist/WidgetTextField/components/Container.js +2 -2
- package/dist/WidgetTextField/components/Icon.cjs +3 -2
- package/dist/WidgetTextField/components/Icon.js +3 -2
- package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
- package/dist/WidgetTextField/components/Skeleton.js +1 -1
- 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 +2 -2
- package/dist/utils/CustomIcon.js +2 -2
- package/package.json +5 -1
- package/src/components/ChatHeader/hooks/useGetCloseButtonProperties.ts +1 -1
- package/src/components/FloatingChat/FloatingChat.tsx +7 -1
- package/src/components/FloatingChat/components/Layout.tsx +3 -0
- package/src/components/FloatingChat/components/ModalSheet.tsx +5 -7
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +4 -6
- package/src/components/FloatingChat/types/types.ts +4 -0
- package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +199 -0
- package/src/components/FullPageSalesAgent/components/Layout.tsx +81 -0
- package/src/components/FullPageSalesAgent/components/index.ts +5 -0
- package/src/components/FullPageSalesAgent/hooks/useContainerResizerObserver.ts +33 -0
- package/src/components/FullPageSalesAgent/hooks/useGetContainerStyles.ts +24 -0
- package/src/components/FullPageSalesAgent/hooks/useGetFooterStyles.ts +17 -0
- package/src/components/FullPageSalesAgent/hooks/useGetScrollContentStyles.ts +17 -0
- package/src/components/FullPageSalesAgent/hooks/useIsMobile.ts +3 -0
- package/src/components/FullPageSalesAgent/index.ts +1 -0
- package/src/components/Message/hooks/useVariantStyleProperties.ts +1 -1
- package/src/components/PromptCarousel/PromptCarousel.tsx +1 -0
- package/src/components/SalesAgentProductCard/SalesAgentProductCard.tsx +2 -0
- package/src/components/SalesAgentProductCard/components/Container.tsx +16 -9
- package/src/components/SalesAgentProductCard/types/types.ts +4 -0
- package/src/components/TextField/utils/getIconColor.ts +1 -1
- package/src/components/TextField/utils/getSendIconElement.tsx +3 -1
- package/src/components/WidgetTextField/components/Icon.tsx +1 -0
- package/src/components/utils/CustomIcon.tsx +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { isValidElement } from 'react';
|
|
3
|
+
import { Stack } from 'src/components/Stack';
|
|
4
|
+
import { Theme } from 'tokens/theme/theme';
|
|
5
|
+
import { useGetContainerStyles } from '../hooks/useGetContainerStyles';
|
|
6
|
+
import { useGetFooterStyles } from '../hooks/useGetFooterStyles';
|
|
7
|
+
import { useGetScrollContentStyles } from '../hooks/useGetScrollContentStyles';
|
|
8
|
+
|
|
9
|
+
export interface LayoutProps {
|
|
10
|
+
theme: Theme;
|
|
11
|
+
welcomeMessage: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
chatMessages?: React.ReactNode;
|
|
14
|
+
answerSuggestions?: React.ReactNode;
|
|
15
|
+
scrollToBottomButton?: React.ReactNode;
|
|
16
|
+
disclaimer?: React.ReactNode;
|
|
17
|
+
headerContainer?: string;
|
|
18
|
+
autoHeight?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Layout = ({
|
|
22
|
+
theme,
|
|
23
|
+
welcomeMessage,
|
|
24
|
+
footer,
|
|
25
|
+
chatMessages,
|
|
26
|
+
answerSuggestions,
|
|
27
|
+
scrollToBottomButton,
|
|
28
|
+
disclaimer,
|
|
29
|
+
headerContainer,
|
|
30
|
+
autoHeight,
|
|
31
|
+
}: LayoutProps) => {
|
|
32
|
+
const hasWelcomeMessage = isValidElement(welcomeMessage);
|
|
33
|
+
const hasAnswerSuggestions = isValidElement(answerSuggestions);
|
|
34
|
+
const { contentClasses, messageContainerClasses } = useGetScrollContentStyles();
|
|
35
|
+
const { footerContainerClasses } = useGetFooterStyles();
|
|
36
|
+
const { containerClasses, containerStyles } = useGetContainerStyles({
|
|
37
|
+
headerContainer,
|
|
38
|
+
autoHeight,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
className={containerClasses}
|
|
44
|
+
style={containerStyles}
|
|
45
|
+
>
|
|
46
|
+
<div className={contentClasses}>
|
|
47
|
+
<Stack
|
|
48
|
+
className={messageContainerClasses}
|
|
49
|
+
direction="column"
|
|
50
|
+
justify="between"
|
|
51
|
+
>
|
|
52
|
+
{welcomeMessage}
|
|
53
|
+
{disclaimer}
|
|
54
|
+
</Stack>
|
|
55
|
+
<Stack
|
|
56
|
+
direction="column"
|
|
57
|
+
gap="0"
|
|
58
|
+
className={classNames(
|
|
59
|
+
(!hasWelcomeMessage || (hasWelcomeMessage && theme === Theme.STANDARD)) &&
|
|
60
|
+
!hasAnswerSuggestions &&
|
|
61
|
+
'envive-tw-pb-4',
|
|
62
|
+
'envive-tw-pt-4',
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
{chatMessages}
|
|
66
|
+
{answerSuggestions}
|
|
67
|
+
</Stack>
|
|
68
|
+
</div>
|
|
69
|
+
<div className={footerContainerClasses}>
|
|
70
|
+
{scrollToBottomButton && (
|
|
71
|
+
<div className="envive-tw-h-[0px]">
|
|
72
|
+
<div className="envive-tw-ml-auto envive-tw-table envive-tw-translate-x-[-30px] envive-tw-translate-y-[-50px]">
|
|
73
|
+
{scrollToBottomButton}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
{footer}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export const useContainerResizerObserver = ({
|
|
4
|
+
headerContainer,
|
|
5
|
+
autoHeight,
|
|
6
|
+
}: {
|
|
7
|
+
headerContainer?: string;
|
|
8
|
+
autoHeight?: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
const [containerHeight, setContainerHeight] = useState<number | string>('100%');
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!autoHeight) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const watchResizing = () => {
|
|
18
|
+
const header = document.querySelector(headerContainer)?.getBoundingClientRect()?.height || 0;
|
|
19
|
+
setContainerHeight(window.innerHeight - header);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
window.addEventListener('resize', watchResizing);
|
|
23
|
+
watchResizing();
|
|
24
|
+
|
|
25
|
+
return () => {
|
|
26
|
+
window.removeEventListener('resize', watchResizing);
|
|
27
|
+
};
|
|
28
|
+
}, [headerContainer, autoHeight]);
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
containerHeight,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useContainerResizerObserver } from './useContainerResizerObserver';
|
|
2
|
+
|
|
3
|
+
export const useGetContainerStyles = ({
|
|
4
|
+
headerContainer,
|
|
5
|
+
autoHeight,
|
|
6
|
+
}: {
|
|
7
|
+
headerContainer?: string;
|
|
8
|
+
autoHeight?: boolean;
|
|
9
|
+
}) => {
|
|
10
|
+
const { containerHeight } = useContainerResizerObserver({
|
|
11
|
+
headerContainer,
|
|
12
|
+
autoHeight,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const containerClasses =
|
|
16
|
+
'envive-tw-mx-auto envive-tw-flex envive-tw-h-full envive-tw-max-w-[768px] envive-tw-flex-col';
|
|
17
|
+
|
|
18
|
+
const containerStyles = { height: containerHeight };
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
containerClasses,
|
|
22
|
+
containerStyles,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useIsMobile } from './useIsMobile';
|
|
2
|
+
|
|
3
|
+
export const useGetFooterStyles = () => {
|
|
4
|
+
const { isMobile } = useIsMobile();
|
|
5
|
+
const footerStyles = !isMobile
|
|
6
|
+
? { boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.2)', borderWidth: '1px' }
|
|
7
|
+
: null;
|
|
8
|
+
|
|
9
|
+
const footerContainerClasses = isMobile
|
|
10
|
+
? 'envive-tw-absolute envive-tw-bottom-[0] envive-tw-left-[0] envive-tw-right-[0]'
|
|
11
|
+
: 'envive-tw-pb-5';
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
footerStyles,
|
|
15
|
+
footerContainerClasses,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { useIsMobile } from './useIsMobile';
|
|
3
|
+
|
|
4
|
+
export const useGetScrollContentStyles = () => {
|
|
5
|
+
const { isMobile } = useIsMobile();
|
|
6
|
+
const contentClasses = classNames({
|
|
7
|
+
'envive-tw-flex-1 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden envive-tw-transition-all envive-tw-duration-300 envive-tw-ease-in-out': true,
|
|
8
|
+
'envive-tw-pb-[131px]': isMobile,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const messageContainerClasses = !isMobile ? 'envive-tw-pt-4' : null;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
contentClasses,
|
|
15
|
+
messageContainerClasses,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FullPageSalesAgent } from './FullPageSalesAgent';
|
|
@@ -20,7 +20,7 @@ export const useVariantStyleProperties = (
|
|
|
20
20
|
const variantStylesMap: Record<MessageVariant, VariantStylesProperties> = {
|
|
21
21
|
[MessageVariant.AGENT]: {
|
|
22
22
|
containerLayoutClasses: 'envive-tw-flex envive-tw-flex-col envive-tw-gap-2',
|
|
23
|
-
containerBackgroundClasses: '
|
|
23
|
+
containerBackgroundClasses: '',
|
|
24
24
|
containerBorderClasses: '',
|
|
25
25
|
containerRadiusClasses: 'envive-tw-rounded-md',
|
|
26
26
|
contentClasses: '',
|
|
@@ -29,6 +29,7 @@ export const SalesAgentProductCard = ({
|
|
|
29
29
|
rate,
|
|
30
30
|
image,
|
|
31
31
|
url,
|
|
32
|
+
target,
|
|
32
33
|
onClick,
|
|
33
34
|
}: SalesAgentProductCardProps) => {
|
|
34
35
|
const finalTheme = resolveTheme(theme);
|
|
@@ -42,6 +43,7 @@ export const SalesAgentProductCard = ({
|
|
|
42
43
|
theme={finalTheme}
|
|
43
44
|
variant={variant}
|
|
44
45
|
url={url}
|
|
46
|
+
target={target}
|
|
45
47
|
onClick={onClick}
|
|
46
48
|
productName={
|
|
47
49
|
<SalesAgentProductCardComponents.ProductName
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
+
import { Theme } from '../../../../tokens/theme/theme';
|
|
3
|
+
import { Container as ContainerComponent } from '../../Container';
|
|
2
4
|
import { Stack } from '../../Stack';
|
|
3
|
-
import { SalesAgentProductCardVariant } from '../types/types';
|
|
4
5
|
import { useGetContainerProperties } from '../hooks/useGetContainerProperties';
|
|
5
6
|
import { useGetProductDescriptionProperties } from '../hooks/useGetProductDescriptionProperties';
|
|
6
|
-
import {
|
|
7
|
-
import { Theme } from '../../../../tokens/theme/theme';
|
|
7
|
+
import { SalesAgentProductCardProps, SalesAgentProductCardVariant } from '../types/types';
|
|
8
8
|
|
|
9
9
|
export type ContainerProps = {
|
|
10
10
|
id?: string;
|
|
@@ -18,6 +18,7 @@ export type ContainerProps = {
|
|
|
18
18
|
rate: React.ReactNode;
|
|
19
19
|
image: React.ReactNode;
|
|
20
20
|
url: string;
|
|
21
|
+
target?: SalesAgentProductCardProps['target'];
|
|
21
22
|
onClick?: () => void | Promise<void>;
|
|
22
23
|
};
|
|
23
24
|
|
|
@@ -33,6 +34,7 @@ export const Container = ({
|
|
|
33
34
|
rate,
|
|
34
35
|
image,
|
|
35
36
|
url,
|
|
37
|
+
target = '_self',
|
|
36
38
|
onClick,
|
|
37
39
|
}: ContainerProps) => {
|
|
38
40
|
const { baseClassName, themeContainerClassNames, containerDirection, containerWidthClassName } =
|
|
@@ -48,12 +50,17 @@ export const Container = ({
|
|
|
48
50
|
variant,
|
|
49
51
|
});
|
|
50
52
|
|
|
51
|
-
const anchorProps: React.AnchorHTMLAttributes<HTMLAnchorElement> =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const anchorProps: React.AnchorHTMLAttributes<HTMLAnchorElement> =
|
|
54
|
+
target !== 'none'
|
|
55
|
+
? {
|
|
56
|
+
href: url,
|
|
57
|
+
onClick,
|
|
58
|
+
target,
|
|
59
|
+
draggable: false,
|
|
60
|
+
}
|
|
61
|
+
: {
|
|
62
|
+
onClick,
|
|
63
|
+
};
|
|
57
64
|
|
|
58
65
|
return (
|
|
59
66
|
<ContainerComponent
|
|
@@ -71,6 +71,10 @@ export type SalesAgentProductCardProps = {
|
|
|
71
71
|
* The URL to navigate to when the card is clicked.
|
|
72
72
|
*/
|
|
73
73
|
url?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The URL target to be applied.
|
|
76
|
+
*/
|
|
77
|
+
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'] | 'none';
|
|
74
78
|
/**
|
|
75
79
|
* Callback function called when the card is clicked.
|
|
76
80
|
*/
|
|
@@ -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:
|
|
@@ -19,7 +19,7 @@ export const CustomIcon = ({
|
|
|
19
19
|
|
|
20
20
|
const cssRules: string[] = [];
|
|
21
21
|
if (fill) {
|
|
22
|
-
cssRules.push(`#${iconId} path { fill: ${fill} !important; }`);
|
|
22
|
+
cssRules.push(`#${iconId} path, #${iconId} rect { fill: ${fill} !important; }`);
|
|
23
23
|
}
|
|
24
24
|
if (stroke) {
|
|
25
25
|
cssRules.push(`#${iconId} path { stroke: ${stroke} !important; }`);
|