@envive-ai/react-toolkit-v3 0.3.32 → 0.3.33
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/CSSVariablesEditor/CssVariablesEditorComponent.d.cts +2 -2
- package/dist/CSSVariablesEditor/CssVariablesEditorComponent.d.ts +2 -2
- package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCssVariablesOptions.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.cjs +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetCurrentMerchantColors.js +1 -1
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.cjs +166 -61
- package/dist/CSSVariablesEditor/hooks/useGetDefaultCssVariables.js +166 -61
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.cjs +31 -16
- package/dist/CSSVariablesEditor/hooks/useHandleUpdateCssVars.js +31 -16
- package/dist/Carousel/Carousel.d.cts +2 -2
- package/dist/Carousel/components/Badge.cjs +1 -1
- package/dist/Carousel/components/Badge.js +1 -1
- package/dist/Carousel/components/Container.cjs +1 -1
- package/dist/Carousel/components/Container.js +1 -1
- 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 +1 -1
- package/dist/ChatFooter/components/Layout.js +1 -1
- package/dist/ChatFooter/components/index.d.cts +5 -5
- package/dist/ChatFooter/components/index.d.ts +5 -5
- package/dist/ChatHeader/ChatHeader.d.ts +2 -2
- package/dist/ChatHeader/hooks/useGetHandleProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetHandleProperties.js +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.cjs +1 -1
- package/dist/ChatHeader/hooks/useGetLayoutProperties.js +1 -1
- package/dist/ChatPreview/ChatPreview.d.cts +2 -2
- package/dist/ChatPreview/ChatPreview.d.ts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.cts +2 -2
- package/dist/ChatPreviewComparison/ChatPreviewComparison.d.ts +2 -2
- package/dist/ChatPreviewComparison/components/Layout.cjs +2 -2
- package/dist/ChatPreviewComparison/components/Layout.js +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.cts +2 -2
- package/dist/ChatPreviewLoading/ChatPreviewLoading.d.ts +2 -2
- package/dist/Container/Container.d.cts +172 -172
- package/dist/Container/Container.d.ts +172 -172
- package/dist/DesignTokens/DesignTokensComponent.d.cts +2 -2
- package/dist/DesignTokens/DesignTokensComponent.d.ts +2 -2
- package/dist/DesignTokens/components/FontFamily.cjs +1 -1
- package/dist/DesignTokens/components/FontFamily.js +1 -1
- package/dist/DesignTokens/components/FontSize.cjs +1 -1
- package/dist/DesignTokens/components/FontSize.js +1 -1
- package/dist/DesignTokens/components/FontWeight.cjs +5 -4
- package/dist/DesignTokens/components/FontWeight.js +5 -4
- package/dist/DesignTokens/components/LetterSpacing.cjs +16 -2
- package/dist/DesignTokens/components/LetterSpacing.js +16 -2
- package/dist/DesignTokens/components/LineHeight.cjs +14 -9
- package/dist/DesignTokens/components/LineHeight.js +14 -9
- package/dist/DesignTokens/components/Typography.cjs +1 -1
- package/dist/DesignTokens/components/Typography.js +1 -1
- package/dist/Disclaimer/components/Container.cjs +1 -1
- package/dist/Disclaimer/components/Container.js +1 -1
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.cts +2 -2
- package/dist/DocumentRetrievalCard/DocumentRetrievalCard.d.ts +2 -2
- package/dist/DocumentRetrievalCard/components/Image.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/Image.js +1 -1
- package/dist/DocumentRetrievalCard/components/Layout.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/Layout.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Icon.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Label.js +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.cjs +1 -1
- package/dist/DocumentRetrievalCard/components/ViewArticleButton/components/Layout.js +1 -1
- package/dist/FloatingButton/FloatingButton.d.cts +2 -2
- package/dist/FloatingButton/FloatingButton.d.ts +2 -2
- package/dist/FloatingButton/components/Button.cjs +1 -1
- package/dist/FloatingButton/components/Button.js +1 -1
- package/dist/FloatingButton/components/Container.cjs +1 -1
- package/dist/FloatingButton/components/Container.js +1 -1
- package/dist/FloatingButton/components/Wrapper.cjs +1 -1
- package/dist/FloatingButton/components/Wrapper.js +1 -1
- package/dist/FloatingChat/FloatingChat.d.cts +2 -2
- package/dist/FloatingChat/FloatingChat.d.ts +2 -2
- package/dist/FloatingChat/components/ChatMessages.cjs +1 -1
- package/dist/FloatingChat/components/ChatMessages.js +1 -1
- package/dist/FloatingChat/components/Layout.cjs +1 -1
- package/dist/FloatingChat/components/Layout.js +1 -1
- package/dist/FloatingChat/components/ProductResultsModal.cjs +1 -1
- package/dist/FloatingChat/components/ProductResultsModal.js +1 -1
- package/dist/FloatingChat/components/ResultsGridView.cjs +1 -1
- package/dist/FloatingChat/components/ResultsGridView.js +1 -1
- package/dist/FloatingChat/components/SalesAgentBadgeContent.cjs +4 -4
- package/dist/FloatingChat/components/SalesAgentBadgeContent.js +4 -4
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.cjs +6 -3
- package/dist/FloatingChat/components/SalesAgentProductCardsCarousel.js +6 -3
- package/dist/FloatingChat/utils/functions.cjs +2 -1
- package/dist/FloatingChat/utils/functions.js +2 -1
- package/dist/Form/Form.cjs +1 -1
- package/dist/Form/Form.js +1 -1
- package/dist/Form/components/Layout.cjs +1 -1
- package/dist/Form/components/Layout.js +1 -1
- package/dist/Form/components/SubmitButtonItem.cjs +1 -1
- package/dist/Form/components/SubmitButtonItem.js +1 -1
- package/dist/Form/components/TextFieldItem.cjs +1 -1
- package/dist/Form/components/TextFieldItem.js +1 -1
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.cts +2 -2
- package/dist/FullPageSalesAgent/FullPageSalesAgent.d.ts +2 -2
- package/dist/FullPageSalesAgent/components/Layout.cjs +1 -1
- package/dist/FullPageSalesAgent/components/Layout.js +1 -1
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.cjs +1 -1
- package/dist/FullPageSalesAgent/components/WelcomeOverlay.js +1 -1
- package/dist/Image/Image.cjs +1 -1
- package/dist/Image/Image.d.cts +2 -2
- package/dist/Image/Image.d.ts +2 -2
- package/dist/Image/Image.js +1 -1
- 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/utils/functions.cjs +1 -1
- package/dist/ImageGallery/utils/functions.js +1 -1
- package/dist/MarkdownProcessor/MarkdownProcessor.d.cts +2 -2
- package/dist/MarkdownProcessor/MarkdownProcessor.d.ts +2 -2
- package/dist/Message/components/Layout.cjs +1 -1
- package/dist/Message/components/Layout.js +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.cjs +1 -1
- package/dist/OrderLookupCard/OrderLookupCard.js +1 -1
- package/dist/OrderLookupCard/components/Layout.cjs +1 -1
- package/dist/OrderLookupCard/components/Layout.js +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.cjs +1 -1
- package/dist/OrderLookupCard/components/MoreProductsOverlay.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageGridItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImageItem.js +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.cjs +1 -1
- package/dist/OrderLookupCard/components/ProductImagesGrid.js +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.cjs +1 -1
- package/dist/OrderLookupCard/components/StatusLabel.js +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.cjs +1 -1
- package/dist/OrderLookupCard/components/TrackOrderLink.js +1 -1
- package/dist/ProductCard/ProductCard.cjs +14 -8
- package/dist/ProductCard/ProductCard.d.cts +3 -2
- package/dist/ProductCard/ProductCard.d.ts +3 -2
- package/dist/ProductCard/ProductCard.js +10 -4
- package/dist/ProductCard/components/Header.cjs +7 -5
- package/dist/ProductCard/components/Header.js +7 -5
- package/dist/ProductCard/components/Poster.cjs +3 -2
- package/dist/ProductCard/components/Poster.js +3 -2
- package/dist/ProductCard/hooks/useGetPosterProperties.cjs +5 -3
- package/dist/ProductCard/hooks/useGetPosterProperties.js +6 -3
- package/dist/ProductCard/index.cjs +3 -1
- package/dist/ProductCard/index.d.cts +2 -2
- package/dist/ProductCard/index.d.ts +2 -2
- package/dist/ProductCard/index.js +2 -1
- package/dist/ProductCard/types/index.cjs +10 -0
- package/dist/ProductCard/types/index.d.cts +13 -3
- package/dist/ProductCard/types/index.d.ts +13 -3
- package/dist/ProductCard/types/index.js +9 -0
- package/dist/PromptButton/PromptButton.cjs +1 -1
- package/dist/PromptButton/PromptButton.d.cts +2 -2
- package/dist/PromptButton/PromptButton.d.ts +2 -2
- package/dist/PromptButton/PromptButton.js +1 -1
- package/dist/PromptButton/components/Layout.cjs +1 -1
- package/dist/PromptButton/components/Layout.js +1 -1
- package/dist/PromptButton/components/Loading.cjs +1 -1
- package/dist/PromptButton/components/Loading.js +1 -1
- 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/Skeleton.cjs +1 -1
- package/dist/PromptButtonCarouselWithImage/components/Skeleton.js +1 -1
- package/dist/PromptCarousel/PromptCarousel.cjs +1 -1
- package/dist/PromptCarousel/PromptCarousel.d.cts +2 -2
- package/dist/PromptCarousel/PromptCarousel.d.ts +2 -2
- package/dist/PromptCarousel/PromptCarousel.js +1 -1
- package/dist/ReviewCard/ReviewCard.d.cts +2 -2
- package/dist/ReviewCard/ReviewCard.d.ts +2 -2
- package/dist/ReviewCard/components/Container.cjs +1 -1
- package/dist/ReviewCard/components/Container.js +1 -1
- package/dist/ReviewCard/components/Rating.cjs +1 -1
- package/dist/ReviewCard/components/Rating.js +1 -1
- 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.d.cts +2 -2
- package/dist/SalesAgentProductCard/SalesAgentProductCard.d.ts +2 -2
- package/dist/SalesAgentProductCard/components/Container.cjs +1 -1
- package/dist/SalesAgentProductCard/components/Container.js +1 -1
- package/dist/SalesAgentProductCard/components/ProductImage.cjs +1 -1
- package/dist/SalesAgentProductCard/components/ProductImage.js +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.cjs +1 -1
- package/dist/SalesAgentProductCard/components/ProductName.js +1 -1
- package/dist/SalesAgentProductCard/components/index.d.cts +8 -8
- package/dist/SalesAgentProductCard/components/index.d.ts +8 -8
- package/dist/SocialProof/SocialProof.d.cts +2 -2
- package/dist/SocialProof/SocialProof.d.ts +2 -2
- package/dist/SocialProof/components/Headline.cjs +1 -1
- package/dist/SocialProof/components/Headline.js +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.cjs +1 -1
- package/dist/SocialProof/components/LayoutFourHorizontal.js +1 -1
- package/dist/SparkleAnimation/SparkleAnimation.d.cts +2 -2
- package/dist/Stack/Stack.d.cts +2 -2
- package/dist/Stack/Stack.d.ts +2 -2
- package/dist/TextField/TextField.cjs +1 -1
- package/dist/TextField/TextField.js +1 -1
- package/dist/TextField/components/Input.cjs +1 -1
- package/dist/TextField/components/Input.js +1 -1
- package/dist/TextField/components/Layout.cjs +1 -1
- package/dist/TextField/components/Layout.js +1 -1
- package/dist/TextField/components/SendIcon.cjs +1 -1
- package/dist/TextField/components/SendIcon.js +1 -1
- package/dist/Title/Title.cjs +1 -1
- package/dist/Title/Title.js +1 -1
- package/dist/Title/components/Layout.cjs +1 -1
- package/dist/Title/components/Layout.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 +2 -2
- package/dist/Tokens/index.js +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.cts +2 -2
- package/dist/TypingAnimation/TypingAnimation.d.ts +2 -2
- package/dist/Typography/Typography.d.ts +4 -4
- package/dist/WelcomeMessage/components/Container.cjs +1 -1
- package/dist/WelcomeMessage/components/Container.js +1 -1
- package/dist/WidgetTextField/WidgetTextField.cjs +3 -2
- package/dist/WidgetTextField/WidgetTextField.d.cts +1 -0
- package/dist/WidgetTextField/WidgetTextField.d.ts +1 -0
- package/dist/WidgetTextField/WidgetTextField.js +3 -2
- package/dist/WidgetTextField/components/Container.cjs +4 -3
- package/dist/WidgetTextField/components/Container.js +4 -3
- package/dist/WidgetTextField/components/Skeleton.cjs +1 -1
- package/dist/WidgetTextField/components/Skeleton.js +1 -1
- package/dist/WidgetTextField/hooks/useGetContainerProperties.cjs +7 -3
- package/dist/WidgetTextField/hooks/useGetContainerProperties.js +7 -3
- package/dist/WidgetTextField/types/types.d.cts +2 -0
- package/dist/WidgetTextField/types/types.d.ts +2 -0
- package/dist/WidgetWrapper/WidgetWrapper.cjs +1 -1
- package/dist/WidgetWrapper/WidgetWrapper.d.cts +2 -2
- package/dist/WidgetWrapper/WidgetWrapper.js +1 -1
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.cts +2 -2
- package/dist/WidgetWrapperWithTitle/WidgetWrapperWithTitle.d.ts +2 -2
- package/dist/packages/components-v3/tokens/typography/fontWeight.cjs +12 -9
- package/dist/packages/components-v3/tokens/typography/fontWeight.d.ts +4 -3
- package/dist/packages/components-v3/tokens/typography/fontWeight.js +12 -9
- package/dist/packages/components-v3/tokens/typography/letterSpacing.cjs +39 -6
- package/dist/packages/components-v3/tokens/typography/letterSpacing.d.ts +13 -2
- package/dist/packages/components-v3/tokens/typography/letterSpacing.js +39 -6
- package/dist/packages/components-v3/tokens/typography/lineHeight.cjs +39 -30
- package/dist/packages/components-v3/tokens/typography/lineHeight.d.ts +15 -12
- package/dist/packages/components-v3/tokens/typography/lineHeight.js +39 -30
- package/dist/packages/components-v3/tokens/typography/typography.cjs +63 -63
- package/dist/packages/components-v3/tokens/typography/typography.js +63 -63
- package/dist/styles.css +1 -1
- package/dist/tokens/typography/fontWeight.d.cts +4 -3
- package/dist/tokens/typography/letterSpacing.d.cts +13 -2
- package/dist/tokens/typography/lineHeight.d.cts +15 -12
- package/dist/utils/resolveTheme.cjs +1 -1
- package/dist/utils/resolveTheme.js +1 -1
- package/package.json +1 -1
- package/src/components/CSSVariablesEditor/hooks/useGetDefaultCssVariables.ts +165 -60
- package/src/components/CSSVariablesEditor/hooks/useHandleUpdateCssVars.ts +30 -15
- package/src/components/DesignTokens/components/FontWeight.tsx +4 -3
- package/src/components/DesignTokens/components/LetterSpacing.tsx +13 -1
- package/src/components/DesignTokens/components/LineHeight.tsx +13 -8
- package/src/components/FloatingChat/components/SalesAgentBadgeContent.tsx +8 -2
- package/src/components/FloatingChat/components/SalesAgentProductCardsCarousel.tsx +5 -2
- package/src/components/FloatingChat/utils/functions.ts +2 -3
- package/src/components/ProductCard/ProductCard.tsx +8 -4
- package/src/components/ProductCard/components/Header.tsx +11 -5
- package/src/components/ProductCard/components/Poster.tsx +12 -3
- package/src/components/ProductCard/hooks/useGetPosterProperties.ts +15 -3
- package/src/components/ProductCard/index.ts +1 -0
- package/src/components/ProductCard/types/index.ts +13 -1
- package/src/components/WidgetTextField/WidgetTextField.tsx +2 -0
- package/src/components/WidgetTextField/components/Container.tsx +3 -0
- package/src/components/WidgetTextField/hooks/useGetContainerProperties.ts +8 -2
- package/src/components/WidgetTextField/types/types.ts +2 -0
|
@@ -290,112 +290,217 @@ export const useGetDefaultCssVariables = ({
|
|
|
290
290
|
|
|
291
291
|
// Font Weights
|
|
292
292
|
{
|
|
293
|
-
key: 'font-weight-
|
|
294
|
-
name: 'Font Weight
|
|
295
|
-
variable: FontWeightCSSVar.
|
|
296
|
-
defaultValue: fontWeight.
|
|
293
|
+
key: 'font-weight-title',
|
|
294
|
+
name: 'Font Weight Title',
|
|
295
|
+
variable: FontWeightCSSVar.Title,
|
|
296
|
+
defaultValue: fontWeight.title,
|
|
297
297
|
category: 'Typography',
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
|
-
key: 'font-weight-
|
|
301
|
-
name: 'Font Weight
|
|
302
|
-
variable: FontWeightCSSVar.
|
|
303
|
-
defaultValue: fontWeight.
|
|
300
|
+
key: 'font-weight-header',
|
|
301
|
+
name: 'Font Weight Header',
|
|
302
|
+
variable: FontWeightCSSVar.Header,
|
|
303
|
+
defaultValue: fontWeight.header,
|
|
304
304
|
category: 'Typography',
|
|
305
305
|
},
|
|
306
306
|
{
|
|
307
|
-
key: 'font-weight-
|
|
308
|
-
name: 'Font Weight
|
|
309
|
-
variable: FontWeightCSSVar.
|
|
310
|
-
defaultValue: fontWeight.
|
|
307
|
+
key: 'font-weight-body-emphasis',
|
|
308
|
+
name: 'Font Weight Body Emphasis',
|
|
309
|
+
variable: FontWeightCSSVar.BodyEmphasis,
|
|
310
|
+
defaultValue: fontWeight.body_emphasis,
|
|
311
|
+
category: 'Typography',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
key: 'font-weight-body-standard',
|
|
315
|
+
name: 'Font Weight Body Standard',
|
|
316
|
+
variable: FontWeightCSSVar.BodyStandard,
|
|
317
|
+
defaultValue: fontWeight.body_standard,
|
|
311
318
|
category: 'Typography',
|
|
312
319
|
},
|
|
313
320
|
|
|
314
321
|
// Line Heights
|
|
315
322
|
{
|
|
316
|
-
key: 'line-height-
|
|
317
|
-
name: 'Line Height
|
|
318
|
-
variable: LineHeightCSSVar.
|
|
319
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
323
|
+
key: 'line-height-t1',
|
|
324
|
+
name: 'Line Height T1',
|
|
325
|
+
variable: LineHeightCSSVar.T1,
|
|
326
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.t1),
|
|
327
|
+
category: 'Typography',
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
key: 'line-height-t2',
|
|
331
|
+
name: 'Line Height T2',
|
|
332
|
+
variable: LineHeightCSSVar.T2,
|
|
333
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.t2),
|
|
334
|
+
category: 'Typography',
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
key: 'line-height-t3',
|
|
338
|
+
name: 'Line Height T3',
|
|
339
|
+
variable: LineHeightCSSVar.T3,
|
|
340
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.t3),
|
|
341
|
+
category: 'Typography',
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
key: 'line-height-h1',
|
|
345
|
+
name: 'Line Height H1',
|
|
346
|
+
variable: LineHeightCSSVar.H1,
|
|
347
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.h1),
|
|
320
348
|
category: 'Typography',
|
|
321
349
|
},
|
|
322
350
|
{
|
|
323
|
-
key: 'line-height-
|
|
324
|
-
name: 'Line Height
|
|
325
|
-
variable: LineHeightCSSVar.
|
|
326
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
351
|
+
key: 'line-height-h2',
|
|
352
|
+
name: 'Line Height H2',
|
|
353
|
+
variable: LineHeightCSSVar.H2,
|
|
354
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.h2),
|
|
327
355
|
category: 'Typography',
|
|
328
356
|
},
|
|
329
357
|
{
|
|
330
|
-
key: 'line-height-
|
|
331
|
-
name: 'Line Height
|
|
332
|
-
variable: LineHeightCSSVar.
|
|
333
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
358
|
+
key: 'line-height-h3',
|
|
359
|
+
name: 'Line Height H3',
|
|
360
|
+
variable: LineHeightCSSVar.H3,
|
|
361
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.h3),
|
|
334
362
|
category: 'Typography',
|
|
335
363
|
},
|
|
336
364
|
{
|
|
337
|
-
key: 'line-height-
|
|
338
|
-
name: 'Line Height
|
|
339
|
-
variable: LineHeightCSSVar.
|
|
340
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
365
|
+
key: 'line-height-b1',
|
|
366
|
+
name: 'Line Height B1',
|
|
367
|
+
variable: LineHeightCSSVar.B1,
|
|
368
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.b1),
|
|
341
369
|
category: 'Typography',
|
|
342
370
|
},
|
|
343
371
|
{
|
|
344
|
-
key: 'line-height-
|
|
345
|
-
name: 'Line Height
|
|
346
|
-
variable: LineHeightCSSVar.
|
|
347
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
372
|
+
key: 'line-height-b2',
|
|
373
|
+
name: 'Line Height B2',
|
|
374
|
+
variable: LineHeightCSSVar.B2,
|
|
375
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.b2),
|
|
348
376
|
category: 'Typography',
|
|
349
377
|
},
|
|
350
378
|
{
|
|
351
|
-
key: 'line-height-
|
|
352
|
-
name: 'Line Height
|
|
353
|
-
variable: LineHeightCSSVar.
|
|
354
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
379
|
+
key: 'line-height-b3',
|
|
380
|
+
name: 'Line Height B3',
|
|
381
|
+
variable: LineHeightCSSVar.B3,
|
|
382
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.b3),
|
|
355
383
|
category: 'Typography',
|
|
356
384
|
},
|
|
357
385
|
{
|
|
358
|
-
key: 'line-height-
|
|
359
|
-
name: 'Line Height
|
|
360
|
-
variable: LineHeightCSSVar.
|
|
361
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
386
|
+
key: 'line-height-b4',
|
|
387
|
+
name: 'Line Height B4',
|
|
388
|
+
variable: LineHeightCSSVar.B4,
|
|
389
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.b4),
|
|
362
390
|
category: 'Typography',
|
|
363
391
|
},
|
|
364
392
|
{
|
|
365
|
-
key: 'line-height-
|
|
366
|
-
name: 'Line Height
|
|
367
|
-
variable: LineHeightCSSVar.
|
|
368
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
393
|
+
key: 'line-height-b5',
|
|
394
|
+
name: 'Line Height B5',
|
|
395
|
+
variable: LineHeightCSSVar.B5,
|
|
396
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.b5),
|
|
369
397
|
category: 'Typography',
|
|
370
398
|
},
|
|
371
399
|
{
|
|
372
|
-
key: 'line-height-
|
|
373
|
-
name: 'Line Height
|
|
374
|
-
variable: LineHeightCSSVar.
|
|
375
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
400
|
+
key: 'line-height-l1',
|
|
401
|
+
name: 'Line Height L1',
|
|
402
|
+
variable: LineHeightCSSVar.L1,
|
|
403
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.l1),
|
|
376
404
|
category: 'Typography',
|
|
377
405
|
},
|
|
378
406
|
{
|
|
379
|
-
key: 'line-height-
|
|
380
|
-
name: 'Line Height
|
|
381
|
-
variable: LineHeightCSSVar.
|
|
382
|
-
defaultValue: convertLineHeightToPercentage(lineHeight
|
|
407
|
+
key: 'line-height-l2',
|
|
408
|
+
name: 'Line Height L2',
|
|
409
|
+
variable: LineHeightCSSVar.L2,
|
|
410
|
+
defaultValue: convertLineHeightToPercentage(lineHeight.l2),
|
|
383
411
|
category: 'Typography',
|
|
384
412
|
},
|
|
385
413
|
|
|
386
414
|
// Letter Spacing
|
|
387
415
|
{
|
|
388
|
-
key: 'letter-spacing-
|
|
389
|
-
name: 'Letter Spacing
|
|
390
|
-
variable: LetterSpacingCSSVar.
|
|
391
|
-
defaultValue: letterSpacing
|
|
416
|
+
key: 'letter-spacing-t1',
|
|
417
|
+
name: 'Letter Spacing T1',
|
|
418
|
+
variable: LetterSpacingCSSVar.T1,
|
|
419
|
+
defaultValue: letterSpacing.t1,
|
|
420
|
+
category: 'Typography',
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
key: 'letter-spacing-t2',
|
|
424
|
+
name: 'Letter Spacing T2',
|
|
425
|
+
variable: LetterSpacingCSSVar.T2,
|
|
426
|
+
defaultValue: letterSpacing.t2,
|
|
427
|
+
category: 'Typography',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
key: 'letter-spacing-t3',
|
|
431
|
+
name: 'Letter Spacing T3',
|
|
432
|
+
variable: LetterSpacingCSSVar.T3,
|
|
433
|
+
defaultValue: letterSpacing.t3,
|
|
434
|
+
category: 'Typography',
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
key: 'letter-spacing-h1',
|
|
438
|
+
name: 'Letter Spacing H1',
|
|
439
|
+
variable: LetterSpacingCSSVar.H1,
|
|
440
|
+
defaultValue: letterSpacing.h1,
|
|
441
|
+
category: 'Typography',
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
key: 'letter-spacing-h2',
|
|
445
|
+
name: 'Letter Spacing H2',
|
|
446
|
+
variable: LetterSpacingCSSVar.H2,
|
|
447
|
+
defaultValue: letterSpacing.h2,
|
|
448
|
+
category: 'Typography',
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
key: 'letter-spacing-h3',
|
|
452
|
+
name: 'Letter Spacing H3',
|
|
453
|
+
variable: LetterSpacingCSSVar.H3,
|
|
454
|
+
defaultValue: letterSpacing.h3,
|
|
455
|
+
category: 'Typography',
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
key: 'letter-spacing-b1',
|
|
459
|
+
name: 'Letter Spacing B1',
|
|
460
|
+
variable: LetterSpacingCSSVar.B1,
|
|
461
|
+
defaultValue: letterSpacing.b1,
|
|
462
|
+
category: 'Typography',
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
key: 'letter-spacing-b2',
|
|
466
|
+
name: 'Letter Spacing B2',
|
|
467
|
+
variable: LetterSpacingCSSVar.B2,
|
|
468
|
+
defaultValue: letterSpacing.b2,
|
|
469
|
+
category: 'Typography',
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
key: 'letter-spacing-b3',
|
|
473
|
+
name: 'Letter Spacing B3',
|
|
474
|
+
variable: LetterSpacingCSSVar.B3,
|
|
475
|
+
defaultValue: letterSpacing.b3,
|
|
476
|
+
category: 'Typography',
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
key: 'letter-spacing-b4',
|
|
480
|
+
name: 'Letter Spacing B4',
|
|
481
|
+
variable: LetterSpacingCSSVar.B4,
|
|
482
|
+
defaultValue: letterSpacing.b4,
|
|
483
|
+
category: 'Typography',
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
key: 'letter-spacing-b5',
|
|
487
|
+
name: 'Letter Spacing B5',
|
|
488
|
+
variable: LetterSpacingCSSVar.B5,
|
|
489
|
+
defaultValue: letterSpacing.b5,
|
|
490
|
+
category: 'Typography',
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
key: 'letter-spacing-l1',
|
|
494
|
+
name: 'Letter Spacing L1',
|
|
495
|
+
variable: LetterSpacingCSSVar.L1,
|
|
496
|
+
defaultValue: letterSpacing.l1,
|
|
392
497
|
category: 'Typography',
|
|
393
498
|
},
|
|
394
499
|
{
|
|
395
|
-
key: 'letter-spacing-
|
|
396
|
-
name: 'Letter Spacing
|
|
397
|
-
variable: LetterSpacingCSSVar.
|
|
398
|
-
defaultValue: letterSpacing
|
|
500
|
+
key: 'letter-spacing-l2',
|
|
501
|
+
name: 'Letter Spacing L2',
|
|
502
|
+
variable: LetterSpacingCSSVar.L2,
|
|
503
|
+
defaultValue: letterSpacing.l2,
|
|
399
504
|
category: 'Typography',
|
|
400
505
|
},
|
|
401
506
|
|
|
@@ -32,23 +32,38 @@ export const useHandleUpdateCssVars = () => {
|
|
|
32
32
|
--${FontSizeCSSVar.L1}: ${variables['font-size-l1']} !important;
|
|
33
33
|
--${FontSizeCSSVar.L2}: ${variables['font-size-l2']} !important;
|
|
34
34
|
|
|
35
|
-
--${FontWeightCSSVar.
|
|
36
|
-
--${FontWeightCSSVar.
|
|
37
|
-
--${FontWeightCSSVar.
|
|
35
|
+
--${FontWeightCSSVar.Title}: ${variables['font-weight-title']} !important;
|
|
36
|
+
--${FontWeightCSSVar.Header}: ${variables['font-weight-header']} !important;
|
|
37
|
+
--${FontWeightCSSVar.BodyEmphasis}: ${variables['font-weight-body-emphasis']} !important;
|
|
38
|
+
--${FontWeightCSSVar.BodyStandard}: ${variables['font-weight-body-standard']} !important;
|
|
38
39
|
|
|
39
|
-
--${LineHeightCSSVar.
|
|
40
|
-
--${LineHeightCSSVar.
|
|
41
|
-
--${LineHeightCSSVar.
|
|
42
|
-
--${LineHeightCSSVar.
|
|
43
|
-
--${LineHeightCSSVar.
|
|
44
|
-
--${LineHeightCSSVar.
|
|
45
|
-
--${LineHeightCSSVar.
|
|
46
|
-
--${LineHeightCSSVar.
|
|
47
|
-
--${LineHeightCSSVar.
|
|
48
|
-
--${LineHeightCSSVar.
|
|
40
|
+
--${LineHeightCSSVar.T1}: ${convertPercentageTolineHeight(variables['line-height-t1'])} !important;
|
|
41
|
+
--${LineHeightCSSVar.T2}: ${convertPercentageTolineHeight(variables['line-height-t2'])} !important;
|
|
42
|
+
--${LineHeightCSSVar.T3}: ${convertPercentageTolineHeight(variables['line-height-t3'])} !important;
|
|
43
|
+
--${LineHeightCSSVar.H1}: ${convertPercentageTolineHeight(variables['line-height-h1'])} !important;
|
|
44
|
+
--${LineHeightCSSVar.H2}: ${convertPercentageTolineHeight(variables['line-height-h2'])} !important;
|
|
45
|
+
--${LineHeightCSSVar.H3}: ${convertPercentageTolineHeight(variables['line-height-h3'])} !important;
|
|
46
|
+
--${LineHeightCSSVar.B1}: ${convertPercentageTolineHeight(variables['line-height-b1'])} !important;
|
|
47
|
+
--${LineHeightCSSVar.B2}: ${convertPercentageTolineHeight(variables['line-height-b2'])} !important;
|
|
48
|
+
--${LineHeightCSSVar.B3}: ${convertPercentageTolineHeight(variables['line-height-b3'])} !important;
|
|
49
|
+
--${LineHeightCSSVar.B4}: ${convertPercentageTolineHeight(variables['line-height-b4'])} !important;
|
|
50
|
+
--${LineHeightCSSVar.B5}: ${convertPercentageTolineHeight(variables['line-height-b5'])} !important;
|
|
51
|
+
--${LineHeightCSSVar.L1}: ${convertPercentageTolineHeight(variables['line-height-l1'])} !important;
|
|
52
|
+
--${LineHeightCSSVar.L2}: ${convertPercentageTolineHeight(variables['line-height-l2'])} !important;
|
|
49
53
|
|
|
50
|
-
--${LetterSpacingCSSVar.
|
|
51
|
-
--${LetterSpacingCSSVar.
|
|
54
|
+
--${LetterSpacingCSSVar.T1}: ${variables['letter-spacing-t1']} !important;
|
|
55
|
+
--${LetterSpacingCSSVar.T2}: ${variables['letter-spacing-t2']} !important;
|
|
56
|
+
--${LetterSpacingCSSVar.T3}: ${variables['letter-spacing-t3']} !important;
|
|
57
|
+
--${LetterSpacingCSSVar.H1}: ${variables['letter-spacing-h1']} !important;
|
|
58
|
+
--${LetterSpacingCSSVar.H2}: ${variables['letter-spacing-h2']} !important;
|
|
59
|
+
--${LetterSpacingCSSVar.H3}: ${variables['letter-spacing-h3']} !important;
|
|
60
|
+
--${LetterSpacingCSSVar.B1}: ${variables['letter-spacing-b1']} !important;
|
|
61
|
+
--${LetterSpacingCSSVar.B2}: ${variables['letter-spacing-b2']} !important;
|
|
62
|
+
--${LetterSpacingCSSVar.B3}: ${variables['letter-spacing-b3']} !important;
|
|
63
|
+
--${LetterSpacingCSSVar.B4}: ${variables['letter-spacing-b4']} !important;
|
|
64
|
+
--${LetterSpacingCSSVar.B5}: ${variables['letter-spacing-b5']} !important;
|
|
65
|
+
--${LetterSpacingCSSVar.L1}: ${variables['letter-spacing-l1']} !important;
|
|
66
|
+
--${LetterSpacingCSSVar.L2}: ${variables['letter-spacing-l2']} !important;
|
|
52
67
|
|
|
53
68
|
--${FontFamilyCSSVar.Title}: ${variables['font-family-title']} !important;
|
|
54
69
|
--${FontFamilyCSSVar.Header}: ${variables['font-family-header']} !important;
|
|
@@ -7,9 +7,10 @@ type FontWeightProps = {
|
|
|
7
7
|
|
|
8
8
|
export const FontWeight = ({ fontWeightTokens }: FontWeightProps) => {
|
|
9
9
|
const fontWeightTwMap = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
title: 'envive-tw-font-title',
|
|
11
|
+
header: 'envive-tw-font-header',
|
|
12
|
+
body_emphasis: 'envive-tw-font-body_emphasis',
|
|
13
|
+
body_standard: 'envive-tw-font-body_standard',
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
return (
|
|
@@ -7,7 +7,19 @@ type LetterSpacingProps = {
|
|
|
7
7
|
|
|
8
8
|
export const LetterSpacing = ({ letterSpacingTokens }: LetterSpacingProps) => {
|
|
9
9
|
const letterSpacingTwMap = {
|
|
10
|
-
|
|
10
|
+
t1: 'envive-tw-tracking-t1',
|
|
11
|
+
t2: 'envive-tw-tracking-t2',
|
|
12
|
+
t3: 'envive-tw-tracking-t3',
|
|
13
|
+
h1: 'envive-tw-tracking-h1',
|
|
14
|
+
h2: 'envive-tw-tracking-h2',
|
|
15
|
+
h3: 'envive-tw-tracking-h3',
|
|
16
|
+
b1: 'envive-tw-tracking-b1',
|
|
17
|
+
b2: 'envive-tw-tracking-b2',
|
|
18
|
+
b3: 'envive-tw-tracking-b3',
|
|
19
|
+
b4: 'envive-tw-tracking-b4',
|
|
20
|
+
b5: 'envive-tw-tracking-b5',
|
|
21
|
+
l1: 'envive-tw-tracking-l1',
|
|
22
|
+
l2: 'envive-tw-tracking-l2',
|
|
11
23
|
};
|
|
12
24
|
|
|
13
25
|
return (
|
|
@@ -7,14 +7,19 @@ type LineHeightProps = {
|
|
|
7
7
|
|
|
8
8
|
export const LineHeight = ({ lineHeightTokens }: LineHeightProps) => {
|
|
9
9
|
const lineHeightTwMap = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
t1: 'envive-tw-leading-t1',
|
|
11
|
+
t2: 'envive-tw-leading-t2',
|
|
12
|
+
t3: 'envive-tw-leading-t3',
|
|
13
|
+
h1: 'envive-tw-leading-h1',
|
|
14
|
+
h2: 'envive-tw-leading-h2',
|
|
15
|
+
h3: 'envive-tw-leading-h3',
|
|
16
|
+
b1: 'envive-tw-leading-b1',
|
|
17
|
+
b2: 'envive-tw-leading-b2',
|
|
18
|
+
b3: 'envive-tw-leading-b3',
|
|
19
|
+
b4: 'envive-tw-leading-b4',
|
|
20
|
+
b5: 'envive-tw-leading-b5',
|
|
21
|
+
l1: 'envive-tw-leading-l1',
|
|
22
|
+
l2: 'envive-tw-leading-l2',
|
|
18
23
|
};
|
|
19
24
|
return (
|
|
20
25
|
<section>
|
|
@@ -59,6 +59,7 @@ export interface GetBadgeContentAndLabelParams {
|
|
|
59
59
|
onExploreAllResults?: () => void;
|
|
60
60
|
displayLimit?: number;
|
|
61
61
|
hideBadgeCount?: boolean;
|
|
62
|
+
isMobile?: boolean;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export interface BadgeContentAndLabel {
|
|
@@ -72,6 +73,7 @@ export const getBadgeContentAndLabel = ({
|
|
|
72
73
|
onExploreAllResults,
|
|
73
74
|
hideBadgeCount,
|
|
74
75
|
displayLimit = MOST_RELEVANT_DISPLAY_LIMIT,
|
|
76
|
+
isMobile = false,
|
|
75
77
|
}: GetBadgeContentAndLabelParams): BadgeContentAndLabel => {
|
|
76
78
|
if (hideBadgeCount) {
|
|
77
79
|
return {
|
|
@@ -83,12 +85,16 @@ export const getBadgeContentAndLabel = ({
|
|
|
83
85
|
<SalesAgentBadgeContent
|
|
84
86
|
totalProducts={totalProducts}
|
|
85
87
|
displayLimit={displayLimit}
|
|
86
|
-
onExploreAllResults={onExploreAllResults}
|
|
88
|
+
onExploreAllResults={onExploreAllResults ?? (() => {})}
|
|
87
89
|
/>
|
|
88
90
|
) : null;
|
|
89
91
|
|
|
92
|
+
// Desktop: show count badge when totalProducts >= 4; Mobile: show when totalProducts >= 3
|
|
93
|
+
const badgeMinThreshold = isMobile ? 3 : 4;
|
|
90
94
|
const badgeLabel =
|
|
91
|
-
!areProductsMoreThanDisplayLimit && totalProducts
|
|
95
|
+
!areProductsMoreThanDisplayLimit && totalProducts >= badgeMinThreshold
|
|
96
|
+
? `${totalProducts} Products`
|
|
97
|
+
: null;
|
|
92
98
|
|
|
93
99
|
return { badgeContent, badgeLabel };
|
|
94
100
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
SalesAgentProductCardVariant,
|
|
7
7
|
} from '../../SalesAgentProductCard/types/types';
|
|
8
8
|
import { resolveTheme } from '../../utils/resolveTheme';
|
|
9
|
+
import { useCheckIsMobile } from '../../utils/useCheckIsMobile';
|
|
9
10
|
import { getProductCarouselDisplayInfo } from '../utils/functions';
|
|
10
11
|
import { getBadgeContentAndLabel } from './SalesAgentBadgeContent';
|
|
11
12
|
|
|
@@ -32,6 +33,7 @@ export const SalesAgentProductCardsCarousel = ({
|
|
|
32
33
|
onExploreAllResults,
|
|
33
34
|
}: SalesAgentProductCardsCarouselProps) => {
|
|
34
35
|
const finalTheme = resolveTheme(theme);
|
|
36
|
+
const { isMobile } = useCheckIsMobile('md');
|
|
35
37
|
const { totalProducts, areProductsMoreThanDisplayLimit, displayedProducts } =
|
|
36
38
|
getProductCarouselDisplayInfo(products, numberOfProducts);
|
|
37
39
|
|
|
@@ -44,13 +46,14 @@ export const SalesAgentProductCardsCarousel = ({
|
|
|
44
46
|
totalProducts,
|
|
45
47
|
areProductsMoreThanDisplayLimit,
|
|
46
48
|
onExploreAllResults,
|
|
49
|
+
isMobile,
|
|
47
50
|
});
|
|
48
51
|
|
|
49
52
|
return (
|
|
50
53
|
<Carousel
|
|
51
54
|
hideNavigation={hideNavigation}
|
|
52
55
|
badgeContent={badgeContent}
|
|
53
|
-
badgeLabel={badgeLabel}
|
|
56
|
+
badgeLabel={badgeLabel ?? undefined}
|
|
54
57
|
elements={displayedProducts.map((product, index) => (
|
|
55
58
|
<SalesAgentProductCard
|
|
56
59
|
key={product.id ?? `product-${index}`}
|
|
@@ -66,7 +69,7 @@ export const SalesAgentProductCardsCarousel = ({
|
|
|
66
69
|
url={product.url}
|
|
67
70
|
target="_blank"
|
|
68
71
|
theme={finalTheme}
|
|
69
|
-
onClick={() => onProductCardClick(product)}
|
|
72
|
+
onClick={() => onProductCardClick?.(product)}
|
|
70
73
|
/>
|
|
71
74
|
))}
|
|
72
75
|
theme={finalTheme}
|
|
@@ -169,8 +169,7 @@ export const getProductCarouselDisplayInfo = <T>(
|
|
|
169
169
|
} => {
|
|
170
170
|
const totalProducts = numberOfProducts ?? products.length;
|
|
171
171
|
const areProductsMoreThanDisplayLimit = totalProducts > displayLimit;
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
: products;
|
|
172
|
+
const maxDisplayed = areProductsMoreThanDisplayLimit ? displayLimit : totalProducts;
|
|
173
|
+
const displayedProducts = products.slice(0, maxDisplayed);
|
|
175
174
|
return { totalProducts, areProductsMoreThanDisplayLimit, displayedProducts };
|
|
176
175
|
};
|
|
@@ -4,10 +4,11 @@ import { TypographyColor } from '../Typography/types';
|
|
|
4
4
|
import { resolveTheme } from '../utils/resolveTheme';
|
|
5
5
|
import { WidgetTextField } from '../WidgetTextField';
|
|
6
6
|
import { ProductCardWidgetComponents } from './components';
|
|
7
|
-
import { ProductCardProps } from './types';
|
|
7
|
+
import { ProductCardProps, ProductCardVariant } from './types';
|
|
8
8
|
|
|
9
9
|
export const ProductCard = ({
|
|
10
10
|
theme = Theme.GLOBAL_CUSTOM,
|
|
11
|
+
variant = ProductCardVariant.DARK,
|
|
11
12
|
imageSrc,
|
|
12
13
|
headline,
|
|
13
14
|
italicizeHeadline,
|
|
@@ -33,11 +34,14 @@ export const ProductCard = ({
|
|
|
33
34
|
onTranscriptionCompleted,
|
|
34
35
|
}: ProductCardProps) => {
|
|
35
36
|
const resolvedTheme = resolveTheme(theme);
|
|
37
|
+
const isLight = variant === ProductCardVariant.LIGHT;
|
|
38
|
+
const minimalTextColor = isLight ? TypographyColor.TEXT_PRIMARY : TypographyColor.TEXT_LIGHT;
|
|
36
39
|
|
|
37
40
|
return (
|
|
38
41
|
<ProductCardWidgetComponents.Poster
|
|
39
42
|
imageSrc={imageSrc}
|
|
40
43
|
fallbackColor={fallbackColor}
|
|
44
|
+
variant={variant}
|
|
41
45
|
>
|
|
42
46
|
<ProductCardWidgetComponents.Header
|
|
43
47
|
headline={headline}
|
|
@@ -46,6 +50,7 @@ export const ProductCard = ({
|
|
|
46
50
|
textTypingDuration={textTypingDuration}
|
|
47
51
|
textTransition={textTransition}
|
|
48
52
|
loop={loop}
|
|
53
|
+
variant={variant}
|
|
49
54
|
/>
|
|
50
55
|
<ProductCardWidgetComponents.Carousel
|
|
51
56
|
theme={resolvedTheme}
|
|
@@ -63,15 +68,14 @@ export const ProductCard = ({
|
|
|
63
68
|
<WidgetTextField
|
|
64
69
|
theme={resolvedTheme}
|
|
65
70
|
minimalFrame={resolvedTheme === Theme.MINIMAL ? 'bottom-only' : 'full'}
|
|
71
|
+
minimalBorderVariant={isLight ? 'primary' : 'light'}
|
|
66
72
|
placeholder={placeholder}
|
|
67
73
|
onClick={onInputClick}
|
|
68
74
|
enableVoiceInput={voiceInputEnabled}
|
|
69
75
|
onTranscriptionStarted={onTranscriptionStarted}
|
|
70
76
|
onTranscriptionCompleted={onTranscriptionCompleted}
|
|
71
77
|
textColor={
|
|
72
|
-
resolvedTheme === Theme.MINIMAL
|
|
73
|
-
? TypographyColor.TEXT_LIGHT
|
|
74
|
-
: TypographyColor.TEXT_SECONDARY
|
|
78
|
+
resolvedTheme === Theme.MINIMAL ? minimalTextColor : TypographyColor.TEXT_SECONDARY
|
|
75
79
|
}
|
|
76
80
|
className={classNames(
|
|
77
81
|
resolvedTheme === Theme.MINIMAL
|
|
@@ -4,7 +4,7 @@ import { Stack } from '../../Stack';
|
|
|
4
4
|
import { Typography, TypographyColor, TypographyVariant } from '../../Typography';
|
|
5
5
|
import { useAnimatedTextMinHeight } from '../../utils/useAnimatedTextMinHeight';
|
|
6
6
|
import { useGetHeaderProperties } from '../hooks/useGetHeaderProperties';
|
|
7
|
-
import { HeaderProps } from '../types';
|
|
7
|
+
import { HeaderProps, ProductCardVariant } from '../types';
|
|
8
8
|
|
|
9
9
|
export const Header = ({
|
|
10
10
|
headline,
|
|
@@ -13,10 +13,16 @@ export const Header = ({
|
|
|
13
13
|
textTypingDuration,
|
|
14
14
|
textTransition,
|
|
15
15
|
loop,
|
|
16
|
+
variant = ProductCardVariant.DARK,
|
|
16
17
|
}: HeaderProps) => {
|
|
17
18
|
const { stackClasses, headlineClasses } = useGetHeaderProperties(italicizeHeadline);
|
|
18
19
|
const { measuringRef, minHeight } = useAnimatedTextMinHeight(animatedText);
|
|
19
20
|
|
|
21
|
+
const textColor =
|
|
22
|
+
variant === ProductCardVariant.LIGHT
|
|
23
|
+
? TypographyColor.TEXT_PRIMARY
|
|
24
|
+
: TypographyColor.TEXT_LIGHT;
|
|
25
|
+
|
|
20
26
|
const biggestText = useMemo(() => {
|
|
21
27
|
return animatedText.reduce((maxText, currText) => {
|
|
22
28
|
return currText.length > maxText.length ? currText : maxText;
|
|
@@ -27,12 +33,12 @@ export const Header = ({
|
|
|
27
33
|
(text: string) => (
|
|
28
34
|
<Typography
|
|
29
35
|
variant={TypographyVariant.B3_MD}
|
|
30
|
-
color={
|
|
36
|
+
color={textColor}
|
|
31
37
|
>
|
|
32
38
|
{text}
|
|
33
39
|
</Typography>
|
|
34
40
|
),
|
|
35
|
-
[],
|
|
41
|
+
[textColor],
|
|
36
42
|
);
|
|
37
43
|
|
|
38
44
|
return (
|
|
@@ -42,7 +48,7 @@ export const Header = ({
|
|
|
42
48
|
>
|
|
43
49
|
<Typography
|
|
44
50
|
variant={TypographyVariant.H1_MD}
|
|
45
|
-
color={
|
|
51
|
+
color={textColor}
|
|
46
52
|
className={headlineClasses}
|
|
47
53
|
numberOfLines={2}
|
|
48
54
|
>
|
|
@@ -63,7 +69,7 @@ export const Header = ({
|
|
|
63
69
|
<div>
|
|
64
70
|
<Typography
|
|
65
71
|
variant={TypographyVariant.B3_MD}
|
|
66
|
-
color={
|
|
72
|
+
color={textColor}
|
|
67
73
|
>
|
|
68
74
|
{biggestText}
|
|
69
75
|
</Typography>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { Container } from '../../Container';
|
|
2
2
|
import { useGetPosterProperties } from '../hooks/useGetPosterProperties';
|
|
3
|
-
import { PosterProps } from '../types';
|
|
3
|
+
import { PosterProps, ProductCardVariant } from '../types';
|
|
4
4
|
|
|
5
|
-
export const Poster = ({
|
|
6
|
-
|
|
5
|
+
export const Poster = ({
|
|
6
|
+
children,
|
|
7
|
+
imageSrc,
|
|
8
|
+
fallbackColor,
|
|
9
|
+
variant = ProductCardVariant.DARK,
|
|
10
|
+
}: PosterProps) => {
|
|
11
|
+
const { containerStyles, containerClasses } = useGetPosterProperties(
|
|
12
|
+
imageSrc,
|
|
13
|
+
fallbackColor,
|
|
14
|
+
variant,
|
|
15
|
+
);
|
|
7
16
|
return (
|
|
8
17
|
<Container
|
|
9
18
|
className={containerClasses}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { ProductCardVariant } from '../types';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const DARK_OVERLAY_OPACITY = '60'; // ~38% opacity
|
|
4
|
+
const LIGHT_OVERLAY_OPACITY = 'CC'; // 80% opacity
|
|
5
|
+
|
|
6
|
+
export const useGetPosterProperties = (
|
|
7
|
+
imageSrc: string,
|
|
8
|
+
fallbackColor: string,
|
|
9
|
+
variant: ProductCardVariant = ProductCardVariant.DARK,
|
|
10
|
+
) => {
|
|
11
|
+
const defaultOverlayColor =
|
|
12
|
+
variant === ProductCardVariant.LIGHT
|
|
13
|
+
? `#FFFFFF${LIGHT_OVERLAY_OPACITY}`
|
|
14
|
+
: `#000000${DARK_OVERLAY_OPACITY}`;
|
|
15
|
+
// CSS variable allows external overrides (e.g. admin preview panel)
|
|
16
|
+
const overlayColor = `var(--envive-product-card-overlay, ${defaultOverlayColor})`;
|
|
5
17
|
const bgColor = fallbackColor || 'black';
|
|
6
18
|
const containerStyles: React.CSSProperties = {
|
|
7
19
|
background: imageSrc
|