@envive-ai/react-toolkit 0.2.10 → 0.2.11

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 (199) hide show
  1. package/dist/Accordion/index.cjs +2 -2
  2. package/dist/Accordion/index.d.cts +2 -2
  3. package/dist/Accordion/index.d.ts +2 -2
  4. package/dist/Accordion/index.js +2 -2
  5. package/dist/{Accordion-DxtXK__u.js → Accordion-B8aUlf0q.js} +2 -2
  6. package/dist/{Accordion-RpyCFs2a.cjs → Accordion-FyCFBOen.cjs} +3 -3
  7. package/dist/AnimatedChevron/index.cjs +1 -1
  8. package/dist/AnimatedChevron/index.d.cts +2 -2
  9. package/dist/AnimatedChevron/index.d.ts +2 -2
  10. package/dist/AnimatedChevron/index.js +1 -1
  11. package/dist/AppliedFiltersScrollbar/index.cjs +3 -3
  12. package/dist/AppliedFiltersScrollbar/index.d.cts +3 -3
  13. package/dist/AppliedFiltersScrollbar/index.d.ts +3 -3
  14. package/dist/AppliedFiltersScrollbar/index.js +2 -2
  15. package/dist/ButtonBase/index.cjs +2 -2
  16. package/dist/ButtonBase/index.d.cts +3 -3
  17. package/dist/ButtonBase/index.d.ts +3 -3
  18. package/dist/ButtonBase/index.js +2 -2
  19. package/dist/{ButtonBase-AU23oGQr.cjs → ButtonBase-B6vDKbGQ.cjs} +3 -3
  20. package/dist/{ButtonBase-6wjsZ1tU.js → ButtonBase-Bpc7nOpz.js} +2 -2
  21. package/dist/DynamicFiltersScrollbar/index.cjs +3 -3
  22. package/dist/DynamicFiltersScrollbar/index.d.cts +2 -2
  23. package/dist/DynamicFiltersScrollbar/index.d.ts +2 -2
  24. package/dist/DynamicFiltersScrollbar/index.js +2 -2
  25. package/dist/{DynamicFiltersScrollbar-CJG4K0PH.js → DynamicFiltersScrollbar-D8OqC4DA.js} +2 -2
  26. package/dist/{DynamicFiltersScrollbar-DgS9gpdg.cjs → DynamicFiltersScrollbar-DIwHWq6v.cjs} +3 -3
  27. package/dist/FilterScrollbar/index.cjs +2 -2
  28. package/dist/FilterScrollbar/index.d.cts +4 -4
  29. package/dist/FilterScrollbar/index.d.ts +4 -4
  30. package/dist/FilterScrollbar/index.js +2 -2
  31. package/dist/ImageWithFallback/index.cjs +1 -1
  32. package/dist/ImageWithFallback/index.d.cts +2 -2
  33. package/dist/ImageWithFallback/index.d.ts +2 -2
  34. package/dist/ImageWithFallback/index.js +1 -1
  35. package/dist/{ImageWithFallback-c-DTsBH-.js → ImageWithFallback-BW57cQw-.js} +1 -1
  36. package/dist/{ImageWithFallback-Bx17VPmQ.cjs → ImageWithFallback-DvaVpR6v.cjs} +2 -2
  37. package/dist/ModalSheet/index.cjs +2 -2
  38. package/dist/ModalSheet/index.d.cts +2 -2
  39. package/dist/ModalSheet/index.d.ts +2 -2
  40. package/dist/ModalSheet/index.js +2 -2
  41. package/dist/{ModalSheet-CcthFeMD.cjs → ModalSheet-BvM2PJbH.cjs} +3 -3
  42. package/dist/{ModalSheet-BSj_g9JF.js → ModalSheet-DFva7krP.js} +2 -2
  43. package/dist/ProductCard/index.cjs +4 -6
  44. package/dist/ProductCard/index.d.cts +82 -2
  45. package/dist/ProductCard/index.d.ts +82 -2
  46. package/dist/ProductCard/index.js +5 -5
  47. package/dist/{ProductCard-n-PAth5m.js → ProductCard-BiWAcPO4.js} +8 -16
  48. package/dist/{ProductCard-C-8ie9Lf.cjs → ProductCard-C2KvH4MN.cjs} +8 -28
  49. package/dist/ProductGrid/index.cjs +5 -5
  50. package/dist/ProductGrid/index.d.cts +3 -4
  51. package/dist/ProductGrid/index.d.ts +3 -4
  52. package/dist/ProductGrid/index.js +5 -5
  53. package/dist/{ProductGrid-xXkWzvR2.js → ProductGrid-B1RtE58G.js} +2 -2
  54. package/dist/{ProductGrid-Ba2tUgmC.cjs → ProductGrid-DkOyRAEg.cjs} +3 -3
  55. package/dist/RadioButton/index.cjs +2 -2
  56. package/dist/RadioButton/index.d.cts +3 -3
  57. package/dist/RadioButton/index.d.ts +3 -3
  58. package/dist/RadioButton/index.js +2 -2
  59. package/dist/{RadioButton-gnFz0TWN.js → RadioButton-CQ6qOvBl.js} +2 -2
  60. package/dist/{RadioButton-BBc1b5vX.cjs → RadioButton-DP-qs5cy.cjs} +3 -3
  61. package/dist/RadioButtonGroup/index.cjs +3 -3
  62. package/dist/RadioButtonGroup/index.d.cts +3 -3
  63. package/dist/RadioButtonGroup/index.d.ts +3 -3
  64. package/dist/RadioButtonGroup/index.js +3 -3
  65. package/dist/{RadioButtonGroup-DxOtcIdO.cjs → RadioButtonGroup-CJPWfAaA.cjs} +3 -3
  66. package/dist/{RadioButtonGroup-DLLleeDX.js → RadioButtonGroup-Ce8cKqYw.js} +2 -2
  67. package/dist/SearchAutocomplete/index.cjs +2 -2
  68. package/dist/SearchAutocomplete/index.d.cts +2 -2
  69. package/dist/SearchAutocomplete/index.d.ts +2 -2
  70. package/dist/SearchAutocomplete/index.js +2 -2
  71. package/dist/{SearchAutocomplete-B690CIZB.js → SearchAutocomplete-CjjL2_lm.js} +2 -2
  72. package/dist/{SearchAutocomplete-DAEDHeqr.cjs → SearchAutocomplete-bbMvWWjI.cjs} +3 -3
  73. package/dist/SearchFilter/index.cjs +9 -9
  74. package/dist/SearchFilter/index.d.cts +6 -43
  75. package/dist/SearchFilter/index.d.ts +6 -43
  76. package/dist/SearchFilter/index.js +9 -9
  77. package/dist/{SearchFilter-ylBowO7T.cjs → SearchFilter-BLi6E9Wx.cjs} +8 -8
  78. package/dist/{SearchFilter-Bi0zqO3-.js → SearchFilter-wHwOym_n.js} +7 -7
  79. package/dist/SearchInput/index.cjs +4 -4
  80. package/dist/SearchInput/index.d.cts +3 -4
  81. package/dist/SearchInput/index.d.ts +3 -4
  82. package/dist/SearchInput/index.js +4 -4
  83. package/dist/{SearchInput-Yy6NIiSk.cjs → SearchInput-BA6bepV_.cjs} +7 -5
  84. package/dist/{SearchInput-Q3knp7tj.js → SearchInput-C3nNkmBm.js} +4 -3
  85. package/dist/SearchInputForm/index.cjs +7 -7
  86. package/dist/SearchInputForm/index.d.cts +3 -3
  87. package/dist/SearchInputForm/index.d.ts +3 -3
  88. package/dist/SearchInputForm/index.js +6 -6
  89. package/dist/SearchResultsContent/index.cjs +15 -15
  90. package/dist/SearchResultsContent/index.d.cts +1 -4
  91. package/dist/SearchResultsContent/index.d.ts +3 -6
  92. package/dist/SearchResultsContent/index.js +11 -11
  93. package/dist/SearchResultsFilterSidebar/index.cjs +13 -13
  94. package/dist/SearchResultsFilterSidebar/index.d.cts +42 -2
  95. package/dist/SearchResultsFilterSidebar/index.d.ts +42 -2
  96. package/dist/SearchResultsFilterSidebar/index.js +12 -12
  97. package/dist/SearchResultsStates/index.cjs +10 -10
  98. package/dist/SearchResultsStates/index.d.cts +5 -7
  99. package/dist/SearchResultsStates/index.d.ts +5 -7
  100. package/dist/SearchResultsStates/index.js +10 -10
  101. package/dist/{SearchResultsStates-BjFB9Qo9.cjs → SearchResultsStates-C-8fh8B9.cjs} +8 -8
  102. package/dist/{SearchResultsStates-D8Uz39yp.js → SearchResultsStates-D62WbDTD.js} +7 -7
  103. package/dist/SparkleAnimation/index.cjs +2 -3
  104. package/dist/SparkleAnimation/index.d.cts +3 -11
  105. package/dist/SparkleAnimation/index.d.ts +3 -11
  106. package/dist/SparkleAnimation/index.js +2 -2
  107. package/dist/{SparkleAnimation-CvGlWUqv.cjs → SparkleAnimation-BFAj73CF.cjs} +7 -16
  108. package/dist/{SparkleAnimation-paLhSu5E.js → SparkleAnimation-BYDUEqWX.js} +7 -10
  109. package/dist/Spinner/index.cjs +1 -1
  110. package/dist/Spinner/index.d.cts +2 -2
  111. package/dist/Spinner/index.d.ts +2 -2
  112. package/dist/Spinner/index.js +1 -1
  113. package/dist/{Spinner-DjK8ts9E.cjs → Spinner-Ccy6VFEp.cjs} +2 -2
  114. package/dist/{Spinner-BqTt55uu.js → Spinner-D2HbRsuw.js} +1 -1
  115. package/dist/SuggestionButton/index.cjs +4 -4
  116. package/dist/SuggestionButton/index.d.cts +3 -3
  117. package/dist/SuggestionButton/index.d.ts +3 -3
  118. package/dist/SuggestionButton/index.js +3 -3
  119. package/dist/TextInput/index.cjs +2 -2
  120. package/dist/TextInput/index.d.cts +2 -2
  121. package/dist/TextInput/index.d.ts +2 -2
  122. package/dist/TextInput/index.js +2 -2
  123. package/dist/{TextInput-B70n36-J.cjs → TextInput-CYTko3-n.cjs} +3 -3
  124. package/dist/{TextInput-y6nNxaTI.js → TextInput-CmxnphaT.js} +2 -2
  125. package/dist/ToggleButton/index.cjs +2 -2
  126. package/dist/ToggleButton/index.d.cts +2 -2
  127. package/dist/ToggleButton/index.d.ts +2 -2
  128. package/dist/ToggleButton/index.js +2 -2
  129. package/dist/{ToggleButton-CJ74eu-N.cjs → ToggleButton-CvxNLMe_.cjs} +3 -3
  130. package/dist/{ToggleButton-Br6MgjiG.js → ToggleButton-V9Qsaks7.js} +2 -2
  131. package/dist/Typography/index.cjs +1 -1
  132. package/dist/Typography/index.d.cts +2 -2
  133. package/dist/Typography/index.d.ts +2 -2
  134. package/dist/Typography/index.js +1 -1
  135. package/dist/colorVar-B5CLhSof.cjs +11 -0
  136. package/dist/colorVar-BJve0Z4_.js +5 -0
  137. package/dist/{index-Qtr26aUO.d.ts → index-C5iOTsRG.d.ts} +1 -1
  138. package/dist/{index-BMHF0IWd.d.cts → index-DoTNu3mL.d.cts} +1 -1
  139. package/dist/{searchFilterSidebarVariants-DzCf_sfh.cjs → searchFilterSidebarVariants-BQ7OC862.cjs} +10 -7
  140. package/dist/{searchFilterSidebarVariants-f9PS9fl6.js → searchFilterSidebarVariants-C_rWIcxf.js} +2 -1
  141. package/package.json +2 -1
  142. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +1 -1
  143. package/src/components/ButtonBase/types.ts +1 -1
  144. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +1 -1
  145. package/src/components/ProductCard/ProductCard.tsx +12 -12
  146. package/src/components/ProductCard/ProductCardSkeleton.tsx +13 -1
  147. package/src/components/ProductCard/index.ts +0 -1
  148. package/src/components/ProductCard/productCardVariants.ts +1 -1
  149. package/src/components/ProductGrid/ProductGrid.tsx +6 -2
  150. package/src/components/ProductGrid/productGridVariants.ts +1 -1
  151. package/src/components/RadioButton/RadioButton.tsx +1 -1
  152. package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +1 -1
  153. package/src/components/SearchFilter/SearchFilter.tsx +1 -2
  154. package/src/components/SearchFilter/SearchFilterFooter.tsx +1 -1
  155. package/src/components/SearchFilter/SearchFilterHeader.tsx +1 -1
  156. package/src/components/SearchFilter/SearchFilterItem.tsx +1 -1
  157. package/src/components/SearchFilter/useHasFilterStateChanged.tsx +1 -1
  158. package/src/components/SearchFilter/utils.ts +1 -1
  159. package/src/components/SearchInput/SearchInput.tsx +1 -1
  160. package/src/components/SearchInput/searchInputVariants.ts +2 -2
  161. package/src/components/SearchInputForm/SearchInputForm.tsx +4 -7
  162. package/src/components/SearchResultsContent/SearchResultsContent.tsx +4 -4
  163. package/src/components/SearchResultsFilterSidebar/SearchResultsFilter.tsx +1 -2
  164. package/src/components/SearchResultsFilterSidebar/index.ts +0 -1
  165. package/src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.ts +2 -2
  166. package/src/components/SearchResultsStates/SearchResultsGrid.tsx +6 -3
  167. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +2 -1
  168. package/src/components/SparkleAnimation/SparkleAnimation.tsx +7 -1
  169. package/src/components/SparkleAnimation/index.ts +0 -1
  170. package/src/components/SuggestionButton/SuggestionButton.tsx +1 -1
  171. package/src/util/colorVar.ts +3 -0
  172. package/dist/colorsConfig-B3-SMUSx.cjs +0 -38
  173. package/dist/colorsConfig-DZ-GSPWy.js +0 -26
  174. package/dist/index-BB4Qbpmg.d.ts +0 -325
  175. package/dist/index-BqARXvZ6.d.cts +0 -325
  176. package/dist/index-Dfe_lkL2.d.cts +0 -46
  177. package/dist/index-DmvaMYbj.d.ts +0 -46
  178. package/dist/types-BhGjnuWx.d.cts +0 -4
  179. package/dist/types-DlqhqT_S.d.ts +0 -4
  180. package/src/atoms/search/types.ts +0 -1
  181. package/src/components/ProductCard/types.ts +0 -49
  182. package/src/components/SearchFilter/types.ts +0 -45
  183. package/src/components/SearchResultsFilterSidebar/types.ts +0 -2
  184. package/src/components/SparkleAnimation/types.ts +0 -6
  185. package/src/config/chatElementDisplayLocation.ts +0 -23
  186. package/src/models/colorsConfig.ts +0 -28
  187. package/src/util/camelCase.ts +0 -87
  188. package/src/util/camelCasedPropertiesDeep.ts +0 -81
  189. package/src/util/internal.ts +0 -97
  190. package/src/util/primitive.ts +0 -8
  191. package/src/util/splitWords.ts +0 -76
  192. package/src/util/trim.ts +0 -28
  193. package/src/util/unknownArray.ts +0 -25
  194. /package/dist/{AnimatedChevron-Bik7GMSe.js → AnimatedChevron-Dee6Pe81.js} +0 -0
  195. /package/dist/{AnimatedChevron-Q96FneFy.cjs → AnimatedChevron-wpcAHp6d.cjs} +0 -0
  196. /package/dist/{Typography-D3vDkBMS.js → Typography-C3QmJzFK.js} +0 -0
  197. /package/dist/{Typography-CFNWgbM5.cjs → Typography-Ds4gfOJz.cjs} +0 -0
  198. /package/dist/{typographyVariantClasses-B6wiawat.d.ts → typographyVariantClasses-BFRoEloZ.d.cts} +0 -0
  199. /package/dist/{typographyVariantClasses-DTSltxPN.d.cts → typographyVariantClasses-D7h3ACAj.d.ts} +0 -0
@@ -1,46 +0,0 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
- import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
3
-
4
- //#region src/components/SearchResultsFilterSidebar/types.d.ts
5
- type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
6
- type CloseIconVariant$1 = 'light' | 'tertiary' | 'dark';
7
- //#endregion
8
- //#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts
9
- interface SearchFilterSidebarVariantClasses {
10
- searchFilterHeaderClasses: string;
11
- radioButtonFillColor: string;
12
- radioButtonHoverColor: string;
13
- radioButtonUncheckedBorderColor: string;
14
- filterDefaultClasses: string;
15
- filterActiveClasses: string;
16
- filterHoverClasses: string;
17
- appliedFilterBackgroundClasses: string;
18
- applyFiltersUnchangedClasses: string;
19
- applyFiltersChangedClasses: string;
20
- filterCloseIconVariant: CloseIconVariant$1;
21
- }
22
- declare const searchFilterSidebarVariantClasses: Record<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses>;
23
- //#endregion
24
- //#region src/components/SearchResultsFilterSidebar/SearchResultsFilter.d.ts
25
- type SearchResultsFilterProps = {
26
- productCount: number;
27
- isOpen: boolean;
28
- setIsOpen: (isOpen: boolean) => void;
29
- searchFilters: SearchFilterDatum[];
30
- searchFilterSidebarVariant: SearchFilterSidebarVariant;
31
- onSelectFilterItem: SelectFilterItem;
32
- onClearAllFilters: () => void;
33
- filterButtonText: string;
34
- };
35
- declare const SearchResultsFilter: ({
36
- productCount,
37
- isOpen,
38
- setIsOpen,
39
- searchFilters,
40
- searchFilterSidebarVariant,
41
- onSelectFilterItem,
42
- onClearAllFilters,
43
- filterButtonText
44
- }: SearchResultsFilterProps) => react_jsx_runtime1.JSX.Element;
45
- //#endregion
46
- export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
@@ -1,46 +0,0 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
- import { SearchFilterDatum, SelectFilterItem } from "@envive-ai/react-hooks/types";
3
-
4
- //#region src/components/SearchResultsFilterSidebar/types.d.ts
5
- type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
6
- type CloseIconVariant$1 = 'light' | 'tertiary' | 'dark';
7
- //#endregion
8
- //#region src/components/SearchResultsFilterSidebar/searchFilterSidebarVariants.d.ts
9
- interface SearchFilterSidebarVariantClasses {
10
- searchFilterHeaderClasses: string;
11
- radioButtonFillColor: string;
12
- radioButtonHoverColor: string;
13
- radioButtonUncheckedBorderColor: string;
14
- filterDefaultClasses: string;
15
- filterActiveClasses: string;
16
- filterHoverClasses: string;
17
- appliedFilterBackgroundClasses: string;
18
- applyFiltersUnchangedClasses: string;
19
- applyFiltersChangedClasses: string;
20
- filterCloseIconVariant: CloseIconVariant$1;
21
- }
22
- declare const searchFilterSidebarVariantClasses: Record<SearchFilterSidebarVariant, SearchFilterSidebarVariantClasses>;
23
- //#endregion
24
- //#region src/components/SearchResultsFilterSidebar/SearchResultsFilter.d.ts
25
- type SearchResultsFilterProps = {
26
- productCount: number;
27
- isOpen: boolean;
28
- setIsOpen: (isOpen: boolean) => void;
29
- searchFilters: SearchFilterDatum[];
30
- searchFilterSidebarVariant: SearchFilterSidebarVariant;
31
- onSelectFilterItem: SelectFilterItem;
32
- onClearAllFilters: () => void;
33
- filterButtonText: string;
34
- };
35
- declare const SearchResultsFilter: ({
36
- productCount,
37
- isOpen,
38
- setIsOpen,
39
- searchFilters,
40
- searchFilterSidebarVariant,
41
- onSelectFilterItem,
42
- onClearAllFilters,
43
- filterButtonText
44
- }: SearchResultsFilterProps) => react_jsx_runtime3.JSX.Element;
45
- //#endregion
46
- export { CloseIconVariant$1 as CloseIconVariant, SearchFilterSidebarVariant, SearchResultsFilter, SearchResultsFilterProps, searchFilterSidebarVariantClasses };
@@ -1,4 +0,0 @@
1
- //#region src/atoms/search/types.d.ts
2
- type SearchInputVariant = 'standard';
3
- //#endregion
4
- export { SearchInputVariant };
@@ -1,4 +0,0 @@
1
- //#region src/atoms/search/types.d.ts
2
- type SearchInputVariant = 'standard';
3
- //#endregion
4
- export { SearchInputVariant };
@@ -1 +0,0 @@
1
- export type SearchInputVariant = 'standard';
@@ -1,49 +0,0 @@
1
- import { ResponseCategory, SearchResponseProduct } from '@spiffy-ai/commerce-api-client';
2
- import type { CamelCasedPropertiesDeep } from 'src/util/camelCasedPropertiesDeep';
3
-
4
- export enum ProductCardSkeletonOverrides {
5
- PRODUCT_CARD_SKELETON_CONTAINER = 'spiffy-product-card-skeleton-container',
6
- PRODUCT_CARD_SKELETON = 'spiffy-product-card-skeleton',
7
- }
8
-
9
- export enum AnimatedProductCardOverrides {
10
- PRODUCT_CARD_ANIMATED_CONTAINER = 'spiffy-product-card-animated-container',
11
- PRODUCT_CARD_ANIMATED_IMAGE_CONTAINER = 'spiffy-product-card-animated',
12
- }
13
-
14
- export type ProductGridVariant = 'standard' | 'square';
15
-
16
- export type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
17
-
18
- export type ProductCardHoverVariant = 'backgroundDark' | 'none';
19
-
20
- export type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
21
- export type ProductCardImageAspectRatio = '3:4' | 'square' | 'none';
22
-
23
- export interface ProductCardConfig {
24
- variant: ProductCardVariant;
25
- hoverVariant: ProductCardHoverVariant;
26
- layoutVariant: ProductCardLayoutVariant;
27
- pricePrefix?: string;
28
- }
29
-
30
- export interface SearchResponseProductAttributes {
31
- category: ResponseCategory.Product;
32
- attributes: CamelCasedPropertiesDeep<SearchResponseProduct>;
33
- }
34
-
35
- export interface ProductCardSkeletonProps {
36
- layoutVariant: ProductCardLayoutVariant;
37
- aspectRatio: ProductCardImageAspectRatio;
38
- growWithContainer?: boolean;
39
- }
40
-
41
- export interface ProductGridProps {
42
- productList: SearchResponseProductAttributes['attributes'][];
43
- productGridVariant: ProductGridVariant;
44
- productGridClasses: string;
45
- productCardConfig?: ProductCardConfig;
46
- merchantShortName: string;
47
- searchResponseId: string;
48
- cardsGrowWithContainer?: boolean;
49
- }
@@ -1,45 +0,0 @@
1
- import {
2
- CloseIconVariant,
3
- SearchFilterDatum,
4
- SearchFilterItemDatum,
5
- SelectFilterItem,
6
- } from '@envive-ai/react-hooks/types';
7
-
8
- export interface SearchFilterItem extends SearchFilterItemDatum {
9
- filterId: string;
10
- filterItemId: string;
11
- }
12
-
13
- export interface SearchFilterItemProps {
14
- filterItem: SearchFilterItem;
15
- onSelectFilterItem: SelectFilterItem;
16
- radioButtonFillColor: string;
17
- radioButtonHoverColor: string;
18
- radioButtonUncheckedBorderColor: string;
19
- }
20
-
21
- export interface SearchFilterHeaderProps {
22
- closeModal: () => void;
23
- productCount: number;
24
- headerClassName: string;
25
- filterCloseIconVariant: 'dark' | 'light' | 'tertiary';
26
- }
27
-
28
- export type SearchFilterProps = {
29
- filters: SearchFilterDatum[];
30
- selectFilterItem: SelectFilterItem;
31
- clearAllFilters: () => void;
32
- productCount: number;
33
- isOpen: boolean;
34
- setIsOpen: (isOpen: boolean) => void;
35
- applyFiltersUnchangedClasses: string;
36
- applyFiltersChangedClasses: string;
37
- headerContent?: React.ReactNode;
38
- footerContent?: React.ReactNode;
39
- filterButtonText?: string; // New prop for custom button text
40
- headerClassName?: string;
41
- radioButtonFillColor: string;
42
- radioButtonHoverColor?: string;
43
- radioButtonUncheckedBorderColor?: string;
44
- filterCloseIconVariant: CloseIconVariant;
45
- };
@@ -1,2 +0,0 @@
1
- export type SearchFilterSidebarVariant = 'darkButton' | 'lightButton';
2
- export type CloseIconVariant = 'light' | 'tertiary' | 'dark';
@@ -1,6 +0,0 @@
1
- export enum SparkleAnimationOverride {
2
- CONTAINER = 'spiffy-sparkle-animation-container',
3
- STAR_ONE_CONTAINER = 'spiffy-sparkle-animation-star-one-container',
4
- STAR_TWO_CONTAINER = 'spiffy-sparkle-animation-star-two-container',
5
- STAR_THREE_CONTAINER = 'spiffy-sparkle-animation-star-three-container',
6
- }
@@ -1,23 +0,0 @@
1
- // Chat element display location enum
2
- export enum ChatElementDisplayLocation {
3
- IN_CHAT = 'in_chat',
4
- CHAT_PREVIEW = 'chat_preview',
5
- FLOATING_BUTTON = 'floating_button',
6
- HELP_ME_CHOOSE = 'help_me_choose',
7
- PLP_IMAGE_BANNER = 'plp_image_banner',
8
- TOP_REVIEWS_SNIPPET = 'top_reviews_snippet',
9
- BOTTOM_REVIEWS_SNIPPET = 'bottom_reviews_snippet',
10
- BLOCK_BACK_BUTTON = 'block_back_button',
11
- SWITCH_TO_AGENT = 'switch_to_agent',
12
- CONVERSATIONAL_SEARCH = 'conversational_search',
13
- GLOBAL_SEARCH_ENTRYPOINT = 'global_search_entrypoint',
14
- SEARCH_NAV_ENTRYPOINT = 'search_nav_entrypoint',
15
- SEARCH_PROMPT = 'search_prompt',
16
- SEARCH_PROMPT_BUTTON = 'search_prompt_button',
17
- SEARCH_ZERO_STATE_SUGGESTED_PRODUCTS = 'search_zero_state_suggested_products',
18
- PRODUCT_GRID = 'product_grid',
19
- UNSPECIFIED = 'unspecified',
20
- FILTER_MODAL = 'filter_modal',
21
- PROMPT_CARD = 'prompt_card',
22
- WINDOW_API_CALL = 'window_api_call',
23
- }
@@ -1,28 +0,0 @@
1
- enum ColorNames {
2
- TextPrimary = 'text-primary',
3
- TextSecondary = 'text-secondary',
4
- TextAccent = 'text-accent',
5
- TextLink = 'text-link',
6
- TextLight = 'text-light',
7
- BackgroundPrimary = 'background-primary',
8
- BackgroundSecondary = 'background-secondary',
9
- BackgroundSecondaryDark = 'background-secondary-dark',
10
- BackgroundTertiary = 'background-tertiary',
11
- BackgroundDark = 'background-dark',
12
- BackgroundLight = 'background-light',
13
- BackgroundSaturated = 'background-saturated',
14
- BorderLight = 'border-light',
15
- BorderMedium = 'border-medium',
16
- BorderDark = 'border-dark',
17
- BorderOutline = 'border-outline',
18
- AccentPrimary = 'accent-primary',
19
- AccentSecondary = 'accent-secondary',
20
- }
21
-
22
- type ColorMapping = {
23
- [key in ColorNames]: string;
24
- };
25
-
26
- const colorVar = (color: ColorNames): string => `var(--spiffy-colors-${color})`;
27
- export { ColorNames, colorVar };
28
- export type { ColorMapping };
@@ -1,87 +0,0 @@
1
- // these types come from https://github.com/sindresorhus/type-fest/blob/main/source/camel-case.d.ts
2
-
3
- import type { SplitWords } from './splitWords';
4
-
5
- /**
6
- * CamelCase options.
7
- *
8
- * @see {@link CamelCase}
9
- */
10
- export type CamelCaseOptions = {
11
- /**
12
- * Whether to preserved consecutive uppercase letter.
13
- *
14
- * @default true
15
- */
16
- preserveConsecutiveUppercase?: boolean;
17
- };
18
-
19
- /**
20
- * Convert an array of words to camel-case.
21
- */
22
- type CamelCaseFromArray<
23
- Words extends string[],
24
- Options extends CamelCaseOptions,
25
- OutputString extends string = '',
26
- > = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]]
27
- ? Options['preserveConsecutiveUppercase'] extends true
28
- ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}`
29
- : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}`
30
- : OutputString;
31
-
32
- /**
33
- * Convert a string literal to camel-case.
34
- *
35
- * This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
36
- *
37
- * By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
38
- *
39
- * @example
40
- * ```
41
- * import type {CamelCase} from 'type-fest';
42
- *
43
- * // Simple
44
- *
45
- * const someVariable: CamelCase<'foo-bar'> = 'fooBar';
46
- *
47
- * // Advanced
48
- *
49
- * type CamelCasedProperties<T> = {
50
- * [K in keyof T as CamelCase<K>]: T[K]
51
- * };
52
- *
53
- * interface RawOptions {
54
- * 'dry-run': boolean;
55
- * 'full_family_name': string;
56
- * foo: number;
57
- * BAR: string;
58
- * QUZ_QUX: number;
59
- * 'OTHER-FIELD': boolean;
60
- * }
61
- *
62
- * const dbResult: CamelCasedProperties<RawOptions> = {
63
- * dryRun: true,
64
- * fullFamilyName: 'bar.js',
65
- * foo: 123,
66
- * bar: 'foo',
67
- * quzQux: 6,
68
- * otherField: false
69
- * };
70
- * ```
71
- *
72
- * @category Change case
73
- * @category Template literal
74
- */
75
- export type CamelCase<
76
- Type,
77
- Options extends CamelCaseOptions = { preserveConsecutiveUppercase: true },
78
- > = Type extends string
79
- ? string extends Type
80
- ? Type
81
- : Uncapitalize<
82
- CamelCaseFromArray<
83
- SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>,
84
- Options
85
- >
86
- >
87
- : Type;
@@ -1,81 +0,0 @@
1
- import type { CamelCase, CamelCaseOptions } from './camelCase';
2
- import type { UnknownArray } from './unknownArray';
3
-
4
- /**
5
- * Convert object properties to camel case recursively.
6
- *
7
- * This can be useful when, for example, converting some API types from a different style.
8
- *
9
- * @see CamelCasedProperties
10
- * @see CamelCase
11
- *
12
- * @example
13
- * ```
14
- * import type {CamelCasedPropertiesDeep} from 'type-fest';
15
- *
16
- * interface User {
17
- * UserId: number;
18
- * UserName: string;
19
- * }
20
- *
21
- * interface UserWithFriends {
22
- * UserInfo: User;
23
- * UserFriends: User[];
24
- * }
25
- *
26
- * const result: CamelCasedPropertiesDeep<UserWithFriends> = {
27
- * userInfo: {
28
- * userId: 1,
29
- * userName: 'Tom',
30
- * },
31
- * userFriends: [
32
- * {
33
- * userId: 2,
34
- * userName: 'Jerry',
35
- * },
36
- * {
37
- * userId: 3,
38
- * userName: 'Spike',
39
- * },
40
- * ],
41
- * };
42
- * ```
43
- *
44
- * @category Change case
45
- * @category Template literal
46
- * @category Object
47
- */
48
- export type CamelCasedPropertiesDeep<
49
- Value,
50
- Options extends CamelCaseOptions = { preserveConsecutiveUppercase: true },
51
- // eslint-disable-next-line @typescript-eslint/ban-types
52
- > = Value extends Function
53
- ? Value
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
- };
61
-
62
- // This is a copy of DelimiterCasedPropertiesArrayDeep (see: delimiter-cased-properties-deep.d.ts).
63
- // These types should be kept in sync.
64
- type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends []
65
- ? []
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;
@@ -1,97 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- // these types come from https://github.com/sindresorhus/type-fest/blob/main/source/internal.d.ts
3
-
4
- import type { Primitive } from './primitive';
5
- import type { Trim } from './trim';
6
-
7
- /**
8
- * Matches any primitive, `void`, `Date`, or `RegExp` value.
9
- */
10
- export type BuiltIns = Primitive | void | Date | RegExp;
11
-
12
- /**
13
- * Matches non-recursive types.
14
- */
15
- export type NonRecursiveType =
16
- | BuiltIns
17
- | ((...arguments_: any[]) => unknown)
18
- | (new (...arguments_: any[]) => unknown);
19
-
20
- /**
21
- * Returns a boolean for whether the string is numeric.
22
- *
23
- * This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
24
- */
25
- export type IsNumeric<T extends string> = T extends `${number}`
26
- ? Trim<T> extends T
27
- ? true
28
- : false
29
- : false;
30
-
31
- /**
32
- * Returns a boolean for whether the string is lowercased.
33
- */
34
- export type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
35
-
36
- /**
37
- * Returns a boolean for whether the string is upper-cased.
38
- */
39
- export type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
40
-
41
- export type WordSeparators = '-' | '_' | Whitespace;
42
-
43
- export type Whitespace =
44
- | '\u{9}' // '\t'
45
- | '\u{A}' // '\n'
46
- | '\u{B}' // '\v'
47
- | '\u{C}' // '\f'
48
- | '\u{D}' // '\r'
49
- | '\u{20}' // ' '
50
- | '\u{85}'
51
- | '\u{A0}'
52
- | '\u{1680}'
53
- | '\u{2000}'
54
- | '\u{2001}'
55
- | '\u{2002}'
56
- | '\u{2003}'
57
- | '\u{2004}'
58
- | '\u{2005}'
59
- | '\u{2006}'
60
- | '\u{2007}'
61
- | '\u{2008}'
62
- | '\u{2009}'
63
- | '\u{200A}'
64
- | '\u{2028}'
65
- | '\u{2029}'
66
- | '\u{202F}'
67
- | '\u{205F}'
68
- | '\u{3000}'
69
- | '\u{FEFF}';
70
-
71
- export type UpperCaseCharacters =
72
- | 'A'
73
- | 'B'
74
- | 'C'
75
- | 'D'
76
- | 'E'
77
- | 'F'
78
- | 'G'
79
- | 'H'
80
- | 'I'
81
- | 'J'
82
- | 'K'
83
- | 'L'
84
- | 'M'
85
- | 'N'
86
- | 'O'
87
- | 'P'
88
- | 'Q'
89
- | 'R'
90
- | 'S'
91
- | 'T'
92
- | 'U'
93
- | 'V'
94
- | 'W'
95
- | 'X'
96
- | 'Y'
97
- | 'Z';
@@ -1,8 +0,0 @@
1
- // this type comes from https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
2
-
3
- /**
4
- * Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
5
- *
6
- * @category Type
7
- */
8
- export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
@@ -1,76 +0,0 @@
1
- // these types come from https://github.com/sindresorhus/type-fest/blob/main/source/split-words.d.ts
2
-
3
- import type { IsLowerCase, IsNumeric, IsUpperCase, WordSeparators } from './internal';
4
-
5
- type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
6
-
7
- type RemoveLastCharacter<
8
- Sentence extends string,
9
- Character extends string,
10
- > = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
11
-
12
- /**
13
- * Split a string (almost) like Lodash's `_.words()` function.
14
- *
15
- * - Split on each word that begins with a capital letter.
16
- * - Split on each {@link WordSeparators}.
17
- * - Split on numeric sequence.
18
- *
19
- * @example
20
- * ```
21
- * type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
22
- * type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
23
- * type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
24
- * type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
25
- * type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
26
- * ```
27
- *
28
- * @internal
29
- * @category Change case
30
- * @category Template literal
31
- */
32
- export type SplitWords<
33
- Sentence extends string,
34
- LastCharacter extends string = '',
35
- CurrentWord extends string = '',
36
- > = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}`
37
- ? FirstCharacter extends WordSeparators
38
- ? // Skip word separator
39
- [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>]
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<
69
- RemainingCharacters,
70
- FirstCharacter,
71
- `${LastCharacter}${FirstCharacter}`
72
- >,
73
- ]
74
- : // No case change: concat word
75
- SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`>
76
- : [...SkipEmptyWord<CurrentWord>];
package/src/util/trim.ts DELETED
@@ -1,28 +0,0 @@
1
- // these types come from https://github.com/sindresorhus/type-fest/blob/main/source/trim.d.ts
2
-
3
- import type { Whitespace } from './internal';
4
-
5
- /**
6
- * Remove spaces from the left side.
7
- */
8
- type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
9
-
10
- /**
11
- * Remove spaces from the right side.
12
- */
13
- type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
14
-
15
- /**
16
- * Remove leading and trailing spaces from a string.
17
- * @example
18
- * ```
19
- * import type {Trim} from 'type-fest';
20
- *
21
- * Trim<' foo '>
22
- * //=> 'foo'
23
- * ```
24
- *
25
- * @category String
26
- * @category Template literal
27
- */
28
- export type Trim<V extends string> = TrimLeft<TrimRight<V>>;
@@ -1,25 +0,0 @@
1
- /**
2
- * Represents an array with `unknown` value.
3
- *
4
- * Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
5
- *
6
- * @example
7
- * ```
8
- * import type {UnknownArray} from 'type-fest';
9
- *
10
- * type IsArray<T> = T extends UnknownArray ? true : false;
11
- *
12
- * type A = IsArray<['foo']>;
13
- * //=> true
14
- *
15
- * type B = IsArray<readonly number[]>;
16
- * //=> true
17
- *
18
- * type C = IsArray<string>;
19
- * //=> false
20
- * ```
21
- *
22
- * @category Type
23
- * @category Array
24
- */
25
- export type UnknownArray = readonly unknown[];