@tapcart/mobile-components 0.4.4 → 0.4.7
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 +3 -1
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-infinite-scroll.js +43 -72
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +2 -1
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +6 -2
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +39 -7
- package/dist/components/ui/product-card.d.ts +2 -1
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +14 -12
- package/dist/components/ui/selectors.d.ts +1 -0
- package/dist/components/ui/selectors.d.ts.map +1 -1
- package/dist/components/ui/selectors.js +4 -4
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +6 -5
- package/dist/components/ui/slider.js +1 -1
- package/dist/styles.css +155 -3
- package/package.json +16 -16
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
1
2
|
interface Product {
|
|
2
3
|
handle: string;
|
|
3
4
|
}
|
|
@@ -23,7 +24,8 @@ interface UseInfiniteScrollReturn {
|
|
|
23
24
|
isLoading: boolean;
|
|
24
25
|
isValidating: boolean;
|
|
25
26
|
}
|
|
26
|
-
declare const
|
|
27
|
+
export declare const formatSearchParamsAsNextQueryVariables: (searchParams: ReadonlyURLSearchParams) => {};
|
|
28
|
+
declare const constructURL: (apiURL: string) => string;
|
|
27
29
|
declare const useInfiniteScroll: ({ initialData, queryVariables: queryVariableProps, }: UseInfiniteScrollProps) => UseInfiniteScrollReturn;
|
|
28
30
|
export { useInfiniteScroll, constructURL };
|
|
29
31
|
//# sourceMappingURL=use-infinite-scroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAmB,MAAM,iBAAiB,CAAA;AAE1E,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAOD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,QAAQ,CAAA;IACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACpC;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,eAAO,MAAM,sCAAsC,iBACnC,uBAAuB,OAsBtC,CAAA;AAED,QAAA,MAAM,YAAY,WAAY,MAAM,WAGnC,CAAA;AAED,QAAA,MAAM,iBAAiB,yDAGpB,sBAAsB,KAAG,uBA4F3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -3,94 +3,65 @@ import { useCallback, useEffect, useMemo } from "react";
|
|
|
3
3
|
import useSWRInfinite from "swr/infinite";
|
|
4
4
|
import { useInView } from "react-intersection-observer";
|
|
5
5
|
import { useSearchParams } from "next/navigation";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
filtersArray === null || filtersArray === void 0 ? void 0 : filtersArray.forEach((filter) => {
|
|
18
|
-
selectedTags.set(filter, true);
|
|
19
|
-
});
|
|
20
|
-
const matchingFilters = (filtersList, selectedTags) => {
|
|
21
|
-
return filtersList.filter((filter) => {
|
|
22
|
-
if (!(filter === null || filter === void 0 ? void 0 : filter.tag))
|
|
23
|
-
return false;
|
|
24
|
-
const parsedFilter = filter.tag;
|
|
25
|
-
return selectedTags.has(parsedFilter);
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
const searchFilters = (filtersData === null || filtersData === void 0 ? void 0 : filtersData.map((category) => {
|
|
29
|
-
const filterList = category.filters;
|
|
30
|
-
const matchingFiltersList = matchingFilters(filterList, selectedTags);
|
|
31
|
-
return Object.assign(Object.assign({}, category), { filters: matchingFiltersList });
|
|
32
|
-
})) || [];
|
|
33
|
-
return {
|
|
34
|
-
searchFilters,
|
|
35
|
-
filtersData,
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
const constructURL = (params, apiURL) => {
|
|
39
|
-
const url = new URL(apiURL);
|
|
40
|
-
Object.keys(params).forEach((key) => {
|
|
41
|
-
const value = params[key];
|
|
42
|
-
if (value !== undefined && value !== null) {
|
|
43
|
-
if (typeof value === "string") {
|
|
44
|
-
url.searchParams.append(key, value);
|
|
6
|
+
export const formatSearchParamsAsNextQueryVariables = (searchParams) => {
|
|
7
|
+
const formattedParams = {};
|
|
8
|
+
if (!searchParams)
|
|
9
|
+
return formattedParams;
|
|
10
|
+
searchParams.forEach((value, key) => {
|
|
11
|
+
//@ts-expect-error
|
|
12
|
+
if (formattedParams[key]) {
|
|
13
|
+
//@ts-expect-error
|
|
14
|
+
if (Array.isArray(formattedParams[key])) {
|
|
15
|
+
//@ts-expect-error
|
|
16
|
+
formattedParams[key].push(value);
|
|
45
17
|
}
|
|
46
18
|
else {
|
|
47
|
-
|
|
19
|
+
//@ts-expect-error
|
|
20
|
+
formattedParams[key] = [formattedParams[key], value];
|
|
48
21
|
}
|
|
49
22
|
}
|
|
23
|
+
else {
|
|
24
|
+
//@ts-expect-error
|
|
25
|
+
formattedParams[key] = value;
|
|
26
|
+
}
|
|
50
27
|
});
|
|
51
|
-
return
|
|
28
|
+
return formattedParams;
|
|
52
29
|
};
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return constructURL(queryVariables, apiURL);
|
|
57
|
-
if (!previousPageData || !((_a = previousPageData.pageData) === null || _a === void 0 ? void 0 : _a.cursorBlob))
|
|
58
|
-
return null;
|
|
59
|
-
return constructURL(Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob }), apiURL);
|
|
30
|
+
const constructURL = (apiURL) => {
|
|
31
|
+
const url = new URL(apiURL);
|
|
32
|
+
return url.toString();
|
|
60
33
|
};
|
|
61
34
|
const useInfiniteScroll = ({ initialData, queryVariables: queryVariableProps, }) => {
|
|
62
|
-
var _a, _b, _c, _d;
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
63
36
|
const searchParams = useSearchParams();
|
|
64
|
-
const sortStateFromParam = useCallback(() => {
|
|
65
|
-
return (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("sort"))
|
|
66
|
-
? parseSort(searchParams.get("sort"))
|
|
67
|
-
: // we need to default to the sort option from the query variables so that the initial sort is correct
|
|
68
|
-
queryVariableProps.sortOption;
|
|
69
|
-
}, [queryVariableProps.sortOption, searchParams]);
|
|
70
|
-
const selectedFilters = (searchParams === null || searchParams === void 0 ? void 0 : searchParams.get("filters")) || "[]";
|
|
71
|
-
const queryVariables = useMemo(() => {
|
|
72
|
-
return Object.assign(Object.assign({}, queryVariableProps), { sortOption: sortStateFromParam(), filterCategories: reconcileFilters({
|
|
73
|
-
selectedFilters,
|
|
74
|
-
filtersData: initialData.filtersData,
|
|
75
|
-
}).searchFilters });
|
|
76
|
-
}, [
|
|
77
|
-
initialData.filtersData,
|
|
78
|
-
queryVariableProps,
|
|
79
|
-
selectedFilters,
|
|
80
|
-
sortStateFromParam,
|
|
81
|
-
]);
|
|
82
37
|
const { ref, inView } = useInView({ rootMargin: "600px" }); // controls how early the next page loads
|
|
83
|
-
const
|
|
84
|
-
|
|
38
|
+
const queryVariables = useMemo(() => {
|
|
39
|
+
const formattedParams = formatSearchParamsAsNextQueryVariables(searchParams);
|
|
40
|
+
return Object.assign(Object.assign({}, queryVariableProps), { searchParams: formattedParams });
|
|
41
|
+
}, [queryVariableProps, searchParams]);
|
|
42
|
+
const getKey = (pageIndex, previousPageData, queryVariables) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (pageIndex === 0) {
|
|
45
|
+
return Object.assign({}, queryVariables);
|
|
46
|
+
}
|
|
47
|
+
if (!previousPageData || !((_a = previousPageData.pageData) === null || _a === void 0 ? void 0 : _a.cursorBlob))
|
|
48
|
+
return null;
|
|
49
|
+
return Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob });
|
|
50
|
+
};
|
|
51
|
+
const fetcher = (body) => fetch(constructURL(initialData.apiURL), {
|
|
52
|
+
method: "POST",
|
|
53
|
+
body: JSON.stringify(body),
|
|
54
|
+
}).then((res) => res.json());
|
|
55
|
+
const { data, error, size, setSize, isLoading, isValidating, } = useSWRInfinite((pageIndex, previousPageData) => getKey(pageIndex, previousPageData, queryVariables), fetcher, {
|
|
85
56
|
revalidateFirstPage: false,
|
|
86
57
|
initialSize: 1,
|
|
87
58
|
});
|
|
88
59
|
const isLoadingInitialData = !data && !error;
|
|
89
60
|
const isLoadingMore = isLoadingInitialData ||
|
|
90
61
|
(size > 0 && data && typeof data[size - 1] === "undefined");
|
|
91
|
-
const isEmpty = ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.products) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
62
|
+
const isEmpty = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.products) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) === 0;
|
|
92
63
|
const isEndPointer = data
|
|
93
|
-
? !((
|
|
64
|
+
? !((_e = (_d = data[data.length - 1]) === null || _d === void 0 ? void 0 : _d.pageData) === null || _e === void 0 ? void 0 : _e.cursorBlob)
|
|
94
65
|
: true;
|
|
95
66
|
const isReachingEnd = isEmpty || isEndPointer;
|
|
96
67
|
const isRefreshing = isValidating && data && data.length === size;
|
|
@@ -113,7 +84,7 @@ const useInfiniteScroll = ({ initialData, queryVariables: queryVariableProps, })
|
|
|
113
84
|
isReachingEnd,
|
|
114
85
|
ref,
|
|
115
86
|
products: data ? data === null || data === void 0 ? void 0 : data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products) : [],
|
|
116
|
-
isLoading:
|
|
87
|
+
isLoading: isLoading,
|
|
117
88
|
isValidating,
|
|
118
89
|
};
|
|
119
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../components/ui/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAIhD,QAAA,MAAM,aAAa,+HAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,8DAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,6HAAwB,CAAA;AAEzC,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAAyC,WAAW;;CAE/D,CAAA;AAGD,QAAA,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../components/ui/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAIhD,QAAA,MAAM,aAAa,+HAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,8DAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,6HAAwB,CAAA;AAEzC,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAAyC,WAAW;;CAE/D,CAAA;AAGD,QAAA,MAAM,aAAa;;wCAejB,CAAA;AAGF,QAAA,MAAM,iBAAiB;;;;;;wCA0CtB,CAAA;AA0BD,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,iBAAiB,+LASrB,CAAA;AAGF,KAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,0DAKf,iBAAiB,4CAoBnB,CAAA;AAED,QAAA,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAE/D,CAAA;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,CAAA"}
|
|
@@ -25,7 +25,8 @@ const Drawer = (_a) => {
|
|
|
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
|
-
|
|
28
|
+
const style = { backgroundColor: `${backdropHexColor}CC` };
|
|
29
|
+
return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: style, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props)));
|
|
29
30
|
});
|
|
30
31
|
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
31
32
|
const DrawerContentBase = React.forwardRef((_a, ref) => {
|
|
@@ -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,EAEL,eAAe,
|
|
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,EAkChB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAsDD,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,7 +11,7 @@ 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, 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, IconSearch, } from "@tabler/icons-react";
|
|
14
|
+
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 } from "@tabler/icons-react";
|
|
15
15
|
import { cn, iconColorVariantClasses } from "../../lib/utils";
|
|
16
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", {
|
|
17
17
|
variants: {
|
|
@@ -70,7 +70,11 @@ const icons = {
|
|
|
70
70
|
"square-x-filled": IconSquareXFilled,
|
|
71
71
|
trash: IconTrash,
|
|
72
72
|
loader: IconLoader2,
|
|
73
|
-
"
|
|
73
|
+
"columns-1": IconColumns1,
|
|
74
|
+
"columns-2": IconColumns2,
|
|
75
|
+
"columns-3": IconColumns3,
|
|
76
|
+
search: IconSearch,
|
|
77
|
+
"shopping-cart-off": IconShoppingCartOff,
|
|
74
78
|
};
|
|
75
79
|
function Icon(_a) {
|
|
76
80
|
var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"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"}
|
|
@@ -9,10 +9,27 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
/* eslint-disable react/display-name */
|
|
14
14
|
/* eslint-disable @next/next/no-img-element */
|
|
15
15
|
import * as React from "react";
|
|
16
|
+
import ReactDOM from "react-dom";
|
|
17
|
+
function ImagePreload({ imgAttributes }) {
|
|
18
|
+
const opts = {
|
|
19
|
+
as: "image",
|
|
20
|
+
imageSrcSet: imgAttributes.srcSet,
|
|
21
|
+
imageSizes: imgAttributes.sizes,
|
|
22
|
+
fetchPriority: imgAttributes.fetchPriority,
|
|
23
|
+
};
|
|
24
|
+
if (ReactDOM.preload) {
|
|
25
|
+
// See https://github.com/facebook/react/pull/26940
|
|
26
|
+
ReactDOM.preload(imgAttributes.src,
|
|
27
|
+
// @ts-expect-error TODO: upgrade to `@types/react-dom@18.3.x`
|
|
28
|
+
opts);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
16
33
|
/**
|
|
17
34
|
* Tapcart’s Image component is a wrapper around the HTML image element.
|
|
18
35
|
* It supports the same props as the HTML `img` element, but automatically
|
|
@@ -100,6 +117,7 @@ export const Image = React.forwardRef((_a, ref) => {
|
|
|
100
117
|
: objectFit === "fit"
|
|
101
118
|
? "contain"
|
|
102
119
|
: objectFit;
|
|
120
|
+
const nFetchPriority = loading === "eager" ? "high" : "auto";
|
|
103
121
|
return {
|
|
104
122
|
width: nWidth,
|
|
105
123
|
height: nHeight,
|
|
@@ -107,6 +125,7 @@ export const Image = React.forwardRef((_a, ref) => {
|
|
|
107
125
|
alt: nAlt,
|
|
108
126
|
aspectRatio: nAspectRatio,
|
|
109
127
|
objectFit: nObjectFit,
|
|
128
|
+
fetchPriority: nFetchPriority,
|
|
110
129
|
};
|
|
111
130
|
}, [
|
|
112
131
|
width,
|
|
@@ -136,12 +155,25 @@ export const Image = React.forwardRef((_a, ref) => {
|
|
|
136
155
|
};
|
|
137
156
|
const imgClassName = `opacity-0 transition-opacity duration-500 ease-in-out ${isLoaded ? "opacity-100" : ""}`;
|
|
138
157
|
const wrapperStyle = Object.assign({ aspectRatio: (_b = normalizedProps.aspectRatio) === null || _b === void 0 ? void 0 : _b.replace(":", "/") }, imageWrapperStyles);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
158
|
+
const srcSet = generateSrcSet(normalizedProps.src, generateSizes(imageWidths, normalizedProps.aspectRatio, crop), loader, normalizedProps.objectFit === "contain");
|
|
159
|
+
return (_jsxs(_Fragment, { children: [loading === "eager" && (_jsx(ImagePreload, { imgAttributes: {
|
|
160
|
+
srcSet,
|
|
161
|
+
sizes,
|
|
162
|
+
fetchPriority: normalizedProps.fetchPriority,
|
|
163
|
+
src: normalizedProps.src || "",
|
|
164
|
+
} })), _jsx("div", Object.assign({ className: "relative bg-stateColors-skeleton border-transparent", style: wrapperStyle }, { children: !hasError && normalizedProps.src ? (_jsx("img", Object.assign({}, passthroughProps, { fetchPriority: normalizedProps.fetchPriority, alt: normalizedProps.alt, decoding: decoding, height: normalizedProps.height, loading: loading, srcSet: srcSet, width: normalizedProps.width, className: imgClassName, onLoad: handleImageLoad, onError: handleImageError, sizes: sizes,
|
|
165
|
+
// `src` needs to come after `sizes` and `srcSet` because React updates
|
|
166
|
+
// attributes in order. If we keep `src` the first one, Safari will
|
|
167
|
+
// immediately start to fetch `src`, before `sizes` and `srcSet` are even
|
|
168
|
+
// updated by React. That causes multiple unnecessary requests if `srcSet`
|
|
169
|
+
// and `sizes` are defined.
|
|
170
|
+
// This bug cannot be reproduced in Chrome or Firefox.
|
|
171
|
+
src: normalizedProps.src, ref: ref, style: {
|
|
172
|
+
objectFit: normalizedProps.objectFit,
|
|
173
|
+
maxHeight: "100%",
|
|
174
|
+
height: "100%",
|
|
175
|
+
width: "100%",
|
|
176
|
+
} }))) : (_jsx("div", { className: "absolute top-0 left-0 w-full h-full bg-stateColors-skeleton " })) }))] }));
|
|
145
177
|
});
|
|
146
178
|
/**
|
|
147
179
|
* The shopifyLoader function is a simple utility function that takes a src, width,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Product } from "app-studio-types";
|
|
3
3
|
type Config = {
|
|
4
|
-
|
|
4
|
+
columns?: string;
|
|
5
5
|
productImage?: {
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
cornerRadius: number;
|
|
@@ -80,6 +80,7 @@ export type ProductCardProps = {
|
|
|
80
80
|
productId: string;
|
|
81
81
|
variantId?: string;
|
|
82
82
|
}) => void;
|
|
83
|
+
className?: string;
|
|
83
84
|
};
|
|
84
85
|
declare const ProductCard: React.FC<ProductCardProps>;
|
|
85
86
|
export { ProductCard };
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"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"}
|
|
@@ -133,8 +133,8 @@ const productCardFavoriteVariants = cva("absolute ", {
|
|
|
133
133
|
iconPosition: "below-image-on-right",
|
|
134
134
|
},
|
|
135
135
|
});
|
|
136
|
-
const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFavoriteClick, onQuickAdd, openProduct, }) => {
|
|
137
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17
|
|
136
|
+
const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFavoriteClick, onQuickAdd, openProduct, className, }) => {
|
|
137
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
|
|
138
138
|
const { variants, images, title, tags } = product;
|
|
139
139
|
// Select the variant that has the lowest price that is available or just the lowest price if none are available
|
|
140
140
|
let searchVariants = variants.filter((variant) => variant.available);
|
|
@@ -172,12 +172,12 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
|
|
|
172
172
|
// Prepare Product Open
|
|
173
173
|
const _openProduct = () => openProduct === null || openProduct === void 0 ? void 0 : openProduct({ productId, variantId });
|
|
174
174
|
const getImageSizes = (config) => {
|
|
175
|
-
switch (config.
|
|
176
|
-
case "
|
|
175
|
+
switch (config.columns) {
|
|
176
|
+
case "1":
|
|
177
177
|
return "100vw";
|
|
178
|
-
case "
|
|
178
|
+
case "2":
|
|
179
179
|
return "50vw";
|
|
180
|
-
case "
|
|
180
|
+
case "3":
|
|
181
181
|
return "33vw";
|
|
182
182
|
default:
|
|
183
183
|
return "100vw";
|
|
@@ -185,7 +185,7 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
|
|
|
185
185
|
};
|
|
186
186
|
const sizes = getImageSizes(config);
|
|
187
187
|
const imageSwipeEnabled = (((_e = config.productImage) === null || _e === void 0 ? void 0 : _e.allowSwipeability) && product.images.length > 1);
|
|
188
|
-
return (_jsx("div", Object.assign({ className:
|
|
188
|
+
return (_jsx("div", Object.assign({ className: cn("w-1/2", className) }, { children: _jsxs("div", Object.assign({ className: "w-full active:opacity-70", onClick: () => {
|
|
189
189
|
_openProduct();
|
|
190
190
|
} }, { children: [((_f = config.productImage) === null || _f === void 0 ? void 0 : _f.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
|
|
191
191
|
borderTopLeftRadius: `${config.productImage.cornerRadius}px`,
|
|
@@ -232,15 +232,17 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
|
|
|
232
232
|
"text-right": ((_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.textAlignment) === "right",
|
|
233
233
|
}, {
|
|
234
234
|
"text-center": ((_3 = config.productTitle) === null || _3 === void 0 ? void 0 : _3.textAlignment) === "center",
|
|
235
|
-
}, {
|
|
235
|
+
}, {
|
|
236
|
+
"line-clamp-2 whitespace-normal overflow-hidden text-ellipsis": (_4 = config.productTitle) === null || _4 === void 0 ? void 0 : _4.wrapText,
|
|
237
|
+
}, "text-textColors-productTitle"), style: { fontSize: (_5 = config.productTitle) === null || _5 === void 0 ? void 0 : _5.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end", { "justify-start": ((_6 = config.price) === null || _6 === void 0 ? void 0 : _6.textAlignment) === "left" }, { "justify-end": ((_7 = config.price) === null || _7 === void 0 ? void 0 : _7.textAlignment) === "right" }, { "justify-center": ((_8 = config.price) === null || _8 === void 0 ? void 0 : _8.textAlignment) === "center" }) }, { children: [((_9 = config.price) === null || _9 === void 0 ? void 0 : _9.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice &&
|
|
236
238
|
variant.compareAtPrice &&
|
|
237
|
-
parseFloat((
|
|
239
|
+
parseFloat((_10 = variant.compareAtPrice) === null || _10 === void 0 ? void 0 : _10.amount) >
|
|
238
240
|
parseFloat(variant.price.amount), compareAtPrice: variant.compareAtPrice &&
|
|
239
|
-
parseFloat((
|
|
241
|
+
parseFloat((_11 = variant.compareAtPrice) === null || _11 === void 0 ? void 0 : _11.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_12 = config.price) === null || _12 === void 0 ? void 0 : _12.fontSize })), ((_13 = config.favoritesIcon) === null || _13 === void 0 ? void 0 : _13.enabled) &&
|
|
240
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) => {
|
|
241
243
|
onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
|
|
242
|
-
}, size: "small", icon: ((
|
|
243
|
-
? (
|
|
244
|
+
}, size: "small", icon: ((_15 = (_14 = config.favoritesIcon) === null || _14 === void 0 ? void 0 : _14.icon) === null || _15 === void 0 ? void 0 : _15.type) === "internal"
|
|
245
|
+
? (_17 = (_16 = config.favoritesIcon) === null || _16 === void 0 ? void 0 : _16.icon) === null || _17 === void 0 ? void 0 : _17.url
|
|
244
246
|
: undefined }) })))] }))] }))] })) })));
|
|
245
247
|
};
|
|
246
248
|
export { ProductCard };
|
|
@@ -24,6 +24,7 @@ declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTML
|
|
|
24
24
|
type SelectorContainerProps = {
|
|
25
25
|
children: React.ReactElement<SelectorsProps>[];
|
|
26
26
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
27
|
+
className: string;
|
|
27
28
|
};
|
|
28
29
|
declare const SelectorContainer: React.FC<SelectorContainerProps>;
|
|
29
30
|
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;2CAyCpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IAC7C,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6CvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -31,14 +31,14 @@ const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pa
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
const Selectors = React.forwardRef((_a, ref) => {
|
|
34
|
-
var { label, selected, disabled = false, className, onSelect } = _a, props = __rest(_a, ["label", "selected", "disabled", "className", "onSelect"]);
|
|
34
|
+
var { label, selected, disabled = false, className, onSelect, children } = _a, props = __rest(_a, ["label", "selected", "disabled", "className", "onSelect", "children"]);
|
|
35
35
|
return (_jsx("button", Object.assign({ disabled: disabled, onClick: onSelect, className: cn(selectorsVariants({
|
|
36
36
|
selected: selected,
|
|
37
37
|
className,
|
|
38
38
|
disabled,
|
|
39
|
-
}), "group"), ref: ref }, props, { children: _jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label })) })));
|
|
39
|
+
}), "group"), ref: ref }, props, { children: children ? (children) : (_jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label }))) })));
|
|
40
40
|
});
|
|
41
|
-
const SelectorContainer = ({ children, containerRef, }) => {
|
|
41
|
+
const SelectorContainer = ({ children, containerRef, className, }) => {
|
|
42
42
|
const [showFadeLeft, setShowFadeLeft] = React.useState(false);
|
|
43
43
|
const [showFadeRight, setShowFadeRight] = React.useState(false);
|
|
44
44
|
const checkOverflow = () => {
|
|
@@ -55,7 +55,7 @@ const SelectorContainer = ({ children, containerRef, }) => {
|
|
|
55
55
|
React.useEffect(() => {
|
|
56
56
|
checkOverflow();
|
|
57
57
|
}, [children]);
|
|
58
|
-
return (_jsx("div", Object.assign({ className: "relative" }, { children: _jsxs("div", Object.assign({ className: "flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
|
|
58
|
+
return (_jsx("div", Object.assign({ className: "relative" }, { 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 bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
|
|
59
59
|
};
|
|
60
60
|
Selectors.displayName = "Selectors";
|
|
61
61
|
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -1 +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,
|
|
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,2CAaf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -24,10 +24,11 @@ const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton rounded
|
|
|
24
24
|
});
|
|
25
25
|
function Skeleton(_a) {
|
|
26
26
|
var { className, variant, height, width, borderRadius = 4 } = _a, props = __rest(_a, ["className", "variant", "height", "width", "borderRadius"]);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const style = {
|
|
28
|
+
width: width,
|
|
29
|
+
height: height,
|
|
30
|
+
borderRadius: variant === "rectangular" ? borderRadius : "",
|
|
31
|
+
};
|
|
32
|
+
return (_jsx("div", Object.assign({ className: cn(skeletonVariants({ variant }), className), style: style }, props)));
|
|
32
33
|
}
|
|
33
34
|
export { Skeleton };
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
|
-
import { Input } from "./Input";
|
|
17
|
+
import { Input } from "./Input/index";
|
|
18
18
|
const Slider = React.forwardRef((_a, ref) => {
|
|
19
19
|
var { className, max, min = 0, step = 1, defaultValue, value, onChange } = _a,
|
|
20
20
|
// doubleValue = false,
|
package/dist/styles.css
CHANGED
|
@@ -803,6 +803,9 @@ video {
|
|
|
803
803
|
.mb-2 {
|
|
804
804
|
margin-bottom: 0.5rem;
|
|
805
805
|
}
|
|
806
|
+
.mb-4 {
|
|
807
|
+
margin-bottom: 1rem;
|
|
808
|
+
}
|
|
806
809
|
.mb-6 {
|
|
807
810
|
margin-bottom: 1.5rem;
|
|
808
811
|
}
|
|
@@ -1081,6 +1084,18 @@ video {
|
|
|
1081
1084
|
.resize {
|
|
1082
1085
|
resize: both;
|
|
1083
1086
|
}
|
|
1087
|
+
.columns-1 {
|
|
1088
|
+
-moz-columns: 1;
|
|
1089
|
+
columns: 1;
|
|
1090
|
+
}
|
|
1091
|
+
.columns-2 {
|
|
1092
|
+
-moz-columns: 2;
|
|
1093
|
+
columns: 2;
|
|
1094
|
+
}
|
|
1095
|
+
.columns-3 {
|
|
1096
|
+
-moz-columns: 3;
|
|
1097
|
+
columns: 3;
|
|
1098
|
+
}
|
|
1084
1099
|
.grid-cols-1 {
|
|
1085
1100
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
1086
1101
|
}
|
|
@@ -1184,6 +1199,9 @@ video {
|
|
|
1184
1199
|
.text-ellipsis {
|
|
1185
1200
|
text-overflow: ellipsis;
|
|
1186
1201
|
}
|
|
1202
|
+
.whitespace-normal {
|
|
1203
|
+
white-space: normal;
|
|
1204
|
+
}
|
|
1187
1205
|
.whitespace-nowrap {
|
|
1188
1206
|
white-space: nowrap;
|
|
1189
1207
|
}
|
|
@@ -1378,6 +1396,10 @@ video {
|
|
|
1378
1396
|
.p-\[1px\] {
|
|
1379
1397
|
padding: 1px;
|
|
1380
1398
|
}
|
|
1399
|
+
.px-0 {
|
|
1400
|
+
padding-left: 0px;
|
|
1401
|
+
padding-right: 0px;
|
|
1402
|
+
}
|
|
1381
1403
|
.px-1 {
|
|
1382
1404
|
padding-left: 0.25rem;
|
|
1383
1405
|
padding-right: 0.25rem;
|
|
@@ -1775,9 +1797,6 @@ video {
|
|
|
1775
1797
|
--tw-drop-shadow: drop-shadow(0 3px 1px 0 rgba(0,0,0,1));
|
|
1776
1798
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1777
1799
|
}
|
|
1778
|
-
.\!filter {
|
|
1779
|
-
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
|
|
1780
|
-
}
|
|
1781
1800
|
.filter {
|
|
1782
1801
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1783
1802
|
}
|
|
@@ -1846,249 +1865,330 @@ video {
|
|
|
1846
1865
|
*:hover {
|
|
1847
1866
|
text-decoration-line: unset !important;
|
|
1848
1867
|
}
|
|
1868
|
+
|
|
1869
|
+
body::-webkit-scrollbar {
|
|
1870
|
+
display: none;
|
|
1871
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
1872
|
+
scrollbar-width: none; /* Firefox */
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1849
1875
|
.file\:border-0::file-selector-button {
|
|
1850
1876
|
border-width: 0px;
|
|
1851
1877
|
}
|
|
1878
|
+
|
|
1852
1879
|
.file\:bg-transparent::file-selector-button {
|
|
1853
1880
|
background-color: transparent;
|
|
1854
1881
|
}
|
|
1882
|
+
|
|
1855
1883
|
.file\:text-sm::file-selector-button {
|
|
1856
1884
|
font-size: 0.875rem;
|
|
1857
1885
|
line-height: 1.25rem;
|
|
1858
1886
|
}
|
|
1887
|
+
|
|
1859
1888
|
.file\:font-medium::file-selector-button {
|
|
1860
1889
|
font-weight: 500;
|
|
1861
1890
|
}
|
|
1891
|
+
|
|
1862
1892
|
.placeholder\:text-stateColors-error::-moz-placeholder {
|
|
1863
1893
|
color: var(--stateColors-error);
|
|
1864
1894
|
}
|
|
1895
|
+
|
|
1865
1896
|
.placeholder\:text-stateColors-error::placeholder {
|
|
1866
1897
|
color: var(--stateColors-error);
|
|
1867
1898
|
}
|
|
1899
|
+
|
|
1868
1900
|
.placeholder\:text-textColors-secondaryColor::-moz-placeholder {
|
|
1869
1901
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
1870
1902
|
}
|
|
1903
|
+
|
|
1871
1904
|
.placeholder\:text-textColors-secondaryColor::placeholder {
|
|
1872
1905
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
1873
1906
|
}
|
|
1907
|
+
|
|
1874
1908
|
.placeholder-shown\:\!truncate:-moz-placeholder-shown {
|
|
1875
1909
|
overflow: hidden !important;
|
|
1876
1910
|
text-overflow: ellipsis !important;
|
|
1877
1911
|
white-space: nowrap !important;
|
|
1878
1912
|
}
|
|
1913
|
+
|
|
1879
1914
|
.placeholder-shown\:\!truncate:placeholder-shown {
|
|
1880
1915
|
overflow: hidden !important;
|
|
1881
1916
|
text-overflow: ellipsis !important;
|
|
1882
1917
|
white-space: nowrap !important;
|
|
1883
1918
|
}
|
|
1919
|
+
|
|
1884
1920
|
.placeholder-shown\:p-4:-moz-placeholder-shown {
|
|
1885
1921
|
padding: 1rem;
|
|
1886
1922
|
}
|
|
1923
|
+
|
|
1887
1924
|
.placeholder-shown\:p-4:placeholder-shown {
|
|
1888
1925
|
padding: 1rem;
|
|
1889
1926
|
}
|
|
1927
|
+
|
|
1890
1928
|
.placeholder-shown\:text-textColors-secondaryColor:-moz-placeholder-shown {
|
|
1891
1929
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
1892
1930
|
}
|
|
1931
|
+
|
|
1893
1932
|
.placeholder-shown\:text-textColors-secondaryColor:placeholder-shown {
|
|
1894
1933
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
1895
1934
|
}
|
|
1935
|
+
|
|
1896
1936
|
.focus-within\:\!border-stateColors-error:focus-within {
|
|
1897
1937
|
border-color: var(--stateColors-error) !important;
|
|
1898
1938
|
}
|
|
1939
|
+
|
|
1899
1940
|
.focus-within\:border-coreColors-brandColorPrimary:focus-within {
|
|
1900
1941
|
border-color: var(--coreColors-brandColorPrimary);
|
|
1901
1942
|
}
|
|
1943
|
+
|
|
1902
1944
|
.hover\:h-\[18px\]:hover {
|
|
1903
1945
|
height: 18px;
|
|
1904
1946
|
}
|
|
1947
|
+
|
|
1905
1948
|
.hover\:w-\[18px\]:hover {
|
|
1906
1949
|
width: 18px;
|
|
1907
1950
|
}
|
|
1951
|
+
|
|
1908
1952
|
.hover\:bg-accent:hover {
|
|
1909
1953
|
background-color: hsl(var(--accent));
|
|
1910
1954
|
}
|
|
1955
|
+
|
|
1911
1956
|
.hover\:bg-muted:hover {
|
|
1912
1957
|
background-color: hsl(var(--muted));
|
|
1913
1958
|
}
|
|
1959
|
+
|
|
1914
1960
|
.hover\:bg-secondary:hover {
|
|
1915
1961
|
background-color: hsl(var(--secondary));
|
|
1916
1962
|
}
|
|
1963
|
+
|
|
1917
1964
|
.hover\:text-accent-foreground:hover {
|
|
1918
1965
|
color: hsl(var(--accent-foreground));
|
|
1919
1966
|
}
|
|
1967
|
+
|
|
1920
1968
|
.hover\:text-foreground:hover {
|
|
1921
1969
|
color: hsl(var(--foreground));
|
|
1922
1970
|
}
|
|
1971
|
+
|
|
1923
1972
|
.hover\:text-muted-foreground:hover {
|
|
1924
1973
|
color: hsl(var(--muted-foreground));
|
|
1925
1974
|
}
|
|
1975
|
+
|
|
1926
1976
|
.hover\:underline:hover {
|
|
1927
1977
|
text-decoration-line: underline;
|
|
1928
1978
|
}
|
|
1979
|
+
|
|
1929
1980
|
.hover\:\!line-through:hover {
|
|
1930
1981
|
text-decoration-line: line-through !important;
|
|
1931
1982
|
}
|
|
1983
|
+
|
|
1932
1984
|
.focus\:border-coreColors-brandColorPrimary:focus {
|
|
1933
1985
|
border-color: var(--coreColors-brandColorPrimary);
|
|
1934
1986
|
}
|
|
1987
|
+
|
|
1935
1988
|
.focus\:border-stateColors-error:focus {
|
|
1936
1989
|
border-color: var(--stateColors-error);
|
|
1937
1990
|
}
|
|
1991
|
+
|
|
1938
1992
|
.focus\:bg-stateColors-skeleton:focus {
|
|
1939
1993
|
background-color: var(--stateColors-skeleton);
|
|
1940
1994
|
}
|
|
1995
|
+
|
|
1941
1996
|
.focus\:opacity-100:focus {
|
|
1942
1997
|
opacity: 1;
|
|
1943
1998
|
}
|
|
1999
|
+
|
|
1944
2000
|
.focus\:outline-none:focus {
|
|
1945
2001
|
outline: 2px solid transparent;
|
|
1946
2002
|
outline-offset: 2px;
|
|
1947
2003
|
}
|
|
2004
|
+
|
|
1948
2005
|
.focus\:ring-2:focus {
|
|
1949
2006
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1950
2007
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1951
2008
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1952
2009
|
}
|
|
2010
|
+
|
|
1953
2011
|
.focus\:ring-ring:focus {
|
|
1954
2012
|
--tw-ring-color: hsl(var(--ring));
|
|
1955
2013
|
}
|
|
2014
|
+
|
|
1956
2015
|
.focus\:ring-offset-2:focus {
|
|
1957
2016
|
--tw-ring-offset-width: 2px;
|
|
1958
2017
|
}
|
|
2018
|
+
|
|
1959
2019
|
.focus-visible\:outline-none:focus-visible {
|
|
1960
2020
|
outline: 2px solid transparent;
|
|
1961
2021
|
outline-offset: 2px;
|
|
1962
2022
|
}
|
|
2023
|
+
|
|
1963
2024
|
.focus-visible\:ring-0:focus-visible {
|
|
1964
2025
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1965
2026
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1966
2027
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1967
2028
|
}
|
|
2029
|
+
|
|
1968
2030
|
.focus-visible\:ring-2:focus-visible {
|
|
1969
2031
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1970
2032
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1971
2033
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1972
2034
|
}
|
|
2035
|
+
|
|
1973
2036
|
.focus-visible\:ring-ring:focus-visible {
|
|
1974
2037
|
--tw-ring-color: hsl(var(--ring));
|
|
1975
2038
|
}
|
|
2039
|
+
|
|
1976
2040
|
.focus-visible\:ring-offset-2:focus-visible {
|
|
1977
2041
|
--tw-ring-offset-width: 2px;
|
|
1978
2042
|
}
|
|
2043
|
+
|
|
1979
2044
|
.focus-visible\:ring-offset-background:focus-visible {
|
|
1980
2045
|
--tw-ring-offset-color: hsl(var(--background));
|
|
1981
2046
|
}
|
|
2047
|
+
|
|
1982
2048
|
.active\:text-coreColors-brandColorPrimary:active {
|
|
1983
2049
|
color: var(--coreColors-brandColorPrimary);
|
|
1984
2050
|
}
|
|
2051
|
+
|
|
1985
2052
|
.active\:opacity-70:active {
|
|
1986
2053
|
opacity: 0.7;
|
|
1987
2054
|
}
|
|
2055
|
+
|
|
1988
2056
|
.active\:outline-coreColors-brandColorPrimary:active {
|
|
1989
2057
|
outline-color: var(--coreColors-brandColorPrimary);
|
|
1990
2058
|
}
|
|
2059
|
+
|
|
1991
2060
|
.disabled\:pointer-events-none:disabled {
|
|
1992
2061
|
pointer-events: none;
|
|
1993
2062
|
}
|
|
2063
|
+
|
|
1994
2064
|
.disabled\:cursor-not-allowed:disabled {
|
|
1995
2065
|
cursor: not-allowed;
|
|
1996
2066
|
}
|
|
2067
|
+
|
|
1997
2068
|
.disabled\:border-stateColors-disabled:disabled {
|
|
1998
2069
|
border-color: var(--stateColors-disabled);
|
|
1999
2070
|
}
|
|
2071
|
+
|
|
2000
2072
|
.disabled\:bg-buttonColors-secondaryFill:disabled {
|
|
2001
2073
|
background-color: var(--buttonColors-secondaryFill);
|
|
2002
2074
|
}
|
|
2075
|
+
|
|
2003
2076
|
.disabled\:bg-stateColors-disabled:disabled {
|
|
2004
2077
|
background-color: var(--stateColors-disabled);
|
|
2005
2078
|
}
|
|
2079
|
+
|
|
2006
2080
|
.disabled\:bg-transparent:disabled {
|
|
2007
2081
|
background-color: transparent;
|
|
2008
2082
|
}
|
|
2083
|
+
|
|
2009
2084
|
.disabled\:text-stateColors-disabled:disabled {
|
|
2010
2085
|
color: var(--stateColors-disabled);
|
|
2011
2086
|
}
|
|
2087
|
+
|
|
2012
2088
|
.disabled\:opacity-50:disabled {
|
|
2013
2089
|
opacity: 0.5;
|
|
2014
2090
|
}
|
|
2091
|
+
|
|
2015
2092
|
.disabled\:opacity-70:disabled {
|
|
2016
2093
|
opacity: 0.7;
|
|
2017
2094
|
}
|
|
2095
|
+
|
|
2018
2096
|
.group:hover .group-hover\:opacity-100 {
|
|
2019
2097
|
opacity: 1;
|
|
2020
2098
|
}
|
|
2099
|
+
|
|
2021
2100
|
.group:active .group-active\:text-coreColors-brandColorPrimary {
|
|
2022
2101
|
color: var(--coreColors-brandColorPrimary);
|
|
2023
2102
|
}
|
|
2103
|
+
|
|
2024
2104
|
.group:disabled .group-disabled\:text-stateColors-disabled {
|
|
2025
2105
|
color: var(--stateColors-disabled);
|
|
2026
2106
|
}
|
|
2107
|
+
|
|
2027
2108
|
.group.destructive .group-\[\.destructive\]\:border-muted\/40 {
|
|
2028
2109
|
border-color: hsl(var(--muted) / 0.4);
|
|
2029
2110
|
}
|
|
2111
|
+
|
|
2030
2112
|
.group.destructive .group-\[\.destructive\]\:text-red-300 {
|
|
2031
2113
|
--tw-text-opacity: 1;
|
|
2032
2114
|
color: rgb(252 165 165 / var(--tw-text-opacity));
|
|
2033
2115
|
}
|
|
2116
|
+
|
|
2034
2117
|
.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover {
|
|
2035
2118
|
border-color: hsl(var(--destructive) / 0.3);
|
|
2036
2119
|
}
|
|
2120
|
+
|
|
2037
2121
|
.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover {
|
|
2038
2122
|
background-color: hsl(var(--destructive));
|
|
2039
2123
|
}
|
|
2124
|
+
|
|
2040
2125
|
.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover {
|
|
2041
2126
|
color: hsl(var(--destructive-foreground));
|
|
2042
2127
|
}
|
|
2128
|
+
|
|
2043
2129
|
.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover {
|
|
2044
2130
|
--tw-text-opacity: 1;
|
|
2045
2131
|
color: rgb(254 242 242 / var(--tw-text-opacity));
|
|
2046
2132
|
}
|
|
2133
|
+
|
|
2047
2134
|
.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus {
|
|
2048
2135
|
--tw-ring-color: hsl(var(--destructive));
|
|
2049
2136
|
}
|
|
2137
|
+
|
|
2050
2138
|
.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus {
|
|
2051
2139
|
--tw-ring-opacity: 1;
|
|
2052
2140
|
--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity));
|
|
2053
2141
|
}
|
|
2142
|
+
|
|
2054
2143
|
.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus {
|
|
2055
2144
|
--tw-ring-offset-color: #dc2626;
|
|
2056
2145
|
}
|
|
2146
|
+
|
|
2057
2147
|
.peer:-moz-placeholder-shown ~ .peer-placeholder-shown\:opacity-0 {
|
|
2058
2148
|
opacity: 0;
|
|
2059
2149
|
}
|
|
2150
|
+
|
|
2060
2151
|
.peer:placeholder-shown ~ .peer-placeholder-shown\:opacity-0 {
|
|
2061
2152
|
opacity: 0;
|
|
2062
2153
|
}
|
|
2154
|
+
|
|
2063
2155
|
.peer:disabled ~ .peer-disabled\:cursor-not-allowed {
|
|
2064
2156
|
cursor: not-allowed;
|
|
2065
2157
|
}
|
|
2158
|
+
|
|
2066
2159
|
.peer:disabled ~ .peer-disabled\:opacity-70 {
|
|
2067
2160
|
opacity: 0.7;
|
|
2068
2161
|
}
|
|
2162
|
+
|
|
2069
2163
|
.data-\[disabled\]\:pointer-events-none[data-disabled] {
|
|
2070
2164
|
pointer-events: none;
|
|
2071
2165
|
}
|
|
2166
|
+
|
|
2072
2167
|
.data-\[state\=checked\]\:translate-x-6[data-state=checked] {
|
|
2073
2168
|
--tw-translate-x: 1.5rem;
|
|
2074
2169
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2075
2170
|
}
|
|
2171
|
+
|
|
2076
2172
|
.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked] {
|
|
2077
2173
|
--tw-translate-x: 0px;
|
|
2078
2174
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2079
2175
|
}
|
|
2176
|
+
|
|
2080
2177
|
.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel] {
|
|
2081
2178
|
--tw-translate-x: 0px;
|
|
2082
2179
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2083
2180
|
}
|
|
2181
|
+
|
|
2084
2182
|
.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end] {
|
|
2085
2183
|
--tw-translate-x: var(--radix-toast-swipe-end-x);
|
|
2086
2184
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2087
2185
|
}
|
|
2186
|
+
|
|
2088
2187
|
.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move] {
|
|
2089
2188
|
--tw-translate-x: var(--radix-toast-swipe-move-x);
|
|
2090
2189
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2091
2190
|
}
|
|
2191
|
+
|
|
2092
2192
|
@keyframes accordion-up {
|
|
2093
2193
|
|
|
2094
2194
|
from {
|
|
@@ -2099,9 +2199,11 @@ video {
|
|
|
2099
2199
|
height: 0;
|
|
2100
2200
|
}
|
|
2101
2201
|
}
|
|
2202
|
+
|
|
2102
2203
|
.data-\[state\=closed\]\:animate-accordion-up[data-state=closed] {
|
|
2103
2204
|
animation: accordion-up 0.2s ease-out;
|
|
2104
2205
|
}
|
|
2206
|
+
|
|
2105
2207
|
@keyframes accordion-down {
|
|
2106
2208
|
|
|
2107
2209
|
from {
|
|
@@ -2112,36 +2214,47 @@ video {
|
|
|
2112
2214
|
height: var(--radix-accordion-content-height);
|
|
2113
2215
|
}
|
|
2114
2216
|
}
|
|
2217
|
+
|
|
2115
2218
|
.data-\[state\=open\]\:animate-accordion-down[data-state=open] {
|
|
2116
2219
|
animation: accordion-down 0.2s ease-out;
|
|
2117
2220
|
}
|
|
2221
|
+
|
|
2118
2222
|
.data-\[state\=checked\]\:bg-stateColors-success[data-state=checked] {
|
|
2119
2223
|
background-color: var(--stateColors-success);
|
|
2120
2224
|
}
|
|
2225
|
+
|
|
2121
2226
|
.data-\[state\=on\]\:bg-accent[data-state=on] {
|
|
2122
2227
|
background-color: hsl(var(--accent));
|
|
2123
2228
|
}
|
|
2229
|
+
|
|
2124
2230
|
.data-\[state\=unchecked\]\:bg-stateColors-disabled[data-state=unchecked] {
|
|
2125
2231
|
background-color: var(--stateColors-disabled);
|
|
2126
2232
|
}
|
|
2233
|
+
|
|
2127
2234
|
.data-\[icon\=true\]\:pr-10[data-icon=true] {
|
|
2128
2235
|
padding-right: 2.5rem;
|
|
2129
2236
|
}
|
|
2237
|
+
|
|
2130
2238
|
.data-\[error\=true\]\:text-stateColors-error[data-error=true] {
|
|
2131
2239
|
color: var(--stateColors-error);
|
|
2132
2240
|
}
|
|
2241
|
+
|
|
2133
2242
|
.data-\[state\=on\]\:text-accent-foreground[data-state=on] {
|
|
2134
2243
|
color: hsl(var(--accent-foreground));
|
|
2135
2244
|
}
|
|
2245
|
+
|
|
2136
2246
|
.data-\[disabled\]\:opacity-50[data-disabled] {
|
|
2137
2247
|
opacity: 0.5;
|
|
2138
2248
|
}
|
|
2249
|
+
|
|
2139
2250
|
.data-\[swipe\=move\]\:transition-none[data-swipe=move] {
|
|
2140
2251
|
transition-property: none;
|
|
2141
2252
|
}
|
|
2253
|
+
|
|
2142
2254
|
.data-\[state\=open\]\:duration-500[data-state=open] {
|
|
2143
2255
|
transition-duration: 500ms;
|
|
2144
2256
|
}
|
|
2257
|
+
|
|
2145
2258
|
.data-\[state\=open\]\:animate-in[data-state=open] {
|
|
2146
2259
|
animation-name: enter;
|
|
2147
2260
|
animation-duration: 150ms;
|
|
@@ -2151,6 +2264,7 @@ video {
|
|
|
2151
2264
|
--tw-enter-translate-x: initial;
|
|
2152
2265
|
--tw-enter-translate-y: initial;
|
|
2153
2266
|
}
|
|
2267
|
+
|
|
2154
2268
|
.data-\[state\=closed\]\:animate-out[data-state=closed] {
|
|
2155
2269
|
animation-name: exit;
|
|
2156
2270
|
animation-duration: 150ms;
|
|
@@ -2160,6 +2274,7 @@ video {
|
|
|
2160
2274
|
--tw-exit-translate-x: initial;
|
|
2161
2275
|
--tw-exit-translate-y: initial;
|
|
2162
2276
|
}
|
|
2277
|
+
|
|
2163
2278
|
.data-\[swipe\=end\]\:animate-out[data-swipe=end] {
|
|
2164
2279
|
animation-name: exit;
|
|
2165
2280
|
animation-duration: 150ms;
|
|
@@ -2169,51 +2284,67 @@ video {
|
|
|
2169
2284
|
--tw-exit-translate-x: initial;
|
|
2170
2285
|
--tw-exit-translate-y: initial;
|
|
2171
2286
|
}
|
|
2287
|
+
|
|
2172
2288
|
.data-\[state\=closed\]\:fade-out-0[data-state=closed] {
|
|
2173
2289
|
--tw-exit-opacity: 0;
|
|
2174
2290
|
}
|
|
2291
|
+
|
|
2175
2292
|
.data-\[state\=open\]\:fade-in-0[data-state=open] {
|
|
2176
2293
|
--tw-enter-opacity: 0;
|
|
2177
2294
|
}
|
|
2295
|
+
|
|
2178
2296
|
.data-\[state\=closed\]\:zoom-out-95[data-state=closed] {
|
|
2179
2297
|
--tw-exit-scale: .95;
|
|
2180
2298
|
}
|
|
2299
|
+
|
|
2181
2300
|
.data-\[state\=open\]\:zoom-in-95[data-state=open] {
|
|
2182
2301
|
--tw-enter-scale: .95;
|
|
2183
2302
|
}
|
|
2303
|
+
|
|
2184
2304
|
.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom] {
|
|
2185
2305
|
--tw-enter-translate-y: -0.5rem;
|
|
2186
2306
|
}
|
|
2307
|
+
|
|
2187
2308
|
.data-\[side\=left\]\:slide-in-from-right-2[data-side=left] {
|
|
2188
2309
|
--tw-enter-translate-x: 0.5rem;
|
|
2189
2310
|
}
|
|
2311
|
+
|
|
2190
2312
|
.data-\[side\=right\]\:slide-in-from-left-2[data-side=right] {
|
|
2191
2313
|
--tw-enter-translate-x: -0.5rem;
|
|
2192
2314
|
}
|
|
2315
|
+
|
|
2193
2316
|
.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top] {
|
|
2194
2317
|
--tw-enter-translate-y: 0.5rem;
|
|
2195
2318
|
}
|
|
2319
|
+
|
|
2196
2320
|
.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed] {
|
|
2197
2321
|
--tw-exit-translate-x: -50%;
|
|
2198
2322
|
}
|
|
2323
|
+
|
|
2199
2324
|
.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed] {
|
|
2200
2325
|
--tw-exit-translate-y: -48%;
|
|
2201
2326
|
}
|
|
2327
|
+
|
|
2202
2328
|
.data-\[state\=closed\]\:slide-out-to-top-full[data-state=closed] {
|
|
2203
2329
|
--tw-exit-translate-y: -100%;
|
|
2204
2330
|
}
|
|
2331
|
+
|
|
2205
2332
|
.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open] {
|
|
2206
2333
|
--tw-enter-translate-x: -50%;
|
|
2207
2334
|
}
|
|
2335
|
+
|
|
2208
2336
|
.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open] {
|
|
2209
2337
|
--tw-enter-translate-y: -48%;
|
|
2210
2338
|
}
|
|
2339
|
+
|
|
2211
2340
|
.data-\[state\=open\]\:slide-in-from-top-full[data-state=open] {
|
|
2212
2341
|
--tw-enter-translate-y: -100%;
|
|
2213
2342
|
}
|
|
2343
|
+
|
|
2214
2344
|
.data-\[state\=open\]\:duration-500[data-state=open] {
|
|
2215
2345
|
animation-duration: 500ms;
|
|
2216
2346
|
}
|
|
2347
|
+
|
|
2217
2348
|
@media (min-width: 640px) {
|
|
2218
2349
|
|
|
2219
2350
|
.sm\:mt-0 {
|
|
@@ -2242,68 +2373,89 @@ video {
|
|
|
2242
2373
|
text-align: left;
|
|
2243
2374
|
}
|
|
2244
2375
|
}
|
|
2376
|
+
|
|
2245
2377
|
.\[\&\+label\]\:text-stateColors-error+label {
|
|
2246
2378
|
color: var(--stateColors-error);
|
|
2247
2379
|
}
|
|
2380
|
+
|
|
2248
2381
|
.\[\&\>div\>button\]\:border-coreColors-brandColorPrimary>div>button {
|
|
2249
2382
|
border-color: var(--coreColors-brandColorPrimary);
|
|
2250
2383
|
}
|
|
2384
|
+
|
|
2251
2385
|
.\[\&\>div\]\:w-full>div {
|
|
2252
2386
|
width: 100%;
|
|
2253
2387
|
}
|
|
2388
|
+
|
|
2254
2389
|
.\[\&\>p\]\:text-stateColors-disabled>p {
|
|
2255
2390
|
color: var(--stateColors-disabled);
|
|
2256
2391
|
}
|
|
2392
|
+
|
|
2257
2393
|
.\[\&\>p\]\:text-textColors-primaryColor>p {
|
|
2258
2394
|
color: var(--textColors-primaryColor, #121212ff);
|
|
2259
2395
|
}
|
|
2396
|
+
|
|
2260
2397
|
.\[\&\>p\]\:text-textColors-secondaryColor>p {
|
|
2261
2398
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
2262
2399
|
}
|
|
2400
|
+
|
|
2263
2401
|
.\[\&\>p\]\:\!line-through>p {
|
|
2264
2402
|
text-decoration-line: line-through !important;
|
|
2265
2403
|
}
|
|
2404
|
+
|
|
2266
2405
|
.\[\&\[data-state\=open\]\]\:outline-coreColors-brandColorPrimary[data-state=open] {
|
|
2267
2406
|
outline-color: var(--coreColors-brandColorPrimary);
|
|
2268
2407
|
}
|
|
2408
|
+
|
|
2269
2409
|
.\[\&\[data-state\=open\]_\.chevron-icon\]\:rotate-180[data-state=open] .chevron-icon {
|
|
2270
2410
|
--tw-rotate: 180deg;
|
|
2271
2411
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2272
2412
|
}
|
|
2413
|
+
|
|
2273
2414
|
.\[\&\[data-state\=open\]_\.label\]\:text-coreColors-brandColorPrimary[data-state=open] .label {
|
|
2274
2415
|
color: var(--coreColors-brandColorPrimary);
|
|
2275
2416
|
}
|
|
2417
|
+
|
|
2276
2418
|
.\[\&\[data-state\=open\]_\.label\]\:text-textColors-secondaryColor[data-state=open] .label {
|
|
2277
2419
|
color: var(--textColors-secondaryColor, #727272ff);
|
|
2278
2420
|
}
|
|
2421
|
+
|
|
2279
2422
|
.\[\&\[data-state\=open\]_svg\]\:rotate-180[data-state=open] svg {
|
|
2280
2423
|
--tw-rotate: 180deg;
|
|
2281
2424
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
2282
2425
|
}
|
|
2426
|
+
|
|
2283
2427
|
.\[\&_\*\]\:text-coreColors-pageColor * {
|
|
2284
2428
|
color: var(--coreColors-pageColor);
|
|
2285
2429
|
}
|
|
2430
|
+
|
|
2286
2431
|
.\[\&_\*\]\:text-stateColors-error * {
|
|
2287
2432
|
color: var(--stateColors-error);
|
|
2288
2433
|
}
|
|
2434
|
+
|
|
2289
2435
|
.\[\&_\*\]\:text-textColors-primaryColor * {
|
|
2290
2436
|
color: var(--textColors-primaryColor, #121212ff);
|
|
2291
2437
|
}
|
|
2438
|
+
|
|
2292
2439
|
.\[\&_\*\]\:placeholder\:text-stateColors-error *::-moz-placeholder {
|
|
2293
2440
|
color: var(--stateColors-error);
|
|
2294
2441
|
}
|
|
2442
|
+
|
|
2295
2443
|
.\[\&_\*\]\:placeholder\:text-stateColors-error *::placeholder {
|
|
2296
2444
|
color: var(--stateColors-error);
|
|
2297
2445
|
}
|
|
2446
|
+
|
|
2298
2447
|
.\[\&_label\]\:focus-within\:\!text-stateColors-error:focus-within label {
|
|
2299
2448
|
color: var(--stateColors-error) !important;
|
|
2300
2449
|
}
|
|
2450
|
+
|
|
2301
2451
|
.\[\&_label\]\:focus-within\:text-coreColors-brandColorPrimary:focus-within label {
|
|
2302
2452
|
color: var(--coreColors-brandColorPrimary);
|
|
2303
2453
|
}
|
|
2454
|
+
|
|
2304
2455
|
.\[\&_p\]\:text-stateColors-disabled p {
|
|
2305
2456
|
color: var(--stateColors-disabled);
|
|
2306
2457
|
}
|
|
2458
|
+
|
|
2307
2459
|
.active\:\[\&_svg\]\:text-stateColors-favorites svg:active {
|
|
2308
2460
|
color: var(--stateColors-favorites);
|
|
2309
2461
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,6 +11,16 @@
|
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
12
|
"author": "Tapcart Inc.",
|
|
13
13
|
"homepage": "https://tapcart.com",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
16
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
17
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
18
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
19
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
20
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
21
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
22
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
23
|
+
},
|
|
14
24
|
"peerDependencies": {
|
|
15
25
|
"react": "^17.0.2 || ^18.0.0",
|
|
16
26
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
@@ -19,17 +29,17 @@
|
|
|
19
29
|
"@types/lodash": "4.17.5",
|
|
20
30
|
"@types/react": "^18.2.0",
|
|
21
31
|
"@types/react-dom": "^18.2.0",
|
|
32
|
+
"app-studio-types": "workspace:*",
|
|
22
33
|
"autoprefixer": "^10.4.14",
|
|
23
34
|
"chokidar-cli": "^3.0.0",
|
|
24
35
|
"concurrently": "^8.2.2",
|
|
25
36
|
"eslint": "^7.32.0",
|
|
37
|
+
"eslint-config-custom": "workspace:*",
|
|
26
38
|
"postcss": "^8.4.24",
|
|
27
39
|
"tailwindcss": "^3.3.2",
|
|
28
40
|
"tsc-alias": "^1.8.10",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"tsconfig": "0.0.0",
|
|
32
|
-
"app-studio-types": "0.0.0"
|
|
41
|
+
"tsconfig": "workspace:*",
|
|
42
|
+
"typescript": "^4.5.2"
|
|
33
43
|
},
|
|
34
44
|
"dependencies": {
|
|
35
45
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -61,15 +71,5 @@
|
|
|
61
71
|
"tailwind-merge": "^1.13.2",
|
|
62
72
|
"tailwindcss-animate": "^1.0.6",
|
|
63
73
|
"vaul": "^0.9.1"
|
|
64
|
-
},
|
|
65
|
-
"scripts": {
|
|
66
|
-
"lint": "eslint \"**/*.ts*\"",
|
|
67
|
-
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
68
|
-
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
69
|
-
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
70
|
-
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
71
|
-
"dev:ts": "tsc -w -p tsconfig.json",
|
|
72
|
-
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
73
|
-
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
declare const inputVariants: (props?: ({
|
|
4
|
-
error?: boolean | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">, VariantProps<typeof inputVariants> {
|
|
7
|
-
id: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
asChild?: boolean;
|
|
11
|
-
value: string;
|
|
12
|
-
placeholder: string;
|
|
13
|
-
onChange: (_: string) => void;
|
|
14
|
-
}
|
|
15
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
-
export { Input };
|
|
17
|
-
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa;;mFAalB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,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,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,QAAA,MAAM,KAAK,qFAkDV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
-
import { cva } from "class-variance-authority";
|
|
16
|
-
import { cn } from "../../lib/utils";
|
|
17
|
-
import { Icon } from "./icon";
|
|
18
|
-
const inputVariants = cva("flex h-14 w-full rounded border border-coreColors-dividingLines bg-coreColors-inputBackground px-4 pt-5 pb-2 placeholder-shown:p-4 text-textColors-primaryColor text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer data-[icon=true]:pr-10", {
|
|
19
|
-
variants: {
|
|
20
|
-
error: {
|
|
21
|
-
true: "border-stateColors-error text-stateColors-error placeholder:text-stateColors-error focus:border-stateColors-error [&+label]:text-stateColors-error",
|
|
22
|
-
false: "",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
error: false,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
const Input = React.forwardRef((_a, ref) => {
|
|
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
|
-
const Comp = asChild ? Slot : "div";
|
|
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
|
-
});
|
|
34
|
-
Input.displayName = "Input";
|
|
35
|
-
export { Input };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
type Product = any;
|
|
2
|
-
interface PageData {
|
|
3
|
-
products: Product[];
|
|
4
|
-
cursorBlob?: string;
|
|
5
|
-
filtersData: any;
|
|
6
|
-
}
|
|
7
|
-
interface ProductGridItemsProps {
|
|
8
|
-
initialData: PageData;
|
|
9
|
-
loadMoreProducts: (params: any) => Promise<PageData>;
|
|
10
|
-
queryVariables: Record<string, any>;
|
|
11
|
-
config: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
declare function ProductGrid({ loadMoreProducts, initialData, queryVariables, config, }: ProductGridItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export { ProductGrid };
|
|
15
|
-
//# sourceMappingURL=product-grid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"product-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/product-grid.tsx"],"names":[],"mappings":"AAkBA,KAAK,OAAO,GAAG,GAAG,CAAA;AAClB,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;CACjB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,QAAQ,CAAA;IACrB,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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useInfiniteScroll } from "../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))) })));
|
|
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" });
|
|
16
|
-
if (isLoadingInitialData)
|
|
17
|
-
return _jsx(Loader, {});
|
|
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-expect-error
|
|
20
|
-
product: product, config: config, isLoading: false }, product.handle))) })), isLoadingMore ? _jsx(Loader, {}) : _jsx("div", { ref: ref })] }));
|
|
21
|
-
}
|
|
22
|
-
export { ProductGrid };
|