@sonic-equipment/ui 173.0.0 → 174.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.
Files changed (159) hide show
  1. package/dist/algolia/algolia-categories-filters.js +1 -5
  2. package/dist/buttons/button/button.d.ts +2 -1
  3. package/dist/buttons/button/button.js +3 -3
  4. package/dist/buttons/button/button.module.css.js +1 -1
  5. package/dist/cards/category-card/category-card.d.ts +1 -2
  6. package/dist/cards/category-card/category-card.js +2 -3
  7. package/dist/cards/category-card/category-card.module.css.js +1 -1
  8. package/dist/cards/data-card/data-card.d.ts +27 -0
  9. package/dist/cards/data-card/data-card.js +17 -0
  10. package/dist/cards/data-card/data-card.module.css.js +3 -0
  11. package/dist/carousel/category-carousel/category-carousel.js +1 -1
  12. package/dist/carousel/category-carousel/category-carousel.module.css.js +1 -1
  13. package/dist/exports.d.ts +8 -1
  14. package/dist/forms/number-field/number-field.js +3 -3
  15. package/dist/global-search/categories-grid/categories-grid.js +1 -1
  16. package/dist/icons/solid/solid-add-icon.d.ts +1 -0
  17. package/dist/icons/solid/solid-close-icon.js +1 -1
  18. package/dist/icons/solid/solid-dashboard-icon.d.ts +1 -0
  19. package/dist/icons/solid/solid-dashboard-icon.js +7 -0
  20. package/dist/icons/solid/solid-edit-icon.d.ts +1 -0
  21. package/dist/icons/solid/solid-facebook-icon.d.ts +1 -0
  22. package/dist/icons/solid/solid-folder-icon.d.ts +1 -0
  23. package/dist/icons/solid/solid-instagram-icon.d.ts +1 -0
  24. package/dist/icons/solid/solid-link-icon.d.ts +1 -0
  25. package/dist/icons/solid/solid-linkedin-icon.d.ts +1 -0
  26. package/dist/icons/solid/solid-logout-icon.d.ts +1 -0
  27. package/dist/icons/solid/solid-logout-icon.js +7 -0
  28. package/dist/icons/solid/solid-mail-icon.d.ts +1 -0
  29. package/dist/icons/solid/solid-news-icon.js +1 -1
  30. package/dist/icons/solid/solid-okay-icon.js +1 -1
  31. package/dist/icons/solid/solid-package-icon.d.ts +1 -0
  32. package/dist/icons/solid/solid-payment-icon.d.ts +1 -0
  33. package/dist/icons/solid/solid-remove-icon.d.ts +1 -0
  34. package/dist/icons/solid/solid-salecategory-icon.d.ts +1 -0
  35. package/dist/icons/solid/solid-salecategory-icon.js +7 -0
  36. package/dist/icons/solid/solid-stories-icon.d.ts +1 -0
  37. package/dist/icons/solid/solid-thumbsdown-icon.d.ts +1 -0
  38. package/dist/icons/solid/solid-thumbsup-icon.d.ts +1 -0
  39. package/dist/icons/solid/solid-tiktok-icon.d.ts +1 -0
  40. package/dist/icons/solid/solid-youtube-icon.d.ts +1 -0
  41. package/dist/icons/stroke/stroke-3d-icon.d.ts +1 -0
  42. package/dist/icons/stroke/stroke-3dview-icon.d.ts +1 -0
  43. package/dist/icons/stroke/stroke-add-icon.d.ts +1 -0
  44. package/dist/icons/stroke/stroke-arkit-icon.d.ts +1 -0
  45. package/dist/icons/stroke/stroke-closebox-icon.js +1 -1
  46. package/dist/icons/stroke/stroke-dashboard-icon.d.ts +1 -0
  47. package/dist/icons/stroke/stroke-edit-icon.d.ts +1 -0
  48. package/dist/icons/stroke/stroke-efficiency-icon.d.ts +1 -0
  49. package/dist/icons/stroke/stroke-event-icon.d.ts +1 -0
  50. package/dist/icons/stroke/stroke-event-icon.js +7 -0
  51. package/dist/icons/stroke/stroke-facebook-icon.d.ts +1 -0
  52. package/dist/icons/stroke/stroke-fallback-icon.d.ts +1 -0
  53. package/dist/icons/stroke/stroke-folder-icon.d.ts +1 -0
  54. package/dist/icons/stroke/stroke-happy-icon.d.ts +1 -0
  55. package/dist/icons/stroke/stroke-information-icon.js +1 -1
  56. package/dist/icons/stroke/stroke-innovate-icon.d.ts +1 -0
  57. package/dist/icons/stroke/stroke-instagram-icon.d.ts +1 -0
  58. package/dist/icons/stroke/stroke-link-icon.d.ts +1 -0
  59. package/dist/icons/stroke/stroke-linkedin-icon.d.ts +1 -0
  60. package/dist/icons/stroke/stroke-logout-icon.d.ts +1 -0
  61. package/dist/icons/stroke/stroke-mail-icon.d.ts +1 -0
  62. package/dist/icons/stroke/stroke-minus-icon.d.ts +1 -0
  63. package/dist/icons/stroke/{stroke-collapse-icon.js → stroke-minus-icon.js} +2 -2
  64. package/dist/icons/stroke/stroke-modular-icon.d.ts +1 -0
  65. package/dist/icons/stroke/stroke-neutral-icon.d.ts +1 -0
  66. package/dist/icons/stroke/stroke-news-icon.d.ts +1 -0
  67. package/dist/icons/stroke/stroke-package-icon.d.ts +1 -0
  68. package/dist/icons/stroke/stroke-payment-icon.d.ts +1 -0
  69. package/dist/icons/stroke/stroke-plus-icon.d.ts +1 -0
  70. package/dist/icons/stroke/{stroke-expand-icon.js → stroke-plus-icon.js} +2 -2
  71. package/dist/icons/stroke/stroke-proactive-icon.d.ts +1 -0
  72. package/dist/icons/stroke/stroke-productivity-icon.d.ts +1 -0
  73. package/dist/icons/stroke/stroke-remove-icon.d.ts +1 -0
  74. package/dist/icons/stroke/stroke-sad-icon.d.ts +1 -0
  75. package/dist/icons/stroke/stroke-sale-icon.d.ts +1 -0
  76. package/dist/icons/stroke/stroke-salecategory-icon.d.ts +1 -0
  77. package/dist/icons/stroke/stroke-stories-icon.d.ts +1 -0
  78. package/dist/icons/stroke/stroke-style-icon.d.ts +1 -0
  79. package/dist/icons/stroke/stroke-support-icon.d.ts +1 -0
  80. package/dist/icons/stroke/stroke-teamplayer-icon.d.ts +1 -0
  81. package/dist/icons/stroke/stroke-thumbsdown-icon.d.ts +1 -0
  82. package/dist/icons/stroke/stroke-thumbsup-icon.d.ts +1 -0
  83. package/dist/icons/stroke/stroke-tiktok-icon.d.ts +1 -0
  84. package/dist/icons/stroke/stroke-warranty10y-icon.d.ts +1 -0
  85. package/dist/icons/stroke/stroke-warranty1y-icon.d.ts +1 -0
  86. package/dist/icons/stroke/stroke-warranty3y-icon.d.ts +1 -0
  87. package/dist/icons/stroke/stroke-warranty5y-icon.d.ts +1 -0
  88. package/dist/icons/stroke/stroke-warrantyconsumable-icon.d.ts +1 -0
  89. package/dist/icons/stroke/stroke-warrantylifetime-icon.d.ts +1 -0
  90. package/dist/icons/stroke/stroke-youtube-icon.d.ts +1 -0
  91. package/dist/index.js +9 -2
  92. package/dist/intl/translation-id.d.ts +1 -1
  93. package/dist/lists/menu-list/menu-list-item.d.ts +2 -1
  94. package/dist/lists/menu-list/menu-list-item.js +2 -2
  95. package/dist/notifications/announcements/announcement.js +4 -4
  96. package/dist/pages/my-account/navigation/connected-my-account-navigation.d.ts +1 -0
  97. package/dist/pages/my-account/navigation/connected-my-account-navigation.js +27 -0
  98. package/dist/pages/my-account/navigation/my-account-desktop-navigation.d.ts +6 -0
  99. package/dist/pages/my-account/navigation/my-account-desktop-navigation.js +17 -0
  100. package/dist/pages/my-account/navigation/my-account-desktop-navigation.module.css.js +3 -0
  101. package/dist/pages/my-account/navigation/my-account-mobile-navigation.d.ts +4 -0
  102. package/dist/pages/my-account/navigation/my-account-mobile-navigation.js +25 -0
  103. package/dist/pages/my-account/widgets/connected-company-information-widget.d.ts +1 -0
  104. package/dist/pages/my-account/widgets/connected-company-information-widget.js +43 -0
  105. package/dist/pages/my-account/widgets/connected-user-account-widget.d.ts +1 -0
  106. package/dist/pages/my-account/widgets/connected-user-account-widget.js +32 -0
  107. package/dist/pages/paths.d.ts +4 -0
  108. package/dist/pages/paths.js +4 -0
  109. package/dist/shared/api/bff/services/bff-service.js +29 -0
  110. package/dist/shared/api/storefront/hooks/authentication/use-sign-out.d.ts +5 -1
  111. package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +2 -1
  112. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.d.ts +1 -0
  113. package/dist/shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js +11 -0
  114. package/dist/shared/api/storefront/services/authentication-service.js +12 -5
  115. package/dist/shared/api/storefront/services/customer-service.d.ts +1 -0
  116. package/dist/shared/api/storefront/services/customer-service.js +8 -1
  117. package/dist/shared/routing/route-provider.d.ts +6 -2
  118. package/dist/shared/routing/route-provider.js +6 -2
  119. package/dist/shared/routing/route-utils.d.ts +2 -2
  120. package/dist/shared/routing/route-utils.js +6 -3
  121. package/dist/shared/routing/types.d.ts +6 -2
  122. package/dist/shared/routing/use-location.d.ts +9 -0
  123. package/dist/shared/routing/use-location.js +18 -0
  124. package/dist/shared/routing/use-route-link.d.ts +1 -0
  125. package/dist/shared/routing/use-route-link.js +5 -4
  126. package/dist/shared/routing/with-routing.js +2 -9
  127. package/dist/sidebar/toggle-sidebar-button.js +1 -1
  128. package/dist/styles.css +239 -127
  129. package/package.json +1 -1
  130. package/dist/icons/other/career-innovate-icon.d.ts +0 -1
  131. package/dist/icons/other/career-proactive-icon.d.ts +0 -1
  132. package/dist/icons/other/career-teamplayer-icon.d.ts +0 -1
  133. package/dist/icons/other/fallback-icon.d.ts +0 -1
  134. package/dist/icons/other/some-facebook-icon.d.ts +0 -1
  135. package/dist/icons/other/some-instagram-icon.d.ts +0 -1
  136. package/dist/icons/other/some-linkedin-icon.d.ts +0 -1
  137. package/dist/icons/other/some-mail-icon.d.ts +0 -1
  138. package/dist/icons/other/some-youtube-icon.d.ts +0 -1
  139. package/dist/icons/other/usp-efficiency-icon.d.ts +0 -1
  140. package/dist/icons/other/usp-style-icon.d.ts +0 -1
  141. package/dist/icons/other/usp-support-icon.d.ts +0 -1
  142. package/dist/icons/other/warranty-10y-icon.d.ts +0 -1
  143. package/dist/icons/other/warranty-1y-icon.d.ts +0 -1
  144. package/dist/icons/other/warranty-3y-icon.d.ts +0 -1
  145. package/dist/icons/other/warranty-5y-icon.d.ts +0 -1
  146. package/dist/icons/other/warranty-consumable-icon.d.ts +0 -1
  147. package/dist/icons/other/warranty-lifetime-icon.d.ts +0 -1
  148. package/dist/icons/solid/solid-event-icon.d.ts +0 -1
  149. package/dist/icons/solid/solid-event-icon.js +0 -7
  150. package/dist/icons/solid/solid-sale-icon.d.ts +0 -1
  151. package/dist/icons/solid/solid-sale-icon.js +0 -7
  152. package/dist/icons/solid/solid-vote-thumbsdown-icon.d.ts +0 -1
  153. package/dist/icons/solid/solid-vote-thumbsup-icon.d.ts +0 -1
  154. package/dist/icons/stroke/stroke-collapse-icon.d.ts +0 -1
  155. package/dist/icons/stroke/stroke-expand-icon.d.ts +0 -1
  156. package/dist/icons/stroke/stroke-vote-thumbsdown-icon.d.ts +0 -1
  157. package/dist/icons/stroke/stroke-vote-thumbsup-icon.d.ts +0 -1
  158. package/dist/shared/routing/use-base-path.d.ts +0 -1
  159. package/dist/shared/routing/use-base-path.js +0 -12
@@ -0,0 +1 @@
1
+ export declare function StrokeSaleCategoryIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeStoriesIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeStyleIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeSupportIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeTeamPlayerIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeThumbsDownIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeThumbsUpIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeTikTokIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarranty10yIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarranty1yIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarranty3yIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarranty5yIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarrantyConsumableIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeWarrantyLifetimeIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function StrokeYouTubeIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ export { IconButton } from './buttons/icon-button/icon-button.js';
46
46
  export { Link } from './buttons/link/link.js';
47
47
  export { PrintButton } from './buttons/print-button/print-button.js';
48
48
  export { CategoryCard } from './cards/category-card/category-card.js';
49
+ export { DataCard } from './cards/data-card/data-card.js';
49
50
  export { ConnectedOrderLineCard } from './cards/orderline-card/connected-orderline-card.js';
50
51
  export { ConnectedRemoveButton } from './cards/orderline-card/connected-remove-button.js';
51
52
  export { OrderLineCard } from './cards/orderline-card/orderline-card.js';
@@ -230,6 +231,11 @@ export { PageMetaData } from './pages/components/page-meta-data/page-meta-data.j
230
231
  export { Page } from './pages/components/page/page.js';
231
232
  export { ErrorPage } from './pages/error-page/error-page.js';
232
233
  export { LoadingPage } from './pages/loading-page/loading-page.js';
234
+ export { ConnectedMyAccountNavigation } from './pages/my-account/navigation/connected-my-account-navigation.js';
235
+ export { MyAccountDesktopNavigation } from './pages/my-account/navigation/my-account-desktop-navigation.js';
236
+ export { MyAccountMobileNavigation } from './pages/my-account/navigation/my-account-mobile-navigation.js';
237
+ export { ConnectedCompanyInformationWidget } from './pages/my-account/widgets/connected-company-information-widget.js';
238
+ export { ConnectedUserAccountWidget } from './pages/my-account/widgets/connected-user-account-widget.js';
233
239
  export { PATHS } from './pages/paths.js';
234
240
  export { ProductOverview } from './pages/product/components/product-overview.js';
235
241
  export { ProductDetailsPageLayout } from './pages/product/layouts/product-details-page-layout/product-details-page-layout.js';
@@ -284,6 +290,7 @@ export { usePatchCartLineById } from './shared/api/storefront/hooks/cart/use-pat
284
290
  export { usePlaceOrder } from './shared/api/storefront/hooks/cart/use-place-order.js';
285
291
  export { useSaveCartForLater } from './shared/api/storefront/hooks/cart/use-save-cart-for-later.js';
286
292
  export { useFetchBillToAddresses } from './shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js';
293
+ export { useFetchCurrentBillToAddress } from './shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js';
287
294
  export { useFetchFulfillmentMethodsByCustomerId } from './shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js';
288
295
  export { useFetchFulfillmentMethodsForCurrentCart } from './shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js';
289
296
  export { useFetchShipToAddresses } from './shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js';
@@ -305,7 +312,7 @@ export { useFetchAllWishListsItems } from './shared/api/storefront/hooks/wishlis
305
312
  export { useFetchWishLists } from './shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js';
306
313
  export { ExistingAccountError, createAccount, createGuestAccount, createSession, fetchSession, patchSession, recoverPassword, signIn, signOut } from './shared/api/storefront/services/authentication-service.js';
307
314
  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';
308
- export { fetchBillToAddresses, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress } from './shared/api/storefront/services/customer-service.js';
315
+ export { fetchBillToAddresses, fetchCurrentBillToAddress, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress } from './shared/api/storefront/services/customer-service.js';
309
316
  export { validateVATNumber } from './shared/api/storefront/services/finance-service.js';
310
317
  export { createAdyenSession, fetchAdyenConfig } from './shared/api/storefront/services/payment-service.js';
311
318
  export { fetchTranslations } from './shared/api/storefront/services/translation-service.js';
@@ -351,7 +358,7 @@ export { GlobalStateProvider, GlobalStateProviderContext, useGlobalState } from
351
358
  export { ReactQueryContainer } from './shared/providers/react-query-container.js';
352
359
  export { RouteProvider } from './shared/routing/route-provider.js';
353
360
  export { buildHref } from './shared/routing/route-utils.js';
354
- export { useBasePath } from './shared/routing/use-base-path.js';
361
+ export { useLocation } from './shared/routing/use-location.js';
355
362
  export { useNavigate } from './shared/routing/use-navigate.js';
356
363
  export { useOnNavigate } from './shared/routing/use-on-navigate.js';
357
364
  export { useRouteLink } from './shared/routing/use-route-link.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.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | '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' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | '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.' | 'Checkout order' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Client cases' | 'Close' | 'Company name' | 'Conceal value' | 'Confirm password' | 'Continue shopping' | 'Continue to sign in' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Delivery date' | 'Delivery expected on {0}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | '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' | 'Main menu' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'Navigation' | 'New list name' | 'New user?' | 'Number of favorites' | 'Number of products' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order' | 'Our products' | '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' | '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' | '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 country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | '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 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' | '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 no products in your shopping cart.' | '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' | '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 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';
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.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | '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' | 'Attention' | 'Availability unknown, please contact customer support for lead time or alternatives.' | 'Billing' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | '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' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Currency Change' | 'Current page' | 'Delivery date' | 'Delivery expected on {0}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit' | 'Edit billing address' | 'Edit shipping address' | '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' | 'More than {0} articles' | 'My account' | 'My Sonic' | 'Name' | 'Navigate to...' | 'Navigation' | 'New list name' | 'New user?' | 'Number of favorites' | 'Number of products' | 'of' | 'Or continue as guest' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order' | 'Orders' | 'Our products' | 'Overview' | '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' | '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' | '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 country' | 'Select a desired delivery date' | 'Select a language' | 'Select a list' | 'Select an industry' | 'Select other company' | 'Selected company' | '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' | '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 no products in your shopping cart.' | 'There is no information to display' | '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' | '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 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';
@@ -4,6 +4,7 @@ export interface MenuListItemProps {
4
4
  'aria-controls'?: string;
5
5
  badge?: ReactNode;
6
6
  children: ReactNode | string;
7
+ className?: string;
7
8
  'data-test-selector'?: string;
8
9
  hasChildren?: boolean;
9
10
  href?: string;
@@ -12,4 +13,4 @@ export interface MenuListItemProps {
12
13
  onClick?: VoidFunction;
13
14
  openInNewTab?: boolean;
14
15
  }
15
- export declare function MenuListItem({ 'aria-controls': ariaControls, badge, children, 'data-test-selector': dataTestSelector, hasChildren, href, image, isSelected, onClick, openInNewTab, ...rest }: MenuListItemProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function MenuListItem({ 'aria-controls': ariaControls, badge, children, className, 'data-test-selector': dataTestSelector, hasChildren, href, image, isSelected, onClick, openInNewTab, ...rest }: MenuListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -7,9 +7,9 @@ import { useFormattedMessage } from '../../intl/use-formatted-message.js';
7
7
  import { Image } from '../../media/image/image.js';
8
8
  import styles from './menu-list.module.css.js';
9
9
 
10
- function MenuListItem({ 'aria-controls': ariaControls, badge, children, 'data-test-selector': dataTestSelector, hasChildren, href, image, isSelected, onClick, openInNewTab, ...rest }) {
10
+ function MenuListItem({ 'aria-controls': ariaControls, badge, children, className, 'data-test-selector': dataTestSelector, hasChildren, href, image, isSelected, onClick, openInNewTab, ...rest }) {
11
11
  const t = useFormattedMessage();
12
- return (jsxs("li", { "aria-owns": ariaControls, className: clsx(styles['menu-list-item'], isSelected && styles['selected'], hasChildren && styles['has-children']), "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, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, target: openInNewTab ? '_blank' : undefined, children: children }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
12
+ 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, onClick: onClick, role: hasChildren ? 'menuitem' : undefined, target: openInNewTab ? '_blank' : undefined, children: children }), hasChildren && (jsx(GlyphsChevronsSlimRightIcon, { "aria-description": `(${t('Submenu')})`, className: styles['icon'] }))] }));
13
13
  }
14
14
 
15
15
  export { MenuListItem };
@@ -6,24 +6,24 @@ import { IconButton } from '../../buttons/icon-button/icon-button.js';
6
6
  import { Link } from '../../buttons/link/link.js';
7
7
  import { GlyphsArrowSemiBoldRightIcon } from '../../icons/glyph/glyphs-arrow-semibold-right-icon.js';
8
8
  import { SolidAttentionIcon } from '../../icons/solid/solid-attention-icon.js';
9
- import { SolidEventIcon } from '../../icons/solid/solid-event-icon.js';
10
9
  import { SolidInformationIcon } from '../../icons/solid/solid-information-icon.js';
11
10
  import { SolidNewsIcon } from '../../icons/solid/solid-news-icon.js';
12
11
  import { SolidNoticeIcon } from '../../icons/solid/solid-notice-icon.js';
13
- import { SolidSaleIcon } from '../../icons/solid/solid-sale-icon.js';
12
+ import { SolidSaleCategoryIcon } from '../../icons/solid/solid-salecategory-icon.js';
14
13
  import { SolidTagIcon } from '../../icons/solid/solid-tag-icon.js';
15
14
  import { StrokeCloseboxIcon } from '../../icons/stroke/stroke-closebox-icon.js';
15
+ import { StrokeEventIcon } from '../../icons/stroke/stroke-event-icon.js';
16
16
  import { multiRef } from '../../shared/utils/refs.js';
17
17
  import styles from './announcement.module.css.js';
18
18
 
19
19
  const iconMap = {
20
20
  critical: jsx(SolidAttentionIcon, {}),
21
- event: jsx(SolidEventIcon, {}),
21
+ event: jsx(StrokeEventIcon, {}),
22
22
  informative: jsx(SolidInformationIcon, {}),
23
23
  new_product_introduction: jsx(SolidTagIcon, {}),
24
24
  news: jsx(SolidNewsIcon, {}),
25
25
  notice: jsx(SolidNoticeIcon, {}),
26
- sales: jsx(SolidSaleIcon, {}),
26
+ sales: jsx(SolidSaleCategoryIcon, {}),
27
27
  };
28
28
  const Announcement = forwardRef(({ announcement: { href, id, subType, text, title, type }, className, onDismiss, }, ref) => {
29
29
  return (jsx("div", { ref: multiRef(ref), className: clsx(styles.announcement, styles[type], styles[subType], className), "data-id": id, "data-sub-type": subType, "data-test-selector": "announcement", "data-type": type, role: "listitem", children: jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.icon, role: "presentation", children: iconMap[subType] }), jsxs("div", { className: styles.content, children: [jsx("h2", { className: styles.title, "data-test-selector": "announcementTitle", children: title }), text &&
@@ -0,0 +1 @@
1
+ export declare function ConnectedMyAccountNavigation(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import Cookies from 'js-cookie';
3
+ import { logger } from '../../../logging/logger.js';
4
+ import { useSignOut } from '../../../shared/api/storefront/hooks/authentication/use-sign-out.js';
5
+ import { useIsBreakpoint } from '../../../shared/hooks/use-is-breakpoint.js';
6
+ import { useLocation } from '../../../shared/routing/use-location.js';
7
+ import { useNavigate } from '../../../shared/routing/use-navigate.js';
8
+ import { PATHS } from '../../paths.js';
9
+ import { MyAccountDesktopNavigation } from './my-account-desktop-navigation.js';
10
+ import { MyAccountMobileNavigation } from './my-account-mobile-navigation.js';
11
+
12
+ function ConnectedMyAccountNavigation() {
13
+ const isXl = useIsBreakpoint('xl');
14
+ const { pathname } = useLocation();
15
+ const { navigate } = useNavigate();
16
+ const { mutate } = useSignOut({
17
+ onError: logger.error,
18
+ onSuccess: () => {
19
+ // TODO: Remove when Spire is deprecated
20
+ Cookies.remove('NavigationMode');
21
+ navigate(PATHS.HOME, { reload: true });
22
+ },
23
+ });
24
+ return (jsx("div", { style: { display: 'grid' }, children: isXl ? (jsx(MyAccountDesktopNavigation, { currentPath: pathname, onLogout: mutate })) : (jsx(MyAccountMobileNavigation, { currentPath: pathname, onLogout: mutate })) }));
25
+ }
26
+
27
+ export { ConnectedMyAccountNavigation };
@@ -0,0 +1,6 @@
1
+ interface MyAccountDesktopNavigationProps {
2
+ currentPath?: string;
3
+ onLogout?: VoidFunction;
4
+ }
5
+ export declare function MyAccountDesktopNavigation({ currentPath, onLogout, }: MyAccountDesktopNavigationProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,17 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { SolidCartIcon } from '../../../icons/solid/solid-cart-icon.js';
3
+ import { SolidDashboardIcon } from '../../../icons/solid/solid-dashboard-icon.js';
4
+ import { SolidFavoriteIcon } from '../../../icons/solid/solid-favorite-icon.js';
5
+ import { SolidLoginIcon } from '../../../icons/solid/solid-login-icon.js';
6
+ import { SolidLogOutIcon } from '../../../icons/solid/solid-logout-icon.js';
7
+ import { FormattedMessage } from '../../../intl/formatted-message.js';
8
+ import { MenuList } from '../../../lists/menu-list/menu-list.js';
9
+ import { MenuListItem } from '../../../lists/menu-list/menu-list-item.js';
10
+ import { PATHS } from '../../paths.js';
11
+ import styles from './my-account-desktop-navigation.module.css.js';
12
+
13
+ function MyAccountDesktopNavigation({ currentPath, onLogout, }) {
14
+ return (jsxs(MenuList, { children: [jsx(MenuListItem, { hasChildren: true, badge: jsx(SolidDashboardIcon, {}), href: PATHS.ACCOUNT, isSelected: currentPath?.toLowerCase() === PATHS.ACCOUNT.toLowerCase(), children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: "Overview" }) }) }), jsx(MenuListItem, { hasChildren: true, badge: jsx(SolidLoginIcon, {}), href: PATHS.ACCOUNT_SETTINGS, isSelected: currentPath?.toLowerCase() === PATHS.ACCOUNT_SETTINGS.toLowerCase(), children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: "Sonic account" }) }) }), jsx(MenuListItem, { hasChildren: true, badge: jsx(SolidFavoriteIcon, {}), href: PATHS.ACCOUNT_MY_LISTS, isSelected: currentPath?.toLowerCase() === PATHS.ACCOUNT_MY_LISTS.toLowerCase(), children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: "Favorites" }) }) }), jsx(MenuListItem, { hasChildren: true, badge: jsx(SolidCartIcon, {}), href: PATHS.ACCOUNT_ORDERS, isSelected: currentPath?.toLowerCase() === PATHS.ACCOUNT_ORDERS.toLowerCase(), children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: "Orders" }) }) }), jsx(MenuListItem, { hasChildren: true, badge: jsx(SolidLogOutIcon, {}), onClick: onLogout, children: jsx("span", { className: styles['menu-list-item'], children: jsx(FormattedMessage, { id: "Log out" }) }) })] }));
15
+ }
16
+
17
+ export { MyAccountDesktopNavigation };
@@ -0,0 +1,3 @@
1
+ var styles = {"menu-list-item":"my-account-desktop-navigation-module-3BpoH"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,4 @@
1
+ export declare function MyAccountMobileNavigation({ currentPath, onLogout, }: {
2
+ currentPath?: string;
3
+ onLogout: () => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { Select } from '../../../forms/select/select.js';
4
+ import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
5
+ import { useNavigate } from '../../../shared/routing/use-navigate.js';
6
+ import { PATHS } from '../../paths.js';
7
+
8
+ function MyAccountMobileNavigation({ currentPath, onLogout, }) {
9
+ const { navigate } = useNavigate();
10
+ const t = useFormattedMessage();
11
+ const options = useMemo(() => ({
12
+ [PATHS.ACCOUNT.toLowerCase()]: t('Overview'),
13
+ [PATHS.ACCOUNT_SETTINGS.toLowerCase()]: t('Sonic account'),
14
+ [PATHS.ACCOUNT_MY_LISTS.toLowerCase()]: t('Favorites'),
15
+ [PATHS.ACCOUNT_ORDERS.toLowerCase()]: t('Orders'),
16
+ logout: t('Log out'),
17
+ }), [t]);
18
+ return (jsx(Select, { label: t('Navigate to...'), onChange: option => {
19
+ if (option === 'logout')
20
+ return onLogout();
21
+ return navigate(option);
22
+ }, options: options, selectedOption: currentPath?.toLowerCase() }));
23
+ }
24
+
25
+ export { MyAccountMobileNavigation };
@@ -0,0 +1 @@
1
+ export declare function ConnectedCompanyInformationWidget(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Button } from '../../../buttons/button/button.js';
3
+ import { DataCard } from '../../../cards/data-card/data-card.js';
4
+ import { FormattedMessage } from '../../../intl/formatted-message.js';
5
+ import { useFetchCurrentBillToAddress } from '../../../shared/api/storefront/hooks/customer/use-fetch-current-bill-to-address.js';
6
+
7
+ function ConnectedCompanyInformationWidget() {
8
+ const { data: billToAddress, isError, isLoading, } = useFetchCurrentBillToAddress();
9
+ const data = billToAddress
10
+ ? [
11
+ {
12
+ key: 'company-name',
13
+ label: 'Company name',
14
+ value: billToAddress.companyName,
15
+ },
16
+ {
17
+ key: 'coc-number',
18
+ label: 'CoC number',
19
+ value: billToAddress.properties.cocRegistration,
20
+ },
21
+ {
22
+ key: 'billing',
23
+ label: 'Billing',
24
+ value: [
25
+ billToAddress.address1,
26
+ billToAddress.address2,
27
+ billToAddress.address3,
28
+ billToAddress.address4,
29
+ billToAddress.postalCode,
30
+ billToAddress.city,
31
+ billToAddress.country?.abbreviation,
32
+ ]
33
+ .filter(Boolean)
34
+ .join(', ') || null,
35
+ },
36
+ ]
37
+ : [];
38
+ return (jsx(DataCard, { actions: [
39
+ jsx(Button, { isDisabled: true, color: "secondary", size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Select other company" }) }, "edit"),
40
+ ], data: data, "data-test-selector": "company-information-widget", isLoading: isLoading, showError: isError, title: "Selected company" }));
41
+ }
42
+
43
+ export { ConnectedCompanyInformationWidget };
@@ -0,0 +1 @@
1
+ export declare function ConnectedUserAccountWidget(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Button } from '../../../buttons/button/button.js';
3
+ import { DataCard } from '../../../cards/data-card/data-card.js';
4
+ import { FormattedMessage } from '../../../intl/formatted-message.js';
5
+ import { useFetchSession } from '../../../shared/api/storefront/hooks/authentication/use-fetch-session.js';
6
+
7
+ function ConnectedUserAccountWidget() {
8
+ const { data: session, isError, isLoading } = useFetchSession();
9
+ const data = session
10
+ ? [
11
+ { key: 'email', label: 'Email', value: session.email },
12
+ {
13
+ key: 'name',
14
+ label: 'Name',
15
+ value: [session.firstName, session.lastName].filter(Boolean).join(' ') ||
16
+ null,
17
+ },
18
+ { key: 'phone', label: 'Phone', value: session.billTo?.phone },
19
+ {
20
+ key: 'company-name',
21
+ label: 'Company name',
22
+ value: session.billTo?.companyName,
23
+ },
24
+ ]
25
+ : [];
26
+ return (jsx(DataCard, { actions: [
27
+ jsx(Button, { isDisabled: true, color: "secondary", size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Edit" }) }, "edit"),
28
+ jsx(Button, { isDisabled: true, color: "secondary", size: "sm", variant: "outline", children: jsx(FormattedMessage, { id: "Change password" }) }, "change-pasword"),
29
+ ], data: data, "data-test-selector": "user-account-widget", isLoading: isLoading, showError: isError, title: "Sonic account" }));
30
+ }
31
+
32
+ export { ConnectedUserAccountWidget };
@@ -2,6 +2,10 @@ export declare const PATHS: {
2
2
  readonly ACCOUNT: "/MyAccount";
3
3
  readonly ACCOUNT_ADDRESSES: "/MyAccount/Addresses";
4
4
  readonly ACCOUNT_CREATE: "/MyAccount/CreateAccount";
5
+ readonly ACCOUNT_INVOICES: "/MyAccount/Invoices";
6
+ readonly ACCOUNT_MY_LISTS: "/MyAccount/MyLists";
7
+ readonly ACCOUNT_ORDERS: "/MyAccount/Orders";
8
+ readonly ACCOUNT_SETTINGS: "/MyAccount/AccountSettings";
5
9
  readonly CART: "/Cart";
6
10
  readonly CHECKOUT_SHIPPING: "/CheckoutShipping";
7
11
  readonly CHECKOUT_SHIPPING_VIA_SIGNIN: "/SignIn?returnUrl=/CheckoutShipping";
@@ -2,6 +2,10 @@ const PATHS = {
2
2
  ACCOUNT: '/MyAccount',
3
3
  ACCOUNT_ADDRESSES: '/MyAccount/Addresses',
4
4
  ACCOUNT_CREATE: '/MyAccount/CreateAccount',
5
+ ACCOUNT_INVOICES: '/MyAccount/Invoices',
6
+ ACCOUNT_MY_LISTS: '/MyAccount/MyLists',
7
+ ACCOUNT_ORDERS: '/MyAccount/Orders',
8
+ ACCOUNT_SETTINGS: '/MyAccount/AccountSettings',
5
9
  CART: '/Cart',
6
10
  CHECKOUT_SHIPPING: '/CheckoutShipping',
7
11
  CHECKOUT_SHIPPING_VIA_SIGNIN: '/SignIn?returnUrl=/CheckoutShipping',
@@ -1,10 +1,15 @@
1
1
  import { config } from '../../../../config.js';
2
2
  import { request } from '../../../fetch/request.js';
3
3
  import { isAnnouncementType, isAnnouncementSubtype } from '../../../model/announcement.js';
4
+ import { TIME } from '../../../utils/time.js';
4
5
 
5
6
  async function fetchAnnouncements({ cultureCode, }) {
6
7
  const { body } = await request({
7
8
  headers: { 'Current-Language-Id': cultureCode },
9
+ next: {
10
+ revalidate: 1 * TIME.DAY,
11
+ tags: ['announcements', `announcement-${cultureCode}`],
12
+ },
8
13
  url: `${config.BFF_API_URL}/notification/announcement`,
9
14
  });
10
15
  if (typeof body === 'string')
@@ -30,6 +35,14 @@ async function fetchAnnouncements({ cultureCode, }) {
30
35
  async function fetchProductDetailsPageData({ cultureCode, pageUrl, }) {
31
36
  const { body } = await request({
32
37
  headers: { 'Current-Language-Id': cultureCode },
38
+ next: {
39
+ revalidate: Infinity,
40
+ tags: [
41
+ 'product-details',
42
+ `product-details-${pageUrl}`,
43
+ `product-details-${pageUrl}-${cultureCode}`,
44
+ ],
45
+ },
33
46
  url: `${config.BFF_API_URL}/pdp/?pageUrl=${pageUrl}`,
34
47
  });
35
48
  return body;
@@ -37,6 +50,14 @@ async function fetchProductDetailsPageData({ cultureCode, pageUrl, }) {
37
50
  async function fetchProductListingPageData({ cultureCode, pageUrl, }) {
38
51
  const { body } = await request({
39
52
  headers: { 'Current-Language-Id': cultureCode },
53
+ next: {
54
+ revalidate: Infinity,
55
+ tags: [
56
+ 'product-listing',
57
+ `product-listing-${pageUrl}`,
58
+ `product-listing-${pageUrl}-${cultureCode}`,
59
+ ],
60
+ },
40
61
  url: `${config.BFF_API_URL}/plp/?pageUrl=${pageUrl}`,
41
62
  });
42
63
  return {
@@ -73,6 +94,14 @@ async function fetchProductListingPageData({ cultureCode, pageUrl, }) {
73
94
  async function fetchNavigationLinks({ cultureCode, source, }) {
74
95
  const { body } = await request({
75
96
  headers: { 'Current-Language-Id': cultureCode, Source: source },
97
+ next: {
98
+ revalidate: Infinity,
99
+ tags: [
100
+ 'navigation',
101
+ `navigation-${source}`,
102
+ `navigation-${source}-${cultureCode}`,
103
+ ],
104
+ },
76
105
  url: `${config.BFF_API_URL}/navigation`,
77
106
  });
78
107
  return body;
@@ -1 +1,5 @@
1
- export declare function useSignOut(): import("@tanstack/react-query").UseMutationResult<void, Error, void, unknown>;
1
+ export interface UseSignOutArgs {
2
+ onError?: (error: Error) => void;
3
+ onSuccess?: VoidFunction;
4
+ }
5
+ export declare function useSignOut(options?: UseSignOutArgs): import("@tanstack/react-query").UseMutationResult<void, Error, void, unknown>;
@@ -2,9 +2,10 @@ import { useQueryClient, useMutation } from '@tanstack/react-query';
2
2
  import { UnauthorizedRequestError } from '../../../../fetch/request.js';
3
3
  import { signOut } from '../../services/authentication-service.js';
4
4
 
5
- function useSignOut() {
5
+ function useSignOut(options = {}) {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation({
8
+ ...options,
8
9
  mutationFn: async () => {
9
10
  try {
10
11
  await signOut();
@@ -0,0 +1 @@
1
+ export declare function useFetchCurrentBillToAddress(): import("@tanstack/react-query").UseQueryResult<import("../../model/storefront.model").BillToModel, Error>;
@@ -0,0 +1,11 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { fetchCurrentBillToAddress } from '../../services/customer-service.js';
3
+
4
+ function useFetchCurrentBillToAddress() {
5
+ return useQuery({
6
+ queryFn: fetchCurrentBillToAddress,
7
+ queryKey: ['customer', 'bill-to-address', 'current'],
8
+ });
9
+ }
10
+
11
+ export { useFetchCurrentBillToAddress };
@@ -1,5 +1,5 @@
1
1
  import { config } from '../../../../config.js';
2
- import { request, RequestError, isRequestError } from '../../../fetch/request.js';
2
+ import { request, isRequestError, RequestError } from '../../../fetch/request.js';
3
3
 
4
4
  async function fetchSession() {
5
5
  const { body } = await request({
@@ -58,10 +58,17 @@ async function createSession({ accessToken, isGuest, keepMeSignedIn, password, r
58
58
  return body;
59
59
  }
60
60
  async function signOut() {
61
- await request({
62
- method: 'DELETE',
63
- url: `${config.SHOP_API_URL}/api/v1/sessions/current`,
64
- });
61
+ try {
62
+ await request({
63
+ method: 'DELETE',
64
+ url: `${config.SHOP_API_URL}/api/v1/sessions/current`,
65
+ });
66
+ }
67
+ catch (error) {
68
+ if (isRequestError(error) && error.status === 401)
69
+ return;
70
+ throw error;
71
+ }
65
72
  }
66
73
  async function createGuestAccount({ defaultWarehouseId, }) {
67
74
  const { body } = await request({
@@ -1,4 +1,5 @@
1
1
  import { BillToCollectionModel, BillToModel, PatchBillToModel, ShipToCollectionModel } from 'shared/api/storefront/model/storefront.model';
2
+ export declare function fetchCurrentBillToAddress(): Promise<BillToModel>;
2
3
  export declare function fetchBillToAddresses(): Promise<BillToCollectionModel>;
3
4
  export declare function fetchShipToAddresses({ shipToId }: {
4
5
  shipToId: string;
@@ -1,6 +1,13 @@
1
1
  import { config } from '../../../../config.js';
2
2
  import { request } from '../../../fetch/request.js';
3
3
 
4
+ async function fetchCurrentBillToAddress() {
5
+ const { body } = await request({
6
+ credentials: 'include',
7
+ url: `${config.SHOP_API_URL}/api/v1/billtos/current`,
8
+ });
9
+ return body;
10
+ }
4
11
  async function fetchBillToAddresses() {
5
12
  const { body } = await request({
6
13
  credentials: 'include',
@@ -36,4 +43,4 @@ async function fetchFulfillmentMethods({ customerId, }) {
36
43
  return updatedBillTo;
37
44
  }
38
45
 
39
- export { fetchBillToAddresses, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress };
46
+ export { fetchBillToAddresses, fetchCurrentBillToAddress, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress };
@@ -2,8 +2,12 @@ import { ElementType, ReactNode } from 'react';
2
2
  import { NavigateFunction, RouteLinkElementProps } from './types';
3
3
  export interface RouteProviderProps {
4
4
  Link?: ElementType<RouteLinkElementProps>;
5
- basePath?: string;
6
5
  children: ReactNode;
7
6
  navigate: NavigateFunction;
7
+ url: {
8
+ basePathname?: string;
9
+ pathname: string;
10
+ search: string;
11
+ };
8
12
  }
9
- export declare function RouteProvider({ basePath, children, Link, navigate, }: RouteProviderProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function RouteProvider({ children, Link, navigate, url, }: RouteProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,12 @@ import { jsx, Fragment } from 'react/jsx-runtime';
3
3
  import { useGlobalState } from '../providers/global-state-provider.js';
4
4
  import { withRouting } from './with-routing.js';
5
5
 
6
- function RouteProvider({ basePath, children, Link = FallbackRouteLink, navigate, }) {
7
- useGlobalState('routing', { Link, basePath, navigate });
6
+ function RouteProvider({ children, Link = FallbackRouteLink, navigate, url, }) {
7
+ useGlobalState('routing', {
8
+ Link,
9
+ navigate,
10
+ url,
11
+ });
8
12
  return jsx(Fragment, { children: children });
9
13
  }
10
14
  const FallbackRouteLink = withRouting('a');
@@ -1,4 +1,4 @@
1
- export declare function buildHref({ basePath, href, }: {
2
- basePath?: string;
1
+ export declare function buildHref({ basePathname, href, }: {
2
+ basePathname?: string;
3
3
  href: string;
4
4
  }): string;