@sonic-equipment/ui 182.0.0 → 184.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 (36) hide show
  1. package/dist/collapsables/cascading-component/use-cascading-component-container.js +1 -0
  2. package/dist/collapsables/cascading-component/use-cascading-component.js +1 -0
  3. package/dist/collapsables/cascading-component/use-has-cascading-component-container.js +1 -0
  4. package/dist/config.js +1 -1
  5. package/dist/header/connected-header.js +1 -1
  6. package/dist/header/header.d.ts +1 -3
  7. package/dist/header/header.js +2 -2
  8. package/dist/logging/use-log-error.js +1 -0
  9. package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js +2 -1
  10. package/dist/shared/api/shared/hooks/use-awaitable-mutation.js +1 -0
  11. package/dist/shared/ga/use-data-layer.js +1 -0
  12. package/dist/shared/hooks/use-breakpoint.js +1 -0
  13. package/dist/shared/hooks/use-cookie.js +1 -0
  14. package/dist/shared/hooks/use-css-link.js +1 -0
  15. package/dist/shared/hooks/use-disclosure.js +1 -0
  16. package/dist/shared/hooks/use-global-disclosure.js +1 -0
  17. package/dist/shared/hooks/use-is-breakpoint.js +1 -0
  18. package/dist/shared/hooks/use-is-scrolled-beyond-element.js +1 -0
  19. package/dist/shared/hooks/use-local-storage.js +1 -0
  20. package/dist/shared/hooks/use-script.js +1 -0
  21. package/dist/shared/hooks/use-scroll-lock.js +1 -0
  22. package/dist/shared/hooks/use-session-storage.js +1 -0
  23. package/dist/shared/hooks/use-watch-css-property.js +10 -1
  24. package/dist/shared/utils/local-storage.js +1 -2
  25. package/dist/styles.css +3 -1
  26. package/dist/table/data-table.js +1 -0
  27. package/dist/table/elements/table-context.js +1 -0
  28. package/dist/table/elements/table-provider.js +1 -0
  29. package/dist/table/elements/table-row-context.js +1 -0
  30. package/dist/table/elements/table-row-provider.js +1 -0
  31. package/dist/table/elements/table-sort-button.js +1 -0
  32. package/dist/table/elements/table.js +1 -0
  33. package/dist/table/elements/td.js +1 -0
  34. package/dist/table/elements/th.js +1 -0
  35. package/dist/table/elements/tr.js +1 -0
  36. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useContext } from 'react';
2
3
  import { CascadingComponentContainerContext } from './cascading-component-container-context.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCascadingComponentContainer } from './use-cascading-component-container.js';
2
3
 
3
4
  function useCascadingComponent() {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCascadingComponentContainer } from './use-cascading-component-container.js';
2
3
 
3
4
  function useHasCascadingComponentContainer() {
package/dist/config.js CHANGED
@@ -58,7 +58,7 @@ const configPerEnvironment = {
58
58
  ALGOLIA_HOST: 'shop.accept-sonic-equipment.com',
59
59
  BFF_API_URL: 'https://shop.accept-sonic-equipment.com/api/v1/bff',
60
60
  COOKIE_DOMAIN: '.accept-sonic-equipment.com',
61
- HOME_PAGE_URL: 'https://accept.sonic-equipment.com/',
61
+ HOME_PAGE_URL: 'https://accept-sonic-equipment.com/',
62
62
  SHOP_API_URL: 'https://shop.accept-sonic-equipment.com',
63
63
  }),
64
64
  'sandbox-reverse-proxy': () => ({
@@ -7,7 +7,7 @@ import { Header } from './header.js';
7
7
  function ConnectedHeader({ className, source, }) {
8
8
  const cultureCode = useCultureCode();
9
9
  const { data } = useFetchNavigationLinks({ cultureCode, source });
10
- return (jsx(Header, { className: className, links: data?.header ?? [], source: source, sticky: true }));
10
+ return (jsx(Header, { className: className, links: data?.header ?? [], sticky: true }));
11
11
  }
12
12
 
13
13
  export { ConnectedHeader };
@@ -1,9 +1,7 @@
1
1
  import { NavigationLink } from '../shared/api/bff/model/bff.model';
2
- import { NavigationLinkSource } from '../shared/api/bff/services/bff-service';
3
2
  export interface HeaderProps {
4
3
  className?: string;
5
4
  links: NavigationLink[];
6
- source: NavigationLinkSource;
7
5
  sticky?: boolean;
8
6
  }
9
- export declare function Header({ className, links, source, sticky }: HeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Header({ className, links, sticky }: HeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -23,7 +23,7 @@ import { NavigationLinkList } from './link-list/navigation-link-list.js';
23
23
  import { SonicLogo } from './sonic-logo/sonic-logo.js';
24
24
  import styles from './header.module.css.js';
25
25
 
26
- function Header({ className, links, source, sticky }) {
26
+ function Header({ className, links, sticky }) {
27
27
  const [activeSubmenu, setActiveSubmenu] = useState();
28
28
  const t = useFormattedMessage();
29
29
  const isXl = useIsBreakpoint('xl');
@@ -66,7 +66,7 @@ function Header({ className, links, source, sticky }) {
66
66
  if (activeSubmenu)
67
67
  setDesktopNavigationOpen(true);
68
68
  }, [activeSubmenu, setDesktopNavigationOpen]);
69
- return (jsxs(Fragment, { children: [jsx("header", { ref: headerRef, className: clsx(styles['header'], sticky && styles['sticky'], className), "data-test-selector": "pageHeader", children: jsx(HeaderLayout, { hamburgerButton: jsx(HamburgerButton, { "aria-controls": "mobile-navigation", "data-test-selector": "pageHeaderHamburgerButton", isActive: mobileNavigationOpen, onActiveChange: toggleMobileNavigation }), hasDrawersOpen: hasDrawersOpen, logo: jsx(SonicLogo, { "data-test-selector": "pageHeaderLogo", href: source === 'shop' ? config.HOME_PAGE_URL : '/', title: t('Home') }), mainNavigation: jsx(NavigationLinkList, { activeLink: activeSubmenu, "data-test-selector": "pageHeaderMainNavigation", links: links, onSubmenuToggle: link => toggleActiveSubmenu(link) }), navigationActions: jsxs(Fragment, { children: [jsx(ConnectedAccountButton, { "data-test-selector": "pageHeaderAccountButton", href: PATHS.ACCOUNT }), jsx(ConnectedFavoritesButton, { "data-test-selector": "pageHeaderFavoritesButton", href: PATHS.FAVORITES }), jsx(ConnectedCartButton, { "data-test-selector": "pageHeaderCartButton", href: PATHS.CART })] }), search: jsx(SearchButton, { "aria-controls": "global-search", "data-test-selector": "pageHeaderSearchButton", isActive: searchOpen, onActiveChange: toggleSearch }) }) }), jsx(SearchDrawer, { groupId: searchGroupId, instanceId: searchInstanceId }), !isXl && (jsx(MobileNavigationDrawer, { groupId: mobileNavigationDrawer.groupId, instanceId: mobileNavigationDrawer.instanceId, links: links })), isXl && (jsx(DesktopNavigationDrawer, { groupId: desktopNavigationDrawer.groupId, instanceId: desktopNavigationDrawer.instanceId, onClosed: () => setActiveSubmenu(undefined), submenu: activeSubmenu }))] }));
69
+ return (jsxs(Fragment, { children: [jsx("header", { ref: headerRef, className: clsx(styles['header'], sticky && styles['sticky'], className), "data-test-selector": "pageHeader", children: jsx(HeaderLayout, { hamburgerButton: jsx(HamburgerButton, { "aria-controls": "mobile-navigation", "data-test-selector": "pageHeaderHamburgerButton", isActive: mobileNavigationOpen, onActiveChange: toggleMobileNavigation }), hasDrawersOpen: hasDrawersOpen, logo: jsx(SonicLogo, { "data-test-selector": "pageHeaderLogo", href: config.HOME_PAGE_URL, title: t('Home') }), mainNavigation: jsx(NavigationLinkList, { activeLink: activeSubmenu, "data-test-selector": "pageHeaderMainNavigation", links: links, onSubmenuToggle: link => toggleActiveSubmenu(link) }), navigationActions: jsxs(Fragment, { children: [jsx(ConnectedAccountButton, { "data-test-selector": "pageHeaderAccountButton", href: PATHS.ACCOUNT }), jsx(ConnectedFavoritesButton, { "data-test-selector": "pageHeaderFavoritesButton", href: PATHS.FAVORITES }), jsx(ConnectedCartButton, { "data-test-selector": "pageHeaderCartButton", href: PATHS.CART })] }), search: jsx(SearchButton, { "aria-controls": "global-search", "data-test-selector": "pageHeaderSearchButton", isActive: searchOpen, onActiveChange: toggleSearch }) }) }), jsx(SearchDrawer, { groupId: searchGroupId, instanceId: searchInstanceId }), !isXl && (jsx(MobileNavigationDrawer, { groupId: mobileNavigationDrawer.groupId, instanceId: mobileNavigationDrawer.instanceId, links: links })), isXl && (jsx(DesktopNavigationDrawer, { groupId: desktopNavigationDrawer.groupId, instanceId: desktopNavigationDrawer.instanceId, onClosed: () => setActiveSubmenu(undefined), submenu: activeSubmenu }))] }));
70
70
  }
71
71
 
72
72
  export { Header };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useEffect } from 'react';
2
3
  import { logger } from './logger.js';
3
4
 
@@ -13,6 +13,7 @@ function CheckoutPageLayout({ actions, children, mobileSummary, overview, }) {
13
13
  const topRef = useRef(null);
14
14
  const bottomRef = useRef(null);
15
15
  const headerHeight = useWatchCssProperty('--header-bottom');
16
+ const isObservingIntersection = Boolean(headerHeight);
16
17
  const isScrolledBeyond = useIsScrolledBeyondElement(bottomRef.current || undefined);
17
18
  const observables = useMemo(() => [
18
19
  {
@@ -27,7 +28,7 @@ function CheckoutPageLayout({ actions, children, mobileSummary, overview, }) {
27
28
  isDisabled: isXXL,
28
29
  observables,
29
30
  });
30
- return (jsxs("div", { className: styles['checkout-page-layout'], children: [!isXXL && (jsxs(Fragment, { children: [mobileSummary, jsx("div", { ref: topRef }), jsxs("div", { className: clsx(styles['top-actions'], styles.actions), children: [actions?.primary, actions?.secondary] }), !isIntersecting && !isScrolledBeyond && (jsxs("div", { className: clsx(styles['top-actions-sticky'], styles.actions), children: [actions?.primary, actions?.secondary] }))] })), jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.main, children: children }), jsx("div", { className: styles.side, children: jsxs("div", { className: styles['sticky-side'], children: [overview, jsxs("div", { ref: bottomRef, className: styles.actions, children: [actions?.primary, actions?.secondary] })] }) })] })] }));
31
+ return (jsxs("div", { className: styles['checkout-page-layout'], children: [!isXXL && (jsxs(Fragment, { children: [mobileSummary, jsx("div", { ref: topRef }), jsxs("div", { className: clsx(styles['top-actions'], styles.actions), children: [actions?.primary, actions?.secondary] }), isObservingIntersection && !isIntersecting && !isScrolledBeyond && (jsxs("div", { className: clsx(styles['top-actions-sticky'], styles.actions), children: [actions?.primary, actions?.secondary] }))] })), jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.main, children: children }), jsx("div", { className: styles.side, children: jsxs("div", { className: styles['sticky-side'], children: [overview, jsxs("div", { ref: bottomRef, className: styles.actions, children: [actions?.primary, actions?.secondary] })] }) })] })] }));
31
32
  }
32
33
 
33
34
  export { CheckoutPageLayout };
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState, useCallback } from 'react';
2
3
  import { useQueryClient } from '@tanstack/react-query';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback, useEffect } from 'react';
2
3
  import { getCurrencyCodeBySymbol } from '../model/currency.js';
3
4
  import { dataLayer } from './data-layer.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState, useCallback, useEffect } from 'react';
2
3
  import { getCurrentBreakpoints } from '../utils/breakpoints.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState } from 'react';
2
3
  import Cookies from 'js-cookie';
3
4
  import { config } from '../../config.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useEffect } from 'react';
2
3
 
3
4
  const loadedCSS = {};
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState, useCallback } from 'react';
2
3
 
3
4
  const useDisclosure = (initialState = false) => {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback } from 'react';
2
3
  import { useGlobalState } from '../providers/global-state-provider.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useCallback, useState, useEffect } from 'react';
2
3
  import { getCurrentBreakpoints } from '../utils/breakpoints.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState, useEffect } from 'react';
2
3
 
3
4
  function getElementYPosition(element) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState } from 'react';
2
3
 
3
4
  function useLocalStorage(key, initialState) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useEffect } from 'react';
2
3
 
3
4
  const loadedScripts = {};
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useEffect } from 'react';
2
3
 
3
4
  const useScrollLock = (lock) => {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useState } from 'react';
2
3
 
3
4
  function useSessionStorage(key, initialState) {
@@ -1,8 +1,17 @@
1
+ "use client";
1
2
  import { useState, useEffect } from 'react';
2
3
  import { getCssPropertyValue } from '../utils/css.js';
3
4
 
4
5
  function useWatchCssProperty(property) {
5
- const [value, setValue] = useState(() => getCssPropertyValue(property));
6
+ const [value, setValue] = useState(() => {
7
+ try {
8
+ return getCssPropertyValue(property);
9
+ }
10
+ catch {
11
+ // If the property can not be retrieved, return undefined
12
+ return;
13
+ }
14
+ });
6
15
  useEffect(() => {
7
16
  if (typeof MutationObserver === 'undefined' ||
8
17
  typeof document === 'undefined')
@@ -1,7 +1,6 @@
1
+ "use client";
1
2
  import { voidFunction } from '../model/defaults.js';
2
3
 
3
- /* eslint-disable import/no-unused-modules */
4
- /* eslint-disable no-prototype-builtins */
5
4
  /** Mocks the localStorage and sessionStorage API in Node.js
6
5
  * @see https://gitlab.com/kaictl/node/mock-local-storage */
7
6
  const HAS_LOCAL_STORAGE_SUPPORT = typeof localStorage !== 'undefined';
package/dist/styles.css CHANGED
@@ -6331,7 +6331,9 @@ button.swiper-pagination-bullet {
6331
6331
  }
6332
6332
 
6333
6333
  :root {
6334
- --header-bottom: calc(var(--announcements-height) + var(--header-height));
6334
+ --header-bottom: calc(
6335
+ var(--announcements-height, 0px) + var(--header-height, 0px)
6336
+ );
6335
6337
  }
6336
6338
 
6337
6339
  .header-layout-module-uGT3X {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useMemo } from 'react';
3
4
  import { DataCard } from '../cards/data-card/data-card.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { createContext } from 'react';
2
3
  import { voidFunction } from '../../shared/model/defaults.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useRef, useMemo } from 'react';
3
4
  import { TableContext } from './table-context.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { createContext } from 'react';
2
3
  import { voidFunction } from '../../shared/model/defaults.js';
3
4
 
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import { useState, useEffect, useMemo } from 'react';
3
4
  import { TableRowContext } from './table-row-context.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 { GlyphsChevronsBoldUpIcon } from '../../icons/glyph/glyphs-chevrons-bold-up-icon.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx, jsxs } from 'react/jsx-runtime';
2
3
  import { useRef, useState, useCallback } from 'react';
3
4
  import clsx from 'clsx';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { Truncated } from '../../text/truncated/truncated.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { Truncated } from '../../text/truncated/truncated.js';
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx } from 'react/jsx-runtime';
2
3
  import clsx from 'clsx';
3
4
  import { TableRowProvider } from './table-row-provider.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "182.0.0",
3
+ "version": "184.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {