@nok-integration/storefront-react 0.19.23 → 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",
@@ -9009,11 +9008,11 @@ function ShippingInfo() {
9009
9008
  })]
9010
9009
  });
9011
9010
  }
9012
- const bar = "_bar_v5jjj_1";
9013
- const floating$1 = "_floating_v5jjj_52";
9014
- const divider = "_divider_v5jjj_58";
9015
- const info$1 = "_info_v5jjj_62";
9016
- const actions = "_actions_v5jjj_70";
9011
+ const bar = "_bar_coyti_1";
9012
+ const floating$1 = "_floating_coyti_53";
9013
+ const divider = "_divider_coyti_59";
9014
+ const info$1 = "_info_coyti_63";
9015
+ const actions = "_actions_coyti_71";
9017
9016
  const styles$k = {
9018
9017
  bar,
9019
9018
  floating: floating$1,
@@ -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",
@@ -9009,11 +9008,11 @@ function ShippingInfo() {
9009
9008
  })]
9010
9009
  });
9011
9010
  }
9012
- const bar = "_bar_v5jjj_1";
9013
- const floating$1 = "_floating_v5jjj_52";
9014
- const divider = "_divider_v5jjj_58";
9015
- const info$1 = "_info_v5jjj_62";
9016
- const actions = "_actions_v5jjj_70";
9011
+ const bar = "_bar_coyti_1";
9012
+ const floating$1 = "_floating_coyti_53";
9013
+ const divider = "_divider_coyti_59";
9014
+ const info$1 = "_info_coyti_63";
9015
+ const actions = "_actions_coyti_71";
9017
9016
  const styles$k = {
9018
9017
  bar,
9019
9018
  floating: floating$1,
@@ -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);
@@ -2340,10 +2340,9 @@
2340
2340
  height: 1px;
2341
2341
  background: var(--color-border-default);
2342
2342
  }
2343
- ._bar_v5jjj_1 {
2343
+ ._bar_coyti_1 {
2344
2344
  position: sticky;
2345
2345
  bottom: 0;
2346
- bottom: calc(100lvh - 100dvh);
2347
2346
  left: 0;
2348
2347
  right: 0;
2349
2348
  display: flex;
@@ -2353,24 +2352,24 @@
2353
2352
  background: var(--color-surface-default);
2354
2353
  z-index: 50;
2355
2354
  }
2356
- ._floating_v5jjj_52 {
2355
+ ._floating_coyti_53 {
2357
2356
  border-radius: var(--radius-12) var(--radius-12) 0 0;
2358
2357
  filter: drop-shadow(0 -4px 12px rgba(206, 206, 206, 0.48));
2359
2358
  }
2360
- ._divider_v5jjj_58 {
2359
+ ._divider_coyti_59 {
2361
2360
  border-top: 1px solid var(--color-border-default);
2362
2361
  }
2363
- ._info_v5jjj_62 {
2362
+ ._info_coyti_63 {
2364
2363
  display: flex;
2365
2364
  align-items: center;
2366
2365
  justify-content: space-between;
2367
2366
  font-weight: var(--font-weight-bold);
2368
2367
  }
2369
- ._actions_v5jjj_70 {
2368
+ ._actions_coyti_71 {
2370
2369
  display: flex;
2371
2370
  gap: var(--space-8);
2372
2371
  }
2373
- ._actions_v5jjj_70 > * {
2372
+ ._actions_coyti_71 > * {
2374
2373
  flex: 1 1 0;
2375
2374
  }
2376
2375
  ._surface_nkc99_15 {
@@ -2430,13 +2429,13 @@
2430
2429
  flex-direction: column;
2431
2430
  gap: var(--space-20);
2432
2431
  }
2433
- ._gallery_9e68b_1 {
2432
+ ._gallery_nv2a9_1 {
2434
2433
  position: relative;
2435
2434
  display: flex;
2436
2435
  flex-direction: column;
2437
2436
  gap: var(--space-12);
2438
2437
  }
2439
- ._track_9e68b_8 {
2438
+ ._track_nv2a9_8 {
2440
2439
  display: flex;
2441
2440
  overflow-x: auto;
2442
2441
  scroll-snap-type: x mandatory;
@@ -2445,51 +2444,29 @@
2445
2444
  background: var(--color-surface-soft);
2446
2445
  scrollbar-width: none;
2447
2446
  }
2448
- ._track_9e68b_8::-webkit-scrollbar {
2447
+ ._track_nv2a9_8::-webkit-scrollbar {
2449
2448
  display: none;
2450
2449
  }
2451
- ._slide_9e68b_32 {
2450
+ ._slide_nv2a9_32 {
2452
2451
  position: relative;
2453
2452
  flex: 0 0 100%;
2454
2453
  scroll-snap-align: center;
2455
2454
  aspect-ratio: 375 / 475;
2456
2455
  }
2457
- ._image_9e68b_39 {
2456
+ ._image_nv2a9_39 {
2458
2457
  object-fit: cover;
2459
2458
  }
2460
- ._placeholder_9e68b_43 {
2459
+ ._placeholder_nv2a9_43 {
2461
2460
  width: 100%;
2462
2461
  aspect-ratio: 375 / 475;
2463
2462
  background: var(--color-surface-soft);
2464
2463
  }
2465
- ._share_9e68b_50 {
2466
- position: absolute;
2467
- z-index: 1;
2468
- top: var(--space-16);
2469
- right: var(--space-16);
2470
- display: inline-flex;
2471
- align-items: center;
2472
- justify-content: center;
2473
- width: 32px;
2474
- height: 32px;
2475
- padding: 0;
2476
- border: none;
2477
- border-radius: var(--radius-8);
2478
- background: var(--color-surface-soft);
2479
- color: var(--color-text-default);
2480
- cursor: pointer;
2481
- }
2482
- ._dots_9e68b_83 {
2464
+ ._dots_nv2a9_49 {
2483
2465
  display: flex;
2484
2466
  justify-content: center;
2485
2467
  gap: var(--space-6);
2486
2468
  }
2487
- ._share_9e68b_50::after {
2488
- content: "";
2489
- position: absolute;
2490
- inset: -6px;
2491
- }
2492
- ._dot_9e68b_83 {
2469
+ ._dot_nv2a9_49 {
2493
2470
  width: 8px;
2494
2471
  height: 8px;
2495
2472
  padding: 0;
@@ -2499,12 +2476,12 @@
2499
2476
  cursor: pointer;
2500
2477
  position: relative;
2501
2478
  }
2502
- ._dot_9e68b_83::after {
2479
+ ._dot_nv2a9_49::after {
2503
2480
  content: "";
2504
2481
  position: absolute;
2505
2482
  inset: -18px -3px;
2506
2483
  }
2507
- ._dotActive_9e68b_134 {
2484
+ ._dotActive_nv2a9_88 {
2508
2485
  background: var(--color-surface-max);
2509
2486
  }
2510
2487
  ._scrim_ddqa4_8 {
package/dist/styles.css CHANGED
@@ -2340,10 +2340,9 @@
2340
2340
  height: 1px;
2341
2341
  background: var(--color-border-default);
2342
2342
  }
2343
- ._bar_v5jjj_1 {
2343
+ ._bar_coyti_1 {
2344
2344
  position: sticky;
2345
2345
  bottom: 0;
2346
- bottom: calc(100lvh - 100dvh);
2347
2346
  left: 0;
2348
2347
  right: 0;
2349
2348
  display: flex;
@@ -2353,24 +2352,24 @@
2353
2352
  background: var(--color-surface-default);
2354
2353
  z-index: 50;
2355
2354
  }
2356
- ._floating_v5jjj_52 {
2355
+ ._floating_coyti_53 {
2357
2356
  border-radius: var(--radius-12) var(--radius-12) 0 0;
2358
2357
  filter: drop-shadow(0 -4px 12px rgba(206, 206, 206, 0.48));
2359
2358
  }
2360
- ._divider_v5jjj_58 {
2359
+ ._divider_coyti_59 {
2361
2360
  border-top: 1px solid var(--color-border-default);
2362
2361
  }
2363
- ._info_v5jjj_62 {
2362
+ ._info_coyti_63 {
2364
2363
  display: flex;
2365
2364
  align-items: center;
2366
2365
  justify-content: space-between;
2367
2366
  font-weight: var(--font-weight-bold);
2368
2367
  }
2369
- ._actions_v5jjj_70 {
2368
+ ._actions_coyti_71 {
2370
2369
  display: flex;
2371
2370
  gap: var(--space-8);
2372
2371
  }
2373
- ._actions_v5jjj_70 > * {
2372
+ ._actions_coyti_71 > * {
2374
2373
  flex: 1 1 0;
2375
2374
  }
2376
2375
  ._surface_nkc99_15 {
@@ -2430,13 +2429,13 @@
2430
2429
  flex-direction: column;
2431
2430
  gap: var(--space-20);
2432
2431
  }
2433
- ._gallery_9e68b_1 {
2432
+ ._gallery_nv2a9_1 {
2434
2433
  position: relative;
2435
2434
  display: flex;
2436
2435
  flex-direction: column;
2437
2436
  gap: var(--space-12);
2438
2437
  }
2439
- ._track_9e68b_8 {
2438
+ ._track_nv2a9_8 {
2440
2439
  display: flex;
2441
2440
  overflow-x: auto;
2442
2441
  scroll-snap-type: x mandatory;
@@ -2445,51 +2444,29 @@
2445
2444
  background: var(--color-surface-soft);
2446
2445
  scrollbar-width: none;
2447
2446
  }
2448
- ._track_9e68b_8::-webkit-scrollbar {
2447
+ ._track_nv2a9_8::-webkit-scrollbar {
2449
2448
  display: none;
2450
2449
  }
2451
- ._slide_9e68b_32 {
2450
+ ._slide_nv2a9_32 {
2452
2451
  position: relative;
2453
2452
  flex: 0 0 100%;
2454
2453
  scroll-snap-align: center;
2455
2454
  aspect-ratio: 375 / 475;
2456
2455
  }
2457
- ._image_9e68b_39 {
2456
+ ._image_nv2a9_39 {
2458
2457
  object-fit: cover;
2459
2458
  }
2460
- ._placeholder_9e68b_43 {
2459
+ ._placeholder_nv2a9_43 {
2461
2460
  width: 100%;
2462
2461
  aspect-ratio: 375 / 475;
2463
2462
  background: var(--color-surface-soft);
2464
2463
  }
2465
- ._share_9e68b_50 {
2466
- position: absolute;
2467
- z-index: 1;
2468
- top: var(--space-16);
2469
- right: var(--space-16);
2470
- display: inline-flex;
2471
- align-items: center;
2472
- justify-content: center;
2473
- width: 32px;
2474
- height: 32px;
2475
- padding: 0;
2476
- border: none;
2477
- border-radius: var(--radius-8);
2478
- background: var(--color-surface-soft);
2479
- color: var(--color-text-default);
2480
- cursor: pointer;
2481
- }
2482
- ._dots_9e68b_83 {
2464
+ ._dots_nv2a9_49 {
2483
2465
  display: flex;
2484
2466
  justify-content: center;
2485
2467
  gap: var(--space-6);
2486
2468
  }
2487
- ._share_9e68b_50::after {
2488
- content: "";
2489
- position: absolute;
2490
- inset: -6px;
2491
- }
2492
- ._dot_9e68b_83 {
2469
+ ._dot_nv2a9_49 {
2493
2470
  width: 8px;
2494
2471
  height: 8px;
2495
2472
  padding: 0;
@@ -2499,12 +2476,12 @@
2499
2476
  cursor: pointer;
2500
2477
  position: relative;
2501
2478
  }
2502
- ._dot_9e68b_83::after {
2479
+ ._dot_nv2a9_49::after {
2503
2480
  content: "";
2504
2481
  position: absolute;
2505
2482
  inset: -18px -3px;
2506
2483
  }
2507
- ._dotActive_9e68b_134 {
2484
+ ._dotActive_nv2a9_88 {
2508
2485
  background: var(--color-surface-max);
2509
2486
  }
2510
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.23",
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": {