@nok-integration/storefront-react 0.29.7 → 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, {
@@ -10966,11 +10962,11 @@ const styles$q = {
10966
10962
  label: label$1,
10967
10963
  divider: divider$1
10968
10964
  };
10969
- function ShippingInfo() {
10965
+ function ShippingInfo({ returns = true } = {}) {
10970
10966
  const t = useT();
10971
10967
  return jsxs("section", {
10972
10968
  className: styles$q.box,
10973
- "aria-label": t("Shipping and returns"),
10969
+ "aria-label": returns ? t("Shipping and returns") : t("Shipping"),
10974
10970
  children: [jsxs("div", {
10975
10971
  className: styles$q.row,
10976
10972
  children: [jsx("svg", {
@@ -10988,10 +10984,10 @@ function ShippingInfo() {
10988
10984
  className: styles$q.label,
10989
10985
  children: t("Standard or express delivery")
10990
10986
  })]
10991
- }), jsx("div", {
10987
+ }), returns && jsx("div", {
10992
10988
  className: styles$q.divider,
10993
10989
  role: "presentation"
10994
- }), jsxs("div", {
10990
+ }), returns && jsxs("div", {
10995
10991
  className: styles$q.row,
10996
10992
  children: [jsx("svg", {
10997
10993
  className: styles$q.icon,
@@ -12458,7 +12454,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [], c
12458
12454
  variants,
12459
12455
  selectedSku: genericSku,
12460
12456
  onSelect: setGenericSku
12461
- }), jsx(ShippingInfo, {}), product.description && jsx(ProductDetails, {
12457
+ }), jsx(ShippingInfo, {
12458
+ returns: !claim
12459
+ }), product.description && jsx(ProductDetails, {
12462
12460
  description: product.description
12463
12461
  })]
12464
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, {
@@ -10966,11 +10962,11 @@ const styles$q = {
10966
10962
  label: label$1,
10967
10963
  divider: divider$1
10968
10964
  };
10969
- function ShippingInfo() {
10965
+ function ShippingInfo({ returns = true } = {}) {
10970
10966
  const t = useT();
10971
10967
  return jsxs("section", {
10972
10968
  className: styles$q.box,
10973
- "aria-label": t("Shipping and returns"),
10969
+ "aria-label": returns ? t("Shipping and returns") : t("Shipping"),
10974
10970
  children: [jsxs("div", {
10975
10971
  className: styles$q.row,
10976
10972
  children: [jsx("svg", {
@@ -10988,10 +10984,10 @@ function ShippingInfo() {
10988
10984
  className: styles$q.label,
10989
10985
  children: t("Standard or express delivery")
10990
10986
  })]
10991
- }), jsx("div", {
10987
+ }), returns && jsx("div", {
10992
10988
  className: styles$q.divider,
10993
10989
  role: "presentation"
10994
- }), jsxs("div", {
10990
+ }), returns && jsxs("div", {
10995
10991
  className: styles$q.row,
10996
10992
  children: [jsx("svg", {
10997
10993
  className: styles$q.icon,
@@ -12458,7 +12454,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [], c
12458
12454
  variants,
12459
12455
  selectedSku: genericSku,
12460
12456
  onSelect: setGenericSku
12461
- }), jsx(ShippingInfo, {}), product.description && jsx(ProductDetails, {
12457
+ }), jsx(ShippingInfo, {
12458
+ returns: !claim
12459
+ }), product.description && jsx(ProductDetails, {
12462
12460
  description: product.description
12463
12461
  })]
12464
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.7",
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",