@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,13 @@
|
|
|
1
|
+
import { __commonJS } from "../../_virtual/rolldown_runtime.js";
|
|
2
|
+
import { require_react_jsx_runtime_production_min } from "./cjs/react-jsx-runtime.production.min.js";
|
|
3
|
+
import { require_react_jsx_runtime_development } from "./cjs/react-jsx-runtime.development.js";
|
|
4
|
+
|
|
5
|
+
//#region ../icons/dist/node_modules/react/jsx-runtime.js
|
|
6
|
+
var require_jsx_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/react/jsx-runtime.js": ((exports, module) => {
|
|
7
|
+
if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_runtime_production_min();
|
|
8
|
+
else module.exports = require_react_jsx_runtime_development();
|
|
9
|
+
}) });
|
|
10
|
+
var jsx_runtime_default = require_jsx_runtime();
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { require_jsx_runtime };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_useReducedMotionWithOverride = require('./useReducedMotionWithOverride.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
|
|
5
|
+
//#region src/util/useHorizontalScrollAnimation.ts
|
|
6
|
+
function useHorizontalScrollAnimation({ scrollContainerRef, animationSpeed = "standard" }) {
|
|
7
|
+
const reducedMotion = require_useReducedMotionWithOverride.useReducedMotionWithOverride();
|
|
8
|
+
const resumeTimeoutRef = (0, react.useRef)(null);
|
|
9
|
+
const scrollAnimationRef = (0, react.useRef)(null);
|
|
10
|
+
const pauseOnHover = true;
|
|
11
|
+
let PIXELS_PER_SECOND = 40;
|
|
12
|
+
switch (animationSpeed) {
|
|
13
|
+
case "standard":
|
|
14
|
+
PIXELS_PER_SECOND = 40;
|
|
15
|
+
break;
|
|
16
|
+
case "slow":
|
|
17
|
+
PIXELS_PER_SECOND = 25;
|
|
18
|
+
break;
|
|
19
|
+
case "none":
|
|
20
|
+
PIXELS_PER_SECOND = 0;
|
|
21
|
+
break;
|
|
22
|
+
default: PIXELS_PER_SECOND = 40;
|
|
23
|
+
}
|
|
24
|
+
const RESUME_DELAY_MS = 2e3;
|
|
25
|
+
const isAnimated = animationSpeed !== "none";
|
|
26
|
+
(0, react.useEffect)(() => {
|
|
27
|
+
if (!isAnimated || reducedMotion || !scrollContainerRef) return () => {};
|
|
28
|
+
const container = scrollContainerRef.current;
|
|
29
|
+
if (!container) return () => {};
|
|
30
|
+
if (container.scrollWidth <= container.clientWidth) return () => {};
|
|
31
|
+
let isPaused = false;
|
|
32
|
+
let lastTimestamp = null;
|
|
33
|
+
let accumulatedScroll = 0;
|
|
34
|
+
const step = (timestamp) => {
|
|
35
|
+
if (lastTimestamp === null) lastTimestamp = timestamp;
|
|
36
|
+
if (!isPaused) {
|
|
37
|
+
const delta = timestamp - lastTimestamp;
|
|
38
|
+
lastTimestamp = timestamp;
|
|
39
|
+
accumulatedScroll += PIXELS_PER_SECOND * (delta / 1e3);
|
|
40
|
+
const pixelsToScroll = Math.floor(accumulatedScroll);
|
|
41
|
+
if (pixelsToScroll > 0) {
|
|
42
|
+
container.scrollLeft += pixelsToScroll;
|
|
43
|
+
accumulatedScroll -= pixelsToScroll;
|
|
44
|
+
if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
|
|
45
|
+
container.scrollLeft = 0;
|
|
46
|
+
accumulatedScroll = 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
51
|
+
};
|
|
52
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
53
|
+
const pauseAnimation = () => {
|
|
54
|
+
isPaused = true;
|
|
55
|
+
if (resumeTimeoutRef.current) {
|
|
56
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
57
|
+
resumeTimeoutRef.current = null;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const scheduleResumeAnimation = () => {
|
|
61
|
+
resumeTimeoutRef.current = setTimeout(() => {
|
|
62
|
+
isPaused = false;
|
|
63
|
+
lastTimestamp = null;
|
|
64
|
+
}, RESUME_DELAY_MS);
|
|
65
|
+
};
|
|
66
|
+
container.addEventListener("mouseenter", pauseAnimation);
|
|
67
|
+
container.addEventListener("mouseleave", scheduleResumeAnimation);
|
|
68
|
+
container.addEventListener("touchstart", pauseAnimation);
|
|
69
|
+
container.addEventListener("touchend", scheduleResumeAnimation);
|
|
70
|
+
return function cleanup() {
|
|
71
|
+
if (scrollAnimationRef.current) cancelAnimationFrame(scrollAnimationRef.current);
|
|
72
|
+
container.removeEventListener("mouseenter", pauseAnimation);
|
|
73
|
+
container.removeEventListener("mouseleave", scheduleResumeAnimation);
|
|
74
|
+
container.removeEventListener("touchstart", pauseAnimation);
|
|
75
|
+
container.removeEventListener("touchend", scheduleResumeAnimation);
|
|
76
|
+
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
77
|
+
};
|
|
78
|
+
}, [
|
|
79
|
+
isAnimated,
|
|
80
|
+
reducedMotion,
|
|
81
|
+
PIXELS_PER_SECOND,
|
|
82
|
+
pauseOnHover,
|
|
83
|
+
scrollContainerRef
|
|
84
|
+
]);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.useHorizontalScrollAnimation = useHorizontalScrollAnimation;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useReducedMotionWithOverride } from "./useReducedMotionWithOverride.js";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/util/useHorizontalScrollAnimation.ts
|
|
5
|
+
function useHorizontalScrollAnimation({ scrollContainerRef, animationSpeed = "standard" }) {
|
|
6
|
+
const reducedMotion = useReducedMotionWithOverride();
|
|
7
|
+
const resumeTimeoutRef = useRef(null);
|
|
8
|
+
const scrollAnimationRef = useRef(null);
|
|
9
|
+
const pauseOnHover = true;
|
|
10
|
+
let PIXELS_PER_SECOND = 40;
|
|
11
|
+
switch (animationSpeed) {
|
|
12
|
+
case "standard":
|
|
13
|
+
PIXELS_PER_SECOND = 40;
|
|
14
|
+
break;
|
|
15
|
+
case "slow":
|
|
16
|
+
PIXELS_PER_SECOND = 25;
|
|
17
|
+
break;
|
|
18
|
+
case "none":
|
|
19
|
+
PIXELS_PER_SECOND = 0;
|
|
20
|
+
break;
|
|
21
|
+
default: PIXELS_PER_SECOND = 40;
|
|
22
|
+
}
|
|
23
|
+
const RESUME_DELAY_MS = 2e3;
|
|
24
|
+
const isAnimated = animationSpeed !== "none";
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!isAnimated || reducedMotion || !scrollContainerRef) return () => {};
|
|
27
|
+
const container = scrollContainerRef.current;
|
|
28
|
+
if (!container) return () => {};
|
|
29
|
+
if (container.scrollWidth <= container.clientWidth) return () => {};
|
|
30
|
+
let isPaused = false;
|
|
31
|
+
let lastTimestamp = null;
|
|
32
|
+
let accumulatedScroll = 0;
|
|
33
|
+
const step = (timestamp) => {
|
|
34
|
+
if (lastTimestamp === null) lastTimestamp = timestamp;
|
|
35
|
+
if (!isPaused) {
|
|
36
|
+
const delta = timestamp - lastTimestamp;
|
|
37
|
+
lastTimestamp = timestamp;
|
|
38
|
+
accumulatedScroll += PIXELS_PER_SECOND * (delta / 1e3);
|
|
39
|
+
const pixelsToScroll = Math.floor(accumulatedScroll);
|
|
40
|
+
if (pixelsToScroll > 0) {
|
|
41
|
+
container.scrollLeft += pixelsToScroll;
|
|
42
|
+
accumulatedScroll -= pixelsToScroll;
|
|
43
|
+
if (Math.ceil(container.scrollLeft) >= container.scrollWidth - container.clientWidth) {
|
|
44
|
+
container.scrollLeft = 0;
|
|
45
|
+
accumulatedScroll = 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
50
|
+
};
|
|
51
|
+
scrollAnimationRef.current = requestAnimationFrame(step);
|
|
52
|
+
const pauseAnimation = () => {
|
|
53
|
+
isPaused = true;
|
|
54
|
+
if (resumeTimeoutRef.current) {
|
|
55
|
+
clearTimeout(resumeTimeoutRef.current);
|
|
56
|
+
resumeTimeoutRef.current = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const scheduleResumeAnimation = () => {
|
|
60
|
+
resumeTimeoutRef.current = setTimeout(() => {
|
|
61
|
+
isPaused = false;
|
|
62
|
+
lastTimestamp = null;
|
|
63
|
+
}, RESUME_DELAY_MS);
|
|
64
|
+
};
|
|
65
|
+
container.addEventListener("mouseenter", pauseAnimation);
|
|
66
|
+
container.addEventListener("mouseleave", scheduleResumeAnimation);
|
|
67
|
+
container.addEventListener("touchstart", pauseAnimation);
|
|
68
|
+
container.addEventListener("touchend", scheduleResumeAnimation);
|
|
69
|
+
return function cleanup() {
|
|
70
|
+
if (scrollAnimationRef.current) cancelAnimationFrame(scrollAnimationRef.current);
|
|
71
|
+
container.removeEventListener("mouseenter", pauseAnimation);
|
|
72
|
+
container.removeEventListener("mouseleave", scheduleResumeAnimation);
|
|
73
|
+
container.removeEventListener("touchstart", pauseAnimation);
|
|
74
|
+
container.removeEventListener("touchend", scheduleResumeAnimation);
|
|
75
|
+
if (resumeTimeoutRef.current) clearTimeout(resumeTimeoutRef.current);
|
|
76
|
+
};
|
|
77
|
+
}, [
|
|
78
|
+
isAnimated,
|
|
79
|
+
reducedMotion,
|
|
80
|
+
PIXELS_PER_SECOND,
|
|
81
|
+
pauseOnHover,
|
|
82
|
+
scrollContainerRef
|
|
83
|
+
]);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { useHorizontalScrollAnimation };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
let framer_motion = require("framer-motion");
|
|
4
|
+
|
|
5
|
+
//#region src/util/useReducedMotionWithOverride.ts
|
|
6
|
+
const useReducedMotionWithOverride = () => {
|
|
7
|
+
const reducedMotionConfig = (0, framer_motion.useReducedMotionConfig)();
|
|
8
|
+
return (0, react.useMemo)(() => {
|
|
9
|
+
if (window?._spiffy?.reducedMotionOverride) return window?._spiffy?.reducedMotionOverride;
|
|
10
|
+
return reducedMotionConfig;
|
|
11
|
+
}, [reducedMotionConfig]);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.useReducedMotionWithOverride = useReducedMotionWithOverride;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useReducedMotionConfig } from "framer-motion";
|
|
3
|
+
|
|
4
|
+
//#region src/util/useReducedMotionWithOverride.ts
|
|
5
|
+
const useReducedMotionWithOverride = () => {
|
|
6
|
+
const reducedMotionConfig = useReducedMotionConfig();
|
|
7
|
+
return useMemo(() => {
|
|
8
|
+
if (window?._spiffy?.reducedMotionOverride) return window?._spiffy?.reducedMotionOverride;
|
|
9
|
+
return reducedMotionConfig;
|
|
10
|
+
}, [reducedMotionConfig]);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useReducedMotionWithOverride };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envive-ai/react-widgets",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "React widget library for Envive services.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -23,17 +23,15 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsdown",
|
|
25
25
|
"build:watch": "tsdown --watch",
|
|
26
|
+
"dev": "npm run get-merchants && storybook dev -p 6006",
|
|
26
27
|
"prepublish": "npm run build",
|
|
28
|
+
"storybook": "tsx ./.storybook/getMerchants.ts && storybook dev -p 6006",
|
|
29
|
+
"storybook:build": "npm run get-merchants && storybook build",
|
|
30
|
+
"storybook:get-merchants": "tsx ./.storybook/getMerchants.ts",
|
|
27
31
|
"typecheck": "tsc",
|
|
28
|
-
"test": "vitest"
|
|
29
|
-
"storybook": "npm run get-merchants && storybook dev -p 6006",
|
|
30
|
-
"build-storybook": "npm run get-merchants && storybook build",
|
|
31
|
-
"dev": "npm run get-merchants && storybook dev -p 6006",
|
|
32
|
-
"get-merchants": "tsx ./.storybook/getMerchants.ts"
|
|
32
|
+
"test": "vitest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@envive-ai/react-hooks": "0.2.8-arthur-2",
|
|
36
|
-
"@envive-ai/react-toolkit": "0.2.13-arthur-1",
|
|
37
35
|
"@tailwindcss/typography": "^0.5.15",
|
|
38
36
|
"classnames": "^2.5.1",
|
|
39
37
|
"framer-motion": "^12.23.24",
|
|
@@ -55,7 +53,12 @@
|
|
|
55
53
|
"@storybook/react-vite": "^9.1.4",
|
|
56
54
|
"@types/node": "^24.3.2",
|
|
57
55
|
"@types/react": "^19.1.12",
|
|
56
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
57
|
+
"@vitest/browser": "^3.2.4",
|
|
58
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
59
|
+
"autoprefixer": "^10.4.21",
|
|
58
60
|
"eslint-plugin-storybook": "^9.1.4",
|
|
61
|
+
"playwright": "^1.56.0",
|
|
59
62
|
"postcss": "^8.5.6",
|
|
60
63
|
"storybook": "^9.1.4",
|
|
61
64
|
"tailwindcss": "^3.4.17",
|
|
@@ -64,6 +67,9 @@
|
|
|
64
67
|
"vite-tsconfig-paths": "^5.1.4",
|
|
65
68
|
"vitest": "^3.2.4"
|
|
66
69
|
},
|
|
70
|
+
"optionalDependencies": {
|
|
71
|
+
"@rollup/rollup-linux-x64-gnu": "*"
|
|
72
|
+
},
|
|
67
73
|
"exports": {
|
|
68
74
|
"./SearchResults": {
|
|
69
75
|
"import": "./dist/SearchResults/index.js",
|
|
@@ -3,13 +3,11 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { SearchResultsContent } from '@envive-ai/react-toolkit/SearchResultsContent';
|
|
4
4
|
import { SearchResultsFilterModal } from '@envive-ai/react-toolkit/SearchResultsFilterModal';
|
|
5
5
|
import { SearchResultsToolbar } from '@envive-ai/react-toolkit/SearchResultsToolbar';
|
|
6
|
-
import { useStickyVisibility } from '@envive-ai/react-toolkit/util'
|
|
6
|
+
import { useStickyVisibility } from '@envive-ai/react-toolkit/util';
|
|
7
7
|
import { SearchResultsHocProps } from '@envive-ai/react-hooks/hooks/Search';
|
|
8
8
|
import { SearchResultsEntryPointWidgetConfig } from './types';
|
|
9
9
|
import { withSearchResults } from './withSearchResults';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
11
|
export interface SearchResultsProps extends SearchResultsHocProps {
|
|
14
12
|
widgetConfig: SearchResultsEntryPointWidgetConfig;
|
|
15
13
|
}
|
|
@@ -141,4 +139,4 @@ export const SearchResultsComponent = ({
|
|
|
141
139
|
);
|
|
142
140
|
};
|
|
143
141
|
|
|
144
|
-
export const SearchResults = withSearchResults(SearchResultsComponent);
|
|
142
|
+
export const SearchResults = withSearchResults(SearchResultsComponent);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SearchIconVariant } from
|
|
2
|
-
import AiSearchBold from
|
|
3
|
-
import AiSearchThin from
|
|
4
|
-
import { Typography } from
|
|
5
|
-
import classNames from
|
|
6
|
-
import React from
|
|
1
|
+
import { SearchIconVariant } from '@envive-ai/react-hooks/contexts/types';
|
|
2
|
+
import AiSearchBold from '@envive-ai/react-icons/AiSearchBold';
|
|
3
|
+
import AiSearchThin from '@envive-ai/react-icons/AiSearchThin';
|
|
4
|
+
import { Typography } from '@envive-ai/react-toolkit/Typography';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import React from 'react';
|
|
7
7
|
|
|
8
|
-
const SEARCH_ENTRYPOINT_BUTTON_TESTID =
|
|
8
|
+
const SEARCH_ENTRYPOINT_BUTTON_TESTID = 'spiffy-search-entrypoint-button';
|
|
9
9
|
|
|
10
10
|
interface SearchIconProps {
|
|
11
11
|
size?: number; // in px
|
|
@@ -46,9 +46,16 @@ export const SearchIcon: React.FC<SearchIconProps> = ({
|
|
|
46
46
|
data-testid={SEARCH_ENTRYPOINT_BUTTON_TESTID}
|
|
47
47
|
ref={entryPointRef}
|
|
48
48
|
>
|
|
49
|
-
<IconComponent
|
|
49
|
+
<IconComponent
|
|
50
|
+
style={{ width: size, height: size }}
|
|
51
|
+
fill={color}
|
|
52
|
+
strokeWidth={iconStrokeWidth}
|
|
53
|
+
/>
|
|
50
54
|
{label && (
|
|
51
|
-
<Typography
|
|
55
|
+
<Typography
|
|
56
|
+
variant="body3"
|
|
57
|
+
className="spiffy-global-search-text"
|
|
58
|
+
>
|
|
52
59
|
{label}
|
|
53
60
|
</Typography>
|
|
54
61
|
)}
|
|
@@ -65,10 +65,10 @@ export const SearchOverlay = React.forwardRef<HTMLDivElement, SearchOverlayProps
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// If we are usingPortal, we need to create a portal widget in the orgConfig
|
|
68
|
-
// so that we can properly identify the portal target. This is often used to
|
|
68
|
+
// so that we can properly identify the portal target. This is often used to
|
|
69
69
|
// get around z-index context hell because it will move the overlay wherever
|
|
70
70
|
// you need to insert it. In most cases, appending it as a child of body is
|
|
71
|
-
// sufficient. Typically this is not needed, but look into how it's done in
|
|
71
|
+
// sufficient. Typically this is not needed, but look into how it's done in
|
|
72
72
|
// Bandolier for more info.
|
|
73
73
|
try {
|
|
74
74
|
const target = getOverlayPortalTarget();
|
|
@@ -79,3 +79,4 @@ export const SearchOverlay = React.forwardRef<HTMLDivElement, SearchOverlayProps
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
);
|
|
82
|
+
SearchOverlay.displayName = 'SearchOverlay';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
3
|
import { useAmplitudeTracking } from '@envive-ai/react-hooks/hooks/AmplitudeOperations';
|
|
4
4
|
import { useSearch } from '@envive-ai/react-hooks/hooks/Search';
|
|
@@ -20,7 +20,6 @@ import { searchZeroStateVariantClasses } from './zeroStateSearchVariants';
|
|
|
20
20
|
import { SearchIcon } from './SearchIcon';
|
|
21
21
|
import { RecommendedProducts } from './components/RecommendedProducts';
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
const SEARCH_ENTRYPOINT_INPUT_TESTID = 'spiffy-search-entrypoint-input';
|
|
25
24
|
|
|
26
25
|
export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
@@ -28,7 +27,6 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
28
27
|
initialIsOpen,
|
|
29
28
|
entryPointRef,
|
|
30
29
|
}) => {
|
|
31
|
-
|
|
32
30
|
// eslint-disable-next-line no-console
|
|
33
31
|
console.log('SearchZeroState: widgetConfig', widgetConfig);
|
|
34
32
|
const {
|
|
@@ -56,7 +54,7 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
56
54
|
const searchInput = useSearch({ allowRedirect: true });
|
|
57
55
|
|
|
58
56
|
const { track } = useAmplitudeTracking();
|
|
59
|
-
|
|
57
|
+
|
|
60
58
|
const {
|
|
61
59
|
recommendedProductsHeading,
|
|
62
60
|
searchOverlayHeading,
|
|
@@ -86,8 +84,7 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
86
84
|
const { overlayBackgroundClasses, sparklesIconColor } =
|
|
87
85
|
searchZeroStateVariantClasses[validVariant];
|
|
88
86
|
|
|
89
|
-
const { searchInputIconColor } =
|
|
90
|
-
searchInputVariantClasses[searchInputVariant];
|
|
87
|
+
const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
|
|
91
88
|
|
|
92
89
|
const handleOpen = () => setIsOpen(true);
|
|
93
90
|
const handleClose = () => setIsOpen(false);
|
|
@@ -105,7 +102,6 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
105
102
|
|
|
106
103
|
useEffect(() => {
|
|
107
104
|
if (isOpen) {
|
|
108
|
-
|
|
109
105
|
resetSearch(); // Reset search state when opening
|
|
110
106
|
searchInputRef.current?.focus();
|
|
111
107
|
}
|
|
@@ -166,29 +162,30 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
166
162
|
<>
|
|
167
163
|
<div className="spiffy-tw-relative spiffy-tw-mb-4">
|
|
168
164
|
<div className="spiffy-tw-flex spiffy-tw-items-center">
|
|
169
|
-
<Typography
|
|
165
|
+
<Typography
|
|
166
|
+
id="global-search-title"
|
|
167
|
+
variant="t3"
|
|
168
|
+
>
|
|
170
169
|
{searchOverlayHeading}
|
|
171
170
|
</Typography>
|
|
172
171
|
<Sparkles
|
|
173
|
-
className="
|
|
172
|
+
className="spiffy-tw-ml-2 spiffy-tw-h-[36px] spiffy-tw-w-[24px] sm:spiffy-tw-h-[45px] sm:spiffy-tw-w-[36px]"
|
|
174
173
|
color={sparklesIconColor}
|
|
175
174
|
stroke="2px"
|
|
176
175
|
/>
|
|
177
176
|
</div>
|
|
178
|
-
{
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
182
|
-
}
|
|
177
|
+
{includeSubtitle && (
|
|
178
|
+
<Typography variant="body2">Go ahead, get as specific as you like...</Typography>
|
|
179
|
+
)}
|
|
183
180
|
</div>
|
|
184
181
|
<button
|
|
185
182
|
onClick={handleClose}
|
|
186
|
-
className="spiffy-tw-absolute spiffy-tw-
|
|
183
|
+
className="spiffy-tw-absolute spiffy-tw-right-4 spiffy-tw-top-4 sm:spiffy-tw-right-8 sm:spiffy-tw-top-8"
|
|
187
184
|
aria-label="Close search"
|
|
188
185
|
type="button"
|
|
189
186
|
>
|
|
190
187
|
<IconCloseVariant
|
|
191
|
-
className="spiffy-tw-
|
|
188
|
+
className="spiffy-tw-h-[20px] spiffy-tw-w-[20px] sm:spiffy-tw-h-[28px] sm:spiffy-tw-w-[28px]"
|
|
192
189
|
strokeWidth="2px"
|
|
193
190
|
/>
|
|
194
191
|
</button>
|
|
@@ -205,7 +202,7 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
205
202
|
onKeyDown={onKeyDown}
|
|
206
203
|
onAutocompleteSelect={onAutocompleteSelect}
|
|
207
204
|
onSearchInputChange={searchChange}
|
|
208
|
-
onSearchSubmit={submitSearchString}
|
|
205
|
+
onSearchSubmit={() => submitSearchString}
|
|
209
206
|
onSearchInputFocus={onSearchInputFocus}
|
|
210
207
|
onSearchInputBlur={onSearchInputBlur}
|
|
211
208
|
/>
|
|
@@ -213,7 +210,7 @@ export const SearchZeroState: React.FC<SearchZeroStateProps> = ({
|
|
|
213
210
|
{initialSuggestions &&
|
|
214
211
|
initialSuggestions.length > 0 && ( // Conditionally render suggestions
|
|
215
212
|
<motion.div
|
|
216
|
-
className="spiffy-tw-
|
|
213
|
+
className="spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden"
|
|
217
214
|
initial={{ opacity: 0 }}
|
|
218
215
|
animate={{ opacity: 1 }}
|
|
219
216
|
exit={{ opacity: 0 }}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { SearchEntryPointWidgetConfig } from
|
|
2
|
-
import { useNewOrgConfig } from
|
|
3
|
-
import { useMemo } from
|
|
4
|
-
import { SearchZeroState } from
|
|
5
|
-
|
|
1
|
+
import { SearchEntryPointWidgetConfig } from '@envive-ai/react-hooks/contexts/types';
|
|
2
|
+
import { useNewOrgConfig } from '@envive-ai/react-hooks/hooks/NewOrgConfig';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { SearchZeroState } from './SearchZeroState';
|
|
6
5
|
|
|
7
6
|
type SearchZeroStateWidgetProps = {
|
|
8
7
|
initialIsOpen: boolean;
|
|
9
8
|
widgetConfigId?: string;
|
|
10
9
|
entryPointRef: React.Ref<HTMLButtonElement>;
|
|
11
|
-
}
|
|
10
|
+
};
|
|
12
11
|
|
|
13
|
-
export const SearchZeroStateWidget = ({
|
|
12
|
+
export const SearchZeroStateWidget = ({
|
|
13
|
+
initialIsOpen,
|
|
14
|
+
widgetConfigId = 'searchEntryPointIcon',
|
|
15
|
+
entryPointRef,
|
|
16
|
+
}: SearchZeroStateWidgetProps) => {
|
|
14
17
|
const newConfig = useNewOrgConfig();
|
|
15
18
|
|
|
16
19
|
const widgetConfig = useMemo(() => {
|
|
@@ -29,5 +32,11 @@ export const SearchZeroStateWidget = ({ initialIsOpen, widgetConfigId = 'searchE
|
|
|
29
32
|
return null;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
<SearchZeroState
|
|
37
|
+
widgetConfig={widgetConfig as SearchEntryPointWidgetConfig}
|
|
38
|
+
initialIsOpen={initialIsOpen}
|
|
39
|
+
entryPointRef={entryPointRef}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
33
42
|
};
|
|
@@ -6,7 +6,10 @@ import { useAmplitudeTracking } from '@envive-ai/react-hooks/hooks/AmplitudeOper
|
|
|
6
6
|
import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
|
|
7
7
|
import { Typography } from '@envive-ai/react-toolkit/Typography';
|
|
8
8
|
import { ProductCardConfig, ProductGridVariant } from '@envive-ai/react-hooks/contexts/types';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ChatElementDisplayLocation,
|
|
11
|
+
SearchResponseProductAttributes,
|
|
12
|
+
} from '@envive-ai/react-hooks/application/models';
|
|
10
13
|
import { SpiffyMetricsEventName } from '@envive-ai/react-hooks/contexts/amplitudeContext';
|
|
11
14
|
|
|
12
15
|
interface RecommendedProductsProps {
|
|
@@ -64,7 +67,6 @@ export const RecommendedProducts: React.FC<RecommendedProductsProps> = ({
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
const handleProductClick = (product: SearchResponseProduct, index: number) => {
|
|
67
|
-
|
|
68
70
|
track(SpiffyMetricsEventName.ProductCardClicked, {
|
|
69
71
|
eventProps: {
|
|
70
72
|
url: product.url,
|
|
@@ -100,7 +102,10 @@ export const RecommendedProducts: React.FC<RecommendedProductsProps> = ({
|
|
|
100
102
|
>
|
|
101
103
|
{heading && (
|
|
102
104
|
<div className={titleContainerClasses}>
|
|
103
|
-
<Typography
|
|
105
|
+
<Typography
|
|
106
|
+
variant="h1"
|
|
107
|
+
className="spiffy-tw-text-[--spiffy-colors-text-accent]"
|
|
108
|
+
>
|
|
104
109
|
{heading}
|
|
105
110
|
</Typography>
|
|
106
111
|
</div>
|
|
@@ -4,9 +4,7 @@ export const SEARCH_OVERLAY_PORTAL_ID = 'spiffy-ai-search-overlay-portal'; // Th
|
|
|
4
4
|
/**
|
|
5
5
|
* Find the portal target inside the overlay host's ShadowRoot.
|
|
6
6
|
*/
|
|
7
|
-
export function getOverlayPortalTarget(
|
|
8
|
-
hostId: string = SEARCH_OVERLAY_ENTRYPOINT_ID,
|
|
9
|
-
): HTMLElement {
|
|
7
|
+
export function getOverlayPortalTarget(hostId: string = SEARCH_OVERLAY_ENTRYPOINT_ID): HTMLElement {
|
|
10
8
|
const bareMount = document.getElementById(SEARCH_OVERLAY_PORTAL_ID) as HTMLElement | null;
|
|
11
9
|
if (bareMount) return bareMount;
|
|
12
10
|
const host = document.getElementById(hostId);
|
|
@@ -16,4 +14,4 @@ export function getOverlayPortalTarget(
|
|
|
16
14
|
const mount = sr.getElementById(SEARCH_OVERLAY_PORTAL_ID) as HTMLElement | null;
|
|
17
15
|
if (!mount) throw new Error('[Overlay] Portal mount missing inside ShadowRoot');
|
|
18
16
|
return mount;
|
|
19
|
-
}
|
|
17
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
SearchEntryPointWidgetConfig,
|
|
3
|
+
SearchInputVariant,
|
|
4
|
+
} from '@envive-ai/react-hooks/contexts/types';
|
|
2
5
|
|
|
3
6
|
export type { SearchInputVariant, SearchEntryPointWidgetConfig };
|
|
4
7
|
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ColorNames,
|
|
3
|
+
SearchZeroStateVariant,
|
|
4
|
+
colorVar,
|
|
5
|
+
} from '@envive-ai/react-hooks/contexts/types';
|
|
2
6
|
|
|
3
7
|
interface SearchZeroStateVariantClasses {
|
|
4
8
|
overlayBackgroundClasses: string;
|
|
5
9
|
sparklesIconColor: string;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
|
-
export const searchZeroStateVariantClasses: Record<
|
|
9
|
-
|
|
12
|
+
export const searchZeroStateVariantClasses: Record<
|
|
13
|
+
SearchZeroStateVariant,
|
|
14
|
+
SearchZeroStateVariantClasses
|
|
15
|
+
> = {
|
|
16
|
+
backgroundTertiary: {
|
|
17
|
+
// standard light mode
|
|
10
18
|
overlayBackgroundClasses:
|
|
11
19
|
'spiffy-tw-bg-[--spiffy-colors-background-tertiary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20',
|
|
12
20
|
sparklesIconColor: colorVar(ColorNames.AccentPrimary),
|
|
13
21
|
},
|
|
14
|
-
backgroundDark: {
|
|
22
|
+
backgroundDark: {
|
|
23
|
+
// standard dark mode
|
|
15
24
|
overlayBackgroundClasses:
|
|
16
25
|
'spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20',
|
|
17
26
|
sparklesIconColor: colorVar(ColorNames.AccentPrimary),
|
|
@@ -19,6 +28,6 @@ export const searchZeroStateVariantClasses: Record<SearchZeroStateVariant, Searc
|
|
|
19
28
|
backgroundPrimary: {
|
|
20
29
|
overlayBackgroundClasses:
|
|
21
30
|
'spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20',
|
|
22
|
-
sparklesIconColor: colorVar(ColorNames.AccentPrimary)
|
|
31
|
+
sparklesIconColor: colorVar(ColorNames.AccentPrimary),
|
|
23
32
|
},
|
|
24
33
|
};
|