@sonic-equipment/ui 169.0.0 → 171.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.
- package/dist/algolia/algolia-active-categories.js +2 -2
- package/dist/algolia/algolia-query-string-routing.js +2 -2
- package/dist/breadcrumbs/breadcrumb.js +4 -4
- package/dist/buttons/button/button.d.ts +5 -2
- package/dist/buttons/button/button.js +19 -11
- package/dist/buttons/icon-button/icon-button.d.ts +7 -3
- package/dist/buttons/icon-button/icon-button.js +9 -5
- package/dist/buttons/link/link.d.ts +2 -0
- package/dist/buttons/link/link.js +10 -9
- package/dist/cards/category-card/category-card.d.ts +3 -1
- package/dist/cards/category-card/category-card.js +4 -4
- package/dist/cards/orderline-card/orderline-card.js +2 -2
- package/dist/cards/product-card/connected-product-card.d.ts +2 -0
- package/dist/cards/product-card/product-card.d.ts +3 -1
- package/dist/cards/product-card/product-card.js +3 -3
- package/dist/carousel/carousel.js +3 -3
- package/dist/carousel/usp-carousel/usp-carousel.js +1 -1
- package/dist/collapsables/show-all/show-all.js +2 -2
- package/dist/drawer/drawer.d.ts +2 -1
- package/dist/drawer/drawer.js +2 -2
- package/dist/drawer/use-drawer.js +1 -0
- package/dist/exports.d.ts +3 -3
- package/dist/filters/active-filters/active-filters.js +2 -2
- package/dist/footer/footer.js +6 -6
- package/dist/forms/select-field/select-field.js +1 -0
- package/dist/global-search/search-result-panel/sections/no-search.js +2 -2
- package/dist/global-search/search-result-panel/sections/with-results.js +5 -6
- package/dist/header/buttons/account/connected-account-button.js +2 -2
- package/dist/header/buttons/cart/connected-cart-button.js +2 -2
- package/dist/header/buttons/favorites/connected-favorites-button.js +2 -2
- package/dist/header/buttons/search/search-button.js +2 -2
- package/dist/header/drawers/desktop-navigation-drawer.js +2 -1
- package/dist/header/drawers/mobile-navigation-drawer.js +2 -1
- package/dist/header/drawers/search-drawer.js +1 -1
- package/dist/header/header.js +1 -1
- package/dist/header/link-list/navigation-link-list.d.ts +2 -1
- package/dist/header/link-list/navigation-link-list.js +6 -5
- package/dist/header/sonic-logo/sonic-logo.d.ts +2 -1
- package/dist/header/sonic-logo/sonic-logo.js +4 -4
- package/dist/index.js +3 -3
- package/dist/lists/menu-list/menu-list-back-button.d.ts +2 -1
- package/dist/lists/menu-list/menu-list-back-button.js +2 -2
- package/dist/lists/menu-list/menu-list-header.d.ts +2 -1
- package/dist/lists/menu-list/menu-list-header.js +3 -3
- package/dist/lists/menu-list/menu-list-item.d.ts +2 -1
- package/dist/lists/menu-list/menu-list-item.js +3 -3
- package/dist/lists/menu-list/menu-list.js +1 -1
- package/dist/media/image-lightbox/image-lightbox.js +3 -3
- package/dist/modals/signin/sign-in-dialog.js +2 -2
- package/dist/navigation/cart-icon/cart-icon.js +1 -1
- package/dist/navigation/mobile-navigation/mobile-navigation.js +1 -1
- package/dist/navigation/panel-navigation/panel-navigation.d.ts +2 -1
- package/dist/navigation/panel-navigation/panel-navigation.js +4 -4
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/free-mode.js +1 -1
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/thumbs.js +1 -1
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/swiper-core.js +30 -15
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/update-on-virtual-data.js +1 -0
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/update-swiper.js +4 -2
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/utils.js +13 -1
- package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/swiper-react.js +2 -2
- package/dist/notifications/announcements/announcement-list.js +1 -1
- package/dist/notifications/announcements/announcement.js +3 -3
- package/dist/pages/account/components/sign-in-form/sign-in-form.js +1 -2
- package/dist/pages/account/create-account-page/create-account-page.js +2 -2
- package/dist/pages/checkout/cart-page/cart-page.js +4 -6
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +3 -3
- package/dist/pages/checkout/payment-page/hooks/use-get-adyen-redirect-result.js +1 -0
- package/dist/pages/checkout/shipping-page/components/currency-change-dialog.js +2 -2
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +3 -3
- package/dist/pages/product/components/product-overview.d.ts +2 -0
- package/dist/pages/product/components/product-overview.js +1 -1
- package/dist/pages/product/product-listing-page/no-results/no-results.js +2 -2
- package/dist/pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +1 -1
- package/dist/pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +1 -1
- package/dist/promos/promo-banner/promo-banner.js +2 -2
- package/dist/promos/promo-card/promo-card.js +2 -2
- package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.d.ts +1 -1
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.d.ts +1 -1
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.d.ts +1 -1
- package/dist/shared/hooks/use-debounced-callback.js +1 -0
- package/dist/shared/hooks/use-enable-mobile-zoom.js +1 -0
- package/dist/shared/hooks/use-intersection-observer.js +1 -0
- package/dist/shared/hooks/use-mutation-observer.js +1 -0
- package/dist/shared/hooks/use-resize-observer.js +1 -0
- package/dist/shared/routing/route-provider.d.ts +4 -3
- package/dist/shared/routing/route-provider.js +4 -2
- package/dist/shared/routing/route-utils.d.ts +4 -0
- package/dist/shared/routing/route-utils.js +8 -0
- package/dist/shared/routing/types.d.ts +8 -0
- package/dist/shared/routing/use-route-link-element.d.ts +1 -0
- package/dist/shared/routing/use-route-link-element.js +11 -0
- package/dist/shared/routing/use-route-link.d.ts +8 -0
- package/dist/shared/routing/use-route-link.js +24 -0
- package/dist/shared/routing/with-routing.d.ts +3 -6
- package/dist/shared/routing/with-routing.js +6 -6
- package/dist/shared/utils/price.d.ts +1 -1
- package/dist/styles.css +2 -2
- package/package.json +45 -45
- package/dist/shared/routing/route-button.d.ts +0 -1
- package/dist/shared/routing/route-button.js +0 -7
- package/dist/shared/routing/route-icon-button.d.ts +0 -1
- package/dist/shared/routing/route-icon-button.js +0 -7
- package/dist/shared/routing/route-link.d.ts +0 -1
- package/dist/shared/routing/route-link.js +0 -7
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/routers/history.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/stateMappings/simple.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/documentation.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/logger.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/noop.js +0 -0
- /package/dist/node_modules/.pnpm/{instantsearch.js@4.78.0_algoliasearch@4.24.0 → instantsearch.js@4.78.3_algoliasearch@4.24.0}/node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/modules/navigation.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/create-element-if-not-defined.js +0 -0
- /package/dist/node_modules/.pnpm/{swiper@11.2.5 → swiper@11.2.8}/node_modules/swiper/shared/ssr-window.esm.js +0 -0
|
@@ -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(
|
|
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
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import simpleStateMapping from '../node_modules/.pnpm/instantsearch.js@4.78.
|
|
3
|
-
import historyRouter from '../node_modules/.pnpm/instantsearch.js@4.78.
|
|
2
|
+
import simpleStateMapping from '../node_modules/.pnpm/instantsearch.js@4.78.3_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/stateMappings/simple.js';
|
|
3
|
+
import historyRouter from '../node_modules/.pnpm/instantsearch.js@4.78.3_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/routers/history.js';
|
|
4
4
|
|
|
5
5
|
function createQueryStringRouting({ algoliaIndex, hierarchicalCategories, }) {
|
|
6
6
|
return {
|
|
@@ -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(
|
|
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(
|
|
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(
|
|
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<
|
|
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
|
|
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,32 @@ 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 { useRouteLink } from '../../shared/routing/use-route-link.js';
|
|
7
8
|
import buttonStyles from './button.module.css.js';
|
|
8
9
|
|
|
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
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (_onClick)
|
|
15
|
-
_onClick(e);
|
|
10
|
+
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, }) {
|
|
11
|
+
const { getRouteLinkProps, RouteLinkElement } = useRouteLink();
|
|
12
|
+
const handleButtonClick = (e) => {
|
|
13
|
+
if (onClick)
|
|
14
|
+
onClick(e);
|
|
16
15
|
e.stopPropagation();
|
|
17
16
|
if (type === 'submit')
|
|
18
17
|
return;
|
|
19
18
|
e.preventDefault();
|
|
20
19
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const classNames = clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, { [buttonStyles['loading-uninformative']]: isLoading === true }, {
|
|
21
|
+
[buttonStyles['loading-informative']]: isLoading &&
|
|
22
|
+
(typeof isLoading === 'string' || isValidElement(isLoading)),
|
|
23
|
+
}, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className);
|
|
24
|
+
const showIconOnLeft = icon && iconPosition === 'left';
|
|
25
|
+
const showIconOnRight = icon && iconPosition === 'right';
|
|
26
|
+
const iconElement = icon && jsx("span", { className: buttonStyles.icon, children: icon });
|
|
27
|
+
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' }))] }));
|
|
28
|
+
if (href) {
|
|
29
|
+
const Element = RouteLinkElement || 'a';
|
|
30
|
+
return (jsx(Element, { className: classNames, "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, onClick: onClick, route: route, type: type, ...getRouteLinkProps(href, route), children: children }));
|
|
31
|
+
}
|
|
32
|
+
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
33
|
}
|
|
26
34
|
|
|
27
35
|
export { Button };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { NavigateOptions } from '../../shared/routing/types';
|
|
1
3
|
export interface IconButtonProps {
|
|
2
|
-
children:
|
|
4
|
+
children: ReactNode;
|
|
3
5
|
className?: string;
|
|
4
6
|
color?: 'primary' | 'secondary' | 'current-color';
|
|
7
|
+
'data-test-selector'?: string;
|
|
5
8
|
href?: string;
|
|
6
9
|
isDisabled?: boolean;
|
|
7
|
-
onClick?: (event:
|
|
10
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
11
|
+
route?: NavigateOptions;
|
|
8
12
|
size?: 'md' | 'lg';
|
|
9
13
|
target?: string;
|
|
10
14
|
title?: string;
|
|
11
15
|
type?: 'button' | 'submit' | 'reset';
|
|
12
16
|
}
|
|
13
|
-
export declare function IconButton({ children, className, color, href, isDisabled, onClick
|
|
17
|
+
export declare function IconButton({ children, className: _className, color, 'data-test-selector': dataTestSelector, href, isDisabled, onClick, route, size, target, title, type, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { useRouteLink } from '../../shared/routing/use-route-link.js';
|
|
4
5
|
import styles from './icon-button.module.css.js';
|
|
5
6
|
|
|
6
|
-
function IconButton({ children, className, color = 'primary', href, isDisabled, onClick
|
|
7
|
-
const
|
|
7
|
+
function IconButton({ children, className: _className, color = 'primary', 'data-test-selector': dataTestSelector, href, isDisabled, onClick, route, size = 'md', target, title, type = 'button', ...rest }) {
|
|
8
|
+
const { getRouteLinkProps, RouteLinkElement } = useRouteLink();
|
|
9
|
+
const handleButtonClick = (e) => {
|
|
8
10
|
e.preventDefault();
|
|
9
11
|
e.stopPropagation();
|
|
10
|
-
|
|
12
|
+
onClick?.(e);
|
|
11
13
|
};
|
|
14
|
+
const className = clsx(styles['icon-button'], styles[size], styles[color], _className);
|
|
12
15
|
if (href) {
|
|
13
|
-
|
|
16
|
+
const Element = RouteLinkElement || 'a';
|
|
17
|
+
return (jsx(Element, { className: className, "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, onClick: onClick, target: target, title: title, ...getRouteLinkProps(href, route), ...rest, children: children }));
|
|
14
18
|
}
|
|
15
|
-
return (jsx("button", { className:
|
|
19
|
+
return (jsx("button", { className: className, "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, disabled: isDisabled, onClick: handleButtonClick, title: title, type: type, ...rest, children: children }));
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
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,20 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
+
import { useRouteLink } from '../../shared/routing/use-route-link.js';
|
|
5
6
|
import styles from './link.module.css.js';
|
|
6
7
|
|
|
7
|
-
const Link = forwardRef(({ children, className, color, hasUnderline, href, id, isDisabled, onClick, onKeyUp, role, tabIndex, target, title, ...rest }, ref) => {
|
|
8
|
+
const Link = forwardRef(({ children, className: _className, color, hasUnderline, href, id, isDisabled, onClick, onKeyUp, role, route, tabIndex, target, title, ...rest }, ref) => {
|
|
9
|
+
const { getRouteLinkProps, RouteLinkElement } = useRouteLink();
|
|
10
|
+
const className = clsx({
|
|
11
|
+
[styles.hover]: Boolean(href || onClick),
|
|
12
|
+
[styles['has-underline']]: hasUnderline,
|
|
13
|
+
}, styles['link'], color && styles[color], _className);
|
|
8
14
|
if (href) {
|
|
9
|
-
|
|
10
|
-
|
|
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 }));
|
|
15
|
+
const Element = RouteLinkElement || 'a';
|
|
16
|
+
return (jsx(Element, { ref: ref, className: className, "data-disabled": isDisabled ? true : undefined, id: id, onClick: onClick, onKeyUp: onKeyUp, role: role, tabIndex: isDisabled ? -1 : tabIndex, target: target, title: title, ...getRouteLinkProps(href, route), ...rest, children: children }));
|
|
13
17
|
}
|
|
14
|
-
return (jsx("button", { ref: ref, className:
|
|
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 }));
|
|
18
|
+
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
19
|
});
|
|
19
20
|
Link.displayName = 'Link';
|
|
20
21
|
|
|
@@ -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(
|
|
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(
|
|
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(
|
|
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,9 +2,9 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useMemo } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import Navigation from '../node_modules/.pnpm/swiper@11.2.
|
|
6
|
-
import freeMode from '../node_modules/.pnpm/swiper@11.2.
|
|
7
|
-
import { Swiper, SwiperSlide } from '../node_modules/.pnpm/swiper@11.2.
|
|
5
|
+
import Navigation from '../node_modules/.pnpm/swiper@11.2.8/node_modules/swiper/modules/navigation.js';
|
|
6
|
+
import freeMode from '../node_modules/.pnpm/swiper@11.2.8/node_modules/swiper/modules/free-mode.js';
|
|
7
|
+
import { Swiper, SwiperSlide } from '../node_modules/.pnpm/swiper@11.2.8/node_modules/swiper/swiper-react.js';
|
|
8
8
|
import { breakpoints } from '../shared/utils/breakpoints.js';
|
|
9
9
|
import { deepMerge } from '../shared/utils/merge.js';
|
|
10
10
|
import { CarouselNavigationButton } from './carousel-navigation-button.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
|
-
import { Swiper, SwiperSlide } from '../../node_modules/.pnpm/swiper@11.2.
|
|
4
|
+
import { Swiper, SwiperSlide } from '../../node_modules/.pnpm/swiper@11.2.8/node_modules/swiper/swiper-react.js';
|
|
5
5
|
import { CarouselPagination } from '../pagination/pagination.js';
|
|
6
6
|
import styles from './usp-carousel.module.css.js';
|
|
7
7
|
|
|
@@ -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(
|
|
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();
|
package/dist/drawer/drawer.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface DrawerProps {
|
|
|
13
13
|
allowCloseOnBackgroundClick?: boolean;
|
|
14
14
|
children: ReactNode | ((args: ChildrenFunctionArgs) => ReactNode);
|
|
15
15
|
className?: string;
|
|
16
|
+
'data-test-selector'?: string;
|
|
16
17
|
groupId?: string;
|
|
17
18
|
instanceId?: string;
|
|
18
19
|
isInitialOpen?: boolean;
|
|
@@ -24,4 +25,4 @@ export interface DrawerProps {
|
|
|
24
25
|
showUnder?: 'header' | 'announcement';
|
|
25
26
|
timeout?: number;
|
|
26
27
|
}
|
|
27
|
-
export declare function Drawer({ allowCloseOnBackgroundClick, children, className, groupId, instanceId, isInitialOpen, isOpen: isOpenControlled, onClose, onClosed, position, showBackgroundOverlay, showUnder, timeout, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function Drawer({ allowCloseOnBackgroundClick, children, className, 'data-test-selector': dataTestSelector, groupId, instanceId, isInitialOpen, isOpen: isOpenControlled, onClose, onClosed, position, showBackgroundOverlay, showUnder, timeout, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/drawer/drawer.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createAddEndListener } from '../collapsables/unmounter/utils.js';
|
|
|
8
8
|
import { useDrawer } from './use-drawer.js';
|
|
9
9
|
import styles from './drawer.module.css.js';
|
|
10
10
|
|
|
11
|
-
function Drawer({ allowCloseOnBackgroundClick, children, className, groupId, instanceId, isInitialOpen = false, isOpen: isOpenControlled, onClose, onClosed, position, showBackgroundOverlay, showUnder, timeout, }) {
|
|
11
|
+
function Drawer({ allowCloseOnBackgroundClick, children, className, 'data-test-selector': dataTestSelector, groupId, instanceId, isInitialOpen = false, isOpen: isOpenControlled, onClose, onClosed, position, showBackgroundOverlay, showUnder, timeout, }) {
|
|
12
12
|
const wasOpenRef = useRef(isInitialOpen);
|
|
13
13
|
const asideRef = useRef(null);
|
|
14
14
|
const useDrawerResult = useDrawer({
|
|
@@ -30,7 +30,7 @@ function Drawer({ allowCloseOnBackgroundClick, children, className, groupId, ins
|
|
|
30
30
|
return onClosed;
|
|
31
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
32
|
}, []);
|
|
33
|
-
return (jsxs(Fragment, { children: [jsx(CSSTransition, { mountOnEnter: true, unmountOnExit: true, addEndListener: createAddEndListener(asideRef), in: isOpen, nodeRef: asideRef, onExited: onClosed, timeout: timeout, children: jsx("aside", { ref: asideRef, className: clsx(styles.drawer, styles[position], showUnder === 'header' && styles['under-header'], showUnder === 'announcement' && styles['under-announcement'], className), children: children instanceof Function ? children(useDrawerResult) : children }, `${groupId}-${instanceId}`) }, groupId), showBackgroundOverlay && (jsx(BackgroundOverlay, { isOpen: isOpen, onClick: () => {
|
|
33
|
+
return (jsxs(Fragment, { children: [jsx(CSSTransition, { mountOnEnter: true, unmountOnExit: true, addEndListener: createAddEndListener(asideRef), in: isOpen, nodeRef: asideRef, onExited: onClosed, timeout: timeout, children: jsx("aside", { ref: asideRef, className: clsx(styles.drawer, styles[position], showUnder === 'header' && styles['under-header'], showUnder === 'announcement' && styles['under-announcement'], className), "data-test-selector": dataTestSelector, children: children instanceof Function ? children(useDrawerResult) : children }, `${groupId}-${instanceId}`) }, groupId), showBackgroundOverlay && (jsx(BackgroundOverlay, { isOpen: isOpen, onClick: () => {
|
|
34
34
|
if (!allowCloseOnBackgroundClick)
|
|
35
35
|
return;
|
|
36
36
|
if (isControlled) {
|
package/dist/exports.d.ts
CHANGED
|
@@ -349,14 +349,14 @@ 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';
|
|
359
|
+
export * from './shared/routing/use-route-link-element';
|
|
360
360
|
export * from './shared/routing/with-routing';
|
|
361
361
|
export * from './shared/utils/array';
|
|
362
362
|
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(
|
|
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 };
|
package/dist/footer/footer.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
|
17
|
+
function FooterLink({ link }) {
|
|
18
18
|
const type = link.type;
|
|
19
19
|
if (type === 'link' || type === 'category') {
|
|
20
|
-
return (jsx(
|
|
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(
|
|
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 })] }));
|
|
@@ -19,6 +19,7 @@ function SelectField({ className, 'data-test-selector': dataTestSelector, defaul
|
|
|
19
19
|
onChange?.(key);
|
|
20
20
|
};
|
|
21
21
|
useEffect(() => {
|
|
22
|
+
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
22
23
|
setSelectedKey(selectedOption);
|
|
23
24
|
}, [selectedOption]);
|
|
24
25
|
return (jsx(Select, { "aria-label": label, className: clsx(styles['select-field'], styles[size], styles[variant], {
|
|
@@ -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(
|
|
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))) }) }));
|