@tapcart/mobile-components 0.6.1 → 0.6.3
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.
- package/dist/components/hooks/use-click-outside.d.ts +8 -0
- package/dist/components/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/components/hooks/use-click-outside.js +46 -0
- package/dist/components/hooks/use-collection.d.ts +25 -0
- package/dist/components/hooks/use-collection.d.ts.map +1 -0
- package/dist/components/hooks/use-collection.js +74 -0
- package/dist/components/hooks/use-products.d.ts +3 -2
- package/dist/components/hooks/use-products.d.ts.map +1 -1
- package/dist/components/hooks/use-products.js +12 -3
- package/dist/components/hooks/use-pull-to-refresh.d.ts +9 -0
- package/dist/components/hooks/use-pull-to-refresh.d.ts.map +1 -0
- package/dist/components/hooks/use-pull-to-refresh.js +88 -0
- package/dist/components/ui/accordion.d.ts +3 -1
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +7 -2
- package/dist/components/ui/chip.d.ts +2 -2
- package/dist/components/ui/chip.js +1 -1
- package/dist/components/ui/favorite/favorite.d.ts +16 -0
- package/dist/components/ui/favorite/favorite.d.ts.map +1 -0
- package/dist/components/ui/favorite/favorite.js +156 -0
- package/dist/components/ui/favorite/favorite.spec.d.ts +2 -0
- package/dist/components/ui/favorite/favorite.spec.d.ts.map +1 -0
- package/dist/components/ui/favorite/favorite.spec.js +6 -0
- package/dist/components/ui/favorite/index.d.ts +2 -0
- package/dist/components/ui/favorite/index.d.ts.map +1 -0
- package/dist/components/ui/favorite/index.js +1 -0
- package/dist/components/ui/favorite.d.ts +1 -1
- package/dist/components/ui/favorite.d.ts.map +1 -1
- package/dist/components/ui/favorite.js +4 -4
- package/dist/components/ui/grid.d.ts +1 -1
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +9 -54
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +13 -17
- package/dist/components/ui/quantity-picker.js +2 -2
- package/dist/components/ui/select.d.ts +39 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +87 -0
- package/dist/components/ui/selectors.d.ts.map +1 -1
- package/dist/components/ui/selectors.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/text.d.ts.map +1 -1
- package/dist/components/ui/text.js +3 -3
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +5 -1
- package/dist/components/ui/wishlist-select.d.ts +43 -0
- package/dist/components/ui/wishlist-select.d.ts.map +1 -0
- package/dist/components/ui/wishlist-select.js +88 -0
- package/dist/components/ui/wishlist.d.ts +15 -4
- package/dist/components/ui/wishlist.d.ts.map +1 -1
- package/dist/components/ui/wishlist.js +12 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/utils.d.ts +91 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +76 -1
- package/dist/styles.css +103 -10
- package/package.json +3 -2
- package/dist/components/ThemeProvider.d.ts +0 -3
- package/dist/components/ThemeProvider.d.ts.map +0 -1
- package/dist/components/ThemeProvider.js +0 -18
- package/dist/components/ThemeToggle.d.ts +0 -2
- package/dist/components/ThemeToggle.d.ts.map +0 -1
- package/dist/components/ThemeToggle.js +0 -8
- package/dist/components/ui/input.d.ts +0 -17
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/input.js +0 -35
- package/dist/components/ui/product-grid.d.ts +0 -15
- package/dist/components/ui/product-grid.d.ts.map +0 -1
- package/dist/components/ui/product-grid.js +0 -22
|
@@ -8,7 +8,7 @@ declare const favoriteVariants: (props?: ({
|
|
|
8
8
|
export interface FavoriteProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof favoriteVariants> {
|
|
9
9
|
selected?: boolean;
|
|
10
10
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
-
|
|
11
|
+
iconUrl?: string;
|
|
12
12
|
showBackground?: boolean;
|
|
13
13
|
cornerRadius?: number;
|
|
14
14
|
layoutType?: "below-image-on-right" | "top-right" | "top-left" | "bottom-left" | "bottom-right";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../components/ui/favorite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,gBAAgB;;;;mFA0BrB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../components/ui/favorite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,gBAAgB;;;;mFA0BrB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EACP,sBAAsB,GACtB,WAAW,GACX,UAAU,GACV,aAAa,GACb,cAAc,CAAA;CACnB;AAED,QAAA,MAAM,QAAQ,yFAwCb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -14,7 +14,7 @@ import * as React from "react";
|
|
|
14
14
|
import { cva } from "class-variance-authority";
|
|
15
15
|
import { cn } from "../../lib/utils";
|
|
16
16
|
import { Icon } from "./icon";
|
|
17
|
-
const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-primaryShadow
|
|
17
|
+
const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-primaryShadow", {
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
20
|
small: "p-2",
|
|
@@ -30,7 +30,7 @@ const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-p
|
|
|
30
30
|
"top-left": "",
|
|
31
31
|
"bottom-left": "",
|
|
32
32
|
"bottom-right": "",
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
},
|
|
35
35
|
defaultVariants: {
|
|
36
36
|
size: "small",
|
|
@@ -39,14 +39,14 @@ const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-p
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
const Favorite = React.forwardRef((_a, ref) => {
|
|
42
|
-
var { className, size = "small", selected = false, onClick,
|
|
42
|
+
var { className, size = "small", selected = false, onClick, iconUrl = "", showBackground = false, cornerRadius = 4, layoutType = "below-image-on-right" } = _a, props = __rest(_a, ["className", "size", "selected", "onClick", "iconUrl", "showBackground", "cornerRadius", "layoutType"]);
|
|
43
43
|
return (_jsx("button", Object.assign({ onClick: onClick, ref: ref, className: cn(favoriteVariants({
|
|
44
44
|
size,
|
|
45
45
|
showBackground,
|
|
46
46
|
layoutType,
|
|
47
47
|
}), className), style: {
|
|
48
48
|
borderRadius: `${cornerRadius}px`,
|
|
49
|
-
} }, props, { children: _jsx(Icon, {
|
|
49
|
+
} }, props, { children: _jsx(Icon, { url: iconUrl, color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm" }) })));
|
|
50
50
|
});
|
|
51
51
|
Favorite.displayName = "Favorite";
|
|
52
52
|
export { Favorite, favoriteVariants };
|
|
@@ -5,7 +5,7 @@ interface GridType {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
declare const gridVariants: (props?: ({
|
|
8
|
-
columns?:
|
|
8
|
+
columns?: 2 | 1 | 3 | 4 | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
10
|
export interface GridProps extends GridType, VariantProps<typeof gridVariants> {
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,eAAe,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,eAAe,EAuChB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AA2DD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AA6CD,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,IAAI,EACJ,IAAW,EACX,KAAK,EACL,SAAS,EACT,WAAW,EACX,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,2CAgBX;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
3
|
var t = {};
|
|
4
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { ReactSVG } from "react-svg";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
|
-
import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconChevronRight, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, IconColumns1, IconColumns2, IconColumns3, IconSearch, IconShoppingCartOff,
|
|
16
|
+
import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconChevronRight, IconChevronLeft, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, IconColumns1, IconColumns2, IconColumns3, IconSearch, IconShoppingCartOff, IconStarFilled, IconShoppingBagPlus, IconShieldCheckFilled, IconShoppingBag, } from "@tabler/icons-react";
|
|
17
17
|
import { cn, iconColorVariantClasses } from "../../lib/utils";
|
|
18
18
|
const iconVariants = cva("inline-flex items-center justify-center text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background", {
|
|
19
19
|
variants: {
|
|
@@ -57,62 +57,13 @@ const icons = {
|
|
|
57
57
|
"square-check": IconSquareCheck,
|
|
58
58
|
"chevron-up": IconChevronUp,
|
|
59
59
|
"chevron-right": IconChevronRight,
|
|
60
|
+
"chevron-left": IconChevronLeft,
|
|
60
61
|
"eye-off": IconEyeOff,
|
|
61
62
|
"square-x": IconSquareX,
|
|
62
63
|
circle: IconCircle,
|
|
63
64
|
"chevron-down": IconChevronDown,
|
|
64
65
|
"heart-filled": IconHeartFilled,
|
|
65
|
-
"menu-icon-about": IconBuildingStore,
|
|
66
|
-
"menu-icon-account": IconUser,
|
|
67
|
-
"menu-icon-alerts": IconBell,
|
|
68
|
-
"menu-icon-bag": IconShoppingBag,
|
|
69
|
-
"menu-icon-blog": IconAppWindow,
|
|
70
|
-
// "menu-icon-banana":
|
|
71
|
-
"menu-icon-bookmark": IconBookmark,
|
|
72
|
-
"menu-icon-beer": IconBottle,
|
|
73
|
-
"menu-icon-cards": IconBoxMultiple,
|
|
74
|
-
"menu-icon-cart": IconShoppingCart,
|
|
75
|
-
"menu-icon-carton": IconMilk,
|
|
76
|
-
"menu-icon-check": IconRosetteDiscountCheck,
|
|
77
|
-
"menu-icon-cheese": IconCheese,
|
|
78
|
-
"menu-icon-contact": IconMessage,
|
|
79
|
-
"menu-icon-delivery": IconPackage,
|
|
80
|
-
// "menu-icon-dresser": ,
|
|
81
|
-
"menu-icon-fork": IconToolsKitchen2,
|
|
82
|
-
"menu-icon-fullhamburger": IconBaselineDensityMedium,
|
|
83
|
-
"menu-icon-glasses": IconEyeglass2,
|
|
84
|
-
"menu-icon-globe": IconWorld,
|
|
85
|
-
"menu-icon-grid": IconLayoutGrid,
|
|
86
|
-
"menu-icon-hanger": IconHanger,
|
|
87
|
-
"menu-icon-hamburger": IconAlignLeft,
|
|
88
|
-
"menu-icon-handcart": IconShoppingBag,
|
|
89
66
|
"menu-icon-heart": IconHeartFilled,
|
|
90
|
-
"menu-icon-info": IconInfoCircle,
|
|
91
|
-
"menu-icon-instagram": IconBrandInstagram,
|
|
92
|
-
"menu-icon-lightning": IconBolt,
|
|
93
|
-
"menu-icon-lookbook": IconDeviceIpadHeart,
|
|
94
|
-
"menu-icon-locator": IconMap2,
|
|
95
|
-
"menu-icon-mail": IconMail,
|
|
96
|
-
"menu-icon-more": IconDots,
|
|
97
|
-
"menu-icon-message": IconMessage2,
|
|
98
|
-
"menu-icon-package": IconGift,
|
|
99
|
-
"menu-icon-page": IconNotes,
|
|
100
|
-
"menu-icon-paper": IconLicense,
|
|
101
|
-
"menu-icon-photos": IconPhoto,
|
|
102
|
-
"menu-icon-sale": IconRosetteDiscount,
|
|
103
|
-
"menu-icon-scroll": IconLicense,
|
|
104
|
-
// "menu-icon-shirt": ,
|
|
105
|
-
// "menu-icon-shorts": ,
|
|
106
|
-
"menu-icon-shoes": IconShoe,
|
|
107
|
-
"menu-icon-speaker": IconSpeakerphone,
|
|
108
|
-
"menu-icon-star": IconStar,
|
|
109
|
-
"menu-icon-search": IconListSearch,
|
|
110
|
-
"menu-icon-support": IconLifebuoy,
|
|
111
|
-
"menu-icon-tag": IconTag,
|
|
112
|
-
"menu-icon-term receipt": IconReceipt2,
|
|
113
|
-
"menu-icon-tshirt": IconShirt,
|
|
114
|
-
"menu-icon-write": IconFilePencil,
|
|
115
|
-
"menu-icon-watch": IconDeviceWatch,
|
|
116
67
|
upload: IconUpload,
|
|
117
68
|
"currency-dollar": IconCurrencyDollar,
|
|
118
69
|
x: IconX,
|
|
@@ -127,6 +78,10 @@ const icons = {
|
|
|
127
78
|
"columns-3": IconColumns3,
|
|
128
79
|
search: IconSearch,
|
|
129
80
|
"shopping-cart-off": IconShoppingCartOff,
|
|
81
|
+
"star-filled": IconStarFilled,
|
|
82
|
+
"shopping-bag": IconShoppingBag,
|
|
83
|
+
"shopping-bag-plus": IconShoppingBagPlus,
|
|
84
|
+
"shield-check-filled": IconShieldCheckFilled,
|
|
130
85
|
};
|
|
131
86
|
const TablerIcon = ({ name, size }) => {
|
|
132
87
|
const IconComponent = icons[name];
|
|
@@ -138,8 +93,8 @@ const CustomIcon = ({ url, size, strokeColor, fillColor }) => {
|
|
|
138
93
|
const paths = svg.querySelectorAll("path");
|
|
139
94
|
paths.forEach((path) => {
|
|
140
95
|
path.setAttribute("stroke-width", strokeWidthMapping[size].toString());
|
|
141
|
-
fillColor && path.setAttribute("fill", fillColor);
|
|
142
|
-
strokeColor && path.setAttribute("stroke", strokeColor);
|
|
96
|
+
fillColor && path.setAttribute("fill", `var(--${fillColor})`);
|
|
97
|
+
strokeColor && path.setAttribute("stroke", `var(--${strokeColor})`);
|
|
143
98
|
});
|
|
144
99
|
} }));
|
|
145
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,KAAK,MAAM,GAAG;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY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AAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC1C,OAAO,EAAE,OAAO,KACb,IAAI,CAAA;IACT,UAAU,CAAC,EAAE,CACX,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC1C,OAAO,EAAE,OAAO,KACb,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA8HD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsU3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -135,7 +135,7 @@ const productCardFavoriteVariants = cva("absolute ", {
|
|
|
135
135
|
},
|
|
136
136
|
});
|
|
137
137
|
const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFavoriteClick, onQuickAdd, openProduct, className, }) => {
|
|
138
|
-
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, _19, _20
|
|
138
|
+
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, _19, _20;
|
|
139
139
|
const { variants, images, title, tags } = product;
|
|
140
140
|
// Select the variant that has the lowest price that is available or just the lowest price if none are available
|
|
141
141
|
let searchVariants = variants.filter((variant) => variant.available);
|
|
@@ -217,34 +217,30 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
|
|
|
217
217
|
imageSwipeEnabled
|
|
218
218
|
})), selected: favorited, onClick: (e) => {
|
|
219
219
|
onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
|
|
220
|
-
},
|
|
221
|
-
? (_s = (_r = config.favoritesIcon) === null || _r === void 0 ? void 0 : _r.icon) === null || _s === void 0 ? void 0 : _s.url
|
|
222
|
-
: undefined, layoutType: (_t = config.favoritesIcon) === null || _t === void 0 ? void 0 : _t.layoutType, showBackground: (_u = config.favoritesIcon) === null || _u === void 0 ? void 0 : _u.showBackground, cornerRadius: (_v = config.favoritesIcon) === null || _v === void 0 ? void 0 : _v.cornerRadius }))] }))), ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
|
|
220
|
+
}, iconUrl: (_q = (_p = config.favoritesIcon) === null || _p === void 0 ? void 0 : _p.icon) === null || _q === void 0 ? void 0 : _q.url, layoutType: (_r = config.favoritesIcon) === null || _r === void 0 ? void 0 : _r.layoutType, showBackground: (_s = config.favoritesIcon) === null || _s === void 0 ? void 0 : _s.showBackground, cornerRadius: (_t = config.favoritesIcon) === null || _t === void 0 ? void 0 : _t.cornerRadius }))] }))), ((_u = config.quickAdd) === null || _u === void 0 ? void 0 : _u.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
|
|
223
221
|
borderBottomLeftRadius: `${config.quickAdd.cornerRadius}px`,
|
|
224
222
|
borderBottomRightRadius: `${config.quickAdd.cornerRadius}px`,
|
|
225
|
-
}, labelClassName: cn("outline-0 w-full", { uppercase: (
|
|
223
|
+
}, labelClassName: cn("outline-0 w-full", { uppercase: (_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.uppercase }, { "text-left": ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.textAlignment) === "left" }, { "text-right": ((_x = config.quickAdd) === null || _x === void 0 ? void 0 : _x.textAlignment) === "right" }, { "text-center": ((_y = config.quickAdd) === null || _y === void 0 ? void 0 : _y.textAlignment) === "center" }), labelStyle: { fontSize: (_z = config.quickAdd) === null || _z === void 0 ? void 0 : _z.fontSize }, variant: "quickadd", size: "default", disabled: product.availableForSale === false, onClick: (e) => {
|
|
226
224
|
e.stopPropagation();
|
|
227
225
|
onQuickAdd === null || onQuickAdd === void 0 ? void 0 : onQuickAdd(e, product);
|
|
228
226
|
} }, { children: _jsxs("div", Object.assign({ className: "flex items-center justify-center gap-2" }, { children: [_jsx(Icon, { name: product.availableForSale ? "plus" : "shopping-cart-off", size: "xs" }), product.availableForSale ? "Quick Add" : "Sold Out"] })) }))), _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", {
|
|
229
227
|
"justify-end": belowBadge.horizontalPosition === "end",
|
|
230
|
-
}) }, { 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 })) }))), ((
|
|
231
|
-
"text-left": ((
|
|
228
|
+
}) }, { 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 })) }))), ((_0 = config.productTitle) === null || _0 === void 0 ? void 0 : _0.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ uppercase: (_1 = config.productTitle) === null || _1 === void 0 ? void 0 : _1.uppercase }, {
|
|
229
|
+
"text-left": ((_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.textAlignment) === "left",
|
|
232
230
|
}, {
|
|
233
|
-
"text-right": ((
|
|
231
|
+
"text-right": ((_3 = config.productTitle) === null || _3 === void 0 ? void 0 : _3.textAlignment) === "right",
|
|
234
232
|
}, {
|
|
235
|
-
"text-center": ((
|
|
233
|
+
"text-center": ((_4 = config.productTitle) === null || _4 === void 0 ? void 0 : _4.textAlignment) === "center",
|
|
236
234
|
}, {
|
|
237
|
-
"line-clamp-2": (
|
|
238
|
-
"line-clamp-1": !((
|
|
239
|
-
}, "text-textColors-productTitle"), style: { fontSize: (
|
|
235
|
+
"line-clamp-2": (_5 = config.productTitle) === null || _5 === void 0 ? void 0 : _5.wrapText,
|
|
236
|
+
"line-clamp-1": !((_6 = config.productTitle) === null || _6 === void 0 ? void 0 : _6.wrapText),
|
|
237
|
+
}, "text-textColors-productTitle"), style: { fontSize: (_7 = config.productTitle) === null || _7 === void 0 ? void 0 : _7.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end items-center", { "justify-start": ((_8 = config.price) === null || _8 === void 0 ? void 0 : _8.textAlignment) === "left" }, { "justify-end": ((_9 = config.price) === null || _9 === void 0 ? void 0 : _9.textAlignment) === "right" }, { "justify-center": ((_10 = config.price) === null || _10 === void 0 ? void 0 : _10.textAlignment) === "center" }) }, { children: [((_11 = config.price) === null || _11 === void 0 ? void 0 : _11.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice &&
|
|
240
238
|
variant.compareAtPrice &&
|
|
241
|
-
parseFloat((
|
|
239
|
+
parseFloat((_12 = variant.compareAtPrice) === null || _12 === void 0 ? void 0 : _12.amount) >
|
|
242
240
|
parseFloat(variant.price.amount), compareAtPrice: variant.compareAtPrice &&
|
|
243
|
-
parseFloat((
|
|
241
|
+
parseFloat((_13 = variant.compareAtPrice) === null || _13 === void 0 ? void 0 : _13.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_14 = config.price) === null || _14 === void 0 ? void 0 : _14.fontSize })), ((_15 = config.favoritesIcon) === null || _15 === void 0 ? void 0 : _15.enabled) &&
|
|
244
242
|
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) => {
|
|
245
243
|
onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
|
|
246
|
-
}, size: "small",
|
|
247
|
-
? (_21 = (_20 = config.favoritesIcon) === null || _20 === void 0 ? void 0 : _20.icon) === null || _21 === void 0 ? void 0 : _21.url
|
|
248
|
-
: undefined, cornerRadius: (_22 = config.favoritesIcon) === null || _22 === void 0 ? void 0 : _22.cornerRadius, layoutType: (_23 = config.favoritesIcon) === null || _23 === void 0 ? void 0 : _23.layoutType, showBackground: (_24 = config.favoritesIcon) === null || _24 === void 0 ? void 0 : _24.showBackground }) })))] }))] }))] })) })));
|
|
244
|
+
}, size: "small", iconUrl: (_17 = (_16 = config.favoritesIcon) === null || _16 === void 0 ? void 0 : _16.icon) === null || _17 === void 0 ? void 0 : _17.url, cornerRadius: (_18 = config.favoritesIcon) === null || _18 === void 0 ? void 0 : _18.cornerRadius, layoutType: (_19 = config.favoritesIcon) === null || _19 === void 0 ? void 0 : _19.layoutType, showBackground: (_20 = config.favoritesIcon) === null || _20 === void 0 ? void 0 : _20.showBackground }) })))] }))] }))] })) })));
|
|
249
245
|
};
|
|
250
246
|
export { ProductCard };
|
|
@@ -14,10 +14,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { cn } from "../../lib/utils";
|
|
16
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-
|
|
17
|
+
const IconButton = ({ icon, handler, className }) => (_jsx("button", Object.assign({ onClick: handler, className: cn("flex items-center justify-center h-7 w-7 bg-stateColors-skeleton outline outline-1 outline-stateColors-skeleton", className) }, { children: _jsx(Icon, { name: icon, size: "sm", color: "coreColors-secondaryIcon" }) })));
|
|
18
18
|
const QuantityPicker = React.forwardRef((_a, ref) => {
|
|
19
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-
|
|
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-8 h-7 py-1 flex justify-center bg-coreColors-inputBackground outline outline-1 outline-coreColors-dividingLines text-[14px] 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
21
|
});
|
|
22
22
|
QuantityPicker.displayName = "QuantityPicker";
|
|
23
23
|
export { QuantityPicker };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface SelectProps<T> {
|
|
3
|
+
children: React.ReactElement<{
|
|
4
|
+
value: T;
|
|
5
|
+
onSelect?: () => void;
|
|
6
|
+
isTrigger?: boolean;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
children: ({ isTrigger }: {
|
|
9
|
+
isTrigger: boolean;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
}>[];
|
|
12
|
+
defaultValue?: T;
|
|
13
|
+
onChange?: (value: T) => void;
|
|
14
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
15
|
+
onCreateNew?: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps<unknown> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
19
|
+
isTrigger?: boolean;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
interface SelectContentProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const SelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
interface SelectItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
30
|
+
onSelect?: () => void;
|
|
31
|
+
isSelected?: boolean;
|
|
32
|
+
isTrigger?: boolean;
|
|
33
|
+
children: React.ReactNode | (({ isTrigger }: {
|
|
34
|
+
isTrigger: boolean;
|
|
35
|
+
}) => React.ReactNode);
|
|
36
|
+
}
|
|
37
|
+
declare const SelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export { Select, SelectTrigger, SelectContent, SelectItem };
|
|
39
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../components/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,UAAU,WAAW,CAAC,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,KA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AC,SAAS,CAAC,CAAA;CACjE;AAED,QAAA,MAAM,UAAU,wFAmBf,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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 { ChevronDown } from "lucide-react";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { CreateNew, Wishlist } from "./wishlist";
|
|
18
|
+
const Select = React.forwardRef(({ children, defaultValue, onChange, onOpenChange, onCreateNew, }, ref) => {
|
|
19
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
20
|
+
const [selectedValue, setSelectedValue] = React.useState(defaultValue);
|
|
21
|
+
const triggerRef = React.useRef(null);
|
|
22
|
+
const contentRef = React.useRef(null);
|
|
23
|
+
// useEffect for click outside listener
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
const handleClickOutside = (event) => {
|
|
26
|
+
if (isOpen &&
|
|
27
|
+
triggerRef.current &&
|
|
28
|
+
contentRef.current &&
|
|
29
|
+
!triggerRef.current.contains(event.target) &&
|
|
30
|
+
!contentRef.current.contains(event.target)) {
|
|
31
|
+
setIsOpen(false);
|
|
32
|
+
onOpenChange && onOpenChange(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
36
|
+
return () => {
|
|
37
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
38
|
+
};
|
|
39
|
+
}, [isOpen, onOpenChange]);
|
|
40
|
+
const handleSelect = (value) => {
|
|
41
|
+
setSelectedValue(value);
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
onChange && onChange(value);
|
|
44
|
+
onOpenChange && onOpenChange(false);
|
|
45
|
+
};
|
|
46
|
+
const handleToggle = () => {
|
|
47
|
+
const newIsOpen = !isOpen;
|
|
48
|
+
setIsOpen(newIsOpen);
|
|
49
|
+
onOpenChange && onOpenChange(newIsOpen);
|
|
50
|
+
};
|
|
51
|
+
const handleCreateNew = () => {
|
|
52
|
+
onCreateNew && onCreateNew();
|
|
53
|
+
setIsOpen(false);
|
|
54
|
+
onOpenChange && onOpenChange(false);
|
|
55
|
+
};
|
|
56
|
+
const selectedChild = React.Children.toArray(children).find((child) => React.isValidElement(child) && child.props.value === selectedValue);
|
|
57
|
+
return (_jsxs("div", Object.assign({ className: "relative", ref: ref }, { children: [_jsxs(SelectTrigger, Object.assign({ ref: triggerRef, onClick: handleToggle }, { children: [_jsx(SelectItem, Object.assign({ isTrigger: true }, { children: selectedChild ? (selectedChild.props.children({ isTrigger: true })) : (_jsx(Wishlist, { name: "My Favorites", isTrigger: true })) })), _jsx(ChevronDown, { className: cn("h-4 w-4 opacity-50 mr-4 transition-transform duration-200 ease-in-out", isOpen && "transform rotate-180") })] })), _jsxs(SelectContent, Object.assign({ isOpen: isOpen, ref: contentRef }, { children: [React.Children.map(children, (child) => React.isValidElement(child)
|
|
58
|
+
? React.cloneElement(child, {
|
|
59
|
+
onSelect: () => handleSelect(child.props.value),
|
|
60
|
+
isSelected: child.props.value === selectedValue,
|
|
61
|
+
}, child.props.children({ isTrigger: false }))
|
|
62
|
+
: child), _jsx("div", Object.assign({ className: "sticky bottom-0 bg-coreColors-inputBackground border-t border-coreColors-dividingLines" }, { children: _jsx(CreateNew, { onClick: handleCreateNew }) }))] }))] })));
|
|
63
|
+
});
|
|
64
|
+
Select.displayName = "Select";
|
|
65
|
+
const SelectTrigger = React.forwardRef((_a, ref) => {
|
|
66
|
+
var { className, children, isTrigger = false } = _a, props = __rest(_a, ["className", "children", "isTrigger"]);
|
|
67
|
+
return (_jsx("button", Object.assign({ ref: ref, className: cn("flex w-full items-center justify-between rounded-md border border-coreColors-brandColorPrimary bg-coreColors-inputBackground text-sm placeholder:text-coreColors-brandColorPrimary disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), style: {
|
|
68
|
+
WebkitTapHighlightColor: "transparent",
|
|
69
|
+
} }, props, { children: children })));
|
|
70
|
+
});
|
|
71
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
72
|
+
const SelectContent = React.forwardRef((_a, ref) => {
|
|
73
|
+
var { className, children, isOpen } = _a, props = __rest(_a, ["className", "children", "isOpen"]);
|
|
74
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("mt-1 absolute z-50 w-full max-h-[200px] overflow-y-auto rounded-md bg-coreColors-inputBackground shadow-md border border-coreColors-brandColorPrimary", "transition-all duration-300 ease-in-out", isOpen
|
|
75
|
+
? "opacity-100 translate-y-0"
|
|
76
|
+
: "opacity-0 translate-y-[-10px] pointer-events-none", className) }, props, { children: children })));
|
|
77
|
+
});
|
|
78
|
+
SelectContent.displayName = "SelectContent";
|
|
79
|
+
const SelectItem = React.forwardRef((_a, ref) => {
|
|
80
|
+
var { className, children, onSelect, isSelected, isTrigger } = _a, props = __rest(_a, ["className", "children", "onSelect", "isSelected", "isTrigger"]);
|
|
81
|
+
return (_jsx("div", Object.assign({ ref: ref, className: cn("relative flex w-full cursor-pointer select-none items-center text-sm outline-none", !isTrigger &&
|
|
82
|
+
"border-b border-coreColors-dividingLines last:border-b-0", isSelected && "bg-stateColors-skeleton", className), onClick: onSelect }, props, { children: typeof children === "function"
|
|
83
|
+
? children({ isTrigger: isTrigger || false })
|
|
84
|
+
: children })));
|
|
85
|
+
});
|
|
86
|
+
SelectItem.displayName = "SelectItem";
|
|
87
|
+
export { Select, SelectTrigger, SelectContent, SelectItem };
|
|
@@ -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;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,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;2CA2CpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,
|
|
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,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,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;2CA2CpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EACJ,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,GACpC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IACtC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6CvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -55,7 +55,7 @@ const SelectorContainer = ({ children, containerRef, className, }) => {
|
|
|
55
55
|
React.useEffect(() => {
|
|
56
56
|
checkOverflow();
|
|
57
57
|
}, [children]);
|
|
58
|
-
return (_jsx("div", Object.assign({ className: "relative no-scrollbar" }, { children: _jsxs("div", Object.assign({ className: cn("flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", className), onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none
|
|
58
|
+
return (_jsx("div", Object.assign({ className: "relative no-scrollbar" }, { children: _jsxs("div", Object.assign({ className: cn("flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", className), onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none " }))] })) })));
|
|
59
59
|
};
|
|
60
60
|
Selectors.displayName = "Selectors";
|
|
61
61
|
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -41,7 +41,7 @@ const Slider = React.forwardRef((_a, ref) => {
|
|
|
41
41
|
const debouncedSliderVal = useDebounce(value, 200);
|
|
42
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
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-[
|
|
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-[14px]" }, { 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-[14px] w-full [&>div]:w-full" }, { children: ["$", _jsx(Input, { className: "border-0 p-0 h-full w-full text-[14px]", id: "slider-maximum", value: debouncedSliderVal[0].toString(), placeholder: defaultValue[0].toString(), onChange: (value) => {
|
|
45
45
|
const inputValue = Number(value);
|
|
46
46
|
inputValue > max ? onChange([max]) : onChange([inputValue]);
|
|
47
47
|
} })] }))] })) }))] }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../components/ui/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../components/ui/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAUhE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -16,8 +16,8 @@ const textVariants = cva("", {
|
|
|
16
16
|
variants: {
|
|
17
17
|
type: {
|
|
18
18
|
h1: "text-[23px] font-fontRegular leading-[130%] font-normal text-textColors-primaryColor",
|
|
19
|
-
h2: "text-lg font-
|
|
20
|
-
"body-primary": "text-[
|
|
19
|
+
h2: "text-lg font-fontRegular leading-[130%] font-medium text-textColors-primaryColor",
|
|
20
|
+
"body-primary": "text-[14px] font-fontRegular leading-[160%] font-normal text-textColors-primaryColor",
|
|
21
21
|
"body-secondary": "text-[12px] font-fontRegular leading-[130%] font-normal text-textColors-secondaryColor",
|
|
22
22
|
label: "text-[10px] font-fontRegular leading-[130%] font-normal text-textColors-secondaryColor",
|
|
23
23
|
},
|
|
@@ -29,6 +29,6 @@ const textVariants = cva("", {
|
|
|
29
29
|
function Text(_a) {
|
|
30
30
|
var { className, type, fontColor } = _a, props = __rest(_a, ["className", "type", "fontColor"]);
|
|
31
31
|
const fontColorOverride = fontColor ? { color: fontColor } : {};
|
|
32
|
-
return _jsx("p", Object.assign({ className: cn(textVariants({ type }), className), style: fontColorOverride }, props));
|
|
32
|
+
return (_jsx("p", Object.assign({ className: cn(textVariants({ type }), className), style: fontColorOverride }, props)));
|
|
33
33
|
}
|
|
34
34
|
export { Text, textVariants };
|
|
@@ -1 +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,
|
|
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,2FAkFb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -48,7 +48,11 @@ const Textarea = React.forwardRef((_a, ref) => {
|
|
|
48
48
|
return (_jsxs(Comp, Object.assign({ className: cn(textareaVariants({ error }), content ? "pt-6 pb-2" : "pt-4 pb-4", className), onClick: focusTextarea }, { children: [_jsx("textarea", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => {
|
|
49
49
|
onChange(e.target.value);
|
|
50
50
|
handleChange(e.target.value);
|
|
51
|
-
}, id: id, className: cn("textarea-component overflow-y-auto w-full resize-none text-[
|
|
51
|
+
}, id: id, className: cn("textarea-component overflow-y-auto w-full resize-none text-[14px] font-fontRegular leading-[160%] font-normal min-h-[24px] align-top placeholder-shown:!truncate text-textColors-primaryColor ring-offset-background file:border-0 file:bg-transparent placeholder-shown:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer", {
|
|
52
|
+
"pr-1": textareaRef.current &&
|
|
53
|
+
maxHeight &&
|
|
54
|
+
textareaRef.current.scrollHeight >= maxHeight,
|
|
55
|
+
}), style: { maxHeight: `${maxHeight}px` }, "data-text": "Enter text here", rows: 1, ref: textareaRef }, props)), label ? (_jsx("label", Object.assign({ htmlFor: id, style: { maxWidth: `-webkit-fill-available` }, className: "absolute truncate text-[10px] pr-4 text-textColors-secondaryColor top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0" }, { children: label }))) : null] })));
|
|
52
56
|
});
|
|
53
57
|
Textarea.displayName = "Textarea";
|
|
54
58
|
export { Textarea };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Translations } from "app-studio-types";
|
|
3
|
+
interface SelectProps<T> {
|
|
4
|
+
children: React.ReactElement<{
|
|
5
|
+
value: T;
|
|
6
|
+
onSelect?: () => void;
|
|
7
|
+
isTrigger?: boolean;
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
translations: Translations;
|
|
10
|
+
children: ({ isTrigger, translations, }: {
|
|
11
|
+
isTrigger: boolean;
|
|
12
|
+
translations: Translations;
|
|
13
|
+
}) => React.ReactNode;
|
|
14
|
+
}>[];
|
|
15
|
+
defaultValue?: T;
|
|
16
|
+
onChange?: (value: T) => void;
|
|
17
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
18
|
+
onCreateNew?: () => void;
|
|
19
|
+
translations: Translations;
|
|
20
|
+
}
|
|
21
|
+
declare const WishlistSelect: React.ForwardRefExoticComponent<SelectProps<unknown> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
23
|
+
isTrigger?: boolean;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
declare const WishlistSelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
interface SelectContentProps {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
isOpen: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
declare const WishlistSelectContent: React.ForwardRefExoticComponent<SelectContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
interface SelectItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
34
|
+
onSelect?: () => void;
|
|
35
|
+
isSelected?: boolean;
|
|
36
|
+
isTrigger?: boolean;
|
|
37
|
+
children: React.ReactNode | (({ isTrigger }: {
|
|
38
|
+
isTrigger: boolean;
|
|
39
|
+
}) => React.ReactNode);
|
|
40
|
+
}
|
|
41
|
+
declare const WishlistSelectItem: React.ForwardRefExoticComponent<SelectItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export { WishlistSelect, WishlistSelectTrigger, WishlistSelectContent, WishlistSelectItem, };
|
|
43
|
+
//# sourceMappingURL=wishlist-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wishlist-select.d.ts","sourceRoot":"","sources":["../../../components/ui/wishlist-select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,UAAU,WAAW,CAAC,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,KAAK,EAAE,CAAC,CAAA;QACR,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;QACrB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,YAAY,EAAE,YAAY,CAAA;QAC1B,QAAQ,EAAE,CAAC,EACT,SAAS,EACT,YAAY,GACb,EAAE;YACD,SAAS,EAAE,OAAO,CAAA;YAClB,YAAY,EAAE,YAAY,CAAA;SAC3B,KAAK,KAAK,CAAC,SAAS,CAAA;KACtB,CAAC,EAAE,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