@envive-ai/react-toolkit 0.2.12 → 0.2.13

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 (180) hide show
  1. package/dist/{Accordion-B0TzPN3m.cjs → Accordion-Bc3o-NjV.cjs} +2 -2
  2. package/dist/{AnimatedChevron-9xf90bpP.cjs → AnimatedChevron-BKQrUKb5.cjs} +1 -1
  3. package/dist/{ButtonBase-BMEAmPnS.cjs → ButtonBase-Bm_QOyM1.cjs} +2 -2
  4. package/dist/{DynamicFiltersScrollbar-DqIydLJu.cjs → DynamicFiltersScrollbar-bT3VoG-D.cjs} +2 -2
  5. package/dist/{ImageWithFallback-CuPe6XF6.cjs → ImageWithFallback-BiBjNK-9.cjs} +1 -1
  6. package/dist/{ModalSheet-Be7-bkXK.cjs → ModalSheet-BuCtRDnQ.cjs} +2 -2
  7. package/dist/{ProductCard-BeY85PBf.cjs → ProductCard-C3seoFWE.cjs} +5 -5
  8. package/dist/{ProductCard-BoyYu6mI.js → ProductCard-ChitHvuc.js} +1 -1
  9. package/dist/{ProductGrid-CxKK7w_X.cjs → ProductGrid-Ct2DvLGf.cjs} +2 -2
  10. package/dist/{ProductGrid-DmtSXfyE.js → ProductGrid-DukHo_KY.js} +1 -1
  11. package/dist/{RadioButton-Dcdj8pNp.cjs → RadioButton-D4TPq1Aa.cjs} +2 -2
  12. package/dist/{RadioButtonGroup-hme7gSiQ.js → RadioButtonGroup-BWQ4-m2M.js} +1 -1
  13. package/dist/{RadioButtonGroup-BnnMx8sE.cjs → RadioButtonGroup-BhZloLH6.cjs} +2 -2
  14. package/dist/{RecommendedProducts-C2eNVrLo.cjs → RecommendedProducts-Cy-1szYc.cjs} +3 -3
  15. package/dist/{RecommendedProducts-LalI8aVC.js → RecommendedProducts-DooGvLFT.js} +1 -1
  16. package/dist/{SearchAutocomplete-A3HXkHwK.cjs → SearchAutocomplete-C1XH39Xx.cjs} +3 -3
  17. package/dist/{SearchAutocomplete-Rza3A-gs.js → SearchAutocomplete-CuuN0cDu.js} +1 -1
  18. package/dist/{SearchFilter-DxrQOLx0.cjs → SearchFilter-CnP71PTj.cjs} +8 -8
  19. package/dist/{SearchFilter-CYY5sNXV.js → SearchFilter-DsYF1A5n.js} +2 -2
  20. package/dist/{SearchInput-3ppsm2Ke.cjs → SearchInput-Cgsjew8Q.cjs} +2 -2
  21. package/dist/{SearchInputForm-DrI4WHDt.js → SearchInputForm--CvVrjwl.js} +4 -3
  22. package/dist/{SearchInputForm-CZz62rOX.cjs → SearchInputForm-CSd4tjts.cjs} +6 -5
  23. package/dist/{SearchResultsFilterButton-BedTofz5.cjs → SearchResultsFilterButton-BQqm4icD.cjs} +2 -2
  24. package/dist/{SearchResultsFilterSidebar-Dgz98oyD.cjs → SearchResultsFilterSidebar-U6dFy-Jo.cjs} +3 -3
  25. package/dist/{SearchResultsFilterSidebar-Bvpk7Uoo.js → SearchResultsFilterSidebar-ydSo1S6h.js} +1 -1
  26. package/dist/{SearchResultsStates-DrGtw0pM.js → SearchResultsStates-BCeqeo9y.js} +9 -9
  27. package/dist/{SearchResultsStates-D37wFr9h.cjs → SearchResultsStates-Dp-AsmH8.cjs} +12 -12
  28. package/dist/{SparkleAnimation-B5A_NCuy.cjs → SparkleAnimation-Bg5qax1t.cjs} +6 -6
  29. package/dist/{SparkleAnimation-BSI_34HX.js → SparkleAnimation-HY4cgwE3.js} +5 -5
  30. package/dist/{Spinner-FQpy5bGu.cjs → Spinner-CUrXDajS.cjs} +1 -1
  31. package/dist/{TextInput-Do5-j1V_.cjs → TextInput-DfCocKVm.cjs} +2 -2
  32. package/dist/{ToggleButton-CmxTz-ou.cjs → ToggleButton-BhBEOjxO.cjs} +2 -2
  33. package/dist/{Typography-Ds4gfOJz.cjs → Typography-Csg-nd_w.cjs} +1 -1
  34. package/dist/{chunk-CUT6urMc.cjs → chunk-CbDLau6x.cjs} +10 -6
  35. package/dist/components/Accordion/{index-DBEaF9x5.d.ts → index-D_7-KJa0.d.cts} +2 -2
  36. package/dist/components/Accordion/index.cjs +2 -2
  37. package/dist/components/AnimatedChevron/{index-Bvff3AGS.d.ts → index-BfdaL9eW.d.cts} +2 -2
  38. package/dist/components/AnimatedChevron/{index-BwQ6tJL8.d.cts → index-bNdUYDzX.d.ts} +2 -2
  39. package/dist/components/AnimatedChevron/index.cjs +1 -1
  40. package/dist/components/AppliedFiltersScrollbar/{index-DADY550R.d.cts → index-B68Mx16E.d.cts} +2 -2
  41. package/dist/components/AppliedFiltersScrollbar/{index-BKNoroAl.d.ts → index-B9u7XRmf.d.ts} +2 -2
  42. package/dist/components/AppliedFiltersScrollbar/index.cjs +2 -2
  43. package/dist/components/ButtonBase/{index-pBSmWoqg.d.cts → index-3ltL6jhO.d.ts} +3 -3
  44. package/dist/components/ButtonBase/{index-BCw2WQ-2.d.ts → index-CcVRnbuQ.d.cts} +3 -3
  45. package/dist/components/ButtonBase/index.cjs +2 -2
  46. package/dist/components/DynamicFiltersScrollbar/{index-BvAT64cX.d.ts → index-B483Jhki.d.cts} +2 -2
  47. package/dist/components/DynamicFiltersScrollbar/{index-X--ALCSa.d.cts → index-B_a6Oebn.d.ts} +2 -2
  48. package/dist/components/DynamicFiltersScrollbar/index.cjs +2 -2
  49. package/dist/components/FilterScrollbar/{index-xlg1Q06Q.d.ts → index-BmHm47DA.d.cts} +3 -3
  50. package/dist/components/FilterScrollbar/{index-DgxXE1ff.d.cts → index-CISEdkBM.d.ts} +3 -3
  51. package/dist/components/FilterScrollbar/index.cjs +2 -2
  52. package/dist/components/ImageWithFallback/{index-C8Fqb7AQ.d.cts → index-CCWzf6ZV.d.ts} +2 -2
  53. package/dist/components/ImageWithFallback/{index-yxDWrUCQ.d.ts → index-Dk89vxqv.d.cts} +2 -2
  54. package/dist/components/ImageWithFallback/index.cjs +1 -1
  55. package/dist/components/ModalSheet/{index-Cp_h5dbe.d.ts → index-CI0qFVA7.d.ts} +2 -2
  56. package/dist/components/ModalSheet/{index-Dnt-aUte.d.cts → index-C_8baIZK.d.cts} +2 -2
  57. package/dist/components/ModalSheet/index.cjs +2 -2
  58. package/dist/components/ProductCard/{index-BF8pv46P.d.ts → index-D5om2RVT.d.ts} +1 -1
  59. package/dist/components/ProductCard/{index-C6TLdXjC.d.cts → index-Djjvdeh7.d.cts} +1 -1
  60. package/dist/components/ProductCard/index.cjs +4 -4
  61. package/dist/components/ProductCard/index.js +1 -1
  62. package/dist/components/ProductGrid/{index-CyDy1V6o.d.ts → index-AxMBGLVk.d.ts} +3 -3
  63. package/dist/components/ProductGrid/{index-B1eVXjB4.d.cts → index-C4Tz_KWs.d.cts} +3 -3
  64. package/dist/components/ProductGrid/index.cjs +5 -5
  65. package/dist/components/ProductGrid/index.js +2 -2
  66. package/dist/components/RadioButton/{index-BHl3dM6k.d.cts → index-BWo-a19v.d.ts} +2 -2
  67. package/dist/components/RadioButton/{index-BZrcz8-J.d.ts → index-DsVASVAv.d.cts} +2 -2
  68. package/dist/components/RadioButton/index.cjs +2 -2
  69. package/dist/components/RadioButton/index.js +1 -1
  70. package/dist/components/RadioButtonGroup/{index-DtdjcXo-.d.cts → index-CiljmnzJ.d.cts} +2 -2
  71. package/dist/components/RadioButtonGroup/index.cjs +3 -3
  72. package/dist/components/RadioButtonGroup/index.js +2 -2
  73. package/dist/components/RecommendedProducts/index.cjs +6 -7
  74. package/dist/components/RecommendedProducts/index.js +3 -4
  75. package/dist/components/SearchAutocomplete/{index-Br_POGOz.d.ts → index-BBUrFTl5.d.ts} +2 -2
  76. package/dist/components/SearchAutocomplete/{index-Ce9gkkbU.d.cts → index-OVMqT8K4.d.cts} +2 -2
  77. package/dist/components/SearchAutocomplete/index.cjs +2 -2
  78. package/dist/components/SearchAutocomplete/index.js +1 -1
  79. package/dist/components/SearchFilter/{index-DAR4UKSA.d.cts → index-BDaLJW2Q.d.cts} +5 -5
  80. package/dist/components/SearchFilter/{index-VygXUBM9.d.ts → index-DESOqSJQ.d.ts} +5 -5
  81. package/dist/components/SearchFilter/index.cjs +9 -9
  82. package/dist/components/SearchFilter/index.js +3 -3
  83. package/dist/components/SearchInput/index.cjs +3 -3
  84. package/dist/components/SearchInputForm/{index-dlLBivQA.d.cts → index-B3A17s3e.d.cts} +5 -3
  85. package/dist/components/SearchInputForm/{index-_sR_KugL.d.ts → index-D1F37qNH.d.ts} +3 -1
  86. package/dist/components/SearchInputForm/index.cjs +5 -5
  87. package/dist/components/SearchInputForm/index.js +2 -2
  88. package/dist/components/SearchResultsContent/{index-CayvNVCK.d.cts → index-B66EnbgF.d.cts} +4 -4
  89. package/dist/components/SearchResultsContent/{index-B_6-7-t-.d.ts → index-BI4Dm7mI.d.ts} +2 -2
  90. package/dist/components/SearchResultsContent/index.cjs +10 -10
  91. package/dist/components/SearchResultsContent/index.js +5 -5
  92. package/dist/components/SearchResultsFilterButton/{index-DuTGqa7-.d.ts → index-CCVZZUTR.d.cts} +2 -2
  93. package/dist/components/SearchResultsFilterButton/{index-D_u8PzTc.d.cts → index-Cjq_NOxx.d.ts} +2 -2
  94. package/dist/components/SearchResultsFilterButton/index.cjs +3 -4
  95. package/dist/components/SearchResultsFilterButton/index.js +0 -1
  96. package/dist/components/SearchResultsFilterModal/{index-BNZEJiXR.d.cts → index-Ba84MNoM.d.ts} +3 -3
  97. package/dist/components/SearchResultsFilterModal/{index-CXBAA2-F.d.ts → index-CMWDFJWT.d.cts} +3 -3
  98. package/dist/components/SearchResultsFilterModal/index.cjs +11 -12
  99. package/dist/components/SearchResultsFilterModal/index.js +4 -5
  100. package/dist/components/SearchResultsFilterSidebar/{index-BDcl27l4.d.ts → index-DmO55w4A.d.ts} +1 -1
  101. package/dist/components/SearchResultsFilterSidebar/{index-DgPB1knO.d.cts → index-Dtr9q9hT.d.cts} +1 -1
  102. package/dist/components/SearchResultsFilterSidebar/index.cjs +10 -10
  103. package/dist/components/SearchResultsFilterSidebar/index.js +4 -4
  104. package/dist/components/SearchResultsStates/{index-CjYl1v-v.d.cts → index-Ba3tQMCI.d.ts} +2 -2
  105. package/dist/components/SearchResultsStates/{index-DJaUfKjE.d.ts → index-DN1-g87W.d.cts} +6 -6
  106. package/dist/components/SearchResultsStates/index.cjs +9 -9
  107. package/dist/components/SearchResultsStates/index.js +5 -5
  108. package/dist/components/SearchResultsToolbar/{index-CVstdvRQ.d.cts → index-M8RkRW3H.d.cts} +2 -2
  109. package/dist/components/SearchResultsToolbar/{index-tAB6lEUm.d.ts → index-_hxKcDDT.d.ts} +2 -2
  110. package/dist/components/SearchResultsToolbar/index.cjs +11 -10
  111. package/dist/components/SearchResultsToolbar/index.js +6 -5
  112. package/dist/components/SparkleAnimation/{index-DjRK3Dys.d.ts → index-BMrS1PDU.d.cts} +2 -2
  113. package/dist/components/SparkleAnimation/{index-BQOC3G_6.d.cts → index-t59eI0td.d.ts} +2 -2
  114. package/dist/components/SparkleAnimation/index.cjs +1 -1
  115. package/dist/components/SparkleAnimation/index.js +1 -1
  116. package/dist/components/Spinner/{index-CIr1izou.d.ts → index-C876igqb.d.ts} +2 -2
  117. package/dist/components/Spinner/{index-C0pGovHC.d.cts → index-DrYhRG9D.d.cts} +2 -2
  118. package/dist/components/Spinner/index.cjs +1 -1
  119. package/dist/components/SuggestionButton/{index-B4J70IPS.d.cts → index-CrGSb18s.d.ts} +2 -2
  120. package/dist/components/SuggestionButton/{index-D6_y1hTj.d.ts → index-DfQRQGev.d.cts} +2 -2
  121. package/dist/components/SuggestionButton/index.cjs +3 -3
  122. package/dist/components/TextInput/index.cjs +2 -2
  123. package/dist/components/ToggleButton/{index-Dc-cs_tK.d.ts → index-CpURpMq5.d.cts} +2 -2
  124. package/dist/components/ToggleButton/index.cjs +2 -2
  125. package/dist/components/Typography/index.cjs +1 -1
  126. package/dist/{index-CqfgJHj8.d.cts → index-1GZFptEC.d.cts} +4 -4
  127. package/dist/{index-8cIrhPDk.d.ts → index-CBI4Lqsm.d.cts} +2 -2
  128. package/dist/{index-Cz6qxTZG.d.ts → index-yDKT5Bem.d.ts} +4 -4
  129. package/dist/util/index.cjs +1 -1
  130. package/package.json +15 -2
  131. package/src/components/Accordion/Accordion.tsx +4 -1
  132. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +5 -2
  133. package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +4 -1
  134. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +5 -2
  135. package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +4 -1
  136. package/src/components/ModalSheet/common/closeIcon.tsx +5 -1
  137. package/src/components/ModalSheet/desktop/index.tsx +1 -1
  138. package/src/components/ModalSheet/mobile/index.tsx +1 -1
  139. package/src/components/ModalSheet/mobile/mobileHeader.tsx +4 -1
  140. package/src/components/ProductCard/ProductCard.tsx +26 -12
  141. package/src/components/ProductCard/productCardVariants.ts +1 -1
  142. package/src/components/ProductGrid/ProductGrid.tsx +5 -2
  143. package/src/components/RadioButton/RadioButton.tsx +15 -2
  144. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +1 -1
  145. package/src/components/RecommendedProducts/RecommendedProducts.tsx +11 -9
  146. package/src/components/RecommendedProducts/index.ts +1 -1
  147. package/src/components/SearchAutocomplete/SearchAutocomplete.tsx +25 -19
  148. package/src/components/SearchFilter/SearchFilter.tsx +24 -10
  149. package/src/components/SearchFilter/SearchFilterHeader.tsx +4 -1
  150. package/src/components/SearchFilter/SearchFilterItem.tsx +3 -3
  151. package/src/components/SearchFilter/useHasFilterStateChanged.tsx +4 -4
  152. package/src/components/SearchInput/SearchInput.tsx +6 -2
  153. package/src/components/SearchInput/searchInputVariants.ts +1 -1
  154. package/src/components/SearchInputForm/SearchInputForm.tsx +7 -7
  155. package/src/components/SearchResultsContent/SearchResultsContent.tsx +1 -1
  156. package/src/components/SearchResultsFilterModal/SearchResultsFilterModal.tsx +4 -1
  157. package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +1 -1
  158. package/src/components/SearchResultsStates/NoSearchResultsFound.tsx +2 -2
  159. package/src/components/SearchResultsStates/SearchResultsGrid.tsx +2 -2
  160. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +9 -5
  161. package/src/components/SearchResultsToolbar/SearchResultsToolbar.tsx +10 -7
  162. package/src/components/SparkleAnimation/SparkleAnimation.tsx +17 -8
  163. package/src/components/SuggestionButton/SuggestionButton.tsx +5 -5
  164. package/src/components/SuggestionButton/types.ts +1 -1
  165. package/src/components/TextInput/TextInput.tsx +9 -2
  166. package/src/components/ToggleButton/ToggleButton.tsx +13 -3
  167. package/src/components/Typography/Typography.spec.tsx +1 -1
  168. package/src/components/Typography/util.ts +2 -2
  169. package/src/models/colorsConfig.ts +2 -1
  170. package/src/stories/NoSearchResultsFound.stories.tsx +7 -0
  171. package/src/stories/SearchResultsFilter.stories.tsx +1 -1
  172. package/src/stories/SparkleAnimation.stories.tsx +5 -2
  173. package/src/util/camelCasedPropertiesDeep.ts +0 -1
  174. package/src/util/colorVar.ts +1 -1
  175. package/src/util/useScrollDirection.ts +1 -1
  176. package/src/util/useStickyVisibility.ts +1 -1
  177. /package/dist/{RadioButton-Bm0qK3bX.js → RadioButton-C1w7N40t.js} +0 -0
  178. /package/dist/components/Accordion/{index-BPofgdcd.d.cts → index-DJOd-3Pi.d.ts} +0 -0
  179. /package/dist/components/ToggleButton/{index-B2rBwaVX.d.cts → index-DFz4kch0.d.ts} +0 -0
  180. /package/dist/{index-BKYA7uMB.d.cts → index-pZZXXUG_.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  'use client';
2
2
 
3
- export * from './RecommendedProducts';
3
+ export * from './RecommendedProducts';
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/no-array-index-key */
1
2
  import React from 'react';
2
3
  import { motion } from 'framer-motion';
3
4
  import classNames from 'classnames';
@@ -39,7 +40,10 @@ export const SearchAutocomplete = ({
39
40
  {parts.map((part, index) => {
40
41
  const isMatch = part.toLowerCase() === searchQuery.toLowerCase();
41
42
  return isMatch ? (
42
- <strong key={index} className="spiffy-tw-font-bold">
43
+ <strong
44
+ key={index}
45
+ className="spiffy-tw-font-bold"
46
+ >
43
47
  {part}
44
48
  </strong>
45
49
  ) : (
@@ -50,21 +54,19 @@ export const SearchAutocomplete = ({
50
54
  );
51
55
  };
52
56
 
53
- const containerClasses = classNames(
54
- 'spiffy-tw-mt-[16px]',
55
- 'spiffy-tw-mb-[8px]',
56
- );
57
+ const containerClasses = classNames('spiffy-tw-mt-[16px]', 'spiffy-tw-mb-[8px]');
57
58
 
58
- const getListElementClasses = (index: number) => classNames(
59
- 'spiffy-tw-flex',
60
- 'spiffy-tw-items-center',
61
- 'spiffy-tw-cursor-pointer',
62
- 'spiffy-tw-py-[8px]',
63
- 'spiffy-tw-pl-[16px]',
64
- 'spiffy-tw-text-[--spiffy-colors-text-primary]',
65
- 'hover:spiffy-tw-bg-neutral-100',
66
- { 'spiffy-tw-bg-neutral-200': focusedIndex === index },
67
- );
59
+ const getListElementClasses = (index: number) =>
60
+ classNames(
61
+ 'spiffy-tw-flex',
62
+ 'spiffy-tw-items-center',
63
+ 'spiffy-tw-cursor-pointer',
64
+ 'spiffy-tw-py-[8px]',
65
+ 'spiffy-tw-pl-[16px]',
66
+ 'spiffy-tw-text-[--spiffy-colors-text-primary]',
67
+ 'hover:spiffy-tw-bg-neutral-100',
68
+ { 'spiffy-tw-bg-neutral-200': focusedIndex === index },
69
+ );
68
70
 
69
71
  return (
70
72
  <motion.div
@@ -74,7 +76,11 @@ export const SearchAutocomplete = ({
74
76
  exit={{ opacity: 0, y: -10 }}
75
77
  transition={{ duration: 0.2 }}
76
78
  >
77
- <ul id={id} role="listbox" className={containerClasses}>
79
+ <ul
80
+ id={id}
81
+ role="listbox"
82
+ className={containerClasses}
83
+ >
78
84
  {results.map((result, index) => (
79
85
  <li
80
86
  key={index}
@@ -83,14 +89,14 @@ export const SearchAutocomplete = ({
83
89
  aria-selected={index === focusedIndex}
84
90
  className={getListElementClasses(index)}
85
91
  onClick={() => onSuggestionSelect(result, index)}
86
- onKeyDown={(event) => {
92
+ onKeyDown={event => {
87
93
  if (event.key === 'Enter' || event.keyCode === 13) {
88
94
  onSuggestionSelect(result, index);
89
95
  }
90
96
  }}
91
97
  >
92
98
  <OutlinedStar
93
- className="spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-[16px]"
99
+ className="spiffy-tw-mr-[16px] spiffy-tw-h-[16px] spiffy-tw-w-[16px]"
94
100
  fill={iconColor}
95
101
  />
96
102
  {highlightMatchingText(result, searchText)}
@@ -99,4 +105,4 @@ export const SearchAutocomplete = ({
99
105
  </ul>
100
106
  </motion.div>
101
107
  );
102
- };
108
+ };
@@ -20,7 +20,7 @@ const SortFilter = ({
20
20
  }: FilterProps) => {
21
21
  const filterTitle = filter.displayName;
22
22
 
23
- const options = filter.items.map((item) => ({
23
+ const options = filter.items.map(item => ({
24
24
  label: item.displayName,
25
25
  value: item.filterItemId,
26
26
  isSelected: item.isSelected,
@@ -30,8 +30,8 @@ const SortFilter = ({
30
30
  <RadioButtonGroup
31
31
  options={options}
32
32
  name={filterTitle}
33
- onChange={(value) => {
34
- const selectedItem = filter.items.find((item) => item.filterItemId === value);
33
+ onChange={value => {
34
+ const selectedItem = filter.items.find(item => item.filterItemId === value);
35
35
  selectFilterItem({
36
36
  filterId: filter.filterId,
37
37
  filterItemId: value,
@@ -41,14 +41,19 @@ const SortFilter = ({
41
41
  }}
42
42
  gap="large"
43
43
  textButtonGap="large"
44
- value={filter.items.find((item) => item.isSelected)?.filterItemId}
44
+ value={filter.items.find(item => item.isSelected)?.filterItemId}
45
45
  fillColor={radioButtonFillColor}
46
46
  hoverColor={radioButtonHoverColor}
47
47
  uncheckedBorderColor={radioButtonUncheckedBorderColor}
48
48
  />
49
49
  );
50
50
 
51
- return <Accordion title={filterTitle} content={content} />;
51
+ return (
52
+ <Accordion
53
+ title={filterTitle}
54
+ content={content}
55
+ />
56
+ );
52
57
  };
53
58
 
54
59
  const FilterItem = ({ filterId, filterItem, selectFilterItem }: FilterItemProps) => (
@@ -82,7 +87,7 @@ const Filter = ({ filter, selectFilterItem }: FilterProps) => {
82
87
  selectedFilterItems > 0 ? `${filter.displayName} (${selectedFilterItems})` : filter.displayName;
83
88
  const content = (
84
89
  <div className={filterContentClassName}>
85
- {filter.items.map((item) => (
90
+ {filter.items.map(item => (
86
91
  <FilterItem
87
92
  key={item.filterItemId}
88
93
  filterId={filter.filterId}
@@ -92,7 +97,12 @@ const Filter = ({ filter, selectFilterItem }: FilterProps) => {
92
97
  ))}
93
98
  </div>
94
99
  );
95
- return <Accordion title={filterTitle} content={content} />;
100
+ return (
101
+ <Accordion
102
+ title={filterTitle}
103
+ content={content}
104
+ />
105
+ );
96
106
  };
97
107
 
98
108
  export const SearchFilter = ({
@@ -157,8 +167,8 @@ export const SearchFilter = ({
157
167
  >
158
168
  <div className={filterWrapperClassName}>
159
169
  {filters
160
- .filter((filter) => filter.displayName !== '')
161
- .map((filter) => {
170
+ .filter(filter => filter.displayName !== '')
171
+ .map(filter => {
162
172
  if (filter.filterId === 'sort') {
163
173
  return (
164
174
  <SortFilter
@@ -172,7 +182,11 @@ export const SearchFilter = ({
172
182
  );
173
183
  }
174
184
  return (
175
- <Filter key={filter.filterId} filter={filter} selectFilterItem={selectFilterItem} />
185
+ <Filter
186
+ key={filter.filterId}
187
+ filter={filter}
188
+ selectFilterItem={selectFilterItem}
189
+ />
176
190
  );
177
191
  })}
178
192
  </div>
@@ -20,7 +20,10 @@ export const SearchFilterHeader = ({
20
20
  headerClassName,
21
21
  )}
22
22
  >
23
- <Typography variant="body2" className="spiffy-tw-font-medium">
23
+ <Typography
24
+ variant="body2"
25
+ className="spiffy-tw-font-medium"
26
+ >
24
27
  Filters ({productCount})
25
28
  </Typography>
26
29
  <button
@@ -28,13 +28,13 @@ export const SearchFilterItem = ({
28
28
  aria-selected={isSelected}
29
29
  className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2"
30
30
  onClick={() => onSelectFilterItem(filterItem)}
31
- onKeyDown={(event) => {
31
+ onKeyDown={event => {
32
32
  if (event.key === 'Enter' || event.key === ' ') {
33
33
  event.preventDefault();
34
34
  onSelectFilterItem(filterItem);
35
35
  }
36
36
  }}
37
- onKeyUp={(event) => {
37
+ onKeyUp={event => {
38
38
  if (event.key === ' ') {
39
39
  event.preventDefault();
40
40
  }
@@ -44,7 +44,7 @@ export const SearchFilterItem = ({
44
44
  <div className={radioClasses}>
45
45
  {isSelected && (
46
46
  <div
47
- className={classNames('spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-rounded-full', {
47
+ className={classNames('spiffy-tw-h-2 spiffy-tw-w-2 spiffy-tw-rounded-full', {
48
48
  'spiffy-tw-bg-white': radioButtonFillColor.includes('spiffy-tw-bg-'),
49
49
  'spiffy-tw-bg-black': radioButtonFillColor.includes('spiffy-tw-bg-white'),
50
50
  })}
@@ -1,4 +1,4 @@
1
- import { useState, useMemo, useEffect } from 'react';
1
+ import { useEffect, useMemo, useState } from 'react';
2
2
  import { SearchFilterDatum } from '@envive-ai/react-hooks/types';
3
3
 
4
4
  export const useHasFilterStateChanged = (filters: SearchFilterDatum[], isOpen: boolean) => {
@@ -8,8 +8,8 @@ export const useHasFilterStateChanged = (filters: SearchFilterDatum[], isOpen: b
8
8
  // Create current filter states map to check for filter changes
9
9
  const currentFilterStates = useMemo(() => {
10
10
  const states: Record<string, boolean> = {};
11
- filters.forEach((filter) => {
12
- filter.items.forEach((item) => {
11
+ filters.forEach(filter => {
12
+ filter.items.forEach(item => {
13
13
  states[`${filter.filterId}-${item.filterItemId}`] = item.isSelected;
14
14
  });
15
15
  });
@@ -24,7 +24,7 @@ export const useHasFilterStateChanged = (filters: SearchFilterDatum[], isOpen: b
24
24
  }
25
25
 
26
26
  const changed = Object.keys(currentFilterStates).some(
27
- (key) => currentFilterStates[key] !== initialFilterStates[key],
27
+ key => currentFilterStates[key] !== initialFilterStates[key],
28
28
  );
29
29
 
30
30
  return changed;
@@ -1,4 +1,5 @@
1
- import React, { useRef, useImperativeHandle } from 'react';
1
+ /* eslint-disable react/display-name */
2
+ import React, { useImperativeHandle, useRef } from 'react';
2
3
  import classNames from 'classnames';
3
4
  import MagnifyingGlassStarVariant from '@envive-ai/react-icons/MagnifyingGlassStarVariant';
4
5
  import IconClose from '@envive-ai/react-icons/IconClose';
@@ -87,7 +88,10 @@ export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
87
88
  ]);
88
89
 
89
90
  return (
90
- <div className={containerClasses} data-testid={dataTestId}>
91
+ <div
92
+ className={containerClasses}
93
+ data-testid={dataTestId}
94
+ >
91
95
  <div className="spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2">
92
96
  <MagnifyingGlassStarVariant
93
97
  className={
@@ -1,4 +1,4 @@
1
- import { colorVar, ColorNames } from 'src/models/colorsConfig';
1
+ import { ColorNames, colorVar } from 'src/models/colorsConfig';
2
2
  import { SearchInputVariant } from '../../atoms/search/types';
3
3
  import { TypographyVariantMap } from '../Typography/typographyVariantClasses';
4
4
 
@@ -19,6 +19,7 @@ interface SearchInputFormProps {
19
19
  onSearchInputFocus: () => void;
20
20
  onSearchInputBlur: () => void;
21
21
  shouldShowAutocomplete: boolean;
22
+ searchInputRef: React.RefObject<HTMLInputElement>;
22
23
  }
23
24
 
24
25
  export const SearchInputForm = ({
@@ -35,18 +36,16 @@ export const SearchInputForm = ({
35
36
  onSearchSubmit,
36
37
  onSearchInputFocus,
37
38
  onSearchInputBlur,
39
+ searchInputRef,
38
40
  }: SearchInputFormProps) => {
39
41
  const { autocompleteIconColor } = searchInputVariantClasses[searchInputVariant];
40
42
 
41
- const containerClasses = classNames(
42
- 'spiffy-tw-relative',
43
- 'spiffy-tw-w-full'
44
- );
43
+ const containerClasses = classNames('spiffy-tw-relative', 'spiffy-tw-w-full');
45
44
 
46
45
  const formClasses = classNames({
47
46
  'spiffy-tw-grow': true,
48
47
  'spiffy-tw-relative': true,
49
- 'spiffy-tw-z-20': shouldShowAutocomplete
48
+ 'spiffy-tw-z-20': shouldShowAutocomplete,
50
49
  });
51
50
 
52
51
  const autocompleteContainerClasses = classNames(
@@ -60,13 +59,13 @@ export const SearchInputForm = ({
60
59
  'spiffy-tw-rounded-b-lg',
61
60
  'spiffy-tw-border',
62
61
  'spiffy-tw-border-t-0',
63
- 'spiffy-tw-pt-4'
62
+ 'spiffy-tw-pt-4',
64
63
  );
65
64
 
66
65
  return (
67
66
  <div className={containerClasses}>
68
67
  <form
69
- onSubmit={(e) => {
68
+ onSubmit={e => {
70
69
  e.preventDefault();
71
70
  onSearchSubmit();
72
71
  }}
@@ -83,6 +82,7 @@ export const SearchInputForm = ({
83
82
  onChange={onSearchInputChange}
84
83
  onFocus={onSearchInputFocus}
85
84
  onBlur={onSearchInputBlur}
85
+ ref={searchInputRef}
86
86
  />
87
87
  </form>
88
88
  {shouldShowAutocomplete && (
@@ -112,4 +112,4 @@ export const SearchResultsContent = ({
112
112
  )}
113
113
  </div>
114
114
  );
115
- };
115
+ };
@@ -1,6 +1,9 @@
1
1
  import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
2
2
  import { SearchFilter, SearchFilterHeader } from '../SearchFilter';
3
- import { SearchFilterSidebarVariant, searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar';
3
+ import {
4
+ SearchFilterSidebarVariant,
5
+ searchFilterSidebarVariantClasses,
6
+ } from '../SearchResultsFilterSidebar';
4
7
 
5
8
  export type SearchResultsFilterModalProps = {
6
9
  productCount: number;
@@ -1,5 +1,5 @@
1
1
  import { ColorNames, colorVar } from 'src/models/colorsConfig';
2
- import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
2
+ import type { CloseIconVariant, SearchFilterSidebarVariant } from './types';
3
3
 
4
4
  interface SearchFilterSidebarVariantClasses {
5
5
  searchFilterHeaderClasses: string;
@@ -56,7 +56,7 @@ export const NoSearchResultsFound = ({
56
56
  <div className="spiffy-tw-flex spiffy-tw-items-start spiffy-tw-gap-2">
57
57
  <div>
58
58
  <Sparkles
59
- className="spiffy-tw-w-[24px] spiffy-tw-h-[24px]"
59
+ className="spiffy-tw-h-[24px] spiffy-tw-w-[24px]"
60
60
  style={{ color: sparkleIconColor }}
61
61
  />
62
62
  </div>
@@ -70,4 +70,4 @@ export const NoSearchResultsFound = ({
70
70
  />
71
71
  </div>
72
72
  );
73
- };
73
+ };
@@ -74,7 +74,7 @@ export const SearchResultsGrid = ({
74
74
 
75
75
  return (
76
76
  <motion.div
77
- className="spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden"
77
+ className="spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden"
78
78
  initial={{ opacity: 0 }}
79
79
  animate={{ opacity: 1 }}
80
80
  exit={{ opacity: 0 }}
@@ -105,4 +105,4 @@ export const SearchResultsGrid = ({
105
105
  />
106
106
  </motion.div>
107
107
  );
108
- };
108
+ };
@@ -1,6 +1,7 @@
1
+ /* eslint-disable react/no-array-index-key */
1
2
  import { motion } from 'framer-motion';
2
3
  import { Typography } from 'src/components/Typography';
3
- import { ProductGridVariant, ProductCardSkeleton } from '../ProductCard';
4
+ import { ProductCardSkeleton, ProductGridVariant } from '../ProductCard';
4
5
  import { productGridVariantClasses } from '../ProductGrid';
5
6
  import { SparkleAnimation } from '../SparkleAnimation';
6
7
 
@@ -18,17 +19,20 @@ export const SearchResultsLoadingGrid = ({
18
19
 
19
20
  return (
20
21
  <motion.div
21
- className="spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden"
22
+ className="spiffy-tw-w-full spiffy-tw-justify-center spiffy-tw-overflow-hidden"
22
23
  initial={{ opacity: 0 }}
23
24
  animate={{ opacity: 1 }}
24
25
  exit={{ opacity: 0 }}
25
26
  transition={{ duration: 0.2 }}
26
27
  >
27
28
  <div className="spiffy-tw-mt-6 spiffy-tw-w-full">
28
- <div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-mb-4">
29
- <div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-2 spiffy-tw-ml-[16px] md:spiffy-tw-ml-[80px]">
29
+ <div className="spiffy-tw-mb-4 spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between">
30
+ <div className="spiffy-tw-ml-[16px] spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-2 md:spiffy-tw-ml-[80px]">
30
31
  <div className="spiffy-tw-width-[24px]">
31
- <SparkleAnimation color={sparkleIconColor} animate />
32
+ <SparkleAnimation
33
+ color={sparkleIconColor}
34
+ animate
35
+ />
32
36
  </div>
33
37
  <Typography variant="body2">Finding the best options for you...</Typography>
34
38
  </div>
@@ -1,14 +1,13 @@
1
- import React from 'react';
1
+ import React, { useRef } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { SearchInputVariant } from '@envive-ai/react-hooks/contexts/types';
4
4
  import { SearchResultsFilterButton } from '../SearchResultsFilterButton';
5
5
  import { SearchInputForm } from '../SearchInputForm';
6
6
 
7
-
8
7
  interface SearchResultsToolbarProps {
9
8
  // From widgetConfig
10
- searchInputVariant: SearchInputVariant;
11
- searchBoxPlaceholder: string;
9
+ searchInputVariant: SearchInputVariant;
10
+ searchBoxPlaceholder: string;
12
11
  // From search hook
13
12
  searchText: string;
14
13
  focusedIndex: number;
@@ -59,7 +58,7 @@ export const SearchResultsToolbar = ({
59
58
  className,
60
59
  }: SearchResultsToolbarProps) => {
61
60
  const [hasZIndex, setHasZIndex] = React.useState(false);
62
-
61
+ const searchInputRef = useRef<HTMLInputElement>(null);
63
62
  // The following is to ensure the z-index is applied after the animation is complete
64
63
  // because otherwise the z-index would be applied instantly when the component is mounted
65
64
  // which would cause the search toolbar to appear over the top of the merchant header
@@ -84,7 +83,10 @@ export const SearchResultsToolbar = ({
84
83
  const contentWrapperClasses = classNames('spiffy-tw-flex', containerXPaddingClasses);
85
84
 
86
85
  return (
87
- <div className={toolbarClasses} ref={toolbarRef}>
86
+ <div
87
+ className={toolbarClasses}
88
+ ref={toolbarRef}
89
+ >
88
90
  <div className={contentWrapperClasses}>
89
91
  <SearchInputForm
90
92
  searchInputVariant={searchInputVariant}
@@ -100,6 +102,7 @@ export const SearchResultsToolbar = ({
100
102
  shouldShowAutocomplete={shouldShowAutocomplete}
101
103
  onSearchSubmit={onSubmitSearch}
102
104
  onAutocompleteSelect={onAutocompleteSelect}
105
+ searchInputRef={searchInputRef}
103
106
  />
104
107
  <SearchResultsFilterButton
105
108
  setIsOpen={setIsFilterOpen}
@@ -108,4 +111,4 @@ export const SearchResultsToolbar = ({
108
111
  </div>
109
112
  </div>
110
113
  );
111
- };
114
+ };
@@ -59,13 +59,16 @@ export const SparkleAnimation = ({ color, className, animate = true }: SparkleAn
59
59
  <div
60
60
  className={classNames(
61
61
  SparkleAnimationOverride.STAR_ONE_CONTAINER,
62
- 'spiffy-tw-absolute -spiffy-tw-top-[2px] spiffy-tw-left-0',
62
+ 'spiffy-tw-left-0 spiffy-tw-absolute -spiffy-tw-top-[2px]',
63
63
  )}
64
64
  >
65
- <motion.div animate={{ scale: mainStarScale }} transition={starTransition}>
65
+ <motion.div
66
+ animate={{ scale: mainStarScale }}
67
+ transition={starTransition}
68
+ >
66
69
  <FourPointStar
67
70
  fill={color}
68
- className="spiffy-tw-w-4 spiffy-tw-h-4 spiffy-tw-inline-block"
71
+ className="spiffy-tw-inline-block spiffy-tw-h-4 spiffy-tw-w-4"
69
72
  />
70
73
  </motion.div>
71
74
  </div>
@@ -77,10 +80,13 @@ export const SparkleAnimation = ({ color, className, animate = true }: SparkleAn
77
80
  'spiffy-tw-absolute -spiffy-tw-top-[7px] spiffy-tw-left-[10px]',
78
81
  )}
79
82
  >
80
- <motion.div animate={{ scale: smallStar1Scale }} transition={starTransition}>
83
+ <motion.div
84
+ animate={{ scale: smallStar1Scale }}
85
+ transition={starTransition}
86
+ >
81
87
  <FourPointStar
82
88
  fill={color}
83
- className="spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-inline-block"
89
+ className="spiffy-tw-inline-block spiffy-tw-h-2 spiffy-tw-w-2"
84
90
  />
85
91
  </motion.div>
86
92
  </div>
@@ -89,13 +95,16 @@ export const SparkleAnimation = ({ color, className, animate = true }: SparkleAn
89
95
  <div
90
96
  className={classNames(
91
97
  SparkleAnimationOverride.STAR_THREE_CONTAINER,
92
- 'spiffy-tw-absolute spiffy-tw-top-[1px] spiffy-tw-left-[12px]',
98
+ 'spiffy-tw-absolute spiffy-tw-left-[12px] spiffy-tw-top-[1px]',
93
99
  )}
94
100
  >
95
- <motion.div animate={{ scale: smallStar2Scale }} transition={starTransition}>
101
+ <motion.div
102
+ animate={{ scale: smallStar2Scale }}
103
+ transition={starTransition}
104
+ >
96
105
  <FourPointStar
97
106
  fill={color}
98
- className="spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-inline-block"
107
+ className="spiffy-tw-inline-block spiffy-tw-h-2 spiffy-tw-w-2"
99
108
  />
100
109
  </motion.div>
101
110
  </div>
@@ -193,7 +193,7 @@ const borderedVariants = [
193
193
  ];
194
194
 
195
195
  const hoverTransform = (variantClass: string[]): string[] =>
196
- variantClass?.map((className) => `hover:${className}`);
196
+ variantClass?.map(className => `hover:${className}`);
197
197
 
198
198
  export const SuggestionButton = ({
199
199
  variant,
@@ -233,10 +233,10 @@ export const SuggestionButton = ({
233
233
  const hoverClasses = variantClassMap.get(hoverVariant) ?? [];
234
234
 
235
235
  // Separate border classes for proper cascading
236
- const baseBorderClasses = baseClasses.filter((cls) => cls.includes('border'));
237
- const baseNonBorderClasses = baseClasses.filter((cls) => !cls.includes('border'));
238
- const hoverBorderClasses = hoverClasses.filter((cls) => cls.includes('border'));
239
- const hoverNonBorderClasses = hoverClasses.filter((cls) => !cls.includes('border'));
236
+ const baseBorderClasses = baseClasses.filter(cls => cls.includes('border'));
237
+ const baseNonBorderClasses = baseClasses.filter(cls => !cls.includes('border'));
238
+ const hoverBorderClasses = hoverClasses.filter(cls => cls.includes('border'));
239
+ const hoverNonBorderClasses = hoverClasses.filter(cls => !cls.includes('border'));
240
240
 
241
241
  const variantClasses = [
242
242
  ...baseNonBorderClasses,
@@ -12,4 +12,4 @@ export type SuggestionButtonVariant =
12
12
  | 'secondaryAccent'
13
13
  | 'transparent'
14
14
  | 'transparentDark'
15
- | 'lightDark';
15
+ | 'lightDark';
@@ -1,7 +1,8 @@
1
+ /* eslint-disable react/display-name */
1
2
  import React from 'react';
2
3
  import classNames from 'classnames';
3
4
 
4
- import { getVariantPlaceholderClassNames, TypographyVariantMap } from '../Typography';
5
+ import { TypographyVariantMap, getVariantPlaceholderClassNames } from '../Typography';
5
6
 
6
7
  export interface TextInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
7
8
  borderRadius: 'sm' | 'md' | 'lg' | 'xl';
@@ -27,6 +28,12 @@ export const TextInput = React.forwardRef<HTMLInputElement, TextInputProps>(
27
28
  className,
28
29
  ]);
29
30
 
30
- return <input ref={ref} {...rest} className={inputClasses} />;
31
+ return (
32
+ <input
33
+ ref={ref}
34
+ {...rest}
35
+ className={inputClasses}
36
+ />
37
+ );
31
38
  },
32
39
  );
@@ -83,13 +83,23 @@ export const ToggleButton = ({
83
83
  secondaryLabelClassName,
84
84
  );
85
85
  return (
86
- <button className={buttonClassNames} onClick={onClick} type="button">
86
+ <button
87
+ className={buttonClassNames}
88
+ onClick={onClick}
89
+ type="button"
90
+ >
87
91
  {icon && <div className={iconClassName}>{icon}</div>}
88
- <Typography variant="body3" className={labelClassNames}>
92
+ <Typography
93
+ variant="body3"
94
+ className={labelClassNames}
95
+ >
89
96
  {label}
90
97
  </Typography>
91
98
  {secondaryLabel && (
92
- <Typography variant="body4" className={secondaryLabelClassNames}>
99
+ <Typography
100
+ variant="body4"
101
+ className={secondaryLabelClassNames}
102
+ >
93
103
  {secondaryLabel}
94
104
  </Typography>
95
105
  )}
@@ -1,4 +1,4 @@
1
- import { describe, it, expect } from 'vitest';
1
+ import { describe, expect, it } from 'vitest';
2
2
  import { getElementTypeFromVariant } from './util';
3
3
 
4
4
  describe('getElementTypeFromVariant', () => {
@@ -1,7 +1,7 @@
1
1
  import {
2
- TypographyVariantMap,
3
- TypographyDomVariantMap,
4
2
  ElementTypes,
3
+ TypographyDomVariantMap,
4
+ TypographyVariantMap,
5
5
  } from './typographyVariantClasses';
6
6
 
7
7
  export const getElementTypeFromVariant = (
@@ -24,5 +24,6 @@ type ColorMapping = {
24
24
  };
25
25
 
26
26
  const colorVar = (color: ColorNames): string => `var(--spiffy-colors-${color})`;
27
- export { ColorNames, colorVar };
27
+ const enviveColorVar = (color: ColorNames): string => `var(--envive-colors-${color})`;
28
+ export { ColorNames, colorVar, enviveColorVar };
28
29
  export type { ColorMapping };
@@ -19,6 +19,13 @@ export const Default: Story = {
19
19
  noResultsFoundText:
20
20
  'I’m sorry, I wasn’t able to find an exact match. Try changing your filters or adjusting your search query.',
21
21
  sparkleIconColor: 'var(--spiffy-colors-accent-primary)',
22
+ recommendedProducts: [
23
+ {
24
+ id: 'product1',
25
+ title: 'Product 1',
26
+ url: 'https://larry-and-serges-prod.myshopify.com/products/machine-learning-mango-fizz',
27
+ },
28
+ ],
22
29
  },
23
30
  };
24
31