@sonic-equipment/ui 187.0.0 → 189.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/cards/data-card/data-card.js +1 -1
- package/dist/country-selector/connected-country-selector.js +0 -11
- package/dist/country-selector/use-countries-languages.js +0 -11
- package/dist/delivery-time/delivery-time.js +3 -4
- package/dist/exports.d.ts +13 -3
- package/dist/footer/connected-footer.js +8 -1
- package/dist/footer/footer.d.ts +5 -10
- package/dist/footer/footer.js +23 -18
- package/dist/forms/fields/select-field/select-field.js +1 -1
- package/dist/forms/layout/form/form.js +1 -1
- package/dist/header/connected-header.js +9 -1
- package/dist/header/drawers/desktop-navigation-drawer.d.ts +3 -3
- package/dist/header/drawers/desktop-navigation-drawer.js +2 -4
- package/dist/header/drawers/mobile-navigation-drawer.d.ts +3 -3
- package/dist/header/drawers/mobile-navigation-drawer.js +2 -2
- package/dist/header/header.d.ts +3 -3
- package/dist/header/header.js +15 -9
- package/dist/header/link-list/navigation-link-list.d.ts +5 -5
- package/dist/header/link-list/navigation-link-list.js +20 -5
- package/dist/index.js +14 -4
- package/dist/intl/formatted-date.d.ts +4 -0
- package/dist/intl/formatted-date.js +8 -0
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/intl/use-formatted-date.d.ts +6 -0
- package/dist/intl/use-formatted-date.js +19 -0
- package/dist/lists/menu-list/menu-list-header.d.ts +1 -1
- package/dist/lists/menu-list/menu-list-item.d.ts +2 -2
- package/dist/lists/menu-list/menu-list-item.js +3 -1
- package/dist/lists/menu-list/menu-list-provider.d.ts +11 -0
- package/dist/lists/menu-list/menu-list-provider.js +30 -0
- package/dist/lists/menu-list/menu-list.d.ts +8 -5
- package/dist/lists/menu-list/menu-list.js +6 -5
- package/dist/lists/menu-list/menu-list.module.css.js +1 -1
- package/dist/lists/menu-list/use-menu-list-item.d.ts +5 -0
- package/dist/lists/menu-list/use-menu-list-item.js +12 -0
- package/dist/lists/menu-list/use-menu-list.d.ts +1 -0
- package/dist/lists/menu-list/use-menu-list.js +11 -0
- package/dist/loading/dynamic-loading-overlay.d.ts +5 -0
- package/dist/loading/dynamic-loading-overlay.js +26 -0
- package/dist/loading/dynamic-loading-overlay.module.css.js +3 -0
- package/dist/media/image-lightbox/image-lightbox.js +12 -2
- package/dist/media/zoom-image/zoom-image.js +6 -1
- package/dist/navigation/mobile-navigation/mobile-navigation.d.ts +3 -3
- package/dist/navigation/mobile-navigation/mobile-navigation.js +2 -2
- package/dist/navigation/panel-navigation/panel-navigation.d.ts +5 -7
- package/dist/navigation/panel-navigation/panel-navigation.js +11 -14
- package/dist/pages/checkout/cart-page/cart-page.js +1 -1
- package/dist/pages/checkout/order-confirmation-page/order-confirmation-page-content.js +2 -4
- package/dist/pages/error-page/error-page.js +2 -7
- package/dist/pages/my-sonic/actions/change-password/connected-change-password-dialog.js +0 -2
- package/dist/pages/my-sonic/navigation/my-sonic-desktop-navigation.js +1 -1
- package/dist/pages/my-sonic/pages/order-history/order-history.d.ts +1 -0
- package/dist/pages/my-sonic/pages/order-history/order-history.js +166 -0
- package/dist/pages/my-sonic/pages/order-history/order-history.module.css.js +3 -0
- package/dist/pages/product/product-listing-page/product-listing.js +1 -1
- package/dist/pages/product/search-result-page/search-results-page.js +1 -1
- package/dist/shared/api/bff/hooks/use-fetch-navigation-links.d.ts +1 -1
- package/dist/shared/api/bff/model/bff.model.d.ts +22 -14
- package/dist/shared/api/bff/model/bff.model.js +11 -0
- package/dist/shared/api/bff/services/bff-service.d.ts +2 -2
- package/dist/shared/api/bff/services/bff-service.js +1 -1
- package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.d.ts +10 -0
- package/dist/shared/api/storefront/hooks/orders/use-fetch-orders.js +13 -0
- package/dist/shared/api/storefront/model/storefront.model.d.ts +13 -1
- package/dist/shared/api/storefront/model/storefront.model.js +28 -1
- package/dist/shared/api/storefront/services/order-service.d.ts +12 -0
- package/dist/shared/api/storefront/services/order-service.js +29 -0
- package/dist/shared/data/navigation.d.ts +2 -0
- package/dist/shared/data/navigation.js +2605 -0
- package/dist/shared/hooks/use-intersection-observer.d.ts +3 -1
- package/dist/shared/hooks/use-intersection-observer.js +3 -2
- package/dist/shared/utils/date.d.ts +4 -1
- package/dist/shared/utils/date.js +6 -5
- package/dist/shared/utils/price.d.ts +1 -1
- package/dist/shared/{hooks/use-scroll-to.d.ts → utils/scrolling.d.ts} +1 -1
- package/dist/shared/utils/scrolling.js +16 -0
- package/dist/shared/utils/uuid.d.ts +2 -1
- package/dist/styles.css +896 -634
- package/dist/table/data-table.d.ts +37 -10
- package/dist/table/data-table.js +72 -17
- package/dist/table/data-table.module.css.js +1 -1
- package/dist/table/elements/switch-sort-direction.d.ts +2 -0
- package/dist/table/elements/switch-sort-direction.js +11 -0
- package/dist/table/elements/table-context.d.ts +6 -5
- package/dist/table/elements/table-context.js +1 -16
- package/dist/table/elements/table-provider.d.ts +6 -5
- package/dist/table/elements/table-provider.js +23 -17
- package/dist/table/elements/table-row-context.d.ts +2 -2
- package/dist/table/elements/table-row-provider.js +4 -4
- package/dist/table/elements/table-sort-button.d.ts +8 -7
- package/dist/table/elements/table-sort-button.js +5 -4
- package/dist/table/elements/table.d.ts +1 -1
- package/dist/table/elements/table.js +2 -2
- package/dist/table/elements/table.module.css.js +1 -1
- package/dist/table/elements/td.d.ts +1 -1
- package/dist/table/elements/th.d.ts +1 -7
- package/dist/table/elements/th.js +2 -3
- package/dist/table/elements/tr.d.ts +2 -8
- package/dist/table/elements/tr.js +1 -3
- package/dist/table/elements/types.d.ts +36 -0
- package/dist/table/elements/use-table.js +1 -3
- package/dist/table/elements/use-td.d.ts +1 -1
- package/dist/table/elements/use-th.d.ts +2 -2
- package/package.json +1 -1
- package/dist/shared/hooks/use-scroll-to.js +0 -19
- package/dist/table/elements/table-column-properties.d.ts +0 -10
- package/dist/table/elements/use-tr.d.ts +0 -2
- package/dist/table/elements/use-tr.js +0 -16
package/dist/index.js
CHANGED
|
@@ -152,6 +152,7 @@ export { HeaderLayout } from './header/header-layout/header-layout.js';
|
|
|
152
152
|
export { NavigationLinkList } from './header/link-list/navigation-link-list.js';
|
|
153
153
|
export { SonicLogo } from './header/sonic-logo/sonic-logo.js';
|
|
154
154
|
export { InfoIconTooltip } from './info-icon-tooltip/info-icon-tooltip.js';
|
|
155
|
+
export { FormattedDate } from './intl/formatted-date.js';
|
|
155
156
|
export { FormattedMessage } from './intl/formatted-message.js';
|
|
156
157
|
export { IntlContext } from './intl/intl-context.js';
|
|
157
158
|
export { IntlProvider } from './intl/intl-provider.js';
|
|
@@ -160,6 +161,7 @@ export { isCountryCode, isCultureCode, isCurrencyCode, isLanguageCode } from './
|
|
|
160
161
|
export { useCountryCode, useUpdateCountryCode } from './intl/use-country-code.js';
|
|
161
162
|
export { useCultureCode, useUpdateCultureCode } from './intl/use-culture-code.js';
|
|
162
163
|
export { useCurrencyCode, useUpdateCurrencyCode } from './intl/use-currency-code.js';
|
|
164
|
+
export { useFormattedDate } from './intl/use-formatted-date.js';
|
|
163
165
|
export { useFormattedMessage } from './intl/use-formatted-message.js';
|
|
164
166
|
export { useIntl } from './intl/use-intl.js';
|
|
165
167
|
export { useLanguageCode } from './intl/use-language-code.js';
|
|
@@ -172,11 +174,15 @@ export { MenuList } from './lists/menu-list/menu-list.js';
|
|
|
172
174
|
export { MenuListBackButton } from './lists/menu-list/menu-list-back-button.js';
|
|
173
175
|
export { MenuListHeader } from './lists/menu-list/menu-list-header.js';
|
|
174
176
|
export { MenuListItem } from './lists/menu-list/menu-list-item.js';
|
|
177
|
+
export { MenuListContext, MenuListProvider } from './lists/menu-list/menu-list-provider.js';
|
|
178
|
+
export { useMenuList } from './lists/menu-list/use-menu-list.js';
|
|
179
|
+
export { useMenuListItem } from './lists/menu-list/use-menu-list-item.js';
|
|
175
180
|
export { OrderLineList } from './lists/orderline-list/orderline-list.js';
|
|
176
181
|
export { ProductOverviewGrid } from './lists/product-overview-grid/product-overview-grid.js';
|
|
177
182
|
export { Widget } from './lists/widget-grid/widget.js';
|
|
178
183
|
export { WidgetGrid } from './lists/widget-grid/widget-grid.js';
|
|
179
184
|
export { BlankPageSpacer } from './loading/blank-page-spacer.js';
|
|
185
|
+
export { DynamicLoadingOverlay } from './loading/dynamic-loading-overlay.js';
|
|
180
186
|
export { LoadingOverlay } from './loading/loading-overlay.js';
|
|
181
187
|
export { ProgressCircle } from './loading/progress-circle.js';
|
|
182
188
|
export { consoleLogger, initLogger, logger } from './logging/logger.js';
|
|
@@ -257,6 +263,7 @@ export { ConnectedMySonicNavigation } from './pages/my-sonic/navigation/connecte
|
|
|
257
263
|
export { MySonicDesktopNavigation } from './pages/my-sonic/navigation/my-sonic-desktop-navigation.js';
|
|
258
264
|
export { MySonicMobileNavigation } from './pages/my-sonic/navigation/my-sonic-mobile-navigation.js';
|
|
259
265
|
export { mySonicNavigationItems } from './pages/my-sonic/navigation/my-sonic-navigation-items.js';
|
|
266
|
+
export { OrderHistory } from './pages/my-sonic/pages/order-history/order-history.js';
|
|
260
267
|
export { AddressDataCard } from './pages/my-sonic/widgets/components/address-data-card.js';
|
|
261
268
|
export { ConnectedBillToAddressWidget } from './pages/my-sonic/widgets/connected-bill-to-address-widget.js';
|
|
262
269
|
export { ConnectedCustomerInformationWidget } from './pages/my-sonic/widgets/connected-customer-information-widget.js';
|
|
@@ -325,6 +332,7 @@ export { useFetchFulfillmentMethodsByCustomerId } from './shared/api/storefront/
|
|
|
325
332
|
export { useFetchFulfillmentMethodsForCurrentCart } from './shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js';
|
|
326
333
|
export { useFetchShipToAddresses } from './shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js';
|
|
327
334
|
export { usePatchBillToAddress } from './shared/api/storefront/hooks/customer/use-patch-bill-to-address.js';
|
|
335
|
+
export { useFetchOrders } from './shared/api/storefront/hooks/orders/use-fetch-orders.js';
|
|
328
336
|
export { useCreateAdyenSession } from './shared/api/storefront/hooks/payment/use-create-adyen-session.js';
|
|
329
337
|
export { useFetchAdyenConfig } from './shared/api/storefront/hooks/payment/use-fetch-adyen-config.js';
|
|
330
338
|
export { useInvalidateAdyen } from './shared/api/storefront/hooks/payment/use-invalidate-adyen.js';
|
|
@@ -346,6 +354,7 @@ export { InvalidPasswordError, NonUniquePasswordError, createSession, fetchSessi
|
|
|
346
354
|
export { addProductToCurrentCart, convertToMinorUnits, deleteCartLineById, deleteCurrentCart, fetchCart, fetchCurrentCart, fetchCurrentCartLines, fetchCurrentCartProductAtp, fetchCurrentCartPromotions, fetchCurrentCheckoutAtp, getAdyenPaymentDetails, patchCart, patchCartLineById, placeOrder, postAdyenPayment, saveCartForLater } from './shared/api/storefront/services/cart-service.js';
|
|
347
355
|
export { fetchBillToAddresses, fetchCurrentBillToAddress, fetchCurrentShipToAddress, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress } from './shared/api/storefront/services/customer-service.js';
|
|
348
356
|
export { validateVATNumber } from './shared/api/storefront/services/finance-service.js';
|
|
357
|
+
export { fetchOrders } from './shared/api/storefront/services/order-service.js';
|
|
349
358
|
export { createAdyenSession, fetchAdyenConfig } from './shared/api/storefront/services/payment-service.js';
|
|
350
359
|
export { markProductAsRecentlyViewed } from './shared/api/storefront/services/product-service.js';
|
|
351
360
|
export { fetchTranslations } from './shared/api/storefront/services/translation-service.js';
|
|
@@ -353,6 +362,7 @@ export { fetchCountriesLanguages, fetchCountriesWithLanguages, fetchSettings, up
|
|
|
353
362
|
export { WishListNameAlreadyExistsError, addWishListItemToWishList, createWishList, deleteWishList, deleteWishListItemFromWishList, getWishList, getWishListItemsByWishListId, getWishLists } from './shared/api/storefront/services/wishlist-service.js';
|
|
354
363
|
export { cart } from './shared/data/cart.data.js';
|
|
355
364
|
export { countries, dutch, english, france, french, german, germany, languages, netherlands, unitedKingdom } from './shared/data/countries-languages.data.js';
|
|
365
|
+
export { navigationData } from './shared/data/navigation.js';
|
|
356
366
|
export { useFeatureFlags } from './shared/feature-flags/use-feature-flags.js';
|
|
357
367
|
export { BadRequestError, ForbiddenRequestError, InternalServerErrorRequestError, NotFoundRequestError, RequestError, TimeoutRequestError, UnauthorizedRequestError, UnprocessableContentRequestError, isFormData, isJsonBody, isRequestError, request } from './shared/fetch/request.js';
|
|
358
368
|
export { dataLayer } from './shared/ga/data-layer.js';
|
|
@@ -373,7 +383,6 @@ export { useMutationObserver } from './shared/hooks/use-mutation-observer.js';
|
|
|
373
383
|
export { useResizeObserver } from './shared/hooks/use-resize-observer.js';
|
|
374
384
|
export { useScript } from './shared/hooks/use-script.js';
|
|
375
385
|
export { useScrollLock } from './shared/hooks/use-scroll-lock.js';
|
|
376
|
-
export { scrollTo, scrollToTop } from './shared/hooks/use-scroll-to.js';
|
|
377
386
|
export { useSessionStorage } from './shared/hooks/use-session-storage.js';
|
|
378
387
|
export { useWatchCssProperty } from './shared/hooks/use-watch-css-property.js';
|
|
379
388
|
export { validatePassword } from './shared/model/account.js';
|
|
@@ -400,7 +409,7 @@ export { withRouting } from './shared/routing/with-routing.js';
|
|
|
400
409
|
export { ensureArray } from './shared/utils/array.js';
|
|
401
410
|
export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
|
|
402
411
|
export { getCssPropertyValue } from './shared/utils/css.js';
|
|
403
|
-
export {
|
|
412
|
+
export { formatDate } from './shared/utils/date.js';
|
|
404
413
|
export { trackPropertyChange } from './shared/utils/debug.js';
|
|
405
414
|
export { environment, environments } from './shared/utils/environment.js';
|
|
406
415
|
export { EventEmitter } from './shared/utils/event-emitter.js';
|
|
@@ -410,6 +419,7 @@ export { formatCurrency, getCurrencyByCountryCode, parseCurrency } from './share
|
|
|
410
419
|
export { isPromise, wait } from './shared/utils/promise.js';
|
|
411
420
|
export { random, randomInt } from './shared/utils/random.js';
|
|
412
421
|
export { multiRef } from './shared/utils/refs.js';
|
|
422
|
+
export { scrollIntoViewRef, scrollToTop } from './shared/utils/scrolling.js';
|
|
413
423
|
export { camelCase } from './shared/utils/string.js';
|
|
414
424
|
export { TIME } from './shared/utils/time.js';
|
|
415
425
|
export { has, hasNo } from './shared/utils/types.js';
|
|
@@ -418,8 +428,9 @@ export { Sidebar } from './sidebar/sidebar.js';
|
|
|
418
428
|
export { SidebarDetectBreakpoint, SidebarProvider } from './sidebar/sidebar-provider.js';
|
|
419
429
|
export { ToggleSidebarButton } from './sidebar/toggle-sidebar-button.js';
|
|
420
430
|
export { useSidebar, useSidebarActions } from './sidebar/use-sidebar.js';
|
|
421
|
-
export { DataTable } from './table/data-table.js';
|
|
431
|
+
export { DataTable, SortWrapper } from './table/data-table.js';
|
|
422
432
|
export { Col } from './table/elements/col.js';
|
|
433
|
+
export { switchSortDirection } from './table/elements/switch-sort-direction.js';
|
|
423
434
|
export { Table } from './table/elements/table.js';
|
|
424
435
|
export { TableContext } from './table/elements/table-context.js';
|
|
425
436
|
export { TableProvider } from './table/elements/table-provider.js';
|
|
@@ -433,7 +444,6 @@ export { useTable } from './table/elements/use-table.js';
|
|
|
433
444
|
export { useTableRow } from './table/elements/use-table-row.js';
|
|
434
445
|
export { useTD } from './table/elements/use-td.js';
|
|
435
446
|
export { useTH } from './table/elements/use-th.js';
|
|
436
|
-
export { useTR } from './table/elements/use-tr.js';
|
|
437
447
|
export { HighlightText } from './text/highlight-text/highlight-text.js';
|
|
438
448
|
export { Truncated } from './text/truncated/truncated.js';
|
|
439
449
|
export { Toast } from './toast/toast.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.' | 'Access denied.' | 'Account' | 'active' | 'Add order notes' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | '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' | '
|
|
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.' | 'Access denied.' | 'Account' | 'active' | 'Add order notes' | 'Add to list' | 'Address 1' | 'Address 2' | 'Address 3' | 'Address 4' | 'Address' | 'All payment methods are unavailable at this time. Please contact customer support.' | 'Amount: {0}' | 'An error occurred while changing the customer.' | 'An error occurred while fetching customers. Please try again later.' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'An unexpected error occured. Please try again.' | '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' | 'ASC' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Billing' | 'Cancel' | 'Cart' | 'Change customer' | 'Change password' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'CoC number' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Copyright © Sonic Equipment B.V.' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Current Password is invalid' | 'Date' | 'Delivery date' | 'Delivery expected on {0}' | 'DESC' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Edit Sonic account' | 'Edit' | 'Email' | 'Enter your email address and we will send you an email that will allow you to recover your password.' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Favorites' | 'Features' | 'Finalize order' | 'Finalize payment' | 'First name' | 'Forgot password?' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'If an account matches the email address you entered, instructions on how to recover the password will be sent to that email address shortly. If you do not receive this email, please contact Customer Support.' | 'If you want to proceed, click the continue button. If you want to change your country, close this message and select a different country.' | 'Incl. VAT' | 'Includes' | 'Industry' | 'industry.AG' | 'industry.AU' | 'industry.AV' | 'industry.BC' | 'industry.MA' | 'industry.MC' | 'industry.OT' | 'industry.PP' | 'industry.TR' | 'Information' | 'Language' | 'Last name' | 'List name already exists' | 'Log out' | 'Main menu' | 'Make this the default customer' | 'More than {0} articles' | 'My Sonic' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New Password is required and must be different than Current Password' | 'New password' | 'New user?' | 'No results found. Please refine your search.' | 'Number of favorites' | 'Number of products' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order#' | 'Order' | 'Orders' | 'orderStatus.Any' | 'orderStatus.Cancelled' | 'orderStatus.Fulfilled' | 'orderStatus.Partially fulfilled' | 'orderStatus.Processing' | 'orderStatus.Saved' | 'orderStatus.Waiting for customer service' | 'Our products' | 'Overview' | 'Password changed. Please sign in again.' | 'Password does not meet requirements' | 'Password' | 'Passwords do not match' | 'Pay by invoice' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid email address' | 'Please enter a valid phone number' | 'please go back to your cart.' | 'Please Sign In' | 'PO Number' | 'PO#' | 'Popular searches' | 'Postal Code' | 'Print' | 'Private account' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quantity' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Recover your password' | 'Remember me' | 'Remove all' | 'Reorder' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search for a customer' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other customer' | 'Selected customer' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Selecting this country will result in your cart to be converted to the currency {0}' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Shopping cart' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sign in or create account' | 'sign in' | 'Sign me up for newsletters and product updates' | 'Signed in' | 'Signed out' | 'Signing in…' | 'Sonic account' | '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' | 'Start checkout' | 'Status' | 'Submenu' | 'Submit email address' | 'Submit' | 'Submitting…' | 'Subtotal' | 'Suggestions' | 'Support' | 'tag.limited' | 'tag.new' | 'The email address you entered is already associated with an existing account. Please sign in to this account or contact Customer Support.' | '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 more customers, please refine your search if needed.' | 'There are no products in your shopping cart.' | 'There is no information to display' | 'This email is already in use' | 'Toggle navigation menu' | 'Total amount is' | 'Total' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unknown' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Username' | '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 are not authorized to access this information.' | 'You are not authorized to perform this action' | 'You are not authorized to view customers. Please log in or contact support.' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You have reached the end of the results, but there may be more articles available. Adjust your filters or search to discover more!' | 'You must ' | 'You selected a country where we invoice in a different currency. This will result in your cart being converted to the new currency. If you would like to review your order, ' | 'Your cart has been emptied.' | 'Your email and password were not recognized.' | 'Your favorites are available on multiple devices' | 'Your new Sonic Equipment account was succesfully created. You should receive an email soon with further instructions on how to activate this account. If you do not receive this email, please contact Customer Support.' | 'Your shopping cart is still empty';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function useFormattedDate(): {
|
|
2
|
+
(date: Date, options?: Intl.DateTimeFormatOptions): string;
|
|
3
|
+
(date: string, options?: Intl.DateTimeFormatOptions): string | undefined;
|
|
4
|
+
(date: null | undefined, options?: Intl.DateTimeFormatOptions): undefined;
|
|
5
|
+
(date: Date | string | null | undefined, options?: Intl.DateTimeFormatOptions): string | undefined;
|
|
6
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { formatDate } from '../shared/utils/date.js';
|
|
3
|
+
import { useIntl } from './use-intl.js';
|
|
4
|
+
|
|
5
|
+
function useFormattedDate() {
|
|
6
|
+
const { cultureCode } = useIntl();
|
|
7
|
+
function format(date, options = {
|
|
8
|
+
day: 'numeric',
|
|
9
|
+
month: 'long',
|
|
10
|
+
weekday: 'long',
|
|
11
|
+
year: 'numeric',
|
|
12
|
+
}) {
|
|
13
|
+
return formatDate(date, cultureCode, options);
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
16
|
+
return useCallback(format, [cultureCode]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { useFormattedDate };
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
interface MenuListHeaderProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
'data-test-selector'?: string;
|
|
5
|
-
href?: string;
|
|
5
|
+
href?: string | null;
|
|
6
6
|
}
|
|
7
7
|
export declare function MenuListHeader({ children, 'data-test-selector': dataTestSelector, href, }: MenuListHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -7,8 +7,8 @@ export interface MenuListItemProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
'data-test-selector'?: string;
|
|
9
9
|
hasChildren?: boolean;
|
|
10
|
-
href?: string;
|
|
11
|
-
image?: ImageType;
|
|
10
|
+
href?: string | null;
|
|
11
|
+
image?: ImageType | null;
|
|
12
12
|
isSelected?: boolean;
|
|
13
13
|
onClick?: VoidFunction;
|
|
14
14
|
openInNewTab?: boolean;
|
|
@@ -5,11 +5,13 @@ import { Link } from '../../buttons/link/link.js';
|
|
|
5
5
|
import { GlyphsChevronsSlimRightIcon } from '../../icons/glyph/glyphs-chevrons-slim-right-icon.js';
|
|
6
6
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
7
7
|
import { Image } from '../../media/image/image.js';
|
|
8
|
+
import { useMenuListItem } from './use-menu-list-item.js';
|
|
8
9
|
import styles from './menu-list.module.css.js';
|
|
9
10
|
|
|
10
11
|
function MenuListItem({ 'aria-controls': ariaControls, badge, children, className, 'data-test-selector': dataTestSelector, hasChildren, href, image, isSelected, onClick, openInNewTab, ...rest }) {
|
|
11
12
|
const t = useFormattedMessage();
|
|
12
|
-
|
|
13
|
+
useMenuListItem({ canCollapse: Boolean(badge) });
|
|
14
|
+
return (jsxs("li", { "aria-owns": ariaControls, className: clsx(styles['menu-list-item'], isSelected && styles['selected'], hasChildren && styles['has-children'], className), "data-test-selector": dataTestSelector, ...rest, children: [image && (jsx("span", { className: styles['image'], role: "presentation", children: jsx(Image, { fit: "contain", image: image, title: "" }) })), badge && jsx("span", { className: styles['badge'], children: badge }), jsx(Link, { "aria-controls": ariaControls, "aria-expanded": ariaControls && isSelected, "aria-haspopup": hasChildren ? 'true' : undefined, className: styles['label'], href: href || undefined, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, target: openInNewTab ? '_blank' : undefined, children: jsx("span", { children: children }) }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export { MenuListItem };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MenuListContextValue {
|
|
3
|
+
canCollapse: boolean;
|
|
4
|
+
registerCanCollapse: (canCollapse: boolean) => () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const MenuListContext: React.Context<MenuListContextValue | undefined>;
|
|
7
|
+
export declare function MenuListProvider({ children, }: {
|
|
8
|
+
children: ReactNode | ((args: {
|
|
9
|
+
canCollapse: boolean;
|
|
10
|
+
}) => ReactNode);
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { createContext, useState, useCallback, useMemo } from 'react';
|
|
4
|
+
import { createUUID } from '../../shared/utils/uuid.js';
|
|
5
|
+
|
|
6
|
+
const MenuListContext = createContext(undefined);
|
|
7
|
+
function MenuListProvider({ children, }) {
|
|
8
|
+
const [menuListItems, setMenuListItems] = useState({});
|
|
9
|
+
const registerCanCollapse = useCallback((canCollapse) => {
|
|
10
|
+
const id = createUUID();
|
|
11
|
+
setMenuListItems(prev => ({ ...prev, [id]: canCollapse }));
|
|
12
|
+
return () => {
|
|
13
|
+
setMenuListItems(prev => {
|
|
14
|
+
const newItems = { ...prev };
|
|
15
|
+
delete newItems[id];
|
|
16
|
+
return newItems;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
const canCollapse = useMemo(() => Object.values(menuListItems).every(Boolean), [menuListItems]);
|
|
21
|
+
const value = useMemo(() => {
|
|
22
|
+
return {
|
|
23
|
+
canCollapse,
|
|
24
|
+
registerCanCollapse,
|
|
25
|
+
};
|
|
26
|
+
}, [registerCanCollapse, canCollapse]);
|
|
27
|
+
return (jsx(MenuListContext.Provider, { value: value, children: children instanceof Function ? children({ canCollapse }) : children }));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { MenuListContext, MenuListProvider };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type MenuListVariant = 'default' | 'primary';
|
|
3
|
+
export interface MenuHeader {
|
|
4
|
+
header?: string;
|
|
5
|
+
href?: string | null;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
3
8
|
export interface MenuListProps {
|
|
4
9
|
back?: {
|
|
5
10
|
onClick: () => void;
|
|
@@ -7,11 +12,9 @@ export interface MenuListProps {
|
|
|
7
12
|
};
|
|
8
13
|
children: ReactNode;
|
|
9
14
|
className?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
15
|
+
collapsible?: boolean;
|
|
16
|
+
header?: MenuHeader;
|
|
14
17
|
scrollable?: boolean;
|
|
15
18
|
variant?: MenuListVariant;
|
|
16
19
|
}
|
|
17
|
-
export declare function MenuList({ back, children, className, header, scrollable, variant, }: MenuListProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function MenuList({ back, children, className, collapsible, header, scrollable, variant, }: MenuListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { MenuListBackButton } from './menu-list-back-button.js';
|
|
5
5
|
import { MenuListHeader } from './menu-list-header.js';
|
|
6
|
+
import { MenuListProvider } from './menu-list-provider.js';
|
|
6
7
|
import styles from './menu-list.module.css.js';
|
|
7
8
|
|
|
8
|
-
function MenuList({ back, children, className, header, scrollable = true, variant = 'default', }) {
|
|
9
|
-
const headerTitle =
|
|
10
|
-
const headerHref =
|
|
11
|
-
return (jsxs("section", { className: clsx(styles['menu-list'], styles[variant], scrollable && styles['scrollable'], className), role: "menu", children: [back && (jsx(MenuListBackButton, { "data-test-selector": "menuListBackButton", onClick: back.onClick, children: back.title })), jsxs("div", { className: styles['scroll-area'], "data-test-selector": "menuListScrollArea", children: [
|
|
9
|
+
function MenuList({ back, children, className, collapsible, header, scrollable = true, variant = 'default', }) {
|
|
10
|
+
const headerTitle = header?.header || header?.label;
|
|
11
|
+
const headerHref = header?.href;
|
|
12
|
+
return (jsx(MenuListProvider, { children: ({ canCollapse }) => (jsxs("section", { className: clsx(styles['menu-list'], styles[variant], scrollable && styles['scrollable'], canCollapse && collapsible && styles['collapsible'], className), role: "menu", children: [back && (jsx(MenuListBackButton, { "data-test-selector": "menuListBackButton", onClick: back.onClick, children: back.title })), jsxs("div", { className: styles['scroll-area'], "data-test-selector": "menuListScrollArea", children: [headerTitle && (jsx(MenuListHeader, { "data-test-selector": "menuListHeader", href: headerHref, children: headerTitle })), jsx("ul", { className: styles['list'], children: children })] })] })) }));
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export { MenuList };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var styles = {"menu-list":"menu-list-module-TloB9","
|
|
1
|
+
var styles = {"menu-list":"menu-list-module-TloB9","scrollable":"menu-list-module-AiDgG","scroll-area":"menu-list-module-x3D-V","list":"menu-list-module-m3rpo","primary":"menu-list-module-xUg6i","collapsible":"menu-list-module-vd14x","menu-list-item":"menu-list-module-4QhF4","label":"menu-list-module-xFYyo","badge":"menu-list-module-4PbP-","has-children":"menu-list-module-61uJb","icon":"menu-list-module-syyw9","menu-list-back-button":"menu-list-module-eKDL9","menu-list-header":"menu-list-module-S08LI","image":"menu-list-module-ELekn","selected":"menu-list-module-hiMca"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useMenuList } from './use-menu-list.js';
|
|
3
|
+
|
|
4
|
+
function useMenuListItem({ canCollapse }) {
|
|
5
|
+
const { registerCanCollapse } = useMenuList();
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
return registerCanCollapse(canCollapse);
|
|
8
|
+
}, [registerCanCollapse, canCollapse]);
|
|
9
|
+
return { canCollapse };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { useMenuListItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMenuList(): import("./menu-list-provider").MenuListContextValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { MenuListContext } from './menu-list-provider.js';
|
|
3
|
+
|
|
4
|
+
function useMenuList() {
|
|
5
|
+
const context = useContext(MenuListContext);
|
|
6
|
+
if (!context)
|
|
7
|
+
throw new Error('useMenuList must be used within a MenuListProvider');
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useMenuList };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useIntersectionObserver } from '../shared/hooks/use-intersection-observer.js';
|
|
5
|
+
import { ProgressCircle } from './progress-circle.js';
|
|
6
|
+
import styles from './dynamic-loading-overlay.module.css.js';
|
|
7
|
+
|
|
8
|
+
const thresholdEntries = 1000;
|
|
9
|
+
const threshold = Array.from({ length: thresholdEntries }, (_, i) => i / thresholdEntries);
|
|
10
|
+
function DynamicLoadingOverlay({ children, className, isLoading, }) {
|
|
11
|
+
const [intersectedHeight, setIntersectedHeight] = useState(0);
|
|
12
|
+
const container = useRef(null);
|
|
13
|
+
useIntersectionObserver({
|
|
14
|
+
isDisabled: !isLoading,
|
|
15
|
+
observables: [{ ref: container }],
|
|
16
|
+
onCallback: entries => {
|
|
17
|
+
entries.forEach(entry => {
|
|
18
|
+
setIntersectedHeight(entry.intersectionRect.height);
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
threshold,
|
|
22
|
+
});
|
|
23
|
+
return (jsxs("div", { ref: container, className: clsx(styles['dynamic-loading-overlay'], isLoading && styles['is-loading'], className), style: { '--intersected-height': `${intersectedHeight}px` }, children: [jsx("div", { className: styles['content'], children: children }), jsx("div", { className: styles['loading-indicator'], children: jsx(ProgressCircle, { className: styles['spinner'], variant: "gray" }) })] }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { DynamicLoadingOverlay };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"dynamic-loading-overlay":"dynamic-loading-overlay-module-CAecM","content":"dynamic-loading-overlay-module-XeFAb","loading-indicator":"dynamic-loading-overlay-module-lhL5i","spinner":"dynamic-loading-overlay-module-cpo4H","is-loading":"dynamic-loading-overlay-module-3bed-"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -28,12 +28,22 @@ function ImageLightbox({ images, initialSelectedIndex = 0, onZoom, variant = 'sm
|
|
|
28
28
|
}
|
|
29
29
|
return (jsxs("div", { className: clsx(styles['image-lightbox'], styles[variant]), children: [jsx(Swiper, { watchSlidesProgress: true, className: styles['thumbs-swiper'], direction: variant === 'sm' ? 'horizontal' : 'vertical', modules: [Thumb], onSwiper: swiper => setThumbsSwiper(swiper), slidesPerView: "auto", spaceBetween: 8, children: images.map((image, index) => (
|
|
30
30
|
// eslint-disable-next-line @eslint-react/no-array-index-key
|
|
31
|
-
jsx(SwiperSlide, { className: styles.slide, children: jsx("div", { className: styles.thumb, children: jsx(Image, { className: styles.image, fit: "contain", height: 80, image:
|
|
31
|
+
jsx(SwiperSlide, { className: styles.slide, children: jsx("div", { className: styles.thumb, children: jsx(Image, { className: styles.image, fit: "contain", height: 80, image: {
|
|
32
|
+
1: image['1'],
|
|
33
|
+
2: image['1'],
|
|
34
|
+
3: image['1'],
|
|
35
|
+
altText: image.altText,
|
|
36
|
+
}, title: "Image", width: 80 }) }) }, index))) }), jsxs("div", { className: styles['main-swiper'], children: [jsx(Swiper, { initialSlide: initialSelectedIndex, modules: [Thumb, Navigation], navigation: {
|
|
32
37
|
nextEl: nextEl.current,
|
|
33
38
|
prevEl: prevEl.current,
|
|
34
39
|
}, onActiveIndexChange: swiper => setCurrentIndex(swiper.activeIndex), onBeforeInit: swiper => (mainSwiperRef.current = swiper), slidesPerView: 1, thumbs: { swiper: thumbsSwiper }, children: images.map((image, index) => (
|
|
35
40
|
// eslint-disable-next-line @eslint-react/no-array-index-key
|
|
36
|
-
jsx(SwiperSlide, { className: styles.slide, children: jsx("button", { className: styles['active-image'], onClick: handleZoom, type: "button", children: jsx(Image, { className: styles.image, fit: "contain", image:
|
|
41
|
+
jsx(SwiperSlide, { className: styles.slide, children: jsx("button", { className: styles['active-image'], onClick: handleZoom, type: "button", children: jsx(Image, { className: styles.image, fit: "contain", image: {
|
|
42
|
+
1: image['3'],
|
|
43
|
+
2: image['3'],
|
|
44
|
+
3: image['3'],
|
|
45
|
+
altText: image.altText,
|
|
46
|
+
}, title: "Image" }) }) }, index))) }), jsx("div", { className: styles.pagination, children: jsx(CarouselPagination, { contained: true, currentPage: currentIndex + 1, numberOfPages: images.length, onChange: pageNumber => mainSwiperRef.current?.slideTo(pageNumber - 1) }) }), variant === 'lg' && (jsxs(Fragment, { children: [jsx(CarouselNavigationButton, { ref: prevEl, className: clsx(styles['navigation-button'], styles['navigation-button-prev']), direction: "previous" }), jsx(CarouselNavigationButton, { ref: nextEl, className: clsx(styles['navigation-button'], styles['navigation-button-next']), direction: "next" })] }))] })] }));
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
export { ImageLightbox };
|
|
@@ -28,7 +28,12 @@ function ZoomImage({ currentImage, isZoomed = false, onClose, scrollFromTopPerce
|
|
|
28
28
|
// handler must also be keyboardd accessible.
|
|
29
29
|
// In this case the modal already handles the escape key.
|
|
30
30
|
// This is a no-op at the moment.
|
|
31
|
-
}, role: "link", tabIndex: 0, children: jsx(Image, { className: styles['zoomed-image'], image:
|
|
31
|
+
}, role: "link", tabIndex: 0, children: jsx(Image, { className: styles['zoomed-image'], image: {
|
|
32
|
+
1: currentImage['3'],
|
|
33
|
+
2: currentImage['3'],
|
|
34
|
+
3: currentImage['3'],
|
|
35
|
+
altText: currentImage.altText,
|
|
36
|
+
}, title: currentImage.altText }) }) }));
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
export { ZoomImage };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NavigationLinkItem } from '../../shared/api/bff/model/bff.model';
|
|
2
2
|
export interface MobileNavigationProps {
|
|
3
3
|
id: string;
|
|
4
4
|
isActive: boolean;
|
|
5
|
-
|
|
5
|
+
linkItems: NavigationLinkItem[] | undefined;
|
|
6
6
|
onActiveChange: (isActive: boolean) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function MobileNavigation({ id, isActive,
|
|
8
|
+
export declare function MobileNavigation({ id, isActive, linkItems, onActiveChange, }: MobileNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,11 +15,11 @@ import { FavoriteIcon } from '../favorite-icon/favorite-icon.js';
|
|
|
15
15
|
import { PanelNavigation } from '../panel-navigation/panel-navigation.js';
|
|
16
16
|
import styles from './mobile-navigation.module.css.js';
|
|
17
17
|
|
|
18
|
-
function MobileNavigation({ id, isActive,
|
|
18
|
+
function MobileNavigation({ id, isActive, linkItems, onActiveChange, }) {
|
|
19
19
|
const t = useFormattedMessage();
|
|
20
20
|
const { data: { isAuthenticated } = {} } = useFetchSession();
|
|
21
21
|
const cartCount = useFetchCurrentCartCount();
|
|
22
|
-
return (jsxs("section", { "aria-label": t('Main menu'), className: clsx(styles['mobile-navigation'], isActive && styles['active']), "data-test-selector": "mobileNavigationMenu", id: id, children: [jsxs("header", { className: styles['header'], children: [jsx("div", { className: styles['logo'], role: "presentation", children: jsx(SonicLogo, {}) }), jsx("div", { className: styles['hamburger'], children: jsx(HamburgerButton, { "aria-controls": "mobile-navigation", "data-test-selector": "mobileNavigationHamburgerButton", isActive: isActive, onActiveChange: onActiveChange }) })] }), jsx(PanelNavigation, { allowBack: true, className: styles['panels'], "data-test-selector": "mobileNavigationPanel", isNarrow: true,
|
|
22
|
+
return (jsxs("section", { "aria-label": t('Main menu'), className: clsx(styles['mobile-navigation'], isActive && styles['active']), "data-test-selector": "mobileNavigationMenu", id: id, children: [jsxs("header", { className: styles['header'], children: [jsx("div", { className: styles['logo'], role: "presentation", children: jsx(SonicLogo, {}) }), jsx("div", { className: styles['hamburger'], children: jsx(HamburgerButton, { "aria-controls": "mobile-navigation", "data-test-selector": "mobileNavigationHamburgerButton", isActive: isActive, onActiveChange: onActiveChange }) })] }), jsx(PanelNavigation, { allowBack: true, className: styles['panels'], "data-test-selector": "mobileNavigationPanel", isNarrow: true, linkItems: linkItems, variant: "primary", children: jsxs(MenuList, { header: { label: t('My Sonic') }, scrollable: false, children: [jsx(MenuListItem, { badge: jsx(AccountIcon, { isAuthenticated: isAuthenticated }), "data-authenticated": isAuthenticated ? true : false, "data-test-selector": "mobileNavigationAccountButton", href: PATHS.ACCOUNT, children: isAuthenticated ? t('My Sonic') : t('Sign in or create account') }), jsx(MenuListItem, { badge: jsx(FavoriteIcon, {}), "data-test-selector": "mobileNavigationFavoritesButton", href: PATHS.FAVORITES, children: t('Favorites') }), jsx(MenuListItem, { badge: jsx(CartIcon, { count: cartCount }), "data-count": cartCount, "data-test-selector": "mobileNavigationCartButton", href: PATHS.CART, children: t('Shopping cart') })] }) })] }));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { MobileNavigation };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { MenuHeader } from '../../lists/menu-list/menu-list';
|
|
3
|
+
import { NavigationLinkItem } from '../../shared/api/bff/model/bff.model';
|
|
3
4
|
export interface PanelNavigationProps {
|
|
4
5
|
allowBack?: boolean;
|
|
5
6
|
children?: ReactNode;
|
|
6
7
|
className?: string;
|
|
7
8
|
'data-test-selector'?: string;
|
|
8
|
-
header?:
|
|
9
|
-
href: string;
|
|
10
|
-
title: string;
|
|
11
|
-
};
|
|
9
|
+
header?: MenuHeader;
|
|
12
10
|
id?: string;
|
|
13
11
|
isNarrow?: boolean;
|
|
14
|
-
|
|
12
|
+
linkItems?: NavigationLinkItem[];
|
|
15
13
|
variant?: 'primary';
|
|
16
14
|
}
|
|
17
|
-
export declare function PanelNavigation({ allowBack, children, className, 'data-test-selector': dataTestSelector, header, id, isNarrow,
|
|
15
|
+
export declare function PanelNavigation({ allowBack, children, className, 'data-test-selector': dataTestSelector, header, id, isNarrow, linkItems, variant, }: PanelNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ import { CascadingComponentContainer } from '../../collapsables/cascading-compon
|
|
|
7
7
|
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
8
8
|
import { MenuList } from '../../lists/menu-list/menu-list.js';
|
|
9
9
|
import { MenuListItem } from '../../lists/menu-list/menu-list-item.js';
|
|
10
|
+
import { isNavigationLinkGroup } from '../../shared/api/bff/model/bff.model.js';
|
|
10
11
|
import { multiRef } from '../../shared/utils/refs.js';
|
|
11
12
|
import styles from './panel-navigation.module.css.js';
|
|
12
13
|
|
|
@@ -18,7 +19,7 @@ const focusableSelectors = [
|
|
|
18
19
|
'select:not([disabled])',
|
|
19
20
|
'[tabindex]:not([tabindex="-1"])',
|
|
20
21
|
].join(',');
|
|
21
|
-
const NavigationMenu = forwardRef(({ allowBack, back, children, className, header, id, isNarrow,
|
|
22
|
+
const NavigationMenu = forwardRef(({ allowBack, back, children, className, header, id, isNarrow, linkItems, scrollable, variant, }, ref) => {
|
|
22
23
|
const menuRef = useRef();
|
|
23
24
|
const submenuRef = useRef(null);
|
|
24
25
|
const [selectedNavigationLink, setSelectedNavigationLink] = useState();
|
|
@@ -37,9 +38,9 @@ const NavigationMenu = forwardRef(({ allowBack, back, children, className, heade
|
|
|
37
38
|
setSelectedNavigationVisible(Boolean(selectedNavigationLink));
|
|
38
39
|
}, [selectedNavigationLink]);
|
|
39
40
|
const t = useFormattedMessage();
|
|
40
|
-
return (jsxs(Fragment, { children: [jsxs("div", { ref: multiRef(ref, menuRef), className: clsx(styles['panel'], isNarrow && styles['narrow'], className), "data-test-selector": "panelNavigation", id: id, children: [jsx(MenuList, { back: back, header: header, scrollable: scrollable, variant: variant, children:
|
|
41
|
+
return (jsxs(Fragment, { children: [jsxs("div", { ref: multiRef(ref, menuRef), className: clsx(styles['panel'], isNarrow && styles['narrow'], className), "data-test-selector": "panelNavigation", id: id, children: [jsx(MenuList, { back: back, header: header, scrollable: scrollable, variant: variant, children: linkItems?.map(link => link.type === 'link-group' && link.items.length > 0 ? (jsx(MenuListItem, { hasChildren: true, "aria-controls": `menu-${link.key}`, "data-test-selector": "panelNavigationItem", image: link.image, isSelected: selectedNavigationLink?.key === link.key, onClick: () => setSelectedNavigationLink(selectedNavigationLink?.key === link.key
|
|
41
42
|
? undefined
|
|
42
|
-
: link), children: link.
|
|
43
|
+
: link), children: link.label }, link.key)) : (jsx(MenuListItem, { "data-test-selector": "panelNavigationItem", href: link.href, image: link.image, openInNewTab: link.openInNewTab, children: link.label }, link.key))) }), children] }), jsx(CascadingComponent, { isVisible: selectedNavigationVisible, nodeRef: submenuRef, onEntered: onFocus(submenuRef), onExited: onFocus(menuRef), onUnmounted: onUnmounted, children: jsx(NavigationMenu, { ref: submenuRef, allowBack: allowBack, back: allowBack
|
|
43
44
|
? {
|
|
44
45
|
onClick: () => {
|
|
45
46
|
setSelectedNavigationVisible(false);
|
|
@@ -47,23 +48,19 @@ const NavigationMenu = forwardRef(({ allowBack, back, children, className, heade
|
|
|
47
48
|
title: header
|
|
48
49
|
? typeof header === 'string'
|
|
49
50
|
? header
|
|
50
|
-
: header.
|
|
51
|
+
: header.label
|
|
51
52
|
: t('Main menu'),
|
|
52
53
|
}
|
|
53
|
-
: undefined, header: selectedNavigationLink?.
|
|
54
|
-
? {
|
|
55
|
-
href: selectedNavigationLink.url,
|
|
56
|
-
title: selectedNavigationLink.title,
|
|
57
|
-
}
|
|
58
|
-
: selectedNavigationLink?.title, id: selectedNavigationLink?.key
|
|
54
|
+
: undefined, header: selectedNavigationLink, id: selectedNavigationLink?.key
|
|
59
55
|
? `menu-${selectedNavigationLink.key}`
|
|
60
|
-
: undefined, isNarrow: isNarrow,
|
|
61
|
-
|
|
56
|
+
: undefined, isNarrow: isNarrow, linkItems: selectedNavigationLink &&
|
|
57
|
+
isNavigationLinkGroup(selectedNavigationLink)
|
|
58
|
+
? selectedNavigationLink.items
|
|
62
59
|
: [] }, selectedNavigationLink?.key) })] }));
|
|
63
60
|
});
|
|
64
61
|
NavigationMenu.displayName = 'NavigationMenu';
|
|
65
|
-
function PanelNavigation({ allowBack, children, className, 'data-test-selector': dataTestSelector, header, id, isNarrow,
|
|
66
|
-
return (jsx("section", { className: clsx(styles['panel-navigation'], className), "data-test-selector": dataTestSelector, id: id, children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: children ? styles['top-panel'] : undefined, header: header, id: "panel-navigation-first-level", isNarrow: isNarrow,
|
|
62
|
+
function PanelNavigation({ allowBack, children, className, 'data-test-selector': dataTestSelector, header, id, isNarrow, linkItems, variant, }) {
|
|
63
|
+
return (jsx("section", { className: clsx(styles['panel-navigation'], className), "data-test-selector": dataTestSelector, id: id, children: jsx(CascadingComponentContainer, { children: jsx("div", { className: clsx(styles['panels'], isNarrow && styles['narrow']), children: jsx(NavigationMenu, { allowBack: allowBack, className: children ? styles['top-panel'] : undefined, header: header, id: "panel-navigation-first-level", isNarrow: isNarrow, linkItems: linkItems, scrollable: children ? false : undefined, variant: variant, children: children }) }) }) }));
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
export { PanelNavigation };
|
|
@@ -99,7 +99,7 @@ function CartContent({ cartLines }) {
|
|
|
99
99
|
originalTotalPrice: ensureNumber(cartLine.properties.totalListPrice),
|
|
100
100
|
pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
|
|
101
101
|
totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
102
|
-
}, productId: cartLine.productId || '', sku: cartLine.erpNumber || '', tags: [], title: cartLine.shortDescription }, cartLine.id))) }) }));
|
|
102
|
+
}, productId: cartLine.productId || '', sku: cartLine.erpNumber || '', tags: [cartLine.properties.label].filter(Boolean), title: cartLine.shortDescription }, cartLine.id))) }) }));
|
|
103
103
|
}
|
|
104
104
|
function CartPage() {
|
|
105
105
|
const t = useFormattedMessage();
|