@sonic-equipment/ui 164.0.0 → 165.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 (61) hide show
  1. package/dist/algolia/algolia-categories-filters.js +9 -7
  2. package/dist/background-overlay/background-overlay-manager.d.ts +178 -0
  3. package/dist/background-overlay/background-overlay-manager.js +291 -0
  4. package/dist/background-overlay/background-overlay.d.ts +12 -2
  5. package/dist/background-overlay/background-overlay.js +28 -27
  6. package/dist/badges/badge/badge.d.ts +2 -1
  7. package/dist/badges/badge/badge.js +2 -2
  8. package/dist/badges/badge/icon-with-badge/icon-with-badge.d.ts +2 -1
  9. package/dist/badges/badge/icon-with-badge/icon-with-badge.js +2 -2
  10. package/dist/cards/orderline-card/orderline-card.js +5 -1
  11. package/dist/cards/product-card/product-card.js +5 -1
  12. package/dist/collapsables/cascading-component/cascading-component.d.ts +6 -2
  13. package/dist/collapsables/cascading-component/cascading-component.js +5 -5
  14. package/dist/collapsables/unmounter/unmounter.js +2 -2
  15. package/dist/drawer/drawer.d.ts +26 -0
  16. package/dist/drawer/drawer.js +37 -0
  17. package/dist/drawer/drawer.module.css.js +3 -0
  18. package/dist/drawer/use-drawer.d.ts +17 -0
  19. package/dist/drawer/use-drawer.js +71 -0
  20. package/dist/exports.d.ts +12 -0
  21. package/dist/global-search/global-search-provider/global-search-provider.js +1 -2
  22. package/dist/global-search/global-search.module.css.js +1 -1
  23. package/dist/header/cart-icon/connected-cart-icon.js +4 -4
  24. package/dist/icons/solid/solid-login-icon.js +7 -0
  25. package/dist/index.js +12 -0
  26. package/dist/intl/translation-id.d.ts +1 -1
  27. package/dist/layout/center.d.ts +5 -0
  28. package/dist/layout/center.js +9 -0
  29. package/dist/layout/center.module.css.js +3 -0
  30. package/dist/lists/menu-list/menu-list.d.ts +4 -2
  31. package/dist/lists/menu-list/menu-list.js +2 -2
  32. package/dist/lists/menu-list/menu-list.module.css.js +1 -1
  33. package/dist/lists/orderline-list/orderline-list.js +1 -2
  34. package/dist/navigation/account-icon/account-icon.d.ts +5 -0
  35. package/dist/navigation/account-icon/account-icon.js +12 -0
  36. package/dist/navigation/cart-icon/cart-icon.d.ts +5 -0
  37. package/dist/navigation/cart-icon/cart-icon.js +12 -0
  38. package/dist/navigation/favorite-icon/favorite-icon.d.ts +5 -0
  39. package/dist/navigation/favorite-icon/favorite-icon.js +12 -0
  40. package/dist/navigation/mobile-navigation/mobile-navigation.d.ts +5 -0
  41. package/dist/navigation/mobile-navigation/mobile-navigation.js +20 -0
  42. package/dist/navigation/panel-navigation/panel-navigation.d.ts +28 -0
  43. package/dist/navigation/panel-navigation/panel-navigation.js +69 -0
  44. package/dist/navigation/panel-navigation/panel-navigation.module.css.js +3 -0
  45. package/dist/pages/paths.d.ts +1 -0
  46. package/dist/pages/paths.js +1 -0
  47. package/dist/shared/hooks/use-global-disclosure.d.ts +10 -0
  48. package/dist/shared/hooks/use-global-disclosure.js +25 -0
  49. package/dist/shared/hooks/use-watch-css-property.d.ts +1 -1
  50. package/dist/shared/hooks/use-watch-css-property.js +2 -3
  51. package/dist/shared/model/category.d.ts +5 -0
  52. package/dist/shared/model/category.js +7 -1
  53. package/dist/shared/model/price.d.ts +2 -2
  54. package/dist/shared/utils/css.d.ts +1 -0
  55. package/dist/shared/utils/css.js +13 -0
  56. package/dist/shared/utils/refs.d.ts +2 -0
  57. package/dist/shared/utils/refs.js +14 -0
  58. package/dist/sidebar/sidebar-provider.js +1 -1
  59. package/dist/styles.css +264 -64
  60. package/package.json +1 -1
  61. package/dist/background-overlay/background-overlay.module.css.js +0 -3
@@ -4,12 +4,16 @@ import { Tag } from '../../badges/tag/tag.js';
4
4
  import { Price } from '../../display/price/price.js';
5
5
  import { ProductSku } from '../../display/product-sku/product-sku.js';
6
6
  import { FormattedMessage } from '../../intl/formatted-message.js';
7
+ import { logger } from '../../logging/logger.js';
7
8
  import { Image } from '../../media/image/image.js';
8
9
  import { RouteLink } from '../../shared/routing/route-link.js';
9
10
  import styles from './product-card.module.css.js';
10
11
 
11
12
  function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }) {
12
- return (jsx("div", { className: styles['product-card-container'], children: jsxs("article", { "aria-labelledby": `title-${id}`, className: styles['product-card'], "data-product-id": sku, id: id, children: [jsx(RouteLink, { className: styles.title, href: href, id: `title-${id}`, onClick: onClick, children: title }), tags && tags.length > 0 && (jsx("div", { className: styles.tags, children: tags.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) })), jsx(ProductSku, { className: styles.sku, sku: sku }), jsx(Price, { className: styles.price, currencyCode: price.currencyCode, isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price, variant: "sonic" }), jsx("div", { className: styles['image-container'], children: jsx(Image, { ...image, fit: "contain" }) }), jsx("div", { className: styles['add-to-cart-button'], children: AddToCartButton }), jsx("div", { className: styles['favorite-button'], children: FavoriteButton && FavoriteButton })] }) }));
13
+ if (!price.currencyCode) {
14
+ logger.error(`Product '${sku}' does not have a currency code`);
15
+ }
16
+ return (jsx("div", { className: styles['product-card-container'], children: jsxs("article", { "aria-labelledby": `title-${id}`, className: styles['product-card'], "data-product-id": sku, id: id, children: [jsx(RouteLink, { className: styles.title, href: href, id: `title-${id}`, onClick: onClick, children: title }), tags && tags.length > 0 && (jsx("div", { className: styles.tags, children: tags.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) })), jsx(ProductSku, { className: styles.sku, sku: sku }), price.currencyCode && (jsx(Price, { className: styles.price, currencyCode: price.currencyCode, isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price, variant: "sonic" })), jsx("div", { className: styles['image-container'], children: jsx(Image, { ...image, fit: "contain" }) }), jsx("div", { className: styles['add-to-cart-button'], children: AddToCartButton }), jsx("div", { className: styles['favorite-button'], children: FavoriteButton && FavoriteButton })] }) }));
13
17
  }
14
18
 
15
19
  export { ProductCard };
@@ -5,9 +5,13 @@ interface CascadingComponentProps<TElement extends HTMLElement = HTMLElement, Re
5
5
  children: React.ReactNode;
6
6
  isVisible?: boolean;
7
7
  nodeRef: React.Ref<RefElement>;
8
+ onEnter?: VoidFunction;
9
+ onEntered?: VoidFunction;
10
+ onExit?: VoidFunction;
11
+ onExited?: VoidFunction;
8
12
  onUnmounted?: () => void;
9
13
  timeout?: number;
10
14
  }
11
- export declare function CascadingComponent<TElement extends HTMLElement = HTMLElement, RefElement extends RefHTMLElement<TElement> = undefined>({ children, isVisible, nodeRef, onClose, onUnmounted, timeout, }: CascadingComponentProps<TElement, RefElement> & CascadingComponentContainerProps): import("react/jsx-runtime").JSX.Element;
12
- export declare function InternalCascadingComponent<TElement extends HTMLElement = HTMLElement, RefElement extends RefHTMLElement<TElement> = undefined>({ children, isVisible: _isVisible, nodeRef, onUnmounted, timeout: timeout, }: CascadingComponentProps<TElement, RefElement>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CascadingComponent<TElement extends HTMLElement = HTMLElement, RefElement extends RefHTMLElement<TElement> = undefined>({ children, isVisible, nodeRef, onClose, onEnter, onEntered, onExit, onExited, onUnmounted, timeout, }: CascadingComponentProps<TElement, RefElement> & CascadingComponentContainerProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function InternalCascadingComponent<TElement extends HTMLElement = HTMLElement, RefElement extends RefHTMLElement<TElement> = undefined>({ children, isVisible: _isVisible, nodeRef, onEnter, onEntered, onExit, onExited, onUnmounted, timeout: timeout, }: CascadingComponentProps<TElement, RefElement>): import("react/jsx-runtime").JSX.Element;
13
17
  export {};
@@ -6,14 +6,14 @@ import { createAddEndListener } from '../unmounter/utils.js';
6
6
  import { CascadingComponentContainerProvider } from './cascading-component-container-provider.js';
7
7
  import { useCascadingComponentContainer } from './use-cascading-component-container.js';
8
8
 
9
- function CascadingComponent({ children, isVisible = false, nodeRef, onClose, onUnmounted, timeout, }) {
9
+ function CascadingComponent({ children, isVisible = false, nodeRef, onClose, onEnter, onEntered, onExit, onExited, onUnmounted, timeout, }) {
10
10
  const context = useCascadingComponentContainer();
11
11
  if (!context) {
12
- return (jsx(Fragment, { children: jsx(CascadingComponentContainerProvider, { onClose: onClose, timeout: timeout, children: jsx(InternalCascadingComponent, { isVisible: isVisible, nodeRef: nodeRef, onUnmounted: onUnmounted, timeout: timeout, children: children }) }) }));
12
+ return (jsx(Fragment, { children: jsx(CascadingComponentContainerProvider, { onClose: onClose, timeout: timeout, children: jsx(InternalCascadingComponent, { isVisible: isVisible, nodeRef: nodeRef, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, onUnmounted: onUnmounted, timeout: timeout, children: children }) }) }));
13
13
  }
14
- return (jsx(InternalCascadingComponent, { isVisible: isVisible, nodeRef: nodeRef, onUnmounted: onUnmounted, timeout: timeout || context.timeout, children: children }));
14
+ return (jsx(InternalCascadingComponent, { isVisible: isVisible, nodeRef: nodeRef, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, onUnmounted: onUnmounted, timeout: timeout || context.timeout, children: children }));
15
15
  }
16
- function InternalCascadingComponent({ children, isVisible: _isVisible = false, nodeRef, onUnmounted, timeout: timeout, }) {
16
+ function InternalCascadingComponent({ children, isVisible: _isVisible = false, nodeRef, onEnter, onEntered, onExit, onExited, onUnmounted, timeout: timeout, }) {
17
17
  const [isVisible, setIsVisible] = useState(_isVisible);
18
18
  const [unmount, setUnmount] = useState(false);
19
19
  useEffect(() => {
@@ -36,7 +36,7 @@ function InternalCascadingComponent({ children, isVisible: _isVisible = false, n
36
36
  const onClose = useCallback(() => {
37
37
  setUnmount(true);
38
38
  }, []);
39
- return (jsx(CSSTransition, { mountOnEnter: true, unmountOnExit: true, ...(timeout === undefined
39
+ return (jsx(CSSTransition, { mountOnEnter: true, unmountOnExit: true, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, ...(timeout === undefined
40
40
  ? { addEndListener: createAddEndListener(nodeRef) }
41
41
  : { timeout }), in: isVisible, nodeRef: nodeRef, children: jsx(Unmounter, { onUnmounted: onUnmounted, onUnmountReady: onUnmountReady, unmount: unmount, children: jsx(CascadingComponentContainerProvider, { onClose: onClose, timeout: timeout, children: children }) }) }));
42
42
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { createContext, useContext, useState, useEffect, useMemo } from 'react';
2
+ import { createContext, useState, useEffect, useMemo, useContext } from 'react';
3
3
 
4
4
  const UnmounterContext = createContext(null);
5
5
  function useUnmount() {
@@ -12,7 +12,7 @@ function Unmounter({ children: children, onUnmounted, onUnmountReady, unmount: _
12
12
  const [childCount, updateChildCount] = useState(0);
13
13
  const unmount = Boolean(_unmount || parentContext?.unmount);
14
14
  useEffect(() => {
15
- return () => onUnmounted?.();
15
+ return onUnmounted;
16
16
  }, [onUnmounted]);
17
17
  useEffect(() => {
18
18
  if (!parentContext)
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ChildrenFunctionArgs {
3
+ close: VoidFunction;
4
+ groupId?: string;
5
+ instanceId: string;
6
+ isClosed: boolean;
7
+ isOpen: boolean;
8
+ open: VoidFunction;
9
+ setIsOpen: (isOpen: boolean) => void;
10
+ toggle: VoidFunction;
11
+ }
12
+ export interface DrawerProps {
13
+ allowCloseOnBackgroundClick?: boolean;
14
+ children: ReactNode | ((args: ChildrenFunctionArgs) => ReactNode);
15
+ className?: string;
16
+ groupId?: string;
17
+ instanceId?: string;
18
+ isInitialOpen?: boolean;
19
+ isOpen?: boolean;
20
+ onClose?: VoidFunction;
21
+ position: 'top' | 'bottom' | 'left' | 'right';
22
+ showBackgroundOverlay?: boolean;
23
+ showUnderHeader?: boolean;
24
+ timeout?: number;
25
+ }
26
+ export declare function Drawer({ allowCloseOnBackgroundClick, children, className, groupId, instanceId, isInitialOpen, isOpen: isOpenControlled, onClose, position, showBackgroundOverlay, showUnderHeader, timeout, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { useRef, useEffect } from 'react';
3
+ import { CSSTransition } from 'react-transition-group';
4
+ import clsx from 'clsx';
5
+ import { BackgroundOverlay } from '../background-overlay/background-overlay.js';
6
+ import { createAddEndListener } from '../collapsables/unmounter/utils.js';
7
+ import { useDrawer } from './use-drawer.js';
8
+ import styles from './drawer.module.css.js';
9
+
10
+ function Drawer({ allowCloseOnBackgroundClick, children, className, groupId, instanceId, isInitialOpen = false, isOpen: isOpenControlled, onClose, position, showBackgroundOverlay, showUnderHeader = false, timeout, }) {
11
+ const wasOpenRef = useRef(isInitialOpen);
12
+ const asideRef = useRef(null);
13
+ const useDrawerResult = useDrawer({
14
+ groupId,
15
+ instanceId,
16
+ isInitialOpen,
17
+ isOpen: isOpenControlled,
18
+ });
19
+ const { close, isControlled, isOpen } = useDrawerResult;
20
+ useEffect(() => {
21
+ if (wasOpenRef.current && !isOpen)
22
+ onClose?.();
23
+ wasOpenRef.current = isOpen;
24
+ }, [instanceId, isOpen, onClose]);
25
+ return (jsxs(Fragment, { children: [jsx(CSSTransition, { mountOnEnter: true, unmountOnExit: true, addEndListener: createAddEndListener(asideRef), in: isOpen, nodeRef: asideRef, timeout: timeout, children: jsx("aside", { ref: asideRef, className: clsx(styles.drawer, styles[position], showUnderHeader && styles['under-header'], className), children: children instanceof Function ? children(useDrawerResult) : children }, `${groupId}-${instanceId}`) }, groupId), showBackgroundOverlay && (jsx(BackgroundOverlay, { isOpen: isOpen, onClick: () => {
26
+ if (!allowCloseOnBackgroundClick)
27
+ return;
28
+ if (isControlled) {
29
+ onClose?.();
30
+ }
31
+ else {
32
+ close();
33
+ }
34
+ }, position: showUnderHeader ? 'behind-header' : 'in-front' }))] }));
35
+ }
36
+
37
+ export { Drawer };
@@ -0,0 +1,3 @@
1
+ var styles = {"drawer":"drawer-module-5ARuA","left":"drawer-module-yjFdX","right":"drawer-module-bZLBV","top":"drawer-module-KiviE","bottom":"drawer-module-p-PYu","under-header":"drawer-module-0jRBQ"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,17 @@
1
+ export interface UseDrawerReturnType {
2
+ close: VoidFunction;
3
+ groupId?: string;
4
+ instanceId: string;
5
+ isClosed: boolean;
6
+ isControlled: boolean;
7
+ isOpen: boolean;
8
+ open: VoidFunction;
9
+ setIsOpen: (isOpen: boolean) => void;
10
+ toggle: VoidFunction;
11
+ }
12
+ export declare function useDrawer({ groupId: _groupId, instanceId: _instanceId, isInitialOpen, isOpen: isOpenControlled, }?: {
13
+ groupId?: string;
14
+ instanceId?: string;
15
+ isInitialOpen?: boolean;
16
+ isOpen?: boolean;
17
+ }): UseDrawerReturnType;
@@ -0,0 +1,71 @@
1
+ import { useRef, useEffect, useCallback, useMemo } from 'react';
2
+ import { useGlobalState } from '../shared/providers/global-state-provider.js';
3
+ import { createUUID } from '../shared/utils/uuid.js';
4
+
5
+ function useDrawer({ groupId: _groupId, instanceId: _instanceId, isInitialOpen, isOpen: isOpenControlled, } = {}) {
6
+ const groupIdRef = useRef(_groupId);
7
+ const groupId = groupIdRef.current;
8
+ const instanceIdRef = useRef(_instanceId || createUUID());
9
+ const instanceId = instanceIdRef.current;
10
+ const isControlled = isOpenControlled !== undefined;
11
+ const [openInstanceId, setOpenInstanceId] = useGlobalState(`drawer-${groupId || instanceId}`);
12
+ useEffect(() => {
13
+ if (isInitialOpen || isOpen)
14
+ setOpenInstanceId(instanceId);
15
+ return () => {
16
+ if (isOpen) {
17
+ setOpenInstanceId(undefined);
18
+ }
19
+ };
20
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
+ }, []);
22
+ useEffect(() => {
23
+ if (isOpenControlled) {
24
+ setOpenInstanceId(instanceId);
25
+ }
26
+ else if (openInstanceId === instanceId) {
27
+ setOpenInstanceId(undefined);
28
+ }
29
+ // eslint-disable-next-line react-hooks/exhaustive-deps
30
+ }, [isOpenControlled]);
31
+ const open = useCallback(() => {
32
+ if (isControlled)
33
+ return;
34
+ setOpenInstanceId(instanceId);
35
+ }, [setOpenInstanceId, instanceId, isControlled]);
36
+ const close = useCallback(() => {
37
+ if (isControlled)
38
+ return;
39
+ setOpenInstanceId(undefined);
40
+ }, [setOpenInstanceId, isControlled]);
41
+ const toggle = useCallback(() => {
42
+ if (openInstanceId === instanceId) {
43
+ close();
44
+ }
45
+ else {
46
+ open();
47
+ }
48
+ }, [close, instanceId, open, openInstanceId]);
49
+ const setIsOpen = useCallback((isOpen) => {
50
+ if (isOpen) {
51
+ open();
52
+ }
53
+ else {
54
+ close();
55
+ }
56
+ }, [close, open]);
57
+ const isOpen = useMemo(() => (isControlled ? isOpenControlled : openInstanceId === instanceId), [isControlled, isOpenControlled, openInstanceId, instanceId]);
58
+ return {
59
+ close,
60
+ groupId,
61
+ instanceId,
62
+ isClosed: !isOpen,
63
+ isControlled,
64
+ isOpen,
65
+ open,
66
+ setIsOpen,
67
+ toggle,
68
+ };
69
+ }
70
+
71
+ export { useDrawer };
package/dist/exports.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from './algolia/use-algolia-insights-provider-global-state';
27
27
  export * from './algolia/use-algolia-instant-search-state';
28
28
  export * from './algolia/use-algolia-search';
29
29
  export * from './background-overlay/background-overlay';
30
+ export * from './background-overlay/background-overlay-manager';
30
31
  export * from './badges/badge/badge';
31
32
  export * from './badges/badge/icon-with-badge/icon-with-badge';
32
33
  export * from './badges/tag/tag';
@@ -80,6 +81,8 @@ export * from './delivery-time/delivery-time';
80
81
  export * from './display/info-display/info-display';
81
82
  export * from './display/price/price';
82
83
  export * from './display/product-sku/product-sku';
84
+ export * from './drawer/drawer';
85
+ export * from './drawer/use-drawer';
83
86
  export * from './filters/active-filters/active-filters';
84
87
  export * from './filters/multi-select/multi-select';
85
88
  export * from './filters/pagination/pagination';
@@ -146,6 +149,7 @@ export * from './intl/use-formatted-message';
146
149
  export * from './intl/use-intl';
147
150
  export * from './intl/use-language-code';
148
151
  export * from './intl/utils';
152
+ export * from './layout/center';
149
153
  export * from './lists/download-document-list/download-document-list';
150
154
  export * from './lists/feature-list/feature-list';
151
155
  export * from './lists/icon-list/icon-list';
@@ -171,6 +175,11 @@ export * from './modals/favorite/add-to-favorite-dialog';
171
175
  export * from './modals/modal/modal';
172
176
  export * from './modals/recover-password/recover-password-dialog';
173
177
  export * from './modals/signin/sign-in-dialog';
178
+ export * from './navigation/account-icon/account-icon';
179
+ export * from './navigation/cart-icon/cart-icon';
180
+ export * from './navigation/favorite-icon/favorite-icon';
181
+ export * from './navigation/mobile-navigation/mobile-navigation';
182
+ export * from './navigation/panel-navigation/panel-navigation';
174
183
  export * from './notifications/announcements/announcement';
175
184
  export * from './notifications/announcements/announcement-provider';
176
185
  export * from './notifications/announcements/connected-announcement';
@@ -305,6 +314,7 @@ export * from './shared/hooks/use-css-link';
305
314
  export * from './shared/hooks/use-debounced-callback';
306
315
  export * from './shared/hooks/use-disclosure';
307
316
  export * from './shared/hooks/use-enable-mobile-zoom';
317
+ export * from './shared/hooks/use-global-disclosure';
308
318
  export * from './shared/hooks/use-intersection-observer';
309
319
  export * from './shared/hooks/use-is-breakpoint';
310
320
  export * from './shared/hooks/use-is-scrolled-beyond-element';
@@ -340,6 +350,7 @@ export * from './shared/routing/use-on-navigate';
340
350
  export * from './shared/routing/with-routing';
341
351
  export * from './shared/utils/array';
342
352
  export * from './shared/utils/breakpoints';
353
+ export * from './shared/utils/css';
343
354
  export * from './shared/utils/date';
344
355
  export * from './shared/utils/debug';
345
356
  export * from './shared/utils/environment';
@@ -349,6 +360,7 @@ export * from './shared/utils/number';
349
360
  export * from './shared/utils/price';
350
361
  export * from './shared/utils/promise';
351
362
  export * from './shared/utils/random';
363
+ export * from './shared/utils/refs';
352
364
  export * from './shared/utils/string';
353
365
  export * from './shared/utils/time';
354
366
  export * from './shared/utils/types';
@@ -4,13 +4,12 @@ import { createContext, useMemo } from 'react';
4
4
  import { AlgoliaSearchProvider } from '../../algolia/algolia-search-provider.js';
5
5
  import { BackgroundOverlay } from '../../background-overlay/background-overlay.js';
6
6
  import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
7
- import styles from '../global-search.module.css.js';
8
7
 
9
8
  const GlobalSearchDisclosureContext = createContext(null);
10
9
  function GlobalSearchProvider({ children, searchClient, }) {
11
10
  const { close, isOpen, open, toggle } = useDisclosure(false);
12
11
  const value = useMemo(() => ({ close, isOpen, open, toggle }), [close, isOpen, open, toggle]);
13
- return (jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs(GlobalSearchDisclosureContext.Provider, { value: value, children: [children, jsx(BackgroundOverlay, { className: styles['global-search-background-overlay-position'], isOpen: isOpen, onClose: close })] }) }));
12
+ return (jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs(GlobalSearchDisclosureContext.Provider, { value: value, children: [children, jsx(BackgroundOverlay, { isOpen: isOpen, onClick: close, position: "behind-header" })] }) }));
14
13
  }
15
14
 
16
15
  export { GlobalSearchDisclosureContext, GlobalSearchProvider };
@@ -1,3 +1,3 @@
1
- var styles = {"global-search-background-overlay-position":"global-search-module-T0bEf","search-wrapper":"global-search-module-d2g2F","search-root":"global-search-module-Sx8Lx","search-container":"global-search-module--orCF","input":"global-search-module-vXnL6","entering":"global-search-module-MYwlp","entered":"global-search-module-Jmt3c","exiting":"global-search-module-gQQfY","exited":"global-search-module-AABcw"};
1
+ var styles = {"search-wrapper":"global-search-module-d2g2F","search-root":"global-search-module-Sx8Lx","search-container":"global-search-module--orCF","input":"global-search-module-vXnL6","entering":"global-search-module-MYwlp","entered":"global-search-module-Jmt3c","exiting":"global-search-module-gQQfY","exited":"global-search-module-AABcw"};
2
2
 
3
3
  export { styles as default };
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { Badge } from '../../badges/badge/badge.js';
4
- import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
5
- import { SolidCartIcon } from '../../icons/solid/solid-cart-icon.js';
3
+ import { useFormattedMessage } from '../../intl/use-formatted-message.js';
4
+ import { CartIcon } from '../../navigation/cart-icon/cart-icon.js';
6
5
  import { useFetchCurrentCartCount } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js';
7
6
  import { RouteIconButton } from '../../shared/routing/route-icon-button.js';
8
7
 
9
8
  function ConnectedCartIcon({ href }) {
10
9
  const count = useFetchCurrentCartCount();
11
- return (jsx(RouteIconButton, { "data-test-selector": "cartIcon", href: href, children: jsx(IconWithBadge, { badge: count ? jsx(Badge, { count: count }) : undefined, "data-test-selector": "cartIconCount", icon: jsx(SolidCartIcon, {}) }) }));
10
+ const t = useFormattedMessage();
11
+ return (jsx(RouteIconButton, { "data-test-selector": "cartIcon", href: href, children: jsx(CartIcon, { "aria-label": t('Shopping cart'), count: count }) }));
12
12
  }
13
13
 
14
14
  export { ConnectedCartIcon };
@@ -0,0 +1,7 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ function SolidLoginIcon(props) {
4
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M11.9996246,2 C17.5137282,2 22,6.48597148 22,11.9997748 C22,17.5140285 17.5137282,22 11.9996246,22 C6.48582133,22 2,17.5140285 2,11.9997748 C2,6.48597148 6.48582133,2 11.9996246,2 Z M11.9996246,3.33025009 C7.21934336,3.33025009 3.33009993,7.21934336 3.33009993,11.9997748 C3.33009993,14.0213525 4.02743387,15.8819608 5.19160917,17.3580143 C7.03044454,15.6346505 9.47216445,14.6559204 11.9997748,14.6559204 C14.5290368,14.6559204 16.9689548,15.6343502 18.8079404,17.3581645 C19.9722658,15.8821109 20.6697499,14.0213525 20.6697499,11.9997748 C20.6697499,7.21934336 16.7803563,3.33025009 11.9996246,3.33025009 Z M11.9999399,5.83909064 C14.0652136,5.83909064 15.7454821,7.51935913 15.7454821,9.58463283 C15.7454821,11.6500567 14.0652136,13.3303252 11.9999399,13.3303252 C9.93466624,13.3303252 8.25439775,11.6500567 8.25439775,9.58463283 C8.25439775,7.51935913 9.93466624,5.83909064 11.9999399,5.83909064 Z", fillRule: "evenodd" }) }));
5
+ }
6
+
7
+ export { SolidLoginIcon };
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ export { useAlgoliaInsightsGlobalState } from './algolia/use-algolia-insights-pr
32
32
  export { useAlgoliaInstantSearchState, useAlgoliaInstantSearchStateIndex, useAlgoliaInstantSearchStateOnline, useAlgoliaInstantSearchStateQueryId, useAlgoliaInstantSearchStateStatus } from './algolia/use-algolia-instant-search-state.js';
33
33
  export { useAlgoliaSearch } from './algolia/use-algolia-search.js';
34
34
  export { BackgroundOverlay } from './background-overlay/background-overlay.js';
35
+ export { BackgroundOverlayManager } from './background-overlay/background-overlay-manager.js';
35
36
  export { Badge } from './badges/badge/badge.js';
36
37
  export { IconWithBadge } from './badges/badge/icon-with-badge/icon-with-badge.js';
37
38
  export { Tag } from './badges/tag/tag.js';
@@ -84,6 +85,8 @@ export { DeliveryTime } from './delivery-time/delivery-time.js';
84
85
  export { InfoDisplay } from './display/info-display/info-display.js';
85
86
  export { Price } from './display/price/price.js';
86
87
  export { ProductSku } from './display/product-sku/product-sku.js';
88
+ export { Drawer } from './drawer/drawer.js';
89
+ export { useDrawer } from './drawer/use-drawer.js';
87
90
  export { ActiveFilters } from './filters/active-filters/active-filters.js';
88
91
  export { MultiSelect } from './filters/multi-select/multi-select.js';
89
92
  export { Pagination } from './filters/pagination/pagination.js';
@@ -148,6 +151,7 @@ export { useFormattedMessage } from './intl/use-formatted-message.js';
148
151
  export { useIntl } from './intl/use-intl.js';
149
152
  export { useLanguageCode } from './intl/use-language-code.js';
150
153
  export { getLanguageCodeFromCultureCode, spireTranslateAdapter } from './intl/utils.js';
154
+ export { Center } from './layout/center.js';
151
155
  export { DownloadDocumentList } from './lists/download-document-list/download-document-list.js';
152
156
  export { FeatureList } from './lists/feature-list/feature-list.js';
153
157
  export { IconList, IconListItem } from './lists/icon-list/icon-list.js';
@@ -173,6 +177,11 @@ export { AddToFavoriteDialog } from './modals/favorite/add-to-favorite-dialog.js
173
177
  export { Modal } from './modals/modal/modal.js';
174
178
  export { RecoverPasswordDialog } from './modals/recover-password/recover-password-dialog.js';
175
179
  export { SignInDialog } from './modals/signin/sign-in-dialog.js';
180
+ export { AccountIcon } from './navigation/account-icon/account-icon.js';
181
+ export { CartIcon } from './navigation/cart-icon/cart-icon.js';
182
+ export { FavoriteIcon } from './navigation/favorite-icon/favorite-icon.js';
183
+ export { MobileNavigation } from './navigation/mobile-navigation/mobile-navigation.js';
184
+ export { PanelNavigation } from './navigation/panel-navigation/panel-navigation.js';
176
185
  export { Announcement } from './notifications/announcements/announcement.js';
177
186
  export { AnnouncementProvider } from './notifications/announcements/announcement-provider.js';
178
187
  export { ConnectedAnnouncement, now } from './notifications/announcements/connected-announcement.js';
@@ -306,6 +315,7 @@ export { useCSSLink } from './shared/hooks/use-css-link.js';
306
315
  export { useDebouncedCallback } from './shared/hooks/use-debounced-callback.js';
307
316
  export { useDisclosure } from './shared/hooks/use-disclosure.js';
308
317
  export { useEnableMobileZoom } from './shared/hooks/use-enable-mobile-zoom.js';
318
+ export { useGlobalDisclosure } from './shared/hooks/use-global-disclosure.js';
309
319
  export { useIntersectionObserver } from './shared/hooks/use-intersection-observer.js';
310
320
  export { useIsBreakpoint } from './shared/hooks/use-is-breakpoint.js';
311
321
  export { useIsScrolledBeyondElement } from './shared/hooks/use-is-scrolled-beyond-element.js';
@@ -338,6 +348,7 @@ export { useOnNavigate } from './shared/routing/use-on-navigate.js';
338
348
  export { withRouting } from './shared/routing/with-routing.js';
339
349
  export { ensureArray } from './shared/utils/array.js';
340
350
  export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
351
+ export { getCssPropertyValue } from './shared/utils/css.js';
341
352
  export { formatDateToLocaleString } from './shared/utils/date.js';
342
353
  export { trackPropertyChange } from './shared/utils/debug.js';
343
354
  export { environment, environments } from './shared/utils/environment.js';
@@ -347,6 +358,7 @@ export { ensureNumber } from './shared/utils/number.js';
347
358
  export { formatCurrency, getCurrencyByCountryCode, parseCurrency } from './shared/utils/price.js';
348
359
  export { isPromise, wait } from './shared/utils/promise.js';
349
360
  export { random, randomInt } from './shared/utils/random.js';
361
+ export { multiRef } from './shared/utils/refs.js';
350
362
  export { camelCase } from './shared/utils/string.js';
351
363
  export { TIME } from './shared/utils/time.js';
352
364
  export { has, hasNo } from './shared/utils/types.js';
@@ -1 +1 @@
1
- export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Close' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Delivery date' | 'Delivery expected on {0}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Features' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Industry' | 'industry.PP' | 'industry.AU' | 'industry.MC' | 'industry.BC' | 'industry.TR' | 'industry.AG' | 'industry.AV' | 'industry.MA' | 'industry.OT' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'More than {0} articles' | 'New list name' | 'New user?' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order number' | 'Order' | 'Order' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove all' | 'Requested delivery date' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signing in…' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
1
+ export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Access denied.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Delivery date' | 'Delivery expected on {0}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Industry' | 'industry.PP' | 'industry.AU' | 'industry.MC' | 'industry.BC' | 'industry.TR' | 'industry.AG' | 'industry.AV' | 'industry.MA' | 'industry.OT' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Main menu' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'Navigation' | 'New list name' | 'New user?' | 'Number of favorites' | 'Number of products' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order number' | 'Order' | 'Order' | 'Our products' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove all' | 'Requested delivery date' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sign in or create account' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Support' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function Center({ children, className, }: {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import styles from './center.module.css.js';
4
+
5
+ function Center({ children, className, }) {
6
+ return jsx("div", { className: clsx(styles.center, className), children: children });
7
+ }
8
+
9
+ export { Center };
@@ -0,0 +1,3 @@
1
+ var styles = {"center":"center-module-Cr7hx"};
2
+
3
+ export { styles as default };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ export type MenuListVariant = 'default' | 'primary';
2
3
  export interface MenuListProps {
3
4
  back?: {
4
5
  onClick: () => void;
@@ -9,6 +10,7 @@ export interface MenuListProps {
9
10
  href: string;
10
11
  title: string;
11
12
  };
12
- variant?: 'default' | 'primary';
13
+ scrollable?: boolean;
14
+ variant?: MenuListVariant;
13
15
  }
14
- export declare function MenuList({ back, children, header, variant, }: MenuListProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function MenuList({ back, children, header, scrollable, variant, }: MenuListProps): import("react/jsx-runtime").JSX.Element;
@@ -4,10 +4,10 @@ import { MenuListBackButton } from './menu-list-back-button.js';
4
4
  import { MenuListHeader } from './menu-list-header.js';
5
5
  import styles from './menu-list.module.css.js';
6
6
 
7
- function MenuList({ back, children, header, variant = 'default', }) {
7
+ function MenuList({ back, children, header, scrollable = true, variant = 'default', }) {
8
8
  const headerTitle = typeof header === 'string' ? header : header?.title;
9
9
  const headerHref = typeof header === 'string' ? undefined : header?.href;
10
- return (jsxs("section", { className: clsx(styles['menu-list'], styles[variant]), role: "menu", children: [back && (jsx(MenuListBackButton, { onClick: back.onClick, children: back.title })), jsxs("div", { className: styles['scroll-area'], children: [header && (jsx(MenuListHeader, { href: headerHref, children: headerTitle })), jsx("ul", { className: styles['list'], children: children })] })] }));
10
+ return (jsxs("section", { className: clsx(styles['menu-list'], styles[variant], scrollable && styles['scrollable']), role: "menu", children: [back && (jsx(MenuListBackButton, { onClick: back.onClick, children: back.title })), jsxs("div", { className: styles['scroll-area'], children: [header && (jsx(MenuListHeader, { href: headerHref, children: headerTitle })), jsx("ul", { className: styles['list'], children: children })] })] }));
11
11
  }
12
12
 
13
13
  export { MenuList };
@@ -1,3 +1,3 @@
1
- var styles = {"menu-list":"menu-list-module-TloB9","primary":"menu-list-module-xUg6i","scroll-area":"menu-list-module-x3D-V","list":"menu-list-module-m3rpo","menu-list-back-button":"menu-list-module-eKDL9","icon":"menu-list-module-syyw9","menu-list-header":"menu-list-module-S08LI","menu-list-item":"menu-list-module-4QhF4","label":"menu-list-module-xFYyo","image":"menu-list-module-ELekn","badge":"menu-list-module-4PbP-","selected":"menu-list-module-hiMca","has-children":"menu-list-module-61uJb"};
1
+ var styles = {"menu-list":"menu-list-module-TloB9","primary":"menu-list-module-xUg6i","scrollable":"menu-list-module-AiDgG","scroll-area":"menu-list-module-x3D-V","list":"menu-list-module-m3rpo","menu-list-back-button":"menu-list-module-eKDL9","icon":"menu-list-module-syyw9","menu-list-header":"menu-list-module-S08LI","menu-list-item":"menu-list-module-4QhF4","label":"menu-list-module-xFYyo","image":"menu-list-module-ELekn","badge":"menu-list-module-4PbP-","selected":"menu-list-module-hiMca","has-children":"menu-list-module-61uJb"};
2
2
 
3
3
  export { styles as default };
@@ -14,13 +14,12 @@ function OrderLineList({ children, onRemoveAll }) {
14
14
  const { close, isOpen, open } = useDisclosure();
15
15
  // eslint-disable-next-line @eslint-react/no-children-count
16
16
  const count = React.Children.count(children);
17
- const productString = count === 1 ? t('Product') : t('Products');
18
17
  function handleRemoveAll() {
19
18
  if (!onRemoveAll)
20
19
  return;
21
20
  open();
22
21
  }
23
- 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 }), ` ${productString.toLowerCase()}`] }), 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("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:
24
23
  // eslint-disable-next-line @eslint-react/no-children-map
25
24
  Children.map(children, (child, index) => (
26
25
  // eslint-disable-next-line @eslint-react/no-array-index-key
@@ -0,0 +1,5 @@
1
+ export interface AccountIconProps {
2
+ 'aria-label'?: string;
3
+ isAuthenticated?: boolean;
4
+ }
5
+ export declare function AccountIcon({ 'aria-label': ariaLabel, isAuthenticated, }: AccountIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Badge } from '../../badges/badge/badge.js';
3
+ import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
4
+ import { SolidLoginIcon } from '../../icons/solid/solid-login-icon.js';
5
+ import { useFormattedMessage } from '../../intl/use-formatted-message.js';
6
+
7
+ function AccountIcon({ 'aria-label': ariaLabel, isAuthenticated, }) {
8
+ const t = useFormattedMessage();
9
+ return (jsx(IconWithBadge, { "aria-label": ariaLabel, badge: isAuthenticated ? (jsx(Badge, { "aria-label": `(${t('Signed in')})`, variant: "green" })) : (jsx(Badge, { "aria-label": `(${t('Signed out')})`, variant: "red" })), icon: jsx(SolidLoginIcon, { role: "presentation" }) }));
10
+ }
11
+
12
+ export { AccountIcon };
@@ -0,0 +1,5 @@
1
+ export interface CartIconProps {
2
+ 'aria-label'?: string;
3
+ count?: number;
4
+ }
5
+ export declare function CartIcon({ 'aria-label': ariaLabel, count }: CartIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Badge } from '../../badges/badge/badge.js';
3
+ import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
4
+ import { SolidCartIcon } from '../../icons/solid/solid-cart-icon.js';
5
+ import { useFormattedMessage } from '../../intl/use-formatted-message.js';
6
+
7
+ function CartIcon({ 'aria-label': ariaLabel, count }) {
8
+ const t = useFormattedMessage();
9
+ return (jsx(IconWithBadge, { "aria-label": ariaLabel, badge: count && count > 0 ? (jsx(Badge, { "aria-label": count && count > 0 ? `(${t('Number of products')})` : undefined, count: count })) : undefined, "data-test-selector": "cartIconCount", icon: jsx(SolidCartIcon, { role: "presentation" }) }));
10
+ }
11
+
12
+ export { CartIcon };
@@ -0,0 +1,5 @@
1
+ export interface FavoriteIconProps {
2
+ 'aria-label'?: string;
3
+ count?: number;
4
+ }
5
+ export declare function FavoriteIcon({ 'aria-label': ariaLabel, count, }: FavoriteIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Badge } from '../../badges/badge/badge.js';
3
+ import { IconWithBadge } from '../../badges/badge/icon-with-badge/icon-with-badge.js';
4
+ import { SolidFavoriteIcon } from '../../icons/solid/solid-favorite-icon.js';
5
+ import { useFormattedMessage } from '../../intl/use-formatted-message.js';
6
+
7
+ function FavoriteIcon({ 'aria-label': ariaLabel, count, }) {
8
+ const t = useFormattedMessage();
9
+ return (jsx(IconWithBadge, { "aria-label": ariaLabel, badge: count && count > 0 ? (jsx(Badge, { "aria-label": count && count > 0 ? `(${t('Number of favorites')})` : undefined, count: count })) : undefined, "data-test-selector": "favoriteIconCount", icon: jsx(SolidFavoriteIcon, { role: "presentation" }) }));
10
+ }
11
+
12
+ export { FavoriteIcon };