@sonic-equipment/ui 0.0.62 → 0.0.64
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/index.d.ts +70 -58
- package/dist/index.js +114 -104
- package/dist/src/algolia/algolia-provider.d.ts +2 -1
- package/dist/src/algolia/algolia-query-string-routing.d.ts +2 -2
- package/dist/src/breadcrumbs/breadcrumb.d.ts +2 -2
- package/dist/src/buttons/button/button.d.ts +4 -2
- package/dist/src/buttons/button/button.stories.d.ts +1 -0
- package/dist/src/buttons/favorite/connected-favorite-button.d.ts +1 -1
- package/dist/src/buttons/link/link.d.ts +14 -0
- package/dist/src/buttons/link/link.stories.d.ts +23 -0
- package/dist/src/cards/product-card/product-card.d.ts +2 -2
- package/dist/src/config.d.ts +1 -2
- package/dist/src/global-search/search-input/search-input.d.ts +3 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/intl/translation-id.d.ts +1 -1
- package/dist/src/pages/page/page.d.ts +2 -2
- package/dist/src/pages/product-listing-page/product-listing-page-data-types.d.ts +1 -0
- package/dist/src/shared/api/bff/model/bff.model.d.ts +1 -0
- package/dist/src/shared/api/shop/hooks/wishlist/use-fetch-all-wishlists-items.d.ts +5 -1
- package/dist/src/shared/routing/route-button.d.ts +2 -4
- package/dist/src/shared/routing/route-button.stories.d.ts +16 -0
- package/dist/src/shared/routing/route-link.d.ts +2 -11
- package/dist/src/shared/routing/route-link.stories.d.ts +16 -0
- package/dist/styles.css +145 -129
- package/package.json +1 -1
- package/dist/src/buttons/link-button/link-button.d.ts +0 -15
- package/dist/src/buttons/link-button/link-button.stories.d.ts +0 -19
- package/dist/src/shared/routing/route-provider.stories.d.ts +0 -16
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useQuery, useQueryClient, useMutation, QueryClient, QueryClientProvider
|
|
|
2
2
|
import qs from 'query-string';
|
|
3
3
|
import React, { useState, useCallback, useEffect, useRef, createContext, useContext, forwardRef, useLayoutEffect, Children, cloneElement, createElement as createElement$1, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
import { Link, Button as Button$1, Breadcrumbs, Breadcrumb as Breadcrumb$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, Section, Header, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1, ModalOverlay, Modal as Modal$1, Dialog as Dialog$1, Form } from 'react-aria-components';
|
|
5
|
+
import { Link as Link$1, Button as Button$1, Breadcrumbs, Breadcrumb as Breadcrumb$1, FieldError as FieldError$1, useContextProps, InputContext, Input as Input$1, Label as Label$1, NumberField as NumberField$1, Checkbox as Checkbox$1, Select as Select$1, SelectValue, Popover, ListBox, Section, Header, ListBoxItem, TextAreaContext, TextArea as TextArea$1, TextField as TextField$1, ModalOverlay, Modal as Modal$1, Dialog as Dialog$1, Form } from 'react-aria-components';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { useHierarchicalMenu, useCurrentRefinements, useClearRefinements, useRefinementList, useHits, useDynamicWidgets, usePagination, useInstantSearch as useInstantSearch$1, InstantSearch, Configure, useSortBy } from 'react-instantsearch';
|
|
8
8
|
import { useInstantSearch } from 'react-instantsearch-core';
|
|
@@ -54,18 +54,16 @@ const configPerEnvironment = {
|
|
|
54
54
|
production: {
|
|
55
55
|
ALGOLIA_API_KEY: 'e31a3a53449eceb4d0f9273b9bcd9759',
|
|
56
56
|
ALGOLIA_APP_ID: '14CUFCVMAD',
|
|
57
|
-
ALGOLIA_HOST: '
|
|
58
|
-
|
|
59
|
-
PROXY_API_URL: 'https://shop.sonic-equipment.com/api/v1/bff',
|
|
57
|
+
ALGOLIA_HOST: 'shop.sonic-equipment.com',
|
|
58
|
+
BFF_API_URL: 'https://shop.sonic-equipment.com/api/v1/bff',
|
|
60
59
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
61
60
|
SHOP_API_URL: 'https://shop.sonic-equipment.com',
|
|
62
61
|
},
|
|
63
62
|
sandbox: {
|
|
64
63
|
ALGOLIA_API_KEY: 'e0edf30798a6b2e4e44fd25f0f2f9646',
|
|
65
64
|
ALGOLIA_APP_ID: 'testing9VXJ0U4GSV',
|
|
66
|
-
ALGOLIA_HOST: '
|
|
67
|
-
|
|
68
|
-
PROXY_API_URL: 'https://sonicequipment.commerce.insitesandbox.com/api/v1/bff',
|
|
65
|
+
ALGOLIA_HOST: 'sonicequipment.commerce.insitesandbox.com',
|
|
66
|
+
BFF_API_URL: 'https://sonicequipment.commerce.insitesandbox.com/api/v1/bff',
|
|
69
67
|
SHOP_API_URL:
|
|
70
68
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
71
69
|
'https://sonicequipment.commerce.insitesandbox.com',
|
|
@@ -323,7 +321,7 @@ function useFetchProductListingPageData({ languageCode, pageUrl, }) {
|
|
|
323
321
|
queryFn: async () => {
|
|
324
322
|
return request({
|
|
325
323
|
headers: { 'Current-Language-Id': languageCode },
|
|
326
|
-
url: `${config.
|
|
324
|
+
url: `${config.BFF_API_URL}/plp/?pageUrl=${pageUrl}`,
|
|
327
325
|
});
|
|
328
326
|
},
|
|
329
327
|
queryKey: ['product-listing-page-data', pageUrl, languageCode],
|
|
@@ -344,6 +342,7 @@ function useFetchProductListingPageData({ languageCode, pageUrl, }) {
|
|
|
344
342
|
title: data.categories.shortDescription,
|
|
345
343
|
},
|
|
346
344
|
categoryPages: data.categoryPages,
|
|
345
|
+
hierarchicalCategories: data.hierarchicalCategories,
|
|
347
346
|
promoCards: data.promoCards
|
|
348
347
|
? {
|
|
349
348
|
top: data.promoCards.top,
|
|
@@ -778,9 +777,10 @@ async function getWishListItemsByWishListId({ wishListId, }) {
|
|
|
778
777
|
});
|
|
779
778
|
}
|
|
780
779
|
|
|
781
|
-
function useFetchAllWishListsItems() {
|
|
780
|
+
function useFetchAllWishListsItems({ enabled = true } = { enabled: true }) {
|
|
782
781
|
const queryClient = useQueryClient();
|
|
783
782
|
return useQuery({
|
|
783
|
+
enabled,
|
|
784
784
|
queryFn: async () => {
|
|
785
785
|
const body =
|
|
786
786
|
// Reuse existing data if available
|
|
@@ -817,8 +817,8 @@ function useFavorite() {
|
|
|
817
817
|
return { signInUrl: state.signInUrl };
|
|
818
818
|
}
|
|
819
819
|
function useFavoriteProduct(productId) {
|
|
820
|
-
const { data: entries, isFetching: isFetchingWishListItems } = useFetchAllWishListsItems();
|
|
821
820
|
const isAuthenticated = useIsAuthenticated();
|
|
821
|
+
const { data: entries, isFetching: isFetchingWishListItems } = useFetchAllWishListsItems({ enabled: Boolean(isAuthenticated) });
|
|
822
822
|
const entry = entries?.find(({ wishListItem }) => wishListItem.productId === productId);
|
|
823
823
|
return {
|
|
824
824
|
isFavorite: Boolean(entry),
|
|
@@ -840,6 +840,22 @@ function useNavigate() {
|
|
|
840
840
|
return state.navigate;
|
|
841
841
|
}
|
|
842
842
|
|
|
843
|
+
var styles$Q = {"link":"link-module-xLqBn","primary":"link-module-bGD6u","secondary":"link-module-v31wH","has-underline":"link-module-UuCEp"};
|
|
844
|
+
|
|
845
|
+
function Link({ children, className, color = 'primary', hasUnderline, onClick: _onClick, ...props }) {
|
|
846
|
+
function onClick(e) {
|
|
847
|
+
_onClick?.(e);
|
|
848
|
+
if (props.href)
|
|
849
|
+
return;
|
|
850
|
+
e.preventDefault();
|
|
851
|
+
}
|
|
852
|
+
return (jsx(Link$1, { className: clsx({ [styles$Q['has-underline']]: hasUnderline }, styles$Q['link'], styles$Q[color], className),
|
|
853
|
+
// Workaround for adobe/react-spectrum #963
|
|
854
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
855
|
+
// @ts-ignore
|
|
856
|
+
onClick: onClick, ...props, children: children }));
|
|
857
|
+
}
|
|
858
|
+
|
|
843
859
|
function RouteLink({ children, onClick: _onClick, ...props }) {
|
|
844
860
|
const navigate = useNavigate();
|
|
845
861
|
function onClick(e) {
|
|
@@ -847,33 +863,46 @@ function RouteLink({ children, onClick: _onClick, ...props }) {
|
|
|
847
863
|
if (!props.href)
|
|
848
864
|
return;
|
|
849
865
|
e.preventDefault();
|
|
866
|
+
if (props.isDisabled)
|
|
867
|
+
return;
|
|
850
868
|
navigate(props.href, props.route);
|
|
851
869
|
}
|
|
852
|
-
|
|
870
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
871
|
+
function onHoverStart(e) {
|
|
853
872
|
// TODO: Implement prefetch
|
|
873
|
+
props.onHoverStart?.(e);
|
|
854
874
|
}
|
|
855
|
-
return (jsx(Link
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
, {
|
|
875
|
+
return (jsx(Link, { onClick: onClick, onHoverStart: onHoverStart, ...props, children: children }));
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
function GlyphsArrowBoldCapsRightIcon(props) {
|
|
879
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "11", viewBox: "0 0 11 11", width: "11", children: jsx("path", { d: "M2.31124163,11 C2.06716529,11 1.91839241,10.7730596 2.04771379,10.5980857 L6.08820761,5.13116556 C6.42092595,4.68081431 6.37243043,4.10595375 5.96732409,3.70073526 L2.70240329,0.432177991 C2.53178078,0.261409485 2.67540212,0 2.93972934,0 L5.48361239,0 C5.57518542,0 5.6619622,0.0340936243 5.72102726,0.0931942463 L8.14882304,2.52367916 C9.1607451,3.53657521 9.28198389,4.9729381 8.45036569,6.09787751 L4.91836426,10.876542 C4.86160851,10.9533653 4.7620417,11 4.65492523,11 L2.31124163,11 Z", fillRule: "evenodd" }) }));
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
var buttonStyles = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
|
|
883
|
+
|
|
884
|
+
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, href, icon, iconPosition = 'left', isDisabled, onClick: _onClick, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
|
|
885
|
+
const showIconOnLeft = icon && iconPosition === 'left';
|
|
886
|
+
const showIconOnRight = icon && iconPosition === 'right';
|
|
887
|
+
const onClick = (e) => {
|
|
888
|
+
if (_onClick)
|
|
889
|
+
_onClick(e);
|
|
890
|
+
if (e.isDefaultPrevented())
|
|
891
|
+
return;
|
|
892
|
+
if (href)
|
|
893
|
+
window.location.href = href;
|
|
894
|
+
e.preventDefault();
|
|
895
|
+
};
|
|
896
|
+
return (jsxs(Button$1, { className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), isDisabled: isDisabled,
|
|
860
897
|
// Workaround for adobe/react-spectrum #963
|
|
861
898
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
862
899
|
// @ts-ignore
|
|
863
|
-
onClick: onClick,
|
|
900
|
+
onClick: onClick, onPress: onPress, type: type, children: [jsx(Fragment, { children: showIconOnLeft && jsx("span", { className: buttonStyles.icon, children: icon }) }), children, withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && jsx("span", { className: buttonStyles.icon, children: icon })] }));
|
|
864
901
|
}
|
|
865
902
|
|
|
866
903
|
function RouteButton({ children, ...props }) {
|
|
867
904
|
const navigate = useNavigate();
|
|
868
|
-
return (jsx(Button
|
|
869
|
-
// Workaround for adobe/react-spectrum #963
|
|
870
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
871
|
-
// @ts-ignore
|
|
872
|
-
, {
|
|
873
|
-
// Workaround for adobe/react-spectrum #963
|
|
874
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
875
|
-
// @ts-ignore
|
|
876
|
-
onClick: e => {
|
|
905
|
+
return (jsx(Button, { onClick: e => {
|
|
877
906
|
if (!props.href)
|
|
878
907
|
return;
|
|
879
908
|
e.preventDefault();
|
|
@@ -915,22 +944,22 @@ function SolidHomeIcon(props) {
|
|
|
915
944
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M15.039782,22 C14.6690193,22 14.3684378,21.6994185 14.3684378,21.3286559 L14.3684378,15.6029043 L9.34495251,15.6029043 L9.34495251,21.3286559 C9.34495251,21.6994185 9.04437101,22 8.67345678,22 L3.67134415,22 C3.3005815,22 3,21.6994185 3,21.3286559 L3,9.79560307 C3,9.60127857 3.08412644,9.41665514 3.23055192,9.28917706 L11.4158271,2.16495603 C11.6686612,1.94501466 12.0447291,1.94501466 12.2975632,2.16495603 L20.4828384,9.28917706 C20.6292639,9.41665514 20.7133903,9.60127857 20.7133903,9.79560307 L20.7133903,21.3286559 C20.7133903,21.6994185 20.4128088,22 20.0418946,22 L15.039782,22 Z", fillRule: "evenodd" }) }));
|
|
916
945
|
}
|
|
917
946
|
|
|
918
|
-
var styles$
|
|
947
|
+
var styles$P = {"breadcrumbs":"breadcrumb-module-CQGse","breadcrumb":"breadcrumb-module-hxhDY","link":"breadcrumb-module-fp2Q6","icon":"breadcrumb-module-uIn3w","previous-icon":"breadcrumb-module-K-wMJ"};
|
|
919
948
|
|
|
920
949
|
function BreadcrumbShort({ links }) {
|
|
921
950
|
const homeLink = links[0];
|
|
922
951
|
const previousLink = links[links.length - 2];
|
|
923
|
-
return (jsx(Breadcrumbs, { className: styles$
|
|
952
|
+
return (jsx(Breadcrumbs, { className: styles$P.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles$P.breadcrumb, children: jsxs(RouteLink, { className: styles$P.link, isDisabled: false, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles$P.icon }), previousLink === undefined || previousLink === homeLink ? (jsx(SolidHomeIcon, { className: styles$P.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
|
|
924
953
|
}
|
|
925
954
|
function BreadcrumbLongItem({ index, isDisabled, link, }) {
|
|
926
|
-
return (jsx(Breadcrumb$1, { className: styles$
|
|
955
|
+
return (jsx(Breadcrumb$1, { className: styles$P.breadcrumb, children: jsxs(RouteLink, { className: styles$P.link, color: "secondary", href: link.href, isDisabled: isDisabled, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles$P['previous-icon'], styles$P.icon) }), link.label] }) }, index));
|
|
927
956
|
}
|
|
928
957
|
function BreadcrumbLong({ links }) {
|
|
929
958
|
const linksWithoutFirst = links.slice(1);
|
|
930
959
|
const homeLink = links[0];
|
|
931
960
|
if (!homeLink)
|
|
932
961
|
return null;
|
|
933
|
-
return (jsxs(Breadcrumbs, { className: styles$
|
|
962
|
+
return (jsxs(Breadcrumbs, { className: styles$P.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles$P.breadcrumb, children: jsx(RouteLink, { className: styles$P.link, href: homeLink.href, children: jsx(SolidHomeIcon, { className: clsx(styles$P['home-icon'], styles$P.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, index)))] }));
|
|
934
963
|
}
|
|
935
964
|
function Breadcrumb({ links }) {
|
|
936
965
|
const { lg } = useBreakpoint();
|
|
@@ -939,24 +968,10 @@ function Breadcrumb({ links }) {
|
|
|
939
968
|
return lg ? BreadcrumbLong({ links }) : BreadcrumbShort({ links });
|
|
940
969
|
}
|
|
941
970
|
|
|
942
|
-
|
|
943
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "11", viewBox: "0 0 11 11", width: "11", children: jsx("path", { d: "M2.31124163,11 C2.06716529,11 1.91839241,10.7730596 2.04771379,10.5980857 L6.08820761,5.13116556 C6.42092595,4.68081431 6.37243043,4.10595375 5.96732409,3.70073526 L2.70240329,0.432177991 C2.53178078,0.261409485 2.67540212,0 2.93972934,0 L5.48361239,0 C5.57518542,0 5.6619622,0.0340936243 5.72102726,0.0931942463 L8.14882304,2.52367916 C9.1607451,3.53657521 9.28198389,4.9729381 8.45036569,6.09787751 L4.91836426,10.876542 C4.86160851,10.9533653 4.7620417,11 4.65492523,11 L2.31124163,11 Z", fillRule: "evenodd" }) }));
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
var buttonStyles = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
|
|
947
|
-
|
|
948
|
-
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
|
|
949
|
-
return (jsxs(Button$1, { className: clsx(className, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], { [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, buttonStyles[_pseudo]), isDisabled: isDisabled,
|
|
950
|
-
// Workaround for adobe/react-spectrum #963
|
|
951
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
952
|
-
// @ts-ignore
|
|
953
|
-
onClick: e => e.preventDefault(), onPress: onPress, type: type, children: [icon && iconPosition === 'left' && (jsx("span", { className: buttonStyles.icon, children: icon })), children, withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), icon && iconPosition === 'right' && (jsx("span", { className: buttonStyles.icon, children: icon }))] }));
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
var styles$P = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
|
|
971
|
+
var styles$O = {"icon-button":"icon-button-module-4PDK-","md":"icon-button-module-k3s9J","lg":"icon-button-module-agk6Y","primary":"icon-button-module-fTeP4","secondary":"icon-button-module-dM0eo"};
|
|
957
972
|
|
|
958
973
|
function IconButton({ children, className, color = 'primary', isDisabled, onPress, size = 'md', type = 'button', }) {
|
|
959
|
-
return (jsx(Button$1, { className: clsx(styles$
|
|
974
|
+
return (jsx(Button$1, { className: clsx(styles$O['icon-button'], styles$O[size], styles$O[color], className), isDisabled: isDisabled,
|
|
960
975
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
961
976
|
// @ts-expect-error
|
|
962
977
|
onClick: e => e.preventDefault(), onPress: onPress, type: type, children: children }));
|
|
@@ -970,27 +985,14 @@ function StrokeFavoriteIcon(props) {
|
|
|
970
985
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M7.33319295,3.33090958 C5.12714802,3.33090958 3.33232058,5.12348359 3.33232058,7.32679321 C3.33232058,8.18447047 3.64878056,9.03643889 4.29989998,9.93107334 L11.9997744,20.2227497 L19.7053643,9.92401241 C20.351069,9.03643889 20.6673786,8.1846207 20.6673786,7.32679321 C20.6673786,5.12348359 18.8727016,3.33090958 16.6666566,3.33090958 C14.8537801,3.33090958 13.1222748,4.56251549 12.6388611,6.19569283 C12.5552338,6.47843037 12.2951771,6.67253074 11.9999248,6.67253074 C11.7046724,6.67253074 11.4447662,6.47843037 11.3609885,6.19569283 C10.8775748,4.56251549 9.14606944,3.33090958 7.33319295,3.33090958 M11.9997744,22 L11.9997744,22 C11.7898038,22 11.5918659,21.9008466 11.4662746,21.7327364 L3.22718487,10.720545 C2.41106707,9.59905954 2,8.45954615 2,7.32679321 C2,4.3895979 4.39240135,2 7.33319295,2 C9.22488362,2 11.0018124,2.98206975 11.9999248,4.46786903 C12.9978868,2.98206975 14.774966,2 16.6666566,2 C19.6072978,2 22,4.3895979 22,7.32679321 C22,8.45969638 21.5887825,9.59920978 20.777929,10.7136343 L12.5334246,21.7327364 C12.4076829,21.9008466 12.2098954,22 11.9997744,22", fillRule: "evenodd" }) }));
|
|
971
986
|
}
|
|
972
987
|
|
|
973
|
-
var styles$
|
|
988
|
+
var styles$N = {"favorite-button":"favorite-button-module-tXSS3","is-favorite":"favorite-button-module-l557q","favorite-on":"favorite-button-module-6Tsmy","favorite-off":"favorite-button-module-LQauU"};
|
|
974
989
|
|
|
975
990
|
function FavoriteButton({ isDisabled, isFavorite, onPress, }) {
|
|
976
|
-
return (jsx(IconButton, { className: clsx(styles$
|
|
977
|
-
[styles$
|
|
991
|
+
return (jsx(IconButton, { className: clsx(styles$N['favorite-button'], {
|
|
992
|
+
[styles$N['is-favorite']]: isFavorite,
|
|
978
993
|
}), color: "secondary", isDisabled: isDisabled, onPress: onPress, children: isFavorite ? jsx(SolidFavoriteIcon, {}) : jsx(StrokeFavoriteIcon, {}) }));
|
|
979
994
|
}
|
|
980
995
|
|
|
981
|
-
var styles$N = {"link-button":"link-button-module-6i75g","primary":"link-button-module-DRTd0","secondary":"link-button-module-HEqnO","has-underline":"link-button-module-Xc-3N"};
|
|
982
|
-
|
|
983
|
-
function LinkButton({ children, className, href, isDisabled, onPress, route, hasUnderline = false, target, color = 'primary', type = href ? 'link' : 'button', }) {
|
|
984
|
-
if (type === 'link') {
|
|
985
|
-
return (jsx(RouteLink, { className: clsx(styles$N['link-button'], styles$N[color], { [styles$N['has-underline']]: hasUnderline }, className), href: href, isDisabled: isDisabled, onPress: onPress, route: route, target: target, children: children }));
|
|
986
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
987
|
-
}
|
|
988
|
-
else if (type === 'button') {
|
|
989
|
-
return (jsx(RouteButton, { className: clsx(styles$N['link-button'], styles$N[color], { [styles$N['has-underline']]: hasUnderline }, styles$N[color], className), href: href, isDisabled: isDisabled, onPress: onPress, route: route, type: "button", children: children }));
|
|
990
|
-
}
|
|
991
|
-
throw new Error('Invalid type ${type} for LinkButton component');
|
|
992
|
-
}
|
|
993
|
-
|
|
994
996
|
var styles$M = {"field-error":"field-error-module-FXnIg"};
|
|
995
997
|
|
|
996
998
|
function FieldError({ children }) {
|
|
@@ -1261,7 +1263,7 @@ function ProductPrice({ className, isVatIncluded, originalPrice, price, }) {
|
|
|
1261
1263
|
var styles$F = {"product-sku":"product-sku-module-ITb8x"};
|
|
1262
1264
|
|
|
1263
1265
|
function ProductSku({ sku }) {
|
|
1264
|
-
return jsx("p", { className: styles$F['product-sku'], children: sku });
|
|
1266
|
+
return (jsx("p", { className: styles$F['product-sku'], "data-test-selector": "productNumber", children: sku }));
|
|
1265
1267
|
}
|
|
1266
1268
|
|
|
1267
1269
|
function isResponsiveImage(image) {
|
|
@@ -1310,7 +1312,7 @@ function PictureComponent({ className, fallbackSrc, fit = 'cover', hasError, ima
|
|
|
1310
1312
|
var styles$D = {"product-card":"product-card-module-pLaiB","favorite-button":"product-card-module-tvEdz","content":"product-card-module-e0kMu","top":"product-card-module-Q0VvF","tag":"product-card-module-HkWBE","title":"product-card-module-CStNi","bottom":"product-card-module-kD2tU","image":"product-card-module-p-zoi","price":"product-card-module-irW0D","add-to-cart-button":"product-card-module-SnCvX"};
|
|
1311
1313
|
|
|
1312
1314
|
function ProductCard({ addToCartButton: AddToCartButton, areaSelected, favoriteButton: FavoriteButton, href, id, image, onClick, onMouseDown, onMouseMove, onPress, price, role, sku, tags, title, }) {
|
|
1313
|
-
return (jsxs(RouteLink, { "aria-selected": areaSelected, className: styles$D['product-card'], href: href, id: id, onClick: onClick, onMouseDown: onMouseDown, onMouseMove: onMouseMove, onPress: onPress, role: role, children: [jsx("div", { className: styles$D.image, children: jsx(Image, { ...image }) }), jsx("div", { className: styles$D['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles$D.content, children: [jsxs("div", { className: styles$D.top, children: [jsx("div", { className: styles$D.tag, children: tags?.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { optional: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) }), jsx("h2", { className: styles$D.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles$D.bottom, children: [jsx("div", { className: styles$D.price, children: jsx(ProductPrice, { isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price }) }), jsx("div", { className: styles$D['add-to-cart-button'], children: AddToCartButton })] })] })] }));
|
|
1315
|
+
return (jsxs(RouteLink, { "aria-selected": areaSelected, className: styles$D['product-card'], "data-product-id": sku, href: href, id: id, onClick: onClick, onMouseDown: onMouseDown, onMouseMove: onMouseMove, onPress: onPress, role: role, children: [jsx("div", { className: styles$D.image, children: jsx(Image, { ...image }) }), jsx("div", { className: styles$D['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles$D.content, children: [jsxs("div", { className: styles$D.top, children: [jsx("div", { className: styles$D.tag, children: tags?.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { optional: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) }), jsx("h2", { className: styles$D.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles$D.bottom, children: [jsx("div", { className: styles$D.price, children: jsx(ProductPrice, { isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price }) }), jsx("div", { className: styles$D['add-to-cart-button'], children: AddToCartButton })] })] })] }));
|
|
1314
1316
|
}
|
|
1315
1317
|
|
|
1316
1318
|
/**
|
|
@@ -2563,7 +2565,7 @@ function updateSlides() {
|
|
|
2563
2565
|
allSlidesSize += slideSizeValue + (spaceBetween || 0);
|
|
2564
2566
|
});
|
|
2565
2567
|
allSlidesSize -= spaceBetween;
|
|
2566
|
-
const maxSnap = allSlidesSize - swiperSize;
|
|
2568
|
+
const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
|
|
2567
2569
|
snapGrid = snapGrid.map(snap => {
|
|
2568
2570
|
if (snap <= 0) return -offsetBefore;
|
|
2569
2571
|
if (snap > maxSnap) return maxSnap + offsetAfter;
|
|
@@ -3410,8 +3412,11 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
3410
3412
|
let direction;
|
|
3411
3413
|
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';
|
|
3412
3414
|
|
|
3415
|
+
// initial virtual
|
|
3416
|
+
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
3417
|
+
const isInitialVirtual = isVirtual && initial;
|
|
3413
3418
|
// Update Index
|
|
3414
|
-
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
|
3419
|
+
if (!isInitialVirtual && (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate)) {
|
|
3415
3420
|
swiper.updateActiveIndex(slideIndex);
|
|
3416
3421
|
// Update Height
|
|
3417
3422
|
if (params.autoHeight) {
|
|
@@ -3431,7 +3436,6 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
|
|
|
3431
3436
|
const isH = swiper.isHorizontal();
|
|
3432
3437
|
const t = rtl ? translate : -translate;
|
|
3433
3438
|
if (speed === 0) {
|
|
3434
|
-
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
|
3435
3439
|
if (isVirtual) {
|
|
3436
3440
|
swiper.wrapperEl.style.scrollSnapType = 'none';
|
|
3437
3441
|
swiper._immediateVirtual = true;
|
|
@@ -6231,7 +6235,7 @@ const updateOnVirtualData = swiper => {
|
|
|
6231
6235
|
};
|
|
6232
6236
|
|
|
6233
6237
|
/**
|
|
6234
|
-
* Swiper React 11.1.
|
|
6238
|
+
* Swiper React 11.1.11
|
|
6235
6239
|
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
6236
6240
|
* https://swiperjs.com
|
|
6237
6241
|
*
|
|
@@ -6239,7 +6243,7 @@ const updateOnVirtualData = swiper => {
|
|
|
6239
6243
|
*
|
|
6240
6244
|
* Released under the MIT License
|
|
6241
6245
|
*
|
|
6242
|
-
* Released on: August
|
|
6246
|
+
* Released on: August 28, 2024
|
|
6243
6247
|
*/
|
|
6244
6248
|
|
|
6245
6249
|
|
|
@@ -6694,7 +6698,7 @@ const ShowAll = ({ children, hasTransparency = true, initialHeight = 0, isOpen,
|
|
|
6694
6698
|
[styles$A['is-open']]: isOpen,
|
|
6695
6699
|
}), children: [jsx("div", { className: styles$A.panel, children: jsx("div", { className: clsx(styles$A.content, {
|
|
6696
6700
|
[styles$A['has-transparency']]: hasTransparency,
|
|
6697
|
-
}), children: children }) }), jsxs(
|
|
6701
|
+
}), children: children }) }), jsxs(RouteLink, { className: styles$A.button, color: "secondary", onPress: () => onToggle(!isOpen), children: [jsx(GlyphsChevronsSlimDownIcon, { className: styles$A.icon }), isOpen ? (jsx(FormattedMessage, { id: "Show less" })) : (jsx(FormattedMessage, { id: "Show all" }))] })] }));
|
|
6698
6702
|
};
|
|
6699
6703
|
|
|
6700
6704
|
var styles$z = {"multi-select":"multi-select-module-DC7Ix","filter-items":"multi-select-module-cwVFb","hidden":"multi-select-module-o7yHU","filter-item":"multi-select-module-OW-NK"};
|
|
@@ -6961,7 +6965,7 @@ function Categories({ categories, path: _path, }) {
|
|
|
6961
6965
|
.map(category => {
|
|
6962
6966
|
const path = _path + '/' + category.label;
|
|
6963
6967
|
const isActive = !category.data || !category.data.some(c => c.isRefined);
|
|
6964
|
-
return (jsxs(Fragment, { children: [jsx(RouteLink, { className: clsx(styles$n.category, {
|
|
6968
|
+
return (jsxs(Fragment, { children: [jsx(RouteLink, { hasUnderline: true, className: clsx(styles$n.category, {
|
|
6965
6969
|
[styles$n['is-active']]: isActive,
|
|
6966
6970
|
}), href: path, isDisabled: isActive, children: category.label }), category.data && (jsx(Categories, { categories: category.data, path: path }))] }, category.value));
|
|
6967
6971
|
});
|
|
@@ -6976,7 +6980,7 @@ var styles$m = {"active-filter-item":"active-filters-module-Rrmhy","category":"a
|
|
|
6976
6980
|
const ActiveFilters = ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }) => {
|
|
6977
6981
|
if (selectedFilterCategories.length === 0)
|
|
6978
6982
|
return null;
|
|
6979
|
-
return (jsx(FilterSection, { button: jsx(
|
|
6983
|
+
return (jsx(FilterSection, { button: jsx(RouteLink, { onPress: onClearAllFilters, children: jsx(FormattedMessage, { id: "Clear filters" }) }), title: "Chosen filters", variant: "with-action", children: selectedFilterCategories.map((category, index) => (jsx("section", { className: styles$m.category, children: category.filters.map(filter => (jsxs("div", { className: styles$m['active-filter-item'], children: [jsxs("span", { children: [jsxs("span", { children: [category.label, ": "] }), jsx("span", { className: styles$m['active-filter-value'], children: filter.label })] }), jsx(IconButton, { color: "secondary", onPress: () => onClearFilter(category.label, filter), children: jsx(StrokeCloseboxIcon, {}) })] }, `${category.label}-${filter.value}`))) }, `${category.label}-${index}`))) }));
|
|
6980
6984
|
};
|
|
6981
6985
|
|
|
6982
6986
|
function AlgoliaActiveFilters() {
|
|
@@ -7017,9 +7021,9 @@ function AlgoliaCategoriesFilters() {
|
|
|
7017
7021
|
const t = useFormattedMessage();
|
|
7018
7022
|
if (categories.length <= 0)
|
|
7019
7023
|
return null;
|
|
7020
|
-
return (jsx(FilterSection, { title: t('facet.categories'), variant: "default", children: categories.map(({ count, isRefined, value }) => (jsxs(
|
|
7024
|
+
return (jsx(FilterSection, { title: t('facet.categories'), variant: "default", children: categories.map(({ count, isRefined, value }) => (jsxs(Link, { className: clsx(styles$n.category, {
|
|
7021
7025
|
[styles$n['is-active']]: isRefined,
|
|
7022
|
-
}), onClick: () => refine(value),
|
|
7026
|
+
}), isDisabled: isRefined, onClick: () => refine(value), children: [jsx("span", { children: value }), " ", jsxs("span", { className: styles$n.count, children: ["(", count, ")"] })] }, value))) }));
|
|
7023
7027
|
}
|
|
7024
7028
|
|
|
7025
7029
|
function AlgoliaMultiSelectFilterSection({ attribute, }) {
|
|
@@ -7246,7 +7250,7 @@ function Dialog({ allowClose = true, children, className, footer = Footer, hideT
|
|
|
7246
7250
|
function SignInDialog({ isOpen, onOpenChange }) {
|
|
7247
7251
|
const t = useFormattedMessage();
|
|
7248
7252
|
const { signInUrl } = useFavorite();
|
|
7249
|
-
return (jsxs(Dialog, { isDismissable: true, isOpen: isOpen, onOpenChange: onOpenChange, title: t('Please Sign In'), children: [t('You must '), jsx(
|
|
7253
|
+
return (jsxs(Dialog, { isDismissable: true, isOpen: isOpen, onOpenChange: onOpenChange, title: t('Please Sign In'), children: [t('You must '), jsx(RouteLink, { color: "secondary", href: `${signInUrl}?returnUrl=${encodeURIComponent(window.location.pathname + window.location.search)}`, onPress: () => onOpenChange(false), children: t('sign in') }), t(' to your account to manage your lists.')] }));
|
|
7250
7254
|
}
|
|
7251
7255
|
|
|
7252
7256
|
function useAddWishListItemToCurrentWishList() {
|
|
@@ -7304,6 +7308,8 @@ function ConnectedFavoriteButton({ productId }) {
|
|
|
7304
7308
|
addWishListItemToCurrentWishList({ productId });
|
|
7305
7309
|
}
|
|
7306
7310
|
}
|
|
7311
|
+
if (isFetching)
|
|
7312
|
+
return null;
|
|
7307
7313
|
return (jsxs(Fragment, { children: [jsx(FavoriteButton, { isDisabled: isFetching, isFavorite: isFavorite, onPress: onFavorite }), jsx(SignInDialog, { isOpen: showSignInDialog, onOpenChange: setShowSignInDialog })] }));
|
|
7308
7314
|
}
|
|
7309
7315
|
|
|
@@ -7407,7 +7413,7 @@ const getAlgoliaIndex = (environment, languageCode) => {
|
|
|
7407
7413
|
};
|
|
7408
7414
|
};
|
|
7409
7415
|
|
|
7410
|
-
function createQueryStringRouting({ algoliaIndex,
|
|
7416
|
+
function createQueryStringRouting({ algoliaIndex, hierarchicalCategories, }) {
|
|
7411
7417
|
return {
|
|
7412
7418
|
router: history({
|
|
7413
7419
|
cleanUrlOnDispose: true,
|
|
@@ -7433,7 +7439,7 @@ function createQueryStringRouting({ algoliaIndex, categoryPages, }) {
|
|
|
7433
7439
|
else {
|
|
7434
7440
|
delete queryString.page;
|
|
7435
7441
|
}
|
|
7436
|
-
if (!
|
|
7442
|
+
if (!hierarchicalCategories &&
|
|
7437
7443
|
state.hierarchicalMenu?.['hierarchicalCategories.lvl0']) {
|
|
7438
7444
|
queryString.category =
|
|
7439
7445
|
state.hierarchicalMenu['hierarchicalCategories.lvl0'].join('+');
|
|
@@ -7454,9 +7460,9 @@ function createQueryStringRouting({ algoliaIndex, categoryPages, }) {
|
|
|
7454
7460
|
refinementList[filter] = [].concat(queryString.filters?.[filter]);
|
|
7455
7461
|
return refinementList;
|
|
7456
7462
|
}, {});
|
|
7457
|
-
const hierarchicalMenu =
|
|
7463
|
+
const hierarchicalMenu = hierarchicalCategories
|
|
7458
7464
|
? {
|
|
7459
|
-
'hierarchicalCategories.lvl0':
|
|
7465
|
+
'hierarchicalCategories.lvl0': hierarchicalCategories,
|
|
7460
7466
|
}
|
|
7461
7467
|
: queryString.category
|
|
7462
7468
|
? typeof queryString.category === 'string'
|
|
@@ -7487,7 +7493,7 @@ function createQueryStringRouting({ algoliaIndex, categoryPages, }) {
|
|
|
7487
7493
|
}),
|
|
7488
7494
|
stateMapping: {
|
|
7489
7495
|
routeToState(routeState) {
|
|
7490
|
-
return simple().routeToState(!
|
|
7496
|
+
return simple().routeToState(!hierarchicalCategories
|
|
7491
7497
|
? routeState
|
|
7492
7498
|
: Object.keys(routeState).reduce((newRouteState, indexName) => {
|
|
7493
7499
|
if (!routeState[indexName])
|
|
@@ -7497,7 +7503,7 @@ function createQueryStringRouting({ algoliaIndex, categoryPages, }) {
|
|
|
7497
7503
|
[indexName]: {
|
|
7498
7504
|
...routeState[indexName],
|
|
7499
7505
|
hierarchicalMenu: {
|
|
7500
|
-
'hierarchicalCategories.lvl0':
|
|
7506
|
+
'hierarchicalCategories.lvl0': hierarchicalCategories,
|
|
7501
7507
|
},
|
|
7502
7508
|
},
|
|
7503
7509
|
};
|
|
@@ -7515,13 +7521,17 @@ function AlgoliaInsightInstantSearchProvider({ children, }) {
|
|
|
7515
7521
|
queryId: results.queryID,
|
|
7516
7522
|
}, children: children }));
|
|
7517
7523
|
}
|
|
7518
|
-
function AlgoliaProvider({ categoryPages, children, languageCode, offlineSearchClient, online: _online = true, query, routing, searchClient, }) {
|
|
7524
|
+
function AlgoliaProvider({ categoryPages, children, hierarchicalCategories, languageCode, offlineSearchClient, online: _online = true, query, routing, searchClient, }) {
|
|
7519
7525
|
const [online] = useGlobalState('algolia', _online);
|
|
7520
7526
|
const algoliaIndex = getAlgoliaIndex(environment, languageCode);
|
|
7521
7527
|
return (jsxs(InstantSearch, { future: {
|
|
7522
7528
|
persistHierarchicalRootCount: true,
|
|
7523
7529
|
preserveSharedStateOnUnmount: true,
|
|
7524
|
-
}, indexName: algoliaIndex.default, insights: true, routing: routing ||
|
|
7530
|
+
}, indexName: algoliaIndex.default, insights: true, routing: routing ||
|
|
7531
|
+
createQueryStringRouting({ algoliaIndex, hierarchicalCategories }), searchClient: online ? searchClient : offlineSearchClient || searchClient, children: [jsx(Configure, { analytics: true, filters: categoryPages
|
|
7532
|
+
? // Replace double quotes with escaped double quotes to avoid breaking the query
|
|
7533
|
+
`categoryPages: "${categoryPages.replace(/"/g, '\\"')}"`
|
|
7534
|
+
: undefined, maxValuesPerFacet: 100, query: query, ruleContexts: ['storefront'] }), jsx(AlgoliaInsightInstantSearchProvider, { children: children })] }, algoliaIndex.default));
|
|
7525
7535
|
}
|
|
7526
7536
|
function useAlgolia() {
|
|
7527
7537
|
const [online, setOnline] = useGlobalState('algolia', false);
|
|
@@ -7676,7 +7686,7 @@ function ProductListingPage({ pageUrl, searchClient: _searchClient, }) {
|
|
|
7676
7686
|
createSonicSearchClient({
|
|
7677
7687
|
apiKey: config.ALGOLIA_API_KEY,
|
|
7678
7688
|
appId: config.ALGOLIA_APP_ID,
|
|
7679
|
-
host: config.
|
|
7689
|
+
host: config.ALGOLIA_HOST,
|
|
7680
7690
|
}), [_searchClient]);
|
|
7681
7691
|
if (isError) {
|
|
7682
7692
|
if (!isRequestError(error))
|
|
@@ -7688,7 +7698,7 @@ function ProductListingPage({ pageUrl, searchClient: _searchClient, }) {
|
|
|
7688
7698
|
return jsx(LoadingOverlay, {});
|
|
7689
7699
|
}
|
|
7690
7700
|
const category = data.breadCrumb.slice(1).map(breadCrumb => breadCrumb.label);
|
|
7691
|
-
return (jsx(ProductListingPageProvider, { data: data, error: error, isError: isError, isLoading: isFetching, children: jsx(AlgoliaProvider, { categoryPages: data.categoryPages, languageCode: languageCode, offlineSearchClient: offlineSearchClient, searchClient: searchClient, children: jsx(Page, { breadCrumb: data.breadCrumb, className: styles$e['product-listing'], title: category.slice().pop(), children: jsx(ProductListingPageContent, { promoCards: data.promoCards?.top }) }) }) }));
|
|
7701
|
+
return (jsx(ProductListingPageProvider, { data: data, error: error, isError: isError, isLoading: isFetching, children: jsx(AlgoliaProvider, { categoryPages: data.categoryPages, hierarchicalCategories: data.hierarchicalCategories, languageCode: languageCode, offlineSearchClient: offlineSearchClient, searchClient: searchClient, children: jsx(Page, { breadCrumb: data.breadCrumb, className: styles$e['product-listing'], title: category.slice().pop(), children: jsx(ProductListingPageContent, { promoCards: data.promoCards?.top }) }) }) }));
|
|
7692
7702
|
}
|
|
7693
7703
|
function ProductListingPageContent({ promoCards, }) {
|
|
7694
7704
|
return (jsxs(Fragment, { children: [promoCards?.length && (jsx("section", { className: styles$e.promos, children: jsx(PromoCards, { promoCardsData: promoCards }) })), jsx("section", { className: styles$e.categories, children: jsx(ConnectedCategoryCarousel, {}) }), jsxs("section", { className: styles$e['action-bar'], children: [jsx("div", { className: styles$e['sidebar-toggle'], children: jsx(ToggleSidebarButton, {}) }), jsx("span", { className: styles$e.count, children: jsx(AlgoliaResultsCount, {}) }), jsx("div", { className: styles$e.sort, children: jsx(AlgoliaSortBy, {}) })] }), jsx("section", { children: jsxs("div", { className: styles$e['product-grid-container'], children: [jsx(Sidebar, { children: jsx(AlgoliaFilterPanel, { showActiveCategories: true }) }), jsxs("div", { className: styles$e['product-grid'], children: [jsx(ProductOverview, {}), jsx("div", { className: styles$e.pagination, children: jsx(AlgoliaPagination, { onChange: () => {
|
|
@@ -7979,7 +7989,7 @@ function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
|
7979
7989
|
createSonicSearchClient({
|
|
7980
7990
|
apiKey: config.ALGOLIA_API_KEY,
|
|
7981
7991
|
appId: config.ALGOLIA_APP_ID,
|
|
7982
|
-
host: config.
|
|
7992
|
+
host: config.ALGOLIA_HOST,
|
|
7983
7993
|
}), [_searchClient]);
|
|
7984
7994
|
const languageCode = useLanguageCode();
|
|
7985
7995
|
const index = getAlgoliaIndex(environment, languageCode);
|
|
@@ -8133,7 +8143,7 @@ function StrokeSearchIcon(props) {
|
|
|
8133
8143
|
|
|
8134
8144
|
var styles$9 = {"form":"search-input-module-xCCzd","input-container":"search-input-module-okP8k","icon":"search-input-module-GZbhK","label":"search-input-module-vKCm4","reset-btn":"search-input-module-lYseZ","input":"search-input-module-bELFK"};
|
|
8135
8145
|
|
|
8136
|
-
function SearchInput({ autocomplete, formRef, inputRef, onCancel, }) {
|
|
8146
|
+
function SearchInput({ autocomplete, formRef, inputRef, onCancel, onSubmit, placeholder, }) {
|
|
8137
8147
|
const formProps = autocomplete?.getFormProps({
|
|
8138
8148
|
inputElement: inputRef.current,
|
|
8139
8149
|
});
|
|
@@ -8141,16 +8151,26 @@ function SearchInput({ autocomplete, formRef, inputRef, onCancel, }) {
|
|
|
8141
8151
|
inputElement: inputRef.current,
|
|
8142
8152
|
});
|
|
8143
8153
|
const labelProps = autocomplete?.getLabelProps({});
|
|
8144
|
-
|
|
8154
|
+
function handleSubmit(e) {
|
|
8155
|
+
if (!inputProps?.value)
|
|
8156
|
+
return;
|
|
8157
|
+
formProps?.onSubmit(e);
|
|
8158
|
+
onSubmit?.();
|
|
8159
|
+
}
|
|
8160
|
+
return (jsx("form", { ref: formRef, className: styles$9.form, ...formProps, onSubmit: handleSubmit, children: jsxs("div", { className: styles$9['input-container'], children: [jsx("label", { className: styles$9.label, ...labelProps, children: jsx(StrokeSearchIcon, { className: clsx(styles$9['icon-search'], styles$9.icon) }) }), jsx("input", { ref: inputRef, onKeyUp: e => {
|
|
8145
8161
|
if (e.key === 'Escape')
|
|
8146
8162
|
onCancel?.();
|
|
8147
|
-
}, ...inputProps, className: styles$9.input }), inputProps?.value && (jsx(IconButton, { className: styles$9['reset-btn'], color: "secondary", onPress: () => formRef.current?.reset(), type: "reset", children: jsx(SolidCloseIcon, {}) }))] }) }));
|
|
8163
|
+
}, ...inputProps, className: styles$9.input, placeholder: placeholder }), inputProps?.value && (jsx(IconButton, { className: styles$9['reset-btn'], color: "secondary", onPress: () => formRef.current?.reset(), type: "reset", children: jsx(SolidCloseIcon, {}) }))] }) }));
|
|
8148
8164
|
}
|
|
8149
8165
|
|
|
8150
8166
|
function ConnectedSearchInput() {
|
|
8151
8167
|
const { autocomplete, formRef, inputRef } = useAlgoliaSearch();
|
|
8152
8168
|
const { close } = useGlobalSearchDisclosure();
|
|
8153
|
-
|
|
8169
|
+
const t = useFormattedMessage();
|
|
8170
|
+
const navigate = useNavigate();
|
|
8171
|
+
return (jsx(SearchInput, { autocomplete: autocomplete, formRef: formRef, inputRef: inputRef, onCancel: close, onSubmit: () => {
|
|
8172
|
+
navigate(`/search?keyword=${inputRef.current?.value}`);
|
|
8173
|
+
}, placeholder: t('Search tools, toolsets, boxes and more') }));
|
|
8154
8174
|
}
|
|
8155
8175
|
|
|
8156
8176
|
var styles$8 = {"categories-grid":"categories-grid-module-C751R","category":"categories-grid-module-7OZS1"};
|
|
@@ -8172,7 +8192,7 @@ function SearchSection({ button, children, className, title, }) {
|
|
|
8172
8192
|
var styles$6 = {"section-container":"search-content-module-ZMwlB","content":"search-content-module-KIok6","left":"search-content-module-YRLIf","right":"search-content-module-qK5sg","button-container":"search-content-module-w-ORq","show-all-button":"search-content-module-bO1Q0","product-results":"search-content-module-bcFCH","no-results-text":"search-content-module-H-FX2","query":"search-content-module-LbQnK","suggestions":"search-content-module-mhiBZ","list":"search-content-module-coPAt"};
|
|
8173
8193
|
|
|
8174
8194
|
function SectionContainer({ buttons, leftContent, rightContent, }) {
|
|
8175
|
-
return (
|
|
8195
|
+
return (jsx("div", { className: styles$6['section-container'], children: jsxs("div", { className: styles$6['content'], children: [jsx("div", { className: styles$6['left'], children: leftContent }), jsxs("div", { className: styles$6['right'], children: [rightContent, jsx("div", { className: styles$6['button-container'], children: buttons })] })] }) }));
|
|
8176
8196
|
}
|
|
8177
8197
|
|
|
8178
8198
|
function NoResults() {
|
|
@@ -8239,7 +8259,7 @@ function RecentSearchesSection() {
|
|
|
8239
8259
|
return null;
|
|
8240
8260
|
}
|
|
8241
8261
|
const { items, source } = collection;
|
|
8242
|
-
return (jsx(SearchSection, { button: jsx(
|
|
8262
|
+
return (jsx(SearchSection, { button: jsx(RouteLink, { hasUnderline: true, onPress: () => 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({
|
|
8243
8263
|
item,
|
|
8244
8264
|
source: source,
|
|
8245
8265
|
}), icon: jsx(StrokeSearchIcon, {}), isRemovable: true, onRemove: () => source.onRemove(item.id), text: jsx(Highlight, { attribute: "label", hit: item }) }, item.id))) }) }));
|
|
@@ -8267,7 +8287,7 @@ function StrokeRecentIcon(props) {
|
|
|
8267
8287
|
function WithResults() {
|
|
8268
8288
|
const { state } = useAlgoliaSearch();
|
|
8269
8289
|
const { close } = useGlobalSearchDisclosure();
|
|
8270
|
-
return (jsx("div", { children: jsx(SectionContainer, { buttons: jsxs(RouteButton, { className: clsx(styles$6['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${state.query}`, onPress: close, children: [jsx(FormattedMessage, { id: "See all results" }),
|
|
8290
|
+
return (jsx("div", { children: jsx(SectionContainer, { buttons: jsxs(RouteButton, { className: clsx(styles$6['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${state.query}`, onPress: close, children: [jsx(FormattedMessage, { id: "See all results" }), jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })] }), leftContent: jsx(SuggestionsSection, {}), rightContent: jsx(ProductResultsSection, {}) }) }));
|
|
8271
8291
|
}
|
|
8272
8292
|
function SuggestionsSection() {
|
|
8273
8293
|
const { autocomplete, categories, querySuggestions, recentSearches } = useAlgoliaSearch();
|
|
@@ -8339,16 +8359,6 @@ var styles = {"search-container":"search-root-module-g9MP0","input":"search-root
|
|
|
8339
8359
|
function SearchRoot() {
|
|
8340
8360
|
const { autocomplete, inputRef } = useAlgoliaSearch();
|
|
8341
8361
|
const { isOpen } = useGlobalSearchDisclosure();
|
|
8342
|
-
useEffect(() => {
|
|
8343
|
-
if (inputRef.current === null)
|
|
8344
|
-
return;
|
|
8345
|
-
if (isOpen) {
|
|
8346
|
-
inputRef.current.focus();
|
|
8347
|
-
}
|
|
8348
|
-
else {
|
|
8349
|
-
inputRef.current.blur();
|
|
8350
|
-
}
|
|
8351
|
-
}, [inputRef, isOpen]);
|
|
8352
8362
|
return (jsx(Fragment, { children: jsx(Transition, { in: isOpen, nodeRef: inputRef, timeout: 300, children: transitionState => (jsxs("div", { className: clsx(styles['search-container'], styles[transitionState]), ...autocomplete.getRootProps({}), children: [jsx("div", { className: styles.input, children: jsx(ConnectedSearchInput, {}) }), jsx("div", { className: styles.panel, children: jsx(SearchResultPanel, {}) })] })) }) }));
|
|
8353
8363
|
}
|
|
8354
8364
|
|
|
@@ -8378,4 +8388,4 @@ function ReactQueryContainer({ children }) {
|
|
|
8378
8388
|
return (jsx(QueryClientProvider, { client: queryClient, children: children }));
|
|
8379
8389
|
}
|
|
8380
8390
|
|
|
8381
|
-
export { Accordion, AddToCartButton, AlgoliaActiveCategories, AlgoliaCategoriesFilters, AlgoliaFilterPanel, AlgoliaInsightInstantSearchProvider, AlgoliaInsightsProvider, AlgoliaInsightsProviderContext, AlgoliaMultiSelectFilterSection, AlgoliaPagination, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, AvailabilityMessageType, BadgeImagePlacementValues, BadgeStyleValues, BadgeTypeValues, Breadcrumb, Button, CartProvider, CategoryCarousel, Checkbox, ColorCheckbox, ConnectedAddToCartButton, CurrencyPositioningType, FavoriteButton, FavoriteProvider, FilterSection, FormattedMessage, GlobalSearch, GlobalSearchContainer, GlobalSearchDisclosureContext, GlobalStateProvider, GlobalStateProviderContext, IconButton, Image, IntlProvider,
|
|
8391
|
+
export { Accordion, AddToCartButton, AlgoliaActiveCategories, AlgoliaCategoriesFilters, AlgoliaFilterPanel, AlgoliaInsightInstantSearchProvider, AlgoliaInsightsProvider, AlgoliaInsightsProviderContext, AlgoliaMultiSelectFilterSection, AlgoliaPagination, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, AvailabilityMessageType, BadgeImagePlacementValues, BadgeStyleValues, BadgeTypeValues, Breadcrumb, Button, CartProvider, CategoryCarousel, Checkbox, ColorCheckbox, ConnectedAddToCartButton, CurrencyPositioningType, FavoriteButton, FavoriteProvider, FilterSection, FormattedMessage, GlobalSearch, GlobalSearchContainer, GlobalSearchDisclosureContext, GlobalStateProvider, GlobalStateProviderContext, IconButton, Image, IntlProvider, Link, LoadingOverlay, MultiSelect, NumberField, Page, PageContainer, ProductCard, ProductListingPage, ProductOverviewGrid, ProductPrice, ProductSku, ProgressCircle, ReactQueryContainer, RouteButton, RouteLink, RouteProvider, SearchResultsPage, Select, ShowAll, Sidebar, SidebarDetectBreakpoint, SidebarProvider, TextField, VariantDisplayTypeValues, config, configPerEnvironment, createSonicSearchClient, transformAlgoliaProductHitToProductHit, useAddProductToCurrentCart, useAlgolia, useAlgoliaInsights, useAlgoliaSearch, useBreakpoint, useCartEvents, useDebouncedCallback, useDeleteCartLineById, useDisclosure, useFavorite, useFavoriteProduct, useFetchCurrentCartLines, useFetchProductListingPageData, useFormattedMessage, useGlobalSearchDisclosure, useGlobalState, useNavigate, useScrollLock, useUpdateCartLineById, userToken, userTokenEventEmitter };
|
|
@@ -5,6 +5,7 @@ import { UiState } from 'instantsearch.js/es/types';
|
|
|
5
5
|
interface AlgoliaProviderProps {
|
|
6
6
|
categoryPages?: string;
|
|
7
7
|
children: ReactNode;
|
|
8
|
+
hierarchicalCategories?: string[];
|
|
8
9
|
languageCode: string;
|
|
9
10
|
offlineSearchClient?: SearchClient;
|
|
10
11
|
online?: boolean;
|
|
@@ -15,7 +16,7 @@ interface AlgoliaProviderProps {
|
|
|
15
16
|
export declare function AlgoliaInsightInstantSearchProvider({ children, }: {
|
|
16
17
|
children?: ReactNode;
|
|
17
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function AlgoliaProvider({ categoryPages, children, languageCode, offlineSearchClient, online: _online, query, routing, searchClient, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function AlgoliaProvider({ categoryPages, children, hierarchicalCategories, languageCode, offlineSearchClient, online: _online, query, routing, searchClient, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export declare function useAlgolia(): {
|
|
20
21
|
online: boolean;
|
|
21
22
|
setOnline: import("shared/providers/global-state-provider").UpdateGlobalState<boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RouterProps } from 'instantsearch.js/es/middlewares/createRouterMiddleware';
|
|
2
2
|
import { UiState } from 'instantsearch.js/es/types';
|
|
3
3
|
import { Indexes } from './algolia-index-config';
|
|
4
|
-
export declare function createQueryStringRouting({ algoliaIndex,
|
|
4
|
+
export declare function createQueryStringRouting({ algoliaIndex, hierarchicalCategories, }: {
|
|
5
5
|
algoliaIndex: Indexes;
|
|
6
|
-
|
|
6
|
+
hierarchicalCategories: string[] | undefined;
|
|
7
7
|
}): RouterProps<UiState, UiState>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface BreadcrumbLink {
|
|
2
2
|
href: string;
|
|
3
3
|
label: string;
|
|
4
4
|
}
|
|
5
5
|
export interface BreadcrumbProps {
|
|
6
|
-
links:
|
|
6
|
+
links: BreadcrumbLink[];
|
|
7
7
|
}
|
|
8
8
|
export declare function Breadcrumb({ links }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
|