@envive-ai/react-widgets 0.1.2 → 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.
Files changed (278) hide show
  1. package/dist/SearchResults/SearchResults.cjs +86 -0
  2. package/dist/SearchResults/SearchResults.js +84 -0
  3. package/dist/SearchResults/SearchResultsWidget.cjs +34 -0
  4. package/dist/SearchResults/SearchResultsWidget.js +33 -0
  5. package/dist/SearchResults/index.cjs +2 -122
  6. package/dist/SearchResults/index.d.cts +2 -0
  7. package/dist/SearchResults/index.d.ts +2 -0
  8. package/dist/SearchResults/index.js +1 -119
  9. package/dist/SearchResults/withSearchResults.cjs +18 -0
  10. package/dist/SearchResults/withSearchResults.js +17 -0
  11. package/dist/SearchZeroState/SearchIcon.cjs +48 -0
  12. package/dist/SearchZeroState/SearchIcon.js +45 -0
  13. package/dist/SearchZeroState/SearchOverlay.cjs +42 -0
  14. package/dist/SearchZeroState/SearchOverlay.js +39 -0
  15. package/dist/SearchZeroState/SearchZeroState.cjs +173 -0
  16. package/dist/SearchZeroState/SearchZeroState.d.cts +7 -0
  17. package/dist/SearchZeroState/SearchZeroState.d.ts +7 -0
  18. package/dist/SearchZeroState/SearchZeroState.js +171 -0
  19. package/dist/SearchZeroState/SearchZeroStateWidget.cjs +23 -0
  20. package/dist/SearchZeroState/SearchZeroStateWidget.d.cts +15 -0
  21. package/dist/SearchZeroState/SearchZeroStateWidget.d.ts +15 -0
  22. package/dist/SearchZeroState/SearchZeroStateWidget.js +22 -0
  23. package/dist/SearchZeroState/components/RecommendedProducts.cjs +74 -0
  24. package/dist/SearchZeroState/components/RecommendedProducts.js +72 -0
  25. package/dist/SearchZeroState/index.cjs +4 -3070
  26. package/dist/SearchZeroState/index.d.cts +4 -0
  27. package/dist/SearchZeroState/index.d.ts +4 -0
  28. package/dist/SearchZeroState/index.js +2 -3065
  29. package/dist/SearchZeroState/overlay/overlayHostLocator.cjs +21 -0
  30. package/dist/SearchZeroState/overlay/overlayHostLocator.js +20 -0
  31. package/dist/SearchZeroState/types.d.cts +10 -0
  32. package/dist/SearchZeroState/types.d.ts +10 -0
  33. package/dist/SearchZeroState/zeroStateSearchVariants.cjs +21 -0
  34. package/dist/SearchZeroState/zeroStateSearchVariants.js +20 -0
  35. package/dist/SuggestionBar/SuggestionBar.cjs +74 -0
  36. package/dist/SuggestionBar/{index-DZU9kbWS.d.cts → SuggestionBar.d.cts} +4 -9
  37. package/dist/SuggestionBar/{index-DyXd4-b7.d.ts → SuggestionBar.d.ts} +6 -11
  38. package/dist/{SuggestionBar-BHAXhgcd.js → SuggestionBar/SuggestionBar.js} +7 -59
  39. package/dist/SuggestionBar/index.cjs +3 -3
  40. package/dist/SuggestionBar/index.d.cts +3 -0
  41. package/dist/SuggestionBar/index.d.ts +3 -0
  42. package/dist/SuggestionBar/index.js +2 -2
  43. package/dist/SuggestionBar/types.cjs +10 -0
  44. package/dist/SuggestionBar/types.d.cts +7 -0
  45. package/dist/SuggestionBar/types.d.ts +7 -0
  46. package/dist/SuggestionBar/types.js +9 -0
  47. package/dist/SuggestionButtonContainer/SuggestionButtonContainer.cjs +76 -0
  48. package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.cts +6 -0
  49. package/dist/SuggestionButtonContainer/SuggestionButtonContainer.d.ts +6 -0
  50. package/dist/{SuggestionButtonContainer-s2e9YGW_.js → SuggestionButtonContainer/SuggestionButtonContainer.js} +6 -98
  51. package/dist/SuggestionButtonContainer/index.cjs +1 -1
  52. package/dist/SuggestionButtonContainer/index.d.cts +3 -0
  53. package/dist/SuggestionButtonContainer/index.d.ts +3 -0
  54. package/dist/SuggestionButtonContainer/index.js +1 -1
  55. package/dist/SuggestionButtonContainer/{index-B_X537jw.d.cts → types.d.cts} +1 -4
  56. package/dist/SuggestionButtonContainer/{index-vwelzDzM.d.ts → types.d.ts} +1 -4
  57. package/dist/{chunk-DSlc6foC.cjs → _virtual/rolldown_runtime.cjs} +2 -12
  58. package/dist/node_modules/react-icons/lib/iconBase.cjs +121 -0
  59. package/dist/node_modules/react-icons/lib/iconBase.js +119 -0
  60. package/dist/node_modules/react-icons/lib/iconContext.cjs +17 -0
  61. package/dist/node_modules/react-icons/lib/iconContext.js +14 -0
  62. package/dist/node_modules/react-icons/md/index.cjs +35 -0
  63. package/dist/node_modules/react-icons/md/index.js +35 -0
  64. package/dist/{SuggestionBar-CK5aU2bb.cjs → node_modules/react-indiana-drag-scroll/dist/index.cjs} +6 -132
  65. package/dist/node_modules/uuid/dist/native.js +6 -0
  66. package/dist/node_modules/uuid/dist/rng.js +13 -0
  67. package/dist/node_modules/uuid/dist/stringify.js +9 -0
  68. package/dist/node_modules/uuid/dist/v4.js +27 -0
  69. package/dist/node_modules/uuid/dist-node/native.cjs +8 -0
  70. package/dist/node_modules/uuid/dist-node/rng.cjs +16 -0
  71. package/dist/node_modules/uuid/dist-node/stringify.cjs +10 -0
  72. package/dist/node_modules/uuid/dist-node/v4.cjs +27 -0
  73. package/dist/packages/components/dist/components/Accordion/Accordion.cjs +80 -0
  74. package/dist/packages/components/dist/components/Accordion/Accordion.js +78 -0
  75. package/dist/packages/components/dist/components/Accordion/index.cjs +1 -0
  76. package/dist/packages/components/dist/components/Accordion/index.js +1 -0
  77. package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.cjs +30 -0
  78. package/dist/packages/components/dist/components/AnimatedChevron/AnimatedChevron.js +29 -0
  79. package/dist/packages/components/dist/components/ButtonBase/ButtonBase.cjs +56 -0
  80. package/dist/packages/components/dist/components/ButtonBase/ButtonBase.js +54 -0
  81. package/dist/packages/components/dist/components/ButtonBase/index.cjs +2 -0
  82. package/dist/packages/components/dist/components/ButtonBase/index.js +2 -0
  83. package/dist/packages/components/dist/components/ButtonBase/types.cjs +11 -0
  84. package/dist/packages/components/dist/components/ButtonBase/types.js +10 -0
  85. package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.cjs +45 -0
  86. package/dist/packages/components/dist/components/FilterScrollbar/AppliedFiltersScrollbar.js +42 -0
  87. package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.cjs +33 -0
  88. package/dist/packages/components/dist/components/FilterScrollbar/DynamicFiltersScrollbar.js +30 -0
  89. package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.cjs +45 -0
  90. package/dist/packages/components/dist/components/ImageWithFallback/ImageWithFallback.js +42 -0
  91. package/dist/packages/components/dist/components/ImageWithFallback/index.cjs +1 -0
  92. package/dist/packages/components/dist/components/ImageWithFallback/index.js +1 -0
  93. package/dist/packages/components/dist/components/ModalSheet/ModalSheet.cjs +30 -0
  94. package/dist/packages/components/dist/components/ModalSheet/ModalSheet.js +29 -0
  95. package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.cjs +26 -0
  96. package/dist/packages/components/dist/components/ModalSheet/desktop/desktopHeader.js +24 -0
  97. package/dist/packages/components/dist/components/ModalSheet/desktop/index.cjs +122 -0
  98. package/dist/packages/components/dist/components/ModalSheet/desktop/index.js +120 -0
  99. package/dist/packages/components/dist/components/ModalSheet/index.cjs +1 -0
  100. package/dist/packages/components/dist/components/ModalSheet/index.js +1 -0
  101. package/dist/packages/components/dist/components/ModalSheet/mobile/index.cjs +116 -0
  102. package/dist/packages/components/dist/components/ModalSheet/mobile/index.js +114 -0
  103. package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.cjs +38 -0
  104. package/dist/packages/components/dist/components/ModalSheet/mobile/mobileHeader.js +36 -0
  105. package/dist/packages/components/dist/components/ProductCard/ProductCard.cjs +153 -0
  106. package/dist/packages/components/dist/components/ProductCard/ProductCard.js +149 -0
  107. package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.cjs +33 -0
  108. package/dist/packages/components/dist/components/ProductCard/ProductCardSkeleton.js +31 -0
  109. package/dist/packages/components/dist/components/ProductCard/index.cjs +4 -0
  110. package/dist/packages/components/dist/components/ProductCard/index.js +4 -0
  111. package/dist/packages/components/dist/components/ProductCard/productCardVariants.cjs +49 -0
  112. package/dist/packages/components/dist/components/ProductCard/productCardVariants.js +45 -0
  113. package/dist/packages/components/dist/components/ProductCard/types.cjs +10 -0
  114. package/dist/packages/components/dist/components/ProductCard/types.js +9 -0
  115. package/dist/packages/components/dist/components/ProductGrid/ProductGrid.cjs +43 -0
  116. package/dist/packages/components/dist/components/ProductGrid/ProductGrid.js +41 -0
  117. package/dist/packages/components/dist/components/ProductGrid/index.cjs +2 -0
  118. package/dist/packages/components/dist/components/ProductGrid/index.js +2 -0
  119. package/dist/packages/components/dist/components/ProductGrid/productGridVariants.cjs +21 -0
  120. package/dist/packages/components/dist/components/ProductGrid/productGridVariants.js +20 -0
  121. package/dist/packages/components/dist/components/RadioButton/RadioButton.cjs +74 -0
  122. package/dist/packages/components/dist/components/RadioButton/RadioButton.js +72 -0
  123. package/dist/packages/components/dist/components/RadioButton/index.cjs +1 -0
  124. package/dist/packages/components/dist/components/RadioButton/index.js +1 -0
  125. package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.cjs +42 -0
  126. package/dist/packages/components/dist/components/RadioButtonGroup/RadioButtonGroup.js +39 -0
  127. package/dist/packages/components/dist/components/RadioButtonGroup/index.cjs +1 -0
  128. package/dist/packages/components/dist/components/RadioButtonGroup/index.js +1 -0
  129. package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.cjs +53 -0
  130. package/dist/packages/components/dist/components/RecommendedProducts/RecommendedProducts.js +51 -0
  131. package/dist/packages/components/dist/components/RecommendedProducts/index.cjs +3 -0
  132. package/dist/packages/components/dist/components/RecommendedProducts/index.js +3 -0
  133. package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.cjs +72 -0
  134. package/dist/packages/components/dist/components/SearchAutocomplete/SearchAutocomplete.js +69 -0
  135. package/dist/packages/components/dist/components/SearchAutocomplete/index.cjs +1 -0
  136. package/dist/packages/components/dist/components/SearchAutocomplete/index.js +1 -0
  137. package/dist/packages/components/dist/components/SearchFilter/SearchFilter.cjs +134 -0
  138. package/dist/packages/components/dist/components/SearchFilter/SearchFilter.js +132 -0
  139. package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.cjs +48 -0
  140. package/dist/packages/components/dist/components/SearchFilter/SearchFilterFooter.js +46 -0
  141. package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.cjs +42 -0
  142. package/dist/packages/components/dist/components/SearchFilter/SearchFilterHeader.js +40 -0
  143. package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.cjs +6 -0
  144. package/dist/packages/components/dist/components/SearchFilter/SearchFilterItem.js +4 -0
  145. package/dist/packages/components/dist/components/SearchFilter/index.cjs +5 -0
  146. package/dist/packages/components/dist/components/SearchFilter/index.js +5 -0
  147. package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.cjs +27 -0
  148. package/dist/packages/components/dist/components/SearchFilter/useHasFilterStateChanged.js +26 -0
  149. package/dist/packages/components/dist/components/SearchFilter/utils.cjs +11 -0
  150. package/dist/packages/components/dist/components/SearchFilter/utils.js +9 -0
  151. package/dist/packages/components/dist/components/SearchInput/SearchInput.cjs +81 -0
  152. package/dist/packages/components/dist/components/SearchInput/SearchInput.js +78 -0
  153. package/dist/packages/components/dist/components/SearchInput/index.cjs +2 -0
  154. package/dist/packages/components/dist/components/SearchInput/index.js +2 -0
  155. package/dist/packages/components/dist/components/SearchInput/searchInputVariants.cjs +15 -0
  156. package/dist/packages/components/dist/components/SearchInput/searchInputVariants.js +15 -0
  157. package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.cjs +57 -0
  158. package/dist/packages/components/dist/components/SearchInputForm/SearchInputForm.js +55 -0
  159. package/dist/packages/components/dist/components/SearchInputForm/index.cjs +1 -0
  160. package/dist/packages/components/dist/components/SearchInputForm/index.js +1 -0
  161. package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.cjs +52 -0
  162. package/dist/packages/components/dist/components/SearchResultsContent/SearchResultsContent.js +50 -0
  163. package/dist/packages/components/dist/components/SearchResultsContent/index.cjs +1 -0
  164. package/dist/packages/components/dist/components/SearchResultsContent/index.js +1 -0
  165. package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.cjs +24 -0
  166. package/dist/packages/components/dist/components/SearchResultsFilterButton/SearchResultsFilterButton.js +23 -0
  167. package/dist/packages/components/dist/components/SearchResultsFilterButton/index.cjs +3 -0
  168. package/dist/packages/components/dist/components/SearchResultsFilterButton/index.js +3 -0
  169. package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.cjs +36 -0
  170. package/dist/packages/components/dist/components/SearchResultsFilterModal/SearchResultsFilterModal.js +35 -0
  171. package/dist/packages/components/dist/components/SearchResultsFilterModal/index.cjs +3 -0
  172. package/dist/packages/components/dist/components/SearchResultsFilterModal/index.js +3 -0
  173. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.cjs +9 -0
  174. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/SearchResultsFilter.js +9 -0
  175. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.cjs +2 -0
  176. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/index.js +2 -0
  177. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.cjs +34 -0
  178. package/dist/packages/components/dist/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +34 -0
  179. package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.cjs +56 -0
  180. package/dist/packages/components/dist/components/SearchResultsStates/NoSearchResultsFound.js +54 -0
  181. package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.cjs +53 -0
  182. package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsGrid.js +51 -0
  183. package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
  184. package/dist/packages/components/dist/components/SearchResultsStates/SearchResultsLoadingGrid.js +51 -0
  185. package/dist/packages/components/dist/components/SearchResultsStates/index.cjs +3 -0
  186. package/dist/packages/components/dist/components/SearchResultsStates/index.js +3 -0
  187. package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.cjs +60 -0
  188. package/dist/packages/components/dist/components/SearchResultsToolbar/SearchResultsToolbar.js +57 -0
  189. package/dist/packages/components/dist/components/SearchResultsToolbar/index.cjs +3 -0
  190. package/dist/packages/components/dist/components/SearchResultsToolbar/index.js +3 -0
  191. package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.cjs +77 -0
  192. package/dist/packages/components/dist/components/SparkleAnimation/SparkleAnimation.js +75 -0
  193. package/dist/packages/components/dist/components/SparkleAnimation/index.cjs +2 -0
  194. package/dist/packages/components/dist/components/SparkleAnimation/index.js +2 -0
  195. package/dist/packages/components/dist/components/SparkleAnimation/types.cjs +12 -0
  196. package/dist/packages/components/dist/components/SparkleAnimation/types.js +11 -0
  197. package/dist/packages/components/dist/components/Spinner/Spinner.cjs +40 -0
  198. package/dist/packages/components/dist/components/Spinner/Spinner.js +38 -0
  199. package/dist/packages/components/dist/components/Spinner/index.cjs +1 -0
  200. package/dist/packages/components/dist/components/Spinner/index.js +1 -0
  201. package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.cjs +193 -0
  202. package/dist/packages/components/dist/components/SuggestionButton/SuggestionButton.js +188 -0
  203. package/dist/packages/components/dist/components/SuggestionButton/index.cjs +1 -0
  204. package/dist/packages/components/dist/components/SuggestionButton/index.js +1 -0
  205. package/dist/packages/components/dist/components/TextInput/TextInput.cjs +34 -0
  206. package/dist/packages/components/dist/components/TextInput/TextInput.js +31 -0
  207. package/dist/packages/components/dist/components/TextInput/index.cjs +1 -0
  208. package/dist/packages/components/dist/components/TextInput/index.js +1 -0
  209. package/dist/packages/components/dist/components/ToggleButton/ToggleButton.cjs +63 -0
  210. package/dist/packages/components/dist/components/ToggleButton/ToggleButton.js +61 -0
  211. package/dist/packages/components/dist/components/ToggleButton/index.cjs +1 -0
  212. package/dist/packages/components/dist/components/ToggleButton/index.js +1 -0
  213. package/dist/packages/components/dist/components/Typography/Typography.cjs +53 -0
  214. package/dist/packages/components/dist/components/Typography/Typography.js +50 -0
  215. package/dist/packages/components/dist/components/Typography/index.cjs +2 -0
  216. package/dist/packages/components/dist/components/Typography/index.js +2 -0
  217. package/dist/packages/components/dist/components/Typography/typographyVariantClasses.cjs +99 -0
  218. package/dist/packages/components/dist/components/Typography/typographyVariantClasses.js +96 -0
  219. package/dist/packages/components/dist/components/Typography/util.cjs +10 -0
  220. package/dist/packages/components/dist/components/Typography/util.js +10 -0
  221. package/dist/packages/components/dist/logging/logger.cjs +20 -0
  222. package/dist/packages/components/dist/logging/logger.js +19 -0
  223. package/dist/packages/components/dist/models/colorsConfig.cjs +28 -0
  224. package/dist/packages/components/dist/models/colorsConfig.js +26 -0
  225. package/dist/packages/components/dist/util/formatPrice.cjs +14 -0
  226. package/dist/packages/components/dist/util/formatPrice.js +13 -0
  227. package/dist/packages/components/dist/util/index.cjs +3 -0
  228. package/dist/packages/components/dist/util/index.js +3 -0
  229. package/dist/packages/components/dist/util/useScrollDirection.cjs +39 -0
  230. package/dist/packages/components/dist/util/useScrollDirection.js +38 -0
  231. package/dist/packages/components/dist/util/useStickyVisibility.cjs +38 -0
  232. package/dist/packages/components/dist/util/useStickyVisibility.js +37 -0
  233. package/dist/packages/icons/dist/AiSearchBold.cjs +38 -0
  234. package/dist/packages/icons/dist/AiSearchBold.js +38 -0
  235. package/dist/packages/icons/dist/AiSearchThin.cjs +35 -0
  236. package/dist/packages/icons/dist/AiSearchThin.js +35 -0
  237. package/dist/packages/icons/dist/ChevronDown.cjs +23 -0
  238. package/dist/packages/icons/dist/ChevronDown.js +23 -0
  239. package/dist/packages/icons/dist/FourPointStar.cjs +22 -0
  240. package/dist/packages/icons/dist/FourPointStar.js +22 -0
  241. package/dist/packages/icons/dist/IconClose.cjs +26 -0
  242. package/dist/packages/icons/dist/IconClose.js +26 -0
  243. package/dist/packages/icons/dist/IconCloseVariant.cjs +22 -0
  244. package/dist/packages/icons/dist/IconCloseVariant.js +22 -0
  245. package/dist/packages/icons/dist/MagnifyingGlassStarVariant.cjs +39 -0
  246. package/dist/packages/icons/dist/MagnifyingGlassStarVariant.js +39 -0
  247. package/dist/packages/icons/dist/OutlinedStar.cjs +22 -0
  248. package/dist/packages/icons/dist/OutlinedStar.js +22 -0
  249. package/dist/packages/icons/dist/SettingsVariant.cjs +72 -0
  250. package/dist/packages/icons/dist/SettingsVariant.js +72 -0
  251. package/dist/packages/icons/dist/Sparkles.cjs +43 -0
  252. package/dist/packages/icons/dist/Sparkles.js +43 -0
  253. package/dist/packages/icons/dist/_virtual/rolldown_runtime.cjs +29 -0
  254. package/dist/packages/icons/dist/_virtual/rolldown_runtime.js +27 -0
  255. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +696 -0
  256. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.development.js +696 -0
  257. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs +43 -0
  258. package/dist/packages/icons/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +43 -0
  259. package/dist/packages/icons/dist/node_modules/react/cjs/react.development.cjs +1528 -0
  260. package/dist/packages/icons/dist/node_modules/react/cjs/react.development.js +1528 -0
  261. package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.cjs +329 -0
  262. package/dist/packages/icons/dist/node_modules/react/cjs/react.production.min.js +329 -0
  263. package/dist/packages/icons/dist/node_modules/react/index.cjs +13 -0
  264. package/dist/packages/icons/dist/node_modules/react/index.js +13 -0
  265. package/dist/packages/icons/dist/node_modules/react/jsx-runtime.cjs +13 -0
  266. package/dist/packages/icons/dist/node_modules/react/jsx-runtime.js +13 -0
  267. package/dist/util/useHorizontalScrollAnimation.cjs +88 -0
  268. package/dist/util/useHorizontalScrollAnimation.js +87 -0
  269. package/dist/util/useReducedMotionWithOverride.cjs +15 -0
  270. package/dist/util/useReducedMotionWithOverride.js +14 -0
  271. package/package.json +3 -5
  272. package/src/SearchZeroState/SearchZeroState.tsx +1 -1
  273. package/src/SuggestionBar/SuggestionBar.tsx +2 -2
  274. package/dist/SearchZeroState/index-DSFtalZR.d.ts +0 -27
  275. package/dist/SearchZeroState/index-bEcxYOSF.d.cts +0 -27
  276. package/dist/SuggestionButtonContainer-Dm38gJiJ.cjs +0 -173
  277. /package/dist/SearchResults/{index-DCTxvwmv.d.cts → SearchResultsWidget.d.cts} +0 -0
  278. /package/dist/SearchResults/{index-CYPV3XE0.d.ts → SearchResultsWidget.d.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_overlayHostLocator = require('./overlay/overlayHostLocator.cjs');
3
+ let react = require("react");
4
+ react = require_rolldown_runtime.__toESM(react);
5
+ let classnames = require("classnames");
6
+ classnames = require_rolldown_runtime.__toESM(classnames);
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ let framer_motion = require("framer-motion");
9
+ let react_dom = require("react-dom");
10
+
11
+ //#region src/SearchZeroState/SearchOverlay.tsx
12
+ const SearchOverlay = react.default.forwardRef(({ children, className, dataTestId, role, ariaModal, ariaLabelledby, id, usingPortal }, ref) => {
13
+ const overlayClasses = (0, classnames.default)("spiffy-search-overlay", "spiffy-tw-fixed", "spiffy-tw-top-[0]", "spiffy-tw-left-[0]", "spiffy-tw-h-[100vh]", "spiffy-tw-w-full", "spiffy-h-[calc(100%-1rem)]", "spiffy-tw-px-[24px] spiffy-tw-pt-[16px] sm:spiffy-tw-px-[41px] sm:spiffy-tw-pt-[40px]", "spiffy-tw-z-[2147483647]", "spiffy-tw-overflow-y-auto", "spiffy-tw-overflow-x-hidden", className);
14
+ const overlayContentClasses = (0, classnames.default)("spiffy-search-overlay-content", "spiffy-tw-flex spiffy-tw-flex-col", "spiffy-tw-min-h-full", className);
15
+ const node = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
16
+ ref,
17
+ className: overlayClasses,
18
+ initial: { opacity: 0 },
19
+ animate: { opacity: 1 },
20
+ exit: { opacity: 0 },
21
+ transition: { duration: .2 },
22
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
23
+ className: overlayContentClasses,
24
+ "data-testid": dataTestId,
25
+ role,
26
+ "aria-modal": ariaModal,
27
+ "aria-labelledby": ariaLabelledby,
28
+ id,
29
+ children
30
+ })
31
+ });
32
+ if (!usingPortal) return node;
33
+ try {
34
+ return (0, react_dom.createPortal)(node, require_overlayHostLocator.getOverlayPortalTarget());
35
+ } catch (err) {
36
+ return node;
37
+ }
38
+ });
39
+ SearchOverlay.displayName = "SearchOverlay";
40
+
41
+ //#endregion
42
+ exports.SearchOverlay = SearchOverlay;
@@ -0,0 +1,39 @@
1
+ import { getOverlayPortalTarget } from "./overlay/overlayHostLocator.js";
2
+ import React from "react";
3
+ import classNames from "classnames";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { motion } from "framer-motion";
6
+ import { createPortal } from "react-dom";
7
+
8
+ //#region src/SearchZeroState/SearchOverlay.tsx
9
+ const SearchOverlay = React.forwardRef(({ children, className, dataTestId, role, ariaModal, ariaLabelledby, id, usingPortal }, ref) => {
10
+ const overlayClasses = classNames("spiffy-search-overlay", "spiffy-tw-fixed", "spiffy-tw-top-[0]", "spiffy-tw-left-[0]", "spiffy-tw-h-[100vh]", "spiffy-tw-w-full", "spiffy-h-[calc(100%-1rem)]", "spiffy-tw-px-[24px] spiffy-tw-pt-[16px] sm:spiffy-tw-px-[41px] sm:spiffy-tw-pt-[40px]", "spiffy-tw-z-[2147483647]", "spiffy-tw-overflow-y-auto", "spiffy-tw-overflow-x-hidden", className);
11
+ const overlayContentClasses = classNames("spiffy-search-overlay-content", "spiffy-tw-flex spiffy-tw-flex-col", "spiffy-tw-min-h-full", className);
12
+ const node = /* @__PURE__ */ jsx(motion.div, {
13
+ ref,
14
+ className: overlayClasses,
15
+ initial: { opacity: 0 },
16
+ animate: { opacity: 1 },
17
+ exit: { opacity: 0 },
18
+ transition: { duration: .2 },
19
+ children: /* @__PURE__ */ jsx("div", {
20
+ className: overlayContentClasses,
21
+ "data-testid": dataTestId,
22
+ role,
23
+ "aria-modal": ariaModal,
24
+ "aria-labelledby": ariaLabelledby,
25
+ id,
26
+ children
27
+ })
28
+ });
29
+ if (!usingPortal) return node;
30
+ try {
31
+ return createPortal(node, getOverlayPortalTarget());
32
+ } catch (err) {
33
+ return node;
34
+ }
35
+ });
36
+ SearchOverlay.displayName = "SearchOverlay";
37
+
38
+ //#endregion
39
+ export { SearchOverlay };
@@ -0,0 +1,173 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_Typography = require('../packages/components/dist/components/Typography/Typography.cjs');
3
+ require('../packages/components/dist/components/Typography/index.cjs');
4
+ const require_SuggestionBar = require('../SuggestionBar/SuggestionBar.cjs');
5
+ require('../SuggestionBar/index.cjs');
6
+ const require_Sparkles = require('../packages/icons/dist/Sparkles.cjs');
7
+ const require_searchInputVariants = require('../packages/components/dist/components/SearchInput/searchInputVariants.cjs');
8
+ const require_SearchInput = require('../packages/components/dist/components/SearchInput/SearchInput.cjs');
9
+ const require_SearchInputForm = require('../packages/components/dist/components/SearchInputForm/SearchInputForm.cjs');
10
+ require('../packages/components/dist/components/SearchInputForm/index.cjs');
11
+ require('../packages/components/dist/components/SearchInput/index.cjs');
12
+ const require_IconCloseVariant = require('../packages/icons/dist/IconCloseVariant.cjs');
13
+ const require_SearchOverlay = require('./SearchOverlay.cjs');
14
+ const require_zeroStateSearchVariants = require('./zeroStateSearchVariants.cjs');
15
+ const require_SearchIcon = require('./SearchIcon.cjs');
16
+ const require_RecommendedProducts = require('./components/RecommendedProducts.cjs');
17
+ let react = require("react");
18
+ react = require_rolldown_runtime.__toESM(react);
19
+ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
20
+ let react_jsx_runtime = require("react/jsx-runtime");
21
+ let framer_motion = require("framer-motion");
22
+ let __envive_ai_react_hooks_hooks_Search = require("@envive-ai/react-hooks/hooks/Search");
23
+ let __envive_ai_react_hooks_hooks_AmplitudeOperations = require("@envive-ai/react-hooks/hooks/AmplitudeOperations");
24
+ let __envive_ai_react_hooks_types = require("@envive-ai/react-hooks/types");
25
+ let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
26
+
27
+ //#region src/SearchZeroState/SearchZeroState.tsx
28
+ const SEARCH_ENTRYPOINT_INPUT_TESTID = "spiffy-search-entrypoint-input";
29
+ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
30
+ console.log("SearchZeroState: widgetConfig", widgetConfig);
31
+ const { searchZeroStateVariant, searchInputVariant, searchIconVariant, searchIconSize = 24, searchBoxPlaceholder, layout, compactLabel, initialSuggestions = [], animationSpeed = "standard", suggestionButtonConfig, includeSubtitle, usingPortal = false } = widgetConfig;
32
+ const { variant: suggestionButtonVariant, hoverVariant: suggestionButtonHoverVariant, borderRadius: suggestionButtonBorderRadius } = suggestionButtonConfig;
33
+ const [isOpen, setIsOpen] = (0, react.useState)(!!initialIsOpen);
34
+ const searchInputRef = (0, react.useRef)(null);
35
+ const searchInput = (0, __envive_ai_react_hooks_hooks_Search.useSearch)({ allowRedirect: true });
36
+ const { track } = (0, __envive_ai_react_hooks_hooks_AmplitudeOperations.useAmplitudeTracking)();
37
+ const { recommendedProductsHeading, searchOverlayHeading, productCardConfig, merchantShortName, recommendedProducts, searchText, autocompleteResults, focusedIndex, focusedOptionId, shouldShowAutocomplete, onSearchInputChange, onSearchInputFocus, onSearchInputBlur, onKeyDown, onAutocompleteSelect, onSubmitSearch, resetSearch } = searchInput;
38
+ const { overlayBackgroundClasses, sparklesIconColor } = require_zeroStateSearchVariants.searchZeroStateVariantClasses[searchZeroStateVariant && require_zeroStateSearchVariants.searchZeroStateVariantClasses[searchZeroStateVariant] ? searchZeroStateVariant : "backgroundTertiary"];
39
+ const { searchInputIconColor } = require_searchInputVariants.searchInputVariantClasses[searchInputVariant];
40
+ const handleOpen = () => setIsOpen(true);
41
+ const handleClose = () => setIsOpen(false);
42
+ (0, react.useEffect)(() => {
43
+ if (isOpen) track(__envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.SearchComponentVisible, { eventProps: { search_component: __envive_ai_react_hooks_application_models.SpiffyWidgets.SearchZeroState } });
44
+ }, [isOpen, track]);
45
+ (0, react.useEffect)(() => {
46
+ if (isOpen) {
47
+ resetSearch();
48
+ searchInputRef.current?.focus();
49
+ }
50
+ }, [isOpen, resetSearch]);
51
+ const submitSearchString = (0, react.useCallback)((query) => {
52
+ onSearchInputChange(query);
53
+ if (onSubmitSearch && query.trim()) {
54
+ onSubmitSearch();
55
+ setIsOpen(false);
56
+ }
57
+ }, [onSubmitSearch, onSearchInputChange]);
58
+ const searchChange = (value) => {
59
+ onSearchInputChange(value);
60
+ };
61
+ if (!isOpen) {
62
+ if (layout === "icon") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchIcon.SearchIcon, {
63
+ entryPointRef,
64
+ size: searchIconSize,
65
+ variant: searchIconVariant,
66
+ label: compactLabel,
67
+ onClick: handleOpen,
68
+ color: searchInputIconColor
69
+ });
70
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchInput.SearchInput, {
71
+ value: "",
72
+ onChange: () => {},
73
+ placeholder: searchBoxPlaceholder,
74
+ suggestions: [],
75
+ onFocus: handleOpen,
76
+ searchInputVariant,
77
+ dataTestId: SEARCH_ENTRYPOINT_INPUT_TESTID
78
+ });
79
+ }
80
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.AnimatePresence, { children: isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_SearchOverlay.SearchOverlay, {
81
+ role: "dialog",
82
+ ariaModal: true,
83
+ ariaLabelledby: "global-search-title",
84
+ className: overlayBackgroundClasses,
85
+ usingPortal,
86
+ children: [
87
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
88
+ className: "spiffy-tw-relative spiffy-tw-mb-4",
89
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
90
+ className: "spiffy-tw-flex spiffy-tw-items-center",
91
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
92
+ id: "global-search-title",
93
+ variant: "t3",
94
+ children: searchOverlayHeading
95
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Sparkles.Sparkles_default, {
96
+ className: "spiffy-tw-ml-2 spiffy-tw-h-[36px] spiffy-tw-w-[24px] sm:spiffy-tw-h-[45px] sm:spiffy-tw-w-[36px]",
97
+ color: sparklesIconColor,
98
+ stroke: "2px"
99
+ })]
100
+ }), includeSubtitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
101
+ variant: "body2",
102
+ children: "Go ahead, get as specific as you like..."
103
+ })]
104
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
105
+ onClick: handleClose,
106
+ className: "spiffy-tw-absolute spiffy-tw-right-4 spiffy-tw-top-4 sm:spiffy-tw-right-8 sm:spiffy-tw-top-8",
107
+ "aria-label": "Close search",
108
+ type: "button",
109
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconCloseVariant.IconCloseVariant_default, {
110
+ className: "spiffy-tw-h-[20px] spiffy-tw-w-[20px] sm:spiffy-tw-h-[28px] sm:spiffy-tw-w-[28px]",
111
+ strokeWidth: "2px"
112
+ })
113
+ })] }),
114
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchInputForm.SearchInputForm, {
115
+ searchInputRef,
116
+ searchInputVariant,
117
+ searchText,
118
+ autocompleteResults,
119
+ searchBoxPlaceholder,
120
+ focusedOptionId,
121
+ shouldShowAutocomplete,
122
+ focusedIndex,
123
+ onKeyDown,
124
+ onAutocompleteSelect,
125
+ onSearchInputChange: searchChange,
126
+ onSearchSubmit: () => submitSearchString,
127
+ onSearchInputFocus,
128
+ onSearchInputBlur
129
+ }),
130
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.AnimatePresence, { children: [initialSuggestions && initialSuggestions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
131
+ className: "spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden",
132
+ initial: { opacity: 0 },
133
+ animate: { opacity: 1 },
134
+ exit: { opacity: 0 },
135
+ transition: { duration: .2 },
136
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
137
+ className: "spiffy-tw-mt-6",
138
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SuggestionBar.SuggestionBar, {
139
+ id: "global-search-suggestions",
140
+ locationForMetrics: __envive_ai_react_hooks_types.SuggestionBarLocationForMetrics.SUGGESTION_BAR_TOP,
141
+ buttonTexts: initialSuggestions,
142
+ buttonBorderRadius: suggestionButtonBorderRadius,
143
+ buttonVariation: suggestionButtonVariant ?? "primary",
144
+ hoverButtonVariation: suggestionButtonHoverVariant ?? "primary",
145
+ animationSpeed,
146
+ handleReply: (message) => {
147
+ if (message.type === __envive_ai_react_hooks_application_models.MessageType.QueryTyped && message.metadata?.content) {
148
+ track(__envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.SearchZeroStateSuggestionClicked, { eventProps: {
149
+ queryText: message.metadata.content,
150
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
151
+ } });
152
+ submitSearchString(message.metadata.content);
153
+ }
154
+ },
155
+ twoRowsOnMobile: true
156
+ })
157
+ })
158
+ }), recommendedProducts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
159
+ className: "spiffy-tw-mt-[40px]",
160
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_RecommendedProducts.RecommendedProducts, {
161
+ retrievedProducts: recommendedProducts,
162
+ merchantShortName,
163
+ productCardConfig,
164
+ productGridVariant: "standard",
165
+ heading: recommendedProductsHeading
166
+ })
167
+ })] })
168
+ ]
169
+ }) });
170
+ };
171
+
172
+ //#endregion
173
+ exports.SearchZeroState = SearchZeroState;
@@ -0,0 +1,7 @@
1
+ import { SearchZeroStateProps } from "./types.cjs";
2
+ import React from "react";
3
+
4
+ //#region src/SearchZeroState/SearchZeroState.d.ts
5
+ declare const SearchZeroState: React.FC<SearchZeroStateProps>;
6
+ //#endregion
7
+ export { SearchZeroState };
@@ -0,0 +1,7 @@
1
+ import { SearchZeroStateProps } from "./types.js";
2
+ import React from "react";
3
+
4
+ //#region src/SearchZeroState/SearchZeroState.d.ts
5
+ declare const SearchZeroState: React.FC<SearchZeroStateProps>;
6
+ //#endregion
7
+ export { SearchZeroState };
@@ -0,0 +1,171 @@
1
+ import { Typography } from "../packages/components/dist/components/Typography/Typography.js";
2
+ import "../packages/components/dist/components/Typography/index.js";
3
+ import { SuggestionBar } from "../SuggestionBar/SuggestionBar.js";
4
+ import "../SuggestionBar/index.js";
5
+ import { Sparkles_default } from "../packages/icons/dist/Sparkles.js";
6
+ import { searchInputVariantClasses } from "../packages/components/dist/components/SearchInput/searchInputVariants.js";
7
+ import { SearchInput } from "../packages/components/dist/components/SearchInput/SearchInput.js";
8
+ import { SearchInputForm } from "../packages/components/dist/components/SearchInputForm/SearchInputForm.js";
9
+ import "../packages/components/dist/components/SearchInputForm/index.js";
10
+ import "../packages/components/dist/components/SearchInput/index.js";
11
+ import { IconCloseVariant_default } from "../packages/icons/dist/IconCloseVariant.js";
12
+ import { SearchOverlay } from "./SearchOverlay.js";
13
+ import { searchZeroStateVariantClasses } from "./zeroStateSearchVariants.js";
14
+ import { SearchIcon } from "./SearchIcon.js";
15
+ import { RecommendedProducts } from "./components/RecommendedProducts.js";
16
+ import React, { useCallback, useEffect, useRef, useState } from "react";
17
+ import { MessageType, SpiffyWidgets } from "@envive-ai/react-hooks/application/models";
18
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
19
+ import { AnimatePresence, motion } from "framer-motion";
20
+ import { useSearch } from "@envive-ai/react-hooks/hooks/Search";
21
+ import { useAmplitudeTracking } from "@envive-ai/react-hooks/hooks/AmplitudeOperations";
22
+ import { SuggestionBarLocationForMetrics } from "@envive-ai/react-hooks/types";
23
+ import { SpiffyMetricsEventName } from "@envive-ai/react-hooks/contexts/amplitudeContext";
24
+
25
+ //#region src/SearchZeroState/SearchZeroState.tsx
26
+ const SEARCH_ENTRYPOINT_INPUT_TESTID = "spiffy-search-entrypoint-input";
27
+ const SearchZeroState = ({ widgetConfig, initialIsOpen, entryPointRef }) => {
28
+ console.log("SearchZeroState: widgetConfig", widgetConfig);
29
+ const { searchZeroStateVariant, searchInputVariant, searchIconVariant, searchIconSize = 24, searchBoxPlaceholder, layout, compactLabel, initialSuggestions = [], animationSpeed = "standard", suggestionButtonConfig, includeSubtitle, usingPortal = false } = widgetConfig;
30
+ const { variant: suggestionButtonVariant, hoverVariant: suggestionButtonHoverVariant, borderRadius: suggestionButtonBorderRadius } = suggestionButtonConfig;
31
+ const [isOpen, setIsOpen] = useState(!!initialIsOpen);
32
+ const searchInputRef = useRef(null);
33
+ const searchInput = useSearch({ allowRedirect: true });
34
+ const { track } = useAmplitudeTracking();
35
+ const { recommendedProductsHeading, searchOverlayHeading, productCardConfig, merchantShortName, recommendedProducts, searchText, autocompleteResults, focusedIndex, focusedOptionId, shouldShowAutocomplete, onSearchInputChange, onSearchInputFocus, onSearchInputBlur, onKeyDown, onAutocompleteSelect, onSubmitSearch, resetSearch } = searchInput;
36
+ const { overlayBackgroundClasses, sparklesIconColor } = searchZeroStateVariantClasses[searchZeroStateVariant && searchZeroStateVariantClasses[searchZeroStateVariant] ? searchZeroStateVariant : "backgroundTertiary"];
37
+ const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
38
+ const handleOpen = () => setIsOpen(true);
39
+ const handleClose = () => setIsOpen(false);
40
+ useEffect(() => {
41
+ if (isOpen) track(SpiffyMetricsEventName.SearchComponentVisible, { eventProps: { search_component: SpiffyWidgets.SearchZeroState } });
42
+ }, [isOpen, track]);
43
+ useEffect(() => {
44
+ if (isOpen) {
45
+ resetSearch();
46
+ searchInputRef.current?.focus();
47
+ }
48
+ }, [isOpen, resetSearch]);
49
+ const submitSearchString = useCallback((query) => {
50
+ onSearchInputChange(query);
51
+ if (onSubmitSearch && query.trim()) {
52
+ onSubmitSearch();
53
+ setIsOpen(false);
54
+ }
55
+ }, [onSubmitSearch, onSearchInputChange]);
56
+ const searchChange = (value) => {
57
+ onSearchInputChange(value);
58
+ };
59
+ if (!isOpen) {
60
+ if (layout === "icon") return /* @__PURE__ */ jsx(SearchIcon, {
61
+ entryPointRef,
62
+ size: searchIconSize,
63
+ variant: searchIconVariant,
64
+ label: compactLabel,
65
+ onClick: handleOpen,
66
+ color: searchInputIconColor
67
+ });
68
+ return /* @__PURE__ */ jsx(SearchInput, {
69
+ value: "",
70
+ onChange: () => {},
71
+ placeholder: searchBoxPlaceholder,
72
+ suggestions: [],
73
+ onFocus: handleOpen,
74
+ searchInputVariant,
75
+ dataTestId: SEARCH_ENTRYPOINT_INPUT_TESTID
76
+ });
77
+ }
78
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(SearchOverlay, {
79
+ role: "dialog",
80
+ ariaModal: true,
81
+ ariaLabelledby: "global-search-title",
82
+ className: overlayBackgroundClasses,
83
+ usingPortal,
84
+ children: [
85
+ /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
86
+ className: "spiffy-tw-relative spiffy-tw-mb-4",
87
+ children: [/* @__PURE__ */ jsxs("div", {
88
+ className: "spiffy-tw-flex spiffy-tw-items-center",
89
+ children: [/* @__PURE__ */ jsx(Typography, {
90
+ id: "global-search-title",
91
+ variant: "t3",
92
+ children: searchOverlayHeading
93
+ }), /* @__PURE__ */ jsx(Sparkles_default, {
94
+ className: "spiffy-tw-ml-2 spiffy-tw-h-[36px] spiffy-tw-w-[24px] sm:spiffy-tw-h-[45px] sm:spiffy-tw-w-[36px]",
95
+ color: sparklesIconColor,
96
+ stroke: "2px"
97
+ })]
98
+ }), includeSubtitle && /* @__PURE__ */ jsx(Typography, {
99
+ variant: "body2",
100
+ children: "Go ahead, get as specific as you like..."
101
+ })]
102
+ }), /* @__PURE__ */ jsx("button", {
103
+ onClick: handleClose,
104
+ className: "spiffy-tw-absolute spiffy-tw-right-4 spiffy-tw-top-4 sm:spiffy-tw-right-8 sm:spiffy-tw-top-8",
105
+ "aria-label": "Close search",
106
+ type: "button",
107
+ children: /* @__PURE__ */ jsx(IconCloseVariant_default, {
108
+ className: "spiffy-tw-h-[20px] spiffy-tw-w-[20px] sm:spiffy-tw-h-[28px] sm:spiffy-tw-w-[28px]",
109
+ strokeWidth: "2px"
110
+ })
111
+ })] }),
112
+ /* @__PURE__ */ jsx(SearchInputForm, {
113
+ searchInputRef,
114
+ searchInputVariant,
115
+ searchText,
116
+ autocompleteResults,
117
+ searchBoxPlaceholder,
118
+ focusedOptionId,
119
+ shouldShowAutocomplete,
120
+ focusedIndex,
121
+ onKeyDown,
122
+ onAutocompleteSelect,
123
+ onSearchInputChange: searchChange,
124
+ onSearchSubmit: () => submitSearchString,
125
+ onSearchInputFocus,
126
+ onSearchInputBlur
127
+ }),
128
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [initialSuggestions && initialSuggestions.length > 0 && /* @__PURE__ */ jsx(motion.div, {
129
+ className: "spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden",
130
+ initial: { opacity: 0 },
131
+ animate: { opacity: 1 },
132
+ exit: { opacity: 0 },
133
+ transition: { duration: .2 },
134
+ children: /* @__PURE__ */ jsx("div", {
135
+ className: "spiffy-tw-mt-6",
136
+ children: /* @__PURE__ */ jsx(SuggestionBar, {
137
+ id: "global-search-suggestions",
138
+ locationForMetrics: SuggestionBarLocationForMetrics.SUGGESTION_BAR_TOP,
139
+ buttonTexts: initialSuggestions,
140
+ buttonBorderRadius: suggestionButtonBorderRadius,
141
+ buttonVariation: suggestionButtonVariant ?? "primary",
142
+ hoverButtonVariation: suggestionButtonHoverVariant ?? "primary",
143
+ animationSpeed,
144
+ handleReply: (message) => {
145
+ if (message.type === MessageType.QueryTyped && message.metadata?.content) {
146
+ track(SpiffyMetricsEventName.SearchZeroStateSuggestionClicked, { eventProps: {
147
+ queryText: message.metadata.content,
148
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
149
+ } });
150
+ submitSearchString(message.metadata.content);
151
+ }
152
+ },
153
+ twoRowsOnMobile: true
154
+ })
155
+ })
156
+ }), recommendedProducts.length > 0 && /* @__PURE__ */ jsx("div", {
157
+ className: "spiffy-tw-mt-[40px]",
158
+ children: /* @__PURE__ */ jsx(RecommendedProducts, {
159
+ retrievedProducts: recommendedProducts,
160
+ merchantShortName,
161
+ productCardConfig,
162
+ productGridVariant: "standard",
163
+ heading: recommendedProductsHeading
164
+ })
165
+ })] })
166
+ ]
167
+ }) });
168
+ };
169
+
170
+ //#endregion
171
+ export { SearchZeroState };
@@ -0,0 +1,23 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ const require_SearchZeroState = require('./SearchZeroState.cjs');
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let __envive_ai_react_hooks_hooks_NewOrgConfig = require("@envive-ai/react-hooks/hooks/NewOrgConfig");
6
+
7
+ //#region src/SearchZeroState/SearchZeroStateWidget.tsx
8
+ const SearchZeroStateWidget = ({ initialIsOpen, widgetConfigId = "searchEntryPointIcon", entryPointRef }) => {
9
+ const newConfig = (0, __envive_ai_react_hooks_hooks_NewOrgConfig.useNewOrgConfig)();
10
+ const widgetConfig = (0, react.useMemo)(() => {
11
+ if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === widgetConfigId).config };
12
+ return null;
13
+ }, [newConfig, widgetConfigId]);
14
+ if (!widgetConfig) return null;
15
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchZeroState.SearchZeroState, {
16
+ widgetConfig,
17
+ initialIsOpen,
18
+ entryPointRef
19
+ });
20
+ };
21
+
22
+ //#endregion
23
+ exports.SearchZeroStateWidget = SearchZeroStateWidget;
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/SearchZeroState/SearchZeroStateWidget.d.ts
4
+ type SearchZeroStateWidgetProps = {
5
+ initialIsOpen: boolean;
6
+ widgetConfigId?: string;
7
+ entryPointRef: React.Ref<HTMLButtonElement>;
8
+ };
9
+ declare const SearchZeroStateWidget: ({
10
+ initialIsOpen,
11
+ widgetConfigId,
12
+ entryPointRef
13
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime0.JSX.Element;
14
+ //#endregion
15
+ export { SearchZeroStateWidget };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/SearchZeroState/SearchZeroStateWidget.d.ts
4
+ type SearchZeroStateWidgetProps = {
5
+ initialIsOpen: boolean;
6
+ widgetConfigId?: string;
7
+ entryPointRef: React.Ref<HTMLButtonElement>;
8
+ };
9
+ declare const SearchZeroStateWidget: ({
10
+ initialIsOpen,
11
+ widgetConfigId,
12
+ entryPointRef
13
+ }: SearchZeroStateWidgetProps) => react_jsx_runtime0.JSX.Element;
14
+ //#endregion
15
+ export { SearchZeroStateWidget };
@@ -0,0 +1,22 @@
1
+ import { SearchZeroState } from "./SearchZeroState.js";
2
+ import { useMemo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { useNewOrgConfig } from "@envive-ai/react-hooks/hooks/NewOrgConfig";
5
+
6
+ //#region src/SearchZeroState/SearchZeroStateWidget.tsx
7
+ const SearchZeroStateWidget = ({ initialIsOpen, widgetConfigId = "searchEntryPointIcon", entryPointRef }) => {
8
+ const newConfig = useNewOrgConfig();
9
+ const widgetConfig = useMemo(() => {
10
+ if (newConfig && newConfig.frontendConfig?.widgetConfigs) return { ...(newConfig.frontendConfig?.widgetConfigs).find((widget) => widget.key === widgetConfigId).config };
11
+ return null;
12
+ }, [newConfig, widgetConfigId]);
13
+ if (!widgetConfig) return null;
14
+ return /* @__PURE__ */ jsx(SearchZeroState, {
15
+ widgetConfig,
16
+ initialIsOpen,
17
+ entryPointRef
18
+ });
19
+ };
20
+
21
+ //#endregion
22
+ export { SearchZeroStateWidget };
@@ -0,0 +1,74 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_Typography = require('../../packages/components/dist/components/Typography/Typography.cjs');
3
+ require('../../packages/components/dist/components/Typography/index.cjs');
4
+ const require_ProductGrid = require('../../packages/components/dist/components/ProductGrid/ProductGrid.cjs');
5
+ require('../../packages/components/dist/components/ProductGrid/index.cjs');
6
+ let __envive_ai_react_hooks_application_models = require("@envive-ai/react-hooks/application/models");
7
+ let classnames = require("classnames");
8
+ classnames = require_rolldown_runtime.__toESM(classnames);
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ let framer_motion = require("framer-motion");
11
+ let __envive_ai_react_hooks_hooks_AmplitudeOperations = require("@envive-ai/react-hooks/hooks/AmplitudeOperations");
12
+ let __envive_ai_react_hooks_contexts_amplitudeContext = require("@envive-ai/react-hooks/contexts/amplitudeContext");
13
+
14
+ //#region src/SearchZeroState/components/RecommendedProducts.tsx
15
+ const RecommendedProducts = ({ retrievedProducts, merchantShortName, productCardConfig = {
16
+ variant: "minimal",
17
+ hoverVariant: "none",
18
+ layoutVariant: "square"
19
+ }, productGridVariant = "square", heading }) => {
20
+ const { track } = (0, __envive_ai_react_hooks_hooks_AmplitudeOperations.useAmplitudeTracking)();
21
+ const containerClasses = (0, classnames.default)("spiffy-tw-justify-center", "spiffy-tw-overflow-hidden", "spiffy-tw-bg-white", "spiffy-tw-relative", "spiffy-tw-px-[24px]", "spiffy-tw-py-[16px]", "sm:spiffy-tw-px-[41px]", "sm:spiffy-tw-py-[40px]");
22
+ const titleContainerClasses = (0, classnames.default)("spiffy-tw-w-full", "spiffy-tw-border-b", "spiffy-tw-border-solid", "spiffy-tw-border-b-[--spiffy-colors-text-accent]", "spiffy-tw-pb-[8px]", "spiffy-tw-mb-[16px]");
23
+ const productGridClasses = (0, classnames.default)("spiffy-tw-grid", "spiffy-tw-justify-items-stretch", "spiffy-tw-grid-cols-2", "md:spiffy-tw-grid-cols-3", "lg:spiffy-tw-grid-cols-4", "spiffy-tw-gap-x-[4px]", "spiffy-tw-gap-y-[24px]", "spiffy-tw-h-full", "spiffy-tw-w-full", "spiffy-tw-items-stretch");
24
+ if (retrievedProducts == null || retrievedProducts.length === 0) return null;
25
+ const handleProductClick = (product, index) => {
26
+ track(__envive_ai_react_hooks_contexts_amplitudeContext.SpiffyMetricsEventName.ProductCardClicked, {
27
+ eventProps: {
28
+ url: product.url,
29
+ search_response_id: void 0,
30
+ product_response_id: product.response_id,
31
+ trigger_location: __envive_ai_react_hooks_application_models.ChatElementDisplayLocation.SEARCH_ZERO_STATE_SUGGESTED_PRODUCTS,
32
+ click_position: index != null ? index + 1 : null,
33
+ title: product.title,
34
+ original_price: product.original_price,
35
+ sale_price: product.sale_price,
36
+ average_rating: product.average_rating,
37
+ number_reviews: product.number_reviews
38
+ },
39
+ alsoSendToGoogleAnalytics: true
40
+ });
41
+ };
42
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(framer_motion.motion.div, {
43
+ className: containerClasses,
44
+ initial: { opacity: 0 },
45
+ animate: { opacity: 1 },
46
+ exit: { opacity: 0 },
47
+ transition: { duration: .2 },
48
+ style: {
49
+ left: "50%",
50
+ right: "50%",
51
+ marginLeft: "-50vw",
52
+ marginRight: "-50vw",
53
+ width: "100vw"
54
+ },
55
+ children: [heading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
56
+ className: titleContainerClasses,
57
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.Typography, {
58
+ variant: "h1",
59
+ className: "spiffy-tw-text-[--spiffy-colors-text-accent]",
60
+ children: heading
61
+ })
62
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ProductGrid.ProductGrid, {
63
+ productList: retrievedProducts,
64
+ productGridVariant,
65
+ productGridClasses,
66
+ productCardConfig,
67
+ merchantShortName,
68
+ onProductClick: handleProductClick
69
+ })]
70
+ });
71
+ };
72
+
73
+ //#endregion
74
+ exports.RecommendedProducts = RecommendedProducts;