@envive-ai/react-toolkit 0.1.1 → 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 (257) hide show
  1. package/dist/AppliedFiltersScrollbar-BlcyhZkZ.cjs +53 -0
  2. package/dist/AppliedFiltersScrollbar-DFGzRemu.js +44 -0
  3. package/dist/ButtonBase-C1rsL9gO.js +60 -0
  4. package/dist/ButtonBase-a8uj6c2f.cjs +69 -0
  5. package/dist/DynamicFiltersScrollbar-B2Rr1KnJ.cjs +41 -0
  6. package/dist/DynamicFiltersScrollbar-Dys6geP0.js +32 -0
  7. package/dist/Headline-L7w3BsBF.cjs +72 -0
  8. package/dist/Headline-ro_Nigw5.js +64 -0
  9. package/dist/ImageWithFallback-CfmkC58B.js +42 -0
  10. package/dist/ImageWithFallback-P3AjyL2Y.cjs +51 -0
  11. package/dist/ProductCard-Btg8tHGc.js +172 -0
  12. package/dist/ProductCard-CS6DZAwO.cjs +193 -0
  13. package/dist/ProductCardSkeleton-BPfp6IOp.js +38 -0
  14. package/dist/ProductCardSkeleton-BgvDlaty.cjs +46 -0
  15. package/dist/ProductGrid-B7QZfW-v.cjs +77 -0
  16. package/dist/ProductGrid-DB_Uq5F-.js +69 -0
  17. package/dist/SearchAutocomplete-C5FL82xC.js +51 -0
  18. package/dist/SearchAutocomplete-wr18dJ8L.cjs +62 -0
  19. package/dist/SearchFilter-D-2IdBKS.js +62 -0
  20. package/dist/SearchFilter-D0IzBlG5.cjs +70 -0
  21. package/dist/SearchFilterHeader-BQT0-ssS.js +37 -0
  22. package/dist/SearchFilterHeader-C3EklfoO.cjs +45 -0
  23. package/dist/SearchFilterItem-BodtWLoP.js +26 -0
  24. package/dist/SearchFilterItem-DmMkiqNC.cjs +34 -0
  25. package/dist/SearchInput-BrcAgcvI.js +89 -0
  26. package/dist/SearchInput-DSB9CwIq.cjs +106 -0
  27. package/dist/SparkleAnimation-BpLwrEqM.cjs +96 -0
  28. package/dist/SparkleAnimation-CXs58sFd.js +85 -0
  29. package/dist/Spinner-BZ-kTOpm.js +38 -0
  30. package/dist/Spinner-CfQ85Ajl.cjs +46 -0
  31. package/dist/Text-Bdv7F5-u.js +42 -0
  32. package/dist/Text-C04c4Z93.cjs +50 -0
  33. package/dist/TextInput-BO80ixsV.cjs +40 -0
  34. package/dist/TextInput-CEGWfdPC.js +31 -0
  35. package/dist/chunk-CUT6urMc.cjs +30 -0
  36. package/dist/colorsConfig-TCONYTQ7.cjs +38 -0
  37. package/dist/colorsConfig-l0ODUVhu.js +26 -0
  38. package/dist/common/ButtonBase/ButtonBase.cjs +5 -0
  39. package/dist/common/ButtonBase/ButtonBase.d.cts +35 -0
  40. package/dist/common/ButtonBase/ButtonBase.d.ts +35 -0
  41. package/dist/common/ButtonBase/ButtonBase.js +5 -0
  42. package/dist/common/Headline/Headline.cjs +4 -0
  43. package/dist/common/Headline/Headline.d.cts +21 -0
  44. package/dist/common/Headline/Headline.d.ts +21 -0
  45. package/dist/common/Headline/Headline.js +4 -0
  46. package/dist/common/ImageWithFallback/ImageWithFallback.cjs +3 -0
  47. package/dist/common/ImageWithFallback/ImageWithFallback.d.cts +26 -0
  48. package/dist/common/ImageWithFallback/ImageWithFallback.d.ts +26 -0
  49. package/dist/common/ImageWithFallback/ImageWithFallback.js +3 -0
  50. package/dist/common/ProductCard/ProductCard.cjs +11 -0
  51. package/dist/common/ProductCard/ProductCard.d.cts +91 -0
  52. package/dist/common/ProductCard/ProductCard.d.ts +91 -0
  53. package/dist/common/ProductCard/ProductCard.js +9 -0
  54. package/dist/common/ProductCard/ProductCardSkeleton.cjs +4 -0
  55. package/dist/common/ProductCard/ProductCardSkeleton.d.cts +12 -0
  56. package/dist/common/ProductCard/ProductCardSkeleton.d.ts +12 -0
  57. package/dist/common/ProductCard/ProductCardSkeleton.js +4 -0
  58. package/dist/common/ProductGrid/ProductGrid.cjs +11 -0
  59. package/dist/common/ProductGrid/ProductGrid.d.cts +26 -0
  60. package/dist/common/ProductGrid/ProductGrid.d.ts +26 -0
  61. package/dist/common/ProductGrid/ProductGrid.js +11 -0
  62. package/dist/common/SparkleAnimation/SparkleAnimation.cjs +3 -0
  63. package/dist/common/SparkleAnimation/SparkleAnimation.d.cts +15 -0
  64. package/dist/common/SparkleAnimation/SparkleAnimation.d.ts +15 -0
  65. package/dist/common/SparkleAnimation/SparkleAnimation.js +3 -0
  66. package/dist/common/Spinner/Spinner.cjs +3 -0
  67. package/dist/common/Spinner/Spinner.d.cts +11 -0
  68. package/dist/common/Spinner/Spinner.d.ts +11 -0
  69. package/dist/common/Spinner/Spinner.js +3 -0
  70. package/dist/common/SuggestionButton/SuggestionButton.cjs +188 -0
  71. package/dist/common/SuggestionButton/SuggestionButton.d.cts +35 -0
  72. package/dist/common/SuggestionButton/SuggestionButton.d.ts +35 -0
  73. package/dist/common/SuggestionButton/SuggestionButton.js +180 -0
  74. package/dist/common/Text/Text.cjs +4 -0
  75. package/dist/common/Text/Text.d.cts +28 -0
  76. package/dist/common/Text/Text.d.ts +28 -0
  77. package/dist/common/Text/Text.js +4 -0
  78. package/dist/common/TextInput/TextInput.cjs +4 -0
  79. package/dist/common/TextInput/TextInput.d.cts +98 -0
  80. package/dist/common/TextInput/TextInput.d.ts +98 -0
  81. package/dist/common/TextInput/TextInput.js +4 -0
  82. package/dist/productCardVariants-C_QIZ-KF.js +45 -0
  83. package/dist/productCardVariants-Dd-wrJKP.cjs +69 -0
  84. package/dist/productGridVariants-CxCKx5Fq.js +20 -0
  85. package/dist/productGridVariants-DVzvjK9i.cjs +26 -0
  86. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.cjs +5 -0
  87. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.cts +22 -0
  88. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +22 -0
  89. package/dist/search/FilterScrollbar/AppliedFiltersScrollbar.js +5 -0
  90. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.cjs +5 -0
  91. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.cts +28 -0
  92. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +28 -0
  93. package/dist/search/FilterScrollbar/DynamicFiltersScrollbar.js +5 -0
  94. package/dist/search/SearchFilter/SearchFilter.cjs +7 -0
  95. package/dist/search/SearchFilter/SearchFilter.d.cts +18 -0
  96. package/dist/search/SearchFilter/SearchFilter.d.ts +18 -0
  97. package/dist/search/SearchFilter/SearchFilter.js +7 -0
  98. package/dist/search/SearchFilter/SearchFilterHeader.cjs +5 -0
  99. package/dist/search/SearchFilter/SearchFilterHeader.d.cts +12 -0
  100. package/dist/search/SearchFilter/SearchFilterHeader.d.ts +12 -0
  101. package/dist/search/SearchFilter/SearchFilterHeader.js +5 -0
  102. package/dist/search/SearchFilter/SearchFilterItem.cjs +5 -0
  103. package/dist/search/SearchFilter/SearchFilterItem.d.cts +13 -0
  104. package/dist/search/SearchFilter/SearchFilterItem.d.ts +13 -0
  105. package/dist/search/SearchFilter/SearchFilterItem.js +5 -0
  106. package/dist/search/SearchInput/SearchInput.cjs +6 -0
  107. package/dist/search/SearchInput/SearchInput.d.cts +20 -0
  108. package/dist/search/SearchInput/SearchInput.d.ts +20 -0
  109. package/dist/search/SearchInput/SearchInput.js +6 -0
  110. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.cjs +3 -0
  111. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.cts +13 -0
  112. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +13 -0
  113. package/dist/search/SearchInputAutocomplete/SearchAutocomplete.js +3 -0
  114. package/dist/search/SearchInputForm/SearchInputForm.cjs +38 -0
  115. package/dist/search/SearchInputForm/SearchInputForm.d.cts +32 -0
  116. package/dist/search/SearchInputForm/SearchInputForm.d.ts +32 -0
  117. package/dist/search/SearchInputForm/SearchInputForm.js +36 -0
  118. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.cjs +52 -0
  119. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.cts +28 -0
  120. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +28 -0
  121. package/dist/search/SearchResultsFilterSidebar/SearchResultsFilter.js +49 -0
  122. package/dist/search/SearchResultsStates/NoSearchResultsFound.cjs +30 -0
  123. package/dist/search/SearchResultsStates/NoSearchResultsFound.d.cts +17 -0
  124. package/dist/search/SearchResultsStates/NoSearchResultsFound.d.ts +17 -0
  125. package/dist/search/SearchResultsStates/NoSearchResultsFound.js +26 -0
  126. package/dist/search/SearchResultsStates/SearchResultsGrid.cjs +66 -0
  127. package/dist/search/SearchResultsStates/SearchResultsGrid.d.cts +41 -0
  128. package/dist/search/SearchResultsStates/SearchResultsGrid.d.ts +41 -0
  129. package/dist/search/SearchResultsStates/SearchResultsGrid.js +62 -0
  130. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.cjs +52 -0
  131. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.cts +15 -0
  132. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +15 -0
  133. package/dist/search/SearchResultsStates/SearchResultsLoadingGrid.js +49 -0
  134. package/dist/searchFilterSidebarVariants-GfFbQzGf.cjs +39 -0
  135. package/dist/searchFilterSidebarVariants-lJVVZT_2.js +34 -0
  136. package/dist/textVariantClasses-5t3OricK.js +101 -0
  137. package/dist/textVariantClasses-Bhf4VY5z.cjs +125 -0
  138. package/dist/types-53zIialA.d.ts +35 -0
  139. package/dist/types-B4BGZSlV.d.cts +4 -0
  140. package/dist/types-BQNqA5xL.d.ts +46 -0
  141. package/dist/types-BRLWwGMI.d.ts +4 -0
  142. package/dist/types-CImLkcNh.d.cts +46 -0
  143. package/dist/types-Cph97xkm.d.ts +6 -0
  144. package/dist/types-CpiJO5UH.d.ts +4 -0
  145. package/dist/types-DFetqNL2.d.ts +8 -0
  146. package/dist/types-DaSkJnT_.d.cts +8 -0
  147. package/dist/types-Dy4_w6Cf.d.cts +4 -0
  148. package/dist/types-TYhhwWZw.d.cts +6 -0
  149. package/dist/types-aa4flfRE.d.cts +35 -0
  150. package/package.json +8 -8
  151. package/src/components/common/ButtonBase/ButtonBase.tsx +2 -2
  152. package/src/components/common/ButtonBase/types.ts +2 -3
  153. package/dist/src/atoms/search/types.d.ts +0 -5
  154. package/dist/src/atoms/search/types.js +0 -1
  155. package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +0 -2
  156. package/dist/src/components/common/ButtonBase/ButtonBase.js +0 -41
  157. package/dist/src/components/common/ButtonBase/types.d.ts +0 -24
  158. package/dist/src/components/common/ButtonBase/types.js +0 -6
  159. package/dist/src/components/common/Headline/Headline.d.ts +0 -10
  160. package/dist/src/components/common/Headline/Headline.js +0 -34
  161. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +0 -12
  162. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +0 -26
  163. package/dist/src/components/common/ProductCard/ProductCard.d.ts +0 -39
  164. package/dist/src/components/common/ProductCard/ProductCard.js +0 -84
  165. package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +0 -9
  166. package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +0 -15
  167. package/dist/src/components/common/ProductCard/productCardVariants.d.ts +0 -8
  168. package/dist/src/components/common/ProductCard/productCardVariants.js +0 -50
  169. package/dist/src/components/common/ProductCard/types.d.ts +0 -39
  170. package/dist/src/components/common/ProductCard/types.js +0 -10
  171. package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +0 -14
  172. package/dist/src/components/common/ProductGrid/ProductGrid.js +0 -13
  173. package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +0 -10
  174. package/dist/src/components/common/ProductGrid/productGridVariants.js +0 -16
  175. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +0 -7
  176. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +0 -40
  177. package/dist/src/components/common/SparkleAnimation/types.d.ts +0 -6
  178. package/dist/src/components/common/SparkleAnimation/types.js +0 -7
  179. package/dist/src/components/common/Spinner/Spinner.d.ts +0 -5
  180. package/dist/src/components/common/Spinner/Spinner.js +0 -16
  181. package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +0 -18
  182. package/dist/src/components/common/SuggestionButton/SuggestionButton.js +0 -210
  183. package/dist/src/components/common/SuggestionButton/types.d.ts +0 -1
  184. package/dist/src/components/common/SuggestionButton/types.js +0 -1
  185. package/dist/src/components/common/Text/Text.d.ts +0 -12
  186. package/dist/src/components/common/Text/Text.js +0 -26
  187. package/dist/src/components/common/Text/textVariantClasses.d.ts +0 -171
  188. package/dist/src/components/common/Text/textVariantClasses.js +0 -103
  189. package/dist/src/components/common/Text/types.d.ts +0 -16
  190. package/dist/src/components/common/Text/types.js +0 -6
  191. package/dist/src/components/common/TextInput/TextInput.d.ts +0 -8
  192. package/dist/src/components/common/TextInput/TextInput.js +0 -25
  193. package/dist/src/components/models/colorsConfig.d.ts +0 -26
  194. package/dist/src/components/models/colorsConfig.js +0 -23
  195. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +0 -11
  196. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +0 -18
  197. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +0 -15
  198. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +0 -15
  199. package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +0 -2
  200. package/dist/src/components/search/SearchFilter/SearchFilter.js +0 -24
  201. package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +0 -2
  202. package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +0 -9
  203. package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +0 -2
  204. package/dist/src/components/search/SearchFilter/SearchFilterItem.js +0 -13
  205. package/dist/src/components/search/SearchFilter/types.d.ts +0 -42
  206. package/dist/src/components/search/SearchFilter/types.js +0 -1
  207. package/dist/src/components/search/SearchInput/SearchInput.d.ts +0 -16
  208. package/dist/src/components/search/SearchInput/SearchInput.js +0 -38
  209. package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +0 -13
  210. package/dist/src/components/search/SearchInput/searchInputVariants.js +0 -12
  211. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +0 -10
  212. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +0 -14
  213. package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +0 -16
  214. package/dist/src/components/search/SearchInputForm/SearchInputForm.js +0 -13
  215. package/dist/src/components/search/SearchInputForm/types.d.ts +0 -1
  216. package/dist/src/components/search/SearchInputForm/types.js +0 -1
  217. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +0 -14
  218. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +0 -15
  219. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +0 -16
  220. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +0 -29
  221. package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +0 -2
  222. package/dist/src/components/search/SearchResultsFilterSidebar/types.js +0 -1
  223. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +0 -8
  224. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +0 -10
  225. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +0 -24
  226. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +0 -19
  227. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +0 -6
  228. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +0 -10
  229. package/dist/src/components/search/types.d.ts +0 -5
  230. package/dist/src/components/search/types.js +0 -6
  231. package/dist/src/components/test/types.d.ts +0 -3
  232. package/dist/src/components/test/types.js +0 -1
  233. package/dist/src/config/chatElementDisplayLocation.d.ts +0 -21
  234. package/dist/src/config/chatElementDisplayLocation.js +0 -23
  235. package/dist/src/index.d.ts +0 -45
  236. package/dist/src/index.js +0 -49
  237. package/dist/src/logging/logger.d.ts +0 -7
  238. package/dist/src/logging/logger.js +0 -16
  239. package/dist/src/types/external.d.ts +0 -21
  240. package/dist/src/types/external.js +0 -5
  241. package/dist/src/util/camelCase.d.ts +0 -65
  242. package/dist/src/util/camelCase.js +0 -2
  243. package/dist/src/util/camelCasedPropertiesDeep.d.ts +0 -53
  244. package/dist/src/util/camelCasedPropertiesDeep.js +0 -1
  245. package/dist/src/util/formatPrice.d.ts +0 -1
  246. package/dist/src/util/formatPrice.js +0 -11
  247. package/dist/src/util/internal.d.ts +0 -27
  248. package/dist/src/util/internal.js +0 -4
  249. package/dist/src/util/primitive.d.ts +0 -6
  250. package/dist/src/util/primitive.js +0 -2
  251. package/dist/src/util/splitWords.d.ts +0 -55
  252. package/dist/src/util/splitWords.js +0 -2
  253. package/dist/src/util/trim.d.ts +0 -24
  254. package/dist/src/util/trim.js +0 -2
  255. package/dist/src/util/unknownArray.d.ts +0 -25
  256. package/dist/src/util/unknownArray.js +0 -1
  257. package/src/index.ts +0 -59
@@ -0,0 +1,62 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ let classnames = require("classnames");
3
+ classnames = require_chunk.__toESM(classnames);
4
+ let react = require("react");
5
+ react = require_chunk.__toESM(react);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
8
+ let framer_motion = require("framer-motion");
9
+ framer_motion = require_chunk.__toESM(framer_motion);
10
+ let __envive_ai_react_icons_src_OutlinedStar = require("@envive-ai/react-icons/src/OutlinedStar");
11
+ __envive_ai_react_icons_src_OutlinedStar = require_chunk.__toESM(__envive_ai_react_icons_src_OutlinedStar);
12
+
13
+ //#region src/components/search/SearchInputAutocomplete/SearchAutocomplete.tsx
14
+ const SearchAutocomplete = ({ id, results, focusedIndex, onSuggestionSelect, iconColor }) => {
15
+ if (results.length === 0) return null;
16
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
17
+ className: "spiffy-tw-h-full",
18
+ initial: {
19
+ opacity: 0,
20
+ y: -10
21
+ },
22
+ animate: {
23
+ opacity: 1,
24
+ y: 0
25
+ },
26
+ exit: {
27
+ opacity: 0,
28
+ y: -10
29
+ },
30
+ transition: { duration: .2 },
31
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
32
+ id,
33
+ role: "listbox",
34
+ className: "spiffy-tw-mt-4 spiffy-tw-space-y-2",
35
+ children: results.map((result, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
36
+ id: `option-${index}`,
37
+ role: "option",
38
+ "aria-selected": index === focusedIndex,
39
+ className: (0, classnames.default)("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-cursor-pointer spiffy-tw-py-1", { "spiffy-tw-bg-neutral-200": index === focusedIndex }, "hover:spiffy-tw-bg-neutral-100"),
40
+ onClick: () => onSuggestionSelect(result, index),
41
+ onKeyDown: (event) => {
42
+ if (event.key === "Enter" || event.keyCode === 13) onSuggestionSelect(result, index);
43
+ },
44
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_OutlinedStar.default, {
45
+ className: "spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-2",
46
+ fill: iconColor
47
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
48
+ className: "spiffy-tw-font-bold",
49
+ children: result
50
+ })]
51
+ }, index))
52
+ })
53
+ });
54
+ };
55
+
56
+ //#endregion
57
+ Object.defineProperty(exports, 'SearchAutocomplete', {
58
+ enumerable: true,
59
+ get: function () {
60
+ return SearchAutocomplete;
61
+ }
62
+ });
@@ -0,0 +1,62 @@
1
+ import { ButtonBase } from "./ButtonBase-C1rsL9gO.js";
2
+ import { Text } from "./Text-Bdv7F5-u.js";
3
+ import { SearchFilterItem } from "./SearchFilterItem-BodtWLoP.js";
4
+ import classNames from "classnames";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region src/components/search/SearchFilter/SearchFilter.tsx
8
+ const SearchFilter = ({ isOpen, setIsOpen, filters, selectFilterItem, clearAllFilters, filterButtonText, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, headerContent }) => {
9
+ const modalClasses = classNames("spiffy-tw-fixed spiffy-tw-inset-0 spiffy-tw-z-50 spiffy-tw-flex spiffy-tw-transform spiffy-tw-transition-all", {
10
+ "spiffy-tw-translate-x-full": !isOpen,
11
+ "spiffy-tw-translate-x-0": isOpen
12
+ });
13
+ const overlayClasses = classNames("spiffy-tw-absolute spiffy-tw-inset-0 spiffy-tw-bg-black spiffy-tw-bg-opacity-50", {
14
+ "spiffy-tw-opacity-0": !isOpen,
15
+ "spiffy-tw-opacity-100": isOpen
16
+ });
17
+ const sidebarClasses = classNames("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");
18
+ return /* @__PURE__ */ jsxs("div", {
19
+ className: modalClasses,
20
+ children: [/* @__PURE__ */ jsx("div", {
21
+ className: overlayClasses,
22
+ onClick: () => setIsOpen(false)
23
+ }), /* @__PURE__ */ jsxs("div", {
24
+ className: sidebarClasses,
25
+ children: [
26
+ headerContent,
27
+ /* @__PURE__ */ jsx("div", {
28
+ className: "spiffy-tw-flex-1 spiffy-tw-px-4 spiffy-tw-py-6",
29
+ children: filters.map((filter) => /* @__PURE__ */ jsxs("div", {
30
+ className: "spiffy-tw-mb-6",
31
+ children: [/* @__PURE__ */ jsx(Text, {
32
+ variant: "body2",
33
+ className: "spiffy-tw-font-medium spiffy-tw-mb-3",
34
+ children: filter.displayName
35
+ }), /* @__PURE__ */ jsx("ul", { children: filter.items.map((item) => /* @__PURE__ */ jsx(SearchFilterItem, {
36
+ filterItem: item,
37
+ onSelectFilterItem: selectFilterItem,
38
+ radioButtonFillColor,
39
+ radioButtonHoverColor,
40
+ radioButtonUncheckedBorderColor
41
+ }, item.id)) })]
42
+ }, filter.id))
43
+ }),
44
+ /* @__PURE__ */ jsxs("div", {
45
+ className: "spiffy-tw-border-t spiffy-tw-border-[--spiffy-colors-border-light] spiffy-tw-px-4 spiffy-tw-py-3",
46
+ children: [/* @__PURE__ */ jsx(ButtonBase, {
47
+ onClick: clearAllFilters,
48
+ text: "Clear All",
49
+ buttonClass: "spiffy-tw-w-full spiffy-tw-mb-2"
50
+ }), /* @__PURE__ */ jsx(ButtonBase, {
51
+ onClick: () => setIsOpen(false),
52
+ text: filterButtonText,
53
+ buttonClass: "spiffy-tw-w-full"
54
+ })]
55
+ })
56
+ ]
57
+ })]
58
+ });
59
+ };
60
+
61
+ //#endregion
62
+ export { SearchFilter };
@@ -0,0 +1,70 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_ButtonBase = require('./ButtonBase-a8uj6c2f.cjs');
3
+ const require_Text = require('./Text-C04c4Z93.cjs');
4
+ const require_SearchFilterItem = require('./SearchFilterItem-DmMkiqNC.cjs');
5
+ let classnames = require("classnames");
6
+ classnames = require_chunk.__toESM(classnames);
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
9
+
10
+ //#region src/components/search/SearchFilter/SearchFilter.tsx
11
+ const SearchFilter = ({ isOpen, setIsOpen, filters, selectFilterItem, clearAllFilters, filterButtonText, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, headerContent }) => {
12
+ const modalClasses = (0, classnames.default)("spiffy-tw-fixed spiffy-tw-inset-0 spiffy-tw-z-50 spiffy-tw-flex spiffy-tw-transform spiffy-tw-transition-all", {
13
+ "spiffy-tw-translate-x-full": !isOpen,
14
+ "spiffy-tw-translate-x-0": isOpen
15
+ });
16
+ const overlayClasses = (0, classnames.default)("spiffy-tw-absolute spiffy-tw-inset-0 spiffy-tw-bg-black spiffy-tw-bg-opacity-50", {
17
+ "spiffy-tw-opacity-0": !isOpen,
18
+ "spiffy-tw-opacity-100": isOpen
19
+ });
20
+ const sidebarClasses = (0, classnames.default)("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");
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22
+ className: modalClasses,
23
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
24
+ className: overlayClasses,
25
+ onClick: () => setIsOpen(false)
26
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
27
+ className: sidebarClasses,
28
+ children: [
29
+ headerContent,
30
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
31
+ className: "spiffy-tw-flex-1 spiffy-tw-px-4 spiffy-tw-py-6",
32
+ children: filters.map((filter) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
33
+ className: "spiffy-tw-mb-6",
34
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
35
+ variant: "body2",
36
+ className: "spiffy-tw-font-medium spiffy-tw-mb-3",
37
+ children: filter.displayName
38
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: filter.items.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SearchFilterItem.SearchFilterItem, {
39
+ filterItem: item,
40
+ onSelectFilterItem: selectFilterItem,
41
+ radioButtonFillColor,
42
+ radioButtonHoverColor,
43
+ radioButtonUncheckedBorderColor
44
+ }, item.id)) })]
45
+ }, filter.id))
46
+ }),
47
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
48
+ className: "spiffy-tw-border-t spiffy-tw-border-[--spiffy-colors-border-light] spiffy-tw-px-4 spiffy-tw-py-3",
49
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
50
+ onClick: clearAllFilters,
51
+ text: "Clear All",
52
+ buttonClass: "spiffy-tw-w-full spiffy-tw-mb-2"
53
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ButtonBase.ButtonBase, {
54
+ onClick: () => setIsOpen(false),
55
+ text: filterButtonText,
56
+ buttonClass: "spiffy-tw-w-full"
57
+ })]
58
+ })
59
+ ]
60
+ })]
61
+ });
62
+ };
63
+
64
+ //#endregion
65
+ Object.defineProperty(exports, 'SearchFilter', {
66
+ enumerable: true,
67
+ get: function () {
68
+ return SearchFilter;
69
+ }
70
+ });
@@ -0,0 +1,37 @@
1
+ import { Text } from "./Text-Bdv7F5-u.js";
2
+ import classNames from "classnames";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+
5
+ //#region src/components/search/SearchFilter/SearchFilterHeader.tsx
6
+ const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterCloseIconVariant }) => {
7
+ const closeIconColor = filterCloseIconVariant === "dark" ? "var(--spiffy-colors-text-primary)" : "var(--spiffy-colors-text-light)";
8
+ return /* @__PURE__ */ jsxs("div", {
9
+ className: classNames("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3", headerClassName),
10
+ children: [/* @__PURE__ */ jsxs(Text, {
11
+ variant: "body2",
12
+ className: "spiffy-tw-font-medium",
13
+ children: [
14
+ "Filters (",
15
+ productCount,
16
+ ")"
17
+ ]
18
+ }), /* @__PURE__ */ jsx("button", {
19
+ onClick: closeModal,
20
+ className: "spiffy-tw-p-2",
21
+ children: /* @__PURE__ */ jsx("svg", {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ width: "14",
24
+ height: "14",
25
+ viewBox: "0 0 14 14",
26
+ fill: "none",
27
+ children: /* @__PURE__ */ jsx("path", {
28
+ 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",
29
+ fill: closeIconColor
30
+ })
31
+ })
32
+ })]
33
+ });
34
+ };
35
+
36
+ //#endregion
37
+ export { SearchFilterHeader };
@@ -0,0 +1,45 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_Text = require('./Text-C04c4Z93.cjs');
3
+ let classnames = require("classnames");
4
+ classnames = require_chunk.__toESM(classnames);
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
7
+
8
+ //#region src/components/search/SearchFilter/SearchFilterHeader.tsx
9
+ const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterCloseIconVariant }) => {
10
+ const closeIconColor = filterCloseIconVariant === "dark" ? "var(--spiffy-colors-text-primary)" : "var(--spiffy-colors-text-light)";
11
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
12
+ className: (0, classnames.default)("spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3", headerClassName),
13
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Text.Text, {
14
+ variant: "body2",
15
+ className: "spiffy-tw-font-medium",
16
+ children: [
17
+ "Filters (",
18
+ productCount,
19
+ ")"
20
+ ]
21
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
22
+ onClick: closeModal,
23
+ className: "spiffy-tw-p-2",
24
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
25
+ xmlns: "http://www.w3.org/2000/svg",
26
+ width: "14",
27
+ height: "14",
28
+ viewBox: "0 0 14 14",
29
+ fill: "none",
30
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
31
+ 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",
32
+ fill: closeIconColor
33
+ })
34
+ })
35
+ })]
36
+ });
37
+ };
38
+
39
+ //#endregion
40
+ Object.defineProperty(exports, 'SearchFilterHeader', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return SearchFilterHeader;
44
+ }
45
+ });
@@ -0,0 +1,26 @@
1
+ import { Text } from "./Text-Bdv7F5-u.js";
2
+ import classNames from "classnames";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+
5
+ //#region src/components/search/SearchFilter/SearchFilterItem.tsx
6
+ const SearchFilterItem = ({ filterItem, onSelectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor }) => {
7
+ const { displayName, isSelected } = filterItem;
8
+ const radioClasses = classNames("spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-rounded-full spiffy-tw-border-2", "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-center", radioButtonUncheckedBorderColor, radioButtonHoverColor, { [radioButtonFillColor]: isSelected });
9
+ return /* @__PURE__ */ jsxs("li", {
10
+ className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2 spiffy-tw-cursor-pointer",
11
+ onClick: () => onSelectFilterItem(filterItem),
12
+ children: [/* @__PURE__ */ jsx(Text, {
13
+ variant: "body3",
14
+ children: displayName
15
+ }), /* @__PURE__ */ jsx("div", {
16
+ className: radioClasses,
17
+ children: isSelected && /* @__PURE__ */ jsx("div", { className: classNames("spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-rounded-full", {
18
+ "spiffy-tw-bg-white": radioButtonFillColor.includes("spiffy-tw-bg-"),
19
+ "spiffy-tw-bg-black": radioButtonFillColor.includes("spiffy-tw-bg-white")
20
+ }) })
21
+ })]
22
+ });
23
+ };
24
+
25
+ //#endregion
26
+ export { SearchFilterItem };
@@ -0,0 +1,34 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_Text = require('./Text-C04c4Z93.cjs');
3
+ let classnames = require("classnames");
4
+ classnames = require_chunk.__toESM(classnames);
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
7
+
8
+ //#region src/components/search/SearchFilter/SearchFilterItem.tsx
9
+ const SearchFilterItem = ({ filterItem, onSelectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor }) => {
10
+ const { displayName, isSelected } = filterItem;
11
+ const radioClasses = (0, classnames.default)("spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-rounded-full spiffy-tw-border-2", "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-center", radioButtonUncheckedBorderColor, radioButtonHoverColor, { [radioButtonFillColor]: isSelected });
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
13
+ className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2 spiffy-tw-cursor-pointer",
14
+ onClick: () => onSelectFilterItem(filterItem),
15
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
16
+ variant: "body3",
17
+ children: displayName
18
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
19
+ className: radioClasses,
20
+ children: isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, classnames.default)("spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-rounded-full", {
21
+ "spiffy-tw-bg-white": radioButtonFillColor.includes("spiffy-tw-bg-"),
22
+ "spiffy-tw-bg-black": radioButtonFillColor.includes("spiffy-tw-bg-white")
23
+ }) })
24
+ })]
25
+ });
26
+ };
27
+
28
+ //#endregion
29
+ Object.defineProperty(exports, 'SearchFilterItem', {
30
+ enumerable: true,
31
+ get: function () {
32
+ return SearchFilterItem;
33
+ }
34
+ });
@@ -0,0 +1,89 @@
1
+ import { TextInput } from "./TextInput-CEGWfdPC.js";
2
+ import { ColorNames, colorVar } from "./colorsConfig-l0ODUVhu.js";
3
+ import classNames from "classnames";
4
+ import React, { useImperativeHandle, useRef } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import MagnifyingGlassStarVariant from "@envive-ai/react-icons/src/MagnifyingGlassStarVariant";
7
+ import CloseIcon from "@envive-ai/react-icons/src/IconClose";
8
+
9
+ //#region src/components/search/SearchInput/searchInputVariants.ts
10
+ const searchInputVariantClasses = { standard: {
11
+ searchInputIconColor: "transparent",
12
+ searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
13
+ searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
14
+ searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
15
+ autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
16
+ searchInputClasses: "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%]",
17
+ placeholderVariant: "h2"
18
+ } };
19
+
20
+ //#endregion
21
+ //#region src/components/search/SearchInput/SearchInput.tsx
22
+ const SearchInput = React.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
23
+ const localInputRef = useRef(null);
24
+ const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
25
+ useImperativeHandle(ref, () => localInputRef.current, []);
26
+ const magnifyingGlassClassesBase = [
27
+ "spiffy-tw-w-[24px]",
28
+ "spiffy-tw-h-[32px]",
29
+ "spiffy-tw-stroke-width-1",
30
+ "sm:spiffy-tw-w-[32px]"
31
+ ];
32
+ const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
33
+ const magnifyingGlassClassesActive = classNames([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
34
+ const containerClasses = classNames("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
35
+ const inputClasses = classNames("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
36
+ const closeButtonIconClassName = classNames([
37
+ "spiffy-tw-w-[16px]",
38
+ "spiffy-tw-h-[16px]",
39
+ "sm:spiffy-tw-w-[24px]",
40
+ "sm:spiffy-tw-h-[24px]",
41
+ "spiffy-tw-cursor-pointer",
42
+ closeIconClasses
43
+ ]);
44
+ return /* @__PURE__ */ jsxs("div", {
45
+ className: containerClasses,
46
+ "data-testid": dataTestId,
47
+ children: [
48
+ /* @__PURE__ */ jsx("div", {
49
+ className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
50
+ children: /* @__PURE__ */ jsx(MagnifyingGlassStarVariant, {
51
+ className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
52
+ stroke: iconColor,
53
+ strokeWidth: "1px"
54
+ })
55
+ }),
56
+ /* @__PURE__ */ jsx(TextInput, {
57
+ value,
58
+ onChange: (event) => onChange(event.target.value),
59
+ onFocus,
60
+ onBlur,
61
+ onKeyDown,
62
+ placeholder,
63
+ className: inputClasses,
64
+ placeholderVariant,
65
+ "aria-label": "Search",
66
+ "aria-autocomplete": "list",
67
+ "aria-expanded": !!suggestions && suggestions.length > 0,
68
+ "aria-controls": "autocomplete-results",
69
+ "aria-activedescendant": ariaActivedescendant,
70
+ borderRadius: "xl",
71
+ borderColorClass: borderColor,
72
+ ref: localInputRef
73
+ }),
74
+ value && /* @__PURE__ */ jsx("button", {
75
+ onClick: () => {
76
+ onChange("");
77
+ localInputRef.current?.focus();
78
+ },
79
+ 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",
80
+ "aria-label": "Clear search input",
81
+ type: "button",
82
+ children: /* @__PURE__ */ jsx(CloseIcon, { className: closeButtonIconClassName })
83
+ })
84
+ ]
85
+ });
86
+ });
87
+
88
+ //#endregion
89
+ export { SearchInput, searchInputVariantClasses };
@@ -0,0 +1,106 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_TextInput = require('./TextInput-BO80ixsV.cjs');
3
+ const require_colorsConfig = require('./colorsConfig-TCONYTQ7.cjs');
4
+ let classnames = require("classnames");
5
+ classnames = require_chunk.__toESM(classnames);
6
+ let react = require("react");
7
+ react = require_chunk.__toESM(react);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
10
+ let __envive_ai_react_icons_src_MagnifyingGlassStarVariant = require("@envive-ai/react-icons/src/MagnifyingGlassStarVariant");
11
+ __envive_ai_react_icons_src_MagnifyingGlassStarVariant = require_chunk.__toESM(__envive_ai_react_icons_src_MagnifyingGlassStarVariant);
12
+ let __envive_ai_react_icons_src_IconClose = require("@envive-ai/react-icons/src/IconClose");
13
+ __envive_ai_react_icons_src_IconClose = require_chunk.__toESM(__envive_ai_react_icons_src_IconClose);
14
+
15
+ //#region src/components/search/SearchInput/searchInputVariants.ts
16
+ const searchInputVariantClasses = { standard: {
17
+ searchInputIconColor: "transparent",
18
+ searchInputBorderColor: "spiffy-tw-border-[--spiffy-colors-border-medium]",
19
+ searchInputCloseIconClasses: "[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]",
20
+ searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
21
+ autocompleteIconColor: require_colorsConfig.colorVar(require_colorsConfig.ColorNames.BackgroundPrimary),
22
+ searchInputClasses: "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%]",
23
+ placeholderVariant: "h2"
24
+ } };
25
+
26
+ //#endregion
27
+ //#region src/components/search/SearchInput/SearchInput.tsx
28
+ const SearchInput = react.default.forwardRef(({ searchInputVariant = "standard", value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur }, ref) => {
29
+ const localInputRef = (0, react.useRef)(null);
30
+ const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant } = searchInputVariantClasses[searchInputVariant];
31
+ (0, react.useImperativeHandle)(ref, () => localInputRef.current, []);
32
+ const magnifyingGlassClassesBase = [
33
+ "spiffy-tw-w-[24px]",
34
+ "spiffy-tw-h-[32px]",
35
+ "spiffy-tw-stroke-width-1",
36
+ "sm:spiffy-tw-w-[32px]"
37
+ ];
38
+ const magnifyingGlassClassesInactive = (0, classnames.default)(magnifyingGlassClassesBase);
39
+ const magnifyingGlassClassesActive = (0, classnames.default)([...magnifyingGlassClassesBase, searchInputActiveStarClasses]);
40
+ const containerClasses = (0, classnames.default)("spiffy-global-search-input-container", "spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center", className);
41
+ const inputClasses = (0, classnames.default)("spiffy-global-search-input", "spiffy-tw-flex-grow spiffy-tw-p-2 spiffy-tw-px-[42px] sm:spiffy-tw-p-3 sm:spiffy-tw-px-[48px]", "spiffy-tw-border", "spiffy-tw-text-base", inputClassName);
42
+ const closeButtonIconClassName = (0, classnames.default)([
43
+ "spiffy-tw-w-[16px]",
44
+ "spiffy-tw-h-[16px]",
45
+ "sm:spiffy-tw-w-[24px]",
46
+ "sm:spiffy-tw-h-[24px]",
47
+ "spiffy-tw-cursor-pointer",
48
+ closeIconClasses
49
+ ]);
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
51
+ className: containerClasses,
52
+ "data-testid": dataTestId,
53
+ children: [
54
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
55
+ className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2",
56
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_MagnifyingGlassStarVariant.default, {
57
+ className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive,
58
+ stroke: iconColor,
59
+ strokeWidth: "1px"
60
+ })
61
+ }),
62
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TextInput.TextInput, {
63
+ value,
64
+ onChange: (event) => onChange(event.target.value),
65
+ onFocus,
66
+ onBlur,
67
+ onKeyDown,
68
+ placeholder,
69
+ className: inputClasses,
70
+ placeholderVariant,
71
+ "aria-label": "Search",
72
+ "aria-autocomplete": "list",
73
+ "aria-expanded": !!suggestions && suggestions.length > 0,
74
+ "aria-controls": "autocomplete-results",
75
+ "aria-activedescendant": ariaActivedescendant,
76
+ borderRadius: "xl",
77
+ borderColorClass: borderColor,
78
+ ref: localInputRef
79
+ }),
80
+ value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
81
+ onClick: () => {
82
+ onChange("");
83
+ localInputRef.current?.focus();
84
+ },
85
+ 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",
86
+ "aria-label": "Clear search input",
87
+ type: "button",
88
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_IconClose.default, { className: closeButtonIconClassName })
89
+ })
90
+ ]
91
+ });
92
+ });
93
+
94
+ //#endregion
95
+ Object.defineProperty(exports, 'SearchInput', {
96
+ enumerable: true,
97
+ get: function () {
98
+ return SearchInput;
99
+ }
100
+ });
101
+ Object.defineProperty(exports, 'searchInputVariantClasses', {
102
+ enumerable: true,
103
+ get: function () {
104
+ return searchInputVariantClasses;
105
+ }
106
+ });
@@ -0,0 +1,96 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ let classnames = require("classnames");
3
+ classnames = require_chunk.__toESM(classnames);
4
+ let react = require("react");
5
+ react = require_chunk.__toESM(react);
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
8
+ let framer_motion = require("framer-motion");
9
+ framer_motion = require_chunk.__toESM(framer_motion);
10
+ let __envive_ai_react_icons_src_FourPointStar = require("@envive-ai/react-icons/src/FourPointStar");
11
+ __envive_ai_react_icons_src_FourPointStar = require_chunk.__toESM(__envive_ai_react_icons_src_FourPointStar);
12
+
13
+ //#region src/components/common/SparkleAnimation/types.ts
14
+ let SparkleAnimationOverride = /* @__PURE__ */ function(SparkleAnimationOverride$1) {
15
+ SparkleAnimationOverride$1["CONTAINER"] = "spiffy-sparkle-animation-container";
16
+ SparkleAnimationOverride$1["STAR_ONE_CONTAINER"] = "spiffy-sparkle-animation-star-one-container";
17
+ SparkleAnimationOverride$1["STAR_TWO_CONTAINER"] = "spiffy-sparkle-animation-star-two-container";
18
+ SparkleAnimationOverride$1["STAR_THREE_CONTAINER"] = "spiffy-sparkle-animation-star-three-container";
19
+ return SparkleAnimationOverride$1;
20
+ }({});
21
+
22
+ //#endregion
23
+ //#region src/components/common/SparkleAnimation/SparkleAnimation.tsx
24
+ const ANIMATION_CYCLE_TIME = 1e3;
25
+ const STAR_DELAY_OFFSET = 250;
26
+ const SparkleAnimation = ({ color, className, animate = true }) => {
27
+ const [mainStarScale, setMainStarScale] = (0, react.useState)(animate ? 0 : 1);
28
+ const [smallStar1Scale, setSmallStar1Scale] = (0, react.useState)(animate ? 0 : 1);
29
+ const [smallStar2Scale, setSmallStar2Scale] = (0, react.useState)(animate ? 0 : 1);
30
+ const containerClasses = (0, classnames.default)(SparkleAnimationOverride.CONTAINER, "spiffy-tw-w-6 spiffy-tw-h-6 spiffy-tw-relative", className);
31
+ (0, react.useEffect)(() => {
32
+ if (!animate) {
33
+ setMainStarScale(1);
34
+ setSmallStar1Scale(1);
35
+ setSmallStar2Scale(1);
36
+ return;
37
+ }
38
+ }, [animate]);
39
+ (0, react.useEffect)(() => {
40
+ if (!animate) return;
41
+ const newScale = mainStarScale === 1 ? 0 : 1;
42
+ setTimeout(() => setMainStarScale(newScale), ANIMATION_CYCLE_TIME);
43
+ setTimeout(() => setSmallStar1Scale(newScale), ANIMATION_CYCLE_TIME + STAR_DELAY_OFFSET);
44
+ setTimeout(() => setSmallStar2Scale(newScale), ANIMATION_CYCLE_TIME + 2 * STAR_DELAY_OFFSET);
45
+ }, [mainStarScale, animate]);
46
+ const starTransition = {
47
+ duration: .3,
48
+ ease: "easeOut"
49
+ };
50
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
51
+ className: containerClasses,
52
+ children: [
53
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
54
+ className: (0, classnames.default)(SparkleAnimationOverride.STAR_ONE_CONTAINER, "spiffy-tw-absolute -spiffy-tw-top-[2px] spiffy-tw-left-0"),
55
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
56
+ animate: { scale: mainStarScale },
57
+ transition: starTransition,
58
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_FourPointStar.default, {
59
+ fill: color,
60
+ className: "spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-inline-block"
61
+ })
62
+ })
63
+ }),
64
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65
+ className: (0, classnames.default)(SparkleAnimationOverride.STAR_TWO_CONTAINER, "spiffy-tw-absolute -spiffy-tw-top-[7px] spiffy-tw-left-[10px]"),
66
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
67
+ animate: { scale: smallStar1Scale },
68
+ transition: starTransition,
69
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_FourPointStar.default, {
70
+ fill: color,
71
+ className: "spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-inline-block"
72
+ })
73
+ })
74
+ }),
75
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
76
+ className: (0, classnames.default)(SparkleAnimationOverride.STAR_THREE_CONTAINER, "spiffy-tw-absolute spiffy-tw-top-[1px] spiffy-tw-left-[12px]"),
77
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
78
+ animate: { scale: smallStar2Scale },
79
+ transition: starTransition,
80
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__envive_ai_react_icons_src_FourPointStar.default, {
81
+ fill: color,
82
+ className: "spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-inline-block"
83
+ })
84
+ })
85
+ })
86
+ ]
87
+ });
88
+ };
89
+
90
+ //#endregion
91
+ Object.defineProperty(exports, 'SparkleAnimation', {
92
+ enumerable: true,
93
+ get: function () {
94
+ return SparkleAnimation;
95
+ }
96
+ });