@nok-integration/storefront-react 0.19.22 → 0.19.23

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
@@ -4336,10 +4336,19 @@ export declare interface OrderTrackingViewProps {
4336
4336
  */
4337
4337
  onCancelled?: (order: OrderDetail) => void;
4338
4338
  /**
4339
- * The cancelled screen's "Reorder". Omit it and no button renders.
4339
+ * Take over the cancelled screen's "Reorder".
4340
4340
  *
4341
- * The host's, because it means "put these items back in a cart and go somewhere", and
4342
- * only they know where that is. We raise `reorder_requested` regardless.
4341
+ * Optional. Pass it and you own the trip. Omit it and the button puts the order's lines
4342
+ * back in the cart itself and navigates to `/cart`, so the frame's one useful next step
4343
+ * is there for a fan whether the host routes it or not.
4344
+ *
4345
+ * **It used to gate whether the button was drawn at all**, which is why a cancelled
4346
+ * order on a host that passes no handler offered nothing at all — the control existed
4347
+ * everywhere we looked and nowhere a fan was. Same rule as `onStartReturn` and the
4348
+ * return flow's "Done": a host handler customises a control, it never decides whether
4349
+ * the design has one.
4350
+ *
4351
+ * `reorder_requested` is raised either way.
4343
4352
  */
4344
4353
  onReorder?: () => void;
4345
4354
  /**
@@ -5586,7 +5595,13 @@ export declare interface ShopHeaderProps {
5586
5595
  * navigation already provides a back affordance should not get a second one.
5587
5596
  */
5588
5597
  onBack?: () => void;
5589
- /** Overflow menu. Omitted by default: a control that opens nothing is worse than none. */
5598
+ /**
5599
+ * Overflow menu. Omitted by default: a control that opens nothing is worse than none.
5600
+ *
5601
+ * A handler passed here is still not drawn on a screen that has declared it carries no
5602
+ * trailing controls — the cart. A host with one bar over every route passes this once,
5603
+ * and cannot know which screen it is over.
5604
+ */
5590
5605
  onMenu?: () => void;
5591
5606
  /**
5592
5607
  * The screen name, drawn between the back control and the icons (Figma `mobile/header`
@@ -5596,7 +5611,13 @@ export declare interface ShopHeaderProps {
5596
5611
  * frames leave it empty, so a bar with nothing in the middle is a state the design has.
5597
5612
  */
5598
5613
  title?: string;
5599
- /** The cart icon and its live count. */
5614
+ /**
5615
+ * The cart icon and its live count. On unless the screen below says otherwise.
5616
+ *
5617
+ * Left unset, this follows the screen: the cart's own bar carries nothing on the right,
5618
+ * and it declares that itself because a host mounting this bar as a sibling cannot see
5619
+ * which view is under it. Set it explicitly and you get exactly what you asked for.
5620
+ */
5600
5621
  showCart?: boolean;
5601
5622
  /**
5602
5623
  * Lay the bar over the content instead of above it, with no background of its own.
package/dist/index.mjs CHANGED
@@ -5159,26 +5159,31 @@ function withAuthorization(init, token) {
5159
5159
  }
5160
5160
  const ScreenTitleContext = createContext({
5161
5161
  title: void 0,
5162
+ trailing: "default",
5162
5163
  claim: () => () => {
5163
5164
  }
5164
5165
  });
5165
5166
  const SuppressedContext = createContext(false);
5166
5167
  function ScreenTitleProvider({ children }) {
5167
5168
  const [title2, setTitle] = useState(void 0);
5169
+ const [trailing, setTrailing] = useState("default");
5168
5170
  const held = useRef(void 0);
5169
- const claim = useCallback((next) => {
5171
+ const claim = useCallback((next, nextTrailing) => {
5170
5172
  held.current = next;
5171
5173
  setTitle(next);
5174
+ setTrailing(nextTrailing);
5172
5175
  return () => {
5173
5176
  if (held.current !== next) return;
5174
5177
  held.current = void 0;
5175
5178
  setTitle(void 0);
5179
+ setTrailing("default");
5176
5180
  };
5177
5181
  }, []);
5178
5182
  const value2 = useMemo(() => ({
5179
5183
  title: title2,
5184
+ trailing,
5180
5185
  claim
5181
- }), [title2, claim]);
5186
+ }), [title2, trailing, claim]);
5182
5187
  return jsx(ScreenTitleContext.Provider, {
5183
5188
  value: value2,
5184
5189
  children
@@ -5187,13 +5192,16 @@ function ScreenTitleProvider({ children }) {
5187
5192
  function useScreenTitle() {
5188
5193
  return useContext(ScreenTitleContext).title;
5189
5194
  }
5190
- function useSetScreenTitle(title2) {
5195
+ function useScreenTrailing() {
5196
+ return useContext(ScreenTitleContext).trailing;
5197
+ }
5198
+ function useSetScreenTitle(title2, trailing = "default") {
5191
5199
  const { claim } = useContext(ScreenTitleContext);
5192
5200
  const suppressed = useContext(SuppressedContext);
5193
5201
  useEffect(() => {
5194
5202
  if (suppressed || title2 === void 0) return;
5195
- return claim(title2);
5196
- }, [claim, title2, suppressed]);
5203
+ return claim(title2, trailing);
5204
+ }, [claim, title2, trailing, suppressed]);
5197
5205
  }
5198
5206
  function NoScreenTitle({ children }) {
5199
5207
  return jsx(SuppressedContext.Provider, {
@@ -5473,13 +5481,16 @@ const styles$O = {
5473
5481
  fill
5474
5482
  };
5475
5483
  const SETTLE_MS$1 = 150;
5476
- function offsetFromViewportTop(el) {
5477
- let top2 = el.getBoundingClientRect().top;
5484
+ function scrolledOffOrigin(el) {
5478
5485
  for (let node = el.parentElement; node; node = node.parentElement) {
5479
- top2 += node.scrollTop;
5486
+ if (node.scrollTop > 0) return true;
5480
5487
  if (getComputedStyle(node).position === "fixed") break;
5481
5488
  }
5482
- const offset = Math.max(0, Math.round(top2));
5489
+ return false;
5490
+ }
5491
+ function offsetFromViewportTop(el) {
5492
+ if (scrolledOffOrigin(el)) return null;
5493
+ const offset = Math.max(0, Math.round(el.getBoundingClientRect().top));
5483
5494
  return offset >= window.innerHeight ? 0 : offset;
5484
5495
  }
5485
5496
  function useTopOffset(ref, property, enabled = true) {
@@ -5488,7 +5499,8 @@ function useTopOffset(ref, property, enabled = true) {
5488
5499
  if (!el || !enabled) return;
5489
5500
  let timer2;
5490
5501
  const measure = () => {
5491
- el.style.setProperty(property, `${offsetFromViewportTop(el)}px`);
5502
+ const offset = offsetFromViewportTop(el);
5503
+ if (offset !== null) el.style.setProperty(property, `${offset}px`);
5492
5504
  };
5493
5505
  const settle = () => {
5494
5506
  if (timer2) clearTimeout(timer2);
@@ -7564,7 +7576,10 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7564
7576
  const [cancelOpen, setCancelOpen] = useState(false);
7565
7577
  const [cancelling, setCancelling] = useState(false);
7566
7578
  const [cancelError, setCancelError] = useState(null);
7579
+ const [reordering, setReordering] = useState(false);
7567
7580
  const emit = useShopEvent();
7581
+ const navigate = useNavigate();
7582
+ const toast2 = useToast();
7568
7583
  const load = useCallback(async () => {
7569
7584
  setState("loading");
7570
7585
  try {
@@ -7625,6 +7640,37 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7625
7640
  setCancelling(false);
7626
7641
  }
7627
7642
  }
7643
+ async function reorder(current2) {
7644
+ emit({
7645
+ type: "reorder_requested",
7646
+ orderRef: current2.order_ref
7647
+ });
7648
+ if (onReorder) {
7649
+ onReorder();
7650
+ return;
7651
+ }
7652
+ setReordering(true);
7653
+ try {
7654
+ let added = 0;
7655
+ for (const line2 of current2.items) {
7656
+ try {
7657
+ await api.cart.addItem({
7658
+ sku: line2.sku,
7659
+ qty: line2.qty
7660
+ });
7661
+ added += 1;
7662
+ } catch {
7663
+ }
7664
+ }
7665
+ if (added === 0) {
7666
+ toast2.show("These items are no longer available", "critical");
7667
+ return;
7668
+ }
7669
+ navigate?.("/cart");
7670
+ } finally {
7671
+ setReordering(false);
7672
+ }
7673
+ }
7628
7674
  if (order.status === "cancelled") {
7629
7675
  return jsxs("div", {
7630
7676
  className: styles$y.page,
@@ -7637,16 +7683,11 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7637
7683
  className: styles$y.cancelledMeta,
7638
7684
  children: `Order #${shortRef$1(order.order_ref)} · Placed ${placedOn(order.placed_at, locale)}`
7639
7685
  })]
7640
- }), onReorder && jsx(Button, {
7686
+ }), jsx(Button, {
7641
7687
  variant: "primary",
7642
7688
  fullWidth: true,
7643
- onClick: () => {
7644
- emit({
7645
- type: "reorder_requested",
7646
- orderRef: order.order_ref
7647
- });
7648
- onReorder();
7649
- },
7689
+ loading: reordering,
7690
+ onClick: () => void reorder(order),
7650
7691
  children: "Reorder"
7651
7692
  }), jsx(OrderLines, {
7652
7693
  order
@@ -9012,7 +9053,7 @@ const styles$j = {
9012
9053
  };
9013
9054
  function CartView(props = {}) {
9014
9055
  const t = useT();
9015
- useSetScreenTitle(t("Cart"));
9056
+ useSetScreenTitle(t("Cart"), "none");
9016
9057
  return jsx(ShopSurface, {
9017
9058
  tone: "light",
9018
9059
  fill: true,
@@ -10721,24 +10762,24 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
10721
10762
  }
10722
10763
  return unavailable;
10723
10764
  }
10724
- const showcase = "_showcase_144lm_44";
10725
- const panel = "_panel_144lm_48";
10726
- const image = "_image_144lm_76";
10727
- const hero = "_hero_144lm_116";
10728
- const heroContent = "_heroContent_144lm_174";
10729
- const heroText = "_heroText_144lm_197";
10730
- const logo = "_logo_144lm_206";
10731
- const heroTitle = "_heroTitle_144lm_226";
10732
- const heroSub = "_heroSub_144lm_250";
10733
- const swipe = "_swipe_144lm_269";
10734
- const swipeLabel = "_swipeLabel_144lm_276";
10735
- const chevron$1 = "_chevron_144lm_282";
10736
- const overlay$1 = "_overlay_144lm_11";
10737
- const copy = "_copy_144lm_315";
10738
- const title$2 = "_title_144lm_320";
10739
- const subtitle$1 = "_subtitle_144lm_327";
10740
- const cta = "_cta_144lm_333";
10741
- const mosaic = "_mosaic_144lm_377";
10765
+ const showcase = "_showcase_1qnt2_44";
10766
+ const panel = "_panel_1qnt2_48";
10767
+ const image = "_image_1qnt2_76";
10768
+ const hero = "_hero_1qnt2_116";
10769
+ const heroContent = "_heroContent_1qnt2_197";
10770
+ const heroText = "_heroText_1qnt2_221";
10771
+ const logo = "_logo_1qnt2_230";
10772
+ const heroTitle = "_heroTitle_1qnt2_250";
10773
+ const heroSub = "_heroSub_1qnt2_274";
10774
+ const swipe = "_swipe_1qnt2_293";
10775
+ const swipeLabel = "_swipeLabel_1qnt2_300";
10776
+ const chevron$1 = "_chevron_1qnt2_306";
10777
+ const overlay$1 = "_overlay_1qnt2_11";
10778
+ const copy = "_copy_1qnt2_341";
10779
+ const title$2 = "_title_1qnt2_346";
10780
+ const subtitle$1 = "_subtitle_1qnt2_353";
10781
+ const cta = "_cta_1qnt2_359";
10782
+ const mosaic = "_mosaic_1qnt2_403";
10742
10783
  const styles$2 = {
10743
10784
  showcase,
10744
10785
  panel,
@@ -11188,12 +11229,15 @@ function CheckoutBar({ title: title2, onClose, closeLabel, className }) {
11188
11229
  })]
11189
11230
  });
11190
11231
  }
11191
- function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: floating2 = false, scrolled: scrolled2, backLabel, menuLabel, className }) {
11232
+ function ShopBar({ onBack, onMenu, title: title2, showCart, floating: floating2 = false, scrolled: scrolled2, backLabel, menuLabel, className }) {
11192
11233
  const t = useT();
11193
11234
  const cartCount = useCartCount();
11194
11235
  const screenTitle = useScreenTitle();
11195
11236
  const shownTitle = title2 ?? screenTitle;
11196
- const hasTrailing = showCart || Boolean(onMenu);
11237
+ const bare = useScreenTrailing() === "none";
11238
+ const cartOn = showCart ?? !bare;
11239
+ const menu = bare ? void 0 : onMenu;
11240
+ const hasTrailing = cartOn || Boolean(menu);
11197
11241
  const atTop = useScrolledUnder(floating2 && scrolled2 === void 0);
11198
11242
  const isScrolled = scrolled2 ?? atTop;
11199
11243
  const cartLabel = cartCount === null ? t("Cart") : cartCount === 0 ? t("Cart, empty") : t("Cart, {0} item{1}", cartCount, cartCount === 1 ? "" : "s");
@@ -11214,7 +11258,7 @@ function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: flo
11214
11258
  children: shownTitle
11215
11259
  }) : null, jsxs("div", {
11216
11260
  className: styles$1.right,
11217
- children: [showCart ? jsxs(CartTrigger, {
11261
+ children: [cartOn ? jsxs(CartTrigger, {
11218
11262
  className: styles$1.iconBtn,
11219
11263
  "aria-label": cartLabel,
11220
11264
  children: [jsx(CartIcon, {}), cartCount !== null && cartCount > 0 ? jsx("span", {
@@ -11222,11 +11266,11 @@ function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: flo
11222
11266
  "aria-hidden": "true",
11223
11267
  children: cartCount > 99 ? "99+" : cartCount
11224
11268
  }) : null]
11225
- }) : null, onMenu ? jsx("button", {
11269
+ }) : null, menu ? jsx("button", {
11226
11270
  type: "button",
11227
11271
  className: `${styles$1.iconBtn} ${styles$1.menuBtn}`,
11228
11272
  "aria-label": menuLabel ?? t("More options"),
11229
- onClick: onMenu,
11273
+ onClick: menu,
11230
11274
  children: jsx(MenuIcon, {})
11231
11275
  }) : null]
11232
11276
  })]
@@ -11517,4 +11561,4 @@ export {
11517
11561
  useToast,
11518
11562
  variantLabel
11519
11563
  };
11520
-
11564
+ //# sourceMappingURL=index.mjs.map
@@ -5159,26 +5159,31 @@ function withAuthorization(init, token) {
5159
5159
  }
5160
5160
  const ScreenTitleContext = createContext({
5161
5161
  title: void 0,
5162
+ trailing: "default",
5162
5163
  claim: () => () => {
5163
5164
  }
5164
5165
  });
5165
5166
  const SuppressedContext = createContext(false);
5166
5167
  function ScreenTitleProvider({ children }) {
5167
5168
  const [title2, setTitle] = useState(void 0);
5169
+ const [trailing, setTrailing] = useState("default");
5168
5170
  const held = useRef(void 0);
5169
- const claim = useCallback((next) => {
5171
+ const claim = useCallback((next, nextTrailing) => {
5170
5172
  held.current = next;
5171
5173
  setTitle(next);
5174
+ setTrailing(nextTrailing);
5172
5175
  return () => {
5173
5176
  if (held.current !== next) return;
5174
5177
  held.current = void 0;
5175
5178
  setTitle(void 0);
5179
+ setTrailing("default");
5176
5180
  };
5177
5181
  }, []);
5178
5182
  const value2 = useMemo(() => ({
5179
5183
  title: title2,
5184
+ trailing,
5180
5185
  claim
5181
- }), [title2, claim]);
5186
+ }), [title2, trailing, claim]);
5182
5187
  return jsx(ScreenTitleContext.Provider, {
5183
5188
  value: value2,
5184
5189
  children
@@ -5187,13 +5192,16 @@ function ScreenTitleProvider({ children }) {
5187
5192
  function useScreenTitle() {
5188
5193
  return useContext(ScreenTitleContext).title;
5189
5194
  }
5190
- function useSetScreenTitle(title2) {
5195
+ function useScreenTrailing() {
5196
+ return useContext(ScreenTitleContext).trailing;
5197
+ }
5198
+ function useSetScreenTitle(title2, trailing = "default") {
5191
5199
  const { claim } = useContext(ScreenTitleContext);
5192
5200
  const suppressed = useContext(SuppressedContext);
5193
5201
  useEffect(() => {
5194
5202
  if (suppressed || title2 === void 0) return;
5195
- return claim(title2);
5196
- }, [claim, title2, suppressed]);
5203
+ return claim(title2, trailing);
5204
+ }, [claim, title2, trailing, suppressed]);
5197
5205
  }
5198
5206
  function NoScreenTitle({ children }) {
5199
5207
  return jsx(SuppressedContext.Provider, {
@@ -5473,13 +5481,16 @@ const styles$O = {
5473
5481
  fill
5474
5482
  };
5475
5483
  const SETTLE_MS$1 = 150;
5476
- function offsetFromViewportTop(el) {
5477
- let top2 = el.getBoundingClientRect().top;
5484
+ function scrolledOffOrigin(el) {
5478
5485
  for (let node = el.parentElement; node; node = node.parentElement) {
5479
- top2 += node.scrollTop;
5486
+ if (node.scrollTop > 0) return true;
5480
5487
  if (getComputedStyle(node).position === "fixed") break;
5481
5488
  }
5482
- const offset = Math.max(0, Math.round(top2));
5489
+ return false;
5490
+ }
5491
+ function offsetFromViewportTop(el) {
5492
+ if (scrolledOffOrigin(el)) return null;
5493
+ const offset = Math.max(0, Math.round(el.getBoundingClientRect().top));
5483
5494
  return offset >= window.innerHeight ? 0 : offset;
5484
5495
  }
5485
5496
  function useTopOffset(ref, property, enabled = true) {
@@ -5488,7 +5499,8 @@ function useTopOffset(ref, property, enabled = true) {
5488
5499
  if (!el || !enabled) return;
5489
5500
  let timer2;
5490
5501
  const measure = () => {
5491
- el.style.setProperty(property, `${offsetFromViewportTop(el)}px`);
5502
+ const offset = offsetFromViewportTop(el);
5503
+ if (offset !== null) el.style.setProperty(property, `${offset}px`);
5492
5504
  };
5493
5505
  const settle = () => {
5494
5506
  if (timer2) clearTimeout(timer2);
@@ -7564,7 +7576,10 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7564
7576
  const [cancelOpen, setCancelOpen] = useState(false);
7565
7577
  const [cancelling, setCancelling] = useState(false);
7566
7578
  const [cancelError, setCancelError] = useState(null);
7579
+ const [reordering, setReordering] = useState(false);
7567
7580
  const emit = useShopEvent();
7581
+ const navigate = useNavigate();
7582
+ const toast2 = useToast();
7568
7583
  const load = useCallback(async () => {
7569
7584
  setState("loading");
7570
7585
  try {
@@ -7625,6 +7640,37 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7625
7640
  setCancelling(false);
7626
7641
  }
7627
7642
  }
7643
+ async function reorder(current2) {
7644
+ emit({
7645
+ type: "reorder_requested",
7646
+ orderRef: current2.order_ref
7647
+ });
7648
+ if (onReorder) {
7649
+ onReorder();
7650
+ return;
7651
+ }
7652
+ setReordering(true);
7653
+ try {
7654
+ let added = 0;
7655
+ for (const line2 of current2.items) {
7656
+ try {
7657
+ await api.cart.addItem({
7658
+ sku: line2.sku,
7659
+ qty: line2.qty
7660
+ });
7661
+ added += 1;
7662
+ } catch {
7663
+ }
7664
+ }
7665
+ if (added === 0) {
7666
+ toast2.show("These items are no longer available", "critical");
7667
+ return;
7668
+ }
7669
+ navigate?.("/cart");
7670
+ } finally {
7671
+ setReordering(false);
7672
+ }
7673
+ }
7628
7674
  if (order.status === "cancelled") {
7629
7675
  return jsxs("div", {
7630
7676
  className: styles$y.page,
@@ -7637,16 +7683,11 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onC
7637
7683
  className: styles$y.cancelledMeta,
7638
7684
  children: `Order #${shortRef$1(order.order_ref)} · Placed ${placedOn(order.placed_at, locale)}`
7639
7685
  })]
7640
- }), onReorder && jsx(Button, {
7686
+ }), jsx(Button, {
7641
7687
  variant: "primary",
7642
7688
  fullWidth: true,
7643
- onClick: () => {
7644
- emit({
7645
- type: "reorder_requested",
7646
- orderRef: order.order_ref
7647
- });
7648
- onReorder();
7649
- },
7689
+ loading: reordering,
7690
+ onClick: () => void reorder(order),
7650
7691
  children: "Reorder"
7651
7692
  }), jsx(OrderLines, {
7652
7693
  order
@@ -9012,7 +9053,7 @@ const styles$j = {
9012
9053
  };
9013
9054
  function CartView(props = {}) {
9014
9055
  const t = useT();
9015
- useSetScreenTitle(t("Cart"));
9056
+ useSetScreenTitle(t("Cart"), "none");
9016
9057
  return jsx(ShopSurface, {
9017
9058
  tone: "light",
9018
9059
  fill: true,
@@ -10721,24 +10762,24 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
10721
10762
  }
10722
10763
  return unavailable;
10723
10764
  }
10724
- const showcase = "_showcase_144lm_44";
10725
- const panel = "_panel_144lm_48";
10726
- const image = "_image_144lm_76";
10727
- const hero = "_hero_144lm_116";
10728
- const heroContent = "_heroContent_144lm_174";
10729
- const heroText = "_heroText_144lm_197";
10730
- const logo = "_logo_144lm_206";
10731
- const heroTitle = "_heroTitle_144lm_226";
10732
- const heroSub = "_heroSub_144lm_250";
10733
- const swipe = "_swipe_144lm_269";
10734
- const swipeLabel = "_swipeLabel_144lm_276";
10735
- const chevron$1 = "_chevron_144lm_282";
10736
- const overlay$1 = "_overlay_144lm_11";
10737
- const copy = "_copy_144lm_315";
10738
- const title$2 = "_title_144lm_320";
10739
- const subtitle$1 = "_subtitle_144lm_327";
10740
- const cta = "_cta_144lm_333";
10741
- const mosaic = "_mosaic_144lm_377";
10765
+ const showcase = "_showcase_1qnt2_44";
10766
+ const panel = "_panel_1qnt2_48";
10767
+ const image = "_image_1qnt2_76";
10768
+ const hero = "_hero_1qnt2_116";
10769
+ const heroContent = "_heroContent_1qnt2_197";
10770
+ const heroText = "_heroText_1qnt2_221";
10771
+ const logo = "_logo_1qnt2_230";
10772
+ const heroTitle = "_heroTitle_1qnt2_250";
10773
+ const heroSub = "_heroSub_1qnt2_274";
10774
+ const swipe = "_swipe_1qnt2_293";
10775
+ const swipeLabel = "_swipeLabel_1qnt2_300";
10776
+ const chevron$1 = "_chevron_1qnt2_306";
10777
+ const overlay$1 = "_overlay_1qnt2_11";
10778
+ const copy = "_copy_1qnt2_341";
10779
+ const title$2 = "_title_1qnt2_346";
10780
+ const subtitle$1 = "_subtitle_1qnt2_353";
10781
+ const cta = "_cta_1qnt2_359";
10782
+ const mosaic = "_mosaic_1qnt2_403";
10742
10783
  const styles$2 = {
10743
10784
  showcase,
10744
10785
  panel,
@@ -11188,12 +11229,15 @@ function CheckoutBar({ title: title2, onClose, closeLabel, className }) {
11188
11229
  })]
11189
11230
  });
11190
11231
  }
11191
- function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: floating2 = false, scrolled: scrolled2, backLabel, menuLabel, className }) {
11232
+ function ShopBar({ onBack, onMenu, title: title2, showCart, floating: floating2 = false, scrolled: scrolled2, backLabel, menuLabel, className }) {
11192
11233
  const t = useT();
11193
11234
  const cartCount = useCartCount();
11194
11235
  const screenTitle = useScreenTitle();
11195
11236
  const shownTitle = title2 ?? screenTitle;
11196
- const hasTrailing = showCart || Boolean(onMenu);
11237
+ const bare = useScreenTrailing() === "none";
11238
+ const cartOn = showCart ?? !bare;
11239
+ const menu = bare ? void 0 : onMenu;
11240
+ const hasTrailing = cartOn || Boolean(menu);
11197
11241
  const atTop = useScrolledUnder(floating2 && scrolled2 === void 0);
11198
11242
  const isScrolled = scrolled2 ?? atTop;
11199
11243
  const cartLabel = cartCount === null ? t("Cart") : cartCount === 0 ? t("Cart, empty") : t("Cart, {0} item{1}", cartCount, cartCount === 1 ? "" : "s");
@@ -11214,7 +11258,7 @@ function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: flo
11214
11258
  children: shownTitle
11215
11259
  }) : null, jsxs("div", {
11216
11260
  className: styles$1.right,
11217
- children: [showCart ? jsxs(CartTrigger, {
11261
+ children: [cartOn ? jsxs(CartTrigger, {
11218
11262
  className: styles$1.iconBtn,
11219
11263
  "aria-label": cartLabel,
11220
11264
  children: [jsx(CartIcon, {}), cartCount !== null && cartCount > 0 ? jsx("span", {
@@ -11222,11 +11266,11 @@ function ShopBar({ onBack, onMenu, title: title2, showCart = true, floating: flo
11222
11266
  "aria-hidden": "true",
11223
11267
  children: cartCount > 99 ? "99+" : cartCount
11224
11268
  }) : null]
11225
- }) : null, onMenu ? jsx("button", {
11269
+ }) : null, menu ? jsx("button", {
11226
11270
  type: "button",
11227
11271
  className: `${styles$1.iconBtn} ${styles$1.menuBtn}`,
11228
11272
  "aria-label": menuLabel ?? t("More options"),
11229
- onClick: onMenu,
11273
+ onClick: menu,
11230
11274
  children: jsx(MenuIcon, {})
11231
11275
  }) : null]
11232
11276
  })]
@@ -11517,4 +11561,4 @@ export {
11517
11561
  useToast,
11518
11562
  variantLabel
11519
11563
  };
11520
-
11564
+ //# sourceMappingURL=storefront.mjs.map
@@ -3436,10 +3436,10 @@
3436
3436
  column-gap: var(--space-12);
3437
3437
  row-gap: var(--space-24);
3438
3438
  }
3439
- ._showcase_144lm_44 {
3439
+ ._showcase_1qnt2_44 {
3440
3440
  background: #080e12;
3441
3441
  }
3442
- ._panel_144lm_48 {
3442
+ ._panel_1qnt2_48 {
3443
3443
  position: relative;
3444
3444
  height: calc(100lvh - var(--showcase-top, 0px));
3445
3445
  scroll-snap-align: start;
@@ -3447,11 +3447,11 @@
3447
3447
  overflow: hidden;
3448
3448
  background: #080e12;
3449
3449
  }
3450
- ._image_144lm_76 {
3450
+ ._image_1qnt2_76 {
3451
3451
  object-fit: cover;
3452
3452
  object-position: 50% var(--slide-focal-y, 50%);
3453
3453
  }
3454
- ._hero_144lm_116::after {
3454
+ ._hero_1qnt2_116::after {
3455
3455
  content: "";
3456
3456
  position: absolute;
3457
3457
  inset: 0;
@@ -3466,9 +3466,10 @@
3466
3466
  rgba(8, 14, 18, 0) 520px);
3467
3467
  pointer-events: none;
3468
3468
  }
3469
- ._hero_144lm_116 ._heroContent_144lm_174 {
3469
+ ._hero_1qnt2_116 ._heroContent_1qnt2_197 {
3470
3470
  position: absolute;
3471
3471
  bottom: 32px;
3472
+ bottom: calc(32px + 100lvh - 100dvh);
3472
3473
  left: 0;
3473
3474
  right: 0;
3474
3475
  z-index: 1;
@@ -3477,7 +3478,7 @@
3477
3478
  gap: 24px;
3478
3479
  align-items: stretch;
3479
3480
  }
3480
- ._heroText_144lm_197 {
3481
+ ._heroText_1qnt2_221 {
3481
3482
  display: flex;
3482
3483
  flex-direction: column;
3483
3484
  gap: 8px;
@@ -3485,11 +3486,11 @@
3485
3486
  padding: 0 24px;
3486
3487
  text-align: center;
3487
3488
  }
3488
- ._heroText_144lm_197 ._logo_144lm_206 {
3489
+ ._heroText_1qnt2_221 ._logo_1qnt2_230 {
3489
3490
  width: 48px;
3490
3491
  height: 48px;
3491
3492
  }
3492
- ._heroTitle_144lm_226 {
3493
+ ._heroTitle_1qnt2_250 {
3493
3494
  width: 100%;
3494
3495
  margin: 0;
3495
3496
  font-family:
@@ -3504,33 +3505,33 @@
3504
3505
  letter-spacing: -1.12px;
3505
3506
  color: #f9fafa;
3506
3507
  }
3507
- ._heroSub_144lm_250 {
3508
+ ._heroSub_1qnt2_274 {
3508
3509
  margin: 0;
3509
3510
  font-size: 16px;
3510
3511
  line-height: 1.55;
3511
3512
  color: #f9fafa;
3512
3513
  max-width: 327px;
3513
3514
  }
3514
- ._swipe_144lm_269 {
3515
+ ._swipe_1qnt2_293 {
3515
3516
  display: flex;
3516
3517
  flex-direction: column;
3517
3518
  align-items: center;
3518
3519
  gap: 6px;
3519
3520
  padding: 8px 0;
3520
3521
  }
3521
- ._swipeLabel_144lm_276 {
3522
+ ._swipeLabel_1qnt2_300 {
3522
3523
  margin: 0;
3523
3524
  font-size: 14px;
3524
3525
  line-height: 1;
3525
3526
  color: rgba(255, 255, 255, 0.54);
3526
3527
  }
3527
- ._chevron_144lm_282 {
3528
+ ._chevron_1qnt2_306 {
3528
3529
  width: 24px;
3529
3530
  height: 24px;
3530
3531
  color: rgba(255, 255, 255, 0.54);
3531
- animation: _bob_144lm_1 1.8s ease-in-out infinite;
3532
+ animation: _bob_1qnt2_1 1.8s ease-in-out infinite;
3532
3533
  }
3533
- @keyframes _bob_144lm_1 {
3534
+ @keyframes _bob_1qnt2_1 {
3534
3535
  0%, 100% {
3535
3536
  transform: translateY(0);
3536
3537
  }
@@ -3538,7 +3539,7 @@
3538
3539
  transform: translateY(4px);
3539
3540
  }
3540
3541
  }
3541
- ._overlay_144lm_11 {
3542
+ ._overlay_1qnt2_11 {
3542
3543
  position: absolute;
3543
3544
  inset: 0;
3544
3545
  z-index: 1;
@@ -3553,26 +3554,27 @@
3553
3554
  gap: 16px;
3554
3555
  align-items: flex-start;
3555
3556
  padding: 0 24px 24px;
3557
+ padding-bottom: calc(24px + 100lvh - 100dvh);
3556
3558
  }
3557
- ._copy_144lm_315 {
3559
+ ._copy_1qnt2_341 {
3558
3560
  display: flex;
3559
3561
  flex-direction: column;
3560
3562
  gap: 8px;
3561
3563
  }
3562
- ._title_144lm_320 {
3564
+ ._title_1qnt2_346 {
3563
3565
  margin: 0;
3564
3566
  font-size: 32px;
3565
3567
  line-height: 1.2;
3566
3568
  font-weight: 700;
3567
3569
  color: #f9fafa;
3568
3570
  }
3569
- ._subtitle_144lm_327 {
3571
+ ._subtitle_1qnt2_353 {
3570
3572
  margin: 0;
3571
3573
  font-size: 16px;
3572
3574
  line-height: 1.55;
3573
3575
  color: #f9fafa;
3574
3576
  }
3575
- ._cta_144lm_333 {
3577
+ ._cta_1qnt2_359 {
3576
3578
  display: inline-flex;
3577
3579
  align-items: center;
3578
3580
  justify-content: center;
@@ -3586,19 +3588,19 @@
3586
3588
  font-weight: 700;
3587
3589
  text-decoration: none;
3588
3590
  }
3589
- ._cta_144lm_333::after {
3591
+ ._cta_1qnt2_359::after {
3590
3592
  content: "";
3591
3593
  position: absolute;
3592
3594
  inset: 0;
3593
3595
  }
3594
- ._cta_144lm_333:active {
3596
+ ._cta_1qnt2_359:active {
3595
3597
  background: rgba(249, 250, 250, 0.12);
3596
3598
  }
3597
- ._cta_144lm_333:focus-visible {
3599
+ ._cta_1qnt2_359:focus-visible {
3598
3600
  outline: none;
3599
3601
  box-shadow: var(--focus-ring);
3600
3602
  }
3601
- ._mosaic_144lm_377 {
3603
+ ._mosaic_1qnt2_403 {
3602
3604
  background: #080e12;
3603
3605
  }
3604
3606
  ._header_8o3d7_25 {
package/dist/styles.css CHANGED
@@ -3436,10 +3436,10 @@
3436
3436
  column-gap: var(--space-12);
3437
3437
  row-gap: var(--space-24);
3438
3438
  }
3439
- ._showcase_144lm_44 {
3439
+ ._showcase_1qnt2_44 {
3440
3440
  background: #080e12;
3441
3441
  }
3442
- ._panel_144lm_48 {
3442
+ ._panel_1qnt2_48 {
3443
3443
  position: relative;
3444
3444
  height: calc(100lvh - var(--showcase-top, 0px));
3445
3445
  scroll-snap-align: start;
@@ -3447,11 +3447,11 @@
3447
3447
  overflow: hidden;
3448
3448
  background: #080e12;
3449
3449
  }
3450
- ._image_144lm_76 {
3450
+ ._image_1qnt2_76 {
3451
3451
  object-fit: cover;
3452
3452
  object-position: 50% var(--slide-focal-y, 50%);
3453
3453
  }
3454
- ._hero_144lm_116::after {
3454
+ ._hero_1qnt2_116::after {
3455
3455
  content: "";
3456
3456
  position: absolute;
3457
3457
  inset: 0;
@@ -3466,9 +3466,10 @@
3466
3466
  rgba(8, 14, 18, 0) 520px);
3467
3467
  pointer-events: none;
3468
3468
  }
3469
- ._hero_144lm_116 ._heroContent_144lm_174 {
3469
+ ._hero_1qnt2_116 ._heroContent_1qnt2_197 {
3470
3470
  position: absolute;
3471
3471
  bottom: 32px;
3472
+ bottom: calc(32px + 100lvh - 100dvh);
3472
3473
  left: 0;
3473
3474
  right: 0;
3474
3475
  z-index: 1;
@@ -3477,7 +3478,7 @@
3477
3478
  gap: 24px;
3478
3479
  align-items: stretch;
3479
3480
  }
3480
- ._heroText_144lm_197 {
3481
+ ._heroText_1qnt2_221 {
3481
3482
  display: flex;
3482
3483
  flex-direction: column;
3483
3484
  gap: 8px;
@@ -3485,11 +3486,11 @@
3485
3486
  padding: 0 24px;
3486
3487
  text-align: center;
3487
3488
  }
3488
- ._heroText_144lm_197 ._logo_144lm_206 {
3489
+ ._heroText_1qnt2_221 ._logo_1qnt2_230 {
3489
3490
  width: 48px;
3490
3491
  height: 48px;
3491
3492
  }
3492
- ._heroTitle_144lm_226 {
3493
+ ._heroTitle_1qnt2_250 {
3493
3494
  width: 100%;
3494
3495
  margin: 0;
3495
3496
  font-family:
@@ -3504,33 +3505,33 @@
3504
3505
  letter-spacing: -1.12px;
3505
3506
  color: #f9fafa;
3506
3507
  }
3507
- ._heroSub_144lm_250 {
3508
+ ._heroSub_1qnt2_274 {
3508
3509
  margin: 0;
3509
3510
  font-size: 16px;
3510
3511
  line-height: 1.55;
3511
3512
  color: #f9fafa;
3512
3513
  max-width: 327px;
3513
3514
  }
3514
- ._swipe_144lm_269 {
3515
+ ._swipe_1qnt2_293 {
3515
3516
  display: flex;
3516
3517
  flex-direction: column;
3517
3518
  align-items: center;
3518
3519
  gap: 6px;
3519
3520
  padding: 8px 0;
3520
3521
  }
3521
- ._swipeLabel_144lm_276 {
3522
+ ._swipeLabel_1qnt2_300 {
3522
3523
  margin: 0;
3523
3524
  font-size: 14px;
3524
3525
  line-height: 1;
3525
3526
  color: rgba(255, 255, 255, 0.54);
3526
3527
  }
3527
- ._chevron_144lm_282 {
3528
+ ._chevron_1qnt2_306 {
3528
3529
  width: 24px;
3529
3530
  height: 24px;
3530
3531
  color: rgba(255, 255, 255, 0.54);
3531
- animation: _bob_144lm_1 1.8s ease-in-out infinite;
3532
+ animation: _bob_1qnt2_1 1.8s ease-in-out infinite;
3532
3533
  }
3533
- @keyframes _bob_144lm_1 {
3534
+ @keyframes _bob_1qnt2_1 {
3534
3535
  0%, 100% {
3535
3536
  transform: translateY(0);
3536
3537
  }
@@ -3538,7 +3539,7 @@
3538
3539
  transform: translateY(4px);
3539
3540
  }
3540
3541
  }
3541
- ._overlay_144lm_11 {
3542
+ ._overlay_1qnt2_11 {
3542
3543
  position: absolute;
3543
3544
  inset: 0;
3544
3545
  z-index: 1;
@@ -3553,26 +3554,27 @@
3553
3554
  gap: 16px;
3554
3555
  align-items: flex-start;
3555
3556
  padding: 0 24px 24px;
3557
+ padding-bottom: calc(24px + 100lvh - 100dvh);
3556
3558
  }
3557
- ._copy_144lm_315 {
3559
+ ._copy_1qnt2_341 {
3558
3560
  display: flex;
3559
3561
  flex-direction: column;
3560
3562
  gap: 8px;
3561
3563
  }
3562
- ._title_144lm_320 {
3564
+ ._title_1qnt2_346 {
3563
3565
  margin: 0;
3564
3566
  font-size: 32px;
3565
3567
  line-height: 1.2;
3566
3568
  font-weight: 700;
3567
3569
  color: #f9fafa;
3568
3570
  }
3569
- ._subtitle_144lm_327 {
3571
+ ._subtitle_1qnt2_353 {
3570
3572
  margin: 0;
3571
3573
  font-size: 16px;
3572
3574
  line-height: 1.55;
3573
3575
  color: #f9fafa;
3574
3576
  }
3575
- ._cta_144lm_333 {
3577
+ ._cta_1qnt2_359 {
3576
3578
  display: inline-flex;
3577
3579
  align-items: center;
3578
3580
  justify-content: center;
@@ -3586,19 +3588,19 @@
3586
3588
  font-weight: 700;
3587
3589
  text-decoration: none;
3588
3590
  }
3589
- ._cta_144lm_333::after {
3591
+ ._cta_1qnt2_359::after {
3590
3592
  content: "";
3591
3593
  position: absolute;
3592
3594
  inset: 0;
3593
3595
  }
3594
- ._cta_144lm_333:active {
3596
+ ._cta_1qnt2_359:active {
3595
3597
  background: rgba(249, 250, 250, 0.12);
3596
3598
  }
3597
- ._cta_144lm_333:focus-visible {
3599
+ ._cta_1qnt2_359:focus-visible {
3598
3600
  outline: none;
3599
3601
  box-shadow: var(--focus-ring);
3600
3602
  }
3601
- ._mosaic_144lm_377 {
3603
+ ._mosaic_1qnt2_403 {
3602
3604
  background: #080e12;
3603
3605
  }
3604
3606
  ._header_8o3d7_25 {
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@nok-integration/storefront-react",
3
- "version": "0.19.22",
3
+ "version": "0.19.23",
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
+ },
6
10
  "type": "module",
7
11
  "main": "./dist/index.mjs",
8
- "module": "./dist/index.mjs",
9
12
  "types": "./dist/index.d.ts",
10
13
  "exports": {
11
14
  ".": {
@@ -20,18 +23,34 @@
20
23
  "dist",
21
24
  "!dist/**/*.map"
22
25
  ],
23
- "sideEffects": [
24
- "*.css"
25
- ],
26
+ "scripts": {
27
+ "build": "pnpm build:package && pnpm build:standalone",
28
+ "build:package": "vite build",
29
+ "build:standalone": "BUILD_TARGET=standalone vite build",
30
+ "typecheck": "tsc --noEmit",
31
+ "build:partner": "PARTNER_DROP=1 pnpm build && pnpm pack"
32
+ },
26
33
  "peerDependencies": {
27
34
  "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
28
35
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
29
36
  },
37
+ "devDependencies": {
38
+ "@microsoft/api-extractor": "^7.58.12",
39
+ "@raqmix/contracts": "^2.0.0",
40
+ "@types/react": "^19.1.0",
41
+ "@types/react-dom": "^19.1.0",
42
+ "@vitejs/plugin-react": "^4.3.4",
43
+ "esbuild": "^0.28.1",
44
+ "terser": "^5.50.0",
45
+ "typescript": "^5.7.3",
46
+ "vite": "^7.0.0",
47
+ "vite-plugin-dts": "^5.0.3"
48
+ },
49
+ "module": "./dist/index.mjs",
50
+ "sideEffects": [
51
+ "*.css"
52
+ ],
30
53
  "dependencies": {
31
54
  "zod": "^3.24.1"
32
- },
33
- "publishConfig": {
34
- "access": "public",
35
- "registry": "https://registry.npmjs.org/"
36
55
  }
37
56
  }