@tapcart/mobile-components 0.2.12 → 0.3.1

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 (61) hide show
  1. package/dist/components/hooks/use-infinite-scroll.d.ts +1 -0
  2. package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
  3. package/dist/components/hooks/use-infinite-scroll.js +3 -2
  4. package/dist/components/hooks/use-scroll-direction.d.ts +1 -1
  5. package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -1
  6. package/dist/components/hooks/use-scroll-direction.js +17 -5
  7. package/dist/components/ui/accordion.js +1 -1
  8. package/dist/components/ui/badge.d.ts +1 -1
  9. package/dist/components/ui/button.d.ts.map +1 -1
  10. package/dist/components/ui/button.js +49 -14
  11. package/dist/components/ui/carousel.d.ts +5 -1
  12. package/dist/components/ui/carousel.d.ts.map +1 -1
  13. package/dist/components/ui/carousel.js +29 -2
  14. package/dist/components/ui/checkbox.js +2 -2
  15. package/dist/components/ui/chip.d.ts +6 -4
  16. package/dist/components/ui/chip.d.ts.map +1 -1
  17. package/dist/components/ui/chip.js +10 -4
  18. package/dist/components/ui/drawer.js +3 -3
  19. package/dist/components/ui/icon.d.ts.map +1 -1
  20. package/dist/components/ui/icon.js +5 -1
  21. package/dist/components/ui/image.d.ts +157 -0
  22. package/dist/components/ui/image.d.ts.map +1 -0
  23. package/dist/components/ui/image.js +311 -0
  24. package/dist/components/ui/line-item-text-icons.d.ts +14 -0
  25. package/dist/components/ui/line-item-text-icons.d.ts.map +1 -0
  26. package/dist/components/ui/line-item-text-icons.js +22 -0
  27. package/dist/components/ui/product-card.d.ts +6 -19
  28. package/dist/components/ui/product-card.d.ts.map +1 -1
  29. package/dist/components/ui/product-card.js +135 -36
  30. package/dist/components/ui/quantity-picker.d.ts +14 -0
  31. package/dist/components/ui/quantity-picker.d.ts.map +1 -0
  32. package/dist/components/ui/quantity-picker.js +23 -0
  33. package/dist/components/ui/radio-group.js +1 -1
  34. package/dist/components/ui/selectors.d.ts +1 -1
  35. package/dist/components/ui/selectors.d.ts.map +1 -1
  36. package/dist/components/ui/selectors.js +20 -4
  37. package/dist/components/ui/skeleton.js +1 -1
  38. package/dist/components/ui/slider.d.ts +14 -0
  39. package/dist/components/ui/slider.d.ts.map +1 -0
  40. package/dist/components/ui/slider.js +50 -0
  41. package/dist/components/ui/subscription.d.ts +15 -0
  42. package/dist/components/ui/subscription.d.ts.map +1 -0
  43. package/dist/components/ui/subscription.js +24 -0
  44. package/dist/components/ui/switch.d.ts.map +1 -1
  45. package/dist/components/ui/switch.js +2 -2
  46. package/dist/components/ui/tabs.js +1 -1
  47. package/dist/components/ui/textarea.d.ts +18 -0
  48. package/dist/components/ui/textarea.d.ts.map +1 -0
  49. package/dist/components/ui/textarea.js +54 -0
  50. package/dist/components/ui/toggle.js +1 -1
  51. package/dist/index.d.ts +6 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +6 -0
  54. package/dist/styles.css +248 -122
  55. package/package.json +20 -14
  56. package/dist/components/ThemeProvider.d.ts +0 -3
  57. package/dist/components/ThemeProvider.d.ts.map +0 -1
  58. package/dist/components/ThemeProvider.js +0 -18
  59. package/dist/components/ThemeToggle.d.ts +0 -2
  60. package/dist/components/ThemeToggle.d.ts.map +0 -1
  61. package/dist/components/ThemeToggle.js +0 -8
@@ -4,27 +4,13 @@ import { Badge } from "./badge";
4
4
  import { Favorite } from "./favorite";
5
5
  import { Button } from "./button";
6
6
  import { Text } from "./text";
7
+ import * as React from "react";
7
8
  import { Price } from "./price";
8
9
  import { Skeleton } from "./skeleton";
9
10
  import { cn } from "../../lib/utils";
10
11
  import { cva } from "class-variance-authority";
11
- const aspectScalingVariants = cva("w-full", {
12
- variants: {
13
- aspectRatio: {
14
- "1:1": "aspect-square",
15
- "2:3": "aspect-[2/3]",
16
- "4:5": "aspect-[4/5]",
17
- },
18
- scaling: {
19
- "fill": "object-cover",
20
- "fit": "object-contain",
21
- }
22
- },
23
- defaultVariants: {
24
- aspectRatio: "2:3",
25
- scaling: "fill"
26
- }
27
- });
12
+ import { Image } from "./image";
13
+ import { Carousel, CarouselContent, CarouselDots, CarouselItem } from "./carousel";
28
14
  const productCardBadgeVariants = cva("absolute truncate", {
29
15
  variants: {
30
16
  horizontalPosition: {
@@ -37,7 +23,18 @@ const productCardBadgeVariants = cva("absolute truncate", {
37
23
  bottom: "bottom-0 mb-2",
38
24
  below: "",
39
25
  },
26
+ imageSwipeEnabled: {
27
+ true: "",
28
+ false: "",
29
+ },
40
30
  },
31
+ compoundVariants: [
32
+ {
33
+ verticalPosition: "bottom",
34
+ imageSwipeEnabled: true,
35
+ class: "bottom-[18px]",
36
+ },
37
+ ],
41
38
  });
42
39
  const productCardFavoriteVariants = cva("absolute ", {
43
40
  variants: {
@@ -58,22 +55,32 @@ const productCardFavoriteVariants = cva("absolute ", {
58
55
  bottom: "",
59
56
  below: "",
60
57
  },
58
+ isSoldOut: {
59
+ true: "",
60
+ false: "",
61
+ },
61
62
  showSoldOutBadge: {
62
63
  true: "",
63
64
  false: "",
64
- }
65
+ },
66
+ imageSwipeEnabled: {
67
+ true: "",
68
+ false: "",
69
+ },
65
70
  },
66
71
  compoundVariants: [
67
72
  {
68
73
  iconPosition: "top-left",
69
74
  badgeHorizontalPosition: ["start", "center"],
70
75
  badgeVerticalPosition: "top",
76
+ showSoldOutBadge: false,
71
77
  class: "top-10",
72
78
  },
73
79
  {
74
80
  iconPosition: "top-right",
75
81
  badgeHorizontalPosition: ["end", "center"],
76
82
  badgeVerticalPosition: "top",
83
+ showSoldOutBadge: false,
77
84
  class: "top-10",
78
85
  },
79
86
  {
@@ -93,28 +100,60 @@ const productCardFavoriteVariants = cva("absolute ", {
93
100
  showSoldOutBadge: true,
94
101
  class: "bottom-10",
95
102
  },
103
+ {
104
+ iconPosition: ["bottom-left", "bottom-right"],
105
+ imageSwipeEnabled: true,
106
+ class: "bottom-[18px]",
107
+ },
108
+ {
109
+ iconPosition: "bottom-left",
110
+ badgeHorizontalPosition: ["start", "center"],
111
+ badgeVerticalPosition: "bottom",
112
+ isSoldOut: false,
113
+ showSoldOutBadge: false,
114
+ imageSwipeEnabled: true,
115
+ class: "bottom-[58px]",
116
+ },
117
+ {
118
+ iconPosition: "bottom-right",
119
+ badgeHorizontalPosition: ["end", "center"],
120
+ badgeVerticalPosition: "bottom",
121
+ showSoldOutBadge: false,
122
+ imageSwipeEnabled: true,
123
+ class: "bottom-[58px]",
124
+ },
125
+ {
126
+ iconPosition: "bottom-left",
127
+ showSoldOutBadge: true,
128
+ imageSwipeEnabled: true,
129
+ class: "bottom-[58px]",
130
+ },
96
131
  ],
97
132
  defaultVariants: {
98
133
  iconPosition: "below-image-on-right",
99
134
  },
100
135
  });
101
136
  const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFavoriteClick, onQuickAdd, openProduct, }) => {
102
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
103
- const ProductImage = ({ src }) => {
104
- const productImageClasses = cn(aspectScalingVariants({ aspectRatio: tapcartData.theme.productImages.aspectRatio, scaling: tapcartData.theme.productImages.scaling }));
105
- if (src) {
106
- return (_jsx("img", { className: productImageClasses, src: src }));
107
- }
108
- else {
109
- return (_jsx("div", { className: `${productImageClasses} bg-neutral-300` }));
110
- }
137
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
138
+ const { variants, images, title, tags } = product;
139
+ // Select the variant that has the lowest price that is available or just the lowest price if none are available
140
+ let searchVariants = variants.filter((variant) => variant.available);
141
+ if (searchVariants.length === 0) {
142
+ searchVariants = variants;
143
+ }
144
+ const variant = searchVariants.reduce((lowest, current) => {
145
+ return current.price.amount < lowest.price.amount ? current : lowest;
146
+ });
147
+ const src = ((_a = images[0]) === null || _a === void 0 ? void 0 : _a.url) || "";
148
+ const [isSelected, setIsSelected] = React.useState(false);
149
+ const handleFavoriteClick = () => {
150
+ setIsSelected((prevState) => !prevState);
111
151
  };
112
- const { variants: [variant], images: [{ src }], title } = product;
113
- const iconPosition = ((_a = config.favoritesIcon) === null || _a === void 0 ? void 0 : _a.layoutType) || "below-image-on-right";
152
+ const iconPosition = ((_b = config.favoritesIcon) === null || _b === void 0 ? void 0 : _b.layoutType) || "below-image-on-right";
114
153
  if (isLoading) {
115
154
  return (_jsxs("div", Object.assign({ className: "w-1/2 rounded" }, { children: [_jsx(Skeleton, { className: "w-full h-64 rounded" }), _jsx(Skeleton, { className: "h-6 w-1/2 mt-2 rounded" }), _jsx(Skeleton, { className: "h-4 w-full mt-2 rounded" })] })));
116
155
  }
117
- const productBadgesPDP = (_b = tapcartData === null || tapcartData === void 0 ? void 0 : tapcartData["product-badges"]) === null || _b === void 0 ? void 0 : _b.pdp;
156
+ const productBadgesPDP = (_c = tapcartData === null || tapcartData === void 0 ? void 0 : tapcartData["product-badges"]) === null || _c === void 0 ? void 0 : _c.pdp;
118
157
  const aboveBadgeKeys = Object.keys(productBadgesPDP).filter((key) => key !== "below");
119
158
  const aboveBadges = aboveBadgeKeys.flatMap((key) => {
120
159
  const badges = productBadgesPDP === null || productBadgesPDP === void 0 ? void 0 : productBadgesPDP[key];
@@ -126,22 +165,82 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
126
165
  const aboveBadge = aboveBadges.length ? aboveBadges[0] : null;
127
166
  const belowBadges = productBadgesPDP.below;
128
167
  const belowBadge = (belowBadges === null || belowBadges === void 0 ? void 0 : belowBadges.length) ? belowBadges[0] : null;
129
- const showSoldOutBadge = !product.availableForSale && !((_c = config.quickAdd) === null || _c === void 0 ? void 0 : _c.enabled);
130
- return (_jsx("div", Object.assign({ className: `w-1/2` }, { children: _jsxs("div", Object.assign({ className: "w-full" }, { children: [((_d = config.productImage) === null || _d === void 0 ? void 0 : _d.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
168
+ const showSoldOutBadge = !product.availableForSale && !((_d = config.quickAdd) === null || _d === void 0 ? void 0 : _d.enabled);
169
+ // Remove Shopify GID info from product id
170
+ const productId = product.id;
171
+ const variantId = variant.id;
172
+ // Prepare Product Open
173
+ const _openProduct = () => openProduct === null || openProduct === void 0 ? void 0 : openProduct({ productId, variantId });
174
+ const getImageSizes = (config) => {
175
+ switch (config.gridLayout) {
176
+ case "1x1":
177
+ return "100vw";
178
+ case "2x2":
179
+ return "50vw";
180
+ case "3x3":
181
+ return "33vw";
182
+ default:
183
+ return "100vw";
184
+ }
185
+ };
186
+ const sizes = getImageSizes(config);
187
+ const imageSwipeEnabled = (((_e = config.productImage) === null || _e === void 0 ? void 0 : _e.allowSwipeability) && product.images.length > 1);
188
+ return (_jsx("div", Object.assign({ className: `w-1/2` }, { children: _jsxs("div", Object.assign({ className: "w-full active:opacity-70", onClick: () => {
189
+ _openProduct();
190
+ } }, { children: [((_f = config.productImage) === null || _f === void 0 ? void 0 : _f.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
131
191
  borderTopLeftRadius: `${config.productImage.cornerRadius}px`,
132
192
  borderTopRightRadius: `${config.productImage.cornerRadius}px`,
133
- } }, { children: [_jsx(ProductImage, { src: src }), aboveBadge && product.availableForSale && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
193
+ borderBottomLeftRadius: `${((_g = config.quickAdd) === null || _g === void 0 ? void 0 : _g.enabled) ? "0" : config.productImage.cornerRadius}px`,
194
+ borderBottomRightRadius: `${((_h = config.quickAdd) === null || _h === void 0 ? void 0 : _h.enabled) ? "0" : config.productImage.cornerRadius}px`,
195
+ } }, { children: [imageSwipeEnabled ? (_jsx(Carousel, Object.assign({ className: "w-full max-w-xs overflow-hidden relative" }, { children: _jsxs("div", Object.assign({ className: "relative" }, { children: [_jsx(CarouselContent, Object.assign({ className: "" }, { children: product.images.map((image, index) => {
196
+ var _a, _b, _c, _d;
197
+ return (_jsx(CarouselItem, Object.assign({ className: "pl-0" }, { children: _jsx(Image, { alt: product.title, aspectRatio: (_b = (_a = tapcartData.theme) === null || _a === void 0 ? void 0 : _a.productImages) === null || _b === void 0 ? void 0 : _b.aspectRatio, data: image, sizes: sizes, objectFit: (_d = (_c = tapcartData.theme) === null || _c === void 0 ? void 0 : _c.productImages) === null || _d === void 0 ? void 0 : _d.scaling }) })));
198
+ }) })), _jsx(CarouselDots, { className: "absolute left-0 w-full bottom-2" })] })) }))) : (_jsx(Image, { alt: product.title, aspectRatio: (_k = (_j = tapcartData.theme) === null || _j === void 0 ? void 0 : _j.productImages) === null || _k === void 0 ? void 0 : _k.aspectRatio, data: product.featuredImage || product.images[0], sizes: sizes, objectFit: (_m = (_l = tapcartData.theme) === null || _l === void 0 ? void 0 : _l.productImages) === null || _m === void 0 ? void 0 : _m.scaling })), aboveBadge && product.availableForSale && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
134
199
  verticalPosition: aboveBadge.verticalPosition,
135
200
  horizontalPosition: aboveBadge.horizontalPosition,
201
+ imageSwipeEnabled,
136
202
  })), style: {
137
203
  color: aboveBadge.fontColor,
138
204
  backgroundColor: aboveBadge.backgroundColor,
139
- }, alignment: aboveBadge.horizontalPosition, cornerRadius: aboveBadge.cornerRadius, icon: aboveBadge.image }, { children: aboveBadge.text }))), showSoldOutBadge && (_jsx(Badge, Object.assign({ size: "plp-layout", className: "absolute left-0 bottom-0 mb-2 bg-stateColors-disabled", alignment: "start", cornerRadius: "rounded", type: "text-only" }, { children: "Sold Out" }))), ((_e = config.favoritesIcon) === null || _e === void 0 ? void 0 : _e.enabled) && iconPosition !== "below-image-on-right" && (_jsx(Favorite, { className: cn(productCardFavoriteVariants({ iconPosition, badgeHorizontalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.horizontalPosition, badgeVerticalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.verticalPosition, showSoldOutBadge })), selected: favorited, onClick: (e) => { onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product); }, icon: ((_g = (_f = config.favoritesIcon) === null || _f === void 0 ? void 0 : _f.icon) === null || _g === void 0 ? void 0 : _g.type) === "internal" ? (_j = (_h = config.favoritesIcon) === null || _h === void 0 ? void 0 : _h.icon) === null || _j === void 0 ? void 0 : _j.url : undefined }))] }))), ((_k = config.quickAdd) === null || _k === void 0 ? void 0 : _k.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
205
+ }, alignment: aboveBadge.horizontalPosition, cornerRadius: aboveBadge.cornerRadius, icon: aboveBadge.image }, { children: aboveBadge.text }))), showSoldOutBadge && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
206
+ verticalPosition: "bottom",
207
+ horizontalPosition: "start",
208
+ imageSwipeEnabled,
209
+ }), "bg-stateColors-disabled"), alignment: "start", cornerRadius: "rounded", type: "text-only" }, { children: "Sold Out" }))), ((_o = config.favoritesIcon) === null || _o === void 0 ? void 0 : _o.enabled) &&
210
+ iconPosition !== "below-image-on-right" && (_jsx(Favorite, { className: cn(productCardFavoriteVariants({
211
+ iconPosition,
212
+ badgeHorizontalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.horizontalPosition,
213
+ badgeVerticalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.verticalPosition,
214
+ isSoldOut: !product.availableForSale,
215
+ showSoldOutBadge,
216
+ imageSwipeEnabled
217
+ })), selected: favorited, onClick: (e) => {
218
+ onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
219
+ }, icon: ((_q = (_p = config.favoritesIcon) === null || _p === void 0 ? void 0 : _p.icon) === null || _q === void 0 ? void 0 : _q.type) === "internal"
220
+ ? (_s = (_r = config.favoritesIcon) === null || _r === void 0 ? void 0 : _r.icon) === null || _s === void 0 ? void 0 : _s.url
221
+ : undefined }))] }))), ((_t = config.quickAdd) === null || _t === void 0 ? void 0 : _t.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
140
222
  borderBottomLeftRadius: `${config.quickAdd.cornerRadius}px`,
141
223
  borderBottomRightRadius: `${config.quickAdd.cornerRadius}px`,
142
- }, labelClassName: cn("outline-0 w-full", { "uppercase": (_l = config.quickAdd) === null || _l === void 0 ? void 0 : _l.uppercase }, { "text-left": ((_m = config.quickAdd) === null || _m === void 0 ? void 0 : _m.textAlignment) === "left" }, { "text-right": ((_o = config.quickAdd) === null || _o === void 0 ? void 0 : _o.textAlignment) === "right" }, { "text-center": ((_p = config.quickAdd) === null || _p === void 0 ? void 0 : _p.textAlignment) === "center" }), labelStyle: { fontSize: (_q = config.quickAdd) === null || _q === void 0 ? void 0 : _q.fontSize }, variant: "quickadd", size: "default", onClick: (e) => {
224
+ }, labelClassName: cn("outline-0 w-full", { uppercase: (_u = config.quickAdd) === null || _u === void 0 ? void 0 : _u.uppercase }, { "text-left": ((_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.textAlignment) === "left" }, { "text-right": ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.textAlignment) === "right" }, { "text-center": ((_x = config.quickAdd) === null || _x === void 0 ? void 0 : _x.textAlignment) === "center" }), labelStyle: { fontSize: (_y = config.quickAdd) === null || _y === void 0 ? void 0 : _y.fontSize }, variant: "quickadd", size: "default", onClick: (e) => {
143
225
  e.stopPropagation();
144
226
  onQuickAdd === null || onQuickAdd === void 0 ? void 0 : onQuickAdd(e, product);
145
- } }, { children: "+ Quick add" }))), _jsxs("div", Object.assign({ className: "w-full flex-col justify-start items-start gap-0 inline-flex" }, { children: [belowBadge && (_jsx("div", Object.assign({ className: cn("mt-2 w-full flex justify-start", { "justify-end": belowBadge.horizontalPosition === "end" }) }, { children: _jsx(Badge, Object.assign({ size: "plp-layout", alignment: belowBadge.horizontalPosition, icon: belowBadge.image, className: cn("truncate", { "rounded": belowBadge.cornerRadius === "rounded" }, { "rounded-none": belowBadge.cornerRadius === "square" }) }, { children: belowBadge.text })) }))), ((_r = config.productTitle) === null || _r === void 0 ? void 0 : _r.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ "uppercase": (_s = config.productTitle) === null || _s === void 0 ? void 0 : _s.uppercase }, { "text-left": ((_t = config.productTitle) === null || _t === void 0 ? void 0 : _t.textAlignment) === "left" }, { "text-right": ((_u = config.productTitle) === null || _u === void 0 ? void 0 : _u.textAlignment) === "right" }, { "text-center": ((_v = config.productTitle) === null || _v === void 0 ? void 0 : _v.textAlignment) === "center" }, { "truncate": !((_w = config.productTitle) === null || _w === void 0 ? void 0 : _w.wrapText) }, { "text-wrap": (_x = config.productTitle) === null || _x === void 0 ? void 0 : _x.wrapText }, "text-textColors-productTitle"), style: { fontSize: (_y = config.productTitle) === null || _y === void 0 ? void 0 : _y.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end", { "justify-start": ((_z = config.price) === null || _z === void 0 ? void 0 : _z.textAlignment) === "left" }, { "justify-end": ((_0 = config.price) === null || _0 === void 0 ? void 0 : _0.textAlignment) === "right" }, { "justify-center": ((_1 = config.price) === null || _1 === void 0 ? void 0 : _1.textAlignment) === "center" }) }, { children: [((_2 = config.price) === null || _2 === void 0 ? void 0 : _2.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice && (variant.compareAtPrice && parseFloat((_3 = variant.compareAtPrice) === null || _3 === void 0 ? void 0 : _3.amount) > parseFloat(variant.price.amount)), compareAtPrice: variant.compareAtPrice && parseFloat((_4 = variant.compareAtPrice) === null || _4 === void 0 ? void 0 : _4.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_5 = config.price) === null || _5 === void 0 ? void 0 : _5.fontSize })), ((_6 = config.favoritesIcon) === null || _6 === void 0 ? void 0 : _6.enabled) && config.favoritesIcon.layoutType === "below-image-on-right" && (_jsx("div", Object.assign({ className: "w-8 h-8 flex items-center justify-center" }, { children: _jsx(Favorite, { selected: favorited, onClick: (e) => { onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product); }, size: "small", icon: ((_8 = (_7 = config.favoritesIcon) === null || _7 === void 0 ? void 0 : _7.icon) === null || _8 === void 0 ? void 0 : _8.type) === "internal" ? (_10 = (_9 = config.favoritesIcon) === null || _9 === void 0 ? void 0 : _9.icon) === null || _10 === void 0 ? void 0 : _10.url : undefined }) })))] }))] }))] })) })));
227
+ } }, { children: "+ Quick add" }))), _jsxs("div", Object.assign({ className: "w-full flex-col justify-start items-start gap-0 inline-flex" }, { children: [belowBadge && (_jsx("div", Object.assign({ className: cn("mt-2 w-full flex justify-start", {
228
+ "justify-end": belowBadge.horizontalPosition === "end",
229
+ }) }, { children: _jsx(Badge, Object.assign({ size: "plp-layout", alignment: belowBadge.horizontalPosition, icon: belowBadge.image, className: cn("truncate", { rounded: belowBadge.cornerRadius === "rounded" }, { "rounded-none": belowBadge.cornerRadius === "square" }) }, { children: belowBadge.text })) }))), ((_z = config.productTitle) === null || _z === void 0 ? void 0 : _z.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ uppercase: (_0 = config.productTitle) === null || _0 === void 0 ? void 0 : _0.uppercase }, {
230
+ "text-left": ((_1 = config.productTitle) === null || _1 === void 0 ? void 0 : _1.textAlignment) === "left",
231
+ }, {
232
+ "text-right": ((_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.textAlignment) === "right",
233
+ }, {
234
+ "text-center": ((_3 = config.productTitle) === null || _3 === void 0 ? void 0 : _3.textAlignment) === "center",
235
+ }, { truncate: !((_4 = config.productTitle) === null || _4 === void 0 ? void 0 : _4.wrapText) }, { "text-wrap": (_5 = config.productTitle) === null || _5 === void 0 ? void 0 : _5.wrapText }, "text-textColors-productTitle"), style: { fontSize: (_6 = config.productTitle) === null || _6 === void 0 ? void 0 : _6.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end", { "justify-start": ((_7 = config.price) === null || _7 === void 0 ? void 0 : _7.textAlignment) === "left" }, { "justify-end": ((_8 = config.price) === null || _8 === void 0 ? void 0 : _8.textAlignment) === "right" }, { "justify-center": ((_9 = config.price) === null || _9 === void 0 ? void 0 : _9.textAlignment) === "center" }) }, { children: [((_10 = config.price) === null || _10 === void 0 ? void 0 : _10.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice &&
236
+ variant.compareAtPrice &&
237
+ parseFloat((_11 = variant.compareAtPrice) === null || _11 === void 0 ? void 0 : _11.amount) >
238
+ parseFloat(variant.price.amount), compareAtPrice: variant.compareAtPrice &&
239
+ parseFloat((_12 = variant.compareAtPrice) === null || _12 === void 0 ? void 0 : _12.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_13 = config.price) === null || _13 === void 0 ? void 0 : _13.fontSize })), ((_14 = config.favoritesIcon) === null || _14 === void 0 ? void 0 : _14.enabled) &&
240
+ config.favoritesIcon.layoutType === "below-image-on-right" && (_jsx("div", Object.assign({ className: "w-8 h-8 flex items-center justify-center" }, { children: _jsx(Favorite, { selected: favorited, onClick: (e) => {
241
+ onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
242
+ }, size: "small", icon: ((_16 = (_15 = config.favoritesIcon) === null || _15 === void 0 ? void 0 : _15.icon) === null || _16 === void 0 ? void 0 : _16.type) === "internal"
243
+ ? (_18 = (_17 = config.favoritesIcon) === null || _17 === void 0 ? void 0 : _17.icon) === null || _18 === void 0 ? void 0 : _18.url
244
+ : undefined }) })))] }))] }))] })) })));
146
245
  };
147
246
  export { ProductCard };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface QuantityPickerProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ decreaseIcon: string;
4
+ increaseIcon: string;
5
+ deleteIcon: string;
6
+ onDecreaseClick: React.ReactEventHandler;
7
+ onIncreaseClick: React.ReactEventHandler;
8
+ value: number;
9
+ setValue: (_: number) => void;
10
+ className?: string;
11
+ }
12
+ declare const QuantityPicker: React.ForwardRefExoticComponent<QuantityPickerProps & React.RefAttributes<HTMLDivElement>>;
13
+ export { QuantityPicker };
14
+ //# sourceMappingURL=quantity-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAgBD,QAAA,MAAM,cAAc,4FAyCnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import * as React from "react";
15
+ import { cn } from "../../lib/utils";
16
+ import { Icon } from "./icon";
17
+ const IconButton = ({ icon, handler, className }) => (_jsx("button", Object.assign({ onClick: handler, className: cn("flex items-center justify-center h-8 w-8 bg-stateColors-skeleton outline outline-1 outline-stateColors-skeleton", className) }, { children: _jsx(Icon, { name: icon, size: "sm", color: "coreColors-secondaryIcon" }) })));
18
+ const QuantityPicker = React.forwardRef((_a, ref) => {
19
+ var { className, decreaseIcon, increaseIcon, deleteIcon, onDecreaseClick, onIncreaseClick, value, setValue } = _a, props = __rest(_a, ["className", "decreaseIcon", "increaseIcon", "deleteIcon", "onDecreaseClick", "onIncreaseClick", "value", "setValue"]);
20
+ return (_jsxs("div", Object.assign({ className: cn("flex", className), ref: ref }, props, { children: [_jsx(IconButton, { handler: onDecreaseClick, icon: value === 1 ? deleteIcon : decreaseIcon, className: "rounded-tl rounded-bl" }), _jsx("div", Object.assign({ className: "w-12 py-1 flex justify-center bg-coreColors-inputBackground outline outline-1 outline-coreColors-dividingLines text-[15px] font-sfpro-roboto leading-[160%] font-normal text-textColors-primaryColor" }, { children: _jsx("input", { type: "tel", pattern: "[0-9]*", value: value, onBlur: (e) => (e.target.value = value.toString()), onFocus: (e) => (e.target.value = ""), onChange: (e) => setValue(parseInt(e.target.value) || 0), className: "w-8 focus-visible:outline-none text-center" }) })), _jsx(IconButton, { handler: onIncreaseClick, icon: increaseIcon, className: "rounded-tr rounded-br" })] })));
21
+ });
22
+ QuantityPicker.displayName = "QuantityPicker";
23
+ export { QuantityPicker };
@@ -37,7 +37,7 @@ const radiogroupItemVariants = cva("grid grid-cols-[auto,auto,1fr] gap-2 items-s
37
37
  const RadioGroupItemLabels = ({ key, label, numberAmount, subtext, }) => (_jsxs("div", Object.assign({ className: "col-span-2" }, { children: [_jsxs("div", Object.assign({ className: "flex flex-row items-start" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled mr-2" }, { children: label })), numberAmount ? (_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled" }, { children: `(${numberAmount})` }))) : null] })), subtext ? (_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled mt-2" }, { children: subtext }))) : null] })));
38
38
  const RadioGroupItem = React.forwardRef((_a, ref) => {
39
39
  var { value, label = "", subtext, numberAmount = 0, onSelect, onClick, selected = false, className, variant = "default", key } = _a, props = __rest(_a, ["value", "label", "subtext", "numberAmount", "onSelect", "onClick", "selected", "className", "variant", "key"]);
40
- return (_jsx("div", Object.assign({ className: cn(radiogroupItemVariants({ variant }), className) }, { children: variant === "deactivated" ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "circle-off", size: "md", className: "text-stateColors-disabled" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] })) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center", className) }, props, { children: selected || variant === "selected" ? (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) : (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(RadioGroupPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }) })), _jsx("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle", size: "md", className: "col-start-1 row-start-1 text-coreColors-secondaryIcon items-center z-1" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) }))) })));
40
+ return (_jsx("div", Object.assign({ className: cn(radiogroupItemVariants({ variant }), className) }, { children: variant === "deactivated" ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "circle-off", size: "md", className: "text-stateColors-disabled" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] })) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center active:opacity-70", className) }, props, { children: selected || variant === "selected" ? (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) : (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(RadioGroupPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }) })), _jsx("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle", size: "md", className: "col-start-1 row-start-1 text-coreColors-secondaryIcon items-center z-1" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) }))) })));
41
41
  });
42
42
  RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
43
43
  export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
@@ -23,7 +23,7 @@ declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTML
23
23
  } & React.RefAttributes<HTMLButtonElement>>;
24
24
  type SelectorContainerProps = {
25
25
  children: React.ReactElement<SelectorsProps>[];
26
- containerRef: React.RefObject<HTMLButtonElement>;
26
+ containerRef: React.RefObject<HTMLDivElement>;
27
27
  };
28
28
  declare const SelectorContainer: React.FC<SelectorContainerProps>;
29
29
  export { SelectorContainer, Selectors, selectorsVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AAED,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;2CA6BpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;CACjD,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAQvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;2CA6BpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAyCvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import * as React from "react";
15
15
  import { cva } from "class-variance-authority";
16
16
  import { cn } from "../../lib/utils";
@@ -23,7 +23,7 @@ const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pa
23
23
  },
24
24
  disabled: {
25
25
  true: "[&>p]:!line-through [&>p]:text-stateColors-disabled",
26
- false: "cursor-pointer active:outline-coreColors-brandColorPrimary",
26
+ false: "cursor-pointer active:outline-coreColors-brandColorPrimary active:opacity-70",
27
27
  },
28
28
  },
29
29
  defaultVariants: {
@@ -38,8 +38,24 @@ const Selectors = React.forwardRef((_a, ref) => {
38
38
  disabled,
39
39
  }), "group"), ref: ref }, props, { children: _jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label })) })));
40
40
  });
41
- const SelectorContainer = ({ children }) => {
42
- return (_jsx("div", Object.assign({ className: "flex gap-2 px-1 h-[42px] items-center overflow-x-auto" }, { children: children.map((chip, index) => (_jsx("div", { children: chip }, index))) })));
41
+ const SelectorContainer = ({ children, containerRef, }) => {
42
+ const [showFadeLeft, setShowFadeLeft] = React.useState(false);
43
+ const [showFadeRight, setShowFadeRight] = React.useState(false);
44
+ const checkOverflow = () => {
45
+ const { scrollLeft, scrollWidth, clientWidth } = containerRef.current;
46
+ setShowFadeLeft(scrollLeft > 0);
47
+ setShowFadeRight(scrollLeft + clientWidth < scrollWidth);
48
+ };
49
+ React.useEffect(() => {
50
+ const handleResize = () => checkOverflow();
51
+ window.addEventListener("resize", handleResize);
52
+ checkOverflow();
53
+ return () => window.removeEventListener("resize", handleResize);
54
+ }, []);
55
+ React.useEffect(() => {
56
+ checkOverflow();
57
+ }, [children]);
58
+ return (_jsx("div", Object.assign({ className: "relative" }, { children: _jsxs("div", Object.assign({ className: "flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
43
59
  };
44
60
  Selectors.displayName = "Selectors";
45
61
  export { SelectorContainer, Selectors, selectorsVariants };
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { cva } from "class-variance-authority";
14
14
  import { cn } from "../../lib/utils";
15
- const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton h-10 w-10 rounded-[4px]", {
15
+ const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton rounded-[4px]", {
16
16
  variants: {
17
17
  variant: {
18
18
  line: "",
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import * as SliderPrimitive from "@radix-ui/react-slider";
3
+ export interface SliderProps extends Omit<React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, "onChange"> {
4
+ className?: string;
5
+ defaultValue: number[];
6
+ value: number[];
7
+ step: number;
8
+ max: number;
9
+ min?: number;
10
+ onChange: (value: number[]) => void;
11
+ }
12
+ declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>>;
13
+ export { Slider };
14
+ //# sourceMappingURL=slider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../components/ui/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAC3D,UAAU,CACX;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,KAAK,EAAE,MAAM,EAAE,CAAA;IAEf,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACpC;AAED,QAAA,MAAM,MAAM,qFAmHX,CAAA;AAID,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import * as React from "react";
15
+ import * as SliderPrimitive from "@radix-ui/react-slider";
16
+ import { cn } from "../../lib/utils";
17
+ import { Input } from "./input";
18
+ const Slider = React.forwardRef((_a, ref) => {
19
+ var { className, max, min = 0, step = 1, defaultValue, value, onChange } = _a,
20
+ // doubleValue = false,
21
+ props = __rest(_a, ["className", "max", "min", "step", "defaultValue", "value", "onChange"]);
22
+ const doubleValue = false;
23
+ const handleCommit = (value) => {
24
+ onChange(value);
25
+ if (props.onValueChange) {
26
+ props.onValueChange(value);
27
+ }
28
+ };
29
+ const useDebounce = (value, delay) => {
30
+ const [debouncedValue, setDebouncedValue] = React.useState(value);
31
+ React.useEffect(() => {
32
+ const handler = setTimeout(() => {
33
+ setDebouncedValue(value);
34
+ }, delay);
35
+ return () => {
36
+ clearTimeout(handler);
37
+ };
38
+ }, [value, delay]);
39
+ return debouncedValue;
40
+ };
41
+ const debouncedSliderVal = useDebounce(value, 200);
42
+ return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "mt-3 mb-6" }, { children: _jsxs(SliderPrimitive.Root, Object.assign({ ref: ref, className: cn("flex relative h-0.5 w-auto items-center select-none", className), onValueChange: (value) => onChange(value), onValueCommit: (value) => {
43
+ handleCommit(value);
44
+ }, defaultValue: defaultValue, value: value, max: max, min: min, step: step }, props, { children: [_jsx(SliderPrimitive.Track, Object.assign({ className: "relative h-1 rounded w-full grow overflow-hidden bg-coreColors-dividingLines" }, { children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-coreColors-brandColorPrimary" }) })), _jsx(SliderPrimitive.Thumb, { className: "block hover:slider-thumb h-4 w-4 rounded-full border-2 border-coreColors-brandColorPrimary bg-coreColors-modalBackground focus-visible:outline-none hover:h-[18px] hover:w-[18px] disabled:pointer-events-none" })] })) })), _jsxs("div", Object.assign({ className: "flex w-auto gap-4 " }, { children: [doubleValue && doubleValue == true ? (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "w-full px-4 py-2 border bg-coreColors-inputBackground" }, { children: _jsxs("div", Object.assign({ className: "flex flex-col" }, { children: [_jsx("div", Object.assign({ className: "h-4 text-textColors-secondaryColor text-[10px] leading-[13px]" }, { children: "Minimum" })), _jsxs("div", Object.assign({ className: "flex text-textColors-primaryColor text-[15px]" }, { children: ["$", min] }))] })) })), _jsx("div", { className: "w-4 h-0 self-center border-2 bg-coreColors-dividingLines" })] })) : (""), _jsx("div", Object.assign({ className: "w-full px-4 py-2 outline outline-1 outline-coreColors-dividingLines rounded bg-coreColors-inputBackground" }, { children: _jsxs("div", Object.assign({ className: "flex flex-col" }, { children: [_jsx("div", Object.assign({ className: "flex items-center h-4 text-textColors-secondaryColor text-[10px] leading-[13px]" }, { children: "Maximum" })), _jsxs("div", Object.assign({ className: "flex h-6 text-textColors-primaryColor text-[15px] w-full [&>div]:w-full" }, { children: ["$", _jsx(Input, { className: "border-0 p-0 h-full w-full text-[15px]", id: "slider-maximum", value: debouncedSliderVal[0].toString(), placeholder: defaultValue[0].toString(), onChange: (value) => {
45
+ const inputValue = Number(value);
46
+ inputValue > max ? onChange([max]) : onChange([inputValue]);
47
+ } })] }))] })) }))] }))] }));
48
+ });
49
+ Slider.displayName = SliderPrimitive.Root.displayName;
50
+ export { Slider };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export interface SubscriptionProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
3
+ imgUrl?: string;
4
+ name: string;
5
+ oldPrice: number;
6
+ type: "subscription" | "one-time";
7
+ newPrice: number;
8
+ selected?: boolean;
9
+ onClick?: () => void;
10
+ className?: string;
11
+ savePercentage?: boolean;
12
+ }
13
+ declare const Subscription: React.ForwardRefExoticComponent<SubscriptionProps & React.RefAttributes<HTMLButtonElement>>;
14
+ export { Subscription };
15
+ //# sourceMappingURL=subscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../components/ui/subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,cAAc,GAAG,UAAU,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,YAAY,6FAsEjB,CAAA;AAID,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,24 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from "react";
14
+ import { Text } from "./text";
15
+ import { cn } from "../../lib/utils";
16
+ import { Icon } from "./icon";
17
+ const Subscription = React.forwardRef((_a, ref) => {
18
+ var { imgUrl, name, oldPrice, newPrice, savePercentage = true, selected = false, type = "subscription", onClick, className } = _a, props = __rest(_a, ["imgUrl", "name", "oldPrice", "newPrice", "savePercentage", "selected", "type", "onClick", "className"]);
19
+ return (_jsxs("button", Object.assign({ className: cn("flex flex-row p-4 gap-2 w-full border-b border-coreColors-dividingLines", selected ? "bg-stateColors-skeleton" : "", className), ref: ref, onClick: onClick }, props, { children: [type == "subscription" && (_jsx(Icon, { name: "repeat", size: "sm", color: "stateColors-subscriptions", className: "my-auto" })), _jsxs("div", Object.assign({ className: "flex flex-col w-full items-start overflow-hidden" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-primaryColor truncate w-full text-left" }, { children: name })), type == "subscription" && savePercentage && newPrice ? (_jsxs(Text, Object.assign({ type: "body-secondary", className: "text-stateColors-subscriptions" }, { children: ["Save ", 100 - (newPrice * 100) / oldPrice, "%"] }))) : null] })), _jsxs("div", Object.assign({ className: "flex flex-row items-start gap-2" }, { children: [type == "subscription" && newPrice ? (_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-salePriceText" }, { children: `$${newPrice.toFixed(2)}` }))) : null, _jsx(Text, Object.assign({ type: "body-primary", className: `${type == "subscription"
20
+ ? "line-through hover:!line-through text-textColors-strikethroughPriceText"
21
+ : "text-textColors-priceText"}` }, { children: `$${oldPrice.toFixed(2)}` }))] }))] })));
22
+ });
23
+ Subscription.displayName = "Subscription";
24
+ export { Subscription };
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAI1D,QAAA,MAAM,MAAM,8JAkBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAI1D,QAAA,MAAM,MAAM,8JAmBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -15,8 +15,8 @@ import * as React from "react";
15
15
  import * as SwitchPrimitives from "@radix-ui/react-switch";
16
16
  import { cn } from "../../lib/utils";
17
17
  const Switch = React.forwardRef((_a, ref) => {
18
- var { className } = _a, props = __rest(_a, ["className"]);
19
- return (_jsx(SwitchPrimitives.Root, Object.assign({ className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className) }, props, { ref: ref }, { children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }) })));
18
+ var { className, onClick } = _a, props = __rest(_a, ["className", "onClick"]);
19
+ return (_jsx(SwitchPrimitives.Root, Object.assign({ onClick: onClick, className: cn("peer inline-flex h-8 w-14 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-stateColors-success data-[state=unchecked]:bg-stateColors-disabled", className) }, props, { ref: ref }, { children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-7 w-7 rounded-full bg-coreColors-pageColor drop-shadow-[0_3px_1px_0_rgba(0,0,0,1)] ring-0 transition-transform data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0") }) })));
20
20
  });
21
21
  Switch.displayName = SwitchPrimitives.Root.displayName;
22
22
  export { Switch };
@@ -15,7 +15,7 @@ import * as React from "react";
15
15
  import { cva } from "class-variance-authority";
16
16
  import { cn } from "../../lib/utils";
17
17
  import { Text } from "./text";
18
- const tabVariants = cva("flex items-center justify-center px-4 py-2 w-full", {
18
+ const tabVariants = cva("flex items-center justify-center px-4 py-2 w-full active:opacity-70", {
19
19
  variants: {
20
20
  isActive: {
21
21
  true: "[&>p]:text-textColors-primaryColor",
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const textareaVariants: (props?: ({
4
+ error?: boolean | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange">, VariantProps<typeof textareaVariants> {
7
+ id: string;
8
+ label?: string;
9
+ icon?: string;
10
+ asChild?: boolean;
11
+ value: string;
12
+ placeholder: string;
13
+ maxHeight?: number;
14
+ onChange: (_: string) => void;
15
+ }
16
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
17
+ export { Textarea };
18
+ //# sourceMappingURL=textarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../components/ui/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,gBAAgB;;mFAarB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC,EACzE,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,QAAA,MAAM,QAAQ,2FA6Eb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}