@sonic-equipment/ui 126.0.0 → 128.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 (175) hide show
  1. package/dist/address/address.d.ts +6 -1
  2. package/dist/address/address.js +2 -2
  3. package/dist/algolia/filter-section.js +1 -1
  4. package/dist/cards/orderline-card/connected-orderline-card.js +1 -1
  5. package/dist/cards/orderline-card/orderline-card.d.ts +3 -3
  6. package/dist/cards/orderline-card/orderline-card.js +3 -2
  7. package/dist/cards/orderline-card/orderline-card.module.css.js +1 -1
  8. package/dist/cards/product-card/product-card.js +1 -1
  9. package/dist/cart-totals/cart-totals.d.ts +1 -1
  10. package/dist/cart-totals/cart-totals.js +1 -1
  11. package/dist/checkout/adyen-payment.d.ts +3 -5
  12. package/dist/checkout/adyen-payment.js +22 -10
  13. package/dist/checkout/adyen-payment.module.css.js +3 -0
  14. package/dist/checkout/payment-details.d.ts +5 -2
  15. package/dist/checkout/payment-details.js +54 -4
  16. package/dist/checkout/payment.d.ts +8 -3
  17. package/dist/checkout/payment.js +168 -34
  18. package/dist/checkout/payment.module.css.js +3 -0
  19. package/dist/checkout/use-get-adyen-redirect-result.d.ts +1 -0
  20. package/dist/checkout/use-get-adyen-redirect-result.js +13 -0
  21. package/dist/checkout/use-has-returned-from-adyen.d.ts +1 -0
  22. package/dist/checkout/use-has-returned-from-adyen.js +8 -0
  23. package/dist/collapsables/accordion/accordion.d.ts +10 -2
  24. package/dist/collapsables/accordion/accordion.js +20 -1
  25. package/dist/collapsables/accordion/accordion.module.css.js +1 -1
  26. package/dist/exports.d.ts +38 -24
  27. package/dist/forms/checkbox/checkbox.d.ts +2 -1
  28. package/dist/forms/checkbox/checkbox.js +2 -2
  29. package/dist/forms/input/input.js +1 -3
  30. package/dist/forms/label/label.d.ts +1 -1
  31. package/dist/forms/select/select.d.ts +4 -2
  32. package/dist/forms/select/select.js +6 -3
  33. package/dist/forms/select/select.module.css.js +1 -1
  34. package/dist/global-search/search-input/connected-search-input.js +1 -1
  35. package/dist/index.js +41 -27
  36. package/dist/intl/missing-translation-provider.js +9 -2
  37. package/dist/intl/translation-id.d.ts +1 -1
  38. package/dist/loading/loading-overlay.js +1 -1
  39. package/dist/pages/{cart-page → checkout/cart-page}/cart-page.js +20 -20
  40. package/dist/pages/{layouts → checkout/layouts}/checkout-page-layout/checkout-page-layout.js +3 -3
  41. package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.module.css.js +3 -0
  42. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.d.ts +7 -0
  43. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js +9 -0
  44. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.d.ts +8 -0
  45. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js +9 -0
  46. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.d.ts +4 -0
  47. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js +8 -0
  48. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.d.ts +7 -0
  49. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js +10 -0
  50. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.module.css.js +3 -0
  51. package/dist/pages/checkout/payment-page/payment-page.d.ts +1 -0
  52. package/dist/pages/checkout/payment-page/payment-page.js +89 -0
  53. package/dist/pages/{shipping-page → checkout/shipping-page}/components/edit-address.d.ts +1 -1
  54. package/dist/pages/{shipping-page → checkout/shipping-page}/components/edit-address.js +13 -13
  55. package/dist/pages/checkout/shipping-page/components/edit-address.module.css.js +3 -0
  56. package/dist/pages/{shipping-page → checkout/shipping-page}/components/readonly-address.d.ts +1 -1
  57. package/dist/pages/checkout/shipping-page/components/readonly-address.js +27 -0
  58. package/dist/pages/checkout/shipping-page/components/readonly-address.module.css.js +3 -0
  59. package/dist/pages/checkout/shipping-page/shipping-page.js +114 -0
  60. package/dist/pages/{page → components/page}/page.d.ts +1 -1
  61. package/dist/pages/{page → components/page}/page.js +3 -5
  62. package/dist/pages/components/page/page.module.css.js +3 -0
  63. package/dist/pages/components/page-container/page-container.module.css.js +3 -0
  64. package/dist/pages/components/page-meta-data/page-meta-data.d.ts +16 -0
  65. package/dist/pages/components/page-meta-data/page-meta-data.js +95 -0
  66. package/dist/pages/error-page/error-page.js +1 -1
  67. package/dist/pages/product/layouts/product-details-page-layout/product-details-page-layout.module.css.js +3 -0
  68. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-images/product-detail-images.d.ts +1 -1
  69. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-images/product-detail-images.js +6 -6
  70. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-images/product-detail-images.module.css.js +1 -1
  71. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-panel/product-details-panel.js +11 -11
  72. package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.module.css.js +3 -0
  73. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-recently-viewed/product-details-recently-viewed.d.ts +1 -1
  74. package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-recently-viewed/product-details-recently-viewed.js +4 -4
  75. package/dist/pages/product/product-details-page/product-details-page.js +30 -0
  76. package/dist/pages/{product-details-page → product/product-details-page}/product-details.d.ts +1 -1
  77. package/dist/pages/{product-details-page → product/product-details-page}/product-details.js +7 -7
  78. package/dist/pages/{product-listing-page → product/product-listing-page}/no-results/no-results.js +4 -4
  79. package/dist/pages/product/product-listing-page/no-results/no-results.module.css.js +3 -0
  80. package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-category-carousel/product-listing-page-category-carousel.js +3 -3
  81. package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-data-types.d.ts +3 -1
  82. package/dist/pages/product/product-listing-page/product-listing-page.js +37 -0
  83. package/dist/pages/product/product-listing-page/product-listing-page.module.css.js +3 -0
  84. package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-product-overview/product-listing-product-overview.js +6 -6
  85. package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing.js +16 -16
  86. package/dist/pages/{search-result-page → product/search-result-page}/search-result-product-overview/search-result-product-overview.js +6 -6
  87. package/dist/pages/{search-result-page → product/search-result-page}/search-results-page-category-carousel/search-results-page-category-carousel.js +3 -3
  88. package/dist/pages/{search-result-page → product/search-result-page}/search-results-page.js +22 -17
  89. package/dist/pages/product/search-result-page/search-results-page.module.css.js +3 -0
  90. package/dist/shared/api/bff/model/bff.model.d.ts +14 -0
  91. package/dist/shared/api/bff/services/bff-service.d.ts +1 -1
  92. package/dist/shared/api/bff/services/bff-service.js +1 -0
  93. package/dist/shared/api/shared/hooks/use-awaitable-mutation.d.ts +20 -4
  94. package/dist/shared/api/shared/hooks/use-awaitable-mutation.js +29 -21
  95. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.d.ts +7 -4
  96. package/dist/shared/api/storefront/hooks/authentication/use-patch-session.js +4 -3
  97. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.d.ts +2 -1
  98. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +4 -2
  99. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.d.ts +3 -1
  100. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +3 -2
  101. package/dist/shared/api/storefront/hooks/cart/use-patch-cart.d.ts +9 -8
  102. package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +6 -4
  103. package/dist/shared/api/storefront/hooks/cart/use-place-order.d.ts +10 -4
  104. package/dist/shared/api/storefront/hooks/cart/use-place-order.js +11 -6
  105. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.d.ts +4 -0
  106. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js +12 -0
  107. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.d.ts +3 -0
  108. package/dist/shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js +12 -0
  109. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.d.ts +5 -2
  110. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +1 -1
  111. package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.d.ts +1 -1
  112. package/dist/shared/api/storefront/hooks/payment/use-invalidate-adyen.js +1 -1
  113. package/dist/shared/api/storefront/model/storefront.model.d.ts +3 -1
  114. package/dist/shared/api/storefront/services/cart-service.d.ts +7 -3
  115. package/dist/shared/api/storefront/services/cart-service.js +11 -8
  116. package/dist/shared/api/storefront/services/customer-service.d.ts +3 -0
  117. package/dist/shared/api/storefront/services/customer-service.js +9 -1
  118. package/dist/shared/api/storefront/services/finance-service.d.ts +13 -0
  119. package/dist/shared/api/storefront/services/finance-service.js +17 -0
  120. package/dist/shared/api/storefront/services/translation-service.js +1 -1
  121. package/dist/shared/hooks/use-css-link.d.ts +3 -0
  122. package/dist/shared/hooks/use-css-link.js +20 -0
  123. package/dist/shared/hooks/use-script.d.ts +15 -0
  124. package/dist/shared/hooks/use-script.js +33 -0
  125. package/dist/shared/providers/react-query-container.js +4 -2
  126. package/dist/shared/routing/route-provider.d.ts +12 -4
  127. package/dist/shared/routing/route-provider.js +14 -10
  128. package/dist/shared/routing/with-routing.js +6 -6
  129. package/dist/shared/utils/string.d.ts +1 -0
  130. package/dist/shared/utils/string.js +6 -1
  131. package/dist/shared/utils/string.test.d.ts +1 -0
  132. package/dist/shared/utils/types.d.ts +3 -0
  133. package/dist/shared/utils/types.js +8 -0
  134. package/dist/styles.css +690 -331
  135. package/dist/tooltip/tooltip.d.ts +2 -2
  136. package/dist/typography/heading/heading.d.ts +4 -2
  137. package/dist/typography/heading/heading.js +3 -2
  138. package/dist/typography/heading/heading.module.css.js +1 -1
  139. package/package.json +1 -1
  140. package/dist/pages/layouts/checkout-page-layout/checkout-page-layout.module.css.js +0 -3
  141. package/dist/pages/layouts/product-details-page-layout/product-details-page-layout.module.css.js +0 -3
  142. package/dist/pages/page/page.module.css.js +0 -3
  143. package/dist/pages/page-container/page-container.module.css.js +0 -3
  144. package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.module.css.js +0 -3
  145. package/dist/pages/product-details-page/product-details-page.js +0 -22
  146. package/dist/pages/product-listing-page/no-results/no-results.module.css.js +0 -3
  147. package/dist/pages/product-listing-page/product-listing-page.js +0 -29
  148. package/dist/pages/product-listing-page/product-listing-page.module.css.js +0 -3
  149. package/dist/pages/search-result-page/search-results-page.module.css.js +0 -3
  150. package/dist/pages/shipping-page/components/edit-address.module.css.js +0 -3
  151. package/dist/pages/shipping-page/components/readonly-address.js +0 -25
  152. package/dist/pages/shipping-page/components/readonly-address.module.css.js +0 -3
  153. package/dist/pages/shipping-page/shipping-page.js +0 -75
  154. package/dist/pages/shipping-page/shipping-page.module.css.js +0 -3
  155. /package/dist/pages/{cart-page → checkout/cart-page}/cart-page.d.ts +0 -0
  156. /package/dist/pages/{layouts → checkout/layouts}/checkout-page-layout/checkout-page-layout.d.ts +0 -0
  157. /package/dist/pages/{shipping-page → checkout/shipping-page}/shipping-page.d.ts +0 -0
  158. /package/dist/pages/{page-container → components/page-container}/page-container.d.ts +0 -0
  159. /package/dist/pages/{page-container → components/page-container}/page-container.js +0 -0
  160. /package/dist/pages/{layouts → product/layouts}/product-details-page-layout/product-details-page-layout.d.ts +0 -0
  161. /package/dist/pages/{layouts → product/layouts}/product-details-page-layout/product-details-page-layout.js +0 -0
  162. /package/dist/pages/{product-details-page → product/product-details-page}/components/product-details-panel/product-details-panel.d.ts +0 -0
  163. /package/dist/pages/{product-details-page → product/product-details-page}/product-details-page.d.ts +0 -0
  164. /package/dist/pages/{product-listing-page → product/product-listing-page}/no-results/no-results.d.ts +0 -0
  165. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-category-carousel/product-listing-page-category-carousel.d.ts +0 -0
  166. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-provider/product-listing-page-context.d.ts +0 -0
  167. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-provider/product-listing-page-context.js +0 -0
  168. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-provider/product-listing-page-provider.d.ts +0 -0
  169. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page-provider/product-listing-page-provider.js +0 -0
  170. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-page.d.ts +0 -0
  171. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing-product-overview/product-listing-product-overview.d.ts +0 -0
  172. /package/dist/pages/{product-listing-page → product/product-listing-page}/product-listing.d.ts +0 -0
  173. /package/dist/pages/{search-result-page → product/search-result-page}/search-result-product-overview/search-result-product-overview.d.ts +0 -0
  174. /package/dist/pages/{search-result-page → product/search-result-page}/search-results-page-category-carousel/search-results-page-category-carousel.d.ts +0 -0
  175. /package/dist/pages/{search-result-page → product/search-result-page}/search-results-page.d.ts +0 -0
package/dist/index.js CHANGED
@@ -65,6 +65,8 @@ export { AdyenPayment } from './checkout/adyen-payment.js';
65
65
  export { parseAmount } from './checkout/parse-amount.js';
66
66
  export { Payment } from './checkout/payment.js';
67
67
  export { PaymentDetails } from './checkout/payment-details.js';
68
+ export { useGetAdyenRedirectResult } from './checkout/use-get-adyen-redirect-result.js';
69
+ export { useHasReturnedFromAdyen } from './checkout/use-has-returned-from-adyen.js';
68
70
  export { Accordion } from './collapsables/accordion/accordion.js';
69
71
  export { AccordionItem } from './collapsables/accordion/accordion-item.js';
70
72
  export { ShowAll } from './collapsables/show-all/show-all.js';
@@ -143,31 +145,37 @@ export { Announcement } from './notifications/announcements/announcement.js';
143
145
  export { AnnouncementProvider } from './notifications/announcements/announcement-provider.js';
144
146
  export { ConnectedAnnouncement, now } from './notifications/announcements/connected-announcement.js';
145
147
  export { IntersectionObserverComponent } from './observers/intersection-observer.js';
146
- export { CartPage } from './pages/cart-page/cart-page.js';
148
+ export { CartPage } from './pages/checkout/cart-page/cart-page.js';
149
+ export { CheckoutPageLayout } from './pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js';
150
+ export { CheckoutPageSection } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js';
151
+ export { CheckoutPageSectionContent } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js';
152
+ export { CheckoutPageSectionHeader } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js';
153
+ export { CheckoutPageSectionLink } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js';
154
+ export { PaymentPage } from './pages/checkout/payment-page/payment-page.js';
155
+ export { EDIT_ADDRESS_FORM_ID, EditAddresses } from './pages/checkout/shipping-page/components/edit-address.js';
156
+ export { ReadOnlyAddresses } from './pages/checkout/shipping-page/components/readonly-address.js';
157
+ export { ShippingPage } from './pages/checkout/shipping-page/shipping-page.js';
158
+ export { PageContainer } from './pages/components/page-container/page-container.js';
159
+ export { PageMetaData } from './pages/components/page-meta-data/page-meta-data.js';
160
+ export { Page } from './pages/components/page/page.js';
147
161
  export { ErrorPage } from './pages/error-page/error-page.js';
148
- export { CheckoutPageLayout } from './pages/layouts/checkout-page-layout/checkout-page-layout.js';
149
- export { ProductDetailsPageLayout } from './pages/layouts/product-details-page-layout/product-details-page-layout.js';
150
162
  export { LoadingPage } from './pages/loading-page/loading-page.js';
151
- export { PageContainer } from './pages/page-container/page-container.js';
152
- export { Page } from './pages/page/page.js';
153
- export { ProductDetailImages } from './pages/product-details-page/components/product-details-images/product-detail-images.js';
154
- export { ProductDetailsPanel } from './pages/product-details-page/components/product-details-panel/product-details-panel.js';
155
- export { ProductDetailsRecentlyViewed } from './pages/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.js';
156
- export { ProductDetails } from './pages/product-details-page/product-details.js';
157
- export { ProductDetailsPage } from './pages/product-details-page/product-details-page.js';
158
- export { NoResults } from './pages/product-listing-page/no-results/no-results.js';
159
- export { ProductListing } from './pages/product-listing-page/product-listing.js';
160
- export { ProductListingPage } from './pages/product-listing-page/product-listing-page.js';
161
- export { ProductListingPageCategoryCarousel } from './pages/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js';
162
- export { ProductListingPageContext } from './pages/product-listing-page/product-listing-page-provider/product-listing-page-context.js';
163
- export { ProductListingPageProvider, useProductListingPageProvider } from './pages/product-listing-page/product-listing-page-provider/product-listing-page-provider.js';
164
- export { ProductListingProductOverview } from './pages/product-listing-page/product-listing-product-overview/product-listing-product-overview.js';
165
- export { SearchResultProductOverview } from './pages/search-result-page/search-result-product-overview/search-result-product-overview.js';
166
- export { SearchResultsPage } from './pages/search-result-page/search-results-page.js';
167
- export { SearchResultsPageCategoryCarousel } from './pages/search-result-page/search-results-page-category-carousel/search-results-page-category-carousel.js';
168
- export { EDIT_ADDRESS_FORM_ID, EditAddresses } from './pages/shipping-page/components/edit-address.js';
169
- export { ReadOnlyAddresses } from './pages/shipping-page/components/readonly-address.js';
170
- export { ShippingPage } from './pages/shipping-page/shipping-page.js';
163
+ export { ProductDetailsPageLayout } from './pages/product/layouts/product-details-page-layout/product-details-page-layout.js';
164
+ export { ProductDetailImages } from './pages/product/product-details-page/components/product-details-images/product-detail-images.js';
165
+ export { ProductDetailsPanel } from './pages/product/product-details-page/components/product-details-panel/product-details-panel.js';
166
+ export { ProductDetailsRecentlyViewed } from './pages/product/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.js';
167
+ export { ProductDetails } from './pages/product/product-details-page/product-details.js';
168
+ export { ProductDetailsPage } from './pages/product/product-details-page/product-details-page.js';
169
+ export { NoResults } from './pages/product/product-listing-page/no-results/no-results.js';
170
+ export { ProductListing } from './pages/product/product-listing-page/product-listing.js';
171
+ export { ProductListingPage } from './pages/product/product-listing-page/product-listing-page.js';
172
+ export { ProductListingPageCategoryCarousel } from './pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js';
173
+ export { ProductListingPageContext } from './pages/product/product-listing-page/product-listing-page-provider/product-listing-page-context.js';
174
+ export { ProductListingPageProvider, useProductListingPageProvider } from './pages/product/product-listing-page/product-listing-page-provider/product-listing-page-provider.js';
175
+ export { ProductListingProductOverview } from './pages/product/product-listing-page/product-listing-product-overview/product-listing-product-overview.js';
176
+ export { SearchResultProductOverview } from './pages/product/search-result-page/search-result-product-overview/search-result-product-overview.js';
177
+ export { SearchResultsPage } from './pages/product/search-result-page/search-results-page.js';
178
+ export { SearchResultsPageCategoryCarousel } from './pages/product/search-result-page/search-results-page-category-carousel/search-results-page-category-carousel.js';
171
179
  export { PromoBanner } from './promos/promo-banner/promo-banner.js';
172
180
  export { PromoBanners } from './promos/promo-banners/promo-banners.js';
173
181
  export { PromoCard } from './promos/promo-card/promo-card.js';
@@ -200,6 +208,8 @@ export { usePatchCartLineById } from './shared/api/storefront/hooks/cart/use-pat
200
208
  export { usePlaceOrder } from './shared/api/storefront/hooks/cart/use-place-order.js';
201
209
  export { useSaveCartForLater } from './shared/api/storefront/hooks/cart/use-save-cart-for-later.js';
202
210
  export { useFetchBillToAddresses } from './shared/api/storefront/hooks/customer/use-fetch-bill-to-addresses.js';
211
+ export { useFetchFulfillmentMethodsByCustomerId } from './shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-by-customer-id.js';
212
+ export { useFetchFulfillmentMethodsForCurrentCart } from './shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js';
203
213
  export { useFetchShipToAddresses } from './shared/api/storefront/hooks/customer/use-fetch-ship-to-addresses.js';
204
214
  export { usePatchBillToAddress } from './shared/api/storefront/hooks/customer/use-patch-bill-to-address.js';
205
215
  export { useCreateAdyenSession } from './shared/api/storefront/hooks/payment/use-create-adyen-session.js';
@@ -218,8 +228,9 @@ export { useDeleteWishListItemFromWishList } from './shared/api/storefront/hooks
218
228
  export { useFetchAllWishListsItems } from './shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js';
219
229
  export { useFetchWishLists } from './shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js';
220
230
  export { createGuestAccount, createSession, fetchSession, patchSession, signIn, signOut } from './shared/api/storefront/services/authentication-service.js';
221
- export { addProductToCurrentCart, convertToMinorUnits, deleteCartLineById, deleteCurrentCart, fetchCurrentCart, fetchCurrentCartLines, fetchCurrentCartProductAtp, fetchCurrentCartPromotions, fetchCurrentCheckoutAtp, getAdyenPaymentDetails, patchCart, patchCartLineById, placeOrder, postAdyenPayment, saveCartForLater } from './shared/api/storefront/services/cart-service.js';
222
- export { fetchBillToAddresses, fetchShipToAddresses, patchBillToAddress } from './shared/api/storefront/services/customer-service.js';
231
+ 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';
232
+ export { fetchBillToAddresses, fetchFulfillmentMethods, fetchShipToAddresses, patchBillToAddress } from './shared/api/storefront/services/customer-service.js';
233
+ export { validateVATNumber } from './shared/api/storefront/services/finance-service.js';
223
234
  export { createAdyenSession, fetchAdyenConfig } from './shared/api/storefront/services/payment-service.js';
224
235
  export { fetchTranslations } from './shared/api/storefront/services/translation-service.js';
225
236
  export { fetchCountries, fetchCountriesLanguages, fetchCountriesWithLanguages, fetchSettings, updateLocale } from './shared/api/storefront/services/website-service.js';
@@ -232,12 +243,14 @@ export { isGAEvent } from './shared/ga/types.js';
232
243
  export { useDataLayer } from './shared/ga/use-data-layer.js';
233
244
  export { useBreakpoint } from './shared/hooks/use-breakpoint.js';
234
245
  export { useCookie } from './shared/hooks/use-cookie.js';
246
+ export { useCSSLink } from './shared/hooks/use-css-link.js';
235
247
  export { useDebouncedCallback } from './shared/hooks/use-debounced-callback.js';
236
248
  export { useDisclosure } from './shared/hooks/use-disclosure.js';
237
249
  export { useEnableMobileZoom } from './shared/hooks/use-enable-mobile-zoom.js';
238
250
  export { useIntersectionObserver } from './shared/hooks/use-intersection-observer.js';
239
251
  export { useIsBreakpoint } from './shared/hooks/use-is-breakpoint.js';
240
252
  export { useResizeObserver } from './shared/hooks/use-resize-observer.js';
253
+ export { useScript } from './shared/hooks/use-script.js';
241
254
  export { useScrollLock } from './shared/hooks/use-scroll-lock.js';
242
255
  export { scrollToTop, useScrollTo } from './shared/hooks/use-scroll-to.js';
243
256
  export { useSessionStorage } from './shared/hooks/use-session-storage.js';
@@ -256,7 +269,7 @@ export { ReactQueryContainer } from './shared/providers/react-query-container.js
256
269
  export { RouteButton } from './shared/routing/route-button.js';
257
270
  export { RouteIconButton } from './shared/routing/route-icon-button.js';
258
271
  export { RouteLink } from './shared/routing/route-link.js';
259
- export { RouteProvider, useLocale, useNavigate, useOnNavigate } from './shared/routing/route-provider.js';
272
+ export { RouteProvider, useBasePath, useNavigate, useOnNavigate } from './shared/routing/route-provider.js';
260
273
  export { withRouting } from './shared/routing/with-routing.js';
261
274
  export { ensureArray } from './shared/utils/array.js';
262
275
  export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
@@ -266,8 +279,9 @@ export { EventEmitter } from './shared/utils/event-emitter.js';
266
279
  export { clone, deepMerge, isPlainObject, default as main, merge } from './shared/utils/merge.js';
267
280
  export { currencies, formatPrice, getCurrencyByCountryCode } from './shared/utils/price.js';
268
281
  export { random, randomInt } from './shared/utils/random.js';
269
- export { capitalizeFirstLetter } from './shared/utils/string.js';
282
+ export { camelCase, capitalizeFirstLetter } from './shared/utils/string.js';
270
283
  export { TIME } from './shared/utils/time.js';
284
+ export { has, hasNo } from './shared/utils/types.js';
271
285
  export { createUUID } from './shared/utils/uuid.js';
272
286
  export { wait } from './shared/utils/wait.js';
273
287
  export { Sidebar } from './sidebar/sidebar.js';
@@ -13,9 +13,16 @@ function MissingTranslationProvider({ children, }) {
13
13
  const message = intlProps.formattedMessage(id, options);
14
14
  if (!missing && !showTranslations)
15
15
  return message;
16
- if (missing && !translations?.[id])
16
+ if (missing &&
17
+ !translations?.[id.toLocaleLowerCase()] &&
18
+ !options?.optional) {
17
19
  return `❗️${message}❗️`;
18
- return showTranslations ? `⭐️${message}⭐️` : message;
20
+ }
21
+ return showTranslations
22
+ ? options?.optional
23
+ ? `❓${message}❓`
24
+ : `⭐️${message}⭐️`
25
+ : message;
19
26
  }, [intlProps, missing, showTranslations, translations]);
20
27
  if (!missing && !showTranslations)
21
28
  return jsx(Fragment, { children: children });
@@ -1 +1 @@
1
- export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'Add order notes' | 'Address' | 'Amount: {0}' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'Attention' | 'Billing address' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Company name' | 'Continue shopping' | 'Continue' | 'Cost overview' | 'Country' | 'Create new list' | 'Delivery expected in {0} {1}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'First name' | 'Fulfillment method' | 'Hide filters' | 'Home' | 'Incl. VAT' | 'Includes' | 'Language' | 'Last name' | 'List name already exists' | 'New list name' | 'Order number' | 'PO Number' | 'Phone' | 'Please Sign In' | 'Popular searches' | 'Postal Code' | 'Print' | 'Product Features' | 'Product' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Remove all' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Share your favorite list with others' | 'Shipping and handling' | 'Shop more efficiently and quicker with a favorites list' | 'Shipping details' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | '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.' | 'Unable to add the product to your cart.' | 'Unable to update the product in your cart.' | 'Unable to remove the product from your cart.' | 'Unable to empty your cart.' | 'Unable to save cart for later.' | 'Use billing address' | 'Try another search' | 'Total' | '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.' | 'Use fewer keywords' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'Your cart has been emptied.' | 'Your favorites are available on multiple devices' | 'Your shopping cart is still empty' | 'article' | 'articles' | 'create account' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'pc' | 'Shipping address' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing';
1
+ export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Billing address' | 'Billing and shipping address' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Company name' | 'Continue shopping' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Delivery expected in {0} {1}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Features' | 'First name' | 'Fulfillment method' | 'Hide filters' | 'Home' | 'Incl. VAT' | 'Includes' | 'Industry' | 'Language' | 'Last name' | 'List name already exists' | 'New list name' | 'of' | 'Order number' | 'Order' | 'Pay' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Remove all' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a desired delivery date' | 'Select a list' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Total amount is' | 'Total' | 'Total' | 'Try another search' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unable to update the product in your cart.' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'Your cart has been emptied.' | 'Your favorites are available on multiple devices' | 'Your shopping cart is still empty';
@@ -3,7 +3,7 @@ import { ProgressCircle } from './progress-circle.js';
3
3
  import styles from './loading-overlay.module.css.js';
4
4
 
5
5
  function LoadingOverlay() {
6
- return (jsx("div", { className: styles['loading-overlay'], children: jsx(ProgressCircle, {}) }));
6
+ return (jsx("div", { className: styles['loading-overlay'], children: jsx(ProgressCircle, { variant: "gray" }) }));
7
7
  }
8
8
 
9
9
  export { LoadingOverlay };
@@ -1,23 +1,23 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { ConnectedOrderLineCard } from '../../cards/orderline-card/connected-orderline-card.js';
3
- import { CartTotals } from '../../cart-totals/cart-totals.js';
4
- import { CartTotalsSummary } from '../../cart-totals/cart-totals-summary.js';
5
- import { FormattedMessage } from '../../intl/formatted-message.js';
6
- import { useFormattedMessage } from '../../intl/use-formatted-message.js';
7
- import { OrderLineList } from '../../lists/orderline-list/orderline-list.js';
8
- import { ErrorPage } from '../error-page/error-page.js';
2
+ import { ConnectedOrderLineCard } from '../../../cards/orderline-card/connected-orderline-card.js';
3
+ import { CartTotals } from '../../../cart-totals/cart-totals.js';
4
+ import { CartTotalsSummary } from '../../../cart-totals/cart-totals-summary.js';
5
+ import { FormattedMessage } from '../../../intl/formatted-message.js';
6
+ import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
7
+ import { OrderLineList } from '../../../lists/orderline-list/orderline-list.js';
9
8
  import { CheckoutPageLayout } from '../layouts/checkout-page-layout/checkout-page-layout.js';
10
- import { LoadingPage } from '../loading-page/loading-page.js';
11
- import { Page } from '../page/page.js';
12
- import { NoResults } from '../product-listing-page/no-results/no-results.js';
13
- import { useIsAuthenticated } from '../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
14
- import { useDeleteCartLineById } from '../../shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
15
- import { useDeleteCurrentCart } from '../../shared/api/storefront/hooks/cart/use-delete-current-cart.js';
16
- import { useSaveCartForLater } from '../../shared/api/storefront/hooks/cart/use-save-cart-for-later.js';
17
- import { RouteButton } from '../../shared/routing/route-button.js';
18
- import { useToast } from '../../toast/use-toast.js';
19
- import { useFetchCurrentCartLinesWithAtp } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js';
20
- import { useFetchCurrentCartWithAtp } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js';
9
+ import { Page } from '../../components/page/page.js';
10
+ import { ErrorPage } from '../../error-page/error-page.js';
11
+ import { LoadingPage } from '../../loading-page/loading-page.js';
12
+ import { NoResults } from '../../product/product-listing-page/no-results/no-results.js';
13
+ import { useIsAuthenticated } from '../../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
14
+ import { useDeleteCartLineById } from '../../../shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
15
+ import { useDeleteCurrentCart } from '../../../shared/api/storefront/hooks/cart/use-delete-current-cart.js';
16
+ import { useSaveCartForLater } from '../../../shared/api/storefront/hooks/cart/use-save-cart-for-later.js';
17
+ import { RouteButton } from '../../../shared/routing/route-button.js';
18
+ import { useToast } from '../../../toast/use-toast.js';
19
+ import { useFetchCurrentCartLinesWithAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js';
20
+ import { useFetchCurrentCartWithAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js';
21
21
 
22
22
  function EmptyCart() {
23
23
  const t = useFormattedMessage();
@@ -93,11 +93,11 @@ function CartContent({ cartLines }) {
93
93
  altText: cartLine.altText,
94
94
  },
95
95
  title: cartLine.altText,
96
- }, onRemove: () => deleteCartLine.mutate({ cartLineId: cartLine.id }), orderLineId: cartLine.id, price: {
96
+ }, isReadonly: false, onRemove: () => deleteCartLine.mutate({ cartLineId: cartLine.id }), orderLineId: cartLine.id, price: {
97
97
  originalTotalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
98
98
  pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
99
99
  totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
100
- }, productId: cartLine.productId || '', readonly: false, sku: cartLine.erpNumber || '', tags: [], title: cartLine.productName }, cartLine.id))) }) }));
100
+ }, productId: cartLine.productId || '', sku: cartLine.erpNumber || '', tags: [], title: cartLine.productName }, cartLine.id))) }) }));
101
101
  }
102
102
  function CartPage() {
103
103
  const t = useFormattedMessage();
@@ -1,9 +1,9 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
2
  import { useRef, useMemo } from 'react';
3
3
  import clsx from 'clsx';
4
- import { useIntersectionObserver } from '../../../shared/hooks/use-intersection-observer.js';
5
- import { useIsBreakpoint } from '../../../shared/hooks/use-is-breakpoint.js';
6
- import { useWatchCssProperty } from '../../../shared/hooks/use-watch-css-property.js';
4
+ import { useIntersectionObserver } from '../../../../shared/hooks/use-intersection-observer.js';
5
+ import { useIsBreakpoint } from '../../../../shared/hooks/use-is-breakpoint.js';
6
+ import { useWatchCssProperty } from '../../../../shared/hooks/use-watch-css-property.js';
7
7
  import styles from './checkout-page-layout.module.css.js';
8
8
 
9
9
  function CheckoutPageLayout({ actions, children, mobileSummary, overview, }) {
@@ -0,0 +1,3 @@
1
+ var styles = {"checkout-page-layout":"checkout-page-layout-module-lULV3","wrapper":"checkout-page-layout-module-cUEmU","sticky-side":"checkout-page-layout-module-B3M80","actions":"checkout-page-layout-module-8UNBq","top-actions":"checkout-page-layout-module-430Iq","top-actions-sticky":"checkout-page-layout-module-wGAXb"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface CheckoutPageSectionContentProps {
3
+ children: ReactNode;
4
+ stretch?: boolean;
5
+ }
6
+ export declare function CheckoutPageSectionContent({ children, stretch, }: CheckoutPageSectionContentProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import styles from './checkout-page-section.module.css.js';
4
+
5
+ function CheckoutPageSectionContent({ children, stretch, }) {
6
+ return (jsx("div", { className: clsx(styles['section-content'], stretch && styles.stretch), children: children }));
7
+ }
8
+
9
+ export { CheckoutPageSectionContent };
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { HeadingProps } from '../../../../../typography/heading/heading';
3
+ export interface CheckoutPageSectionHeaderProps {
4
+ size?: HeadingProps['size'];
5
+ tag?: HeadingProps['tag'];
6
+ title: string | ReactNode;
7
+ }
8
+ export declare function CheckoutPageSectionHeader({ size, tag, title, }: CheckoutPageSectionHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Heading } from '../../../../../typography/heading/heading.js';
3
+ import styles from './checkout-page-section.module.css.js';
4
+
5
+ function CheckoutPageSectionHeader({ size = 'xs', tag = 'h2', title, }) {
6
+ return (jsx(Heading, { className: styles['section-header'], size: size, tag: tag, children: title }));
7
+ }
8
+
9
+ export { CheckoutPageSectionHeader };
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function CheckoutPageSectionLink({ children }: {
3
+ children: ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import styles from './checkout-page-section.module.css.js';
3
+
4
+ function CheckoutPageSectionLink({ children }) {
5
+ return jsx("div", { className: styles['section-link'], children: children });
6
+ }
7
+
8
+ export { CheckoutPageSectionLink };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export interface CheckoutPageSectionProps {
3
+ children: ReactNode;
4
+ hasBorder?: boolean;
5
+ title: string | ReactNode;
6
+ }
7
+ export declare function CheckoutPageSection({ children, hasBorder, title, }: CheckoutPageSectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { CheckoutPageSectionHeader } from './checkout-page-section-header.js';
4
+ import styles from './checkout-page-section.module.css.js';
5
+
6
+ function CheckoutPageSection({ children, hasBorder = true, title, }) {
7
+ return (jsxs("section", { className: clsx(styles.section, { [styles['has-border']]: hasBorder }), children: [title && jsx(CheckoutPageSectionHeader, { title: title }), children] }));
8
+ }
9
+
10
+ export { CheckoutPageSection };
@@ -0,0 +1,3 @@
1
+ var styles = {"section":"checkout-page-section-module-zyovs","has-border":"checkout-page-section-module-pe5iL","section-header":"checkout-page-section-module-lcEdH","section-content":"checkout-page-section-module-ZkhMj","stretch":"checkout-page-section-module-24DRv","section-link":"checkout-page-section-module-l508k"};
2
+
3
+ export { styles as default };
@@ -0,0 +1 @@
1
+ export declare function PaymentPage(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,89 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useCallback, useEffect } from 'react';
3
+ import { Button } from '../../../buttons/button/button.js';
4
+ import { OrderLineCard } from '../../../cards/orderline-card/orderline-card.js';
5
+ import { CartTotals } from '../../../cart-totals/cart-totals.js';
6
+ import { CartTotalsSummary } from '../../../cart-totals/cart-totals-summary.js';
7
+ import { Payment } from '../../../checkout/payment.js';
8
+ import { useHasReturnedFromAdyen } from '../../../checkout/use-has-returned-from-adyen.js';
9
+ import { FormattedMessage } from '../../../intl/formatted-message.js';
10
+ import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
11
+ import { OrderLineList } from '../../../lists/orderline-list/orderline-list.js';
12
+ import { useIsAuthenticated } from '../../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
13
+ import { useFetchCurrentCheckoutAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js';
14
+ import { useFetchCurrentCartWithAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js';
15
+ import { useFetchFulfillmentMethodsForCurrentCart } from '../../../shared/api/storefront/hooks/customer/use-fetch-fulfillment-methods-for-current-cart.js';
16
+ import { useNavigate } from '../../../shared/routing/route-provider.js';
17
+ import { hasNo } from '../../../shared/utils/types.js';
18
+ import { Page } from '../../components/page/page.js';
19
+ import { ErrorPage } from '../../error-page/error-page.js';
20
+ import { LoadingPage } from '../../loading-page/loading-page.js';
21
+ import { CheckoutPageLayout } from '../layouts/checkout-page-layout/checkout-page-layout.js';
22
+ import { CheckoutPageSection } from '../layouts/checkout-page-layout/components/checkout-page-section.js';
23
+ import { CheckoutPageSectionContent } from '../layouts/checkout-page-layout/components/checkout-page-section-content.js';
24
+
25
+ const PAYMENT_FORM_ID = 'paymentForm';
26
+ function PaymentPage() {
27
+ const hasReturnedFromAdyen = useHasReturnedFromAdyen();
28
+ const isAuthenticated = useIsAuthenticated();
29
+ const { data: cart, error, isLoading: isLoadingCart, } = useFetchCurrentCartWithAtp({
30
+ forceRecalculation: !hasReturnedFromAdyen,
31
+ });
32
+ const { data: atp, isLoading: isAtpLoading } = useFetchCurrentCheckoutAtp();
33
+ const { data: fulfillmentMethods, isLoading: isFulfillmentMethodsLoading } = useFetchFulfillmentMethodsForCurrentCart();
34
+ const isLoading = isLoadingCart || isAtpLoading || isFulfillmentMethodsLoading;
35
+ const t = useFormattedMessage();
36
+ const [isProcessing, setIsProcessing] = useState(false);
37
+ const [isValidating, setIsValidating] = useState(false);
38
+ const { isNavigating, navigate } = useNavigate();
39
+ const onPaymentComplete = useCallback(() => navigate('/CheckoutConfirmation'), [navigate]);
40
+ useEffect(() => {
41
+ if (isNavigating)
42
+ return;
43
+ if (isAuthenticated === undefined)
44
+ return;
45
+ if (!isAuthenticated)
46
+ return navigate('/signin?returnUrl=/CheckoutShipping');
47
+ if (hasNo(cart))
48
+ return;
49
+ if (hasNo(cart.cartLines) || cart.cartLines.length === 0)
50
+ return navigate('/cart');
51
+ if (hasNo(cart.billTo))
52
+ return navigate('/signin?returnUrl=/CheckoutShipping');
53
+ if (hasNo(cart.billTo.address1))
54
+ return navigate('/CheckoutShipping');
55
+ }, [cart, navigate, isAuthenticated, isNavigating]);
56
+ if (error)
57
+ return jsx(ErrorPage, { error: error });
58
+ if (isLoading || isNavigating)
59
+ return jsx(LoadingPage, {});
60
+ if (!isAuthenticated ||
61
+ hasNo(atp) ||
62
+ hasNo(cart) ||
63
+ hasNo(fulfillmentMethods) ||
64
+ hasNo(cart.cartLines) ||
65
+ cart.cartLines.length === 0 ||
66
+ hasNo(cart.billTo?.address1))
67
+ return null;
68
+ return (jsx(Page, { breadCrumb: [
69
+ { href: '/', label: t('Home') },
70
+ { href: '/CheckoutReviewAndSubmit', label: t('Review and payment') },
71
+ ], title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
72
+ primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", form: PAYMENT_FORM_ID, isDisabled: isProcessing, isLoading: isProcessing ? (jsx(FormattedMessage, { id: "Processing" })) : isValidating ? (jsx(FormattedMessage, { id: "Validating" })) : (false), type: "submit", children: jsx(FormattedMessage, { id: "Pay" }) })),
73
+ }, mobileSummary: jsx(CartTotalsSummary, { totalAmount: cart.orderGrandTotalDisplay }), overview: jsx(CartTotals, { fulfillmentMethod: cart.fulfillmentMethod, shippingCost: cart.shippingAndHandlingDisplay, subtotal: cart.orderSubTotalDisplay, tax: cart.totalTaxDisplay, total: cart.orderGrandTotalDisplay, vatPercentage: cart.cartLines[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: PAYMENT_FORM_ID, fulfillmentMethods: fulfillmentMethods, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing, onValidating: setIsValidating }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
74
+ fit: 'contain',
75
+ image: {
76
+ '1': cartLine.smallImagePath,
77
+ '2': cartLine.smallImagePath,
78
+ '3': cartLine.smallImagePath,
79
+ altText: cartLine.altText,
80
+ },
81
+ title: cartLine.altText,
82
+ }, isReadonly: true, price: {
83
+ originalTotalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
84
+ pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
85
+ totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
86
+ }, productId: cartLine.productId || '', quantity: cartLine.qtyOrdered || 1, sku: cartLine.erpNumber || '', tags: [], title: cartLine.productName }, cartLine.id))) }) }) })] }) }));
87
+ }
88
+
89
+ export { PaymentPage };
@@ -1,4 +1,4 @@
1
- import { CountryModel } from '../../../shared/api/storefront/model/storefront.model';
1
+ import { CountryModel } from '../../../../shared/api/storefront/model/storefront.model';
2
2
  export declare const EDIT_ADDRESS_FORM_ID = "billToForm";
3
3
  interface Address {
4
4
  address1: string;
@@ -1,14 +1,15 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { useState, useMemo } from 'react';
2
+ import { useState } from 'react';
3
3
  import { Form } from 'react-aria-components';
4
- import { CountrySelect } from '../../../country-selector/country-select/country-select.js';
5
- import { Checkbox } from '../../../forms/checkbox/checkbox.js';
6
- import { TextField } from '../../../forms/text-field/text-field.js';
7
- import { FormattedMessage } from '../../../intl/formatted-message.js';
8
- import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
9
- import { validatePhone, validateEmail } from '../../../shared/model/address.js';
10
- import { Tooltip } from '../../../tooltip/tooltip.js';
11
- import { Heading } from '../../../typography/heading/heading.js';
4
+ import { CountrySelect } from '../../../../country-selector/country-select/country-select.js';
5
+ import { Checkbox } from '../../../../forms/checkbox/checkbox.js';
6
+ import { TextField } from '../../../../forms/text-field/text-field.js';
7
+ import { FormattedMessage } from '../../../../intl/formatted-message.js';
8
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
9
+ import { validatePhone, validateEmail } from '../../../../shared/model/address.js';
10
+ import { Tooltip } from '../../../../tooltip/tooltip.js';
11
+ import { CheckoutPageSection } from '../../layouts/checkout-page-layout/components/checkout-page-section.js';
12
+ import { CheckoutPageSectionContent } from '../../layouts/checkout-page-layout/components/checkout-page-section-content.js';
12
13
  import styles from './edit-address.module.css.js';
13
14
 
14
15
  const EDIT_ADDRESS_FORM_ID = 'billToForm';
@@ -16,8 +17,7 @@ function EditAddresses({ countries, isLoading, onSubmit, }) {
16
17
  const t = useFormattedMessage();
17
18
  const [companyName, setCompanyName] = useState('');
18
19
  const [lastName, setLastName] = useState('');
19
- const lastNameKey = useMemo(() => `lastname-${Boolean(companyName)}`, [companyName]);
20
- return (jsxs(Fragment, { children: [jsxs("section", { className: styles['form-container'], children: [jsx(Heading, { className: styles['form-header'], size: "xs", tag: "h2", children: jsx(FormattedMessage, { id: "Billing address" }) }), jsxs(Form, { className: styles.form, "data-test-selector": "billToAddressForm", id: EDIT_ADDRESS_FORM_ID, onSubmit: e => {
20
+ return (jsxs(Fragment, { children: [jsx(CheckoutPageSection, { title: jsx(FormattedMessage, { id: "Billing address" }), children: jsx(CheckoutPageSectionContent, { children: jsxs(Form, { className: styles.form, "data-test-selector": "billToAddressForm", id: EDIT_ADDRESS_FORM_ID, onSubmit: e => {
21
21
  e.preventDefault();
22
22
  const formData = new FormData(e.currentTarget);
23
23
  const countryFormValue = formData.get('country')?.toString();
@@ -40,7 +40,7 @@ function EditAddresses({ countries, isLoading, onSubmit, }) {
40
40
  },
41
41
  notes: formData.get('notes')?.toString() || '',
42
42
  });
43
- }, children: [jsx(TextField, { isDisabled: isLoading, label: t('First name'), name: "firstName", showLabel: true }), jsx(TextField, { isDisabled: isLoading, isRequired: !companyName, label: t('Last name'), minLength: 3, name: "lastName", onChange: setLastName, showLabel: true, value: lastName }, lastNameKey), jsx(TextField, { isDisabled: isLoading, label: t('Company name'), name: "companyName", onChange: setCompanyName, showLabel: true, value: companyName }), jsx(TextField, { isDisabled: isLoading, label: t('Attention'), name: "attention", showLabel: true }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, isDisabled: isLoading, label: `${t('Address')} 1`, maxLength: 30, minLength: 3, name: "address1", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, label: `${t('Address')} 2`, maxLength: 30, minLength: 3, name: "address2", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, label: `${t('Address')} 3`, maxLength: 30, minLength: 3, name: "address3", showLabel: true }) }), jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('Postal Code'), maxLength: 10, minLength: 4, name: "postalCode", showLabel: true }), jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('City'), maxLength: 30, minLength: 3, name: "city", showLabel: true }), jsx("div", { className: styles['span-2'], children: jsx(CountrySelect, { isRequired: true, countries: countries, name: "country" }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('Phone'), name: "phone", showLabel: true, validate: value => {
43
+ }, children: [jsx(TextField, { isDisabled: isLoading, label: t('First name'), name: "firstName", showLabel: true }), jsx(TextField, { isDisabled: isLoading, isRequired: !companyName, label: t('Last name'), minLength: 3, name: "lastName", onChange: setLastName, showLabel: true, value: lastName }, `lastname-${Boolean(companyName)}`), jsx(TextField, { isDisabled: isLoading, label: t('Company name'), name: "companyName", onChange: setCompanyName, showLabel: true, value: companyName }), jsx(TextField, { isDisabled: isLoading, label: t('Attention'), name: "attention", showLabel: true }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, isDisabled: isLoading, label: `${t('Address')} 1`, maxLength: 30, minLength: 3, name: "address1", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, label: `${t('Address')} 2`, maxLength: 30, minLength: 3, name: "address2", showLabel: true }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, label: `${t('Address')} 3`, maxLength: 30, minLength: 3, name: "address3", showLabel: true }) }), jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('Postal Code'), maxLength: 10, minLength: 4, name: "postalCode", showLabel: true }), jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('City'), maxLength: 30, minLength: 3, name: "city", showLabel: true }), jsx("div", { className: styles['span-2'], children: jsx(CountrySelect, { isRequired: true, countries: countries, name: "country" }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isRequired: true, isDisabled: isLoading, label: t('Phone'), name: "phone", showLabel: true, validate: value => {
44
44
  if (!value)
45
45
  return value;
46
46
  return (validatePhone(value) || 'Vul een geldig telefoonnummer in');
@@ -48,7 +48,7 @@ function EditAddresses({ countries, isLoading, onSubmit, }) {
48
48
  if (!value)
49
49
  return value;
50
50
  return validateEmail(value) || 'Vul een geldig emailadres in';
51
- } }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, isMultiline: true, label: t('Add order notes'), name: "notes", rows: 3, showLabel: true }) })] })] }), jsxs("section", { className: styles['form-container'], children: [jsx(Heading, { className: styles['form-header'], size: "xs", tag: "h2", children: jsx(FormattedMessage, { id: "Shipping address" }) }), jsxs("div", { className: styles['use-invoice-checkbox'], children: [jsx(Checkbox, { isDisabled: true, isSelected: true, children: jsx(FormattedMessage, { id: "Use billing address" }) }), jsx(Tooltip, { text: t('Changing your address is currently not possible. Please contact customer support to change your address.') })] })] })] }));
51
+ } }) }), jsx("div", { className: styles['span-2'], children: jsx(TextField, { isDisabled: isLoading, isMultiline: true, label: t('Add order notes'), name: "notes", rows: 3, showLabel: true }) })] }) }) }), jsx(CheckoutPageSection, { title: jsx(FormattedMessage, { id: "Shipping address" }), children: jsx(CheckoutPageSectionContent, { children: jsxs("div", { className: styles['use-invoice-checkbox'], children: [jsx(Checkbox, { isDisabled: true, isSelected: true, children: jsx(FormattedMessage, { id: "Use billing address" }) }), jsx(Tooltip, { text: t('Changing your address is currently not possible. Please contact customer support to change your address.') })] }) }) })] }));
52
52
  }
53
53
 
54
54
  export { EDIT_ADDRESS_FORM_ID, EditAddresses };
@@ -0,0 +1,3 @@
1
+ var styles = {"form":"edit-address-module-oC1yA","span-2":"edit-address-module-7ANZQ","use-invoice-checkbox":"edit-address-module-QAPy-"};
2
+
3
+ export { styles as default };
@@ -1,4 +1,4 @@
1
- import { BillToModel, ShipToModel } from '../../../shared/api/storefront/model/storefront.model';
1
+ import { BillToModel, ShipToModel } from '../../../../shared/api/storefront/model/storefront.model';
2
2
  export declare function ReadOnlyAddresses({ billTo, isLoading, notes, onSubmit, shipTo, }: {
3
3
  billTo: BillToModel | undefined | null;
4
4
  isLoading: boolean;
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Form } from 'react-aria-components';
3
+ import { Address } from '../../../../address/address.js';
4
+ import { Checkbox } from '../../../../forms/checkbox/checkbox.js';
5
+ import { TextField } from '../../../../forms/text-field/text-field.js';
6
+ import { FormattedMessage } from '../../../../intl/formatted-message.js';
7
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
8
+ import { RouteLink } from '../../../../shared/routing/route-link.js';
9
+ import { CheckoutPageSection } from '../../layouts/checkout-page-layout/components/checkout-page-section.js';
10
+ import { CheckoutPageSectionContent } from '../../layouts/checkout-page-layout/components/checkout-page-section-content.js';
11
+ import { CheckoutPageSectionLink } from '../../layouts/checkout-page-layout/components/checkout-page-section-link.js';
12
+ import { EDIT_ADDRESS_FORM_ID } from './edit-address.js';
13
+ import styles from './readonly-address.module.css.js';
14
+
15
+ const ACCOUNT_ADDRESSES_PATH = '/MyAccount/Addresses';
16
+ function ReadOnlyAddresses({ billTo, isLoading, notes, onSubmit, shipTo, }) {
17
+ const t = useFormattedMessage();
18
+ return (jsxs(Form, { "data-test-selector": "billToAddressForm", id: EDIT_ADDRESS_FORM_ID, onSubmit: e => {
19
+ e.preventDefault();
20
+ const formData = new FormData(e.currentTarget);
21
+ onSubmit({
22
+ notes: formData.get('notes')?.toString() || '',
23
+ });
24
+ }, children: [jsxs(CheckoutPageSection, { title: jsx(FormattedMessage, { id: "Billing address" }), children: [jsx(CheckoutPageSectionLink, { children: jsxs(RouteLink, { color: "secondary", href: ACCOUNT_ADDRESSES_PATH, isDisabled: isLoading, children: [jsx(FormattedMessage, { id: "Edit billing address" }), " >"] }) }), jsxs(CheckoutPageSectionContent, { children: [billTo && (jsx(Address, { address1: billTo.address1, address2: billTo.address2, address3: billTo.address3, city: billTo.city, companyName: billTo.companyName, country: billTo.country?.name, email: billTo.email, firstName: billTo.firstName, lastName: billTo.lastName, phone: billTo.phone, postalCode: billTo.postalCode })), jsx("div", { className: styles.notes, children: jsx(TextField, { defaultValue: notes, isDisabled: isLoading, isMultiline: true, label: t('Add order notes'), name: "notes", rows: 3, showLabel: true }) })] })] }), jsxs(CheckoutPageSection, { title: jsx(FormattedMessage, { id: "Shipping address" }), children: [jsx(CheckoutPageSectionLink, { children: jsxs(RouteLink, { color: "secondary", href: ACCOUNT_ADDRESSES_PATH, isDisabled: isLoading, children: [jsx(FormattedMessage, { id: "Edit shipping address" }), " >"] }) }), jsxs(CheckoutPageSectionContent, { children: [jsx(Checkbox, { className: styles['use-invoice-checkbox'], isDisabled: true, isSelected: true, children: jsx(FormattedMessage, { id: "Use billing address" }) }), shipTo && (jsx(Address, { address1: shipTo.address1, address2: shipTo.address2, address3: shipTo.address3, city: shipTo.city, companyName: shipTo.companyName, country: shipTo.country?.name, email: shipTo.email, firstName: shipTo.firstName, lastName: shipTo.lastName, phone: shipTo.phone, postalCode: shipTo.postalCode }))] })] })] }));
25
+ }
26
+
27
+ export { ReadOnlyAddresses };
@@ -0,0 +1,3 @@
1
+ var styles = {"notes":"readonly-address-module-1hAQK","use-invoice-checkbox":"readonly-address-module-jMyJ-"};
2
+
3
+ export { styles as default };