@tapcart/mobile-components 0.2.4 → 0.2.8
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 +25 -0
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -0
- package/dist/components/hooks/use-infinite-scroll.js +48 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +34 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +62 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +34 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +56 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +112 -0
- package/dist/components/ui/checkbox.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +38 -0
- package/dist/components/ui/chip.d.ts +28 -0
- package/dist/components/ui/chip.d.ts.map +1 -0
- package/dist/components/ui/chip.js +66 -0
- package/dist/components/ui/container.d.ts +10 -0
- package/dist/components/ui/container.d.ts.map +1 -0
- package/dist/components/ui/container.js +26 -0
- package/dist/components/ui/drawer.d.ts +37 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +63 -0
- package/dist/components/ui/favorite.d.ts +13 -0
- package/dist/components/ui/favorite.d.ts.map +1 -0
- package/dist/components/ui/favorite.js +35 -0
- package/dist/components/ui/grid.d.ts +14 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +33 -0
- package/dist/components/ui/icon.d.ts +13 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/icon.js +50 -0
- package/dist/components/ui/input.d.ts +17 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +35 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +24 -0
- package/dist/components/ui/money.d.ts +12 -0
- package/dist/components/ui/money.d.ts.map +1 -0
- package/dist/components/ui/money.js +30 -0
- package/dist/components/ui/price.d.ts +13 -0
- package/dist/components/ui/price.d.ts.map +1 -0
- package/dist/components/ui/price.js +9 -0
- package/dist/components/ui/product-card.d.ts +68 -0
- package/dist/components/ui/product-card.d.ts.map +1 -0
- package/dist/components/ui/product-card.js +132 -0
- package/dist/components/ui/product-grid.d.ts +14 -0
- package/dist/components/ui/product-grid.d.ts.map +1 -0
- package/dist/components/ui/product-grid.js +22 -0
- package/dist/components/ui/radio-group.d.ts +21 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +47 -0
- package/dist/components/ui/scroll-area.d.ts +9 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +29 -0
- package/dist/components/ui/selectors.d.ts +30 -0
- package/dist/components/ui/selectors.d.ts.map +1 -0
- package/dist/components/ui/selectors.js +45 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +22 -0
- package/dist/components/ui/skeleton.d.ts +13 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +33 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +22 -0
- package/dist/components/ui/tabs.d.ts +13 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +96 -0
- package/dist/components/ui/text.d.ts +10 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +33 -0
- package/dist/components/ui/toast.d.ts +20 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +98 -0
- package/dist/components/ui/toaster.d.ts +6 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +22 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +36 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +40 -0
- package/dist/components/ui/use-toast.d.ts +45 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +112 -0
- package/dist/components/ui/video.d.ts +8 -0
- package/dist/components/ui/video.d.ts.map +1 -0
- package/dist/components/ui/video.js +22 -0
- package/dist/components/ui/wishlist.d.ts +12 -0
- package/dist/components/ui/wishlist.d.ts.map +1 -0
- package/dist/components/ui/wishlist.js +23 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +25 -0
- package/dist/styles.css +425 -142
- package/package.json +19 -9
- package/dist/index.d.mts +0 -221
- package/dist/index.mjs +0 -999
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare type Config = {
|
|
3
|
+
gridLayout?: string;
|
|
4
|
+
productImage?: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
cornerRadius: number;
|
|
7
|
+
aspectRatio: "1:1" | "2:3" | "4:5";
|
|
8
|
+
scaling: "fill" | "fit";
|
|
9
|
+
};
|
|
10
|
+
price?: {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
fontSize: number;
|
|
13
|
+
textAlignment: string;
|
|
14
|
+
currency: string;
|
|
15
|
+
locale: string;
|
|
16
|
+
};
|
|
17
|
+
productTitle?: {
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
fontSize: number;
|
|
20
|
+
uppercase: boolean;
|
|
21
|
+
textAlignment: string;
|
|
22
|
+
wrapText: boolean;
|
|
23
|
+
};
|
|
24
|
+
quickAdd?: {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
fontSize: number;
|
|
27
|
+
uppercase: boolean;
|
|
28
|
+
textAlignment: string;
|
|
29
|
+
cornerRadius: number;
|
|
30
|
+
quickAdd: (event: React.MouseEvent<HTMLButtonElement>, product: ProductCardProps["product"]) => void;
|
|
31
|
+
};
|
|
32
|
+
badge?: {
|
|
33
|
+
text: string;
|
|
34
|
+
verticalPosition: "top" | "bottom" | "below";
|
|
35
|
+
horizontalPosition: "left" | "right" | "full-width";
|
|
36
|
+
icon: string;
|
|
37
|
+
};
|
|
38
|
+
favoritesIcon?: {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
layoutType: "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "default";
|
|
41
|
+
showBackground: boolean;
|
|
42
|
+
cornerRadius: number;
|
|
43
|
+
icon: string;
|
|
44
|
+
size: "small" | "large" | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
declare type ProductCardProps = {
|
|
48
|
+
config: Config;
|
|
49
|
+
product: {
|
|
50
|
+
variants: {
|
|
51
|
+
compare_at_price: number | undefined;
|
|
52
|
+
price: number;
|
|
53
|
+
}[];
|
|
54
|
+
images: {
|
|
55
|
+
url: string;
|
|
56
|
+
}[];
|
|
57
|
+
title: string;
|
|
58
|
+
tags: string[];
|
|
59
|
+
availableForSale: boolean;
|
|
60
|
+
openProduct: (event: React.MouseEvent<HTMLDivElement>, product: ProductCardProps["product"]) => void;
|
|
61
|
+
};
|
|
62
|
+
isLoading: boolean;
|
|
63
|
+
favorited?: boolean;
|
|
64
|
+
onFavoriteClick?: () => void;
|
|
65
|
+
};
|
|
66
|
+
declare const ProductCard: React.FC<ProductCardProps>;
|
|
67
|
+
export { ProductCard };
|
|
68
|
+
//# sourceMappingURL=product-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,oBAAY,MAAM,GAAG;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;QAClC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAA;KACxB,CAAA;IACD,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,EAAE,MAAM,CAAA;QAChB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,OAAO,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,OAAO,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,YAAY,EAAE,MAAM,CAAA;QACpB,QAAQ,EAAE,CACR,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC1C,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,KACjC,IAAI,CAAA;KACV,CAAA;IACD,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;QAC5C,kBAAkB,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,CAAA;QACnD,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,OAAO,CAAA;QAChB,UAAU,EACN,SAAS,GACT,UAAU,GACV,YAAY,GACZ,aAAa,GACb,SAAS,CAAA;QACb,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;KAC3C,CAAA;CACF,CAAA;AAED,aAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE;QACP,QAAQ,EAAE;YAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;QACnE,MAAM,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;QACzB,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,EAAE,CAAA;QACd,gBAAgB,EAAE,OAAO,CAAA;QACzB,WAAW,EAAE,CACX,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EACvC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,KACjC,IAAI,CAAA;KACV,CAAA;IACD,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;CAC7B,CAAA;AAqFD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2J3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge } from "../../components/ui/badge";
|
|
4
|
+
import { Button } from "../../components/ui/button";
|
|
5
|
+
import { Text } from "../../components/ui/text";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Price } from "../../components/ui/price";
|
|
8
|
+
import { Skeleton } from "../../components/ui/skeleton";
|
|
9
|
+
import { Favorite } from "../../components/ui/favorite";
|
|
10
|
+
import { cn } from "../../lib/utils";
|
|
11
|
+
import { cva } from "class-variance-authority";
|
|
12
|
+
const aspectScalingVariants = cva("w-full", {
|
|
13
|
+
variants: {
|
|
14
|
+
aspectRatio: {
|
|
15
|
+
"1:1": "aspect-square",
|
|
16
|
+
"2:3": "aspect-[2/3]",
|
|
17
|
+
"4:5": "aspect-[4/5]",
|
|
18
|
+
},
|
|
19
|
+
scaling: {
|
|
20
|
+
fill: "object-cover",
|
|
21
|
+
fit: "object-contain",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
aspectRatio: "2:3",
|
|
26
|
+
scaling: "fill",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const badgeVariants = cva("absolute", {
|
|
30
|
+
variants: {
|
|
31
|
+
horizontalPosition: {
|
|
32
|
+
left: "left-0",
|
|
33
|
+
right: "right-0",
|
|
34
|
+
"full-width": "",
|
|
35
|
+
},
|
|
36
|
+
verticalPosition: {
|
|
37
|
+
top: "top-0 mt-2",
|
|
38
|
+
bottom: "bottom-0 mb-2",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const favoriteVariants = cva("absolute ", {
|
|
43
|
+
variants: {
|
|
44
|
+
iconPosition: {
|
|
45
|
+
topLeft: "top-0 left-2 mt-2",
|
|
46
|
+
topRight: "top-0 right-2 mt-2",
|
|
47
|
+
bottomLeft: "bottom-0 left-2 mb-2",
|
|
48
|
+
bottomRight: "bottom-0 right-2 mb-2",
|
|
49
|
+
default: "",
|
|
50
|
+
},
|
|
51
|
+
badgeHorizontalPosition: {
|
|
52
|
+
left: "",
|
|
53
|
+
right: "",
|
|
54
|
+
"full-width": "",
|
|
55
|
+
},
|
|
56
|
+
badgeVerticalPosition: {
|
|
57
|
+
top: "",
|
|
58
|
+
bottom: "",
|
|
59
|
+
below: "",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
compoundVariants: [
|
|
63
|
+
{
|
|
64
|
+
iconPosition: "topLeft",
|
|
65
|
+
badgeHorizontalPosition: ["left", "full-width"],
|
|
66
|
+
badgeVerticalPosition: "top",
|
|
67
|
+
class: "top-10",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
iconPosition: "topRight",
|
|
71
|
+
badgeHorizontalPosition: ["right", "full-width"],
|
|
72
|
+
badgeVerticalPosition: "top",
|
|
73
|
+
class: "top-10",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
iconPosition: "bottomLeft",
|
|
77
|
+
badgeHorizontalPosition: ["left", "full-width"],
|
|
78
|
+
badgeVerticalPosition: "bottom",
|
|
79
|
+
class: "bottom-10",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
iconPosition: "bottomRight",
|
|
83
|
+
badgeHorizontalPosition: ["right", "full-width"],
|
|
84
|
+
badgeVerticalPosition: "bottom",
|
|
85
|
+
class: "bottom-10",
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
defaultVariants: {
|
|
89
|
+
iconPosition: "default",
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
const ProductCard = ({ config, product, isLoading, favorited, onFavoriteClick, }) => {
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
94
|
+
const { variants: [variant], images: [{ url }], title, tags, } = product;
|
|
95
|
+
const [isSelected, setIsSelected] = React.useState(false);
|
|
96
|
+
const handleFavoriteClick = () => {
|
|
97
|
+
setIsSelected((prevState) => !prevState);
|
|
98
|
+
};
|
|
99
|
+
const iconPosition = ((_a = config.favoritesIcon) === null || _a === void 0 ? void 0 : _a.layoutType) || "default";
|
|
100
|
+
if (isLoading) {
|
|
101
|
+
return (_jsxs("div", Object.assign({ className: "w-1/2 rounded" }, { children: [_jsx(Skeleton, { className: "w-full h-64 rounded" }, void 0), _jsx(Skeleton, { className: "h-6 w-1/2 mt-2 rounded" }, void 0), _jsx(Skeleton, { className: "h-4 w-full mt-2 rounded" }, void 0)] }), void 0));
|
|
102
|
+
}
|
|
103
|
+
return (_jsx("div", { children: _jsxs("div", { children: [((_b = config.productImage) === null || _b === void 0 ? void 0 : _b.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
|
|
104
|
+
borderTopLeftRadius: `${config.productImage.cornerRadius}px`,
|
|
105
|
+
borderTopRightRadius: `${config.productImage.cornerRadius}px`,
|
|
106
|
+
} }, { children: [_jsx("img", { className: cn(aspectScalingVariants({
|
|
107
|
+
aspectRatio: (_c = config.productImage) === null || _c === void 0 ? void 0 : _c.aspectRatio,
|
|
108
|
+
scaling: config.productImage.scaling,
|
|
109
|
+
})), src: url, onClick: (e) => product.openProduct(e, product) }, void 0), config.badge &&
|
|
110
|
+
tags.includes(config.badge.text) &&
|
|
111
|
+
config.badge.verticalPosition !== "below" && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(badgeVariants({
|
|
112
|
+
verticalPosition: config.badge.verticalPosition,
|
|
113
|
+
horizontalPosition: config.badge.horizontalPosition,
|
|
114
|
+
})), alignment: config.badge.horizontalPosition, icon: config.badge.icon }, { children: config.badge.text }), void 0)), ((_d = config.favoritesIcon) === null || _d === void 0 ? void 0 : _d.enabled) && iconPosition !== "default" && (_jsx(Favorite, { className: cn(favoriteVariants({
|
|
115
|
+
iconPosition,
|
|
116
|
+
badgeHorizontalPosition: (_e = config === null || config === void 0 ? void 0 : config.badge) === null || _e === void 0 ? void 0 : _e.horizontalPosition,
|
|
117
|
+
badgeVerticalPosition: (_f = config === null || config === void 0 ? void 0 : config.badge) === null || _f === void 0 ? void 0 : _f.verticalPosition,
|
|
118
|
+
})), selected: favorited, onClick: onFavoriteClick || handleFavoriteClick }, void 0))] }), void 0)), ((_g = config.quickAdd) === null || _g === void 0 ? void 0 : _g.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
|
|
119
|
+
borderBottomLeftRadius: `${config.quickAdd.cornerRadius}px`,
|
|
120
|
+
borderBottomRightRadius: `${config.quickAdd.cornerRadius}px`,
|
|
121
|
+
}, variant: "quickadd", size: "default", onClick: (e) => {
|
|
122
|
+
var _a;
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
(_a = config.quickAdd) === null || _a === void 0 ? void 0 : _a.quickAdd(e, product);
|
|
125
|
+
} }, { children: "+ Quick add" }), void 0)), _jsxs("div", Object.assign({ className: "mt-2 w-full flex-col justify-start items-start gap-1 inline-flex" }, { children: [config.badge &&
|
|
126
|
+
tags.includes(config.badge.text) &&
|
|
127
|
+
config.badge.verticalPosition === "below" && (_jsx("div", Object.assign({ className: `w-full flex ${config.badge.horizontalPosition === "right"
|
|
128
|
+
? "justify-end"
|
|
129
|
+
: "justify-start"}` }, { children: _jsx(Badge, Object.assign({ size: "plp-layout", alignment: config.badge.horizontalPosition, icon: config.badge.icon, className: "rounded" }, { children: config.badge.text }), void 0) }), void 0)), _jsxs("div", Object.assign({ className: "flex w-full justify-between items-center gap-2" }, { children: [((_h = config.price) === null || _h === void 0 ? void 0 : _h.enabled) && (_jsx(Price, { price: variant.price, isSale: !!variant.compare_at_price, compareAtPrice: variant.compare_at_price, currency: config.price.currency, locale: config.price.locale }, void 0)), _jsx("div", Object.assign({ className: "w-8 h-8 flex items-center justify-center" }, { children: ((_j = config.favoritesIcon) === null || _j === void 0 ? void 0 : _j.enabled) &&
|
|
130
|
+
config.favoritesIcon.layoutType === "default" && (_jsx(Favorite, { selected: isSelected, onClick: handleFavoriteClick, size: "small" }, void 0)) }), void 0)] }), void 0), ((_k = config.productTitle) === null || _k === void 0 ? void 0 : _k.enabled) && (_jsx("div", { children: _jsx(Text, Object.assign({ type: "body-secondary", className: "text-textColors-productTitle" }, { children: title }), void 0) }, void 0))] }), void 0)] }, void 0) }, void 0));
|
|
131
|
+
};
|
|
132
|
+
export { ProductCard };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare type Product = any;
|
|
2
|
+
interface PageData {
|
|
3
|
+
products: Product[];
|
|
4
|
+
cursorBlob?: string;
|
|
5
|
+
}
|
|
6
|
+
interface ProductGridItemsProps {
|
|
7
|
+
initialData: PageData[];
|
|
8
|
+
loadMoreProducts: (params: any) => Promise<PageData>;
|
|
9
|
+
queryVariables: Record<string, any>;
|
|
10
|
+
config: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
declare function ProductGrid({ loadMoreProducts, initialData, queryVariables, config, }: ProductGridItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { ProductGrid };
|
|
14
|
+
//# sourceMappingURL=product-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/product-grid.tsx"],"names":[],"mappings":"AAkBA,aAAK,OAAO,GAAG,GAAG,CAAA;AAClB,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,QAAQ,EAAE,CAAA;IACvB,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5B;AAED,iBAAS,WAAW,CAAC,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,MAAM,GACP,EAAE,qBAAqB,2CAmCvB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useInfiniteScroll } from "../../components/hooks/use-infinite-scroll";
|
|
4
|
+
import { ProductCard } from "./product-card";
|
|
5
|
+
const Loader = () => (_jsx("div", Object.assign({ className: "grid-cols-2 lg:grid-cols-3" }, { children: Array(4)
|
|
6
|
+
.fill(0)
|
|
7
|
+
.map((_, index) => (_jsx("div", { className: "aspect-[2/3] animate-pulse bg-neutral-100 dark:bg-neutral-900" }, index))) }), void 0));
|
|
8
|
+
function ProductGrid({ loadMoreProducts, initialData, queryVariables, config, }) {
|
|
9
|
+
const { data, error, isLoadingInitialData, isLoadingMore, isEmpty, isReachingEnd, ref, products, } = useInfiniteScroll({
|
|
10
|
+
initialData,
|
|
11
|
+
loadMoreProducts,
|
|
12
|
+
queryVariables,
|
|
13
|
+
});
|
|
14
|
+
if (error)
|
|
15
|
+
return _jsx("div", { children: "Failed to load data" }, void 0);
|
|
16
|
+
if (isLoadingInitialData)
|
|
17
|
+
return _jsx(Loader, {}, void 0);
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "grid-cols-2 lg:grid-cols-3" }, { children: products.map((product, i) => (_jsx(ProductCard, {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
product: product, config: config, isLoading: false }, product.handle))) }), void 0), isLoadingMore ? _jsx(Loader, {}, void 0) : _jsx("div", { ref: ref }, void 0)] }, void 0));
|
|
21
|
+
}
|
|
22
|
+
export { ProductGrid };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export interface RadioGroupItemProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
subtext?: string;
|
|
8
|
+
numberAmount?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
onSelect?: React.ReactEventHandler;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
declare const radiogroupItemVariants: (props?: ({
|
|
15
|
+
variant?: "selected" | "default" | "deactivated" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
17
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & RadioGroupItemProps & VariantProps<(props?: ({
|
|
18
|
+
variant?: "selected" | "default" | "deactivated" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
|
|
21
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../components/ui/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAElE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,UAAU,+JAWd,CAAA;AAGF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,sBAAsB;;mFAc3B,CAAA;AA6BD,QAAA,MAAM,cAAc;;8HA8EnB,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
17
|
+
import { cn } from "../../lib/utils";
|
|
18
|
+
import { Icon } from "./icon";
|
|
19
|
+
import { Text } from "./text";
|
|
20
|
+
const RadioGroup = React.forwardRef((_a, ref) => {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx(RadioGroupPrimitive.Root, Object.assign({ className: cn("grid gap-2", className) }, props, { ref: ref }), void 0));
|
|
23
|
+
});
|
|
24
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
25
|
+
const radiogroupItemVariants = cva("grid grid-cols-[auto,auto,1fr] gap-2 items-start group", {
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
default: "",
|
|
29
|
+
selected: "[&>div>button]:border-coreColors-brandColorPrimary",
|
|
30
|
+
deactivated: "[&_p]:text-stateColors-disabled",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
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 mb-2" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled mr-2" }, { children: label }), void 0), numberAmount ?
|
|
38
|
+
_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled" }, { children: `(${numberAmount})` }), void 0)
|
|
39
|
+
: null] }), void 0), subtext ?
|
|
40
|
+
_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled" }, { children: subtext }), void 0)
|
|
41
|
+
: null] }), void 0));
|
|
42
|
+
const RadioGroupItem = React.forwardRef((_a, ref) => {
|
|
43
|
+
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"]);
|
|
44
|
+
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" }, void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }, void 0)) : (_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" }, void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }), void 0)) : (_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" }, void 0) }), void 0), _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" }, void 0) }), void 0)] }), void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }), void 0)) }), void 0)) }), void 0));
|
|
45
|
+
});
|
|
46
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
47
|
+
export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
declare type Orientation = "horizontal" | "vertical";
|
|
4
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
6
|
+
orientation?: Orientation | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { ScrollArea, ScrollBar };
|
|
9
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../components/ui/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAIlE,aAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAA;AAE5C,QAAA,MAAM,UAAU,+JAed,CAAA;AAGF,QAAA,MAAM,SAAS;;wCAuBb,CAAA;AAGF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
const ScrollArea = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
19
|
+
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ ref: ref, className: cn("relative overflow-hidden", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, Object.assign({ className: "h-full w-full rounded-[inherit]" }, { children: _jsx("div", Object.assign({ className: "flex w-max px-[16px]" }, { children: children }), void 0) }), void 0), _jsx(ScrollBar, {}, void 0), _jsx(ScrollAreaPrimitive.Corner, {}, void 0)] }), void 0));
|
|
20
|
+
});
|
|
21
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
22
|
+
const ScrollBar = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className, orientation = "horizontal" } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
24
|
+
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, Object.assign({ ref: ref, orientation: orientation, className: cn("flex touch-none select-none transition-colors", orientation === "vertical" &&
|
|
25
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" &&
|
|
26
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px] ", className) }, props, { children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" }, void 0) }), void 0));
|
|
27
|
+
});
|
|
28
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
29
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const selectorsVariants: (props?: ({
|
|
4
|
+
selected?: boolean | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare type SelectorsProps = React.ComponentPropsWithoutRef<"button"> & VariantProps<typeof selectorsVariants> & {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
key?: string;
|
|
12
|
+
onSelect?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
15
|
+
selected?: boolean | null | undefined;
|
|
16
|
+
disabled?: boolean | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
selected?: boolean | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
key?: string | undefined;
|
|
22
|
+
onSelect?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
23
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
declare type SelectorContainerProps = {
|
|
25
|
+
children: React.ReactElement<SelectorsProps>[];
|
|
26
|
+
containerRef: React.RefObject<HTMLButtonElement>;
|
|
27
|
+
};
|
|
28
|
+
declare const SelectorContainer: React.FC<SelectorContainerProps>;
|
|
29
|
+
export { SelectorContainer, Selectors, selectorsVariants };
|
|
30
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +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,aAAK,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,aAAK,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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Text } from "./text";
|
|
18
|
+
const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pageColor flex-row justify-center outline outline-1 rounded text-textColors-primaryColor outline-coreColors-dividingLines items-center", {
|
|
19
|
+
variants: {
|
|
20
|
+
selected: {
|
|
21
|
+
true: "outline-coreColors-brandColorPrimary",
|
|
22
|
+
false: "",
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
true: "[&>p]:!line-through [&>p]:text-stateColors-disabled",
|
|
26
|
+
false: "cursor-pointer active:outline-coreColors-brandColorPrimary",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
selected: false,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const Selectors = React.forwardRef((_a, ref) => {
|
|
34
|
+
var { label, selected, disabled = false, className, onSelect } = _a, props = __rest(_a, ["label", "selected", "disabled", "className", "onSelect"]);
|
|
35
|
+
return (_jsx("button", Object.assign({ disabled: disabled, onClick: onSelect, className: cn(selectorsVariants({
|
|
36
|
+
selected: selected,
|
|
37
|
+
className,
|
|
38
|
+
disabled,
|
|
39
|
+
}), "group"), ref: ref }, props, { children: _jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label }), void 0) }), void 0));
|
|
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))) }), void 0));
|
|
43
|
+
};
|
|
44
|
+
Selectors.displayName = "Selectors";
|
|
45
|
+
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../components/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAI/D,QAAA,MAAM,SAAS,6JAoBd,CAAA;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
const Separator = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, orientation = "horizontal", decorative = true } = _a, props = __rest(_a, ["className", "orientation", "decorative"]);
|
|
19
|
+
return (_jsx(SeparatorPrimitive.Root, Object.assign({ ref: ref, decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className) }, props), void 0));
|
|
20
|
+
});
|
|
21
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
|
+
export { Separator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const skeletonVariants: (props?: ({
|
|
4
|
+
variant?: "circle" | "line" | "rectangular" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
declare function Skeleton({ className, variant, height, width, borderRadius, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Skeleton };
|
|
13
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../components/ui/skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,gBAAgB;;mFAYrB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,YAAgB,EAChB,GAAG,KAAK,EACT,EAAE,aAAa,2CAYf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton h-10 w-10 rounded-[4px]", {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
line: "",
|
|
19
|
+
rectangular: "",
|
|
20
|
+
circle: "rounded-full",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { variant: "line" },
|
|
24
|
+
});
|
|
25
|
+
function Skeleton(_a) {
|
|
26
|
+
var { className, variant, height, width, borderRadius = 4 } = _a, props = __rest(_a, ["className", "variant", "height", "width", "borderRadius"]);
|
|
27
|
+
return (_jsx("div", Object.assign({ className: cn(skeletonVariants({ variant }), className), style: {
|
|
28
|
+
width: width,
|
|
29
|
+
height: height,
|
|
30
|
+
borderRadius: variant === "rectangular" ? borderRadius : "",
|
|
31
|
+
} }, props), void 0));
|
|
32
|
+
}
|
|
33
|
+
export { Skeleton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
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") }, void 0) }), void 0));
|
|
20
|
+
});
|
|
21
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
22
|
+
export { Switch };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
tabs: {
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}[];
|
|
7
|
+
activeTab: number;
|
|
8
|
+
onTabChange: (_: number) => void;
|
|
9
|
+
active?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Tabs };
|
|
13
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAiCD,QAAA,MAAM,IAAI,kFAyGT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|