@nok-integration/storefront-react 0.19.24 → 0.19.25

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.mjs CHANGED
@@ -5689,7 +5689,6 @@ const ES = {
5689
5689
  "See all": "Ver todo",
5690
5690
  "See more": "Ver más",
5691
5691
  "Select an option": "Selecciona una opción",
5692
- Share: "Compartir",
5693
5692
  Shipping: "Envío",
5694
5693
  "Shipping address": "Dirección de envío",
5695
5694
  "Shipping and returns": "Envíos y devoluciones",
@@ -9299,22 +9298,20 @@ function CartSheetProvider({ children }) {
9299
9298
  })]
9300
9299
  });
9301
9300
  }
9302
- const gallery = "_gallery_9e68b_1";
9303
- const track$2 = "_track_9e68b_8";
9304
- const slide$1 = "_slide_9e68b_32";
9305
- const image$4 = "_image_9e68b_39";
9306
- const placeholder$1 = "_placeholder_9e68b_43";
9307
- const share = "_share_9e68b_50";
9308
- const dots$2 = "_dots_9e68b_83";
9309
- const dot$2 = "_dot_9e68b_83";
9310
- const dotActive$2 = "_dotActive_9e68b_134";
9301
+ const gallery = "_gallery_nv2a9_1";
9302
+ const track$2 = "_track_nv2a9_8";
9303
+ const slide$1 = "_slide_nv2a9_32";
9304
+ const image$4 = "_image_nv2a9_39";
9305
+ const placeholder$1 = "_placeholder_nv2a9_43";
9306
+ const dots$2 = "_dots_nv2a9_49";
9307
+ const dot$2 = "_dot_nv2a9_49";
9308
+ const dotActive$2 = "_dotActive_nv2a9_88";
9311
9309
  const styles$i = {
9312
9310
  gallery,
9313
9311
  track: track$2,
9314
9312
  slide: slide$1,
9315
9313
  image: image$4,
9316
9314
  placeholder: placeholder$1,
9317
- share,
9318
9315
  dots: dots$2,
9319
9316
  dot: dot$2,
9320
9317
  dotActive: dotActive$2
@@ -9357,37 +9354,9 @@ function MediaGallery({ media: media2, alt }) {
9357
9354
  "aria-hidden": "true"
9358
9355
  });
9359
9356
  }
9360
- function share2() {
9361
- if (typeof navigator !== "undefined" && navigator.share) {
9362
- void navigator.share({
9363
- title: alt,
9364
- url: window.location.href
9365
- }).catch(() => {
9366
- });
9367
- }
9368
- }
9369
9357
  return jsxs("div", {
9370
9358
  className: styles$i.gallery,
9371
- children: [jsx("button", {
9372
- type: "button",
9373
- className: styles$i.share,
9374
- onClick: share2,
9375
- "aria-label": t("Share"),
9376
- children: jsx("svg", {
9377
- width: "20",
9378
- height: "20",
9379
- viewBox: "0 0 24 24",
9380
- fill: "none",
9381
- "aria-hidden": "true",
9382
- children: jsx("path", {
9383
- d: "M12 3v12M12 3 8 7m4-4 4 4M5 12v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6",
9384
- stroke: "currentColor",
9385
- strokeWidth: "1.6",
9386
- strokeLinecap: "round",
9387
- strokeLinejoin: "round"
9388
- })
9389
- })
9390
- }), jsx("div", {
9359
+ children: [jsx("div", {
9391
9360
  className: styles$i.track,
9392
9361
  ref: trackRef,
9393
9362
  role: "group",
@@ -10068,7 +10037,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10068
10037
  const colourSoldOut = hasColours && selectedColour ? !colours.find((c) => c.value === selectedColour)?.available : false;
10069
10038
  const purchasable = anyInStock && !colourSoldOut;
10070
10039
  const colourImage = useMemo(() => selectedColour ? baseColours.find((c) => c.value === selectedColour)?.image : void 0, [baseColours, selectedColour]);
10071
- const media2 = useMemo(() => colourImage ? [colourImage, ...product.media.filter((m) => m !== colourImage)] : product.media, [colourImage, product.media]);
10040
+ const shootColour = baseColours[0]?.value;
10041
+ const media2 = useMemo(() => {
10042
+ if (!colourImage) return product.media;
10043
+ if (selectedColour === shootColour) {
10044
+ return [colourImage, ...product.media.filter((m) => m !== colourImage)];
10045
+ }
10046
+ return [colourImage];
10047
+ }, [colourImage, product.media, selectedColour, shootColour]);
10072
10048
  function selectSize(value2) {
10073
10049
  setSelectedSize(value2);
10074
10050
  setSizeError(false);
@@ -5689,7 +5689,6 @@ const ES = {
5689
5689
  "See all": "Ver todo",
5690
5690
  "See more": "Ver más",
5691
5691
  "Select an option": "Selecciona una opción",
5692
- Share: "Compartir",
5693
5692
  Shipping: "Envío",
5694
5693
  "Shipping address": "Dirección de envío",
5695
5694
  "Shipping and returns": "Envíos y devoluciones",
@@ -9299,22 +9298,20 @@ function CartSheetProvider({ children }) {
9299
9298
  })]
9300
9299
  });
9301
9300
  }
9302
- const gallery = "_gallery_9e68b_1";
9303
- const track$2 = "_track_9e68b_8";
9304
- const slide$1 = "_slide_9e68b_32";
9305
- const image$4 = "_image_9e68b_39";
9306
- const placeholder$1 = "_placeholder_9e68b_43";
9307
- const share = "_share_9e68b_50";
9308
- const dots$2 = "_dots_9e68b_83";
9309
- const dot$2 = "_dot_9e68b_83";
9310
- const dotActive$2 = "_dotActive_9e68b_134";
9301
+ const gallery = "_gallery_nv2a9_1";
9302
+ const track$2 = "_track_nv2a9_8";
9303
+ const slide$1 = "_slide_nv2a9_32";
9304
+ const image$4 = "_image_nv2a9_39";
9305
+ const placeholder$1 = "_placeholder_nv2a9_43";
9306
+ const dots$2 = "_dots_nv2a9_49";
9307
+ const dot$2 = "_dot_nv2a9_49";
9308
+ const dotActive$2 = "_dotActive_nv2a9_88";
9311
9309
  const styles$i = {
9312
9310
  gallery,
9313
9311
  track: track$2,
9314
9312
  slide: slide$1,
9315
9313
  image: image$4,
9316
9314
  placeholder: placeholder$1,
9317
- share,
9318
9315
  dots: dots$2,
9319
9316
  dot: dot$2,
9320
9317
  dotActive: dotActive$2
@@ -9357,37 +9354,9 @@ function MediaGallery({ media: media2, alt }) {
9357
9354
  "aria-hidden": "true"
9358
9355
  });
9359
9356
  }
9360
- function share2() {
9361
- if (typeof navigator !== "undefined" && navigator.share) {
9362
- void navigator.share({
9363
- title: alt,
9364
- url: window.location.href
9365
- }).catch(() => {
9366
- });
9367
- }
9368
- }
9369
9357
  return jsxs("div", {
9370
9358
  className: styles$i.gallery,
9371
- children: [jsx("button", {
9372
- type: "button",
9373
- className: styles$i.share,
9374
- onClick: share2,
9375
- "aria-label": t("Share"),
9376
- children: jsx("svg", {
9377
- width: "20",
9378
- height: "20",
9379
- viewBox: "0 0 24 24",
9380
- fill: "none",
9381
- "aria-hidden": "true",
9382
- children: jsx("path", {
9383
- d: "M12 3v12M12 3 8 7m4-4 4 4M5 12v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6",
9384
- stroke: "currentColor",
9385
- strokeWidth: "1.6",
9386
- strokeLinecap: "round",
9387
- strokeLinejoin: "round"
9388
- })
9389
- })
9390
- }), jsx("div", {
9359
+ children: [jsx("div", {
9391
9360
  className: styles$i.track,
9392
9361
  ref: trackRef,
9393
9362
  role: "group",
@@ -10068,7 +10037,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10068
10037
  const colourSoldOut = hasColours && selectedColour ? !colours.find((c) => c.value === selectedColour)?.available : false;
10069
10038
  const purchasable = anyInStock && !colourSoldOut;
10070
10039
  const colourImage = useMemo(() => selectedColour ? baseColours.find((c) => c.value === selectedColour)?.image : void 0, [baseColours, selectedColour]);
10071
- const media2 = useMemo(() => colourImage ? [colourImage, ...product.media.filter((m) => m !== colourImage)] : product.media, [colourImage, product.media]);
10040
+ const shootColour = baseColours[0]?.value;
10041
+ const media2 = useMemo(() => {
10042
+ if (!colourImage) return product.media;
10043
+ if (selectedColour === shootColour) {
10044
+ return [colourImage, ...product.media.filter((m) => m !== colourImage)];
10045
+ }
10046
+ return [colourImage];
10047
+ }, [colourImage, product.media, selectedColour, shootColour]);
10072
10048
  function selectSize(value2) {
10073
10049
  setSelectedSize(value2);
10074
10050
  setSizeError(false);
@@ -2429,13 +2429,13 @@
2429
2429
  flex-direction: column;
2430
2430
  gap: var(--space-20);
2431
2431
  }
2432
- ._gallery_9e68b_1 {
2432
+ ._gallery_nv2a9_1 {
2433
2433
  position: relative;
2434
2434
  display: flex;
2435
2435
  flex-direction: column;
2436
2436
  gap: var(--space-12);
2437
2437
  }
2438
- ._track_9e68b_8 {
2438
+ ._track_nv2a9_8 {
2439
2439
  display: flex;
2440
2440
  overflow-x: auto;
2441
2441
  scroll-snap-type: x mandatory;
@@ -2444,51 +2444,29 @@
2444
2444
  background: var(--color-surface-soft);
2445
2445
  scrollbar-width: none;
2446
2446
  }
2447
- ._track_9e68b_8::-webkit-scrollbar {
2447
+ ._track_nv2a9_8::-webkit-scrollbar {
2448
2448
  display: none;
2449
2449
  }
2450
- ._slide_9e68b_32 {
2450
+ ._slide_nv2a9_32 {
2451
2451
  position: relative;
2452
2452
  flex: 0 0 100%;
2453
2453
  scroll-snap-align: center;
2454
2454
  aspect-ratio: 375 / 475;
2455
2455
  }
2456
- ._image_9e68b_39 {
2456
+ ._image_nv2a9_39 {
2457
2457
  object-fit: cover;
2458
2458
  }
2459
- ._placeholder_9e68b_43 {
2459
+ ._placeholder_nv2a9_43 {
2460
2460
  width: 100%;
2461
2461
  aspect-ratio: 375 / 475;
2462
2462
  background: var(--color-surface-soft);
2463
2463
  }
2464
- ._share_9e68b_50 {
2465
- position: absolute;
2466
- z-index: 1;
2467
- top: var(--space-16);
2468
- right: var(--space-16);
2469
- display: inline-flex;
2470
- align-items: center;
2471
- justify-content: center;
2472
- width: 32px;
2473
- height: 32px;
2474
- padding: 0;
2475
- border: none;
2476
- border-radius: var(--radius-8);
2477
- background: var(--color-surface-soft);
2478
- color: var(--color-text-default);
2479
- cursor: pointer;
2480
- }
2481
- ._dots_9e68b_83 {
2464
+ ._dots_nv2a9_49 {
2482
2465
  display: flex;
2483
2466
  justify-content: center;
2484
2467
  gap: var(--space-6);
2485
2468
  }
2486
- ._share_9e68b_50::after {
2487
- content: "";
2488
- position: absolute;
2489
- inset: -6px;
2490
- }
2491
- ._dot_9e68b_83 {
2469
+ ._dot_nv2a9_49 {
2492
2470
  width: 8px;
2493
2471
  height: 8px;
2494
2472
  padding: 0;
@@ -2498,12 +2476,12 @@
2498
2476
  cursor: pointer;
2499
2477
  position: relative;
2500
2478
  }
2501
- ._dot_9e68b_83::after {
2479
+ ._dot_nv2a9_49::after {
2502
2480
  content: "";
2503
2481
  position: absolute;
2504
2482
  inset: -18px -3px;
2505
2483
  }
2506
- ._dotActive_9e68b_134 {
2484
+ ._dotActive_nv2a9_88 {
2507
2485
  background: var(--color-surface-max);
2508
2486
  }
2509
2487
  ._scrim_ddqa4_8 {
package/dist/styles.css CHANGED
@@ -2429,13 +2429,13 @@
2429
2429
  flex-direction: column;
2430
2430
  gap: var(--space-20);
2431
2431
  }
2432
- ._gallery_9e68b_1 {
2432
+ ._gallery_nv2a9_1 {
2433
2433
  position: relative;
2434
2434
  display: flex;
2435
2435
  flex-direction: column;
2436
2436
  gap: var(--space-12);
2437
2437
  }
2438
- ._track_9e68b_8 {
2438
+ ._track_nv2a9_8 {
2439
2439
  display: flex;
2440
2440
  overflow-x: auto;
2441
2441
  scroll-snap-type: x mandatory;
@@ -2444,51 +2444,29 @@
2444
2444
  background: var(--color-surface-soft);
2445
2445
  scrollbar-width: none;
2446
2446
  }
2447
- ._track_9e68b_8::-webkit-scrollbar {
2447
+ ._track_nv2a9_8::-webkit-scrollbar {
2448
2448
  display: none;
2449
2449
  }
2450
- ._slide_9e68b_32 {
2450
+ ._slide_nv2a9_32 {
2451
2451
  position: relative;
2452
2452
  flex: 0 0 100%;
2453
2453
  scroll-snap-align: center;
2454
2454
  aspect-ratio: 375 / 475;
2455
2455
  }
2456
- ._image_9e68b_39 {
2456
+ ._image_nv2a9_39 {
2457
2457
  object-fit: cover;
2458
2458
  }
2459
- ._placeholder_9e68b_43 {
2459
+ ._placeholder_nv2a9_43 {
2460
2460
  width: 100%;
2461
2461
  aspect-ratio: 375 / 475;
2462
2462
  background: var(--color-surface-soft);
2463
2463
  }
2464
- ._share_9e68b_50 {
2465
- position: absolute;
2466
- z-index: 1;
2467
- top: var(--space-16);
2468
- right: var(--space-16);
2469
- display: inline-flex;
2470
- align-items: center;
2471
- justify-content: center;
2472
- width: 32px;
2473
- height: 32px;
2474
- padding: 0;
2475
- border: none;
2476
- border-radius: var(--radius-8);
2477
- background: var(--color-surface-soft);
2478
- color: var(--color-text-default);
2479
- cursor: pointer;
2480
- }
2481
- ._dots_9e68b_83 {
2464
+ ._dots_nv2a9_49 {
2482
2465
  display: flex;
2483
2466
  justify-content: center;
2484
2467
  gap: var(--space-6);
2485
2468
  }
2486
- ._share_9e68b_50::after {
2487
- content: "";
2488
- position: absolute;
2489
- inset: -6px;
2490
- }
2491
- ._dot_9e68b_83 {
2469
+ ._dot_nv2a9_49 {
2492
2470
  width: 8px;
2493
2471
  height: 8px;
2494
2472
  padding: 0;
@@ -2498,12 +2476,12 @@
2498
2476
  cursor: pointer;
2499
2477
  position: relative;
2500
2478
  }
2501
- ._dot_9e68b_83::after {
2479
+ ._dot_nv2a9_49::after {
2502
2480
  content: "";
2503
2481
  position: absolute;
2504
2482
  inset: -18px -3px;
2505
2483
  }
2506
- ._dotActive_9e68b_134 {
2484
+ ._dotActive_nv2a9_88 {
2507
2485
  background: var(--color-surface-max);
2508
2486
  }
2509
2487
  ._scrim_ddqa4_8 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nok-integration/storefront-react",
3
- "version": "0.19.24",
3
+ "version": "0.19.25",
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
  "publishConfig": {