@envive-ai/react-toolkit 0.1.0 → 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/LICENSE +2 -0
- 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 -5
- package/src/atoms/search/types.ts +5 -0
- package/src/components/common/ButtonBase/ButtonBase.tsx +70 -0
- package/src/components/common/ButtonBase/types.ts +26 -0
- package/src/components/common/Headline/Headline.tsx +81 -0
- package/src/components/common/ImageWithFallback/ImageWithFallback.tsx +66 -0
- package/src/components/common/ProductCard/ProductCard.tsx +305 -0
- package/src/components/common/ProductCard/ProductCardSkeleton.tsx +83 -0
- package/src/components/common/ProductCard/productCardVariants.ts +63 -0
- package/src/components/common/ProductCard/types.ts +49 -0
- package/src/components/common/ProductGrid/ProductGrid.tsx +73 -0
- package/src/components/common/ProductGrid/productGridVariants.ts +31 -0
- package/src/components/common/SparkleAnimation/SparkleAnimation.tsx +105 -0
- package/src/components/common/SparkleAnimation/types.ts +6 -0
- package/src/components/common/Spinner/Spinner.tsx +30 -0
- package/src/components/common/SuggestionButton/SuggestionButton.tsx +258 -0
- package/src/components/common/SuggestionButton/types.ts +14 -0
- package/src/components/common/Text/Text.tsx +58 -0
- package/src/components/common/Text/textVariantClasses.ts +106 -0
- package/src/components/common/Text/types.ts +23 -0
- package/src/components/common/TextInput/TextInput.tsx +34 -0
- package/src/components/models/colorsConfig.ts +28 -0
- package/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.tsx +70 -0
- package/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.tsx +52 -0
- package/src/components/search/SearchFilter/SearchFilter.tsx +84 -0
- package/src/components/search/SearchFilter/SearchFilterHeader.tsx +42 -0
- package/src/components/search/SearchFilter/SearchFilterItem.tsx +42 -0
- package/src/components/search/SearchFilter/types.ts +48 -0
- package/src/components/search/SearchInput/SearchInput.tsx +135 -0
- package/src/components/search/SearchInput/searchInputVariants.ts +27 -0
- package/src/components/search/SearchInputAutocomplete/SearchAutocomplete.tsx +62 -0
- package/src/components/search/SearchInputForm/SearchInputForm.tsx +66 -0
- package/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.tsx +82 -0
- package/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +45 -0
- package/{dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.d.ts → src/components/search/SearchResultsFilterSidebar/types.ts} +1 -1
- package/src/components/search/SearchResultsStates/NoSearchResultsFound.tsx +41 -0
- package/src/components/search/SearchResultsStates/SearchResultsGrid.tsx +105 -0
- package/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.tsx +50 -0
- package/src/components/search/types.ts +5 -0
- package/{dist/packages/components/src/components/test/types.d.ts → src/components/test/types.ts} +1 -1
- package/src/config/chatElementDisplayLocation.ts +22 -0
- package/src/logging/logger.ts +21 -0
- package/src/types/external.ts +24 -0
- package/{dist/packages/components/src/util/camelCase.d.ts → src/util/camelCase.ts} +33 -11
- package/src/util/camelCasedPropertiesDeep.ts +81 -0
- package/src/util/formatPrice.ts +14 -0
- package/src/util/internal.ts +95 -0
- package/{dist/src/util/primitive.d.ts → src/util/primitive.ts} +2 -0
- package/src/util/splitWords.ts +72 -0
- package/{dist/src/util/trim.d.ts → src/util/trim.ts} +5 -1
- package/dist/packages/components/src/atoms/search/types.d.ts +0 -5
- package/dist/packages/components/src/atoms/search/types.js +0 -1
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
- package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.js +0 -41
- package/dist/packages/components/src/components/common/ButtonBase/types.d.ts +0 -24
- package/dist/packages/components/src/components/common/ButtonBase/types.js +0 -6
- package/dist/packages/components/src/components/common/Headline/Headline.d.ts +0 -10
- package/dist/packages/components/src/components/common/Headline/Headline.js +0 -34
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
- package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.d.ts +0 -39
- package/dist/packages/components/src/components/common/ProductCard/ProductCard.js +0 -83
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
- package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
- package/dist/packages/components/src/components/common/ProductCard/productCardVariants.js +0 -50
- package/dist/packages/components/src/components/common/ProductCard/types.d.ts +0 -39
- package/dist/packages/components/src/components/common/ProductCard/types.js +0 -10
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
- package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.js +0 -13
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
- package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.js +0 -16
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
- package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
- package/dist/packages/components/src/components/common/SparkleAnimation/types.d.ts +0 -6
- package/dist/packages/components/src/components/common/SparkleAnimation/types.js +0 -7
- package/dist/packages/components/src/components/common/Spinner/Spinner.d.ts +0 -5
- package/dist/packages/components/src/components/common/Spinner/Spinner.js +0 -16
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
- package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
- package/dist/packages/components/src/components/common/SuggestionButton/types.d.ts +0 -1
- package/dist/packages/components/src/components/common/SuggestionButton/types.js +0 -1
- package/dist/packages/components/src/components/common/Text/Text.d.ts +0 -12
- package/dist/packages/components/src/components/common/Text/Text.js +0 -26
- package/dist/packages/components/src/components/common/Text/textVariantClasses.d.ts +0 -171
- package/dist/packages/components/src/components/common/Text/textVariantClasses.js +0 -103
- package/dist/packages/components/src/components/common/Text/types.d.ts +0 -16
- package/dist/packages/components/src/components/common/Text/types.js +0 -6
- package/dist/packages/components/src/components/common/TextInput/TextInput.d.ts +0 -8
- package/dist/packages/components/src/components/common/TextInput/TextInput.js +0 -25
- package/dist/packages/components/src/components/models/colorsConfig.d.ts +0 -26
- package/dist/packages/components/src/components/models/colorsConfig.js +0 -23
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
- package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
- package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.js +0 -24
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
- package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
- package/dist/packages/components/src/components/search/SearchFilter/types.d.ts +0 -42
- package/dist/packages/components/src/components/search/SearchFilter/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchInput/SearchInput.js +0 -38
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
- package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.js +0 -12
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
- package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
- package/dist/packages/components/src/components/search/SearchInputForm/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
- package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
- package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
- package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
- package/dist/packages/components/src/components/search/types.d.ts +0 -5
- package/dist/packages/components/src/components/search/types.js +0 -6
- package/dist/packages/components/src/components/test/types.js +0 -1
- package/dist/packages/components/src/config/chatElementDisplayLocation.d.ts +0 -21
- package/dist/packages/components/src/config/chatElementDisplayLocation.js +0 -23
- package/dist/packages/components/src/index.d.ts +0 -45
- package/dist/packages/components/src/index.js +0 -49
- package/dist/packages/components/src/logging/logger.d.ts +0 -7
- package/dist/packages/components/src/logging/logger.js +0 -16
- package/dist/packages/components/src/types/external.d.ts +0 -21
- package/dist/packages/components/src/types/external.js +0 -5
- package/dist/packages/components/src/util/camelCase.js +0 -2
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.d.ts +0 -53
- package/dist/packages/components/src/util/camelCasedPropertiesDeep.js +0 -1
- package/dist/packages/components/src/util/formatPrice.d.ts +0 -1
- package/dist/packages/components/src/util/formatPrice.js +0 -11
- package/dist/packages/components/src/util/internal.d.ts +0 -27
- package/dist/packages/components/src/util/internal.js +0 -4
- package/dist/packages/components/src/util/primitive.d.ts +0 -6
- package/dist/packages/components/src/util/primitive.js +0 -2
- package/dist/packages/components/src/util/splitWords.d.ts +0 -55
- package/dist/packages/components/src/util/splitWords.js +0 -2
- package/dist/packages/components/src/util/trim.d.ts +0 -24
- package/dist/packages/components/src/util/trim.js +0 -2
- package/dist/packages/components/src/util/unknownArray.js +0 -1
- 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.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.js +0 -2
- package/dist/src/util/unknownArray.d.ts +0 -25
- package/dist/src/util/unknownArray.js +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/{dist/packages/components/src/components/search/SearchInputForm/types.d.ts → src/components/search/SearchInputForm/types.ts} +0 -0
- /package/{dist/packages/components/src/util/unknownArray.d.ts → src/util/unknownArray.ts} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
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
|
+
import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
|
|
8
|
+
import { ButtonBase } from 'src/components/common/ButtonBase/ButtonBase';
|
|
9
|
+
|
|
10
|
+
export type SearchResultsFilterProps = {
|
|
11
|
+
productCount: number;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
14
|
+
searchFilters: SearchFilterType[];
|
|
15
|
+
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
16
|
+
searchText: string;
|
|
17
|
+
onSelectFilterItem: SelectFilterItem;
|
|
18
|
+
onClearAllFilters: () => void;
|
|
19
|
+
filterButtonText: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const SearchResultsFilter = ({
|
|
23
|
+
productCount,
|
|
24
|
+
isOpen,
|
|
25
|
+
setIsOpen,
|
|
26
|
+
searchFilters,
|
|
27
|
+
searchFilterSidebarVariant,
|
|
28
|
+
onSelectFilterItem,
|
|
29
|
+
onClearAllFilters,
|
|
30
|
+
filterButtonText,
|
|
31
|
+
}: SearchResultsFilterProps) => {
|
|
32
|
+
const {
|
|
33
|
+
applyFiltersUnchangedClasses,
|
|
34
|
+
applyFiltersChangedClasses,
|
|
35
|
+
searchFilterHeaderClasses,
|
|
36
|
+
radioButtonFillColor,
|
|
37
|
+
radioButtonHoverColor,
|
|
38
|
+
radioButtonUncheckedBorderColor,
|
|
39
|
+
filterCloseIconVariant,
|
|
40
|
+
} = searchFilterSidebarVariantClasses[searchFilterSidebarVariant];
|
|
41
|
+
|
|
42
|
+
const openFilter = useCallback(() => {
|
|
43
|
+
setIsOpen(true);
|
|
44
|
+
}, [setIsOpen]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<SearchFilter
|
|
49
|
+
isOpen={isOpen}
|
|
50
|
+
setIsOpen={setIsOpen}
|
|
51
|
+
filters={searchFilters}
|
|
52
|
+
productCount={productCount}
|
|
53
|
+
selectFilterItem={onSelectFilterItem}
|
|
54
|
+
clearAllFilters={onClearAllFilters}
|
|
55
|
+
applyFiltersUnchangedClasses={applyFiltersUnchangedClasses}
|
|
56
|
+
applyFiltersChangedClasses={applyFiltersChangedClasses}
|
|
57
|
+
filterButtonText={filterButtonText}
|
|
58
|
+
radioButtonFillColor={radioButtonFillColor}
|
|
59
|
+
radioButtonHoverColor={radioButtonHoverColor}
|
|
60
|
+
radioButtonUncheckedBorderColor={radioButtonUncheckedBorderColor}
|
|
61
|
+
filterCloseIconVariant={filterCloseIconVariant}
|
|
62
|
+
headerContent={
|
|
63
|
+
<SearchFilterHeader
|
|
64
|
+
closeModal={() => setIsOpen(false)}
|
|
65
|
+
productCount={productCount}
|
|
66
|
+
headerClassName={searchFilterHeaderClasses}
|
|
67
|
+
filterCloseIconVariant={filterCloseIconVariant}
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
<ButtonBase
|
|
72
|
+
onClick={openFilter}
|
|
73
|
+
// icon={SettingsVariant} // Icon is handled by user
|
|
74
|
+
iconClass="spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center"
|
|
75
|
+
text={filterButtonText}
|
|
76
|
+
textClass="spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block"
|
|
77
|
+
buttonClass="spiffy-tw-flex-row spiffy-tw-pl-[16px] sm:spiffy-tw-pl-0 sm:spiffy-tw-px-4 sm:spiffy-tw-gap-[8px]"
|
|
78
|
+
disablePadding
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
|
|
2
|
+
import { ColorNames, colorVar } from 'src/components/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<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses> = {
|
|
19
|
+
darkButton: {
|
|
20
|
+
radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
|
|
21
|
+
radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
|
|
22
|
+
radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
|
|
23
|
+
searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
24
|
+
filterDefaultClasses: 'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
25
|
+
filterHoverClasses: '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]',
|
|
26
|
+
filterActiveClasses: 'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
27
|
+
appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
|
|
28
|
+
applyFiltersUnchangedClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
29
|
+
applyFiltersChangedClasses: 'spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
30
|
+
filterCloseIconVariant: 'light',
|
|
31
|
+
},
|
|
32
|
+
lightButton: {
|
|
33
|
+
radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
|
|
34
|
+
radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
|
|
35
|
+
radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
|
|
36
|
+
searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-primary]',
|
|
37
|
+
filterDefaultClasses: 'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
38
|
+
filterHoverClasses: '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]',
|
|
39
|
+
filterActiveClasses: 'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
|
|
40
|
+
appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
|
|
41
|
+
applyFiltersUnchangedClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
|
|
42
|
+
applyFiltersChangedClasses: 'spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-link]',
|
|
43
|
+
filterCloseIconVariant: 'dark',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
|
|
2
|
-
export type CloseIconVariant = 'light' | 'tertiary' | 'dark';
|
|
2
|
+
export type CloseIconVariant = 'light' | 'tertiary' | 'dark';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import Sparkles from '@envive-ai/react-icons/src/Sparkles';
|
|
3
|
+
import { Text } from 'src/components/common/Text/Text';
|
|
4
|
+
|
|
5
|
+
interface NoSearchResultsFoundProps {
|
|
6
|
+
containerPaddingClasses: string;
|
|
7
|
+
includeBottomMargin?: boolean; // manually add about a page of bottom margin to push unsupressed content down
|
|
8
|
+
noResultsFoundText?: string;
|
|
9
|
+
sparkleIconColor?: string; // example format: var(--spiffy-colors-accent-primary)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const NoSearchResultsFound = ({
|
|
13
|
+
containerPaddingClasses,
|
|
14
|
+
includeBottomMargin = false,
|
|
15
|
+
noResultsFoundText,
|
|
16
|
+
sparkleIconColor = 'var(--spiffy-colors-accent-primary)',
|
|
17
|
+
}: NoSearchResultsFoundProps) => {
|
|
18
|
+
const containerClasses = classNames(
|
|
19
|
+
containerPaddingClasses,
|
|
20
|
+
includeBottomMargin ? 'spiffy-tw-mb-[100vh]' : '',
|
|
21
|
+
'spiffy-tw-mt-6',
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const textPrompt =
|
|
25
|
+
noResultsFoundText ||
|
|
26
|
+
'I’m sorry, I wasn’t able to find an exact match. Try changing your filters or adjusting your search query.';
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={containerClasses}>
|
|
30
|
+
<div className="spiffy-tw-flex spiffy-tw-items-start spiffy-tw-gap-2">
|
|
31
|
+
<div>
|
|
32
|
+
<Sparkles
|
|
33
|
+
className="spiffy-tw-w-[24px] spiffy-tw-h-[24px]"
|
|
34
|
+
style={{ color: sparkleIconColor }}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<Text variant="body2">{textPrompt}</Text>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
import { AppliedFiltersScrollbar } from '../FilterScrollbar/AppliedFiltersScrollbar';
|
|
7
|
+
import { DynamicFiltersScrollbar } from '../FilterScrollbar/DynamicFiltersScrollbar';
|
|
8
|
+
import { searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar/searchFilterSidebarVariants';
|
|
9
|
+
import type { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar/types';
|
|
10
|
+
import { ProductGridVariant } from 'src/components/common/ProductCard/types';
|
|
11
|
+
|
|
12
|
+
interface SearchResultsGridProps {
|
|
13
|
+
productList: SearchResponseProduct[];
|
|
14
|
+
availableDynamicFilters: { name: string; displayName: string }[];
|
|
15
|
+
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
16
|
+
productGridVariant: ProductGridVariant;
|
|
17
|
+
selectedFilterOptions: SelectedFilterOption[];
|
|
18
|
+
searchResponseId: string;
|
|
19
|
+
containerXPaddingClasses: string;
|
|
20
|
+
productGridClasses: string;
|
|
21
|
+
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
22
|
+
onToggleDynamicFilter: ({
|
|
23
|
+
filter,
|
|
24
|
+
dynamicFilterDisplayName,
|
|
25
|
+
}: {
|
|
26
|
+
filter: string;
|
|
27
|
+
dynamicFilterDisplayName: string;
|
|
28
|
+
}) => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const SearchResultsGrid = ({
|
|
32
|
+
productList,
|
|
33
|
+
availableDynamicFilters,
|
|
34
|
+
searchFilterSidebarVariant,
|
|
35
|
+
productGridVariant,
|
|
36
|
+
selectedFilterOptions,
|
|
37
|
+
searchResponseId,
|
|
38
|
+
containerXPaddingClasses,
|
|
39
|
+
productGridClasses,
|
|
40
|
+
onRemoveFilter,
|
|
41
|
+
onToggleDynamicFilter,
|
|
42
|
+
}: SearchResultsGridProps) => {
|
|
43
|
+
const sharedFilterBarClasses = classNames(
|
|
44
|
+
'spiffy-suggestion-bar',
|
|
45
|
+
'spiffy-tw-no-scrollbar',
|
|
46
|
+
'spiffy-tw-flex',
|
|
47
|
+
'spiffy-tw-flex-row',
|
|
48
|
+
'spiffy-tw-gap-2',
|
|
49
|
+
'spiffy-tw-mb-[16px]',
|
|
50
|
+
'spiffy-tw-overflow-x-scroll',
|
|
51
|
+
containerXPaddingClasses,
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const filterBarClasses = classNames(sharedFilterBarClasses, 'spiffy-tw-mt-[24px]');
|
|
55
|
+
|
|
56
|
+
const appliedFilterBarClasses = classNames(
|
|
57
|
+
sharedFilterBarClasses,
|
|
58
|
+
'spiffy-tw-mb-[32px]',
|
|
59
|
+
'spiffy-tw-mt-[8px]',
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const {
|
|
63
|
+
// We may want to pull these into their own variant separated from the filter sidebar (but also used in it) In this case, we need them for dynamic filters
|
|
64
|
+
filterDefaultClasses,
|
|
65
|
+
filterHoverClasses,
|
|
66
|
+
appliedFilterBackgroundClasses,
|
|
67
|
+
} = searchFilterSidebarVariantClasses[searchFilterSidebarVariant];
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<motion.div
|
|
71
|
+
className="spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden"
|
|
72
|
+
initial={{ opacity: 0 }}
|
|
73
|
+
animate={{ opacity: 1 }}
|
|
74
|
+
exit={{ opacity: 0 }}
|
|
75
|
+
transition={{ duration: 0.2 }}
|
|
76
|
+
>
|
|
77
|
+
<AppliedFiltersScrollbar
|
|
78
|
+
selectedFilterOptions={selectedFilterOptions}
|
|
79
|
+
filterBarClassNames={appliedFilterBarClasses}
|
|
80
|
+
filterDefaultClasses={filterDefaultClasses}
|
|
81
|
+
filterHoverClasses={filterHoverClasses}
|
|
82
|
+
appliedFilterBackgroundClasses={appliedFilterBackgroundClasses}
|
|
83
|
+
onRemoveFilter={onRemoveFilter}
|
|
84
|
+
/>
|
|
85
|
+
<DynamicFiltersScrollbar
|
|
86
|
+
availableDynamicFilters={availableDynamicFilters}
|
|
87
|
+
filterBarClassNames={filterBarClasses}
|
|
88
|
+
filterDefaultClasses={filterDefaultClasses}
|
|
89
|
+
filterHoverClasses={filterHoverClasses}
|
|
90
|
+
onToggleDynamicFilter={onToggleDynamicFilter}
|
|
91
|
+
/>
|
|
92
|
+
<ProductGrid
|
|
93
|
+
productList={productList}
|
|
94
|
+
productGridVariant={productGridVariant}
|
|
95
|
+
productGridClasses={productGridClasses}
|
|
96
|
+
searchResponseId={searchResponseId}
|
|
97
|
+
merchantShortName={''}
|
|
98
|
+
handleClick={function (clickedUrl: string): void {
|
|
99
|
+
console.log(clickedUrl);
|
|
100
|
+
throw new Error('Function not implemented.');
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
</motion.div>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Text } from 'src/components/common/Text/Text';
|
|
2
|
+
import { SparkleAnimation } from 'src/components/common/SparkleAnimation/SparkleAnimation';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
import { ProductGridVariant } from 'src/components/common/ProductCard/types';
|
|
5
|
+
import { ProductCardSkeleton } from 'src/components/common/ProductCard/ProductCardSkeleton';
|
|
6
|
+
import { productGridVariantClasses } from 'src/components/common/ProductGrid/productGridVariants';
|
|
7
|
+
|
|
8
|
+
export const SearchResultsLoadingGrid = ({
|
|
9
|
+
productGridVariant,
|
|
10
|
+
productGridClasses,
|
|
11
|
+
sparkleIconColor = 'var(--spiffy-colors-accent-primary)',
|
|
12
|
+
}: {
|
|
13
|
+
productGridVariant: ProductGridVariant;
|
|
14
|
+
productGridClasses: string;
|
|
15
|
+
sparkleIconColor?: string;
|
|
16
|
+
}) => {
|
|
17
|
+
const { productCardLayoutVariant, productCardImageAspectRatio } =
|
|
18
|
+
productGridVariantClasses[productGridVariant];
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<motion.div
|
|
22
|
+
className="spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden"
|
|
23
|
+
initial={{ opacity: 0 }}
|
|
24
|
+
animate={{ opacity: 1 }}
|
|
25
|
+
exit={{ opacity: 0 }}
|
|
26
|
+
transition={{ duration: 0.2 }}
|
|
27
|
+
>
|
|
28
|
+
<div className="spiffy-tw-mt-6 spiffy-tw-w-full">
|
|
29
|
+
<div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-mb-4">
|
|
30
|
+
<div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-2 spiffy-tw-ml-[16px] md:spiffy-tw-ml-[80px]">
|
|
31
|
+
<div className="spiffy-tw-width-[24px]">
|
|
32
|
+
<SparkleAnimation color={sparkleIconColor} animate={true} />
|
|
33
|
+
</div>
|
|
34
|
+
<Text variant="body2">Finding the best options for you...</Text>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<div className={productGridClasses}>
|
|
38
|
+
{Array.from({ length: 8 }).map((_, index) => (
|
|
39
|
+
<ProductCardSkeleton
|
|
40
|
+
key={index}
|
|
41
|
+
layoutVariant={productCardLayoutVariant}
|
|
42
|
+
aspectRatio={productCardImageAspectRatio}
|
|
43
|
+
growWithContainer={true}
|
|
44
|
+
/>
|
|
45
|
+
))}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</motion.div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Chat element display location enum
|
|
2
|
+
export enum ChatElementDisplayLocation {
|
|
3
|
+
IN_CHAT = 'in_chat',
|
|
4
|
+
CHAT_PREVIEW = 'chat_preview',
|
|
5
|
+
FLOATING_BUTTON = 'floating_button',
|
|
6
|
+
HELP_ME_CHOOSE = 'help_me_choose',
|
|
7
|
+
PLP_IMAGE_BANNER = 'plp_image_banner',
|
|
8
|
+
TOP_REVIEWS_SNIPPET = 'top_reviews_snippet',
|
|
9
|
+
BOTTOM_REVIEWS_SNIPPET = 'bottom_reviews_snippet',
|
|
10
|
+
BLOCK_BACK_BUTTON = 'block_back_button',
|
|
11
|
+
SWITCH_TO_AGENT = 'switch_to_agent',
|
|
12
|
+
CONVERSATIONAL_SEARCH = 'conversational_search',
|
|
13
|
+
GLOBAL_SEARCH_ENTRYPOINT = 'global_search_entrypoint',
|
|
14
|
+
SEARCH_NAV_ENTRYPOINT = 'search_nav_entrypoint',
|
|
15
|
+
SEARCH_PROMPT = 'search_prompt',
|
|
16
|
+
SEARCH_PROMPT_BUTTON = 'search_prompt_button',
|
|
17
|
+
PRODUCT_GRID = 'product_grid',
|
|
18
|
+
UNSPECIFIED = 'unspecified',
|
|
19
|
+
FILTER_MODAL = 'filter_modal',
|
|
20
|
+
PROMPT_CARD = 'prompt_card',
|
|
21
|
+
WINDOW_API_CALL = 'window_api_call',
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
|
|
3
|
+
class Logger {
|
|
4
|
+
static logInfo(message: string, ...args: unknown[]): void {
|
|
5
|
+
console.info(`INFO: ${message}`, ...args);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static logDebug(message: string, ...args: unknown[]): void {
|
|
9
|
+
console.debug(`DEBUG: ${message}`, ...args);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static logError(message: string, error: unknown | undefined, ...args: unknown[]): void {
|
|
13
|
+
console.error(`ERROR: ${message} error=${error}`, args);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static logWarn(message: string, error: unknown | undefined, ...args: unknown[]): void {
|
|
17
|
+
console.warn(`WARN: ${message} error=${error}`, args);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Logger;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Local type definitions for external dependencies that may not be available
|
|
2
|
+
|
|
3
|
+
export enum ResponseCategory {
|
|
4
|
+
Product = 'product',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface SearchResponseProduct {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
price?: number;
|
|
12
|
+
currency?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
brand?: string;
|
|
15
|
+
category?: string;
|
|
16
|
+
availability?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
responseId?: string;
|
|
19
|
+
originalPrice?: number;
|
|
20
|
+
salePrice?: number;
|
|
21
|
+
averageRating?: number;
|
|
22
|
+
numberReviews?: number;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
+
// these types come from https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts
|
|
2
|
+
|
|
1
3
|
import type { SplitWords } from './splitWords';
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* CamelCase options.
|
|
4
7
|
*
|
|
5
8
|
* @see {@link CamelCase}
|
|
6
9
|
*/
|
|
7
10
|
export type CamelCaseOptions = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Whether to preserved consecutive uppercase letter.
|
|
13
|
+
*
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
preserveConsecutiveUppercase?: boolean;
|
|
14
17
|
};
|
|
18
|
+
|
|
15
19
|
/**
|
|
16
20
|
* Convert an array of words to camel-case.
|
|
17
21
|
*/
|
|
18
|
-
type CamelCaseFromArray<
|
|
22
|
+
type CamelCaseFromArray<
|
|
23
|
+
Words extends string[],
|
|
24
|
+
Options extends CamelCaseOptions,
|
|
25
|
+
OutputString extends string = '',
|
|
26
|
+
> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]]
|
|
27
|
+
? Options['preserveConsecutiveUppercase'] extends true
|
|
28
|
+
? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}`
|
|
29
|
+
: `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}`
|
|
30
|
+
: OutputString;
|
|
31
|
+
|
|
19
32
|
/**
|
|
20
33
|
* Convert a string literal to camel-case.
|
|
21
34
|
*
|
|
@@ -59,7 +72,16 @@ type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions
|
|
|
59
72
|
* @category Change case
|
|
60
73
|
* @category Template literal
|
|
61
74
|
*/
|
|
62
|
-
export type CamelCase<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
export type CamelCase<
|
|
76
|
+
Type,
|
|
77
|
+
Options extends CamelCaseOptions = { preserveConsecutiveUppercase: true },
|
|
78
|
+
> = Type extends string
|
|
79
|
+
? string extends Type
|
|
80
|
+
? Type
|
|
81
|
+
: Uncapitalize<
|
|
82
|
+
CamelCaseFromArray<
|
|
83
|
+
SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>,
|
|
84
|
+
Options
|
|
85
|
+
>
|
|
86
|
+
>
|
|
87
|
+
: Type;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
+
import type { CamelCase, CamelCaseOptions } from './camelCase';
|
|
3
|
+
import type { UnknownArray } from './unknownArray';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Convert object properties to camel case recursively.
|
|
7
|
+
*
|
|
8
|
+
* This can be useful when, for example, converting some API types from a different style.
|
|
9
|
+
*
|
|
10
|
+
* @see CamelCasedProperties
|
|
11
|
+
* @see CamelCase
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* import type {CamelCasedPropertiesDeep} from 'type-fest';
|
|
16
|
+
*
|
|
17
|
+
* interface User {
|
|
18
|
+
* UserId: number;
|
|
19
|
+
* UserName: string;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* interface UserWithFriends {
|
|
23
|
+
* UserInfo: User;
|
|
24
|
+
* UserFriends: User[];
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* const result: CamelCasedPropertiesDeep<UserWithFriends> = {
|
|
28
|
+
* userInfo: {
|
|
29
|
+
* userId: 1,
|
|
30
|
+
* userName: 'Tom',
|
|
31
|
+
* },
|
|
32
|
+
* userFriends: [
|
|
33
|
+
* {
|
|
34
|
+
* userId: 2,
|
|
35
|
+
* userName: 'Jerry',
|
|
36
|
+
* },
|
|
37
|
+
* {
|
|
38
|
+
* userId: 3,
|
|
39
|
+
* userName: 'Spike',
|
|
40
|
+
* },
|
|
41
|
+
* ],
|
|
42
|
+
* };
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @category Change case
|
|
46
|
+
* @category Template literal
|
|
47
|
+
* @category Object
|
|
48
|
+
*/
|
|
49
|
+
export type CamelCasedPropertiesDeep<
|
|
50
|
+
Value,
|
|
51
|
+
Options extends CamelCaseOptions = { preserveConsecutiveUppercase: true },
|
|
52
|
+
> = Value extends Function
|
|
53
|
+
? Value
|
|
54
|
+
: Value extends UnknownArray
|
|
55
|
+
? CamelCasedPropertiesArrayDeep<Value>
|
|
56
|
+
: Value extends Set<infer U>
|
|
57
|
+
? Set<CamelCasedPropertiesDeep<U, Options>>
|
|
58
|
+
: {
|
|
59
|
+
[K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// This is a copy of DelimiterCasedPropertiesArrayDeep (see: delimiter-cased-properties-deep.d.ts).
|
|
63
|
+
// These types should be kept in sync.
|
|
64
|
+
type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends []
|
|
65
|
+
? []
|
|
66
|
+
: // Tailing spread array
|
|
67
|
+
Value extends [infer U, ...infer V]
|
|
68
|
+
? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
|
|
69
|
+
: Value extends readonly [infer U, ...infer V]
|
|
70
|
+
? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
|
|
71
|
+
: // Leading spread array
|
|
72
|
+
Value extends readonly [...infer U, infer V]
|
|
73
|
+
? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
|
|
74
|
+
: Value extends readonly [...infer U, infer V]
|
|
75
|
+
? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
|
|
76
|
+
: // Array
|
|
77
|
+
Value extends Array<infer U>
|
|
78
|
+
? Array<CamelCasedPropertiesDeep<U>>
|
|
79
|
+
: Value extends ReadonlyArray<infer U>
|
|
80
|
+
? ReadonlyArray<CamelCasedPropertiesDeep<U>>
|
|
81
|
+
: never;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const formatPrice = (price?: number, currency: string = '$'): string => {
|
|
2
|
+
if (price == null) {
|
|
3
|
+
return '';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const options: Intl.NumberFormatOptions = {};
|
|
7
|
+
|
|
8
|
+
if (!Number.isInteger(price)) {
|
|
9
|
+
options.minimumFractionDigits = 2;
|
|
10
|
+
options.maximumFractionDigits = 2;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return `${currency}${price.toLocaleString('en-US', options)}`;
|
|
14
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
3
|
+
// these types come from https://github.com/sindresorhus/type-fest/blob/main/source/internal.d.ts
|
|
4
|
+
|
|
5
|
+
import type { Primitive } from './primitive';
|
|
6
|
+
import type { Trim } from './trim';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
10
|
+
*/
|
|
11
|
+
export type BuiltIns = Primitive | void | Date | RegExp;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Matches non-recursive types.
|
|
15
|
+
*/
|
|
16
|
+
export type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Returns a boolean for whether the string is numeric.
|
|
20
|
+
*
|
|
21
|
+
* This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
|
|
22
|
+
*/
|
|
23
|
+
export type IsNumeric<T extends string> = T extends `${number}`
|
|
24
|
+
? Trim<T> extends T
|
|
25
|
+
? true
|
|
26
|
+
: false
|
|
27
|
+
: false;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns a boolean for whether the string is lowercased.
|
|
31
|
+
*/
|
|
32
|
+
export type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns a boolean for whether the string is upper-cased.
|
|
36
|
+
*/
|
|
37
|
+
export type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
|
|
38
|
+
|
|
39
|
+
export type WordSeparators = '-' | '_' | Whitespace;
|
|
40
|
+
|
|
41
|
+
export type Whitespace =
|
|
42
|
+
| '\u{9}' // '\t'
|
|
43
|
+
| '\u{A}' // '\n'
|
|
44
|
+
| '\u{B}' // '\v'
|
|
45
|
+
| '\u{C}' // '\f'
|
|
46
|
+
| '\u{D}' // '\r'
|
|
47
|
+
| '\u{20}' // ' '
|
|
48
|
+
| '\u{85}'
|
|
49
|
+
| '\u{A0}'
|
|
50
|
+
| '\u{1680}'
|
|
51
|
+
| '\u{2000}'
|
|
52
|
+
| '\u{2001}'
|
|
53
|
+
| '\u{2002}'
|
|
54
|
+
| '\u{2003}'
|
|
55
|
+
| '\u{2004}'
|
|
56
|
+
| '\u{2005}'
|
|
57
|
+
| '\u{2006}'
|
|
58
|
+
| '\u{2007}'
|
|
59
|
+
| '\u{2008}'
|
|
60
|
+
| '\u{2009}'
|
|
61
|
+
| '\u{200A}'
|
|
62
|
+
| '\u{2028}'
|
|
63
|
+
| '\u{2029}'
|
|
64
|
+
| '\u{202F}'
|
|
65
|
+
| '\u{205F}'
|
|
66
|
+
| '\u{3000}'
|
|
67
|
+
| '\u{FEFF}';
|
|
68
|
+
|
|
69
|
+
export type UpperCaseCharacters =
|
|
70
|
+
| 'A'
|
|
71
|
+
| 'B'
|
|
72
|
+
| 'C'
|
|
73
|
+
| 'D'
|
|
74
|
+
| 'E'
|
|
75
|
+
| 'F'
|
|
76
|
+
| 'G'
|
|
77
|
+
| 'H'
|
|
78
|
+
| 'I'
|
|
79
|
+
| 'J'
|
|
80
|
+
| 'K'
|
|
81
|
+
| 'L'
|
|
82
|
+
| 'M'
|
|
83
|
+
| 'N'
|
|
84
|
+
| 'O'
|
|
85
|
+
| 'P'
|
|
86
|
+
| 'Q'
|
|
87
|
+
| 'R'
|
|
88
|
+
| 'S'
|
|
89
|
+
| 'T'
|
|
90
|
+
| 'U'
|
|
91
|
+
| 'V'
|
|
92
|
+
| 'W'
|
|
93
|
+
| 'X'
|
|
94
|
+
| 'Y'
|
|
95
|
+
| 'Z';
|