@envive-ai/react-toolkit 0.1.1 → 0.1.2
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/AppliedFiltersScrollbar-BlcyhZkZ.cjs +53 -0
- package/dist/AppliedFiltersScrollbar-DFGzRemu.js +44 -0
- package/dist/ButtonBase-C1rsL9gO.js +60 -0
- package/dist/ButtonBase-a8uj6c2f.cjs +69 -0
- package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +41 -0
- package/dist/DynamicFiltersScrollbar-Dys6geP0.js +32 -0
- package/dist/Headline-L7w3BsBF.cjs +72 -0
- package/dist/Headline-ro_Nigw5.js +64 -0
- package/dist/ImageWithFallback-CfmkC58B.js +42 -0
- package/dist/ImageWithFallback-P3AjyL2Y.cjs +51 -0
- package/dist/ProductCard-Btg8tHGc.js +172 -0
- package/dist/ProductCard-CS6DZAwO.cjs +193 -0
- package/dist/ProductCardSkeleton-BPfp6IOp.js +38 -0
- package/dist/ProductCardSkeleton-BgvDlaty.cjs +46 -0
- package/dist/ProductGrid-B7QZfW-v.cjs +77 -0
- package/dist/ProductGrid-DB_Uq5F-.js +69 -0
- package/dist/SearchAutocomplete-C5FL82xC.js +51 -0
- package/dist/SearchAutocomplete-wr18dJ8L.cjs +62 -0
- package/dist/SearchFilter-D-2IdBKS.js +62 -0
- package/dist/SearchFilter-D0IzBlG5.cjs +70 -0
- package/dist/SearchFilterHeader-BQT0-ssS.js +37 -0
- package/dist/SearchFilterHeader-C3EklfoO.cjs +45 -0
- package/dist/SearchFilterItem-BodtWLoP.js +26 -0
- package/dist/SearchFilterItem-DmMkiqNC.cjs +34 -0
- package/dist/SearchInput-BrcAgcvI.js +89 -0
- package/dist/SearchInput-DSB9CwIq.cjs +106 -0
- package/dist/SparkleAnimation-BpLwrEqM.cjs +96 -0
- package/dist/SparkleAnimation-CXs58sFd.js +85 -0
- package/dist/Spinner-BZ-kTOpm.js +38 -0
- package/dist/Spinner-CfQ85Ajl.cjs +46 -0
- package/dist/Text-Bdv7F5-u.js +42 -0
- package/dist/Text-C04c4Z93.cjs +50 -0
- package/dist/TextInput-BO80ixsV.cjs +40 -0
- package/dist/TextInput-CEGWfdPC.js +31 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/colorsConfig-TCONYTQ7.cjs +38 -0
- package/dist/colorsConfig-l0ODUVhu.js +26 -0
- package/dist/common/ButtonBase/ButtonBase.cjs +5 -0
- package/dist/common/ButtonBase/ButtonBase.d.cts +35 -0
- package/dist/common/ButtonBase/ButtonBase.d.ts +35 -0
- package/dist/common/ButtonBase/ButtonBase.js +5 -0
- package/dist/common/Headline/Headline.cjs +4 -0
- package/dist/common/Headline/Headline.d.cts +21 -0
- package/dist/common/Headline/Headline.d.ts +21 -0
- package/dist/common/Headline/Headline.js +4 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.cjs +3 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.cts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.d.ts +26 -0
- package/dist/common/ImageWithFallback/ImageWithFallback.js +3 -0
- package/dist/common/ProductCard/ProductCard.cjs +11 -0
- package/dist/common/ProductCard/ProductCard.d.cts +91 -0
- package/dist/common/ProductCard/ProductCard.d.ts +91 -0
- package/dist/common/ProductCard/ProductCard.js +9 -0
- package/dist/common/ProductCard/ProductCardSkeleton.cjs +4 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.cts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.d.ts +12 -0
- package/dist/common/ProductCard/ProductCardSkeleton.js +4 -0
- package/dist/common/ProductGrid/ProductGrid.cjs +11 -0
- package/dist/common/ProductGrid/ProductGrid.d.cts +26 -0
- package/dist/common/ProductGrid/ProductGrid.d.ts +26 -0
- package/dist/common/ProductGrid/ProductGrid.js +11 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.cjs +3 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +15 -0
- package/dist/common/SparkleAnimation/SparkleAnimation.js +3 -0
- package/dist/common/Spinner/Spinner.cjs +3 -0
- package/dist/common/Spinner/Spinner.d.cts +11 -0
- package/dist/common/Spinner/Spinner.d.ts +11 -0
- package/dist/common/Spinner/Spinner.js +3 -0
- package/dist/common/SuggestionButton/SuggestionButton.cjs +188 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.cts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.d.ts +35 -0
- package/dist/common/SuggestionButton/SuggestionButton.js +180 -0
- package/dist/common/Text/Text.cjs +4 -0
- package/dist/common/Text/Text.d.cts +28 -0
- package/dist/common/Text/Text.d.ts +28 -0
- package/dist/common/Text/Text.js +4 -0
- package/dist/common/TextInput/TextInput.cjs +4 -0
- package/dist/common/TextInput/TextInput.d.cts +98 -0
- package/dist/common/TextInput/TextInput.d.ts +98 -0
- package/dist/common/TextInput/TextInput.js +4 -0
- package/dist/productCardVariants-C_QIZ-KF.js +45 -0
- package/dist/productCardVariants-Dd-wrJKP.cjs +69 -0
- package/dist/productGridVariants-CxCKx5Fq.js +20 -0
- package/dist/productGridVariants-DVzvjK9i.cjs +26 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +5 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +5 -0
- package/dist/search/SearchFilter/SearchFilter.cjs +7 -0
- package/dist/search/SearchFilter/SearchFilter.d.cts +18 -0
- package/dist/search/SearchFilter/SearchFilter.d.ts +18 -0
- package/dist/search/SearchFilter/SearchFilter.js +7 -0
- package/dist/search/SearchFilter/SearchFilterHeader.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.cts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.d.ts +12 -0
- package/dist/search/SearchFilter/SearchFilterHeader.js +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.cjs +5 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.cts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.d.ts +13 -0
- package/dist/search/SearchFilter/SearchFilterItem.js +5 -0
- package/dist/search/SearchInput/SearchInput.cjs +6 -0
- package/dist/search/SearchInput/SearchInput.d.cts +20 -0
- package/dist/search/SearchInput/SearchInput.d.ts +20 -0
- package/dist/search/SearchInput/SearchInput.js +6 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +3 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.cts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +13 -0
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +3 -0
- package/dist/search/SearchInputForm/SearchInputForm.cjs +38 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.cts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.d.ts +32 -0
- package/dist/search/SearchInputForm/SearchInputForm.js +36 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs +52 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +28 -0
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js +49 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +30 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +17 -0
- package/dist/search/SearchResultsStates/NoSearchResultsFound.js +26 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +66 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +41 -0
- package/dist/search/SearchResultsStates/SearchResultsGrid.js +62 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +49 -0
- package/dist/searchFilterSidebarVariants-GfFbQzGf.cjs +39 -0
- package/dist/searchFilterSidebarVariants-lJVVZT_2.js +34 -0
- package/dist/textVariantClasses-5t3OricK.js +101 -0
- package/dist/textVariantClasses-Bhf4VY5z.cjs +125 -0
- package/dist/types-53zIialA.d.ts +35 -0
- package/dist/types-B4BGZSlV.d.cts +4 -0
- package/dist/types-BQNqA5xL.d.ts +46 -0
- package/dist/types-BRLWwGMI.d.ts +4 -0
- package/dist/types-CImLkcNh.d.cts +46 -0
- package/dist/types-Cph97xkm.d.ts +6 -0
- package/dist/types-CpiJO5UH.d.ts +4 -0
- package/dist/types-DFetqNL2.d.ts +8 -0
- package/dist/types-DaSkJnT_.d.cts +8 -0
- package/dist/types-Dy4_w6Cf.d.cts +4 -0
- package/dist/types-TYhhwWZw.d.cts +6 -0
- package/dist/types-aa4flfRE.d.cts +35 -0
- package/package.json +8 -8
- package/src/components/common/ButtonBase/ButtonBase.tsx +2 -2
- package/src/components/common/ButtonBase/types.ts +2 -3
- package/dist/src/atoms/search/types.d.ts +0 -5
- package/dist/src/atoms/search/types.js +0 -1
- package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
- package/dist/src/components/common/ButtonBase/ButtonBase.js +0 -41
- package/dist/src/components/common/ButtonBase/types.d.ts +0 -24
- package/dist/src/components/common/ButtonBase/types.js +0 -6
- package/dist/src/components/common/Headline/Headline.d.ts +0 -10
- package/dist/src/components/common/Headline/Headline.js +0 -34
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
- package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
- package/dist/src/components/common/ProductCard/ProductCard.d.ts +0 -39
- package/dist/src/components/common/ProductCard/ProductCard.js +0 -84
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
- package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
- package/dist/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
- package/dist/src/components/common/ProductCard/productCardVariants.js +0 -50
- package/dist/src/components/common/ProductCard/types.d.ts +0 -39
- package/dist/src/components/common/ProductCard/types.js +0 -10
- package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
- package/dist/src/components/common/ProductGrid/ProductGrid.js +0 -13
- package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
- package/dist/src/components/common/ProductGrid/productGridVariants.js +0 -16
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
- package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
- package/dist/src/components/common/SparkleAnimation/types.d.ts +0 -6
- package/dist/src/components/common/SparkleAnimation/types.js +0 -7
- package/dist/src/components/common/Spinner/Spinner.d.ts +0 -5
- package/dist/src/components/common/Spinner/Spinner.js +0 -16
- package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
- package/dist/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
- package/dist/src/components/common/SuggestionButton/types.d.ts +0 -1
- package/dist/src/components/common/SuggestionButton/types.js +0 -1
- package/dist/src/components/common/Text/Text.d.ts +0 -12
- package/dist/src/components/common/Text/Text.js +0 -26
- package/dist/src/components/common/Text/textVariantClasses.d.ts +0 -171
- package/dist/src/components/common/Text/textVariantClasses.js +0 -103
- package/dist/src/components/common/Text/types.d.ts +0 -16
- package/dist/src/components/common/Text/types.js +0 -6
- package/dist/src/components/common/TextInput/TextInput.d.ts +0 -8
- package/dist/src/components/common/TextInput/TextInput.js +0 -25
- package/dist/src/components/models/colorsConfig.d.ts +0 -26
- package/dist/src/components/models/colorsConfig.js +0 -23
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
- package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
- package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
- package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilter.js +0 -24
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
- package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
- package/dist/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
- package/dist/src/components/search/SearchFilter/types.d.ts +0 -42
- package/dist/src/components/search/SearchFilter/types.js +0 -1
- package/dist/src/components/search/SearchInput/SearchInput.d.ts +0 -16
- package/dist/src/components/search/SearchInput/SearchInput.js +0 -38
- package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
- package/dist/src/components/search/SearchInput/searchInputVariants.js +0 -12
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
- package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
- package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
- package/dist/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
- package/dist/src/components/search/SearchInputForm/types.d.ts +0 -1
- package/dist/src/components/search/SearchInputForm/types.js +0 -1
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
- package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
- package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
- package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +0 -2
- package/dist/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
- package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
- package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
- package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
- package/dist/src/components/search/types.d.ts +0 -5
- package/dist/src/components/search/types.js +0 -6
- package/dist/src/components/test/types.d.ts +0 -3
- package/dist/src/components/test/types.js +0 -1
- package/dist/src/config/chatElementDisplayLocation.d.ts +0 -21
- package/dist/src/config/chatElementDisplayLocation.js +0 -23
- package/dist/src/index.d.ts +0 -45
- package/dist/src/index.js +0 -49
- package/dist/src/logging/logger.d.ts +0 -7
- package/dist/src/logging/logger.js +0 -16
- package/dist/src/types/external.d.ts +0 -21
- package/dist/src/types/external.js +0 -5
- package/dist/src/util/camelCase.d.ts +0 -65
- package/dist/src/util/camelCase.js +0 -2
- package/dist/src/util/camelCasedPropertiesDeep.d.ts +0 -53
- package/dist/src/util/camelCasedPropertiesDeep.js +0 -1
- package/dist/src/util/formatPrice.d.ts +0 -1
- package/dist/src/util/formatPrice.js +0 -11
- package/dist/src/util/internal.d.ts +0 -27
- package/dist/src/util/internal.js +0 -4
- package/dist/src/util/primitive.d.ts +0 -6
- package/dist/src/util/primitive.js +0 -2
- package/dist/src/util/splitWords.d.ts +0 -55
- package/dist/src/util/splitWords.js +0 -2
- package/dist/src/util/trim.d.ts +0 -24
- package/dist/src/util/trim.js +0 -2
- package/dist/src/util/unknownArray.d.ts +0 -25
- package/dist/src/util/unknownArray.js +0 -1
- package/src/index.ts +0 -59
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/components/common/Text/textVariantClasses.ts
|
|
3
|
+
const HeadlineVariantMap = {
|
|
4
|
+
t1: {
|
|
5
|
+
"spiffy-headline": true,
|
|
6
|
+
"spiffy-headline-1": true,
|
|
7
|
+
"spiffy-tw-text-[32px]": true,
|
|
8
|
+
"spiffy-tw-font-medium": true,
|
|
9
|
+
"spiffy-tw-leading-[124%]": true
|
|
10
|
+
},
|
|
11
|
+
t2: {
|
|
12
|
+
"spiffy-headline": true,
|
|
13
|
+
"spiffy-headline-1": true,
|
|
14
|
+
"spiffy-tw-text-[16px]": true,
|
|
15
|
+
"spiffy-tw-font-medium": true,
|
|
16
|
+
"spiffy-tw-leading-[124%]": true
|
|
17
|
+
},
|
|
18
|
+
t3: {
|
|
19
|
+
"spiffy-headline": true,
|
|
20
|
+
"spiffy-headline-1": true,
|
|
21
|
+
"spiffy-tw-text-[24px]": true,
|
|
22
|
+
"spiffy-tw-leading-[120%]": true
|
|
23
|
+
},
|
|
24
|
+
h1: {
|
|
25
|
+
"spiffy-headline": true,
|
|
26
|
+
"spiffy-headline-1": true,
|
|
27
|
+
"spiffy-tw-text-[20px]": true,
|
|
28
|
+
"spiffy-tw-font-normal": true,
|
|
29
|
+
"spiffy-tw-leading-[120%]": true
|
|
30
|
+
},
|
|
31
|
+
h2: {
|
|
32
|
+
"spiffy-headline": true,
|
|
33
|
+
"spiffy-headline-2": true,
|
|
34
|
+
"spiffy-tw-text-[16px]": true,
|
|
35
|
+
"spiffy-tw-font-normal": true,
|
|
36
|
+
"spiffy-tw-leading-[124%]": true
|
|
37
|
+
},
|
|
38
|
+
h3: {
|
|
39
|
+
"spiffy-headline": true,
|
|
40
|
+
"spiffy-headline-3": true,
|
|
41
|
+
"spiffy-tw-text-[15px]": true,
|
|
42
|
+
"spiffy-tw-font-medium": true,
|
|
43
|
+
"spiffy-tw-leading-[124%]": true
|
|
44
|
+
},
|
|
45
|
+
h4: {
|
|
46
|
+
"spiffy-headline": true,
|
|
47
|
+
"spiffy-headline-4": true,
|
|
48
|
+
"spiffy-tw-text-[14px]": true,
|
|
49
|
+
"spiffy-tw-font-medium": true,
|
|
50
|
+
"spiffy-tw-leading-[124%]": true
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const TextVariantMap = {
|
|
54
|
+
body1: {
|
|
55
|
+
"spiffy-body-text": true,
|
|
56
|
+
"spiffy-body-1": true,
|
|
57
|
+
"spiffy-tw-text-[20px]": true,
|
|
58
|
+
"spiffy-tw-font-normal": true,
|
|
59
|
+
"spiffy-tw-line-height-[120%]": true
|
|
60
|
+
},
|
|
61
|
+
body2: {
|
|
62
|
+
"spiffy-body-text": true,
|
|
63
|
+
"spiffy-body-2": true,
|
|
64
|
+
"spiffy-tw-text-[16px]": true,
|
|
65
|
+
"spiffy-tw-font-normal": true,
|
|
66
|
+
"spiffy-tw-line-height-[148%]": true
|
|
67
|
+
},
|
|
68
|
+
body3: {
|
|
69
|
+
"spiffy-body-text": true,
|
|
70
|
+
"spiffy-body-3": true,
|
|
71
|
+
"spiffy-tw-text-sm": true,
|
|
72
|
+
"spiffy-tw-font-normal": true,
|
|
73
|
+
"spiffy-tw-leading-[140%]": true
|
|
74
|
+
},
|
|
75
|
+
body4: {
|
|
76
|
+
"spiffy-body-text": true,
|
|
77
|
+
"spiffy-body-4": true,
|
|
78
|
+
"spiffy-tw-text-xs": true,
|
|
79
|
+
"spiffy-tw-font-medium": true,
|
|
80
|
+
"spiffy-tw-leading-[130%]": true
|
|
81
|
+
},
|
|
82
|
+
body5: {
|
|
83
|
+
"spiffy-body-text": true,
|
|
84
|
+
"spiffy-body-5": true,
|
|
85
|
+
"spiffy-tw-text-[10px]": true,
|
|
86
|
+
"spiffy-tw-font-normal": true
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const TextStyleVariantMap = {
|
|
90
|
+
...TextVariantMap,
|
|
91
|
+
...HeadlineVariantMap
|
|
92
|
+
};
|
|
93
|
+
const getVariantPlaceholderClassNames = (classes) => {
|
|
94
|
+
return Object.keys(classes).reduce((acc, key) => {
|
|
95
|
+
if (key.includes("spiffy-tw")) acc[`placeholder:${key}`] = classes[key];
|
|
96
|
+
else acc[`${key}-placeholder`] = classes[key];
|
|
97
|
+
return acc;
|
|
98
|
+
}, {});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
Object.defineProperty(exports, 'HeadlineVariantMap', {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return HeadlineVariantMap;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, 'TextStyleVariantMap', {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return TextStyleVariantMap;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, 'TextVariantMap', {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return TextVariantMap;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, 'getVariantPlaceholderClassNames', {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return getVariantPlaceholderClassNames;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/external.d.ts
|
|
2
|
+
|
|
3
|
+
interface SearchResponseProduct {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
price?: number;
|
|
8
|
+
currency?: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
brand?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
availability?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
responseId?: string;
|
|
15
|
+
originalPrice?: number;
|
|
16
|
+
salePrice?: number;
|
|
17
|
+
averageRating?: number;
|
|
18
|
+
numberReviews?: number;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/common/ProductCard/types.d.ts
|
|
23
|
+
|
|
24
|
+
type ProductGridVariant = 'standard' | 'square';
|
|
25
|
+
type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
26
|
+
type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
27
|
+
type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
28
|
+
interface ProductCardConfig {
|
|
29
|
+
variant: ProductCardVariant;
|
|
30
|
+
hoverVariant: ProductCardHoverVariant;
|
|
31
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
32
|
+
pricePrefix?: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant, SearchResponseProduct };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/search/SearchFilter/types.d.ts
|
|
4
|
+
type SearchFilterItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
value: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
};
|
|
10
|
+
type SearchFilter = {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
items: SearchFilterItem[];
|
|
14
|
+
};
|
|
15
|
+
type SelectFilterItem = (filterItem: SearchFilterItem) => void;
|
|
16
|
+
interface SearchFilterItemProps {
|
|
17
|
+
filterItem: SearchFilterItem;
|
|
18
|
+
onSelectFilterItem: SelectFilterItem;
|
|
19
|
+
radioButtonFillColor: string;
|
|
20
|
+
radioButtonHoverColor: string;
|
|
21
|
+
radioButtonUncheckedBorderColor: string;
|
|
22
|
+
}
|
|
23
|
+
interface SearchFilterHeaderProps {
|
|
24
|
+
closeModal: () => void;
|
|
25
|
+
productCount: number;
|
|
26
|
+
headerClassName: string;
|
|
27
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
28
|
+
}
|
|
29
|
+
interface SearchFilterProps {
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
32
|
+
filters: SearchFilter[];
|
|
33
|
+
productCount: number;
|
|
34
|
+
selectFilterItem: SelectFilterItem;
|
|
35
|
+
clearAllFilters: () => void;
|
|
36
|
+
applyFiltersUnchangedClasses: string;
|
|
37
|
+
applyFiltersChangedClasses: string;
|
|
38
|
+
filterButtonText: string;
|
|
39
|
+
radioButtonFillColor: string;
|
|
40
|
+
radioButtonHoverColor: string;
|
|
41
|
+
radioButtonUncheckedBorderColor: string;
|
|
42
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
43
|
+
headerContent: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SearchFilter, SearchFilterHeaderProps, SearchFilterItemProps, SearchFilterProps, SelectFilterItem };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/search/SearchFilter/types.d.ts
|
|
4
|
+
type SearchFilterItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
value: string;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
};
|
|
10
|
+
type SearchFilter = {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
items: SearchFilterItem[];
|
|
14
|
+
};
|
|
15
|
+
type SelectFilterItem = (filterItem: SearchFilterItem) => void;
|
|
16
|
+
interface SearchFilterItemProps {
|
|
17
|
+
filterItem: SearchFilterItem;
|
|
18
|
+
onSelectFilterItem: SelectFilterItem;
|
|
19
|
+
radioButtonFillColor: string;
|
|
20
|
+
radioButtonHoverColor: string;
|
|
21
|
+
radioButtonUncheckedBorderColor: string;
|
|
22
|
+
}
|
|
23
|
+
interface SearchFilterHeaderProps {
|
|
24
|
+
closeModal: () => void;
|
|
25
|
+
productCount: number;
|
|
26
|
+
headerClassName: string;
|
|
27
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
28
|
+
}
|
|
29
|
+
interface SearchFilterProps {
|
|
30
|
+
isOpen: boolean;
|
|
31
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
32
|
+
filters: SearchFilter[];
|
|
33
|
+
productCount: number;
|
|
34
|
+
selectFilterItem: SelectFilterItem;
|
|
35
|
+
clearAllFilters: () => void;
|
|
36
|
+
applyFiltersUnchangedClasses: string;
|
|
37
|
+
applyFiltersChangedClasses: string;
|
|
38
|
+
filterButtonText: string;
|
|
39
|
+
radioButtonFillColor: string;
|
|
40
|
+
radioButtonHoverColor: string;
|
|
41
|
+
radioButtonUncheckedBorderColor: string;
|
|
42
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
43
|
+
headerContent: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SearchFilter, SearchFilterHeaderProps, SearchFilterItemProps, SearchFilterProps, SelectFilterItem };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/types/external.d.ts
|
|
2
|
+
|
|
3
|
+
interface SearchResponseProduct {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
price?: number;
|
|
8
|
+
currency?: string;
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
brand?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
availability?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
responseId?: string;
|
|
15
|
+
originalPrice?: number;
|
|
16
|
+
salePrice?: number;
|
|
17
|
+
averageRating?: number;
|
|
18
|
+
numberReviews?: number;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/common/ProductCard/types.d.ts
|
|
23
|
+
|
|
24
|
+
type ProductGridVariant = 'standard' | 'square';
|
|
25
|
+
type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
26
|
+
type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
27
|
+
type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
28
|
+
interface ProductCardConfig {
|
|
29
|
+
variant: ProductCardVariant;
|
|
30
|
+
hoverVariant: ProductCardHoverVariant;
|
|
31
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
32
|
+
pricePrefix?: string;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant, SearchResponseProduct };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -11,25 +11,25 @@
|
|
|
11
11
|
"author": "Envive AI",
|
|
12
12
|
"license": "UNLICENSED",
|
|
13
13
|
"type": "module",
|
|
14
|
-
"main": "dist/
|
|
15
|
-
"module": "dist/
|
|
16
|
-
"types": "dist/
|
|
14
|
+
"main": "dist/index.cjs",
|
|
15
|
+
"module": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
19
|
"src",
|
|
20
20
|
"!**/*.tsbuildinfo"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "
|
|
23
|
+
"build": "tsdown",
|
|
24
24
|
"prepublish": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@envive-ai/react-icons": "0.1.0",
|
|
27
28
|
"classnames": "^2.5.1",
|
|
28
29
|
"framer-motion": "^12.23.12",
|
|
29
30
|
"react-icons": "^5.0.1",
|
|
30
31
|
"react-indiana-drag-scroll": "^3.0.3-alpha",
|
|
31
|
-
"vite-plugin-svgr": "^4.5.0"
|
|
32
|
-
"@envive-ai/react-icons": "0.1.0"
|
|
32
|
+
"vite-plugin-svgr": "^4.5.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "^18.3.1",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@svgr/cli": "^8.1.0",
|
|
40
40
|
"copyfiles": "^2.4.1",
|
|
41
|
-
"
|
|
41
|
+
"tsdown": "^0.14.2",
|
|
42
42
|
"typescript": "~5.8.3"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { createElement, useEffect, useRef } from 'react';
|
|
3
|
-
import { ButtonBaseOverrides,
|
|
4
|
-
import { Text } from '
|
|
3
|
+
import { ButtonBaseOverrides, ButtonBaseProps } from './types';
|
|
4
|
+
import { Text } from '../Text/Text';
|
|
5
5
|
|
|
6
6
|
export const ButtonBase = ({
|
|
7
7
|
type = 'button',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ButtonHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import { TestProps } from 'src/components/test/types';
|
|
3
3
|
|
|
4
4
|
export interface ButtonHoverStyles extends CSSProperties {
|
|
5
5
|
backgroundColor?: string;
|
|
@@ -17,7 +17,6 @@ export interface ButtonBaseProps extends TestProps {
|
|
|
17
17
|
iconClass?: string;
|
|
18
18
|
onClick?: () => void;
|
|
19
19
|
disablePadding?: boolean;
|
|
20
|
-
dataTestId?: string;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export enum ButtonBaseOverrides {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { createElement, useEffect, useRef } from 'react';
|
|
4
|
-
import { ButtonBaseOverrides } from './types';
|
|
5
|
-
import { Text } from '../../../components/common/Text/Text';
|
|
6
|
-
export const ButtonBase = ({ type = 'button', isDisabled = false, dataAttributes, buttonClass, text, textClass, icon, iconClass = 'spiffy-tw-w-[21px] spiffy-tw-h-[21px]', dataTestId, onClick, disablePadding = false, }) => {
|
|
7
|
-
const buttonRef = useRef(null);
|
|
8
|
-
const buttonClassName = classNames({
|
|
9
|
-
[ButtonBaseOverrides.BUTTON]: true,
|
|
10
|
-
'spiffy-tw-flex': true,
|
|
11
|
-
'spiffy-tw-min-h-[36px]': true,
|
|
12
|
-
'spiffy-tw-cursor-pointer': true,
|
|
13
|
-
'spiffy-tw-items-center': true,
|
|
14
|
-
'spiffy-tw-gap-2': true,
|
|
15
|
-
'spiffy-tw-px-4': !disablePadding,
|
|
16
|
-
'spiffy-tw-transition-colors': true,
|
|
17
|
-
'spiffy-tw-opacity-40': isDisabled,
|
|
18
|
-
'spiffy-tw-cursor-not-allowed': isDisabled,
|
|
19
|
-
[`${buttonClass}`]: buttonClass != null,
|
|
20
|
-
});
|
|
21
|
-
const textClassName = classNames({
|
|
22
|
-
[ButtonBaseOverrides.BUTTON_TEXT]: true,
|
|
23
|
-
'spiffy-tw-whitespace-nowrap': true,
|
|
24
|
-
[`${textClass}`]: textClass != null,
|
|
25
|
-
});
|
|
26
|
-
const iconClassName = classNames({
|
|
27
|
-
[ButtonBaseOverrides.BUTTON_ICON]: true,
|
|
28
|
-
[`${iconClass}`]: iconClass != null,
|
|
29
|
-
});
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (dataAttributes && buttonRef.current) {
|
|
32
|
-
Object.entries(dataAttributes).forEach(([key, value]) => {
|
|
33
|
-
buttonRef.current?.setAttribute(key, value);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}, [dataAttributes]);
|
|
37
|
-
return (_jsxs("button", { type: type, ref: buttonRef, className: buttonClassName, disabled: isDisabled, "data-testid": dataTestId, onClick: onClick, children: [icon &&
|
|
38
|
-
createElement(icon, {
|
|
39
|
-
className: iconClassName,
|
|
40
|
-
}), _jsx(Text, { className: textClassName, children: text })] }));
|
|
41
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
import type { TestProps } from '../../../components/test/types';
|
|
3
|
-
export interface ButtonHoverStyles extends CSSProperties {
|
|
4
|
-
backgroundColor?: string;
|
|
5
|
-
color?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ButtonBaseProps extends TestProps {
|
|
8
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
9
|
-
isDisabled?: boolean;
|
|
10
|
-
dataAttributes?: Record<string, string>;
|
|
11
|
-
buttonClass?: string;
|
|
12
|
-
text: string;
|
|
13
|
-
textClass?: string;
|
|
14
|
-
icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
15
|
-
iconClass?: string;
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
disablePadding?: boolean;
|
|
18
|
-
dataTestId?: string;
|
|
19
|
-
}
|
|
20
|
-
export declare enum ButtonBaseOverrides {
|
|
21
|
-
BUTTON = "spiffy-button-base-button",
|
|
22
|
-
BUTTON_TEXT = "spiffy-button-base-button-text",
|
|
23
|
-
BUTTON_ICON = "spiffy-button-base-button-icon"
|
|
24
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export var ButtonBaseOverrides;
|
|
2
|
-
(function (ButtonBaseOverrides) {
|
|
3
|
-
ButtonBaseOverrides["BUTTON"] = "spiffy-button-base-button";
|
|
4
|
-
ButtonBaseOverrides["BUTTON_TEXT"] = "spiffy-button-base-button-text";
|
|
5
|
-
ButtonBaseOverrides["BUTTON_ICON"] = "spiffy-button-base-button-icon";
|
|
6
|
-
})(ButtonBaseOverrides || (ButtonBaseOverrides = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type HeadlineVariant = 't1' | 't2' | 't3' | 'h1' | 'h2' | 'h3' | 'h4';
|
|
2
|
-
export type HeadlineProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
variant?: HeadlineVariant;
|
|
7
|
-
testId?: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const Headline: ({ children, className, style, testId, variant }: HeadlineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { HeadlineVariantMap } from '../Text/textVariantClasses';
|
|
4
|
-
export const Headline = ({ children, className, style, testId, variant = 'h1' }) => {
|
|
5
|
-
const variantClassNames = variant ? HeadlineVariantMap[variant] : {};
|
|
6
|
-
const textClassNames = classNames(className, variantClassNames, {
|
|
7
|
-
'spiffy-tw-font-[Poppins,sans-serif]': true,
|
|
8
|
-
});
|
|
9
|
-
const T1 = () => (_jsx("h1", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
10
|
-
const T2 = () => (_jsx("h2", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
11
|
-
const T3 = () => (_jsx("h3", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
12
|
-
const H1 = () => (_jsx("h1", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
13
|
-
const H2 = () => (_jsx("h2", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
14
|
-
const H3 = () => (_jsx("h3", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
15
|
-
const H4 = () => (_jsx("h4", { "data-testid": testId, className: textClassNames, style: style, children: children }));
|
|
16
|
-
switch (variant) {
|
|
17
|
-
case 't1':
|
|
18
|
-
return T1();
|
|
19
|
-
case 't2':
|
|
20
|
-
return T2();
|
|
21
|
-
case 't3':
|
|
22
|
-
return T3();
|
|
23
|
-
case 'h1':
|
|
24
|
-
return H1();
|
|
25
|
-
case 'h2':
|
|
26
|
-
return H2();
|
|
27
|
-
case 'h3':
|
|
28
|
-
return H3();
|
|
29
|
-
case 'h4':
|
|
30
|
-
return H4();
|
|
31
|
-
default:
|
|
32
|
-
throw new Error(`Invalid variant: ${variant}`);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ImageWithFallbackProps {
|
|
3
|
-
src: string | undefined;
|
|
4
|
-
alt: string;
|
|
5
|
-
fallbackClassnames?: string;
|
|
6
|
-
fallback: React.ReactNode;
|
|
7
|
-
dataTestId?: string;
|
|
8
|
-
imageClassnames: string;
|
|
9
|
-
onLoad?: () => void;
|
|
10
|
-
onError?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const ImageWithFallback: ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError, }: ImageWithFallbackProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
export const ImageWithFallback = ({ src, alt, dataTestId, fallbackClassnames, fallback, imageClassnames, onLoad, onError, }) => {
|
|
5
|
-
const [isLoaded, setIsLoaded] = useState(false);
|
|
6
|
-
const [isError, setIsError] = useState(false);
|
|
7
|
-
const imageExtraClassnames = classNames(imageClassnames, {
|
|
8
|
-
'spiffy-tw-block': isLoaded,
|
|
9
|
-
'spiffy-tw-hidden': !isLoaded,
|
|
10
|
-
});
|
|
11
|
-
const fallbackMergedClassNames = classNames({
|
|
12
|
-
'spiffy-tw-flex': true,
|
|
13
|
-
'spiffy-tw-flex-col': true,
|
|
14
|
-
'spiffy-tw-items-center': true,
|
|
15
|
-
}, fallbackClassnames);
|
|
16
|
-
if (isError) {
|
|
17
|
-
return _jsx("div", { className: fallbackMergedClassNames, children: fallback });
|
|
18
|
-
}
|
|
19
|
-
return (_jsxs(_Fragment, { children: [!isLoaded && _jsx("div", { className: fallbackMergedClassNames, children: fallback }), _jsx("img", { src: src, className: imageExtraClassnames, "data-testid": dataTestId, alt: alt, onLoad: () => {
|
|
20
|
-
setIsLoaded(true);
|
|
21
|
-
onLoad?.();
|
|
22
|
-
}, onError: () => {
|
|
23
|
-
setIsError(true);
|
|
24
|
-
onError?.();
|
|
25
|
-
} })] }));
|
|
26
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant } from './types';
|
|
2
|
-
import type { TestProps } from '../../../components/test/types';
|
|
3
|
-
import type { ChatElementDisplayLocation } from '../../../config/chatElementDisplayLocation';
|
|
4
|
-
interface RatingSummaryProps {
|
|
5
|
-
stars: number;
|
|
6
|
-
reviewCount: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const RatingSummary: ({ stars, reviewCount, className }: RatingSummaryProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
interface PriceSectionProps {
|
|
11
|
-
originalPrice?: string;
|
|
12
|
-
salePrice?: string;
|
|
13
|
-
pricePrefix?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare const PriceSection: ({ originalPrice, salePrice, pricePrefix }: PriceSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
interface ProductCardProps extends TestProps {
|
|
17
|
-
productCardConfig?: ProductCardConfig;
|
|
18
|
-
merchantShortName: string;
|
|
19
|
-
title: string;
|
|
20
|
-
url?: string;
|
|
21
|
-
searchResponseId?: string;
|
|
22
|
-
productResponseId?: string;
|
|
23
|
-
cardDisplayLocation: ChatElementDisplayLocation.IN_CHAT | ChatElementDisplayLocation.PRODUCT_GRID;
|
|
24
|
-
imageUrl?: string;
|
|
25
|
-
originalPrice?: number;
|
|
26
|
-
averageRating?: number;
|
|
27
|
-
numberReviews?: number;
|
|
28
|
-
salePrice?: number;
|
|
29
|
-
variant?: ProductCardVariant;
|
|
30
|
-
hoverVariant?: ProductCardHoverVariant;
|
|
31
|
-
layoutVariant?: ProductCardLayoutVariant;
|
|
32
|
-
zoomOnHover?: boolean;
|
|
33
|
-
aspectRatio?: '3:4' | 'square' | 'none';
|
|
34
|
-
clickPosition?: number | null;
|
|
35
|
-
growWithContainer?: boolean;
|
|
36
|
-
handleClick: (clickedUrl: string) => void;
|
|
37
|
-
}
|
|
38
|
-
export declare const ProductCard: ({ productCardConfig, merchantShortName, imageUrl, title, url, originalPrice, averageRating, numberReviews, salePrice, variant, hoverVariant, dataTestId, layoutVariant, zoomOnHover, aspectRatio, growWithContainer, handleClick, }: ProductCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
export {};
|