@envive-ai/react-toolkit 0.1.4 → 0.1.6
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/Accordion/index.cjs +84 -0
- package/dist/Accordion/index.d.cts +13 -0
- package/dist/Accordion/index.d.ts +13 -0
- package/dist/Accordion/index.js +77 -0
- package/dist/ButtonBase/index.cjs +7 -0
- package/dist/ButtonBase/index.d.cts +43 -0
- package/dist/ButtonBase/index.d.ts +43 -0
- package/dist/ButtonBase/index.js +6 -0
- package/dist/{ButtonBase-C1rsL9gO.js → ButtonBase-BIAu5fIG.js} +5 -5
- package/dist/ButtonBase-BRfuPPzN.js +1 -0
- package/dist/ButtonBase-BleAVeo-.cjs +0 -0
- package/dist/{ButtonBase-a8uj6c2f.cjs → ButtonBase-DcyxOe2v.cjs} +11 -5
- package/dist/{AppliedFiltersScrollbar-BlcyhZkZ.cjs → DynamicFiltersScrollbar-BTopFhyl.cjs} +34 -2
- package/dist/{AppliedFiltersScrollbar-DFGzRemu.js → DynamicFiltersScrollbar-BmPTqym5.js} +29 -3
- package/dist/FilterScrollbar/index.cjs +6 -0
- package/dist/FilterScrollbar/index.d.cts +47 -0
- package/dist/FilterScrollbar/index.d.ts +47 -0
- package/dist/FilterScrollbar/index.js +5 -0
- package/dist/Headline/index.cjs +4 -0
- package/dist/{common/Headline/Headline.d.cts → Headline/index.d.cts} +3 -3
- package/dist/{common/Headline/Headline.d.ts → Headline/index.d.ts} +3 -3
- package/dist/Headline/index.js +4 -0
- package/dist/{Headline-8on6ZB9e.js → Headline-XpaAeTSR.js} +2 -2
- package/dist/{Headline-CcWn0w-a.cjs → Headline-iP_MckEO.cjs} +2 -2
- package/dist/ImageWithFallback/index.cjs +3 -0
- package/dist/{common/ImageWithFallback/ImageWithFallback.d.ts → ImageWithFallback/index.d.cts} +3 -3
- package/dist/{common/ImageWithFallback/ImageWithFallback.d.cts → ImageWithFallback/index.d.ts} +2 -2
- package/dist/ImageWithFallback/index.js +3 -0
- package/dist/{ImageWithFallback-ioeMFrTf.cjs → ImageWithFallback-1LqhQK1q.cjs} +3 -3
- package/dist/{ImageWithFallback-gN5HDS9L.js → ImageWithFallback-Ckwsmd8P.js} +2 -2
- package/dist/ProductCard/index.cjs +17 -0
- package/dist/ProductCard/index.d.cts +3 -0
- package/dist/ProductCard/index.d.ts +3 -0
- package/dist/ProductCard/index.js +8 -0
- package/dist/{ProductCard-C7WUShhN.cjs → ProductCard-DZZKutY-.cjs} +138 -12
- package/dist/{ProductCard-B5wnOeR9.js → ProductCard-SF8-lXlT.js} +92 -9
- package/dist/ProductGrid/index.cjs +10 -0
- package/dist/ProductGrid/index.d.cts +36 -0
- package/dist/ProductGrid/index.d.ts +36 -0
- package/dist/ProductGrid/index.js +9 -0
- package/dist/{ProductGrid-DZgwGPSQ.cjs → ProductGrid-BSSmPr7K.cjs} +56 -30
- package/dist/{ProductGrid-wnSc9bXT.js → ProductGrid-DTUhH219.js} +50 -30
- package/dist/SearchAutocomplete/index.cjs +3 -0
- package/dist/{search/SearchInputAutocomplete/SearchAutocomplete.d.cts → SearchAutocomplete/index.d.cts} +1 -1
- package/dist/{search/SearchInputAutocomplete/SearchAutocomplete.d.ts → SearchAutocomplete/index.d.ts} +1 -1
- package/dist/SearchAutocomplete/index.js +3 -0
- package/dist/{SearchAutocomplete-B8mO03Rr.js → SearchAutocomplete-BPjlo6qq.js} +4 -4
- package/dist/{SearchAutocomplete-BrF2SMoZ.cjs → SearchAutocomplete-BzaEXmRQ.cjs} +8 -8
- package/dist/SearchFilter/index.cjs +8 -0
- package/dist/SearchFilter/index.d.cts +2 -0
- package/dist/SearchFilter/index.d.ts +2 -0
- package/dist/SearchFilter/index.js +6 -0
- package/dist/SearchFilter-B15tybnV.cjs +134 -0
- package/dist/SearchFilter-D427M2UE.js +114 -0
- package/dist/SearchInput/index.cjs +7 -0
- package/dist/SearchInput/index.d.cts +33 -0
- package/dist/SearchInput/index.d.ts +33 -0
- package/dist/SearchInput/index.js +6 -0
- package/dist/{SearchInput-CzVUsUSb.js → SearchInput-C0wB4hSV.js} +8 -8
- package/dist/{SearchInput-mLPisqFO.cjs → SearchInput-D6UW79wT.cjs} +12 -12
- package/dist/{search/SearchInputForm/SearchInputForm.cjs → SearchInputForm/index.cjs} +9 -8
- package/dist/SearchInputForm/index.d.cts +2 -0
- package/dist/SearchInputForm/index.d.ts +2 -0
- package/dist/{search/SearchInputForm/SearchInputForm.js → SearchInputForm/index.js} +8 -7
- package/dist/{search/SearchResultsFilterSidebar/SearchResultsFilter.cjs → SearchResultsFilterSidebar/index.cjs} +15 -12
- package/dist/SearchResultsFilterSidebar/index.d.cts +3 -0
- package/dist/SearchResultsFilterSidebar/index.d.ts +3 -0
- package/dist/{search/SearchResultsFilterSidebar/SearchResultsFilter.js → SearchResultsFilterSidebar/index.js} +11 -10
- package/dist/SearchResultsStates/index.cjs +126 -0
- package/dist/SearchResultsStates/index.d.cts +73 -0
- package/dist/SearchResultsStates/index.d.ts +73 -0
- package/dist/SearchResultsStates/index.js +118 -0
- package/dist/SparkleAnimation/index.cjs +4 -0
- package/dist/SparkleAnimation/index.d.cts +23 -0
- package/dist/SparkleAnimation/index.d.ts +23 -0
- package/dist/SparkleAnimation/index.js +3 -0
- package/dist/{SparkleAnimation-Qs17S1rn.js → SparkleAnimation-BdOjC8l-.js} +5 -5
- package/dist/{SparkleAnimation-Ba5G4MIQ.cjs → SparkleAnimation-BhyeL26m.cjs} +12 -6
- package/dist/Spinner/index.cjs +3 -0
- package/dist/Spinner/index.d.cts +11 -0
- package/dist/Spinner/index.d.ts +11 -0
- package/dist/Spinner/index.js +3 -0
- package/dist/{Spinner-BZ-kTOpm.js → Spinner-BgGihEfJ.js} +1 -1
- package/dist/{Spinner-CfQ85Ajl.cjs → Spinner-DzdIkS6t.cjs} +1 -1
- package/dist/{common/SuggestionButton/SuggestionButton.cjs → SuggestionButton/index.cjs} +5 -5
- package/dist/{common/SuggestionButton/SuggestionButton.d.cts → SuggestionButton/index.d.cts} +6 -6
- package/dist/{common/SuggestionButton/SuggestionButton.d.ts → SuggestionButton/index.d.ts} +6 -6
- package/dist/{common/SuggestionButton/SuggestionButton.js → SuggestionButton/index.js} +4 -4
- package/dist/Text/index.cjs +10 -0
- package/dist/Text/index.d.cts +42 -0
- package/dist/Text/index.d.ts +42 -0
- package/dist/Text/index.js +5 -0
- package/dist/{Text-Bdv7F5-u.js → Text-BMg3d10t.js} +2 -2
- package/dist/Text-CV9pv8ds.js +10 -0
- package/dist/{Text-C04c4Z93.cjs → Text-CgOYTs8D.cjs} +2 -2
- package/dist/Text-DDT3sqY1.cjs +16 -0
- package/dist/TextInput/index.cjs +4 -0
- package/dist/TextInput/index.d.cts +12 -0
- package/dist/TextInput/index.d.ts +12 -0
- package/dist/TextInput/index.js +4 -0
- package/dist/{TextInput-BO80ixsV.cjs → TextInput-C6fF9cSB.cjs} +4 -4
- package/dist/{TextInput-CEGWfdPC.js → TextInput-CRMqBW3X.js} +3 -3
- package/dist/{colorsConfig-BKBZfFq1.js → colorsConfig-BQlaCfxi.js} +1 -1
- package/dist/{colorsConfig-vunsVTFC.cjs → colorsConfig-DCvy_dV4.cjs} +1 -1
- package/dist/index-B0oln9VD.d.ts +58 -0
- package/dist/index-B125udRj.d.cts +78 -0
- package/dist/{search/SearchInputForm/SearchInputForm.d.cts → index-BHNzU-Pc.d.ts} +10 -6
- package/dist/{search/SearchInputForm/SearchInputForm.d.ts → index-BNCrvswP.d.cts} +10 -6
- package/dist/index-CQlBDGTL.d.cts +58 -0
- package/dist/index-CcnuEYQN.d.ts +379 -0
- package/dist/index-DMXTg_9L.d.ts +78 -0
- package/dist/index-wYn2mEDm.d.cts +379 -0
- package/dist/{searchFilterSidebarVariants-eoyfoWA8.js → searchFilterSidebarVariants-BWQyiKwS.js} +2 -2
- package/dist/{searchFilterSidebarVariants-L1rn5Ift.cjs → searchFilterSidebarVariants-D08jyA7U.cjs} +2 -2
- package/dist/{textVariantClasses-Bhf4VY5z.cjs → textVariantClasses-BnV4wXaw.cjs} +1 -1
- package/dist/textVariantClasses-C8OCWZAw.d.ts +174 -0
- package/dist/textVariantClasses-Cdg-UUHi.d.cts +174 -0
- package/dist/{textVariantClasses-5t3OricK.js → textVariantClasses-CnjwO2Fv.js} +1 -1
- package/dist/types-BQYpWDJ4.d.cts +6 -0
- package/dist/types-BruEHw-X.d.ts +6 -0
- package/package.json +62 -84
- package/src/components/Accordion/Accordion.tsx +90 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +70 -0
- package/src/components/ButtonBase/index.ts +2 -0
- package/src/components/{common/ButtonBase → ButtonBase}/types.ts +1 -1
- package/src/components/{search/FilterScrollbar → DynamicFiltersScrollbar}/DynamicFiltersScrollbar.tsx +1 -1
- package/src/components/{search/FilterScrollbar → FilterScrollbar}/AppliedFiltersScrollbar.tsx +1 -1
- package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +52 -0
- package/src/components/FilterScrollbar/index.ts +2 -0
- package/src/components/Headline/index.ts +1 -0
- package/src/components/ImageWithFallback/index.ts +1 -0
- package/src/components/{common/ProductCard → ProductCard}/ProductCard.tsx +34 -17
- package/src/components/ProductCard/index.ts +4 -0
- package/src/components/{common/ProductCard → ProductCard}/types.ts +1 -1
- package/src/components/ProductGrid/ProductGrid.tsx +73 -0
- package/src/components/ProductGrid/index.ts +2 -0
- package/src/components/{search/SearchInputAutocomplete → SearchAutocomplete}/SearchAutocomplete.tsx +1 -1
- package/src/components/SearchAutocomplete/index.ts +1 -0
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilter.tsx +2 -2
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilterHeader.tsx +1 -1
- package/src/components/{search/SearchFilter → SearchFilter}/SearchFilterItem.tsx +1 -1
- package/src/components/SearchFilter/index.ts +4 -0
- package/src/components/{search/SearchInput → SearchInput}/SearchInput.tsx +6 -6
- package/src/components/SearchInput/index.ts +2 -0
- package/src/components/{search/SearchInput → SearchInput}/searchInputVariants.ts +5 -5
- package/src/components/{search/SearchInputForm → SearchInputForm}/SearchInputForm.tsx +6 -4
- package/src/components/SearchInputForm/index.ts +2 -0
- package/src/components/SearchResultsContent/SearchResultsContent.tsx +87 -0
- package/src/components/SearchResultsContent/utils.ts +28 -0
- package/src/components/{search/SearchResultsFilterSidebar → SearchResultsFilterSidebar}/SearchResultsFilter.tsx +5 -6
- package/src/components/SearchResultsFilterSidebar/index.ts +3 -0
- package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +58 -0
- package/src/components/SearchResultsFilterSidebar/types.ts +15 -0
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/NoSearchResultsFound.tsx +2 -2
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/SearchResultsGrid.tsx +14 -12
- package/src/components/{search/SearchResultsStates → SearchResultsStates}/SearchResultsLoadingGrid.tsx +4 -5
- package/src/components/SearchResultsStates/index.ts +3 -0
- package/src/components/SparkleAnimation/index.ts +2 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/SuggestionButton/index.ts +2 -0
- package/src/components/Text/index.ts +3 -0
- package/src/components/TextInput/index.ts +1 -0
- package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +0 -41
- package/dist/DynamicFiltersScrollbar-Dys6geP0.js +0 -32
- package/dist/ProductCardSkeleton-BPfp6IOp.js +0 -38
- package/dist/ProductCardSkeleton-BgvDlaty.cjs +0 -46
- package/dist/SearchFilter-D-2IdBKS.js +0 -62
- package/dist/SearchFilter-D0IzBlG5.cjs +0 -70
- package/dist/SearchFilterHeader-BQT0-ssS.js +0 -37
- package/dist/SearchFilterHeader-C3EklfoO.cjs +0 -45
- package/dist/SearchFilterItem-BodtWLoP.js +0 -26
- package/dist/SearchFilterItem-DmMkiqNC.cjs +0 -34
- package/dist/common/ButtonBase/ButtonBase.cjs +0 -5
- package/dist/common/ButtonBase/ButtonBase.d.cts +0 -35
- package/dist/common/ButtonBase/ButtonBase.d.ts +0 -35
- package/dist/common/ButtonBase/ButtonBase.js +0 -5
- package/dist/common/Headline/Headline.cjs +0 -4
- package/dist/common/Headline/Headline.js +0 -4
- package/dist/common/ImageWithFallback/ImageWithFallback.cjs +0 -3
- package/dist/common/ImageWithFallback/ImageWithFallback.js +0 -3
- package/dist/common/ProductCard/ProductCard.cjs +0 -11
- package/dist/common/ProductCard/ProductCard.d.cts +0 -91
- package/dist/common/ProductCard/ProductCard.d.ts +0 -91
- package/dist/common/ProductCard/ProductCard.js +0 -9
- package/dist/common/ProductCard/ProductCardSkeleton.cjs +0 -4
- package/dist/common/ProductCard/ProductCardSkeleton.d.cts +0 -12
- package/dist/common/ProductCard/ProductCardSkeleton.d.ts +0 -12
- package/dist/common/ProductCard/ProductCardSkeleton.js +0 -4
- package/dist/common/ProductGrid/ProductGrid.cjs +0 -11
- package/dist/common/ProductGrid/ProductGrid.d.cts +0 -26
- package/dist/common/ProductGrid/ProductGrid.d.ts +0 -26
- package/dist/common/ProductGrid/ProductGrid.js +0 -11
- package/dist/common/SparkleAnimation/SparkleAnimation.cjs +0 -3
- package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +0 -15
- package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +0 -15
- package/dist/common/SparkleAnimation/SparkleAnimation.js +0 -3
- package/dist/common/Spinner/Spinner.cjs +0 -3
- package/dist/common/Spinner/Spinner.d.cts +0 -11
- package/dist/common/Spinner/Spinner.d.ts +0 -11
- package/dist/common/Spinner/Spinner.js +0 -3
- package/dist/common/Text/Text.cjs +0 -4
- package/dist/common/Text/Text.d.cts +0 -28
- package/dist/common/Text/Text.d.ts +0 -28
- package/dist/common/Text/Text.js +0 -4
- package/dist/common/TextInput/TextInput.cjs +0 -4
- package/dist/common/TextInput/TextInput.d.cts +0 -98
- package/dist/common/TextInput/TextInput.d.ts +0 -98
- package/dist/common/TextInput/TextInput.js +0 -4
- package/dist/productCardVariants-C_QIZ-KF.js +0 -45
- package/dist/productCardVariants-Dd-wrJKP.cjs +0 -69
- package/dist/productGridVariants-BNX4YlRK.js +0 -20
- package/dist/productGridVariants-CsNV0ACt.cjs +0 -26
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +0 -5
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +0 -22
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -22
- package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -5
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +0 -5
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +0 -28
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -28
- package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -5
- package/dist/search/SearchFilter/SearchFilter.cjs +0 -7
- package/dist/search/SearchFilter/SearchFilter.d.cts +0 -18
- package/dist/search/SearchFilter/SearchFilter.d.ts +0 -18
- package/dist/search/SearchFilter/SearchFilter.js +0 -7
- package/dist/search/SearchFilter/SearchFilterHeader.cjs +0 -5
- package/dist/search/SearchFilter/SearchFilterHeader.d.cts +0 -12
- package/dist/search/SearchFilter/SearchFilterHeader.d.ts +0 -12
- package/dist/search/SearchFilter/SearchFilterHeader.js +0 -5
- package/dist/search/SearchFilter/SearchFilterItem.cjs +0 -5
- package/dist/search/SearchFilter/SearchFilterItem.d.cts +0 -13
- package/dist/search/SearchFilter/SearchFilterItem.d.ts +0 -13
- package/dist/search/SearchFilter/SearchFilterItem.js +0 -5
- package/dist/search/SearchInput/SearchInput.cjs +0 -6
- package/dist/search/SearchInput/SearchInput.d.cts +0 -20
- package/dist/search/SearchInput/SearchInput.d.ts +0 -20
- package/dist/search/SearchInput/SearchInput.js +0 -6
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +0 -3
- package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -3
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +0 -28
- package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -28
- package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +0 -30
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +0 -17
- package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -17
- package/dist/search/SearchResultsStates/NoSearchResultsFound.js +0 -26
- package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +0 -66
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +0 -41
- package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -41
- package/dist/search/SearchResultsStates/SearchResultsGrid.js +0 -62
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +0 -52
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +0 -15
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -15
- package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -49
- package/dist/types-53zIialA.d.ts +0 -35
- package/dist/types-B4BGZSlV.d.cts +0 -4
- package/dist/types-BQNqA5xL.d.ts +0 -46
- package/dist/types-BRLWwGMI.d.ts +0 -4
- package/dist/types-CImLkcNh.d.cts +0 -46
- package/dist/types-Cph97xkm.d.ts +0 -6
- package/dist/types-CpiJO5UH.d.ts +0 -4
- package/dist/types-Dy4_w6Cf.d.cts +0 -4
- package/dist/types-TYhhwWZw.d.cts +0 -6
- package/dist/types-aa4flfRE.d.cts +0 -35
- package/src/components/common/ProductGrid/ProductGrid.tsx +0 -73
- package/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +0 -45
- package/src/components/search/SearchResultsFilterSidebar/types.ts +0 -2
- package/src/components/search/types.ts +0 -5
- package/src/types/external.ts +0 -24
- /package/dist/{types-DFetqNL2.d.ts → types-Bm-qQyO3.d.ts} +0 -0
- /package/dist/{types-DaSkJnT_.d.cts → types-C-Jrlw5Z.d.cts} +0 -0
- /package/src/components/{common/ButtonBase → ButtonBase}/ButtonBase.tsx +0 -0
- /package/src/components/{common/Headline → Headline}/Headline.tsx +0 -0
- /package/src/components/{common/ImageWithFallback → ImageWithFallback}/ImageWithFallback.tsx +0 -0
- /package/src/components/{common/ProductCard → ProductCard}/ProductCardSkeleton.tsx +0 -0
- /package/src/components/{common/ProductCard → ProductCard}/productCardVariants.ts +0 -0
- /package/src/components/{common/ProductGrid → ProductGrid}/productGridVariants.ts +0 -0
- /package/src/components/{search/SearchFilter → SearchFilter}/types.ts +0 -0
- /package/src/components/{search/SearchInputForm → SearchInputForm}/types.ts +0 -0
- /package/src/components/{common/SparkleAnimation → SparkleAnimation}/SparkleAnimation.tsx +0 -0
- /package/src/components/{common/SparkleAnimation → SparkleAnimation}/types.ts +0 -0
- /package/src/components/{common/Spinner → Spinner}/Spinner.tsx +0 -0
- /package/src/components/{common/SuggestionButton → SuggestionButton}/SuggestionButton.tsx +0 -0
- /package/src/components/{common/SuggestionButton → SuggestionButton}/types.ts +0 -0
- /package/src/components/{common/Text → Text}/Text.tsx +0 -0
- /package/src/components/{common/Text → Text}/textVariantClasses.ts +0 -0
- /package/src/components/{common/Text → Text}/types.ts +0 -0
- /package/src/components/{common/TextInput → TextInput}/TextInput.tsx +0 -0
- /package/src/{components/models → models}/colorsConfig.ts +0 -0
- /package/src/{components/test → test}/types.ts +0 -0
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { MdStar } from 'react-icons/md';
|
|
3
|
-
import { Text } from 'src/components/common/Text/Text';
|
|
4
3
|
import {
|
|
5
4
|
variantClassMap,
|
|
6
5
|
variantHoverClassMap,
|
|
7
6
|
productCardLayoutVariantClasses,
|
|
8
7
|
variantTitleColorMap,
|
|
9
8
|
} from './productCardVariants';
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
9
|
+
import { ChatElementDisplayLocation } from 'src/config/chatElementDisplayLocation';
|
|
10
|
+
import Logger from 'src/logging/logger';
|
|
11
|
+
import { TestProps } from 'src/test/types';
|
|
12
|
+
import { Headline } from '../Headline';
|
|
13
|
+
import { ImageWithFallback } from '../ImageWithFallback';
|
|
14
|
+
import { Spinner } from '../Spinner';
|
|
15
|
+
import {
|
|
13
16
|
ProductCardConfig,
|
|
17
|
+
ProductCardVariant,
|
|
14
18
|
ProductCardHoverVariant,
|
|
15
19
|
ProductCardLayoutVariant,
|
|
16
|
-
ProductCardVariant,
|
|
17
20
|
} from './types';
|
|
18
|
-
import
|
|
19
|
-
import type { ChatElementDisplayLocation } from 'src/config/chatElementDisplayLocation';
|
|
20
|
-
import Logger from 'src/logging/logger';
|
|
21
|
-
import { Spinner } from '../Spinner/Spinner';
|
|
21
|
+
import { Text } from 'src/components/Text/Text';
|
|
22
22
|
import { formatPrice } from 'src/util/formatPrice';
|
|
23
|
+
import { useImageResolver } from '@envive-ai/react-hooks/hooks';
|
|
23
24
|
|
|
24
25
|
const formatReviews = (stars: number) =>
|
|
25
26
|
String(
|
|
@@ -95,11 +96,26 @@ export const PriceSection = ({ originalPrice, salePrice, pricePrefix }: PriceSec
|
|
|
95
96
|
);
|
|
96
97
|
};
|
|
97
98
|
|
|
99
|
+
// export const formatPrice = (price?: number, currency: string = '$'): string => {
|
|
100
|
+
// if (price == null) {
|
|
101
|
+
// return '';
|
|
102
|
+
// }
|
|
103
|
+
|
|
104
|
+
// const options: Intl.NumberFormatOptions = {};
|
|
105
|
+
|
|
106
|
+
// if (!Number.isInteger(price)) {
|
|
107
|
+
// options.minimumFractionDigits = 2;
|
|
108
|
+
// options.maximumFractionDigits = 2;
|
|
109
|
+
// }
|
|
110
|
+
|
|
111
|
+
// return `${currency}${price.toLocaleString('en-US', options)}`;
|
|
112
|
+
// };
|
|
113
|
+
|
|
98
114
|
interface ProductCardProps extends TestProps {
|
|
99
115
|
productCardConfig?: ProductCardConfig;
|
|
100
116
|
merchantShortName: string;
|
|
101
117
|
title: string;
|
|
102
|
-
url
|
|
118
|
+
url: string;
|
|
103
119
|
searchResponseId?: string;
|
|
104
120
|
productResponseId?: string;
|
|
105
121
|
cardDisplayLocation: ChatElementDisplayLocation.IN_CHAT | ChatElementDisplayLocation.PRODUCT_GRID;
|
|
@@ -115,7 +131,7 @@ interface ProductCardProps extends TestProps {
|
|
|
115
131
|
aspectRatio?: '3:4' | 'square' | 'none';
|
|
116
132
|
clickPosition?: number | null;
|
|
117
133
|
growWithContainer?: boolean;
|
|
118
|
-
handleClick
|
|
134
|
+
handleClick?: (clickedUrl: string) => void;
|
|
119
135
|
}
|
|
120
136
|
|
|
121
137
|
export const ProductCard = ({
|
|
@@ -124,6 +140,8 @@ export const ProductCard = ({
|
|
|
124
140
|
imageUrl,
|
|
125
141
|
title,
|
|
126
142
|
url,
|
|
143
|
+
// searchResponseId,
|
|
144
|
+
// productResponseId,
|
|
127
145
|
originalPrice,
|
|
128
146
|
averageRating,
|
|
129
147
|
numberReviews,
|
|
@@ -132,13 +150,14 @@ export const ProductCard = ({
|
|
|
132
150
|
hoverVariant,
|
|
133
151
|
dataTestId,
|
|
134
152
|
layoutVariant = 'normal',
|
|
153
|
+
// cardDisplayLocation,
|
|
135
154
|
zoomOnHover = false,
|
|
136
155
|
aspectRatio = 'none',
|
|
156
|
+
// clickPosition = null,
|
|
137
157
|
growWithContainer = false,
|
|
138
158
|
handleClick,
|
|
139
159
|
}: ProductCardProps) => {
|
|
140
|
-
|
|
141
|
-
// const { productCardConfig } = orgUIConfig;
|
|
160
|
+
const { resolve } = useImageResolver();
|
|
142
161
|
|
|
143
162
|
const finalVariant = variant ?? productCardConfig?.variant ?? 'filled';
|
|
144
163
|
const finalHoverVariant = hoverVariant ?? productCardConfig?.hoverVariant ?? 'backgroundDark';
|
|
@@ -265,15 +284,13 @@ export const ProductCard = ({
|
|
|
265
284
|
|
|
266
285
|
return (
|
|
267
286
|
<div className={containerClassnames} data-testid={dataTestId}>
|
|
268
|
-
<a href={url} onClick={() => handleClick(url
|
|
287
|
+
<a href={url} onClick={() => handleClick(url)} target="_self" draggable={false}>
|
|
269
288
|
<div className={verticalContainerClassnames}>
|
|
270
289
|
<div className={imageClipContainerClassnames}>
|
|
271
290
|
<div className={imageContainerClassnames}>
|
|
272
291
|
{imageUrl && (
|
|
273
292
|
<ImageWithFallback
|
|
274
|
-
|
|
275
|
-
// src={resolve(imageUrl, layoutVariant === 'tall' ? 300 : 178)}
|
|
276
|
-
src={imageUrl}
|
|
293
|
+
src={resolve(imageUrl, layoutVariant === 'tall' ? 300 : 178)}
|
|
277
294
|
alt={title}
|
|
278
295
|
fallback={<Spinner className="spiffy-tw-w-6 spiffy-tw-h-6" />}
|
|
279
296
|
imageClassnames={imageClassnames}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ResponseCategory, SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
2
2
|
import type { CamelCasedPropertiesDeep } from 'src/util/camelCasedPropertiesDeep';
|
|
3
3
|
|
|
4
4
|
export enum ProductCardSkeletonOverrides {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ChatElementDisplayLocation } from 'src/config/chatElementDisplayLocation';
|
|
2
|
+
import { ProductGridVariant, ProductCardConfig, ProductCard } from '../ProductCard';
|
|
3
|
+
import { productGridVariantClasses } from './productGridVariants';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
6
|
+
import { CamelCasedPropertiesDeep } from 'src/util/camelCasedPropertiesDeep';
|
|
7
|
+
|
|
8
|
+
interface ProductGridProps {
|
|
9
|
+
productList: SearchResponseProduct[];
|
|
10
|
+
productGridVariant: ProductGridVariant;
|
|
11
|
+
productGridClasses: string;
|
|
12
|
+
productCardConfig?: ProductCardConfig;
|
|
13
|
+
merchantShortName: string;
|
|
14
|
+
searchResponseId: string;
|
|
15
|
+
cardsGrowWithContainer?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const ProductGrid = ({
|
|
19
|
+
productList,
|
|
20
|
+
productGridVariant,
|
|
21
|
+
productGridClasses,
|
|
22
|
+
productCardConfig,
|
|
23
|
+
merchantShortName,
|
|
24
|
+
searchResponseId,
|
|
25
|
+
cardsGrowWithContainer = true,
|
|
26
|
+
}: ProductGridProps) => {
|
|
27
|
+
const {
|
|
28
|
+
productCardVariant,
|
|
29
|
+
productCardHoverVariant,
|
|
30
|
+
productCardLayoutVariant,
|
|
31
|
+
productCardImageAspectRatio,
|
|
32
|
+
zoomOnHover,
|
|
33
|
+
} = productGridVariantClasses[productGridVariant];
|
|
34
|
+
|
|
35
|
+
const cardContainerClasses = classNames({
|
|
36
|
+
'spiffy-tw-w-full': cardsGrowWithContainer,
|
|
37
|
+
'spiffy-tw-h-full': cardsGrowWithContainer,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className={productGridClasses}>
|
|
42
|
+
{productList.map((product: SearchResponseProduct, index: number) => {
|
|
43
|
+
const camelCasedProduct: CamelCasedPropertiesDeep<SearchResponseProduct> = product;
|
|
44
|
+
return (
|
|
45
|
+
<div key={camelCasedProduct.id} className={cardContainerClasses}>
|
|
46
|
+
<ProductCard
|
|
47
|
+
productCardConfig={productCardConfig}
|
|
48
|
+
merchantShortName={merchantShortName}
|
|
49
|
+
key={camelCasedProduct.id}
|
|
50
|
+
imageUrl={camelCasedProduct.imageUrl}
|
|
51
|
+
searchResponseId={searchResponseId}
|
|
52
|
+
productResponseId={camelCasedProduct.responseId}
|
|
53
|
+
title={camelCasedProduct.title}
|
|
54
|
+
url={camelCasedProduct.url}
|
|
55
|
+
originalPrice={camelCasedProduct.originalPrice}
|
|
56
|
+
salePrice={camelCasedProduct.salePrice}
|
|
57
|
+
averageRating={camelCasedProduct.averageRating}
|
|
58
|
+
numberReviews={camelCasedProduct.numberReviews}
|
|
59
|
+
cardDisplayLocation={ChatElementDisplayLocation.PRODUCT_GRID}
|
|
60
|
+
layoutVariant={productCardLayoutVariant}
|
|
61
|
+
variant={productCardVariant}
|
|
62
|
+
hoverVariant={productCardHoverVariant}
|
|
63
|
+
zoomOnHover={zoomOnHover}
|
|
64
|
+
aspectRatio={productCardImageAspectRatio}
|
|
65
|
+
clickPosition={index}
|
|
66
|
+
growWithContainer={cardsGrowWithContainer}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
})}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
};
|
package/src/components/{search/SearchInputAutocomplete → SearchAutocomplete}/SearchAutocomplete.tsx
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { motion } from 'framer-motion';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import OutlinedStar from '@envive-ai/react-icons/
|
|
4
|
+
import OutlinedStar from '@envive-ai/react-icons/OutlinedStar';
|
|
5
5
|
|
|
6
6
|
interface GlobalSearchAutocompleteProps {
|
|
7
7
|
id: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SearchAutocomplete';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { SearchFilterItem } from './SearchFilterItem';
|
|
3
3
|
import type { SearchFilterProps } from './types';
|
|
4
|
-
import { Text } from 'src/components/
|
|
5
|
-
import { ButtonBase } from 'src/components/
|
|
4
|
+
import { Text } from 'src/components/Text/Text';
|
|
5
|
+
import { ButtonBase } from 'src/components/ButtonBase/ButtonBase';
|
|
6
6
|
|
|
7
7
|
export const SearchFilter = ({
|
|
8
8
|
isOpen,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useRef, useImperativeHandle } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import MagnifyingGlassStarVariant from '@envive-ai/react-icons/
|
|
4
|
-
import
|
|
5
|
-
import { TextInput } from '
|
|
3
|
+
import MagnifyingGlassStarVariant from '@envive-ai/react-icons/MagnifyingGlassStarVariant';
|
|
4
|
+
import { SearchInputVariant } from '../SearchInputForm';
|
|
5
|
+
import { TextInput } from '../TextInput';
|
|
6
6
|
import { searchInputVariantClasses } from './searchInputVariants';
|
|
7
|
-
import
|
|
7
|
+
import { IconClose } from '@envive-ai/react-icons/src/index.js';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface SearchInputProps {
|
|
10
10
|
searchInputVariant?: SearchInputVariant;
|
|
11
11
|
value: string;
|
|
12
12
|
placeholder?: string;
|
|
@@ -126,7 +126,7 @@ export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
|
|
|
126
126
|
aria-label="Clear search input"
|
|
127
127
|
type="button"
|
|
128
128
|
>
|
|
129
|
-
<
|
|
129
|
+
<IconClose className={closeButtonIconClassName} />
|
|
130
130
|
</button>
|
|
131
131
|
)}
|
|
132
132
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { colorVar, ColorNames } from 'src/models/colorsConfig';
|
|
2
|
+
import { SearchInputVariant } from '../SearchInputForm';
|
|
3
|
+
import { TextStyleVariantMap } from '../Text/textVariantClasses';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type SearchInputVariantClasses = {
|
|
6
6
|
searchInputIconColor: string;
|
|
7
7
|
searchInputBorderColor: string;
|
|
8
8
|
searchInputCloseIconClasses: string;
|
|
@@ -10,7 +10,7 @@ interface SearchInputVariantClasses {
|
|
|
10
10
|
autocompleteIconColor: string;
|
|
11
11
|
searchInputClasses: string;
|
|
12
12
|
placeholderVariant: keyof typeof TextStyleVariantMap;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
|
|
15
15
|
export const searchInputVariantClasses: Record<SearchInputVariant, SearchInputVariantClasses> = {
|
|
16
16
|
standard: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SearchAutocomplete } from '../SearchInputAutocomplete/SearchAutocomplete';
|
|
3
|
-
import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
|
|
1
|
+
import { SearchAutocomplete } from '../SearchAutocomplete';
|
|
4
2
|
import { SearchInput } from '../SearchInput/SearchInput';
|
|
3
|
+
import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
|
|
4
|
+
import { SearchInputVariant } from './types';
|
|
5
5
|
|
|
6
6
|
interface SearchInputFormProps {
|
|
7
7
|
searchInputVariant: SearchInputVariant;
|
|
@@ -15,6 +15,7 @@ interface SearchInputFormProps {
|
|
|
15
15
|
onAutocompleteSelect: (suggestion: string) => void;
|
|
16
16
|
onSearchInputChange: (value: string) => void;
|
|
17
17
|
onSearchSubmit: () => void;
|
|
18
|
+
searchInputDataTestId?: string;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export const SearchInputForm = ({
|
|
@@ -29,6 +30,7 @@ export const SearchInputForm = ({
|
|
|
29
30
|
onAutocompleteSelect,
|
|
30
31
|
onSearchInputChange,
|
|
31
32
|
onSearchSubmit,
|
|
33
|
+
searchInputDataTestId,
|
|
32
34
|
}: SearchInputFormProps) => {
|
|
33
35
|
const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
|
|
34
36
|
|
|
@@ -47,7 +49,7 @@ export const SearchInputForm = ({
|
|
|
47
49
|
suggestions={autocompleteResults}
|
|
48
50
|
ariaActivedescendant={focusedOptionId}
|
|
49
51
|
searchInputVariant={searchInputVariant}
|
|
50
|
-
|
|
52
|
+
dataTestId={searchInputDataTestId}
|
|
51
53
|
onKeyDown={onKeyDown}
|
|
52
54
|
onChange={onSearchInputChange}
|
|
53
55
|
/>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { SelectedFilterOption } from 'src/atoms/search/types';
|
|
2
|
+
import {
|
|
3
|
+
ProductCardConfig,
|
|
4
|
+
ProductGridVariant,
|
|
5
|
+
SearchResponseProductAttributes,
|
|
6
|
+
} from '../ProductCard';
|
|
7
|
+
import { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar';
|
|
8
|
+
import {
|
|
9
|
+
NoSearchResultsFound,
|
|
10
|
+
SearchResultsGrid,
|
|
11
|
+
SearchResultsLoadingGrid,
|
|
12
|
+
} from '../SearchResultsStates';
|
|
13
|
+
import { SearchResultsState } from './utils';
|
|
14
|
+
|
|
15
|
+
interface SearchResultsContentProps {
|
|
16
|
+
searchResultsState: SearchResultsState;
|
|
17
|
+
productList: SearchResponseProductAttributes['attributes'][];
|
|
18
|
+
productCardConfig: ProductCardConfig;
|
|
19
|
+
merchantShortName: string;
|
|
20
|
+
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
21
|
+
productGridVariant: ProductGridVariant;
|
|
22
|
+
productGridClasses: string;
|
|
23
|
+
containerXPaddingClasses: string;
|
|
24
|
+
selectedFilterOptions: SelectedFilterOption[];
|
|
25
|
+
availableDynamicFilters: { name: string; displayName: string }[];
|
|
26
|
+
searchResponseId: string;
|
|
27
|
+
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
28
|
+
onToggleDynamicFilter: ({
|
|
29
|
+
filter,
|
|
30
|
+
dynamicFilterDisplayName,
|
|
31
|
+
}: {
|
|
32
|
+
filter: string;
|
|
33
|
+
dynamicFilterDisplayName: string;
|
|
34
|
+
}) => void;
|
|
35
|
+
noResultsFoundText?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const SearchResultsContent = ({
|
|
39
|
+
searchResultsState,
|
|
40
|
+
productList,
|
|
41
|
+
productCardConfig,
|
|
42
|
+
merchantShortName,
|
|
43
|
+
searchFilterSidebarVariant,
|
|
44
|
+
productGridVariant,
|
|
45
|
+
productGridClasses,
|
|
46
|
+
containerXPaddingClasses,
|
|
47
|
+
selectedFilterOptions,
|
|
48
|
+
availableDynamicFilters,
|
|
49
|
+
searchResponseId,
|
|
50
|
+
onRemoveFilter,
|
|
51
|
+
onToggleDynamicFilter,
|
|
52
|
+
noResultsFoundText,
|
|
53
|
+
}: SearchResultsContentProps) => {
|
|
54
|
+
return (
|
|
55
|
+
<div>
|
|
56
|
+
{searchResultsState === SearchResultsState.NoResults && (
|
|
57
|
+
<NoSearchResultsFound
|
|
58
|
+
containerPaddingClasses={containerXPaddingClasses}
|
|
59
|
+
includeBottomMargin
|
|
60
|
+
noResultsFoundText={noResultsFoundText}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
{searchResultsState === SearchResultsState.Results && (
|
|
64
|
+
<SearchResultsGrid
|
|
65
|
+
searchFilterSidebarVariant={searchFilterSidebarVariant}
|
|
66
|
+
productCardConfig={productCardConfig}
|
|
67
|
+
merchantShortName={merchantShortName}
|
|
68
|
+
productList={productList}
|
|
69
|
+
productGridVariant={productGridVariant}
|
|
70
|
+
productGridClasses={productGridClasses}
|
|
71
|
+
containerXPaddingClasses={containerXPaddingClasses}
|
|
72
|
+
selectedFilterOptions={selectedFilterOptions}
|
|
73
|
+
availableDynamicFilters={availableDynamicFilters}
|
|
74
|
+
searchResponseId={searchResponseId}
|
|
75
|
+
onRemoveFilter={onRemoveFilter}
|
|
76
|
+
onToggleDynamicFilter={onToggleDynamicFilter}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
{searchResultsState === SearchResultsState.Loading && (
|
|
80
|
+
<SearchResultsLoadingGrid
|
|
81
|
+
productGridVariant={productGridVariant}
|
|
82
|
+
productGridClasses={productGridClasses}
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
2
|
+
|
|
3
|
+
export interface SearchResult {
|
|
4
|
+
products: SearchResponseProduct[]; // Flattened from all responses
|
|
5
|
+
filters: string[]; // Combined from all responses
|
|
6
|
+
generatedQuery?: string;
|
|
7
|
+
totalProductCount: number;
|
|
8
|
+
searchResponseId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const enum SearchResultsState {
|
|
12
|
+
Loading,
|
|
13
|
+
Results,
|
|
14
|
+
NoResults,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const getSearchResultsState = (
|
|
18
|
+
isLoadingSearch: boolean,
|
|
19
|
+
searchData: SearchResult | null,
|
|
20
|
+
): SearchResultsState => {
|
|
21
|
+
if (isLoadingSearch) {
|
|
22
|
+
return SearchResultsState.Loading;
|
|
23
|
+
}
|
|
24
|
+
if (searchData) {
|
|
25
|
+
return SearchResultsState.Results;
|
|
26
|
+
}
|
|
27
|
+
return SearchResultsState.NoResults;
|
|
28
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
|
|
3
|
-
import { SearchFilter } from '../SearchFilter/SearchFilter';
|
|
4
|
-
import { SearchFilterHeader } from '../SearchFilter/SearchFilterHeader';
|
|
5
|
-
import type { SearchFilter as SearchFilterType, SelectFilterItem } from '../SearchFilter/types';
|
|
6
|
-
import type { SearchFilterSidebarVariant } from './types';
|
|
7
3
|
import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
|
|
8
|
-
import
|
|
4
|
+
import SettingsVariant from '@envive-ai/react-icons/SettingsVariant';
|
|
5
|
+
import { ButtonBase } from '../ButtonBase';
|
|
6
|
+
import { SelectFilterItem, SearchFilter, SearchFilterHeader } from '../SearchFilter';
|
|
7
|
+
import { SearchFilterSidebarVariant, type SearchFilter as SearchFilterType } from './types';
|
|
9
8
|
|
|
10
9
|
export type SearchResultsFilterProps = {
|
|
11
10
|
productCount: number;
|
|
@@ -70,7 +69,7 @@ export const SearchResultsFilter = ({
|
|
|
70
69
|
/>
|
|
71
70
|
<ButtonBase
|
|
72
71
|
onClick={openFilter}
|
|
73
|
-
|
|
72
|
+
icon={SettingsVariant}
|
|
74
73
|
iconClass="spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center"
|
|
75
74
|
text={filterButtonText}
|
|
76
75
|
textClass="spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
|
|
2
|
+
import { ColorNames, colorVar } from 'src/models/colorsConfig';
|
|
3
|
+
|
|
4
|
+
interface SearchFilterSidebarVariantClasses {
|
|
5
|
+
searchFilterHeaderClasses: string;
|
|
6
|
+
radioButtonFillColor: string;
|
|
7
|
+
radioButtonHoverColor: string;
|
|
8
|
+
radioButtonUncheckedBorderColor: string;
|
|
9
|
+
filterDefaultClasses: string;
|
|
10
|
+
filterActiveClasses: string;
|
|
11
|
+
filterHoverClasses: string;
|
|
12
|
+
appliedFilterBackgroundClasses: string;
|
|
13
|
+
applyFiltersUnchangedClasses: string;
|
|
14
|
+
applyFiltersChangedClasses: string;
|
|
15
|
+
filterCloseIconVariant: CloseIconVariant;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const searchFilterSidebarVariantClasses: Record<
|
|
19
|
+
SearchFilterSidebarVariant,
|
|
20
|
+
SearchFilterSidebarVariantClasses
|
|
21
|
+
> = {
|
|
22
|
+
darkButton: {
|
|
23
|
+
radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
|
|
24
|
+
radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
|
|
25
|
+
radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
|
|
26
|
+
searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
27
|
+
filterDefaultClasses:
|
|
28
|
+
'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
29
|
+
filterHoverClasses:
|
|
30
|
+
'hover:spiffy-tw-border-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-text-[--spiffy-colors-text-primary]',
|
|
31
|
+
filterActiveClasses:
|
|
32
|
+
'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
33
|
+
appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
|
|
34
|
+
applyFiltersUnchangedClasses:
|
|
35
|
+
'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
36
|
+
applyFiltersChangedClasses:
|
|
37
|
+
'spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
38
|
+
filterCloseIconVariant: 'light',
|
|
39
|
+
},
|
|
40
|
+
lightButton: {
|
|
41
|
+
radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
|
|
42
|
+
radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
|
|
43
|
+
radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
|
|
44
|
+
searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-primary]',
|
|
45
|
+
filterDefaultClasses:
|
|
46
|
+
'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
47
|
+
filterHoverClasses:
|
|
48
|
+
'hover:spiffy-tw-border-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-text-[--spiffy-colors-text-primary]',
|
|
49
|
+
filterActiveClasses:
|
|
50
|
+
'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
51
|
+
appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
|
|
52
|
+
applyFiltersUnchangedClasses:
|
|
53
|
+
'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
54
|
+
applyFiltersChangedClasses:
|
|
55
|
+
'spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-link]',
|
|
56
|
+
filterCloseIconVariant: 'dark',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
|
|
2
|
+
export type CloseIconVariant = 'light' | 'tertiary' | 'dark';
|
|
3
|
+
|
|
4
|
+
export type SearchFilter = {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
items: SearchFilterItem[];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SearchFilterItem = {
|
|
11
|
+
id: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
value: string;
|
|
14
|
+
isSelected: boolean;
|
|
15
|
+
};
|
package/src/components/{search/SearchResultsStates → SearchResultsStates}/NoSearchResultsFound.tsx
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import Sparkles from '@envive-ai/react-icons/
|
|
3
|
-
import { Text } from 'src/components/
|
|
2
|
+
import Sparkles from '@envive-ai/react-icons/Sparkles';
|
|
3
|
+
import { Text } from 'src/components/Text';
|
|
4
4
|
|
|
5
5
|
interface NoSearchResultsFoundProps {
|
|
6
6
|
containerPaddingClasses: string;
|
package/src/components/{search/SearchResultsStates → SearchResultsStates}/SearchResultsGrid.tsx
RENAMED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { motion } from 'framer-motion';
|
|
2
|
-
import type { SelectedFilterOption } from 'src/atoms/search/types';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import type { SearchResponseProduct } from 'src/types/external';
|
|
5
|
-
import { ProductGrid } from 'src/components/common/ProductGrid/ProductGrid';
|
|
6
1
|
import { AppliedFiltersScrollbar } from '../FilterScrollbar/AppliedFiltersScrollbar';
|
|
7
2
|
import { DynamicFiltersScrollbar } from '../FilterScrollbar/DynamicFiltersScrollbar';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
|
|
8
5
|
import { searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar/searchFilterSidebarVariants';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
8
|
+
import { SelectedFilterOption } from 'src/atoms/search/types';
|
|
9
|
+
import { ProductCardConfig, ProductGridVariant } from '../ProductCard';
|
|
10
|
+
import { ProductGrid } from '../ProductGrid';
|
|
11
|
+
import { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar';
|
|
11
12
|
|
|
12
13
|
interface SearchResultsGridProps {
|
|
13
14
|
productList: SearchResponseProduct[];
|
|
15
|
+
productCardConfig: ProductCardConfig;
|
|
16
|
+
merchantShortName: string;
|
|
14
17
|
availableDynamicFilters: { name: string; displayName: string }[];
|
|
15
18
|
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
16
19
|
productGridVariant: ProductGridVariant;
|
|
@@ -30,6 +33,8 @@ interface SearchResultsGridProps {
|
|
|
30
33
|
|
|
31
34
|
export const SearchResultsGrid = ({
|
|
32
35
|
productList,
|
|
36
|
+
productCardConfig,
|
|
37
|
+
merchantShortName,
|
|
33
38
|
availableDynamicFilters,
|
|
34
39
|
searchFilterSidebarVariant,
|
|
35
40
|
productGridVariant,
|
|
@@ -93,12 +98,9 @@ export const SearchResultsGrid = ({
|
|
|
93
98
|
productList={productList}
|
|
94
99
|
productGridVariant={productGridVariant}
|
|
95
100
|
productGridClasses={productGridClasses}
|
|
101
|
+
productCardConfig={productCardConfig}
|
|
102
|
+
merchantShortName={merchantShortName}
|
|
96
103
|
searchResponseId={searchResponseId}
|
|
97
|
-
merchantShortName={''}
|
|
98
|
-
handleClick={function (clickedUrl: string): void {
|
|
99
|
-
console.log(clickedUrl);
|
|
100
|
-
throw new Error('Function not implemented.');
|
|
101
|
-
}}
|
|
102
104
|
/>
|
|
103
105
|
</motion.div>
|
|
104
106
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Text } from 'src/components/common/Text/Text';
|
|
2
|
-
import { SparkleAnimation } from 'src/components/common/SparkleAnimation/SparkleAnimation';
|
|
3
1
|
import { motion } from 'framer-motion';
|
|
4
|
-
import { ProductGridVariant } from '
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ProductGridVariant, ProductCardSkeleton } from '../ProductCard';
|
|
3
|
+
import { productGridVariantClasses } from '../ProductGrid';
|
|
4
|
+
import { SparkleAnimation } from '../SparkleAnimation';
|
|
5
|
+
import { Text } from '@envive-ai/react-toolkit/Text';
|
|
7
6
|
|
|
8
7
|
export const SearchResultsLoadingGrid = ({
|
|
9
8
|
productGridVariant,
|