@gfed-medusa/sf-lib-common 3.3.3 → 3.3.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/breadcrumbs/index.d.ts +2 -2
- package/dist/components/cart-mismatch-banner/index.d.ts +2 -2
- package/dist/components/cart-mismatch-banner/index.js +6 -2
- package/dist/components/cart-mismatch-banner/index.js.map +1 -1
- package/dist/components/delete-button/index.d.ts +2 -2
- package/dist/components/error-message/index.d.ts +2 -2
- package/dist/components/error-message/index.d.ts.map +1 -1
- package/dist/components/free-shipping-price-nudge/index.d.ts +2 -2
- package/dist/components/interactive-link/index.d.ts +9 -6
- package/dist/components/interactive-link/index.d.ts.map +1 -1
- package/dist/components/interactive-link/index.js +6 -6
- package/dist/components/interactive-link/index.js.map +1 -1
- package/dist/components/line-item-options/index.d.ts +2 -2
- package/dist/components/line-item-price/index.d.ts +2 -2
- package/dist/components/line-item-price/index.d.ts.map +1 -1
- package/dist/components/localized-client-link/index.d.ts +2 -2
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/modal/index.d.ts.map +1 -1
- package/dist/components/modal/index.js +6 -8
- package/dist/components/modal/index.js.map +1 -1
- package/dist/components/preview-price/index.d.ts +2 -2
- package/dist/components/preview-price/index.d.ts.map +1 -1
- package/dist/components/product-card/index.d.ts +2 -2
- package/dist/components/product-card/index.js +1 -1
- package/dist/components/product-card/index.js.map +1 -1
- package/dist/components/product-preview/index.d.ts +10 -5
- package/dist/components/product-preview/index.d.ts.map +1 -1
- package/dist/components/product-preview/index.js +4 -2
- package/dist/components/product-preview/index.js.map +1 -1
- package/dist/components/submit-button/index.d.ts +2 -2
- package/dist/components/thumbnail/index.d.ts +2 -0
- package/dist/components/thumbnail/index.d.ts.map +1 -1
- package/dist/components/thumbnail/index.js +7 -3
- package/dist/components/thumbnail/index.js.map +1 -1
- package/dist/lib/config/medusa.js +1 -1
- package/dist/lib/context/apollo-context.d.ts +2 -2
- package/dist/lib/context/modal-context.d.ts +2 -2
- package/dist/lib/context/modal-context.d.ts.map +1 -1
- package/dist/lib/data/categories.d.ts +4 -15
- package/dist/lib/data/categories.d.ts.map +1 -1
- package/dist/lib/data/categories.js +5 -2
- package/dist/lib/data/categories.js.map +1 -1
- package/dist/lib/data/context.d.ts +2 -2
- package/dist/lib/data/context.d.ts.map +1 -1
- package/dist/lib/data/cookies-actions.d.ts.map +1 -1
- package/dist/lib/data/cookies-actions.js +8 -4
- package/dist/lib/data/cookies-actions.js.map +1 -1
- package/dist/lib/data/home-banner.d.ts +7 -0
- package/dist/lib/data/home-banner.d.ts.map +1 -0
- package/dist/lib/data/home-banner.js +16 -0
- package/dist/lib/data/home-banner.js.map +1 -0
- package/dist/lib/gql/fragments/cart.d.ts +9 -9
- package/dist/lib/gql/fragments/cart.d.ts.map +1 -1
- package/dist/lib/gql/fragments/customer.d.ts +3 -3
- package/dist/lib/gql/fragments/customer.d.ts.map +1 -1
- package/dist/lib/gql/fragments/product.d.ts +9 -10
- package/dist/lib/gql/fragments/product.d.ts.map +1 -1
- package/dist/lib/gql/fragments/product.js +1 -10
- package/dist/lib/gql/fragments/product.js.map +1 -1
- package/dist/lib/gql/mutations/cart.d.ts +6 -6
- package/dist/lib/gql/queries/cart.d.ts +2 -2
- package/dist/lib/gql/queries/collections.d.ts +3 -3
- package/dist/lib/gql/queries/customer.d.ts +2 -2
- package/dist/lib/gql/queries/footer.d.ts +3 -3
- package/dist/lib/gql/queries/home-banner.d.ts +7 -0
- package/dist/lib/gql/queries/home-banner.d.ts.map +1 -0
- package/dist/lib/gql/queries/home-banner.js +46 -0
- package/dist/lib/gql/queries/home-banner.js.map +1 -0
- package/dist/lib/gql/queries/order.d.ts +4 -4
- package/dist/lib/gql/queries/order.d.ts.map +1 -1
- package/dist/lib/gql/queries/order.js +1 -0
- package/dist/lib/gql/queries/order.js.map +1 -1
- package/dist/lib/gql/queries/product.d.ts +3 -4
- package/dist/lib/gql/queries/product.d.ts.map +1 -1
- package/dist/lib/gql/queries/product.js +4 -23
- package/dist/lib/gql/queries/product.js.map +1 -1
- package/dist/lib/gql/queries/regions.d.ts +3 -3
- package/dist/lib/utils/get-product-price.d.ts +3 -2
- package/dist/lib/utils/get-product-price.d.ts.map +1 -1
- package/dist/lib/utils/get-product-price.js.map +1 -1
- package/dist/lib/utils/imagekit.d.ts +0 -4
- package/dist/lib/utils/imagekit.d.ts.map +1 -1
- package/dist/lib/utils/imagekit.js +3 -8
- package/dist/lib/utils/imagekit.js.map +1 -1
- package/dist/types/cms.d.ts +27 -1
- package/dist/types/cms.d.ts.map +1 -1
- package/dist/types/graphql.d.ts +94 -38
- package/dist/types/graphql.d.ts.map +1 -1
- package/dist/types/graphql.js +258 -289
- package/dist/types/graphql.js.map +1 -1
- package/package.json +4 -4
- package/dist/lib/data/search.d.ts +0 -9
- package/dist/lib/data/search.d.ts.map +0 -1
- package/dist/lib/data/search.js +0 -23
- package/dist/lib/data/search.js.map +0 -1
- package/dist/lib/hooks/use-search.d.ts +0 -22
- package/dist/lib/hooks/use-search.d.ts.map +0 -1
- package/dist/lib/hooks/use-search.js +0 -69
- package/dist/lib/hooks/use-search.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/breadcrumbs/index.d.ts
|
|
4
4
|
declare const SEPARATOR_ICONS: Record<string, React.ComponentType<{
|
|
@@ -14,7 +14,7 @@ declare function Breadcrumbs({
|
|
|
14
14
|
iconClassName,
|
|
15
15
|
iconSize,
|
|
16
16
|
separatorIcon
|
|
17
|
-
}: BreadcrumbsProps):
|
|
17
|
+
}: BreadcrumbsProps): react_jsx_runtime0.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Breadcrumbs };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Cart, Customer } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/cart-mismatch-banner/index.d.ts
|
|
5
5
|
declare function CartMismatchBanner(props: {
|
|
6
6
|
customer: Customer;
|
|
7
7
|
cart: Cart;
|
|
8
|
-
}):
|
|
8
|
+
}): react_jsx_runtime0.JSX.Element | undefined;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CartMismatchBanner };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -12,13 +12,17 @@ function CartMismatchBanner(props) {
|
|
|
12
12
|
const { customer, cart } = props;
|
|
13
13
|
const [isPending, setIsPending] = useState(false);
|
|
14
14
|
const [actionText, setActionText] = useState("Run transfer again");
|
|
15
|
+
const [transferComplete, setTransferComplete] = useState(false);
|
|
15
16
|
const ctx = useStorefrontContext();
|
|
16
|
-
if (!customer || !!cart.customerId) return;
|
|
17
|
+
if (!customer || !!cart.customerId || transferComplete) return;
|
|
17
18
|
const handleSubmit = async () => {
|
|
18
19
|
try {
|
|
19
20
|
setIsPending(true);
|
|
20
21
|
setActionText("Transferring..");
|
|
21
|
-
await transferCart(ctx);
|
|
22
|
+
const result = await transferCart(ctx);
|
|
23
|
+
setIsPending(false);
|
|
24
|
+
if (result?.customerId) setTransferComplete(true);
|
|
25
|
+
else setActionText("Run transfer again");
|
|
22
26
|
} catch {
|
|
23
27
|
setActionText("Run transfer again");
|
|
24
28
|
setIsPending(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\n\nimport { ExclamationCircleSolid } from '@medusajs/icons';\nimport { Button } from '@medusajs/ui';\n\nimport { useStorefrontContext } from '@/lib/data/context';\nimport { transferCart } from '@/lib/data/customer';\nimport { Customer } from '@/types/graphql';\nimport { Cart } from '@/types/graphql';\n\nfunction CartMismatchBanner(props: { customer: Customer; cart: Cart }) {\n const { customer, cart } = props;\n const [isPending, setIsPending] = useState(false);\n const [actionText, setActionText] = useState('Run transfer again');\n const ctx = useStorefrontContext();\n\n if (!customer || !!cart.customerId) {\n return;\n }\n\n const handleSubmit = async () => {\n try {\n setIsPending(true);\n setActionText('Transferring..');\n\n await transferCart(ctx);\n } catch {\n setActionText('Run transfer again');\n setIsPending(false);\n }\n };\n\n return (\n <div className=\"small:gap-2 small:p-4 mt-2 flex items-center justify-center gap-1 bg-orange-300 p-2 text-center text-sm text-orange-800\">\n <div className=\"small:flex-row small:gap-2 flex flex-col items-center gap-1\">\n <span className=\"flex items-center gap-1\">\n <ExclamationCircleSolid className=\"inline\" />\n Something went wrong when we tried to transfer your cart\n </span>\n\n <span>·</span>\n\n <Button\n variant=\"transparent\"\n className=\"bg-transparent p-0 text-orange-950 hover:bg-transparent focus:bg-transparent active:bg-transparent disabled:text-orange-500\"\n size=\"base\"\n disabled={isPending}\n onClick={handleSubmit}\n >\n {actionText}\n </Button>\n </div>\n </div>\n );\n}\n\nexport { CartMismatchBanner };\n"],"mappings":";;;;;;;;;;AAYA,SAAS,mBAAmB,OAA2C;CACrE,MAAM,EAAE,UAAU,SAAS;CAC3B,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,YAAY,iBAAiB,SAAS,qBAAqB;CAClE,MAAM,MAAM,sBAAsB;AAElC,KAAI,CAAC,YAAY,CAAC,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":["'use client';\n\nimport { useState } from 'react';\n\nimport { ExclamationCircleSolid } from '@medusajs/icons';\nimport { Button } from '@medusajs/ui';\n\nimport { useStorefrontContext } from '@/lib/data/context';\nimport { transferCart } from '@/lib/data/customer';\nimport { Customer } from '@/types/graphql';\nimport { Cart } from '@/types/graphql';\n\nfunction CartMismatchBanner(props: { customer: Customer; cart: Cart }) {\n const { customer, cart } = props;\n const [isPending, setIsPending] = useState(false);\n const [actionText, setActionText] = useState('Run transfer again');\n const [transferComplete, setTransferComplete] = useState(false);\n const ctx = useStorefrontContext();\n\n if (!customer || !!cart.customerId || transferComplete) {\n return;\n }\n\n const handleSubmit = async () => {\n try {\n setIsPending(true);\n setActionText('Transferring..');\n\n const result = await transferCart(ctx);\n\n setIsPending(false);\n if (result?.customerId) {\n setTransferComplete(true);\n } else {\n setActionText('Run transfer again');\n }\n } catch {\n setActionText('Run transfer again');\n setIsPending(false);\n }\n };\n\n return (\n <div className=\"small:gap-2 small:p-4 mt-2 flex items-center justify-center gap-1 bg-orange-300 p-2 text-center text-sm text-orange-800\">\n <div className=\"small:flex-row small:gap-2 flex flex-col items-center gap-1\">\n <span className=\"flex items-center gap-1\">\n <ExclamationCircleSolid className=\"inline\" />\n Something went wrong when we tried to transfer your cart\n </span>\n\n <span>·</span>\n\n <Button\n variant=\"transparent\"\n className=\"bg-transparent p-0 text-orange-950 hover:bg-transparent focus:bg-transparent active:bg-transparent disabled:text-orange-500\"\n size=\"base\"\n disabled={isPending}\n onClick={handleSubmit}\n >\n {actionText}\n </Button>\n </div>\n </div>\n );\n}\n\nexport { CartMismatchBanner };\n"],"mappings":";;;;;;;;;;AAYA,SAAS,mBAAmB,OAA2C;CACrE,MAAM,EAAE,UAAU,SAAS;CAC3B,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,YAAY,iBAAiB,SAAS,qBAAqB;CAClE,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,MAAM;CAC/D,MAAM,MAAM,sBAAsB;AAElC,KAAI,CAAC,YAAY,CAAC,CAAC,KAAK,cAAc,iBACpC;CAGF,MAAM,eAAe,YAAY;AAC/B,MAAI;AACF,gBAAa,KAAK;AAClB,iBAAc,iBAAiB;GAE/B,MAAM,SAAS,MAAM,aAAa,IAAI;AAEtC,gBAAa,MAAM;AACnB,OAAI,QAAQ,WACV,qBAAoB,KAAK;OAEzB,eAAc,qBAAqB;UAE/B;AACN,iBAAc,qBAAqB;AACnC,gBAAa,MAAM;;;AAIvB,QACE,oBAAC;EAAI,WAAU;YACb,qBAAC;GAAI,WAAU;;IACb,qBAAC;KAAK,WAAU;gBACd,oBAAC,0BAAuB,WAAU,WAAW;MAExC;IAEP,oBAAC,oBAAK,MAAQ;IAEd,oBAAC;KACC,SAAQ;KACR,WAAU;KACV,MAAK;KACL,UAAU;KACV,SAAS;eAER;MACM;;IACL;GACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/delete-button/index.d.ts
|
|
4
4
|
declare const DeleteButton: ({
|
|
@@ -9,7 +9,7 @@ declare const DeleteButton: ({
|
|
|
9
9
|
id: string;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
className?: string;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => react_jsx_runtime1.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { DeleteButton };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/error-message/index.d.ts
|
|
4
4
|
declare const ErrorMessage: ({
|
|
@@ -7,7 +7,7 @@ declare const ErrorMessage: ({
|
|
|
7
7
|
}: {
|
|
8
8
|
error?: string | null;
|
|
9
9
|
"data-testid"?: string;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => react_jsx_runtime2.JSX.Element | null;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ErrorMessage };
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/error-message/index.tsx"],"sourcesContent":[],"mappings":";;;cAAM;;iBAAgB;AAMrB;;;AAAA,CAAA,EAAA,GAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/error-message/index.tsx"],"sourcesContent":[],"mappings":";;;cAAM;;iBAAgB;AAMrB;;;AAAA,CAAA,EAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA,GAaA,IAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cart, ShippingOption } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/free-shipping-price-nudge/index.d.ts
|
|
5
5
|
declare function ShippingPriceNudge({
|
|
@@ -10,7 +10,7 @@ declare function ShippingPriceNudge({
|
|
|
10
10
|
variant?: 'popup' | 'inline';
|
|
11
11
|
cart: Cart;
|
|
12
12
|
shippingOptions: ShippingOption[];
|
|
13
|
-
}):
|
|
13
|
+
}): react_jsx_runtime3.JSX.Element | undefined;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { ShippingPriceNudge };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LocalizedClientLink } from "../localized-client-link/index.js";
|
|
2
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
2
3
|
|
|
3
4
|
//#region src/components/interactive-link/index.d.ts
|
|
4
|
-
type InteractiveLinkProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onClick?: () => void;
|
|
5
|
+
type InteractiveLinkProps = React.ComponentPropsWithoutRef<typeof LocalizedClientLink> & {
|
|
6
|
+
textClassName?: string;
|
|
7
|
+
iconClassName?: string;
|
|
8
8
|
};
|
|
9
9
|
declare const InteractiveLink: ({
|
|
10
10
|
href,
|
|
11
11
|
children,
|
|
12
12
|
onClick,
|
|
13
|
+
className,
|
|
14
|
+
textClassName,
|
|
15
|
+
iconClassName,
|
|
13
16
|
...props
|
|
14
|
-
}: InteractiveLinkProps) =>
|
|
17
|
+
}: InteractiveLinkProps) => react_jsx_runtime5.JSX.Element;
|
|
15
18
|
//#endregion
|
|
16
19
|
export { InteractiveLink };
|
|
17
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAKK,oBAAA,GAAuB,KAAA,CAAM,gCACzB;;;AAHsD,CAAA;AAEL,cAOpD,eA0BL,EAAA,CAAA;EAAA,IAAA;EAAA,QAAA;EAAA,OAAA;EAAA,SAAA;EAAA,aAAA;EAAA,aAAA;EAAA,GAAA;AAAA,CAAA,EAlBE,oBAkBF,EAAA,GAlBsB,kBAAA,CAAA,GAAA,CAAA,OAkBtB"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { LocalizedClientLink } from "../localized-client-link/index.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowUpRightMini } from "@medusajs/icons";
|
|
4
|
-
import { Text } from "@medusajs/ui";
|
|
4
|
+
import { Text, clx } from "@medusajs/ui";
|
|
5
5
|
|
|
6
6
|
//#region src/components/interactive-link/index.tsx
|
|
7
|
-
const InteractiveLink = ({ href, children, onClick, ...props }) => {
|
|
7
|
+
const InteractiveLink = ({ href, children, onClick, className, textClassName, iconClassName, ...props }) => {
|
|
8
8
|
return /* @__PURE__ */ jsxs(LocalizedClientLink, {
|
|
9
|
-
className: "group flex items-center gap-x-1",
|
|
9
|
+
className: clx("text-ui-fg-interactive group flex items-center gap-x-1", className),
|
|
10
10
|
href,
|
|
11
11
|
onClick,
|
|
12
12
|
...props,
|
|
13
13
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
14
|
-
className: "text-
|
|
14
|
+
className: clx("text-current", textClassName),
|
|
15
15
|
children
|
|
16
16
|
}), /* @__PURE__ */ jsx(ArrowUpRightMini, {
|
|
17
|
-
className: "duration-150 ease-in-out group-hover:rotate-45",
|
|
18
|
-
color: "
|
|
17
|
+
className: clx("duration-150 ease-in-out group-hover:rotate-45", iconClassName),
|
|
18
|
+
color: "currentColor"
|
|
19
19
|
})]
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":["import { ArrowUpRightMini } from '@medusajs/icons';\nimport { Text } from '@medusajs/ui';\n\nimport { LocalizedClientLink } from '../localized-client-link';\n\ntype InteractiveLinkProps =
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":["import { ArrowUpRightMini } from '@medusajs/icons';\nimport { Text, clx } from '@medusajs/ui';\n\nimport { LocalizedClientLink } from '../localized-client-link';\n\ntype InteractiveLinkProps = React.ComponentPropsWithoutRef<\n typeof LocalizedClientLink\n> & {\n textClassName?: string;\n iconClassName?: string;\n};\n\nconst InteractiveLink = ({\n href,\n children,\n onClick,\n className,\n textClassName,\n iconClassName,\n ...props\n}: InteractiveLinkProps) => {\n return (\n <LocalizedClientLink\n className={clx('text-ui-fg-interactive group flex items-center gap-x-1', className)}\n href={href}\n onClick={onClick}\n {...props}\n >\n <Text className={clx('text-current', textClassName)}>{children}</Text>\n <ArrowUpRightMini\n className={clx(\n 'duration-150 ease-in-out group-hover:rotate-45',\n iconClassName\n )}\n color=\"currentColor\"\n />\n </LocalizedClientLink>\n );\n};\n\nexport { InteractiveLink };\n"],"mappings":";;;;;;AAYA,MAAM,mBAAmB,EACvB,MACA,UACA,SACA,WACA,eACA,eACA,GAAG,YACuB;AAC1B,QACE,qBAAC;EACC,WAAW,IAAI,0DAA0D,UAAU;EAC7E;EACG;EACT,GAAI;aAEJ,oBAAC;GAAK,WAAW,IAAI,gBAAgB,cAAc;GAAG;IAAgB,EACtE,oBAAC;GACC,WAAW,IACT,kDACA,cACD;GACD,OAAM;IACN;GACkB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe, ProductVariant } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/line-item-options/index.d.ts
|
|
5
5
|
type LineItemOptionsProps = {
|
|
@@ -11,7 +11,7 @@ declare const LineItemOptions: ({
|
|
|
11
11
|
variant,
|
|
12
12
|
"data-testid": dataTestid,
|
|
13
13
|
"data-value": dataValue
|
|
14
|
-
}: LineItemOptionsProps) =>
|
|
14
|
+
}: LineItemOptionsProps) => react_jsx_runtime7.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemOptions };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LineItem } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/line-item-price/index.d.ts
|
|
5
5
|
type LineItemPriceProps = {
|
|
@@ -11,7 +11,7 @@ declare const LineItemPrice: ({
|
|
|
11
11
|
item,
|
|
12
12
|
style,
|
|
13
13
|
currencyCode
|
|
14
|
-
}: LineItemPriceProps) =>
|
|
14
|
+
}: LineItemPriceProps) => react_jsx_runtime8.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemPrice };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-price/index.tsx"],"sourcesContent":[],"mappings":";;;;KAMK,kBAAA;QACG;;EADH,YAAA,EAAA,MAAA;AACW,CAAA;cAKV,aAAiB,EAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,CAAA,EAIpB,kBAJoB,EAAA,GAIF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-price/index.tsx"],"sourcesContent":[],"mappings":";;;;KAMK,kBAAA;QACG;;EADH,YAAA,EAAA,MAAA;AACW,CAAA;cAKV,aAAiB,EAAA,CAAA;EAAA,IAAA;EAAA,KAAA;EAAA;AAAA,CAAA,EAIpB,kBAJoB,EAAA,GAIF,kBAAA,CAAA,GAAA,CAAA,OAJE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/localized-client-link/index.d.ts
|
|
5
5
|
type LocalizedClientLinkProps = DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & {
|
|
@@ -10,7 +10,7 @@ declare const LocalizedClientLink: ({
|
|
|
10
10
|
href,
|
|
11
11
|
locale,
|
|
12
12
|
...props
|
|
13
|
-
}: LocalizedClientLinkProps) =>
|
|
13
|
+
}: LocalizedClientLinkProps) => react_jsx_runtime4.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { LocalizedClientLink };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/modal/index.d.ts
|
|
5
5
|
type ModalProps = {
|
|
@@ -20,7 +20,7 @@ declare const Modal: {
|
|
|
20
20
|
children,
|
|
21
21
|
"data-testid": dataTestId,
|
|
22
22
|
"aria-label": ariaLabel
|
|
23
|
-
}: ModalProps):
|
|
23
|
+
}: ModalProps): react_jsx_runtime6.JSX.Element;
|
|
24
24
|
Title: React.FC<{
|
|
25
25
|
children: React.ReactNode;
|
|
26
26
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":[],"mappings":";;;;KAQK,UAAA;;;EAAA,IAAA,CAAA,EAAA,OAAU,GAAA,QAAA,GAKH,OAAM;EAKZ,MAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":[],"mappings":";;;;KAQK,UAAA;;;EAAA,IAAA,CAAA,EAAA,OAAU,GAAA,QAAA,GAKH,OAAM;EAKZ,MAAA,CAAA,EAmEL,OAAA;YAxEW,KAAA,CAAM;;;;cAKZ;;;;;;;;;KAQH,aAAU,kBAAA,CAAA,GAAA,CAAA;;IAAV,QAAA,EA6D+B,KAAA,CAAM,SA7DrC;EAAU,CAAA,CAAA;EA6DqB,WAAM,UAAA,CAAA;cAeA,KAAA,CAAM;EAAN,CAAA,CAAA;;IAQD,QAAA,EAAN,KAAA,CAAM,SAAA;;EAIJ,MAAM,UAAA,CAAA;cAAN,KAAA,CAAM"}
|
|
@@ -24,13 +24,13 @@ const Modal = ({ isOpen, close, size = "medium", search = false, children, "data
|
|
|
24
24
|
leave: "ease-in duration-200",
|
|
25
25
|
leaveFrom: "opacity-100",
|
|
26
26
|
leaveTo: "opacity-0",
|
|
27
|
-
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 h-screen bg-
|
|
27
|
+
children: /* @__PURE__ */ jsx("div", { className: "fixed inset-0 h-screen bg-black/20 backdrop-blur-sm" })
|
|
28
28
|
}), /* @__PURE__ */ jsx("div", {
|
|
29
29
|
className: "fixed inset-0 overflow-y-hidden",
|
|
30
30
|
children: /* @__PURE__ */ jsx("div", {
|
|
31
|
-
className: clx("flex h-full min-h-full justify-center
|
|
32
|
-
"items-center": !search,
|
|
33
|
-
"items-start": search
|
|
31
|
+
className: clx("flex h-full min-h-full justify-center text-center", {
|
|
32
|
+
"items-center p-4": !search,
|
|
33
|
+
"items-start small:pt-[68px] small:px-4 small:pb-4": search
|
|
34
34
|
}),
|
|
35
35
|
children: /* @__PURE__ */ jsx(Transition.Child, {
|
|
36
36
|
as: Fragment,
|
|
@@ -42,12 +42,10 @@ const Modal = ({ isOpen, close, size = "medium", search = false, children, "data
|
|
|
42
42
|
leaveTo: "opacity-0 scale-95",
|
|
43
43
|
children: /* @__PURE__ */ jsx(Dialog.Panel, {
|
|
44
44
|
"data-testid": dataTestId,
|
|
45
|
-
className: clx("flex h-fit max-h-[75vh] w-full transform flex-col justify-start p-5 text-left align-middle transition-all", {
|
|
45
|
+
className: clx("flex h-dvh small:h-fit small:max-h-[75vh] w-full transform flex-col justify-start rounded-none small:rounded-rounded border bg-white p-4 small:p-5 shadow-xl text-left align-middle transition-all", {
|
|
46
46
|
"max-w-md": size === "small",
|
|
47
47
|
"max-w-xl": size === "medium",
|
|
48
|
-
"max-w-3xl": size === "large"
|
|
49
|
-
"bg-transparent shadow-none": search,
|
|
50
|
-
"rounded-rounded border bg-white shadow-xl": !search
|
|
48
|
+
"max-w-3xl": size === "large"
|
|
51
49
|
}),
|
|
52
50
|
children: /* @__PURE__ */ jsx(ModalProvider, {
|
|
53
51
|
close,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Title: React.FC<{ children: React.ReactNode }>","Description: React.FC<{ children: React.ReactNode }>","Body: React.FC<{ children: React.ReactNode }>","Footer: React.FC<{ children: React.ReactNode }>"],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":["import React, { Fragment } from 'react';\n\nimport { X } from '@gfed-medusa/sf-lib-ui/icons/x';\nimport { Dialog, Transition } from '@headlessui/react';\nimport { clx } from '@medusajs/ui';\n\nimport { ModalProvider, useModal } from '@/lib/context/modal-context';\n\ntype ModalProps = {\n isOpen: boolean;\n close: () => void;\n size?: 'small' | 'medium' | 'large';\n search?: boolean;\n children: React.ReactNode;\n 'data-testid'?: string;\n 'aria-label'?: string;\n};\n\nconst Modal = ({\n isOpen,\n close,\n size = 'medium',\n search = false,\n children,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n}: ModalProps) => {\n return (\n <Transition appear show={isOpen} as={Fragment}>\n <Dialog\n as=\"div\"\n className=\"relative z-[75]\"\n onClose={close}\n aria-label={ariaLabel}\n >\n <Transition.Child\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0\"\n enterTo=\"opacity-100\"\n leave=\"ease-in duration-200\"\n leaveFrom=\"opacity-100\"\n leaveTo=\"opacity-0\"\n >\n <div className=\"fixed inset-0 h-screen bg-
|
|
1
|
+
{"version":3,"file":"index.js","names":["Title: React.FC<{ children: React.ReactNode }>","Description: React.FC<{ children: React.ReactNode }>","Body: React.FC<{ children: React.ReactNode }>","Footer: React.FC<{ children: React.ReactNode }>"],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":["import React, { Fragment } from 'react';\n\nimport { X } from '@gfed-medusa/sf-lib-ui/icons/x';\nimport { Dialog, Transition } from '@headlessui/react';\nimport { clx } from '@medusajs/ui';\n\nimport { ModalProvider, useModal } from '@/lib/context/modal-context';\n\ntype ModalProps = {\n isOpen: boolean;\n close: () => void;\n size?: 'small' | 'medium' | 'large';\n search?: boolean;\n children: React.ReactNode;\n 'data-testid'?: string;\n 'aria-label'?: string;\n};\n\nconst Modal = ({\n isOpen,\n close,\n size = 'medium',\n search = false,\n children,\n 'data-testid': dataTestId,\n 'aria-label': ariaLabel,\n}: ModalProps) => {\n return (\n <Transition appear show={isOpen} as={Fragment}>\n <Dialog\n as=\"div\"\n className=\"relative z-[75]\"\n onClose={close}\n aria-label={ariaLabel}\n >\n <Transition.Child\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0\"\n enterTo=\"opacity-100\"\n leave=\"ease-in duration-200\"\n leaveFrom=\"opacity-100\"\n leaveTo=\"opacity-0\"\n >\n <div className=\"fixed inset-0 h-screen bg-black/20 backdrop-blur-sm\" />\n </Transition.Child>\n\n <div className=\"fixed inset-0 overflow-y-hidden\">\n <div\n className={clx(\n 'flex h-full min-h-full justify-center text-center',\n {\n 'items-center p-4': !search,\n 'items-start small:pt-[68px] small:px-4 small:pb-4': search,\n }\n )}\n >\n <Transition.Child\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0 scale-95\"\n enterTo=\"opacity-100 scale-100\"\n leave=\"ease-in duration-200\"\n leaveFrom=\"opacity-100 scale-100\"\n leaveTo=\"opacity-0 scale-95\"\n >\n <Dialog.Panel\n data-testid={dataTestId}\n className={clx(\n 'flex h-dvh small:h-fit small:max-h-[75vh] w-full transform flex-col justify-start rounded-none small:rounded-rounded border bg-white p-4 small:p-5 shadow-xl text-left align-middle transition-all',\n {\n 'max-w-md': size === 'small',\n 'max-w-xl': size === 'medium',\n 'max-w-3xl': size === 'large',\n }\n )}\n >\n <ModalProvider close={close}>{children}</ModalProvider>\n </Dialog.Panel>\n </Transition.Child>\n </div>\n </div>\n </Dialog>\n </Transition>\n );\n};\n\nconst Title: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const { close } = useModal();\n\n return (\n <Dialog.Title className=\"flex items-center justify-between\">\n <div className=\"text-large-semi\">{children}</div>\n <div>\n <button onClick={close} data-testid=\"close-modal-button\">\n <X size={20} />\n </button>\n </div>\n </Dialog.Title>\n );\n};\n\nconst Description: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n return (\n <Dialog.Description className=\"text-small-regular text-ui-fg-base flex h-full items-center justify-center pb-4 pt-2\">\n {children}\n </Dialog.Description>\n );\n};\n\nconst Body: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n return <div className=\"flex justify-center\">{children}</div>;\n};\n\nconst Footer: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n return (\n <div className=\"flex items-center justify-end gap-x-4\">{children}</div>\n );\n};\n\nModal.Title = Title;\nModal.Description = Description;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport { Modal };\n"],"mappings":";;;;;;;;AAkBA,MAAM,SAAS,EACb,QACA,OACA,OAAO,UACP,SAAS,OACT,UACA,eAAe,YACf,cAAc,gBACE;AAChB,QACE,oBAAC;EAAW;EAAO,MAAM;EAAQ,IAAI;YACnC,qBAAC;GACC,IAAG;GACH,WAAU;GACV,SAAS;GACT,cAAY;cAEZ,oBAAC,WAAW;IACV,IAAI;IACJ,OAAM;IACN,WAAU;IACV,SAAQ;IACR,OAAM;IACN,WAAU;IACV,SAAQ;cAER,oBAAC,SAAI,WAAU,wDAAwD;KACtD,EAEnB,oBAAC;IAAI,WAAU;cACb,oBAAC;KACC,WAAW,IACT,qDACA;MACE,oBAAoB,CAAC;MACrB,qDAAqD;MACtD,CACF;eAED,oBAAC,WAAW;MACV,IAAI;MACJ,OAAM;MACN,WAAU;MACV,SAAQ;MACR,OAAM;MACN,WAAU;MACV,SAAQ;gBAER,oBAAC,OAAO;OACN,eAAa;OACb,WAAW,IACT,sMACA;QACE,YAAY,SAAS;QACrB,YAAY,SAAS;QACrB,aAAa,SAAS;QACvB,CACF;iBAED,oBAAC;QAAqB;QAAQ;SAAyB;QAC1C;OACE;MACf;KACF;IACC;GACE;;AAIjB,MAAMA,SAAkD,EAAE,eAAe;CACvE,MAAM,EAAE,UAAU,UAAU;AAE5B,QACE,qBAAC,OAAO;EAAM,WAAU;aACtB,oBAAC;GAAI,WAAU;GAAmB;IAAe,EACjD,oBAAC,mBACC,oBAAC;GAAO,SAAS;GAAO,eAAY;aAClC,oBAAC,KAAE,MAAM,KAAM;IACR,GACL;GACO;;AAInB,MAAMC,eAAwD,EAAE,eAAe;AAC7E,QACE,oBAAC,OAAO;EAAY,WAAU;EAC3B;GACkB;;AAIzB,MAAMC,QAAiD,EAAE,eAAe;AACtE,QAAO,oBAAC;EAAI,WAAU;EAAuB;GAAe;;AAG9D,MAAMC,UAAmD,EAAE,eAAe;AACxE,QACE,oBAAC;EAAI,WAAU;EAAyC;GAAe;;AAI3E,MAAM,QAAQ;AACd,MAAM,cAAc;AACpB,MAAM,OAAO;AACb,MAAM,SAAS"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { VariantPrice } from "../../types/prices.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/preview-price/index.d.ts
|
|
5
5
|
declare function PreviewPrice({
|
|
6
6
|
price
|
|
7
7
|
}: {
|
|
8
8
|
price: VariantPrice;
|
|
9
|
-
}):
|
|
9
|
+
}): react_jsx_runtime15.JSX.Element | null;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { PreviewPrice };
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/preview-price/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAIS,YAAA;;;SAAiC;IAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/preview-price/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAIS,YAAA;;;SAAiC;IAAc,mBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as class_variance_authority_types0 from "class-variance-authority/types";
|
|
4
4
|
|
|
@@ -59,7 +59,7 @@ declare function ProductCard({
|
|
|
59
59
|
variant,
|
|
60
60
|
size,
|
|
61
61
|
className
|
|
62
|
-
}: ProductCardProps):
|
|
62
|
+
}: ProductCardProps): react_jsx_runtime11.JSX.Element;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { ProductCard };
|
|
65
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -93,7 +93,7 @@ function ProductCard({ product, rating, badge, variants, variant, size, classNam
|
|
|
93
93
|
quality: 60,
|
|
94
94
|
sizes: "(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 240px, 200px"
|
|
95
95
|
}), badge && /* @__PURE__ */ jsx("div", {
|
|
96
|
-
className: "absolute
|
|
96
|
+
className: "absolute left-2 top-2",
|
|
97
97
|
children: /* @__PURE__ */ jsx(Badge, {
|
|
98
98
|
variant: "default",
|
|
99
99
|
children: badge.label
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/product-card/index.tsx"],"sourcesContent":["'use client';\n\nimport Image from 'next/image';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\n\nimport { Badge } from '@gfed-medusa/sf-lib-ui/components/badge';\nimport { Button } from '@gfed-medusa/sf-lib-ui/components/button';\nimport { RatingCount } from '@gfed-medusa/sf-lib-ui/components/rating-count';\nimport { VariantSelector } from '@gfed-medusa/sf-lib-ui/components/variant-selector';\nimport { cn } from '@gfed-medusa/sf-lib-ui/lib/utils';\n\nconst productCardVariants = cva(\n 'rounded-2xl border overflow-hidden transition',\n {\n variants: {\n variant: {\n default: 'flex flex-col shadow-sm hover:shadow-md',\n withAddToCart: 'flex flex-col shadow-sm hover:shadow-md',\n minimal: 'flex flex-col hover:shadow hover:border-muted-foreground/30',\n },\n size: {\n sm: 'w-48',\n md: 'w-64',\n lg: 'w-80',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n);\n\ninterface Price {\n current: string;\n old?: string;\n}\n\ninterface Product {\n id: string;\n image: {\n src: string;\n alt?: string;\n };\n localize?: {\n currency: string;\n locale: string;\n };\n title: string;\n href?: string;\n price: Price;\n}\n\ninterface ProductCardProps extends VariantProps<typeof productCardVariants> {\n product: Product;\n rating?: {\n average: number;\n count?: number;\n };\n badge?: {\n label: string;\n variant?: 'default' | 'sale' | 'new' | 'limited';\n };\n variants?: {\n options: {\n value: string;\n label?: string;\n imageSrc?: string;\n color?: string;\n }[];\n value: string;\n onChange: (value: string) => void;\n };\n quantity?: {\n value: number;\n onChange: (value: number) => void;\n };\n className?: string;\n}\n\nconst formatPrice = (price: Price, locale = 'en-GB', currency = 'GBP') => {\n const formatter = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n });\n\n return {\n currentPrice: formatter.format(Number(price.current)),\n oldPrice: price.old ? formatter.format(Number(price.old)) : undefined,\n };\n};\n\nexport function ProductCard({\n product,\n rating,\n badge,\n variants,\n variant,\n size,\n className,\n}: ProductCardProps) {\n const { currentPrice, oldPrice } = formatPrice(\n product.price,\n product.localize?.locale,\n product.localize?.currency\n );\n\n switch (variant) {\n case 'minimal':\n return (\n <div\n className={cn(\n productCardVariants({ variant, size }),\n 'w-60 overflow-hidden rounded-2xl border p-0 shadow-sm'\n )}\n >\n <div className=\"relative h-72 w-full overflow-hidden\">\n <Image\n src={product.image.src}\n alt={product.image.alt ?? product.title}\n fill\n className=\"object-cover\"\n sizes=\"240px\"\n quality={60}\n />\n </div>\n\n <div className=\"flex flex-col gap-1 p-3\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"truncate text-base font-medium\">\n {product.href ? (\n <a href={product.href} className=\"hover:underline\">\n {product.title}\n </a>\n ) : (\n product.title\n )}\n </h3>\n <p className=\"mt-0 text-lg font-semibold text-gray-900\">\n {currentPrice}\n </p>\n </div>\n <p className=\"text-xs text-gray-500\">7 colors</p>\n </div>\n </div>\n );\n default:\n return (\n <div className={cn(productCardVariants({ variant, size }), className)}>\n {/* Image */}\n <div className=\"relative aspect-[1/1]\">\n <Image\n src={product.image.src}\n alt={product.image.alt ?? product.title}\n fill\n className={cn('object-cover')}\n priority\n quality={60}\n sizes=\"(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 240px, 200px\"\n />\n {badge && (\n <div className=\"absolute
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/product-card/index.tsx"],"sourcesContent":["'use client';\n\nimport Image from 'next/image';\n\nimport { type VariantProps, cva } from 'class-variance-authority';\n\nimport { Badge } from '@gfed-medusa/sf-lib-ui/components/badge';\nimport { Button } from '@gfed-medusa/sf-lib-ui/components/button';\nimport { RatingCount } from '@gfed-medusa/sf-lib-ui/components/rating-count';\nimport { VariantSelector } from '@gfed-medusa/sf-lib-ui/components/variant-selector';\nimport { cn } from '@gfed-medusa/sf-lib-ui/lib/utils';\n\nconst productCardVariants = cva(\n 'rounded-2xl border overflow-hidden transition',\n {\n variants: {\n variant: {\n default: 'flex flex-col shadow-sm hover:shadow-md',\n withAddToCart: 'flex flex-col shadow-sm hover:shadow-md',\n minimal: 'flex flex-col hover:shadow hover:border-muted-foreground/30',\n },\n size: {\n sm: 'w-48',\n md: 'w-64',\n lg: 'w-80',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n);\n\ninterface Price {\n current: string;\n old?: string;\n}\n\ninterface Product {\n id: string;\n image: {\n src: string;\n alt?: string;\n };\n localize?: {\n currency: string;\n locale: string;\n };\n title: string;\n href?: string;\n price: Price;\n}\n\ninterface ProductCardProps extends VariantProps<typeof productCardVariants> {\n product: Product;\n rating?: {\n average: number;\n count?: number;\n };\n badge?: {\n label: string;\n variant?: 'default' | 'sale' | 'new' | 'limited';\n };\n variants?: {\n options: {\n value: string;\n label?: string;\n imageSrc?: string;\n color?: string;\n }[];\n value: string;\n onChange: (value: string) => void;\n };\n quantity?: {\n value: number;\n onChange: (value: number) => void;\n };\n className?: string;\n}\n\nconst formatPrice = (price: Price, locale = 'en-GB', currency = 'GBP') => {\n const formatter = new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n });\n\n return {\n currentPrice: formatter.format(Number(price.current)),\n oldPrice: price.old ? formatter.format(Number(price.old)) : undefined,\n };\n};\n\nexport function ProductCard({\n product,\n rating,\n badge,\n variants,\n variant,\n size,\n className,\n}: ProductCardProps) {\n const { currentPrice, oldPrice } = formatPrice(\n product.price,\n product.localize?.locale,\n product.localize?.currency\n );\n\n switch (variant) {\n case 'minimal':\n return (\n <div\n className={cn(\n productCardVariants({ variant, size }),\n 'w-60 overflow-hidden rounded-2xl border p-0 shadow-sm'\n )}\n >\n <div className=\"relative h-72 w-full overflow-hidden\">\n <Image\n src={product.image.src}\n alt={product.image.alt ?? product.title}\n fill\n className=\"object-cover\"\n sizes=\"240px\"\n quality={60}\n />\n </div>\n\n <div className=\"flex flex-col gap-1 p-3\">\n <div className=\"flex items-center justify-between\">\n <h3 className=\"truncate text-base font-medium\">\n {product.href ? (\n <a href={product.href} className=\"hover:underline\">\n {product.title}\n </a>\n ) : (\n product.title\n )}\n </h3>\n <p className=\"mt-0 text-lg font-semibold text-gray-900\">\n {currentPrice}\n </p>\n </div>\n <p className=\"text-xs text-gray-500\">7 colors</p>\n </div>\n </div>\n );\n default:\n return (\n <div className={cn(productCardVariants({ variant, size }), className)}>\n {/* Image */}\n <div className=\"relative aspect-[1/1]\">\n <Image\n src={product.image.src}\n alt={product.image.alt ?? product.title}\n fill\n className={cn('object-cover')}\n priority\n quality={60}\n sizes=\"(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 240px, 200px\"\n />\n {badge && (\n <div className=\"absolute left-2 top-2\">\n <Badge variant=\"default\">{badge.label}</Badge>\n </div>\n )}\n </div>\n\n {/* Content */}\n <div className=\"flex flex-col gap-2 p-3\">\n <h3 className=\"truncate text-base font-medium\">\n {product.href ? (\n <a href={product.href} className=\"hover:underline\">\n {product.title}\n </a>\n ) : (\n product.title\n )}\n </h3>\n\n {/* Price */}\n <div className=\"flex items-center gap-2\">\n <p className=\"text-lg font-semibold\">{currentPrice}</p>\n {oldPrice && (\n <p className=\"text-muted-foreground text-sm line-through\">\n {oldPrice}\n </p>\n )}\n </div>\n\n {/* Rating */}\n {rating !== undefined && (\n <div\n data-testid=\"product-card-rating\"\n className=\"flex items-center gap-2\"\n >\n <RatingCount\n average={rating.average}\n ratingCount={rating.count}\n />\n </div>\n )}\n\n {/* Variant Selector */}\n {variants && (\n <VariantSelector\n options={variants.options}\n value={variants.value ?? ''}\n onChange={variants.onChange}\n type=\"color\"\n />\n )}\n\n {/* Add to Cart button */}\n {variant === 'withAddToCart' && (\n <Button variant=\"default\" className=\"w-full cursor-pointer\">\n Add to Cart\n </Button>\n )}\n </div>\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,sBAAsB,IAC1B,iDACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,eAAe;GACf,SAAS;GACV;EACD,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAiDD,MAAM,eAAe,OAAc,SAAS,SAAS,WAAW,UAAU;CACxE,MAAM,YAAY,IAAI,KAAK,aAAa,QAAQ;EAC9C,OAAO;EACP;EACD,CAAC;AAEF,QAAO;EACL,cAAc,UAAU,OAAO,OAAO,MAAM,QAAQ,CAAC;EACrD,UAAU,MAAM,MAAM,UAAU,OAAO,OAAO,MAAM,IAAI,CAAC,GAAG;EAC7D;;AAGH,SAAgB,YAAY,EAC1B,SACA,QACA,OACA,UACA,SACA,MACA,aACmB;CACnB,MAAM,EAAE,cAAc,aAAa,YACjC,QAAQ,OACR,QAAQ,UAAU,QAClB,QAAQ,UAAU,SACnB;AAED,SAAQ,SAAR;EACE,KAAK,UACH,QACE,qBAAC;GACC,WAAW,GACT,oBAAoB;IAAE;IAAS;IAAM,CAAC,EACtC,wDACD;cAED,oBAAC;IAAI,WAAU;cACb,oBAAC;KACC,KAAK,QAAQ,MAAM;KACnB,KAAK,QAAQ,MAAM,OAAO,QAAQ;KAClC;KACA,WAAU;KACV,OAAM;KACN,SAAS;MACT;KACE,EAEN,qBAAC;IAAI,WAAU;eACb,qBAAC;KAAI,WAAU;gBACb,oBAAC;MAAG,WAAU;gBACX,QAAQ,OACP,oBAAC;OAAE,MAAM,QAAQ;OAAM,WAAU;iBAC9B,QAAQ;QACP,GAEJ,QAAQ;OAEP,EACL,oBAAC;MAAE,WAAU;gBACV;OACC;MACA,EACN,oBAAC;KAAE,WAAU;eAAwB;MAAY;KAC7C;IACF;EAEV,QACE,QACE,qBAAC;GAAI,WAAW,GAAG,oBAAoB;IAAE;IAAS;IAAM,CAAC,EAAE,UAAU;cAEnE,qBAAC;IAAI,WAAU;eACb,oBAAC;KACC,KAAK,QAAQ,MAAM;KACnB,KAAK,QAAQ,MAAM,OAAO,QAAQ;KAClC;KACA,WAAW,GAAG,eAAe;KAC7B;KACA,SAAS;KACT,OAAM;MACN,EACD,SACC,oBAAC;KAAI,WAAU;eACb,oBAAC;MAAM,SAAQ;gBAAW,MAAM;OAAc;MAC1C;KAEJ,EAGN,qBAAC;IAAI,WAAU;;KACb,oBAAC;MAAG,WAAU;gBACX,QAAQ,OACP,oBAAC;OAAE,MAAM,QAAQ;OAAM,WAAU;iBAC9B,QAAQ;QACP,GAEJ,QAAQ;OAEP;KAGL,qBAAC;MAAI,WAAU;iBACb,oBAAC;OAAE,WAAU;iBAAyB;QAAiB,EACtD,YACC,oBAAC;OAAE,WAAU;iBACV;QACC;OAEF;KAGL,WAAW,UACV,oBAAC;MACC,eAAY;MACZ,WAAU;gBAEV,oBAAC;OACC,SAAS,OAAO;OAChB,aAAa,OAAO;QACpB;OACE;KAIP,YACC,oBAAC;MACC,SAAS,SAAS;MAClB,OAAO,SAAS,SAAS;MACzB,UAAU,SAAS;MACnB,MAAK;OACL;KAIH,YAAY,mBACX,oBAAC;MAAO,SAAQ;MAAU,WAAU;gBAAwB;OAEnD;;KAEP;IACF"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { Product } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/product-preview/index.d.ts
|
|
5
|
+
type ProductPreviewProduct = Pick<Product, 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'>;
|
|
5
6
|
type ProductPreviewProps = {
|
|
6
|
-
product:
|
|
7
|
+
product: ProductPreviewProduct;
|
|
7
8
|
isFeatured?: boolean;
|
|
9
|
+
imagePriority?: boolean;
|
|
10
|
+
imageFetchPriority?: 'auto' | 'high' | 'low';
|
|
8
11
|
};
|
|
9
12
|
declare function ProductPreview({
|
|
10
13
|
product,
|
|
11
|
-
isFeatured
|
|
12
|
-
|
|
14
|
+
isFeatured,
|
|
15
|
+
imagePriority,
|
|
16
|
+
imageFetchPriority
|
|
17
|
+
}: ProductPreviewProps): react_jsx_runtime9.JSX.Element;
|
|
13
18
|
//#endregion
|
|
14
|
-
export { ProductPreview, ProductPreviewProps };
|
|
19
|
+
export { ProductPreview, ProductPreviewProduct, ProductPreviewProps };
|
|
15
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,mBAAA;WACD
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,aAAA,CAAA,EAAA,OAAmB;EAOtB,kBAAc,CAAA,EAAA,MAAA,GAAA,MAAA,GAAA,KAAA;CACrB;iBADO,cAAA,CAEP;EAAA,OAAA;EAAA,UAAA;EAAA,aAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,kBAAA,CAAA,GAAA,CAAA,OAHpB"}
|
|
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
import { Text } from "@medusajs/ui";
|
|
7
7
|
|
|
8
8
|
//#region src/components/product-preview/index.tsx
|
|
9
|
-
function ProductPreview({ product, isFeatured }) {
|
|
9
|
+
function ProductPreview({ product, isFeatured, imagePriority = false, imageFetchPriority }) {
|
|
10
10
|
const { cheapestPrice } = getProductPrice({ product });
|
|
11
11
|
return /* @__PURE__ */ jsx(LocalizedClientLink, {
|
|
12
12
|
href: `/products/${product.handle}`,
|
|
@@ -17,7 +17,9 @@ function ProductPreview({ product, isFeatured }) {
|
|
|
17
17
|
thumbnail: product.thumbnail,
|
|
18
18
|
images: product.images,
|
|
19
19
|
size: "full",
|
|
20
|
-
isFeatured
|
|
20
|
+
isFeatured,
|
|
21
|
+
imagePriority,
|
|
22
|
+
imageFetchPriority
|
|
21
23
|
}), /* @__PURE__ */ jsxs("div", {
|
|
22
24
|
className: "txt-compact-medium mt-4 flex justify-between",
|
|
23
25
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":["import { Text } from '@medusajs/ui';\n\nimport { getProductPrice } from '@/lib/utils/get-product-price';\nimport { Product } from '@/types/graphql';\n\nimport { LocalizedClientLink } from '../localized-client-link';\nimport { PreviewPrice } from '../preview-price';\nimport { Thumbnail } from '../thumbnail';\n\nexport type ProductPreviewProps = {\n product:
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":["import { Text } from '@medusajs/ui';\n\nimport { getProductPrice } from '@/lib/utils/get-product-price';\nimport { Product } from '@/types/graphql';\n\nimport { LocalizedClientLink } from '../localized-client-link';\nimport { PreviewPrice } from '../preview-price';\nimport { Thumbnail } from '../thumbnail';\n\nexport type ProductPreviewProduct = Pick<\n Product,\n 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'\n>;\n\nexport type ProductPreviewProps = {\n product: ProductPreviewProduct;\n isFeatured?: boolean;\n imagePriority?: boolean;\n imageFetchPriority?: 'auto' | 'high' | 'low';\n};\n\nfunction ProductPreview({\n product,\n isFeatured,\n imagePriority = false,\n imageFetchPriority,\n}: ProductPreviewProps) {\n const { cheapestPrice } = getProductPrice({\n product,\n });\n\n return (\n <LocalizedClientLink href={`/products/${product.handle}`} className=\"group\">\n <div data-testid=\"product-wrapper\">\n <Thumbnail\n thumbnail={product.thumbnail}\n images={product.images}\n size=\"full\"\n isFeatured={isFeatured}\n imagePriority={imagePriority}\n imageFetchPriority={imageFetchPriority}\n />\n <div className=\"txt-compact-medium mt-4 flex justify-between\">\n <Text className=\"text-ui-fg-subtle\" data-testid=\"product-title\">\n {product.title}\n </Text>\n <div className=\"flex items-center gap-x-2\">\n {cheapestPrice && <PreviewPrice price={cheapestPrice} />}\n </div>\n </div>\n </div>\n </LocalizedClientLink>\n );\n}\n\nexport { ProductPreview };\n"],"mappings":";;;;;;;;AAqBA,SAAS,eAAe,EACtB,SACA,YACA,gBAAgB,OAChB,sBACsB;CACtB,MAAM,EAAE,kBAAkB,gBAAgB,EACxC,SACD,CAAC;AAEF,QACE,oBAAC;EAAoB,MAAM,aAAa,QAAQ;EAAU,WAAU;YAClE,qBAAC;GAAI,eAAY;cACf,oBAAC;IACC,WAAW,QAAQ;IACnB,QAAQ,QAAQ;IAChB,MAAK;IACO;IACG;IACK;KACpB,EACF,qBAAC;IAAI,WAAU;eACb,oBAAC;KAAK,WAAU;KAAoB,eAAY;eAC7C,QAAQ;MACJ,EACP,oBAAC;KAAI,WAAU;eACZ,iBAAiB,oBAAC,gBAAa,OAAO,gBAAiB;MACpD;KACF;IACF;GACc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/submit-button/index.d.ts
|
|
5
5
|
declare function SubmitButton({
|
|
@@ -14,7 +14,7 @@ declare function SubmitButton({
|
|
|
14
14
|
className?: string;
|
|
15
15
|
'data-testid'?: string;
|
|
16
16
|
isLoading?: boolean;
|
|
17
|
-
}):
|
|
17
|
+
}): react_jsx_runtime10.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SubmitButton };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":[],"mappings":";;;KAOK,cAAA;;EAAA,MAAA,CAAA,EAAA,GAAA,EAAA,GAAc,IAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":[],"mappings":";;;KAOK,cAAA;;EAAA,MAAA,CAAA,EAAA,GAAA,EAAA,GAAc,IAAA;EAYb,IAAA,CAAA,EAAA,OAqCL,GAAA,QArCyB,GAAA,OAAA,GAAA,MAAT,GAAM,QAAE;;;;;;;cAAnB,WAAW,KAAA,CAAM,GAAG"}
|
|
@@ -5,7 +5,7 @@ import Image from "next/image";
|
|
|
5
5
|
import { PlaceholderImage } from "@gfed-medusa/sf-lib-ui/icons/placeholder-image";
|
|
6
6
|
|
|
7
7
|
//#region src/components/thumbnail/index.tsx
|
|
8
|
-
const Thumbnail = ({ thumbnail, images, size = "small", isFeatured, className, "data-testid": dataTestid }) => {
|
|
8
|
+
const Thumbnail = ({ thumbnail, images, size = "small", isFeatured, imagePriority = false, imageFetchPriority, className, "data-testid": dataTestid }) => {
|
|
9
9
|
const initialImage = thumbnail || images?.[0]?.url;
|
|
10
10
|
return /* @__PURE__ */ jsx(Container, {
|
|
11
11
|
className: clx("rounded-large bg-ui-bg-subtle shadow-elevation-card-rest group-hover:shadow-elevation-card-hover relative w-full overflow-hidden p-4 transition-shadow duration-150 ease-in-out", className, {
|
|
@@ -20,16 +20,20 @@ const Thumbnail = ({ thumbnail, images, size = "small", isFeatured, className, "
|
|
|
20
20
|
"data-testid": dataTestid,
|
|
21
21
|
children: /* @__PURE__ */ jsx(ImageOrPlaceholder, {
|
|
22
22
|
image: initialImage,
|
|
23
|
-
size
|
|
23
|
+
size,
|
|
24
|
+
imagePriority,
|
|
25
|
+
imageFetchPriority
|
|
24
26
|
})
|
|
25
27
|
});
|
|
26
28
|
};
|
|
27
|
-
const ImageOrPlaceholder = ({ image, size }) => {
|
|
29
|
+
const ImageOrPlaceholder = ({ image, size, imagePriority, imageFetchPriority }) => {
|
|
28
30
|
return image ? /* @__PURE__ */ jsx(Image, {
|
|
29
31
|
src: image,
|
|
30
32
|
alt: "Thumbnail",
|
|
31
33
|
className: "absolute inset-0 object-cover object-center",
|
|
32
34
|
draggable: false,
|
|
35
|
+
priority: imagePriority,
|
|
36
|
+
...imageFetchPriority ? { fetchPriority: imageFetchPriority } : {},
|
|
33
37
|
quality: 40,
|
|
34
38
|
sizes: "(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 480px, 800px",
|
|
35
39
|
fill: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Thumbnail: React.FC<ThumbnailProps>"],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport Image from 'next/image';\n\nimport { PlaceholderImage } from '@gfed-medusa/sf-lib-ui/icons/placeholder-image';\nimport { Container, clx } from '@medusajs/ui';\n\ntype ThumbnailProps = {\n thumbnail?: string | null;\n // TODO: Fix image typings\n images?: any[] | null;\n size?: 'small' | 'medium' | 'large' | 'full' | 'square';\n isFeatured?: boolean;\n className?: string;\n 'data-testid'?: string;\n};\n\nconst Thumbnail: React.FC<ThumbnailProps> = ({\n thumbnail,\n images,\n size = 'small',\n isFeatured,\n className,\n 'data-testid': dataTestid,\n}) => {\n const initialImage = thumbnail || images?.[0]?.url;\n\n return (\n <Container\n className={clx(\n 'rounded-large bg-ui-bg-subtle shadow-elevation-card-rest group-hover:shadow-elevation-card-hover relative w-full overflow-hidden p-4 transition-shadow duration-150 ease-in-out',\n className,\n {\n 'aspect-[11/14]': isFeatured,\n 'aspect-[9/16]': !isFeatured && size !== 'square',\n 'aspect-[1/1]': size === 'square',\n 'w-[180px]': size === 'small',\n 'w-[290px]': size === 'medium',\n 'w-[440px]': size === 'large',\n 'w-full': size === 'full',\n }\n )}\n data-testid={dataTestid}\n >\n <ImageOrPlaceholder
|
|
1
|
+
{"version":3,"file":"index.js","names":["Thumbnail: React.FC<ThumbnailProps>"],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport Image from 'next/image';\n\nimport { PlaceholderImage } from '@gfed-medusa/sf-lib-ui/icons/placeholder-image';\nimport { Container, clx } from '@medusajs/ui';\n\ntype ThumbnailProps = {\n thumbnail?: string | null;\n // TODO: Fix image typings\n images?: any[] | null;\n size?: 'small' | 'medium' | 'large' | 'full' | 'square';\n isFeatured?: boolean;\n imagePriority?: boolean;\n imageFetchPriority?: 'auto' | 'high' | 'low';\n className?: string;\n 'data-testid'?: string;\n};\n\nconst Thumbnail: React.FC<ThumbnailProps> = ({\n thumbnail,\n images,\n size = 'small',\n isFeatured,\n imagePriority = false,\n imageFetchPriority,\n className,\n 'data-testid': dataTestid,\n}) => {\n const initialImage = thumbnail || images?.[0]?.url;\n\n return (\n <Container\n className={clx(\n 'rounded-large bg-ui-bg-subtle shadow-elevation-card-rest group-hover:shadow-elevation-card-hover relative w-full overflow-hidden p-4 transition-shadow duration-150 ease-in-out',\n className,\n {\n 'aspect-[11/14]': isFeatured,\n 'aspect-[9/16]': !isFeatured && size !== 'square',\n 'aspect-[1/1]': size === 'square',\n 'w-[180px]': size === 'small',\n 'w-[290px]': size === 'medium',\n 'w-[440px]': size === 'large',\n 'w-full': size === 'full',\n }\n )}\n data-testid={dataTestid}\n >\n <ImageOrPlaceholder\n image={initialImage}\n size={size}\n imagePriority={imagePriority}\n imageFetchPriority={imageFetchPriority}\n />\n </Container>\n );\n};\n\nconst ImageOrPlaceholder = ({\n image,\n size,\n imagePriority,\n imageFetchPriority,\n}: Pick<\n ThumbnailProps,\n 'size' | 'imagePriority' | 'imageFetchPriority'\n> & { image?: string }) => {\n return image ? (\n <Image\n src={image}\n alt=\"Thumbnail\"\n className=\"absolute inset-0 object-cover object-center\"\n draggable={false}\n priority={imagePriority}\n {...(imageFetchPriority ? { fetchPriority: imageFetchPriority } : {})}\n quality={40}\n sizes=\"(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 480px, 800px\"\n fill\n />\n ) : (\n <div className=\"absolute inset-0 flex h-full w-full items-center justify-center\">\n <PlaceholderImage size={size === 'small' ? 16 : 24} />\n </div>\n );\n};\n\nexport { Thumbnail };\n"],"mappings":";;;;;;;AAmBA,MAAMA,aAAuC,EAC3C,WACA,QACA,OAAO,SACP,YACA,gBAAgB,OAChB,oBACA,WACA,eAAe,iBACX;CACJ,MAAM,eAAe,aAAa,SAAS,IAAI;AAE/C,QACE,oBAAC;EACC,WAAW,IACT,mLACA,WACA;GACE,kBAAkB;GAClB,iBAAiB,CAAC,cAAc,SAAS;GACzC,gBAAgB,SAAS;GACzB,aAAa,SAAS;GACtB,aAAa,SAAS;GACtB,aAAa,SAAS;GACtB,UAAU,SAAS;GACpB,CACF;EACD,eAAa;YAEb,oBAAC;GACC,OAAO;GACD;GACS;GACK;IACpB;GACQ;;AAIhB,MAAM,sBAAsB,EAC1B,OACA,MACA,eACA,yBAIyB;AACzB,QAAO,QACL,oBAAC;EACC,KAAK;EACL,KAAI;EACJ,WAAU;EACV,WAAW;EACX,UAAU;EACV,GAAK,qBAAqB,EAAE,eAAe,oBAAoB,GAAG,EAAE;EACpE,SAAS;EACT,OAAM;EACN;GACA,GAEF,oBAAC;EAAI,WAAU;YACb,oBAAC,oBAAiB,MAAM,SAAS,UAAU,KAAK,KAAM;GAClD"}
|
|
@@ -3,7 +3,7 @@ import Medusa from "@medusajs/js-sdk";
|
|
|
3
3
|
//#region src/lib/config/medusa.ts
|
|
4
4
|
const sdk = new Medusa({
|
|
5
5
|
baseUrl: process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL || "http://localhost:9000",
|
|
6
|
-
debug:
|
|
6
|
+
debug: false,
|
|
7
7
|
publishableKey: process.env.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY
|
|
8
8
|
});
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/context/apollo-context.d.ts
|
|
5
5
|
declare function ApolloClientProvider({
|
|
6
6
|
children
|
|
7
|
-
}: PropsWithChildren):
|
|
7
|
+
}: PropsWithChildren): react_jsx_runtime13.JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ApolloClientProvider };
|
|
10
10
|
//# sourceMappingURL=apollo-context.d.ts.map
|