@sonic-equipment/ui 168.0.0 → 170.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-active-categories.js +2 -2
  2. package/dist/breadcrumbs/breadcrumb.js +4 -4
  3. package/dist/buttons/button/button.d.ts +5 -2
  4. package/dist/buttons/button/button.js +22 -11
  5. package/dist/buttons/icon-button/icon-button.d.ts +6 -3
  6. package/dist/buttons/icon-button/icon-button.js +12 -5
  7. package/dist/buttons/link/link.d.ts +2 -0
  8. package/dist/buttons/link/link.js +13 -9
  9. package/dist/cards/category-card/category-card.d.ts +3 -1
  10. package/dist/cards/category-card/category-card.js +4 -4
  11. package/dist/cards/orderline-card/orderline-card.js +2 -2
  12. package/dist/cards/product-card/connected-product-card.d.ts +2 -0
  13. package/dist/cards/product-card/product-card.d.ts +3 -1
  14. package/dist/cards/product-card/product-card.js +3 -3
  15. package/dist/collapsables/show-all/show-all.js +2 -2
  16. package/dist/country-selector/connected-country-selector.d.ts +6 -6
  17. package/dist/exports.d.ts +2 -3
  18. package/dist/filters/active-filters/active-filters.js +2 -2
  19. package/dist/footer/connected-footer.d.ts +3 -1
  20. package/dist/footer/connected-footer.js +2 -2
  21. package/dist/footer/footer.js +6 -6
  22. package/dist/global-search/search-result-panel/sections/no-search.js +2 -2
  23. package/dist/global-search/search-result-panel/sections/with-results.js +2 -2
  24. package/dist/header/buttons/account/connected-account-button.js +2 -2
  25. package/dist/header/buttons/cart/connected-cart-button.js +2 -2
  26. package/dist/header/buttons/favorites/connected-favorites-button.js +2 -2
  27. package/dist/header/buttons/search/search-button.js +2 -2
  28. package/dist/header/connected-header.d.ts +2 -1
  29. package/dist/header/connected-header.js +3 -4
  30. package/dist/header/header.d.ts +2 -1
  31. package/dist/header/header.js +2 -2
  32. package/dist/header/link-list/navigation-link-list.js +3 -3
  33. package/dist/header/sonic-logo/sonic-logo.js +2 -3
  34. package/dist/index.js +2 -3
  35. package/dist/lists/menu-list/menu-list-header.js +2 -2
  36. package/dist/lists/menu-list/menu-list-item.js +2 -2
  37. package/dist/modals/signin/sign-in-dialog.js +2 -2
  38. package/dist/navigation/cart-icon/cart-icon.js +1 -1
  39. package/dist/notifications/announcements/announcement.js +2 -2
  40. package/dist/notifications/announcements/connected-announcement-list.d.ts +3 -1
  41. package/dist/notifications/announcements/connected-announcement-list.js +2 -2
  42. package/dist/pages/account/components/sign-in-form/sign-in-form.js +1 -2
  43. package/dist/pages/account/create-account-page/create-account-page.js +2 -2
  44. package/dist/pages/checkout/cart-page/cart-page.js +4 -6
  45. package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js +1 -1
  46. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +3 -3
  47. package/dist/pages/checkout/shipping-page/components/currency-change-dialog.js +2 -2
  48. package/dist/pages/checkout/shipping-page/components/readonly-address.js +3 -3
  49. package/dist/pages/product/components/product-overview.d.ts +2 -0
  50. package/dist/pages/product/components/product-overview.js +1 -1
  51. package/dist/pages/product/product-listing-page/no-results/no-results.js +2 -2
  52. package/dist/pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +1 -1
  53. package/dist/pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +1 -1
  54. package/dist/promos/promo-banner/promo-banner.js +2 -2
  55. package/dist/promos/promo-card/promo-card.js +2 -2
  56. package/dist/shared/hooks/use-watch-css-property.js +1 -1
  57. package/dist/shared/routing/route-provider.d.ts +4 -3
  58. package/dist/shared/routing/route-provider.js +4 -2
  59. package/dist/shared/routing/route-utils.d.ts +4 -0
  60. package/dist/shared/routing/route-utils.js +8 -0
  61. package/dist/shared/routing/types.d.ts +7 -0
  62. package/dist/shared/routing/use-route-link-element.d.ts +1 -0
  63. package/dist/shared/routing/use-route-link-element.js +11 -0
  64. package/dist/shared/routing/with-routing.d.ts +3 -6
  65. package/dist/shared/routing/with-routing.js +6 -6
  66. package/dist/shared/utils/css.js +53 -0
  67. package/dist/shared/utils/price.d.ts +1 -1
  68. package/dist/styles.css +190 -188
  69. package/package.json +1 -1
  70. package/dist/shared/routing/route-button.d.ts +0 -1
  71. package/dist/shared/routing/route-button.js +0 -7
  72. package/dist/shared/routing/route-icon-button.d.ts +0 -1
  73. package/dist/shared/routing/route-icon-button.js +0 -7
  74. package/dist/shared/routing/route-link.d.ts +0 -1
  75. package/dist/shared/routing/route-link.js +0 -7
@@ -2,9 +2,9 @@
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { useHierarchicalMenu } from 'react-instantsearch';
4
4
  import clsx from 'clsx';
5
+ import { Link } from '../buttons/link/link.js';
5
6
  import { StrokeCategoriesIcon } from '../icons/stroke/stroke-categories-icon.js';
6
7
  import { useFormattedMessage } from '../intl/use-formatted-message.js';
7
- import { RouteLink } from '../shared/routing/route-link.js';
8
8
  import { FilterSection } from './filter-section.js';
9
9
  import styles from './algolia-filter-panel.module.css.js';
10
10
  import filterSectionStyles from './filter-section.module.css.js';
@@ -29,7 +29,7 @@ function Categories({ categories, path: _path, }) {
29
29
  const categorySlug = category.label.toLowerCase().replaceAll(' ', '-');
30
30
  const path = `${_path}/${categorySlug}`;
31
31
  const isActive = !category.data || !category.data.some(c => c.isRefined);
32
- return (jsxs(Fragment, { children: [jsx("div", { className: filterSectionStyles['filter-section-item'], children: jsxs(RouteLink, { hasUnderline: true, className: clsx(styles.category, {
32
+ return (jsxs(Fragment, { children: [jsx("div", { className: filterSectionStyles['filter-section-item'], children: jsxs(Link, { hasUnderline: true, className: clsx(styles.category, {
33
33
  [styles['is-active']]: isActive,
34
34
  }), href: path, isDisabled: isActive, children: [jsx(StrokeCategoriesIcon, { height: 24, width: 24 }), jsx("span", { children: category.label })] }) }), category.data && (jsx(Categories, { categories: category.data, path: path }))] }, category.value));
35
35
  });
@@ -2,10 +2,10 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { Breadcrumbs, Breadcrumb as Breadcrumb$1 } from 'react-aria-components';
4
4
  import clsx from 'clsx';
5
+ import { Link } from '../buttons/link/link.js';
5
6
  import { GlyphsChevronsSlimLeftIcon } from '../icons/glyph/glyphs-chevrons-slim-left-icon.js';
6
7
  import { SolidHomeIcon } from '../icons/solid/solid-home-icon.js';
7
8
  import { useIsBreakpoint } from '../shared/hooks/use-is-breakpoint.js';
8
- import { RouteLink } from '../shared/routing/route-link.js';
9
9
  import styles from './breadcrumb.module.css.js';
10
10
 
11
11
  function BreadcrumbShort({ links }) {
@@ -14,17 +14,17 @@ function BreadcrumbShort({ links }) {
14
14
  const isHomeLink = previousLink === undefined || previousLink === homeLink;
15
15
  const href = previousLink?.href || homeLink?.href;
16
16
  const label = previousLink?.label || homeLink?.label;
17
- return (jsx(Breadcrumbs, { className: styles.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(RouteLink, { className: styles.link, href: href, isDisabled: false, title: label, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles.icon }), isHomeLink ? (jsx(SolidHomeIcon, { className: styles.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
17
+ return (jsx(Breadcrumbs, { className: styles.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(Link, { className: styles.link, href: href, isDisabled: false, title: label, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles.icon }), isHomeLink ? (jsx(SolidHomeIcon, { className: styles.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
18
18
  }
19
19
  function BreadcrumbLongItem({ index, isDisabled, link, }) {
20
- return (jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(RouteLink, { className: styles.link, color: "secondary", href: link.href, isDisabled: isDisabled, title: link.label, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles['previous-icon'], styles.icon) }), link.label] }) }, index));
20
+ return (jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(Link, { className: styles.link, color: "secondary", href: link.href, isDisabled: isDisabled, title: link.label, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles['previous-icon'], styles.icon) }), link.label] }) }, index));
21
21
  }
22
22
  function BreadcrumbLong({ links }) {
23
23
  const linksWithoutFirst = links.slice(1);
24
24
  const homeLink = links[0];
25
25
  if (!homeLink)
26
26
  return null;
27
- return (jsxs(Breadcrumbs, { className: styles.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsx(RouteLink, { className: styles.link, href: homeLink.href, title: homeLink.label, children: jsx(SolidHomeIcon, { className: clsx(styles['home-icon'], styles.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, link.href + link.label || index)))] }));
27
+ return (jsxs(Breadcrumbs, { className: styles.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsx(Link, { className: styles.link, href: homeLink.href, title: homeLink.label, children: jsx(SolidHomeIcon, { className: clsx(styles['home-icon'], styles.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, link.href + link.label || index)))] }));
28
28
  }
29
29
  function Breadcrumb({ links }) {
30
30
  const isLg = useIsBreakpoint('lg');
@@ -1,4 +1,5 @@
1
1
  import { MouseEvent, ReactNode } from 'react';
2
+ import { NavigateOptions } from '../../shared/routing/types';
2
3
  export interface ButtonProps {
3
4
  _pseudo?: 'none' | 'focus' | 'hover' | 'active';
4
5
  children?: ReactNode;
@@ -7,17 +8,19 @@ export interface ButtonProps {
7
8
  condensed?: boolean;
8
9
  'data-test-selector'?: string;
9
10
  form?: string;
11
+ href?: string;
10
12
  icon?: React.ReactNode;
11
13
  iconPosition?: 'left' | 'right';
12
14
  isDisabled?: boolean;
13
15
  isLoading?: string | ReactNode | boolean;
14
16
  isValidating?: boolean;
15
17
  name?: string;
16
- onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
18
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
19
+ route?: NavigateOptions;
17
20
  size?: 'sm' | 'md' | 'lg';
18
21
  type?: 'button' | 'submit' | 'reset';
19
22
  value?: string;
20
23
  variant?: 'solid' | 'outline' | 'ghost';
21
24
  withArrow?: boolean;
22
25
  }
23
- export declare function Button({ _pseudo, children, className, color, condensed, 'data-test-selector': dataTestSelector, form, icon, iconPosition, isDisabled, isLoading, isValidating, name, onClick: _onClick, size, type, value, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Button({ _pseudo, children: _children, className, color, condensed, 'data-test-selector': dataTestSelector, form, href, icon, iconPosition, isDisabled, isLoading, isValidating, name, onClick, route, size, type, value, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -4,24 +4,35 @@ import { isValidElement } from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { ProgressCircle } from '../../loading/progress-circle.js';
6
6
  import { GlyphsArrowBoldCapsRightIcon } from '../../icons/glyph/glyphs-arrow-boldcaps-right-icon.js';
7
+ import { buildHref } from '../../shared/routing/route-utils.js';
8
+ import { useBasePath } from '../../shared/routing/use-base-path.js';
9
+ import { useRouteLinkElement } from '../../shared/routing/use-route-link-element.js';
7
10
  import buttonStyles from './button.module.css.js';
8
11
 
9
- function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, 'data-test-selector': dataTestSelector, form, icon, iconPosition = 'left', isDisabled, isLoading = false, isValidating = true, name, onClick: _onClick, size = 'lg', type = 'button', value, variant = 'solid', withArrow = false, }) {
10
- const showIconOnLeft = icon && iconPosition === 'left';
11
- const showIconOnRight = icon && iconPosition === 'right';
12
- const iconElement = icon && jsx("span", { className: buttonStyles.icon, children: icon });
13
- const onClick = (e) => {
14
- if (_onClick)
15
- _onClick(e);
12
+ function Button({ _pseudo = 'none', children: _children, className, color = 'primary', condensed, 'data-test-selector': dataTestSelector, form, href, icon, iconPosition = 'left', isDisabled, isLoading = false, isValidating = true, name, onClick, route, size = 'lg', type = 'button', value, variant = 'solid', withArrow = false, }) {
13
+ const basePath = useBasePath();
14
+ const RouteLinkElement = useRouteLinkElement();
15
+ const handleButtonClick = (e) => {
16
+ if (onClick)
17
+ onClick(e);
16
18
  e.stopPropagation();
17
19
  if (type === 'submit')
18
20
  return;
19
21
  e.preventDefault();
20
22
  };
21
- return (jsx("button", { className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, { [buttonStyles['loading-uninformative']]: isLoading === true }, {
22
- [buttonStyles['loading-informative']]: isLoading &&
23
- (typeof isLoading === 'string' || isValidElement(isLoading)),
24
- }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, disabled: isDisabled, form: form, formNoValidate: isValidating ? undefined : true, name: name, onClick: onClick, type: type, value: value, children: jsxs(Fragment, { children: [showIconOnLeft && iconElement, jsx("span", { className: buttonStyles.children, children: isLoading ? (isLoading === true ? children : isLoading) : children }), withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && iconElement, isLoading && (jsx(ProgressCircle, { className: buttonStyles.spinner, size: "sm", variant: color === 'primary' ? 'white' : 'gray' }))] }) }));
23
+ const classNames = clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, { [buttonStyles['loading-uninformative']]: isLoading === true }, {
24
+ [buttonStyles['loading-informative']]: isLoading &&
25
+ (typeof isLoading === 'string' || isValidElement(isLoading)),
26
+ }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className);
27
+ const showIconOnLeft = icon && iconPosition === 'left';
28
+ const showIconOnRight = icon && iconPosition === 'right';
29
+ const iconElement = icon && jsx("span", { className: buttonStyles.icon, children: icon });
30
+ const children = (jsxs(Fragment, { children: [showIconOnLeft && iconElement, jsx("span", { className: buttonStyles.children, children: isLoading ? (isLoading === true ? _children : isLoading) : _children }), withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && iconElement, isLoading && (jsx(ProgressCircle, { className: buttonStyles.spinner, size: "sm", variant: color === 'primary' ? 'white' : 'gray' }))] }));
31
+ if (href) {
32
+ const Element = RouteLinkElement || 'a';
33
+ return (jsx(Element, { className: classNames, "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, href: buildHref({ basePath, href }), onClick: onClick, route: route, type: type, children: children }));
34
+ }
35
+ return (jsx("button", { className: classNames, "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, disabled: isDisabled, form: form, formNoValidate: isValidating ? undefined : true, name: name, onClick: handleButtonClick, type: type, value: value, children: children }));
25
36
  }
26
37
 
27
38
  export { Button };
@@ -1,13 +1,16 @@
1
+ import { MouseEvent, ReactNode } from 'react';
2
+ import { NavigateOptions } from '../../shared/routing/types';
1
3
  export interface IconButtonProps {
2
- children: React.ReactNode;
4
+ children: ReactNode;
3
5
  className?: string;
4
6
  color?: 'primary' | 'secondary' | 'current-color';
5
7
  href?: string;
6
8
  isDisabled?: boolean;
7
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
9
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
10
+ route?: NavigateOptions;
8
11
  size?: 'md' | 'lg';
9
12
  target?: string;
10
13
  title?: string;
11
14
  type?: 'button' | 'submit' | 'reset';
12
15
  }
13
- export declare function IconButton({ children, className, color, href, isDisabled, onClick: _onClick, size, target, title, type, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function IconButton({ children, className: _className, color, href, isDisabled, onClick, size, target, title, type, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,18 +1,25 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
+ import { buildHref } from '../../shared/routing/route-utils.js';
5
+ import { useBasePath } from '../../shared/routing/use-base-path.js';
6
+ import { useRouteLinkElement } from '../../shared/routing/use-route-link-element.js';
4
7
  import styles from './icon-button.module.css.js';
5
8
 
6
- function IconButton({ children, className, color = 'primary', href, isDisabled, onClick: _onClick, size = 'md', target, title, type = 'button', ...rest }) {
7
- const onClick = (e) => {
9
+ function IconButton({ children, className: _className, color = 'primary', href, isDisabled, onClick, size = 'md', target, title, type = 'button', ...rest }) {
10
+ const basePath = useBasePath();
11
+ const RouteLinkElement = useRouteLinkElement();
12
+ const handleButtonClick = (e) => {
8
13
  e.preventDefault();
9
14
  e.stopPropagation();
10
- _onClick?.(e);
15
+ onClick?.(e);
11
16
  };
17
+ const className = clsx(styles['icon-button'], styles[size], styles[color], _className);
12
18
  if (href) {
13
- return (jsx("a", { className: clsx(styles['icon-button'], styles[size], styles[color], className), "data-disabled": isDisabled ? true : undefined, href: href, onClick: onClick, target: target, title: title, ...rest, children: children }));
19
+ const Element = RouteLinkElement || 'a';
20
+ return (jsx(Element, { className: className, "data-disabled": isDisabled ? true : undefined, href: buildHref({ basePath, href }), onClick: onClick, target: target, title: title, ...rest, children: children }));
14
21
  }
15
- return (jsx("button", { className: clsx(styles['icon-button'], styles[size], styles[color], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: onClick, title: title, type: type, ...rest, children: children }));
22
+ return (jsx("button", { className: className, "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: handleButtonClick, title: title, type: type, ...rest, children: children }));
16
23
  }
17
24
 
18
25
  export { IconButton };
@@ -1,4 +1,5 @@
1
1
  import { KeyboardEvent, MouseEventHandler, ReactNode } from 'react';
2
+ import { NavigateOptions } from '../../shared/routing/types';
2
3
  export interface LinkProps {
3
4
  children: ReactNode;
4
5
  className?: string;
@@ -10,6 +11,7 @@ export interface LinkProps {
10
11
  onClick?: MouseEventHandler<HTMLElement>;
11
12
  onKeyUp?: (event: KeyboardEvent) => void;
12
13
  role?: string;
14
+ route?: NavigateOptions;
13
15
  tabIndex?: number;
14
16
  target?: string;
15
17
  title?: string;
@@ -2,19 +2,23 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import clsx from 'clsx';
5
+ import { buildHref } from '../../shared/routing/route-utils.js';
6
+ import { useBasePath } from '../../shared/routing/use-base-path.js';
7
+ import { useRouteLinkElement } from '../../shared/routing/use-route-link-element.js';
5
8
  import styles from './link.module.css.js';
6
9
 
7
- const Link = forwardRef(({ children, className, color, hasUnderline, href, id, isDisabled, onClick, onKeyUp, role, tabIndex, target, title, ...rest }, ref) => {
10
+ const Link = forwardRef(({ children, className: _className, color, hasUnderline, href, id, isDisabled, onClick, onKeyUp, role, tabIndex, target, title, ...rest }, ref) => {
11
+ const basePath = useBasePath();
12
+ const RouteLinkElement = useRouteLinkElement();
13
+ const className = clsx({
14
+ [styles.hover]: Boolean(href || onClick),
15
+ [styles['has-underline']]: hasUnderline,
16
+ }, styles['link'], color && styles[color], _className);
8
17
  if (href) {
9
- return (jsx("a", { ref: ref, className: clsx({
10
- [styles.hover]: Boolean(href || onClick),
11
- [styles['has-underline']]: hasUnderline,
12
- }, styles['link'], color && styles[color], className), "data-disabled": isDisabled ? true : undefined, href: href, id: id, onClick: onClick, onKeyUp: onKeyUp, role: role, tabIndex: isDisabled ? -1 : tabIndex, target: target, title: title, ...rest, children: children }));
18
+ const Element = RouteLinkElement || 'a';
19
+ return (jsx(Element, { ref: ref, className: className, "data-disabled": isDisabled ? true : undefined, href: buildHref({ basePath, href }), id: id, onClick: onClick, onKeyUp: onKeyUp, role: role, tabIndex: isDisabled ? -1 : tabIndex, target: target, title: title, ...rest, children: children }));
13
20
  }
14
- return (jsx("button", { ref: ref, className: clsx({
15
- [styles.hover]: Boolean(href || onClick),
16
- [styles['has-underline']]: hasUnderline,
17
- }, styles['link'], color && styles[color], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled ? true : undefined, id: id, onClick: onClick, onKeyUp: onKeyUp, role: role, tabIndex: isDisabled ? -1 : tabIndex, title: title, type: "button", ...rest, children: children }));
21
+ return (jsx("button", { ref: ref, className: className, "data-disabled": isDisabled ? true : undefined, disabled: isDisabled ? true : undefined, id: id, onClick: onClick, onKeyUp: onKeyUp, role: role, tabIndex: isDisabled ? -1 : tabIndex, title: title, type: "button", ...rest, children: children }));
18
22
  });
19
23
  Link.displayName = 'Link';
20
24
 
@@ -1,11 +1,13 @@
1
1
  import { ImageSourceType } from '../../shared/model/image';
2
+ import { NavigateOptions } from '../../shared/routing/types';
2
3
  export interface CategoryCardProps {
3
4
  className?: string;
4
5
  href: string;
5
6
  image: ImageSourceType;
6
7
  isSelected?: boolean;
7
8
  onClick?: VoidFunction;
9
+ route?: NavigateOptions;
8
10
  title: string;
9
11
  withArrow?: boolean;
10
12
  }
11
- export declare function CategoryCard({ className, href, image, isSelected, onClick, title, withArrow, }: CategoryCardProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function CategoryCard({ className, href, image, isSelected, onClick, route, title, withArrow, }: CategoryCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
+ import { Link } from '../../buttons/link/link.js';
4
5
  import { GlyphsArrowBoldCapsRightIcon } from '../../icons/glyph/glyphs-arrow-boldcaps-right-icon.js';
5
6
  import { Image } from '../../media/image/image.js';
6
- import { RouteLink } from '../../shared/routing/route-link.js';
7
7
  import styles from './category-card.module.css.js';
8
8
 
9
- function CategoryCard({ className, href, image, isSelected = false, onClick, title, withArrow = false, }) {
10
- return (jsxs(RouteLink, { className: clsx({
9
+ function CategoryCard({ className, href, image, isSelected = false, onClick, route, title, withArrow = false, }) {
10
+ return (jsxs(Link, { className: clsx({
11
11
  [styles['is-selected']]: isSelected,
12
- }, styles['category-card'], className), href: href, onClick: onClick, children: [jsx("div", { className: styles['image-container'], children: jsx(Image, { className: styles.image, ...image, fit: "contain" }) }), jsxs("p", { className: styles.title, children: [jsx("span", { children: title }), withArrow && jsx(GlyphsArrowBoldCapsRightIcon, { className: styles.arrow })] })] }));
12
+ }, styles['category-card'], className), href: href, onClick: onClick, route: route, children: [jsx("div", { className: styles['image-container'], children: jsx(Image, { className: styles.image, ...image, fit: "contain" }) }), jsxs("p", { className: styles.title, children: [jsx("span", { children: title }), withArrow && jsx(GlyphsArrowBoldCapsRightIcon, { className: styles.arrow })] })] }));
13
13
  }
14
14
 
15
15
  export { CategoryCard };
@@ -1,13 +1,13 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import clsx from 'clsx';
3
3
  import { Tag } from '../../badges/tag/tag.js';
4
+ import { Link } from '../../buttons/link/link.js';
4
5
  import { DeliveryTime } from '../../delivery-time/delivery-time.js';
5
6
  import { Price } from '../../display/price/price.js';
6
7
  import { ProductSku } from '../../display/product-sku/product-sku.js';
7
8
  import { FormattedMessage } from '../../intl/formatted-message.js';
8
9
  import { logger } from '../../logging/logger.js';
9
10
  import { Image } from '../../media/image/image.js';
10
- import { RouteLink } from '../../shared/routing/route-link.js';
11
11
  import styles from './orderline-card.module.css.js';
12
12
 
13
13
  function OrderLineCard(props) {
@@ -15,7 +15,7 @@ function OrderLineCard(props) {
15
15
  if (!price.currencyCode) {
16
16
  logger.error(`Product '${sku}' does not have a currency code`);
17
17
  }
18
- return (jsxs("article", { "aria-labelledby": `title-${productId}`, className: clsx(styles['orderline-card'], isReadonly && styles.readonly), "data-disabled": isReadonly ? true : undefined, "data-product-id": sku, "data-test-selector": "orderLineListItem", id: productId, children: [isReadonly ? (jsx("div", { className: styles.title, "data-test-selector": "orderLineCardTitle", id: `title-${productId}`, children: title })) : (jsx(RouteLink, { className: styles.title, "data-test-selector": "orderLineCardTitle", href: href, id: `title-${productId}`, 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, "data-test-selector": "orderLineCardPrice", originalPrice: price.originalTotalPrice, price: price.totalPrice, pricePerUnit: price.pricePerUnit, variant: "sonic" })), jsx("div", { className: styles['image-container'], role: "presentation", children: jsx(Image, { "data-test-selector": "orderLineCardImage", ...image, fit: "contain" }) }), isReadonly ? (jsx("p", { className: styles.amount, children: jsx(FormattedMessage, { id: "Amount: {0}", replacementValues: { '0': props.quantity.toString() } }) })) : (jsx("div", { className: styles['add-to-cart-button'], children: props.addToCartButton })), jsx(DeliveryTime, { className: styles.delivery, deliveryDate: deliveryDate }), !isReadonly && (jsx("div", { className: styles.remove, "data-test-selector": "orderLineCardRemove", children: props.removeButton }))] }));
18
+ return (jsxs("article", { "aria-labelledby": `title-${productId}`, className: clsx(styles['orderline-card'], isReadonly && styles.readonly), "data-disabled": isReadonly ? true : undefined, "data-product-id": sku, "data-test-selector": "orderLineListItem", id: productId, children: [isReadonly ? (jsx("div", { className: styles.title, "data-test-selector": "orderLineCardTitle", id: `title-${productId}`, children: title })) : (jsx(Link, { className: styles.title, "data-test-selector": "orderLineCardTitle", href: href, id: `title-${productId}`, 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, "data-test-selector": "orderLineCardPrice", originalPrice: price.originalTotalPrice, price: price.totalPrice, pricePerUnit: price.pricePerUnit, variant: "sonic" })), jsx("div", { className: styles['image-container'], role: "presentation", children: jsx(Image, { "data-test-selector": "orderLineCardImage", ...image, fit: "contain" }) }), isReadonly ? (jsx("p", { className: styles.amount, children: jsx(FormattedMessage, { id: "Amount: {0}", replacementValues: { '0': props.quantity.toString() } }) })) : (jsx("div", { className: styles['add-to-cart-button'], children: props.addToCartButton })), jsx(DeliveryTime, { className: styles.delivery, deliveryDate: deliveryDate }), !isReadonly && (jsx("div", { className: styles.remove, "data-test-selector": "orderLineCardRemove", children: props.removeButton }))] }));
19
19
  }
20
20
 
21
21
  export { OrderLineCard };
@@ -1,8 +1,10 @@
1
1
  import { AddToCartHandler } from '../../buttons/add-to-cart-button/connected-add-to-cart-button';
2
+ import { NavigateOptions } from '../../shared/routing/types';
2
3
  import { ProductCardProps } from './product-card';
3
4
  export interface ConnectedProductCardProps extends Omit<ProductCardProps, 'addToCartButton' | 'favoriteButton'> {
4
5
  onAddToCart?: AddToCartHandler;
5
6
  onFavorited?: VoidFunction;
6
7
  onFavoriting?: VoidFunction;
8
+ route?: NavigateOptions;
7
9
  }
8
10
  export declare function ConnectedProductCard({ id, onAddToCart, onFavorited, onFavoriting, ...props }: ConnectedProductCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
2
  import type { ImageSourceType } from '../../shared/model/image';
3
3
  import type { ProductPriceType } from '../../shared/model/price';
4
+ import { NavigateOptions } from '../../shared/routing/types';
4
5
  export interface ProductCardProps {
5
6
  addToCartButton: ReactElement;
6
7
  favoriteButton?: ReactElement;
@@ -9,8 +10,9 @@ export interface ProductCardProps {
9
10
  image: ImageSourceType;
10
11
  onClick?: VoidFunction;
11
12
  price: ProductPriceType;
13
+ route?: NavigateOptions;
12
14
  sku: string;
13
15
  tags?: string[];
14
16
  title: ReactNode;
15
17
  }
16
- export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, route, sku, tags, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +1,19 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { Tag } from '../../badges/tag/tag.js';
4
+ import { Link } from '../../buttons/link/link.js';
4
5
  import { Price } from '../../display/price/price.js';
5
6
  import { ProductSku } from '../../display/product-sku/product-sku.js';
6
7
  import { FormattedMessage } from '../../intl/formatted-message.js';
7
8
  import { logger } from '../../logging/logger.js';
8
9
  import { Image } from '../../media/image/image.js';
9
- import { RouteLink } from '../../shared/routing/route-link.js';
10
10
  import styles from './product-card.module.css.js';
11
11
 
12
- function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }) {
12
+ function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, route, sku, tags, title, }) {
13
13
  if (!price.currencyCode) {
14
14
  logger.error(`Product '${sku}' does not have a currency code`);
15
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 })] }) }));
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(Link, { className: styles.title, href: href, id: `title-${id}`, onClick: onClick, route: route, 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 })] }) }));
17
17
  }
18
18
 
19
19
  export { ProductCard };
@@ -2,11 +2,11 @@
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { useRef, useState } from 'react';
4
4
  import clsx from 'clsx';
5
+ import { Link } from '../../buttons/link/link.js';
5
6
  import { GlyphsChevronsSlimDownIcon } from '../../icons/glyph/glyphs-chevrons-slim-down-icon.js';
6
7
  import { FormattedMessage } from '../../intl/formatted-message.js';
7
8
  import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
8
9
  import { useResizeObserver } from '../../shared/hooks/use-resize-observer.js';
9
- import { RouteLink } from '../../shared/routing/route-link.js';
10
10
  import styles from './show-all.module.css.js';
11
11
 
12
12
  function ShowAll({ children, hasTransparency = true, initialHeight = 0, initialIsOpen = false, isOpen: isControlledOpen, onToggle, }) {
@@ -23,7 +23,7 @@ function ShowAll({ children, hasTransparency = true, initialHeight = 0, initialI
23
23
  [styles['is-open']]: isReallyOpen,
24
24
  }), style: contentFits ? undefined : { '--initital-height': `${initialHeight}px` }, children: [jsx("div", { className: styles.panel, children: jsx("div", { className: clsx(styles.content, {
25
25
  [styles['has-transparency']]: !contentFits && hasTransparency,
26
- }), children: jsx("div", { ref: ref, children: children }) }) }), !contentFits && (jsxs(RouteLink, { className: styles.button, color: "secondary", onClick: () => {
26
+ }), children: jsx("div", { ref: ref, children: children }) }) }), !contentFits && (jsxs(Link, { className: styles.button, color: "secondary", onClick: () => {
27
27
  if (isControlled)
28
28
  return onToggle(!isControlled);
29
29
  toggle();
@@ -1,13 +1,13 @@
1
1
  import { CountryCode, LanguageCode } from '../intl/types';
2
2
  import { Country, Language } from '../shared/model/countries-languages';
3
- interface ConnectedCountrySelectorProps {
3
+ export type OnCountryLanguageChangeHandler = (args: {
4
+ country: Country;
5
+ language: Language;
6
+ }) => void;
7
+ export interface ConnectedCountrySelectorProps {
4
8
  defaultCountryCode: CountryCode;
5
9
  defaultLanguageCode: LanguageCode;
6
- onChange?: (args: {
7
- country: Country;
8
- language: Language;
9
- }) => void;
10
+ onChange?: OnCountryLanguageChangeHandler;
10
11
  showCountry?: boolean;
11
12
  }
12
13
  export declare function ConnectedCountrySelector({ defaultCountryCode, defaultLanguageCode, onChange, showCountry, }: ConnectedCountrySelectorProps): import("react/jsx-runtime").JSX.Element | null;
13
- export {};
package/dist/exports.d.ts CHANGED
@@ -349,14 +349,13 @@ export * from './shared/providers/cart-provider';
349
349
  export * from './shared/providers/favorite-provider';
350
350
  export * from './shared/providers/global-state-provider';
351
351
  export * from './shared/providers/react-query-container';
352
- export * from './shared/routing/route-button';
353
- export * from './shared/routing/route-icon-button';
354
- export * from './shared/routing/route-link';
355
352
  export * from './shared/routing/route-provider';
353
+ export * from './shared/routing/route-utils';
356
354
  export * from './shared/routing/types';
357
355
  export * from './shared/routing/use-base-path';
358
356
  export * from './shared/routing/use-navigate';
359
357
  export * from './shared/routing/use-on-navigate';
358
+ export * from './shared/routing/use-route-link-element';
360
359
  export * from './shared/routing/with-routing';
361
360
  export * from './shared/utils/array';
362
361
  export * from './shared/utils/breakpoints';
@@ -3,10 +3,10 @@ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
4
  import { FilterSection } from '../../algolia/filter-section.js';
5
5
  import { IconButton } from '../../buttons/icon-button/icon-button.js';
6
+ import { Link } from '../../buttons/link/link.js';
6
7
  import { StrokeCloseboxIcon } from '../../icons/stroke/stroke-closebox-icon.js';
7
8
  import { FormattedMessage } from '../../intl/formatted-message.js';
8
9
  import { useFormattedMessage } from '../../intl/use-formatted-message.js';
9
- import { RouteLink } from '../../shared/routing/route-link.js';
10
10
  import filterSectionStyles from '../../algolia/filter-section.module.css.js';
11
11
  import styles from './active-filters.module.css.js';
12
12
 
@@ -14,7 +14,7 @@ const ActiveFilters = ({ onClearAllFilters, onClearFilter, selectedFilterCategor
14
14
  const t = useFormattedMessage();
15
15
  if (selectedFilterCategories.length === 0)
16
16
  return null;
17
- return (jsx(FilterSection, { button: jsx(RouteLink, { onClick: onClearAllFilters, children: jsx(FormattedMessage, { id: "Clear filters" }) }), title: t('Chosen filters'), variant: "with-action", children: selectedFilterCategories.map(category => category.filters.map(filter => (jsxs("div", { className: clsx(filterSectionStyles['filter-section-item'], styles['active-filter-item']), children: [jsxs("span", { children: [jsxs("span", { children: [jsx(FormattedMessage, { id: `facet.${category.label.toLowerCase()}` }), jsx("span", { children: ": " })] }), jsx("span", { className: styles['active-filter-value'], children: filter.label })] }), jsx(IconButton, { className: styles['clear-filter-button'], color: "secondary", onClick: () => onClearFilter(category.label, filter), children: jsx(StrokeCloseboxIcon, {}) })] }, `${category.label}-${filter.value}`)))) }));
17
+ return (jsx(FilterSection, { button: jsx(Link, { onClick: onClearAllFilters, children: jsx(FormattedMessage, { id: "Clear filters" }) }), title: t('Chosen filters'), variant: "with-action", children: selectedFilterCategories.map(category => category.filters.map(filter => (jsxs("div", { className: clsx(filterSectionStyles['filter-section-item'], styles['active-filter-item']), children: [jsxs("span", { children: [jsxs("span", { children: [jsx(FormattedMessage, { id: `facet.${category.label.toLowerCase()}` }), jsx("span", { children: ": " })] }), jsx("span", { className: styles['active-filter-value'], children: filter.label })] }), jsx(IconButton, { className: styles['clear-filter-button'], color: "secondary", onClick: () => onClearFilter(category.label, filter), children: jsx(StrokeCloseboxIcon, {}) })] }, `${category.label}-${filter.value}`)))) }));
18
18
  };
19
19
 
20
20
  export { ActiveFilters };
@@ -1,4 +1,6 @@
1
+ import { OnCountryLanguageChangeHandler } from '../country-selector/connected-country-selector';
1
2
  import { NavigationLinkSource } from '../shared/api/bff/services/bff-service';
2
- export declare function ConnectedFooter({ source }: {
3
+ export declare function ConnectedFooter({ onCountryLanguageChange, source, }: {
4
+ onCountryLanguageChange: OnCountryLanguageChangeHandler;
3
5
  source: NavigationLinkSource;
4
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -4,10 +4,10 @@ import { useCultureCode } from '../intl/use-culture-code.js';
4
4
  import { useFetchNavigationLinks } from '../shared/api/bff/hooks/use-fetch-navigation-links.js';
5
5
  import { Footer } from './footer.js';
6
6
 
7
- function ConnectedFooter({ source }) {
7
+ function ConnectedFooter({ onCountryLanguageChange, source, }) {
8
8
  const cultureCode = useCultureCode();
9
9
  const { data } = useFetchNavigationLinks({ cultureCode, source });
10
- return (jsx(Footer, { bottomLinks: data?.footer.bottomLinks || [], copyright: data?.footer.copyright || '', countrySelector: jsx(ConnectedCountrySelector, { defaultCountryCode: "NL", defaultLanguageCode: "EN" }), linkBlocks: data?.footer.linkBlocks || [] }));
10
+ return (jsx(Footer, { bottomLinks: data?.footer.bottomLinks || [], copyright: data?.footer.copyright || '', countrySelector: jsx(ConnectedCountrySelector, { defaultCountryCode: "NL", defaultLanguageCode: "EN", onChange: onCountryLanguageChange }), linkBlocks: data?.footer.linkBlocks || [] }));
11
11
  }
12
12
 
13
13
  export { ConnectedFooter };
@@ -1,23 +1,23 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { Link } from '../buttons/link/link.js';
3
4
  import { Accordion } from '../collapsables/accordion/accordion.js';
4
5
  import { AccordionItem } from '../collapsables/accordion/accordion-item.js';
5
6
  import { logger } from '../logging/logger.js';
6
7
  import { useIsBreakpoint } from '../shared/hooks/use-is-breakpoint.js';
7
- import { RouteLink } from '../shared/routing/route-link.js';
8
8
  import styles from './footer.module.css.js';
9
9
 
10
10
  function BottomSection({ bottomLinks, copyright, countrySelector, }) {
11
- return (jsxs("div", { className: styles['bottom-section'], children: [copyright && jsx("p", { className: styles.copyright, children: copyright }), bottomLinks.length > 0 && (jsx("div", { className: styles['bottom-links'], children: bottomLinks.map(link => (jsx(RouteLink, { className: styles['bottom-link'], href: link.url, target: link.openInNewTab ? '_blank' : undefined, children: link.title }, link.key))) })), countrySelector] }));
11
+ return (jsxs("div", { className: styles['bottom-section'], children: [copyright && jsx("p", { className: styles.copyright, children: copyright }), bottomLinks.length > 0 && (jsx("div", { className: styles['bottom-links'], children: bottomLinks.map(link => (jsx(Link, { className: styles['bottom-link'], href: link.url, target: link.openInNewTab ? '_blank' : undefined, children: link.title }, link.key))) })), countrySelector] }));
12
12
  }
13
13
  function LinkSection({ link }) {
14
14
  const isXl = useIsBreakpoint('xl');
15
- return (jsx("div", { className: styles['link-block'], children: jsx(Accordion, { color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: !isXl, id: `link-block-${link.key}`, initialIsOpen: isXl, title: link.title, children: jsx("ul", { className: styles['list'], children: link.links?.map(link => jsx(Link, { link: link }, link.key)) }) }) }) }, link.key));
15
+ return (jsx("div", { className: styles['link-block'], children: jsx(Accordion, { color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: !isXl, id: `link-block-${link.key}`, initialIsOpen: isXl, title: link.title, children: jsx("ul", { className: styles['list'], children: link.links?.map(link => jsx(FooterLink, { link: link }, link.key)) }) }) }) }, link.key));
16
16
  }
17
- function Link({ link }) {
17
+ function FooterLink({ link }) {
18
18
  const type = link.type;
19
19
  if (type === 'link' || type === 'category') {
20
- return (jsx(RouteLink, { href: link.url, target: link.openInNewTab ? '_blank' : undefined, children: link.title }));
20
+ return (jsx(Link, { href: link.url, target: link.openInNewTab ? '_blank' : undefined, children: link.title }));
21
21
  }
22
22
  if (type === 'section') {
23
23
  return jsx(LinkSection, { link: link });
@@ -26,7 +26,7 @@ function Link({ link }) {
26
26
  return null;
27
27
  }
28
28
  function FooterLinkBlock({ linkBlocks }) {
29
- return (jsx("div", { className: styles['main-links'], children: linkBlocks.map(link => (jsx(Link, { link: link }, link.key))) }));
29
+ return (jsx("div", { className: styles['main-links'], children: linkBlocks.map(link => (jsx(FooterLink, { link: link }, link.key))) }));
30
30
  }
31
31
  function Footer({ bottomLinks, copyright, countrySelector, linkBlocks, }) {
32
32
  return (jsxs("footer", { className: styles.footer, children: [jsx(FooterLinkBlock, { linkBlocks: linkBlocks }), jsx(BottomSection, { bottomLinks: bottomLinks, copyright: copyright, countrySelector: countrySelector })] }));
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useAlgoliaSearch } from '../../../algolia/use-algolia-search.js';
4
+ import { Link } from '../../../buttons/link/link.js';
4
5
  import { CardCarousel } from '../../../carousel/card-carousel/card-carousel.js';
5
6
  import { StrokeSearchIcon } from '../../../icons/stroke/stroke-search-icon.js';
6
7
  import { FormattedMessage } from '../../../intl/formatted-message.js';
7
8
  import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
8
9
  import { PromoCard } from '../../../promos/promo-card/promo-card.js';
9
- import { RouteLink } from '../../../shared/routing/route-link.js';
10
10
  import { useGlobalSearchDisclosure } from '../../global-search-provider/use-search-disclosure.js';
11
11
  import { Highlight } from '../../search-highlight/highlight.js';
12
12
  import { SearchList } from '../../search-section/search-list.js';
@@ -39,7 +39,7 @@ function RecentSearchesSection() {
39
39
  return null;
40
40
  }
41
41
  const { items, source } = collection;
42
- return (jsx(SearchSection, { button: jsx(RouteLink, { hasUnderline: true, onClick: () => items.forEach(item => source.onRemove(item.id)), children: jsx(FormattedMessage, { id: "Clear" }) }), title: t('Recent searches'), children: jsx(SearchList, { ...autocomplete.getListProps({ source }), children: items.map(item => (jsx(SearchListItem, { ...autocomplete.getItemProps({
42
+ return (jsx(SearchSection, { button: jsx(Link, { hasUnderline: true, onClick: () => items.forEach(item => source.onRemove(item.id)), children: jsx(FormattedMessage, { id: "Clear" }) }), title: t('Recent searches'), children: jsx(SearchList, { ...autocomplete.getListProps({ source }), children: items.map(item => (jsx(SearchListItem, { ...autocomplete.getItemProps({
43
43
  item,
44
44
  source: source,
45
45
  }), icon: jsx(StrokeSearchIcon, {}), isRemovable: true, onRemove: () => source.onRemove(item.id), text: jsx(Highlight, { attribute: "label", hit: item }) }, item.id))) }) }));
@@ -4,6 +4,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import clsx from 'clsx';
5
5
  import { useAlgoliaInsights } from '../../../algolia/use-algolia-insights.js';
6
6
  import { useAlgoliaSearch } from '../../../algolia/use-algolia-search.js';
7
+ import { Button } from '../../../buttons/button/button.js';
7
8
  import { ConnectedProductCard } from '../../../cards/product-card/connected-product-card.js';
8
9
  import { CardCarousel } from '../../../carousel/card-carousel/card-carousel.js';
9
10
  import { StrokeRecentIcon } from '../../../icons/stroke/stroke-recent-icon.js';
@@ -12,7 +13,6 @@ import { FormattedMessage } from '../../../intl/formatted-message.js';
12
13
  import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
13
14
  import { PromoCard } from '../../../promos/promo-card/promo-card.js';
14
15
  import { isProductHit } from '../../../shared/model/hit.js';
15
- import { RouteButton } from '../../../shared/routing/route-button.js';
16
16
  import { useGlobalSearchDisclosure } from '../../global-search-provider/use-search-disclosure.js';
17
17
  import { Highlight } from '../../search-highlight/highlight.js';
18
18
  import { SearchList } from '../../search-section/search-list.js';
@@ -26,7 +26,7 @@ import styles from './search-content.module.css.js';
26
26
  function WithResults({ isLoading }) {
27
27
  const { state } = useAlgoliaSearch();
28
28
  const { close } = useGlobalSearchDisclosure();
29
- return (jsx("div", { children: jsx(SectionContainer, { buttons: !isLoading && (jsx(RouteButton, { withArrow: true, className: clsx(styles['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${encodeURIComponent(state.query)}`, onClick: close, children: jsx(FormattedMessage, { id: "See all results" }) })), leftContent: jsx(SuggestionsSection, {}), rightContent: isLoading ? jsx(SearchingSection, {}) : jsx(ProductResultsSection, {}) }) }));
29
+ return (jsx("div", { children: jsx(SectionContainer, { buttons: !isLoading && (jsx(Button, { withArrow: true, className: clsx(styles['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${encodeURIComponent(state.query)}`, onClick: close, children: jsx(FormattedMessage, { id: "See all results" }) })), leftContent: jsx(SuggestionsSection, {}), rightContent: isLoading ? jsx(SearchingSection, {}) : jsx(ProductResultsSection, {}) }) }));
30
30
  }
31
31
  function SuggestionsSection() {
32
32
  const { autocomplete, categories, querySuggestions, recentSearches } = useAlgoliaSearch();
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
  import { jsx } from 'react/jsx-runtime';
3
+ import { IconButton } from '../../../buttons/icon-button/icon-button.js';
3
4
  import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
4
5
  import { AccountIcon } from '../../../navigation/account-icon/account-icon.js';
5
6
  import { useFetchSession } from '../../../shared/api/storefront/hooks/authentication/use-fetch-session.js';
6
- import { RouteIconButton } from '../../../shared/routing/route-icon-button.js';
7
7
 
8
8
  function ConnectedAccountButton({ className, 'data-test-selector': dataTestSelector, href, onClick, }) {
9
9
  const t = useFormattedMessage();
10
10
  const { data: { isAuthenticated } = {} } = useFetchSession();
11
- return (jsx(RouteIconButton, { className: className, "data-test-selector": dataTestSelector, href: href, onClick: onClick, children: jsx(AccountIcon, { "aria-label": isAuthenticated ? t('My account') : t('Sign in or create account'), isAuthenticated: isAuthenticated }) }));
11
+ return (jsx(IconButton, { className: className, "data-test-selector": dataTestSelector, href: href, onClick: onClick, children: jsx(AccountIcon, { "aria-label": isAuthenticated ? t('My account') : t('Sign in or create account'), isAuthenticated: isAuthenticated }) }));
12
12
  }
13
13
 
14
14
  export { ConnectedAccountButton };