@envive-ai/react-widgets 0.1.2-arthur-3 → 0.1.3
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/SearchResults/SearchResults.cjs +86 -0
- package/dist/SearchResults/SearchResults.js +84 -0
- package/dist/SearchResults/SearchResultsWidget.cjs +34 -0
- package/dist/SearchResults/SearchResultsWidget.js +33 -0
- package/dist/SearchResults/index.cjs +2 -122
- package/dist/SearchResults/index.d.cts +2 -0
- package/dist/SearchResults/index.d.ts +2 -0
- package/dist/SearchResults/index.js +1 -119
- package/dist/SearchResults/withSearchResults.cjs +18 -0
- package/dist/SearchResults/withSearchResults.js +17 -0
- package/dist/SearchZeroState/SearchIcon.cjs +48 -0
- package/dist/SearchZeroState/SearchIcon.js +45 -0
- package/dist/SearchZeroState/SearchOverlay.cjs +42 -0
- package/dist/SearchZeroState/SearchOverlay.js +39 -0
- package/dist/SearchZeroState/SearchZeroState.cjs +173 -0
- package/dist/SearchZeroState/SearchZeroState.d.cts +7 -0
- package/dist/SearchZeroState/SearchZeroState.d.ts +7 -0
- package/dist/SearchZeroState/SearchZeroState.js +171 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.cjs +23 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +15 -0
- package/dist/SearchZeroState/SearchZeroStateWidget.js +22 -0
- package/dist/SearchZeroState/components/RecommendedProducts.cjs +74 -0
- package/dist/SearchZeroState/components/RecommendedProducts.js +72 -0
- package/dist/SearchZeroState/index.cjs +4 -2996
- package/dist/SearchZeroState/index.d.cts +4 -0
- package/dist/SearchZeroState/index.d.ts +4 -0
- package/dist/SearchZeroState/index.js +2 -2991
- package/dist/SearchZeroState/overlay/overlayHostLocator.cjs +21 -0
- package/dist/SearchZeroState/overlay/overlayHostLocator.js +20 -0
- package/dist/SearchZeroState/types.d.cts +10 -0
- package/dist/SearchZeroState/types.d.ts +10 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.cjs +21 -0
- package/dist/SearchZeroState/zeroStateSearchVariants.js +20 -0
- package/dist/SuggestionBar/SuggestionBar.cjs +74 -0
- package/dist/SuggestionBar/{index-DZU9kbWS.d.cts → SuggestionBar.d.cts} +4 -9
- package/dist/SuggestionBar/{index-DyXd4-b7.d.ts → SuggestionBar.d.ts} +6 -11
- package/dist/SuggestionBar/SuggestionBar.js +72 -0
- package/dist/SuggestionBar/index.cjs +3 -3
- package/dist/SuggestionBar/index.d.cts +3 -0
- package/dist/SuggestionBar/index.d.ts +3 -0
- package/dist/SuggestionBar/index.js +2 -2
- package/dist/SuggestionBar/types.cjs +10 -0
- package/dist/SuggestionBar/types.d.cts +7 -0
- package/dist/SuggestionBar/types.d.ts +7 -0
- package/dist/SuggestionBar/types.js +9 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +76 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +6 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +6 -0
- package/dist/SuggestionButtonContainer/SuggestionButtonContainer.js +75 -0
- package/dist/SuggestionButtonContainer/index.cjs +1 -1
- package/dist/SuggestionButtonContainer/index.d.cts +3 -0
- package/dist/SuggestionButtonContainer/index.d.ts +3 -0
- package/dist/SuggestionButtonContainer/index.js +1 -1
- package/dist/SuggestionButtonContainer/{index-B_X537jw.d.cts → types.d.cts} +1 -4
- package/dist/SuggestionButtonContainer/{index-vwelzDzM.d.ts → types.d.ts} +1 -4
- package/dist/_virtual/rolldown_runtime.cjs +33 -0
- package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
- package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
- package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
- package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
- package/dist/node_modules/react-icons/md/index.cjs +35 -0
- package/dist/node_modules/react-icons/md/index.js +35 -0
- package/dist/{SuggestionBar-BOThXJvJ.cjs → node_modules/react-indiana-drag-scroll/dist/index.cjs} +6 -139
- package/dist/node_modules/uuid/dist/native.js +6 -0
- package/dist/node_modules/uuid/dist/rng.js +13 -0
- package/dist/node_modules/uuid/dist/stringify.js +9 -0
- package/dist/node_modules/uuid/dist/v4.js +27 -0
- package/dist/node_modules/uuid/dist-node/native.cjs +8 -0
- package/dist/node_modules/uuid/dist-node/rng.cjs +16 -0
- package/dist/node_modules/uuid/dist-node/stringify.cjs +10 -0
- package/dist/node_modules/uuid/dist-node/v4.cjs +27 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.cjs +80 -0
- package/dist/packages/components/dist/components/Accordion/Accordion.js +78 -0
- package/dist/packages/components/dist/components/Accordion/index.cjs +1 -0
- package/dist/packages/components/dist/components/Accordion/index.js +1 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +30 -0
- package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +29 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +56 -0
- package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +54 -0
- package/dist/packages/components/dist/components/ButtonBase/index.cjs +2 -0
- package/dist/packages/components/dist/components/ButtonBase/index.js +2 -0
- package/dist/packages/components/dist/components/ButtonBase/types.cjs +11 -0
- package/dist/packages/components/dist/components/ButtonBase/types.js +10 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +45 -0
- package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +42 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +33 -0
- package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +30 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +45 -0
- package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +42 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +1 -0
- package/dist/packages/components/dist/components/ImageWithFallback/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +30 -0
- package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +29 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +26 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +24 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +122 -0
- package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +120 -0
- package/dist/packages/components/dist/components/ModalSheet/index.cjs +1 -0
- package/dist/packages/components/dist/components/ModalSheet/index.js +1 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +116 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +114 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +38 -0
- package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +36 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +153 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCard.js +149 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +33 -0
- package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +31 -0
- package/dist/packages/components/dist/components/ProductCard/index.cjs +4 -0
- package/dist/packages/components/dist/components/ProductCard/index.js +4 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +49 -0
- package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +45 -0
- package/dist/packages/components/dist/components/ProductCard/types.cjs +10 -0
- package/dist/packages/components/dist/components/ProductCard/types.js +9 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +43 -0
- package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +41 -0
- package/dist/packages/components/dist/components/ProductGrid/index.cjs +2 -0
- package/dist/packages/components/dist/components/ProductGrid/index.js +2 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +21 -0
- package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +20 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +74 -0
- package/dist/packages/components/dist/components/RadioButton/RadioButton.js +72 -0
- package/dist/packages/components/dist/components/RadioButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButton/index.js +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +42 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +39 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +1 -0
- package/dist/packages/components/dist/components/RadioButtonGroup/index.js +1 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +53 -0
- package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +51 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +3 -0
- package/dist/packages/components/dist/components/RecommendedProducts/index.js +3 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +72 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +69 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchAutocomplete/index.js +1 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +134 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +132 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +48 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +46 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +42 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +40 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +6 -0
- package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +4 -0
- package/dist/packages/components/dist/components/SearchFilter/index.cjs +5 -0
- package/dist/packages/components/dist/components/SearchFilter/index.js +5 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +27 -0
- package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +26 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.cjs +11 -0
- package/dist/packages/components/dist/components/SearchFilter/utils.js +9 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +81 -0
- package/dist/packages/components/dist/components/SearchInput/SearchInput.js +78 -0
- package/dist/packages/components/dist/components/SearchInput/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchInput/index.js +2 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +15 -0
- package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +15 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +57 -0
- package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +55 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchInputForm/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +50 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +1 -0
- package/dist/packages/components/dist/components/SearchResultsContent/index.js +1 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +24 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +23 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +36 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +35 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +9 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +2 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +34 -0
- package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +34 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +56 -0
- package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +54 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +53 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
- package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +51 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsStates/index.js +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +60 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +57 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +3 -0
- package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +3 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +77 -0
- package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +75 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/index.js +2 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +12 -0
- package/dist/packages/components/dist/components/SparkleAnimation/types.js +11 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.cjs +40 -0
- package/dist/packages/components/dist/components/Spinner/Spinner.js +38 -0
- package/dist/packages/components/dist/components/Spinner/index.cjs +1 -0
- package/dist/packages/components/dist/components/Spinner/index.js +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +193 -0
- package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +188 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/SuggestionButton/index.js +1 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.cjs +34 -0
- package/dist/packages/components/dist/components/TextInput/TextInput.js +31 -0
- package/dist/packages/components/dist/components/TextInput/index.cjs +1 -0
- package/dist/packages/components/dist/components/TextInput/index.js +1 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +63 -0
- package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +61 -0
- package/dist/packages/components/dist/components/ToggleButton/index.cjs +1 -0
- package/dist/packages/components/dist/components/ToggleButton/index.js +1 -0
- package/dist/packages/components/dist/components/Typography/Typography.cjs +53 -0
- package/dist/packages/components/dist/components/Typography/Typography.js +50 -0
- package/dist/packages/components/dist/components/Typography/index.cjs +2 -0
- package/dist/packages/components/dist/components/Typography/index.js +2 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +99 -0
- package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +96 -0
- package/dist/packages/components/dist/components/Typography/util.cjs +10 -0
- package/dist/packages/components/dist/components/Typography/util.js +10 -0
- package/dist/packages/components/dist/logging/logger.cjs +20 -0
- package/dist/packages/components/dist/logging/logger.js +19 -0
- package/dist/packages/components/dist/models/colorsConfig.cjs +28 -0
- package/dist/packages/components/dist/models/colorsConfig.js +26 -0
- package/dist/packages/components/dist/util/formatPrice.cjs +14 -0
- package/dist/packages/components/dist/util/formatPrice.js +13 -0
- package/dist/packages/components/dist/util/index.cjs +3 -0
- package/dist/packages/components/dist/util/index.js +3 -0
- package/dist/packages/components/dist/util/useScrollDirection.cjs +39 -0
- package/dist/packages/components/dist/util/useScrollDirection.js +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.cjs +38 -0
- package/dist/packages/components/dist/util/useStickyVisibility.js +37 -0
- package/dist/packages/icons/dist/AiSearchBold.cjs +38 -0
- package/dist/packages/icons/dist/AiSearchBold.js +38 -0
- package/dist/packages/icons/dist/AiSearchThin.cjs +35 -0
- package/dist/packages/icons/dist/AiSearchThin.js +35 -0
- package/dist/packages/icons/dist/ChevronDown.cjs +23 -0
- package/dist/packages/icons/dist/ChevronDown.js +23 -0
- package/dist/packages/icons/dist/FourPointStar.cjs +22 -0
- package/dist/packages/icons/dist/FourPointStar.js +22 -0
- package/dist/packages/icons/dist/IconClose.cjs +26 -0
- package/dist/packages/icons/dist/IconClose.js +26 -0
- package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
- package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +39 -0
- package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +39 -0
- package/dist/packages/icons/dist/OutlinedStar.cjs +22 -0
- package/dist/packages/icons/dist/OutlinedStar.js +22 -0
- package/dist/packages/icons/dist/SettingsVariant.cjs +72 -0
- package/dist/packages/icons/dist/SettingsVariant.js +72 -0
- package/dist/packages/icons/dist/Sparkles.cjs +43 -0
- package/dist/packages/icons/dist/Sparkles.js +43 -0
- package/dist/{chunk-DWy1uDak.cjs → packages/icons/dist/_virtual/rolldown_runtime.cjs} +4 -14
- package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +27 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
- package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
- package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
- package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
- package/dist/util/useHorizontalScrollAnimation.cjs +88 -0
- package/dist/util/useHorizontalScrollAnimation.js +87 -0
- package/dist/util/useReducedMotionWithOverride.cjs +15 -0
- package/dist/util/useReducedMotionWithOverride.js +14 -0
- package/package.json +14 -8
- package/src/SearchResults/SearchResults.tsx +2 -4
- package/src/SearchResults/SearchResultsWidget.tsx +1 -1
- package/src/SearchResults/types.ts +0 -3
- package/src/SearchZeroState/SearchIcon.tsx +16 -9
- package/src/SearchZeroState/SearchOverlay.tsx +3 -2
- package/src/SearchZeroState/SearchZeroState.tsx +15 -18
- package/src/SearchZeroState/SearchZeroStateWidget.tsx +17 -8
- package/src/SearchZeroState/components/RecommendedProducts.tsx +8 -3
- package/src/SearchZeroState/overlay/overlayHostLocator.ts +2 -4
- package/src/SearchZeroState/types.ts +4 -1
- package/src/SearchZeroState/zeroStateSearchVariants.ts +14 -5
- package/src/SuggestionBar/SuggestionBar.tsx +12 -20
- package/src/SuggestionBar/types.ts +3 -3
- package/src/SuggestionButtonContainer/SuggestionButtonContainer.tsx +8 -17
- package/src/SuggestionButtonContainer/types.ts +3 -4
- package/src/stories/SearchResults.stories.tsx +1 -1
- package/src/stories/SearchZeroState.stories.tsx +10 -2
- package/src/stories/SuggestionBar.stories.tsx +1 -2
- package/src/util/useHorizontalScrollAnimation.ts +1 -1
- package/dist/SearchZeroState/index-19CiYvee.d.cts +0 -27
- package/dist/SearchZeroState/index-6EaGWYP4.d.ts +0 -27
- package/dist/SuggestionBar-DeMmAK4M.js +0 -131
- package/dist/SuggestionButtonContainer-BeWPpeQk.cjs +0 -173
- package/dist/SuggestionButtonContainer-CZhOkZaJ.js +0 -167
- /package/dist/SearchResults/{index-D8nrHueo.d.ts → SearchResultsWidget.d.cts} +0 -0
- /package/dist/SearchResults/{index-D52sX_I2.d.cts → SearchResultsWidget.d.ts} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_SearchResultsContent = require('../packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs');
|
|
3
|
+
require('../packages/components/dist/components/SearchResultsContent/index.cjs');
|
|
4
|
+
const require_SearchResultsFilterModal = require('../packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs');
|
|
5
|
+
require('../packages/components/dist/components/SearchResultsFilterModal/index.cjs');
|
|
6
|
+
const require_SearchResultsToolbar = require('../packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs');
|
|
7
|
+
require('../packages/components/dist/components/SearchResultsToolbar/index.cjs');
|
|
8
|
+
const require_useStickyVisibility = require('../packages/components/dist/util/useStickyVisibility.cjs');
|
|
9
|
+
require('../packages/components/dist/util/index.cjs');
|
|
10
|
+
const require_withSearchResults = require('./withSearchResults.cjs');
|
|
11
|
+
let react = require("react");
|
|
12
|
+
let classnames = require("classnames");
|
|
13
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
14
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
//#region src/SearchResults/SearchResults.tsx
|
|
17
|
+
const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShortName, productList, autocompleteResults, searchFilters, availableDynamicFilters, selectedFilterOptions, searchText, query, searchResultsState, isFilterOpen, shouldShowAutocomplete, focusedIndex, focusedOptionId, recommendedProducts, filterButtonText, onSearchInputChange, onSubmitSearch, onAutocompleteSelect, onKeyDown, onSearchInputFocus, onSearchInputBlur, onToggleDynamicFilter, onSelectFilterItem, onRemoveFilter, onClearAllFilters, setIsFilterOpen, searchResultsRef }) => {
|
|
18
|
+
const { searchInputVariant, searchFilterSidebarVariant, productGridVariant, searchBoxPlaceholder, noResultsFoundText, isSearchInputSticky = false } = widgetConfig;
|
|
19
|
+
const { toolbarRef: ref, isVisible, toolbarHeight: height } = require_useStickyVisibility.useStickyVisibility();
|
|
20
|
+
const toolbarRef = isSearchInputSticky ? ref : null;
|
|
21
|
+
const finalIsVisible = isSearchInputSticky ? isVisible : true;
|
|
22
|
+
const toolbarHeight = isSearchInputSticky ? height : 0;
|
|
23
|
+
const stickyToolbarClasses = (0, classnames.default)("spiffy-tw-fixed", "spiffy-tw-top-0", "spiffy-tw-left-0", "spiffy-tw-right-0", "spiffy-tw-transition-transform", "spiffy-tw-duration-300", "spiffy-tw-py-[8px]");
|
|
24
|
+
const containerXPaddingClasses = (0, classnames.default)("spiffy-tw-px-[16px]", "sm:spiffy-tw-px-[46px]");
|
|
25
|
+
(0, react.useEffect)(() => {
|
|
26
|
+
window.scrollTo({
|
|
27
|
+
top: 0,
|
|
28
|
+
behavior: "smooth"
|
|
29
|
+
});
|
|
30
|
+
}, [productList]);
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchResultsFilterModal.SearchResultsFilterModal, {
|
|
33
|
+
isOpen: isFilterOpen,
|
|
34
|
+
setIsOpen: setIsFilterOpen,
|
|
35
|
+
searchFilters,
|
|
36
|
+
productCount: productList.length,
|
|
37
|
+
onSelectFilterItem,
|
|
38
|
+
onClearAllFilters,
|
|
39
|
+
searchFilterSidebarVariant,
|
|
40
|
+
filterButtonText
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchResultsToolbar.SearchResultsToolbar, {
|
|
43
|
+
className: isSearchInputSticky ? stickyToolbarClasses : "spiffy-tw-py-[8px]",
|
|
44
|
+
toolbarRef,
|
|
45
|
+
searchInputVariant,
|
|
46
|
+
searchBoxPlaceholder,
|
|
47
|
+
searchText,
|
|
48
|
+
focusedIndex,
|
|
49
|
+
focusedOptionId,
|
|
50
|
+
autocompleteResults,
|
|
51
|
+
filterButtonText,
|
|
52
|
+
onKeyDown,
|
|
53
|
+
onSearchInputChange,
|
|
54
|
+
onSubmitSearch,
|
|
55
|
+
onAutocompleteSelect,
|
|
56
|
+
onSearchInputFocus,
|
|
57
|
+
onSearchInputBlur,
|
|
58
|
+
shouldShowAutocomplete,
|
|
59
|
+
setIsFilterOpen,
|
|
60
|
+
containerXPaddingClasses,
|
|
61
|
+
isVisible: finalIsVisible
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchResultsContent.SearchResultsContent, {
|
|
64
|
+
searchResultsState,
|
|
65
|
+
productList,
|
|
66
|
+
recommendedProducts,
|
|
67
|
+
productCardConfig,
|
|
68
|
+
merchantShortName,
|
|
69
|
+
searchFilterSidebarVariant,
|
|
70
|
+
noResultsFoundText,
|
|
71
|
+
productGridVariant,
|
|
72
|
+
containerXPaddingClasses,
|
|
73
|
+
selectedFilterOptions,
|
|
74
|
+
availableDynamicFilters,
|
|
75
|
+
onRemoveFilter,
|
|
76
|
+
onToggleDynamicFilter,
|
|
77
|
+
searchResultsRef,
|
|
78
|
+
toolbarHeight,
|
|
79
|
+
query
|
|
80
|
+
})
|
|
81
|
+
] });
|
|
82
|
+
};
|
|
83
|
+
const SearchResults = require_withSearchResults.withSearchResults(SearchResultsComponent);
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
exports.SearchResults = SearchResults;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { SearchResultsContent } from "../packages/components/dist/components/SearchResultsContent/SearchResultsContent.js";
|
|
2
|
+
import "../packages/components/dist/components/SearchResultsContent/index.js";
|
|
3
|
+
import { SearchResultsFilterModal } from "../packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js";
|
|
4
|
+
import "../packages/components/dist/components/SearchResultsFilterModal/index.js";
|
|
5
|
+
import { SearchResultsToolbar } from "../packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js";
|
|
6
|
+
import "../packages/components/dist/components/SearchResultsToolbar/index.js";
|
|
7
|
+
import { useStickyVisibility } from "../packages/components/dist/util/useStickyVisibility.js";
|
|
8
|
+
import "../packages/components/dist/util/index.js";
|
|
9
|
+
import { withSearchResults } from "./withSearchResults.js";
|
|
10
|
+
import { useEffect } from "react";
|
|
11
|
+
import classNames from "classnames";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
|
|
14
|
+
//#region src/SearchResults/SearchResults.tsx
|
|
15
|
+
const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShortName, productList, autocompleteResults, searchFilters, availableDynamicFilters, selectedFilterOptions, searchText, query, searchResultsState, isFilterOpen, shouldShowAutocomplete, focusedIndex, focusedOptionId, recommendedProducts, filterButtonText, onSearchInputChange, onSubmitSearch, onAutocompleteSelect, onKeyDown, onSearchInputFocus, onSearchInputBlur, onToggleDynamicFilter, onSelectFilterItem, onRemoveFilter, onClearAllFilters, setIsFilterOpen, searchResultsRef }) => {
|
|
16
|
+
const { searchInputVariant, searchFilterSidebarVariant, productGridVariant, searchBoxPlaceholder, noResultsFoundText, isSearchInputSticky = false } = widgetConfig;
|
|
17
|
+
const { toolbarRef: ref, isVisible, toolbarHeight: height } = useStickyVisibility();
|
|
18
|
+
const toolbarRef = isSearchInputSticky ? ref : null;
|
|
19
|
+
const finalIsVisible = isSearchInputSticky ? isVisible : true;
|
|
20
|
+
const toolbarHeight = isSearchInputSticky ? height : 0;
|
|
21
|
+
const stickyToolbarClasses = classNames("spiffy-tw-fixed", "spiffy-tw-top-0", "spiffy-tw-left-0", "spiffy-tw-right-0", "spiffy-tw-transition-transform", "spiffy-tw-duration-300", "spiffy-tw-py-[8px]");
|
|
22
|
+
const containerXPaddingClasses = classNames("spiffy-tw-px-[16px]", "sm:spiffy-tw-px-[46px]");
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
window.scrollTo({
|
|
25
|
+
top: 0,
|
|
26
|
+
behavior: "smooth"
|
|
27
|
+
});
|
|
28
|
+
}, [productList]);
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
30
|
+
/* @__PURE__ */ jsx(SearchResultsFilterModal, {
|
|
31
|
+
isOpen: isFilterOpen,
|
|
32
|
+
setIsOpen: setIsFilterOpen,
|
|
33
|
+
searchFilters,
|
|
34
|
+
productCount: productList.length,
|
|
35
|
+
onSelectFilterItem,
|
|
36
|
+
onClearAllFilters,
|
|
37
|
+
searchFilterSidebarVariant,
|
|
38
|
+
filterButtonText
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ jsx(SearchResultsToolbar, {
|
|
41
|
+
className: isSearchInputSticky ? stickyToolbarClasses : "spiffy-tw-py-[8px]",
|
|
42
|
+
toolbarRef,
|
|
43
|
+
searchInputVariant,
|
|
44
|
+
searchBoxPlaceholder,
|
|
45
|
+
searchText,
|
|
46
|
+
focusedIndex,
|
|
47
|
+
focusedOptionId,
|
|
48
|
+
autocompleteResults,
|
|
49
|
+
filterButtonText,
|
|
50
|
+
onKeyDown,
|
|
51
|
+
onSearchInputChange,
|
|
52
|
+
onSubmitSearch,
|
|
53
|
+
onAutocompleteSelect,
|
|
54
|
+
onSearchInputFocus,
|
|
55
|
+
onSearchInputBlur,
|
|
56
|
+
shouldShowAutocomplete,
|
|
57
|
+
setIsFilterOpen,
|
|
58
|
+
containerXPaddingClasses,
|
|
59
|
+
isVisible: finalIsVisible
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsx(SearchResultsContent, {
|
|
62
|
+
searchResultsState,
|
|
63
|
+
productList,
|
|
64
|
+
recommendedProducts,
|
|
65
|
+
productCardConfig,
|
|
66
|
+
merchantShortName,
|
|
67
|
+
searchFilterSidebarVariant,
|
|
68
|
+
noResultsFoundText,
|
|
69
|
+
productGridVariant,
|
|
70
|
+
containerXPaddingClasses,
|
|
71
|
+
selectedFilterOptions,
|
|
72
|
+
availableDynamicFilters,
|
|
73
|
+
onRemoveFilter,
|
|
74
|
+
onToggleDynamicFilter,
|
|
75
|
+
searchResultsRef,
|
|
76
|
+
toolbarHeight,
|
|
77
|
+
query
|
|
78
|
+
})
|
|
79
|
+
] });
|
|
80
|
+
};
|
|
81
|
+
const SearchResults = withSearchResults(SearchResultsComponent);
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { SearchResults };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_SearchResults = require('./SearchResults.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let jotai = require("jotai");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __envive_ai_react_hooks_atoms_globalSearch = require("@envive-ai/react-hooks/atoms/globalSearch");
|
|
7
|
+
let __envive_ai_react_hooks_atoms_search = require("@envive-ai/react-hooks/atoms/search");
|
|
8
|
+
let __envive_ai_react_hooks_hooks_NewOrgConfig = require("@envive-ai/react-hooks/hooks/NewOrgConfig");
|
|
9
|
+
|
|
10
|
+
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
11
|
+
const SearchResultsWidget = () => {
|
|
12
|
+
const setIsSearchResultsOpen = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_globalSearch.isSearchResultsOpenAtom);
|
|
13
|
+
const setSearchSystem = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_search.searchSystemAtom);
|
|
14
|
+
const newConfig = (0, __envive_ai_react_hooks_hooks_NewOrgConfig.useNewOrgConfig)();
|
|
15
|
+
(0, react.useEffect)(() => {
|
|
16
|
+
setSearchSystem(true);
|
|
17
|
+
return () => setSearchSystem(false);
|
|
18
|
+
}, [setSearchSystem]);
|
|
19
|
+
(0, react.useEffect)(() => {
|
|
20
|
+
setIsSearchResultsOpen(true);
|
|
21
|
+
return () => {
|
|
22
|
+
setIsSearchResultsOpen(false);
|
|
23
|
+
};
|
|
24
|
+
}, [setIsSearchResultsOpen]);
|
|
25
|
+
const widgetConfig = (0, react.useMemo)(() => {
|
|
26
|
+
if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === "searchResultsEntryPoint").config };
|
|
27
|
+
return null;
|
|
28
|
+
}, [newConfig]);
|
|
29
|
+
if (!widgetConfig) return null;
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchResults.SearchResults, { widgetConfig });
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.SearchResultsWidget = SearchResultsWidget;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SearchResults } from "./SearchResults.js";
|
|
2
|
+
import { useEffect, useMemo } from "react";
|
|
3
|
+
import { useSetAtom } from "jotai";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { isSearchResultsOpenAtom } from "@envive-ai/react-hooks/atoms/globalSearch";
|
|
6
|
+
import { searchSystemAtom } from "@envive-ai/react-hooks/atoms/search";
|
|
7
|
+
import { useNewOrgConfig } from "@envive-ai/react-hooks/hooks/NewOrgConfig";
|
|
8
|
+
|
|
9
|
+
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
10
|
+
const SearchResultsWidget = () => {
|
|
11
|
+
const setIsSearchResultsOpen = useSetAtom(isSearchResultsOpenAtom);
|
|
12
|
+
const setSearchSystem = useSetAtom(searchSystemAtom);
|
|
13
|
+
const newConfig = useNewOrgConfig();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setSearchSystem(true);
|
|
16
|
+
return () => setSearchSystem(false);
|
|
17
|
+
}, [setSearchSystem]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setIsSearchResultsOpen(true);
|
|
20
|
+
return () => {
|
|
21
|
+
setIsSearchResultsOpen(false);
|
|
22
|
+
};
|
|
23
|
+
}, [setIsSearchResultsOpen]);
|
|
24
|
+
const widgetConfig = useMemo(() => {
|
|
25
|
+
if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === "searchResultsEntryPoint").config };
|
|
26
|
+
return null;
|
|
27
|
+
}, [newConfig]);
|
|
28
|
+
if (!widgetConfig) return null;
|
|
29
|
+
return /* @__PURE__ */ jsx(SearchResults, { widgetConfig });
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { SearchResultsWidget };
|
|
@@ -1,123 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
let react = require("react");
|
|
3
|
-
let jotai = require("jotai");
|
|
4
|
-
let __envive_ai_react_hooks_atoms_globalSearch = require("@envive-ai/react-hooks/atoms/globalSearch");
|
|
5
|
-
let __envive_ai_react_hooks_atoms_search = require("@envive-ai/react-hooks/atoms/search");
|
|
6
|
-
let __envive_ai_react_hooks_hooks_NewOrgConfig = require("@envive-ai/react-hooks/hooks/NewOrgConfig");
|
|
7
|
-
let classnames = require("classnames");
|
|
8
|
-
classnames = require_chunk.__toESM(classnames);
|
|
9
|
-
let __envive_ai_react_toolkit_SearchResultsContent = require("@envive-ai/react-toolkit/SearchResultsContent");
|
|
10
|
-
let __envive_ai_react_toolkit_SearchResultsFilterModal = require("@envive-ai/react-toolkit/SearchResultsFilterModal");
|
|
11
|
-
let __envive_ai_react_toolkit_SearchResultsToolbar = require("@envive-ai/react-toolkit/SearchResultsToolbar");
|
|
12
|
-
let __envive_ai_react_toolkit_util = require("@envive-ai/react-toolkit/util");
|
|
13
|
-
let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
|
|
14
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
1
|
+
const require_SearchResultsWidget = require('./SearchResultsWidget.cjs');
|
|
15
2
|
|
|
16
|
-
|
|
17
|
-
function withSearchResults(Component) {
|
|
18
|
-
return function SearchResultsHoc(props) {
|
|
19
|
-
const searchHookResult = (0, __envive_ai_react_hooks_hooks_Search.useSearch)();
|
|
20
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
21
|
-
...props,
|
|
22
|
-
...searchHookResult,
|
|
23
|
-
productList: searchHookResult.searchData?.products || []
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/SearchResults/SearchResults.tsx
|
|
30
|
-
const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShortName, productList, autocompleteResults, searchFilters, availableDynamicFilters, selectedFilterOptions, searchText, query, searchResultsState, isFilterOpen, shouldShowAutocomplete, focusedIndex, focusedOptionId, recommendedProducts, filterButtonText, onSearchInputChange, onSubmitSearch, onAutocompleteSelect, onKeyDown, onSearchInputFocus, onSearchInputBlur, onToggleDynamicFilter, onSelectFilterItem, onRemoveFilter, onClearAllFilters, setIsFilterOpen, searchResultsRef }) => {
|
|
31
|
-
const { searchInputVariant, searchFilterSidebarVariant, productGridVariant, searchBoxPlaceholder, noResultsFoundText, isSearchInputSticky = false } = widgetConfig;
|
|
32
|
-
const { toolbarRef: ref, isVisible, toolbarHeight: height } = (0, __envive_ai_react_toolkit_util.useStickyVisibility)();
|
|
33
|
-
const toolbarRef = isSearchInputSticky ? ref : null;
|
|
34
|
-
const finalIsVisible = isSearchInputSticky ? isVisible : true;
|
|
35
|
-
const toolbarHeight = isSearchInputSticky ? height : 0;
|
|
36
|
-
const stickyToolbarClasses = (0, classnames.default)("spiffy-tw-fixed", "spiffy-tw-top-0", "spiffy-tw-left-0", "spiffy-tw-right-0", "spiffy-tw-transition-transform", "spiffy-tw-duration-300", "spiffy-tw-py-[8px]");
|
|
37
|
-
const containerXPaddingClasses = (0, classnames.default)("spiffy-tw-px-[16px]", "sm:spiffy-tw-px-[46px]");
|
|
38
|
-
(0, react.useEffect)(() => {
|
|
39
|
-
window.scrollTo({
|
|
40
|
-
top: 0,
|
|
41
|
-
behavior: "smooth"
|
|
42
|
-
});
|
|
43
|
-
}, [productList]);
|
|
44
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
45
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsFilterModal.SearchResultsFilterModal, {
|
|
46
|
-
isOpen: isFilterOpen,
|
|
47
|
-
setIsOpen: setIsFilterOpen,
|
|
48
|
-
searchFilters,
|
|
49
|
-
productCount: productList.length,
|
|
50
|
-
onSelectFilterItem,
|
|
51
|
-
onClearAllFilters,
|
|
52
|
-
searchFilterSidebarVariant,
|
|
53
|
-
filterButtonText
|
|
54
|
-
}),
|
|
55
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsToolbar.SearchResultsToolbar, {
|
|
56
|
-
className: isSearchInputSticky ? stickyToolbarClasses : "spiffy-tw-py-[8px]",
|
|
57
|
-
toolbarRef,
|
|
58
|
-
searchInputVariant,
|
|
59
|
-
searchBoxPlaceholder,
|
|
60
|
-
searchText,
|
|
61
|
-
focusedIndex,
|
|
62
|
-
focusedOptionId,
|
|
63
|
-
autocompleteResults,
|
|
64
|
-
filterButtonText,
|
|
65
|
-
onKeyDown,
|
|
66
|
-
onSearchInputChange,
|
|
67
|
-
onSubmitSearch,
|
|
68
|
-
onAutocompleteSelect,
|
|
69
|
-
onSearchInputFocus,
|
|
70
|
-
onSearchInputBlur,
|
|
71
|
-
shouldShowAutocomplete,
|
|
72
|
-
setIsFilterOpen,
|
|
73
|
-
containerXPaddingClasses,
|
|
74
|
-
isVisible: finalIsVisible
|
|
75
|
-
}),
|
|
76
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_toolkit_SearchResultsContent.SearchResultsContent, {
|
|
77
|
-
searchResultsState,
|
|
78
|
-
productList,
|
|
79
|
-
recommendedProducts,
|
|
80
|
-
productCardConfig,
|
|
81
|
-
merchantShortName,
|
|
82
|
-
searchFilterSidebarVariant,
|
|
83
|
-
noResultsFoundText,
|
|
84
|
-
productGridVariant,
|
|
85
|
-
containerXPaddingClasses,
|
|
86
|
-
selectedFilterOptions,
|
|
87
|
-
availableDynamicFilters,
|
|
88
|
-
onRemoveFilter,
|
|
89
|
-
onToggleDynamicFilter,
|
|
90
|
-
searchResultsRef,
|
|
91
|
-
toolbarHeight,
|
|
92
|
-
query
|
|
93
|
-
})
|
|
94
|
-
] });
|
|
95
|
-
};
|
|
96
|
-
const SearchResults = withSearchResults(SearchResultsComponent);
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
100
|
-
const SearchResultsWidget = () => {
|
|
101
|
-
const setIsSearchResultsOpen = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_globalSearch.isSearchResultsOpenAtom);
|
|
102
|
-
const setSearchSystem = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_search.searchSystemAtom);
|
|
103
|
-
const newConfig = (0, __envive_ai_react_hooks_hooks_NewOrgConfig.useNewOrgConfig)();
|
|
104
|
-
(0, react.useEffect)(() => {
|
|
105
|
-
setSearchSystem(true);
|
|
106
|
-
return () => setSearchSystem(false);
|
|
107
|
-
}, [setSearchSystem]);
|
|
108
|
-
(0, react.useEffect)(() => {
|
|
109
|
-
setIsSearchResultsOpen(true);
|
|
110
|
-
return () => {
|
|
111
|
-
setIsSearchResultsOpen(false);
|
|
112
|
-
};
|
|
113
|
-
}, [setIsSearchResultsOpen]);
|
|
114
|
-
const widgetConfig = (0, react.useMemo)(() => {
|
|
115
|
-
if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === "searchResultsEntryPoint").config };
|
|
116
|
-
return null;
|
|
117
|
-
}, [newConfig]);
|
|
118
|
-
if (!widgetConfig) return null;
|
|
119
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchResults, { widgetConfig });
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
exports.SearchResultsWidget = SearchResultsWidget;
|
|
3
|
+
exports.SearchResultsWidget = require_SearchResultsWidget.SearchResultsWidget;
|
|
@@ -1,121 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useSetAtom } from "jotai";
|
|
3
|
-
import { isSearchResultsOpenAtom } from "@envive-ai/react-hooks/atoms/globalSearch";
|
|
4
|
-
import { searchSystemAtom } from "@envive-ai/react-hooks/atoms/search";
|
|
5
|
-
import { useNewOrgConfig } from "@envive-ai/react-hooks/hooks/NewOrgConfig";
|
|
6
|
-
import classNames from "classnames";
|
|
7
|
-
import { SearchResultsContent } from "@envive-ai/react-toolkit/SearchResultsContent";
|
|
8
|
-
import { SearchResultsFilterModal } from "@envive-ai/react-toolkit/SearchResultsFilterModal";
|
|
9
|
-
import { SearchResultsToolbar } from "@envive-ai/react-toolkit/SearchResultsToolbar";
|
|
10
|
-
import { useStickyVisibility } from "@envive-ai/react-toolkit/util";
|
|
11
|
-
import { useSearch } from "@envive-ai/react-hooks/hooks/Search";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { SearchResultsWidget } from "./SearchResultsWidget.js";
|
|
13
2
|
|
|
14
|
-
//#region src/SearchResults/withSearchResults.tsx
|
|
15
|
-
function withSearchResults(Component) {
|
|
16
|
-
return function SearchResultsHoc(props) {
|
|
17
|
-
const searchHookResult = useSearch();
|
|
18
|
-
return /* @__PURE__ */ jsx(Component, {
|
|
19
|
-
...props,
|
|
20
|
-
...searchHookResult,
|
|
21
|
-
productList: searchHookResult.searchData?.products || []
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/SearchResults/SearchResults.tsx
|
|
28
|
-
const SearchResultsComponent = ({ widgetConfig, productCardConfig, merchantShortName, productList, autocompleteResults, searchFilters, availableDynamicFilters, selectedFilterOptions, searchText, query, searchResultsState, isFilterOpen, shouldShowAutocomplete, focusedIndex, focusedOptionId, recommendedProducts, filterButtonText, onSearchInputChange, onSubmitSearch, onAutocompleteSelect, onKeyDown, onSearchInputFocus, onSearchInputBlur, onToggleDynamicFilter, onSelectFilterItem, onRemoveFilter, onClearAllFilters, setIsFilterOpen, searchResultsRef }) => {
|
|
29
|
-
const { searchInputVariant, searchFilterSidebarVariant, productGridVariant, searchBoxPlaceholder, noResultsFoundText, isSearchInputSticky = false } = widgetConfig;
|
|
30
|
-
const { toolbarRef: ref, isVisible, toolbarHeight: height } = useStickyVisibility();
|
|
31
|
-
const toolbarRef = isSearchInputSticky ? ref : null;
|
|
32
|
-
const finalIsVisible = isSearchInputSticky ? isVisible : true;
|
|
33
|
-
const toolbarHeight = isSearchInputSticky ? height : 0;
|
|
34
|
-
const stickyToolbarClasses = classNames("spiffy-tw-fixed", "spiffy-tw-top-0", "spiffy-tw-left-0", "spiffy-tw-right-0", "spiffy-tw-transition-transform", "spiffy-tw-duration-300", "spiffy-tw-py-[8px]");
|
|
35
|
-
const containerXPaddingClasses = classNames("spiffy-tw-px-[16px]", "sm:spiffy-tw-px-[46px]");
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
window.scrollTo({
|
|
38
|
-
top: 0,
|
|
39
|
-
behavior: "smooth"
|
|
40
|
-
});
|
|
41
|
-
}, [productList]);
|
|
42
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
43
|
-
/* @__PURE__ */ jsx(SearchResultsFilterModal, {
|
|
44
|
-
isOpen: isFilterOpen,
|
|
45
|
-
setIsOpen: setIsFilterOpen,
|
|
46
|
-
searchFilters,
|
|
47
|
-
productCount: productList.length,
|
|
48
|
-
onSelectFilterItem,
|
|
49
|
-
onClearAllFilters,
|
|
50
|
-
searchFilterSidebarVariant,
|
|
51
|
-
filterButtonText
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ jsx(SearchResultsToolbar, {
|
|
54
|
-
className: isSearchInputSticky ? stickyToolbarClasses : "spiffy-tw-py-[8px]",
|
|
55
|
-
toolbarRef,
|
|
56
|
-
searchInputVariant,
|
|
57
|
-
searchBoxPlaceholder,
|
|
58
|
-
searchText,
|
|
59
|
-
focusedIndex,
|
|
60
|
-
focusedOptionId,
|
|
61
|
-
autocompleteResults,
|
|
62
|
-
filterButtonText,
|
|
63
|
-
onKeyDown,
|
|
64
|
-
onSearchInputChange,
|
|
65
|
-
onSubmitSearch,
|
|
66
|
-
onAutocompleteSelect,
|
|
67
|
-
onSearchInputFocus,
|
|
68
|
-
onSearchInputBlur,
|
|
69
|
-
shouldShowAutocomplete,
|
|
70
|
-
setIsFilterOpen,
|
|
71
|
-
containerXPaddingClasses,
|
|
72
|
-
isVisible: finalIsVisible
|
|
73
|
-
}),
|
|
74
|
-
/* @__PURE__ */ jsx(SearchResultsContent, {
|
|
75
|
-
searchResultsState,
|
|
76
|
-
productList,
|
|
77
|
-
recommendedProducts,
|
|
78
|
-
productCardConfig,
|
|
79
|
-
merchantShortName,
|
|
80
|
-
searchFilterSidebarVariant,
|
|
81
|
-
noResultsFoundText,
|
|
82
|
-
productGridVariant,
|
|
83
|
-
containerXPaddingClasses,
|
|
84
|
-
selectedFilterOptions,
|
|
85
|
-
availableDynamicFilters,
|
|
86
|
-
onRemoveFilter,
|
|
87
|
-
onToggleDynamicFilter,
|
|
88
|
-
searchResultsRef,
|
|
89
|
-
toolbarHeight,
|
|
90
|
-
query
|
|
91
|
-
})
|
|
92
|
-
] });
|
|
93
|
-
};
|
|
94
|
-
const SearchResults = withSearchResults(SearchResultsComponent);
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/SearchResults/SearchResultsWidget.tsx
|
|
98
|
-
const SearchResultsWidget = () => {
|
|
99
|
-
const setIsSearchResultsOpen = useSetAtom(isSearchResultsOpenAtom);
|
|
100
|
-
const setSearchSystem = useSetAtom(searchSystemAtom);
|
|
101
|
-
const newConfig = useNewOrgConfig();
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
setSearchSystem(true);
|
|
104
|
-
return () => setSearchSystem(false);
|
|
105
|
-
}, [setSearchSystem]);
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
setIsSearchResultsOpen(true);
|
|
108
|
-
return () => {
|
|
109
|
-
setIsSearchResultsOpen(false);
|
|
110
|
-
};
|
|
111
|
-
}, [setIsSearchResultsOpen]);
|
|
112
|
-
const widgetConfig = useMemo(() => {
|
|
113
|
-
if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === "searchResultsEntryPoint").config };
|
|
114
|
-
return null;
|
|
115
|
-
}, [newConfig]);
|
|
116
|
-
if (!widgetConfig) return null;
|
|
117
|
-
return /* @__PURE__ */ jsx(SearchResults, { widgetConfig });
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
3
|
export { SearchResultsWidget };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
|
|
4
|
+
|
|
5
|
+
//#region src/SearchResults/withSearchResults.tsx
|
|
6
|
+
function withSearchResults(Component) {
|
|
7
|
+
return function SearchResultsHoc(props) {
|
|
8
|
+
const searchHookResult = (0, __envive_ai_react_hooks_hooks_Search.useSearch)();
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
10
|
+
...props,
|
|
11
|
+
...searchHookResult,
|
|
12
|
+
productList: searchHookResult.searchData?.products || []
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.withSearchResults = withSearchResults;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSearch } from "@envive-ai/react-hooks/hooks/Search";
|
|
3
|
+
|
|
4
|
+
//#region src/SearchResults/withSearchResults.tsx
|
|
5
|
+
function withSearchResults(Component) {
|
|
6
|
+
return function SearchResultsHoc(props) {
|
|
7
|
+
const searchHookResult = useSearch();
|
|
8
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
9
|
+
...props,
|
|
10
|
+
...searchHookResult,
|
|
11
|
+
productList: searchHookResult.searchData?.products || []
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { withSearchResults };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Typography = require('../packages/components/dist/components/Typography/Typography.cjs');
|
|
3
|
+
require('../packages/components/dist/components/Typography/index.cjs');
|
|
4
|
+
const require_AiSearchBold = require('../packages/icons/dist/AiSearchBold.cjs');
|
|
5
|
+
const require_AiSearchThin = require('../packages/icons/dist/AiSearchThin.cjs');
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
let classnames = require("classnames");
|
|
9
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
//#region src/SearchZeroState/SearchIcon.tsx
|
|
13
|
+
const SEARCH_ENTRYPOINT_BUTTON_TESTID = "spiffy-search-entrypoint-button";
|
|
14
|
+
const SearchIcon = ({ size = 22, variant = "thin", color = "currentColor", onClick, label, entryPointRef }) => {
|
|
15
|
+
const containerClasses = (0, classnames.default)([
|
|
16
|
+
"spiffy-global-search-input-container",
|
|
17
|
+
"spiffy-tw-relative",
|
|
18
|
+
"spiffy-tw-flex",
|
|
19
|
+
"spiffy-tw-items-center"
|
|
20
|
+
]);
|
|
21
|
+
const iconStrokeWidth = variant === "thin" ? "inherit" : "2px";
|
|
22
|
+
const IconComponent = {
|
|
23
|
+
thin: require_AiSearchThin.AiSearchThin_default,
|
|
24
|
+
bold: require_AiSearchBold.AiSearchBold_default
|
|
25
|
+
}[variant];
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
27
|
+
className: containerClasses,
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick,
|
|
30
|
+
"data-testid": SEARCH_ENTRYPOINT_BUTTON_TESTID,
|
|
31
|
+
ref: entryPointRef,
|
|
32
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconComponent, {
|
|
33
|
+
style: {
|
|
34
|
+
width: size,
|
|
35
|
+
height: size
|
|
36
|
+
},
|
|
37
|
+
fill: color,
|
|
38
|
+
strokeWidth: iconStrokeWidth
|
|
39
|
+
}), label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
|
|
40
|
+
variant: "body3",
|
|
41
|
+
className: "spiffy-global-search-text",
|
|
42
|
+
children: label
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.SearchIcon = SearchIcon;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Typography } from "../packages/components/dist/components/Typography/Typography.js";
|
|
2
|
+
import "../packages/components/dist/components/Typography/index.js";
|
|
3
|
+
import { AiSearchBold_default } from "../packages/icons/dist/AiSearchBold.js";
|
|
4
|
+
import { AiSearchThin_default } from "../packages/icons/dist/AiSearchThin.js";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/SearchZeroState/SearchIcon.tsx
|
|
10
|
+
const SEARCH_ENTRYPOINT_BUTTON_TESTID = "spiffy-search-entrypoint-button";
|
|
11
|
+
const SearchIcon = ({ size = 22, variant = "thin", color = "currentColor", onClick, label, entryPointRef }) => {
|
|
12
|
+
const containerClasses = classNames([
|
|
13
|
+
"spiffy-global-search-input-container",
|
|
14
|
+
"spiffy-tw-relative",
|
|
15
|
+
"spiffy-tw-flex",
|
|
16
|
+
"spiffy-tw-items-center"
|
|
17
|
+
]);
|
|
18
|
+
const iconStrokeWidth = variant === "thin" ? "inherit" : "2px";
|
|
19
|
+
const IconComponent = {
|
|
20
|
+
thin: AiSearchThin_default,
|
|
21
|
+
bold: AiSearchBold_default
|
|
22
|
+
}[variant];
|
|
23
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
24
|
+
className: containerClasses,
|
|
25
|
+
type: "button",
|
|
26
|
+
onClick,
|
|
27
|
+
"data-testid": SEARCH_ENTRYPOINT_BUTTON_TESTID,
|
|
28
|
+
ref: entryPointRef,
|
|
29
|
+
children: [/* @__PURE__ */ jsx(IconComponent, {
|
|
30
|
+
style: {
|
|
31
|
+
width: size,
|
|
32
|
+
height: size
|
|
33
|
+
},
|
|
34
|
+
fill: color,
|
|
35
|
+
strokeWidth: iconStrokeWidth
|
|
36
|
+
}), label && /* @__PURE__ */ jsx(Typography, {
|
|
37
|
+
variant: "body3",
|
|
38
|
+
className: "spiffy-global-search-text",
|
|
39
|
+
children: label
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { SearchIcon };
|