@gem-sdk/plugin-cart-drawer 1.0.0 → 1.0.5
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.
|
@@ -15,7 +15,7 @@ const CartLineItem = () => {
|
|
|
15
15
|
const { isMutating: loading, trigger: removeCartLine } = core.useRemoveCartItem();
|
|
16
16
|
const money = core.useMoney(line.variant?.price ? line.variant?.price : 0);
|
|
17
17
|
const compareAtPrice = core.useMoney(line.variant?.listPrice ? line.variant?.listPrice : 0);
|
|
18
|
-
return (jsxRuntime.jsxs("div", { className: "flex items-center gap-4 border-b border-b-g-line-2 py-4 last:border-b-transparent", children: [jsxRuntime.jsx("div", { className: "aspect-square w-16", children: line.variant?.image?.url && (jsxRuntime.jsx("img", { className: "h-full w-full object-cover", src: line.variant.image.url, alt: line.variant?.image?.altText ?? '' })) }), jsxRuntime.jsxs("div", { className: "flex-1", children: [jsxRuntime.jsxs("p", { className: "line-clamp-2", children: [line.productTitle, "
|
|
18
|
+
return (jsxRuntime.jsxs("div", { className: "flex items-center gap-4 border-b border-b-g-line-2 py-4 last:border-b-transparent", children: [jsxRuntime.jsx("div", { className: "aspect-square w-16", children: line.variant?.image?.url && (jsxRuntime.jsx("img", { className: "h-full w-full object-cover", src: line.variant.image.url, alt: line.variant?.image?.altText ?? '' })) }), jsxRuntime.jsxs("div", { className: "flex-1", children: [jsxRuntime.jsxs("p", { className: "line-clamp-2", children: [line.productTitle, " ", line.variant.name !== 'Default Title' && ` - ${line.variant.name}`] }), jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx("span", { className: "font-semibold", children: money.localizedString }), line.variant?.listPrice > 0 && (jsxRuntime.jsx("span", { className: "text-[#B4B4B4] line-through", children: compareAtPrice.localizedString }))] }), line.attributes?.map((attribute) => (jsxRuntime.jsxs("div", { children: [attribute.key, ": ", attribute.value] }, attribute.key)))] }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [jsxRuntime.jsx(CartLineItemQuantity.default, { size: "medium" }), jsxRuntime.jsx("button", { onClick: () => {
|
|
19
19
|
components.openConfirm({
|
|
20
20
|
title: (jsxRuntime.jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsxRuntime.jsx(Trash.default, {}), jsxRuntime.jsx("p", { className: "font-g-body text-xl font-semibold", children: "Are you sure ?" })] })),
|
|
21
21
|
content: (jsxRuntime.jsxs("div", { className: "text-center", children: [jsxRuntime.jsx("p", { children: "Do you really want to delete these items?" }), jsxRuntime.jsx("p", { children: "This process cannot be undone." })] })),
|
|
@@ -11,7 +11,7 @@ const CartLineItem = () => {
|
|
|
11
11
|
const { isMutating: loading, trigger: removeCartLine } = useRemoveCartItem();
|
|
12
12
|
const money = useMoney(line.variant?.price ? line.variant?.price : 0);
|
|
13
13
|
const compareAtPrice = useMoney(line.variant?.listPrice ? line.variant?.listPrice : 0);
|
|
14
|
-
return (jsxs("div", { className: "flex items-center gap-4 border-b border-b-g-line-2 py-4 last:border-b-transparent", children: [jsx("div", { className: "aspect-square w-16", children: line.variant?.image?.url && (jsx("img", { className: "h-full w-full object-cover", src: line.variant.image.url, alt: line.variant?.image?.altText ?? '' })) }), jsxs("div", { className: "flex-1", children: [jsxs("p", { className: "line-clamp-2", children: [line.productTitle, "
|
|
14
|
+
return (jsxs("div", { className: "flex items-center gap-4 border-b border-b-g-line-2 py-4 last:border-b-transparent", children: [jsx("div", { className: "aspect-square w-16", children: line.variant?.image?.url && (jsx("img", { className: "h-full w-full object-cover", src: line.variant.image.url, alt: line.variant?.image?.altText ?? '' })) }), jsxs("div", { className: "flex-1", children: [jsxs("p", { className: "line-clamp-2", children: [line.productTitle, " ", line.variant.name !== 'Default Title' && ` - ${line.variant.name}`] }), jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [jsxs("div", { className: "flex gap-2", children: [jsx("span", { className: "font-semibold", children: money.localizedString }), line.variant?.listPrice > 0 && (jsx("span", { className: "text-[#B4B4B4] line-through", children: compareAtPrice.localizedString }))] }), line.attributes?.map((attribute) => (jsxs("div", { children: [attribute.key, ": ", attribute.value] }, attribute.key)))] }), jsxs("div", { className: "flex items-center justify-between", children: [jsx(CartLineItemQuantity, { size: "medium" }), jsx("button", { onClick: () => {
|
|
15
15
|
openConfirm({
|
|
16
16
|
title: (jsxs("div", { className: "flex w-full flex-col items-center gap-4", children: [jsx(Trash, {}), jsx("p", { className: "font-g-body text-xl font-semibold", children: "Are you sure ?" })] })),
|
|
17
17
|
content: (jsxs("div", { className: "text-center", children: [jsx("p", { children: "Do you really want to delete these items?" }), jsx("p", { children: "This process cannot be undone." })] })),
|
package/dist/esm/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BaseProps } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
|
-
type CartDrawerProps = BaseProps<{
|
|
4
|
-
title?: string;
|
|
5
|
-
emptyLabel?: string;
|
|
6
|
-
openMode?: 'popup' | 'page';
|
|
7
|
-
}> & {
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
};
|
|
3
|
+
type CartDrawerProps = BaseProps<{
|
|
4
|
+
title?: string;
|
|
5
|
+
emptyLabel?: string;
|
|
6
|
+
openMode?: 'popup' | 'page';
|
|
7
|
+
}> & {
|
|
8
|
+
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
};
|
|
11
11
|
declare const CartDrawer: React.FC<CartDrawerProps>;
|
|
12
12
|
|
|
13
13
|
export { CartDrawer as default };
|