@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
@@ -1,9 +1,9 @@
1
- import { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { Placement } from 'react-aria';
3
3
  export interface TooltipProps {
4
4
  offset?: number;
5
5
  placement?: Placement;
6
- text: string;
6
+ text: string | ReactNode;
7
7
  trigger?: ReactElement;
8
8
  }
9
9
  export declare function Tooltip({ offset, placement, text, trigger, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,11 @@
1
+ import { Breakpoint } from '../../shared/utils/breakpoints';
1
2
  export declare const SIZES: readonly ["xxl", "xl", "l", "m", "s", "xs", "xxs", "xxxs"];
2
3
  export declare const TAGS: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "h7"];
3
4
  type Size = (typeof SIZES)[number];
4
5
  type Tag = (typeof TAGS)[number];
5
- interface HeadingProps {
6
+ export interface HeadingProps {
6
7
  bold?: boolean;
8
+ breakpoints?: Partial<Record<Breakpoint, Size>>;
7
9
  children: React.ReactNode;
8
10
  className?: string;
9
11
  italic?: boolean;
@@ -11,7 +13,7 @@ interface HeadingProps {
11
13
  tag?: Tag;
12
14
  uppercase?: boolean;
13
15
  }
14
- export declare function Heading({ bold, children, className, italic, size, tag, uppercase, }: HeadingProps): React.ReactElement<{
16
+ export declare function Heading({ bold, breakpoints, children, className, italic, size, tag, uppercase, }: HeadingProps): React.ReactElement<{
15
17
  className: string;
16
18
  }, string | React.JSXElementConstructor<any>>;
17
19
  export {};
@@ -14,9 +14,10 @@ const sizeToTag = {
14
14
  xxs: 'h6',
15
15
  xxxs: 'h6',
16
16
  };
17
- function Heading({ bold = true, children, className, italic, size = 'xxl', tag, uppercase, }) {
17
+ function Heading({ bold = true, breakpoints, children, className, italic, size = 'xxl', tag, uppercase, }) {
18
18
  return createElement(tag || sizeToTag[size], {
19
- className: clsx(className, styles.heading, styles[size], {
19
+ className: clsx(className, styles.heading, styles[size], breakpoints &&
20
+ Object.entries(breakpoints).map(([breakpoint, bpSize]) => styles[`${breakpoint}-${bpSize}`]), {
20
21
  [styles.uppercase]: uppercase,
21
22
  [styles.italic]: italic,
22
23
  [styles.bold]: bold,
@@ -1,3 +1,3 @@
1
- var styles = {"heading":"heading-module-pMC65","uppercase":"heading-module-6spgX","italic":"heading-module-XXMDM","bold":"heading-module-xvrxo","xxl":"heading-module-Kn3ZN","xl":"heading-module--hZs-","l":"heading-module-WrJRY","m":"heading-module-hTexc","s":"heading-module-7W29m","xs":"heading-module-SgaLB","xxs":"heading-module-33en7","xxxs":"heading-module-qvrEk"};
1
+ var styles = {"heading":"heading-module-pMC65","uppercase":"heading-module-6spgX","italic":"heading-module-XXMDM","bold":"heading-module-xvrxo","xxl":"heading-module-Kn3ZN","xl":"heading-module--hZs-","l":"heading-module-WrJRY","m":"heading-module-hTexc","s":"heading-module-7W29m","xs":"heading-module-SgaLB","xxs":"heading-module-33en7","xxxs":"heading-module-qvrEk","sm-xxl":"heading-module-Q3y61","sm-xl":"heading-module-k5ODo","sm-l":"heading-module-45IqH","sm-m":"heading-module-X7un-","sm-s":"heading-module-EimRV","sm-xs":"heading-module-OCU2-","sm-xxs":"heading-module-Iey3i","sm-xxxs":"heading-module-HIlpl","md-xxl":"heading-module-5QOn5","md-xl":"heading-module-Yi-gr","md-l":"heading-module-Yv3Nk","md-m":"heading-module-rw6SX","md-s":"heading-module-w5E3X","md-xs":"heading-module-gS4KN","md-xxs":"heading-module-WP-gl","md-xxxs":"heading-module-mpKxt","lg-xxl":"heading-module-Jl0gk","lg-xl":"heading-module-JeBTR","lg-l":"heading-module-3dHjk","lg-m":"heading-module-TWKes","lg-s":"heading-module-Y4TBU","lg-xs":"heading-module-c7cii","lg-xxs":"heading-module-pzJ8y","lg-xxxs":"heading-module--tJ-O","xl-xxl":"heading-module-nWxkD","xl-xl":"heading-module-VXYJS","xl-l":"heading-module-ozpn6","xl-m":"heading-module-mYwNt","xl-s":"heading-module-Bthct","xl-xs":"heading-module-81BCe","xl-xxs":"heading-module-RjUW0","xl-xxxs":"heading-module-PlHnT","xxl-xxl":"heading-module-zl8KP","xxl-xl":"heading-module-zw3KX","xxl-l":"heading-module-76y37","xxl-m":"heading-module-Ucgfg","xxl-s":"heading-module-dOPjv","xxl-xs":"heading-module-Le9JC","xxl-xxs":"heading-module-9j-SM","xxl-xxxs":"heading-module-wOR6v"};
2
2
 
3
3
  export { styles as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "126.0.0",
3
+ "version": "128.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -1,3 +0,0 @@
1
- var styles = {"checkout-page-layout":"checkout-page-layout-module-54Qta","wrapper":"checkout-page-layout-module-itTHb","sticky-side":"checkout-page-layout-module-pV1P2","actions":"checkout-page-layout-module-xuXiO","top-actions":"checkout-page-layout-module-Nmktk","top-actions-sticky":"checkout-page-layout-module---Bqj"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"product-details-page-layout":"product-details-page-layout-module-YnHNa","top":"product-details-page-layout-module-bWVpu","image-gallery":"product-details-page-layout-module-EgqvM","product-information":"product-details-page-layout-module-Tu8s1","recently-viewed":"product-details-page-layout-module-9VKcH","included":"product-details-page-layout-module--tq0o","usp":"product-details-page-layout-module-xA4IZ"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"page":"page-module-XtZ9Y","breadcrumb":"page-module-ohh9z","title":"page-module-TEmve"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"page-container":"page-container-module-PYmbC","inner-page-container":"page-container-module-uD8GF"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"product-details-panel":"product-details-panel-module-kfhpL","heading":"product-details-panel-module--1ODE","price-action-container":"product-details-panel-module-CCcmA","action-container":"product-details-panel-module-1vyDM","description":"product-details-panel-module-GfTab","feature-list":"product-details-panel-module-ze0my"};
2
-
3
- export { styles as default };
@@ -1,22 +0,0 @@
1
- "use client";
2
- import { jsx } from 'react/jsx-runtime';
3
- import { useCultureCode } from '../../intl/use-culture-code.js';
4
- import { useFetchProductDetailsPageData } from '../../shared/api/bff/hooks/use-fetch-product-details-page-data.js';
5
- import { ErrorPage } from '../error-page/error-page.js';
6
- import { LoadingPage } from '../loading-page/loading-page.js';
7
- import { ProductDetails } from './product-details.js';
8
-
9
- function ProductDetailsPage({ pageUrl }) {
10
- const cultureCode = useCultureCode();
11
- const { data, error, isError, isFetching } = useFetchProductDetailsPageData({
12
- cultureCode,
13
- pageUrl,
14
- });
15
- if (isError)
16
- return jsx(ErrorPage, { error: error });
17
- if (!data || isFetching)
18
- return jsx(LoadingPage, {});
19
- return jsx(ProductDetails, { data: data });
20
- }
21
-
22
- export { ProductDetailsPage };
@@ -1,3 +0,0 @@
1
- var styles = {"no-results":"no-results-module-T1cti","title":"no-results-module-mZ8TQ","body":"no-results-module-FQGhC","buttons":"no-results-module-QGZsD"};
2
-
3
- export { styles as default };
@@ -1,29 +0,0 @@
1
- "use client";
2
- import { jsx } from 'react/jsx-runtime';
3
- import { createSonicSearchClient } from '../../algolia/algolia-sonic-searchclient.js';
4
- import { config } from '../../config.js';
5
- import { useCultureCode } from '../../intl/use-culture-code.js';
6
- import { useFetchProductListingPageData } from '../../shared/api/bff/hooks/use-fetch-product-listing-page-data.js';
7
- import { ErrorPage } from '../error-page/error-page.js';
8
- import { LoadingPage } from '../loading-page/loading-page.js';
9
- import { ProductListing } from './product-listing.js';
10
-
11
- const defaultSearchClient = createSonicSearchClient({
12
- apiKey: config.ALGOLIA_API_KEY,
13
- appId: config.ALGOLIA_APP_ID,
14
- host: config.ALGOLIA_HOST,
15
- });
16
- function ProductListingPage({ pageUrl, searchClient = defaultSearchClient, }) {
17
- const cultureCode = useCultureCode();
18
- const { data, error, isError, isFetching } = useFetchProductListingPageData({
19
- cultureCode,
20
- pageUrl,
21
- });
22
- if (isError)
23
- return jsx(ErrorPage, { error: error });
24
- if (!data || isFetching)
25
- return jsx(LoadingPage, {});
26
- return jsx(ProductListing, { data: data, searchClient: searchClient });
27
- }
28
-
29
- export { ProductListingPage };
@@ -1,3 +0,0 @@
1
- var styles = {"product-listing":"product-listing-page-module-dmIHF","header":"product-listing-page-module-Oz76Z","promos":"product-listing-page-module-iY1yj","action-bar":"product-listing-page-module-XxGrr","sidebar-toggle":"product-listing-page-module-F7bxy","sort":"product-listing-page-module-aQzHr","count":"product-listing-page-module-zx79v","categories":"product-listing-page-module-R4aOl","product-grid-container":"product-listing-page-module-ICkKg","product-grid":"product-listing-page-module-LHE7z","pagination":"product-listing-page-module-xsRaj"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"search-results":"search-results-page-module-M7SIu","header":"search-results-page-module-DpNT-","action-bar":"search-results-page-module-RJoMk","sidebar-toggle":"search-results-page-module-SzLQb","sort":"search-results-page-module-cgonp","count":"search-results-page-module-hunZp","categories":"search-results-page-module-n2lSj","product-grid-container":"search-results-page-module-TK-iE","product-grid":"search-results-page-module-HWUnk","pagination":"search-results-page-module-SZYiA"};
2
-
3
- export { styles as default };
@@ -1,3 +0,0 @@
1
- var styles = {"form-container":"edit-address-module-dphSX","form-header":"edit-address-module-8FyLR","form":"edit-address-module-dtGk5","span-2":"edit-address-module-HVdsP","use-invoice-checkbox":"edit-address-module-H8hM-"};
2
-
3
- export { styles as default };
@@ -1,25 +0,0 @@
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 { Heading } from '../../../typography/heading/heading.js';
10
- import { EDIT_ADDRESS_FORM_ID } from './edit-address.js';
11
- import styles from './readonly-address.module.css.js';
12
-
13
- const ACCOUNT_ADDRESSES_PATH = '/MyAccount/Addresses';
14
- function ReadOnlyAddresses({ billTo, isLoading, notes, onSubmit, shipTo, }) {
15
- const t = useFormattedMessage();
16
- return (jsxs(Form, { className: styles.form, id: EDIT_ADDRESS_FORM_ID, onSubmit: e => {
17
- e.preventDefault();
18
- const formData = new FormData(e.currentTarget);
19
- onSubmit({
20
- notes: formData.get('notes')?.toString() || '',
21
- });
22
- }, children: [jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xs", tag: "h2", children: jsx(FormattedMessage, { id: "Billing address" }) }), jsxs(RouteLink, { className: styles['section-link'], color: "secondary", href: ACCOUNT_ADDRESSES_PATH, isDisabled: isLoading, children: [jsx(FormattedMessage, { id: "Edit billing address" }), " >"] }), jsxs("div", { className: styles['section-content'], children: [billTo && (jsx(Address, { city: billTo.city, companyName: billTo.companyName, country: billTo.country?.name, email: billTo.email, 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("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xs", tag: "h2", children: jsx(FormattedMessage, { id: "Shipping address" }) }), jsxs(RouteLink, { className: styles['section-link'], color: "secondary", href: ACCOUNT_ADDRESSES_PATH, isDisabled: isLoading, children: [jsx(FormattedMessage, { id: "Edit shipping address" }), " >"] }), jsxs("div", { className: styles['section-content'], children: [jsx(Checkbox, { className: styles['use-invoice-checkbox'], isDisabled: true, isSelected: true, children: jsx(FormattedMessage, { id: "Use billing address" }) }), shipTo && (jsx(Address, { city: shipTo.city, companyName: shipTo.companyName, country: shipTo.country?.name, email: shipTo.email, phone: shipTo.phone, postalCode: shipTo.postalCode }))] })] })] }));
23
- }
24
-
25
- export { ReadOnlyAddresses };
@@ -1,3 +0,0 @@
1
- var styles = {"section":"readonly-address-module-86tan","section-header":"readonly-address-module-VLsk2","section-content":"readonly-address-module-84Ake","section-link":"readonly-address-module-rxXHA","notes":"readonly-address-module-mhW4y","use-invoice-checkbox":"readonly-address-module-qgm1D"};
2
-
3
- export { styles as default };
@@ -1,75 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useEffect } from 'react';
3
- import { Button } from '../../buttons/button/button.js';
4
- import { CartTotals } from '../../cart-totals/cart-totals.js';
5
- import { CartTotalsSummary } from '../../cart-totals/cart-totals-summary.js';
6
- import { FormattedMessage } from '../../intl/formatted-message.js';
7
- import { useFormattedMessage } from '../../intl/use-formatted-message.js';
8
- import { useFetchCurrentCart } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart.js';
9
- import { usePatchCart } from '../../shared/api/storefront/hooks/cart/use-patch-cart.js';
10
- import { usePatchBillToAddress } from '../../shared/api/storefront/hooks/customer/use-patch-bill-to-address.js';
11
- import { useFetchCountries } from '../../shared/api/storefront/hooks/website/use-fetch-countries.js';
12
- import { useNavigate } from '../../shared/routing/route-provider.js';
13
- import { ErrorPage } from '../error-page/error-page.js';
14
- import { CheckoutPageLayout } from '../layouts/checkout-page-layout/checkout-page-layout.js';
15
- import { LoadingPage } from '../loading-page/loading-page.js';
16
- import { Page } from '../page/page.js';
17
- import { EDIT_ADDRESS_FORM_ID, EditAddresses } from './components/edit-address.js';
18
- import { ReadOnlyAddresses } from './components/readonly-address.js';
19
- import styles from './shipping-page.module.css.js';
20
-
21
- const REVIEW_AND_SUBMIT_PATH = '/CheckoutReviewAndSubmit';
22
- function ShippingPage() {
23
- const { data: cart, error, isLoading: isLoadingCart } = useFetchCurrentCart();
24
- const hasCart = Boolean(cart);
25
- const hasBillTo = Boolean(cart?.billTo);
26
- const hasEmptyBillTo = Boolean(cart?.billTo?.address1);
27
- const { data: countries, isLoading: isLoadingCountries } = useFetchCountries({
28
- enabled: !hasEmptyBillTo,
29
- });
30
- const { isLoading: isPatchBillToAddress, mutate: patchBillToAddress } = usePatchBillToAddress();
31
- const { isLoading: isPatchingCart, mutate: patchCart } = usePatchCart();
32
- const t = useFormattedMessage();
33
- const isLoading = isLoadingCart || isLoadingCountries;
34
- const isPatching = isPatchBillToAddress || isPatchingCart;
35
- const navigate = useNavigate();
36
- useEffect(() => {
37
- if (hasCart && !hasBillTo)
38
- navigate('/sign-in?returnUrl=/CheckoutShipping');
39
- }, [hasCart, hasBillTo, navigate]);
40
- if (error)
41
- return jsx(ErrorPage, { error: error });
42
- if (isLoading)
43
- return jsx(LoadingPage, {});
44
- if (!cart || (!hasEmptyBillTo && !countries))
45
- return null;
46
- if (!hasBillTo) {
47
- return (jsx(Page, { breadCrumb: [
48
- { href: '/', label: t('Home') },
49
- { href: '/CheckoutShipping', label: t('Shipping details') },
50
- ], children: jsx("h1", { children: jsx(FormattedMessage, { id: "Please Sign In" }) }) }));
51
- }
52
- return (jsx(Page, { breadCrumb: [
53
- { href: '/', label: t('Home') },
54
- { href: '/CheckoutShipping', label: t('Shipping details') },
55
- ], title: t('Shipping details'), children: jsx(CheckoutPageLayout, { actions: {
56
- primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutShippingCartTotalContinueButton", form: EDIT_ADDRESS_FORM_ID, isDisabled: isPatching, isLoading: isPatching && jsx(FormattedMessage, { id: "Continue shopping" }), type: "submit", children: jsx(FormattedMessage, { id: "Continue shopping" }) })),
57
- }, mobileSummary: jsx(CartTotalsSummary, { totalAmount: cart.orderGrandTotalDisplay }), overview: jsx(CartTotals, { shippingCost: cart.shippingAndHandlingDisplay, subtotal: cart.orderSubTotalDisplay, tax: cart.totalTaxDisplay, total: cart.orderGrandTotalDisplay, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: jsx("div", { className: styles['main-content'], children: hasEmptyBillTo ? (jsx(ReadOnlyAddresses, { billTo: cart.billTo, isLoading: isPatching, notes: cart.notes, onSubmit: async ({ notes }) => {
58
- if (!cart.billTo)
59
- return;
60
- await patchCart({ cart: { ...cart, notes } });
61
- navigate(REVIEW_AND_SUBMIT_PATH);
62
- }, shipTo: cart.shipTo })) : (jsx(EditAddresses, { countries: countries || [], isLoading: isPatching, onSubmit: async ({ address, notes }) => {
63
- if (!cart.billTo)
64
- return;
65
- await Promise.all([
66
- patchBillToAddress({
67
- billTo: { ...cart.billTo, ...address },
68
- }),
69
- patchCart({ cart: { ...cart, notes } }),
70
- ]);
71
- navigate(REVIEW_AND_SUBMIT_PATH);
72
- } })) }) }) }));
73
- }
74
-
75
- export { ShippingPage };
@@ -1,3 +0,0 @@
1
- var styles = {"main-content":"shipping-page-module-vmV0t"};
2
-
3
- export { styles as default };