@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
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { ElementType } from 'react';
|
|
1
2
|
export interface RouteContext {
|
|
3
|
+
Link?: ElementType<RouteLinkElementProps>;
|
|
2
4
|
basePath?: string;
|
|
3
5
|
navigate: NavigateFunction;
|
|
4
6
|
}
|
|
7
|
+
export interface RouteLinkElementProps extends React.HTMLProps<HTMLAnchorElement> {
|
|
8
|
+
href: string;
|
|
9
|
+
onNavigate: () => void;
|
|
10
|
+
route?: NavigateOptions;
|
|
11
|
+
}
|
|
5
12
|
export interface NavigateOptions {
|
|
6
13
|
prefetch?: boolean;
|
|
7
14
|
reload?: boolean;
|
|
8
15
|
replace?: boolean;
|
|
16
|
+
scroll?: boolean;
|
|
9
17
|
}
|
|
10
18
|
export type NavigateFunction = (href: string, options?: NavigateOptions) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRouteLinkElement(): React.ElementType<import("./types").RouteLinkElementProps> | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useGlobalState } from '../providers/global-state-provider.js';
|
|
2
|
+
|
|
3
|
+
function useRouteLinkElement() {
|
|
4
|
+
const [state] = useGlobalState('routing');
|
|
5
|
+
if (!state) {
|
|
6
|
+
throw new Error('RouteProvider not found');
|
|
7
|
+
}
|
|
8
|
+
return state.Link;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useRouteLinkElement };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NavigateOptions } from './types';
|
|
2
|
+
export declare function useRouteLink(): {
|
|
3
|
+
RouteLinkElement: React.ElementType<import("./types").RouteLinkElementProps> | undefined;
|
|
4
|
+
getRouteLinkProps: (href: string, route?: NavigateOptions) => {
|
|
5
|
+
href: string;
|
|
6
|
+
onNavigate: () => void;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { buildHref } from './route-utils.js';
|
|
3
|
+
import { useBasePath } from './use-base-path.js';
|
|
4
|
+
import { useOnNavigate } from './use-on-navigate.js';
|
|
5
|
+
import { useRouteLinkElement } from './use-route-link-element.js';
|
|
6
|
+
|
|
7
|
+
function useRouteLink() {
|
|
8
|
+
const basePath = useBasePath();
|
|
9
|
+
const RouteLinkElement = useRouteLinkElement();
|
|
10
|
+
const triggerCallbacks = useOnNavigate();
|
|
11
|
+
const getRouteLinkProps = useCallback((href, route) => {
|
|
12
|
+
href = buildHref({ basePath, href });
|
|
13
|
+
return {
|
|
14
|
+
href,
|
|
15
|
+
onNavigate: () => triggerCallbacks(href, route),
|
|
16
|
+
};
|
|
17
|
+
}, [basePath, triggerCallbacks]);
|
|
18
|
+
return {
|
|
19
|
+
RouteLinkElement,
|
|
20
|
+
getRouteLinkProps,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useRouteLink };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NavigateOptions } from './types';
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { NavigateOptions, RouteLinkElementProps } from './types';
|
|
3
3
|
export interface WithRoutingProps {
|
|
4
4
|
href?: string;
|
|
5
5
|
route?: NavigateOptions;
|
|
6
6
|
}
|
|
7
|
-
export declare function withRouting<
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
onClick?: MouseEventHandler<TElement> | undefined;
|
|
10
|
-
}, TElement extends HTMLElement>(component: TComponent): React.ForwardRefExoticComponent<React.PropsWithoutRef<ComponentProps<TComponent> & WithRoutingProps> & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export declare function withRouting(component: ElementType<RouteLinkElementProps>): React.FunctionComponent<RouteLinkElementProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createElement } from 'react';
|
|
2
2
|
import { useBasePath } from './use-base-path.js';
|
|
3
3
|
import { useNavigate } from './use-navigate.js';
|
|
4
4
|
|
|
5
5
|
function withRouting(component) {
|
|
6
|
-
const Component =
|
|
6
|
+
const Component = ({ href, onClick, route, ...rest }) => {
|
|
7
7
|
const { navigate } = useNavigate();
|
|
8
8
|
const basePath = useBasePath();
|
|
9
9
|
if (basePath &&
|
|
@@ -15,7 +15,7 @@ function withRouting(component) {
|
|
|
15
15
|
const props = {
|
|
16
16
|
...rest,
|
|
17
17
|
href,
|
|
18
|
-
onClick(e) {
|
|
18
|
+
onClick: (e) => {
|
|
19
19
|
onClick?.(e);
|
|
20
20
|
if (!href)
|
|
21
21
|
return;
|
|
@@ -28,11 +28,11 @@ function withRouting(component) {
|
|
|
28
28
|
}
|
|
29
29
|
return navigate(href, route);
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
route,
|
|
32
32
|
};
|
|
33
33
|
return createElement(component, props);
|
|
34
|
-
}
|
|
35
|
-
Component.displayName = `WithRouting(${component.
|
|
34
|
+
};
|
|
35
|
+
Component.displayName = `WithRouting(${component.toString()})`;
|
|
36
36
|
return Component;
|
|
37
37
|
}
|
|
38
38
|
|