@nok-integration/storefront-react 0.19.16 → 0.19.17

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
@@ -1253,12 +1253,15 @@ declare const CategoryPage: z.ZodObject<{
1253
1253
  }>, z.ZodObject<{
1254
1254
  kind: z.ZodLiteral<"lifestyle_image">;
1255
1255
  images: z.ZodArray<z.ZodString, "many">;
1256
+ videos: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>, "many">>;
1256
1257
  }, "strip", z.ZodTypeAny, {
1257
1258
  kind: "lifestyle_image";
1258
1259
  images: string[];
1260
+ videos?: (string | null)[] | undefined;
1259
1261
  }, {
1260
1262
  kind: "lifestyle_image";
1261
1263
  images: string[];
1264
+ videos?: (string | null)[] | undefined;
1262
1265
  }>, z.ZodObject<{
1263
1266
  kind: z.ZodLiteral<"grid">;
1264
1267
  title: z.ZodOptional<z.ZodString>;
@@ -1719,6 +1722,7 @@ declare const CategoryPage: z.ZodObject<{
1719
1722
  } | {
1720
1723
  kind: "lifestyle_image";
1721
1724
  images: string[];
1725
+ videos?: (string | null)[] | undefined;
1722
1726
  } | {
1723
1727
  kind: "grid";
1724
1728
  products: {
@@ -1931,6 +1935,7 @@ declare const CategoryPage: z.ZodObject<{
1931
1935
  } | {
1932
1936
  kind: "lifestyle_image";
1933
1937
  images: string[];
1938
+ videos?: (string | null)[] | undefined;
1934
1939
  } | {
1935
1940
  kind: "grid";
1936
1941
  products: {
@@ -2381,6 +2386,7 @@ declare function createClient(options: ClientOptions): {
2381
2386
  } | {
2382
2387
  kind: "lifestyle_image";
2383
2388
  images: string[];
2389
+ videos?: (string | null)[] | undefined;
2384
2390
  } | {
2385
2391
  kind: "grid";
2386
2392
  products: {
@@ -3460,15 +3466,30 @@ export declare function isDuplicateOrder(err: unknown): boolean;
3460
3466
  export declare function isUnauthorized(err: unknown): boolean;
3461
3467
 
3462
3468
  /**
3463
- * Full-width editorial image, swipeable when the CMS supplies more than one.
3469
+ * Full-width editorial band, swipeable when the CMS supplies more than one slide.
3464
3470
  *
3465
3471
  * It previously rendered `images[0]` and dropped the rest, which is a silent failure of
3466
3472
  * the worst kind: the block takes an array, an author publishes three, and nothing on the
3467
3473
  * screen says the other two exist.
3474
+ *
3475
+ * **A slide is a picture or a clip, and the picture is the clip's poster.** The pairing is
3476
+ * positional and comes off the wire that way, so `images[i]` is what shows for slide `i`
3477
+ * until its video decodes, and all that shows when motion is reduced — the same rule the
3478
+ * shop entry's slides follow. `priority` stays on the image path only: a band this far
3479
+ * down the page has no business fetching a megabyte before it is anywhere near the screen,
3480
+ * and `ShopVideo` starts its own download when the slide comes into view.
3468
3481
  */
3469
- export declare function LifestyleImage({ images }: {
3482
+ export declare function LifestyleImage({ images, videos }: LifestyleImageProps): JSX.Element | null;
3483
+
3484
+ declare interface LifestyleImageProps {
3470
3485
  images: string[];
3471
- }): JSX.Element | null;
3486
+ /**
3487
+ * Parallel to `images`: the clip for the slide at the same index, `null` where that
3488
+ * slide is a still. Absent for a band of stills, which is every band published before
3489
+ * contracts 2.51.0.
3490
+ */
3491
+ videos?: (string | null)[];
3492
+ }
3472
3493
 
3473
3494
  /** Editorial text band between PCP sections. */
3474
3495
  export declare function LifestyleText({ text, align }: LifestyleTextProps): JSX.Element;
package/dist/index.mjs CHANGED
@@ -4343,7 +4343,8 @@ function requireContent() {
4343
4343
  });
4344
4344
  exports.LifestyleImageBlock = zod_1.z.object({
4345
4345
  kind: zod_1.z.literal("lifestyle_image"),
4346
- images: zod_1.z.array(common_1.Url).min(1)
4346
+ images: zod_1.z.array(common_1.Url).min(1),
4347
+ videos: zod_1.z.array(common_1.Url.nullable()).optional()
4347
4348
  });
4348
4349
  exports.GridBlock = zod_1.z.object({
4349
4350
  kind: zod_1.z.literal("grid"),
@@ -10205,14 +10206,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10205
10206
  })]
10206
10207
  });
10207
10208
  }
10208
- const hero$1 = "_hero_1glho_10";
10209
- const image$2 = "_image_1glho_42";
10210
- const scrim$1 = "_scrim_1glho_70";
10211
- const fade = "_fade_1glho_94";
10212
- const text$2 = "_text_1glho_108";
10213
- const title$5 = "_title_1glho_146";
10214
- const subtitle$2 = "_subtitle_1glho_157";
10215
- const noImage = "_noImage_1glho_172";
10209
+ const hero$1 = "_hero_wguje_10";
10210
+ const image$2 = "_image_wguje_42";
10211
+ const scrim$1 = "_scrim_wguje_70";
10212
+ const fade = "_fade_wguje_94";
10213
+ const text$2 = "_text_wguje_108";
10214
+ const title$5 = "_title_wguje_155";
10215
+ const subtitle$2 = "_subtitle_wguje_166";
10216
+ const noImage = "_noImage_wguje_181";
10216
10217
  const styles$9 = {
10217
10218
  hero: hero$1,
10218
10219
  image: image$2,
@@ -10290,7 +10291,7 @@ const styles$7 = {
10290
10291
  dot: dot$1,
10291
10292
  dotActive: dotActive$1
10292
10293
  };
10293
- function LifestyleImage({ images }) {
10294
+ function LifestyleImage({ images, videos }) {
10294
10295
  const trackRef = useRef(null);
10295
10296
  const [active, setActive] = useState(0);
10296
10297
  useEffect(() => {
@@ -10310,17 +10311,25 @@ function LifestyleImage({ images }) {
10310
10311
  children: [jsx("ul", {
10311
10312
  className: styles$7.track,
10312
10313
  ref: trackRef,
10313
- children: images.map((src, i) => jsx("li", {
10314
- className: styles$7.slide,
10315
- children: jsx(ShopImage, {
10316
- src,
10317
- alt: "",
10318
- fill: true,
10319
- sizes: "(max-width: 480px) 100vw, 480px",
10320
- className: styles$7.image,
10321
- priority: i === 0
10322
- })
10323
- }, src))
10314
+ children: images.map((src, i) => {
10315
+ const clip = videos?.[i];
10316
+ return jsx("li", {
10317
+ className: styles$7.slide,
10318
+ children: clip ? jsx(ShopVideo, {
10319
+ src: clip,
10320
+ poster: src,
10321
+ fill: true,
10322
+ className: styles$7.image
10323
+ }) : jsx(ShopImage, {
10324
+ src,
10325
+ alt: "",
10326
+ fill: true,
10327
+ sizes: "(max-width: 480px) 100vw, 480px",
10328
+ className: styles$7.image,
10329
+ priority: i === 0
10330
+ })
10331
+ }, src);
10332
+ })
10324
10333
  }), images.length > 1 && jsx("div", {
10325
10334
  className: styles$7.dots,
10326
10335
  "aria-hidden": "true",
@@ -10508,7 +10517,8 @@ function Block({ block }) {
10508
10517
  });
10509
10518
  case "lifestyle_image":
10510
10519
  return jsx(LifestyleImage, {
10511
- images: block.images
10520
+ images: block.images,
10521
+ videos: block.videos
10512
10522
  });
10513
10523
  case "grid":
10514
10524
  return jsxs("div", {
@@ -4343,7 +4343,8 @@ function requireContent() {
4343
4343
  });
4344
4344
  exports.LifestyleImageBlock = zod_1.z.object({
4345
4345
  kind: zod_1.z.literal("lifestyle_image"),
4346
- images: zod_1.z.array(common_1.Url).min(1)
4346
+ images: zod_1.z.array(common_1.Url).min(1),
4347
+ videos: zod_1.z.array(common_1.Url.nullable()).optional()
4347
4348
  });
4348
4349
  exports.GridBlock = zod_1.z.object({
4349
4350
  kind: zod_1.z.literal("grid"),
@@ -10205,14 +10206,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10205
10206
  })]
10206
10207
  });
10207
10208
  }
10208
- const hero$1 = "_hero_1glho_10";
10209
- const image$2 = "_image_1glho_42";
10210
- const scrim$1 = "_scrim_1glho_70";
10211
- const fade = "_fade_1glho_94";
10212
- const text$2 = "_text_1glho_108";
10213
- const title$5 = "_title_1glho_146";
10214
- const subtitle$2 = "_subtitle_1glho_157";
10215
- const noImage = "_noImage_1glho_172";
10209
+ const hero$1 = "_hero_wguje_10";
10210
+ const image$2 = "_image_wguje_42";
10211
+ const scrim$1 = "_scrim_wguje_70";
10212
+ const fade = "_fade_wguje_94";
10213
+ const text$2 = "_text_wguje_108";
10214
+ const title$5 = "_title_wguje_155";
10215
+ const subtitle$2 = "_subtitle_wguje_166";
10216
+ const noImage = "_noImage_wguje_181";
10216
10217
  const styles$9 = {
10217
10218
  hero: hero$1,
10218
10219
  image: image$2,
@@ -10290,7 +10291,7 @@ const styles$7 = {
10290
10291
  dot: dot$1,
10291
10292
  dotActive: dotActive$1
10292
10293
  };
10293
- function LifestyleImage({ images }) {
10294
+ function LifestyleImage({ images, videos }) {
10294
10295
  const trackRef = useRef(null);
10295
10296
  const [active, setActive] = useState(0);
10296
10297
  useEffect(() => {
@@ -10310,17 +10311,25 @@ function LifestyleImage({ images }) {
10310
10311
  children: [jsx("ul", {
10311
10312
  className: styles$7.track,
10312
10313
  ref: trackRef,
10313
- children: images.map((src, i) => jsx("li", {
10314
- className: styles$7.slide,
10315
- children: jsx(ShopImage, {
10316
- src,
10317
- alt: "",
10318
- fill: true,
10319
- sizes: "(max-width: 480px) 100vw, 480px",
10320
- className: styles$7.image,
10321
- priority: i === 0
10322
- })
10323
- }, src))
10314
+ children: images.map((src, i) => {
10315
+ const clip = videos?.[i];
10316
+ return jsx("li", {
10317
+ className: styles$7.slide,
10318
+ children: clip ? jsx(ShopVideo, {
10319
+ src: clip,
10320
+ poster: src,
10321
+ fill: true,
10322
+ className: styles$7.image
10323
+ }) : jsx(ShopImage, {
10324
+ src,
10325
+ alt: "",
10326
+ fill: true,
10327
+ sizes: "(max-width: 480px) 100vw, 480px",
10328
+ className: styles$7.image,
10329
+ priority: i === 0
10330
+ })
10331
+ }, src);
10332
+ })
10324
10333
  }), images.length > 1 && jsx("div", {
10325
10334
  className: styles$7.dots,
10326
10335
  "aria-hidden": "true",
@@ -10508,7 +10517,8 @@ function Block({ block }) {
10508
10517
  });
10509
10518
  case "lifestyle_image":
10510
10519
  return jsx(LifestyleImage, {
10511
- images: block.images
10520
+ images: block.images,
10521
+ videos: block.videos
10512
10522
  });
10513
10523
  case "grid":
10514
10524
  return jsxs("div", {
@@ -3107,7 +3107,7 @@
3107
3107
  ._oos_1hv16_66 {
3108
3108
  color: var(--color-state-surface-critical-default);
3109
3109
  }
3110
- ._hero_1glho_10 {
3110
+ ._hero_wguje_10 {
3111
3111
  --hero-height: clamp(480px, calc(100svh - var(--hero-top, 0px)), 812px);
3112
3112
  position: relative;
3113
3113
  height: var(--hero-height);
@@ -3115,15 +3115,15 @@
3115
3115
  background: var(--color-surface-default);
3116
3116
  margin-bottom: calc(var(--hero-height) * -237 / 812);
3117
3117
  }
3118
- ._image_1glho_42 {
3118
+ ._image_wguje_42 {
3119
3119
  position: absolute;
3120
3120
  inset: 0;
3121
3121
  }
3122
- ._image_1glho_42 img {
3122
+ ._image_wguje_42 img {
3123
3123
  object-fit: cover;
3124
3124
  object-position: top center;
3125
3125
  }
3126
- ._scrim_1glho_70 {
3126
+ ._scrim_wguje_70 {
3127
3127
  position: absolute;
3128
3128
  inset: 0;
3129
3129
  background:
@@ -3133,7 +3133,7 @@
3133
3133
  rgba(0, 0, 0, 0.1) 45%,
3134
3134
  rgba(0, 0, 0, 0) 70%);
3135
3135
  }
3136
- ._fade_1glho_94 {
3136
+ ._fade_wguje_94 {
3137
3137
  position: absolute;
3138
3138
  right: 0;
3139
3139
  bottom: 0;
@@ -3146,19 +3146,19 @@
3146
3146
  rgba(8, 14, 18, 0.65) 55%,
3147
3147
  var(--color-surface-default) 100%);
3148
3148
  }
3149
- ._text_1glho_108 {
3149
+ ._text_wguje_108 {
3150
3150
  position: absolute;
3151
- top: max(var(--space-12), calc(106px - var(--hero-top, 0px)));
3151
+ top: max(0px, calc(var(--space-12) - var(--hero-top, 0px)));
3152
3152
  left: 0;
3153
3153
  right: 0;
3154
3154
  display: flex;
3155
3155
  flex-direction: column;
3156
3156
  align-items: center;
3157
3157
  gap: var(--space-8);
3158
- padding: var(--space-12) var(--space-24) var(--space-24);
3158
+ padding: 0 var(--space-24) var(--space-24);
3159
3159
  text-align: center;
3160
3160
  }
3161
- ._title_1glho_146 {
3161
+ ._title_wguje_155 {
3162
3162
  width: 327px;
3163
3163
  max-width: 100%;
3164
3164
  margin: 0;
@@ -3168,7 +3168,7 @@
3168
3168
  color: #f9fafa;
3169
3169
  text-wrap: balance;
3170
3170
  }
3171
- ._subtitle_1glho_157 {
3171
+ ._subtitle_wguje_166 {
3172
3172
  width: 224px;
3173
3173
  max-width: 100%;
3174
3174
  margin: 0;
@@ -3177,18 +3177,18 @@
3177
3177
  font-weight: var(--font-weight-regular);
3178
3178
  color: #f9fafa;
3179
3179
  }
3180
- ._noImage_1glho_172 {
3180
+ ._noImage_wguje_181 {
3181
3181
  height: auto;
3182
3182
  min-height: 0;
3183
3183
  max-height: none;
3184
3184
  margin-bottom: 0;
3185
3185
  }
3186
- ._noImage_1glho_172 ._text_1glho_108 {
3186
+ ._noImage_wguje_181 ._text_wguje_108 {
3187
3187
  position: static;
3188
3188
  padding-top: var(--space-24);
3189
3189
  }
3190
- ._noImage_1glho_172 ._title_1glho_146,
3191
- ._noImage_1glho_172 ._subtitle_1glho_157 {
3190
+ ._noImage_wguje_181 ._title_wguje_155,
3191
+ ._noImage_wguje_181 ._subtitle_wguje_166 {
3192
3192
  color: var(--color-text-default);
3193
3193
  }
3194
3194
  ._text_1saw4_6 {
package/dist/styles.css CHANGED
@@ -3107,7 +3107,7 @@
3107
3107
  ._oos_1hv16_66 {
3108
3108
  color: var(--color-state-surface-critical-default);
3109
3109
  }
3110
- ._hero_1glho_10 {
3110
+ ._hero_wguje_10 {
3111
3111
  --hero-height: clamp(480px, calc(100svh - var(--hero-top, 0px)), 812px);
3112
3112
  position: relative;
3113
3113
  height: var(--hero-height);
@@ -3115,15 +3115,15 @@
3115
3115
  background: var(--color-surface-default);
3116
3116
  margin-bottom: calc(var(--hero-height) * -237 / 812);
3117
3117
  }
3118
- ._image_1glho_42 {
3118
+ ._image_wguje_42 {
3119
3119
  position: absolute;
3120
3120
  inset: 0;
3121
3121
  }
3122
- ._image_1glho_42 img {
3122
+ ._image_wguje_42 img {
3123
3123
  object-fit: cover;
3124
3124
  object-position: top center;
3125
3125
  }
3126
- ._scrim_1glho_70 {
3126
+ ._scrim_wguje_70 {
3127
3127
  position: absolute;
3128
3128
  inset: 0;
3129
3129
  background:
@@ -3133,7 +3133,7 @@
3133
3133
  rgba(0, 0, 0, 0.1) 45%,
3134
3134
  rgba(0, 0, 0, 0) 70%);
3135
3135
  }
3136
- ._fade_1glho_94 {
3136
+ ._fade_wguje_94 {
3137
3137
  position: absolute;
3138
3138
  right: 0;
3139
3139
  bottom: 0;
@@ -3146,19 +3146,19 @@
3146
3146
  rgba(8, 14, 18, 0.65) 55%,
3147
3147
  var(--color-surface-default) 100%);
3148
3148
  }
3149
- ._text_1glho_108 {
3149
+ ._text_wguje_108 {
3150
3150
  position: absolute;
3151
- top: max(var(--space-12), calc(106px - var(--hero-top, 0px)));
3151
+ top: max(0px, calc(var(--space-12) - var(--hero-top, 0px)));
3152
3152
  left: 0;
3153
3153
  right: 0;
3154
3154
  display: flex;
3155
3155
  flex-direction: column;
3156
3156
  align-items: center;
3157
3157
  gap: var(--space-8);
3158
- padding: var(--space-12) var(--space-24) var(--space-24);
3158
+ padding: 0 var(--space-24) var(--space-24);
3159
3159
  text-align: center;
3160
3160
  }
3161
- ._title_1glho_146 {
3161
+ ._title_wguje_155 {
3162
3162
  width: 327px;
3163
3163
  max-width: 100%;
3164
3164
  margin: 0;
@@ -3168,7 +3168,7 @@
3168
3168
  color: #f9fafa;
3169
3169
  text-wrap: balance;
3170
3170
  }
3171
- ._subtitle_1glho_157 {
3171
+ ._subtitle_wguje_166 {
3172
3172
  width: 224px;
3173
3173
  max-width: 100%;
3174
3174
  margin: 0;
@@ -3177,18 +3177,18 @@
3177
3177
  font-weight: var(--font-weight-regular);
3178
3178
  color: #f9fafa;
3179
3179
  }
3180
- ._noImage_1glho_172 {
3180
+ ._noImage_wguje_181 {
3181
3181
  height: auto;
3182
3182
  min-height: 0;
3183
3183
  max-height: none;
3184
3184
  margin-bottom: 0;
3185
3185
  }
3186
- ._noImage_1glho_172 ._text_1glho_108 {
3186
+ ._noImage_wguje_181 ._text_wguje_108 {
3187
3187
  position: static;
3188
3188
  padding-top: var(--space-24);
3189
3189
  }
3190
- ._noImage_1glho_172 ._title_1glho_146,
3191
- ._noImage_1glho_172 ._subtitle_1glho_157 {
3190
+ ._noImage_wguje_181 ._title_wguje_155,
3191
+ ._noImage_wguje_181 ._subtitle_wguje_166 {
3192
3192
  color: var(--color-text-default);
3193
3193
  }
3194
3194
  ._text_1saw4_6 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nok-integration/storefront-react",
3
- "version": "0.19.16",
3
+ "version": "0.19.17",
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",