@sonic-equipment/ui 0.0.58 → 0.0.60
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 +5 -5
- package/dist/index.js +41 -34
- package/dist/src/algolia/algolia-sonic-searchclient.d.ts +2 -4
- package/dist/src/global-search/search-result-panel/sections/section-container.d.ts +2 -1
- package/dist/src/intl/translation-id.d.ts +1 -1
- package/dist/src/lists/product-overview-grid/product-overview-grid.d.ts +2 -1
- package/dist/styles.css +64 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3899,7 +3899,7 @@ interface TextFieldProps {
|
|
|
3899
3899
|
*/
|
|
3900
3900
|
declare function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel, size, value, }: TextFieldProps): react_jsx_runtime.JSX.Element;
|
|
3901
3901
|
|
|
3902
|
-
type TranslationId = "'{0}' in all products" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Cancel' | 'Create new list' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Double check your spelling' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Hide filters' | 'Incl. VAT' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Products' | 'Quick access' | 'Recent searches' | 'Searching again using more general terms' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, we could not find matches for' | 'Sort by' | 'Submit' | 'Suggestions' | 'Use fewer keywords' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
3902
|
+
type TranslationId = "'{0}' in all products" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Cancel' | 'Create new list' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Double check your spelling' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Hide filters' | 'Incl. VAT' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Products' | 'Quick access' | 'Recent searches' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, we could not find matches for' | 'Sort by' | 'Submit' | 'Suggestions' | 'Use fewer keywords' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
3903
3903
|
|
|
3904
3904
|
interface FormattedMessageProps {
|
|
3905
3905
|
fallbackValue?: string;
|
|
@@ -3927,8 +3927,9 @@ declare function useFormattedMessage(): FormattedMessageFunction;
|
|
|
3927
3927
|
|
|
3928
3928
|
interface ProductOverviewGridProps {
|
|
3929
3929
|
children?: ReactNode;
|
|
3930
|
+
isLoading?: boolean;
|
|
3930
3931
|
}
|
|
3931
|
-
declare function ProductOverviewGrid({ children }: ProductOverviewGridProps): react_jsx_runtime.JSX.Element;
|
|
3932
|
+
declare function ProductOverviewGrid({ children, isLoading, }: ProductOverviewGridProps): react_jsx_runtime.JSX.Element;
|
|
3932
3933
|
|
|
3933
3934
|
declare function LoadingOverlay(): react_jsx_runtime.JSX.Element;
|
|
3934
3935
|
|
|
@@ -4045,12 +4046,11 @@ interface AlgoliaPaginationProps {
|
|
|
4045
4046
|
}
|
|
4046
4047
|
declare function AlgoliaPagination({ onChange }: AlgoliaPaginationProps): react_jsx_runtime.JSX.Element;
|
|
4047
4048
|
|
|
4048
|
-
declare const createSonicSearchClient: ({ apiKey, appId, host,
|
|
4049
|
+
declare const createSonicSearchClient: ({ apiKey, appId, host, }: {
|
|
4049
4050
|
apiKey: string;
|
|
4050
4051
|
appId: string;
|
|
4051
4052
|
host: string | undefined;
|
|
4052
|
-
|
|
4053
|
-
}) => SearchClient;
|
|
4053
|
+
}) => algoliasearch.SearchClient;
|
|
4054
4054
|
|
|
4055
4055
|
interface AlgoliaInsightsProviderGlobalState {
|
|
4056
4056
|
index?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ import React, { useState, useCallback, useEffect, useRef, createContext, useCont
|
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
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';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { useHierarchicalMenu, useCurrentRefinements, useClearRefinements, useRefinementList, useHits, useDynamicWidgets, usePagination, useInstantSearch, InstantSearch, Configure, useSortBy } from 'react-instantsearch';
|
|
7
|
+
import { useHierarchicalMenu, useCurrentRefinements, useClearRefinements, useRefinementList, useHits, useDynamicWidgets, usePagination, useInstantSearch as useInstantSearch$1, InstantSearch, Configure, useSortBy } from 'react-instantsearch';
|
|
8
|
+
import { useInstantSearch } from 'react-instantsearch-core';
|
|
8
9
|
import aa from 'search-insights';
|
|
9
10
|
import { history } from 'instantsearch.js/es/lib/routers/index.js';
|
|
10
11
|
import { simple } from 'instantsearch.js/es/lib/stateMappings/index.js';
|
|
@@ -882,22 +883,22 @@ function SolidHomeIcon(props) {
|
|
|
882
883
|
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" }) }));
|
|
883
884
|
}
|
|
884
885
|
|
|
885
|
-
var styles$
|
|
886
|
+
var styles$R = {"breadcrumbs":"breadcrumb-module-CQGse","breadcrumb":"breadcrumb-module-hxhDY","link":"breadcrumb-module-fp2Q6","icon":"breadcrumb-module-uIn3w","previous-icon":"breadcrumb-module-K-wMJ"};
|
|
886
887
|
|
|
887
888
|
function BreadcrumbShort({ links }) {
|
|
888
889
|
const homeLink = links[0];
|
|
889
890
|
const previousLink = links[links.length - 2];
|
|
890
|
-
return (jsx(Breadcrumbs, { className: styles$
|
|
891
|
+
return (jsx(Breadcrumbs, { className: styles$R.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles$R.breadcrumb, children: jsxs(RouteLink, { className: styles$R.link, isDisabled: false, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles$R.icon }), previousLink === undefined || previousLink === homeLink ? (jsx(SolidHomeIcon, { className: styles$R.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
|
|
891
892
|
}
|
|
892
893
|
function BreadcrumbLongItem({ index, isDisabled, link, }) {
|
|
893
|
-
return (jsx(Breadcrumb$1, { className: styles$
|
|
894
|
+
return (jsx(Breadcrumb$1, { className: styles$R.breadcrumb, children: jsxs(RouteLink, { className: styles$R.link, href: link.href, isDisabled: isDisabled, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles$R['previous-icon'], styles$R.icon) }), link.label] }) }, index));
|
|
894
895
|
}
|
|
895
896
|
function BreadcrumbLong({ links }) {
|
|
896
897
|
const linksWithoutFirst = links.slice(1);
|
|
897
898
|
const homeLink = links[0];
|
|
898
899
|
if (!homeLink)
|
|
899
900
|
return null;
|
|
900
|
-
return (jsxs(Breadcrumbs, { className: styles$
|
|
901
|
+
return (jsxs(Breadcrumbs, { className: styles$R.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles$R.breadcrumb, children: jsx(RouteLink, { className: styles$R.link, href: homeLink.href, children: jsx(SolidHomeIcon, { className: clsx(styles$R['home-icon'], styles$R.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, index)))] }));
|
|
901
902
|
}
|
|
902
903
|
function Breadcrumb({ links }) {
|
|
903
904
|
const { lg } = useBreakpoint();
|
|
@@ -910,14 +911,14 @@ function GlyphsArrowBoldCapsRightIcon(props) {
|
|
|
910
911
|
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" }) }));
|
|
911
912
|
}
|
|
912
913
|
|
|
913
|
-
var
|
|
914
|
+
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"};
|
|
914
915
|
|
|
915
916
|
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onPress, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
|
|
916
|
-
return (jsxs(Button$1, { className: clsx(className,
|
|
917
|
+
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,
|
|
917
918
|
// Workaround for adobe/react-spectrum #963
|
|
918
919
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
919
920
|
// @ts-ignore
|
|
920
|
-
onClick: e => e.preventDefault(), onPress: onPress, type: type, children: [icon && iconPosition === 'left' && (jsx("span", { className:
|
|
921
|
+
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 }))] }));
|
|
921
922
|
}
|
|
922
923
|
|
|
923
924
|
var styles$Q = {"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"};
|
|
@@ -6782,16 +6783,16 @@ function IntlProvider({ children, formatMessage, languageCode: _languageCode, })
|
|
|
6782
6783
|
return (jsx(IntlContext.Provider, { value: { formatMessage, languageCode, updateLanguageCode }, children: children }));
|
|
6783
6784
|
}
|
|
6784
6785
|
|
|
6785
|
-
var styles$v = {"
|
|
6786
|
+
var styles$v = {"progress-circle":"progress-circle-module-4nweP","spin":"progress-circle-module-kCf7K"};
|
|
6786
6787
|
|
|
6787
|
-
function
|
|
6788
|
-
return (
|
|
6788
|
+
function ProgressCircle({ className }) {
|
|
6789
|
+
return (jsxs("svg", { className: clsx(styles$v['progress-circle'], className), viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", children: [jsx("title", { children: "Spinner" }), jsxs("defs", { children: [jsx("pattern", { height: "100%", id: "pattern-1", patternUnits: "objectBoundingBox", width: "100%", children: jsx("use", { xlinkHref: "#image-2" }) }), jsx("image", { height: "24", id: "image-2", width: "24", xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAB7UlEQVRIDZ2VSaoCQQyG01rOoBtBr+YZXXsFL+BGEHcqDuCE89SPL480hdpiGYil3an/S1KDUavViq/Xq1wul8RPp5Ocz2dhPB6PiR8OB42RAHO5XE7D4zgW/PF4CM/u97tks1n1TCYjURSpB2hraALglw8BQGXOuQQSKk68y+fzL9lRBQAqAUIlVkUoxBUKBZ3sC1irbrdbUoX/PgTyAqDXmFVBBVRCFfYuGMBk67UvRCUA2FFAfgKUSiWhFTgQA9ESjLVgC7NWwEPNFYtFFUEICJnigAxCFbvd7jcAFVi/gbDoCALmOzCMAzebzUILEFculxVgOwcIDqRSqaiTBDadToMhziYDwBgNRmW0rdFoSLPZ1PeDwUDHbz+iTqejyv5VYHuekbVggavVqkLq9fq32hqnLTJxdgmijPQeYSqs1Woa3G63g8QJ1haZKMJkjDgLjLi/Nbvd7m8ARCxry9x2jyn2ej2ZTCb28+tRK/Azpy3vrN/vy2azeffq4zM9aLTFP1jPM4bDoWbPH06o6WXn9/lZgDMxGo1kuVwG/5uhlfkkTsB4PJb5fC7b7VYPH89C7P9GS5nBLYr4er2W/X6vhy4lNPXxR8BisdDWkD13Ee0KtVQAgqvVSncO2XNlc3WEWirAxLmmgf0K+ANZ6DTlvO5jwwAAAABJRU5ErkJggg==" })] }), jsx("g", { fill: "none", fillRule: "evenodd", id: "Page-1", stroke: "none", strokeWidth: "1", children: jsx("path", { d: "M12,0 C18.627417,0 24,5.372583 24,12 C24,14.7277828 23.0855773,17.3196292 21.4324752,19.4188392 C19.1717866,22.2895997 15.7255176,24 12,24 C11.2636203,24 10.6666667,23.4030463 10.6666667,22.6666667 C10.6666667,21.930287 11.2636203,21.3333333 12,21.3333333 C14.8994206,21.3333333 17.5771113,20.0043823 19.3374325,17.7690188 C20.6234737,16.1359252 21.3333333,14.1238938 21.3333333,12 C21.3333333,6.84534234 17.1546577,2.66666667 12,2.66666667 C6.84534234,2.66666667 2.66666667,6.84534234 2.66666667,12 C2.66666667,14.4546154 3.61656005,16.756214 5.28844833,18.485859 C5.80023235,19.015323 5.78589988,19.8594213 5.25643588,20.3712053 C4.72697187,20.8829893 3.88287357,20.8686569 3.37108955,20.3391928 C1.22326178,18.1171666 0,15.1531945 0,12 C0,5.372583 5.372583,0 12,0 Z", fill: "url(#pattern-1)", fillRule: "nonzero", id: "Spinner" }) })] }));
|
|
6789
6790
|
}
|
|
6790
6791
|
|
|
6791
|
-
var styles$u = {"
|
|
6792
|
+
var styles$u = {"product-grid":"product-overview-grid-module-bzys-","loading-panel":"product-overview-grid-module-XikkF","fade-in":"product-overview-grid-module-A6CS7","progress-circle":"product-overview-grid-module-DWnnI","grid-item":"product-overview-grid-module-MlUVA"};
|
|
6792
6793
|
|
|
6793
|
-
function
|
|
6794
|
-
return (jsxs("
|
|
6794
|
+
function ProductOverviewGrid({ children, isLoading, }) {
|
|
6795
|
+
return (jsxs("div", { className: styles$u['product-grid'], children: [Children.map(children, (child, index) => (jsx("div", { className: styles$u['grid-item'], children: child }, index))), isLoading && (jsx("div", { className: styles$u['loading-panel'], children: jsx(ProgressCircle, { className: styles$u['progress-circle'] }) }))] }));
|
|
6795
6796
|
}
|
|
6796
6797
|
|
|
6797
6798
|
var styles$t = {"loading-overlay":"loading-overlay-module-L67Gy"};
|
|
@@ -7357,9 +7358,11 @@ function useProductHits() {
|
|
|
7357
7358
|
}
|
|
7358
7359
|
|
|
7359
7360
|
function ProductOverview() {
|
|
7361
|
+
const { status } = useInstantSearch();
|
|
7362
|
+
const isLoading = status !== 'idle';
|
|
7360
7363
|
const products = useProductHits();
|
|
7361
7364
|
const { sendAddToCartFromProductListPageEvent, sendProductClickFromProductListPageEvent, } = useAlgoliaInsights();
|
|
7362
|
-
return (jsx(ProductOverviewGrid, { children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, image: {
|
|
7365
|
+
return (jsx(ProductOverviewGrid, { isLoading: isLoading, children: products.map(product => (jsx(ConnectedProductCard, { href: product.storefrontSlug, image: {
|
|
7363
7366
|
fit: 'contain',
|
|
7364
7367
|
image: product.image,
|
|
7365
7368
|
title: product.name,
|
|
@@ -7542,7 +7545,7 @@ function createQueryStringRouting({ algoliaIndex, categoryPages, }) {
|
|
|
7542
7545
|
}
|
|
7543
7546
|
|
|
7544
7547
|
function AlgoliaInsightInstantSearchProvider({ children, }) {
|
|
7545
|
-
const { results } = useInstantSearch();
|
|
7548
|
+
const { results } = useInstantSearch$1();
|
|
7546
7549
|
return (jsx(AlgoliaInsightsProvider, { value: {
|
|
7547
7550
|
index: results.index,
|
|
7548
7551
|
queryId: results.queryID,
|
|
@@ -7570,20 +7573,24 @@ const offlineSearchClient = {
|
|
|
7570
7573
|
},
|
|
7571
7574
|
};
|
|
7572
7575
|
|
|
7573
|
-
const createSonicSearchClient = ({ apiKey, appId, host,
|
|
7576
|
+
const createSonicSearchClient = ({ apiKey, appId, host, }) => {
|
|
7574
7577
|
const searchClient = algoliasearch(appId, apiKey);
|
|
7575
|
-
if (host) {
|
|
7576
|
-
|
|
7577
|
-
// @ts-ignore
|
|
7578
|
-
searchClient.search = async (requests) => {
|
|
7579
|
-
const res = await fetch(`${config.PROXY_API_URL}${path}`, {
|
|
7580
|
-
body: JSON.stringify({ requests }),
|
|
7581
|
-
headers: { 'Content-Type': 'application/json' },
|
|
7582
|
-
method: 'post',
|
|
7583
|
-
});
|
|
7584
|
-
return await res.json();
|
|
7585
|
-
};
|
|
7578
|
+
if (!host) {
|
|
7579
|
+
return searchClient;
|
|
7586
7580
|
}
|
|
7581
|
+
const read = searchClient.transporter.read;
|
|
7582
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7583
|
+
// @ts-ignore
|
|
7584
|
+
searchClient.transporter.hosts = [{ accept: 1, protocol: 'https', url: host }];
|
|
7585
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7586
|
+
// @ts-ignore
|
|
7587
|
+
searchClient.transporter.timeouts = { connect: 3000, read: 3000, write: 3000 };
|
|
7588
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7589
|
+
// @ts-ignore
|
|
7590
|
+
searchClient.transporter.read = (request) => {
|
|
7591
|
+
request.path = `/api/v1/bff/${request.path.replace('*', 'x')}`;
|
|
7592
|
+
return read(request);
|
|
7593
|
+
};
|
|
7587
7594
|
return searchClient;
|
|
7588
7595
|
};
|
|
7589
7596
|
|
|
@@ -7706,7 +7713,6 @@ function ProductListingPage({ pageUrl, searchClient: _searchClient, }) {
|
|
|
7706
7713
|
apiKey: config.ALGOLIA_API_KEY,
|
|
7707
7714
|
appId: config.ALGOLIA_APP_ID,
|
|
7708
7715
|
host: config.ALGOLIA_PROXY_HOST,
|
|
7709
|
-
path: '/search',
|
|
7710
7716
|
}), [_searchClient]);
|
|
7711
7717
|
if (isError) {
|
|
7712
7718
|
if (!isRequestError(error))
|
|
@@ -8011,7 +8017,6 @@ function AlgoliaSearchProvider({ children, searchClient: _searchClient, }) {
|
|
|
8011
8017
|
apiKey: config.ALGOLIA_API_KEY,
|
|
8012
8018
|
appId: config.ALGOLIA_APP_ID,
|
|
8013
8019
|
host: config.ALGOLIA_PROXY_HOST,
|
|
8014
|
-
path: '/autocomplete',
|
|
8015
8020
|
}), [_searchClient]);
|
|
8016
8021
|
const languageCode = useLanguageCode();
|
|
8017
8022
|
const index = getAlgoliaIndex(environment, languageCode);
|
|
@@ -8207,10 +8212,10 @@ function SearchSection({ button, children, className, title, }) {
|
|
|
8207
8212
|
return (jsxs("div", { className: clsx(styles$7['search-section'], className), children: [jsxs("div", { className: styles$7.header, children: [title && jsx("h2", { className: styles$7.title, children: title }), button && button] }), jsx("div", { className: styles$7.content, children: children })] }));
|
|
8208
8213
|
}
|
|
8209
8214
|
|
|
8210
|
-
var styles$6 = {"content":"search-content-module-KIok6","left":"search-content-module-YRLIf","right":"search-content-module-qK5sg","product-results":"search-content-module-bcFCH","no-results-text":"search-content-module-H-FX2","title":"search-content-module-ywvOI","suggestions":"search-content-module-mhiBZ","list":"search-content-module-coPAt"};
|
|
8215
|
+
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","title":"search-content-module-ywvOI","suggestions":"search-content-module-mhiBZ","list":"search-content-module-coPAt"};
|
|
8211
8216
|
|
|
8212
|
-
function SectionContainer({ leftContent, rightContent, }) {
|
|
8213
|
-
return (jsxs("div", { className: styles$6['content'], children: [jsx("div", { className: styles$6['left'], children: leftContent }), jsx("div", { className: styles$6['right'], children: rightContent })] }));
|
|
8217
|
+
function SectionContainer({ buttons, leftContent, rightContent, }) {
|
|
8218
|
+
return (jsxs("div", { className: styles$6['section-container'], children: [jsxs("div", { className: styles$6['content'], children: [jsx("div", { className: styles$6['left'], children: leftContent }), jsx("div", { className: styles$6['right'], children: rightContent })] }), jsx("div", { className: styles$6['button-container'], children: buttons })] }));
|
|
8214
8219
|
}
|
|
8215
8220
|
|
|
8216
8221
|
function NoResults() {
|
|
@@ -8314,7 +8319,9 @@ function StrokeRecentIcon(props) {
|
|
|
8314
8319
|
}
|
|
8315
8320
|
|
|
8316
8321
|
function WithResults() {
|
|
8317
|
-
|
|
8322
|
+
const { state } = useAlgoliaSearch();
|
|
8323
|
+
const resultsCount = state.collections.reduce((acc, collection) => acc + collection.items.length, 0);
|
|
8324
|
+
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}`, children: [jsx(FormattedMessage, { id: "See all results" }), " (", resultsCount, ")", jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })] }), leftContent: jsx(SuggestionsSection, {}), rightContent: jsx(ProductResultsSection, {}) }) }));
|
|
8318
8325
|
}
|
|
8319
8326
|
function SuggestionsSection() {
|
|
8320
8327
|
const { autocomplete, categories, querySuggestions, recentSearches } = useAlgoliaSearch();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const createSonicSearchClient: ({ apiKey, appId, host, path, }: {
|
|
1
|
+
export declare const createSonicSearchClient: ({ apiKey, appId, host, }: {
|
|
3
2
|
apiKey: string;
|
|
4
3
|
appId: string;
|
|
5
4
|
host: string | undefined;
|
|
6
|
-
|
|
7
|
-
}) => SearchClient;
|
|
5
|
+
}) => import("algoliasearch").SearchClient;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
interface SearchContentProps {
|
|
3
|
+
buttons?: ReactNode;
|
|
3
4
|
leftContent: ReactNode;
|
|
4
5
|
rightContent: ReactNode;
|
|
5
6
|
}
|
|
6
|
-
export declare function SectionContainer({ leftContent, rightContent, }: SearchContentProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function SectionContainer({ buttons, leftContent, rightContent, }: SearchContentProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Cancel' | 'Create new list' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Double check your spelling' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Hide filters' | 'Incl. VAT' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Products' | 'Quick access' | 'Recent searches' | 'Searching again using more general terms' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, we could not find matches for' | 'Sort by' | 'Submit' | 'Suggestions' | 'Use fewer keywords' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Cancel' | 'Create new list' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Double check your spelling' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Hide filters' | 'Incl. VAT' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Products' | 'Quick access' | 'Recent searches' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, we could not find matches for' | 'Sort by' | 'Submit' | 'Suggestions' | 'Use fewer keywords' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface ProductOverviewGridProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
+
isLoading?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare function ProductOverviewGrid({ children }: ProductOverviewGridProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function ProductOverviewGrid({ children, isLoading, }: ProductOverviewGridProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/styles.css
CHANGED
|
@@ -1851,17 +1851,62 @@
|
|
|
1851
1851
|
display: none;
|
|
1852
1852
|
}
|
|
1853
1853
|
|
|
1854
|
+
.progress-circle-module-4nweP {
|
|
1855
|
+
--width: var(--space-24);
|
|
1856
|
+
|
|
1857
|
+
width: var(--width);
|
|
1858
|
+
height: var(--width);
|
|
1859
|
+
animation: progress-circle-module-kCf7K 0.6s infinite linear;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
@keyframes progress-circle-module-kCf7K {
|
|
1863
|
+
to {
|
|
1864
|
+
transform: rotate(360deg);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1854
1868
|
.product-overview-grid-module-bzys- {
|
|
1855
1869
|
--amount-of-columns: 1;
|
|
1856
1870
|
--column-gap: 0;
|
|
1857
1871
|
--row-gap: var(--space-16);
|
|
1858
1872
|
|
|
1873
|
+
position: relative;
|
|
1859
1874
|
display: grid;
|
|
1860
1875
|
width: 100%;
|
|
1861
1876
|
gap: var(--row-gap) var(--column-gap);
|
|
1862
1877
|
grid-template-columns: repeat(var(--amount-of-columns), 1fr);
|
|
1863
1878
|
}
|
|
1864
1879
|
|
|
1880
|
+
.product-overview-grid-module-bzys- .product-overview-grid-module-XikkF {
|
|
1881
|
+
position: absolute;
|
|
1882
|
+
z-index: 100;
|
|
1883
|
+
display: flex;
|
|
1884
|
+
justify-content: center;
|
|
1885
|
+
padding: 120px;
|
|
1886
|
+
animation: product-overview-grid-module-A6CS7 0.3s ease-in-out forwards;
|
|
1887
|
+
background-color: rgb(255 255 255 / 0%);
|
|
1888
|
+
inset: 0;
|
|
1889
|
+
pointer-events: none;
|
|
1890
|
+
-webkit-user-select: none;
|
|
1891
|
+
-moz-user-select: none;
|
|
1892
|
+
user-select: none;
|
|
1893
|
+
}
|
|
1894
|
+
|
|
1895
|
+
.product-overview-grid-module-bzys- .product-overview-grid-module-XikkF .product-overview-grid-module-DWnnI {
|
|
1896
|
+
position: fixed;
|
|
1897
|
+
top: 50vh;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
@keyframes product-overview-grid-module-A6CS7 {
|
|
1901
|
+
from {
|
|
1902
|
+
background-color: rgb(255 255 255 / 0%);
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
to {
|
|
1906
|
+
background-color: rgb(255 255 255 / 80%);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1865
1910
|
.product-overview-grid-module-MlUVA {
|
|
1866
1911
|
container-type: inline-size;
|
|
1867
1912
|
}
|
|
@@ -1933,20 +1978,6 @@
|
|
|
1933
1978
|
}
|
|
1934
1979
|
}
|
|
1935
1980
|
|
|
1936
|
-
.progress-circle-module-4nweP {
|
|
1937
|
-
--width: var(--space-24);
|
|
1938
|
-
|
|
1939
|
-
width: var(--width);
|
|
1940
|
-
height: var(--width);
|
|
1941
|
-
animation: progress-circle-module-kCf7K 0.6s infinite linear;
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
@keyframes progress-circle-module-kCf7K {
|
|
1945
|
-
to {
|
|
1946
|
-
transform: rotate(360deg);
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
1981
|
.loading-overlay-module-L67Gy {
|
|
1951
1982
|
--header-height-desktop: 96px;
|
|
1952
1983
|
--header-height-mobile: 54px;
|
|
@@ -2872,22 +2903,38 @@
|
|
|
2872
2903
|
gap: var(--space-16);
|
|
2873
2904
|
}
|
|
2874
2905
|
|
|
2875
|
-
.search-content-module-
|
|
2906
|
+
.search-content-module-ZMwlB {
|
|
2876
2907
|
--padding-inline: var(--space-16);
|
|
2877
2908
|
--padding-block: var(--space-20);
|
|
2909
|
+
}
|
|
2878
2910
|
|
|
2911
|
+
.search-content-module-KIok6 {
|
|
2879
2912
|
display: grid;
|
|
2880
2913
|
grid-template-columns: 1fr;
|
|
2881
2914
|
}
|
|
2882
2915
|
|
|
2883
|
-
|
|
2916
|
+
.search-content-module-KIok6 .search-content-module-YRLIf {
|
|
2884
2917
|
display: block;
|
|
2885
2918
|
}
|
|
2886
2919
|
|
|
2887
|
-
|
|
2920
|
+
.search-content-module-KIok6 .search-content-module-qK5sg {
|
|
2888
2921
|
display: block;
|
|
2889
2922
|
}
|
|
2890
2923
|
|
|
2924
|
+
.search-content-module-w-ORq {
|
|
2925
|
+
display: flex;
|
|
2926
|
+
flex-wrap: wrap;
|
|
2927
|
+
padding-bottom: var(--padding-block);
|
|
2928
|
+
gap: var(--space-16);
|
|
2929
|
+
padding-inline: var(--padding-inline);
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
@media (width < 768px) {
|
|
2933
|
+
.search-content-module-w-ORq .search-content-module-bO1Q0 {
|
|
2934
|
+
width: 100%;
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2891
2938
|
.search-content-module-bcFCH {
|
|
2892
2939
|
--column-gap: var(--space-16);
|
|
2893
2940
|
--card-width: 154px;
|