@nok-integration/storefront-react 0.29.6 → 0.29.8

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/index.d.ts CHANGED
@@ -6037,7 +6037,9 @@ export declare interface SheetHeaderProps {
6037
6037
  * The card only reports the policy; it does not set it. If 14 is wrong, it is wrong in the
6038
6038
  * design, and one word changes it here.
6039
6039
  */
6040
- export declare function ShippingInfo(): JSX.Element;
6040
+ export declare function ShippingInfo({ returns }?: {
6041
+ returns?: boolean;
6042
+ }): JSX.Element;
6041
6043
 
6042
6044
  declare interface ShopContextValue {
6043
6045
  api: DaznClient;
package/dist/index.mjs CHANGED
@@ -8643,7 +8643,7 @@ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
8643
8643
  onRetry: () => void load()
8644
8644
  });
8645
8645
  }
8646
- if (!order.can_return) {
8646
+ if (!order.can_return || order.vip) {
8647
8647
  return jsx(ErrorState, {
8648
8648
  code: "order_not_cancellable",
8649
8649
  onRetry: () => void load()
@@ -9183,10 +9183,6 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
9183
9183
  onReorder();
9184
9184
  return;
9185
9185
  }
9186
- if (current22.vip) {
9187
- navigate?.(`/vip/${encodeURIComponent(current22.vip.invite_ref)}`);
9188
- return;
9189
- }
9190
9186
  setReordering(true);
9191
9187
  try {
9192
9188
  let added = 0;
@@ -9235,7 +9231,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
9235
9231
  className: styles$D.cancelledMeta,
9236
9232
  children: t("Order #{0} · Placed {1}", shortRef$1(order.order_ref), placedOn(order.placed_at, locale))
9237
9233
  })]
9238
- }), jsx(Button, {
9234
+ }), !order.vip && jsx(Button, {
9239
9235
  variant: "primary",
9240
9236
  fullWidth: true,
9241
9237
  className: styles$D.reorder,
@@ -9361,7 +9357,7 @@ function NeedHelp({ order, onStartReturn, onOpenReturn, onContactSupport }) {
9361
9357
  label: returns.length > 1 ? t("Track return {0}", ret.return_ref) : "Track your return",
9362
9358
  status: RETURN_STATUS[ret.status] ?? ret.status.replace(/_/g, " "),
9363
9359
  onClick: () => onOpenReturn?.(ret.return_ref)
9364
- }, ret.return_ref)), order.can_return && onStartReturn && jsx(HelpRow, {
9360
+ }, ret.return_ref)), order.can_return && !order.vip && onStartReturn && jsx(HelpRow, {
9365
9361
  label: "Start a return",
9366
9362
  onClick: onStartReturn
9367
9363
  }), jsx(HelpRow, {
@@ -9757,6 +9753,7 @@ function OrderListContent({ onOpenOrder, onOpenReturn, onStartShopping, locale:
9757
9753
  if (state === "loading") {
9758
9754
  return jsxs("div", {
9759
9755
  className: styles$A.page,
9756
+ "data-shop-layout": "wide",
9760
9757
  children: [jsx(Skeleton, {
9761
9758
  height: 148,
9762
9759
  radius: 12
@@ -10965,11 +10962,11 @@ const styles$q = {
10965
10962
  label: label$1,
10966
10963
  divider: divider$1
10967
10964
  };
10968
- function ShippingInfo() {
10965
+ function ShippingInfo({ returns = true } = {}) {
10969
10966
  const t = useT();
10970
10967
  return jsxs("section", {
10971
10968
  className: styles$q.box,
10972
- "aria-label": t("Shipping and returns"),
10969
+ "aria-label": returns ? t("Shipping and returns") : t("Shipping"),
10973
10970
  children: [jsxs("div", {
10974
10971
  className: styles$q.row,
10975
10972
  children: [jsx("svg", {
@@ -10987,10 +10984,10 @@ function ShippingInfo() {
10987
10984
  className: styles$q.label,
10988
10985
  children: t("Standard or express delivery")
10989
10986
  })]
10990
- }), jsx("div", {
10987
+ }), returns && jsx("div", {
10991
10988
  className: styles$q.divider,
10992
10989
  role: "presentation"
10993
- }), jsxs("div", {
10990
+ }), returns && jsxs("div", {
10994
10991
  className: styles$q.row,
10995
10992
  children: [jsx("svg", {
10996
10993
  className: styles$q.icon,
@@ -12457,7 +12454,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [], c
12457
12454
  variants,
12458
12455
  selectedSku: genericSku,
12459
12456
  onSelect: setGenericSku
12460
- }), jsx(ShippingInfo, {}), product.description && jsx(ProductDetails, {
12457
+ }), jsx(ShippingInfo, {
12458
+ returns: !claim
12459
+ }), product.description && jsx(ProductDetails, {
12461
12460
  description: product.description
12462
12461
  })]
12463
12462
  }), related.length > 0 && jsx("div", {
@@ -8643,7 +8643,7 @@ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
8643
8643
  onRetry: () => void load()
8644
8644
  });
8645
8645
  }
8646
- if (!order.can_return) {
8646
+ if (!order.can_return || order.vip) {
8647
8647
  return jsx(ErrorState, {
8648
8648
  code: "order_not_cancellable",
8649
8649
  onRetry: () => void load()
@@ -9183,10 +9183,6 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
9183
9183
  onReorder();
9184
9184
  return;
9185
9185
  }
9186
- if (current22.vip) {
9187
- navigate?.(`/vip/${encodeURIComponent(current22.vip.invite_ref)}`);
9188
- return;
9189
- }
9190
9186
  setReordering(true);
9191
9187
  try {
9192
9188
  let added = 0;
@@ -9235,7 +9231,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
9235
9231
  className: styles$D.cancelledMeta,
9236
9232
  children: t("Order #{0} · Placed {1}", shortRef$1(order.order_ref), placedOn(order.placed_at, locale))
9237
9233
  })]
9238
- }), jsx(Button, {
9234
+ }), !order.vip && jsx(Button, {
9239
9235
  variant: "primary",
9240
9236
  fullWidth: true,
9241
9237
  className: styles$D.reorder,
@@ -9361,7 +9357,7 @@ function NeedHelp({ order, onStartReturn, onOpenReturn, onContactSupport }) {
9361
9357
  label: returns.length > 1 ? t("Track return {0}", ret.return_ref) : "Track your return",
9362
9358
  status: RETURN_STATUS[ret.status] ?? ret.status.replace(/_/g, " "),
9363
9359
  onClick: () => onOpenReturn?.(ret.return_ref)
9364
- }, ret.return_ref)), order.can_return && onStartReturn && jsx(HelpRow, {
9360
+ }, ret.return_ref)), order.can_return && !order.vip && onStartReturn && jsx(HelpRow, {
9365
9361
  label: "Start a return",
9366
9362
  onClick: onStartReturn
9367
9363
  }), jsx(HelpRow, {
@@ -9757,6 +9753,7 @@ function OrderListContent({ onOpenOrder, onOpenReturn, onStartShopping, locale:
9757
9753
  if (state === "loading") {
9758
9754
  return jsxs("div", {
9759
9755
  className: styles$A.page,
9756
+ "data-shop-layout": "wide",
9760
9757
  children: [jsx(Skeleton, {
9761
9758
  height: 148,
9762
9759
  radius: 12
@@ -10965,11 +10962,11 @@ const styles$q = {
10965
10962
  label: label$1,
10966
10963
  divider: divider$1
10967
10964
  };
10968
- function ShippingInfo() {
10965
+ function ShippingInfo({ returns = true } = {}) {
10969
10966
  const t = useT();
10970
10967
  return jsxs("section", {
10971
10968
  className: styles$q.box,
10972
- "aria-label": t("Shipping and returns"),
10969
+ "aria-label": returns ? t("Shipping and returns") : t("Shipping"),
10973
10970
  children: [jsxs("div", {
10974
10971
  className: styles$q.row,
10975
10972
  children: [jsx("svg", {
@@ -10987,10 +10984,10 @@ function ShippingInfo() {
10987
10984
  className: styles$q.label,
10988
10985
  children: t("Standard or express delivery")
10989
10986
  })]
10990
- }), jsx("div", {
10987
+ }), returns && jsx("div", {
10991
10988
  className: styles$q.divider,
10992
10989
  role: "presentation"
10993
- }), jsxs("div", {
10990
+ }), returns && jsxs("div", {
10994
10991
  className: styles$q.row,
10995
10992
  children: [jsx("svg", {
10996
10993
  className: styles$q.icon,
@@ -12457,7 +12454,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [], c
12457
12454
  variants,
12458
12455
  selectedSku: genericSku,
12459
12456
  onSelect: setGenericSku
12460
- }), jsx(ShippingInfo, {}), product.description && jsx(ProductDetails, {
12457
+ }), jsx(ShippingInfo, {
12458
+ returns: !claim
12459
+ }), product.description && jsx(ProductDetails, {
12461
12460
  description: product.description
12462
12461
  })]
12463
12462
  }), related.length > 0 && jsx("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nok-integration/storefront-react",
3
- "version": "0.29.6",
3
+ "version": "0.29.8",
4
4
  "description": "Mountable React storefront components: catalogue, product detail and cart, mounted directly into a host DOM tree. No iframe.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",