@envive-ai/react-toolkit 0.1.0 → 0.1.2

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 (404) hide show
  1. package/LICENSE +2 -0
  2. package/dist/AppliedFiltersScrollbar-BlcyhZkZ.cjs +53 -0
  3. package/dist/AppliedFiltersScrollbar-DFGzRemu.js +44 -0
  4. package/dist/ButtonBase-C1rsL9gO.js +60 -0
  5. package/dist/ButtonBase-a8uj6c2f.cjs +69 -0
  6. package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +41 -0
  7. package/dist/DynamicFiltersScrollbar-Dys6geP0.js +32 -0
  8. package/dist/Headline-L7w3BsBF.cjs +72 -0
  9. package/dist/Headline-ro_Nigw5.js +64 -0
  10. package/dist/ImageWithFallback-CfmkC58B.js +42 -0
  11. package/dist/ImageWithFallback-P3AjyL2Y.cjs +51 -0
  12. package/dist/ProductCard-Btg8tHGc.js +172 -0
  13. package/dist/ProductCard-CS6DZAwO.cjs +193 -0
  14. package/dist/ProductCardSkeleton-BPfp6IOp.js +38 -0
  15. package/dist/ProductCardSkeleton-BgvDlaty.cjs +46 -0
  16. package/dist/ProductGrid-B7QZfW-v.cjs +77 -0
  17. package/dist/ProductGrid-DB_Uq5F-.js +69 -0
  18. package/dist/SearchAutocomplete-C5FL82xC.js +51 -0
  19. package/dist/SearchAutocomplete-wr18dJ8L.cjs +62 -0
  20. package/dist/SearchFilter-D-2IdBKS.js +62 -0
  21. package/dist/SearchFilter-D0IzBlG5.cjs +70 -0
  22. package/dist/SearchFilterHeader-BQT0-ssS.js +37 -0
  23. package/dist/SearchFilterHeader-C3EklfoO.cjs +45 -0
  24. package/dist/SearchFilterItem-BodtWLoP.js +26 -0
  25. package/dist/SearchFilterItem-DmMkiqNC.cjs +34 -0
  26. package/dist/SearchInput-BrcAgcvI.js +89 -0
  27. package/dist/SearchInput-DSB9CwIq.cjs +106 -0
  28. package/dist/SparkleAnimation-BpLwrEqM.cjs +96 -0
  29. package/dist/SparkleAnimation-CXs58sFd.js +85 -0
  30. package/dist/Spinner-BZ-kTOpm.js +38 -0
  31. package/dist/Spinner-CfQ85Ajl.cjs +46 -0
  32. package/dist/Text-Bdv7F5-u.js +42 -0
  33. package/dist/Text-C04c4Z93.cjs +50 -0
  34. package/dist/TextInput-BO80ixsV.cjs +40 -0
  35. package/dist/TextInput-CEGWfdPC.js +31 -0
  36. package/dist/chunk-CUT6urMc.cjs +30 -0
  37. package/dist/colorsConfig-TCONYTQ7.cjs +38 -0
  38. package/dist/colorsConfig-l0ODUVhu.js +26 -0
  39. package/dist/common/ButtonBase/ButtonBase.cjs +5 -0
  40. package/dist/common/ButtonBase/ButtonBase.d.cts +35 -0
  41. package/dist/common/ButtonBase/ButtonBase.d.ts +35 -0
  42. package/dist/common/ButtonBase/ButtonBase.js +5 -0
  43. package/dist/common/Headline/Headline.cjs +4 -0
  44. package/dist/common/Headline/Headline.d.cts +21 -0
  45. package/dist/common/Headline/Headline.d.ts +21 -0
  46. package/dist/common/Headline/Headline.js +4 -0
  47. package/dist/common/ImageWithFallback/ImageWithFallback.cjs +3 -0
  48. package/dist/common/ImageWithFallback/ImageWithFallback.d.cts +26 -0
  49. package/dist/common/ImageWithFallback/ImageWithFallback.d.ts +26 -0
  50. package/dist/common/ImageWithFallback/ImageWithFallback.js +3 -0
  51. package/dist/common/ProductCard/ProductCard.cjs +11 -0
  52. package/dist/common/ProductCard/ProductCard.d.cts +91 -0
  53. package/dist/common/ProductCard/ProductCard.d.ts +91 -0
  54. package/dist/common/ProductCard/ProductCard.js +9 -0
  55. package/dist/common/ProductCard/ProductCardSkeleton.cjs +4 -0
  56. package/dist/common/ProductCard/ProductCardSkeleton.d.cts +12 -0
  57. package/dist/common/ProductCard/ProductCardSkeleton.d.ts +12 -0
  58. package/dist/common/ProductCard/ProductCardSkeleton.js +4 -0
  59. package/dist/common/ProductGrid/ProductGrid.cjs +11 -0
  60. package/dist/common/ProductGrid/ProductGrid.d.cts +26 -0
  61. package/dist/common/ProductGrid/ProductGrid.d.ts +26 -0
  62. package/dist/common/ProductGrid/ProductGrid.js +11 -0
  63. package/dist/common/SparkleAnimation/SparkleAnimation.cjs +3 -0
  64. package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +15 -0
  65. package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +15 -0
  66. package/dist/common/SparkleAnimation/SparkleAnimation.js +3 -0
  67. package/dist/common/Spinner/Spinner.cjs +3 -0
  68. package/dist/common/Spinner/Spinner.d.cts +11 -0
  69. package/dist/common/Spinner/Spinner.d.ts +11 -0
  70. package/dist/common/Spinner/Spinner.js +3 -0
  71. package/dist/common/SuggestionButton/SuggestionButton.cjs +188 -0
  72. package/dist/common/SuggestionButton/SuggestionButton.d.cts +35 -0
  73. package/dist/common/SuggestionButton/SuggestionButton.d.ts +35 -0
  74. package/dist/common/SuggestionButton/SuggestionButton.js +180 -0
  75. package/dist/common/Text/Text.cjs +4 -0
  76. package/dist/common/Text/Text.d.cts +28 -0
  77. package/dist/common/Text/Text.d.ts +28 -0
  78. package/dist/common/Text/Text.js +4 -0
  79. package/dist/common/TextInput/TextInput.cjs +4 -0
  80. package/dist/common/TextInput/TextInput.d.cts +98 -0
  81. package/dist/common/TextInput/TextInput.d.ts +98 -0
  82. package/dist/common/TextInput/TextInput.js +4 -0
  83. package/dist/productCardVariants-C_QIZ-KF.js +45 -0
  84. package/dist/productCardVariants-Dd-wrJKP.cjs +69 -0
  85. package/dist/productGridVariants-CxCKx5Fq.js +20 -0
  86. package/dist/productGridVariants-DVzvjK9i.cjs +26 -0
  87. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +5 -0
  88. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +22 -0
  89. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
  90. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +5 -0
  91. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +5 -0
  92. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
  93. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
  94. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +5 -0
  95. package/dist/search/SearchFilter/SearchFilter.cjs +7 -0
  96. package/dist/search/SearchFilter/SearchFilter.d.cts +18 -0
  97. package/dist/search/SearchFilter/SearchFilter.d.ts +18 -0
  98. package/dist/search/SearchFilter/SearchFilter.js +7 -0
  99. package/dist/search/SearchFilter/SearchFilterHeader.cjs +5 -0
  100. package/dist/search/SearchFilter/SearchFilterHeader.d.cts +12 -0
  101. package/dist/search/SearchFilter/SearchFilterHeader.d.ts +12 -0
  102. package/dist/search/SearchFilter/SearchFilterHeader.js +5 -0
  103. package/dist/search/SearchFilter/SearchFilterItem.cjs +5 -0
  104. package/dist/search/SearchFilter/SearchFilterItem.d.cts +13 -0
  105. package/dist/search/SearchFilter/SearchFilterItem.d.ts +13 -0
  106. package/dist/search/SearchFilter/SearchFilterItem.js +5 -0
  107. package/dist/search/SearchInput/SearchInput.cjs +6 -0
  108. package/dist/search/SearchInput/SearchInput.d.cts +20 -0
  109. package/dist/search/SearchInput/SearchInput.d.ts +20 -0
  110. package/dist/search/SearchInput/SearchInput.js +6 -0
  111. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +3 -0
  112. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.cts +13 -0
  113. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +13 -0
  114. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +3 -0
  115. package/dist/search/SearchInputForm/SearchInputForm.cjs +38 -0
  116. package/dist/search/SearchInputForm/SearchInputForm.d.cts +32 -0
  117. package/dist/search/SearchInputForm/SearchInputForm.d.ts +32 -0
  118. package/dist/search/SearchInputForm/SearchInputForm.js +36 -0
  119. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs +52 -0
  120. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +28 -0
  121. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +28 -0
  122. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js +49 -0
  123. package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +30 -0
  124. package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +17 -0
  125. package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +17 -0
  126. package/dist/search/SearchResultsStates/NoSearchResultsFound.js +26 -0
  127. package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +66 -0
  128. package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +41 -0
  129. package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +41 -0
  130. package/dist/search/SearchResultsStates/SearchResultsGrid.js +62 -0
  131. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
  132. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
  133. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
  134. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +49 -0
  135. package/dist/searchFilterSidebarVariants-GfFbQzGf.cjs +39 -0
  136. package/dist/searchFilterSidebarVariants-lJVVZT_2.js +34 -0
  137. package/dist/textVariantClasses-5t3OricK.js +101 -0
  138. package/dist/textVariantClasses-Bhf4VY5z.cjs +125 -0
  139. package/dist/types-53zIialA.d.ts +35 -0
  140. package/dist/types-B4BGZSlV.d.cts +4 -0
  141. package/dist/types-BQNqA5xL.d.ts +46 -0
  142. package/dist/types-BRLWwGMI.d.ts +4 -0
  143. package/dist/types-CImLkcNh.d.cts +46 -0
  144. package/dist/types-Cph97xkm.d.ts +6 -0
  145. package/dist/types-CpiJO5UH.d.ts +4 -0
  146. package/dist/types-DFetqNL2.d.ts +8 -0
  147. package/dist/types-DaSkJnT_.d.cts +8 -0
  148. package/dist/types-Dy4_w6Cf.d.cts +4 -0
  149. package/dist/types-TYhhwWZw.d.cts +6 -0
  150. package/dist/types-aa4flfRE.d.cts +35 -0
  151. package/package.json +8 -5
  152. package/src/atoms/search/types.ts +5 -0
  153. package/src/components/common/ButtonBase/ButtonBase.tsx +70 -0
  154. package/src/components/common/ButtonBase/types.ts +26 -0
  155. package/src/components/common/Headline/Headline.tsx +81 -0
  156. package/src/components/common/ImageWithFallback/ImageWithFallback.tsx +66 -0
  157. package/src/components/common/ProductCard/ProductCard.tsx +305 -0
  158. package/src/components/common/ProductCard/ProductCardSkeleton.tsx +83 -0
  159. package/src/components/common/ProductCard/productCardVariants.ts +63 -0
  160. package/src/components/common/ProductCard/types.ts +49 -0
  161. package/src/components/common/ProductGrid/ProductGrid.tsx +73 -0
  162. package/src/components/common/ProductGrid/productGridVariants.ts +31 -0
  163. package/src/components/common/SparkleAnimation/SparkleAnimation.tsx +105 -0
  164. package/src/components/common/SparkleAnimation/types.ts +6 -0
  165. package/src/components/common/Spinner/Spinner.tsx +30 -0
  166. package/src/components/common/SuggestionButton/SuggestionButton.tsx +258 -0
  167. package/src/components/common/SuggestionButton/types.ts +14 -0
  168. package/src/components/common/Text/Text.tsx +58 -0
  169. package/src/components/common/Text/textVariantClasses.ts +106 -0
  170. package/src/components/common/Text/types.ts +23 -0
  171. package/src/components/common/TextInput/TextInput.tsx +34 -0
  172. package/src/components/models/colorsConfig.ts +28 -0
  173. package/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.tsx +70 -0
  174. package/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.tsx +52 -0
  175. package/src/components/search/SearchFilter/SearchFilter.tsx +84 -0
  176. package/src/components/search/SearchFilter/SearchFilterHeader.tsx +42 -0
  177. package/src/components/search/SearchFilter/SearchFilterItem.tsx +42 -0
  178. package/src/components/search/SearchFilter/types.ts +48 -0
  179. package/src/components/search/SearchInput/SearchInput.tsx +135 -0
  180. package/src/components/search/SearchInput/searchInputVariants.ts +27 -0
  181. package/src/components/search/SearchInputAutocomplete/SearchAutocomplete.tsx +62 -0
  182. package/src/components/search/SearchInputForm/SearchInputForm.tsx +66 -0
  183. package/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.tsx +82 -0
  184. package/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +45 -0
  185. package/{dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.d.ts → src/components/search/SearchResultsFilterSidebar/types.ts} +1 -1
  186. package/src/components/search/SearchResultsStates/NoSearchResultsFound.tsx +41 -0
  187. package/src/components/search/SearchResultsStates/SearchResultsGrid.tsx +105 -0
  188. package/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.tsx +50 -0
  189. package/src/components/search/types.ts +5 -0
  190. package/{dist/packages/components/src/components/test/types.d.ts → src/components/test/types.ts} +1 -1
  191. package/src/config/chatElementDisplayLocation.ts +22 -0
  192. package/src/logging/logger.ts +21 -0
  193. package/src/types/external.ts +24 -0
  194. package/{dist/packages/components/src/util/camelCase.d.ts → src/util/camelCase.ts} +33 -11
  195. package/src/util/camelCasedPropertiesDeep.ts +81 -0
  196. package/src/util/formatPrice.ts +14 -0
  197. package/src/util/internal.ts +95 -0
  198. package/{dist/src/util/primitive.d.ts → src/util/primitive.ts} +2 -0
  199. package/src/util/splitWords.ts +72 -0
  200. package/{dist/src/util/trim.d.ts → src/util/trim.ts} +5 -1
  201. package/dist/packages/components/src/atoms/search/types.d.ts +0 -5
  202. package/dist/packages/components/src/atoms/search/types.js +0 -1
  203. package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
  204. package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.js +0 -41
  205. package/dist/packages/components/src/components/common/ButtonBase/types.d.ts +0 -24
  206. package/dist/packages/components/src/components/common/ButtonBase/types.js +0 -6
  207. package/dist/packages/components/src/components/common/Headline/Headline.d.ts +0 -10
  208. package/dist/packages/components/src/components/common/Headline/Headline.js +0 -34
  209. package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
  210. package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
  211. package/dist/packages/components/src/components/common/ProductCard/ProductCard.d.ts +0 -39
  212. package/dist/packages/components/src/components/common/ProductCard/ProductCard.js +0 -83
  213. package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
  214. package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
  215. package/dist/packages/components/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
  216. package/dist/packages/components/src/components/common/ProductCard/productCardVariants.js +0 -50
  217. package/dist/packages/components/src/components/common/ProductCard/types.d.ts +0 -39
  218. package/dist/packages/components/src/components/common/ProductCard/types.js +0 -10
  219. package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
  220. package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.js +0 -13
  221. package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
  222. package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.js +0 -16
  223. package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
  224. package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
  225. package/dist/packages/components/src/components/common/SparkleAnimation/types.d.ts +0 -6
  226. package/dist/packages/components/src/components/common/SparkleAnimation/types.js +0 -7
  227. package/dist/packages/components/src/components/common/Spinner/Spinner.d.ts +0 -5
  228. package/dist/packages/components/src/components/common/Spinner/Spinner.js +0 -16
  229. package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
  230. package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
  231. package/dist/packages/components/src/components/common/SuggestionButton/types.d.ts +0 -1
  232. package/dist/packages/components/src/components/common/SuggestionButton/types.js +0 -1
  233. package/dist/packages/components/src/components/common/Text/Text.d.ts +0 -12
  234. package/dist/packages/components/src/components/common/Text/Text.js +0 -26
  235. package/dist/packages/components/src/components/common/Text/textVariantClasses.d.ts +0 -171
  236. package/dist/packages/components/src/components/common/Text/textVariantClasses.js +0 -103
  237. package/dist/packages/components/src/components/common/Text/types.d.ts +0 -16
  238. package/dist/packages/components/src/components/common/Text/types.js +0 -6
  239. package/dist/packages/components/src/components/common/TextInput/TextInput.d.ts +0 -8
  240. package/dist/packages/components/src/components/common/TextInput/TextInput.js +0 -25
  241. package/dist/packages/components/src/components/models/colorsConfig.d.ts +0 -26
  242. package/dist/packages/components/src/components/models/colorsConfig.js +0 -23
  243. package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
  244. package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
  245. package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
  246. package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
  247. package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
  248. package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.js +0 -24
  249. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
  250. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
  251. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
  252. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
  253. package/dist/packages/components/src/components/search/SearchFilter/types.d.ts +0 -42
  254. package/dist/packages/components/src/components/search/SearchFilter/types.js +0 -1
  255. package/dist/packages/components/src/components/search/SearchInput/SearchInput.d.ts +0 -16
  256. package/dist/packages/components/src/components/search/SearchInput/SearchInput.js +0 -38
  257. package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
  258. package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.js +0 -12
  259. package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
  260. package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
  261. package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
  262. package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
  263. package/dist/packages/components/src/components/search/SearchInputForm/types.js +0 -1
  264. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
  265. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
  266. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
  267. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
  268. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
  269. package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
  270. package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
  271. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
  272. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
  273. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
  274. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
  275. package/dist/packages/components/src/components/search/types.d.ts +0 -5
  276. package/dist/packages/components/src/components/search/types.js +0 -6
  277. package/dist/packages/components/src/components/test/types.js +0 -1
  278. package/dist/packages/components/src/config/chatElementDisplayLocation.d.ts +0 -21
  279. package/dist/packages/components/src/config/chatElementDisplayLocation.js +0 -23
  280. package/dist/packages/components/src/index.d.ts +0 -45
  281. package/dist/packages/components/src/index.js +0 -49
  282. package/dist/packages/components/src/logging/logger.d.ts +0 -7
  283. package/dist/packages/components/src/logging/logger.js +0 -16
  284. package/dist/packages/components/src/types/external.d.ts +0 -21
  285. package/dist/packages/components/src/types/external.js +0 -5
  286. package/dist/packages/components/src/util/camelCase.js +0 -2
  287. package/dist/packages/components/src/util/camelCasedPropertiesDeep.d.ts +0 -53
  288. package/dist/packages/components/src/util/camelCasedPropertiesDeep.js +0 -1
  289. package/dist/packages/components/src/util/formatPrice.d.ts +0 -1
  290. package/dist/packages/components/src/util/formatPrice.js +0 -11
  291. package/dist/packages/components/src/util/internal.d.ts +0 -27
  292. package/dist/packages/components/src/util/internal.js +0 -4
  293. package/dist/packages/components/src/util/primitive.d.ts +0 -6
  294. package/dist/packages/components/src/util/primitive.js +0 -2
  295. package/dist/packages/components/src/util/splitWords.d.ts +0 -55
  296. package/dist/packages/components/src/util/splitWords.js +0 -2
  297. package/dist/packages/components/src/util/trim.d.ts +0 -24
  298. package/dist/packages/components/src/util/trim.js +0 -2
  299. package/dist/packages/components/src/util/unknownArray.js +0 -1
  300. package/dist/src/atoms/search/types.d.ts +0 -5
  301. package/dist/src/atoms/search/types.js +0 -1
  302. package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
  303. package/dist/src/components/common/ButtonBase/ButtonBase.js +0 -41
  304. package/dist/src/components/common/ButtonBase/types.d.ts +0 -24
  305. package/dist/src/components/common/ButtonBase/types.js +0 -6
  306. package/dist/src/components/common/Headline/Headline.d.ts +0 -10
  307. package/dist/src/components/common/Headline/Headline.js +0 -34
  308. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
  309. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
  310. package/dist/src/components/common/ProductCard/ProductCard.d.ts +0 -39
  311. package/dist/src/components/common/ProductCard/ProductCard.js +0 -84
  312. package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
  313. package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
  314. package/dist/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
  315. package/dist/src/components/common/ProductCard/productCardVariants.js +0 -50
  316. package/dist/src/components/common/ProductCard/types.d.ts +0 -39
  317. package/dist/src/components/common/ProductCard/types.js +0 -10
  318. package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
  319. package/dist/src/components/common/ProductGrid/ProductGrid.js +0 -13
  320. package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
  321. package/dist/src/components/common/ProductGrid/productGridVariants.js +0 -16
  322. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
  323. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
  324. package/dist/src/components/common/SparkleAnimation/types.d.ts +0 -6
  325. package/dist/src/components/common/SparkleAnimation/types.js +0 -7
  326. package/dist/src/components/common/Spinner/Spinner.d.ts +0 -5
  327. package/dist/src/components/common/Spinner/Spinner.js +0 -16
  328. package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
  329. package/dist/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
  330. package/dist/src/components/common/SuggestionButton/types.d.ts +0 -1
  331. package/dist/src/components/common/SuggestionButton/types.js +0 -1
  332. package/dist/src/components/common/Text/Text.d.ts +0 -12
  333. package/dist/src/components/common/Text/Text.js +0 -26
  334. package/dist/src/components/common/Text/textVariantClasses.d.ts +0 -171
  335. package/dist/src/components/common/Text/textVariantClasses.js +0 -103
  336. package/dist/src/components/common/Text/types.d.ts +0 -16
  337. package/dist/src/components/common/Text/types.js +0 -6
  338. package/dist/src/components/common/TextInput/TextInput.d.ts +0 -8
  339. package/dist/src/components/common/TextInput/TextInput.js +0 -25
  340. package/dist/src/components/models/colorsConfig.d.ts +0 -26
  341. package/dist/src/components/models/colorsConfig.js +0 -23
  342. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
  343. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
  344. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
  345. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
  346. package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
  347. package/dist/src/components/search/SearchFilter/SearchFilter.js +0 -24
  348. package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
  349. package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
  350. package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
  351. package/dist/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
  352. package/dist/src/components/search/SearchFilter/types.d.ts +0 -42
  353. package/dist/src/components/search/SearchFilter/types.js +0 -1
  354. package/dist/src/components/search/SearchInput/SearchInput.d.ts +0 -16
  355. package/dist/src/components/search/SearchInput/SearchInput.js +0 -38
  356. package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
  357. package/dist/src/components/search/SearchInput/searchInputVariants.js +0 -12
  358. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
  359. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
  360. package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
  361. package/dist/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
  362. package/dist/src/components/search/SearchInputForm/types.d.ts +0 -1
  363. package/dist/src/components/search/SearchInputForm/types.js +0 -1
  364. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
  365. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
  366. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
  367. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
  368. package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +0 -2
  369. package/dist/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
  370. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
  371. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
  372. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
  373. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
  374. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
  375. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
  376. package/dist/src/components/search/types.d.ts +0 -5
  377. package/dist/src/components/search/types.js +0 -6
  378. package/dist/src/components/test/types.d.ts +0 -3
  379. package/dist/src/components/test/types.js +0 -1
  380. package/dist/src/config/chatElementDisplayLocation.d.ts +0 -21
  381. package/dist/src/config/chatElementDisplayLocation.js +0 -23
  382. package/dist/src/index.d.ts +0 -45
  383. package/dist/src/index.js +0 -49
  384. package/dist/src/logging/logger.d.ts +0 -7
  385. package/dist/src/logging/logger.js +0 -16
  386. package/dist/src/types/external.d.ts +0 -21
  387. package/dist/src/types/external.js +0 -5
  388. package/dist/src/util/camelCase.d.ts +0 -65
  389. package/dist/src/util/camelCase.js +0 -2
  390. package/dist/src/util/camelCasedPropertiesDeep.d.ts +0 -53
  391. package/dist/src/util/camelCasedPropertiesDeep.js +0 -1
  392. package/dist/src/util/formatPrice.d.ts +0 -1
  393. package/dist/src/util/formatPrice.js +0 -11
  394. package/dist/src/util/internal.d.ts +0 -27
  395. package/dist/src/util/internal.js +0 -4
  396. package/dist/src/util/primitive.js +0 -2
  397. package/dist/src/util/splitWords.d.ts +0 -55
  398. package/dist/src/util/splitWords.js +0 -2
  399. package/dist/src/util/trim.js +0 -2
  400. package/dist/src/util/unknownArray.d.ts +0 -25
  401. package/dist/src/util/unknownArray.js +0 -1
  402. package/dist/tsconfig.tsbuildinfo +0 -1
  403. /package/{dist/packages/components/src/components/search/SearchInputForm/types.d.ts → src/components/search/SearchInputForm/types.ts} +0 -0
  404. /package/{dist/packages/components/src/util/unknownArray.d.ts → src/util/unknownArray.ts} +0 -0
@@ -0,0 +1,70 @@
1
+ import classNames from 'classnames';
2
+ import ScrollContainer from 'react-indiana-drag-scroll';
3
+ import { Text } from 'src/components/common/Text/Text';
4
+ import type { SelectedFilterOption } from 'src/atoms/search/types';
5
+
6
+ interface AppliedFiltersScrollbarProps {
7
+ selectedFilterOptions: SelectedFilterOption[];
8
+ filterBarClassNames: string;
9
+ filterDefaultClasses: string;
10
+ filterHoverClasses: string;
11
+ appliedFilterBackgroundClasses: string;
12
+ onRemoveFilter: (filter: SelectedFilterOption) => void;
13
+ }
14
+
15
+ export const AppliedFiltersScrollbar = ({
16
+ selectedFilterOptions,
17
+ filterBarClassNames,
18
+ filterDefaultClasses,
19
+ filterHoverClasses,
20
+ appliedFilterBackgroundClasses,
21
+ onRemoveFilter,
22
+ }: AppliedFiltersScrollbarProps) => {
23
+ if (selectedFilterOptions.length === 0) {
24
+ return null;
25
+ }
26
+
27
+ // Extract border and text classes from filterDefaultClasses, excluding background because everything is shared between filters except for the applied filters background
28
+ const filterDefaultWithoutBg = filterDefaultClasses
29
+ .replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, '')
30
+ .trim();
31
+ const buttonClasses = classNames(
32
+ ' spiffy-tw-flex spiffy-tw-items-center spiffy-tw-rounded-full spiffy-tw-px-[8px] spiffy-tw-py-[4px] spiffy-tw-whitespace-nowrap',
33
+ filterHoverClasses,
34
+ filterDefaultWithoutBg,
35
+ appliedFilterBackgroundClasses,
36
+ );
37
+ const iconColor = 'currentColor'; // match with text color
38
+
39
+ return (
40
+ <ScrollContainer className={filterBarClassNames} hideScrollbars>
41
+ {selectedFilterOptions.map((filter) => {
42
+ return (
43
+ <button
44
+ key={filter.id}
45
+ className={buttonClasses}
46
+ type="button"
47
+ onClick={() => onRemoveFilter(filter)}
48
+ aria-label={`Remove filter: ${filter.displayName}`}
49
+ >
50
+ <div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]">
51
+ <Text variant="body3">{filter.displayName}</Text>
52
+ <svg
53
+ xmlns="http://www.w3.org/2000/svg"
54
+ width="10"
55
+ height="10"
56
+ viewBox="0 0 10 10"
57
+ fill="none"
58
+ >
59
+ <path
60
+ d="M4.59766 4.29297L8.48535 0.405273L9.19238 1.1123L5.30469 5L9.19238 8.8877L8.48535 9.59473L4.59766 5.70703L0.707031 9.59766L0 8.89062L3.89062 5L0 1.10938L0.707031 0.402344L4.59766 4.29297Z"
61
+ fill={iconColor}
62
+ />
63
+ </svg>
64
+ </div>
65
+ </button>
66
+ );
67
+ })}
68
+ </ScrollContainer>
69
+ );
70
+ };
@@ -0,0 +1,52 @@
1
+ import classNames from 'classnames';
2
+ import ScrollContainer from 'react-indiana-drag-scroll';
3
+ import { Text } from 'src/components/common/Text/Text';
4
+
5
+ interface DynamicFiltersScrollbarProps {
6
+ availableDynamicFilters: { name: string; displayName: string }[];
7
+ filterBarClassNames: string;
8
+ filterDefaultClasses: string;
9
+ filterHoverClasses: string;
10
+ onToggleDynamicFilter: ({
11
+ filter,
12
+ dynamicFilterDisplayName,
13
+ }: {
14
+ filter: string;
15
+ dynamicFilterDisplayName: string;
16
+ }) => void;
17
+ }
18
+
19
+ export const DynamicFiltersScrollbar = ({
20
+ availableDynamicFilters,
21
+ filterBarClassNames,
22
+ filterDefaultClasses,
23
+ filterHoverClasses,
24
+ onToggleDynamicFilter,
25
+ }: DynamicFiltersScrollbarProps) => {
26
+ return (
27
+ <ScrollContainer className={filterBarClassNames} hideScrollbars>
28
+ {availableDynamicFilters.map(({ name, displayName }) => {
29
+ const buttonClasses = classNames(
30
+ 'spiffy-tw-px-[12px] spiffy-tw-py-2 spiffy-tw-rounded-full spiffy-tw-border spiffy-tw-whitespace-nowrap ',
31
+ filterHoverClasses,
32
+ filterDefaultClasses,
33
+ );
34
+ return (
35
+ <button
36
+ key={name}
37
+ type="button"
38
+ className={buttonClasses}
39
+ onClick={() => {
40
+ onToggleDynamicFilter({
41
+ filter: name,
42
+ dynamicFilterDisplayName: displayName,
43
+ });
44
+ }}
45
+ >
46
+ <Text variant="body3">{displayName}</Text>
47
+ </button>
48
+ );
49
+ })}
50
+ </ScrollContainer>
51
+ );
52
+ };
@@ -0,0 +1,84 @@
1
+ import classNames from 'classnames';
2
+ import { SearchFilterItem } from './SearchFilterItem';
3
+ import type { SearchFilterProps } from './types';
4
+ import { Text } from 'src/components/common/Text/Text';
5
+ import { ButtonBase } from 'src/components/common/ButtonBase/ButtonBase';
6
+
7
+ export const SearchFilter = ({
8
+ isOpen,
9
+ setIsOpen,
10
+ filters,
11
+ // productCount,
12
+ selectFilterItem,
13
+ clearAllFilters,
14
+ // applyFiltersUnchangedClasses,
15
+ // applyFiltersChangedClasses,
16
+ filterButtonText,
17
+ radioButtonFillColor,
18
+ radioButtonHoverColor,
19
+ radioButtonUncheckedBorderColor,
20
+ // filterCloseIconVariant,
21
+ headerContent,
22
+ }: SearchFilterProps) => {
23
+ const modalClasses = classNames(
24
+ 'spiffy-tw-fixed spiffy-tw-inset-0 spiffy-tw-z-50 spiffy-tw-flex spiffy-tw-transform spiffy-tw-transition-all',
25
+ {
26
+ 'spiffy-tw-translate-x-full': !isOpen,
27
+ 'spiffy-tw-translate-x-0': isOpen,
28
+ },
29
+ );
30
+
31
+ const overlayClasses = classNames(
32
+ 'spiffy-tw-absolute spiffy-tw-inset-0 spiffy-tw-bg-black spiffy-tw-bg-opacity-50',
33
+ {
34
+ 'spiffy-tw-opacity-0': !isOpen,
35
+ 'spiffy-tw-opacity-100': isOpen,
36
+ },
37
+ );
38
+
39
+ const sidebarClasses = classNames(
40
+ 'spiffy-tw-relative spiffy-tw-ml-auto spiffy-tw-flex spiffy-tw-h-full spiffy-tw-w-full spiffy-tw-max-w-xs spiffy-tw-flex-col spiffy-tw-overflow-y-auto spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-py-4 spiffy-tw-shadow-xl',
41
+ );
42
+
43
+ return (
44
+ <div className={modalClasses}>
45
+ <div className={overlayClasses} onClick={() => setIsOpen(false)} />
46
+ <div className={sidebarClasses}>
47
+ {headerContent}
48
+ <div className="spiffy-tw-flex-1 spiffy-tw-px-4 spiffy-tw-py-6">
49
+ {filters.map((filter) => (
50
+ <div key={filter.id} className="spiffy-tw-mb-6">
51
+ <Text variant="body2" className="spiffy-tw-font-medium spiffy-tw-mb-3">
52
+ {filter.displayName}
53
+ </Text>
54
+ <ul>
55
+ {filter.items.map((item) => (
56
+ <SearchFilterItem
57
+ key={item.id}
58
+ filterItem={item}
59
+ onSelectFilterItem={selectFilterItem}
60
+ radioButtonFillColor={radioButtonFillColor}
61
+ radioButtonHoverColor={radioButtonHoverColor}
62
+ radioButtonUncheckedBorderColor={radioButtonUncheckedBorderColor}
63
+ />
64
+ ))}
65
+ </ul>
66
+ </div>
67
+ ))}
68
+ </div>
69
+ <div className="spiffy-tw-border-t spiffy-tw-border-[--spiffy-colors-border-light] spiffy-tw-px-4 spiffy-tw-py-3">
70
+ <ButtonBase
71
+ onClick={clearAllFilters}
72
+ text="Clear All"
73
+ buttonClass="spiffy-tw-w-full spiffy-tw-mb-2"
74
+ />
75
+ <ButtonBase
76
+ onClick={() => setIsOpen(false)}
77
+ text={filterButtonText}
78
+ buttonClass="spiffy-tw-w-full"
79
+ />
80
+ </div>
81
+ </div>
82
+ </div>
83
+ );
84
+ };
@@ -0,0 +1,42 @@
1
+ import classNames from 'classnames';
2
+ import { Text } from 'src/components/common/Text/Text';
3
+ import type { SearchFilterHeaderProps } from './types';
4
+
5
+ export const SearchFilterHeader = ({
6
+ closeModal,
7
+ productCount,
8
+ headerClassName,
9
+ filterCloseIconVariant,
10
+ }: SearchFilterHeaderProps) => {
11
+ const closeIconColor =
12
+ filterCloseIconVariant === 'dark'
13
+ ? 'var(--spiffy-colors-text-primary)'
14
+ : 'var(--spiffy-colors-text-light)';
15
+
16
+ return (
17
+ <div
18
+ className={classNames(
19
+ 'spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3',
20
+ headerClassName,
21
+ )}
22
+ >
23
+ <Text variant="body2" className="spiffy-tw-font-medium">
24
+ Filters ({productCount})
25
+ </Text>
26
+ <button onClick={closeModal} className="spiffy-tw-p-2">
27
+ <svg
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ width="14"
30
+ height="14"
31
+ viewBox="0 0 14 14"
32
+ fill="none"
33
+ >
34
+ <path
35
+ d="M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976311 12.6834 -0.0976311 12.2929 0.292893L7 5.58579L1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976311 12.6834 -0.0976311 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711Z"
36
+ fill={closeIconColor}
37
+ />
38
+ </svg>
39
+ </button>
40
+ </div>
41
+ );
42
+ };
@@ -0,0 +1,42 @@
1
+ import classNames from 'classnames';
2
+ import { Text } from 'src/components/common/Text/Text';
3
+ import type { SearchFilterItemProps } from './types';
4
+
5
+ export const SearchFilterItem = ({
6
+ filterItem,
7
+ onSelectFilterItem,
8
+ radioButtonFillColor,
9
+ radioButtonHoverColor,
10
+ radioButtonUncheckedBorderColor,
11
+ }: SearchFilterItemProps) => {
12
+ const { displayName, isSelected } = filterItem;
13
+
14
+ const radioClasses = classNames(
15
+ 'spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-rounded-full spiffy-tw-border-2',
16
+ 'spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-center',
17
+ radioButtonUncheckedBorderColor,
18
+ radioButtonHoverColor,
19
+ {
20
+ [radioButtonFillColor]: isSelected,
21
+ },
22
+ );
23
+
24
+ return (
25
+ <li
26
+ className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2 spiffy-tw-cursor-pointer"
27
+ onClick={() => onSelectFilterItem(filterItem)}
28
+ >
29
+ <Text variant="body3">{displayName}</Text>
30
+ <div className={radioClasses}>
31
+ {isSelected && (
32
+ <div
33
+ className={classNames('spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-rounded-full', {
34
+ 'spiffy-tw-bg-white': radioButtonFillColor.includes('spiffy-tw-bg-'),
35
+ 'spiffy-tw-bg-black': radioButtonFillColor.includes('spiffy-tw-bg-white'),
36
+ })}
37
+ />
38
+ )}
39
+ </div>
40
+ </li>
41
+ );
42
+ };
@@ -0,0 +1,48 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type SearchFilterItem = {
4
+ id: string;
5
+ displayName: string;
6
+ value: string;
7
+ isSelected: boolean;
8
+ };
9
+
10
+ export type SearchFilter = {
11
+ id: string;
12
+ displayName: string;
13
+ items: SearchFilterItem[];
14
+ };
15
+
16
+ export type SelectFilterItem = (filterItem: SearchFilterItem) => void;
17
+
18
+ export interface SearchFilterItemProps {
19
+ filterItem: SearchFilterItem;
20
+ onSelectFilterItem: SelectFilterItem;
21
+ radioButtonFillColor: string;
22
+ radioButtonHoverColor: string;
23
+ radioButtonUncheckedBorderColor: string;
24
+ }
25
+
26
+ export interface SearchFilterHeaderProps {
27
+ closeModal: () => void;
28
+ productCount: number;
29
+ headerClassName: string;
30
+ filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
31
+ }
32
+
33
+ export interface SearchFilterProps {
34
+ isOpen: boolean;
35
+ setIsOpen: (isOpen: boolean) => void;
36
+ filters: SearchFilter[];
37
+ productCount: number;
38
+ selectFilterItem: SelectFilterItem;
39
+ clearAllFilters: () => void;
40
+ applyFiltersUnchangedClasses: string;
41
+ applyFiltersChangedClasses: string;
42
+ filterButtonText: string;
43
+ radioButtonFillColor: string;
44
+ radioButtonHoverColor: string;
45
+ radioButtonUncheckedBorderColor: string;
46
+ filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
47
+ headerContent: ReactNode;
48
+ }
@@ -0,0 +1,135 @@
1
+ import React, { useRef, useImperativeHandle } from 'react';
2
+ import classNames from 'classnames';
3
+ import MagnifyingGlassStarVariant from '@envive-ai/react-icons/src/MagnifyingGlassStarVariant';
4
+ import CloseIcon from '@envive-ai/react-icons/src/IconClose';
5
+ import { TextInput } from 'src/components/common/TextInput/TextInput';
6
+ import { searchInputVariantClasses } from './searchInputVariants';
7
+ import type { SearchInputVariant } from '../SearchInputForm/types';
8
+
9
+ export interface SearchInputProps {
10
+ searchInputVariant?: SearchInputVariant;
11
+ value: string;
12
+ placeholder?: string;
13
+ suggestions?: string[];
14
+ className?: string;
15
+ dataTestId?: string;
16
+ ariaActivedescendant?: string;
17
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
18
+ onChange: (newValue: string) => void;
19
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
20
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
21
+ }
22
+
23
+ export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
24
+ (
25
+ {
26
+ searchInputVariant = 'standard',
27
+ value,
28
+ placeholder,
29
+ suggestions,
30
+ className,
31
+ dataTestId,
32
+ ariaActivedescendant,
33
+ onKeyDown,
34
+ onChange,
35
+ onFocus,
36
+ onBlur,
37
+ },
38
+ ref,
39
+ ) => {
40
+ const localInputRef = useRef<HTMLInputElement>(null);
41
+
42
+ const {
43
+ searchInputClasses: inputClassName,
44
+ searchInputIconColor: iconColor,
45
+ searchInputBorderColor: borderColor,
46
+ searchInputCloseIconClasses: closeIconClasses,
47
+ searchInputActiveStarClasses,
48
+ placeholderVariant,
49
+ } = searchInputVariantClasses[searchInputVariant];
50
+
51
+ // Expose the local ref through the forwarded ref
52
+ useImperativeHandle(ref, () => localInputRef.current!, []);
53
+ const magnifyingGlassClassesBase = [
54
+ 'spiffy-tw-w-[24px]',
55
+ 'spiffy-tw-h-[32px]',
56
+ 'spiffy-tw-stroke-width-1',
57
+ 'sm:spiffy-tw-w-[32px]',
58
+ ];
59
+
60
+ const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
61
+
62
+ const magnifyingGlassClassesActive = classNames([
63
+ ...magnifyingGlassClassesBase,
64
+ searchInputActiveStarClasses,
65
+ ]);
66
+
67
+ const containerClasses = classNames(
68
+ 'spiffy-global-search-input-container',
69
+ 'spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center',
70
+ className,
71
+ );
72
+
73
+ const inputClasses = classNames(
74
+ 'spiffy-global-search-input',
75
+ 'spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]',
76
+ 'spiffy-tw-border',
77
+ 'spiffy-tw-text-base',
78
+ inputClassName,
79
+ );
80
+ const closeButtonIconClassName = classNames([
81
+ 'spiffy-tw-w-[16px]',
82
+ 'spiffy-tw-h-[16px]',
83
+ 'sm:spiffy-tw-w-[24px]',
84
+ 'sm:spiffy-tw-h-[24px]',
85
+ 'spiffy-tw-cursor-pointer',
86
+ closeIconClasses,
87
+ ]);
88
+
89
+ return (
90
+ <div className={containerClasses} data-testid={dataTestId}>
91
+ <div className="spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2">
92
+ <MagnifyingGlassStarVariant
93
+ className={
94
+ value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive
95
+ }
96
+ stroke={iconColor}
97
+ strokeWidth="1px"
98
+ />
99
+ </div>
100
+ <TextInput
101
+ value={value}
102
+ onChange={(event: React.ChangeEvent<HTMLInputElement>) => onChange(event.target.value)}
103
+ onFocus={onFocus}
104
+ onBlur={onBlur}
105
+ onKeyDown={onKeyDown}
106
+ placeholder={placeholder}
107
+ className={inputClasses}
108
+ placeholderVariant={placeholderVariant}
109
+ aria-label="Search"
110
+ aria-autocomplete="list"
111
+ aria-expanded={!!suggestions && suggestions.length > 0}
112
+ aria-controls="autocomplete-results"
113
+ aria-activedescendant={ariaActivedescendant}
114
+ borderRadius="xl"
115
+ borderColorClass={borderColor}
116
+ ref={localInputRef}
117
+ />
118
+
119
+ {value && (
120
+ <button
121
+ onClick={() => {
122
+ onChange('');
123
+ localInputRef.current?.focus();
124
+ }}
125
+ className="spiffy-tw-absolute spiffy-tw-right-5 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2 spiffy-tw-text-neutral-500 hover:spiffy-tw-text-neutral-700"
126
+ aria-label="Clear search input"
127
+ type="button"
128
+ >
129
+ <CloseIcon className={closeButtonIconClassName} />
130
+ </button>
131
+ )}
132
+ </div>
133
+ );
134
+ },
135
+ );
@@ -0,0 +1,27 @@
1
+ import type { TextStyleVariantMap } from 'src/components/common/Text/textVariantClasses';
2
+ import type { SearchInputVariant } from '../SearchInputForm/types';
3
+ import { ColorNames, colorVar } from 'src/components/models/colorsConfig';
4
+
5
+ interface SearchInputVariantClasses {
6
+ searchInputIconColor: string;
7
+ searchInputBorderColor: string;
8
+ searchInputCloseIconClasses: string;
9
+ searchInputActiveStarClasses: string;
10
+ autocompleteIconColor: string;
11
+ searchInputClasses: string;
12
+ placeholderVariant: keyof typeof TextStyleVariantMap;
13
+ }
14
+
15
+ export const searchInputVariantClasses: Record<SearchInputVariant, SearchInputVariantClasses> = {
16
+ standard: {
17
+ searchInputIconColor: 'transparent', // colorVar(ColorNames.TextSecondary),
18
+ searchInputBorderColor: 'spiffy-tw-border-[--spiffy-colors-border-medium]',
19
+ searchInputCloseIconClasses:
20
+ '[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]',
21
+ searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
22
+ autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
23
+ searchInputClasses:
24
+ 'spiffy-tw-text-[--spiffy-colors-text-primary] placeholder:spiffy-tw-text-[--spiffy-colors-text-secondary] spiffy-tw-text-[16px] spiffy-tw-font-normal spiffy-tw-leading-[148%] placeholder:spiffy-tw-font-medium placeholder:spiffy-tw-leading-[124%]',
25
+ placeholderVariant: 'h2',
26
+ },
27
+ };
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { motion } from 'framer-motion';
3
+ import classNames from 'classnames';
4
+ import OutlinedStar from '@envive-ai/react-icons/src/OutlinedStar';
5
+
6
+ interface GlobalSearchAutocompleteProps {
7
+ id: string;
8
+ results: string[];
9
+ focusedIndex: number;
10
+ onSuggestionSelect: (suggestion: string, rankPosition: number) => void;
11
+ iconColor?: string;
12
+ }
13
+
14
+ export const SearchAutocomplete: React.FC<GlobalSearchAutocompleteProps> = ({
15
+ id,
16
+ results,
17
+ focusedIndex,
18
+ onSuggestionSelect,
19
+ iconColor,
20
+ }) => {
21
+ if (results.length === 0) {
22
+ return null;
23
+ }
24
+
25
+ return (
26
+ <motion.div
27
+ className="spiffy-tw-h-full"
28
+ initial={{ opacity: 0, y: -10 }}
29
+ animate={{ opacity: 1, y: 0 }}
30
+ exit={{ opacity: 0, y: -10 }}
31
+ transition={{ duration: 0.2 }}
32
+ >
33
+ <ul id={id} role="listbox" className="spiffy-tw-mt-4 spiffy-tw-space-y-2">
34
+ {results.map((result, index) => (
35
+ <li
36
+ key={index}
37
+ id={`option-${index}`}
38
+ role="option"
39
+ aria-selected={index === focusedIndex}
40
+ className={classNames(
41
+ 'spiffy-tw-flex spiffy-tw-items-center spiffy-tw-cursor-pointer spiffy-tw-py-1',
42
+ { 'spiffy-tw-bg-neutral-200': index === focusedIndex },
43
+ 'hover:spiffy-tw-bg-neutral-100',
44
+ )}
45
+ onClick={() => onSuggestionSelect(result, index)}
46
+ onKeyDown={(event) => {
47
+ if (event.key === 'Enter' || event.keyCode === 13) {
48
+ onSuggestionSelect(result, index);
49
+ }
50
+ }}
51
+ >
52
+ <OutlinedStar
53
+ className="spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-2"
54
+ fill={iconColor}
55
+ />
56
+ <span className="spiffy-tw-font-bold">{result}</span>
57
+ </li>
58
+ ))}
59
+ </ul>
60
+ </motion.div>
61
+ );
62
+ };
@@ -0,0 +1,66 @@
1
+ import type { SearchInputVariant } from './types';
2
+ import { SearchAutocomplete } from '../SearchInputAutocomplete/SearchAutocomplete';
3
+ import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
4
+ import { SearchInput } from '../SearchInput/SearchInput';
5
+
6
+ interface SearchInputFormProps {
7
+ searchInputVariant: SearchInputVariant;
8
+ searchText: string;
9
+ autocompleteResults: string[];
10
+ searchBoxPlaceholder: string;
11
+ focusedOptionId: string | undefined;
12
+ isDirty: boolean;
13
+ focusedIndex: number;
14
+ onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
15
+ onAutocompleteSelect: (suggestion: string) => void;
16
+ onSearchInputChange: (value: string) => void;
17
+ onSearchSubmit: () => void;
18
+ }
19
+
20
+ export const SearchInputForm = ({
21
+ searchInputVariant,
22
+ searchText,
23
+ autocompleteResults,
24
+ searchBoxPlaceholder,
25
+ focusedOptionId,
26
+ isDirty,
27
+ focusedIndex,
28
+ onKeyDown,
29
+ onAutocompleteSelect,
30
+ onSearchInputChange,
31
+ onSearchSubmit,
32
+ }: SearchInputFormProps) => {
33
+ const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
34
+
35
+ return (
36
+ <>
37
+ <form
38
+ onSubmit={(e) => {
39
+ e.preventDefault();
40
+ onSearchSubmit();
41
+ }}
42
+ className="spiffy-tw-grow"
43
+ >
44
+ <SearchInput
45
+ value={searchText}
46
+ placeholder={searchBoxPlaceholder}
47
+ suggestions={autocompleteResults}
48
+ ariaActivedescendant={focusedOptionId}
49
+ searchInputVariant={searchInputVariant}
50
+ // dataTestId={SEARCH_INPUT_TESTID}
51
+ onKeyDown={onKeyDown}
52
+ onChange={onSearchInputChange}
53
+ />
54
+ </form>
55
+ {isDirty && (
56
+ <SearchAutocomplete
57
+ id="autocomplete-results"
58
+ results={autocompleteResults}
59
+ focusedIndex={focusedIndex}
60
+ iconColor={searchInputIconColor}
61
+ onSuggestionSelect={onAutocompleteSelect}
62
+ />
63
+ )}
64
+ </>
65
+ );
66
+ };