@gfed-medusa/sf-lib-common 3.1.1 → 3.3.3
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/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 +2 -2
- package/dist/components/interactive-link/index.d.ts.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/localized-client-link/index.d.ts +2 -2
- package/dist/components/localized-client-link/index.d.ts.map +1 -1
- package/dist/components/modal/index.d.ts +2 -2
- package/dist/components/modal/index.d.ts.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.js +14 -9
- package/dist/components/product-card/index.js.map +1 -1
- package/dist/components/product-preview/index.d.ts +2 -2
- package/dist/components/product-preview/index.d.ts.map +1 -1
- package/dist/components/submit-button/index.d.ts +2 -2
- package/dist/components/submit-button/index.d.ts.map +1 -1
- package/dist/components/thumbnail/index.js +1 -1
- package/dist/components/thumbnail/index.js.map +1 -1
- package/dist/lib/context/apollo-context.d.ts +2 -2
- package/dist/lib/context/apollo-context.d.ts.map +1 -1
- package/dist/lib/context/modal-context.d.ts +2 -2
- package/dist/lib/data/collections.js +3 -3
- package/dist/lib/data/collections.js.map +1 -1
- package/dist/lib/data/context.d.ts +2 -2
- package/dist/lib/gql/fragments/cart.d.ts +9 -9
- package/dist/lib/gql/fragments/customer.d.ts +3 -3
- package/dist/lib/gql/fragments/product.d.ts +10 -9
- package/dist/lib/gql/fragments/product.d.ts.map +1 -1
- package/dist/lib/gql/fragments/product.js +12 -1
- 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 +4 -3
- package/dist/lib/gql/queries/collections.d.ts.map +1 -1
- package/dist/lib/gql/queries/collections.js +14 -2
- package/dist/lib/gql/queries/collections.js.map +1 -1
- 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/order.d.ts +4 -4
- package/dist/lib/gql/queries/product.d.ts +3 -3
- package/dist/lib/gql/queries/regions.d.ts +3 -3
- package/dist/lib/gql/queries/shipping.d.ts +3 -3
- package/dist/lib/hooks/use-apollo.d.ts +2 -2
- package/dist/lib/utils/imagekit.d.ts +13 -0
- package/dist/lib/utils/imagekit.d.ts.map +1 -0
- package/dist/lib/utils/imagekit.js +29 -0
- package/dist/lib/utils/imagekit.js.map +1 -0
- package/dist/types/graphql.d.ts +31 -1
- package/dist/types/graphql.d.ts.map +1 -1
- package/dist/types/graphql.js +296 -1
- package/dist/types/graphql.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime9 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_runtime9.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_runtime4 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_runtime4.JSX.Element | undefined;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CartMismatchBanner };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime5 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_runtime5.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_runtime10 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_runtime10.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,mBAAA,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_runtime7 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_runtime7.JSX.Element | undefined;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { ShippingPriceNudge };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/interactive-link/index.d.ts
|
|
4
4
|
type InteractiveLinkProps = {
|
|
@@ -11,7 +11,7 @@ declare const InteractiveLink: ({
|
|
|
11
11
|
children,
|
|
12
12
|
onClick,
|
|
13
13
|
...props
|
|
14
|
-
}: InteractiveLinkProps) =>
|
|
14
|
+
}: InteractiveLinkProps) => react_jsx_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { InteractiveLink };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":";;;KAKK,oBAAA;;aAEQ,KAAA,CAAM;EAFd,OAAA,CAAA,EAAA,GAAA,GAAA,IAAA;AAEuB,CAAA;cAItB,eAAmB,EAAA,CAAA;EAAA,IAAA;EAAA,QAAA;EAAA,OAAA;EAAA,GAAA;AAAA,CAAA,EAKtB,oBALsB,EAAA,GAKF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":";;;KAKK,oBAAA;;aAEQ,KAAA,CAAM;EAFd,OAAA,CAAA,EAAA,GAAA,GAAA,IAAA;AAEuB,CAAA;cAItB,eAAmB,EAAA,CAAA;EAAA,IAAA;EAAA,QAAA;EAAA,OAAA;EAAA,GAAA;AAAA,CAAA,EAKtB,oBALsB,EAAA,GAKF,kBAAA,CAAA,GAAA,CAAA,OALE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe, ProductVariant } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 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_runtime0.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_runtime11 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_runtime11.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemPrice };
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 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_runtime1.JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { LocalizedClientLink };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,kBAAA,CAAA,GAAA,CAAA,OAZE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 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_runtime3.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,EAqEL,OAAA;YA1EW,KAAA,CAAM;;;;cAKZ;;;;;;;;;KAQH,aAAU,
|
|
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,EAqEL,OAAA;YA1EW,KAAA,CAAM;;;;cAKZ;;;;;;;;;KAQH,aAAU,kBAAA,CAAA,GAAA,CAAA;;IAAV,QAAA,EA+D+B,KAAA,CAAM,SA/DrC;EAAU,CAAA,CAAA;EA+DqB,WAAM,UAAA,CAAA;cAeA,KAAA,CAAM;EAAN,CAAA,CAAA;;IAQD,QAAA,EAAN,KAAA,CAAM,SAAA;;EAIJ,MAAM,UAAA,CAAA;cAAN,KAAA,CAAM"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { VariantPrice } from "../../types/prices.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime6 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_runtime6.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,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -47,11 +47,14 @@ function ProductCard({ product, rating, badge, variants, variant, size, classNam
|
|
|
47
47
|
size
|
|
48
48
|
}), "w-60 overflow-hidden rounded-2xl border p-0 shadow-sm"),
|
|
49
49
|
children: [/* @__PURE__ */ jsx("div", {
|
|
50
|
-
className: "h-72 w-full overflow-hidden",
|
|
51
|
-
children: /* @__PURE__ */ jsx(
|
|
50
|
+
className: "relative h-72 w-full overflow-hidden",
|
|
51
|
+
children: /* @__PURE__ */ jsx(Image, {
|
|
52
52
|
src: product.image.src,
|
|
53
53
|
alt: product.image.alt ?? product.title,
|
|
54
|
-
|
|
54
|
+
fill: true,
|
|
55
|
+
className: "object-cover",
|
|
56
|
+
sizes: "240px",
|
|
57
|
+
quality: 60
|
|
55
58
|
})
|
|
56
59
|
}), /* @__PURE__ */ jsxs("div", {
|
|
57
60
|
className: "flex flex-col gap-1 p-3",
|
|
@@ -80,15 +83,17 @@ function ProductCard({ product, rating, badge, variants, variant, size, classNam
|
|
|
80
83
|
size
|
|
81
84
|
}), className),
|
|
82
85
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
83
|
-
className: "relative",
|
|
86
|
+
className: "relative aspect-[1/1]",
|
|
84
87
|
children: [/* @__PURE__ */ jsx(Image, {
|
|
85
|
-
src: product.image.src
|
|
88
|
+
src: product.image.src,
|
|
86
89
|
alt: product.image.alt ?? product.title,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
fill: true,
|
|
91
|
+
className: cn("object-cover"),
|
|
92
|
+
priority: true,
|
|
93
|
+
quality: 60,
|
|
94
|
+
sizes: "(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 240px, 200px"
|
|
90
95
|
}), badge && /* @__PURE__ */ jsx("div", {
|
|
91
|
-
className: "absolute
|
|
96
|
+
className: "absolute top-2 left-2",
|
|
92
97
|
children: /* @__PURE__ */ jsx(Badge, {
|
|
93
98
|
variant: "default",
|
|
94
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=\"h-72 w-full overflow-hidden\">\n
|
|
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 top-2 left-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,5 +1,5 @@
|
|
|
1
1
|
import { Product } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/product-preview/index.d.ts
|
|
5
5
|
type ProductPreviewProps = {
|
|
@@ -9,7 +9,7 @@ type ProductPreviewProps = {
|
|
|
9
9
|
declare function ProductPreview({
|
|
10
10
|
product,
|
|
11
11
|
isFeatured
|
|
12
|
-
}: ProductPreviewProps):
|
|
12
|
+
}: ProductPreviewProps): react_jsx_runtime13.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ProductPreview, ProductPreviewProps };
|
|
15
15
|
//# 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;;AADX,CAAA;AAGE,iBAEO,cAAA,CAAc;EAAA,OAAA;EAAA;AAAA,CAAA,EAA0B,mBAA1B,CAAA,EAA6C,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,mBAAA;WACD;;AADX,CAAA;AAGE,iBAEO,cAAA,CAAc;EAAA,OAAA;EAAA;AAAA,CAAA,EAA0B,mBAA1B,CAAA,EAA6C,mBAAA,CAAA,GAAA,CAAA,OAA7C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime14 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_runtime14.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/submit-button/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,YAAA;;;;iBAIQ;;;YAGL,KAAA,CAAM;;EAPT,SAAA,CAAA,EAAA,MAAY;EACnB,aAAA,CAAA,EAAA,MAAA;EACA,SAAA,CAAA,EAAA,OAAA;CACA,CAAA,EASD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/submit-button/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,YAAA;;;;iBAIQ;;;YAGL,KAAA,CAAM;;EAPT,SAAA,CAAA,EAAA,MAAY;EACnB,aAAA,CAAA,EAAA,MAAA;EACA,SAAA,CAAA,EAAA,OAAA;CACA,CAAA,EASD,mBAAA,CAAA,GAAA,CAAA,OATC"}
|
|
@@ -30,7 +30,7 @@ const ImageOrPlaceholder = ({ image, size }) => {
|
|
|
30
30
|
alt: "Thumbnail",
|
|
31
31
|
className: "absolute inset-0 object-cover object-center",
|
|
32
32
|
draggable: false,
|
|
33
|
-
quality:
|
|
33
|
+
quality: 40,
|
|
34
34
|
sizes: "(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 480px, 800px",
|
|
35
35
|
fill: true
|
|
36
36
|
}) : /* @__PURE__ */ jsx("div", {
|
|
@@ -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 image={initialImage} size={size} />\n </Container>\n );\n};\n\nconst ImageOrPlaceholder = ({\n image,\n size,\n}: Pick<ThumbnailProps, 'size'> & { 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 quality={
|
|
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 image={initialImage} size={size} />\n </Container>\n );\n};\n\nconst ImageOrPlaceholder = ({\n image,\n size,\n}: Pick<ThumbnailProps, 'size'> & { 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 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":";;;;;;;AAiBA,MAAMA,aAAuC,EAC3C,WACA,QACA,OAAO,SACP,YACA,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;GAAmB,OAAO;GAAoB;IAAQ;GAC7C;;AAIhB,MAAM,sBAAsB,EAC1B,OACA,WACuD;AACvD,QAAO,QACL,oBAAC;EACC,KAAK;EACL,KAAI;EACJ,WAAU;EACV,WAAW;EACX,SAAS;EACT,OAAM;EACN;GACA,GAEF,oBAAC;EAAI,WAAU;YACb,oBAAC,oBAAiB,MAAM,SAAS,UAAU,KAAK,KAAM;GAClD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 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_runtime15.JSX.Element;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ApolloClientProvider };
|
|
10
10
|
//# sourceMappingURL=apollo-context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-context.d.ts","names":[],"sources":["../../../src/lib/context/apollo-context.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,oBAAA;;GAAmC,oBAAiB,
|
|
1
|
+
{"version":3,"file":"apollo-context.d.ts","names":[],"sources":["../../../src/lib/context/apollo-context.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,oBAAA;;GAAmC,oBAAiB,mBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/context/modal-context.d.ts
|
|
5
5
|
interface ModalContext {
|
|
@@ -13,7 +13,7 @@ interface ModalProviderProps {
|
|
|
13
13
|
declare const ModalProvider: ({
|
|
14
14
|
children,
|
|
15
15
|
close
|
|
16
|
-
}: ModalProviderProps) =>
|
|
16
|
+
}: ModalProviderProps) => react_jsx_runtime8.JSX.Element;
|
|
17
17
|
declare const useModal: () => ModalContext;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { ModalProvider, useModal };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
3
|
import { graphqlFetch } from "../gql/apollo-client.js";
|
|
4
|
-
import {
|
|
4
|
+
import { GET_COLLECTIONS_HOME_QUERY } from "../gql/queries/collections.js";
|
|
5
5
|
|
|
6
6
|
//#region src/lib/data/collections.ts
|
|
7
7
|
const listCollections = async (queryParams = {}) => {
|
|
8
8
|
try {
|
|
9
9
|
return { collections: (await graphqlFetch({
|
|
10
|
-
query:
|
|
10
|
+
query: GET_COLLECTIONS_HOME_QUERY,
|
|
11
11
|
variables: {
|
|
12
|
-
limit: parseInt(queryParams.limit || "
|
|
12
|
+
limit: parseInt(queryParams.limit || "50"),
|
|
13
13
|
offset: parseInt(queryParams.offset || "0")
|
|
14
14
|
}
|
|
15
15
|
}))?.collections };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","names":[],"sources":["../../../src/lib/data/collections.ts"],"sourcesContent":["'use server';\n\nimport { graphqlFetch } from '@/lib/gql/apollo-client';\nimport {
|
|
1
|
+
{"version":3,"file":"collections.js","names":[],"sources":["../../../src/lib/data/collections.ts"],"sourcesContent":["'use server';\n\nimport { graphqlFetch } from '@/lib/gql/apollo-client';\nimport { GET_COLLECTIONS_HOME_QUERY } from '@/lib/gql/queries/collections';\nimport {\n GetCollectionsQuery,\n GetCollectionsQueryVariables,\n} from '@/types/graphql';\n\nexport const listCollections = async (\n queryParams: Record<string, string> = {}\n) => {\n try {\n const limit = parseInt(queryParams.limit || '50');\n const offset = parseInt(queryParams.offset || '0');\n\n const data = await graphqlFetch<\n GetCollectionsQuery,\n GetCollectionsQueryVariables\n >({\n query: GET_COLLECTIONS_HOME_QUERY,\n variables: { limit, offset },\n });\n\n return {\n collections: data?.collections,\n };\n } catch (error) {\n console.error('Error fetching collections from BFF:', error);\n return { collections: [] };\n }\n};\n"],"mappings":";;;;;;AASA,MAAa,kBAAkB,OAC7B,cAAsC,EAAE,KACrC;AACH,KAAI;AAYF,SAAO,EACL,cATW,MAAM,aAGjB;GACA,OAAO;GACP,WAAW;IAAE,OARD,SAAS,YAAY,SAAS,KAAK;IAQ3B,QAPP,SAAS,YAAY,UAAU,IAAI;IAOpB;GAC7B,CAAC,GAGmB,aACpB;UACM,OAAO;AACd,UAAQ,MAAM,wCAAwC,MAAM;AAC5D,SAAO,EAAE,aAAa,EAAE,EAAE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStorefrontActions } from "./client-actions.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/data/context.d.ts
|
|
6
6
|
interface StorefrontContext {
|
|
@@ -15,7 +15,7 @@ interface StorefrontProviderProps {
|
|
|
15
15
|
declare const StorefrontProvider: ({
|
|
16
16
|
children,
|
|
17
17
|
value
|
|
18
|
-
}: StorefrontProviderProps) =>
|
|
18
|
+
}: StorefrontProviderProps) => react_jsx_runtime2.JSX.Element;
|
|
19
19
|
declare const useStorefrontContext: () => StorefrontContext;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { StorefrontContext, StorefrontProvider, useStorefrontActions, useStorefrontContext };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client2 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/cart.d.ts
|
|
4
|
-
declare const LINE_ITEM_FRAGMENT:
|
|
5
|
-
declare const COUNTRY_FRAGMENT:
|
|
6
|
-
declare const REGION_FRAGMENT:
|
|
7
|
-
declare const SHIPPING_METHODS_FRAGMENT:
|
|
8
|
-
declare const PAYMENT_COLLECTION_FRAGMENT:
|
|
9
|
-
declare const ADDRESS_FRAGMENT:
|
|
10
|
-
declare const PROMOTION_FRAGMENT:
|
|
11
|
-
declare const CART_FRAGMENT:
|
|
4
|
+
declare const LINE_ITEM_FRAGMENT: _apollo_client2.DocumentNode;
|
|
5
|
+
declare const COUNTRY_FRAGMENT: _apollo_client2.DocumentNode;
|
|
6
|
+
declare const REGION_FRAGMENT: _apollo_client2.DocumentNode;
|
|
7
|
+
declare const SHIPPING_METHODS_FRAGMENT: _apollo_client2.DocumentNode;
|
|
8
|
+
declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client2.DocumentNode;
|
|
9
|
+
declare const ADDRESS_FRAGMENT: _apollo_client2.DocumentNode;
|
|
10
|
+
declare const PROMOTION_FRAGMENT: _apollo_client2.DocumentNode;
|
|
11
|
+
declare const CART_FRAGMENT: _apollo_client2.DocumentNode;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { ADDRESS_FRAGMENT, CART_FRAGMENT, COUNTRY_FRAGMENT, LINE_ITEM_FRAGMENT, PAYMENT_COLLECTION_FRAGMENT, PROMOTION_FRAGMENT, REGION_FRAGMENT, SHIPPING_METHODS_FRAGMENT };
|
|
14
14
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client31 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/customer.d.ts
|
|
4
|
-
declare const CUSTOMER_ADDRESS_FRAGMENT:
|
|
5
|
-
declare const CUSTOMER_FRAGMENT:
|
|
4
|
+
declare const CUSTOMER_ADDRESS_FRAGMENT: _apollo_client31.DocumentNode;
|
|
5
|
+
declare const CUSTOMER_FRAGMENT: _apollo_client31.DocumentNode;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CUSTOMER_ADDRESS_FRAGMENT, CUSTOMER_FRAGMENT };
|
|
8
8
|
//# sourceMappingURL=customer.d.ts.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client23 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/fragments/product.d.ts
|
|
4
|
-
declare const PRICE_FRAGMENT:
|
|
5
|
-
declare const PRODUCT_VARIANT_FRAGMENT:
|
|
6
|
-
declare const PRODUCT_HIT_FRAGMENT:
|
|
7
|
-
declare const PRODUCT_CATEGORY_FRAGMENT:
|
|
8
|
-
declare const PRODUCT_COLLECTION_FRAGMENT:
|
|
9
|
-
declare const PRODUCT_IMAGE_FRAGMENT:
|
|
10
|
-
declare const COLLECTION_PRODUCTS_FRAGMENT:
|
|
4
|
+
declare const PRICE_FRAGMENT: _apollo_client23.DocumentNode;
|
|
5
|
+
declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client23.DocumentNode;
|
|
6
|
+
declare const PRODUCT_HIT_FRAGMENT: _apollo_client23.DocumentNode;
|
|
7
|
+
declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client23.DocumentNode;
|
|
8
|
+
declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client23.DocumentNode;
|
|
9
|
+
declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client23.DocumentNode;
|
|
10
|
+
declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client23.DocumentNode;
|
|
11
|
+
declare const COLLECTION_PRODUCTS_HOME_FRAGMENT: _apollo_client23.DocumentNode;
|
|
11
12
|
//#endregion
|
|
12
|
-
export { COLLECTION_PRODUCTS_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_HIT_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
|
|
13
|
+
export { COLLECTION_PRODUCTS_FRAGMENT, COLLECTION_PRODUCTS_HOME_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_HIT_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
|
|
13
14
|
//# sourceMappingURL=product.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,gBAMZ,gBAAA,CAN0B;cAQd,0BAqBZ,gBAAA,CArBoC;cAuBxB,sBAQZ,gBAAA,CARgC;AA/BpB,cAyCA,yBAnCZ,EA0CA,gBAAA,CAPqC,YAnCrC;AAEY,cA0CA,2BArBZ,EA2BA,gBAAA,CANuC,YArBvC;AAEY,cA2BA,sBAnBZ,EAwBA,gBAAA,CALkC,YAnBlC;AAEY,cAwBA,4BAjBZ,EAwCA,gBAAA,CAvBwC,YAjBxC"}
|
|
1
|
+
{"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,gBAMZ,gBAAA,CAN0B;cAQd,0BAqBZ,gBAAA,CArBoC;cAuBxB,sBAQZ,gBAAA,CARgC;AA/BpB,cAyCA,yBAnCZ,EA0CA,gBAAA,CAPqC,YAnCrC;AAEY,cA0CA,2BArBZ,EA2BA,gBAAA,CANuC,YArBvC;AAEY,cA2BA,sBAnBZ,EAwBA,gBAAA,CALkC,YAnBlC;AAEY,cAwBA,4BAjBZ,EAwCA,gBAAA,CAvBwC,YAjBxC;AAEY,cAwCA,iCAlCZ,EA4CA,gBAAA,CAV6C,YAlC7C"}
|
|
@@ -84,7 +84,18 @@ const COLLECTION_PRODUCTS_FRAGMENT = gql`
|
|
|
84
84
|
${PRODUCT_IMAGE_FRAGMENT}
|
|
85
85
|
${PRICE_FRAGMENT}
|
|
86
86
|
`;
|
|
87
|
+
const COLLECTION_PRODUCTS_HOME_FRAGMENT = gql`
|
|
88
|
+
fragment CollectionProductsHome on ProductList {
|
|
89
|
+
count
|
|
90
|
+
items {
|
|
91
|
+
id
|
|
92
|
+
title
|
|
93
|
+
handle
|
|
94
|
+
thumbnail
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
87
98
|
|
|
88
99
|
//#endregion
|
|
89
|
-
export { COLLECTION_PRODUCTS_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_HIT_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
|
|
100
|
+
export { COLLECTION_PRODUCTS_FRAGMENT, COLLECTION_PRODUCTS_HOME_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_HIT_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
|
|
90
101
|
//# sourceMappingURL=product.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const PRICE_FRAGMENT = gql`\n fragment Price on Price {\n amount\n currencyCode\n priceType\n }\n`;\n\nexport const PRODUCT_VARIANT_FRAGMENT = gql`\n fragment ProductVariant on ProductVariant {\n id\n sku\n inventoryQuantity\n allowBackorder\n manageInventory\n title\n options {\n id\n optionId\n value\n }\n price {\n ...Price\n }\n originalPrice {\n ...Price\n }\n }\n ${PRICE_FRAGMENT}\n`;\n\nexport const PRODUCT_HIT_FRAGMENT = gql`\n fragment ProductHit on ProductHit {\n id\n title\n description\n handle\n thumbnail\n }\n`;\n\nexport const PRODUCT_CATEGORY_FRAGMENT = gql`\n fragment ProductCategory on ProductCategory {\n id\n name\n description\n handle\n }\n`;\n\nexport const PRODUCT_COLLECTION_FRAGMENT = gql`\n fragment ProductCollection on Collection {\n id\n title\n handle\n }\n`;\n\nexport const PRODUCT_IMAGE_FRAGMENT = gql`\n fragment ProductImage on ProductImage {\n id\n url\n }\n`;\n\nexport const COLLECTION_PRODUCTS_FRAGMENT = gql`\n fragment CollectionProducts on ProductList {\n count\n items {\n id\n title\n handle\n thumbnail\n images {\n ...ProductImage\n }\n variants {\n price {\n ...Price\n }\n originalPrice {\n ...Price\n }\n }\n }\n }\n ${PRODUCT_IMAGE_FRAGMENT}\n ${PRICE_FRAGMENT}\n`;\n"],"mappings":";;;AAEA,MAAa,iBAAiB,GAAG;;;;;;;AAQjC,MAAa,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;IAoBvC,eAAe;;AAGnB,MAAa,uBAAuB,GAAG;;;;;;;;;AAUvC,MAAa,4BAA4B,GAAG;;;;;;;;AAS5C,MAAa,8BAA8B,GAAG;;;;;;;AAQ9C,MAAa,yBAAyB,GAAG;;;;;;AAOzC,MAAa,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;;;IAqB3C,uBAAuB;IACvB,eAAe"}
|
|
1
|
+
{"version":3,"file":"product.js","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const PRICE_FRAGMENT = gql`\n fragment Price on Price {\n amount\n currencyCode\n priceType\n }\n`;\n\nexport const PRODUCT_VARIANT_FRAGMENT = gql`\n fragment ProductVariant on ProductVariant {\n id\n sku\n inventoryQuantity\n allowBackorder\n manageInventory\n title\n options {\n id\n optionId\n value\n }\n price {\n ...Price\n }\n originalPrice {\n ...Price\n }\n }\n ${PRICE_FRAGMENT}\n`;\n\nexport const PRODUCT_HIT_FRAGMENT = gql`\n fragment ProductHit on ProductHit {\n id\n title\n description\n handle\n thumbnail\n }\n`;\n\nexport const PRODUCT_CATEGORY_FRAGMENT = gql`\n fragment ProductCategory on ProductCategory {\n id\n name\n description\n handle\n }\n`;\n\nexport const PRODUCT_COLLECTION_FRAGMENT = gql`\n fragment ProductCollection on Collection {\n id\n title\n handle\n }\n`;\n\nexport const PRODUCT_IMAGE_FRAGMENT = gql`\n fragment ProductImage on ProductImage {\n id\n url\n }\n`;\n\nexport const COLLECTION_PRODUCTS_FRAGMENT = gql`\n fragment CollectionProducts on ProductList {\n count\n items {\n id\n title\n handle\n thumbnail\n images {\n ...ProductImage\n }\n variants {\n price {\n ...Price\n }\n originalPrice {\n ...Price\n }\n }\n }\n }\n ${PRODUCT_IMAGE_FRAGMENT}\n ${PRICE_FRAGMENT}\n`;\n\nexport const COLLECTION_PRODUCTS_HOME_FRAGMENT = gql`\n fragment CollectionProductsHome on ProductList {\n count\n items {\n id\n title\n handle\n thumbnail\n }\n }\n`;\n"],"mappings":";;;AAEA,MAAa,iBAAiB,GAAG;;;;;;;AAQjC,MAAa,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;IAoBvC,eAAe;;AAGnB,MAAa,uBAAuB,GAAG;;;;;;;;;AAUvC,MAAa,4BAA4B,GAAG;;;;;;;;AAS5C,MAAa,8BAA8B,GAAG;;;;;;;AAQ9C,MAAa,yBAAyB,GAAG;;;;;;AAOzC,MAAa,+BAA+B,GAAG;;;;;;;;;;;;;;;;;;;;;IAqB3C,uBAAuB;IACvB,eAAe;;AAGnB,MAAa,oCAAoC,GAAG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client10 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/mutations/cart.d.ts
|
|
4
|
-
declare const CREATE_CART_MUTATION:
|
|
5
|
-
declare const CREATE_LINE_ITEM_MUTATION:
|
|
6
|
-
declare const UPDATE_CART_MUTATION:
|
|
7
|
-
declare const DELETE_LINE_ITEM_MUTATION:
|
|
8
|
-
declare const TRANSFER_CART_MUTATION:
|
|
4
|
+
declare const CREATE_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
5
|
+
declare const CREATE_LINE_ITEM_MUTATION: _apollo_client10.DocumentNode;
|
|
6
|
+
declare const UPDATE_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
7
|
+
declare const DELETE_LINE_ITEM_MUTATION: _apollo_client10.DocumentNode;
|
|
8
|
+
declare const TRANSFER_CART_MUTATION: _apollo_client10.DocumentNode;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CREATE_CART_MUTATION, CREATE_LINE_ITEM_MUTATION, DELETE_LINE_ITEM_MUTATION, TRANSFER_CART_MUTATION, UPDATE_CART_MUTATION };
|
|
11
11
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client16 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/cart.d.ts
|
|
4
|
-
declare const GET_CART_QUERY:
|
|
4
|
+
declare const GET_CART_QUERY: _apollo_client16.DocumentNode;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { GET_CART_QUERY };
|
|
7
7
|
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _apollo_client17 from "@apollo/client";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/gql/queries/collections.d.ts
|
|
4
|
-
declare const GET_COLLECTIONS_QUERY:
|
|
4
|
+
declare const GET_COLLECTIONS_QUERY: _apollo_client17.DocumentNode;
|
|
5
|
+
declare const GET_COLLECTIONS_HOME_QUERY: _apollo_client17.DocumentNode;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { GET_COLLECTIONS_QUERY };
|
|
7
|
+
export { GET_COLLECTIONS_HOME_QUERY, GET_COLLECTIONS_QUERY };
|
|
7
8
|
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","names":[],"sources":["../../../../src/lib/gql/queries/collections.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"collections.d.ts","names":[],"sources":["../../../../src/lib/gql/queries/collections.ts"],"sourcesContent":[],"mappings":";;;cAQa,uBAWZ,gBAAA,CAXiC;cAarB,4BAWZ,gBAAA,CAXsC"}
|