@sonic-equipment/ui 134.0.0 → 136.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/address/address.d.ts +5 -2
- package/dist/address/address.js +3 -2
- package/dist/algolia/algolia-initialization.js +2 -1
- package/dist/algolia/algolia-insights-provider.js +3 -3
- package/dist/algolia/algolia-searchclient-offline.js +3 -2
- package/dist/algolia/use-algolia-insights.js +24 -23
- package/dist/buttons/link/link.d.ts +2 -1
- package/dist/buttons/link/link.js +4 -2
- package/dist/collapsables/accordion/accordion-item.d.ts +2 -1
- package/dist/collapsables/accordion/accordion-item.js +13 -4
- package/dist/exports.d.ts +7 -0
- package/dist/footer/footer.d.ts +9 -0
- package/dist/footer/footer.js +14 -0
- package/dist/footer/footer.model.d.ts +18 -0
- package/dist/footer/footer.module.css.js +3 -0
- package/dist/header/hamburger-button/hamburger-button.d.ts +6 -0
- package/dist/header/hamburger-button/hamburger-button.js +14 -0
- package/dist/header/hamburger-button/hamburger-button.module.css.js +3 -0
- package/dist/header/header-layout/header-layout.d.ts +9 -0
- package/dist/header/header-layout/header-layout.js +8 -0
- package/dist/header/header-layout/header-layout.module.css.js +3 -0
- package/dist/header/sonic-logo/sonic-logo.d.ts +5 -0
- package/dist/header/sonic-logo/sonic-logo.js +11 -0
- package/dist/header/sonic-logo/sonic-logo.module.css.js +3 -0
- package/dist/index.js +7 -0
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/intl/utils.js +2 -1
- package/dist/logging/logger.d.ts +11 -0
- package/dist/logging/logger.js +22 -0
- package/dist/logging/use-log-error.d.ts +1 -0
- package/dist/logging/use-log-error.js +12 -0
- package/dist/notifications/announcements/announcement-provider.js +3 -6
- package/dist/pages/checkout/components/billing-and-invoice-information.js +1 -1
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +1 -1
- package/dist/pages/checkout/payment-page/components/adyen-payment.js +34 -24
- package/dist/pages/checkout/payment-page/components/payment.js +29 -17
- package/dist/pages/checkout/payment-page/payment-page-content.js +1 -1
- package/dist/pages/checkout/shipping-page/components/edit-address.d.ts +3 -2
- package/dist/pages/checkout/shipping-page/components/edit-address.js +5 -5
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +25 -1
- package/dist/pages/checkout/shipping-page/shipping-page-content.d.ts +2 -1
- package/dist/pages/checkout/shipping-page/shipping-page-content.js +2 -2
- package/dist/pages/checkout/shipping-page/shipping-page.js +3 -2
- package/dist/pages/product/search-result-page/search-results-page.js +1 -1
- package/dist/shared/ga/data-layer.js +3 -2
- package/dist/shared/providers/global-state-provider.js +3 -5
- package/dist/shared/utils/debug.d.ts +2 -0
- package/dist/shared/utils/debug.js +21 -0
- package/dist/shared/utils/environment.js +4 -2
- package/dist/styles.css +242 -3
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { AddressType } from '../shared/model/address';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export interface AddressProps {
|
|
3
|
+
address: AddressType;
|
|
4
|
+
'data-test-selector'?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function Address({ address, 'data-test-selector': dataTestSelector, }: AddressProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/address/address.js
CHANGED
|
@@ -2,8 +2,9 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { capitalizeFirstLetter } from '../shared/utils/string.js';
|
|
3
3
|
import styles from './address.module.css.js';
|
|
4
4
|
|
|
5
|
-
function Address({
|
|
6
|
-
|
|
5
|
+
function Address({ address, 'data-test-selector': dataTestSelector, }) {
|
|
6
|
+
const { address1, address2, address3, city, companyName, country, email, firstName, lastName, phone, postalCode, } = address;
|
|
7
|
+
return (jsxs("address", { className: styles.address, "data-test-selector": dataTestSelector, children: [(firstName || lastName) && (jsx("p", { "data-test-selector": "addressInfoDisplay_name", children: `${firstName} ${lastName}` })), companyName && (jsx("p", { "data-test-selector": "addressInfoDisplay_companyName", children: companyName })), address1 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address1", children: address1 })), address2 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address2", children: address2 })), address3 && (jsx("p", { "data-test-selector": "addressInfoDisplay_address3", children: address3 })), (postalCode || city) && (jsxs("p", { "data-test-selector": "addressInfoDisplay_postalCodeAndCity", children: [postalCode, " ", city ? capitalizeFirstLetter(city) : ''] })), country && (jsx("p", { "data-test-selector": "addressInfoDisplay_country", children: country })), phone && jsx("p", { "data-test-selector": "addressInfoDisplay_phone", children: phone }), email && jsx("p", { "data-test-selector": "addressInfoDisplay_email", children: email })] }));
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export { Address };
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { config } from '../config.js';
|
|
3
3
|
import Cookies from 'js-cookie';
|
|
4
4
|
import aa from 'search-insights';
|
|
5
|
+
import { logger } from '../logging/logger.js';
|
|
5
6
|
import { request } from '../shared/fetch/request.js';
|
|
6
7
|
import { createUUID } from '../shared/utils/uuid.js';
|
|
7
8
|
|
|
@@ -14,7 +15,7 @@ aa('init', {
|
|
|
14
15
|
});
|
|
15
16
|
aa('getUserToken', {}, (err, value) => {
|
|
16
17
|
if (err)
|
|
17
|
-
return
|
|
18
|
+
return logger.error(err);
|
|
18
19
|
userToken = value === undefined ? generateUserToken() : String(value);
|
|
19
20
|
});
|
|
20
21
|
aa('onUserTokenChange', value => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { createContext, useContext } from 'react';
|
|
3
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
4
4
|
import { useCultureCode } from '../intl/use-culture-code.js';
|
|
5
5
|
import { getLanguageCodeFromCultureCode } from '../intl/utils.js';
|
|
6
6
|
import { environment } from '../shared/utils/environment.js';
|
|
@@ -13,12 +13,12 @@ function AlgoliaInsightsProvider({ children, value, }) {
|
|
|
13
13
|
const algoliaIndex = getAlgoliaIndex(environment, getLanguageCodeFromCultureCode(cultureCode));
|
|
14
14
|
const [globalState] = useAlgoliaInsightsGlobalState();
|
|
15
15
|
const context = useContext(AlgoliaInsightsProviderContext);
|
|
16
|
-
const combinedValue = {
|
|
16
|
+
const combinedValue = useMemo(() => ({
|
|
17
17
|
index: algoliaIndex.default,
|
|
18
18
|
...globalState,
|
|
19
19
|
...context,
|
|
20
20
|
...value,
|
|
21
|
-
};
|
|
21
|
+
}), [algoliaIndex.default, context, globalState, value]);
|
|
22
22
|
return (jsx(AlgoliaInsightsProviderContext.Provider, { value: combinedValue, children: children }));
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { logger } from '../logging/logger.js';
|
|
3
|
+
|
|
2
4
|
const searchClientLogger = (searchClient) => {
|
|
3
5
|
return {
|
|
4
6
|
...searchClient,
|
|
5
7
|
search: (async (queries, requestOptions) => {
|
|
6
8
|
const response = await searchClient.search(queries, requestOptions);
|
|
7
|
-
|
|
8
|
-
console.log('Algolia::SearchClient::search', {
|
|
9
|
+
logger.info('Algolia::SearchClient::search', {
|
|
9
10
|
args: { queries, requestOptions },
|
|
10
11
|
response,
|
|
11
12
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
3
|
import aa from 'search-insights';
|
|
4
|
+
import { logger } from '../logging/logger.js';
|
|
4
5
|
import { currencySymbolToISO } from '../shared/model/currency.js';
|
|
5
6
|
import { ensureArray } from '../shared/utils/array.js';
|
|
6
7
|
import { userToken } from './algolia-initialization.js';
|
|
@@ -18,7 +19,7 @@ function useAlgoliaInsights() {
|
|
|
18
19
|
context,
|
|
19
20
|
sendAddToCartFromProductDetailsPageEvent({ cartLine }) {
|
|
20
21
|
if (!context.index)
|
|
21
|
-
return
|
|
22
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
22
23
|
if (context.queryId) {
|
|
23
24
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
24
25
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
@@ -55,9 +56,9 @@ function useAlgoliaInsights() {
|
|
|
55
56
|
},
|
|
56
57
|
sendAddToCartFromProductListPageEvent({ cartLine }) {
|
|
57
58
|
if (!context.index)
|
|
58
|
-
return
|
|
59
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
59
60
|
if (!context.queryId)
|
|
60
|
-
return
|
|
61
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
61
62
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
62
63
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
63
64
|
eventName: 'PLP: AddToCart ClickedAfterSearch',
|
|
@@ -76,7 +77,7 @@ function useAlgoliaInsights() {
|
|
|
76
77
|
},
|
|
77
78
|
sendAddToCartFromSearchEvent({ cartLine, queryId }) {
|
|
78
79
|
if (!context.index)
|
|
79
|
-
return
|
|
80
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
80
81
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
81
82
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
82
83
|
eventName: 'SRP: AddToCart ClickedAfterSearch',
|
|
@@ -95,9 +96,9 @@ function useAlgoliaInsights() {
|
|
|
95
96
|
},
|
|
96
97
|
sendAddToCartFromSearchResultPageEvent({ cartLine }) {
|
|
97
98
|
if (!context.index)
|
|
98
|
-
return
|
|
99
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
99
100
|
if (!context.queryId)
|
|
100
|
-
return
|
|
101
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
101
102
|
aa('addedToCartObjectIDsAfterSearch', {
|
|
102
103
|
currency: getCurrencyFromPriceString(cartLine.pricing?.actualPriceDisplay),
|
|
103
104
|
eventName: 'SRP: AddToCart ClickedAfterSearch',
|
|
@@ -116,10 +117,10 @@ function useAlgoliaInsights() {
|
|
|
116
117
|
},
|
|
117
118
|
sendAddToWishListFromProductDetailsPageEvent({ objectId, position }) {
|
|
118
119
|
if (!context.index)
|
|
119
|
-
return
|
|
120
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
120
121
|
if (context.queryId) {
|
|
121
122
|
if (!position)
|
|
122
|
-
return
|
|
123
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no position', context, objectId);
|
|
123
124
|
aa('clickedObjectIDsAfterSearch', {
|
|
124
125
|
eventName: 'PDP: Product Added to Wishlist',
|
|
125
126
|
index: context.index,
|
|
@@ -140,9 +141,9 @@ function useAlgoliaInsights() {
|
|
|
140
141
|
},
|
|
141
142
|
sendAddToWishListFromProductListPageEvent({ objectId, position }) {
|
|
142
143
|
if (!context.index)
|
|
143
|
-
return
|
|
144
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
144
145
|
if (!context.queryId)
|
|
145
|
-
return
|
|
146
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
146
147
|
aa('clickedObjectIDsAfterSearch', {
|
|
147
148
|
eventName: 'PLP: Product Added to Wishlist',
|
|
148
149
|
index: context.index,
|
|
@@ -154,7 +155,7 @@ function useAlgoliaInsights() {
|
|
|
154
155
|
},
|
|
155
156
|
sendAddToWishListFromSearchEvent({ objectId, position, queryId }) {
|
|
156
157
|
if (!context.index)
|
|
157
|
-
return
|
|
158
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
158
159
|
aa('clickedObjectIDsAfterSearch', {
|
|
159
160
|
eventName: 'SRP: Product Added to Wishlist',
|
|
160
161
|
index: context.index,
|
|
@@ -166,9 +167,9 @@ function useAlgoliaInsights() {
|
|
|
166
167
|
},
|
|
167
168
|
sendAddToWishListFromSearchResultPageEvent({ objectId, position, }) {
|
|
168
169
|
if (!context.index)
|
|
169
|
-
return
|
|
170
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
170
171
|
if (!context.queryId)
|
|
171
|
-
return
|
|
172
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
172
173
|
aa('clickedObjectIDsAfterSearch', {
|
|
173
174
|
eventName: 'SRP: Product Added to Wishlist',
|
|
174
175
|
index: context.index,
|
|
@@ -180,11 +181,11 @@ function useAlgoliaInsights() {
|
|
|
180
181
|
},
|
|
181
182
|
sendProductClickFromProductListPageEvent({ objectId, position }) {
|
|
182
183
|
if (!objectId)
|
|
183
|
-
return
|
|
184
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
184
185
|
if (!context.index)
|
|
185
|
-
return
|
|
186
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
186
187
|
if (!context.queryId)
|
|
187
|
-
return
|
|
188
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
188
189
|
aa('clickedObjectIDsAfterSearch', {
|
|
189
190
|
eventName: 'PLP: Product Clicked',
|
|
190
191
|
index: context.index,
|
|
@@ -200,9 +201,9 @@ function useAlgoliaInsights() {
|
|
|
200
201
|
},
|
|
201
202
|
sendProductClickFromSearchEvent({ objectId, position, queryId }) {
|
|
202
203
|
if (!objectId)
|
|
203
|
-
return
|
|
204
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
204
205
|
if (!context.index)
|
|
205
|
-
return
|
|
206
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
206
207
|
aa('clickedObjectIDsAfterSearch', {
|
|
207
208
|
eventName: 'SRP: Product Clicked',
|
|
208
209
|
index: context.index,
|
|
@@ -218,11 +219,11 @@ function useAlgoliaInsights() {
|
|
|
218
219
|
},
|
|
219
220
|
sendProductClickFromSearchResultPageEvent({ objectId, position }) {
|
|
220
221
|
if (!objectId)
|
|
221
|
-
return
|
|
222
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
222
223
|
if (!context.index)
|
|
223
|
-
return
|
|
224
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
224
225
|
if (!context.queryId)
|
|
225
|
-
return
|
|
226
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no queryId', context);
|
|
226
227
|
aa('clickedObjectIDsAfterSearch', {
|
|
227
228
|
eventName: 'SRP: Product Clicked',
|
|
228
229
|
index: context.index,
|
|
@@ -238,9 +239,9 @@ function useAlgoliaInsights() {
|
|
|
238
239
|
},
|
|
239
240
|
sendPurchaseEventFromPaymentPage({ cart }) {
|
|
240
241
|
if (!context.index)
|
|
241
|
-
return
|
|
242
|
+
return logger.warn('Unable to send clickedObjectIDsAfterSearch event, no index', context);
|
|
242
243
|
if (!cart.cartLines || cart.cartLines.length === 0)
|
|
243
|
-
return
|
|
244
|
+
return logger.warn('Unable to send purchasedObjectIDs event, no cartLines', cart);
|
|
244
245
|
aa('purchasedObjectIDs', {
|
|
245
246
|
currency: currencySymbolToISO[cart.currencySymbol],
|
|
246
247
|
eventName: 'Purchase Successful',
|
|
@@ -2,8 +2,9 @@ import { AnchorHTMLAttributes } from 'react';
|
|
|
2
2
|
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
3
|
areaSelected?: boolean;
|
|
4
4
|
color?: 'primary' | 'secondary';
|
|
5
|
+
currentColor?: boolean;
|
|
5
6
|
hasUnderline?: boolean;
|
|
6
7
|
isDisabled?: boolean;
|
|
7
8
|
role?: 'option';
|
|
8
9
|
}
|
|
9
|
-
export declare function Link({ children, className, color, hasUnderline, isDisabled, onClick, onKeyUp, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Link({ children, className, color, currentColor, hasUnderline, isDisabled, onClick, onKeyUp, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,11 +3,13 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import styles from './link.module.css.js';
|
|
5
5
|
|
|
6
|
-
function Link({ children, className, color = 'primary', hasUnderline, isDisabled, onClick, onKeyUp, ...props }) {
|
|
6
|
+
function Link({ children, className, color = 'primary', currentColor, hasUnderline, isDisabled, onClick, onKeyUp, ...props }) {
|
|
7
7
|
return (jsx("a", { className: clsx({
|
|
8
8
|
[styles.hover]: Boolean(props.href),
|
|
9
9
|
[styles['has-underline']]: hasUnderline && props.href,
|
|
10
|
-
|
|
10
|
+
[styles[color]]: !currentColor,
|
|
11
|
+
[styles['current-color']]: currentColor,
|
|
12
|
+
}, styles['link'], className), "data-disabled": isDisabled ? true : undefined, onClick: onClick, onKeyUp: onKeyUp, role: "link", tabIndex: isDisabled ? -1 : 0, ...props, children: children }));
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export { Link };
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export type BorderType = 'top' | 'middle' | 'middle-accentuated' | 'bottom';
|
|
3
3
|
export interface AccordionItemProps {
|
|
4
4
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
5
|
+
allowCollapse?: boolean;
|
|
5
6
|
allowToggle?: boolean;
|
|
6
7
|
borderType?: BorderType | BorderType[];
|
|
7
8
|
children: ReactNode;
|
|
@@ -12,4 +13,4 @@ export interface AccordionItemProps {
|
|
|
12
13
|
size?: 'md' | 'lg';
|
|
13
14
|
title: ReactNode;
|
|
14
15
|
}
|
|
15
|
-
export declare function AccordionItem({ _pseudo, allowToggle, borderType, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function AccordionItem({ _pseudo, allowCollapse, allowToggle, borderType, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import { GlyphsChevronsBoldDownIcon } from '../../icons/glyph/glyphs-chevrons-bold-down-icon.js';
|
|
5
6
|
import { GlyphsChevronsSlimDownIcon } from '../../icons/glyph/glyphs-chevrons-slim-down-icon.js';
|
|
@@ -7,16 +8,24 @@ import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
|
|
|
7
8
|
import { ensureArray } from '../../shared/utils/array.js';
|
|
8
9
|
import styles from './accordion.module.css.js';
|
|
9
10
|
|
|
10
|
-
function AccordionItem({ _pseudo = 'none', allowToggle = true, borderType = 'bottom', children, className, id, initialIsOpen = false, isDisabled = false, size, title, }) {
|
|
11
|
-
const { isOpen, toggle } = useDisclosure(initialIsOpen);
|
|
11
|
+
function AccordionItem({ _pseudo = 'none', allowCollapse = true, allowToggle = true, borderType = 'bottom', children, className, id, initialIsOpen = false, isDisabled = false, size, title, }) {
|
|
12
|
+
const { close, isOpen, open, toggle } = useDisclosure(initialIsOpen);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (initialIsOpen) {
|
|
15
|
+
open();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
close();
|
|
19
|
+
}
|
|
20
|
+
}, [close, initialIsOpen, open]);
|
|
12
21
|
const panelId = `panel-${id}`;
|
|
13
22
|
return (jsxs("div", { className: clsx(className, ...ensureArray(borderType).map(type => styles[`border-type-${type}`]), styles['accordion-item'], {
|
|
14
23
|
[styles['is-open']]: isOpen,
|
|
15
24
|
[styles['allow-toggle']]: allowToggle,
|
|
16
|
-
}), children: [jsx("h3", { children: jsxs("button", { "aria-controls": panelId, "aria-expanded": isOpen, className: clsx(styles.button, styles[_pseudo]), disabled: isDisabled, id: id, onClick: () => {
|
|
25
|
+
}), children: [jsx("h3", { children: allowCollapse ? (jsxs("button", { "aria-controls": panelId, "aria-expanded": isOpen, className: clsx(styles.button, styles[_pseudo]), disabled: isDisabled, id: id, onClick: () => {
|
|
17
26
|
if (allowToggle)
|
|
18
27
|
toggle();
|
|
19
|
-
}, type: "button", children: [title, jsx("span", { className: styles.icon, children: size === 'lg' ? (jsx(GlyphsChevronsBoldDownIcon, {})) : (jsx(GlyphsChevronsSlimDownIcon, {})) })] }) }), jsx("div", { "aria-labelledby": id, className: styles.panel, id: panelId, role: "region", children: jsx("div", { className: styles.content, children: children }) })] }));
|
|
28
|
+
}, type: "button", children: [title, jsx("span", { className: styles.icon, children: size === 'lg' ? (jsx(GlyphsChevronsBoldDownIcon, {})) : (jsx(GlyphsChevronsSlimDownIcon, {})) })] })) : (jsx("span", { className: styles.button, children: title })) }), jsx("div", { "aria-labelledby": id, className: styles.panel, id: panelId, role: "region", children: jsx("div", { className: styles.content, children: children }) })] }));
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
export { AccordionItem };
|
package/dist/exports.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export * from './display/product-sku/product-sku';
|
|
|
73
73
|
export * from './filters/active-filters/active-filters';
|
|
74
74
|
export * from './filters/multi-select/multi-select';
|
|
75
75
|
export * from './filters/pagination/pagination';
|
|
76
|
+
export * from './footer/footer';
|
|
76
77
|
export * from './forms/checkbox/checkbox';
|
|
77
78
|
export * from './forms/color-checkbox/color-checkbox';
|
|
78
79
|
export * from './forms/field-error/field-error';
|
|
@@ -108,6 +109,9 @@ export * from './global-search/search-section/search-list-item';
|
|
|
108
109
|
export * from './global-search/search-section/search-section';
|
|
109
110
|
export * from './global-search/types';
|
|
110
111
|
export * from './header/cart-icon/connected-cart-icon';
|
|
112
|
+
export * from './header/hamburger-button/hamburger-button';
|
|
113
|
+
export * from './header/header-layout/header-layout';
|
|
114
|
+
export * from './header/sonic-logo/sonic-logo';
|
|
111
115
|
export * from './info-icon-tooltip/info-icon-tooltip';
|
|
112
116
|
export * from './intl/formatted-message';
|
|
113
117
|
export * from './intl/intl-context';
|
|
@@ -127,6 +131,8 @@ export * from './lists/ul/list';
|
|
|
127
131
|
export * from './loading/blank-page-spacer';
|
|
128
132
|
export * from './loading/loading-overlay';
|
|
129
133
|
export * from './loading/progress-circle';
|
|
134
|
+
export * from './logging/logger';
|
|
135
|
+
export * from './logging/use-log-error';
|
|
130
136
|
export * from './media/image-grid/images-grid';
|
|
131
137
|
export * from './media/image-lightbox/image-lightbox';
|
|
132
138
|
export * from './media/image/image';
|
|
@@ -287,6 +293,7 @@ export * from './shared/routing/with-routing';
|
|
|
287
293
|
export * from './shared/utils/array';
|
|
288
294
|
export * from './shared/utils/breakpoints';
|
|
289
295
|
export * from './shared/utils/date';
|
|
296
|
+
export * from './shared/utils/debug';
|
|
290
297
|
export * from './shared/utils/environment';
|
|
291
298
|
export * from './shared/utils/event-emitter';
|
|
292
299
|
export * from './shared/utils/merge';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FooterLink, LinkBlock } from './footer.model';
|
|
3
|
+
export interface FooterProps {
|
|
4
|
+
bottomLinks: FooterLink[];
|
|
5
|
+
copyright: string;
|
|
6
|
+
countrySelector: ReactNode;
|
|
7
|
+
linkBlocks: LinkBlock[];
|
|
8
|
+
}
|
|
9
|
+
export declare function Footer({ bottomLinks, copyright, countrySelector, linkBlocks, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Accordion } from '../collapsables/accordion/accordion.js';
|
|
4
|
+
import { AccordionItem } from '../collapsables/accordion/accordion-item.js';
|
|
5
|
+
import { useIsBreakpoint } from '../shared/hooks/use-is-breakpoint.js';
|
|
6
|
+
import { RouteLink } from '../shared/routing/route-link.js';
|
|
7
|
+
import styles from './footer.module.css.js';
|
|
8
|
+
|
|
9
|
+
function Footer({ bottomLinks, copyright, countrySelector, linkBlocks, }) {
|
|
10
|
+
const isXl = useIsBreakpoint('xl');
|
|
11
|
+
return (jsxs("footer", { className: styles.footer, children: [jsx("div", { className: styles['main-links'], children: linkBlocks.map(linkBlock => (jsx("div", { className: styles['link-block'], children: jsx(Accordion, { color: "white", hasLineSeparator: false, size: "lg", children: jsx(AccordionItem, { allowCollapse: !isXl, id: `link-block-${linkBlock.key}`, initialIsOpen: isXl, title: linkBlock.header, children: jsx("ul", { className: styles['list'], children: linkBlock.links.map(link => (jsx("li", { children: jsx(RouteLink, { currentColor: true, href: link.externalLink || link.internalLink, target: link.openInNewTab ? '_blank' : undefined, children: link.title }) }, link.key))) }) }) }) }, linkBlock.key))) }), jsxs("div", { className: styles['bottom-section'], children: [jsx("p", { className: styles.copyright, children: copyright }), jsx("div", { className: styles['bottom-links'], children: bottomLinks.map(link => (jsx(RouteLink, { className: styles['bottom-link'], currentColor: true, href: link.externalLink || link.internalLink, target: link.openInNewTab ? '_blank' : undefined, children: link.title }, link.key))) }), countrySelector] })] }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { Footer };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface FooterLink {
|
|
2
|
+
externalLink?: string;
|
|
3
|
+
internalLink?: string;
|
|
4
|
+
isButton: boolean;
|
|
5
|
+
key: string;
|
|
6
|
+
openInNewTab: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LinkBlock {
|
|
10
|
+
header: string;
|
|
11
|
+
key: string;
|
|
12
|
+
links: FooterLink[];
|
|
13
|
+
}
|
|
14
|
+
export interface FooterModel {
|
|
15
|
+
bottomLinks: FooterLink[];
|
|
16
|
+
copyright: string;
|
|
17
|
+
linkBlocks: LinkBlock[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"footer":"footer-module-YzJ68","main-links":"footer-module-rFBXC","link-block":"footer-module-P5FXP","link-block-heading":"footer-module-umuTh","list":"footer-module-FM4hU","bottom-section":"footer-module-TZq-4","copyright":"footer-module-qlHSS","bottom-links":"footer-module-5eyFH","bottom-link":"footer-module-0gJpF"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface HamburgerButtonProps {
|
|
2
|
+
'aria-controls': string;
|
|
3
|
+
isActive: boolean;
|
|
4
|
+
onActiveChange: (isActive: boolean) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function HamburgerButton({ 'aria-controls': ariaControls, isActive, onActiveChange, }: HamburgerButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { IconButton } from '../../buttons/icon-button/icon-button.js';
|
|
4
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
5
|
+
import styles from './hamburger-button.module.css.js';
|
|
6
|
+
|
|
7
|
+
function HamburgerButton({ 'aria-controls': ariaControls, isActive, onActiveChange, }) {
|
|
8
|
+
const t = useFormattedMessage();
|
|
9
|
+
return (jsx(IconButton, { "aria-controls": ariaControls, "aria-expanded": isActive, onClick: () => onActiveChange(!isActive), title: t('Toggle navigation menu'), type: "button", children: jsxs("div", { className: clsx(styles['hamburger-button'], {
|
|
10
|
+
[styles.active]: isActive,
|
|
11
|
+
}), children: [jsx("span", { "aria-hidden": "true" }), jsx("span", { "aria-hidden": "true" }), jsx("span", { "aria-hidden": "true" })] }) }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { HamburgerButton };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface HeaderLayoutProps {
|
|
3
|
+
hamburgerButton?: ReactNode;
|
|
4
|
+
logo: ReactNode;
|
|
5
|
+
mainNavigation: ReactNode;
|
|
6
|
+
navigationActions: ReactNode;
|
|
7
|
+
search: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function HeaderLayout({ hamburgerButton, logo, mainNavigation, navigationActions, search, }: HeaderLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './header-layout.module.css.js';
|
|
3
|
+
|
|
4
|
+
function HeaderLayout({ hamburgerButton, logo, mainNavigation, navigationActions, search, }) {
|
|
5
|
+
return (jsxs("header", { className: styles.header, children: [jsxs("div", { className: styles['mobile-menu-toggle'], children: [hamburgerButton && hamburgerButton, jsx("div", { className: styles.search, children: search })] }), jsx("div", { className: styles.logo, children: logo }), jsx("div", { className: styles['main-navigation'], children: mainNavigation }), jsxs("div", { className: styles['navigation-actions'], children: [jsx("div", { className: styles.search, children: search }), jsx("div", { className: styles.icons, children: navigationActions })] })] }));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { HeaderLayout };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"header":"header-layout-module-VlTuk","logo":"header-layout-module-oKPyL","mobile-menu-toggle":"header-layout-module-aBOJL","main-navigation":"header-layout-module--ICLK","navigation-actions":"header-layout-module-HjY-a","search":"header-layout-module-fP3a6","icons":"header-layout-module-4Qp5b"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
4
|
+
import styles from './sonic-logo.module.css.js';
|
|
5
|
+
|
|
6
|
+
function SonicLogo({ className, href }) {
|
|
7
|
+
const Tag = href ? RouteLink : 'div';
|
|
8
|
+
return (jsx(Tag, { "aria-label": "Sonic", className: clsx(styles.wrapper, className), href: href, children: jsx("svg", { className: styles['sonic-logo'], viewBox: "0 0 100 24", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { fill: "none", fillRule: "evenodd", children: [jsx("path", { className: styles.letters, d: "M11.87 8.65c1.815 0 3.286 1.482 3.286 3.311 0 6.595-5.325 11.962-11.87 11.962C1.471 23.923 0 22.44 0 20.612c0-1.766 1.372-3.21 3.1-3.307l.186-.005c2.848 0 5.179-2.277 5.293-5.12l.005-.219c0-1.829 1.471-3.311 3.286-3.311zm0-8.65c1.815 0 3.286 1.483 3.286 3.311 0 1.766-1.371 3.21-3.1 3.307l-.186.005c-2.849 0-5.178 2.277-5.293 5.118l-.004.22c0 1.829-1.472 3.311-3.287 3.311C1.472 15.272 0 13.79 0 11.961 0 5.366 5.325 0 11.87 0zm6.155 12.016c0 6.596 5.325 11.963 11.87 11.963 6.545 0 11.87-5.367 11.87-11.963 0-6.595-5.325-11.96-11.87-11.96-6.545 0-11.87 5.365-11.87 11.96zm6.572 0c0-2.943 2.376-5.338 5.298-5.338 2.92 0 5.297 2.395 5.297 5.338 0 2.945-2.376 5.34-5.297 5.34-2.922 0-5.298-2.395-5.298-5.34zM82.251 3.56c-4.628 4.663-4.628 12.251 0 16.915 4.628 4.663 12.158 4.663 16.786 0a3.33 3.33 0 0 0 .001-4.683 3.268 3.268 0 0 0-4.501-.138l-.146.138a5.278 5.278 0 0 1-7.494 0c-2.064-2.081-2.064-5.468.001-7.549a5.275 5.275 0 0 1 7.313-.174l.18.173a3.268 3.268 0 0 0 4.647 0 3.33 3.33 0 0 0 0-4.684c-4.63-4.663-12.16-4.662-16.787.002zm-12.868-.13v17.148c0 1.828 1.47 3.311 3.285 3.311 1.816 0 3.287-1.483 3.287-3.311V3.429c0-1.829-1.471-3.312-3.287-3.312-1.815 0-3.285 1.483-3.285 3.312zM48.063.075c-1.814 0-3.285 1.483-3.285 3.311V20.69c0 1.828 1.471 3.311 3.286 3.311s3.286-1.483 3.286-3.311V6.698h2.95c2.92 0 5.297 2.394 5.297 5.338v8.653c0 1.828 1.471 3.311 3.286 3.311s3.286-1.483 3.286-3.311v-8.653C66.17 5.44 60.844.075 54.3.075h-6.235z" }), jsx("path", { className: styles.dot, d: "M35.27 12.017c0 2.991-2.406 5.416-5.375 5.416-2.97 0-5.376-2.425-5.376-5.416 0-2.992 2.407-5.417 5.376-5.417 2.969 0 5.375 2.425 5.375 5.417" })] }) }) }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { SonicLogo };
|
package/dist/index.js
CHANGED
|
@@ -78,6 +78,7 @@ export { ProductSku } from './display/product-sku/product-sku.js';
|
|
|
78
78
|
export { ActiveFilters } from './filters/active-filters/active-filters.js';
|
|
79
79
|
export { MultiSelect } from './filters/multi-select/multi-select.js';
|
|
80
80
|
export { Pagination } from './filters/pagination/pagination.js';
|
|
81
|
+
export { Footer } from './footer/footer.js';
|
|
81
82
|
export { Checkbox } from './forms/checkbox/checkbox.js';
|
|
82
83
|
export { ColorCheckbox } from './forms/color-checkbox/color-checkbox.js';
|
|
83
84
|
export { FieldError } from './forms/field-error/field-error.js';
|
|
@@ -112,6 +113,9 @@ export { SearchList } from './global-search/search-section/search-list.js';
|
|
|
112
113
|
export { SearchListItem } from './global-search/search-section/search-list-item.js';
|
|
113
114
|
export { SearchSection } from './global-search/search-section/search-section.js';
|
|
114
115
|
export { ConnectedCartIcon } from './header/cart-icon/connected-cart-icon.js';
|
|
116
|
+
export { HamburgerButton } from './header/hamburger-button/hamburger-button.js';
|
|
117
|
+
export { HeaderLayout } from './header/header-layout/header-layout.js';
|
|
118
|
+
export { SonicLogo } from './header/sonic-logo/sonic-logo.js';
|
|
115
119
|
export { InfoIconTooltip } from './info-icon-tooltip/info-icon-tooltip.js';
|
|
116
120
|
export { FormattedMessage } from './intl/formatted-message.js';
|
|
117
121
|
export { IntlContext } from './intl/intl-context.js';
|
|
@@ -130,6 +134,8 @@ export { List, ListItem } from './lists/ul/list.js';
|
|
|
130
134
|
export { BlankPageSpacer } from './loading/blank-page-spacer.js';
|
|
131
135
|
export { LoadingOverlay } from './loading/loading-overlay.js';
|
|
132
136
|
export { ProgressCircle } from './loading/progress-circle.js';
|
|
137
|
+
export { consoleLogger, initLogger, logger } from './logging/logger.js';
|
|
138
|
+
export { useLogError } from './logging/use-log-error.js';
|
|
133
139
|
export { ImagesGrid } from './media/image-grid/images-grid.js';
|
|
134
140
|
export { ImageLightbox } from './media/image-lightbox/image-lightbox.js';
|
|
135
141
|
export { Image } from './media/image/image.js';
|
|
@@ -287,6 +293,7 @@ export { withRouting } from './shared/routing/with-routing.js';
|
|
|
287
293
|
export { ensureArray } from './shared/utils/array.js';
|
|
288
294
|
export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
|
|
289
295
|
export { convertDateUnitToPluralOrSingle, formatDateToLocaleString, getDateUnitObject } from './shared/utils/date.js';
|
|
296
|
+
export { trackPropertyChange } from './shared/utils/debug.js';
|
|
290
297
|
export { environment, environments } from './shared/utils/environment.js';
|
|
291
298
|
export { EventEmitter } from './shared/utils/event-emitter.js';
|
|
292
299
|
export { clone, deepMerge, isPlainObject, default as main, merge } from './shared/utils/merge.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Company name' | 'Conceal value' | 'Continue shopping' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Delivery date' | 'Delivery expected in {0} {1}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Features' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'Incl. VAT' | 'Includes' | 'Industry' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'New list name' | 'New user?' | 'of' | 'Or sign in as guest' | 'Order number' | 'Order' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'Password' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid e-mail address' | 'Please enter a valid phone number' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Requested delivery date' | 'Remember me' | 'Remove all' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a desired delivery date' | 'Select a list' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Total amount is' | 'Total' | 'Total' | 'Try another search' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unable to update the product in your cart.' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'Your cart has been emptied.' | 'Your favorites are available on multiple devices' | 'Your shopping cart is still empty';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Company name' | 'Conceal value' | 'Continue shopping' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Delivery date' | 'Delivery expected in {0} {1}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Features' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'Incl. VAT' | 'Includes' | 'Industry' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'New list name' | 'New user?' | 'of' | 'Or sign in as guest' | 'Order number' | 'Order' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'Password' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid e-mail address' | 'Please enter a valid phone number' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Requested delivery date' | 'Remember me' | 'Remove all' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a desired delivery date' | 'Select a list' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Total' | 'Try another search' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unable to update the product in your cart.' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'Your cart has been emptied.' | 'Your favorites are available on multiple devices' | 'Your shopping cart is still empty';
|
package/dist/intl/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { logger } from '../logging/logger.js';
|
|
1
2
|
import { isLanguageCode } from './types.js';
|
|
2
3
|
|
|
3
4
|
function getLanguageCodeFromCultureCode(cultureCode) {
|
|
@@ -21,7 +22,7 @@ function spireTranslateAdapter(translate) {
|
|
|
21
22
|
}, [])
|
|
22
23
|
: []));
|
|
23
24
|
if (optional && message === undefined)
|
|
24
|
-
|
|
25
|
+
logger.warn(`Missing translation with id: ${id}`);
|
|
25
26
|
return message || fallbackValue || id;
|
|
26
27
|
};
|
|
27
28
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
debug(message: unknown, ...args: unknown[]): void;
|
|
3
|
+
error(message: unknown, error: unknown): void;
|
|
4
|
+
error(message: unknown, error: unknown, ...args: unknown[]): void;
|
|
5
|
+
error(error: unknown): void;
|
|
6
|
+
info(message: unknown, ...args: unknown[]): void;
|
|
7
|
+
warn(message: unknown, ...args: unknown[]): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const consoleLogger: Logger;
|
|
10
|
+
export declare let logger: Logger;
|
|
11
|
+
export declare function initLogger(replacementLogger: Logger): Logger;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const consoleLogger = {
|
|
2
|
+
debug(...args) {
|
|
3
|
+
// eslint-disable-next-line no-console
|
|
4
|
+
return console.debug('⚡️', ...args);
|
|
5
|
+
},
|
|
6
|
+
error(...args) {
|
|
7
|
+
return console.error('❌', ...args);
|
|
8
|
+
},
|
|
9
|
+
info(...args) {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
return console.log('✅', ...args);
|
|
12
|
+
},
|
|
13
|
+
warn(...args) {
|
|
14
|
+
return console.warn('⚠️', ...args);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
let logger = consoleLogger;
|
|
18
|
+
function initLogger(replacementLogger) {
|
|
19
|
+
return (logger = replacementLogger);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { consoleLogger, initLogger, logger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLogError(error?: unknown): void;
|