@envive-ai/react-toolkit-v3 0.3.28 → 0.3.30

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 (191) hide show
  1. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
  2. package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
  3. package/dist/Carousel/Carousel.cjs +1 -1
  4. package/dist/Carousel/Carousel.d.ts +2 -2
  5. package/dist/Carousel/Carousel.js +1 -1
  6. package/dist/Carousel/components/Container.cjs +2 -2
  7. package/dist/Carousel/components/Container.js +2 -2
  8. package/dist/ChatFooter/ChatFooter.cjs +1 -1
  9. package/dist/ChatFooter/ChatFooter.d.ts +2 -2
  10. package/dist/ChatFooter/ChatFooter.js +1 -1
  11. package/dist/ChatFooter/components/Layout.cjs +2 -2
  12. package/dist/ChatFooter/components/Layout.js +2 -2
  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/ChatHeader/components/Handle.cjs +2 -2
  17. package/dist/ChatHeader/components/Handle.js +2 -2
  18. package/dist/ChatHeader/components/Toggle.cjs +3 -3
  19. package/dist/ChatHeader/components/Toggle.js +3 -3
  20. package/dist/ChatPreview/ChatPreview.cjs +1 -1
  21. package/dist/ChatPreview/ChatPreview.d.ts +2 -2
  22. package/dist/ChatPreview/ChatPreview.js +1 -1
  23. package/dist/ChatPreviewComparison/ChatPreviewComparison.cjs +1 -1
  24. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
  25. package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
  26. package/dist/ChatPreviewComparison/ChatPreviewComparison.js +1 -1
  27. package/dist/ChatPreviewComparison/components/Headline.cjs +2 -2
  28. package/dist/ChatPreviewComparison/components/Headline.js +2 -2
  29. package/dist/ChatPreviewComparison/components/Layout.cjs +4 -4
  30. package/dist/ChatPreviewComparison/components/Layout.js +4 -4
  31. package/dist/ChatPreviewComparison/components/Message.cjs +2 -2
  32. package/dist/ChatPreviewComparison/components/Message.js +2 -2
  33. package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
  34. package/dist/Container/Container.d.cts +56 -56
  35. package/dist/Container/Container.d.ts +220 -220
  36. package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
  37. package/dist/Disclaimer/components/Container.cjs +2 -2
  38. package/dist/Disclaimer/components/Container.js +2 -2
  39. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
  40. package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
  41. package/dist/DocumentRetrievalCard/components/Layout.cjs +2 -2
  42. package/dist/DocumentRetrievalCard/components/Layout.js +2 -2
  43. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
  44. package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
  45. package/dist/FloatingButton/FloatingButton.d.cts +2 -2
  46. package/dist/FloatingButton/FloatingButton.d.ts +2 -2
  47. package/dist/FloatingChat/FloatingChat.d.cts +2 -2
  48. package/dist/FloatingChat/FloatingChat.d.ts +2 -2
  49. package/dist/FloatingChat/components/AgentMessage.cjs +1 -0
  50. package/dist/FloatingChat/components/AgentMessage.js +1 -0
  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 +3 -3
  54. package/dist/FloatingChat/components/Layout.js +3 -3
  55. package/dist/FloatingChat/components/ResultsGridView.cjs +1 -1
  56. package/dist/FloatingChat/components/ResultsGridView.js +1 -1
  57. package/dist/FloatingChat/components/SalesAgentBadgeContent.cjs +1 -1
  58. package/dist/FloatingChat/components/SalesAgentBadgeContent.js +1 -1
  59. package/dist/FullPageSalesAgent/FullPageSalesAgent.cjs +2 -3
  60. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
  61. package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
  62. package/dist/FullPageSalesAgent/FullPageSalesAgent.js +2 -3
  63. package/dist/FullPageSalesAgent/components/Layout.cjs +24 -27
  64. package/dist/FullPageSalesAgent/components/Layout.js +24 -27
  65. package/dist/FullPageSalesAgent/components/WelcomeOverlay.cjs +27 -17
  66. package/dist/FullPageSalesAgent/components/WelcomeOverlay.js +27 -17
  67. package/dist/Image/Image.d.cts +2 -2
  68. package/dist/Image/Image.d.ts +2 -2
  69. package/dist/ImageGallery/ImageGallery.d.cts +2 -2
  70. package/dist/ImageGallery/ImageGallery.d.ts +2 -2
  71. package/dist/ImageGallery/components/Layout.cjs +1 -1
  72. package/dist/ImageGallery/components/Layout.js +1 -1
  73. package/dist/MarkdownProcessor/MarkdownProcessor.cjs +7 -3
  74. package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +4 -3
  75. package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +4 -3
  76. package/dist/MarkdownProcessor/MarkdownProcessor.js +7 -3
  77. package/dist/MarkdownProcessor/components/MarkdownLink.cjs +3 -2
  78. package/dist/MarkdownProcessor/components/MarkdownLink.js +3 -2
  79. package/dist/MarkdownProcessor/types/types.d.cts +5 -0
  80. package/dist/MarkdownProcessor/types/types.d.ts +5 -0
  81. package/dist/MarkdownProcessor/utils/functions.cjs +2 -1
  82. package/dist/MarkdownProcessor/utils/functions.js +2 -1
  83. package/dist/Message/Message.cjs +5 -4
  84. package/dist/Message/Message.d.cts +2 -1
  85. package/dist/Message/Message.d.ts +2 -1
  86. package/dist/Message/Message.js +5 -4
  87. package/dist/Message/components/AgentContent.cjs +3 -2
  88. package/dist/Message/components/AgentContent.js +3 -2
  89. package/dist/Message/components/LinkButton.cjs +3 -3
  90. package/dist/Message/components/LinkButton.d.cts +4 -1
  91. package/dist/Message/components/LinkButton.d.ts +4 -1
  92. package/dist/Message/components/LinkButton.js +3 -3
  93. package/dist/Message/hooks/useGetLinkButtonIconProperties.cjs +4 -3
  94. package/dist/Message/hooks/useGetLinkButtonIconProperties.js +4 -3
  95. package/dist/Message/types/index.d.cts +4 -0
  96. package/dist/Message/types/index.d.ts +4 -0
  97. package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
  98. package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
  99. package/dist/ProductCard/ProductCard.cjs +2 -2
  100. package/dist/ProductCard/ProductCard.d.cts +2 -2
  101. package/dist/ProductCard/ProductCard.d.ts +2 -2
  102. package/dist/ProductCard/ProductCard.js +2 -2
  103. package/dist/PromptButton/PromptButton.d.cts +2 -2
  104. package/dist/PromptButton/PromptButton.d.ts +2 -2
  105. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.cts +2 -2
  106. package/dist/PromptButtonCarouselWithImage/PromptButtonCarouselWithImage.d.ts +2 -2
  107. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.cjs +1 -1
  108. package/dist/PromptButtonCarouselWithImage/components/PromptButtonsCarousel.js +1 -1
  109. package/dist/PromptCarousel/PromptCarousel.cjs +3 -3
  110. package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
  111. package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
  112. package/dist/PromptCarousel/PromptCarousel.js +3 -3
  113. package/dist/ReviewCard/ReviewCard.d.cts +2 -2
  114. package/dist/ReviewCard/ReviewCard.d.ts +2 -2
  115. package/dist/ReviewCard/components/Container.cjs +2 -2
  116. package/dist/ReviewCard/components/Container.js +2 -2
  117. package/dist/ReviewCard/components/ReadMoreButton.cjs +1 -1
  118. package/dist/ReviewCard/components/ReadMoreButton.js +1 -1
  119. package/dist/ReviewCard/components/index.d.cts +4 -4
  120. package/dist/ReviewCard/components/index.d.ts +6 -6
  121. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.cts +2 -2
  122. package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
  123. package/dist/SalesAgentProductCard/components/Container.cjs +2 -2
  124. package/dist/SalesAgentProductCard/components/Container.js +2 -2
  125. package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
  126. package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
  127. package/dist/SocialProof/SocialProof.cjs +1 -1
  128. package/dist/SocialProof/SocialProof.d.cts +2 -2
  129. package/dist/SocialProof/SocialProof.d.ts +2 -2
  130. package/dist/SocialProof/SocialProof.js +1 -1
  131. package/dist/SocialProof/components/Headline.cjs +3 -3
  132. package/dist/SocialProof/components/Headline.js +3 -3
  133. package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
  134. package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
  135. package/dist/SocialProof/components/Subheadline.cjs +1 -1
  136. package/dist/SocialProof/components/Subheadline.js +1 -1
  137. package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
  138. package/dist/SparkleAnimation/SparkleAnimation.d.ts +2 -2
  139. package/dist/Stack/Stack.d.ts +2 -2
  140. package/dist/TitledPromptCarousel/TitledPromptCarousel.cjs +1 -1
  141. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.cts +2 -2
  142. package/dist/TitledPromptCarousel/TitledPromptCarousel.d.ts +2 -2
  143. package/dist/TitledPromptCarousel/TitledPromptCarousel.js +1 -1
  144. package/dist/Tokens/index.cjs +1 -1
  145. package/dist/Tokens/index.js +1 -1
  146. package/dist/TypingAnimation/TypingAnimation.cjs +1 -1
  147. package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
  148. package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
  149. package/dist/TypingAnimation/TypingAnimation.js +1 -1
  150. package/dist/TypingAnimation/hooks/useGetTypographyVariant.cjs +1 -1
  151. package/dist/TypingAnimation/hooks/useGetTypographyVariant.js +1 -1
  152. package/dist/Typography/Typography.d.cts +4 -4
  153. package/dist/Typography/Typography.d.ts +4 -4
  154. package/dist/WelcomeMessage/components/Container.cjs +2 -2
  155. package/dist/WelcomeMessage/components/Container.js +2 -2
  156. package/dist/WidgetTextField/WidgetTextField.cjs +4 -4
  157. package/dist/WidgetTextField/WidgetTextField.d.ts +2 -2
  158. package/dist/WidgetTextField/WidgetTextField.js +1 -1
  159. package/dist/WidgetTextField/components/Container.cjs +2 -2
  160. package/dist/WidgetTextField/components/Container.js +2 -2
  161. package/dist/WidgetTextField/components/Icon.cjs +1 -1
  162. package/dist/WidgetTextField/components/Icon.js +1 -1
  163. package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +3 -2
  164. package/dist/WidgetTextField/hooks/useGetContainerProperties.js +3 -2
  165. package/dist/WidgetWrapper/WidgetWrapper.cjs +8 -1
  166. package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
  167. package/dist/WidgetWrapper/WidgetWrapper.d.ts +2 -2
  168. package/dist/WidgetWrapper/WidgetWrapper.js +8 -1
  169. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.cjs +1 -1
  170. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
  171. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
  172. package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.js +1 -1
  173. package/dist/styles.css +1 -1
  174. package/package.json +1 -1
  175. package/src/components/FloatingChat/components/AgentMessage.tsx +1 -0
  176. package/src/components/FullPageSalesAgent/FullPageSalesAgent.tsx +1 -2
  177. package/src/components/FullPageSalesAgent/components/Layout.tsx +4 -1
  178. package/src/components/FullPageSalesAgent/components/WelcomeOverlay.tsx +30 -17
  179. package/src/components/MarkdownProcessor/MarkdownProcessor.tsx +3 -2
  180. package/src/components/MarkdownProcessor/components/MarkdownLink.tsx +4 -1
  181. package/src/components/MarkdownProcessor/types/types.ts +5 -0
  182. package/src/components/MarkdownProcessor/utils/functions.tsx +4 -0
  183. package/src/components/Message/Message.tsx +4 -2
  184. package/src/components/Message/components/AgentContent.tsx +4 -0
  185. package/src/components/Message/components/LinkButton.tsx +4 -1
  186. package/src/components/Message/hooks/useGetLinkButtonIconProperties.ts +7 -3
  187. package/src/components/Message/types/index.ts +3 -0
  188. package/src/components/WidgetTextField/hooks/useGetContainerProperties.ts +2 -1
  189. package/src/components/WidgetWrapper/WidgetWrapper.tsx +10 -2
  190. package/src/components/WidgetWrapperWithTitle/WidgetWrapperWithTitle.tsx +5 -5
  191. package/src/components/utils/resolveTheme.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envive-ai/react-toolkit-v3",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "React component library for Envive services.",
5
5
  "keywords": [
6
6
  "react",
@@ -124,6 +124,7 @@ export const AgentMessage = ({
124
124
  if (msg.type === MessageType.Text && msg.metadata.content) {
125
125
  return (
126
126
  <MessageComponent
127
+ theme={finalTheme}
127
128
  variant={MessageVariant.AGENT}
128
129
  agentName={hideAgentName ? undefined : agentName}
129
130
  showSparkle={isResponseStreaming || isPendingResponse}
@@ -461,9 +461,8 @@ export const FullPageSalesAgent = ({
461
461
  headerContainer={headerContainer}
462
462
  autoHeight={autoHeight}
463
463
  scrollContainerRef={scrollContainerRef}
464
- backgroundStyle={backgroundStyle}
465
464
  overlay={
466
- overlayEnabled ? (
465
+ overlayEnabled && showOverlay ? (
467
466
  <WelcomeOverlay
468
467
  show={showOverlay}
469
468
  theme={resolvedTheme}
@@ -49,6 +49,10 @@ export const Layout = ({
49
49
  autoHeight,
50
50
  });
51
51
 
52
+ if (overlay) {
53
+ return overlay;
54
+ }
55
+
52
56
  return (
53
57
  <div
54
58
  className={classNames(containerClasses, 'envive-tw-relative')}
@@ -89,7 +93,6 @@ export const Layout = ({
89
93
  )}
90
94
  {footer}
91
95
  </div>
92
- {overlay}
93
96
  </div>
94
97
  );
95
98
  };
@@ -56,23 +56,15 @@ export const WelcomeOverlay = ({
56
56
  const showProductCarousel = !isLoading && products.length > 0 && !!productCarouselTitle;
57
57
 
58
58
  const welcomeOverlayClassNames = classNames([
59
+ 'envive-overlay',
59
60
  'envive-tw-inset-0',
60
61
  'envive-tw-absolute',
61
62
  'envive-tw-z-20',
62
63
  'envive-tw-flex',
63
64
  'envive-tw-w-full',
64
- 'envive-tw-h-full',
65
- 'envive-tw-max-w-[768px]',
66
65
  'envive-tw-flex-col',
67
66
  ]);
68
67
 
69
- const titleClassNames = classNames([
70
- 'envive-tw-flex',
71
- 'envive-tw-flex-row',
72
- 'envive-tw-gap-2',
73
- 'envive-tw-items-center',
74
- ]);
75
-
76
68
  const titleBoxClassNames = classNames([
77
69
  'envive-tw-flex',
78
70
  'envive-tw-py-4',
@@ -85,6 +77,22 @@ export const WelcomeOverlay = ({
85
77
  'envive-tw-border',
86
78
  'envive-tw-rounded-global-custom',
87
79
  ]);
80
+ const overlayContentClassNames = classNames([
81
+ 'envive-tw-inset-0',
82
+ 'envive-tw-mx-auto',
83
+ 'envive-tw-flex',
84
+ 'envive-tw-w-full',
85
+ 'envive-tw-max-w-[768px]',
86
+ 'envive-tw-flex-1',
87
+ 'envive-tw-flex-col',
88
+ 'envive-tw-gap-6',
89
+ 'envive-tw-overflow-y-auto',
90
+ 'envive-tw-overflow-x-hidden',
91
+ 'envive-tw-px-4',
92
+ 'envive-tw-pb-4',
93
+ 'envive-tw-pt-6',
94
+ 'lg:envive-tw-gap-10',
95
+ ]);
88
96
  return (
89
97
  <AnimatePresence>
90
98
  {show && (
@@ -95,15 +103,20 @@ export const WelcomeOverlay = ({
95
103
  initial={{ opacity: 1 }}
96
104
  exit={{ opacity: 0, transition: { duration: 0.5, ease: 'easeIn' } }}
97
105
  >
98
- <div className="envive-tw-flex envive-tw-flex-1 envive-tw-flex-col envive-tw-gap-6 envive-tw-overflow-y-auto envive-tw-overflow-x-hidden envive-tw-px-4 envive-tw-pb-4 envive-tw-pt-6 lg:envive-tw-gap-10">
106
+ <div className={overlayContentClassNames}>
99
107
  <div className={titleBoxClassNames}>
100
- <div className={titleClassNames}>
101
- <Typography variant={TypographyVariant.T3_MD}>{title}</Typography>
102
- <SparkleAnimation
103
- color={sparkleColor}
104
- animate={false}
105
- />
106
- </div>
108
+ <Typography
109
+ variant={TypographyVariant.T3_MD}
110
+ as="span"
111
+ >
112
+ {title}
113
+ <span className="envive-tw-ml-1 envive-tw-inline-block envive-tw-align-top">
114
+ <SparkleAnimation
115
+ color={sparkleColor}
116
+ animate={false}
117
+ />
118
+ </span>
119
+ </Typography>
107
120
  {chatFooter}
108
121
  {promptSuggestions.length > 0 && (
109
122
  <PromptCarousel
@@ -10,6 +10,7 @@ export const MarkdownProcessor = ({
10
10
  textColor,
11
11
  textVariant,
12
12
  onLinkClick,
13
+ theme,
13
14
  }: MarkdownProcessorProps) => {
14
15
  const processedContent = content.replace(/<br\s*[\\/]?>/gi, '\n\n');
15
16
 
@@ -18,10 +19,10 @@ export const MarkdownProcessor = ({
18
19
  li: MarkdownProcessorComponents.MarkdownListItem,
19
20
  ul: MarkdownProcessorComponents.MarkdownUnorderedList,
20
21
  ol: MarkdownProcessorComponents.MarkdownOrderedList,
21
- a: createMarkdownLinkComponent({ onLinkClick }),
22
+ a: createMarkdownLinkComponent({ onLinkClick, theme }),
22
23
  p: createMarkdownParagraphComponent({ clampParagraphs, textColor, textVariant }),
23
24
  }),
24
- [clampParagraphs, textColor, textVariant, onLinkClick],
25
+ [clampParagraphs, textColor, textVariant, onLinkClick, theme],
25
26
  );
26
27
 
27
28
  return <ReactMarkdown components={components}>{processedContent}</ReactMarkdown>;
@@ -1,17 +1,20 @@
1
1
  import { TypographyColor } from 'src/components/Typography';
2
2
  import { LinkButton } from '../../Message/components/LinkButton';
3
+ import { Theme } from '../../../../tokens/theme/theme';
3
4
 
4
5
  export type MarkdownLinkProps = {
5
6
  href?: string;
6
7
  children?: React.ReactNode;
7
8
  onClick?: (url: string) => void;
9
+ theme?: Theme;
8
10
  };
9
11
 
10
- export const MarkdownLink = ({ href, onClick, children }: MarkdownLinkProps) => (
12
+ export const MarkdownLink = ({ href, onClick, children, theme }: MarkdownLinkProps) => (
11
13
  <LinkButton
12
14
  url={href}
13
15
  text={children?.toString()}
14
16
  typographyColor={TypographyColor.TEXT_SECONDARY}
15
17
  onClick={onClick}
18
+ theme={theme}
16
19
  />
17
20
  );
@@ -1,4 +1,5 @@
1
1
  import { TypographyColor, TypographyVariant } from '../../Typography/types';
2
+ import { Theme } from '../../../../tokens/theme/theme';
2
3
 
3
4
  /**
4
5
  * Props for the MarkdownProcessor component.
@@ -41,4 +42,8 @@ export type MarkdownProcessorProps = {
41
42
  * Callback invoked when a markdown link is clicked. Receives the link URL as an argument.
42
43
  */
43
44
  onLinkClick?: (url: string) => void;
45
+ /**
46
+ * Theme applied to link icons. When STANDARD or MODERN, link icons get 2px border radius.
47
+ */
48
+ theme?: Theme;
44
49
  };
@@ -1,5 +1,6 @@
1
1
  import { TypographyColor, TypographyVariant } from '../../Typography/types';
2
2
  import { MarkdownProcessorComponents } from '../components';
3
+ import { Theme } from '../../../../tokens/theme/theme';
3
4
 
4
5
  export const createMarkdownParagraphComponent = ({
5
6
  clampParagraphs,
@@ -25,13 +26,16 @@ export const createMarkdownParagraphComponent = ({
25
26
 
26
27
  export const createMarkdownLinkComponent = ({
27
28
  onLinkClick,
29
+ theme,
28
30
  }: {
29
31
  onLinkClick?: (url: string) => void;
32
+ theme?: Theme;
30
33
  }) => {
31
34
  const Component = ({ href, children }: { href?: string; children?: React.ReactNode }) => (
32
35
  <MarkdownProcessorComponents.MarkdownLink
33
36
  href={href}
34
37
  onClick={onLinkClick}
38
+ theme={theme}
35
39
  >
36
40
  {children}
37
41
  </MarkdownProcessorComponents.MarkdownLink>
@@ -19,6 +19,7 @@ export const Message = ({
19
19
  style,
20
20
  ariaLabel,
21
21
  onLinkClick,
22
+ theme,
22
23
  }: MessageProps): JSX.Element => {
23
24
  const validationResult = validateMessageProps({ variant, agentName, content, isLoading });
24
25
  if (!validationResult.isValid) {
@@ -46,12 +47,13 @@ export const Message = ({
46
47
  )}
47
48
  {isAgent && (
48
49
  <MessageComponents.AgentContent
49
- content={content}
50
+ content={content ?? ''}
50
51
  isLoading={isLoading}
51
52
  onLinkClick={onLinkClick}
53
+ theme={theme}
52
54
  />
53
55
  )}
54
- {isUser && <MessageComponents.UserContent content={content} />}
56
+ {isUser && <MessageComponents.UserContent content={content ?? ''} />}
55
57
  </MessageComponents.Layout>
56
58
  );
57
59
  };
@@ -1,5 +1,6 @@
1
1
  import { Suspense, lazy } from 'react';
2
2
  import { LoadingSkeleton } from './LoadingSkeleton';
3
+ import { Theme } from '../../../../tokens/theme/theme';
3
4
 
4
5
  const MarkdownProcessor = lazy(async () => ({
5
6
  default: (await import('../../MarkdownProcessor/MarkdownProcessor')).MarkdownProcessor,
@@ -9,6 +10,7 @@ type AgentContentProps = {
9
10
  content: string;
10
11
  isLoading?: boolean;
11
12
  onLinkClick?: (url: string) => void;
13
+ theme?: Theme;
12
14
  };
13
15
 
14
16
  /**
@@ -18,6 +20,7 @@ export const AgentContent = ({
18
20
  content,
19
21
  isLoading = false,
20
22
  onLinkClick,
23
+ theme,
21
24
  }: AgentContentProps): React.ReactNode => {
22
25
  if (isLoading) {
23
26
  return <LoadingSkeleton />;
@@ -28,6 +31,7 @@ export const AgentContent = ({
28
31
  <MarkdownProcessor
29
32
  content={content}
30
33
  onLinkClick={onLinkClick}
34
+ theme={theme}
31
35
  />
32
36
  </Suspense>
33
37
  );
@@ -4,12 +4,14 @@ import { CustomIcon } from '../../utils/CustomIcon';
4
4
  import { useGetLinkButtonIconProperties } from '../hooks/useGetLinkButtonIconProperties';
5
5
  import { useGetLinkButtonProperties } from '../hooks/useGetLinkButtonProperties';
6
6
  import { openUrlInNewTab } from '../utils/openUrlInNewTab';
7
+ import { Theme } from '../../../../tokens/theme/theme';
7
8
 
8
9
  type LinkButtonProps = {
9
10
  url: string;
10
11
  text: string;
11
12
  typographyColor?: TypographyColor;
12
13
  onClick?: (url: string) => void;
14
+ theme?: Theme;
13
15
  };
14
16
 
15
17
  /**
@@ -21,9 +23,10 @@ export const LinkButton = ({
21
23
  text,
22
24
  typographyColor,
23
25
  onClick,
26
+ theme,
24
27
  }: LinkButtonProps): React.ReactNode => {
25
28
  const { containerClasses } = useGetLinkButtonProperties();
26
- const { iconContainerClasses } = useGetLinkButtonIconProperties();
29
+ const { iconContainerClasses } = useGetLinkButtonIconProperties(theme);
27
30
 
28
31
  const handleClick = () => {
29
32
  openUrlInNewTab(url);
@@ -1,20 +1,24 @@
1
1
  import { useMemo } from 'react';
2
+ import { Theme } from '../../../../tokens/theme/theme';
2
3
 
3
4
  /**
4
5
  * Hook that returns CSS classes for the LinkButton icon container element.
5
6
  */
6
- export const useGetLinkButtonIconProperties = () => {
7
+ export const useGetLinkButtonIconProperties = (theme?: Theme) => {
7
8
  const iconContainerClasses = useMemo(() => {
8
9
  const layoutClasses =
9
10
  'envive-tw-inline-flex envive-tw-h-4 envive-tw-w-4 envive-tw-items-center envive-tw-justify-center envive-tw-align-middle';
10
11
 
11
- const visualClasses = 'envive-tw-rounded-sm envive-tw-bg-background-secondary';
12
+ const radiusClass =
13
+ theme === Theme.STANDARD || theme === Theme.MODERN ? 'envive-tw-rounded-2' : '';
14
+
15
+ const visualClasses = `${radiusClass} envive-tw-bg-background-secondary`;
12
16
 
13
17
  const interactiveClasses =
14
18
  'envive-tw-transition-colors envive-tw-duration-200 group-hover:envive-tw-bg-[color-mix(in_srgb,var(--envive-colors-background-secondary)_90%,#000000_10%)]';
15
19
 
16
20
  return `${layoutClasses} ${visualClasses} ${interactiveClasses}`;
17
- }, []);
21
+ }, [theme]);
18
22
 
19
23
  return { iconContainerClasses };
20
24
  };
@@ -1,3 +1,5 @@
1
+ import { Theme } from '../../../../tokens/theme/theme';
2
+
1
3
  /**
2
4
  * Visual variant of the message component.
3
5
  */
@@ -86,4 +88,5 @@ export interface MessageProps {
86
88
  style?: React.CSSProperties;
87
89
 
88
90
  onLinkClick?: (url: string) => void;
91
+ theme?: Theme;
89
92
  }
@@ -11,7 +11,7 @@ export const useGetContainerProperties = ({
11
11
  minimalFrame = 'full',
12
12
  }: UseGetContainerPropertiesProps) => {
13
13
  const baseClassName =
14
- 'envive-tw-cursor-text envive-tw-border-solid envive-tw-px-4 envive-tw-py-2';
14
+ 'envive-tw-cursor-text envive-tw-border-solid envive-tw-px-4 envive-tw-py-2 envive-tw-bg-[--envive-colors-background-light]';
15
15
 
16
16
  const themeContainerClassName = useMemo(() => {
17
17
  const minimalBorderClass =
@@ -24,6 +24,7 @@ export const useGetContainerProperties = ({
24
24
  'envive-tw-border-[1px] envive-tw-border-border-light envive-tw-rounded-global-custom',
25
25
  [Theme.MODERN]: 'envive-tw-border-[1px] envive-tw-border-border-light envive-tw-rounded-4',
26
26
  [Theme.MINIMAL]: minimalBorderClass,
27
+ [Theme.GLOBAL_CUSTOM]: '',
27
28
  };
28
29
  return themeCotainerMap[theme] ?? '';
29
30
  }, [theme, minimalFrame]);
@@ -1,7 +1,8 @@
1
1
  import classNames from 'classnames';
2
2
  import { Container } from '../Container';
3
- import { WidgetWrapperProps } from './types/types';
3
+ import { WidgetWrapperProps, WidgetWrapperVariant } from './types/types';
4
4
  import { useGetWrapperProperties } from './hooks/useGetWrapperProperties';
5
+ import { useCheckIsMobile } from '../utils/useCheckIsMobile';
5
6
 
6
7
  /**
7
8
  * WidgetWrapper component provides consistent styling for widget containers.
@@ -18,11 +19,18 @@ export const WidgetWrapper = ({
18
19
  ...containerProps
19
20
  }: WidgetWrapperProps) => {
20
21
  const { wrapperClassName } = useGetWrapperProperties(variant);
22
+ const { isMobile } = useCheckIsMobile('md');
23
+
24
+ const isCardVariant =
25
+ variant === WidgetWrapperVariant.CARD_WITH_BORDER ||
26
+ variant === WidgetWrapperVariant.CARD_NO_BORDER;
27
+
28
+ const cardPadding = isCardVariant && !isMobile ? { padding: '24px' } : {};
21
29
 
22
30
  return (
23
31
  <Container
24
32
  className={classNames(wrapperClassName, className)}
25
- style={style}
33
+ style={{ ...style, ...cardPadding }}
26
34
  {...containerProps}
27
35
  >
28
36
  {children}
@@ -18,13 +18,13 @@ export const WidgetWrapperWithTitle = ({
18
18
  hideLogo,
19
19
  fullIsLoading,
20
20
  }: WidgetWrapperWithTitleProps) => {
21
- const cardBgColor =
21
+ const isCardVariant =
22
22
  variant === WidgetWrapperVariant.CARD_WITH_BORDER ||
23
- variant === WidgetWrapperVariant.CARD_NO_BORDER
24
- ? hexCardColor
25
- : undefined;
23
+ variant === WidgetWrapperVariant.CARD_NO_BORDER;
26
24
 
27
- const logo = hideLogo ? null : logoSrc;
25
+ const cardBgColor = isCardVariant ? hexCardColor : undefined;
26
+
27
+ const logo = hideLogo ? undefined : logoSrc;
28
28
 
29
29
  return (
30
30
  <WidgetWrapper
@@ -8,8 +8,8 @@ export const resolveTheme = (theme: Theme) => {
8
8
  globalCustomTheme &&
9
9
  (theme === Theme.GLOBAL_CUSTOM || theme === ('var(--envive-colors-global-custom)' as Theme))
10
10
  ) {
11
- return globalCustomTheme as Theme;
11
+ return globalCustomTheme;
12
12
  }
13
13
 
14
- return theme as Theme;
14
+ return theme;
15
15
  };