@envive-ai/react-toolkit 0.2.10 → 0.2.12
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-RpyCFs2a.cjs → Accordion-B0TzPN3m.cjs} +2 -5
- package/dist/{Accordion-DxtXK__u.js → Accordion-D8Vm8J1y.js} +3 -3
- package/dist/{AnimatedChevron-Q96FneFy.cjs → AnimatedChevron-9xf90bpP.cjs} +0 -2
- package/dist/{AnimatedChevron-Bik7GMSe.js → AnimatedChevron-DghLnmlM.js} +1 -1
- package/dist/{ButtonBase-AU23oGQr.cjs → ButtonBase-BMEAmPnS.cjs} +1 -3
- package/dist/{ButtonBase-6wjsZ1tU.js → ButtonBase-CT397aT3.js} +2 -2
- package/dist/{DynamicFiltersScrollbar-CJG4K0PH.js → DynamicFiltersScrollbar-CibstqNd.js} +4 -6
- package/dist/{DynamicFiltersScrollbar-DgS9gpdg.cjs → DynamicFiltersScrollbar-DqIydLJu.cjs} +3 -6
- package/dist/{ImageWithFallback-Bx17VPmQ.cjs → ImageWithFallback-CuPe6XF6.cjs} +0 -1
- package/dist/{ImageWithFallback-c-DTsBH-.js → ImageWithFallback-_QZT0EKI.js} +1 -1
- package/dist/{ModalSheet-CcthFeMD.cjs → ModalSheet-Be7-bkXK.cjs} +10 -15
- package/dist/{ModalSheet-BSj_g9JF.js → ModalSheet-DVrY7Mw0.js} +11 -12
- package/dist/{ProductCard-C-8ie9Lf.cjs → ProductCard-BeY85PBf.cjs} +8 -25
- package/dist/{ProductCard-n-PAth5m.js → ProductCard-BoyYu6mI.js} +7 -20
- package/dist/{ProductGrid-Ba2tUgmC.cjs → ProductGrid-CxKK7w_X.cjs} +1 -2
- package/dist/{ProductGrid-xXkWzvR2.js → ProductGrid-DmtSXfyE.js} +2 -2
- package/dist/{RadioButton-gnFz0TWN.js → RadioButton-Bm0qK3bX.js} +2 -2
- package/dist/{RadioButton-BBc1b5vX.cjs → RadioButton-Dcdj8pNp.cjs} +1 -3
- package/dist/{RadioButtonGroup-DxOtcIdO.cjs → RadioButtonGroup-BnnMx8sE.cjs} +1 -2
- package/dist/{RadioButtonGroup-DLLleeDX.js → RadioButtonGroup-hme7gSiQ.js} +2 -2
- package/dist/RecommendedProducts-C2eNVrLo.cjs +56 -0
- package/dist/RecommendedProducts-LalI8aVC.js +49 -0
- package/dist/{SearchAutocomplete-DAEDHeqr.cjs → SearchAutocomplete-A3HXkHwK.cjs} +3 -6
- package/dist/{SearchAutocomplete-B690CIZB.js → SearchAutocomplete-Rza3A-gs.js} +4 -5
- package/dist/{SearchFilter-Bi0zqO3-.js → SearchFilter-CYY5sNXV.js} +39 -43
- package/dist/{SearchFilter-ylBowO7T.cjs → SearchFilter-DxrQOLx0.cjs} +38 -44
- package/dist/{SearchInput-Yy6NIiSk.cjs → SearchInput-3ppsm2Ke.cjs} +2 -3
- package/dist/{SearchInput-Q3knp7tj.js → SearchInput-DE9Iz7A8.js} +3 -3
- package/dist/{SearchInputForm/index.cjs → SearchInputForm-CZz62rOX.cjs} +9 -9
- package/dist/{SearchInputForm/index.js → SearchInputForm-DrI4WHDt.js} +3 -6
- package/dist/SearchResultsFilterButton-BedTofz5.cjs +29 -0
- package/dist/SearchResultsFilterButton-CV11UTGi.js +22 -0
- package/dist/{SearchResultsFilterSidebar/index.js → SearchResultsFilterSidebar-Bvpk7Uoo.js} +4 -13
- package/dist/{SearchResultsFilterSidebar/index.cjs → SearchResultsFilterSidebar-Dgz98oyD.cjs} +10 -17
- package/dist/{SearchResultsStates-BjFB9Qo9.cjs → SearchResultsStates-D37wFr9h.cjs} +42 -16
- package/dist/{SearchResultsStates-D8Uz39yp.js → SearchResultsStates-DrGtw0pM.js} +43 -15
- package/dist/{SparkleAnimation-CvGlWUqv.cjs → SparkleAnimation-B5A_NCuy.cjs} +1 -4
- package/dist/{SparkleAnimation-paLhSu5E.js → SparkleAnimation-BSI_34HX.js} +2 -2
- package/dist/{Spinner-BqTt55uu.js → Spinner-CDDFWySo.js} +1 -1
- package/dist/{Spinner-DjK8ts9E.cjs → Spinner-FQpy5bGu.cjs} +0 -1
- package/dist/{TextInput-B70n36-J.cjs → TextInput-Do5-j1V_.cjs} +3 -5
- package/dist/{TextInput-y6nNxaTI.js → TextInput-PtrUXoZo.js} +4 -5
- package/dist/{ToggleButton-Br6MgjiG.js → ToggleButton-BTz_zIdc.js} +2 -2
- package/dist/{ToggleButton-CJ74eu-N.cjs → ToggleButton-CmxTz-ou.cjs} +1 -2
- package/dist/{Typography-D3vDkBMS.js → Typography-xehJH05l.js} +1 -1
- package/dist/{colorsConfig-DZ-GSPWy.js → colorsConfig-BjdoRtRK.js} +1 -1
- package/dist/{Accordion/index.d.ts → components/Accordion/index-BPofgdcd.d.cts} +2 -2
- package/dist/{Accordion/index.d.cts → components/Accordion/index-DBEaF9x5.d.ts} +2 -2
- package/dist/components/Accordion/index.cjs +4 -0
- package/dist/components/Accordion/index.js +4 -0
- package/dist/{AnimatedChevron/index.d.cts → components/AnimatedChevron/index-Bvff3AGS.d.ts} +2 -2
- package/dist/{AnimatedChevron/index.d.ts → components/AnimatedChevron/index-BwQ6tJL8.d.cts} +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-BKNoroAl.d.ts} +2 -2
- package/dist/{AppliedFiltersScrollbar/index.d.cts → components/AppliedFiltersScrollbar/index-DADY550R.d.cts} +2 -2
- package/dist/{AppliedFiltersScrollbar → components/AppliedFiltersScrollbar}/index.cjs +3 -5
- package/dist/{AppliedFiltersScrollbar → components/AppliedFiltersScrollbar}/index.js +2 -3
- package/dist/{ButtonBase/index.d.ts → components/ButtonBase/index-BCw2WQ-2.d.ts} +2 -2
- package/dist/{ButtonBase/index.d.cts → components/ButtonBase/index-pBSmWoqg.d.cts} +2 -2
- package/dist/components/ButtonBase/index.cjs +6 -0
- package/dist/components/ButtonBase/index.js +5 -0
- package/dist/{DynamicFiltersScrollbar/index.d.ts → components/DynamicFiltersScrollbar/index-BvAT64cX.d.ts} +2 -2
- package/dist/{DynamicFiltersScrollbar/index.d.cts → components/DynamicFiltersScrollbar/index-X--ALCSa.d.cts} +2 -2
- package/dist/{DynamicFiltersScrollbar → components/DynamicFiltersScrollbar}/index.cjs +3 -5
- package/dist/{DynamicFiltersScrollbar → components/DynamicFiltersScrollbar}/index.js +2 -3
- package/dist/{FilterScrollbar/index.d.ts → components/FilterScrollbar/index-DgxXE1ff.d.cts} +3 -3
- package/dist/{FilterScrollbar/index.d.cts → components/FilterScrollbar/index-xlg1Q06Q.d.ts} +3 -3
- 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-C8Fqb7AQ.d.cts} +2 -2
- package/dist/{ImageWithFallback/index.d.ts → components/ImageWithFallback/index-yxDWrUCQ.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-Cp_h5dbe.d.ts} +2 -2
- package/dist/{ModalSheet/index.d.ts → components/ModalSheet/index-Dnt-aUte.d.cts} +2 -2
- package/dist/components/ModalSheet/index.cjs +4 -0
- package/dist/components/ModalSheet/index.js +4 -0
- package/dist/components/ProductCard/index-BF8pv46P.d.ts +2 -0
- package/dist/components/ProductCard/index-C6TLdXjC.d.cts +2 -0
- package/dist/{ProductCard → components/ProductCard}/index.cjs +5 -4
- package/dist/components/ProductCard/index.js +7 -0
- package/dist/{ProductGrid/index.d.cts → components/ProductGrid/index-B1eVXjB4.d.cts} +3 -3
- package/dist/{ProductGrid/index.d.ts → components/ProductGrid/index-CyDy1V6o.d.ts} +3 -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-BHl3dM6k.d.cts} +2 -2
- package/dist/{RadioButton/index.d.ts → components/RadioButton/index-BZrcz8-J.d.ts} +2 -2
- 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-DdyMuFCX.d.ts} +2 -2
- package/dist/{RadioButtonGroup/index.d.ts → components/RadioButtonGroup/index-DtdjcXo-.d.cts} +2 -2
- 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.ts → components/SearchAutocomplete/index-Br_POGOz.d.ts} +2 -2
- package/dist/{SearchAutocomplete/index.d.cts → components/SearchAutocomplete/index-Ce9gkkbU.d.cts} +2 -2
- package/dist/components/SearchAutocomplete/index.cjs +4 -0
- package/dist/components/SearchAutocomplete/index.js +4 -0
- package/dist/{SearchFilter/index.d.cts → components/SearchFilter/index-DAR4UKSA.d.cts} +5 -5
- package/dist/{SearchFilter/index.d.ts → components/SearchFilter/index-VygXUBM9.d.ts} +5 -5
- package/dist/components/SearchFilter/index.cjs +17 -0
- package/dist/components/SearchFilter/index.js +12 -0
- package/dist/{SearchInput/index.d.ts → components/SearchInput/index-UY0W77Y0.d.ts} +2 -2
- package/dist/{SearchInput/index.d.cts → components/SearchInput/index-rFDdhvqg.d.cts} +2 -2
- package/dist/components/SearchInput/index.cjs +7 -0
- package/dist/components/SearchInput/index.js +6 -0
- package/dist/{SearchInputForm/index.d.cts → components/SearchInputForm/index-_sR_KugL.d.ts} +3 -3
- package/dist/{SearchInputForm/index.d.ts → components/SearchInputForm/index-dlLBivQA.d.cts} +1 -1
- package/dist/components/SearchInputForm/index.cjs +8 -0
- package/dist/components/SearchInputForm/index.js +8 -0
- package/dist/{SearchResultsContent/index.d.cts → components/SearchResultsContent/index-B_6-7-t-.d.ts} +18 -9
- package/dist/{SearchResultsContent/index.d.ts → components/SearchResultsContent/index-CayvNVCK.d.cts} +18 -9
- package/dist/components/SearchResultsContent/index.cjs +60 -0
- package/dist/components/SearchResultsContent/index.js +58 -0
- package/dist/components/SearchResultsFilterButton/index-D_u8PzTc.d.cts +13 -0
- package/dist/components/SearchResultsFilterButton/index-DuTGqa7-.d.ts +13 -0
- package/dist/components/SearchResultsFilterButton/index.cjs +9 -0
- package/dist/components/SearchResultsFilterButton/index.js +9 -0
- package/dist/components/SearchResultsFilterModal/index-BNZEJiXR.d.cts +27 -0
- package/dist/components/SearchResultsFilterModal/index-CXBAA2-F.d.ts +27 -0
- package/dist/components/SearchResultsFilterModal/index.cjs +47 -0
- package/dist/components/SearchResultsFilterModal/index.js +46 -0
- package/dist/components/SearchResultsFilterSidebar/index-BDcl27l4.d.ts +2 -0
- package/dist/components/SearchResultsFilterSidebar/index-DgPB1knO.d.cts +2 -0
- package/dist/components/SearchResultsFilterSidebar/index.cjs +16 -0
- package/dist/components/SearchResultsFilterSidebar/index.js +15 -0
- package/dist/{SearchResultsStates/index.d.ts → components/SearchResultsStates/index-CjYl1v-v.d.cts} +19 -10
- package/dist/{SearchResultsStates/index.d.cts → components/SearchResultsStates/index-DJaUfKjE.d.ts} +19 -10
- package/dist/components/SearchResultsStates/index.cjs +16 -0
- package/dist/components/SearchResultsStates/index.js +14 -0
- package/dist/components/SearchResultsToolbar/index-CVstdvRQ.d.cts +49 -0
- package/dist/components/SearchResultsToolbar/index-tAB6lEUm.d.ts +49 -0
- package/dist/components/SearchResultsToolbar/index.cjs +66 -0
- package/dist/components/SearchResultsToolbar/index.js +63 -0
- package/dist/{SparkleAnimation/index.d.ts → components/SparkleAnimation/index-BQOC3G_6.d.cts} +2 -2
- package/dist/{SparkleAnimation/index.d.cts → components/SparkleAnimation/index-DjRK3Dys.d.ts} +2 -2
- package/dist/{SparkleAnimation → components/SparkleAnimation}/index.cjs +1 -1
- package/dist/components/SparkleAnimation/index.js +3 -0
- package/dist/{Spinner/index.d.cts → components/Spinner/index-C0pGovHC.d.cts} +2 -2
- package/dist/{Spinner/index.d.ts → components/Spinner/index-CIr1izou.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-B4J70IPS.d.cts} +2 -2
- package/dist/{SuggestionButton/index.d.ts → components/SuggestionButton/index-D6_y1hTj.d.ts} +2 -2
- package/dist/{SuggestionButton → components/SuggestionButton}/index.cjs +5 -7
- package/dist/{SuggestionButton → components/SuggestionButton}/index.js +4 -5
- package/dist/{TextInput/index.d.cts → components/TextInput/index-CRJMRe-b.d.cts} +2 -2
- package/dist/{TextInput/index.d.ts → components/TextInput/index-CkQtHiR9.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-Dc-cs_tK.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-DE1Nhjra.d.ts +3 -0
- package/dist/components/Typography/index-DzSBreyM.d.cts +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-DmvaMYbj.d.ts → index-8cIrhPDk.d.ts} +3 -3
- package/dist/{index-Dfe_lkL2.d.cts → index-BKYA7uMB.d.cts} +1 -1
- package/dist/{index-Qtr26aUO.d.ts → index-Bw6lDfEp.d.cts} +2 -2
- package/dist/{index-BqARXvZ6.d.cts → index-CqfgJHj8.d.cts} +5 -5
- package/dist/{index-BMHF0IWd.d.cts → index-Cr8VXccr.d.ts} +2 -2
- package/dist/{index-BB4Qbpmg.d.ts → index-Cz6qxTZG.d.ts} +5 -5
- package/dist/{searchFilterSidebarVariants-DzCf_sfh.cjs → searchFilterSidebarVariants-C61Byr1S.cjs} +1 -1
- package/dist/{searchFilterSidebarVariants-f9PS9fl6.js → searchFilterSidebarVariants-DcwlBfvY.js} +2 -2
- package/dist/{types-BhGjnuWx.d.cts → types--eyQnaEA.d.cts} +1 -1
- package/dist/{types-DlqhqT_S.d.ts → types-CQpdBL3M.d.ts} +1 -1
- package/dist/{typographyVariantClasses-B6wiawat.d.ts → typographyVariantClasses-CoRhazCU.d.cts} +1 -1
- package/dist/{typographyVariantClasses-DTSltxPN.d.cts → typographyVariantClasses-CrT5OfVw.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 -52
- package/src/components/RecommendedProducts/RecommendedProducts.tsx +97 -0
- package/src/components/RecommendedProducts/index.ts +3 -0
- package/src/components/SearchResultsContent/SearchResultsContent.tsx +68 -35
- 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/SearchResultsStates/NoSearchResultsFound.tsx +43 -11
- package/src/components/SearchResultsStates/SearchResultsGrid.tsx +5 -1
- package/src/components/SearchResultsToolbar/SearchResultsToolbar.tsx +111 -0
- package/src/components/SearchResultsToolbar/index.ts +3 -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/colorVar.ts +3 -0
- package/src/util/index.ts +4 -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 -2
- package/dist/ProductCard/index.d.ts +0 -2
- 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.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/SearchResultsFilterSidebar/index.d.cts +0 -2
- package/dist/SearchResultsFilterSidebar/index.d.ts +0 -2
- package/dist/SearchResultsStates/index.cjs +0 -14
- package/dist/SearchResultsStates/index.js +0 -12
- 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/{ButtonBase-DbWQ25n-.cjs → ButtonBase-BIXx56hq.cjs} +0 -0
- /package/dist/{ButtonBase-C_uKnl48.js → ButtonBase-C9fn-c5h.js} +0 -0
- /package/dist/{Typography-CFNWgbM5.cjs → Typography-Ds4gfOJz.cjs} +0 -0
- /package/dist/{colorsConfig-B3-SMUSx.cjs → colorsConfig-D-MZuBvt.cjs} +0 -0
- /package/dist/{ToggleButton/index.d.ts → components/ToggleButton/index-B2rBwaVX.d.cts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-toolkit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "React component library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -24,11 +24,14 @@
|
|
|
24
24
|
"build": "tsdown",
|
|
25
25
|
"build:watch": "tsdown --watch",
|
|
26
26
|
"prepublish": "npm run build",
|
|
27
|
+
"storybook": "tsx ./.storybook/getMerchants.ts && storybook dev -p 6006",
|
|
28
|
+
"storybook:build": "npm run get-merchants && storybook build",
|
|
29
|
+
"storybook:get-merchants": "tsx ./.storybook/getMerchants.ts",
|
|
27
30
|
"typecheck": "tsc",
|
|
28
31
|
"test": "vitest"
|
|
29
32
|
},
|
|
30
33
|
"dependencies": {
|
|
31
|
-
"@envive-ai/react-hooks": "0.2.
|
|
34
|
+
"@envive-ai/react-hooks": "0.2.7",
|
|
32
35
|
"@tailwindcss/typography": "^0.5.15",
|
|
33
36
|
"classnames": "^2.5.1",
|
|
34
37
|
"react-icons": "^5.0.1",
|
|
@@ -40,114 +43,138 @@
|
|
|
40
43
|
"react-dom": "^18.3.1"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
46
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
47
|
+
"@spiffy-ai/commerce-api-client": "^1.1.0-SNAPSHOT.202510160819",
|
|
48
|
+
"@storybook/react-vite": "^9.1.4",
|
|
43
49
|
"@types/node": "^24.3.2",
|
|
44
50
|
"@types/react": "^19.1.12",
|
|
45
51
|
"postcss": "^8.5.6",
|
|
46
52
|
"tailwindcss": "^3.4.17",
|
|
47
53
|
"tsdown": "^0.14.2",
|
|
54
|
+
"tsx": "^4.20.6",
|
|
48
55
|
"typescript": "^5.4.3",
|
|
49
56
|
"vitest": "^3.2.4"
|
|
50
57
|
},
|
|
51
58
|
"exports": {
|
|
52
59
|
"./Accordion": {
|
|
53
|
-
"import": "./dist/Accordion/index.js",
|
|
54
|
-
"require": "./dist/Accordion/index.cjs"
|
|
60
|
+
"import": "./dist/components/Accordion/index.js",
|
|
61
|
+
"require": "./dist/components/Accordion/index.cjs"
|
|
55
62
|
},
|
|
56
63
|
"./AnimatedChevron": {
|
|
57
|
-
"import": "./dist/AnimatedChevron/index.js",
|
|
58
|
-
"require": "./dist/AnimatedChevron/index.cjs"
|
|
64
|
+
"import": "./dist/components/AnimatedChevron/index.js",
|
|
65
|
+
"require": "./dist/components/AnimatedChevron/index.cjs"
|
|
59
66
|
},
|
|
60
67
|
"./AppliedFiltersScrollbar": {
|
|
61
|
-
"import": "./dist/AppliedFiltersScrollbar/index.js",
|
|
62
|
-
"require": "./dist/AppliedFiltersScrollbar/index.cjs"
|
|
68
|
+
"import": "./dist/components/AppliedFiltersScrollbar/index.js",
|
|
69
|
+
"require": "./dist/components/AppliedFiltersScrollbar/index.cjs"
|
|
63
70
|
},
|
|
64
71
|
"./ButtonBase": {
|
|
65
|
-
"import": "./dist/ButtonBase/index.js",
|
|
66
|
-
"require": "./dist/ButtonBase/index.cjs"
|
|
72
|
+
"import": "./dist/components/ButtonBase/index.js",
|
|
73
|
+
"require": "./dist/components/ButtonBase/index.cjs"
|
|
67
74
|
},
|
|
68
75
|
"./DynamicFiltersScrollbar": {
|
|
69
|
-
"import": "./dist/DynamicFiltersScrollbar/index.js",
|
|
70
|
-
"require": "./dist/DynamicFiltersScrollbar/index.cjs"
|
|
76
|
+
"import": "./dist/components/DynamicFiltersScrollbar/index.js",
|
|
77
|
+
"require": "./dist/components/DynamicFiltersScrollbar/index.cjs"
|
|
71
78
|
},
|
|
72
79
|
"./FilterScrollbar": {
|
|
73
|
-
"import": "./dist/FilterScrollbar/index.js",
|
|
74
|
-
"require": "./dist/FilterScrollbar/index.cjs"
|
|
80
|
+
"import": "./dist/components/FilterScrollbar/index.js",
|
|
81
|
+
"require": "./dist/components/FilterScrollbar/index.cjs"
|
|
75
82
|
},
|
|
76
83
|
"./ImageWithFallback": {
|
|
77
|
-
"import": "./dist/ImageWithFallback/index.js",
|
|
78
|
-
"require": "./dist/ImageWithFallback/index.cjs"
|
|
84
|
+
"import": "./dist/components/ImageWithFallback/index.js",
|
|
85
|
+
"require": "./dist/components/ImageWithFallback/index.cjs"
|
|
79
86
|
},
|
|
80
87
|
"./ModalSheet": {
|
|
81
|
-
"import": "./dist/ModalSheet/index.js",
|
|
82
|
-
"require": "./dist/ModalSheet/index.cjs"
|
|
88
|
+
"import": "./dist/components/ModalSheet/index.js",
|
|
89
|
+
"require": "./dist/components/ModalSheet/index.cjs"
|
|
83
90
|
},
|
|
84
91
|
"./ProductCard": {
|
|
85
|
-
"import": "./dist/ProductCard/index.js",
|
|
86
|
-
"require": "./dist/ProductCard/index.cjs"
|
|
92
|
+
"import": "./dist/components/ProductCard/index.js",
|
|
93
|
+
"require": "./dist/components/ProductCard/index.cjs"
|
|
87
94
|
},
|
|
88
95
|
"./ProductGrid": {
|
|
89
|
-
"import": "./dist/ProductGrid/index.js",
|
|
90
|
-
"require": "./dist/ProductGrid/index.cjs"
|
|
96
|
+
"import": "./dist/components/ProductGrid/index.js",
|
|
97
|
+
"require": "./dist/components/ProductGrid/index.cjs"
|
|
91
98
|
},
|
|
92
99
|
"./RadioButton": {
|
|
93
|
-
"import": "./dist/RadioButton/index.js",
|
|
94
|
-
"require": "./dist/RadioButton/index.cjs"
|
|
100
|
+
"import": "./dist/components/RadioButton/index.js",
|
|
101
|
+
"require": "./dist/components/RadioButton/index.cjs"
|
|
95
102
|
},
|
|
96
103
|
"./RadioButtonGroup": {
|
|
97
|
-
"import": "./dist/RadioButtonGroup/index.js",
|
|
98
|
-
"require": "./dist/RadioButtonGroup/index.cjs"
|
|
104
|
+
"import": "./dist/components/RadioButtonGroup/index.js",
|
|
105
|
+
"require": "./dist/components/RadioButtonGroup/index.cjs"
|
|
106
|
+
},
|
|
107
|
+
"./RecommendedProducts": {
|
|
108
|
+
"import": "./dist/components/RecommendedProducts/index.js",
|
|
109
|
+
"require": "./dist/components/RecommendedProducts/index.cjs"
|
|
99
110
|
},
|
|
100
111
|
"./SearchAutocomplete": {
|
|
101
|
-
"import": "./dist/SearchAutocomplete/index.js",
|
|
102
|
-
"require": "./dist/SearchAutocomplete/index.cjs"
|
|
112
|
+
"import": "./dist/components/SearchAutocomplete/index.js",
|
|
113
|
+
"require": "./dist/components/SearchAutocomplete/index.cjs"
|
|
103
114
|
},
|
|
104
115
|
"./SearchFilter": {
|
|
105
|
-
"import": "./dist/SearchFilter/index.js",
|
|
106
|
-
"require": "./dist/SearchFilter/index.cjs"
|
|
116
|
+
"import": "./dist/components/SearchFilter/index.js",
|
|
117
|
+
"require": "./dist/components/SearchFilter/index.cjs"
|
|
107
118
|
},
|
|
108
119
|
"./SearchInput": {
|
|
109
|
-
"import": "./dist/SearchInput/index.js",
|
|
110
|
-
"require": "./dist/SearchInput/index.cjs"
|
|
120
|
+
"import": "./dist/components/SearchInput/index.js",
|
|
121
|
+
"require": "./dist/components/SearchInput/index.cjs"
|
|
111
122
|
},
|
|
112
123
|
"./SearchInputForm": {
|
|
113
|
-
"import": "./dist/SearchInputForm/index.js",
|
|
114
|
-
"require": "./dist/SearchInputForm/index.cjs"
|
|
124
|
+
"import": "./dist/components/SearchInputForm/index.js",
|
|
125
|
+
"require": "./dist/components/SearchInputForm/index.cjs"
|
|
115
126
|
},
|
|
116
127
|
"./SearchResultsContent": {
|
|
117
|
-
"import": "./dist/SearchResultsContent/index.js",
|
|
118
|
-
"require": "./dist/SearchResultsContent/index.cjs"
|
|
128
|
+
"import": "./dist/components/SearchResultsContent/index.js",
|
|
129
|
+
"require": "./dist/components/SearchResultsContent/index.cjs"
|
|
130
|
+
},
|
|
131
|
+
"./SearchResultsFilterButton": {
|
|
132
|
+
"import": "./dist/components/SearchResultsFilterButton/index.js",
|
|
133
|
+
"require": "./dist/components/SearchResultsFilterButton/index.cjs"
|
|
134
|
+
},
|
|
135
|
+
"./SearchResultsFilterModal": {
|
|
136
|
+
"import": "./dist/components/SearchResultsFilterModal/index.js",
|
|
137
|
+
"require": "./dist/components/SearchResultsFilterModal/index.cjs"
|
|
119
138
|
},
|
|
120
139
|
"./SearchResultsFilterSidebar": {
|
|
121
|
-
"import": "./dist/SearchResultsFilterSidebar/index.js",
|
|
122
|
-
"require": "./dist/SearchResultsFilterSidebar/index.cjs"
|
|
140
|
+
"import": "./dist/components/SearchResultsFilterSidebar/index.js",
|
|
141
|
+
"require": "./dist/components/SearchResultsFilterSidebar/index.cjs"
|
|
123
142
|
},
|
|
124
143
|
"./SearchResultsStates": {
|
|
125
|
-
"import": "./dist/SearchResultsStates/index.js",
|
|
126
|
-
"require": "./dist/SearchResultsStates/index.cjs"
|
|
144
|
+
"import": "./dist/components/SearchResultsStates/index.js",
|
|
145
|
+
"require": "./dist/components/SearchResultsStates/index.cjs"
|
|
146
|
+
},
|
|
147
|
+
"./SearchResultsToolbar": {
|
|
148
|
+
"import": "./dist/components/SearchResultsToolbar/index.js",
|
|
149
|
+
"require": "./dist/components/SearchResultsToolbar/index.cjs"
|
|
127
150
|
},
|
|
128
151
|
"./SparkleAnimation": {
|
|
129
|
-
"import": "./dist/SparkleAnimation/index.js",
|
|
130
|
-
"require": "./dist/SparkleAnimation/index.cjs"
|
|
152
|
+
"import": "./dist/components/SparkleAnimation/index.js",
|
|
153
|
+
"require": "./dist/components/SparkleAnimation/index.cjs"
|
|
131
154
|
},
|
|
132
155
|
"./Spinner": {
|
|
133
|
-
"import": "./dist/Spinner/index.js",
|
|
134
|
-
"require": "./dist/Spinner/index.cjs"
|
|
156
|
+
"import": "./dist/components/Spinner/index.js",
|
|
157
|
+
"require": "./dist/components/Spinner/index.cjs"
|
|
135
158
|
},
|
|
136
159
|
"./SuggestionButton": {
|
|
137
|
-
"import": "./dist/SuggestionButton/index.js",
|
|
138
|
-
"require": "./dist/SuggestionButton/index.cjs"
|
|
160
|
+
"import": "./dist/components/SuggestionButton/index.js",
|
|
161
|
+
"require": "./dist/components/SuggestionButton/index.cjs"
|
|
139
162
|
},
|
|
140
163
|
"./TextInput": {
|
|
141
|
-
"import": "./dist/TextInput/index.js",
|
|
142
|
-
"require": "./dist/TextInput/index.cjs"
|
|
164
|
+
"import": "./dist/components/TextInput/index.js",
|
|
165
|
+
"require": "./dist/components/TextInput/index.cjs"
|
|
143
166
|
},
|
|
144
167
|
"./ToggleButton": {
|
|
145
|
-
"import": "./dist/ToggleButton/index.js",
|
|
146
|
-
"require": "./dist/ToggleButton/index.cjs"
|
|
168
|
+
"import": "./dist/components/ToggleButton/index.js",
|
|
169
|
+
"require": "./dist/components/ToggleButton/index.cjs"
|
|
147
170
|
},
|
|
148
171
|
"./Typography": {
|
|
149
|
-
"import": "./dist/Typography/index.js",
|
|
150
|
-
"require": "./dist/Typography/index.cjs"
|
|
172
|
+
"import": "./dist/components/Typography/index.js",
|
|
173
|
+
"require": "./dist/components/Typography/index.cjs"
|
|
174
|
+
},
|
|
175
|
+
"./util": {
|
|
176
|
+
"import": "./dist/util/index.js",
|
|
177
|
+
"require": "./dist/util/index.cjs"
|
|
151
178
|
},
|
|
152
179
|
"./package.json": "./package.json"
|
|
153
180
|
}
|
|
@@ -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,3 +1,5 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
1
3
|
import { SelectedFilterOption } from '@envive-ai/react-hooks/atoms/search';
|
|
2
4
|
import { SearchResultsState } from '@envive-ai/react-hooks/hooks/utils';
|
|
3
5
|
import {
|
|
@@ -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,29 +1,55 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import Sparkles from '@envive-ai/react-icons/Sparkles';
|
|
3
3
|
import { Typography } from 'src/components/Typography';
|
|
4
|
+
import { SearchResponseProductAttributes } from '@envive-ai/react-hooks/application/models';
|
|
5
|
+
import { RecommendedProducts } from '../RecommendedProducts';
|
|
6
|
+
import { ProductGridVariant } from '../ProductCard';
|
|
4
7
|
|
|
5
8
|
interface NoSearchResultsFoundProps {
|
|
6
9
|
containerPaddingClasses: string;
|
|
7
|
-
includeBottomMargin?: boolean; // manually add about a page of bottom margin to push unsupressed content down
|
|
10
|
+
// includeBottomMargin?: boolean; // manually add about a page of bottom margin to push unsupressed content down
|
|
8
11
|
noResultsFoundText?: string;
|
|
9
12
|
sparkleIconColor?: string; // example format: var(--spiffy-colors-accent-primary)
|
|
13
|
+
recommendedProducts: SearchResponseProductAttributes['attributes'][];
|
|
14
|
+
searchText: string;
|
|
15
|
+
merchantShortName: string;
|
|
16
|
+
productGridVariant: ProductGridVariant;
|
|
10
17
|
}
|
|
11
18
|
|
|
12
19
|
export const NoSearchResultsFound = ({
|
|
13
20
|
containerPaddingClasses,
|
|
14
|
-
includeBottomMargin = false,
|
|
15
21
|
noResultsFoundText,
|
|
16
22
|
sparkleIconColor = 'var(--spiffy-colors-accent-primary)',
|
|
23
|
+
recommendedProducts,
|
|
24
|
+
searchText,
|
|
25
|
+
merchantShortName,
|
|
26
|
+
productGridVariant,
|
|
17
27
|
}: NoSearchResultsFoundProps) => {
|
|
18
|
-
const containerClasses = classNames(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'spiffy-tw-mt-6',
|
|
22
|
-
);
|
|
28
|
+
const containerClasses = classNames(containerPaddingClasses, 'spiffy-tw-mt-6', {
|
|
29
|
+
'spiffy-tw-mb-[100vh]': recommendedProducts.length === 0,
|
|
30
|
+
});
|
|
23
31
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
let textPrompt: React.ReactNode;
|
|
33
|
+
if (recommendedProducts.length > 0) {
|
|
34
|
+
textPrompt = noResultsFoundText ? (
|
|
35
|
+
<span>{noResultsFoundText}</span>
|
|
36
|
+
) : (
|
|
37
|
+
<span>
|
|
38
|
+
I’m sorry, I wasn’t able to find an exact match for
|
|
39
|
+
<strong className="spiffy-tw-font-semibold"> {`"${searchText}".`}</strong> Try changing your
|
|
40
|
+
filters or adjusting your search query. In the meantime, explore some of our top-selling
|
|
41
|
+
products below.
|
|
42
|
+
</span>
|
|
43
|
+
);
|
|
44
|
+
} else {
|
|
45
|
+
textPrompt = (
|
|
46
|
+
<span>
|
|
47
|
+
I’m sorry, I wasn’t able to find an exact match for
|
|
48
|
+
<strong className="spiffy-tw-font-semibold"> {`"${searchText}."`}</strong> Try changing your
|
|
49
|
+
filters or adjusting your search query.
|
|
50
|
+
</span>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
27
53
|
|
|
28
54
|
return (
|
|
29
55
|
<div className={containerClasses}>
|
|
@@ -36,6 +62,12 @@ export const NoSearchResultsFound = ({
|
|
|
36
62
|
</div>
|
|
37
63
|
<Typography variant="body2">{textPrompt}</Typography>
|
|
38
64
|
</div>
|
|
65
|
+
<RecommendedProducts
|
|
66
|
+
retrievedProducts={recommendedProducts}
|
|
67
|
+
merchantShortName={merchantShortName}
|
|
68
|
+
productCardConfig={{ variant: 'minimal', hoverVariant: 'none', layoutVariant: 'square' }}
|
|
69
|
+
productGridVariant={productGridVariant}
|
|
70
|
+
/>
|
|
39
71
|
</div>
|
|
40
72
|
);
|
|
41
|
-
};
|
|
73
|
+
};
|