@sonic-equipment/ui 166.0.0 → 168.0.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.
Files changed (148) hide show
  1. package/dist/algolia/algolia-sonic-searchclient.d.ts +2 -1
  2. package/dist/algolia/algolia-sonic-searchclient.js +2 -2
  3. package/dist/background-overlay/background-overlay-manager.js +6 -0
  4. package/dist/background-overlay/background-overlay.d.ts +1 -1
  5. package/dist/base.css +59 -1
  6. package/dist/buttons/link/link.d.ts +1 -1
  7. package/dist/buttons/link/link.js +6 -4
  8. package/dist/cart-totals/cart-totals.js +1 -0
  9. package/dist/collapsables/accordion/accordion-item.js +3 -2
  10. package/dist/collapsables/cascading-component/cascading-component-container-context.js +1 -0
  11. package/dist/collapsables/cascading-component/cascading-component-container-provider.js +1 -0
  12. package/dist/collapsables/cascading-component/cascading-component-container.js +1 -0
  13. package/dist/collapsables/cascading-component/cascading-component.js +1 -0
  14. package/dist/collapsables/unmounter/unmounter.js +1 -0
  15. package/dist/config.js +12 -11
  16. package/dist/country-select/country-select.js +1 -0
  17. package/dist/display/price/price.js +1 -0
  18. package/dist/drawer/drawer.d.ts +3 -2
  19. package/dist/drawer/drawer.js +15 -3
  20. package/dist/drawer/drawer.module.css.js +1 -1
  21. package/dist/drawer/use-drawer.js +1 -6
  22. package/dist/exports.d.ts +15 -5
  23. package/dist/footer/connected-footer.d.ts +4 -0
  24. package/dist/footer/connected-footer.js +13 -0
  25. package/dist/footer/footer.d.ts +8 -4
  26. package/dist/footer/footer.js +23 -2
  27. package/dist/footer/footer.model.d.ts +3 -15
  28. package/dist/forms/form/form.js +1 -0
  29. package/dist/forms/text-field/password-reveal-toggle/password-reveal-toggle.js +1 -0
  30. package/dist/global-search/global-search-provider/global-search-provider.d.ts +0 -6
  31. package/dist/global-search/global-search-provider/global-search-provider.js +3 -9
  32. package/dist/global-search/global-search-provider/use-search-disclosure.d.ts +1 -6
  33. package/dist/global-search/global-search-provider/use-search-disclosure.js +5 -9
  34. package/dist/global-search/global-search.d.ts +3 -1
  35. package/dist/global-search/global-search.js +7 -6
  36. package/dist/header/buttons/account/connected-account-button.d.ts +7 -0
  37. package/dist/header/buttons/account/connected-account-button.js +14 -0
  38. package/dist/header/buttons/cart/connected-cart-button.d.ts +7 -0
  39. package/dist/header/buttons/cart/connected-cart-button.js +14 -0
  40. package/dist/header/buttons/favorites/connected-favorites-button.d.ts +7 -0
  41. package/dist/header/buttons/favorites/connected-favorites-button.js +13 -0
  42. package/dist/header/{hamburger-button → buttons/hamburger}/hamburger-button.d.ts +2 -1
  43. package/dist/header/buttons/hamburger/hamburger-button.js +13 -0
  44. package/dist/header/buttons/hamburger/hamburger-button.module.css.js +3 -0
  45. package/dist/header/buttons/search/search-button.d.ts +7 -0
  46. package/dist/header/buttons/search/search-button.js +12 -0
  47. package/dist/header/connected-header.d.ts +4 -0
  48. package/dist/header/connected-header.js +13 -0
  49. package/dist/header/drawers/desktop-navigation-drawer.d.ts +8 -0
  50. package/dist/header/drawers/desktop-navigation-drawer.js +12 -0
  51. package/dist/header/drawers/desktop-navigation-drawer.module.css.js +3 -0
  52. package/dist/header/drawers/mobile-navigation-drawer.d.ts +7 -0
  53. package/dist/header/drawers/mobile-navigation-drawer.js +10 -0
  54. package/dist/header/drawers/mobile-navigation-drawer.module.css.js +3 -0
  55. package/dist/header/drawers/search-drawer.d.ts +5 -0
  56. package/dist/header/drawers/search-drawer.js +9 -0
  57. package/dist/header/header-layout/header-layout.d.ts +2 -1
  58. package/dist/header/header-layout/header-layout.js +3 -2
  59. package/dist/header/header-layout/header-layout.module.css.js +1 -1
  60. package/dist/header/header.d.ts +3 -2
  61. package/dist/header/header.js +64 -5
  62. package/dist/header/header.module.css.js +3 -0
  63. package/dist/header/link-list/navigation-link-list.d.ts +3 -2
  64. package/dist/header/link-list/navigation-link-list.js +3 -3
  65. package/dist/header/link-list/navigation-link-list.module.css.js +1 -1
  66. package/dist/header/sonic-logo/sonic-logo.d.ts +2 -1
  67. package/dist/header/sonic-logo/sonic-logo.js +4 -2
  68. package/dist/index.js +17 -6
  69. package/dist/intl/missing-translation-provider.js +1 -0
  70. package/dist/intl/translation-id.d.ts +1 -1
  71. package/dist/lists/menu-list/menu-list-back-button.js +1 -0
  72. package/dist/lists/menu-list/menu-list-item.d.ts +9 -21
  73. package/dist/lists/menu-list/menu-list-item.js +3 -8
  74. package/dist/lists/menu-list/menu-list.js +1 -0
  75. package/dist/lists/orderline-list/orderline-list.js +2 -2
  76. package/dist/media/zoom-image/zoom-image.js +1 -0
  77. package/dist/navigation/account-icon/account-icon.js +1 -0
  78. package/dist/navigation/cart-icon/cart-icon.js +1 -0
  79. package/dist/navigation/favorite-icon/favorite-icon.js +1 -0
  80. package/dist/navigation/mobile-navigation/mobile-navigation.d.ts +6 -3
  81. package/dist/navigation/mobile-navigation/mobile-navigation.js +8 -3
  82. package/dist/navigation/mobile-navigation/mobile-navigation.module.css.js +3 -0
  83. package/dist/navigation/panel-navigation/panel-navigation.d.ts +4 -16
  84. package/dist/navigation/panel-navigation/panel-navigation.js +5 -5
  85. package/dist/notifications/announcements/announcement-list.d.ts +7 -0
  86. package/dist/notifications/announcements/announcement-list.js +26 -0
  87. package/dist/notifications/announcements/announcement-list.module.css.js +3 -0
  88. package/dist/notifications/announcements/announcement.d.ts +2 -1
  89. package/dist/notifications/announcements/announcement.js +7 -3
  90. package/dist/notifications/announcements/announcement.module.css.js +1 -1
  91. package/dist/notifications/announcements/connected-announcement-list.d.ts +1 -0
  92. package/dist/notifications/announcements/connected-announcement-list.js +22 -0
  93. package/dist/notifications/announcements/use-filter-announcements.d.ts +2 -0
  94. package/dist/notifications/announcements/use-filter-announcements.js +35 -0
  95. package/dist/observers/intersection-observer.js +1 -0
  96. package/dist/pages/account/create-account-page/create-account-page.js +1 -0
  97. package/dist/pages/account/layouts/sign-in-page-layout/sign-in-page-layout.js +1 -0
  98. package/dist/pages/account/sign-in-page/sign-in-page.js +1 -0
  99. package/dist/pages/checkout/cart-page/cart-page.js +2 -1
  100. package/dist/pages/checkout/cart-page/components/empty-cart-page.js +1 -0
  101. package/dist/pages/checkout/components/billing-and-invoice-information.js +1 -0
  102. package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js +1 -0
  103. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -0
  104. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.js +1 -0
  105. package/dist/pages/checkout/payment-page/components/adyen-payment.js +1 -0
  106. package/dist/pages/checkout/payment-page/components/payment.js +1 -0
  107. package/dist/pages/checkout/payment-page/payment-page-content.js +2 -1
  108. package/dist/pages/checkout/payment-page/payment-page.js +1 -0
  109. package/dist/pages/checkout/shipping-page/components/currency-change-dialog.js +1 -0
  110. package/dist/pages/checkout/shipping-page/components/edit-address-form.js +1 -0
  111. package/dist/pages/checkout/shipping-page/components/readonly-address.js +1 -0
  112. package/dist/pages/checkout/shipping-page/components/sonic-address.js +8 -2
  113. package/dist/pages/checkout/shipping-page/shipping-page-content.js +2 -1
  114. package/dist/pages/checkout/shipping-page/shipping-page.js +1 -0
  115. package/dist/pages/components/page-meta-data/page-meta-data.js +4 -0
  116. package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.js +1 -0
  117. package/dist/shared/api/bff/hooks/use-fetch-navigation-links.d.ts +2 -0
  118. package/dist/shared/api/bff/hooks/use-fetch-navigation-links.js +15 -0
  119. package/dist/shared/api/bff/model/bff.model.d.ts +30 -0
  120. package/dist/shared/api/bff/services/bff-service.d.ts +7 -1
  121. package/dist/shared/api/bff/services/bff-service.js +8 -1
  122. package/dist/shared/feature-flags/use-feature-flags.d.ts +1 -0
  123. package/dist/shared/feature-flags/use-feature-flags.js +1 -0
  124. package/dist/shared/ga/data-layer.js +4 -3
  125. package/dist/shared/hooks/use-mutation-observer.d.ts +3 -0
  126. package/dist/shared/hooks/use-mutation-observer.js +27 -0
  127. package/dist/shared/hooks/use-resize-observer.js +7 -1
  128. package/dist/shared/routing/route-button.d.ts +1 -1
  129. package/dist/shared/routing/route-icon-button.d.ts +1 -1
  130. package/dist/shared/routing/route-link.d.ts +1 -1
  131. package/dist/shared/routing/with-routing.d.ts +2 -2
  132. package/dist/shared/routing/with-routing.js +5 -4
  133. package/dist/styles.css +840 -622
  134. package/dist/toast/toast-provider.js +1 -0
  135. package/dist/tooltip/tooltip.js +1 -0
  136. package/dist/typography/heading/heading.js +1 -0
  137. package/package.json +1 -1
  138. package/dist/header/cart-icon/connected-cart-icon.d.ts +0 -3
  139. package/dist/header/cart-icon/connected-cart-icon.js +0 -14
  140. package/dist/header/hamburger-button/hamburger-button.js +0 -14
  141. package/dist/header/hamburger-button/hamburger-button.module.css.js +0 -3
  142. package/dist/notifications/announcements/announcement-provider.d.ts +0 -1
  143. package/dist/notifications/announcements/announcement-provider.js +0 -29
  144. package/dist/notifications/announcements/announcement-provider.module.css.js +0 -3
  145. package/dist/notifications/announcements/connected-announcement.d.ts +0 -5
  146. package/dist/notifications/announcements/connected-announcement.js +0 -27
  147. package/dist/shared/api/bff/model/announcement.model.d.ts +0 -12
  148. package/dist/shared/model/link.d.ts +0 -15
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { GlyphsChevronsSlimRightIcon } from '../../icons/glyph/glyphs-chevrons-slim-right-icon.js';
@@ -6,15 +7,9 @@ import { Image } from '../../media/image/image.js';
6
7
  import { RouteLink } from '../../shared/routing/route-link.js';
7
8
  import styles from './menu-list.module.css.js';
8
9
 
9
- function MenuListItem(props) {
10
- const { children, hasChildren, onClick } = props;
11
- const href = 'href' in props ? props.href : undefined;
12
- const isSelected = 'isSelected' in props ? props.isSelected : false;
13
- const badge = 'badge' in props ? props.badge : undefined;
14
- const image = 'image' in props ? props.image : undefined;
15
- const ariaControls = 'aria-controls' in props ? props['aria-controls'] : undefined;
10
+ function MenuListItem({ 'aria-controls': ariaControls, badge, children, hasChildren, href, image, isSelected, onClick, openInNewTab, }) {
16
11
  const t = useFormattedMessage();
17
- return (jsxs("li", { "aria-owns": ariaControls, className: clsx(styles['menu-list-item'], isSelected && styles['selected'], hasChildren && styles['has-children']), children: [image && (jsx("span", { className: styles['image'], role: "presentation", children: jsx(Image, { fit: "contain", image: image, title: "" }) })), badge && jsx("span", { className: styles['badge'], children: badge }), jsx(RouteLink, { "aria-controls": ariaControls, "aria-expanded": ariaControls && isSelected, "aria-haspopup": hasChildren ? 'true' : undefined, className: styles['label'], href: href, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, children: children }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
12
+ return (jsxs("li", { "aria-owns": ariaControls, className: clsx(styles['menu-list-item'], isSelected && styles['selected'], hasChildren && styles['has-children']), children: [image && (jsx("span", { className: styles['image'], role: "presentation", children: jsx(Image, { fit: "contain", image: image, title: "" }) })), badge && jsx("span", { className: styles['badge'], children: badge }), jsx(RouteLink, { "aria-controls": ariaControls, "aria-expanded": ariaControls && isSelected, "aria-haspopup": hasChildren ? 'true' : undefined, className: styles['label'], href: href, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, target: openInNewTab ? '_blank' : undefined, children: children }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
18
13
  }
19
14
 
20
15
  export { MenuListItem };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { MenuListBackButton } from './menu-list-back-button.js';
@@ -19,11 +19,11 @@ function OrderLineList({ children, onRemoveAll }) {
19
19
  return;
20
20
  open();
21
21
  }
22
- return (jsxs(Fragment, { children: [jsxs("div", { className: styles['orderline-list'], children: [jsxs("div", { className: styles.header, children: [jsxs("p", { className: styles.count, children: [jsx("span", { "data-test-selector": "orderLineListCount", children: count }), ` ${t.pluralize('product', count)}`] }), onRemoveAll && (jsxs(Link, { className: styles['lnk-remove-all'], color: "primary", "data-test-selector": "cartlineHeader_removeAll", onClick: handleRemoveAll, children: [jsx(StrokeTrashIcon, {}), jsx(FormattedMessage, { id: "Remove all" })] }))] }), jsx("div", { className: styles.items, children:
22
+ return (jsxs(Fragment, { children: [jsxs("section", { "aria-labelledby": "orderline-list-count", className: styles['orderline-list'], children: [jsxs("div", { className: styles.header, children: [jsxs("p", { className: styles.count, id: "orderline-list-count", children: [jsx("span", { "data-test-selector": "orderLineListCount", children: count }), ` ${t.pluralize('product', count)}`] }), onRemoveAll && (jsxs(Link, { className: styles['lnk-remove-all'], color: "primary", "data-test-selector": "cartlineHeader_removeAll", onClick: handleRemoveAll, children: [jsx(StrokeTrashIcon, {}), jsx(FormattedMessage, { id: "Remove all" })] }))] }), jsx("ul", { className: styles.items, children:
23
23
  // eslint-disable-next-line @eslint-react/no-children-map
24
24
  Children.map(children, (child, index) => (
25
25
  // eslint-disable-next-line @eslint-react/no-array-index-key
26
- jsx("div", { className: styles.item, children: child }, index))) })] }), onRemoveAll && (jsx(ConfirmationDialog, { isOpen: isOpen, onCancel: close, onConfirm: onRemoveAll, title: t('Are you sure you want to remove all items from your cart?') }))] }));
26
+ jsx("li", { className: styles.item, children: child }, index))) })] }), onRemoveAll && (jsx(ConfirmationDialog, { isOpen: isOpen, onCancel: close, onConfirm: onRemoveAll, title: t('Are you sure you want to remove all items from your cart?') }))] }));
27
27
  }
28
28
 
29
29
  export { OrderLineList };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { Modal } from '../../modals/modal/modal.js';
3
4
  import { Image } from '../image/image.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { Badge } from '../../badges/badge/badge.js';
3
4
  import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { Badge } from '../../badges/badge/badge.js';
3
4
  import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { Badge } from '../../badges/badge/badge.js';
3
4
  import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
@@ -1,5 +1,8 @@
1
- import { NavigationMenuLink } from '../panel-navigation/panel-navigation';
1
+ import { NavigationLink } from '../../shared/api/bff/model/bff.model';
2
2
  export interface MobileNavigationProps {
3
- links: NavigationMenuLink[];
3
+ id: string;
4
+ isActive: boolean;
5
+ links: NavigationLink[];
6
+ onActiveChange: (isActive: boolean) => void;
4
7
  }
5
- export declare function MobileNavigation({ links }: MobileNavigationProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function MobileNavigation({ id, isActive, links, onActiveChange, }: MobileNavigationProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,8 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import clsx from 'clsx';
4
+ import { HamburgerButton } from '../../header/buttons/hamburger/hamburger-button.js';
5
+ import { SonicLogo } from '../../header/sonic-logo/sonic-logo.js';
2
6
  import { useFormattedMessage } from '../../intl/use-formatted-message.js';
3
7
  import { MenuList } from '../../lists/menu-list/menu-list.js';
4
8
  import { MenuListItem } from '../../lists/menu-list/menu-list-item.js';
@@ -9,12 +13,13 @@ import { AccountIcon } from '../account-icon/account-icon.js';
9
13
  import { CartIcon } from '../cart-icon/cart-icon.js';
10
14
  import { FavoriteIcon } from '../favorite-icon/favorite-icon.js';
11
15
  import { PanelNavigation } from '../panel-navigation/panel-navigation.js';
16
+ import styles from './mobile-navigation.module.css.js';
12
17
 
13
- function MobileNavigation({ links }) {
18
+ function MobileNavigation({ id, isActive, links, onActiveChange, }) {
14
19
  const t = useFormattedMessage();
15
20
  const { data: { isAuthenticated } = {} } = useFetchSession();
16
21
  const cartCount = useFetchCurrentCartCount();
17
- return (jsx(PanelNavigation, { allowBack: true, isNarrow: true, links: links, variant: "primary", children: jsxs(MenuList, { header: t('My Sonic'), scrollable: false, children: [jsx(MenuListItem, { badge: jsx(AccountIcon, { isAuthenticated: isAuthenticated }), href: PATHS.ACCOUNT, children: isAuthenticated ? t('My account') : t('Sign in or create account') }), jsx(MenuListItem, { badge: jsx(FavoriteIcon, {}), href: PATHS.FAVORITES, children: t('Favorites') }), jsx(MenuListItem, { badge: jsx(CartIcon, { count: cartCount }), href: PATHS.CART, children: t('Shopping cart') })] }) }));
22
+ return (jsxs("section", { "aria-label": t('Main menu'), className: clsx(styles['mobile-navigation'], isActive && styles['active']), id: id, children: [jsxs("header", { className: styles['header'], children: [jsx("div", { className: styles['logo'], role: "presentation", children: jsx(SonicLogo, {}) }), jsx("div", { className: styles['hamburger'], children: jsx(HamburgerButton, { "aria-controls": "mobile-navigation", isActive: isActive, onActiveChange: onActiveChange }) })] }), jsx(PanelNavigation, { allowBack: true, className: styles['panels'], isNarrow: true, links: links, variant: "primary", children: jsxs(MenuList, { header: t('My Sonic'), scrollable: false, children: [jsx(MenuListItem, { badge: jsx(AccountIcon, { isAuthenticated: isAuthenticated }), href: PATHS.ACCOUNT, children: isAuthenticated ? t('My account') : t('Sign in or create account') }), jsx(MenuListItem, { badge: jsx(FavoriteIcon, {}), href: PATHS.FAVORITES, children: t('Favorites') }), jsx(MenuListItem, { badge: jsx(CartIcon, { count: cartCount }), href: PATHS.CART, children: t('Shopping cart') })] }) })] }));
18
23
  }
19
24
 
20
25
  export { MobileNavigation };
@@ -0,0 +1,3 @@
1
+ var styles = {"mobile-navigation":"mobile-navigation-module-rMdS-","header":"mobile-navigation-module-XKb3-","active":"mobile-navigation-module-P0kLz","logo":"mobile-navigation-module-keQoj","hamburger":"mobile-navigation-module-3Z-Sl","panels":"mobile-navigation-module-zDR9Q"};
2
+
3
+ export { styles as default };
@@ -1,17 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ImageType } from '../../shared/model/image';
3
- import { NavigationLink } from '../../shared/model/link';
4
- interface NavigationMenuLinkBase extends Omit<NavigationLink, 'external' | 'openInNewTab' | 'type' | 'url' | 'links'> {
5
- image?: ImageType;
6
- }
7
- interface MenuListItemWithChildrenProps {
8
- links: NavigationMenuLink[];
9
- url?: string;
10
- }
11
- interface MenuListItemWithoutChildrenProps {
12
- url: string;
13
- }
14
- export type NavigationMenuLink = NavigationMenuLinkBase & (MenuListItemWithChildrenProps | MenuListItemWithoutChildrenProps);
2
+ import { NavigationLink } from '../../shared/api/bff/model/bff.model';
15
3
  export interface PanelNavigationProps {
16
4
  allowBack?: boolean;
17
5
  children?: ReactNode;
@@ -20,9 +8,9 @@ export interface PanelNavigationProps {
20
8
  href: string;
21
9
  title: string;
22
10
  };
11
+ id?: string;
23
12
  isNarrow?: boolean;
24
- links?: NavigationMenuLink[];
13
+ links?: NavigationLink[];
25
14
  variant?: 'primary';
26
15
  }
27
- export declare function PanelNavigation({ allowBack, children, className, header, isNarrow, links, variant, }: PanelNavigationProps): import("react/jsx-runtime").JSX.Element;
28
- export {};
16
+ export declare function PanelNavigation({ allowBack, children, className, header, id, isNarrow, links, variant, }: PanelNavigationProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { forwardRef, useRef, useState, useCallback, useEffect } from 'react';
3
4
  import clsx from 'clsx';
@@ -36,9 +37,9 @@ const NavigationMenu = forwardRef(({ allowBack, back, children, className, heade
36
37
  setSelectedNavigationVisible(Boolean(selectedNavigationLink));
37
38
  }, [selectedNavigationLink]);
38
39
  const t = useFormattedMessage();
39
- return (jsxs(Fragment, { children: [jsxs("div", { ref: multiRef(ref, menuRef), className: clsx(styles['panel'], isNarrow && styles['narrow'], className), id: id, children: [jsx(MenuList, { back: back, header: header, scrollable: scrollable, variant: variant, children: links?.map(link => 'links' in link ? (jsx(MenuListItem, { hasChildren: true, "aria-controls": `menu-${link.key}`, image: link.image, isSelected: selectedNavigationLink?.key === link.key, onClick: () => setSelectedNavigationLink(selectedNavigationLink?.key === link.key
40
+ return (jsxs(Fragment, { children: [jsxs("div", { ref: multiRef(ref, menuRef), className: clsx(styles['panel'], isNarrow && styles['narrow'], className), id: id, children: [jsx(MenuList, { back: back, header: header, scrollable: scrollable, variant: variant, children: links?.map(link => link.links && link.links.length > 0 ? (jsx(MenuListItem, { hasChildren: true, "aria-controls": `menu-${link.key}`, image: link.image, isSelected: selectedNavigationLink?.key === link.key, onClick: () => setSelectedNavigationLink(selectedNavigationLink?.key === link.key
40
41
  ? undefined
41
- : link), children: link.title }, link.key)) : (jsx(MenuListItem, { href: link.url, image: link.image, children: link.title }, link.key))) }), children] }), jsx(CascadingComponent, { isVisible: selectedNavigationVisible, nodeRef: submenuRef, onEntered: onFocus(submenuRef), onExited: onFocus(menuRef), onUnmounted: onUnmounted, children: jsx(NavigationMenu, { ref: submenuRef, allowBack: allowBack, back: allowBack
42
+ : link), children: link.title }, link.key)) : (jsx(MenuListItem, { href: link.url, image: link.image, openInNewTab: link.openInNewTab, children: link.title }, link.key))) }), children] }), jsx(CascadingComponent, { isVisible: selectedNavigationVisible, nodeRef: submenuRef, onEntered: onFocus(submenuRef), onExited: onFocus(menuRef), onUnmounted: onUnmounted, children: jsx(NavigationMenu, { ref: submenuRef, allowBack: allowBack, back: allowBack
42
43
  ? {
43
44
  onClick: () => {
44
45
  setSelectedNavigationVisible(false);
@@ -61,9 +62,8 @@ const NavigationMenu = forwardRef(({ allowBack, back, children, className, heade
61
62
  : [] }, selectedNavigationLink?.key) })] }));
62
63
  });
63
64
  NavigationMenu.displayName = 'NavigationMenu';
64
- function PanelNavigation({ allowBack, children, className, header, isNarrow, links, variant, }) {
65
- const t = useFormattedMessage();
66
- return (jsx("section", { "aria-label": t('Navigation'), className: clsx(styles['panel-navigation'], className), children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: children ? styles['top-panel'] : undefined, header: header, id: "panel-navigation-first-level", isNarrow: isNarrow, links: links, scrollable: children ? false : undefined, variant: variant, children: children }) }) }) }));
65
+ function PanelNavigation({ allowBack, children, className, header, id, isNarrow, links, variant, }) {
66
+ return (jsx("section", { className: clsx(styles['panel-navigation'], className), id: id, children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: children ? styles['top-panel'] : undefined, header: header, id: "panel-navigation-first-level", isNarrow: isNarrow, links: links, scrollable: children ? false : undefined, variant: variant, children: children }) }) }) }));
67
67
  }
68
68
 
69
69
  export { PanelNavigation };
@@ -0,0 +1,7 @@
1
+ import { AnnouncementObject } from '../../shared/model/announcement';
2
+ export declare function AnnouncementList({ announcements, className, onDismiss, sticky, }: {
3
+ announcements: AnnouncementObject[];
4
+ className?: string;
5
+ onDismiss?: (id: string) => void;
6
+ sticky?: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useRef } from 'react';
4
+ import { TransitionGroup, CSSTransition } from 'react-transition-group';
5
+ import clsx from 'clsx';
6
+ import { useResizeObserver } from '../../shared/hooks/use-resize-observer.js';
7
+ import { Announcement } from './announcement.js';
8
+ import { useFilterAnnouncements } from './use-filter-announcements.js';
9
+ import styles from './announcement-list.module.css.js';
10
+
11
+ function AnnouncementList({ announcements, className, onDismiss, sticky, }) {
12
+ const filteredAnnouncements = useFilterAnnouncements(announcements);
13
+ const nodeRef = useRef(null);
14
+ const { ref: announcementRef } = useResizeObserver((_, size) => {
15
+ const height = Math.floor(size.height);
16
+ document?.documentElement.style.setProperty('--announcements-height', `${height}px`);
17
+ });
18
+ return (jsx("section", { ref: announcementRef, className: clsx(styles['announcement-list'], sticky && styles['sticky'], className), children: jsx(TransitionGroup, { className: styles['list'], role: "list", children: filteredAnnouncements.map(announcement => (jsx(CSSTransition, { classNames: {
19
+ enter: styles['enter'],
20
+ enterActive: styles['enter-active'],
21
+ exit: styles['exit'],
22
+ exitActive: styles['exit-active'],
23
+ }, nodeRef: nodeRef, timeout: 250, children: jsx(Announcement, { ref: nodeRef, announcement: announcement, className: styles['list-item'], onDismiss: onDismiss }) }, announcement.id))) }) }));
24
+ }
25
+
26
+ export { AnnouncementList };
@@ -0,0 +1,3 @@
1
+ var styles = {"announcement-list":"announcement-list-module-Nn6HC","sticky":"announcement-list-module-icXq8","list":"announcement-list-module-cgFNU","list-item":"announcement-list-module-fUupi","enter":"announcement-list-module-W10mi","exit":"announcement-list-module-tyqE0","exit-active":"announcement-list-module-dUOEB","enter-active":"announcement-list-module-1Rfn0"};
2
+
3
+ export { styles as default };
@@ -1,6 +1,7 @@
1
1
  import { AnnouncementObject } from '../../shared/model/announcement';
2
2
  export interface AnnouncementProps {
3
3
  announcement: AnnouncementObject;
4
+ className?: string;
4
5
  onDismiss?: (id: string) => void;
5
6
  }
6
- export declare function Announcement({ announcement: { href, id, subType, text, title, type }, onDismiss, }: AnnouncementProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare const Announcement: React.ForwardRefExoticComponent<AnnouncementProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { forwardRef } from 'react';
3
4
  import clsx from 'clsx';
4
5
  import { IconButton } from '../../buttons/icon-button/icon-button.js';
5
6
  import { GlyphsArrowSemiBoldRightIcon } from '../../icons/glyph/glyphs-arrow-semibold-right-icon.js';
@@ -12,6 +13,7 @@ import { SolidSaleIcon } from '../../icons/solid/solid-sale-icon.js';
12
13
  import { SolidTagIcon } from '../../icons/solid/solid-tag-icon.js';
13
14
  import { StrokeCloseboxIcon } from '../../icons/stroke/stroke-closebox-icon.js';
14
15
  import { RouteLink } from '../../shared/routing/route-link.js';
16
+ import { multiRef } from '../../shared/utils/refs.js';
15
17
  import styles from './announcement.module.css.js';
16
18
 
17
19
  const iconMap = {
@@ -23,8 +25,10 @@ const iconMap = {
23
25
  notice: jsx(SolidNoticeIcon, {}),
24
26
  sales: jsx(SolidSaleIcon, {}),
25
27
  };
26
- function Announcement({ announcement: { href, id, subType, text, title, type }, onDismiss, }) {
27
- return (jsxs(RouteLink, { className: clsx(styles.announcement, { [styles.hover]: Boolean(href) }, styles[type], styles[subType]), href: href, children: [jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.icon, children: iconMap[subType] }), jsxs("div", { className: styles.content, children: [jsx("h2", { className: styles.title, children: title }), jsxs("p", { className: styles.text, children: [text, href && jsx(GlyphsArrowSemiBoldRightIcon, {})] })] })] }), jsx("div", { className: styles.close, children: jsx(IconButton, { color: "current-color", onClick: () => onDismiss?.(id), children: jsx(StrokeCloseboxIcon, {}) }) })] }));
28
- }
28
+ const Announcement = forwardRef(({ announcement: { href, id, subType, text, title, type }, className, onDismiss, }, ref) => {
29
+ return (jsx("div", { ref: multiRef(ref), className: clsx(styles.announcement, styles[type], styles[subType], className), role: "listitem", children: jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.icon, role: "presentation", children: iconMap[subType] }), jsxs("div", { className: styles.content, children: [jsx("h2", { className: styles.title, children: title }), text &&
30
+ (href ? (jsxs(RouteLink, { className: styles.link, href: href, children: [text, jsx(GlyphsArrowSemiBoldRightIcon, {})] })) : (jsx("p", { className: styles.text, children: text })))] }), jsx(IconButton, { className: styles.close, color: "current-color", onClick: () => onDismiss?.(id), children: jsx(StrokeCloseboxIcon, {}) })] }) }));
31
+ });
32
+ Announcement.displayName = 'Announcement';
29
33
 
30
34
  export { Announcement };
@@ -1,3 +1,3 @@
1
- var styles = {"announcement":"announcement-module-Xi0L5","wrapper":"announcement-module-4XVjD","icon":"announcement-module-lxmA2","content":"announcement-module-1Jn7y","title":"announcement-module-8k2rK","text":"announcement-module-yXGsN","close":"announcement-module-gZ9ae","informative":"announcement-module-0LTWL","notice":"announcement-module-Ga3lN","critical":"announcement-module-S3nSW","hover":"announcement-module-Fj5ya","promo":"announcement-module-E6DqW"};
1
+ var styles = {"announcement":"announcement-module-Xi0L5","wrapper":"announcement-module-4XVjD","icon":"announcement-module-lxmA2","content":"announcement-module-1Jn7y","title":"announcement-module-8k2rK","link":"announcement-module--Bhqj","text":"announcement-module-yXGsN","close":"announcement-module-gZ9ae","informative":"announcement-module-0LTWL","notice":"announcement-module-Ga3lN","critical":"announcement-module-S3nSW","promo":"announcement-module-E6DqW"};
2
2
 
3
3
  export { styles as default };
@@ -0,0 +1 @@
1
+ export declare function ConnectedAnnouncementList(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useCultureCode } from '../../intl/use-culture-code.js';
4
+ import { useLogError } from '../../logging/use-log-error.js';
5
+ import { useFetchAnnouncements } from '../../shared/api/bff/hooks/use-fetch-announcements.js';
6
+ import { useLocalStorage } from '../../shared/hooks/use-local-storage.js';
7
+ import { AnnouncementList } from './announcement-list.js';
8
+
9
+ function ConnectedAnnouncementList() {
10
+ const cultureCode = useCultureCode();
11
+ const { data: announcements, error } = useFetchAnnouncements({
12
+ cultureCode,
13
+ });
14
+ useLogError(error);
15
+ const [dismissedIds, setDismissedIds] = useLocalStorage('dismissedAnnouncementIds', []);
16
+ const filteredAnnouncements = announcements?.filter(({ id }) => !dismissedIds.includes(id));
17
+ if (!filteredAnnouncements)
18
+ return null;
19
+ return (jsx(AnnouncementList, { announcements: filteredAnnouncements, onDismiss: id => setDismissedIds(dismissedIds => [...dismissedIds, id]), sticky: true }));
20
+ }
21
+
22
+ export { ConnectedAnnouncementList };
@@ -0,0 +1,2 @@
1
+ import { AnnouncementObject } from '../../shared/model/announcement';
2
+ export declare function useFilterAnnouncements(announcements: AnnouncementObject[]): AnnouncementObject[];
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useState, useCallback, useEffect } from 'react';
3
+ import { TIME } from '../../shared/utils/time.js';
4
+
5
+ const now = () => new Date();
6
+ const filterAnnouncement = (announcement) => {
7
+ const { endDate, startDate } = announcement;
8
+ const isVisible = (!startDate || startDate <= now()) && (!endDate || endDate > now());
9
+ return isVisible;
10
+ };
11
+ const arraysEqual = (a, b) => {
12
+ if (a.length !== b.length)
13
+ return false;
14
+ return a.every((val, index) => val === b[index]);
15
+ };
16
+ function useFilterAnnouncements(announcements) {
17
+ const [filteredAnnouncements, setFilteredAnnouncements] = useState(announcements.filter(filterAnnouncement));
18
+ const updateAnnouncements = useCallback(() => {
19
+ const newFilteredAnnouncements = announcements.filter(filterAnnouncement);
20
+ // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
21
+ setFilteredAnnouncements(filteredAnnouncements => arraysEqual(filteredAnnouncements, newFilteredAnnouncements)
22
+ ? filteredAnnouncements
23
+ : newFilteredAnnouncements);
24
+ }, [announcements]);
25
+ useEffect(() => {
26
+ updateAnnouncements();
27
+ }, [announcements, updateAnnouncements]);
28
+ useEffect(() => {
29
+ const intervalId = setInterval(updateAnnouncements, 1 * TIME.MINUTE);
30
+ return () => clearInterval(intervalId);
31
+ }, [updateAnnouncements]);
32
+ return filteredAnnouncements;
33
+ }
34
+
35
+ export { useFilterAnnouncements };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { useRef } from 'react';
3
4
  import { useIntersectionObserver } from '../shared/hooks/use-intersection-observer.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { useMemo } from 'react';
3
4
  import { FormattedMessage } from '../../../intl/formatted-message.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { useIsBreakpoint } from '../../../../shared/hooks/use-is-breakpoint.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { useState, useMemo } from 'react';
3
4
  import { RecoverPasswordDialog } from '../../../modals/recover-password/recover-password-dialog.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { ConnectedOrderLineCard } from '../../../cards/orderline-card/connected-orderline-card.js';
3
4
  import { CartTotals } from '../../../cart-totals/cart-totals.js';
@@ -80,7 +81,7 @@ function CartContent({ cartLines }) {
80
81
  if (!currencyCode)
81
82
  throw new Error(`Currency code not found for symbol ${currentCart.currencySymbol}`);
82
83
  return (jsx(CheckoutPageLayout, { actions: {
83
- primary: (jsx(RouteButton, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", href: "/CheckoutShipping", children: jsx(FormattedMessage, { id: "Continue shopping" }) })),
84
+ primary: (jsx(RouteButton, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", href: "/CheckoutShipping", children: jsx(FormattedMessage, { id: "Start checkout" }) })),
84
85
  secondary: (jsx(RouteButton, { color: "secondary", "data-test-selector": "saveCartForLaterButton", href: isAuthenticated ? undefined : PATHS.SIGN_IN, onClick: () => {
85
86
  if (!isAuthenticated)
86
87
  return;
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
3
  import { FormattedMessage } from '../../../../intl/formatted-message.js';
3
4
  import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { AddressInfoDisplay } from '../../../address-info-display/address-info-display.js';
3
4
  import { InfoDisplay } from '../../../display/info-display/info-display.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { useRef, useMemo } from 'react';
3
4
  import clsx from 'clsx';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
3
  import { PrintButton } from '../../../buttons/print-button/print-button.js';
3
4
  import { OrderLineCard } from '../../../cards/orderline-card/orderline-card.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useEffect } from 'react';
3
4
  import { LoadingPage } from '../../loading-page/loading-page.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useRef, useEffect } from 'react';
3
4
  import AdyenCheckout from '@adyen/adyen-web';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { useRef, useState, useEffect, useCallback } from 'react';
3
4
  import { Form } from 'react-aria-components';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { Button } from '../../../buttons/button/button.js';
3
4
  import { OrderLineCard } from '../../../cards/orderline-card/orderline-card.js';
@@ -27,7 +28,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, isValidat
27
28
  label: t('Review and payment'),
28
29
  },
29
30
  ], "data-test-selector": "paymentPage", title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
30
- primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_placeOrder", form: formId, isDisabled: isProcessing, isLoading: isProcessing ? (jsx(FormattedMessage, { id: "Processing" })) : isValidatingVAT ? (jsx(FormattedMessage, { id: "Validating" })) : (false), type: "submit", children: jsx(FormattedMessage, { id: "Pay" }) })),
31
+ primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_placeOrder", form: formId, isDisabled: isProcessing, isLoading: isProcessing ? (jsx(FormattedMessage, { id: "Processing" })) : isValidatingVAT ? (jsx(FormattedMessage, { id: "Validating" })) : (false), type: "submit", children: cart.paymentMethod?.name === 'PBI' ? (jsx(FormattedMessage, { id: "Finalize order" })) : (jsx(FormattedMessage, { id: "Finalize payment" })) })),
31
32
  }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: cart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, deliveryDate: hasAtp ? undefined : cart.requestedDeliveryDate, fulfillmentMethod: cart.fulfillmentMethod, isPayByInvoice: (cart.paymentOptions?.paymentMethods?.length || 1) <= 1 &&
32
33
  cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing, onValidatingVAT: setIsValidatingVAT }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
33
34
  fit: 'contain',
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useState, useCallback, useEffect } from 'react';
3
4
  import { useIsAuthenticated } from '../../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { FormattedMessage } from '../../../../intl/formatted-message.js';
3
4
  import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
3
  import { useState } from 'react';
3
4
  import { Form } from 'react-aria-components';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
3
  import { Form } from 'react-aria-components';
3
4
  import { AddressInfoDisplay } from '../../../../address-info-display/address-info-display.js';
@@ -1,9 +1,15 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
- import { FormattedMessage } from '../../../../intl/formatted-message.js';
3
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
3
4
  import styles from './sonic-address.module.css.js';
4
5
 
5
6
  function SonicAddress() {
6
- return (jsx("div", { className: styles['sonic-address'], "data-test-selector": "pickupAddressSonic", children: jsx(FormattedMessage, { id: "Sonic address" }) }));
7
+ const t = useFormattedMessage();
8
+ return (jsx("div", { className: styles['sonic-address'],
9
+ // eslint-disable-next-line @eslint-react/dom/no-dangerously-set-innerhtml
10
+ dangerouslySetInnerHTML: {
11
+ __html: t('Sonic address').replaceAll(String.raw `\n`, '\n'),
12
+ }, "data-test-selector": "pickupAddressSonic" }));
7
13
  }
8
14
 
9
15
  export { SonicAddress };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
3
  import { Button } from '../../../buttons/button/button.js';
3
4
  import { CartTotals } from '../../../cart-totals/cart-totals.js';
@@ -31,7 +32,7 @@ function ShippingPageContent({ cart, editAddress, errorPatchBillingAddress, fulf
31
32
  label: t('Shipping details'),
32
33
  },
33
34
  ], "data-test-selector": "shippingPage", title: t('Shipping details'), children: jsxs(CheckoutPageLayout, { actions: {
34
- primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", form: EDIT_ADDRESS_FORM_ID, isDisabled: isPatching, isLoading: isPatching || isPatchingSession ? (jsx(FormattedMessage, { id: "Updating address" })) : undefined, type: "submit", children: jsx(FormattedMessage, { id: "Continue shopping" }) })),
35
+ primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", form: EDIT_ADDRESS_FORM_ID, isDisabled: isPatching, isLoading: isPatching || isPatchingSession ? (jsx(FormattedMessage, { id: "Updating address" })) : undefined, type: "submit", children: jsx(FormattedMessage, { id: "Checkout order" }) })),
35
36
  }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: cart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, fulfillmentMethod: fulfillmentMethods && fulfillmentMethods.length === 1
36
37
  ? cart.fulfillmentMethod
37
38
  : undefined, shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate }), children: [jsxs(Fragment, { children: [fulfillmentMethods && fulfillmentMethods.length > 1 && (jsx(CheckoutPageSection, { hasBorder: true, title: t('Fulfillment method'), children: jsx(CheckoutPageSectionContent, { children: jsx("div", { className: styles['fulfillment-select-wrapper'], children: jsx(Select, { isRequired: true, showLabel: true, "data-test-selector": "fulfillmentMethodSelect", defaultSelectedOption: cart.fulfillmentMethod, isLoading: isLoadingFulfillmentMethods, label: t('Fulfillment method'), name: "fulfillmentMethod", onChange: onChangeFulfillmentMethod, options: fulfillmentMethodOptions || {}, variant: "solid" }) }) }) })), hasBillToAddress && !isGuest ? readOnlyAddress : editAddress] }), Boolean(errorPatchBillingAddress) && (jsx("div", { className: styles['error-message'], children: jsx(FormattedMessage, { id: "An unexpected error occured" }) }))] }) }));
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
3
  import { useRef, useEffect } from 'react';
3
4
  import { useCountries } from '../../../country-select/hooks/use-countries.js';
@@ -1,3 +1,5 @@
1
+ import { environment } from '../../../shared/utils/environment.js';
2
+
1
3
  function addOrUpdateElement(selector, { attributes, tag, }) {
2
4
  const existingElement = document?.querySelector(selector);
3
5
  if (existingElement) {
@@ -19,6 +21,8 @@ function removeElements(selector) {
19
21
  document?.querySelectorAll(selector).forEach(element => element.remove());
20
22
  }
21
23
  function PageMetaData(props) {
24
+ if (environment === 'next')
25
+ return null;
22
26
  if (typeof document === 'undefined')
23
27
  return null;
24
28
  if (props.windowTitle) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs, jsx } from 'react/jsx-runtime';
2
3
  import { ConnectedAddToCartButton } from '../../../../../buttons/add-to-cart-button/connected-add-to-cart-button.js';
3
4
  import { ConnectedFavoriteButton } from '../../../../../buttons/favorite/connected-favorite-button.js';
@@ -0,0 +1,2 @@
1
+ import { FetchNavigationLinksArgs } from '../services/bff-service';
2
+ export declare function useFetchNavigationLinks({ cultureCode, source, }: FetchNavigationLinksArgs): import("@tanstack/react-query").UseQueryResult<import("../model/bff.model").NavigationLinkResponse, Error>;
@@ -0,0 +1,15 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { TIME } from '../../../utils/time.js';
3
+ import { fetchNavigationLinks } from '../services/bff-service.js';
4
+
5
+ function useFetchNavigationLinks({ cultureCode, source, }) {
6
+ return useQuery({
7
+ gcTime: 1 * TIME.DAY,
8
+ queryFn: () => fetchNavigationLinks({ cultureCode, source }),
9
+ queryKey: ['navigation', source, cultureCode],
10
+ refetchInterval: 5 * TIME.MINUTE,
11
+ staleTime: 1 * TIME.DAY,
12
+ });
13
+ }
14
+
15
+ export { useFetchNavigationLinks };
@@ -1,4 +1,5 @@
1
1
  import { CurrencyCode } from '../../../../intl/types';
2
+ import { ImageType } from '../../../model/image';
2
3
  export interface PageModel {
3
4
  alternateLanguageUrls: {
4
5
  [key: string]: string;
@@ -175,4 +176,33 @@ export interface Country {
175
176
  languages: Language[];
176
177
  name: string;
177
178
  }
179
+ interface Announcement {
180
+ endDate?: string;
181
+ href: string;
182
+ id: string;
183
+ startDate?: string;
184
+ subType: string;
185
+ text: string;
186
+ title: string;
187
+ type: string;
188
+ }
189
+ export type AnnouncementResponse = Announcement[];
190
+ export interface NavigationLink {
191
+ external?: boolean;
192
+ image?: ImageType;
193
+ key: string;
194
+ links?: NavigationLink[];
195
+ openInNewTab?: boolean;
196
+ title: string;
197
+ type: 'link' | 'category' | 'section';
198
+ url?: string;
199
+ }
200
+ export interface NavigationLinkResponse {
201
+ footer: {
202
+ bottomLinks: NavigationLink[];
203
+ copyright: string;
204
+ linkBlocks: NavigationLink[];
205
+ };
206
+ header: NavigationLink[];
207
+ }
178
208
  export {};