@envive-ai/react-toolkit 0.2.11 → 0.2.13-arthur-1
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-B8aUlf0q.js → Accordion-8zFBEEaN.js} +25 -6
- package/dist/{Accordion-FyCFBOen.cjs → Accordion-DPUaEXiE.cjs} +23 -8
- package/dist/{AnimatedChevron-wpcAHp6d.cjs → AnimatedChevron-CPW5KPLr.cjs} +0 -2
- package/dist/{AnimatedChevron-Dee6Pe81.js → AnimatedChevron-DO_jcnJg.js} +1 -1
- package/dist/{ButtonBase-B6vDKbGQ.cjs → ButtonBase-C44g6llb.cjs} +1 -3
- package/dist/{ButtonBase-Bpc7nOpz.js → ButtonBase-Cjo-fBg2.js} +3 -3
- package/dist/{DynamicFiltersScrollbar-DIwHWq6v.cjs → DynamicFiltersScrollbar-IO886VXD.cjs} +3 -6
- package/dist/{DynamicFiltersScrollbar-D8OqC4DA.js → DynamicFiltersScrollbar-s5yfmMau.js} +5 -7
- package/dist/FourPointStar-3DqnYmfN.js +21 -0
- package/dist/FourPointStar-AQ9OSu0S.cjs +26 -0
- package/dist/{ImageWithFallback-DvaVpR6v.cjs → ImageWithFallback-C-ZQn7tR.cjs} +1 -2
- package/dist/{ImageWithFallback-BW57cQw-.js → ImageWithFallback-DjDNefaG.js} +2 -2
- package/dist/{ModalSheet-DFva7krP.js → ModalSheet-C5f5abw1.js} +12 -13
- package/dist/{ModalSheet-BvM2PJbH.cjs → ModalSheet-JZerJZ1T.cjs} +11 -16
- package/dist/OutlinedStar-CC0V_jAK.cjs +26 -0
- package/dist/OutlinedStar-WWs3gRwt.js +21 -0
- package/dist/{ProductCard-C2KvH4MN.cjs → ProductCard-C7rZyWpj.cjs} +31 -28
- package/dist/{ProductCard-BiWAcPO4.js → ProductCard-GxpFxjh0.js} +19 -24
- package/dist/{ProductGrid-DkOyRAEg.cjs → ProductGrid-0A8vml2y.cjs} +2 -3
- package/dist/{ProductGrid-B1RtE58G.js → ProductGrid-DAwc9dKV.js} +3 -3
- package/dist/{RadioButton-CQ6qOvBl.js → RadioButton-DOc8g47U.js} +3 -3
- package/dist/{RadioButton-DP-qs5cy.cjs → RadioButton-DpF1wymL.cjs} +1 -3
- package/dist/{RadioButtonGroup-CJPWfAaA.cjs → RadioButtonGroup-ByzTXNAb.cjs} +2 -3
- package/dist/{RadioButtonGroup-Ce8cKqYw.js → RadioButtonGroup-YQIxmR7j.js} +3 -3
- package/dist/RecommendedProducts-C6dLpLPP.js +49 -0
- package/dist/RecommendedProducts-qkPxXVJn.cjs +56 -0
- package/dist/{SearchAutocomplete-bbMvWWjI.cjs → SearchAutocomplete-BdTWETDB.cjs} +5 -9
- package/dist/{SearchAutocomplete-CjjL2_lm.js → SearchAutocomplete-DNe193EV.js} +7 -8
- package/dist/{SearchFilter-BLi6E9Wx.cjs → SearchFilter-BRtCSuAn.cjs} +38 -44
- package/dist/{SearchFilter-wHwOym_n.js → SearchFilter-DvJx0b0W.js} +40 -44
- package/dist/{SearchInput-BA6bepV_.cjs → SearchInput-CImlqrau.cjs} +64 -13
- package/dist/{SearchInput-C3nNkmBm.js → SearchInput-kLhxkpgq.js} +64 -9
- package/dist/{SearchInputForm/index.js → SearchInputForm-CFm_hUvX.js} +7 -9
- package/dist/{SearchInputForm/index.cjs → SearchInputForm-ZgNNEX6E.cjs} +13 -12
- package/dist/SearchResultsFilterButton-D929tRt9.cjs +96 -0
- package/dist/SearchResultsFilterButton-Dk7u7rgn.js +90 -0
- package/dist/{SearchResultsFilterSidebar/index.cjs → SearchResultsFilterSidebar-BRFONIEq.cjs} +11 -18
- package/dist/{SearchResultsFilterSidebar/index.js → SearchResultsFilterSidebar-DLzQoFGD.js} +5 -14
- package/dist/SearchResultsStates-CQR5Il4l.cjs +196 -0
- package/dist/SearchResultsStates-D7HfsLeZ.js +177 -0
- package/dist/{SparkleAnimation-BFAj73CF.cjs → SparkleAnimation-BikAiAmb.cjs} +20 -15
- package/dist/{SparkleAnimation-BYDUEqWX.js → SparkleAnimation-szzXiTam.js} +15 -12
- package/dist/{Spinner-Ccy6VFEp.cjs → Spinner-7HblFCja.cjs} +1 -2
- package/dist/{Spinner-D2HbRsuw.js → Spinner-OFbXMms8.js} +2 -2
- package/dist/{TextInput-CYTko3-n.cjs → TextInput-CaynCoDf.cjs} +3 -5
- package/dist/{TextInput-CmxnphaT.js → TextInput-CsdOvLBQ.js} +5 -6
- package/dist/{ToggleButton-V9Qsaks7.js → ToggleButton-D8--AKKK.js} +3 -3
- package/dist/{ToggleButton-CvxNLMe_.cjs → ToggleButton-Dxk3U1hR.cjs} +1 -2
- package/dist/{Typography-C3QmJzFK.js → Typography-xehJH05l.js} +1 -1
- package/dist/colorsConfig-CFI1KN8R.js +26 -0
- package/dist/colorsConfig-Dp7w5LPb.cjs +38 -0
- package/dist/{Accordion/index.d.ts → components/Accordion/index-D_7-KJa0.d.cts} +2 -2
- package/dist/{Accordion/index.d.cts → components/Accordion/index-Dd_9XeqA.d.ts} +2 -2
- package/dist/components/Accordion/index.cjs +5 -0
- package/dist/components/Accordion/index.js +5 -0
- package/dist/{AnimatedChevron/index.d.cts → components/AnimatedChevron/index-BwQ6tJL8.d.cts} +2 -2
- package/dist/{AnimatedChevron/index.d.ts → components/AnimatedChevron/index-DZdGWikh.d.ts} +2 -2
- package/dist/components/AnimatedChevron/index.cjs +3 -0
- package/dist/components/AnimatedChevron/index.js +3 -0
- package/dist/{AppliedFiltersScrollbar/index.d.ts → components/AppliedFiltersScrollbar/index-Dcyc-5Bv.d.ts} +3 -3
- package/dist/{AppliedFiltersScrollbar/index.d.cts → components/AppliedFiltersScrollbar/index-VbXAIfym.d.cts} +3 -3
- package/dist/{AppliedFiltersScrollbar → components/AppliedFiltersScrollbar}/index.cjs +4 -6
- package/dist/{AppliedFiltersScrollbar → components/AppliedFiltersScrollbar}/index.js +3 -4
- package/dist/{ButtonBase/index.d.ts → components/ButtonBase/index-Bxdhf_O8.d.cts} +3 -3
- package/dist/{ButtonBase/index.d.cts → components/ButtonBase/index-VoanK6Pr.d.ts} +3 -3
- package/dist/components/ButtonBase/index.cjs +6 -0
- package/dist/components/ButtonBase/index.js +5 -0
- package/dist/{DynamicFiltersScrollbar/index.d.cts → components/DynamicFiltersScrollbar/index-CHzxQmaW.d.cts} +2 -2
- package/dist/{DynamicFiltersScrollbar/index.d.ts → components/DynamicFiltersScrollbar/index-vVNOOaOF.d.ts} +2 -2
- package/dist/{DynamicFiltersScrollbar → components/DynamicFiltersScrollbar}/index.cjs +4 -6
- package/dist/{DynamicFiltersScrollbar → components/DynamicFiltersScrollbar}/index.js +3 -4
- package/dist/{FilterScrollbar/index.d.cts → components/FilterScrollbar/index-DXcZLcQi.d.cts} +4 -4
- package/dist/{FilterScrollbar/index.d.ts → components/FilterScrollbar/index-DwLyxqQl.d.ts} +4 -4
- package/dist/components/FilterScrollbar/index.cjs +5 -0
- package/dist/components/FilterScrollbar/index.js +4 -0
- package/dist/{ImageWithFallback/index.d.cts → components/ImageWithFallback/index-BLbkDyG8.d.cts} +2 -2
- package/dist/{ImageWithFallback/index.d.ts → components/ImageWithFallback/index-NJZsMOXc.d.ts} +2 -2
- package/dist/components/ImageWithFallback/index.cjs +3 -0
- package/dist/components/ImageWithFallback/index.js +3 -0
- package/dist/{ModalSheet/index.d.cts → components/ModalSheet/index-B5q4MHdq.d.cts} +2 -2
- package/dist/{ModalSheet/index.d.ts → components/ModalSheet/index-BN20-QS0.d.ts} +2 -2
- package/dist/components/ModalSheet/index.cjs +4 -0
- package/dist/components/ModalSheet/index.js +4 -0
- package/dist/components/ProductCard/index-CglXQ3wh.d.ts +2 -0
- package/dist/components/ProductCard/index-XVlN6iMl.d.cts +2 -0
- package/dist/{ProductCard → components/ProductCard}/index.cjs +7 -4
- package/dist/components/ProductCard/index.js +7 -0
- package/dist/{ProductGrid/index.d.ts → components/ProductGrid/index-BPBgwFsa.d.cts} +4 -3
- package/dist/{ProductGrid/index.d.cts → components/ProductGrid/index-D_YpwJCd.d.ts} +4 -3
- package/dist/components/ProductGrid/index.cjs +9 -0
- package/dist/components/ProductGrid/index.js +8 -0
- package/dist/{RadioButton/index.d.cts → components/RadioButton/index-BeOT_AlW.d.cts} +3 -3
- package/dist/{RadioButton/index.d.ts → components/RadioButton/index-CxluCaJw.d.ts} +3 -3
- package/dist/components/RadioButton/index.cjs +4 -0
- package/dist/components/RadioButton/index.js +4 -0
- package/dist/{RadioButtonGroup/index.d.cts → components/RadioButtonGroup/index-BOhV-rG3.d.cts} +3 -3
- package/dist/{RadioButtonGroup/index.d.ts → components/RadioButtonGroup/index-KeOIiYNW.d.ts} +3 -3
- package/dist/components/RadioButtonGroup/index.cjs +6 -0
- package/dist/components/RadioButtonGroup/index.js +5 -0
- package/dist/components/RecommendedProducts/index-BFM83Qu3.d.cts +15 -0
- package/dist/components/RecommendedProducts/index-DlbCfGof.d.ts +15 -0
- package/dist/components/RecommendedProducts/index.cjs +12 -0
- package/dist/components/RecommendedProducts/index.js +12 -0
- package/dist/{SearchAutocomplete/index.d.cts → components/SearchAutocomplete/index-BcnHcv7Q.d.cts} +2 -2
- package/dist/{SearchAutocomplete/index.d.ts → components/SearchAutocomplete/index-Br_POGOz.d.ts} +2 -2
- package/dist/components/SearchAutocomplete/index.cjs +6 -0
- package/dist/components/SearchAutocomplete/index.js +6 -0
- package/dist/components/SearchFilter/index-BbIqmoO8.d.ts +91 -0
- package/dist/components/SearchFilter/index-DAL3Wl6U.d.cts +91 -0
- package/dist/components/SearchFilter/index.cjs +18 -0
- package/dist/components/SearchFilter/index.js +13 -0
- package/dist/{SearchInput/index.d.cts → components/SearchInput/index-C0H51Flv.d.ts} +4 -3
- package/dist/{SearchInput/index.d.ts → components/SearchInput/index-rFDdhvqg.d.cts} +4 -3
- package/dist/components/SearchInput/index.cjs +8 -0
- package/dist/components/SearchInput/index.js +7 -0
- package/dist/{SearchInputForm/index.d.cts → components/SearchInputForm/index-Cleto06d.d.cts} +4 -2
- package/dist/{SearchInputForm/index.d.ts → components/SearchInputForm/index-DjjoY7MQ.d.ts} +6 -4
- package/dist/components/SearchInputForm/index.cjs +10 -0
- package/dist/components/SearchInputForm/index.js +10 -0
- package/dist/{SearchResultsContent/index.d.ts → components/SearchResultsContent/index-C4qsTFUd.d.cts} +19 -7
- package/dist/{SearchResultsContent/index.d.cts → components/SearchResultsContent/index-KdFf9yzs.d.ts} +17 -5
- package/dist/components/SearchResultsContent/index.cjs +62 -0
- package/dist/components/SearchResultsContent/index.js +60 -0
- package/dist/components/SearchResultsFilterButton/index-BvntKdyC.d.ts +13 -0
- package/dist/components/SearchResultsFilterButton/index-zgQsT6vz.d.cts +13 -0
- package/dist/components/SearchResultsFilterButton/index.cjs +10 -0
- package/dist/components/SearchResultsFilterButton/index.js +10 -0
- package/dist/components/SearchResultsFilterModal/index-CNBQ1ikL.d.ts +27 -0
- package/dist/components/SearchResultsFilterModal/index-mRcnKysU.d.cts +27 -0
- package/dist/components/SearchResultsFilterModal/index.cjs +48 -0
- package/dist/components/SearchResultsFilterModal/index.js +47 -0
- package/dist/components/SearchResultsFilterSidebar/index-C7PE9z5a.d.ts +2 -0
- package/dist/components/SearchResultsFilterSidebar/index-DKzEKFV3.d.cts +2 -0
- package/dist/components/SearchResultsFilterSidebar/index.cjs +17 -0
- package/dist/components/SearchResultsFilterSidebar/index.js +16 -0
- package/dist/{SearchResultsStates/index.d.ts → components/SearchResultsStates/index-Dugoegtn.d.ts} +20 -9
- package/dist/{SearchResultsStates/index.d.cts → components/SearchResultsStates/index-RVgPTFiH.d.cts} +16 -5
- package/dist/components/SearchResultsStates/index.cjs +18 -0
- package/dist/components/SearchResultsStates/index.js +16 -0
- package/dist/components/SearchResultsToolbar/index-CIvuccni.d.ts +49 -0
- package/dist/components/SearchResultsToolbar/index-PYr086HM.d.cts +49 -0
- package/dist/components/SearchResultsToolbar/index.cjs +68 -0
- package/dist/components/SearchResultsToolbar/index.js +65 -0
- package/dist/components/SparkleAnimation/index-BFqUibyY.d.ts +23 -0
- package/dist/components/SparkleAnimation/index-CSBR76H5.d.cts +23 -0
- package/dist/components/SparkleAnimation/index.cjs +6 -0
- package/dist/components/SparkleAnimation/index.js +5 -0
- package/dist/{Spinner/index.d.cts → components/Spinner/index-DrYhRG9D.d.cts} +2 -2
- package/dist/{Spinner/index.d.ts → components/Spinner/index-TKsPifGM.d.ts} +2 -2
- package/dist/components/Spinner/index.cjs +3 -0
- package/dist/components/Spinner/index.js +3 -0
- package/dist/{SuggestionButton/index.d.cts → components/SuggestionButton/index-BioM3QHW.d.ts} +3 -3
- package/dist/{SuggestionButton/index.d.ts → components/SuggestionButton/index-CjV6Ar4Y.d.cts} +3 -3
- package/dist/{SuggestionButton → components/SuggestionButton}/index.cjs +11 -14
- package/dist/{SuggestionButton → components/SuggestionButton}/index.js +10 -10
- package/dist/{TextInput/index.d.cts → components/TextInput/index-CRJMRe-b.d.cts} +2 -2
- package/dist/{TextInput/index.d.ts → components/TextInput/index-DAhxej1K.d.ts} +2 -2
- package/dist/components/TextInput/index.cjs +4 -0
- package/dist/components/TextInput/index.js +4 -0
- package/dist/{ToggleButton/index.d.cts → components/ToggleButton/index-eLDrp4ic.d.cts} +2 -2
- package/dist/{ToggleButton/index.d.ts → components/ToggleButton/index-pFQuGdoj.d.ts} +2 -2
- package/dist/components/ToggleButton/index.cjs +4 -0
- package/dist/components/ToggleButton/index.js +4 -0
- package/dist/components/Typography/index-DzSBreyM.d.cts +3 -0
- package/dist/components/Typography/index-ymH7f3jB.d.ts +3 -0
- package/dist/{Typography → components/Typography}/index.cjs +1 -1
- package/dist/components/Typography/index.js +3 -0
- package/dist/formatPrice-CyfkjZ3R.cjs +19 -0
- package/dist/formatPrice-DexQu2aZ.js +13 -0
- package/dist/index-BCBtAzCc.d.ts +325 -0
- package/dist/{SearchResultsFilterSidebar/index.d.ts → index-BiKhzraQ.d.cts} +9 -5
- package/dist/{index-DoTNu3mL.d.cts → index-Bw6lDfEp.d.cts} +2 -2
- package/dist/index-CzbumwVZ.d.cts +325 -0
- package/dist/{SearchResultsFilterSidebar/index.d.cts → index-DK0xpfMg.d.ts} +9 -5
- package/dist/{index-C5iOTsRG.d.ts → index-DXGw5Z56.d.ts} +2 -2
- package/dist/jsx-runtime-Dg2m6dxZ-B-pkyyHT.cjs +2586 -0
- package/dist/jsx-runtime-Dg2m6dxZ-CU_SzTu4.js +2580 -0
- package/dist/{searchFilterSidebarVariants-BQ7OC862.cjs → searchFilterSidebarVariants-CjyRGKK_.cjs} +7 -10
- package/dist/{searchFilterSidebarVariants-C_rWIcxf.js → searchFilterSidebarVariants-gkgkflXx.js} +2 -3
- package/dist/types--eyQnaEA.d.cts +4 -0
- package/dist/types-D6fl4HOx.d.ts +4 -0
- package/dist/{typographyVariantClasses-BFRoEloZ.d.cts → typographyVariantClasses-CoRhazCU.d.cts} +1 -1
- package/dist/{typographyVariantClasses-D7h3ACAj.d.ts → typographyVariantClasses-_oNpv-aN.d.ts} +1 -1
- package/dist/util/index-C2ueYGXh.d.ts +21 -0
- package/dist/util/index-DUzbpjPa.d.cts +21 -0
- package/dist/util/index.cjs +80 -0
- package/dist/util/index.js +76 -0
- package/package.json +79 -53
- package/src/atoms/search/types.ts +1 -0
- package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +1 -1
- package/src/components/ButtonBase/types.ts +1 -1
- package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +1 -1
- package/src/components/ProductCard/ProductCard.tsx +12 -12
- package/src/components/ProductCard/ProductCardSkeleton.tsx +1 -13
- package/src/components/ProductCard/index.ts +1 -0
- package/src/components/ProductCard/productCardVariants.ts +1 -1
- package/src/components/ProductCard/types.ts +49 -0
- package/src/components/ProductGrid/ProductGrid.tsx +2 -6
- package/src/components/ProductGrid/productGridVariants.ts +1 -1
- package/src/components/RadioButton/RadioButton.tsx +1 -1
- package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +1 -1
- package/src/components/RecommendedProducts/RecommendedProducts.tsx +97 -0
- package/src/components/RecommendedProducts/index.ts +3 -0
- package/src/components/SearchFilter/SearchFilter.tsx +2 -1
- package/src/components/SearchFilter/SearchFilterFooter.tsx +1 -1
- package/src/components/SearchFilter/SearchFilterHeader.tsx +1 -1
- package/src/components/SearchFilter/SearchFilterItem.tsx +1 -1
- package/src/components/SearchFilter/types.ts +45 -0
- package/src/components/SearchFilter/useHasFilterStateChanged.tsx +1 -1
- package/src/components/SearchFilter/utils.ts +1 -1
- package/src/components/SearchInput/SearchInput.tsx +1 -1
- package/src/components/SearchInput/searchInputVariants.ts +2 -2
- package/src/components/SearchInputForm/SearchInputForm.tsx +10 -4
- package/src/components/SearchResultsContent/SearchResultsContent.tsx +72 -39
- package/src/components/SearchResultsFilterButton/SearchResultsFilterButton.tsx +30 -0
- package/src/components/SearchResultsFilterButton/index.ts +3 -0
- package/src/components/SearchResultsFilterModal/SearchResultsFilterModal.tsx +61 -0
- package/src/components/SearchResultsFilterModal/index.ts +3 -0
- package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -1
- package/src/components/SearchResultsFilterSidebar/index.ts +1 -0
- package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +2 -2
- package/src/components/SearchResultsFilterSidebar/types.ts +2 -0
- package/src/components/SearchResultsStates/NoSearchResultsFound.tsx +43 -11
- package/src/components/SearchResultsStates/SearchResultsGrid.tsx +8 -7
- package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +1 -2
- package/src/components/SearchResultsToolbar/SearchResultsToolbar.tsx +111 -0
- package/src/components/SearchResultsToolbar/index.ts +3 -0
- package/src/components/SparkleAnimation/SparkleAnimation.tsx +1 -7
- package/src/components/SparkleAnimation/index.ts +1 -0
- package/src/components/SparkleAnimation/types.ts +6 -0
- package/src/components/SuggestionButton/SuggestionButton.tsx +1 -1
- package/src/config/chatElementDisplayLocation.ts +23 -0
- package/src/models/colorsConfig.ts +28 -0
- package/src/stories/AppliedFiltersScrollbar.stories.tsx +42 -0
- package/src/stories/ButtonBase.stories.tsx +54 -0
- package/src/stories/DynamicFiltersScrollbar.stories.tsx +42 -0
- package/src/stories/NoSearchResultsFound.stories.tsx +30 -0
- package/src/stories/ProductCard.stories.tsx +78 -0
- package/src/stories/ProductCardSkeleton.stories.tsx +48 -0
- package/src/stories/ProductGrid.stories.tsx +82 -0
- package/src/stories/SearchInputForm.stories.tsx +39 -0
- package/src/stories/SearchResultsFilter.stories.tsx +56 -0
- package/src/stories/SearchResultsGrid.stories.tsx +98 -0
- package/src/stories/SearchResultsLoadingGrid.stories.tsx +30 -0
- package/src/stories/SparkleAnimation.stories.tsx +47 -0
- package/src/stories/Typography.stories.tsx +140 -0
- package/src/util/camelCase.ts +87 -0
- package/src/util/camelCasedPropertiesDeep.ts +81 -0
- package/src/util/colorVar.ts +1 -1
- package/src/util/index.ts +4 -0
- package/src/util/internal.ts +97 -0
- package/src/util/primitive.ts +8 -0
- package/src/util/splitWords.ts +76 -0
- package/src/util/trim.ts +28 -0
- package/src/util/unknownArray.ts +25 -0
- package/src/util/useScrollDirection.ts +60 -0
- package/src/util/useStickyVisibility.ts +37 -0
- package/dist/Accordion/index.cjs +0 -4
- package/dist/Accordion/index.js +0 -4
- package/dist/AnimatedChevron/index.cjs +0 -3
- package/dist/AnimatedChevron/index.js +0 -3
- package/dist/ButtonBase/index.cjs +0 -6
- package/dist/ButtonBase/index.js +0 -5
- package/dist/FilterScrollbar/index.cjs +0 -5
- package/dist/FilterScrollbar/index.js +0 -4
- package/dist/ImageWithFallback/index.cjs +0 -3
- package/dist/ImageWithFallback/index.js +0 -3
- package/dist/ModalSheet/index.cjs +0 -4
- package/dist/ModalSheet/index.js +0 -4
- package/dist/ProductCard/index.d.cts +0 -82
- package/dist/ProductCard/index.d.ts +0 -82
- package/dist/ProductCard/index.js +0 -6
- package/dist/ProductGrid/index.cjs +0 -8
- package/dist/ProductGrid/index.js +0 -7
- package/dist/RadioButton/index.cjs +0 -4
- package/dist/RadioButton/index.js +0 -4
- package/dist/RadioButtonGroup/index.cjs +0 -6
- package/dist/RadioButtonGroup/index.js +0 -5
- package/dist/SearchAutocomplete/index.cjs +0 -4
- package/dist/SearchAutocomplete/index.js +0 -4
- package/dist/SearchFilter/index.cjs +0 -17
- package/dist/SearchFilter/index.d.cts +0 -54
- package/dist/SearchFilter/index.d.ts +0 -54
- package/dist/SearchFilter/index.js +0 -12
- package/dist/SearchInput/index.cjs +0 -7
- package/dist/SearchInput/index.js +0 -6
- package/dist/SearchResultsContent/index.cjs +0 -44
- package/dist/SearchResultsContent/index.js +0 -41
- package/dist/SearchResultsStates/index.cjs +0 -14
- package/dist/SearchResultsStates/index.js +0 -12
- package/dist/SearchResultsStates-C-8fh8B9.cjs +0 -132
- package/dist/SearchResultsStates-D62WbDTD.js +0 -110
- package/dist/SparkleAnimation/index.cjs +0 -3
- package/dist/SparkleAnimation/index.d.cts +0 -15
- package/dist/SparkleAnimation/index.d.ts +0 -15
- package/dist/SparkleAnimation/index.js +0 -3
- package/dist/Spinner/index.cjs +0 -3
- package/dist/Spinner/index.js +0 -3
- package/dist/TextInput/index.cjs +0 -4
- package/dist/TextInput/index.js +0 -4
- package/dist/ToggleButton/index.cjs +0 -4
- package/dist/ToggleButton/index.js +0 -4
- package/dist/Typography/index.d.cts +0 -3
- package/dist/Typography/index.d.ts +0 -3
- package/dist/Typography/index.js +0 -3
- package/dist/colorVar-B5CLhSof.cjs +0 -11
- package/dist/colorVar-BJve0Z4_.js +0 -5
- /package/dist/{ButtonBase-DbWQ25n-.cjs → ButtonBase-Cb6Iec6f.cjs} +0 -0
- /package/dist/{ButtonBase-C_uKnl48.js → ButtonBase-D2eXuapk.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ResponseCategory, SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
2
|
+
import type { CamelCasedPropertiesDeep } from 'src/util/camelCasedPropertiesDeep';
|
|
3
|
+
|
|
4
|
+
export enum ProductCardSkeletonOverrides {
|
|
5
|
+
PRODUCT_CARD_SKELETON_CONTAINER = 'spiffy-product-card-skeleton-container',
|
|
6
|
+
PRODUCT_CARD_SKELETON = 'spiffy-product-card-skeleton',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum AnimatedProductCardOverrides {
|
|
10
|
+
PRODUCT_CARD_ANIMATED_CONTAINER = 'spiffy-product-card-animated-container',
|
|
11
|
+
PRODUCT_CARD_ANIMATED_IMAGE_CONTAINER = 'spiffy-product-card-animated',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ProductGridVariant = 'standard' | 'square';
|
|
15
|
+
|
|
16
|
+
export type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
|
|
17
|
+
|
|
18
|
+
export type ProductCardHoverVariant = 'backgroundDark' | 'none';
|
|
19
|
+
|
|
20
|
+
export type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
|
|
21
|
+
export type ProductCardImageAspectRatio = '3:4' | 'square' | 'none';
|
|
22
|
+
|
|
23
|
+
export interface ProductCardConfig {
|
|
24
|
+
variant: ProductCardVariant;
|
|
25
|
+
hoverVariant: ProductCardHoverVariant;
|
|
26
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
27
|
+
pricePrefix?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SearchResponseProductAttributes {
|
|
31
|
+
category: ResponseCategory.Product;
|
|
32
|
+
attributes: CamelCasedPropertiesDeep<SearchResponseProduct>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ProductCardSkeletonProps {
|
|
36
|
+
layoutVariant: ProductCardLayoutVariant;
|
|
37
|
+
aspectRatio: ProductCardImageAspectRatio;
|
|
38
|
+
growWithContainer?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ProductGridProps {
|
|
42
|
+
productList: SearchResponseProductAttributes['attributes'][];
|
|
43
|
+
productGridVariant: ProductGridVariant;
|
|
44
|
+
productGridClasses: string;
|
|
45
|
+
productCardConfig?: ProductCardConfig;
|
|
46
|
+
merchantShortName: string;
|
|
47
|
+
searchResponseId: string;
|
|
48
|
+
cardsGrowWithContainer?: boolean;
|
|
49
|
+
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
|
-
import {
|
|
3
|
-
SearchResponseProductAttributes,
|
|
4
|
-
ProductCardConfig,
|
|
5
|
-
ProductGridVariant,
|
|
6
|
-
} from '@envive-ai/types';
|
|
2
|
+
import { SearchResponseProductAttributes } from '@envive-ai/react-hooks/application/models';
|
|
7
3
|
import { productGridVariantClasses } from './productGridVariants';
|
|
8
|
-
import { ProductCard } from '../ProductCard';
|
|
4
|
+
import { ProductGridVariant, ProductCardConfig, ProductCard } from '../ProductCard';
|
|
9
5
|
|
|
10
6
|
interface ProductGridProps {
|
|
11
7
|
productList: SearchResponseProductAttributes['attributes'][];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { TestProps } from '@envive-ai/types';
|
|
3
|
+
import { TestProps } from '@envive-ai/react-hooks/types';
|
|
4
4
|
import { Typography } from '../Typography';
|
|
5
5
|
|
|
6
6
|
interface RadioButtonProps extends TestProps {
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { SearchResponseProductAttributes } from "@envive-ai/react-hooks/application/models";
|
|
2
|
+
import { ProductCardConfig, ProductGridVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { ProductGrid } from "../ProductGrid";
|
|
6
|
+
import { Typography } from "../Typography";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
interface RecommendedProductsProps {
|
|
10
|
+
retrievedProducts: SearchResponseProductAttributes['attributes'][];
|
|
11
|
+
merchantShortName: string;
|
|
12
|
+
productCardConfig?: ProductCardConfig;
|
|
13
|
+
productGridVariant?: ProductGridVariant;
|
|
14
|
+
heading?: string;
|
|
15
|
+
onProductClick?: (product: SearchResponseProductAttributes['attributes'], index: number) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const RecommendedProducts: React.FC<RecommendedProductsProps> = ({
|
|
19
|
+
retrievedProducts,
|
|
20
|
+
merchantShortName,
|
|
21
|
+
productCardConfig = { variant: 'minimal', hoverVariant: 'none', layoutVariant: 'square' },
|
|
22
|
+
productGridVariant = 'square',
|
|
23
|
+
heading,
|
|
24
|
+
onProductClick,
|
|
25
|
+
}: RecommendedProductsProps) => {
|
|
26
|
+
const containerClasses = classNames(
|
|
27
|
+
'spiffy-tw-justify-center',
|
|
28
|
+
'spiffy-tw-overflow-hidden',
|
|
29
|
+
'spiffy-tw-bg-white',
|
|
30
|
+
// Break out of parent container to fill full viewport width using CSS calc
|
|
31
|
+
'spiffy-tw-relative',
|
|
32
|
+
'spiffy-tw-px-[24px]',
|
|
33
|
+
'spiffy-tw-py-[16px]',
|
|
34
|
+
'sm:spiffy-tw-px-[41px]',
|
|
35
|
+
'sm:spiffy-tw-py-[40px]',
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const titleContainerClasses = classNames(
|
|
39
|
+
'spiffy-tw-w-full',
|
|
40
|
+
'spiffy-tw-border-b',
|
|
41
|
+
'spiffy-tw-border-solid',
|
|
42
|
+
'spiffy-tw-border-b-[--spiffy-colors-text-accent]',
|
|
43
|
+
'spiffy-tw-pb-[8px]',
|
|
44
|
+
'spiffy-tw-mb-[16px]',
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const productGridClasses = classNames(
|
|
48
|
+
'spiffy-tw-grid',
|
|
49
|
+
'spiffy-tw-justify-items-stretch',
|
|
50
|
+
'spiffy-tw-grid-cols-2',
|
|
51
|
+
'md:spiffy-tw-grid-cols-3',
|
|
52
|
+
'lg:spiffy-tw-grid-cols-4',
|
|
53
|
+
'spiffy-tw-gap-x-[4px]',
|
|
54
|
+
'spiffy-tw-gap-y-[24px]',
|
|
55
|
+
'spiffy-tw-h-full',
|
|
56
|
+
'spiffy-tw-w-full',
|
|
57
|
+
'spiffy-tw-items-stretch',
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
if (retrievedProducts == null || retrievedProducts.length === 0) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<motion.div
|
|
66
|
+
className={containerClasses}
|
|
67
|
+
initial={{ opacity: 0 }}
|
|
68
|
+
animate={{ opacity: 1 }}
|
|
69
|
+
exit={{ opacity: 0 }}
|
|
70
|
+
transition={{ duration: 0.2 }}
|
|
71
|
+
style={{
|
|
72
|
+
// Break out of parent container padding using CSS calc
|
|
73
|
+
left: '50%',
|
|
74
|
+
right: '50%',
|
|
75
|
+
marginLeft: '-50vw',
|
|
76
|
+
marginRight: '-50vw',
|
|
77
|
+
width: '100vw',
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{heading && (
|
|
81
|
+
<div className={titleContainerClasses}>
|
|
82
|
+
<Typography variant="h1" className="spiffy-tw-text-[--spiffy-colors-text-accent]">
|
|
83
|
+
{heading}
|
|
84
|
+
</Typography>
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
<ProductGrid
|
|
88
|
+
productList={retrievedProducts}
|
|
89
|
+
productGridVariant={productGridVariant}
|
|
90
|
+
productGridClasses={productGridClasses}
|
|
91
|
+
productCardConfig={productCardConfig}
|
|
92
|
+
merchantShortName={merchantShortName}
|
|
93
|
+
onProductClick={onProductClick}
|
|
94
|
+
/>
|
|
95
|
+
</motion.div>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
|
-
import { FilterItemProps, FilterProps
|
|
3
|
+
import { FilterItemProps, FilterProps } from '@envive-ai/react-hooks/types';
|
|
4
|
+
import { SearchFilterProps } from './types';
|
|
4
5
|
import { SearchFilterHeader } from './SearchFilterHeader';
|
|
5
6
|
import { useHasFilterStateChanged } from './useHasFilterStateChanged';
|
|
6
7
|
import { getSelectedFilterItemsCount, getTotalSelectedFilterItemsCount } from './utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { Typography } from 'src/components/Typography';
|
|
3
|
-
import type { SearchFilterHeaderProps } from '
|
|
3
|
+
import type { SearchFilterHeaderProps } from './types';
|
|
4
4
|
|
|
5
5
|
export const SearchFilterHeader = ({
|
|
6
6
|
closeModal,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { Typography } from 'src/components/Typography';
|
|
3
|
-
import type { SearchFilterItemProps } from '
|
|
3
|
+
import type { SearchFilterItemProps } from './types';
|
|
4
4
|
|
|
5
5
|
export const SearchFilterItem = ({
|
|
6
6
|
filterItem,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CloseIconVariant,
|
|
3
|
+
SearchFilterDatum,
|
|
4
|
+
SearchFilterItemDatum,
|
|
5
|
+
SelectFilterItem,
|
|
6
|
+
} from '@envive-ai/react-hooks/types';
|
|
7
|
+
|
|
8
|
+
export interface SearchFilterItem extends SearchFilterItemDatum {
|
|
9
|
+
filterId: string;
|
|
10
|
+
filterItemId: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SearchFilterItemProps {
|
|
14
|
+
filterItem: SearchFilterItem;
|
|
15
|
+
onSelectFilterItem: SelectFilterItem;
|
|
16
|
+
radioButtonFillColor: string;
|
|
17
|
+
radioButtonHoverColor: string;
|
|
18
|
+
radioButtonUncheckedBorderColor: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SearchFilterHeaderProps {
|
|
22
|
+
closeModal: () => void;
|
|
23
|
+
productCount: number;
|
|
24
|
+
headerClassName: string;
|
|
25
|
+
filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type SearchFilterProps = {
|
|
29
|
+
filters: SearchFilterDatum[];
|
|
30
|
+
selectFilterItem: SelectFilterItem;
|
|
31
|
+
clearAllFilters: () => void;
|
|
32
|
+
productCount: number;
|
|
33
|
+
isOpen: boolean;
|
|
34
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
35
|
+
applyFiltersUnchangedClasses: string;
|
|
36
|
+
applyFiltersChangedClasses: string;
|
|
37
|
+
headerContent?: React.ReactNode;
|
|
38
|
+
footerContent?: React.ReactNode;
|
|
39
|
+
filterButtonText?: string; // New prop for custom button text
|
|
40
|
+
headerClassName?: string;
|
|
41
|
+
radioButtonFillColor: string;
|
|
42
|
+
radioButtonHoverColor?: string;
|
|
43
|
+
radioButtonUncheckedBorderColor?: string;
|
|
44
|
+
filterCloseIconVariant: CloseIconVariant;
|
|
45
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useMemo, useEffect } from 'react';
|
|
2
|
-
import { SearchFilterDatum } from '@envive-ai/types';
|
|
2
|
+
import { SearchFilterDatum } from '@envive-ai/react-hooks/types';
|
|
3
3
|
|
|
4
4
|
export const useHasFilterStateChanged = (filters: SearchFilterDatum[], isOpen: boolean) => {
|
|
5
5
|
// Track initial filter states when modal opens
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchFilterDatum, SearchFilterItemDatum } from '@envive-ai/types';
|
|
1
|
+
import { SearchFilterDatum, SearchFilterItemDatum } from '@envive-ai/react-hooks/types';
|
|
2
2
|
|
|
3
3
|
export const getSelectedFilterItemsCount = (filter: SearchFilterDatum) =>
|
|
4
4
|
filter.items.filter((item: SearchFilterItemDatum) => item.isSelected).length;
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useImperativeHandle } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import MagnifyingGlassStarVariant from '@envive-ai/react-icons/MagnifyingGlassStarVariant';
|
|
4
4
|
import IconClose from '@envive-ai/react-icons/IconClose';
|
|
5
|
-
import { SearchInputVariant } from '@envive-ai/types';
|
|
5
|
+
import { SearchInputVariant } from '@envive-ai/react-hooks/contexts/types';
|
|
6
6
|
import { TextInput } from '../TextInput';
|
|
7
7
|
import { searchInputVariantClasses } from './searchInputVariants';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colorVar } from 'src/
|
|
2
|
-
import { SearchInputVariant
|
|
1
|
+
import { colorVar, ColorNames } from 'src/models/colorsConfig';
|
|
2
|
+
import { SearchInputVariant } from '../../atoms/search/types';
|
|
3
3
|
import { TypographyVariantMap } from '../Typography/typographyVariantClasses';
|
|
4
4
|
|
|
5
5
|
type SearchInputVariantClasses = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import { SEARCH_INPUT_TESTID } from '@envive-ai/react-hooks/config/locators/components/search';
|
|
3
|
-
import { SearchInputVariant } from '@envive-ai/types';
|
|
4
3
|
import { SearchAutocomplete } from '../SearchAutocomplete';
|
|
5
4
|
import { SearchInput } from '../SearchInput/SearchInput';
|
|
6
5
|
import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
|
|
6
|
+
import { SearchInputVariant } from '../../atoms/search/types';
|
|
7
7
|
|
|
8
8
|
interface SearchInputFormProps {
|
|
9
9
|
searchInputVariant: SearchInputVariant;
|
|
@@ -19,6 +19,7 @@ interface SearchInputFormProps {
|
|
|
19
19
|
onSearchInputFocus: () => void;
|
|
20
20
|
onSearchInputBlur: () => void;
|
|
21
21
|
shouldShowAutocomplete: boolean;
|
|
22
|
+
searchInputRef: React.RefObject<HTMLInputElement>;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export const SearchInputForm = ({
|
|
@@ -35,15 +36,19 @@ export const SearchInputForm = ({
|
|
|
35
36
|
onSearchSubmit,
|
|
36
37
|
onSearchInputFocus,
|
|
37
38
|
onSearchInputBlur,
|
|
39
|
+
searchInputRef,
|
|
38
40
|
}: SearchInputFormProps) => {
|
|
39
41
|
const { autocompleteIconColor } = searchInputVariantClasses[searchInputVariant];
|
|
40
42
|
|
|
41
|
-
const containerClasses = classNames(
|
|
43
|
+
const containerClasses = classNames(
|
|
44
|
+
'spiffy-tw-relative',
|
|
45
|
+
'spiffy-tw-w-full'
|
|
46
|
+
);
|
|
42
47
|
|
|
43
48
|
const formClasses = classNames({
|
|
44
49
|
'spiffy-tw-grow': true,
|
|
45
50
|
'spiffy-tw-relative': true,
|
|
46
|
-
'spiffy-tw-z-20': shouldShowAutocomplete
|
|
51
|
+
'spiffy-tw-z-20': shouldShowAutocomplete
|
|
47
52
|
});
|
|
48
53
|
|
|
49
54
|
const autocompleteContainerClasses = classNames(
|
|
@@ -57,7 +62,7 @@ export const SearchInputForm = ({
|
|
|
57
62
|
'spiffy-tw-rounded-b-lg',
|
|
58
63
|
'spiffy-tw-border',
|
|
59
64
|
'spiffy-tw-border-t-0',
|
|
60
|
-
'spiffy-tw-pt-4'
|
|
65
|
+
'spiffy-tw-pt-4'
|
|
61
66
|
);
|
|
62
67
|
|
|
63
68
|
return (
|
|
@@ -80,6 +85,7 @@ export const SearchInputForm = ({
|
|
|
80
85
|
onChange={onSearchInputChange}
|
|
81
86
|
onFocus={onSearchInputFocus}
|
|
82
87
|
onBlur={onSearchInputBlur}
|
|
88
|
+
ref={searchInputRef}
|
|
83
89
|
/>
|
|
84
90
|
</form>
|
|
85
91
|
{shouldShowAutocomplete && (
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
3
|
+
import { SelectedFilterOption } from '@envive-ai/react-hooks/atoms/search';
|
|
4
|
+
import { SearchResultsState } from '@envive-ai/react-hooks/hooks/utils';
|
|
1
5
|
import {
|
|
2
|
-
SearchResultsState,
|
|
3
|
-
SelectedFilterOption,
|
|
4
6
|
ProductCardConfig,
|
|
5
7
|
ProductGridVariant,
|
|
6
8
|
SearchResponseProductAttributes,
|
|
7
|
-
|
|
8
|
-
} from '
|
|
9
|
+
} from '../ProductCard';
|
|
10
|
+
import { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar';
|
|
9
11
|
import {
|
|
10
12
|
NoSearchResultsFound,
|
|
11
13
|
SearchResultsGrid,
|
|
@@ -14,16 +16,17 @@ import {
|
|
|
14
16
|
|
|
15
17
|
interface SearchResultsContentProps {
|
|
16
18
|
searchResultsState: SearchResultsState;
|
|
17
|
-
productList:
|
|
19
|
+
productList: SearchResponseProduct[];
|
|
20
|
+
recommendedProducts: SearchResponseProductAttributes['attributes'][];
|
|
18
21
|
productCardConfig: ProductCardConfig;
|
|
19
22
|
merchantShortName: string;
|
|
20
23
|
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
21
24
|
productGridVariant: ProductGridVariant;
|
|
22
|
-
productGridClasses: string;
|
|
23
25
|
containerXPaddingClasses: string;
|
|
24
26
|
selectedFilterOptions: SelectedFilterOption[];
|
|
25
27
|
availableDynamicFilters: { name: string; displayName: string }[];
|
|
26
28
|
onRemoveFilter: (filter: SelectedFilterOption) => void;
|
|
29
|
+
onProductClick?: () => void;
|
|
27
30
|
onToggleDynamicFilter: ({
|
|
28
31
|
filter,
|
|
29
32
|
dynamicFilterDisplayName,
|
|
@@ -32,51 +35,81 @@ interface SearchResultsContentProps {
|
|
|
32
35
|
dynamicFilterDisplayName: string;
|
|
33
36
|
}) => void;
|
|
34
37
|
noResultsFoundText?: string;
|
|
38
|
+
searchResultsRef: React.RefObject<HTMLDivElement>;
|
|
39
|
+
toolbarHeight: number;
|
|
40
|
+
query: string;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
export const SearchResultsContent = ({
|
|
38
44
|
searchResultsState,
|
|
39
45
|
productList,
|
|
46
|
+
recommendedProducts,
|
|
40
47
|
productCardConfig,
|
|
41
48
|
merchantShortName,
|
|
42
49
|
searchFilterSidebarVariant,
|
|
43
50
|
productGridVariant,
|
|
44
|
-
productGridClasses,
|
|
45
51
|
containerXPaddingClasses,
|
|
46
52
|
selectedFilterOptions,
|
|
47
53
|
availableDynamicFilters,
|
|
54
|
+
onProductClick,
|
|
48
55
|
onRemoveFilter,
|
|
49
56
|
onToggleDynamicFilter,
|
|
50
57
|
noResultsFoundText,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
58
|
+
searchResultsRef,
|
|
59
|
+
toolbarHeight,
|
|
60
|
+
query,
|
|
61
|
+
}: SearchResultsContentProps) => {
|
|
62
|
+
const productGridClasses = classNames(
|
|
63
|
+
'spiffy-tw-grid',
|
|
64
|
+
'spiffy-tw-justify-items-stretch',
|
|
65
|
+
'spiffy-tw-grid-cols-2',
|
|
66
|
+
'md:spiffy-tw-grid-cols-3',
|
|
67
|
+
'lg:spiffy-tw-grid-cols-4',
|
|
68
|
+
'spiffy-tw-gap-x-[4px]',
|
|
69
|
+
'spiffy-tw-gap-y-[24px]',
|
|
70
|
+
'spiffy-tw-h-full',
|
|
71
|
+
'spiffy-tw-w-full',
|
|
72
|
+
'spiffy-tw-items-stretch',
|
|
73
|
+
containerXPaddingClasses,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
ref={searchResultsRef}
|
|
79
|
+
style={{ paddingTop: `${toolbarHeight}px`, backgroundColor: 'white' }}
|
|
80
|
+
>
|
|
81
|
+
{searchResultsState === SearchResultsState.NoResults && (
|
|
82
|
+
<NoSearchResultsFound
|
|
83
|
+
containerPaddingClasses={containerXPaddingClasses}
|
|
84
|
+
noResultsFoundText={noResultsFoundText}
|
|
85
|
+
recommendedProducts={recommendedProducts}
|
|
86
|
+
searchText={query}
|
|
87
|
+
merchantShortName={merchantShortName}
|
|
88
|
+
productGridVariant={productGridVariant}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
{searchResultsState === SearchResultsState.Results && (
|
|
92
|
+
<SearchResultsGrid
|
|
93
|
+
searchFilterSidebarVariant={searchFilterSidebarVariant}
|
|
94
|
+
productCardConfig={productCardConfig}
|
|
95
|
+
merchantShortName={merchantShortName}
|
|
96
|
+
productList={productList}
|
|
97
|
+
productGridVariant={productGridVariant}
|
|
98
|
+
productGridClasses={productGridClasses}
|
|
99
|
+
containerXPaddingClasses={containerXPaddingClasses}
|
|
100
|
+
selectedFilterOptions={selectedFilterOptions}
|
|
101
|
+
availableDynamicFilters={availableDynamicFilters}
|
|
102
|
+
onRemoveFilter={onRemoveFilter}
|
|
103
|
+
onProductClick={onProductClick}
|
|
104
|
+
onToggleDynamicFilter={onToggleDynamicFilter}
|
|
105
|
+
/>
|
|
106
|
+
)}
|
|
107
|
+
{searchResultsState === SearchResultsState.Loading && (
|
|
108
|
+
<SearchResultsLoadingGrid
|
|
109
|
+
productGridVariant={productGridVariant}
|
|
110
|
+
productGridClasses={productGridClasses}
|
|
111
|
+
/>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
import SettingsVariant from '@envive-ai/react-icons/SettingsVariant';
|
|
4
|
+
import { ButtonBase } from '../ButtonBase';
|
|
5
|
+
|
|
6
|
+
export type SearchResultsFilterButtonProps = {
|
|
7
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
8
|
+
filterButtonText: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SearchResultsFilterButton = ({
|
|
12
|
+
setIsOpen,
|
|
13
|
+
filterButtonText,
|
|
14
|
+
}: SearchResultsFilterButtonProps) => {
|
|
15
|
+
const openFilter = useCallback(() => {
|
|
16
|
+
setIsOpen(true);
|
|
17
|
+
}, [setIsOpen]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ButtonBase
|
|
21
|
+
onClick={openFilter}
|
|
22
|
+
icon={SettingsVariant}
|
|
23
|
+
iconClass="spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center"
|
|
24
|
+
text={filterButtonText}
|
|
25
|
+
textClass="spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block"
|
|
26
|
+
buttonClass="spiffy-tw-flex-row spiffy-tw-pl-[16px] sm:spiffy-tw-pl-0 sm:spiffy-tw-px-4 sm:spiffy-tw-gap-[8px]"
|
|
27
|
+
disablePadding
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
|
|
2
|
+
import { SearchFilter, SearchFilterHeader } from '../SearchFilter';
|
|
3
|
+
import { SearchFilterSidebarVariant, searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar';
|
|
4
|
+
|
|
5
|
+
export type SearchResultsFilterModalProps = {
|
|
6
|
+
productCount: number;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
9
|
+
searchFilters: SearchFilterDatum[];
|
|
10
|
+
searchFilterSidebarVariant: SearchFilterSidebarVariant;
|
|
11
|
+
onSelectFilterItem: SelectFilterItem;
|
|
12
|
+
onClearAllFilters: () => void;
|
|
13
|
+
filterButtonText: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const SearchResultsFilterModal = ({
|
|
17
|
+
productCount,
|
|
18
|
+
isOpen,
|
|
19
|
+
setIsOpen,
|
|
20
|
+
searchFilters,
|
|
21
|
+
searchFilterSidebarVariant,
|
|
22
|
+
onSelectFilterItem,
|
|
23
|
+
onClearAllFilters,
|
|
24
|
+
filterButtonText,
|
|
25
|
+
}: SearchResultsFilterModalProps) => {
|
|
26
|
+
const {
|
|
27
|
+
applyFiltersUnchangedClasses,
|
|
28
|
+
applyFiltersChangedClasses,
|
|
29
|
+
searchFilterHeaderClasses,
|
|
30
|
+
radioButtonFillColor,
|
|
31
|
+
radioButtonHoverColor,
|
|
32
|
+
radioButtonUncheckedBorderColor,
|
|
33
|
+
filterCloseIconVariant,
|
|
34
|
+
} = searchFilterSidebarVariantClasses[searchFilterSidebarVariant];
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<SearchFilter
|
|
38
|
+
isOpen={isOpen}
|
|
39
|
+
setIsOpen={setIsOpen}
|
|
40
|
+
filters={searchFilters}
|
|
41
|
+
productCount={productCount}
|
|
42
|
+
selectFilterItem={onSelectFilterItem}
|
|
43
|
+
clearAllFilters={onClearAllFilters}
|
|
44
|
+
applyFiltersUnchangedClasses={applyFiltersUnchangedClasses}
|
|
45
|
+
applyFiltersChangedClasses={applyFiltersChangedClasses}
|
|
46
|
+
filterButtonText={filterButtonText}
|
|
47
|
+
radioButtonFillColor={radioButtonFillColor}
|
|
48
|
+
radioButtonHoverColor={radioButtonHoverColor}
|
|
49
|
+
radioButtonUncheckedBorderColor={radioButtonUncheckedBorderColor}
|
|
50
|
+
filterCloseIconVariant={filterCloseIconVariant}
|
|
51
|
+
headerContent={
|
|
52
|
+
<SearchFilterHeader
|
|
53
|
+
closeModal={() => setIsOpen(false)}
|
|
54
|
+
productCount={productCount}
|
|
55
|
+
headerClassName={searchFilterHeaderClasses}
|
|
56
|
+
filterCloseIconVariant={filterCloseIconVariant}
|
|
57
|
+
/>
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
|
|
3
|
-
import { SearchFilterDatum, SelectFilterItem
|
|
3
|
+
import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
|
|
4
4
|
import SettingsVariant from '@envive-ai/react-icons/src/SettingsVariant.js';
|
|
5
5
|
import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
|
|
6
6
|
import { ButtonBase } from '../ButtonBase';
|
|
7
7
|
import { SearchFilter, SearchFilterHeader } from '../SearchFilter';
|
|
8
|
+
import { SearchFilterSidebarVariant } from './types';
|
|
8
9
|
|
|
9
10
|
export type SearchResultsFilterProps = {
|
|
10
11
|
productCount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colorVar } from 'src/
|
|
2
|
-
import { SearchFilterSidebarVariant, CloseIconVariant
|
|
1
|
+
import { ColorNames, colorVar } from 'src/models/colorsConfig';
|
|
2
|
+
import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
|
|
3
3
|
|
|
4
4
|
interface SearchFilterSidebarVariantClasses {
|
|
5
5
|
searchFilterHeaderClasses: string;
|