@envive-ai/react-toolkit 0.2.0 → 0.2.2

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 (190) hide show
  1. package/package.json +10 -13
  2. package/src/components/Accordion/Accordion.tsx +3 -3
  3. package/src/components/AnimatedChevron/AnimatedChevron.tsx +1 -2
  4. package/src/components/AppliedFiltersScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  5. package/src/components/ButtonBase/ButtonBase.tsx +2 -2
  6. package/src/components/DynamicFiltersScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  7. package/src/components/FilterScrollbar/AppliedFiltersScrollbar.tsx +2 -2
  8. package/src/components/FilterScrollbar/DynamicFiltersScrollbar.tsx +2 -2
  9. package/src/components/ProductCard/ProductCard.tsx +10 -9
  10. package/src/components/RadioButton/RadioButton.tsx +2 -2
  11. package/src/components/SearchFilter/SearchFilterHeader.tsx +3 -3
  12. package/src/components/SearchFilter/SearchFilterItem.tsx +2 -2
  13. package/src/components/SearchInput/searchInputVariants.ts +2 -2
  14. package/src/components/SearchResultsStates/NoSearchResultsFound.tsx +3 -3
  15. package/src/components/SearchResultsStates/SearchResultsLoadingGrid.tsx +2 -2
  16. package/src/components/TextInput/TextInput.tsx +4 -3
  17. package/src/components/ToggleButton/ToggleButton.tsx +5 -5
  18. package/src/components/Typography/Typography.spec.tsx +22 -0
  19. package/src/components/Typography/Typography.tsx +73 -0
  20. package/src/components/Typography/index.ts +2 -0
  21. package/src/components/{Text/textVariantClasses.ts → Typography/typographyVariantClasses.ts} +36 -38
  22. package/src/components/Typography/util.ts +19 -0
  23. package/dist/Accordion/index.cjs +0 -6
  24. package/dist/Accordion/index.d.cts +0 -13
  25. package/dist/Accordion/index.d.ts +0 -13
  26. package/dist/Accordion/index.js +0 -6
  27. package/dist/Accordion-D9gO9_y3.cjs +0 -88
  28. package/dist/Accordion-ZEdp99Ph.js +0 -77
  29. package/dist/AnimatedChevron/index.cjs +0 -3
  30. package/dist/AnimatedChevron/index.d.cts +0 -11
  31. package/dist/AnimatedChevron/index.d.ts +0 -11
  32. package/dist/AnimatedChevron/index.js +0 -3
  33. package/dist/AnimatedChevron-CwuXgR2r.js +0 -29
  34. package/dist/AnimatedChevron-e_UzWBl0.cjs +0 -37
  35. package/dist/AppliedFiltersScrollbar/index.cjs +0 -48
  36. package/dist/AppliedFiltersScrollbar/index.d.cts +0 -22
  37. package/dist/AppliedFiltersScrollbar/index.d.ts +0 -22
  38. package/dist/AppliedFiltersScrollbar/index.js +0 -44
  39. package/dist/ButtonBase/index.cjs +0 -7
  40. package/dist/ButtonBase/index.d.cts +0 -42
  41. package/dist/ButtonBase/index.d.ts +0 -42
  42. package/dist/ButtonBase/index.js +0 -6
  43. package/dist/ButtonBase-BJ0qXMWD.js +0 -60
  44. package/dist/ButtonBase-BktteD9c.js +0 -1
  45. package/dist/ButtonBase-Cb6Iec6f.cjs +0 -0
  46. package/dist/ButtonBase-VIv-tn7H.cjs +0 -75
  47. package/dist/DynamicFiltersScrollbar/index.cjs +0 -36
  48. package/dist/DynamicFiltersScrollbar/index.d.cts +0 -28
  49. package/dist/DynamicFiltersScrollbar/index.d.ts +0 -28
  50. package/dist/DynamicFiltersScrollbar/index.js +0 -32
  51. package/dist/DynamicFiltersScrollbar-HCYZjI14.cjs +0 -81
  52. package/dist/DynamicFiltersScrollbar-O0ai3cIG.js +0 -66
  53. package/dist/FilterScrollbar/index.cjs +0 -6
  54. package/dist/FilterScrollbar/index.d.cts +0 -47
  55. package/dist/FilterScrollbar/index.d.ts +0 -47
  56. package/dist/FilterScrollbar/index.js +0 -5
  57. package/dist/Headline/index.cjs +0 -4
  58. package/dist/Headline/index.d.cts +0 -21
  59. package/dist/Headline/index.d.ts +0 -21
  60. package/dist/Headline/index.js +0 -4
  61. package/dist/Headline-CKJmd2w4.cjs +0 -72
  62. package/dist/Headline-DtjTB4xS.js +0 -64
  63. package/dist/ImageWithFallback/index.cjs +0 -3
  64. package/dist/ImageWithFallback/index.d.cts +0 -26
  65. package/dist/ImageWithFallback/index.d.ts +0 -26
  66. package/dist/ImageWithFallback/index.js +0 -3
  67. package/dist/ImageWithFallback-CbYsD1_a.js +0 -42
  68. package/dist/ImageWithFallback-Km9h16Vz.cjs +0 -51
  69. package/dist/ModalSheet/index.cjs +0 -4
  70. package/dist/ModalSheet/index.d.cts +0 -38
  71. package/dist/ModalSheet/index.d.ts +0 -38
  72. package/dist/ModalSheet/index.js +0 -4
  73. package/dist/ModalSheet-DwnbbFh7.cjs +0 -313
  74. package/dist/ModalSheet-sMg44OLz.js +0 -302
  75. package/dist/ProductCard/index.cjs +0 -17
  76. package/dist/ProductCard/index.d.cts +0 -2
  77. package/dist/ProductCard/index.d.ts +0 -2
  78. package/dist/ProductCard/index.js +0 -8
  79. package/dist/ProductCard-BDz80MCQ.cjs +0 -319
  80. package/dist/ProductCard-CqhNJShq.js +0 -255
  81. package/dist/ProductGrid/index.cjs +0 -10
  82. package/dist/ProductGrid/index.d.cts +0 -33
  83. package/dist/ProductGrid/index.d.ts +0 -33
  84. package/dist/ProductGrid/index.js +0 -9
  85. package/dist/ProductGrid-8n4XgcMr.js +0 -60
  86. package/dist/ProductGrid-RRcdkY5J.cjs +0 -74
  87. package/dist/RadioButton/index.cjs +0 -6
  88. package/dist/RadioButton/index.d.cts +0 -32
  89. package/dist/RadioButton/index.d.ts +0 -32
  90. package/dist/RadioButton/index.js +0 -6
  91. package/dist/RadioButton-BWnaUI8o.cjs +0 -84
  92. package/dist/RadioButton-CG8_M0hY.js +0 -75
  93. package/dist/RadioButtonGroup/index.cjs +0 -8
  94. package/dist/RadioButtonGroup/index.d.cts +0 -36
  95. package/dist/RadioButtonGroup/index.d.ts +0 -36
  96. package/dist/RadioButtonGroup/index.js +0 -7
  97. package/dist/RadioButtonGroup-B7EuiEP1.js +0 -38
  98. package/dist/RadioButtonGroup-ReQqakpS.cjs +0 -52
  99. package/dist/SearchAutocomplete/index.cjs +0 -3
  100. package/dist/SearchAutocomplete/index.d.cts +0 -13
  101. package/dist/SearchAutocomplete/index.d.ts +0 -13
  102. package/dist/SearchAutocomplete/index.js +0 -3
  103. package/dist/SearchAutocomplete-BMNYZiJL.js +0 -51
  104. package/dist/SearchAutocomplete-BmHdijOv.cjs +0 -62
  105. package/dist/SearchFilter/index.cjs +0 -19
  106. package/dist/SearchFilter/index.d.cts +0 -91
  107. package/dist/SearchFilter/index.d.ts +0 -91
  108. package/dist/SearchFilter/index.js +0 -14
  109. package/dist/SearchFilter-C8mgj84o.js +0 -268
  110. package/dist/SearchFilter-FrdHPM5O.cjs +0 -307
  111. package/dist/SearchInput/index.cjs +0 -7
  112. package/dist/SearchInput/index.d.cts +0 -34
  113. package/dist/SearchInput/index.d.ts +0 -34
  114. package/dist/SearchInput/index.js +0 -6
  115. package/dist/SearchInput--x9NTMTb.cjs +0 -106
  116. package/dist/SearchInput-IBq83nqF.js +0 -89
  117. package/dist/SearchInputForm/index.cjs +0 -39
  118. package/dist/SearchInputForm/index.d.cts +0 -34
  119. package/dist/SearchInputForm/index.d.ts +0 -34
  120. package/dist/SearchInputForm/index.js +0 -37
  121. package/dist/SearchResultsContent/index.cjs +0 -47
  122. package/dist/SearchResultsContent/index.d.cts +0 -48
  123. package/dist/SearchResultsContent/index.d.ts +0 -48
  124. package/dist/SearchResultsContent/index.js +0 -44
  125. package/dist/SearchResultsFilterSidebar/index.cjs +0 -62
  126. package/dist/SearchResultsFilterSidebar/index.d.cts +0 -2
  127. package/dist/SearchResultsFilterSidebar/index.d.ts +0 -2
  128. package/dist/SearchResultsFilterSidebar/index.js +0 -57
  129. package/dist/SearchResultsStates/index.cjs +0 -17
  130. package/dist/SearchResultsStates/index.d.cts +0 -69
  131. package/dist/SearchResultsStates/index.d.ts +0 -69
  132. package/dist/SearchResultsStates/index.js +0 -15
  133. package/dist/SearchResultsStates-D7dM35qq.js +0 -110
  134. package/dist/SearchResultsStates-nlaPbkj3.cjs +0 -132
  135. package/dist/SparkleAnimation/index.cjs +0 -4
  136. package/dist/SparkleAnimation/index.d.cts +0 -23
  137. package/dist/SparkleAnimation/index.d.ts +0 -23
  138. package/dist/SparkleAnimation/index.js +0 -3
  139. package/dist/SparkleAnimation-D1aZE-7A.cjs +0 -101
  140. package/dist/SparkleAnimation-DtWkXmkN.js +0 -84
  141. package/dist/Spinner/index.cjs +0 -3
  142. package/dist/Spinner/index.d.cts +0 -11
  143. package/dist/Spinner/index.d.ts +0 -11
  144. package/dist/Spinner/index.js +0 -3
  145. package/dist/Spinner-bg6jb_ks.js +0 -38
  146. package/dist/Spinner-rcWX566W.cjs +0 -46
  147. package/dist/SuggestionButton/index.cjs +0 -188
  148. package/dist/SuggestionButton/index.d.cts +0 -35
  149. package/dist/SuggestionButton/index.d.ts +0 -35
  150. package/dist/SuggestionButton/index.js +0 -180
  151. package/dist/Text/index.cjs +0 -10
  152. package/dist/Text/index.d.cts +0 -42
  153. package/dist/Text/index.d.ts +0 -42
  154. package/dist/Text/index.js +0 -5
  155. package/dist/Text-BLzNhX4H.js +0 -42
  156. package/dist/Text-BMsncrpY.js +0 -10
  157. package/dist/Text-C8t_iEj6.cjs +0 -16
  158. package/dist/Text-DllCE9_D.cjs +0 -50
  159. package/dist/TextInput/index.cjs +0 -4
  160. package/dist/TextInput/index.d.cts +0 -12
  161. package/dist/TextInput/index.d.ts +0 -12
  162. package/dist/TextInput/index.js +0 -4
  163. package/dist/TextInput-BeHPlVHT.js +0 -31
  164. package/dist/TextInput-CGs4BY1q.cjs +0 -40
  165. package/dist/ToggleButton/index.cjs +0 -6
  166. package/dist/ToggleButton/index.d.cts +0 -30
  167. package/dist/ToggleButton/index.d.ts +0 -30
  168. package/dist/ToggleButton/index.js +0 -6
  169. package/dist/ToggleButton-CRiPqTCb.js +0 -60
  170. package/dist/ToggleButton-DfJZ8POQ.cjs +0 -68
  171. package/dist/chunk-CUT6urMc.cjs +0 -30
  172. package/dist/colorsConfig-Ck2jeqWe.js +0 -26
  173. package/dist/colorsConfig-CqCKftuM.cjs +0 -38
  174. package/dist/index-B9WeFNlO.d.cts +0 -325
  175. package/dist/index-CLGe_Pam.d.cts +0 -46
  176. package/dist/index-CeECGrFM.d.ts +0 -325
  177. package/dist/index-PSzeHU2s.d.ts +0 -46
  178. package/dist/searchFilterSidebarVariants-B05f5SD5.js +0 -34
  179. package/dist/searchFilterSidebarVariants-NQhqq-NT.cjs +0 -39
  180. package/dist/textVariantClasses-B0gNjzl4.d.cts +0 -174
  181. package/dist/textVariantClasses-Bl8SAGwZ.d.ts +0 -174
  182. package/dist/textVariantClasses-CBre7vXv.cjs +0 -123
  183. package/dist/textVariantClasses-CRrTb43V.js +0 -99
  184. package/dist/types-BhGjnuWx.d.cts +0 -4
  185. package/dist/types-CTOdb0G0.d.ts +0 -4
  186. package/src/components/Headline/Headline.tsx +0 -81
  187. package/src/components/Headline/index.ts +0 -1
  188. package/src/components/Text/Text.tsx +0 -58
  189. package/src/components/Text/index.ts +0 -3
  190. package/src/components/Text/types.ts +0 -23
@@ -1,255 +0,0 @@
1
- import { Text } from "./Text-BLzNhX4H.js";
2
- import { Headline } from "./Headline-DtjTB4xS.js";
3
- import { ImageWithFallback } from "./ImageWithFallback-CbYsD1_a.js";
4
- import { Spinner } from "./Spinner-bg6jb_ks.js";
5
- import classNames from "classnames";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { MdStar } from "react-icons/md";
8
- import { useImageResolver } from "@envive-ai/react-hooks/hooks/ImageResolver";
9
-
10
- //#region src/logging/logger.ts
11
- var Logger = class {
12
- static logInfo(message, ...args) {
13
- console.info(`INFO: ${message}`, ...args);
14
- }
15
- static logDebug(message, ...args) {
16
- console.debug(`DEBUG: ${message}`, ...args);
17
- }
18
- static logError(message, error, ...args) {
19
- console.error(`ERROR: ${message} error=${error}`, args);
20
- }
21
- static logWarn(message, error, ...args) {
22
- console.warn(`WARN: ${message} error=${error}`, args);
23
- }
24
- };
25
- var logger_default = Logger;
26
-
27
- //#endregion
28
- //#region src/util/formatPrice.ts
29
- const formatPrice = (price, currency = "$") => {
30
- if (price == null) return "";
31
- const options = {};
32
- if (!Number.isInteger(price)) {
33
- options.minimumFractionDigits = 2;
34
- options.maximumFractionDigits = 2;
35
- }
36
- return `${currency}${price.toLocaleString("en-US", options)}`;
37
- };
38
-
39
- //#endregion
40
- //#region src/components/ProductCard/productCardVariants.ts
41
- /**
42
- * Shared variant mapping configurations for ProductCard components
43
- */
44
- const variantClassMap = new Map([
45
- ["filled", ["spiffy-tw-bg-[--spiffy-colors-background-secondary]", "spiffy-tw-shadow-md"]],
46
- ["bordered", [
47
- "spiffy-tw-bg-[--spiffy-colors-background-secondary]",
48
- "spiffy-tw-border",
49
- "spiffy-tw-border-[--spiffy-colors-border-light]"
50
- ]],
51
- ["minimal", ["spiffy-tw-bg-transparent"]],
52
- ["transparentBordered", [
53
- "spiffy-tw-bg-transparent",
54
- "spiffy-tw-border",
55
- "spiffy-tw-border-[--spiffy-colors-border-light]"
56
- ]]
57
- ]);
58
- const variantHoverClassMap = new Map([["backgroundDark", ["hover:spiffy-tw-bg-[--spiffy-colors-background-secondary-dark]"]], ["none", []]]);
59
- const variantTitleColorMap = new Map([
60
- ["filled", "spiffy-tw-text-[--spiffy-colors-text-link]"],
61
- ["bordered", "spiffy-tw-text-[--spiffy-colors-text-primary]"],
62
- ["minimal", "spiffy-tw-text-[--spiffy-colors-text-primary]"],
63
- ["transparentBordered", "spiffy-tw-text-[--spiffy-colors-text-primary]"]
64
- ]);
65
- const productCardLayoutVariantClasses = {
66
- normal: {
67
- productTitle: ["spiffy-product-card-title"],
68
- container: ["spiffy-tw-w-[208px]"],
69
- verticalContainer: ["spiffy-tw-rounded-[8px]", "spiffy-tw-h-[268px]"]
70
- },
71
- tall: {
72
- productTitle: ["spiffy-product-card-title-tall", "spiffy-tw-pt-[8px]"],
73
- container: ["spiffy-tw-w-[160px] lg:spiffy-tw-w-[300px]"],
74
- verticalContainer: ["lg:spiffy-tw-h-[496px]"]
75
- },
76
- square: {
77
- productTitle: ["spiffy-product-card-title-tall", "spiffy-tw-pt-[8px]"],
78
- container: ["spiffy-tw-w-[160px] lg:spiffy-tw-w-[280px]"],
79
- verticalContainer: ["lg:spiffy-tw-h-[400px]"]
80
- }
81
- };
82
-
83
- //#endregion
84
- //#region src/components/ProductCard/ProductCard.tsx
85
- const formatReviews = (stars) => String(Number(stars).toLocaleString("en-US", {
86
- minimumFractionDigits: 1,
87
- maximumFractionDigits: 1
88
- }));
89
- const RatingSummary = ({ stars, reviewCount, className }) => {
90
- const group = classNames("spiffy-product-card-rating", "spiffy-product-card-text-color", "spiffy-tw-flex", "spiffy-tw-flex-row", "spiffy-tw-items-center", "spiffy-tw-gap-1", "spiffy-tw-text-[--spiffy-colors-text-primary]", "spiffy-tw-tracking-[0.8px]");
91
- const starClassnames = classNames("spiffy-product-card-rating-star-color", "spiffy-tw-fill-[--spiffy-colors-accent-primary]", "spiffy-tw-w-[14px]", "spiffy-tw-h-[14px]");
92
- return /* @__PURE__ */ jsx("div", {
93
- className,
94
- children: /* @__PURE__ */ jsxs("div", {
95
- className: group,
96
- children: [
97
- /* @__PURE__ */ jsx(MdStar, { className: starClassnames }),
98
- /* @__PURE__ */ jsx(Text, {
99
- variant: "body3",
100
- children: formatReviews(stars)
101
- }),
102
- /* @__PURE__ */ jsxs(Text, {
103
- variant: "body3",
104
- children: [
105
- "(",
106
- reviewCount,
107
- ")"
108
- ]
109
- })
110
- ]
111
- })
112
- });
113
- };
114
- const PriceSection = ({ originalPrice, salePrice, pricePrefix }) => {
115
- if (!originalPrice) return null;
116
- const priceClassName = classNames("spiffy-product-card-price", "spiffy-product-card-text-color", "spiffy-tw-font-regular", "spiffy-tw-flex", "spiffy-tw-flex-wrap", "spiffy-tw-gap-1", "spiffy-tw-text-sm", "spiffy-tw-font-[400]", "spiffy-tw-leading-[100%]", "spiffy-tw-tracking-[0.8px]", "spiffy-tw-text-[--spiffy-colors-text-primary]");
117
- const showSalePrice = salePrice && originalPrice !== salePrice;
118
- return /* @__PURE__ */ jsxs("div", {
119
- className: priceClassName,
120
- children: [
121
- pricePrefix && /* @__PURE__ */ jsx(Text, { children: pricePrefix }),
122
- showSalePrice && /* @__PURE__ */ jsx(Text, { children: salePrice }),
123
- /* @__PURE__ */ jsx(Text, {
124
- className: showSalePrice ? "spiffy-tw-line-through" : "",
125
- children: originalPrice
126
- })
127
- ]
128
- });
129
- };
130
- const ProductCard = ({ productCardConfig, merchantShortName, imageUrl, title, url, originalPrice, averageRating, numberReviews, salePrice, variant, hoverVariant, dataTestId, layoutVariant = "normal", zoomOnHover = false, aspectRatio = "none", growWithContainer = false, handleClick }) => {
131
- const { resolve } = useImageResolver();
132
- const finalVariant = variant ?? productCardConfig?.variant ?? "filled";
133
- const finalHoverVariant = hoverVariant ?? productCardConfig?.hoverVariant ?? "backgroundDark";
134
- const finalLayoutVariant = layoutVariant ?? productCardConfig?.layoutVariant ?? "normal";
135
- const pricePrefix = productCardConfig?.pricePrefix;
136
- if (productCardConfig == null) {
137
- logger_default.logError("[ProductCard] productCardConfig is null", void 0, { merchant: merchantShortName });
138
- return null;
139
- }
140
- const layoutClasses = productCardLayoutVariantClasses[finalLayoutVariant];
141
- const containerClassnames = classNames("spiffy-tw-cursor-pointer", "spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-gap-inherit", "spiffy-tw-overflow-hidden", {
142
- "spiffy-tw-h-full": growWithContainer,
143
- "spiffy-tw-w-full": growWithContainer,
144
- "spiffy-tw-max-w-full": growWithContainer
145
- }, !growWithContainer && layoutClasses.container, variantClassMap.get(finalVariant) ?? [], variantHoverClassMap.get(finalHoverVariant) ?? []);
146
- const verticalContainerVariantClasses = productCardLayoutVariantClasses[layoutVariant].verticalContainer;
147
- const verticalContainerClassnames = classNames("spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-overflow-hidden", "spiffy-tw-gap-inherit", {
148
- "spiffy-tw-h-full": growWithContainer,
149
- "spiffy-tw-w-full": growWithContainer,
150
- "spiffy-tw-flex-1": growWithContainer
151
- }, ...!growWithContainer && layoutVariant ? verticalContainerVariantClasses : []);
152
- const linkClassnames = classNames({
153
- "spiffy-tw-w-full": true,
154
- "spiffy-tw-h-full": true,
155
- "spiffy-tw-overflow-hidden": true,
156
- "spiffy-tw-select-none": true
157
- });
158
- const imageClipContainerClassnames = classNames("spiffy-tw-w-full", "spiffy-tw-overflow-hidden", {
159
- "spiffy-tw-flex-shrink-0": growWithContainer,
160
- "spiffy-tw-tw-h-full": !growWithContainer
161
- }, aspectRatio === "3:4" ? "spiffy-tw-aspect-[3/4]" : "", aspectRatio === "square" ? "spiffy-tw-aspect-square" : "");
162
- const imageContainerClassnames = classNames(linkClassnames, zoomOnHover ? [
163
- "spiffy-tw-transition-transform",
164
- "spiffy-tw-duration-200",
165
- "spiffy-tw-origin-top",
166
- "hover:spiffy-tw-scale-105"
167
- ] : []);
168
- const contentClassnames = classNames("spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-p-2", "spiffy-tw-pr-2", "spiffy-tw-items-start", "spiffy-tw-justify-end", { "spiffy-tw-flex-grow-0": layoutVariant === "tall" || layoutVariant === "square" });
169
- const productTitleClassnames = classNames("spiffy-tw-line-clamp-2", "spiffy-tw-overflow-clip", "spiffy-tw-tracking-[0.8px]", "spiffy-tw-whitespace-normal", "spiffy-tw-normal-case", variantTitleColorMap.get(finalVariant) ?? "spiffy-tw-text-[--spiffy-colors-text-primary]", ...layoutClasses.productTitle);
170
- const priceAndRatingContainerClassnames = classNames("spiffy-tw-flex", "spiffy-tw-flex-row", "spiffy-tw-justify-between", "spiffy-tw-items-center", "spiffy-tw-w-full", "spiffy-tw-pt-2", "spiffy-tw-gap-2");
171
- const imageClassnames = classNames("spiffy-tw-bg-transparent", "spiffy-tw-w-full", "spiffy-tw-h-full", "spiffy-tw-object-cover", "spiffy-tw-object-top", "spiffy-tw-select-none", "spiffy-tw-pointer-events-none");
172
- return /* @__PURE__ */ jsx("div", {
173
- className: containerClassnames,
174
- "data-testid": dataTestId,
175
- children: /* @__PURE__ */ jsx("a", {
176
- href: url,
177
- onClick: () => handleClick(url),
178
- target: "_self",
179
- draggable: false,
180
- children: /* @__PURE__ */ jsxs("div", {
181
- className: verticalContainerClassnames,
182
- children: [/* @__PURE__ */ jsx("div", {
183
- className: imageClipContainerClassnames,
184
- children: /* @__PURE__ */ jsx("div", {
185
- className: imageContainerClassnames,
186
- children: imageUrl && /* @__PURE__ */ jsx(ImageWithFallback, {
187
- src: resolve(imageUrl, layoutVariant === "tall" ? 300 : 178),
188
- alt: title,
189
- fallback: /* @__PURE__ */ jsx(Spinner, { className: "spiffy-tw-w-6 spiffy-tw-h-6" }),
190
- imageClassnames
191
- })
192
- })
193
- }), /* @__PURE__ */ jsxs("div", {
194
- className: contentClassnames,
195
- children: [/* @__PURE__ */ jsx(Headline, {
196
- variant: "h4",
197
- className: productTitleClassnames,
198
- children: title
199
- }), /* @__PURE__ */ jsxs("div", {
200
- className: priceAndRatingContainerClassnames,
201
- children: [(originalPrice || salePrice) && /* @__PURE__ */ jsx(PriceSection, {
202
- originalPrice: formatPrice(originalPrice),
203
- salePrice: formatPrice(salePrice),
204
- pricePrefix
205
- }), averageRating && numberReviews && /* @__PURE__ */ jsx(RatingSummary, {
206
- stars: averageRating,
207
- reviewCount: numberReviews
208
- })]
209
- })]
210
- })]
211
- })
212
- })
213
- });
214
- };
215
-
216
- //#endregion
217
- //#region src/components/ProductCard/types.ts
218
- let ProductCardSkeletonOverrides = /* @__PURE__ */ function(ProductCardSkeletonOverrides$1) {
219
- ProductCardSkeletonOverrides$1["PRODUCT_CARD_SKELETON_CONTAINER"] = "spiffy-product-card-skeleton-container";
220
- ProductCardSkeletonOverrides$1["PRODUCT_CARD_SKELETON"] = "spiffy-product-card-skeleton";
221
- return ProductCardSkeletonOverrides$1;
222
- }({});
223
- let AnimatedProductCardOverrides = /* @__PURE__ */ function(AnimatedProductCardOverrides$1) {
224
- AnimatedProductCardOverrides$1["PRODUCT_CARD_ANIMATED_CONTAINER"] = "spiffy-product-card-animated-container";
225
- AnimatedProductCardOverrides$1["PRODUCT_CARD_ANIMATED_IMAGE_CONTAINER"] = "spiffy-product-card-animated";
226
- return AnimatedProductCardOverrides$1;
227
- }({});
228
-
229
- //#endregion
230
- //#region src/components/ProductCard/ProductCardSkeleton.tsx
231
- const ProductCardSkeleton = ({ layoutVariant, aspectRatio, growWithContainer = false }) => {
232
- const layoutClasses = productCardLayoutVariantClasses[layoutVariant || "normal"];
233
- const containerClasses = classNames(ProductCardSkeletonOverrides.PRODUCT_CARD_SKELETON_CONTAINER, "spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-gap-inherit", "spiffy-tw-bg-transparent", !growWithContainer ? layoutClasses.container : "");
234
- const verticalContainerClasses = classNames("spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-overflow-hidden", "spiffy-tw-gap-inherit", !growWithContainer ? layoutClasses.verticalContainer : "");
235
- const imageClipContainerClasses = classNames("spiffy-tw-w-full", aspectRatio === "3:4" ? "spiffy-tw-aspect-[3/4]" : "", aspectRatio === "square" ? "spiffy-tw-aspect-square" : "", "spiffy-tw-overflow-hidden");
236
- const imageSkeletonClasses = classNames("spiffy-tw-bg-[#F4F4F6]", "spiffy-tw-animate-pulse", "spiffy-tw-opacity-70", "spiffy-tw-w-full", "spiffy-tw-h-full");
237
- const contentContainerClasses = classNames("spiffy-tw-flex", "spiffy-tw-flex-col", "spiffy-tw-gap-2", "spiffy-tw-w-full", "spiffy-tw-p-2");
238
- const textSkeletonClasses = classNames(ProductCardSkeletonOverrides.PRODUCT_CARD_SKELETON, "spiffy-tw-h-[15px]", "spiffy-tw-block", "spiffy-tw-rounded-sm", "spiffy-tw-animate-pulse", "spiffy-tw-opacity-70", "spiffy-tw-bg-[#F4F4F6]");
239
- return /* @__PURE__ */ jsx("div", {
240
- className: containerClasses,
241
- children: /* @__PURE__ */ jsxs("div", {
242
- className: verticalContainerClasses,
243
- children: [/* @__PURE__ */ jsx("div", {
244
- className: imageClipContainerClasses,
245
- children: /* @__PURE__ */ jsx("div", { className: imageSkeletonClasses })
246
- }), /* @__PURE__ */ jsxs("div", {
247
- className: contentContainerClasses,
248
- children: [/* @__PURE__ */ jsx("div", { className: classNames(textSkeletonClasses, "spiffy-tw-w-full") }), /* @__PURE__ */ jsx("div", { className: classNames(textSkeletonClasses, "spiffy-tw-w-[60%]") })]
249
- })]
250
- })
251
- });
252
- };
253
-
254
- //#endregion
255
- export { AnimatedProductCardOverrides, PriceSection, ProductCard, ProductCardSkeleton, ProductCardSkeletonOverrides, RatingSummary, productCardLayoutVariantClasses, variantClassMap, variantHoverClassMap, variantTitleColorMap };
@@ -1,10 +0,0 @@
1
- require('../textVariantClasses-CBre7vXv.cjs');
2
- require('../Text-DllCE9_D.cjs');
3
- require('../Headline-CKJmd2w4.cjs');
4
- require('../ImageWithFallback-Km9h16Vz.cjs');
5
- require('../ProductCard-BDz80MCQ.cjs');
6
- require('../Spinner-rcWX566W.cjs');
7
- const require_ProductGrid = require('../ProductGrid-RRcdkY5J.cjs');
8
-
9
- exports.ProductGrid = require_ProductGrid.ProductGrid;
10
- exports.productGridVariantClasses = require_ProductGrid.productGridVariantClasses;
@@ -1,33 +0,0 @@
1
- import { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant } from "../index-B9WeFNlO.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
4
-
5
- //#region src/components/ProductGrid/ProductGrid.d.ts
6
- interface ProductGridProps {
7
- productList: SearchResponseProduct[];
8
- productGridVariant: ProductGridVariant;
9
- productGridClasses: string;
10
- productCardConfig?: ProductCardConfig;
11
- merchantShortName: string;
12
- cardsGrowWithContainer?: boolean;
13
- }
14
- declare const ProductGrid: ({
15
- productList,
16
- productGridVariant,
17
- productGridClasses,
18
- productCardConfig,
19
- merchantShortName,
20
- cardsGrowWithContainer
21
- }: ProductGridProps) => react_jsx_runtime0.JSX.Element;
22
- //#endregion
23
- //#region src/components/ProductGrid/productGridVariants.d.ts
24
- interface ProductGridVariantClasses {
25
- productCardVariant: ProductCardVariant;
26
- productCardHoverVariant: ProductCardHoverVariant;
27
- productCardLayoutVariant: ProductCardLayoutVariant;
28
- productCardImageAspectRatio: '3:4' | 'square' | 'none';
29
- zoomOnHover: boolean;
30
- }
31
- declare const productGridVariantClasses: Record<ProductGridVariant, ProductGridVariantClasses>;
32
- //#endregion
33
- export { ProductGrid, productGridVariantClasses };
@@ -1,33 +0,0 @@
1
- import { ProductCardConfig, ProductCardHoverVariant, ProductCardLayoutVariant, ProductCardVariant, ProductGridVariant } from "../index-CeECGrFM.js";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
3
- import { SearchResponseProduct } from "@spiffy-ai/commerce-api-client";
4
-
5
- //#region src/components/ProductGrid/ProductGrid.d.ts
6
- interface ProductGridProps {
7
- productList: SearchResponseProduct[];
8
- productGridVariant: ProductGridVariant;
9
- productGridClasses: string;
10
- productCardConfig?: ProductCardConfig;
11
- merchantShortName: string;
12
- cardsGrowWithContainer?: boolean;
13
- }
14
- declare const ProductGrid: ({
15
- productList,
16
- productGridVariant,
17
- productGridClasses,
18
- productCardConfig,
19
- merchantShortName,
20
- cardsGrowWithContainer
21
- }: ProductGridProps) => react_jsx_runtime6.JSX.Element;
22
- //#endregion
23
- //#region src/components/ProductGrid/productGridVariants.d.ts
24
- interface ProductGridVariantClasses {
25
- productCardVariant: ProductCardVariant;
26
- productCardHoverVariant: ProductCardHoverVariant;
27
- productCardLayoutVariant: ProductCardLayoutVariant;
28
- productCardImageAspectRatio: '3:4' | 'square' | 'none';
29
- zoomOnHover: boolean;
30
- }
31
- declare const productGridVariantClasses: Record<ProductGridVariant, ProductGridVariantClasses>;
32
- //#endregion
33
- export { ProductGrid, productGridVariantClasses };
@@ -1,9 +0,0 @@
1
- import "../textVariantClasses-CRrTb43V.js";
2
- import "../Text-BLzNhX4H.js";
3
- import "../Headline-DtjTB4xS.js";
4
- import "../ImageWithFallback-CbYsD1_a.js";
5
- import "../ProductCard-CqhNJShq.js";
6
- import "../Spinner-bg6jb_ks.js";
7
- import { ProductGrid, productGridVariantClasses } from "../ProductGrid-8n4XgcMr.js";
8
-
9
- export { ProductGrid, productGridVariantClasses };
@@ -1,60 +0,0 @@
1
- import { ProductCard } from "./ProductCard-CqhNJShq.js";
2
- import classNames from "classnames";
3
- import { jsx } from "react/jsx-runtime";
4
-
5
- //#region src/components/ProductGrid/productGridVariants.ts
6
- const productGridVariantClasses = {
7
- standard: {
8
- productCardVariant: "minimal",
9
- productCardHoverVariant: "backgroundDark",
10
- productCardLayoutVariant: "tall",
11
- productCardImageAspectRatio: "3:4",
12
- zoomOnHover: true
13
- },
14
- square: {
15
- productCardVariant: "minimal",
16
- productCardHoverVariant: "backgroundDark",
17
- productCardLayoutVariant: "square",
18
- productCardImageAspectRatio: "square",
19
- zoomOnHover: true
20
- }
21
- };
22
-
23
- //#endregion
24
- //#region src/components/ProductGrid/ProductGrid.tsx
25
- const ProductGrid = ({ productList, productGridVariant, productGridClasses, productCardConfig, merchantShortName, cardsGrowWithContainer = true }) => {
26
- const { productCardVariant, productCardHoverVariant, productCardLayoutVariant, productCardImageAspectRatio, zoomOnHover } = productGridVariantClasses[productGridVariant];
27
- const cardContainerClasses = classNames({
28
- "spiffy-tw-w-full": cardsGrowWithContainer,
29
- "spiffy-tw-h-full": cardsGrowWithContainer
30
- });
31
- return /* @__PURE__ */ jsx("div", {
32
- className: productGridClasses,
33
- children: productList.map((product) => {
34
- const camelCasedProduct = product;
35
- return /* @__PURE__ */ jsx("div", {
36
- className: cardContainerClasses,
37
- children: /* @__PURE__ */ jsx(ProductCard, {
38
- productCardConfig,
39
- merchantShortName,
40
- imageUrl: camelCasedProduct.imageUrl,
41
- title: camelCasedProduct.title,
42
- url: camelCasedProduct.url,
43
- originalPrice: camelCasedProduct.originalPrice,
44
- salePrice: camelCasedProduct.salePrice,
45
- averageRating: camelCasedProduct.averageRating,
46
- numberReviews: camelCasedProduct.numberReviews,
47
- layoutVariant: productCardLayoutVariant,
48
- variant: productCardVariant,
49
- hoverVariant: productCardHoverVariant,
50
- zoomOnHover,
51
- aspectRatio: productCardImageAspectRatio,
52
- growWithContainer: cardsGrowWithContainer
53
- }, camelCasedProduct.id)
54
- }, camelCasedProduct.id);
55
- })
56
- });
57
- };
58
-
59
- //#endregion
60
- export { ProductGrid, productGridVariantClasses };
@@ -1,74 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_ProductCard = require('./ProductCard-BDz80MCQ.cjs');
3
- let classnames = require("classnames");
4
- classnames = require_chunk.__toESM(classnames);
5
- let react_jsx_runtime = require("react/jsx-runtime");
6
- react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
7
-
8
- //#region src/components/ProductGrid/productGridVariants.ts
9
- const productGridVariantClasses = {
10
- standard: {
11
- productCardVariant: "minimal",
12
- productCardHoverVariant: "backgroundDark",
13
- productCardLayoutVariant: "tall",
14
- productCardImageAspectRatio: "3:4",
15
- zoomOnHover: true
16
- },
17
- square: {
18
- productCardVariant: "minimal",
19
- productCardHoverVariant: "backgroundDark",
20
- productCardLayoutVariant: "square",
21
- productCardImageAspectRatio: "square",
22
- zoomOnHover: true
23
- }
24
- };
25
-
26
- //#endregion
27
- //#region src/components/ProductGrid/ProductGrid.tsx
28
- const ProductGrid = ({ productList, productGridVariant, productGridClasses, productCardConfig, merchantShortName, cardsGrowWithContainer = true }) => {
29
- const { productCardVariant, productCardHoverVariant, productCardLayoutVariant, productCardImageAspectRatio, zoomOnHover } = productGridVariantClasses[productGridVariant];
30
- const cardContainerClasses = (0, classnames.default)({
31
- "spiffy-tw-w-full": cardsGrowWithContainer,
32
- "spiffy-tw-h-full": cardsGrowWithContainer
33
- });
34
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
35
- className: productGridClasses,
36
- children: productList.map((product) => {
37
- const camelCasedProduct = product;
38
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
39
- className: cardContainerClasses,
40
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ProductCard.ProductCard, {
41
- productCardConfig,
42
- merchantShortName,
43
- imageUrl: camelCasedProduct.imageUrl,
44
- title: camelCasedProduct.title,
45
- url: camelCasedProduct.url,
46
- originalPrice: camelCasedProduct.originalPrice,
47
- salePrice: camelCasedProduct.salePrice,
48
- averageRating: camelCasedProduct.averageRating,
49
- numberReviews: camelCasedProduct.numberReviews,
50
- layoutVariant: productCardLayoutVariant,
51
- variant: productCardVariant,
52
- hoverVariant: productCardHoverVariant,
53
- zoomOnHover,
54
- aspectRatio: productCardImageAspectRatio,
55
- growWithContainer: cardsGrowWithContainer
56
- }, camelCasedProduct.id)
57
- }, camelCasedProduct.id);
58
- })
59
- });
60
- };
61
-
62
- //#endregion
63
- Object.defineProperty(exports, 'ProductGrid', {
64
- enumerable: true,
65
- get: function () {
66
- return ProductGrid;
67
- }
68
- });
69
- Object.defineProperty(exports, 'productGridVariantClasses', {
70
- enumerable: true,
71
- get: function () {
72
- return productGridVariantClasses;
73
- }
74
- });
@@ -1,6 +0,0 @@
1
- require('../textVariantClasses-CBre7vXv.cjs');
2
- require('../Text-DllCE9_D.cjs');
3
- require('../Text-C8t_iEj6.cjs');
4
- const require_RadioButton = require('../RadioButton-BWnaUI8o.cjs');
5
-
6
- exports.RadioButton = require_RadioButton.RadioButton;
@@ -1,32 +0,0 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { TestProps } from "@envive-ai/react-hooks/types";
3
-
4
- //#region src/components/RadioButton/RadioButton.d.ts
5
- interface RadioButtonProps extends TestProps {
6
- isDisabled?: boolean;
7
- label: string;
8
- name: string;
9
- value: string;
10
- textButtonGap?: 'small' | 'medium' | 'large';
11
- fillColor?: string;
12
- hoverColor?: string;
13
- uncheckedBorderColor?: string;
14
- checked?: boolean;
15
- onChange: (value: string) => void;
16
- id: any;
17
- }
18
- declare const RadioButton: ({
19
- isDisabled,
20
- label,
21
- name,
22
- value,
23
- textButtonGap,
24
- fillColor,
25
- hoverColor,
26
- uncheckedBorderColor,
27
- checked,
28
- onChange,
29
- id
30
- }: RadioButtonProps) => react_jsx_runtime0.JSX.Element;
31
- //#endregion
32
- export { RadioButton };
@@ -1,32 +0,0 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
2
- import { TestProps } from "@envive-ai/react-hooks/types";
3
-
4
- //#region src/components/RadioButton/RadioButton.d.ts
5
- interface RadioButtonProps extends TestProps {
6
- isDisabled?: boolean;
7
- label: string;
8
- name: string;
9
- value: string;
10
- textButtonGap?: 'small' | 'medium' | 'large';
11
- fillColor?: string;
12
- hoverColor?: string;
13
- uncheckedBorderColor?: string;
14
- checked?: boolean;
15
- onChange: (value: string) => void;
16
- id: any;
17
- }
18
- declare const RadioButton: ({
19
- isDisabled,
20
- label,
21
- name,
22
- value,
23
- textButtonGap,
24
- fillColor,
25
- hoverColor,
26
- uncheckedBorderColor,
27
- checked,
28
- onChange,
29
- id
30
- }: RadioButtonProps) => react_jsx_runtime17.JSX.Element;
31
- //#endregion
32
- export { RadioButton };
@@ -1,6 +0,0 @@
1
- import "../textVariantClasses-CRrTb43V.js";
2
- import "../Text-BLzNhX4H.js";
3
- import "../Text-BMsncrpY.js";
4
- import { RadioButton } from "../RadioButton-CG8_M0hY.js";
5
-
6
- export { RadioButton };
@@ -1,84 +0,0 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_Text = require('./Text-DllCE9_D.cjs');
3
- let react = require("react");
4
- react = require_chunk.__toESM(react);
5
- let classnames = require("classnames");
6
- classnames = require_chunk.__toESM(classnames);
7
- let react_jsx_runtime = require("react/jsx-runtime");
8
- react_jsx_runtime = require_chunk.__toESM(react_jsx_runtime);
9
-
10
- //#region src/components/RadioButton/RadioButton.tsx
11
- const RadioButton = ({ isDisabled = false, label, name, value, textButtonGap = "medium", fillColor, hoverColor, uncheckedBorderColor, checked = false, onChange, id }) => {
12
- const [isHovered, setIsHovered] = (0, react.useState)(false);
13
- const containerClassName = (0, classnames.default)({
14
- "spiffy-tw-flex": true,
15
- "spiffy-tw-items-center": true,
16
- "spiffy-tw-group": true,
17
- "spiffy-tw-gap-1": textButtonGap === "small",
18
- "spiffy-tw-gap-2": textButtonGap === "medium",
19
- "spiffy-tw-gap-4": textButtonGap === "large",
20
- "spiffy-tw-cursor-pointer": !isDisabled,
21
- "spiffy-tw-opacity-40": isDisabled
22
- });
23
- const getFillColor = () => {
24
- if (isHovered && hoverColor) return hoverColor;
25
- if (checked) return fillColor;
26
- return uncheckedBorderColor;
27
- };
28
- const handleChange = () => {
29
- if (!isDisabled) onChange(value);
30
- };
31
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
32
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
33
- className: containerClassName,
34
- onMouseEnter: () => !isDisabled && setIsHovered(true),
35
- onMouseLeave: () => setIsHovered(false),
36
- "aria-label": label,
37
- htmlFor: id,
38
- children: label
39
- }),
40
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
41
- className: "spiffy-tw-relative",
42
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
43
- type: "radio",
44
- id,
45
- name,
46
- value,
47
- checked,
48
- disabled: isDisabled,
49
- onChange: handleChange,
50
- className: "spiffy-tw-sr-only"
51
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
52
- xmlns: "http://www.w3.org/2000/svg",
53
- width: "24",
54
- height: "24",
55
- viewBox: "0 0 24 24",
56
- fill: "none",
57
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
58
- cx: "12",
59
- cy: "12",
60
- r: "11.5",
61
- fill: "white",
62
- stroke: getFillColor()
63
- }), checked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
64
- cx: "12",
65
- cy: "12",
66
- r: "9",
67
- fill: getFillColor()
68
- })]
69
- })]
70
- }),
71
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
72
- variant: "body3",
73
- children: label
74
- })
75
- ] });
76
- };
77
-
78
- //#endregion
79
- Object.defineProperty(exports, 'RadioButton', {
80
- enumerable: true,
81
- get: function () {
82
- return RadioButton;
83
- }
84
- });