@envive-ai/react-toolkit 0.1.0

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 (210) hide show
  1. package/dist/packages/components/src/atoms/search/types.d.ts +5 -0
  2. package/dist/packages/components/src/atoms/search/types.js +1 -0
  3. package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.d.ts +2 -0
  4. package/dist/packages/components/src/components/common/ButtonBase/ButtonBase.js +41 -0
  5. package/dist/packages/components/src/components/common/ButtonBase/types.d.ts +24 -0
  6. package/dist/packages/components/src/components/common/ButtonBase/types.js +6 -0
  7. package/dist/packages/components/src/components/common/Headline/Headline.d.ts +10 -0
  8. package/dist/packages/components/src/components/common/Headline/Headline.js +34 -0
  9. package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +12 -0
  10. package/dist/packages/components/src/components/common/ImageWithFallback/ImageWithFallback.js +26 -0
  11. package/dist/packages/components/src/components/common/ProductCard/ProductCard.d.ts +39 -0
  12. package/dist/packages/components/src/components/common/ProductCard/ProductCard.js +83 -0
  13. package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.d.ts +9 -0
  14. package/dist/packages/components/src/components/common/ProductCard/ProductCardSkeleton.js +15 -0
  15. package/dist/packages/components/src/components/common/ProductCard/productCardVariants.d.ts +8 -0
  16. package/dist/packages/components/src/components/common/ProductCard/productCardVariants.js +50 -0
  17. package/dist/packages/components/src/components/common/ProductCard/types.d.ts +39 -0
  18. package/dist/packages/components/src/components/common/ProductCard/types.js +10 -0
  19. package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.d.ts +14 -0
  20. package/dist/packages/components/src/components/common/ProductGrid/ProductGrid.js +13 -0
  21. package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.d.ts +10 -0
  22. package/dist/packages/components/src/components/common/ProductGrid/productGridVariants.js +16 -0
  23. package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +7 -0
  24. package/dist/packages/components/src/components/common/SparkleAnimation/SparkleAnimation.js +40 -0
  25. package/dist/packages/components/src/components/common/SparkleAnimation/types.d.ts +6 -0
  26. package/dist/packages/components/src/components/common/SparkleAnimation/types.js +7 -0
  27. package/dist/packages/components/src/components/common/Spinner/Spinner.d.ts +5 -0
  28. package/dist/packages/components/src/components/common/Spinner/Spinner.js +16 -0
  29. package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.d.ts +18 -0
  30. package/dist/packages/components/src/components/common/SuggestionButton/SuggestionButton.js +210 -0
  31. package/dist/packages/components/src/components/common/SuggestionButton/types.d.ts +1 -0
  32. package/dist/packages/components/src/components/common/SuggestionButton/types.js +1 -0
  33. package/dist/packages/components/src/components/common/Text/Text.d.ts +12 -0
  34. package/dist/packages/components/src/components/common/Text/Text.js +26 -0
  35. package/dist/packages/components/src/components/common/Text/textVariantClasses.d.ts +171 -0
  36. package/dist/packages/components/src/components/common/Text/textVariantClasses.js +103 -0
  37. package/dist/packages/components/src/components/common/Text/types.d.ts +16 -0
  38. package/dist/packages/components/src/components/common/Text/types.js +6 -0
  39. package/dist/packages/components/src/components/common/TextInput/TextInput.d.ts +8 -0
  40. package/dist/packages/components/src/components/common/TextInput/TextInput.js +25 -0
  41. package/dist/packages/components/src/components/models/colorsConfig.d.ts +26 -0
  42. package/dist/packages/components/src/components/models/colorsConfig.js +23 -0
  43. package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +11 -0
  44. package/dist/packages/components/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +18 -0
  45. package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +15 -0
  46. package/dist/packages/components/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +15 -0
  47. package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.d.ts +2 -0
  48. package/dist/packages/components/src/components/search/SearchFilter/SearchFilter.js +24 -0
  49. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.d.ts +2 -0
  50. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterHeader.js +9 -0
  51. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.d.ts +2 -0
  52. package/dist/packages/components/src/components/search/SearchFilter/SearchFilterItem.js +13 -0
  53. package/dist/packages/components/src/components/search/SearchFilter/types.d.ts +42 -0
  54. package/dist/packages/components/src/components/search/SearchFilter/types.js +1 -0
  55. package/dist/packages/components/src/components/search/SearchInput/SearchInput.d.ts +16 -0
  56. package/dist/packages/components/src/components/search/SearchInput/SearchInput.js +38 -0
  57. package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.d.ts +13 -0
  58. package/dist/packages/components/src/components/search/SearchInput/searchInputVariants.js +12 -0
  59. package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +10 -0
  60. package/dist/packages/components/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +14 -0
  61. package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.d.ts +16 -0
  62. package/dist/packages/components/src/components/search/SearchInputForm/SearchInputForm.js +13 -0
  63. package/dist/packages/components/src/components/search/SearchInputForm/types.d.ts +1 -0
  64. package/dist/packages/components/src/components/search/SearchInputForm/types.js +1 -0
  65. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +14 -0
  66. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +15 -0
  67. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +16 -0
  68. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +29 -0
  69. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.d.ts +2 -0
  70. package/dist/packages/components/src/components/search/SearchResultsFilterSidebar/types.js +1 -0
  71. package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +8 -0
  72. package/dist/packages/components/src/components/search/SearchResultsStates/NoSearchResultsFound.js +10 -0
  73. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +24 -0
  74. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsGrid.js +19 -0
  75. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +6 -0
  76. package/dist/packages/components/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +10 -0
  77. package/dist/packages/components/src/components/search/types.d.ts +5 -0
  78. package/dist/packages/components/src/components/search/types.js +6 -0
  79. package/dist/packages/components/src/components/test/types.d.ts +3 -0
  80. package/dist/packages/components/src/components/test/types.js +1 -0
  81. package/dist/packages/components/src/config/chatElementDisplayLocation.d.ts +21 -0
  82. package/dist/packages/components/src/config/chatElementDisplayLocation.js +23 -0
  83. package/dist/packages/components/src/index.d.ts +45 -0
  84. package/dist/packages/components/src/index.js +49 -0
  85. package/dist/packages/components/src/logging/logger.d.ts +7 -0
  86. package/dist/packages/components/src/logging/logger.js +16 -0
  87. package/dist/packages/components/src/types/external.d.ts +21 -0
  88. package/dist/packages/components/src/types/external.js +5 -0
  89. package/dist/packages/components/src/util/camelCase.d.ts +65 -0
  90. package/dist/packages/components/src/util/camelCase.js +2 -0
  91. package/dist/packages/components/src/util/camelCasedPropertiesDeep.d.ts +53 -0
  92. package/dist/packages/components/src/util/camelCasedPropertiesDeep.js +1 -0
  93. package/dist/packages/components/src/util/formatPrice.d.ts +1 -0
  94. package/dist/packages/components/src/util/formatPrice.js +11 -0
  95. package/dist/packages/components/src/util/internal.d.ts +27 -0
  96. package/dist/packages/components/src/util/internal.js +4 -0
  97. package/dist/packages/components/src/util/primitive.d.ts +6 -0
  98. package/dist/packages/components/src/util/primitive.js +2 -0
  99. package/dist/packages/components/src/util/splitWords.d.ts +55 -0
  100. package/dist/packages/components/src/util/splitWords.js +2 -0
  101. package/dist/packages/components/src/util/trim.d.ts +24 -0
  102. package/dist/packages/components/src/util/trim.js +2 -0
  103. package/dist/packages/components/src/util/unknownArray.d.ts +25 -0
  104. package/dist/packages/components/src/util/unknownArray.js +1 -0
  105. package/dist/src/atoms/search/types.d.ts +5 -0
  106. package/dist/src/atoms/search/types.js +1 -0
  107. package/dist/src/components/common/ButtonBase/ButtonBase.d.ts +2 -0
  108. package/dist/src/components/common/ButtonBase/ButtonBase.js +41 -0
  109. package/dist/src/components/common/ButtonBase/types.d.ts +24 -0
  110. package/dist/src/components/common/ButtonBase/types.js +6 -0
  111. package/dist/src/components/common/Headline/Headline.d.ts +10 -0
  112. package/dist/src/components/common/Headline/Headline.js +34 -0
  113. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.d.ts +12 -0
  114. package/dist/src/components/common/ImageWithFallback/ImageWithFallback.js +26 -0
  115. package/dist/src/components/common/ProductCard/ProductCard.d.ts +39 -0
  116. package/dist/src/components/common/ProductCard/ProductCard.js +84 -0
  117. package/dist/src/components/common/ProductCard/ProductCardSkeleton.d.ts +9 -0
  118. package/dist/src/components/common/ProductCard/ProductCardSkeleton.js +15 -0
  119. package/dist/src/components/common/ProductCard/productCardVariants.d.ts +8 -0
  120. package/dist/src/components/common/ProductCard/productCardVariants.js +50 -0
  121. package/dist/src/components/common/ProductCard/types.d.ts +39 -0
  122. package/dist/src/components/common/ProductCard/types.js +10 -0
  123. package/dist/src/components/common/ProductGrid/ProductGrid.d.ts +14 -0
  124. package/dist/src/components/common/ProductGrid/ProductGrid.js +13 -0
  125. package/dist/src/components/common/ProductGrid/productGridVariants.d.ts +10 -0
  126. package/dist/src/components/common/ProductGrid/productGridVariants.js +16 -0
  127. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.d.ts +7 -0
  128. package/dist/src/components/common/SparkleAnimation/SparkleAnimation.js +40 -0
  129. package/dist/src/components/common/SparkleAnimation/types.d.ts +6 -0
  130. package/dist/src/components/common/SparkleAnimation/types.js +7 -0
  131. package/dist/src/components/common/Spinner/Spinner.d.ts +5 -0
  132. package/dist/src/components/common/Spinner/Spinner.js +16 -0
  133. package/dist/src/components/common/SuggestionButton/SuggestionButton.d.ts +18 -0
  134. package/dist/src/components/common/SuggestionButton/SuggestionButton.js +210 -0
  135. package/dist/src/components/common/SuggestionButton/types.d.ts +1 -0
  136. package/dist/src/components/common/SuggestionButton/types.js +1 -0
  137. package/dist/src/components/common/Text/Text.d.ts +12 -0
  138. package/dist/src/components/common/Text/Text.js +26 -0
  139. package/dist/src/components/common/Text/textVariantClasses.d.ts +171 -0
  140. package/dist/src/components/common/Text/textVariantClasses.js +103 -0
  141. package/dist/src/components/common/Text/types.d.ts +16 -0
  142. package/dist/src/components/common/Text/types.js +6 -0
  143. package/dist/src/components/common/TextInput/TextInput.d.ts +8 -0
  144. package/dist/src/components/common/TextInput/TextInput.js +25 -0
  145. package/dist/src/components/models/colorsConfig.d.ts +26 -0
  146. package/dist/src/components/models/colorsConfig.js +23 -0
  147. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.d.ts +11 -0
  148. package/dist/src/components/search/FilterScrollbar/AppliedFiltersScrollbar.js +18 -0
  149. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.d.ts +15 -0
  150. package/dist/src/components/search/FilterScrollbar/DynamicFiltersScrollbar.js +15 -0
  151. package/dist/src/components/search/SearchFilter/SearchFilter.d.ts +2 -0
  152. package/dist/src/components/search/SearchFilter/SearchFilter.js +24 -0
  153. package/dist/src/components/search/SearchFilter/SearchFilterHeader.d.ts +2 -0
  154. package/dist/src/components/search/SearchFilter/SearchFilterHeader.js +9 -0
  155. package/dist/src/components/search/SearchFilter/SearchFilterItem.d.ts +2 -0
  156. package/dist/src/components/search/SearchFilter/SearchFilterItem.js +13 -0
  157. package/dist/src/components/search/SearchFilter/types.d.ts +42 -0
  158. package/dist/src/components/search/SearchFilter/types.js +1 -0
  159. package/dist/src/components/search/SearchInput/SearchInput.d.ts +16 -0
  160. package/dist/src/components/search/SearchInput/SearchInput.js +38 -0
  161. package/dist/src/components/search/SearchInput/searchInputVariants.d.ts +13 -0
  162. package/dist/src/components/search/SearchInput/searchInputVariants.js +12 -0
  163. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.d.ts +10 -0
  164. package/dist/src/components/search/SearchInputAutocomplete/SearchAutocomplete.js +14 -0
  165. package/dist/src/components/search/SearchInputForm/SearchInputForm.d.ts +16 -0
  166. package/dist/src/components/search/SearchInputForm/SearchInputForm.js +13 -0
  167. package/dist/src/components/search/SearchInputForm/types.d.ts +1 -0
  168. package/dist/src/components/search/SearchInputForm/types.js +1 -0
  169. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.d.ts +14 -0
  170. package/dist/src/components/search/SearchResultsFilterSidebar/SearchResultsFilter.js +15 -0
  171. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts +16 -0
  172. package/dist/src/components/search/SearchResultsFilterSidebar/searchFilterSidebarVariants.js +29 -0
  173. package/dist/src/components/search/SearchResultsFilterSidebar/types.d.ts +2 -0
  174. package/dist/src/components/search/SearchResultsFilterSidebar/types.js +1 -0
  175. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.d.ts +8 -0
  176. package/dist/src/components/search/SearchResultsStates/NoSearchResultsFound.js +10 -0
  177. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.d.ts +24 -0
  178. package/dist/src/components/search/SearchResultsStates/SearchResultsGrid.js +19 -0
  179. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.d.ts +6 -0
  180. package/dist/src/components/search/SearchResultsStates/SearchResultsLoadingGrid.js +10 -0
  181. package/dist/src/components/search/types.d.ts +5 -0
  182. package/dist/src/components/search/types.js +6 -0
  183. package/dist/src/components/test/types.d.ts +3 -0
  184. package/dist/src/components/test/types.js +1 -0
  185. package/dist/src/config/chatElementDisplayLocation.d.ts +21 -0
  186. package/dist/src/config/chatElementDisplayLocation.js +23 -0
  187. package/dist/src/index.d.ts +45 -0
  188. package/dist/src/index.js +49 -0
  189. package/dist/src/logging/logger.d.ts +7 -0
  190. package/dist/src/logging/logger.js +16 -0
  191. package/dist/src/types/external.d.ts +21 -0
  192. package/dist/src/types/external.js +5 -0
  193. package/dist/src/util/camelCase.d.ts +65 -0
  194. package/dist/src/util/camelCase.js +2 -0
  195. package/dist/src/util/camelCasedPropertiesDeep.d.ts +53 -0
  196. package/dist/src/util/camelCasedPropertiesDeep.js +1 -0
  197. package/dist/src/util/formatPrice.d.ts +1 -0
  198. package/dist/src/util/formatPrice.js +11 -0
  199. package/dist/src/util/internal.d.ts +27 -0
  200. package/dist/src/util/internal.js +4 -0
  201. package/dist/src/util/primitive.d.ts +6 -0
  202. package/dist/src/util/primitive.js +2 -0
  203. package/dist/src/util/splitWords.d.ts +55 -0
  204. package/dist/src/util/splitWords.js +2 -0
  205. package/dist/src/util/trim.d.ts +24 -0
  206. package/dist/src/util/trim.js +2 -0
  207. package/dist/src/util/unknownArray.d.ts +25 -0
  208. package/dist/src/util/unknownArray.js +1 -0
  209. package/dist/tsconfig.tsbuildinfo +1 -0
  210. package/package.json +41 -0
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import ScrollContainer from 'react-indiana-drag-scroll';
4
+ import { Text } from '../../../../../../src/components/common/Text/Text';
5
+ export const AppliedFiltersScrollbar = ({ selectedFilterOptions, filterBarClassNames, filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, onRemoveFilter, }) => {
6
+ if (selectedFilterOptions.length === 0) {
7
+ return null;
8
+ }
9
+ // Extract border and text classes from filterDefaultClasses, excluding background because everything is shared between filters except for the applied filters background
10
+ const filterDefaultWithoutBg = filterDefaultClasses
11
+ .replace(/spiffy-tw-bg-\[--spiffy-colors-[^\]]+\]/g, '')
12
+ .trim();
13
+ 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);
14
+ const iconColor = 'currentColor'; // match with text color
15
+ return (_jsx(ScrollContainer, { className: filterBarClassNames, hideScrollbars: true, children: selectedFilterOptions.map((filter) => {
16
+ return (_jsx("button", { className: buttonClasses, type: "button", onClick: () => onRemoveFilter(filter), "aria-label": `Remove filter: ${filter.displayName}`, children: _jsxs("div", { className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-[8px]", children: [_jsx(Text, { variant: "body3", children: filter.displayName }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: _jsx("path", { 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", fill: iconColor }) })] }) }, filter.id));
17
+ }) }));
18
+ };
@@ -0,0 +1,15 @@
1
+ interface DynamicFiltersScrollbarProps {
2
+ availableDynamicFilters: {
3
+ name: string;
4
+ displayName: string;
5
+ }[];
6
+ filterBarClassNames: string;
7
+ filterDefaultClasses: string;
8
+ filterHoverClasses: string;
9
+ onToggleDynamicFilter: ({ filter, dynamicFilterDisplayName, }: {
10
+ filter: string;
11
+ dynamicFilterDisplayName: string;
12
+ }) => void;
13
+ }
14
+ export declare const DynamicFiltersScrollbar: ({ availableDynamicFilters, filterBarClassNames, filterDefaultClasses, filterHoverClasses, onToggleDynamicFilter, }: DynamicFiltersScrollbarProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import ScrollContainer from 'react-indiana-drag-scroll';
4
+ import { Text } from '../../../../../../src/components/common/Text/Text';
5
+ export const DynamicFiltersScrollbar = ({ availableDynamicFilters, filterBarClassNames, filterDefaultClasses, filterHoverClasses, onToggleDynamicFilter, }) => {
6
+ return (_jsx(ScrollContainer, { className: filterBarClassNames, hideScrollbars: true, children: availableDynamicFilters.map(({ name, displayName }) => {
7
+ const buttonClasses = classNames('spiffy-tw-px-[12px] spiffy-tw-py-2 spiffy-tw-rounded-full spiffy-tw-border spiffy-tw-whitespace-nowrap ', filterHoverClasses, filterDefaultClasses);
8
+ return (_jsx("button", { type: "button", className: buttonClasses, onClick: () => {
9
+ onToggleDynamicFilter({
10
+ filter: name,
11
+ dynamicFilterDisplayName: displayName,
12
+ });
13
+ }, children: _jsx(Text, { variant: "body3", children: displayName }) }, name));
14
+ }) }));
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { SearchFilterProps } from './types';
2
+ export declare const SearchFilter: ({ isOpen, setIsOpen, filters, selectFilterItem, clearAllFilters, filterButtonText, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, headerContent, }: SearchFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { SearchFilterItem } from './SearchFilterItem';
4
+ import { Text } from '../../../../../../src/components/common/Text/Text';
5
+ import { ButtonBase } from '../../../../../../src/components/common/ButtonBase/ButtonBase';
6
+ export const SearchFilter = ({ isOpen, setIsOpen, filters,
7
+ // productCount,
8
+ selectFilterItem, clearAllFilters,
9
+ // applyFiltersUnchangedClasses,
10
+ // applyFiltersChangedClasses,
11
+ filterButtonText, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor,
12
+ // filterCloseIconVariant,
13
+ headerContent, }) => {
14
+ const modalClasses = classNames('spiffy-tw-fixed spiffy-tw-inset-0 spiffy-tw-z-50 spiffy-tw-flex spiffy-tw-transform spiffy-tw-transition-all', {
15
+ 'spiffy-tw-translate-x-full': !isOpen,
16
+ 'spiffy-tw-translate-x-0': isOpen,
17
+ });
18
+ const overlayClasses = classNames('spiffy-tw-absolute spiffy-tw-inset-0 spiffy-tw-bg-black spiffy-tw-bg-opacity-50', {
19
+ 'spiffy-tw-opacity-0': !isOpen,
20
+ 'spiffy-tw-opacity-100': isOpen,
21
+ });
22
+ 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');
23
+ return (_jsxs("div", { className: modalClasses, children: [_jsx("div", { className: overlayClasses, onClick: () => setIsOpen(false) }), _jsxs("div", { className: sidebarClasses, children: [headerContent, _jsx("div", { className: "spiffy-tw-flex-1 spiffy-tw-px-4 spiffy-tw-py-6", children: filters.map((filter) => (_jsxs("div", { className: "spiffy-tw-mb-6", children: [_jsx(Text, { variant: "body2", className: "spiffy-tw-font-medium spiffy-tw-mb-3", children: filter.displayName }), _jsx("ul", { children: filter.items.map((item) => (_jsx(SearchFilterItem, { filterItem: item, onSelectFilterItem: selectFilterItem, radioButtonFillColor: radioButtonFillColor, radioButtonHoverColor: radioButtonHoverColor, radioButtonUncheckedBorderColor: radioButtonUncheckedBorderColor }, item.id))) })] }, filter.id))) }), _jsxs("div", { className: "spiffy-tw-border-t spiffy-tw-border-[--spiffy-colors-border-light] spiffy-tw-px-4 spiffy-tw-py-3", children: [_jsx(ButtonBase, { onClick: clearAllFilters, text: "Clear All", buttonClass: "spiffy-tw-w-full spiffy-tw-mb-2" }), _jsx(ButtonBase, { onClick: () => setIsOpen(false), text: filterButtonText, buttonClass: "spiffy-tw-w-full" })] })] })] }));
24
+ };
@@ -0,0 +1,2 @@
1
+ import type { SearchFilterHeaderProps } from './types';
2
+ export declare const SearchFilterHeader: ({ closeModal, productCount, headerClassName, filterCloseIconVariant, }: SearchFilterHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { Text } from '../../../../../../src/components/common/Text/Text';
4
+ export const SearchFilterHeader = ({ closeModal, productCount, headerClassName, filterCloseIconVariant, }) => {
5
+ const closeIconColor = filterCloseIconVariant === 'dark'
6
+ ? 'var(--spiffy-colors-text-primary)'
7
+ : 'var(--spiffy-colors-text-light)';
8
+ return (_jsxs("div", { className: classNames('spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-px-4 spiffy-tw-py-3', headerClassName), children: [_jsxs(Text, { variant: "body2", className: "spiffy-tw-font-medium", children: ["Filters (", productCount, ")"] }), _jsx("button", { onClick: closeModal, className: "spiffy-tw-p-2", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: _jsx("path", { 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", fill: closeIconColor }) }) })] }));
9
+ };
@@ -0,0 +1,2 @@
1
+ import type { SearchFilterItemProps } from './types';
2
+ export declare const SearchFilterItem: ({ filterItem, onSelectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, }: SearchFilterItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { Text } from '../../../../../../src/components/common/Text/Text';
4
+ export const SearchFilterItem = ({ filterItem, onSelectFilterItem, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, }) => {
5
+ const { displayName, isSelected } = filterItem;
6
+ 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, {
7
+ [radioButtonFillColor]: isSelected,
8
+ });
9
+ return (_jsxs("li", { className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-py-2 spiffy-tw-cursor-pointer", onClick: () => onSelectFilterItem(filterItem), children: [_jsx(Text, { variant: "body3", children: displayName }), _jsx("div", { className: radioClasses, children: isSelected && (_jsx("div", { className: classNames('spiffy-tw-w-2 spiffy-tw-h-2 spiffy-tw-rounded-full', {
10
+ 'spiffy-tw-bg-white': radioButtonFillColor.includes('spiffy-tw-bg-'),
11
+ 'spiffy-tw-bg-black': radioButtonFillColor.includes('spiffy-tw-bg-white'),
12
+ }) })) })] }));
13
+ };
@@ -0,0 +1,42 @@
1
+ import type { ReactNode } from 'react';
2
+ export type SearchFilterItem = {
3
+ id: string;
4
+ displayName: string;
5
+ value: string;
6
+ isSelected: boolean;
7
+ };
8
+ export type SearchFilter = {
9
+ id: string;
10
+ displayName: string;
11
+ items: SearchFilterItem[];
12
+ };
13
+ export type SelectFilterItem = (filterItem: SearchFilterItem) => void;
14
+ export interface SearchFilterItemProps {
15
+ filterItem: SearchFilterItem;
16
+ onSelectFilterItem: SelectFilterItem;
17
+ radioButtonFillColor: string;
18
+ radioButtonHoverColor: string;
19
+ radioButtonUncheckedBorderColor: string;
20
+ }
21
+ export interface SearchFilterHeaderProps {
22
+ closeModal: () => void;
23
+ productCount: number;
24
+ headerClassName: string;
25
+ filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
26
+ }
27
+ export interface SearchFilterProps {
28
+ isOpen: boolean;
29
+ setIsOpen: (isOpen: boolean) => void;
30
+ filters: SearchFilter[];
31
+ productCount: number;
32
+ selectFilterItem: SelectFilterItem;
33
+ clearAllFilters: () => void;
34
+ applyFiltersUnchangedClasses: string;
35
+ applyFiltersChangedClasses: string;
36
+ filterButtonText: string;
37
+ radioButtonFillColor: string;
38
+ radioButtonHoverColor: string;
39
+ radioButtonUncheckedBorderColor: string;
40
+ filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
41
+ headerContent: ReactNode;
42
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { SearchInputVariant } from '../SearchInputForm/types';
3
+ export interface SearchInputProps {
4
+ searchInputVariant?: SearchInputVariant;
5
+ value: string;
6
+ placeholder?: string;
7
+ suggestions?: string[];
8
+ className?: string;
9
+ dataTestId?: string;
10
+ ariaActivedescendant?: string;
11
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
12
+ onChange: (newValue: string) => void;
13
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
14
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
15
+ }
16
+ export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useRef, useImperativeHandle } from 'react';
3
+ import classNames from 'classnames';
4
+ import MagnifyingGlassStarVariant from '@envive/icons/src/MagnifyingGlassStarVariant';
5
+ import CloseIcon from '@envive/icons/src/IconClose';
6
+ import { TextInput } from '../../../../../../src/components/common/TextInput/TextInput';
7
+ import { searchInputVariantClasses } from './searchInputVariants';
8
+ export const SearchInput = React.forwardRef(({ searchInputVariant = 'standard', value, placeholder, suggestions, className, dataTestId, ariaActivedescendant, onKeyDown, onChange, onFocus, onBlur, }, ref) => {
9
+ const localInputRef = useRef(null);
10
+ const { searchInputClasses: inputClassName, searchInputIconColor: iconColor, searchInputBorderColor: borderColor, searchInputCloseIconClasses: closeIconClasses, searchInputActiveStarClasses, placeholderVariant, } = searchInputVariantClasses[searchInputVariant];
11
+ // Expose the local ref through the forwarded ref
12
+ useImperativeHandle(ref, () => localInputRef.current, []);
13
+ const magnifyingGlassClassesBase = [
14
+ 'spiffy-tw-w-[24px]',
15
+ 'spiffy-tw-h-[32px]',
16
+ 'spiffy-tw-stroke-width-1',
17
+ 'sm:spiffy-tw-w-[32px]',
18
+ ];
19
+ const magnifyingGlassClassesInactive = classNames(magnifyingGlassClassesBase);
20
+ const magnifyingGlassClassesActive = classNames([
21
+ ...magnifyingGlassClassesBase,
22
+ searchInputActiveStarClasses,
23
+ ]);
24
+ const containerClasses = classNames('spiffy-global-search-input-container', 'spiffy-tw-relative spiffy-tw-flex spiffy-tw-items-center', className);
25
+ 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);
26
+ const closeButtonIconClassName = classNames([
27
+ 'spiffy-tw-w-[16px]',
28
+ 'spiffy-tw-h-[16px]',
29
+ 'sm:spiffy-tw-w-[24px]',
30
+ 'sm:spiffy-tw-h-[24px]',
31
+ 'spiffy-tw-cursor-pointer',
32
+ closeIconClasses,
33
+ ]);
34
+ return (_jsxs("div", { className: containerClasses, "data-testid": dataTestId, children: [_jsx("div", { className: "spiffy-tw-absolute spiffy-tw-left-3 spiffy-tw-top-1/2 spiffy-tw--translate-y-1/2", children: _jsx(MagnifyingGlassStarVariant, { className: value.length > 0 ? magnifyingGlassClassesActive : magnifyingGlassClassesInactive, stroke: iconColor, strokeWidth: "1px" }) }), _jsx(TextInput, { value: value, onChange: (event) => onChange(event.target.value), onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, placeholder: placeholder, className: inputClasses, placeholderVariant: placeholderVariant, "aria-label": "Search", "aria-autocomplete": "list", "aria-expanded": !!suggestions && suggestions.length > 0, "aria-controls": "autocomplete-results", "aria-activedescendant": ariaActivedescendant, borderRadius: "xl", borderColorClass: borderColor, ref: localInputRef }), value && (_jsx("button", { onClick: () => {
35
+ onChange('');
36
+ localInputRef.current?.focus();
37
+ }, 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", "aria-label": "Clear search input", type: "button", children: _jsx(CloseIcon, { className: closeButtonIconClassName }) }))] }));
38
+ });
@@ -0,0 +1,13 @@
1
+ import type { TextStyleVariantMap } from '../../../../../../src/components/common/Text/textVariantClasses';
2
+ import type { SearchInputVariant } from '../SearchInputForm/types';
3
+ interface SearchInputVariantClasses {
4
+ searchInputIconColor: string;
5
+ searchInputBorderColor: string;
6
+ searchInputCloseIconClasses: string;
7
+ searchInputActiveStarClasses: string;
8
+ autocompleteIconColor: string;
9
+ searchInputClasses: string;
10
+ placeholderVariant: keyof typeof TextStyleVariantMap;
11
+ }
12
+ export declare const searchInputVariantClasses: Record<SearchInputVariant, SearchInputVariantClasses>;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { ColorNames, colorVar } from '../../../../../../src/components/models/colorsConfig';
2
+ export const searchInputVariantClasses = {
3
+ standard: {
4
+ searchInputIconColor: 'transparent', // colorVar(ColorNames.TextSecondary),
5
+ searchInputBorderColor: 'spiffy-tw-border-[--spiffy-colors-border-medium]',
6
+ searchInputCloseIconClasses: '[&>circle]:spiffy-tw-fill-[--spiffy-colors-text-secondary] [&>path]:spiffy-tw-fill-[#fff]',
7
+ searchInputActiveStarClasses: `first:[&>path]:spiffy-tw-stroke-[--spiffy-colors-accent-primary] first:[&>path]:spiffy-tw-fill-[--spiffy-colors-accent-primary]`,
8
+ autocompleteIconColor: colorVar(ColorNames.BackgroundPrimary),
9
+ 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%]',
10
+ placeholderVariant: 'h2',
11
+ },
12
+ };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface GlobalSearchAutocompleteProps {
3
+ id: string;
4
+ results: string[];
5
+ focusedIndex: number;
6
+ onSuggestionSelect: (suggestion: string, rankPosition: number) => void;
7
+ iconColor?: string;
8
+ }
9
+ export declare const SearchAutocomplete: React.FC<GlobalSearchAutocompleteProps>;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { motion } from 'framer-motion';
3
+ import classNames from 'classnames';
4
+ import OutlinedStar from '@envive/icons/src/OutlinedStar';
5
+ export const SearchAutocomplete = ({ id, results, focusedIndex, onSuggestionSelect, iconColor, }) => {
6
+ if (results.length === 0) {
7
+ return null;
8
+ }
9
+ return (_jsx(motion.div, { className: "spiffy-tw-h-full", initial: { opacity: 0, y: -10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2 }, children: _jsx("ul", { id: id, role: "listbox", className: "spiffy-tw-mt-4 spiffy-tw-space-y-2", children: results.map((result, index) => (_jsxs("li", { id: `option-${index}`, role: "option", "aria-selected": index === focusedIndex, className: classNames('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'), onClick: () => onSuggestionSelect(result, index), onKeyDown: (event) => {
10
+ if (event.key === 'Enter' || event.keyCode === 13) {
11
+ onSuggestionSelect(result, index);
12
+ }
13
+ }, children: [_jsx(OutlinedStar, { className: "spiffy-tw-w-[16px] spiffy-tw-h-[16px] spiffy-tw-mr-2", fill: iconColor }), _jsx("span", { className: "spiffy-tw-font-bold", children: result })] }, index))) }) }));
14
+ };
@@ -0,0 +1,16 @@
1
+ import type { SearchInputVariant } from './types';
2
+ interface SearchInputFormProps {
3
+ searchInputVariant: SearchInputVariant;
4
+ searchText: string;
5
+ autocompleteResults: string[];
6
+ searchBoxPlaceholder: string;
7
+ focusedOptionId: string | undefined;
8
+ isDirty: boolean;
9
+ focusedIndex: number;
10
+ onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
11
+ onAutocompleteSelect: (suggestion: string) => void;
12
+ onSearchInputChange: (value: string) => void;
13
+ onSearchSubmit: () => void;
14
+ }
15
+ export declare const SearchInputForm: ({ searchInputVariant, searchText, autocompleteResults, searchBoxPlaceholder, focusedOptionId, isDirty, focusedIndex, onKeyDown, onAutocompleteSelect, onSearchInputChange, onSearchSubmit, }: SearchInputFormProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SearchAutocomplete } from '../SearchInputAutocomplete/SearchAutocomplete';
3
+ import { searchInputVariantClasses } from '../SearchInput/searchInputVariants';
4
+ import { SearchInput } from '../SearchInput/SearchInput';
5
+ export const SearchInputForm = ({ searchInputVariant, searchText, autocompleteResults, searchBoxPlaceholder, focusedOptionId, isDirty, focusedIndex, onKeyDown, onAutocompleteSelect, onSearchInputChange, onSearchSubmit, }) => {
6
+ const { searchInputIconColor } = searchInputVariantClasses[searchInputVariant];
7
+ return (_jsxs(_Fragment, { children: [_jsx("form", { onSubmit: (e) => {
8
+ e.preventDefault();
9
+ onSearchSubmit();
10
+ }, className: "spiffy-tw-grow", children: _jsx(SearchInput, { value: searchText, placeholder: searchBoxPlaceholder, suggestions: autocompleteResults, ariaActivedescendant: focusedOptionId, searchInputVariant: searchInputVariant,
11
+ // dataTestId={SEARCH_INPUT_TESTID}
12
+ onKeyDown: onKeyDown, onChange: onSearchInputChange }) }), isDirty && (_jsx(SearchAutocomplete, { id: "autocomplete-results", results: autocompleteResults, focusedIndex: focusedIndex, iconColor: searchInputIconColor, onSuggestionSelect: onAutocompleteSelect }))] }));
13
+ };
@@ -0,0 +1 @@
1
+ export type SearchInputVariant = 'standard';
@@ -0,0 +1,14 @@
1
+ import type { SearchFilter as SearchFilterType, SelectFilterItem } from '../SearchFilter/types';
2
+ import type { SearchFilterSidebarVariant } from './types';
3
+ export type SearchResultsFilterProps = {
4
+ productCount: number;
5
+ isOpen: boolean;
6
+ setIsOpen: (isOpen: boolean) => void;
7
+ searchFilters: SearchFilterType[];
8
+ searchFilterSidebarVariant: SearchFilterSidebarVariant;
9
+ searchText: string;
10
+ onSelectFilterItem: SelectFilterItem;
11
+ onClearAllFilters: () => void;
12
+ filterButtonText: string;
13
+ };
14
+ export declare const SearchResultsFilter: ({ productCount, isOpen, setIsOpen, searchFilters, searchFilterSidebarVariant, onSelectFilterItem, onClearAllFilters, filterButtonText, }: SearchResultsFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from 'react';
3
+ import { SearchFilter } from '../SearchFilter/SearchFilter';
4
+ import { SearchFilterHeader } from '../SearchFilter/SearchFilterHeader';
5
+ import { searchFilterSidebarVariantClasses } from './searchFilterSidebarVariants';
6
+ import { ButtonBase } from '../../../../../../src/components/common/ButtonBase/ButtonBase';
7
+ export const SearchResultsFilter = ({ productCount, isOpen, setIsOpen, searchFilters, searchFilterSidebarVariant, onSelectFilterItem, onClearAllFilters, filterButtonText, }) => {
8
+ const { applyFiltersUnchangedClasses, applyFiltersChangedClasses, searchFilterHeaderClasses, radioButtonFillColor, radioButtonHoverColor, radioButtonUncheckedBorderColor, filterCloseIconVariant, } = searchFilterSidebarVariantClasses[searchFilterSidebarVariant];
9
+ const openFilter = useCallback(() => {
10
+ setIsOpen(true);
11
+ }, [setIsOpen]);
12
+ return (_jsxs(_Fragment, { children: [_jsx(SearchFilter, { isOpen: isOpen, setIsOpen: setIsOpen, filters: searchFilters, productCount: productCount, selectFilterItem: onSelectFilterItem, clearAllFilters: onClearAllFilters, applyFiltersUnchangedClasses: applyFiltersUnchangedClasses, applyFiltersChangedClasses: applyFiltersChangedClasses, filterButtonText: filterButtonText, radioButtonFillColor: radioButtonFillColor, radioButtonHoverColor: radioButtonHoverColor, radioButtonUncheckedBorderColor: radioButtonUncheckedBorderColor, filterCloseIconVariant: filterCloseIconVariant, headerContent: _jsx(SearchFilterHeader, { closeModal: () => setIsOpen(false), productCount: productCount, headerClassName: searchFilterHeaderClasses, filterCloseIconVariant: filterCloseIconVariant }) }), _jsx(ButtonBase, { onClick: openFilter,
13
+ // icon={SettingsVariant} // Icon is handled by user
14
+ iconClass: "spiffy-tw-w-[28px] spiffy-tw-h-[28px] spiffy-tw-object-center", text: filterButtonText, textClass: "spiffy-tw-uppercase spiffy-tw-text-[--spiffy-colors-text-primary] spiffy-tw-hidden md:spiffy-tw-block", buttonClass: "spiffy-tw-flex-row spiffy-tw-pl-[16px] sm:spiffy-tw-pl-0 sm:spiffy-tw-px-4 sm:spiffy-tw-gap-[8px]", disablePadding: true })] }));
15
+ };
@@ -0,0 +1,16 @@
1
+ import type { SearchFilterSidebarVariant, CloseIconVariant } from './types';
2
+ interface SearchFilterSidebarVariantClasses {
3
+ searchFilterHeaderClasses: string;
4
+ radioButtonFillColor: string;
5
+ radioButtonHoverColor: string;
6
+ radioButtonUncheckedBorderColor: string;
7
+ filterDefaultClasses: string;
8
+ filterActiveClasses: string;
9
+ filterHoverClasses: string;
10
+ appliedFilterBackgroundClasses: string;
11
+ applyFiltersUnchangedClasses: string;
12
+ applyFiltersChangedClasses: string;
13
+ filterCloseIconVariant: CloseIconVariant;
14
+ }
15
+ export declare const searchFilterSidebarVariantClasses: Record<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses>;
16
+ export {};
@@ -0,0 +1,29 @@
1
+ import { ColorNames, colorVar } from '../../../../../../src/components/models/colorsConfig';
2
+ export const searchFilterSidebarVariantClasses = {
3
+ darkButton: {
4
+ radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
5
+ radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
6
+ radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
7
+ searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-light]',
8
+ filterDefaultClasses: 'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
9
+ filterHoverClasses: 'hover:spiffy-tw-border-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-text-[--spiffy-colors-text-primary]',
10
+ filterActiveClasses: 'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
11
+ appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
12
+ applyFiltersUnchangedClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
13
+ applyFiltersChangedClasses: 'spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
14
+ filterCloseIconVariant: 'light',
15
+ },
16
+ lightButton: {
17
+ radioButtonFillColor: colorVar(ColorNames.BackgroundDark),
18
+ radioButtonHoverColor: colorVar(ColorNames.BackgroundSecondaryDark),
19
+ radioButtonUncheckedBorderColor: colorVar(ColorNames.BorderMedium),
20
+ searchFilterHeaderClasses: 'spiffy-tw-text-[--spiffy-colors-text-primary]',
21
+ filterDefaultClasses: 'spiffy-tw-border-[--spiffy-colors-border-medium] spiffy-tw-bg-[--spiffy-colors-background-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
22
+ filterHoverClasses: 'hover:spiffy-tw-border-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark] hover:spiffy-tw-text-[--spiffy-colors-text-primary]',
23
+ filterActiveClasses: 'spiffy-tw-border-[--spiffy-colors-border-outline] spiffy-tw-bg-[--spiffy-colors-background-dark] spiffy-tw-text-[--spiffy-colors-text-light]',
24
+ appliedFilterBackgroundClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light]',
25
+ applyFiltersUnchangedClasses: 'spiffy-tw-bg-[--spiffy-colors-border-light] spiffy-tw-text-[--spiffy-colors-text-secondary]',
26
+ applyFiltersChangedClasses: 'spiffy-tw-bg-[--spiffy-colors-background-primary] spiffy-tw-text-[--spiffy-colors-text-link]',
27
+ filterCloseIconVariant: 'dark',
28
+ },
29
+ };
@@ -0,0 +1,2 @@
1
+ export type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
2
+ export type CloseIconVariant = 'light' | 'tertiary' | 'dark';
@@ -0,0 +1,8 @@
1
+ interface NoSearchResultsFoundProps {
2
+ containerPaddingClasses: string;
3
+ includeBottomMargin?: boolean;
4
+ noResultsFoundText?: string;
5
+ sparkleIconColor?: string;
6
+ }
7
+ export declare const NoSearchResultsFound: ({ containerPaddingClasses, includeBottomMargin, noResultsFoundText, sparkleIconColor, }: NoSearchResultsFoundProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import Sparkles from '@envive/icons/src/Sparkles';
4
+ import { Text } from '../../../../../../src/components/common/Text/Text';
5
+ export const NoSearchResultsFound = ({ containerPaddingClasses, includeBottomMargin = false, noResultsFoundText, sparkleIconColor = 'var(--spiffy-colors-accent-primary)', }) => {
6
+ const containerClasses = classNames(containerPaddingClasses, includeBottomMargin ? 'spiffy-tw-mb-[100vh]' : '', 'spiffy-tw-mt-6');
7
+ const textPrompt = noResultsFoundText ||
8
+ 'I’m sorry, I wasn’t able to find an exact match. Try changing your filters or adjusting your search query.';
9
+ return (_jsx("div", { className: containerClasses, children: _jsxs("div", { className: "spiffy-tw-flex spiffy-tw-items-start spiffy-tw-gap-2", children: [_jsx("div", { children: _jsx(Sparkles, { className: "spiffy-tw-w-[24px] spiffy-tw-h-[24px]", style: { color: sparkleIconColor } }) }), _jsx(Text, { variant: "body2", children: textPrompt })] }) }));
10
+ };
@@ -0,0 +1,24 @@
1
+ import type { SelectedFilterOption } from '../../../../../../src/atoms/search/types';
2
+ import type { SearchResponseProduct } from '../../../../../../src/types/external';
3
+ import type { SearchFilterSidebarVariant } from '../SearchResultsFilterSidebar/types';
4
+ import { ProductGridVariant } from '../../../../../../src/components/common/ProductCard/types';
5
+ interface SearchResultsGridProps {
6
+ productList: SearchResponseProduct[];
7
+ availableDynamicFilters: {
8
+ name: string;
9
+ displayName: string;
10
+ }[];
11
+ searchFilterSidebarVariant: SearchFilterSidebarVariant;
12
+ productGridVariant: ProductGridVariant;
13
+ selectedFilterOptions: SelectedFilterOption[];
14
+ searchResponseId: string;
15
+ containerXPaddingClasses: string;
16
+ productGridClasses: string;
17
+ onRemoveFilter: (filter: SelectedFilterOption) => void;
18
+ onToggleDynamicFilter: ({ filter, dynamicFilterDisplayName, }: {
19
+ filter: string;
20
+ dynamicFilterDisplayName: string;
21
+ }) => void;
22
+ }
23
+ export declare const SearchResultsGrid: ({ productList, availableDynamicFilters, searchFilterSidebarVariant, productGridVariant, selectedFilterOptions, searchResponseId, containerXPaddingClasses, productGridClasses, onRemoveFilter, onToggleDynamicFilter, }: SearchResultsGridProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { motion } from 'framer-motion';
3
+ import classNames from 'classnames';
4
+ import { ProductGrid } from '../../../../../../src/components/common/ProductGrid/ProductGrid';
5
+ import { AppliedFiltersScrollbar } from '../FilterScrollbar/AppliedFiltersScrollbar';
6
+ import { DynamicFiltersScrollbar } from '../FilterScrollbar/DynamicFiltersScrollbar';
7
+ import { searchFilterSidebarVariantClasses } from '../SearchResultsFilterSidebar/searchFilterSidebarVariants';
8
+ export const SearchResultsGrid = ({ productList, availableDynamicFilters, searchFilterSidebarVariant, productGridVariant, selectedFilterOptions, searchResponseId, containerXPaddingClasses, productGridClasses, onRemoveFilter, onToggleDynamicFilter, }) => {
9
+ const sharedFilterBarClasses = classNames('spiffy-suggestion-bar', 'spiffy-tw-no-scrollbar', 'spiffy-tw-flex', 'spiffy-tw-flex-row', 'spiffy-tw-gap-2', 'spiffy-tw-mb-[16px]', 'spiffy-tw-overflow-x-scroll', containerXPaddingClasses);
10
+ const filterBarClasses = classNames(sharedFilterBarClasses, 'spiffy-tw-mt-[24px]');
11
+ const appliedFilterBarClasses = classNames(sharedFilterBarClasses, 'spiffy-tw-mb-[32px]', 'spiffy-tw-mt-[8px]');
12
+ const {
13
+ // We may want to pull these into their own variant separated from the filter sidebar (but also used in it) In this case, we need them for dynamic filters
14
+ filterDefaultClasses, filterHoverClasses, appliedFilterBackgroundClasses, } = searchFilterSidebarVariantClasses[searchFilterSidebarVariant];
15
+ return (_jsxs(motion.div, { className: "spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, children: [_jsx(AppliedFiltersScrollbar, { selectedFilterOptions: selectedFilterOptions, filterBarClassNames: appliedFilterBarClasses, filterDefaultClasses: filterDefaultClasses, filterHoverClasses: filterHoverClasses, appliedFilterBackgroundClasses: appliedFilterBackgroundClasses, onRemoveFilter: onRemoveFilter }), _jsx(DynamicFiltersScrollbar, { availableDynamicFilters: availableDynamicFilters, filterBarClassNames: filterBarClasses, filterDefaultClasses: filterDefaultClasses, filterHoverClasses: filterHoverClasses, onToggleDynamicFilter: onToggleDynamicFilter }), _jsx(ProductGrid, { productList: productList, productGridVariant: productGridVariant, productGridClasses: productGridClasses, searchResponseId: searchResponseId, merchantShortName: '', handleClick: function (clickedUrl) {
16
+ console.log(clickedUrl);
17
+ throw new Error('Function not implemented.');
18
+ } })] }));
19
+ };
@@ -0,0 +1,6 @@
1
+ import { ProductGridVariant } from '../../../../../../src/components/common/ProductCard/types';
2
+ export declare const SearchResultsLoadingGrid: ({ productGridVariant, productGridClasses, sparkleIconColor, }: {
3
+ productGridVariant: ProductGridVariant;
4
+ productGridClasses: string;
5
+ sparkleIconColor?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from '../../../../../../src/components/common/Text/Text';
3
+ import { SparkleAnimation } from '../../../../../../src/components/common/SparkleAnimation/SparkleAnimation';
4
+ import { motion } from 'framer-motion';
5
+ import { ProductCardSkeleton } from '../../../../../../src/components/common/ProductCard/ProductCardSkeleton';
6
+ import { productGridVariantClasses } from '../../../../../../src/components/common/ProductGrid/productGridVariants';
7
+ export const SearchResultsLoadingGrid = ({ productGridVariant, productGridClasses, sparkleIconColor = 'var(--spiffy-colors-accent-primary)', }) => {
8
+ const { productCardLayoutVariant, productCardImageAspectRatio } = productGridVariantClasses[productGridVariant];
9
+ return (_jsx(motion.div, { className: "spiffy-tw-justify-center spiffy-tw-w-full spiffy-tw-overflow-hidden", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, children: _jsxs("div", { className: "spiffy-tw-mt-6 spiffy-tw-w-full", children: [_jsx("div", { className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-justify-between spiffy-tw-mb-4", children: _jsxs("div", { className: "spiffy-tw-flex spiffy-tw-items-center spiffy-tw-gap-2 spiffy-tw-ml-[16px] md:spiffy-tw-ml-[80px]", children: [_jsx("div", { className: "spiffy-tw-width-[24px]", children: _jsx(SparkleAnimation, { color: sparkleIconColor, animate: true }) }), _jsx(Text, { variant: "body2", children: "Finding the best options for you..." })] }) }), _jsx("div", { className: productGridClasses, children: Array.from({ length: 8 }).map((_, index) => (_jsx(ProductCardSkeleton, { layoutVariant: productCardLayoutVariant, aspectRatio: productCardImageAspectRatio, growWithContainer: true }, index))) })] }) }));
10
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum SearchResultsState {
2
+ NoResults = "noResults",
3
+ Results = "results",
4
+ Loading = "loading"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var SearchResultsState;
2
+ (function (SearchResultsState) {
3
+ SearchResultsState["NoResults"] = "noResults";
4
+ SearchResultsState["Results"] = "results";
5
+ SearchResultsState["Loading"] = "loading";
6
+ })(SearchResultsState || (SearchResultsState = {}));
@@ -0,0 +1,3 @@
1
+ export interface TestProps {
2
+ dataTestId?: string;
3
+ }
@@ -0,0 +1,21 @@
1
+ export declare enum ChatElementDisplayLocation {
2
+ IN_CHAT = "in_chat",
3
+ CHAT_PREVIEW = "chat_preview",
4
+ FLOATING_BUTTON = "floating_button",
5
+ HELP_ME_CHOOSE = "help_me_choose",
6
+ PLP_IMAGE_BANNER = "plp_image_banner",
7
+ TOP_REVIEWS_SNIPPET = "top_reviews_snippet",
8
+ BOTTOM_REVIEWS_SNIPPET = "bottom_reviews_snippet",
9
+ BLOCK_BACK_BUTTON = "block_back_button",
10
+ SWITCH_TO_AGENT = "switch_to_agent",
11
+ CONVERSATIONAL_SEARCH = "conversational_search",
12
+ GLOBAL_SEARCH_ENTRYPOINT = "global_search_entrypoint",
13
+ SEARCH_NAV_ENTRYPOINT = "search_nav_entrypoint",
14
+ SEARCH_PROMPT = "search_prompt",
15
+ SEARCH_PROMPT_BUTTON = "search_prompt_button",
16
+ PRODUCT_GRID = "product_grid",
17
+ UNSPECIFIED = "unspecified",
18
+ FILTER_MODAL = "filter_modal",
19
+ PROMPT_CARD = "prompt_card",
20
+ WINDOW_API_CALL = "window_api_call"
21
+ }
@@ -0,0 +1,23 @@
1
+ // Chat element display location enum
2
+ export var ChatElementDisplayLocation;
3
+ (function (ChatElementDisplayLocation) {
4
+ ChatElementDisplayLocation["IN_CHAT"] = "in_chat";
5
+ ChatElementDisplayLocation["CHAT_PREVIEW"] = "chat_preview";
6
+ ChatElementDisplayLocation["FLOATING_BUTTON"] = "floating_button";
7
+ ChatElementDisplayLocation["HELP_ME_CHOOSE"] = "help_me_choose";
8
+ ChatElementDisplayLocation["PLP_IMAGE_BANNER"] = "plp_image_banner";
9
+ ChatElementDisplayLocation["TOP_REVIEWS_SNIPPET"] = "top_reviews_snippet";
10
+ ChatElementDisplayLocation["BOTTOM_REVIEWS_SNIPPET"] = "bottom_reviews_snippet";
11
+ ChatElementDisplayLocation["BLOCK_BACK_BUTTON"] = "block_back_button";
12
+ ChatElementDisplayLocation["SWITCH_TO_AGENT"] = "switch_to_agent";
13
+ ChatElementDisplayLocation["CONVERSATIONAL_SEARCH"] = "conversational_search";
14
+ ChatElementDisplayLocation["GLOBAL_SEARCH_ENTRYPOINT"] = "global_search_entrypoint";
15
+ ChatElementDisplayLocation["SEARCH_NAV_ENTRYPOINT"] = "search_nav_entrypoint";
16
+ ChatElementDisplayLocation["SEARCH_PROMPT"] = "search_prompt";
17
+ ChatElementDisplayLocation["SEARCH_PROMPT_BUTTON"] = "search_prompt_button";
18
+ ChatElementDisplayLocation["PRODUCT_GRID"] = "product_grid";
19
+ ChatElementDisplayLocation["UNSPECIFIED"] = "unspecified";
20
+ ChatElementDisplayLocation["FILTER_MODAL"] = "filter_modal";
21
+ ChatElementDisplayLocation["PROMPT_CARD"] = "prompt_card";
22
+ ChatElementDisplayLocation["WINDOW_API_CALL"] = "window_api_call";
23
+ })(ChatElementDisplayLocation || (ChatElementDisplayLocation = {}));