@gfed-medusa/sf-lib-common 3.7.3 → 3.8.0
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/breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/cart-mismatch-banner/index.d.ts +2 -2
- package/dist/components/cart-mismatch-banner/index.d.ts.map +1 -1
- package/dist/components/delete-button/index.d.ts +2 -2
- package/dist/components/delete-button/index.d.ts.map +1 -1
- package/dist/components/device-id-setter/index.d.ts +5 -0
- package/dist/components/device-id-setter/index.d.ts.map +1 -0
- package/dist/components/device-id-setter/index.js +16 -0
- package/dist/components/device-id-setter/index.js.map +1 -0
- 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/line-item-options/index.d.ts +2 -2
- 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/personalized-content/components/hero-banner.d.ts +31 -0
- package/dist/components/personalized-content/components/hero-banner.d.ts.map +1 -0
- package/dist/components/personalized-content/components/hero-banner.js +85 -0
- package/dist/components/personalized-content/components/hero-banner.js.map +1 -0
- package/dist/components/personalized-content/components/index.d.ts +2 -0
- package/dist/components/personalized-content/components/index.js +3 -0
- package/dist/components/preview-price/index.d.ts +2 -2
- package/dist/components/product-card/index.d.ts +2 -2
- package/dist/components/product-preview/index.d.ts +2 -4
- package/dist/components/product-preview/index.d.ts.map +1 -1
- package/dist/components/product-preview/index.js +1 -2
- package/dist/components/product-preview/index.js.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.d.ts +0 -1
- package/dist/components/thumbnail/index.d.ts.map +1 -1
- package/dist/components/thumbnail/index.js +9 -11
- 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/context.d.ts +2 -2
- package/dist/lib/data/context.d.ts.map +1 -1
- package/dist/lib/data/personalization.d.ts +51 -0
- package/dist/lib/data/personalization.d.ts.map +1 -0
- package/dist/lib/data/personalization.js +77 -0
- package/dist/lib/data/personalization.js.map +1 -0
- package/dist/lib/gql/apollo-client.d.ts.map +1 -1
- package/dist/lib/gql/apollo-client.js +6 -2
- package/dist/lib/gql/apollo-client.js.map +1 -1
- 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/product.d.ts +8 -8
- package/dist/lib/gql/fragments/product.d.ts.map +1 -1
- package/dist/lib/gql/mutations/cart.d.ts +6 -6
- package/dist/lib/gql/queries/cart-summary.d.ts +2 -2
- package/dist/lib/gql/queries/cart-summary.js +1 -1
- package/dist/lib/gql/queries/cart-summary.js.map +1 -1
- package/dist/lib/gql/queries/cart-total.d.ts +7 -0
- package/dist/lib/gql/queries/cart-total.d.ts.map +1 -0
- package/dist/lib/gql/queries/cart-total.js +14 -0
- package/dist/lib/gql/queries/cart-total.js.map +1 -0
- package/dist/lib/gql/queries/cart.d.ts +2 -2
- package/dist/lib/gql/queries/cart.d.ts.map +1 -1
- package/dist/lib/gql/queries/cart.js +1 -1
- package/dist/lib/gql/queries/cart.js.map +1 -1
- package/dist/lib/gql/queries/collections.d.ts +3 -3
- package/dist/lib/gql/queries/collections.d.ts.map +1 -1
- package/dist/lib/gql/queries/customer.d.ts +2 -2
- package/dist/lib/gql/queries/customer.d.ts.map +1 -1
- package/dist/lib/gql/queries/footer.d.ts +3 -3
- package/dist/lib/gql/queries/footer.d.ts.map +1 -1
- package/dist/lib/gql/queries/home-banner.d.ts +2 -2
- 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 +5 -0
- package/dist/lib/gql/queries/order.js.map +1 -1
- package/dist/lib/gql/queries/product-personalization.d.ts +7 -0
- package/dist/lib/gql/queries/product-personalization.d.ts.map +1 -0
- package/dist/lib/gql/queries/product-personalization.js +22 -0
- package/dist/lib/gql/queries/product-personalization.js.map +1 -0
- package/dist/lib/gql/queries/product.d.ts +2 -2
- package/dist/lib/gql/queries/regions.d.ts +3 -3
- package/dist/lib/hooks/use-apollo.d.ts +2 -2
- package/dist/lib/hooks/use-time-on-page.d.ts +13 -0
- package/dist/lib/hooks/use-time-on-page.d.ts.map +1 -0
- package/dist/lib/hooks/use-time-on-page.js +46 -0
- package/dist/lib/hooks/use-time-on-page.js.map +1 -0
- package/dist/lib/personalization/behavior-tracker.d.ts +1 -5
- package/dist/lib/personalization/behavior-tracker.d.ts.map +1 -1
- package/dist/lib/personalization/behavior-tracker.js +6 -20
- package/dist/lib/personalization/behavior-tracker.js.map +1 -1
- package/dist/lib/personalization/client-signal.d.ts +26 -0
- package/dist/lib/personalization/client-signal.d.ts.map +1 -0
- package/dist/lib/personalization/client-signal.js +105 -0
- package/dist/lib/personalization/client-signal.js.map +1 -0
- package/dist/lib/personalization/config.d.ts +2 -6
- package/dist/lib/personalization/config.d.ts.map +1 -1
- package/dist/lib/personalization/config.js +2 -16
- package/dist/lib/personalization/config.js.map +1 -1
- package/dist/lib/personalization/device-id.d.ts +5 -0
- package/dist/lib/personalization/device-id.d.ts.map +1 -0
- package/dist/lib/personalization/device-id.js +24 -0
- package/dist/lib/personalization/device-id.js.map +1 -0
- package/dist/lib/personalization/personalization-gql.d.ts +9 -0
- package/dist/lib/personalization/personalization-gql.d.ts.map +1 -0
- package/dist/lib/personalization/personalization-gql.js +42 -0
- package/dist/lib/personalization/personalization-gql.js.map +1 -0
- package/dist/lib/utils/imagekit.d.ts +2 -2
- package/dist/lib/utils/imagekit.js +1 -1
- package/dist/lib/utils/imagekit.js.map +1 -1
- package/dist/types/graphql.d.ts +247 -5
- package/dist/types/graphql.d.ts.map +1 -1
- package/dist/types/graphql.js +410 -3
- package/dist/types/graphql.js.map +1 -1
- package/package.json +1 -1
- package/dist/lib/data/contextual-banner.d.ts +0 -15
- package/dist/lib/data/contextual-banner.d.ts.map +0 -1
- package/dist/lib/data/contextual-banner.js +0 -19
- package/dist/lib/data/contextual-banner.js.map +0 -1
- package/dist/lib/gql/queries/contextual-banner.d.ts +0 -7
- package/dist/lib/gql/queries/contextual-banner.d.ts.map +0 -1
- package/dist/lib/gql/queries/contextual-banner.js +0 -21
- package/dist/lib/gql/queries/contextual-banner.js.map +0 -1
- package/dist/lib/personalization/user-profile.d.ts +0 -15
- package/dist/lib/personalization/user-profile.d.ts.map +0 -1
- package/dist/lib/personalization/user-profile.js +0 -47
- package/dist/lib/personalization/user-profile.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime16 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_runtime16.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Breadcrumbs };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":[],"mappings":";;;cAiBM,iBAAiB,eAErB,KAAA,CAAM;;;AAyCW,CAAA,CAAA,CAAA;AA3CU,UAQnB,gBAAA,CAAgB;EA+BjB,aAAA,CAAW,EAAA,MAAA,OA9BW,eA8BX;EAClB,QAAA,CAAA,EAAA,MAAA;EACA,aAAA,CAAA,EAAA,MAAA;;iBAFO,WAAA,CAIN;EAAA,aAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,gBAAA,CAAA,EAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/breadcrumbs/index.tsx"],"sourcesContent":[],"mappings":";;;cAiBM,iBAAiB,eAErB,KAAA,CAAM;;;AAyCW,CAAA,CAAA,CAAA;AA3CU,UAQnB,gBAAA,CAAgB;EA+BjB,aAAA,CAAW,EAAA,MAAA,OA9BW,eA8BX;EAClB,QAAA,CAAA,EAAA,MAAA;EACA,aAAA,CAAA,EAAA,MAAA;;iBAFO,WAAA,CAIN;EAAA,aAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,gBAAA,CAAA,EAAgB,mBAAA,CAAA,GAAA,CAAA,OAAhB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Cart, Customer } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime12 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_runtime12.JSX.Element | undefined;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { CartMismatchBanner };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAYS,kBAAA;YAAsC;EAAtC,IAAA,EAAsD,IAAtD;CAAsC,CAAA,EAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/cart-mismatch-banner/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAYS,kBAAA;YAAsC;EAAtC,IAAA,EAAsD,IAAtD;CAAsC,CAAA,EAAsB,mBAAA,CAAA,GAAA,CAAA,OAAA,GAAtB,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime13 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_runtime13.JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { DeleteButton };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/delete-button/index.tsx"],"sourcesContent":[],"mappings":";;;cASM;;;;;;aAMO,KAAA,CAAM;EANb,SAAA,CAAA,EAAA,MAuCL;CAvCqB,EAAA,GAQrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/delete-button/index.tsx"],"sourcesContent":[],"mappings":";;;cASM;;;;;;aAMO,KAAA,CAAM;EANb,SAAA,CAAA,EAAA,MAuCL;CAvCqB,EAAA,GAQrB,mBAAA,CAAA,GAAA,CAAA,OARqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/device-id-setter/index.tsx"],"sourcesContent":[],"mappings":";iBAMgB,cAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { getDeviceId } from "../../lib/personalization/device-id.js";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/device-id-setter/index.tsx
|
|
7
|
+
function DeviceIdSetter() {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
getDeviceId();
|
|
10
|
+
}, []);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { DeviceIdSetter };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/device-id-setter/index.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { getDeviceId } from '@/lib/personalization/device-id';\n\nexport function DeviceIdSetter() {\n useEffect(() => {\n getDeviceId();\n }, []);\n\n return null;\n}\n"],"mappings":";;;;;;AAMA,SAAgB,iBAAiB;AAC/B,iBAAgB;AACd,eAAa;IACZ,EAAE,CAAC;AAEN,QAAO"}
|
|
@@ -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_runtime11 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_runtime11.JSX.Element | undefined;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { ShippingPriceNudge };
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LocalizedClientLink } from "../localized-client-link/index.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/interactive-link/index.d.ts
|
|
5
5
|
type InteractiveLinkProps = React.ComponentPropsWithoutRef<typeof LocalizedClientLink> & {
|
|
@@ -14,7 +14,7 @@ declare const InteractiveLink: ({
|
|
|
14
14
|
textClassName,
|
|
15
15
|
iconClassName,
|
|
16
16
|
...props
|
|
17
|
-
}: InteractiveLinkProps) =>
|
|
17
|
+
}: InteractiveLinkProps) => react_jsx_runtime15.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { InteractiveLink };
|
|
20
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe, ProductVariant } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime14 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_runtime14.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { LineItemOptions };
|
|
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_runtime0 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_runtime0.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_runtime1 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_runtime1.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,
|
|
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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/personalized-content/components/hero-banner.d.ts
|
|
4
|
+
interface HeroBannerProps {
|
|
5
|
+
headline?: string;
|
|
6
|
+
subheadline?: string;
|
|
7
|
+
image?: {
|
|
8
|
+
asset?: {
|
|
9
|
+
url?: string;
|
|
10
|
+
};
|
|
11
|
+
} | string;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
cta?: {
|
|
14
|
+
label?: string;
|
|
15
|
+
href?: string;
|
|
16
|
+
};
|
|
17
|
+
badge?: string;
|
|
18
|
+
backgroundColor?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function HeroBanner({
|
|
21
|
+
headline,
|
|
22
|
+
subheadline,
|
|
23
|
+
image,
|
|
24
|
+
imageUrl,
|
|
25
|
+
cta,
|
|
26
|
+
badge,
|
|
27
|
+
backgroundColor
|
|
28
|
+
}: HeroBannerProps): react_jsx_runtime9.JSX.Element | null;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { HeroBanner };
|
|
31
|
+
//# sourceMappingURL=hero-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-banner.d.ts","names":[],"sources":["../../../../src/components/personalized-content/components/hero-banner.tsx"],"sourcesContent":[],"mappings":";;;UAOU,eAAA;;;EAAA,KAAA,CAAA,EAAA;IAmCM,KAAA,CAAA,EAAA;MAAa,GAAA,CAAA,EAAA,MAAA;IAAU,CAAA;EAAa,CAAA,GAAA,MAAA;EAAO,QAAA,CAAA,EAAA,MAAA;EAAU,GAAA,CAAA,EAAA;IAAK,KAAA,CAAA,EAAA,MAAA;IAAO,IAAA,CAAA,EAAA,MAAA;EAAmB,CAAA;EAAe,KAAA,CAAA,EAAA,MAAA;EAAA,eAAA,CAAA,EAAA,MAAA;;iBAAnG,UAAA;;;;;;;;GAAoF,kBAAe,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { LocalizedClientLink } from "../../localized-client-link/index.js";
|
|
4
|
+
import { getImageKitUrl } from "../../../lib/utils/imagekit.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Button, Heading, Text } from "@medusajs/ui";
|
|
7
|
+
|
|
8
|
+
//#region src/components/personalized-content/components/hero-banner.tsx
|
|
9
|
+
function getImageUrl(image, imageUrl) {
|
|
10
|
+
if (imageUrl) return imageUrl;
|
|
11
|
+
if (!image) return void 0;
|
|
12
|
+
if (typeof image === "string") return image;
|
|
13
|
+
return image.asset?.url ?? void 0;
|
|
14
|
+
}
|
|
15
|
+
function CtaButton({ cta }) {
|
|
16
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
17
|
+
variant: "primary",
|
|
18
|
+
children: cta.label
|
|
19
|
+
});
|
|
20
|
+
if (cta.href?.startsWith("http://") || cta.href?.startsWith("https://") || cta.href?.startsWith("//")) return /* @__PURE__ */ jsx("a", {
|
|
21
|
+
href: cta.href,
|
|
22
|
+
target: "_blank",
|
|
23
|
+
rel: "noreferrer",
|
|
24
|
+
children: button
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ jsx(LocalizedClientLink, {
|
|
27
|
+
href: cta.href,
|
|
28
|
+
children: button
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function HeroBanner({ headline, subheadline, image, imageUrl, cta, badge, backgroundColor }) {
|
|
32
|
+
const bannerImage = getImageUrl(image, imageUrl);
|
|
33
|
+
if (!headline && !subheadline && !badge && !cta?.label) return null;
|
|
34
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
35
|
+
className: "border-ui-border-base relative isolate overflow-hidden border-b",
|
|
36
|
+
children: [
|
|
37
|
+
bannerImage && /* @__PURE__ */ jsx("img", {
|
|
38
|
+
src: getImageKitUrl(bannerImage, {
|
|
39
|
+
width: 1920,
|
|
40
|
+
quality: 80
|
|
41
|
+
}),
|
|
42
|
+
alt: "",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
fetchPriority: "high",
|
|
45
|
+
className: "absolute inset-0 h-full w-full object-cover"
|
|
46
|
+
}),
|
|
47
|
+
bannerImage && /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "absolute inset-0 bg-gradient-to-t from-black/50 via-black/20 to-transparent",
|
|
49
|
+
"aria-hidden": "true"
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "content-container relative flex min-h-[420px] flex-col justify-center py-10 md:min-h-[540px]",
|
|
53
|
+
style: backgroundColor && !bannerImage ? { backgroundColor } : void 0,
|
|
54
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: "w-full max-w-2xl pt-8 text-left md:pt-14",
|
|
56
|
+
children: [
|
|
57
|
+
badge && /* @__PURE__ */ jsx(Text, {
|
|
58
|
+
as: "span",
|
|
59
|
+
size: "xsmall",
|
|
60
|
+
className: "text-ui-fg-muted block font-medium uppercase tracking-[0.3em]",
|
|
61
|
+
children: badge
|
|
62
|
+
}),
|
|
63
|
+
headline && /* @__PURE__ */ jsx(Heading, {
|
|
64
|
+
level: "h1",
|
|
65
|
+
className: "text-ui-fg-base mt-2 text-3xl font-normal leading-tight md:text-4xl",
|
|
66
|
+
children: headline
|
|
67
|
+
}),
|
|
68
|
+
subheadline && /* @__PURE__ */ jsx(Text, {
|
|
69
|
+
className: "text-ui-fg-subtle mt-2 max-w-xl text-base leading-7",
|
|
70
|
+
children: subheadline
|
|
71
|
+
}),
|
|
72
|
+
cta?.label && cta?.href && /* @__PURE__ */ jsx("div", {
|
|
73
|
+
className: "mt-6",
|
|
74
|
+
children: /* @__PURE__ */ jsx(CtaButton, { cta })
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { HeroBanner };
|
|
85
|
+
//# sourceMappingURL=hero-banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-banner.js","names":[],"sources":["../../../../src/components/personalized-content/components/hero-banner.tsx"],"sourcesContent":["'use client';\n\nimport { Button, Heading, Text } from '@medusajs/ui';\n\nimport { getImageKitUrl } from '../../../lib/utils/imagekit';\nimport { LocalizedClientLink } from '../../localized-client-link';\n\ninterface HeroBannerProps {\n headline?: string;\n subheadline?: string;\n image?: { asset?: { url?: string } } | string;\n imageUrl?: string;\n cta?: { label?: string; href?: string };\n badge?: string;\n backgroundColor?: string;\n}\n\nfunction getImageUrl(image: HeroBannerProps['image'], imageUrl?: string): string | undefined {\n if (imageUrl) return imageUrl;\n if (!image) return undefined;\n if (typeof image === 'string') return image;\n return image.asset?.url ?? undefined;\n}\n\nfunction CtaButton({ cta }: { cta: NonNullable<HeroBannerProps['cta']> }) {\n const button = <Button variant=\"primary\">{cta.label}</Button>;\n const isExternal =\n cta.href?.startsWith('http://') ||\n cta.href?.startsWith('https://') ||\n cta.href?.startsWith('//');\n\n if (isExternal) {\n return (\n <a href={cta.href} target=\"_blank\" rel=\"noreferrer\">\n {button}\n </a>\n );\n }\n\n return <LocalizedClientLink href={cta.href!}>{button}</LocalizedClientLink>;\n}\n\nexport function HeroBanner({ headline, subheadline, image, imageUrl, cta, badge, backgroundColor }: HeroBannerProps) {\n const bannerImage = getImageUrl(image, imageUrl);\n\n if (!headline && !subheadline && !badge && !cta?.label) return null;\n\n return (\n <section className=\"border-ui-border-base relative isolate overflow-hidden border-b\">\n {bannerImage && (\n <img\n src={getImageKitUrl(bannerImage, { width: 1920, quality: 80 })}\n alt=\"\"\n aria-hidden=\"true\"\n fetchPriority=\"high\"\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n )}\n {bannerImage && (\n <div className=\"absolute inset-0 bg-gradient-to-t from-black/50 via-black/20 to-transparent\" aria-hidden=\"true\" />\n )}\n <div\n className=\"content-container relative flex min-h-[420px] flex-col justify-center py-10 md:min-h-[540px]\"\n style={backgroundColor && !bannerImage ? { backgroundColor } : undefined}\n >\n <div className=\"w-full max-w-2xl pt-8 text-left md:pt-14\">\n {badge && (\n <Text\n as=\"span\"\n size=\"xsmall\"\n className=\"text-ui-fg-muted block font-medium uppercase tracking-[0.3em]\"\n >\n {badge}\n </Text>\n )}\n {headline && (\n <Heading level=\"h1\" className=\"text-ui-fg-base mt-2 text-3xl font-normal leading-tight md:text-4xl\">\n {headline}\n </Heading>\n )}\n {subheadline && (\n <Text className=\"text-ui-fg-subtle mt-2 max-w-xl text-base leading-7\">\n {subheadline}\n </Text>\n )}\n {cta?.label && cta?.href && (\n <div className=\"mt-6\">\n <CtaButton cta={cta as NonNullable<HeroBannerProps['cta']>} />\n </div>\n )}\n </div>\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;;;;AAiBA,SAAS,YAAY,OAAiC,UAAuC;AAC3F,KAAI,SAAU,QAAO;AACrB,KAAI,CAAC,MAAO,QAAO;AACnB,KAAI,OAAO,UAAU,SAAU,QAAO;AACtC,QAAO,MAAM,OAAO,OAAO;;AAG7B,SAAS,UAAU,EAAE,OAAqD;CACxE,MAAM,SAAS,oBAAC;EAAO,SAAQ;YAAW,IAAI;GAAe;AAM7D,KAJE,IAAI,MAAM,WAAW,UAAU,IAC/B,IAAI,MAAM,WAAW,WAAW,IAChC,IAAI,MAAM,WAAW,KAAK,CAG1B,QACE,oBAAC;EAAE,MAAM,IAAI;EAAM,QAAO;EAAS,KAAI;YACpC;GACC;AAIR,QAAO,oBAAC;EAAoB,MAAM,IAAI;YAAQ;GAA6B;;AAG7E,SAAgB,WAAW,EAAE,UAAU,aAAa,OAAO,UAAU,KAAK,OAAO,mBAAoC;CACnH,MAAM,cAAc,YAAY,OAAO,SAAS;AAEhD,KAAI,CAAC,YAAY,CAAC,eAAe,CAAC,SAAS,CAAC,KAAK,MAAO,QAAO;AAE/D,QACE,qBAAC;EAAQ,WAAU;;GAChB,eACC,oBAAC;IACC,KAAK,eAAe,aAAa;KAAE,OAAO;KAAM,SAAS;KAAI,CAAC;IAC9D,KAAI;IACJ,eAAY;IACZ,eAAc;IACd,WAAU;KACV;GAEH,eACC,oBAAC;IAAI,WAAU;IAA8E,eAAY;KAAS;GAEpH,oBAAC;IACC,WAAU;IACV,OAAO,mBAAmB,CAAC,cAAc,EAAE,iBAAiB,GAAG;cAE/D,qBAAC;KAAI,WAAU;;MACZ,SACC,oBAAC;OACC,IAAG;OACH,MAAK;OACL,WAAU;iBAET;QACI;MAER,YACC,oBAAC;OAAQ,OAAM;OAAK,WAAU;iBAC3B;QACO;MAEX,eACC,oBAAC;OAAK,WAAU;iBACb;QACI;MAER,KAAK,SAAS,KAAK,QAClB,oBAAC;OAAI,WAAU;iBACb,oBAAC,aAAe,MAA8C;QAC1D;;MAEJ;KACF;;GACE"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { VariantPrice } from "../../types/prices.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 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_runtime2.JSX.Element | null;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { PreviewPrice };
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 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_runtime3.JSX.Element;
|
|
63
63
|
//#endregion
|
|
64
64
|
export { ProductCard };
|
|
65
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { Product } from "../../types/graphql.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/product-preview/index.d.ts
|
|
5
5
|
type ProductPreviewProduct = Pick<Product, 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'>;
|
|
6
6
|
type ProductPreviewProps = {
|
|
7
7
|
product: ProductPreviewProduct;
|
|
8
8
|
isFeatured?: boolean;
|
|
9
|
-
imagePriority?: boolean;
|
|
10
9
|
imageFetchPriority?: 'auto' | 'high' | 'low';
|
|
11
10
|
};
|
|
12
11
|
declare function ProductPreview({
|
|
13
12
|
product,
|
|
14
13
|
isFeatured,
|
|
15
|
-
imagePriority,
|
|
16
14
|
imageFetchPriority
|
|
17
|
-
}: ProductPreviewProps):
|
|
15
|
+
}: ProductPreviewProps): react_jsx_runtime4.JSX.Element;
|
|
18
16
|
//#endregion
|
|
19
17
|
export { ProductPreview, ProductPreviewProduct, ProductPreviewProps };
|
|
20
18
|
//# 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,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,
|
|
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,kBAAA,CAAA,EAAA,MAAmB,GAAA,MACpB,GAAA,KAAA;AAGT,CAAA;iBAEO,cAAA,CACP;EAAA,OAAA;EAAA,UAAA;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, imageFetchPriority }) {
|
|
10
10
|
const { cheapestPrice } = getProductPrice({ product });
|
|
11
11
|
return /* @__PURE__ */ jsx(LocalizedClientLink, {
|
|
12
12
|
href: `/products/${product.handle}`,
|
|
@@ -18,7 +18,6 @@ function ProductPreview({ product, isFeatured, imagePriority = false, imageFetch
|
|
|
18
18
|
images: product.images,
|
|
19
19
|
size: "full",
|
|
20
20
|
isFeatured,
|
|
21
|
-
imagePriority,
|
|
22
21
|
imageFetchPriority
|
|
23
22
|
}), /* @__PURE__ */ jsxs("div", {
|
|
24
23
|
className: "txt-compact-medium mt-4 flex min-w-0 flex-col items-start gap-y-1 text-left",
|
|
@@ -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 ProductPreviewProduct = Pick<\n Product,\n 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'\n>;\n\nexport type ProductPreviewProps = {\n product: ProductPreviewProduct;\n isFeatured?: boolean;\n
|
|
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 imageFetchPriority?: 'auto' | 'high' | 'low';\n};\n\nfunction ProductPreview({\n product,\n isFeatured,\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 imageFetchPriority={imageFetchPriority}\n />\n <div className=\"txt-compact-medium mt-4 flex min-w-0 flex-col items-start gap-y-1 text-left\">\n <Text\n className=\"text-ui-fg-subtle w-full min-w-0 overflow-hidden break-words whitespace-normal [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:2]\"\n data-testid=\"product-title\"\n >\n {product.title}\n </Text>\n <div className=\"flex w-full min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-left\">\n {cheapestPrice && <PreviewPrice price={cheapestPrice} />}\n </div>\n </div>\n </div>\n </LocalizedClientLink>\n );\n}\n\nexport { ProductPreview };\n"],"mappings":";;;;;;;;AAoBA,SAAS,eAAe,EACtB,SACA,YACA,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;IACQ;KACpB,EACF,qBAAC;IAAI,WAAU;eACb,oBAAC;KACC,WAAU;KACV,eAAY;eAEX,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_runtime5 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_runtime5.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,kBAAA,CAAA,GAAA,CAAA,OATC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":[],"mappings":";;;KAMK,cAAA;;EAAA,MAAA,CAAA,EAAA,GAAA,EAAA,GAAc,IAAA;EAWb,IAAA,CAAA,EAAA,OAiCL,GAAA,QAjCyB,GAAA,OAAA,GAAA,MAAT,GAAM,QAAE;;;;;;cAAnB,WAAW,KAAA,CAAM,GAAG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { getImageKitUrl } from "../../lib/utils/imagekit.js";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { Container, clx } from "@medusajs/ui";
|
|
4
|
-
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",
|
|
8
|
+
const Thumbnail = ({ thumbnail, images, size = "small", 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,22 +20,20 @@ const Thumbnail = ({ thumbnail, images, size = "small", imagePriority = false, i
|
|
|
20
20
|
children: /* @__PURE__ */ jsx(ImageOrPlaceholder, {
|
|
21
21
|
image: initialImage,
|
|
22
22
|
size,
|
|
23
|
-
imagePriority,
|
|
24
23
|
imageFetchPriority
|
|
25
24
|
})
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
|
-
const ImageOrPlaceholder = ({ image, size,
|
|
29
|
-
return image ? /* @__PURE__ */ jsx(
|
|
30
|
-
src: image,
|
|
27
|
+
const ImageOrPlaceholder = ({ image, size, imageFetchPriority }) => {
|
|
28
|
+
return image ? /* @__PURE__ */ jsx("img", {
|
|
29
|
+
src: getImageKitUrl(image, {
|
|
30
|
+
width: 800,
|
|
31
|
+
quality: 40
|
|
32
|
+
}),
|
|
31
33
|
alt: "Thumbnail",
|
|
32
34
|
className: "absolute inset-0 object-cover object-center",
|
|
33
35
|
draggable: false,
|
|
34
|
-
|
|
35
|
-
...imageFetchPriority ? { fetchPriority: imageFetchPriority } : {},
|
|
36
|
-
quality: 40,
|
|
37
|
-
sizes: "(max-width: 576px) 280px, (max-width: 768px) 360px, (max-width: 992px) 480px, 800px",
|
|
38
|
-
fill: true
|
|
36
|
+
...imageFetchPriority ? { fetchPriority: imageFetchPriority } : {}
|
|
39
37
|
}) : /* @__PURE__ */ jsx("div", {
|
|
40
38
|
className: "absolute inset-0 flex h-full w-full items-center justify-center",
|
|
41
39
|
children: /* @__PURE__ */ jsx(PlaceholderImage, { size: size === "small" ? 16 : 24 })
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"index.js","names":["Thumbnail: React.FC<ThumbnailProps>"],"sources":["../../../src/components/thumbnail/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { getImageKitUrl } from '../../lib/utils/imagekit';\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 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 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-[29/34]': 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 imageFetchPriority={imageFetchPriority}\n />\n </Container>\n );\n};\n\nconst ImageOrPlaceholder = ({\n image,\n size,\n imageFetchPriority,\n}: Pick<\n ThumbnailProps,\n 'size' | 'imageFetchPriority'\n> & { image?: string }) => {\n return image ? (\n <img\n src={getImageKitUrl(image, { width: 800, quality: 40 })}\n alt=\"Thumbnail\"\n className=\"absolute inset-0 object-cover object-center\"\n draggable={false}\n {...(imageFetchPriority ? { fetchPriority: imageFetchPriority } : {})}\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,oBACA,WACA,eAAe,iBACX;CACJ,MAAM,eAAe,aAAa,SAAS,IAAI;AAE/C,QACE,oBAAC;EACC,WAAW,IACT,mLACA,WACA;GACE,kBAAkB,SAAS;GAC3B,gBAAgB,SAAS;GACzB,aAAa,SAAS;GACtB,aAAa,SAAS;GACtB,aAAa,SAAS;GACtB,UAAU,SAAS;GACpB,CACF;EACD,eAAa;YAEb,oBAAC;GACC,OAAO;GACD;GACc;IACpB;GACQ;;AAIhB,MAAM,sBAAsB,EAC1B,OACA,MACA,yBAIyB;AACzB,QAAO,QACL,oBAAC;EACC,KAAK,eAAe,OAAO;GAAE,OAAO;GAAK,SAAS;GAAI,CAAC;EACvD,KAAI;EACJ,WAAU;EACV,WAAW;EACX,GAAK,qBAAqB,EAAE,eAAe,oBAAoB,GAAG,EAAE;GACpE,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_runtime6 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_runtime6.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,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime7 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_runtime7.JSX.Element;
|
|
17
17
|
declare const useModal: () => ModalContext;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { ModalProvider, useModal };
|
|
@@ -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_runtime8 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_runtime8.JSX.Element;
|
|
19
19
|
declare const useStorefrontContext: () => StorefrontContext;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { StorefrontContext, StorefrontProvider, useStorefrontActions, useStorefrontContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/lib/data/context.tsx"],"sourcesContent":[],"mappings":";;;;;UAMiB,iBAAA;;;;AAAjB;AAIC,UAwBS,uBAAA,CAAuB;EAKpB,QAAA,EAJD,SAIC;EAAsB,KAAA,CAAA,EAHzB,iBAGyB;;AAGhC,cAHU,kBAGV,EAAA,CAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,uBAAA,EAAA,GAAuB,
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/lib/data/context.tsx"],"sourcesContent":[],"mappings":";;;;;UAMiB,iBAAA;;;;AAAjB;AAIC,UAwBS,uBAAA,CAAuB;EAKpB,QAAA,EAJD,SAIC;EAAsB,KAAA,CAAA,EAHzB,iBAGyB;;AAGhC,cAHU,kBAGV,EAAA,CAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAA,uBAAA,EAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAvB;AAAuB,cAwBb,oBAxBa,EAAA,GAAA,GAwBO,iBAxBP"}
|