@tapcart/mobile-components 0.2.10 → 0.2.12
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-infinite-scroll.d.ts +1 -0
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-infinite-scroll.js +10 -6
- package/dist/components/hooks/use-scroll-direction.d.ts +8 -0
- package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -0
- package/dist/components/hooks/use-scroll-direction.js +30 -0
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/alert-dialog.js +8 -8
- package/dist/components/ui/badge.d.ts +4 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +25 -7
- package/dist/components/ui/button.d.ts +3 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +5 -5
- package/dist/components/ui/carousel.d.ts +5 -5
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +5 -5
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/chip.d.ts +2 -2
- package/dist/components/ui/chip.d.ts.map +1 -1
- package/dist/components/ui/chip.js +2 -2
- package/dist/components/ui/container.js +1 -1
- package/dist/components/ui/drawer.d.ts +3 -3
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +15 -13
- package/dist/components/ui/dropdown.d.ts +22 -0
- package/dist/components/ui/dropdown.d.ts.map +1 -0
- package/dist/components/ui/dropdown.js +60 -0
- package/dist/components/ui/favorite.d.ts +4 -2
- package/dist/components/ui/favorite.d.ts.map +1 -1
- package/dist/components/ui/favorite.js +11 -5
- package/dist/components/ui/grid.js +5 -5
- package/dist/components/ui/icon.d.ts +2 -2
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +32 -7
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/money.js +1 -1
- package/dist/components/ui/price.d.ts +2 -1
- package/dist/components/ui/price.d.ts.map +1 -1
- package/dist/components/ui/price.js +6 -6
- package/dist/components/ui/product-card.d.ts +93 -27
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +140 -33
- package/dist/components/ui/product-grid.d.ts +1 -1
- package/dist/components/ui/product-grid.d.ts.map +1 -1
- package/dist/components/ui/product-grid.js +5 -5
- package/dist/components/ui/radio-group.js +4 -4
- package/dist/components/ui/scroll-area.d.ts +1 -1
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/selectors.d.ts +2 -2
- package/dist/components/ui/selectors.d.ts.map +1 -1
- package/dist/components/ui/selectors.js +3 -3
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/text.js +6 -6
- package/dist/components/ui/toast.d.ts +3 -3
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/components/ui/toast.js +7 -7
- package/dist/components/ui/toaster.js +2 -2
- package/dist/components/ui/toggle-group.d.ts +2 -2
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/use-toast.d.ts +6 -6
- package/dist/components/ui/use-toast.d.ts.map +1 -1
- package/dist/components/ui/video.js +1 -1
- package/dist/components/ui/wishlist.d.ts +2 -1
- package/dist/components/ui/wishlist.d.ts.map +1 -1
- package/dist/components/ui/wishlist.js +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/styles.css +147 -29
- package/package.json +1 -1
|
@@ -13,51 +13,53 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { Drawer as DrawerPrimitive } from "vaul";
|
|
16
|
-
import { cn } from "
|
|
17
|
-
import { Icon } from "
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Icon } from "./icon";
|
|
18
18
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
19
19
|
const DrawerPortal = DrawerPrimitive.Portal;
|
|
20
20
|
const DrawerClose = DrawerPrimitive.Close;
|
|
21
21
|
const Drawer = (_a) => {
|
|
22
22
|
var { shouldScaleBackground } = _a, props = __rest(_a, ["shouldScaleBackground"]);
|
|
23
|
-
return
|
|
23
|
+
return _jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props));
|
|
24
24
|
};
|
|
25
25
|
Drawer.displayName = "Drawer";
|
|
26
26
|
const DrawerOverlay = React.forwardRef((_a, ref) => {
|
|
27
27
|
var { className, backdropHexColor = "#000000" } = _a, props = __rest(_a, ["className", "backdropHexColor"]);
|
|
28
|
-
return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: { backgroundColor: `${backdropHexColor}CC` }, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props)
|
|
28
|
+
return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: { backgroundColor: `${backdropHexColor}CC` }, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props)));
|
|
29
29
|
});
|
|
30
30
|
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
31
31
|
const DrawerContentBase = React.forwardRef((_a, ref) => {
|
|
32
32
|
var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet"]);
|
|
33
|
-
const styles = isSheet
|
|
34
|
-
|
|
33
|
+
const styles = isSheet
|
|
34
|
+
? { height: "calc(100vh - 56px)" }
|
|
35
|
+
: { maxHeight: "calc(100vh - 56px)" };
|
|
36
|
+
return (_jsxs(DrawerPortal, { children: [hideBackdrop ? null : (_jsx(DrawerOverlay, { backdropHexColor: backdropHexColor })), _jsxs(DrawerPrimitive.Content, Object.assign({ ref: ref, style: styles, className: cn("fixed inset-x-0 bottom-0 z-50 flex h-auto flex-col rounded-t-2xl bg-coreColors-modalBackground", className) }, props, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }), children] }))] }));
|
|
35
37
|
});
|
|
36
38
|
DrawerContentBase.displayName = "DrawerContentBase";
|
|
37
39
|
const DrawerHeaderBase = (_a) => {
|
|
38
40
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
39
|
-
return (_jsx("div", Object.assign({ className: cn(className) }, props)
|
|
41
|
+
return (_jsx("div", Object.assign({ className: cn(className) }, props)));
|
|
40
42
|
};
|
|
41
43
|
DrawerHeaderBase.displayName = "DrawerHeaderBase";
|
|
42
44
|
const DrawerTitle = React.forwardRef((_a, ref) => {
|
|
43
45
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
-
return (_jsx(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-textColors-primaryColor text-center text-[18px] font-medium leading-[24px] truncate my-0 mx-4", className) }, props)
|
|
46
|
+
return (_jsx(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-textColors-primaryColor text-center text-[18px] font-medium leading-[24px] truncate my-0 mx-4", className) }, props)));
|
|
45
47
|
});
|
|
46
48
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
47
49
|
const DrawerFooter = (_a) => {
|
|
48
50
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
-
return (_jsx("div", Object.assign({ className: cn("mt-auto flex flex-row gap-2 pb-8 pt-4 pl-4 pr-4 border-t border-coreColors-dividingLines", className) }, props)
|
|
51
|
+
return (_jsx("div", Object.assign({ className: cn("mt-auto flex flex-row gap-2 pb-8 pt-4 pl-4 pr-4 border-t border-coreColors-dividingLines", className) }, props)));
|
|
50
52
|
};
|
|
51
53
|
DrawerFooter.displayName = "DrawerFooter";
|
|
52
54
|
const DrawerDescription = React.forwardRef((_a, ref) => {
|
|
53
55
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
-
return (_jsx(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)
|
|
56
|
+
return (_jsx(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
|
|
55
57
|
});
|
|
56
58
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
57
|
-
const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick }) => {
|
|
58
|
-
return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, className: "h-6 w-6 p-0", size: "md" }
|
|
59
|
+
const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick, }) => {
|
|
60
|
+
return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" })), _jsx(DrawerTitle, { children: title }), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" }))] })));
|
|
59
61
|
};
|
|
60
62
|
const DrawerContent = ({ children }) => {
|
|
61
|
-
return
|
|
63
|
+
return _jsx("div", Object.assign({ className: "h-full overflow-scroll" }, { children: children }));
|
|
62
64
|
};
|
|
63
65
|
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContentBase, DrawerContent, DrawerFooter, DrawerDescription, DrawerHeader, };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
import { WishlistProps } from "./wishlist";
|
|
4
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
5
|
+
interface DropdownMenuTriggerProps {
|
|
6
|
+
label: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
selectedItem?: WishlistProps | null;
|
|
10
|
+
isError?: boolean;
|
|
11
|
+
width?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const DropdownMenuTrigger: React.FC<DropdownMenuTriggerProps>;
|
|
14
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
width?: number | undefined;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
19
|
+
inset?: boolean | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuGroup, type DropdownMenuTriggerProps, };
|
|
22
|
+
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../components/ui/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAMtE,OAAO,EAAmB,aAAa,EAAE,MAAM,YAAY,CAAA;AAE3D,QAAA,MAAM,YAAY,mDAA6B,CAAA;AAE/C,UAAU,wBAAwB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgF3D,CAAA;AAED,QAAA,MAAM,iBAAiB,qHAA8B,CAAA;AAErD,QAAA,MAAM,mBAAmB;;wCAuBvB,CAAA;AAGF,QAAA,MAAM,gBAAgB;;wCAepB,CAAA;AAGF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
16
|
+
import clsx from "clsx";
|
|
17
|
+
import { cn } from "../../lib/utils";
|
|
18
|
+
import { Text } from "./text";
|
|
19
|
+
import { Icon } from "./icon";
|
|
20
|
+
import { PlaceholderIcon } from "./wishlist";
|
|
21
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
22
|
+
const DropdownMenuTrigger = (_a) => {
|
|
23
|
+
var { label, className, asChild, selectedItem, isError, width } = _a, props = __rest(_a, ["label", "className", "asChild", "selectedItem", "isError", "width"]);
|
|
24
|
+
const triggerClass = clsx("[&[data-state=open]_.chevron-icon]:rotate-180 active:text-coreColors-brandColorPrimary active:outline-coreColors-brandColorPrimary outline outline-1 outline-coreColors-dividingLines", {
|
|
25
|
+
"outline-stateColors-error": isError,
|
|
26
|
+
"[&[data-state=open]]:outline-coreColors-brandColorPrimary": !isError,
|
|
27
|
+
"[&[data-state=open]_.label]:text-coreColors-brandColorPrimary": selectedItem,
|
|
28
|
+
"[&[data-state=open]_.label]:text-textColors-secondaryColor": !selectedItem,
|
|
29
|
+
});
|
|
30
|
+
const labelClass = clsx("label overflow-hidden text-ellipsis whitespace-nowrap", {
|
|
31
|
+
"text-stateColors-error": isError,
|
|
32
|
+
"text-textColors-secondaryColor": !isError,
|
|
33
|
+
});
|
|
34
|
+
const nameClass = clsx("name", {
|
|
35
|
+
"text-stateColors-error": isError,
|
|
36
|
+
"": !isError,
|
|
37
|
+
});
|
|
38
|
+
const iconClass = clsx("", {
|
|
39
|
+
"stateColors-error": isError,
|
|
40
|
+
"coreColors-secondaryIcon": !isError,
|
|
41
|
+
});
|
|
42
|
+
return (_jsx(DropdownMenuPrimitive.Trigger, Object.assign({ asChild: asChild, className: cn(triggerClass, className) }, props, { style: { width: width } }, { children: _jsxs("button", Object.assign({ className: "h-14 flex justify-between items-center w-full rounded-[4px] p-4 bg-coreColors-inputBackground" }, { children: [selectedItem ? (_jsxs("div", Object.assign({ className: "flex flex-row items-center overflow-hidden" }, { children: [selectedItem.imgUrl ? (_jsx("img", { alt: "wishlist-image", className: "flex-shrink-0 h-10 w-10 border border-coreColors-dividingLines rounded-sm", src: selectedItem.imgUrl })) : (_jsx(PlaceholderIcon, {})), _jsxs("div", Object.assign({ className: "ml-2 text-start overflow-hidden" }, { children: [_jsx(Text, Object.assign({ type: "label", className: labelClass }, { children: label })), _jsx(Text, Object.assign({ type: "body-primary", className: nameClass }, { children: selectedItem.name }))] }))] }))) : (_jsx(Text, Object.assign({ type: "body-primary", className: labelClass }, { children: label }))), _jsx(Icon, { name: "chevron-down", size: "sm", color: iconClass, className: "chevron-icon shrink-0 ml-2" })] })) })));
|
|
43
|
+
};
|
|
44
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
45
|
+
const DropdownMenuContent = React.forwardRef((_a, ref) => {
|
|
46
|
+
var { className, sideOffset = 4, width } = _a, props = __rest(_a, ["className", "sideOffset", "width"]);
|
|
47
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ ref: ref, sideOffset: sideOffset, className: cn("z-50 max-h-[240px] overflow-y-auto min-w-[8rem] rounded-[4px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), style: {
|
|
48
|
+
outlineStyle: "solid",
|
|
49
|
+
outlineWidth: 1,
|
|
50
|
+
outlineColor: "var(--coreColors-brandColorPrimary)",
|
|
51
|
+
width: width,
|
|
52
|
+
} }, props)) }));
|
|
53
|
+
});
|
|
54
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
55
|
+
const DropdownMenuItem = React.forwardRef((_a, ref) => {
|
|
56
|
+
var { className, inset } = _a, props = __rest(_a, ["className", "inset"]);
|
|
57
|
+
return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ ref: ref, className: cn("relative flex cursor-default select-none items-center outline-none transition-colors focus:bg-stateColors-skeleton data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className) }, props)));
|
|
58
|
+
});
|
|
59
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
60
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuGroup, };
|
|
@@ -2,11 +2,13 @@ import * as React from "react";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const favoriteVariants: (props?: ({
|
|
4
4
|
size?: "small" | "large" | null | undefined;
|
|
5
|
-
|
|
5
|
+
showBackground?: boolean | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface FavoriteProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof favoriteVariants> {
|
|
8
8
|
selected?: boolean;
|
|
9
|
-
onClick:
|
|
9
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
10
|
+
icon?: string;
|
|
11
|
+
showBackground?: boolean;
|
|
10
12
|
}
|
|
11
13
|
declare const Favorite: React.ForwardRefExoticComponent<FavoriteProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
14
|
export { Favorite, favoriteVariants };
|
|
@@ -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;;;
|
|
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;;;mFAkBrB,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,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,QAAQ,yFAuBb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -14,22 +14,28 @@ 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
|
|
17
|
+
const favoriteVariants = cva("flex p-2 gap-2 rounded-[4px] shadow-buttonColors-primaryShadow active:[&_svg]:text-stateColors-favorites", {
|
|
18
18
|
variants: {
|
|
19
19
|
size: {
|
|
20
20
|
small: "p-2",
|
|
21
21
|
large: "p-3",
|
|
22
22
|
},
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
showBackground: {
|
|
24
|
+
true: "bg-coreColors-inputBackground",
|
|
25
|
+
false: "",
|
|
25
26
|
},
|
|
26
27
|
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: "small",
|
|
30
|
+
showBackground: true,
|
|
31
|
+
},
|
|
27
32
|
});
|
|
28
33
|
const Favorite = React.forwardRef((_a, ref) => {
|
|
29
|
-
var { className, size = "small", selected = false, onClick } = _a, props = __rest(_a, ["className", "size", "selected", "onClick"]);
|
|
34
|
+
var { className, size = "small", selected = false, onClick, icon = "heart-filled", showBackground = true } = _a, props = __rest(_a, ["className", "size", "selected", "onClick", "icon", "showBackground"]);
|
|
30
35
|
return (_jsx("button", Object.assign({ onClick: onClick, ref: ref, className: cn(favoriteVariants({
|
|
31
36
|
size,
|
|
32
|
-
|
|
37
|
+
showBackground
|
|
38
|
+
}), className) }, props, { children: _jsx(Icon, { name: icon, color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm" }) })));
|
|
33
39
|
});
|
|
34
40
|
Favorite.displayName = "Favorite";
|
|
35
41
|
export { Favorite, favoriteVariants };
|
|
@@ -16,10 +16,10 @@ import { cn } from "../../lib/utils";
|
|
|
16
16
|
const gridVariants = cva("grid", {
|
|
17
17
|
variants: {
|
|
18
18
|
columns: {
|
|
19
|
-
1: "grid-cols-1 gap-y-
|
|
20
|
-
2: "grid-cols-2 gap-x-[7px] gap-y-
|
|
21
|
-
3: "grid-cols-3 gap-x-[7px] gap-y-
|
|
22
|
-
4: "grid-cols-4 gap-x-[7px] gap-y-
|
|
19
|
+
1: "grid-cols-1 gap-y-4",
|
|
20
|
+
2: "grid-cols-2 gap-x-[7px] gap-y-4",
|
|
21
|
+
3: "grid-cols-3 gap-x-[7px] gap-y-4",
|
|
22
|
+
4: "grid-cols-4 gap-x-[7px] gap-y-4",
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
defaultVariants: {
|
|
@@ -28,6 +28,6 @@ const gridVariants = cva("grid", {
|
|
|
28
28
|
});
|
|
29
29
|
function Grid(_a) {
|
|
30
30
|
var { className, columns } = _a, props = __rest(_a, ["className", "columns"]);
|
|
31
|
-
return (_jsx(Container, { children: _jsx("div", Object.assign({ className: cn(gridVariants({ columns }), className) }, props)
|
|
31
|
+
return (_jsx(Container, { children: _jsx("div", Object.assign({ className: cn(gridVariants({ columns }), className) }, props)) }));
|
|
32
32
|
}
|
|
33
33
|
export { Grid, gridVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
import {
|
|
3
|
+
import { IconPencilMinus } from "@tabler/icons-react";
|
|
4
4
|
declare const iconVariants: (props?: ({
|
|
5
5
|
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
color?: string | null | undefined;
|
|
@@ -9,5 +9,5 @@ export interface IconProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "c
|
|
|
9
9
|
name?: string;
|
|
10
10
|
}
|
|
11
11
|
declare function Icon({ className, name, size, color, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export { Icon, iconVariants,
|
|
12
|
+
export { Icon, iconVariants, IconPencilMinus };
|
|
13
13
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,eAAe,EA0BhB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AA6CD,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,CAAA;CACd;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAW,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAczE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -11,9 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { cva } from "class-variance-authority";
|
|
14
|
-
import { IconUpload, IconPencilMinus } from "@tabler/icons-react";
|
|
14
|
+
import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, } from "@tabler/icons-react";
|
|
15
15
|
import { cn, iconColorVariantClasses } from "../../lib/utils";
|
|
16
|
-
import * as allIcons from "@tabler/icons-react";
|
|
17
16
|
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", {
|
|
18
17
|
variants: {
|
|
19
18
|
size: {
|
|
@@ -40,11 +39,37 @@ const sizeMapping = {
|
|
|
40
39
|
md: 24,
|
|
41
40
|
lg: 56,
|
|
42
41
|
};
|
|
42
|
+
const icons = {
|
|
43
|
+
minus: IconMinus,
|
|
44
|
+
plus: IconPlus,
|
|
45
|
+
"adjustments-alt": IconAdjustmentsAlt,
|
|
46
|
+
"arrows-sort": IconArrowsSort,
|
|
47
|
+
"alert-circle": IconAlertCircle,
|
|
48
|
+
"circle-x": IconCircleX,
|
|
49
|
+
"info-circle": IconInfoCircle,
|
|
50
|
+
check: IconCheck,
|
|
51
|
+
"square-off": IconSquareOff,
|
|
52
|
+
"map-pin": IconMapPin,
|
|
53
|
+
repeat: IconRepeat,
|
|
54
|
+
square: IconSquare,
|
|
55
|
+
"square-check": IconSquareCheck,
|
|
56
|
+
"chevron-up": IconChevronUp,
|
|
57
|
+
"eye-off": IconEyeOff,
|
|
58
|
+
"square-x": IconSquareX,
|
|
59
|
+
circle: IconCircle,
|
|
60
|
+
"chevron-down": IconChevronDown,
|
|
61
|
+
"heart-filled": IconHeartFilled,
|
|
62
|
+
upload: IconUpload,
|
|
63
|
+
"currency-dollar": IconCurrencyDollar,
|
|
64
|
+
x: IconX,
|
|
65
|
+
"circle-off": IconCircleOff,
|
|
66
|
+
"circle-dot-filled": IconCircleDotFilled,
|
|
67
|
+
"mood-sad": IconMoodSad,
|
|
68
|
+
"square-x-filled": IconSquareXFilled,
|
|
69
|
+
};
|
|
43
70
|
function Icon(_a) {
|
|
44
71
|
var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const IconComponent = allIcons[iconName];
|
|
48
|
-
return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] }, void 0)) : null, props.children] }), void 0));
|
|
72
|
+
const IconComponent = icons[name];
|
|
73
|
+
return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] })) : null, props.children] })));
|
|
49
74
|
}
|
|
50
|
-
export { Icon, iconVariants,
|
|
75
|
+
export { Icon, iconVariants, IconPencilMinus };
|
|
@@ -29,7 +29,7 @@ const inputVariants = cva("flex h-14 w-full rounded border border-coreColors-div
|
|
|
29
29
|
const Input = React.forwardRef((_a, ref) => {
|
|
30
30
|
var { className, error = false, id, type, label, icon, asChild, value, placeholder, onChange } = _a, props = __rest(_a, ["className", "error", "id", "type", "label", "icon", "asChild", "value", "placeholder", "onChange"]);
|
|
31
31
|
const Comp = asChild ? Slot : "div";
|
|
32
|
-
return (_jsxs(Comp, Object.assign({ className: "relative" }, { children: [_jsx("input", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), id: id, type: type, className: cn(inputVariants({ error }), className), "data-icon": !!icon, ref: ref }, props)
|
|
32
|
+
return (_jsxs(Comp, Object.assign({ className: "relative group" }, { children: [_jsx("input", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), id: id, type: type, className: cn(inputVariants({ error }), className), "data-icon": !!icon, ref: ref }, props)), label ? (_jsx("label", Object.assign({ htmlFor: id, className: "absolute text-[10px] text-textColors-secondaryColor group-active:text-coreColors-brandColorPrimary top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0" }, { children: label }))) : null, icon ? (_jsx(Icon, { name: icon, "data-error": error, size: "sm", className: "absolute w-5 aspect-square fill-current text-textColors-secondaryColor top-[18px] z-10 origin-[0] end-4 peer-pr-8 icon data-[error=true]:text-stateColors-error" })) : null] })));
|
|
33
33
|
});
|
|
34
34
|
Input.displayName = "Input";
|
|
35
35
|
export { Input };
|
|
@@ -18,7 +18,7 @@ import { cn } from "../../lib/utils";
|
|
|
18
18
|
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
19
19
|
const Label = React.forwardRef((_a, ref) => {
|
|
20
20
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return (_jsx(LabelPrimitive.Root, Object.assign({ ref: ref, className: cn(labelVariants(), className) }, props)
|
|
21
|
+
return (_jsx(LabelPrimitive.Root, Object.assign({ ref: ref, className: cn(labelVariants(), className) }, props)));
|
|
22
22
|
});
|
|
23
23
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
24
24
|
export { Label };
|
|
@@ -25,6 +25,6 @@ function Money(_a) {
|
|
|
25
25
|
currency: currency,
|
|
26
26
|
});
|
|
27
27
|
let formattedPrice = formatter.format(Number(price));
|
|
28
|
-
return _jsx("span", Object.assign({}, props, { children: formattedPrice })
|
|
28
|
+
return _jsx("span", Object.assign({}, props, { children: formattedPrice }));
|
|
29
29
|
}
|
|
30
30
|
export { Money, moneyVariants };
|
|
@@ -7,7 +7,8 @@ interface PriceProps {
|
|
|
7
7
|
compareAtPriceHigh?: number;
|
|
8
8
|
currency?: string;
|
|
9
9
|
locale?: string;
|
|
10
|
+
fontSize?: number;
|
|
10
11
|
}
|
|
11
|
-
declare function Price({ price, priceHigh, priceRanges, isSale, compareAtPrice, compareAtPriceHigh, currency, locale, }: PriceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function Price({ price, priceHigh, priceRanges, isSale, compareAtPrice, compareAtPriceHigh, currency, locale, fontSize, }: PriceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export { Price };
|
|
13
14
|
//# sourceMappingURL=price.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,GACd,EAAE,UAAU,2CAuFZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Money } from "
|
|
3
|
-
import { Text } from "
|
|
4
|
-
function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", }) {
|
|
5
|
-
return (_jsx(_Fragment, { children: priceRanges ? (_jsx(_Fragment, { children: isSale &&
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { Money } from "./money";
|
|
3
|
+
import { Text } from "./text";
|
|
4
|
+
function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", fontSize = 15, }) {
|
|
5
|
+
return (_jsx(_Fragment, { children: priceRanges ? (_jsx(_Fragment, { children: isSale &&
|
|
6
|
+
compareAtPrice !== undefined &&
|
|
7
|
+
compareAtPriceHigh !== undefined ? (_jsxs("div", Object.assign({ className: "flex flex-wrap" }, { children: [_jsx(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: _jsxs("span", Object.assign({ className: "mr-2" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }), " -", " ", priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale }))] })) })), _jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }), " ", "-", " ", _jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale })] }))] }))) : (_jsxs(Text, Object.assign({ className: "text-textColors-priceText", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }), " -", " ", priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale }))] }))) })) : (_jsx(_Fragment, { children: isSale && compareAtPrice !== undefined ? (_jsxs("div", Object.assign({ className: "flex flex-wrap" }, { children: [_jsx(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: _jsx("span", Object.assign({ className: "mr-2" }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }) })) })), _jsx(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style: { fontSize } }, { children: _jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }) }))] }))) : (_jsx(Text, Object.assign({ className: "text-textColors-priceText", style: { fontSize: `${fontSize}px` } }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }) }))) })) }));
|
|
8
8
|
}
|
|
9
9
|
export { Price };
|
|
@@ -1,32 +1,98 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
type Config = {
|
|
3
|
+
gridLayout?: string;
|
|
4
|
+
productImage?: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
cornerRadius: number;
|
|
7
|
+
};
|
|
8
|
+
price?: {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
fontSize: number;
|
|
11
|
+
textAlignment: "left" | "right" | "center" | null;
|
|
12
|
+
};
|
|
13
|
+
productTitle?: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
fontSize: number;
|
|
16
|
+
uppercase: boolean;
|
|
17
|
+
textAlignment: string;
|
|
18
|
+
wrapText: boolean;
|
|
19
|
+
};
|
|
20
|
+
quickAdd?: {
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
fontSize: number;
|
|
23
|
+
uppercase: boolean;
|
|
24
|
+
textAlignment: string;
|
|
25
|
+
cornerRadius: number;
|
|
26
|
+
};
|
|
27
|
+
favoritesIcon?: {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
layoutType: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "below-image-on-right";
|
|
30
|
+
showBackground: boolean;
|
|
31
|
+
cornerRadius: number;
|
|
32
|
+
icon: {
|
|
33
|
+
type: "internal";
|
|
34
|
+
url: "string";
|
|
35
|
+
assetId?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type BadgeData = {
|
|
40
|
+
horizontalPosition?: "start" | "end" | "center";
|
|
41
|
+
cornerRadius: "square" | "circle" | "rounded";
|
|
42
|
+
tags: Array<string>;
|
|
43
|
+
fontColor: string;
|
|
44
|
+
backgroundColor: string;
|
|
45
|
+
excludeTags?: Array<string>;
|
|
46
|
+
text: string;
|
|
47
|
+
priority: number;
|
|
48
|
+
image?: string | null;
|
|
49
|
+
};
|
|
50
|
+
type TapcartData = {
|
|
51
|
+
currency: {
|
|
52
|
+
code: string;
|
|
53
|
+
locale: string;
|
|
54
|
+
};
|
|
55
|
+
"product-badges": {
|
|
56
|
+
pdp: {
|
|
57
|
+
top?: Array<BadgeData>;
|
|
58
|
+
bottom?: Array<BadgeData>;
|
|
59
|
+
below?: Array<BadgeData>;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
theme: {
|
|
63
|
+
productImages: {
|
|
64
|
+
aspectRatio: "1:1" | "2:3" | "4:5";
|
|
65
|
+
scaling: "fill" | "fit";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type Product = {
|
|
70
|
+
variants: {
|
|
71
|
+
compareAtPrice: {
|
|
72
|
+
amount: string;
|
|
73
|
+
currencyCode: string;
|
|
74
|
+
} | undefined;
|
|
75
|
+
price: {
|
|
76
|
+
amount: string;
|
|
77
|
+
currencyCode: string;
|
|
78
|
+
};
|
|
79
|
+
}[];
|
|
80
|
+
images: {
|
|
81
|
+
src: string;
|
|
82
|
+
}[];
|
|
83
|
+
title: string;
|
|
84
|
+
tags: string[];
|
|
85
|
+
availableForSale: boolean;
|
|
86
|
+
};
|
|
87
|
+
export type ProductCardProps = {
|
|
88
|
+
config: Config;
|
|
89
|
+
tapcartData: TapcartData;
|
|
90
|
+
product: Product;
|
|
17
91
|
isLoading: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
position: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
|
|
23
|
-
};
|
|
24
|
-
icon?: {
|
|
25
|
-
name: string;
|
|
26
|
-
position: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
|
|
27
|
-
};
|
|
28
|
-
quickAdd: (event: React.MouseEvent<HTMLButtonElement>, product: ProductCardProps["product"]) => void;
|
|
29
|
-
openProduct: (event: React.MouseEvent<HTMLDivElement>, product: ProductCardProps["product"]) => void;
|
|
92
|
+
favorited?: boolean;
|
|
93
|
+
onFavoriteClick?: (event: React.MouseEvent<HTMLButtonElement>, product: Product) => void;
|
|
94
|
+
onQuickAdd?: (event: React.MouseEvent<HTMLButtonElement>, product: Product) => void;
|
|
95
|
+
openProduct?: (event: React.MouseEvent<HTMLDivElement>, product: Product) => void;
|
|
30
96
|
};
|
|
31
97
|
declare const ProductCard: React.FC<ProductCardProps>;
|
|
32
98
|
export { ProductCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"
|
|
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,KAAK,MAAM,GAAG;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