@nok-integration/storefront-react 0.16.3 → 0.16.5
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 +14 -3
- package/dist/index.mjs +9 -29
- package/dist/standalone/storefront.mjs +9 -29
- package/package.json +9 -26
package/dist/index.d.ts
CHANGED
|
@@ -3386,9 +3386,20 @@ export declare type ShopEvent = {
|
|
|
3386
3386
|
* if the design is ours, and a mismatch if only half of it is.
|
|
3387
3387
|
*
|
|
3388
3388
|
* The cart count is real, never fabricated: `useCartCount` returns `null` until it knows,
|
|
3389
|
-
* and the badge stays hidden until then
|
|
3390
|
-
*
|
|
3391
|
-
*
|
|
3389
|
+
* and the badge stays hidden until then — a "0" that appears while the cart is still
|
|
3390
|
+
* loading and then jumps to "3" is a guess wearing a number.
|
|
3391
|
+
*
|
|
3392
|
+
* **The badge is also hidden at zero**, which is a deliberate departure from the frame:
|
|
3393
|
+
* `.cart.icon` draws an explicit empty state carrying "0". DAZN asked for it removed on
|
|
3394
|
+
* 17 Aug 2026 and they are right — a filled pill is an attention mark, and one that says
|
|
3395
|
+
* there is nothing to look at spends the fan's attention to tell them so. The empty state
|
|
3396
|
+
* is the icon on its own.
|
|
3397
|
+
*
|
|
3398
|
+
* `useCartCount` had said as much since it was written ("a badge must render nothing for
|
|
3399
|
+
* `null` and nothing for `0`"); the component followed the frame instead, and the two
|
|
3400
|
+
* disagreed in the codebase for as long as the badge existed. The count still
|
|
3401
|
+
* distinguishes the two states, because the accessible name needs to: unknown reads
|
|
3402
|
+
* "Cart", empty reads "Cart, empty".
|
|
3392
3403
|
*
|
|
3393
3404
|
* Mount it inside `DaznShopProvider`, and inside `CartSheet` if `showCart` is on, since
|
|
3394
3405
|
* the trigger opens that sheet.
|
package/dist/index.mjs
CHANGED
|
@@ -5951,8 +5951,8 @@ function PriceBlock({
|
|
|
5951
5951
|
return /* @__PURE__ */ jsxs("div", { className: [styles$y.root, styles$y[size], styles$y[align], styles$y[variant]].join(" "), children: [
|
|
5952
5952
|
/* @__PURE__ */ jsx("span", { className: styles$y.price, children: format(price2) }),
|
|
5953
5953
|
hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$y.compareAt, children: [
|
|
5954
|
-
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children:
|
|
5955
|
-
format(compareAt2)
|
|
5954
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
|
|
5955
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
|
|
5956
5956
|
] }),
|
|
5957
5957
|
hasCompare && variant === "badge" && pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
|
|
5958
5958
|
] });
|
|
@@ -6289,15 +6289,9 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
|
|
|
6289
6289
|
/* @__PURE__ */ jsxs("div", { className: styles$v.title, children: [
|
|
6290
6290
|
/* @__PURE__ */ jsx("h1", { className: styles$v.headline, children: order.headline }),
|
|
6291
6291
|
/* @__PURE__ */ jsxs("p", { className: styles$v.subtitle, children: [
|
|
6292
|
-
/* @__PURE__ */
|
|
6293
|
-
"Order #",
|
|
6294
|
-
shortRef$1(order.order_ref)
|
|
6295
|
-
] }),
|
|
6292
|
+
/* @__PURE__ */ jsx("span", { children: `Order #${shortRef$1(order.order_ref)}` }),
|
|
6296
6293
|
/* @__PURE__ */ jsx("span", { className: styles$v.dot, "aria-hidden": "true" }),
|
|
6297
|
-
/* @__PURE__ */
|
|
6298
|
-
"Placed ",
|
|
6299
|
-
formatPlaced$1(order.placed_at, locale)
|
|
6300
|
-
] })
|
|
6294
|
+
/* @__PURE__ */ jsx("span", { children: `Placed ${formatPlaced$1(order.placed_at, locale)}` })
|
|
6301
6295
|
] })
|
|
6302
6296
|
] }),
|
|
6303
6297
|
/* @__PURE__ */ jsxs("div", { className: styles$v.widget, children: [
|
|
@@ -6311,11 +6305,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
|
|
|
6311
6305
|
rel: "noopener noreferrer",
|
|
6312
6306
|
children: [
|
|
6313
6307
|
"Track order",
|
|
6314
|
-
/* @__PURE__ */
|
|
6315
|
-
" (opens ",
|
|
6316
|
-
order.tracking.carrier,
|
|
6317
|
-
" in a new tab)"
|
|
6318
|
-
] })
|
|
6308
|
+
/* @__PURE__ */ jsx("span", { className: styles$v.srOnly, children: ` (opens ${order.tracking.carrier} in a new tab)` })
|
|
6319
6309
|
]
|
|
6320
6310
|
}
|
|
6321
6311
|
)
|
|
@@ -6529,10 +6519,7 @@ function OrderCard({
|
|
|
6529
6519
|
const body2 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6530
6520
|
/* @__PURE__ */ jsxs("div", { className: styles$t.head, children: [
|
|
6531
6521
|
/* @__PURE__ */ jsxs("div", { className: styles$t.heading, children: [
|
|
6532
|
-
/* @__PURE__ */
|
|
6533
|
-
"Order #",
|
|
6534
|
-
shortRef(order.order_ref)
|
|
6535
|
-
] }),
|
|
6522
|
+
/* @__PURE__ */ jsx("span", { className: styles$t.title, children: `Order #${shortRef(order.order_ref)}` }),
|
|
6536
6523
|
/* @__PURE__ */ jsx("span", { className: styles$t.date, children: formatPlaced(order.placed_at, locale) })
|
|
6537
6524
|
] }),
|
|
6538
6525
|
/* @__PURE__ */ jsx(OrderStatusBadge, { status: order.status })
|
|
@@ -6570,11 +6557,7 @@ function Thumbnails({ order }) {
|
|
|
6570
6557
|
"+",
|
|
6571
6558
|
overflow
|
|
6572
6559
|
] }),
|
|
6573
|
-
/* @__PURE__ */
|
|
6574
|
-
"and ",
|
|
6575
|
-
overflow,
|
|
6576
|
-
" more items"
|
|
6577
|
-
] })
|
|
6560
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `and ${overflow} more items` })
|
|
6578
6561
|
] })
|
|
6579
6562
|
] }, `${src}-${i}`);
|
|
6580
6563
|
}) });
|
|
@@ -7713,10 +7696,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
|
|
|
7713
7696
|
c.image ? /* @__PURE__ */ jsx(ShopImage, { src: c.image, alt: "", fill: true, sizes: "79px", className: styles$f.image }) : /* @__PURE__ */ jsx("span", { className: styles$f.placeholder, "aria-hidden": "true" }),
|
|
7714
7697
|
soldOut && /* @__PURE__ */ jsx("span", { className: styles$f.scrim, "aria-hidden": "true", children: "Out of stock" })
|
|
7715
7698
|
] }),
|
|
7716
|
-
lowStock && /* @__PURE__ */
|
|
7717
|
-
c.remaining,
|
|
7718
|
-
" left"
|
|
7719
|
-
] })
|
|
7699
|
+
lowStock && /* @__PURE__ */ jsx("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: `${c.remaining} left` })
|
|
7720
7700
|
]
|
|
7721
7701
|
},
|
|
7722
7702
|
c.value
|
|
@@ -8717,7 +8697,7 @@ function ShopHeader({
|
|
|
8717
8697
|
/* @__PURE__ */ jsxs("div", { className: styles$1.right, children: [
|
|
8718
8698
|
showCart ? /* @__PURE__ */ jsxs(CartTrigger, { className: styles$1.iconBtn, "aria-label": cartLabel, children: [
|
|
8719
8699
|
/* @__PURE__ */ jsx(CartIcon, {}),
|
|
8720
|
-
cartCount
|
|
8700
|
+
cartCount !== null && cartCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$1.badge, "aria-hidden": "true", children: cartCount > 99 ? "99+" : cartCount }) : null
|
|
8721
8701
|
] }) : null,
|
|
8722
8702
|
onMenu ? /* @__PURE__ */ jsx(
|
|
8723
8703
|
"button",
|
|
@@ -5951,8 +5951,8 @@ function PriceBlock({
|
|
|
5951
5951
|
return /* @__PURE__ */ jsxs("div", { className: [styles$y.root, styles$y[size], styles$y[align], styles$y[variant]].join(" "), children: [
|
|
5952
5952
|
/* @__PURE__ */ jsx("span", { className: styles$y.price, children: format(price2) }),
|
|
5953
5953
|
hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$y.compareAt, children: [
|
|
5954
|
-
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children:
|
|
5955
|
-
format(compareAt2)
|
|
5954
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
|
|
5955
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
|
|
5956
5956
|
] }),
|
|
5957
5957
|
hasCompare && variant === "badge" && pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
|
|
5958
5958
|
] });
|
|
@@ -6289,15 +6289,9 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
|
|
|
6289
6289
|
/* @__PURE__ */ jsxs("div", { className: styles$v.title, children: [
|
|
6290
6290
|
/* @__PURE__ */ jsx("h1", { className: styles$v.headline, children: order.headline }),
|
|
6291
6291
|
/* @__PURE__ */ jsxs("p", { className: styles$v.subtitle, children: [
|
|
6292
|
-
/* @__PURE__ */
|
|
6293
|
-
"Order #",
|
|
6294
|
-
shortRef$1(order.order_ref)
|
|
6295
|
-
] }),
|
|
6292
|
+
/* @__PURE__ */ jsx("span", { children: `Order #${shortRef$1(order.order_ref)}` }),
|
|
6296
6293
|
/* @__PURE__ */ jsx("span", { className: styles$v.dot, "aria-hidden": "true" }),
|
|
6297
|
-
/* @__PURE__ */
|
|
6298
|
-
"Placed ",
|
|
6299
|
-
formatPlaced$1(order.placed_at, locale)
|
|
6300
|
-
] })
|
|
6294
|
+
/* @__PURE__ */ jsx("span", { children: `Placed ${formatPlaced$1(order.placed_at, locale)}` })
|
|
6301
6295
|
] })
|
|
6302
6296
|
] }),
|
|
6303
6297
|
/* @__PURE__ */ jsxs("div", { className: styles$v.widget, children: [
|
|
@@ -6311,11 +6305,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
|
|
|
6311
6305
|
rel: "noopener noreferrer",
|
|
6312
6306
|
children: [
|
|
6313
6307
|
"Track order",
|
|
6314
|
-
/* @__PURE__ */
|
|
6315
|
-
" (opens ",
|
|
6316
|
-
order.tracking.carrier,
|
|
6317
|
-
" in a new tab)"
|
|
6318
|
-
] })
|
|
6308
|
+
/* @__PURE__ */ jsx("span", { className: styles$v.srOnly, children: ` (opens ${order.tracking.carrier} in a new tab)` })
|
|
6319
6309
|
]
|
|
6320
6310
|
}
|
|
6321
6311
|
)
|
|
@@ -6529,10 +6519,7 @@ function OrderCard({
|
|
|
6529
6519
|
const body2 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6530
6520
|
/* @__PURE__ */ jsxs("div", { className: styles$t.head, children: [
|
|
6531
6521
|
/* @__PURE__ */ jsxs("div", { className: styles$t.heading, children: [
|
|
6532
|
-
/* @__PURE__ */
|
|
6533
|
-
"Order #",
|
|
6534
|
-
shortRef(order.order_ref)
|
|
6535
|
-
] }),
|
|
6522
|
+
/* @__PURE__ */ jsx("span", { className: styles$t.title, children: `Order #${shortRef(order.order_ref)}` }),
|
|
6536
6523
|
/* @__PURE__ */ jsx("span", { className: styles$t.date, children: formatPlaced(order.placed_at, locale) })
|
|
6537
6524
|
] }),
|
|
6538
6525
|
/* @__PURE__ */ jsx(OrderStatusBadge, { status: order.status })
|
|
@@ -6570,11 +6557,7 @@ function Thumbnails({ order }) {
|
|
|
6570
6557
|
"+",
|
|
6571
6558
|
overflow
|
|
6572
6559
|
] }),
|
|
6573
|
-
/* @__PURE__ */
|
|
6574
|
-
"and ",
|
|
6575
|
-
overflow,
|
|
6576
|
-
" more items"
|
|
6577
|
-
] })
|
|
6560
|
+
/* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `and ${overflow} more items` })
|
|
6578
6561
|
] })
|
|
6579
6562
|
] }, `${src}-${i}`);
|
|
6580
6563
|
}) });
|
|
@@ -7713,10 +7696,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
|
|
|
7713
7696
|
c.image ? /* @__PURE__ */ jsx(ShopImage, { src: c.image, alt: "", fill: true, sizes: "79px", className: styles$f.image }) : /* @__PURE__ */ jsx("span", { className: styles$f.placeholder, "aria-hidden": "true" }),
|
|
7714
7697
|
soldOut && /* @__PURE__ */ jsx("span", { className: styles$f.scrim, "aria-hidden": "true", children: "Out of stock" })
|
|
7715
7698
|
] }),
|
|
7716
|
-
lowStock && /* @__PURE__ */
|
|
7717
|
-
c.remaining,
|
|
7718
|
-
" left"
|
|
7719
|
-
] })
|
|
7699
|
+
lowStock && /* @__PURE__ */ jsx("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: `${c.remaining} left` })
|
|
7720
7700
|
]
|
|
7721
7701
|
},
|
|
7722
7702
|
c.value
|
|
@@ -8717,7 +8697,7 @@ function ShopHeader({
|
|
|
8717
8697
|
/* @__PURE__ */ jsxs("div", { className: styles$1.right, children: [
|
|
8718
8698
|
showCart ? /* @__PURE__ */ jsxs(CartTrigger, { className: styles$1.iconBtn, "aria-label": cartLabel, children: [
|
|
8719
8699
|
/* @__PURE__ */ jsx(CartIcon, {}),
|
|
8720
|
-
cartCount
|
|
8700
|
+
cartCount !== null && cartCount > 0 ? /* @__PURE__ */ jsx("span", { className: styles$1.badge, "aria-hidden": "true", children: cartCount > 99 ? "99+" : cartCount }) : null
|
|
8721
8701
|
] }) : null,
|
|
8722
8702
|
onMenu ? /* @__PURE__ */ jsx(
|
|
8723
8703
|
"button",
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nok-integration/storefront-react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
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
|
-
"publishConfig": {
|
|
7
|
-
"access": "public",
|
|
8
|
-
"registry": "https://registry.npmjs.org/"
|
|
9
|
-
},
|
|
10
6
|
"type": "module",
|
|
11
7
|
"main": "./dist/index.mjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
12
9
|
"types": "./dist/index.d.ts",
|
|
13
10
|
"exports": {
|
|
14
11
|
".": {
|
|
@@ -23,32 +20,18 @@
|
|
|
23
20
|
"dist",
|
|
24
21
|
"!dist/**/*.map"
|
|
25
22
|
],
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"build:standalone": "BUILD_TARGET=standalone vite build",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"build:partner": "PARTNER_DROP=1 pnpm build && pnpm pack"
|
|
32
|
-
},
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"*.css"
|
|
25
|
+
],
|
|
33
26
|
"peerDependencies": {
|
|
34
27
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
35
28
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
36
29
|
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@dazn/contracts": "^2.0.0",
|
|
39
|
-
"@microsoft/api-extractor": "^7.58.12",
|
|
40
|
-
"@types/react": "^19.1.0",
|
|
41
|
-
"@types/react-dom": "^19.1.0",
|
|
42
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
43
|
-
"typescript": "^5.7.3",
|
|
44
|
-
"vite": "^7.0.0",
|
|
45
|
-
"vite-plugin-dts": "^5.0.3"
|
|
46
|
-
},
|
|
47
|
-
"module": "./dist/index.mjs",
|
|
48
|
-
"sideEffects": [
|
|
49
|
-
"*.css"
|
|
50
|
-
],
|
|
51
30
|
"dependencies": {
|
|
52
31
|
"zod": "^3.24.1"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
36
|
}
|
|
54
37
|
}
|