@sonic-equipment/ui 170.0.0 → 173.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 (75) hide show
  1. package/dist/algolia/algolia-query-string-routing.js +2 -2
  2. package/dist/buttons/button/button.js +3 -6
  3. package/dist/buttons/icon-button/icon-button.d.ts +2 -1
  4. package/dist/buttons/icon-button/icon-button.js +5 -8
  5. package/dist/buttons/link/link.js +4 -7
  6. package/dist/cards/orderline-card/orderline-card.d.ts +1 -1
  7. package/dist/carousel/carousel.js +3 -3
  8. package/dist/carousel/usp-carousel/usp-carousel.js +1 -1
  9. package/dist/delivery-time/delivery-time.d.ts +2 -2
  10. package/dist/delivery-time/delivery-time.js +3 -1
  11. package/dist/drawer/drawer.d.ts +2 -1
  12. package/dist/drawer/drawer.js +2 -2
  13. package/dist/drawer/use-drawer.js +1 -0
  14. package/dist/exports.d.ts +1 -0
  15. package/dist/forms/select-field/select-field.js +1 -0
  16. package/dist/global-search/search-result-panel/sections/with-results.js +3 -4
  17. package/dist/header/buttons/account/connected-account-button.js +1 -1
  18. package/dist/header/buttons/cart/connected-cart-button.js +1 -1
  19. package/dist/header/drawers/desktop-navigation-drawer.js +2 -1
  20. package/dist/header/drawers/mobile-navigation-drawer.js +2 -1
  21. package/dist/header/drawers/search-drawer.js +1 -1
  22. package/dist/header/header.js +1 -1
  23. package/dist/header/link-list/navigation-link-list.d.ts +2 -1
  24. package/dist/header/link-list/navigation-link-list.js +4 -3
  25. package/dist/header/sonic-logo/sonic-logo.d.ts +2 -1
  26. package/dist/header/sonic-logo/sonic-logo.js +3 -2
  27. package/dist/index.js +1 -0
  28. package/dist/lists/menu-list/menu-list-back-button.d.ts +2 -1
  29. package/dist/lists/menu-list/menu-list-back-button.js +2 -2
  30. package/dist/lists/menu-list/menu-list-header.d.ts +2 -1
  31. package/dist/lists/menu-list/menu-list-header.js +2 -2
  32. package/dist/lists/menu-list/menu-list-item.d.ts +2 -1
  33. package/dist/lists/menu-list/menu-list-item.js +2 -2
  34. package/dist/lists/menu-list/menu-list.js +1 -1
  35. package/dist/media/image-lightbox/image-lightbox.js +3 -3
  36. package/dist/navigation/cart-icon/cart-icon.js +1 -1
  37. package/dist/navigation/mobile-navigation/mobile-navigation.js +1 -1
  38. package/dist/navigation/panel-navigation/panel-navigation.d.ts +2 -1
  39. package/dist/navigation/panel-navigation/panel-navigation.js +4 -4
  40. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/free-mode.js +1 -1
  41. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/thumbs.js +1 -1
  42. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/swiper-core.js +30 -15
  43. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/update-on-virtual-data.js +1 -0
  44. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/update-swiper.js +4 -2
  45. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/utils.js +13 -1
  46. package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/swiper-react.js +2 -2
  47. package/dist/notifications/announcements/announcement-list.js +1 -1
  48. package/dist/notifications/announcements/announcement.js +2 -2
  49. package/dist/pages/checkout/cart-page/cart-page.js +1 -1
  50. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
  51. package/dist/pages/checkout/payment-page/hooks/use-get-adyen-redirect-result.js +1 -0
  52. package/dist/pages/checkout/payment-page/payment-page-content.js +1 -1
  53. package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.d.ts +1 -1
  54. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +1 -1
  55. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.d.ts +1 -1
  56. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.d.ts +1 -1
  57. package/dist/shared/hooks/use-debounced-callback.js +1 -0
  58. package/dist/shared/hooks/use-enable-mobile-zoom.js +1 -0
  59. package/dist/shared/hooks/use-intersection-observer.js +1 -0
  60. package/dist/shared/hooks/use-mutation-observer.js +1 -0
  61. package/dist/shared/hooks/use-resize-observer.js +1 -0
  62. package/dist/shared/routing/types.d.ts +1 -0
  63. package/dist/shared/routing/use-route-link.d.ts +8 -0
  64. package/dist/shared/routing/use-route-link.js +24 -0
  65. package/dist/styles.css +7 -3
  66. package/package.json +45 -45
  67. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/routers/history.js +0 -0
  68. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/stateMappings/simple.js +0 -0
  69. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/documentation.js +0 -0
  70. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/logger.js +0 -0
  71. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/noop.js +0 -0
  72. /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js +0 -0
  73. /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/navigation.js +0 -0
  74. /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/create-element-if-not-defined.js +0 -0
  75. /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/ssr-window.esm.js +0 -0
@@ -1,4 +1,4 @@
1
- import { d as now, k as elementTransitionEnd } from '../shared/utils.js';
1
+ import { f as now, l as elementTransitionEnd } from '../shared/utils.js';
2
2
 
3
3
  function freeMode(_ref) {
4
4
  let {
@@ -1,5 +1,5 @@
1
1
  import { g as getDocument } from '../shared/ssr-window.esm.js';
2
- import { l as isObject, e as elementChildren } from '../shared/utils.js';
2
+ import { o as isObject, e as elementChildren } from '../shared/utils.js';
3
3
 
4
4
  function Thumb(_ref) {
5
5
  let {
@@ -1,5 +1,5 @@
1
1
  import { a as getWindow, g as getDocument } from './ssr-window.esm.js';
2
- import { w as extend, u as showWarning, e as elementChildren, n as nextTick, t as animateCSSModeScroll, j as getTranslate, q as elementNextAll, r as elementPrevAll, s as setCSSProperty, p as elementStyle, f as elementOuterSize, h as elementIndex, c as createElement, x as deleteProps, v as elementIsChildOf, d as now, a as elementParents } from './utils.js';
2
+ import { x as extend, v as showWarning, e as elementChildren, n as nextTick, u as animateCSSModeScroll, k as getTranslate, r as elementNextAll, t as elementPrevAll, a as setCSSProperty, q as elementStyle, h as elementOuterSize, i as elementIndex, c as createElement, y as deleteProps, w as elementIsChildOf, f as now, b as elementParents } from './utils.js';
3
3
 
4
4
  let support;
5
5
  function calcSupport() {
@@ -1310,11 +1310,9 @@ function transitionEmit(_ref) {
1310
1310
  if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';
1311
1311
  }
1312
1312
  swiper.emit(`transition${step}`);
1313
- if (runCallbacks && activeIndex !== previousIndex) {
1314
- if (dir === 'reset') {
1315
- swiper.emit(`slideResetTransition${step}`);
1316
- return;
1317
- }
1313
+ if (runCallbacks && dir === 'reset') {
1314
+ swiper.emit(`slideResetTransition${step}`);
1315
+ } else if (runCallbacks && activeIndex !== previousIndex) {
1318
1316
  swiper.emit(`slideChangeTransition${step}`);
1319
1317
  if (dir === 'next') {
1320
1318
  swiper.emit(`slideNextTransition${step}`);
@@ -1810,7 +1808,7 @@ var slide = {
1810
1808
  slideToClickedSlide
1811
1809
  };
1812
1810
 
1813
- function loopCreate(slideRealIndex) {
1811
+ function loopCreate(slideRealIndex, initial) {
1814
1812
  const swiper = this;
1815
1813
  const {
1816
1814
  params,
@@ -1858,7 +1856,8 @@ function loopCreate(slideRealIndex) {
1858
1856
  }
1859
1857
  swiper.loopFix({
1860
1858
  slideRealIndex,
1861
- direction: params.centeredSlides ? undefined : 'next'
1859
+ direction: params.centeredSlides ? undefined : 'next',
1860
+ initial
1862
1861
  });
1863
1862
  }
1864
1863
 
@@ -1869,6 +1868,7 @@ function loopFix(_temp) {
1869
1868
  direction,
1870
1869
  setTranslate,
1871
1870
  activeSlideIndex,
1871
+ initial,
1872
1872
  byController,
1873
1873
  byMousewheel
1874
1874
  } = _temp === void 0 ? {} : _temp;
@@ -1883,7 +1883,8 @@ function loopFix(_temp) {
1883
1883
  params
1884
1884
  } = swiper;
1885
1885
  const {
1886
- centeredSlides
1886
+ centeredSlides,
1887
+ initialSlide
1887
1888
  } = params;
1888
1889
  swiper.allowSlidePrev = true;
1889
1890
  swiper.allowSlideNext = true;
@@ -1919,14 +1920,16 @@ function loopFix(_temp) {
1919
1920
  loopedSlides += params.loopAdditionalSlides;
1920
1921
  swiper.loopedSlides = loopedSlides;
1921
1922
  const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
1922
- if (slides.length < slidesPerView + loopedSlides) {
1923
- showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
1923
+ if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
1924
+ showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');
1924
1925
  } else if (gridEnabled && params.grid.fill === 'row') {
1925
1926
  showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');
1926
1927
  }
1927
1928
  const prependSlidesIndexes = [];
1928
1929
  const appendSlidesIndexes = [];
1929
- let activeIndex = swiper.activeIndex;
1930
+ const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
1931
+ const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !centeredSlides;
1932
+ let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
1930
1933
  if (typeof activeSlideIndex === 'undefined') {
1931
1934
  activeSlideIndex = swiper.getSlideIndex(slides.find(el => el.classList.contains(params.slideActiveClass)));
1932
1935
  } else {
@@ -1936,7 +1939,6 @@ function loopFix(_temp) {
1936
1939
  const isPrev = direction === 'prev' || !direction;
1937
1940
  let slidesPrepended = 0;
1938
1941
  let slidesAppended = 0;
1939
- const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
1940
1942
  const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
1941
1943
  const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);
1942
1944
  // prepend last slides before start
@@ -1958,6 +1960,9 @@ function loopFix(_temp) {
1958
1960
  }
1959
1961
  } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
1960
1962
  slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
1963
+ if (isInitialOverflow) {
1964
+ slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
1965
+ }
1961
1966
  for (let i = 0; i < slidesAppended; i += 1) {
1962
1967
  const index = i - Math.floor(i / cols) * cols;
1963
1968
  if (gridEnabled) {
@@ -1973,6 +1978,14 @@ function loopFix(_temp) {
1973
1978
  requestAnimationFrame(() => {
1974
1979
  swiper.__preventObserver__ = false;
1975
1980
  });
1981
+ if (swiper.params.effect === 'cards' && slides.length < slidesPerView + loopedSlides * 2) {
1982
+ if (appendSlidesIndexes.includes(activeSlideIndex)) {
1983
+ appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
1984
+ }
1985
+ if (prependSlidesIndexes.includes(activeSlideIndex)) {
1986
+ prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
1987
+ }
1988
+ }
1976
1989
  if (isPrev) {
1977
1990
  prependSlidesIndexes.forEach(index => {
1978
1991
  slides[index].swiperLoopMoveDOM = true;
@@ -2329,7 +2342,9 @@ function onTouchMove(event) {
2329
2342
  data.isMoved = false;
2330
2343
  return;
2331
2344
  }
2332
- } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
2345
+ } else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
2346
+ return;
2347
+ } else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
2333
2348
  return;
2334
2349
  }
2335
2350
  }
@@ -3794,7 +3809,7 @@ class Swiper {
3794
3809
 
3795
3810
  // Create loop
3796
3811
  if (swiper.params.loop) {
3797
- swiper.loopCreate();
3812
+ swiper.loopCreate(undefined, true);
3798
3813
  }
3799
3814
 
3800
3815
  // Attach events
@@ -122,6 +122,7 @@ const updateOnVirtualData = swiper => {
122
122
  swiper.updateSlides();
123
123
  swiper.updateProgress();
124
124
  swiper.updateSlidesClasses();
125
+ swiper.emit('_virtualUpdated');
125
126
  if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
126
127
  swiper.parallax.setTranslate();
127
128
  }
@@ -1,3 +1,5 @@
1
+ import { s as setInnerHTML } from './utils.js';
2
+
1
3
  /* underscore in name -> watch for changes */
2
4
  const paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',
3
5
  // modules
@@ -192,14 +194,14 @@ function updateSwiper(_ref) {
192
194
  if (!nextEl || typeof nextEl === 'string') {
193
195
  nextEl = document.createElement('div');
194
196
  nextEl.classList.add('swiper-button-next');
195
- nextEl.innerHTML = swiper.hostEl.constructor.nextButtonSvg;
197
+ setInnerHTML(nextEl, swiper.hostEl.constructor.nextButtonSvg);
196
198
  nextEl.part.add('button-next');
197
199
  swiper.el.appendChild(nextEl);
198
200
  }
199
201
  if (!prevEl || typeof prevEl === 'string') {
200
202
  prevEl = document.createElement('div');
201
203
  prevEl.classList.add('swiper-button-prev');
202
- prevEl.innerHTML = swiper.hostEl.constructor.prevButtonSvg;
204
+ setInnerHTML(prevEl, swiper.hostEl.constructor.prevButtonSvg);
203
205
  prevEl.part.add('button-prev');
204
206
  swiper.el.appendChild(prevEl);
205
207
  }
@@ -299,5 +299,17 @@ function elementOuterSize(el, size, includeMargins) {
299
299
  function makeElementsArray(el) {
300
300
  return (Array.isArray(el) ? el : [el]).filter(e => !!e);
301
301
  }
302
+ function setInnerHTML(el, html) {
303
+ if (html === void 0) {
304
+ html = '';
305
+ }
306
+ if (typeof trustedTypes !== 'undefined') {
307
+ el.innerHTML = trustedTypes.createPolicy('html', {
308
+ createHTML: s => s
309
+ }).createHTML(html);
310
+ } else {
311
+ el.innerHTML = html;
312
+ }
313
+ }
302
314
 
303
- export { elementParents as a, createElement as c, now as d, elementChildren as e, elementOuterSize as f, elementIndex as h, classesToTokens as i, getTranslate as j, elementTransitionEnd as k, isObject as l, makeElementsArray as m, nextTick as n, elementStyle as p, elementNextAll as q, elementPrevAll as r, setCSSProperty as s, animateCSSModeScroll as t, showWarning as u, elementIsChildOf as v, extend as w, deleteProps as x };
315
+ export { setCSSProperty as a, elementParents as b, createElement as c, elementChildren as e, now as f, elementOuterSize as h, elementIndex as i, classesToTokens as j, getTranslate as k, elementTransitionEnd as l, makeElementsArray as m, nextTick as n, isObject as o, elementStyle as q, elementNextAll as r, setInnerHTML as s, elementPrevAll as t, animateCSSModeScroll as u, showWarning as v, elementIsChildOf as w, extend as x, deleteProps as y };
@@ -4,7 +4,7 @@ import { g as getParams, m as mountSwiper, a as getChangedParams, u as updateOnV
4
4
  import { d as uniqueClasses, w as wrapperClass, n as needsNavigation, b as needsScrollbar, a as needsPagination, e as extend, u as updateSwiper } from './shared/update-swiper.js';
5
5
 
6
6
  /**
7
- * Swiper React 11.2.5
7
+ * Swiper React 11.2.8
8
8
  * Most modern mobile touch slider and framework with hardware accelerated transitions
9
9
  * https://swiperjs.com
10
10
  *
@@ -12,7 +12,7 @@ import { d as uniqueClasses, w as wrapperClass, n as needsNavigation, b as needs
12
12
  *
13
13
  * Released under the MIT License
14
14
  *
15
- * Released on: March 3, 2025
15
+ * Released on: May 23, 2025
16
16
  */
17
17
 
18
18
 
@@ -15,7 +15,7 @@ function AnnouncementList({ announcements, className, onDismiss, sticky, }) {
15
15
  const height = Math.floor(size.height);
16
16
  document?.documentElement.style.setProperty('--announcements-height', `${height}px`);
17
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: {
18
+ return (jsx("section", { ref: announcementRef, className: clsx(styles['announcement-list'], sticky && styles['sticky'], className), "data-test-selector": "announcementList", children: jsx(TransitionGroup, { className: styles['list'], role: "list", children: filteredAnnouncements.map(announcement => (jsx(CSSTransition, { classNames: {
19
19
  enter: styles['enter'],
20
20
  enterActive: styles['enter-active'],
21
21
  exit: styles['exit'],
@@ -26,8 +26,8 @@ const iconMap = {
26
26
  sales: jsx(SolidSaleIcon, {}),
27
27
  };
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(Link, { 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, {}) })] }) }));
29
+ return (jsx("div", { ref: multiRef(ref), className: clsx(styles.announcement, styles[type], styles[subType], className), "data-id": id, "data-sub-type": subType, "data-test-selector": "announcement", "data-type": type, 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, "data-test-selector": "announcementTitle", children: title }), text &&
30
+ (href ? (jsxs(Link, { className: styles.link, "data-test-selector": "announcementLink", href: href, children: [text, jsx(GlyphsArrowSemiBoldRightIcon, {})] })) : (jsx("p", { className: styles.text, children: text })))] }), jsx(IconButton, { className: styles.close, color: "current-color", "data-test-selector": "announcementCloseButton", onClick: () => onDismiss?.(id), children: jsx(StrokeCloseboxIcon, {}) })] }) }));
31
31
  });
32
32
  Announcement.displayName = 'Announcement';
33
33
 
@@ -85,7 +85,7 @@ function CartContent({ cartLines }) {
85
85
  secondary: isAuthenticated ? (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", onClick: () => {
86
86
  saveCartForLater.mutate({ cart: currentCart });
87
87
  }, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })) : (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", href: PATHS.SIGN_IN, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })),
88
- }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: currentCart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, shippingCost: currentCart.shippingAndHandling, subtotal: currentCart.orderSubTotal, tax: currentCart.totalTax, total: currentCart.orderGrandTotal, vatPercentage: cartLines[0]?.pricing?.vatRate || 0 }), children: jsx(OrderLineList, { onRemoveAll: () => deleteCurrentCart.mutate(), children: cartLines.map(cartLine => (jsx(ConnectedOrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
88
+ }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: currentCart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, shippingCost: currentCart.shippingAndHandling, subtotal: currentCart.orderSubTotal, tax: currentCart.totalTax, total: currentCart.orderGrandTotal, vatPercentage: cartLines[0]?.pricing?.vatRate || 0 }), children: jsx(OrderLineList, { onRemoveAll: () => deleteCurrentCart.mutate(), children: cartLines.map(cartLine => (jsx(ConnectedOrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
89
89
  fit: 'contain',
90
90
  image: {
91
91
  '1': cartLine.smallImagePath,
@@ -76,7 +76,7 @@ function OrderConfirmationPageContent({ cart, }) {
76
76
  email: cart.shipTo?.email,
77
77
  phone: cart.shipTo?.phone,
78
78
  postalCode: cart.shipTo?.postalCode,
79
- } }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: t('Order'), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
79
+ } }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: t('Order'), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: undefined, href: cartLine.productUri, image: {
80
80
  fit: 'contain',
81
81
  image: {
82
82
  '1': cartLine.smallImagePath,
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef } from 'react';
2
3
  import qs from 'query-string';
3
4
 
@@ -30,7 +30,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, isValidat
30
30
  ], "data-test-selector": "paymentPage", title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
31
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" })) })),
32
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 &&
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
+ 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 ?? null, href: cartLine.productUri, image: {
34
34
  fit: 'contain',
35
35
  image: {
36
36
  '1': cartLine.smallImagePath,
@@ -5,4 +5,4 @@ export interface UseFetchCartByIdArgs<T> {
5
5
  id: string;
6
6
  select?: (data: CartModel) => T;
7
7
  }
8
- export declare function useFetchCartById<T = CartModel>({ enabled, forceRecalculation, id, select, }: UseFetchCartByIdArgs<T>): import("@tanstack/react-query").UseQueryResult<T, Error>;
8
+ export declare function useFetchCartById<T = CartModel>({ enabled, forceRecalculation, id, select, }: UseFetchCartByIdArgs<T>): import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<T>, Error>;
@@ -14,7 +14,7 @@ function useFetchCurrentCartWithAtp({ forceRecalculation = true, select = cartMo
14
14
  ...cartResult.data,
15
15
  cartLines: cartResult.data.cartLines?.map(line => ({
16
16
  ...line,
17
- atp: atp.find(a => a.productCode === line.erpNumber),
17
+ atp: atp.find(a => a.productCode === line.erpNumber) || null,
18
18
  })),
19
19
  }
20
20
  : cartResult.data),
@@ -1,3 +1,3 @@
1
1
  import { CartModel } from '../../model/storefront.model';
2
2
  import { UseFetchCartByIdArgs } from './use-fetch-cart-by-id';
3
- export declare function useFetchCurrentCart<T = CartModel>(args?: Omit<UseFetchCartByIdArgs<T>, 'id'>): import("@tanstack/react-query").UseQueryResult<T, Error>;
3
+ export declare function useFetchCurrentCart<T = CartModel>(args?: Omit<UseFetchCartByIdArgs<T>, 'id'>): import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<T>, Error>;
@@ -2,4 +2,4 @@ import { Country } from '../../model/storefront.model';
2
2
  export declare function useFetchCountriesWithLanguages<TReturnType = Country[]>({ enabled, select, }?: {
3
3
  enabled?: boolean;
4
4
  select?: (data: Country[]) => TReturnType;
5
- }): import("@tanstack/react-query").UseQueryResult<TReturnType, Error>;
5
+ }): import("@tanstack/react-query").UseQueryResult<import("@tanstack/react-query").NoInfer<TReturnType>, Error>;
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useCallback } from 'react';
2
3
 
3
4
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useEffect } from 'react';
2
3
 
3
4
  function useEnableMobileZoom({ isEnabled }) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState, useRef, useEffect } from 'react';
2
3
 
3
4
  function useIntersectionObserver({ isDisabled, observables, onIntersectingChange, }) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useEffect } from 'react';
2
3
 
3
4
  function useMutationObserver(onChange, options) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useEffect } from 'react';
2
3
 
3
4
  function useResizeObserver(resizeCallback) {
@@ -6,6 +6,7 @@ export interface RouteContext {
6
6
  }
7
7
  export interface RouteLinkElementProps extends React.HTMLProps<HTMLAnchorElement> {
8
8
  href: string;
9
+ onNavigate: () => void;
9
10
  route?: NavigateOptions;
10
11
  }
11
12
  export interface NavigateOptions {
@@ -0,0 +1,8 @@
1
+ import { NavigateOptions } from './types';
2
+ export declare function useRouteLink(): {
3
+ RouteLinkElement: React.ElementType<import("./types").RouteLinkElementProps> | undefined;
4
+ getRouteLinkProps: (href: string, route?: NavigateOptions) => {
5
+ href: string;
6
+ onNavigate: () => void;
7
+ };
8
+ };
@@ -0,0 +1,24 @@
1
+ import { useCallback } from 'react';
2
+ import { buildHref } from './route-utils.js';
3
+ import { useBasePath } from './use-base-path.js';
4
+ import { useOnNavigate } from './use-on-navigate.js';
5
+ import { useRouteLinkElement } from './use-route-link-element.js';
6
+
7
+ function useRouteLink() {
8
+ const basePath = useBasePath();
9
+ const RouteLinkElement = useRouteLinkElement();
10
+ const triggerCallbacks = useOnNavigate();
11
+ const getRouteLinkProps = useCallback((href, route) => {
12
+ href = buildHref({ basePath, href });
13
+ return {
14
+ href,
15
+ onNavigate: () => triggerCallbacks(href, route),
16
+ };
17
+ }, [basePath, triggerCallbacks]);
18
+ return {
19
+ RouteLinkElement,
20
+ getRouteLinkProps,
21
+ };
22
+ }
23
+
24
+ export { useRouteLink };
package/dist/styles.css CHANGED
@@ -3379,7 +3379,7 @@ html {
3379
3379
  }
3380
3380
 
3381
3381
  /**
3382
- * Swiper 11.2.5
3382
+ * Swiper 11.2.8
3383
3383
  * Most modern mobile touch slider and framework with hardware accelerated transitions
3384
3384
  * https://swiperjs.com
3385
3385
  *
@@ -3387,7 +3387,7 @@ html {
3387
3387
  *
3388
3388
  * Released under the MIT License
3389
3389
  *
3390
- * Released on: March 3, 2025
3390
+ * Released on: May 23, 2025
3391
3391
  */
3392
3392
 
3393
3393
  /* FONT_START */
@@ -3747,9 +3747,12 @@ html {
3747
3747
 
3748
3748
  .carousel-module-ealh- .carousel-module-bUMlb {
3749
3749
  display: grid;
3750
+ flex-grow: 0;
3750
3751
  block-size: auto;
3752
+ font-size: inherit;
3751
3753
  inline-size: -moz-fit-content;
3752
3754
  inline-size: fit-content;
3755
+ text-align: left;
3753
3756
  }
3754
3757
 
3755
3758
  /* stylelint-disable-next-line no-descending-specificity */
@@ -4759,7 +4762,7 @@ button.swiper-pagination-bullet {
4759
4762
  display: grid;
4760
4763
  gap: var(--space-32);
4761
4764
  grid-template-columns: repeat(auto-fit, 220px);
4762
- margin-block-end: 104px;
4765
+ margin-block-end: 48px;
4763
4766
  }
4764
4767
 
4765
4768
  .footer-module-YzJ68 .footer-module-TZq-4 {
@@ -5393,6 +5396,7 @@ button.swiper-pagination-bullet {
5393
5396
  .search-section-module-qaTiw .search-section-module-E--U2 .search-section-module-AHlDR {
5394
5397
  margin: 0;
5395
5398
  color: var(--color-brand-dark-gray);
5399
+ font-family: inherit;
5396
5400
  font-size: var(--font-size-16);
5397
5401
  font-weight: var(--font-weight-normal);
5398
5402
  line-height: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "170.0.0",
3
+ "version": "173.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -52,59 +52,59 @@
52
52
  "devDependencies": {
53
53
  "@chromatic-com/storybook": "^3.2.6",
54
54
  "@csstools/postcss-global-data": "3.0.0",
55
- "@eslint-react/eslint-plugin": "^1.35.0",
55
+ "@eslint-react/eslint-plugin": "^1.50.0",
56
56
  "@rollup/plugin-alias": "5.1.1",
57
57
  "@rollup/plugin-commonjs": "28.0.3",
58
58
  "@rollup/plugin-node-resolve": "16.0.1",
59
59
  "@rollup/plugin-replace": "6.0.2",
60
60
  "@rollup/plugin-typescript": "12.1.2",
61
- "@storybook/addon-docs": "^8.6.7",
62
- "@storybook/addon-essentials": "^8.6.7",
63
- "@storybook/addon-interactions": "^8.6.7",
64
- "@storybook/addon-links": "^8.6.7",
65
- "@storybook/addon-viewport": "^8.6.7",
66
- "@storybook/blocks": "^8.6.7",
67
- "@storybook/preview-api": "^8.6.7",
68
- "@storybook/react": "^8.6.7",
69
- "@storybook/react-vite": "^8.6.7",
70
- "@storybook/test": "^8.6.7",
61
+ "@storybook/addon-docs": "^8.6.14",
62
+ "@storybook/addon-essentials": "^8.6.14",
63
+ "@storybook/addon-interactions": "^8.6.14",
64
+ "@storybook/addon-links": "^8.6.14",
65
+ "@storybook/addon-viewport": "^8.6.14",
66
+ "@storybook/blocks": "^8.6.14",
67
+ "@storybook/preview-api": "^8.6.14",
68
+ "@storybook/react": "^8.6.14",
69
+ "@storybook/react-vite": "^8.6.14",
70
+ "@storybook/test": "^8.6.14",
71
71
  "@total-typescript/ts-reset": "^0.6.1",
72
72
  "@types/js-cookie": "3.0.6",
73
- "@types/node": "22.13.10",
73
+ "@types/node": "22.15.23",
74
74
  "@types/postcss-import": "14.0.3",
75
75
  "@types/react": "18.3.12",
76
76
  "@types/react-dom": "18.3.1",
77
- "@typescript-eslint/eslint-plugin": "8.26.1",
78
- "@typescript-eslint/parser": "8.26.1",
77
+ "@typescript-eslint/eslint-plugin": "8.33.0",
78
+ "@typescript-eslint/parser": "8.33.0",
79
79
  "@typescript/lib-dom": "npm:typescript-partial-lib-dom@^1.1.0",
80
- "@vitejs/plugin-react": "4.3.4",
80
+ "@vitejs/plugin-react": "4.5.0",
81
81
  "autoprefixer": "10.4.21",
82
82
  "concurrently": "9.1.2",
83
83
  "eslint": "8.57.0",
84
- "eslint-config-prettier": "10.1.1",
85
- "eslint-import-resolver-typescript": "3.9.1",
84
+ "eslint-config-prettier": "10.1.5",
85
+ "eslint-import-resolver-typescript": "3.10.1",
86
86
  "eslint-plugin-css-modules": "^2.12.0",
87
- "eslint-plugin-formatjs": "^5.2.14",
87
+ "eslint-plugin-formatjs": "^5.3.1",
88
88
  "eslint-plugin-import": "2.31.0",
89
89
  "eslint-plugin-jsx-a11y": "^6.10.2",
90
- "eslint-plugin-mdx": "3.2.0",
91
- "eslint-plugin-prettier": "5.2.3",
92
- "eslint-plugin-react": "7.37.4",
90
+ "eslint-plugin-mdx": "3.4.2",
91
+ "eslint-plugin-prettier": "5.4.0",
92
+ "eslint-plugin-react": "7.37.5",
93
93
  "eslint-plugin-react-hooks": "5.2.0",
94
94
  "eslint-plugin-simple-import-sort": "12.1.1",
95
95
  "eslint-plugin-sort-destructure-keys": "2.0.0",
96
96
  "eslint-plugin-sort-keys-fix": "1.1.2",
97
97
  "eslint-plugin-ssr-friendly": "^1.3.0",
98
- "eslint-plugin-storybook": "^0.11.6",
98
+ "eslint-plugin-storybook": "^0.12.0",
99
99
  "eslint-plugin-typescript-sort-keys": "3.3.0",
100
100
  "eslint-plugin-unicorn": "^56.0.1",
101
101
  "eslint-plugin-unused-imports": "4.1.4",
102
102
  "http-server": "14.1.1",
103
103
  "husky": "9.1.7",
104
- "instantsearch.js": "4.78.0",
105
- "nodemon": "3.1.9",
104
+ "instantsearch.js": "4.78.3",
105
+ "nodemon": "3.1.10",
106
106
  "postcss": "8.5.3",
107
- "postcss-custom-media": "11.0.5",
107
+ "postcss-custom-media": "11.0.6",
108
108
  "postcss-import": "16.1.0",
109
109
  "postcss-nested": "7.0.2",
110
110
  "prettier": "3.5.3",
@@ -112,44 +112,44 @@
112
112
  "react-dom": "18.3.1",
113
113
  "react-json-view": "1.21.3",
114
114
  "rimraf": "6.0.1",
115
- "rollup": "4.36.0",
115
+ "rollup": "4.41.1",
116
116
  "rollup-plugin-peer-deps-external": "2.2.4",
117
117
  "rollup-plugin-postcss": "4.0.2",
118
118
  "rollup-plugin-preserve-directives": "^0.4.0",
119
- "storybook": "^8.6.7",
120
- "stylelint": "16.16.0",
119
+ "storybook": "^8.6.14",
120
+ "stylelint": "16.19.1",
121
121
  "stylelint-config-css-modules": "4.4.0",
122
122
  "stylelint-config-idiomatic-order": "10.0.0",
123
123
  "stylelint-config-standard": "37.0.0",
124
- "typescript": "5.8.2",
125
- "typescript-eslint": "^8.26.1",
126
- "vite": "6.2.2",
124
+ "typescript": "5.8.3",
125
+ "typescript-eslint": "^8.33.0",
126
+ "vite": "6.3.5",
127
127
  "vite-tsconfig-paths": "5.1.4",
128
- "vitest": "3.0.9"
128
+ "vitest": "3.1.4"
129
129
  },
130
130
  "dependencies": {
131
131
  "@adyen/adyen-web": "5.32.0",
132
- "@algolia/autocomplete-core": "1.18.1",
133
- "@algolia/autocomplete-plugin-query-suggestions": "1.18.1",
134
- "@algolia/autocomplete-plugin-recent-searches": "1.18.1",
135
- "@algolia/autocomplete-preset-algolia": "1.18.1",
132
+ "@algolia/autocomplete-core": "1.19.2",
133
+ "@algolia/autocomplete-plugin-query-suggestions": "1.19.2",
134
+ "@algolia/autocomplete-plugin-recent-searches": "1.19.2",
135
+ "@algolia/autocomplete-preset-algolia": "1.19.2",
136
136
  "@algolia/client-search": "4.24.0",
137
- "@tanstack/react-query": "5.69.0",
138
- "@tanstack/react-query-devtools": "5.69.0",
137
+ "@tanstack/react-query": "5.77.2",
138
+ "@tanstack/react-query-devtools": "5.77.2",
139
139
  "@types/react-transition-group": "4.4.12",
140
140
  "algoliasearch": "4.24.0",
141
141
  "clsx": "2.1.1",
142
142
  "fast-equals": "5.2.2",
143
- "instantsearch.js": "4.78.0",
143
+ "instantsearch.js": "4.78.3",
144
144
  "js-cookie": "3.0.5",
145
- "query-string": "9.1.1",
146
- "react-aria": "3.38.1",
147
- "react-aria-components": "1.7.1",
148
- "react-instantsearch": "7.15.4",
145
+ "query-string": "9.2.0",
146
+ "react-aria": "3.40.0",
147
+ "react-aria-components": "1.9.0",
148
+ "react-instantsearch": "7.15.8",
149
149
  "react-toastify": "10.0.6",
150
150
  "react-transition-group": "4.4.5",
151
151
  "search-insights": "2.17.3",
152
- "swiper": "11.2.5"
152
+ "swiper": "11.2.8"
153
153
  },
154
154
  "publishConfig": {
155
155
  "access": "public"