@envive-ai/react-toolkit 0.2.9 → 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-AhyHehrB.js → DynamicFiltersScrollbar-D8OqC4DA.js} +2 -2
  26. package/dist/{DynamicFiltersScrollbar-50i_InZz.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-Ckwsmd8P.js → ImageWithFallback-BW57cQw-.js} +1 -1
  36. package/dist/{ImageWithFallback-1LqhQK1q.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-DRczevG8.js → ProductCard-BiWAcPO4.js} +8 -16
  48. package/dist/{ProductCard-DksbHI3v.cjs → ProductCard-C2KvH4MN.cjs} +8 -28
  49. package/dist/ProductGrid/index.cjs +5 -5
  50. package/dist/ProductGrid/index.d.cts +6 -5
  51. package/dist/ProductGrid/index.d.ts +6 -5
  52. package/dist/ProductGrid/index.js +5 -5
  53. package/dist/{ProductGrid-B36atUp5.js → ProductGrid-B1RtE58G.js} +6 -5
  54. package/dist/{ProductGrid-CStAsiRj.cjs → ProductGrid-DkOyRAEg.cjs} +7 -6
  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-DoqlQgeW.js → RadioButton-CQ6qOvBl.js} +2 -2
  60. package/dist/{RadioButton-OqwNhq7S.cjs → RadioButton-DP-qs5cy.cjs} +3 -3
  61. package/dist/RadioButtonGroup/index.cjs +3 -3
  62. package/dist/RadioButtonGroup/index.d.cts +1 -1
  63. package/dist/RadioButtonGroup/index.d.ts +3 -3
  64. package/dist/RadioButtonGroup/index.js +3 -3
  65. package/dist/{RadioButtonGroup-DwMWFYga.cjs → RadioButtonGroup-CJPWfAaA.cjs} +3 -3
  66. package/dist/{RadioButtonGroup-BP4aECu6.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-Yk01V_VO.cjs → SearchFilter-BLi6E9Wx.cjs} +8 -8
  78. package/dist/{SearchFilter-X18X1iOO.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-Bn6wD39s.cjs → SearchInput-BA6bepV_.cjs} +7 -5
  84. package/dist/{SearchInput-DFoKyqJV.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 +3 -6
  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-CKoDWkXP.cjs → SearchResultsStates-C-8fh8B9.cjs} +8 -8
  102. package/dist/{SearchResultsStates-DF65ZU2r.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-BTTG_drp.cjs → TextInput-CYTko3-n.cjs} +3 -3
  124. package/dist/{TextInput-BfUhaQUc.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-DCiR4sB5.cjs → ToggleButton-CvxNLMe_.cjs} +3 -3
  130. package/dist/{ToggleButton-8P9eNKy1.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-B1P8YS86.cjs → searchFilterSidebarVariants-BQ7OC862.cjs} +10 -7
  140. package/dist/{searchFilterSidebarVariants-CN9_kzJ8.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 +10 -3
  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-BjmNL7s7.cjs +0 -38
  173. package/dist/colorsConfig-E7w6Ol6W.js +0 -26
  174. package/dist/index-DL1kptAp.d.ts +0 -46
  175. package/dist/index-Dfe_lkL2.d.cts +0 -46
  176. package/dist/index-Dz7MKQfH.d.cts +0 -325
  177. package/dist/index-Wd_cQHmW.d.ts +0 -325
  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,325 +0,0 @@
1
- import { FC } from "react";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
3
- import { TestProps } from "@envive-ai/react-hooks/types";
4
- import { ResponseCategory, SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
5
-
6
- //#region src/util/trim.d.ts
7
- /**
8
- * Remove spaces from the left side.
9
- */
10
- type TrimLeft<V extends string> = V extends `${Whitespace}${infer R}` ? TrimLeft<R> : V;
11
- /**
12
- * Remove spaces from the right side.
13
- */
14
- type TrimRight<V extends string> = V extends `${infer R}${Whitespace}` ? TrimRight<R> : V;
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
- type Trim<V extends string> = TrimLeft<TrimRight<V>>;
29
- //#endregion
30
- //#region src/util/internal.d.ts
31
- /**
32
- * Returns a boolean for whether the string is numeric.
33
- *
34
- * This type is a workaround for [Microsoft/TypeScript#46109](https://github.com/microsoft/TypeScript/issues/46109#issuecomment-930307987).
35
- */
36
- type IsNumeric<T extends string> = T extends `${number}` ? Trim<T> extends T ? true : false : false;
37
- /**
38
- * Returns a boolean for whether the string is lowercased.
39
- */
40
- type IsLowerCase<T extends string> = T extends Lowercase<T> ? true : false;
41
- /**
42
- * Returns a boolean for whether the string is upper-cased.
43
- */
44
- type IsUpperCase<T extends string> = T extends Uppercase<T> ? true : false;
45
- type WordSeparators = '-' | '_' | Whitespace;
46
- type Whitespace = '\u{9}' | '\u{A}' | '\u{B}' | '\u{C}' | '\u{D}' | '\u{20}' | '\u{85}' | '\u{A0}' | '\u{1680}' | '\u{2000}' | '\u{2001}' | '\u{2002}' | '\u{2003}' | '\u{2004}' | '\u{2005}' | '\u{2006}' | '\u{2007}' | '\u{2008}' | '\u{2009}' | '\u{200A}' | '\u{2028}' | '\u{2029}' | '\u{202F}' | '\u{205F}' | '\u{3000}' | '\u{FEFF}';
47
- //#endregion
48
- //#region src/util/splitWords.d.ts
49
- type SkipEmptyWord<Word extends string> = Word extends '' ? [] : [Word];
50
- type RemoveLastCharacter<Sentence extends string, Character extends string> = Sentence extends `${infer LeftSide}${Character}` ? SkipEmptyWord<LeftSide> : never;
51
- /**
52
- * Split a string (almost) like Lodash's `_.words()` function.
53
- *
54
- * - Split on each word that begins with a capital letter.
55
- * - Split on each {@link WordSeparators}.
56
- * - Split on numeric sequence.
57
- *
58
- * @example
59
- * ```
60
- * type Words0 = SplitWords<'helloWorld'>; // ['hello', 'World']
61
- * type Words1 = SplitWords<'helloWORLD'>; // ['hello', 'WORLD']
62
- * type Words2 = SplitWords<'hello-world'>; // ['hello', 'world']
63
- * type Words3 = SplitWords<'--hello the_world'>; // ['hello', 'the', 'world']
64
- * type Words4 = SplitWords<'lifeIs42'>; // ['life', 'Is', '42']
65
- * ```
66
- *
67
- * @internal
68
- * @category Change case
69
- * @category Template literal
70
- */
71
- type SplitWords<Sentence extends string, LastCharacter extends string = '', CurrentWord extends string = ''> = Sentence extends `${infer FirstCharacter}${infer RemainingCharacters}` ? FirstCharacter extends WordSeparators ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters>] : LastCharacter extends '' ? SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter> : [false, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, false] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsNumeric<LastCharacter>, IsNumeric<FirstCharacter>] ? SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [true, true] extends [IsLowerCase<LastCharacter>, IsUpperCase<FirstCharacter>] ? [...SkipEmptyWord<CurrentWord>, ...SplitWords<RemainingCharacters, FirstCharacter, FirstCharacter>] : [true, true] extends [IsUpperCase<LastCharacter>, IsLowerCase<FirstCharacter>] ? [...RemoveLastCharacter<CurrentWord, LastCharacter>, ...SplitWords<RemainingCharacters, FirstCharacter, `${LastCharacter}${FirstCharacter}`>] : SplitWords<RemainingCharacters, FirstCharacter, `${CurrentWord}${FirstCharacter}`> : [...SkipEmptyWord<CurrentWord>];
72
- //#endregion
73
- //#region src/util/camelCase.d.ts
74
- /**
75
- * CamelCase options.
76
- *
77
- * @see {@link CamelCase}
78
- */
79
- type CamelCaseOptions = {
80
- /**
81
- * Whether to preserved consecutive uppercase letter.
82
- *
83
- * @default true
84
- */
85
- preserveConsecutiveUppercase?: boolean;
86
- };
87
- /**
88
- * Convert an array of words to camel-case.
89
- */
90
- type CamelCaseFromArray<Words extends string[], Options extends CamelCaseOptions, OutputString extends string = ''> = Words extends [infer FirstWord extends string, ...infer RemainingWords extends string[]] ? Options['preserveConsecutiveUppercase'] extends true ? `${Capitalize<FirstWord>}${CamelCaseFromArray<RemainingWords, Options>}` : `${Capitalize<Lowercase<FirstWord>>}${CamelCaseFromArray<RemainingWords, Options>}` : OutputString;
91
- /**
92
- * Convert a string literal to camel-case.
93
- *
94
- * This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
95
- *
96
- * By default, consecutive uppercase letter are preserved. See {@link CamelCaseOptions.preserveConsecutiveUppercase preserveConsecutiveUppercase} option to change this behaviour.
97
- *
98
- * @example
99
- * ```
100
- * import type {CamelCase} from 'type-fest';
101
- *
102
- * // Simple
103
- *
104
- * const someVariable: CamelCase<'foo-bar'> = 'fooBar';
105
- *
106
- * // Advanced
107
- *
108
- * type CamelCasedProperties<T> = {
109
- * [K in keyof T as CamelCase<K>]: T[K]
110
- * };
111
- *
112
- * interface RawOptions {
113
- * 'dry-run': boolean;
114
- * 'full_family_name': string;
115
- * foo: number;
116
- * BAR: string;
117
- * QUZ_QUX: number;
118
- * 'OTHER-FIELD': boolean;
119
- * }
120
- *
121
- * const dbResult: CamelCasedProperties<RawOptions> = {
122
- * dryRun: true,
123
- * fullFamilyName: 'bar.js',
124
- * foo: 123,
125
- * bar: 'foo',
126
- * quzQux: 6,
127
- * otherField: false
128
- * };
129
- * ```
130
- *
131
- * @category Change case
132
- * @category Template literal
133
- */
134
- type CamelCase<Type, Options extends CamelCaseOptions = {
135
- preserveConsecutiveUppercase: true;
136
- }> = Type extends string ? string extends Type ? Type : Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> : Type;
137
- //#endregion
138
- //#region src/util/unknownArray.d.ts
139
- /**
140
- * Represents an array with `unknown` value.
141
- *
142
- * Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
143
- *
144
- * @example
145
- * ```
146
- * import type {UnknownArray} from 'type-fest';
147
- *
148
- * type IsArray<T> = T extends UnknownArray ? true : false;
149
- *
150
- * type A = IsArray<['foo']>;
151
- * //=> true
152
- *
153
- * type B = IsArray<readonly number[]>;
154
- * //=> true
155
- *
156
- * type C = IsArray<string>;
157
- * //=> false
158
- * ```
159
- *
160
- * @category Type
161
- * @category Array
162
- */
163
- type UnknownArray = readonly unknown[];
164
- //#endregion
165
- //#region src/util/camelCasedPropertiesDeep.d.ts
166
- /**
167
- * Convert object properties to camel case recursively.
168
- *
169
- * This can be useful when, for example, converting some API types from a different style.
170
- *
171
- * @see CamelCasedProperties
172
- * @see CamelCase
173
- *
174
- * @example
175
- * ```
176
- * import type {CamelCasedPropertiesDeep} from 'type-fest';
177
- *
178
- * interface User {
179
- * UserId: number;
180
- * UserName: string;
181
- * }
182
- *
183
- * interface UserWithFriends {
184
- * UserInfo: User;
185
- * UserFriends: User[];
186
- * }
187
- *
188
- * const result: CamelCasedPropertiesDeep<UserWithFriends> = {
189
- * userInfo: {
190
- * userId: 1,
191
- * userName: 'Tom',
192
- * },
193
- * userFriends: [
194
- * {
195
- * userId: 2,
196
- * userName: 'Jerry',
197
- * },
198
- * {
199
- * userId: 3,
200
- * userName: 'Spike',
201
- * },
202
- * ],
203
- * };
204
- * ```
205
- *
206
- * @category Change case
207
- * @category Template literal
208
- * @category Object
209
- */
210
- type CamelCasedPropertiesDeep<Value, Options extends CamelCaseOptions = {
211
- preserveConsecutiveUppercase: true;
212
- }> = Value extends Function ? Value : Value extends UnknownArray ? CamelCasedPropertiesArrayDeep<Value> : Value extends Set<infer U> ? Set<CamelCasedPropertiesDeep<U, Options>> : { [K in keyof Value as CamelCase<K, Options>]: CamelCasedPropertiesDeep<Value[K], Options> };
213
- type CamelCasedPropertiesArrayDeep<Value extends UnknownArray> = Value extends [] ? [] : Value extends [infer U, ...infer V] ? [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [infer U, ...infer V] ? readonly [CamelCasedPropertiesDeep<U>, ...CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends readonly [...infer U, infer V] ? readonly [...CamelCasedPropertiesDeep<U>, CamelCasedPropertiesDeep<V>] : Value extends Array<infer U> ? Array<CamelCasedPropertiesDeep<U>> : Value extends ReadonlyArray<infer U> ? ReadonlyArray<CamelCasedPropertiesDeep<U>> : never;
214
- //#endregion
215
- //#region src/components/ProductCard/types.d.ts
216
- declare enum ProductCardSkeletonOverrides {
217
- PRODUCT_CARD_SKELETON_CONTAINER = "spiffy-product-card-skeleton-container",
218
- PRODUCT_CARD_SKELETON = "spiffy-product-card-skeleton",
219
- }
220
- declare enum AnimatedProductCardOverrides {
221
- PRODUCT_CARD_ANIMATED_CONTAINER = "spiffy-product-card-animated-container",
222
- PRODUCT_CARD_ANIMATED_IMAGE_CONTAINER = "spiffy-product-card-animated",
223
- }
224
- type ProductGridVariant = 'standard' | 'square';
225
- type ProductCardVariant = 'filled' | 'bordered' | 'minimal' | 'transparentBordered';
226
- type ProductCardHoverVariant = 'backgroundDark' | 'none';
227
- type ProductCardLayoutVariant = 'normal' | 'tall' | 'square';
228
- type ProductCardImageAspectRatio = '3:4' | 'square' | 'none';
229
- interface ProductCardConfig {
230
- variant: ProductCardVariant;
231
- hoverVariant: ProductCardHoverVariant;
232
- layoutVariant: ProductCardLayoutVariant;
233
- pricePrefix?: string;
234
- }
235
- interface SearchResponseProductAttributes {
236
- category: ResponseCategory.Product;
237
- attributes: CamelCasedPropertiesDeep<SearchResponseProduct>;
238
- }
239
- interface ProductCardSkeletonProps {
240
- layoutVariant: ProductCardLayoutVariant;
241
- aspectRatio: ProductCardImageAspectRatio;
242
- growWithContainer?: boolean;
243
- }
244
- interface ProductGridProps {
245
- productList: SearchResponseProductAttributes['attributes'][];
246
- productGridVariant: ProductGridVariant;
247
- productGridClasses: string;
248
- productCardConfig?: ProductCardConfig;
249
- merchantShortName: string;
250
- searchResponseId: string;
251
- cardsGrowWithContainer?: boolean;
252
- }
253
- //#endregion
254
- //#region src/components/ProductCard/ProductCard.d.ts
255
- interface RatingSummaryProps {
256
- stars: number;
257
- reviewCount: number;
258
- className?: string;
259
- }
260
- declare const RatingSummary: ({
261
- stars,
262
- reviewCount,
263
- className
264
- }: RatingSummaryProps) => react_jsx_runtime6.JSX.Element;
265
- interface PriceSectionProps {
266
- originalPrice?: string;
267
- salePrice?: string;
268
- pricePrefix?: string;
269
- }
270
- declare const PriceSection: ({
271
- originalPrice,
272
- salePrice,
273
- pricePrefix
274
- }: PriceSectionProps) => react_jsx_runtime6.JSX.Element;
275
- interface ProductCardProps extends TestProps {
276
- productCardConfig?: ProductCardConfig;
277
- merchantShortName: string;
278
- title: string;
279
- url: string;
280
- imageUrl?: string;
281
- originalPrice?: number;
282
- averageRating?: number;
283
- numberReviews?: number;
284
- salePrice?: number;
285
- variant?: ProductCardVariant;
286
- hoverVariant?: ProductCardHoverVariant;
287
- layoutVariant?: ProductCardLayoutVariant;
288
- zoomOnHover?: boolean;
289
- aspectRatio?: '3:4' | 'square' | 'none';
290
- growWithContainer?: boolean;
291
- onClick?: () => void;
292
- }
293
- declare const ProductCard: ({
294
- productCardConfig,
295
- merchantShortName,
296
- imageUrl,
297
- title,
298
- url,
299
- originalPrice,
300
- averageRating,
301
- numberReviews,
302
- salePrice,
303
- variant,
304
- hoverVariant,
305
- dataTestId,
306
- layoutVariant,
307
- zoomOnHover,
308
- aspectRatio,
309
- growWithContainer,
310
- onClick
311
- }: ProductCardProps) => react_jsx_runtime6.JSX.Element;
312
- //#endregion
313
- //#region src/components/ProductCard/ProductCardSkeleton.d.ts
314
- declare const ProductCardSkeleton: FC<ProductCardSkeletonProps>;
315
- //#endregion
316
- //#region src/components/ProductCard/productCardVariants.d.ts
317
- /**
318
- * Shared variant mapping configurations for ProductCard components
319
- */
320
- declare const variantClassMap: Map<ProductCardVariant, string[]>;
321
- declare const variantHoverClassMap: Map<ProductCardHoverVariant, string[]>;
322
- declare const variantTitleColorMap: Map<ProductCardVariant, string>;
323
- declare const productCardLayoutVariantClasses: Record<ProductCardLayoutVariant, Record<string, string[]>>;
324
- //#endregion
325
- export { AnimatedProductCardOverrides, PriceSection, ProductCard, ProductCardConfig, ProductCardHoverVariant, ProductCardImageAspectRatio, ProductCardLayoutVariant, ProductCardSkeleton, ProductCardSkeletonOverrides, ProductCardSkeletonProps, ProductCardVariant, ProductGridProps, ProductGridVariant, RatingSummary, RatingSummaryProps, SearchResponseProductAttributes, productCardLayoutVariantClasses, variantClassMap, variantHoverClassMap, variantTitleColorMap };
@@ -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;