@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,21 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/SearchZeroState/overlay/overlayHostLocator.ts
|
|
3
|
+
const SEARCH_OVERLAY_ENTRYPOINT_ID = "spiffy-ai-search-overlay-entrypoint";
|
|
4
|
+
const SEARCH_OVERLAY_PORTAL_ID = "spiffy-ai-search-overlay-portal";
|
|
5
|
+
/**
|
|
6
|
+
* Find the portal target inside the overlay host's ShadowRoot.
|
|
7
|
+
*/
|
|
8
|
+
function getOverlayPortalTarget(hostId = SEARCH_OVERLAY_ENTRYPOINT_ID) {
|
|
9
|
+
const bareMount = document.getElementById(SEARCH_OVERLAY_PORTAL_ID);
|
|
10
|
+
if (bareMount) return bareMount;
|
|
11
|
+
const host = document.getElementById(hostId);
|
|
12
|
+
if (!host) throw new Error(`[Overlay] Host #${hostId} not found`);
|
|
13
|
+
const sr = host.shadowRoot;
|
|
14
|
+
if (!sr) throw new Error("[Overlay] Host has no shadowRoot (was it initialized?)");
|
|
15
|
+
const mount = sr.getElementById(SEARCH_OVERLAY_PORTAL_ID);
|
|
16
|
+
if (!mount) throw new Error("[Overlay] Portal mount missing inside ShadowRoot");
|
|
17
|
+
return mount;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.getOverlayPortalTarget = getOverlayPortalTarget;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/SearchZeroState/overlay/overlayHostLocator.ts
|
|
2
|
+
const SEARCH_OVERLAY_ENTRYPOINT_ID = "spiffy-ai-search-overlay-entrypoint";
|
|
3
|
+
const SEARCH_OVERLAY_PORTAL_ID = "spiffy-ai-search-overlay-portal";
|
|
4
|
+
/**
|
|
5
|
+
* Find the portal target inside the overlay host's ShadowRoot.
|
|
6
|
+
*/
|
|
7
|
+
function getOverlayPortalTarget(hostId = SEARCH_OVERLAY_ENTRYPOINT_ID) {
|
|
8
|
+
const bareMount = document.getElementById(SEARCH_OVERLAY_PORTAL_ID);
|
|
9
|
+
if (bareMount) return bareMount;
|
|
10
|
+
const host = document.getElementById(hostId);
|
|
11
|
+
if (!host) throw new Error(`[Overlay] Host #${hostId} not found`);
|
|
12
|
+
const sr = host.shadowRoot;
|
|
13
|
+
if (!sr) throw new Error("[Overlay] Host has no shadowRoot (was it initialized?)");
|
|
14
|
+
const mount = sr.getElementById(SEARCH_OVERLAY_PORTAL_ID);
|
|
15
|
+
if (!mount) throw new Error("[Overlay] Portal mount missing inside ShadowRoot");
|
|
16
|
+
return mount;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getOverlayPortalTarget };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SearchEntryPointWidgetConfig, SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
2
|
+
|
|
3
|
+
//#region src/SearchZeroState/types.d.ts
|
|
4
|
+
interface SearchZeroStateProps {
|
|
5
|
+
widgetConfig: SearchEntryPointWidgetConfig;
|
|
6
|
+
initialIsOpen?: boolean;
|
|
7
|
+
entryPointRef?: React.Ref<HTMLButtonElement>;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type SearchEntryPointWidgetConfig, type SearchInputVariant, SearchZeroStateProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SearchEntryPointWidgetConfig, SearchInputVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
2
|
+
|
|
3
|
+
//#region src/SearchZeroState/types.d.ts
|
|
4
|
+
interface SearchZeroStateProps {
|
|
5
|
+
widgetConfig: SearchEntryPointWidgetConfig;
|
|
6
|
+
initialIsOpen?: boolean;
|
|
7
|
+
entryPointRef?: React.Ref<HTMLButtonElement>;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type SearchEntryPointWidgetConfig, type SearchInputVariant, SearchZeroStateProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __envive_ai_react_hooks_contexts_types = require("@envive-ai/react-hooks/contexts/types");
|
|
3
|
+
|
|
4
|
+
//#region src/SearchZeroState/zeroStateSearchVariants.ts
|
|
5
|
+
const searchZeroStateVariantClasses = {
|
|
6
|
+
backgroundTertiary: {
|
|
7
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-tertiary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
8
|
+
sparklesIconColor: (0, __envive_ai_react_hooks_contexts_types.colorVar)(__envive_ai_react_hooks_contexts_types.ColorNames.AccentPrimary)
|
|
9
|
+
},
|
|
10
|
+
backgroundDark: {
|
|
11
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
12
|
+
sparklesIconColor: (0, __envive_ai_react_hooks_contexts_types.colorVar)(__envive_ai_react_hooks_contexts_types.ColorNames.AccentPrimary)
|
|
13
|
+
},
|
|
14
|
+
backgroundPrimary: {
|
|
15
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
16
|
+
sparklesIconColor: (0, __envive_ai_react_hooks_contexts_types.colorVar)(__envive_ai_react_hooks_contexts_types.ColorNames.AccentPrimary)
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.searchZeroStateVariantClasses = searchZeroStateVariantClasses;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ColorNames, colorVar } from "@envive-ai/react-hooks/contexts/types";
|
|
2
|
+
|
|
3
|
+
//#region src/SearchZeroState/zeroStateSearchVariants.ts
|
|
4
|
+
const searchZeroStateVariantClasses = {
|
|
5
|
+
backgroundTertiary: {
|
|
6
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-tertiary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
7
|
+
sparklesIconColor: colorVar(ColorNames.AccentPrimary)
|
|
8
|
+
},
|
|
9
|
+
backgroundDark: {
|
|
10
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
11
|
+
sparklesIconColor: colorVar(ColorNames.AccentPrimary)
|
|
12
|
+
},
|
|
13
|
+
backgroundPrimary: {
|
|
14
|
+
overlayBackgroundClasses: "spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-bg-opacity-90 spiffy-tw-backdrop-blur-20",
|
|
15
|
+
sparklesIconColor: colorVar(ColorNames.AccentPrimary)
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { searchZeroStateVariantClasses };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_index = require('../node_modules/react-indiana-drag-scroll/dist/index.cjs');
|
|
3
|
+
const require_v4 = require('../node_modules/uuid/dist-node/v4.cjs');
|
|
4
|
+
const require_types = require('./types.cjs');
|
|
5
|
+
const require_SuggestionButtonContainer = require('../SuggestionButtonContainer/SuggestionButtonContainer.cjs');
|
|
6
|
+
require('../SuggestionButtonContainer/index.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let jotai = require("jotai");
|
|
9
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
10
|
+
let __envive_ai_react_hooks_atoms_chat = require("@envive-ai/react-hooks/atoms/chat");
|
|
11
|
+
let __envive_ai_react_hooks_config = require("@envive-ai/react-hooks/config");
|
|
12
|
+
let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
|
|
13
|
+
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
14
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
15
|
+
|
|
16
|
+
//#region src/SuggestionBar/SuggestionBar.tsx
|
|
17
|
+
var import_dist = require_index.default;
|
|
18
|
+
function SuggestionBar({ id, locationForMetrics, buttonTexts, buttonVariation, hoverButtonVariation, boldFirstButton = false, twoRowsOnMobile = false, animationSpeed = "none", buttonBorderRadius = "lg", handleReply, dataTestId }) {
|
|
19
|
+
const componentVisibleTriggerRef = (0, react.useRef)(null);
|
|
20
|
+
const containerRef = (0, react.useRef)(null);
|
|
21
|
+
const { ref } = (0, import_dist.useScrollContainer)();
|
|
22
|
+
const isSmallScreen = (0, __envive_ai_react_hooks_hooks_IsSmallScreen.useIsSmallScreen)();
|
|
23
|
+
const logPerfMetric = (0, jotai.useSetAtom)(__envive_ai_react_hooks_atoms_chat.logPerfMetricAtom);
|
|
24
|
+
const isAnimated = animationSpeed !== "none";
|
|
25
|
+
(0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(__envive_ai_react_hooks_application_models.SpiffyWidgets.SuggestionBar, componentVisibleTriggerRef, { animated: isAnimated });
|
|
26
|
+
const handleClickSuggestion = (0, react.useCallback)((buttonText) => {
|
|
27
|
+
handleReply({
|
|
28
|
+
id: require_v4.default(),
|
|
29
|
+
role: __envive_ai_react_hooks_application_models.MessageRole.User,
|
|
30
|
+
type: __envive_ai_react_hooks_application_models.MessageType.QueryTyped,
|
|
31
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
+
metadata: { content: buttonText }
|
|
33
|
+
});
|
|
34
|
+
}, [handleReply]);
|
|
35
|
+
const setRefs = (0, react.useCallback)((el) => {
|
|
36
|
+
if (typeof ref === "function") ref(el);
|
|
37
|
+
containerRef.current = el;
|
|
38
|
+
}, [ref]);
|
|
39
|
+
const handleContainerRef = (0, react.useCallback)((el) => {
|
|
40
|
+
if (el) logPerfMetric(locationForMetrics === require_types.SuggestionBarLocationForMetrics.SUGGESTION_BAR_TOP ? __envive_ai_react_hooks_atoms_chat.PerfMetricsEvents.TopSuggestionsBarRendered : __envive_ai_react_hooks_atoms_chat.PerfMetricsEvents.BottomSuggestionsBarRendered);
|
|
41
|
+
setRefs(el);
|
|
42
|
+
}, [
|
|
43
|
+
locationForMetrics,
|
|
44
|
+
logPerfMetric,
|
|
45
|
+
setRefs
|
|
46
|
+
]);
|
|
47
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48
|
+
id,
|
|
49
|
+
className: "spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden",
|
|
50
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
51
|
+
className: `spiffy-tw-no-scrollbar spiffy-tw-relative spiffy-tw-w-full spiffy-tw-overflow-y-hidden spiffy-tw-overflow-x-scroll ${twoRowsOnMobile && isSmallScreen ? "spiffy-tw-h-20" : "spiffy-tw-h-9"} `,
|
|
52
|
+
ref: handleContainerRef,
|
|
53
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
54
|
+
className: "spiffy-tw-relative spiffy-tw-inline-block spiffy-tw-whitespace-nowrap",
|
|
55
|
+
ref: componentVisibleTriggerRef,
|
|
56
|
+
"data-testid": dataTestId || __envive_ai_react_hooks_config.SUGGESTION_BAR_TESTID,
|
|
57
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionButtonContainer.SuggestionButtonContainer, {
|
|
58
|
+
buttonVariation,
|
|
59
|
+
hoverButtonVariation,
|
|
60
|
+
buttonTexts,
|
|
61
|
+
onButtonClick: handleClickSuggestion,
|
|
62
|
+
scrollContainerRef: containerRef,
|
|
63
|
+
boldFirstButton,
|
|
64
|
+
twoRowsOnMobile,
|
|
65
|
+
animationSpeed,
|
|
66
|
+
buttonBorderRadius
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
exports.SuggestionBar = SuggestionBar;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
+
import { SuggestionBarLocationForMetrics } from "./types.cjs";
|
|
1
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
3
|
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
3
|
-
import { TestProps } from "@envive-ai/react-hooks/types";
|
|
4
4
|
import { Message } from "postcss";
|
|
5
5
|
|
|
6
|
-
//#region src/SuggestionBar/types.d.ts
|
|
7
|
-
declare enum SuggestionBarLocationForMetrics {
|
|
8
|
-
SUGGESTION_BAR_TOP = "top",
|
|
9
|
-
SUGGESTION_BAR_BOTTOM = "bottom",
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
6
|
//#region src/SuggestionBar/SuggestionBar.d.ts
|
|
13
|
-
interface SuggestionBarProps
|
|
7
|
+
interface SuggestionBarProps {
|
|
14
8
|
id: string;
|
|
15
9
|
locationForMetrics: SuggestionBarLocationForMetrics;
|
|
16
10
|
buttonTexts: string[];
|
|
@@ -21,6 +15,7 @@ interface SuggestionBarProps extends TestProps {
|
|
|
21
15
|
twoRowsOnMobile?: boolean | undefined;
|
|
22
16
|
animationSpeed?: 'standard' | 'slow' | 'none';
|
|
23
17
|
buttonBorderRadius?: 'sm' | 'md' | 'lg';
|
|
18
|
+
dataTestId?: string;
|
|
24
19
|
}
|
|
25
20
|
declare function SuggestionBar({
|
|
26
21
|
id,
|
|
@@ -36,4 +31,4 @@ declare function SuggestionBar({
|
|
|
36
31
|
dataTestId
|
|
37
32
|
}: Readonly<SuggestionBarProps>): react_jsx_runtime0.JSX.Element;
|
|
38
33
|
//#endregion
|
|
39
|
-
export { SuggestionBar
|
|
34
|
+
export { SuggestionBar };
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
import { SuggestionButtonVariant } from "@envive-ai/react-hooks/contexts/types";
|
|
4
4
|
import { Message } from "postcss";
|
|
5
5
|
|
|
6
|
-
//#region src/SuggestionBar/types.d.ts
|
|
7
|
-
declare enum SuggestionBarLocationForMetrics {
|
|
8
|
-
SUGGESTION_BAR_TOP = "top",
|
|
9
|
-
SUGGESTION_BAR_BOTTOM = "bottom",
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
6
|
//#region src/SuggestionBar/SuggestionBar.d.ts
|
|
13
|
-
interface SuggestionBarProps
|
|
7
|
+
interface SuggestionBarProps {
|
|
14
8
|
id: string;
|
|
15
9
|
locationForMetrics: SuggestionBarLocationForMetrics;
|
|
16
10
|
buttonTexts: string[];
|
|
@@ -21,6 +15,7 @@ interface SuggestionBarProps extends TestProps {
|
|
|
21
15
|
twoRowsOnMobile?: boolean | undefined;
|
|
22
16
|
animationSpeed?: 'standard' | 'slow' | 'none';
|
|
23
17
|
buttonBorderRadius?: 'sm' | 'md' | 'lg';
|
|
18
|
+
dataTestId?: string;
|
|
24
19
|
}
|
|
25
20
|
declare function SuggestionBar({
|
|
26
21
|
id,
|
|
@@ -34,6 +29,6 @@ declare function SuggestionBar({
|
|
|
34
29
|
buttonBorderRadius,
|
|
35
30
|
handleReply,
|
|
36
31
|
dataTestId
|
|
37
|
-
}: Readonly<SuggestionBarProps>):
|
|
32
|
+
}: Readonly<SuggestionBarProps>): react_jsx_runtime1.JSX.Element;
|
|
38
33
|
//#endregion
|
|
39
|
-
export { SuggestionBar
|
|
34
|
+
export { SuggestionBar };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import v4_default from "../node_modules/uuid/dist/v4.js";
|
|
2
|
+
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
3
|
+
import { SuggestionButtonContainer } from "../SuggestionButtonContainer/SuggestionButtonContainer.js";
|
|
4
|
+
import "../SuggestionButtonContainer/index.js";
|
|
5
|
+
import { useCallback, useRef } from "react";
|
|
6
|
+
import { useScrollContainer } from "react-indiana-drag-scroll";
|
|
7
|
+
import { useSetAtom } from "jotai";
|
|
8
|
+
import { MessageRole, MessageType, SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
|
|
9
|
+
import { PerfMetricsEvents, logPerfMetricAtom } from "@envive-ai/react-hooks/atoms/chat";
|
|
10
|
+
import { SUGGESTION_BAR_TESTID } from "@envive-ai/react-hooks/config";
|
|
11
|
+
import { useIsSmallScreen } from "@envive-ai/react-hooks/hooks/IsSmallScreen";
|
|
12
|
+
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
|
|
15
|
+
//#region src/SuggestionBar/SuggestionBar.tsx
|
|
16
|
+
function SuggestionBar({ id, locationForMetrics, buttonTexts, buttonVariation, hoverButtonVariation, boldFirstButton = false, twoRowsOnMobile = false, animationSpeed = "none", buttonBorderRadius = "lg", handleReply, dataTestId }) {
|
|
17
|
+
const componentVisibleTriggerRef = useRef(null);
|
|
18
|
+
const containerRef = useRef(null);
|
|
19
|
+
const { ref } = useScrollContainer();
|
|
20
|
+
const isSmallScreen = useIsSmallScreen();
|
|
21
|
+
const logPerfMetric = useSetAtom(logPerfMetricAtom);
|
|
22
|
+
const isAnimated = animationSpeed !== "none";
|
|
23
|
+
useTrackComponentVisibleEvent(SpiffyWidgets.SuggestionBar, componentVisibleTriggerRef, { animated: isAnimated });
|
|
24
|
+
const handleClickSuggestion = useCallback((buttonText) => {
|
|
25
|
+
handleReply({
|
|
26
|
+
id: v4_default(),
|
|
27
|
+
role: MessageRole.User,
|
|
28
|
+
type: MessageType.QueryTyped,
|
|
29
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
30
|
+
metadata: { content: buttonText }
|
|
31
|
+
});
|
|
32
|
+
}, [handleReply]);
|
|
33
|
+
const setRefs = useCallback((el) => {
|
|
34
|
+
if (typeof ref === "function") ref(el);
|
|
35
|
+
containerRef.current = el;
|
|
36
|
+
}, [ref]);
|
|
37
|
+
const handleContainerRef = useCallback((el) => {
|
|
38
|
+
if (el) logPerfMetric(locationForMetrics === SuggestionBarLocationForMetrics.SUGGESTION_BAR_TOP ? PerfMetricsEvents.TopSuggestionsBarRendered : PerfMetricsEvents.BottomSuggestionsBarRendered);
|
|
39
|
+
setRefs(el);
|
|
40
|
+
}, [
|
|
41
|
+
locationForMetrics,
|
|
42
|
+
logPerfMetric,
|
|
43
|
+
setRefs
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ jsx("div", {
|
|
46
|
+
id,
|
|
47
|
+
className: "spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden",
|
|
48
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: `spiffy-tw-no-scrollbar spiffy-tw-relative spiffy-tw-w-full spiffy-tw-overflow-y-hidden spiffy-tw-overflow-x-scroll ${twoRowsOnMobile && isSmallScreen ? "spiffy-tw-h-20" : "spiffy-tw-h-9"} `,
|
|
50
|
+
ref: handleContainerRef,
|
|
51
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "spiffy-tw-relative spiffy-tw-inline-block spiffy-tw-whitespace-nowrap",
|
|
53
|
+
ref: componentVisibleTriggerRef,
|
|
54
|
+
"data-testid": dataTestId || SUGGESTION_BAR_TESTID,
|
|
55
|
+
children: /* @__PURE__ */ jsx(SuggestionButtonContainer, {
|
|
56
|
+
buttonVariation,
|
|
57
|
+
hoverButtonVariation,
|
|
58
|
+
buttonTexts,
|
|
59
|
+
onButtonClick: handleClickSuggestion,
|
|
60
|
+
scrollContainerRef: containerRef,
|
|
61
|
+
boldFirstButton,
|
|
62
|
+
twoRowsOnMobile,
|
|
63
|
+
animationSpeed,
|
|
64
|
+
buttonBorderRadius
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { SuggestionBar };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
require('
|
|
1
|
+
const require_types = require('./types.cjs');
|
|
2
|
+
const require_SuggestionBar = require('./SuggestionBar.cjs');
|
|
3
3
|
|
|
4
4
|
exports.SuggestionBar = require_SuggestionBar.SuggestionBar;
|
|
5
|
-
exports.SuggestionBarLocationForMetrics =
|
|
5
|
+
exports.SuggestionBarLocationForMetrics = require_types.SuggestionBarLocationForMetrics;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
1
|
+
import { SuggestionBarLocationForMetrics } from "./types.js";
|
|
2
|
+
import { SuggestionBar } from "./SuggestionBar.js";
|
|
3
3
|
|
|
4
4
|
export { SuggestionBar, SuggestionBarLocationForMetrics };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/SuggestionBar/types.ts
|
|
3
|
+
let SuggestionBarLocationForMetrics = /* @__PURE__ */ function(SuggestionBarLocationForMetrics$1) {
|
|
4
|
+
SuggestionBarLocationForMetrics$1["SUGGESTION_BAR_TOP"] = "top";
|
|
5
|
+
SuggestionBarLocationForMetrics$1["SUGGESTION_BAR_BOTTOM"] = "bottom";
|
|
6
|
+
return SuggestionBarLocationForMetrics$1;
|
|
7
|
+
}({});
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.SuggestionBarLocationForMetrics = SuggestionBarLocationForMetrics;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/SuggestionBar/types.ts
|
|
2
|
+
let SuggestionBarLocationForMetrics = /* @__PURE__ */ function(SuggestionBarLocationForMetrics$1) {
|
|
3
|
+
SuggestionBarLocationForMetrics$1["SUGGESTION_BAR_TOP"] = "top";
|
|
4
|
+
SuggestionBarLocationForMetrics$1["SUGGESTION_BAR_BOTTOM"] = "bottom";
|
|
5
|
+
return SuggestionBarLocationForMetrics$1;
|
|
6
|
+
}({});
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SuggestionBarLocationForMetrics };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_SuggestionButton = require('../packages/components/dist/components/SuggestionButton/SuggestionButton.cjs');
|
|
3
|
+
require('../packages/components/dist/components/SuggestionButton/index.cjs');
|
|
4
|
+
const require_useHorizontalScrollAnimation = require('../util/useHorizontalScrollAnimation.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
|
|
7
|
+
let __envive_ai_react_hooks_config = require("@envive-ai/react-hooks/config");
|
|
8
|
+
let __envive_ai_react_hooks_hooks_IsSmallScreen = require("@envive-ai/react-hooks/hooks/IsSmallScreen");
|
|
9
|
+
let __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent = require("@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent");
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.tsx
|
|
13
|
+
function ButtonContainer({ children }) {
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
15
|
+
className: "spiffy-tw-pl-0 spiffy-tw-flex spiffy-tw-h-full spiffy-tw-flex-row spiffy-tw-items-center spiffy-tw-space-x-2",
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, buttonTexts, boldFirstButton = false, twoRowsOnMobile = false, animationSpeed = "none", buttonBorderRadius = "lg", scrollContainerRef, onButtonClick }) => {
|
|
20
|
+
const componentVisibleTriggerRef = (0, react.useRef)(null);
|
|
21
|
+
require_useHorizontalScrollAnimation.useHorizontalScrollAnimation({
|
|
22
|
+
scrollContainerRef,
|
|
23
|
+
animationSpeed
|
|
24
|
+
});
|
|
25
|
+
const isSmallScreen = (0, __envive_ai_react_hooks_hooks_IsSmallScreen.useIsSmallScreen)();
|
|
26
|
+
const isAnimated = animationSpeed !== "none";
|
|
27
|
+
(0, __envive_ai_react_hooks_hooks_TrackComponentVisibleEvent.useTrackComponentVisibleEvent)(__envive_ai_react_hooks_application_models.SpiffyWidgets.SuggestionBar, componentVisibleTriggerRef, { animated: isAnimated });
|
|
28
|
+
const visibleButtonsFirstRow = buttonTexts.slice(0, twoRowsOnMobile && isSmallScreen ? Math.ceil((buttonTexts.length + 1) / 2) : void 0);
|
|
29
|
+
const visibleButtonsSecondRow = buttonTexts.slice(Math.ceil((buttonTexts.length + 1) / 2), buttonTexts.length);
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
31
|
+
className: "spiffy-tw-no-scrollbar spiffy-tw-w-full spiffy-tw-overflow-x-scroll spiffy-tw-whitespace-nowrap",
|
|
32
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsFirstRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionButton.SuggestionButton, {
|
|
33
|
+
variant: buttonVariation,
|
|
34
|
+
hoverVariant: hoverButtonVariation,
|
|
35
|
+
isDisabled: false,
|
|
36
|
+
content: suggestion,
|
|
37
|
+
boldText: boldFirstButton && i === 0,
|
|
38
|
+
borderRadius: buttonBorderRadius,
|
|
39
|
+
onClick: () => onButtonClick(suggestion),
|
|
40
|
+
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
41
|
+
}, i)), isAnimated && buttonTexts.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionButton.SuggestionButton, {
|
|
42
|
+
variant: buttonVariation,
|
|
43
|
+
hoverVariant: hoverButtonVariation,
|
|
44
|
+
isDisabled: false,
|
|
45
|
+
content: suggestion,
|
|
46
|
+
boldText: boldFirstButton && i === 0,
|
|
47
|
+
borderRadius: buttonBorderRadius,
|
|
48
|
+
onClick: () => onButtonClick(suggestion),
|
|
49
|
+
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
50
|
+
}, `animation-dupe-${i}`))] }), twoRowsOnMobile && isSmallScreen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
51
|
+
className: "spiffy-tw-mt-1.5",
|
|
52
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonContainer, { children: [visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionButton.SuggestionButton, {
|
|
53
|
+
variant: buttonVariation,
|
|
54
|
+
hoverVariant: hoverButtonVariation,
|
|
55
|
+
isDisabled: false,
|
|
56
|
+
content: suggestion,
|
|
57
|
+
boldText: boldFirstButton && i === 0,
|
|
58
|
+
borderRadius: buttonBorderRadius,
|
|
59
|
+
onClick: () => onButtonClick(suggestion),
|
|
60
|
+
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
61
|
+
}, i)), isAnimated && visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionButton.SuggestionButton, {
|
|
62
|
+
variant: buttonVariation,
|
|
63
|
+
hoverVariant: hoverButtonVariation,
|
|
64
|
+
isDisabled: false,
|
|
65
|
+
content: suggestion,
|
|
66
|
+
boldText: boldFirstButton && i === 0,
|
|
67
|
+
borderRadius: buttonBorderRadius,
|
|
68
|
+
onClick: () => onButtonClick(suggestion),
|
|
69
|
+
dataTestId: __envive_ai_react_hooks_config.SUGGESTION_BAR_BUTTON_TESTID
|
|
70
|
+
}, `animation-dupe-${i}`))] })
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
exports.SuggestionButtonContainer = SuggestionButtonContainer;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SuggestionButtonContainerProps } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.d.ts
|
|
4
|
+
declare const SuggestionButtonContainer: React.FC<SuggestionButtonContainerProps>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { SuggestionButtonContainer };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SuggestionButtonContainerProps } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.d.ts
|
|
4
|
+
declare const SuggestionButtonContainer: React.FC<SuggestionButtonContainerProps>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { SuggestionButtonContainer };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SuggestionButton } from "../packages/components/dist/components/SuggestionButton/SuggestionButton.js";
|
|
2
|
+
import "../packages/components/dist/components/SuggestionButton/index.js";
|
|
3
|
+
import { useHorizontalScrollAnimation } from "../util/useHorizontalScrollAnimation.js";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
|
|
6
|
+
import { SUGGESTION_BAR_BUTTON_TESTID } from "@envive-ai/react-hooks/config";
|
|
7
|
+
import { useIsSmallScreen } from "@envive-ai/react-hooks/hooks/IsSmallScreen";
|
|
8
|
+
import { useTrackComponentVisibleEvent } from "@envive-ai/react-hooks/hooks/TrackComponentVisibleEvent";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
|
|
11
|
+
//#region src/SuggestionButtonContainer/SuggestionButtonContainer.tsx
|
|
12
|
+
function ButtonContainer({ children }) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: "spiffy-tw-pl-0 spiffy-tw-flex spiffy-tw-h-full spiffy-tw-flex-row spiffy-tw-items-center spiffy-tw-space-x-2",
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const SuggestionButtonContainer = ({ buttonVariation, hoverButtonVariation, buttonTexts, boldFirstButton = false, twoRowsOnMobile = false, animationSpeed = "none", buttonBorderRadius = "lg", scrollContainerRef, onButtonClick }) => {
|
|
19
|
+
const componentVisibleTriggerRef = useRef(null);
|
|
20
|
+
useHorizontalScrollAnimation({
|
|
21
|
+
scrollContainerRef,
|
|
22
|
+
animationSpeed
|
|
23
|
+
});
|
|
24
|
+
const isSmallScreen = useIsSmallScreen();
|
|
25
|
+
const isAnimated = animationSpeed !== "none";
|
|
26
|
+
useTrackComponentVisibleEvent(SpiffyWidgets.SuggestionBar, componentVisibleTriggerRef, { animated: isAnimated });
|
|
27
|
+
const visibleButtonsFirstRow = buttonTexts.slice(0, twoRowsOnMobile && isSmallScreen ? Math.ceil((buttonTexts.length + 1) / 2) : void 0);
|
|
28
|
+
const visibleButtonsSecondRow = buttonTexts.slice(Math.ceil((buttonTexts.length + 1) / 2), buttonTexts.length);
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "spiffy-tw-no-scrollbar spiffy-tw-w-full spiffy-tw-overflow-x-scroll spiffy-tw-whitespace-nowrap",
|
|
31
|
+
children: [/* @__PURE__ */ jsxs(ButtonContainer, { children: [visibleButtonsFirstRow.map((suggestion, i) => /* @__PURE__ */ jsx(SuggestionButton, {
|
|
32
|
+
variant: buttonVariation,
|
|
33
|
+
hoverVariant: hoverButtonVariation,
|
|
34
|
+
isDisabled: false,
|
|
35
|
+
content: suggestion,
|
|
36
|
+
boldText: boldFirstButton && i === 0,
|
|
37
|
+
borderRadius: buttonBorderRadius,
|
|
38
|
+
onClick: () => onButtonClick(suggestion),
|
|
39
|
+
dataTestId: SUGGESTION_BAR_BUTTON_TESTID
|
|
40
|
+
}, i)), isAnimated && buttonTexts.map((suggestion, i) => /* @__PURE__ */ jsx(SuggestionButton, {
|
|
41
|
+
variant: buttonVariation,
|
|
42
|
+
hoverVariant: hoverButtonVariation,
|
|
43
|
+
isDisabled: false,
|
|
44
|
+
content: suggestion,
|
|
45
|
+
boldText: boldFirstButton && i === 0,
|
|
46
|
+
borderRadius: buttonBorderRadius,
|
|
47
|
+
onClick: () => onButtonClick(suggestion),
|
|
48
|
+
dataTestId: SUGGESTION_BAR_BUTTON_TESTID
|
|
49
|
+
}, `animation-dupe-${i}`))] }), twoRowsOnMobile && isSmallScreen && /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: "spiffy-tw-mt-1.5",
|
|
51
|
+
children: /* @__PURE__ */ jsxs(ButtonContainer, { children: [visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ jsx(SuggestionButton, {
|
|
52
|
+
variant: buttonVariation,
|
|
53
|
+
hoverVariant: hoverButtonVariation,
|
|
54
|
+
isDisabled: false,
|
|
55
|
+
content: suggestion,
|
|
56
|
+
boldText: boldFirstButton && i === 0,
|
|
57
|
+
borderRadius: buttonBorderRadius,
|
|
58
|
+
onClick: () => onButtonClick(suggestion),
|
|
59
|
+
dataTestId: SUGGESTION_BAR_BUTTON_TESTID
|
|
60
|
+
}, i)), isAnimated && visibleButtonsSecondRow.map((suggestion, i) => /* @__PURE__ */ jsx(SuggestionButton, {
|
|
61
|
+
variant: buttonVariation,
|
|
62
|
+
hoverVariant: hoverButtonVariation,
|
|
63
|
+
isDisabled: false,
|
|
64
|
+
content: suggestion,
|
|
65
|
+
boldText: boldFirstButton && i === 0,
|
|
66
|
+
borderRadius: buttonBorderRadius,
|
|
67
|
+
onClick: () => onButtonClick(suggestion),
|
|
68
|
+
dataTestId: SUGGESTION_BAR_BUTTON_TESTID
|
|
69
|
+
}, `animation-dupe-${i}`))] })
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { SuggestionButtonContainer };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const require_SuggestionButtonContainer = require('
|
|
1
|
+
const require_SuggestionButtonContainer = require('./SuggestionButtonContainer.cjs');
|
|
2
2
|
|
|
3
3
|
exports.SuggestionButtonContainer = require_SuggestionButtonContainer.SuggestionButtonContainer;
|
|
@@ -14,7 +14,4 @@ interface SuggestionButtonContainerProps extends TestProps {
|
|
|
14
14
|
buttonBorderRadius?: 'sm' | 'md' | 'lg';
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
|
-
|
|
18
|
-
declare const SuggestionButtonContainer: React.FC<SuggestionButtonContainerProps>;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { SuggestionButtonContainer, SuggestionButtonContainerProps };
|
|
17
|
+
export { SuggestionButtonContainerProps };
|
|
@@ -14,7 +14,4 @@ interface SuggestionButtonContainerProps extends TestProps {
|
|
|
14
14
|
buttonBorderRadius?: 'sm' | 'md' | 'lg';
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
|
-
|
|
18
|
-
declare const SuggestionButtonContainer: React.FC<SuggestionButtonContainerProps>;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { SuggestionButtonContainer, SuggestionButtonContainerProps };
|
|
17
|
+
export { SuggestionButtonContainerProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
+
key = keys[i];
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
16
|
+
__defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: true
|
|
28
|
+
}) : target, mod));
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
|
|
32
|
+
exports.__commonJS = __commonJS;
|
|
33
|
+
exports.__toESM = __toESM;
|