@nok-integration/storefront-react 0.24.0 → 0.25.0

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
@@ -63,7 +63,7 @@ export declare interface BadgeProps {
63
63
 
64
64
  export declare type BadgeTone = 'neutral' | 'success' | 'critical' | 'promo';
65
65
 
66
- export declare function BottomSheet({ open, onClose, title, children, footer }: BottomSheetProps): JSX.Element | null;
66
+ export declare function BottomSheet({ open, onClose, title, children, footer, wide }: BottomSheetProps): JSX.Element | null;
67
67
 
68
68
  export declare interface BottomSheetProps {
69
69
  open: boolean;
@@ -72,6 +72,7 @@ export declare interface BottomSheetProps {
72
72
  children: ReactNode;
73
73
  /** Optional sticky footer (e.g. a StickyCtaBar). */
74
74
  footer?: ReactNode;
75
+ wide?: 'sheet' | 'panel';
75
76
  }
76
77
 
77
78
  /**
@@ -419,13 +420,19 @@ declare const CategoryHero: z.ZodObject<{
419
420
  title: z.ZodString;
420
421
  subtitle: z.ZodOptional<z.ZodString>;
421
422
  image: z.ZodOptional<z.ZodString>;
423
+ /**
424
+ * The hero at desktop width (1200px and up). Absent = `image` is used at every width.
425
+ */
426
+ desktop_image: z.ZodOptional<z.ZodString>;
422
427
  }, "strip", z.ZodTypeAny, {
423
428
  title: string;
424
429
  image?: string | undefined;
430
+ desktop_image?: string | undefined;
425
431
  subtitle?: string | undefined;
426
432
  }, {
427
433
  title: string;
428
434
  image?: string | undefined;
435
+ desktop_image?: string | undefined;
429
436
  subtitle?: string | undefined;
430
437
  }>;
431
438
 
@@ -437,13 +444,19 @@ declare const CategoryPage: z.ZodObject<{
437
444
  title: z.ZodString;
438
445
  subtitle: z.ZodOptional<z.ZodString>;
439
446
  image: z.ZodOptional<z.ZodString>;
447
+ /**
448
+ * The hero at desktop width (1200px and up). Absent = `image` is used at every width.
449
+ */
450
+ desktop_image: z.ZodOptional<z.ZodString>;
440
451
  }, "strip", z.ZodTypeAny, {
441
452
  title: string;
442
453
  image?: string | undefined;
454
+ desktop_image?: string | undefined;
443
455
  subtitle?: string | undefined;
444
456
  }, {
445
457
  title: string;
446
458
  image?: string | undefined;
459
+ desktop_image?: string | undefined;
447
460
  subtitle?: string | undefined;
448
461
  }>;
449
462
  blocks: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
@@ -1299,14 +1312,22 @@ declare const CategoryPage: z.ZodObject<{
1299
1312
  kind: z.ZodLiteral<"lifestyle_image">;
1300
1313
  images: z.ZodArray<z.ZodString, "many">;
1301
1314
  videos: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>, "many">>;
1315
+ /**
1316
+ * Parallel to `images`: the still drawn for slide `i` at desktop width (1200px and up),
1317
+ * in place of `images[i]` and of `videos[i]`. `null`, or an index past the end, keeps
1318
+ * that slide as it is at every width. Like `videos`, it never adds a slide.
1319
+ */
1320
+ desktop_images: z.ZodOptional<z.ZodArray<z.ZodNullable<z.ZodString>, "many">>;
1302
1321
  }, "strip", z.ZodTypeAny, {
1303
1322
  kind: "lifestyle_image";
1304
1323
  images: string[];
1305
1324
  videos?: (string | null)[] | undefined;
1325
+ desktop_images?: (string | null)[] | undefined;
1306
1326
  }, {
1307
1327
  kind: "lifestyle_image";
1308
1328
  images: string[];
1309
1329
  videos?: (string | null)[] | undefined;
1330
+ desktop_images?: (string | null)[] | undefined;
1310
1331
  }>, z.ZodObject<{
1311
1332
  kind: z.ZodLiteral<"grid">;
1312
1333
  title: z.ZodOptional<z.ZodString>;
@@ -1676,6 +1697,7 @@ declare const CategoryPage: z.ZodObject<{
1676
1697
  hero: {
1677
1698
  title: string;
1678
1699
  image?: string | undefined;
1700
+ desktop_image?: string | undefined;
1679
1701
  subtitle?: string | undefined;
1680
1702
  };
1681
1703
  blocks: ({
@@ -1776,6 +1798,7 @@ declare const CategoryPage: z.ZodObject<{
1776
1798
  kind: "lifestyle_image";
1777
1799
  images: string[];
1778
1800
  videos?: (string | null)[] | undefined;
1801
+ desktop_images?: (string | null)[] | undefined;
1779
1802
  } | {
1780
1803
  kind: "grid";
1781
1804
  products: {
@@ -1893,6 +1916,7 @@ declare const CategoryPage: z.ZodObject<{
1893
1916
  hero: {
1894
1917
  title: string;
1895
1918
  image?: string | undefined;
1919
+ desktop_image?: string | undefined;
1896
1920
  subtitle?: string | undefined;
1897
1921
  };
1898
1922
  blocks: ({
@@ -1993,6 +2017,7 @@ declare const CategoryPage: z.ZodObject<{
1993
2017
  kind: "lifestyle_image";
1994
2018
  images: string[];
1995
2019
  videos?: (string | null)[] | undefined;
2020
+ desktop_images?: (string | null)[] | undefined;
1996
2021
  } | {
1997
2022
  kind: "grid";
1998
2023
  products: {
@@ -2371,6 +2396,7 @@ declare function createClient(options: ClientOptions): {
2371
2396
  title: string;
2372
2397
  image?: string | undefined;
2373
2398
  subtitle?: string | undefined;
2399
+ desktop_image?: string | undefined;
2374
2400
  };
2375
2401
  blocks: ({
2376
2402
  title: string;
@@ -2470,6 +2496,7 @@ declare function createClient(options: ClientOptions): {
2470
2496
  kind: "lifestyle_image";
2471
2497
  images: string[];
2472
2498
  videos?: (string | null)[] | undefined;
2499
+ desktop_images?: (string | null)[] | undefined;
2473
2500
  } | {
2474
2501
  kind: "grid";
2475
2502
  products: {
@@ -2593,6 +2620,7 @@ declare function createClient(options: ClientOptions): {
2593
2620
  key: string;
2594
2621
  cta: string;
2595
2622
  image?: string | undefined;
2623
+ desktop_image?: string | undefined;
2596
2624
  target?: string | undefined;
2597
2625
  video?: string | undefined;
2598
2626
  focal_y?: number | undefined;
@@ -2949,7 +2977,7 @@ declare function createClient(options: ClientOptions): {
2949
2977
  */
2950
2978
  stockAlerts: {
2951
2979
  /** "Remind me when available" — idempotent per SKU for the session's principal. */
2952
- create: (body: StockAlertRequest) => Promise<{
2980
+ create: (body: StockAlertRequest, query?: CartMarketQuery) => Promise<{
2953
2981
  sku: string;
2954
2982
  created_at: string;
2955
2983
  notified_at?: string | undefined;
@@ -3761,7 +3789,7 @@ export declare function isUnauthorized(err: unknown): boolean;
3761
3789
  * down the page has no business fetching a megabyte before it is anywhere near the screen,
3762
3790
  * and `ShopVideo` starts its own download when the slide comes into view.
3763
3791
  */
3764
- export declare function LifestyleImage({ images, videos }: LifestyleImageProps): JSX.Element | null;
3792
+ export declare function LifestyleImage({ images, videos, desktopImages }: LifestyleImageProps): JSX.Element | null;
3765
3793
 
3766
3794
  declare interface LifestyleImageProps {
3767
3795
  images: string[];
@@ -3771,6 +3799,8 @@ declare interface LifestyleImageProps {
3771
3799
  * contracts 2.51.0.
3772
3800
  */
3773
3801
  videos?: (string | null)[];
3802
+ /** Parallel to `images`: the still drawn for that slide from 1200px wide, `null` for none. */
3803
+ desktopImages?: (string | null)[];
3774
3804
  }
3775
3805
 
3776
3806
  /** Editorial text band between PCP sections. */
@@ -4466,7 +4496,7 @@ declare type OrderDetail = z.infer<typeof OrderDetail>;
4466
4496
  export declare function OrderListView(props: OrderListViewProps): JSX.Element;
4467
4497
 
4468
4498
  export declare interface OrderListViewProps {
4469
- /** Opens one order. Without it the rows render as static cards rather than dead links. */
4499
+ /** Opens one order on a route of your own. Without it the order opens in place of the list. */
4470
4500
  onOpenOrder?: (orderRef: string) => void;
4471
4501
  /**
4472
4502
  * Open one return on a route of your own.
@@ -4478,7 +4508,7 @@ export declare interface OrderListViewProps {
4478
4508
  * landing them on the order is a different answer to the question they asked.
4479
4509
  */
4480
4510
  onOpenReturn?: (returnRef: string) => void;
4481
- /** The empty state's call to action — the design's "Continue shopping" button. */
4511
+ /** The empty state's "Continue shopping". Without it the button navigates to the shop home. */
4482
4512
  onStartShopping?: () => void;
4483
4513
  /** Overrides the provider's locale for dates. */
4484
4514
  locale?: string;
@@ -4518,7 +4548,7 @@ export declare interface OrderStatusBadgeProps {
4518
4548
  * The pricing breakdown. DISPLAY ONLY — every value is server-authoritative; the UI
4519
4549
  * never sums or computes anything here.
4520
4550
  */
4521
- export declare function OrderSummary({ pricing, deferred, hidden, rows, discount, }: OrderSummaryProps): JSX.Element;
4551
+ export declare function OrderSummary({ pricing, deferred, hidden, rows, discount, collapsible, }: OrderSummaryProps): JSX.Element;
4522
4552
 
4523
4553
  export declare interface OrderSummaryProps {
4524
4554
  pricing: Pricing;
@@ -4569,6 +4599,7 @@ export declare interface OrderSummaryProps {
4569
4599
  * the grand total is DAZN's, never the sum of the rows above it.
4570
4600
  */
4571
4601
  discount?: Money;
4602
+ collapsible?: boolean;
4572
4603
  }
4573
4604
 
4574
4605
  export declare function OrderTimeline({ progress, estimatedDelivery, locale: localeProp, }: OrderTimelineProps): JSX.Element;
@@ -5734,14 +5765,6 @@ declare interface Review {
5734
5765
  author: string;
5735
5766
  }
5736
5767
 
5737
- /**
5738
- * Tester-quote carousel — swipeable cards with dot pagination.
5739
- *
5740
- * These are tester quotes, not customer reviews: no stars and no ratings, and the `author`
5741
- * under each quote is what says whose words they are — a team and a city, never a person.
5742
- * A quote must therefore never arrive without one. The block draws no disclaimer line, in
5743
- * line with the frame.
5744
- */
5745
5768
  export declare function ReviewCarousel({ quotes }: ReviewCarouselProps): JSX.Element;
5746
5769
 
5747
5770
  declare interface ReviewCarouselProps {
@@ -5760,6 +5783,18 @@ export declare interface SaleBadgeProps {
5760
5783
  pct: number;
5761
5784
  }
5762
5785
 
5786
+ export declare interface ScreenCrumb {
5787
+ label: string;
5788
+ to?: ShopRoute;
5789
+ }
5790
+
5791
+ export declare interface ScreenNav {
5792
+ crumbs: ScreenCrumb[];
5793
+ tone: ScreenNavTone;
5794
+ }
5795
+
5796
+ export declare type ScreenNavTone = 'media' | 'light';
5797
+
5763
5798
  /**
5764
5799
  * What a whole screen looks like while its data is in flight.
5765
5800
  *
@@ -6064,28 +6099,15 @@ export declare interface ShopHeaderProps {
6064
6099
  className?: string;
6065
6100
  }
6066
6101
 
6067
- /**
6068
- * The replacement for `next/image` inside the SDK.
6069
- *
6070
- * `next/image` cannot come with us: it needs the Next runtime and its optimiser
6071
- * endpoint, and the SDK runs in DAZN's bundle where neither exists. So this is a plain
6072
- * `<img>` with the platform features that actually carry the weight — native lazy
6073
- * loading, `decoding="async"`, `sizes`, and `fetchpriority` for the LCP image.
6074
- *
6075
- * **What is genuinely lost is on-the-fly resizing and format negotiation** (AVIF/WebP
6076
- * per browser). That is not something a component can polyfill — it is a serving
6077
- * concern. Whoever serves the catalogue media should emit `srcset`-ready derivatives
6078
- * and modern formats; until then, this renders the source as given rather than
6079
- * pretending to optimise it.
6080
- *
6081
- * The one rewrite it does perform is rebasing **root-relative** paths onto the host's
6082
- * `assetBaseUrl` — see {@link resolveAssetUrl}. Without it the SDK's own design imagery
6083
- * is requested from the host's origin, which does not serve it.
6084
- */
6085
- export declare function ShopImage({ src, alt, fill, width, height, sizes, className, style, priority, }: ShopImageProps): JSX.Element;
6102
+ export declare function ShopImage({ src, desktopSrc, alt, fill, width, height, sizes, className, style, priority, }: ShopImageProps): JSX.Element;
6086
6103
 
6087
6104
  export declare interface ShopImageProps {
6088
6105
  src: string;
6106
+ /**
6107
+ * Drawn instead of `src` from 1200px wide. The browser picks one before fetching, so only
6108
+ * the one shown is downloaded and nothing moves when it is chosen.
6109
+ */
6110
+ desktopSrc?: string;
6089
6111
  alt: string;
6090
6112
  /**
6091
6113
  * Fill the positioned ancestor, as `next/image`'s `fill` does. The parent must be
@@ -6146,7 +6168,7 @@ export declare interface ShopLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnc
6146
6168
  * that has one passes `onHelp`. An inert row is marked `aria-disabled`, so a screen reader
6147
6169
  * is told what a sighted fan discovers by tapping.
6148
6170
  */
6149
- export declare function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, label, }: ShopMenuSheetProps): JSX.Element | null;
6171
+ export declare function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, label, placement, }: ShopMenuSheetProps): JSX.Element | null;
6150
6172
 
6151
6173
  export declare interface ShopMenuSheetProps {
6152
6174
  open: boolean;
@@ -6160,6 +6182,16 @@ export declare interface ShopMenuSheetProps {
6160
6182
  closeLabel?: string;
6161
6183
  /** Accessible name for the dialog itself; it has no visible title in the design. */
6162
6184
  label?: string;
6185
+ placement?: 'sheet' | 'dropdown';
6186
+ }
6187
+
6188
+ export declare function ShopNav({ onManageOrders, onHelp, menuLabel, className }: ShopNavProps): JSX.Element | null;
6189
+
6190
+ export declare interface ShopNavProps {
6191
+ onManageOrders?: () => void;
6192
+ onHelp?: () => void;
6193
+ menuLabel?: string;
6194
+ className?: string;
6163
6195
  }
6164
6196
 
6165
6197
  /**
@@ -6167,7 +6199,7 @@ export declare interface ShopMenuSheetProps {
6167
6199
  * implementation detail — see the versioning policy in the component SDK specification.
6168
6200
  */
6169
6201
  /** A storefront-relative identifier. NOT a URL expected to resolve on the host. */
6170
- export declare type ShopRoute = '/' | `/category/${string}` | `/product/${string}` | '/cart' | `/vip/${string}`;
6202
+ export declare type ShopRoute = '/' | `/category/${string}` | `/product/${string}` | '/cart' | '/orders' | `/vip/${string}`;
6171
6203
 
6172
6204
  /**
6173
6205
  * Request: the shopping session id and the one-time code, exactly as they arrive on the
@@ -6762,6 +6794,10 @@ export declare interface UseProductResult {
6762
6794
  error: ReturnType<typeof codeOf> | undefined;
6763
6795
  }
6764
6796
 
6797
+ export declare function useScreenNav(): ScreenNav | undefined;
6798
+
6799
+ export declare function useSetScreenNav(crumbs: ScreenCrumb[] | undefined, tone: ScreenNavTone): void;
6800
+
6765
6801
  /** The typed, schema-validating commerce client. Requires a provider. */
6766
6802
  export declare function useShopApi(): DaznClient;
6767
6803