@envive-ai/react-toolkit 0.1.12 → 0.1.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 (181) hide show
  1. package/dist/Accordion/index.cjs +3 -3
  2. package/dist/Accordion/index.d.cts +2 -2
  3. package/dist/Accordion/index.d.ts +2 -2
  4. package/dist/Accordion/index.js +3 -3
  5. package/dist/{Accordion-DBZpiQe7.cjs → Accordion-D9gO9_y3.cjs} +1 -1
  6. package/dist/{Accordion-Cp3Hx2zm.js → Accordion-ZEdp99Ph.js} +1 -1
  7. package/dist/AppliedFiltersScrollbar/index.cjs +25 -27
  8. package/dist/AppliedFiltersScrollbar/index.d.cts +2 -2
  9. package/dist/AppliedFiltersScrollbar/index.d.ts +2 -2
  10. package/dist/AppliedFiltersScrollbar/index.js +25 -27
  11. package/dist/ButtonBase/index.cjs +3 -3
  12. package/dist/ButtonBase/index.d.cts +2 -3
  13. package/dist/ButtonBase/index.d.ts +2 -3
  14. package/dist/ButtonBase/index.js +3 -3
  15. package/dist/{ButtonBase-BAf-nlCm.js → ButtonBase-DgRupM53.js} +3 -3
  16. package/dist/{ButtonBase-Do88ndKa.cjs → ButtonBase-DrIwVGTR.cjs} +3 -3
  17. package/dist/DynamicFiltersScrollbar/index.cjs +23 -25
  18. package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
  19. package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
  20. package/dist/DynamicFiltersScrollbar/index.js +23 -25
  21. package/dist/DynamicFiltersScrollbar-B1j53y2q.cjs +81 -0
  22. package/dist/DynamicFiltersScrollbar-D7WYp6x9.js +66 -0
  23. package/dist/FilterScrollbar/index.cjs +3 -3
  24. package/dist/FilterScrollbar/index.d.cts +3 -3
  25. package/dist/FilterScrollbar/index.d.ts +3 -3
  26. package/dist/FilterScrollbar/index.js +3 -3
  27. package/dist/Headline/index.cjs +2 -2
  28. package/dist/Headline/index.d.cts +2 -2
  29. package/dist/Headline/index.d.ts +2 -2
  30. package/dist/Headline/index.js +2 -2
  31. package/dist/{Headline-DNEWF8ly.js → Headline-COv0Jbn8.js} +1 -1
  32. package/dist/{Headline-DTT4RSv2.cjs → Headline-Cp79THVF.cjs} +1 -1
  33. package/dist/ImageWithFallback/index.d.cts +2 -2
  34. package/dist/ImageWithFallback/index.d.ts +2 -2
  35. package/dist/ModalSheet/index.d.cts +2 -2
  36. package/dist/ModalSheet/index.d.ts +2 -2
  37. package/dist/ProductCard/index.cjs +4 -4
  38. package/dist/ProductCard/index.d.cts +1 -1
  39. package/dist/ProductCard/index.d.ts +1 -1
  40. package/dist/ProductCard/index.js +4 -4
  41. package/dist/{ProductCard-C3MjnfZJ.js → ProductCard-CNwmHggx.js} +32 -32
  42. package/dist/{ProductCard-FDyIMnZs.cjs → ProductCard-EmdDy2af.cjs} +32 -32
  43. package/dist/ProductGrid/index.cjs +5 -5
  44. package/dist/ProductGrid/index.d.cts +4 -8
  45. package/dist/ProductGrid/index.d.ts +4 -8
  46. package/dist/ProductGrid/index.js +5 -5
  47. package/dist/{ProductGrid-TlntVJ6h.cjs → ProductGrid-CMoomZLc.cjs} +3 -7
  48. package/dist/{ProductGrid-C9OKsyB2.js → ProductGrid-nmWSp0qX.js} +3 -7
  49. package/dist/RadioButton/index.cjs +3 -3
  50. package/dist/RadioButton/index.d.cts +5 -3
  51. package/dist/RadioButton/index.d.ts +5 -3
  52. package/dist/RadioButton/index.js +3 -3
  53. package/dist/{RadioButton-DZ6QXkrN.cjs → RadioButton-BdKJRzLM.cjs} +17 -10
  54. package/dist/{RadioButton-Bf68dZl7.js → RadioButton-S5dALI2f.js} +18 -11
  55. package/dist/RadioButtonGroup/index.cjs +4 -4
  56. package/dist/RadioButtonGroup/index.d.cts +2 -2
  57. package/dist/RadioButtonGroup/index.d.ts +2 -2
  58. package/dist/RadioButtonGroup/index.js +4 -4
  59. package/dist/{RadioButtonGroup-8k7hkJYB.js → RadioButtonGroup-BipNsoHL.js} +2 -1
  60. package/dist/{RadioButtonGroup-Dc_n5amh.cjs → RadioButtonGroup-TAJMA1j_.cjs} +2 -1
  61. package/dist/SearchAutocomplete/index.cjs +56 -2
  62. package/dist/SearchAutocomplete/index.js +49 -1
  63. package/dist/SearchFilter/index.cjs +8 -8
  64. package/dist/SearchFilter/index.d.cts +4 -4
  65. package/dist/SearchFilter/index.d.ts +4 -4
  66. package/dist/SearchFilter/index.js +8 -8
  67. package/dist/{SearchFilter-CTVBi5s3.cjs → SearchFilter-BcLc0TMq.cjs} +26 -16
  68. package/dist/{SearchFilter-DvqBIXa1.js → SearchFilter-w-0s2YVu.js} +26 -16
  69. package/dist/SearchInput/index.cjs +96 -6
  70. package/dist/SearchInput/index.d.cts +1 -1
  71. package/dist/SearchInput/index.d.ts +2 -2
  72. package/dist/SearchInput/index.js +88 -4
  73. package/dist/SearchInputForm/index.cjs +0 -39
  74. package/dist/SearchInputForm/index.d.cts +2 -2
  75. package/dist/SearchInputForm/index.d.ts +2 -2
  76. package/dist/SearchInputForm/index.js +1 -37
  77. package/dist/SearchResultsContent/index.cjs +34 -37
  78. package/dist/SearchResultsContent/index.d.cts +4 -6
  79. package/dist/SearchResultsContent/index.d.ts +4 -6
  80. package/dist/SearchResultsContent/index.js +34 -37
  81. package/dist/SearchResultsFilterSidebar/index.cjs +10 -10
  82. package/dist/SearchResultsFilterSidebar/index.d.cts +1 -1
  83. package/dist/SearchResultsFilterSidebar/index.d.ts +1 -1
  84. package/dist/SearchResultsFilterSidebar/index.js +10 -10
  85. package/dist/SearchResultsStates/index.cjs +10 -10
  86. package/dist/SearchResultsStates/index.d.cts +6 -8
  87. package/dist/SearchResultsStates/index.d.ts +6 -8
  88. package/dist/SearchResultsStates/index.js +10 -10
  89. package/dist/{SearchResultsStates-iKz64Pd4.js → SearchResultsStates-DlZz14yy.js} +8 -10
  90. package/dist/{SearchResultsStates-CH4agenX.cjs → SearchResultsStates-DwcPrsdd.cjs} +8 -10
  91. package/dist/SparkleAnimation/index.cjs +1 -1
  92. package/dist/SparkleAnimation/index.d.cts +2 -2
  93. package/dist/SparkleAnimation/index.d.ts +2 -2
  94. package/dist/SparkleAnimation/index.js +1 -1
  95. package/dist/{SparkleAnimation-qi5WCJ9B.cjs → SparkleAnimation-CvGlWUqv.cjs} +0 -1
  96. package/dist/{SparkleAnimation-BLfNojLv.js → SparkleAnimation-paLhSu5E.js} +0 -1
  97. package/dist/Spinner/index.d.cts +2 -2
  98. package/dist/SuggestionButton/index.cjs +3 -3
  99. package/dist/SuggestionButton/index.d.cts +2 -2
  100. package/dist/SuggestionButton/index.d.ts +2 -2
  101. package/dist/SuggestionButton/index.js +3 -3
  102. package/dist/Text/index.cjs +2 -2
  103. package/dist/Text/index.d.cts +2 -2
  104. package/dist/Text/index.d.ts +3 -3
  105. package/dist/Text/index.js +2 -2
  106. package/dist/{Text-Bod4OMPk.js → Text-BLzNhX4H.js} +1 -1
  107. package/dist/{Text-MQjxqgZZ.cjs → Text-DllCE9_D.cjs} +1 -1
  108. package/dist/TextInput/index.cjs +2 -2
  109. package/dist/TextInput/index.d.ts +1 -1
  110. package/dist/TextInput/index.js +2 -2
  111. package/dist/{TextInput-DoM41M53.js → TextInput-DmsOxxPN.js} +1 -1
  112. package/dist/{TextInput-B3dTeD3q.cjs → TextInput-HMW0hxLI.cjs} +1 -1
  113. package/dist/ToggleButton/index.cjs +3 -3
  114. package/dist/ToggleButton/index.d.cts +2 -2
  115. package/dist/ToggleButton/index.d.ts +2 -2
  116. package/dist/ToggleButton/index.js +3 -3
  117. package/dist/{ToggleButton-CK_vkMvt.cjs → ToggleButton-DblAj4Cd.cjs} +1 -1
  118. package/dist/{ToggleButton-GIVd2-Z4.js → ToggleButton-r7Y7Kzzo.js} +1 -1
  119. package/dist/index-BKvXn5sj.d.ts +4 -0
  120. package/dist/{index-B8l3muO3.d.ts → index-Br1B7Jta.d.cts} +2 -3
  121. package/dist/{index-CFH3KUVw.d.cts → index-DADHwW6M.d.ts} +5 -9
  122. package/dist/{index-Vck3pox6.d.ts → index-DDp-fLgm.d.cts} +5 -9
  123. package/dist/{index-BMt66uqr.d.cts → index-Dh8rcWev.d.ts} +2 -3
  124. package/dist/index-W1wCDiw_.d.cts +4 -0
  125. package/dist/{searchFilterSidebarVariants-CI782ylo.js → searchFilterSidebarVariants-J0FJ8pck.js} +1 -1
  126. package/dist/{searchFilterSidebarVariants-DFfOTqjc.cjs → searchFilterSidebarVariants-kkTjYEIF.cjs} +1 -1
  127. package/dist/{textVariantClasses-Dgz7Zaql.cjs → textVariantClasses-CBre7vXv.cjs} +5 -7
  128. package/dist/{textVariantClasses-D77TGEy1.js → textVariantClasses-CRrTb43V.js} +5 -7
  129. package/package.json +2 -6
  130. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +25 -27
  131. package/src/components/ButtonBase/ButtonBase.tsx +1 -2
  132. package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +26 -28
  133. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +25 -27
  134. package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +26 -28
  135. package/src/components/ModalSheet/ModalSheet.tsx +1 -1
  136. package/src/components/ModalSheet/common/closeIcon.tsx +2 -2
  137. package/src/components/ModalSheet/mobile/mobileHeader.tsx +1 -1
  138. package/src/components/ProductCard/ProductCard.tsx +5 -28
  139. package/src/components/ProductGrid/ProductGrid.tsx +3 -11
  140. package/src/components/RadioButton/RadioButton.tsx +15 -6
  141. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +1 -0
  142. package/src/components/SearchFilter/SearchFilter.tsx +2 -2
  143. package/src/components/SearchFilter/SearchFilterFooter.tsx +1 -1
  144. package/src/components/SearchFilter/SearchFilterHeader.tsx +6 -1
  145. package/src/components/SearchFilter/SearchFilterItem.tsx +17 -3
  146. package/src/components/SearchFilter/useHasFilterStateChanged.tsx +1 -0
  147. package/src/components/SearchFilter/utils.ts +4 -6
  148. package/src/components/SearchInput/SearchInput.tsx +2 -2
  149. package/src/components/SearchInputForm/index.ts +0 -1
  150. package/src/components/SearchResultsContent/SearchResultsContent.tsx +33 -38
  151. package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +2 -3
  152. package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +1 -1
  153. package/src/components/SearchResultsStates/SearchResultsGrid.tsx +4 -8
  154. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +3 -3
  155. package/src/components/SparkleAnimation/SparkleAnimation.tsx +0 -1
  156. package/src/components/Spinner/Spinner.tsx +29 -14
  157. package/src/components/SuggestionButton/SuggestionButton.tsx +1 -1
  158. package/src/components/SuggestionButton/types.ts +1 -1
  159. package/src/components/Text/textVariantClasses.ts +12 -10
  160. package/src/components/TextInput/TextInput.tsx +1 -0
  161. package/src/util/camelCasedPropertiesDeep.ts +22 -22
  162. package/src/util/internal.ts +4 -2
  163. package/src/util/splitWords.ts +35 -31
  164. package/dist/DynamicFiltersScrollbar-C4kdNSJ9.js +0 -70
  165. package/dist/DynamicFiltersScrollbar-CVw1PINp.cjs +0 -85
  166. package/dist/SearchAutocomplete-BlpII8Xs.js +0 -51
  167. package/dist/SearchAutocomplete-DIEhLT4C.cjs +0 -62
  168. package/dist/SearchInput-CVaCPWCE.js +0 -89
  169. package/dist/SearchInput-vJMWoLzS.cjs +0 -106
  170. package/dist/Styles/index.cjs +0 -274
  171. package/dist/Styles/index.d.cts +0 -258
  172. package/dist/Styles/index.d.ts +0 -258
  173. package/dist/Styles/index.js +0 -274
  174. package/dist/index-H_9LhS_1.d.cts +0 -36
  175. package/dist/index-h-QwQNnu.d.ts +0 -36
  176. package/src/components/Styles/EnviveTailwindPreset.ts +0 -285
  177. package/src/components/Styles/index.ts +0 -2
  178. package/tailwind-preset.js +0 -3
  179. /package/dist/{colorsConfig-D-MZuBvt.cjs → colorsConfig-B3-SMUSx.cjs} +0 -0
  180. /package/dist/{colorsConfig-DEfiLHH0.js → colorsConfig-DZ-GSPWy.js} +0 -0
  181. /package/dist/{textVariantClasses-kyZtL8F5.d.ts → textVariantClasses-C8OCWZAw.d.ts} +0 -0
@@ -22,9 +22,23 @@ export const SearchFilterItem = ({
22
22
  );
23
23
 
24
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"
25
+ <button
26
+ type="button"
27
+ role="option"
28
+ aria-selected={isSelected}
29
+ className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2"
27
30
  onClick={() => onSelectFilterItem(filterItem)}
31
+ onKeyDown={(event) => {
32
+ if (event.key === 'Enter' || event.key === ' ') {
33
+ event.preventDefault();
34
+ onSelectFilterItem(filterItem);
35
+ }
36
+ }}
37
+ onKeyUp={(event) => {
38
+ if (event.key === ' ') {
39
+ event.preventDefault();
40
+ }
41
+ }}
28
42
  >
29
43
  <Text variant="body3">{displayName}</Text>
30
44
  <div className={radioClasses}>
@@ -37,6 +51,6 @@ export const SearchFilterItem = ({
37
51
  />
38
52
  )}
39
53
  </div>
40
- </li>
54
+ </button>
41
55
  );
42
56
  };
@@ -34,6 +34,7 @@ export const useHasFilterStateChanged = (filters: SearchFilterDatum[], isOpen: b
34
34
  if (isOpen) {
35
35
  setInitialFilterStates(currentFilterStates);
36
36
  }
37
+ // eslint-disable-next-line react-hooks/exhaustive-deps
37
38
  }, [isOpen]);
38
39
 
39
40
  return hasFiltersChanged;
@@ -1,15 +1,13 @@
1
1
  import { SearchFilterDatum, SearchFilterItemDatum } from '@envive-ai/react-hooks/types';
2
2
 
3
- export const getSelectedFilterItemsCount = (filter: SearchFilterDatum) => {
4
- return filter.items.filter((item: SearchFilterItemDatum) => item.isSelected).length;
5
- };
3
+ export const getSelectedFilterItemsCount = (filter: SearchFilterDatum) =>
4
+ filter.items.filter((item: SearchFilterItemDatum) => item.isSelected).length;
6
5
 
7
6
  // Gets the count of total active filters excluding sort filters
8
- export const getTotalSelectedFilterItemsCount = (filters: SearchFilterDatum[]) => {
9
- return filters.reduce((acc: number, filter: SearchFilterDatum) => {
7
+ export const getTotalSelectedFilterItemsCount = (filters: SearchFilterDatum[]) =>
8
+ filters.reduce((acc: number, filter: SearchFilterDatum) => {
10
9
  if (filter.filterId === 'sort') {
11
10
  return acc;
12
11
  }
13
12
  return acc + getSelectedFilterItemsCount(filter);
14
13
  }, 0);
15
- };
@@ -1,10 +1,10 @@
1
1
  import React, { useRef, useImperativeHandle } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import MagnifyingGlassStarVariant from '@envive-ai/react-icons/MagnifyingGlassStarVariant';
4
- import { SearchInputVariant } from '../SearchInputForm';
4
+ import { IconClose } from '@envive-ai/react-icons/src/index.js';
5
+ import { SearchInputVariant } from '../SearchInputForm/types';
5
6
  import { TextInput } from '../TextInput';
6
7
  import { searchInputVariantClasses } from './searchInputVariants';
7
- import { IconClose } from '@envive-ai/react-icons/src/index.js';
8
8
 
9
9
  interface SearchInputProps {
10
10
  searchInputVariant?: SearchInputVariant;
@@ -1,2 +1 @@
1
- export * from './SearchInputForm';
2
1
  export * from './types';
@@ -1,4 +1,5 @@
1
1
  import { SelectedFilterOption } from '@envive-ai/react-hooks/atoms/search';
2
+ import { SearchResultsState } from '@envive-ai/react-hooks/hooks/utils';
2
3
  import {
3
4
  ProductCardConfig,
4
5
  ProductGridVariant,
@@ -10,7 +11,6 @@ import {
10
11
  SearchResultsGrid,
11
12
  SearchResultsLoadingGrid,
12
13
  } from '../SearchResultsStates';
13
- import { SearchResultsState } from '@envive-ai/react-hooks/hooks/utils';
14
14
 
15
15
  interface SearchResultsContentProps {
16
16
  searchResultsState: SearchResultsState;
@@ -23,7 +23,6 @@ interface SearchResultsContentProps {
23
23
  containerXPaddingClasses: string;
24
24
  selectedFilterOptions: SelectedFilterOption[];
25
25
  availableDynamicFilters: { name: string; displayName: string }[];
26
- searchResponseId: string;
27
26
  onRemoveFilter: (filter: SelectedFilterOption) => void;
28
27
  onToggleDynamicFilter: ({
29
28
  filter,
@@ -46,42 +45,38 @@ export const SearchResultsContent = ({
46
45
  containerXPaddingClasses,
47
46
  selectedFilterOptions,
48
47
  availableDynamicFilters,
49
- searchResponseId,
50
48
  onRemoveFilter,
51
49
  onToggleDynamicFilter,
52
50
  noResultsFoundText,
53
- }: SearchResultsContentProps) => {
54
- return (
55
- <div>
56
- {searchResultsState === SearchResultsState.NoResults && (
57
- <NoSearchResultsFound
58
- containerPaddingClasses={containerXPaddingClasses}
59
- includeBottomMargin
60
- noResultsFoundText={noResultsFoundText}
61
- />
62
- )}
63
- {searchResultsState === SearchResultsState.Results && (
64
- <SearchResultsGrid
65
- searchFilterSidebarVariant={searchFilterSidebarVariant}
66
- productCardConfig={productCardConfig}
67
- merchantShortName={merchantShortName}
68
- productList={productList}
69
- productGridVariant={productGridVariant}
70
- productGridClasses={productGridClasses}
71
- containerXPaddingClasses={containerXPaddingClasses}
72
- selectedFilterOptions={selectedFilterOptions}
73
- availableDynamicFilters={availableDynamicFilters}
74
- searchResponseId={searchResponseId}
75
- onRemoveFilter={onRemoveFilter}
76
- onToggleDynamicFilter={onToggleDynamicFilter}
77
- />
78
- )}
79
- {searchResultsState === SearchResultsState.Loading && (
80
- <SearchResultsLoadingGrid
81
- productGridVariant={productGridVariant}
82
- productGridClasses={productGridClasses}
83
- />
84
- )}
85
- </div>
86
- );
87
- };
51
+ }: SearchResultsContentProps) => (
52
+ <div>
53
+ {searchResultsState === SearchResultsState.NoResults && (
54
+ <NoSearchResultsFound
55
+ containerPaddingClasses={containerXPaddingClasses}
56
+ includeBottomMargin
57
+ noResultsFoundText={noResultsFoundText}
58
+ />
59
+ )}
60
+ {searchResultsState === SearchResultsState.Results && (
61
+ <SearchResultsGrid
62
+ searchFilterSidebarVariant={searchFilterSidebarVariant}
63
+ productCardConfig={productCardConfig}
64
+ merchantShortName={merchantShortName}
65
+ productList={productList}
66
+ productGridVariant={productGridVariant}
67
+ productGridClasses={productGridClasses}
68
+ containerXPaddingClasses={containerXPaddingClasses}
69
+ selectedFilterOptions={selectedFilterOptions}
70
+ availableDynamicFilters={availableDynamicFilters}
71
+ onRemoveFilter={onRemoveFilter}
72
+ onToggleDynamicFilter={onToggleDynamicFilter}
73
+ />
74
+ )}
75
+ {searchResultsState === SearchResultsState.Loading && (
76
+ <SearchResultsLoadingGrid
77
+ productGridVariant={productGridVariant}
78
+ productGridClasses={productGridClasses}
79
+ />
80
+ )}
81
+ </div>
82
+ );
@@ -1,11 +1,11 @@
1
1
  import { useCallback } from 'react';
2
2
 
3
+ import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
4
+ import SettingsVariant from '@envive-ai/react-icons/src/SettingsVariant.js';
3
5
  import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
4
6
  import { ButtonBase } from '../ButtonBase';
5
7
  import { SearchFilter, SearchFilterHeader } from '../SearchFilter';
6
8
  import { SearchFilterSidebarVariant } from './types';
7
- import { SearchFilterDatum, SelectFilterItem } from '@envive-ai/react-hooks/types';
8
- import SettingsVariant from '@envive-ai/react-icons/src/SettingsVariant.js';
9
9
 
10
10
  export type SearchResultsFilterProps = {
11
11
  productCount: number;
@@ -13,7 +13,6 @@ export type SearchResultsFilterProps = {
13
13
  setIsOpen: (isOpen: boolean) => void;
14
14
  searchFilters: SearchFilterDatum[];
15
15
  searchFilterSidebarVariant: SearchFilterSidebarVariant;
16
- searchText: string;
17
16
  onSelectFilterItem: SelectFilterItem;
18
17
  onClearAllFilters: () => void;
19
18
  filterButtonText: string;
@@ -1,5 +1,5 @@
1
- import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
2
1
  import { ColorNames, colorVar } from 'src/models/colorsConfig';
2
+ import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
3
3
 
4
4
  interface SearchFilterSidebarVariantClasses {
5
5
  searchFilterHeaderClasses: string;
@@ -1,14 +1,14 @@
1
+ import { motion } from 'framer-motion';
2
+ import classNames from 'classnames';
3
+ import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
4
+ import { SelectedFilterOption } from '@envive-ai/react-hooks/atoms/search';
1
5
  import { AppliedFiltersScrollbar } from '../FilterScrollbar/AppliedFiltersScrollbar';
2
6
  import { DynamicFiltersScrollbar } from '../FilterScrollbar/DynamicFiltersScrollbar';
3
- import { motion } from 'framer-motion';
4
7
 
5
8
  import { searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar/searchFilterSidebarVariants';
6
- import classNames from 'classnames';
7
- import { SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
8
9
  import { ProductCardConfig, ProductGridVariant } from '../ProductCard';
9
10
  import { ProductGrid } from '../ProductGrid';
10
11
  import { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar';
11
- import { SelectedFilterOption } from '@envive-ai/react-hooks/atoms/search';
12
12
 
13
13
  interface SearchResultsGridProps {
14
14
  productList: SearchResponseProduct[];
@@ -18,7 +18,6 @@ interface SearchResultsGridProps {
18
18
  searchFilterSidebarVariant: SearchFilterSidebarVariant;
19
19
  productGridVariant: ProductGridVariant;
20
20
  selectedFilterOptions: SelectedFilterOption[];
21
- searchResponseId: string;
22
21
  containerXPaddingClasses: string;
23
22
  productGridClasses: string;
24
23
  onRemoveFilter: (filter: SelectedFilterOption) => void;
@@ -39,7 +38,6 @@ export const SearchResultsGrid = ({
39
38
  searchFilterSidebarVariant,
40
39
  productGridVariant,
41
40
  selectedFilterOptions,
42
- searchResponseId,
43
41
  containerXPaddingClasses,
44
42
  productGridClasses,
45
43
  onRemoveFilter,
@@ -100,8 +98,6 @@ export const SearchResultsGrid = ({
100
98
  productGridClasses={productGridClasses}
101
99
  productCardConfig={productCardConfig}
102
100
  merchantShortName={merchantShortName}
103
- searchResponseId={searchResponseId}
104
- cardDisplayLocation=""
105
101
  />
106
102
  </motion.div>
107
103
  );
@@ -1,8 +1,8 @@
1
1
  import { motion } from 'framer-motion';
2
+ import { Text } from 'src/components/Text';
2
3
  import { ProductGridVariant, ProductCardSkeleton } from '../ProductCard';
3
4
  import { productGridVariantClasses } from '../ProductGrid';
4
5
  import { SparkleAnimation } from '../SparkleAnimation';
5
- import { Text } from 'src/components/Text';
6
6
 
7
7
  export const SearchResultsLoadingGrid = ({
8
8
  productGridVariant,
@@ -28,7 +28,7 @@ export const SearchResultsLoadingGrid = ({
28
28
  <div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-mb-4">
29
29
  <div className="spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-2 spiffy-tw-ml-[16px] md:spiffy-tw-ml-[80px]">
30
30
  <div className="spiffy-tw-width-[24px]">
31
- <SparkleAnimation color={sparkleIconColor} animate={true} />
31
+ <SparkleAnimation color={sparkleIconColor} animate />
32
32
  </div>
33
33
  <Text variant="body2">Finding the best options for you...</Text>
34
34
  </div>
@@ -39,7 +39,7 @@ export const SearchResultsLoadingGrid = ({
39
39
  key={index}
40
40
  layoutVariant={productCardLayoutVariant}
41
41
  aspectRatio={productCardImageAspectRatio}
42
- growWithContainer={true}
42
+ growWithContainer
43
43
  />
44
44
  ))}
45
45
  </div>
@@ -34,7 +34,6 @@ export const SparkleAnimation = ({ color, className, animate = true }: SparkleAn
34
34
  setMainStarScale(1);
35
35
  setSmallStar1Scale(1);
36
36
  setSmallStar2Scale(1);
37
- return;
38
37
  }
39
38
  }, [animate]);
40
39
 
@@ -1,18 +1,21 @@
1
- import classNames from "classnames";
1
+ import classNames from 'classnames';
2
2
 
3
3
  type SpinnerProps = {
4
4
  className?: string;
5
- }
5
+ };
6
6
 
7
7
  export const Spinner = ({ className }: SpinnerProps) => {
8
- const svgClassnames = classNames({
9
- 'spiffy-tw-w-4': true,
10
- 'spiffy-tw-h-4': true,
11
- 'spiffy-tw-text-gray-200': true,
12
- 'spiffy-tw-animate-spin': true,
13
- 'spiffy-tw-dark:text-gray-600': true,
14
- 'spiffy-tw-fill-black': true,
15
- }, className);
8
+ const svgClassnames = classNames(
9
+ {
10
+ 'spiffy-tw-w-4': true,
11
+ 'spiffy-tw-h-4': true,
12
+ 'spiffy-tw-text-gray-200': true,
13
+ 'spiffy-tw-animate-spin': true,
14
+ 'spiffy-tw-dark:text-gray-600': true,
15
+ 'spiffy-tw-fill-black': true,
16
+ },
17
+ className,
18
+ );
16
19
 
17
20
  const spanClassnames = classNames({
18
21
  'spiffy-tw-sr-only': true,
@@ -20,11 +23,23 @@ export const Spinner = ({ className }: SpinnerProps) => {
20
23
 
21
24
  return (
22
25
  <div role="status">
23
- <svg aria-hidden="true" className={svgClassnames} viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
24
- <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
25
- <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
26
+ <svg
27
+ aria-hidden="true"
28
+ className={svgClassnames}
29
+ viewBox="0 0 100 101"
30
+ fill="none"
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ >
33
+ <path
34
+ d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
35
+ fill="currentColor"
36
+ />
37
+ <path
38
+ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
39
+ fill="currentFill"
40
+ />
26
41
  </svg>
27
42
  <span className={spanClassnames}>Loading...</span>
28
43
  </div>
29
44
  );
30
- };
45
+ };
@@ -1,9 +1,9 @@
1
1
  import classNames from 'classnames';
2
2
  import OutlinedStar from '@envive-ai/react-icons/OutlinedStar';
3
3
  import FourPointStar from '@envive-ai/react-icons/FourPointStar';
4
+ import { TestProps } from '@envive-ai/react-hooks/types';
4
5
  import type { SuggestionButtonVariant } from './types';
5
6
  import { ButtonBase } from '../ButtonBase/ButtonBase';
6
- import { TestProps } from '@envive-ai/react-hooks/types';
7
7
 
8
8
  export const SPIFFY_SUGGESTION_BUTTON_QUESTION_CLASS = 'spiffy-suggestion-button-question-class';
9
9
  export const SPIFFY_SUGGESTION_BUTTON_ANSWER_CLASS = 'spiffy-suggestion-button-answer-class';
@@ -11,4 +11,4 @@ export type SuggestionButtonVariant =
11
11
  | 'secondaryAccent'
12
12
  | 'transparent'
13
13
  | 'transparentDark'
14
- | 'lightDark';
14
+ | 'lightDark';
@@ -94,13 +94,15 @@ export const TextStyleVariantMap = {
94
94
  ...HeadlineVariantMap,
95
95
  };
96
96
 
97
- export const getVariantPlaceholderClassNames = (classes: Record<string, boolean>) => {
98
- return Object.keys(classes).reduce((acc, key) => {
99
- if(key.includes('spiffy-tw')){
100
- acc[`placeholder:${key}`] = classes[key];
101
- } else {
102
- acc[`${key}-placeholder`] = classes[key];
103
- }
104
- return acc;
105
- }, {} as Record<string, boolean>);
106
- }
97
+ export const getVariantPlaceholderClassNames = (classes: Record<string, boolean>) =>
98
+ Object.keys(classes).reduce(
99
+ (acc, key) => {
100
+ if (key.includes('spiffy-tw')) {
101
+ acc[`placeholder:${key}`] = classes[key];
102
+ } else {
103
+ acc[`${key}-placeholder`] = classes[key];
104
+ }
105
+ return acc;
106
+ },
107
+ {} as Record<string, boolean>,
108
+ );
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/jsx-props-no-spreading */
1
2
  // Disabling this prevents an otherwise simple wrapper around input
2
3
  // from becoming needlessly verbose while maintaining flexibility.
3
4
  // Keeping it enabled requires listing every possible prop.
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-unsafe-function-type */
2
1
  import type { CamelCase, CamelCaseOptions } from './camelCase';
3
2
  import type { UnknownArray } from './unknownArray';
4
3
 
@@ -49,33 +48,34 @@ import type { UnknownArray } from './unknownArray';
49
48
  export type CamelCasedPropertiesDeep<
50
49
  Value,
51
50
  Options extends CamelCaseOptions = { preserveConsecutiveUppercase: true },
51
+ // eslint-disable-next-line @typescript-eslint/ban-types
52
52
  > = Value extends Function
53
53
  ? Value
54
54
  : Value extends UnknownArray
55
- ? CamelCasedPropertiesArrayDeep<Value>
56
- : Value extends Set<infer U>
57
- ? Set<CamelCasedPropertiesDeep<U, Options>>
58
- : {
59
- [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options>;
60
- };
55
+ ? CamelCasedPropertiesArrayDeep<Value>
56
+ : Value extends Set<infer U>
57
+ ? Set<CamelCasedPropertiesDeep<U, Options>>
58
+ : {
59
+ [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options>;
60
+ };
61
61
 
62
62
  // This is a copy of DelimiterCasedPropertiesArrayDeep (see: delimiter-cased-properties-deep.d.ts).
63
63
  // These types should be kept in sync.
64
64
  type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends []
65
65
  ? []
66
66
  : // Tailing spread array
67
- Value extends [infer U, ...infer V]
68
- ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
69
- : Value extends readonly [infer U, ...infer V]
70
- ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
71
- : // Leading spread array
72
- Value extends readonly [...infer U, infer V]
73
- ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
74
- : Value extends readonly [...infer U, infer V]
75
- ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
76
- : // Array
77
- Value extends Array<infer U>
78
- ? Array<CamelCasedPropertiesDeep<U>>
79
- : Value extends ReadonlyArray<infer U>
80
- ? ReadonlyArray<CamelCasedPropertiesDeep<U>>
81
- : never;
67
+ Value extends [infer U, ...infer V]
68
+ ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
69
+ : Value extends readonly [infer U, ...infer V]
70
+ ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>]
71
+ : // Leading spread array
72
+ Value extends readonly [...infer U, infer V]
73
+ ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
74
+ : Value extends readonly [...infer U, infer V]
75
+ ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>]
76
+ : // Array
77
+ Value extends Array<infer U>
78
+ ? Array<CamelCasedPropertiesDeep<U>>
79
+ : Value extends ReadonlyArray<infer U>
80
+ ? ReadonlyArray<CamelCasedPropertiesDeep<U>>
81
+ : never;
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- /* eslint-disable @typescript-eslint/no-unsafe-function-type */
3
2
  // these types come from https://github.com/sindresorhus/type-fest/blob/main/source/internal.d.ts
4
3
 
5
4
  import type { Primitive } from './primitive';
@@ -13,7 +12,10 @@ export type BuiltIns = Primitive | void | Date | RegExp;
13
12
  /**
14
13
  * Matches non-recursive types.
15
14
  */
16
- export type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown);
15
+ export type NonRecursiveType =
16
+ | BuiltIns
17
+ | ((...arguments_: any[]) => unknown)
18
+ | (new (...arguments_: any[]) => unknown);
17
19
 
18
20
  /**
19
21
  * Returns a boolean for whether the string is numeric.
@@ -38,35 +38,39 @@ export type SplitWords<
38
38
  ? // Skip word separator
39
39
  [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>]
40
40
  : LastCharacter extends ''
41
- ? // Fist char of word
42
- SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
43
- : // Case change: non-numeric to numeric, push word
44
- [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
45
- ? [
46
- ...SkipEmptyWord<CurrentWord>,
47
- ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
48
- ]
49
- : // Case change: numeric to non-numeric, push word
50
- [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
51
- ? [
52
- ...SkipEmptyWord<CurrentWord>,
53
- ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
54
- ]
55
- : // No case change: concat word
56
- [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
57
- ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`>
58
- : // Case change: lower to upper, push word
59
- [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>]
60
- ? [
61
- ...SkipEmptyWord<CurrentWord>,
62
- ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
63
- ]
64
- : // Case change: upper to lower, brings back the last character, push word
65
- [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>]
66
- ? [
67
- ...RemoveLastCharacter<CurrentWord, LastCharacter>,
68
- ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>,
69
- ]
70
- : // No case change: concat word
71
- SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`>
41
+ ? // Fist char of word
42
+ SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>
43
+ : // Case change: non-numeric to numeric, push word
44
+ [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
45
+ ? [
46
+ ...SkipEmptyWord<CurrentWord>,
47
+ ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
48
+ ]
49
+ : // Case change: numeric to non-numeric, push word
50
+ [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
51
+ ? [
52
+ ...SkipEmptyWord<CurrentWord>,
53
+ ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
54
+ ]
55
+ : // No case change: concat word
56
+ [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>]
57
+ ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`>
58
+ : // Case change: lower to upper, push word
59
+ [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>]
60
+ ? [
61
+ ...SkipEmptyWord<CurrentWord>,
62
+ ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>,
63
+ ]
64
+ : // Case change: upper to lower, brings back the last character, push word
65
+ [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>]
66
+ ? [
67
+ ...RemoveLastCharacter<CurrentWord, LastCharacter>,
68
+ ...SplitWords<
69
+ RemainingCharacters,
70
+ FirstCharacter,
71
+ `${LastCharacter}${FirstCharacter}`
72
+ >,
73
+ ]
74
+ : // No case change: concat word
75
+ SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`>
72
76
  : [...SkipEmptyWord<CurrentWord>];
@@ -1,70 +0,0 @@
1
- import { Text } from "./Text-Bod4OMPk.js";
2
- import classNames from "classnames";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import ScrollContainer from "react-indiana-drag-scroll";
5
-
6
- //#region src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx
7
- const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter }) => {
8
- if (selectedFilterOptions.length === 0) return null;
9
- const filterDefaultWithoutBg = filterDefaultClasses.replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, "").trim();
10
- const buttonClasses = classNames(" spiffy-tw-flex spiffy-tw-items-center spiffy-tw-rounded-full spiffy-tw-px-[8px] spiffy-tw-py-[4px] spiffy-tw-whitespace-nowrap", filterHoverClasses, filterDefaultWithoutBg, appliedFilterBackgroundClasses);
11
- const iconColor = "currentColor";
12
- return /* @__PURE__ */ jsx(ScrollContainer, {
13
- className: filterBarClassNames,
14
- hideScrollbars: true,
15
- children: selectedFilterOptions.map((filter) => {
16
- return /* @__PURE__ */ jsx("button", {
17
- className: buttonClasses,
18
- type: "button",
19
- onClick: () => onRemoveFilter(filter),
20
- "aria-label": `Remove filter: ${filter.displayName}`,
21
- children: /* @__PURE__ */ jsxs("div", {
22
- className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]",
23
- children: [/* @__PURE__ */ jsx(Text, {
24
- variant: "body3",
25
- children: filter.displayName
26
- }), /* @__PURE__ */ jsx("svg", {
27
- xmlns: "http://www.w3.org/2000/svg",
28
- width: "10",
29
- height: "10",
30
- viewBox: "0 0 10 10",
31
- fill: "none",
32
- children: /* @__PURE__ */ jsx("path", {
33
- 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",
34
- fill: iconColor
35
- })
36
- })]
37
- })
38
- }, filter.id);
39
- })
40
- });
41
- };
42
-
43
- //#endregion
44
- //#region src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx
45
- const DynamicFiltersScrollbar = ({ availableDynamicFilters, filterBarClassNames, filterDefaultClasses, filterHoverClasses, onToggleDynamicFilter }) => {
46
- return /* @__PURE__ */ jsx(ScrollContainer, {
47
- className: filterBarClassNames,
48
- hideScrollbars: true,
49
- children: availableDynamicFilters.map(({ name, displayName }) => {
50
- const buttonClasses = classNames("spiffy-tw-px-[12px] spiffy-tw-py-2 spiffy-tw-rounded-full spiffy-tw-border spiffy-tw-whitespace-nowrap ", filterHoverClasses, filterDefaultClasses);
51
- return /* @__PURE__ */ jsx("button", {
52
- type: "button",
53
- className: buttonClasses,
54
- onClick: () => {
55
- onToggleDynamicFilter({
56
- filter: name,
57
- dynamicFilterDisplayName: displayName
58
- });
59
- },
60
- children: /* @__PURE__ */ jsx(Text, {
61
- variant: "body3",
62
- children: displayName
63
- })
64
- }, name);
65
- })
66
- });
67
- };
68
-
69
- //#endregion
70
- export { AppliedFiltersScrollbar, DynamicFiltersScrollbar };