@sonic-equipment/ui 131.0.0 → 133.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 (89) hide show
  1. package/dist/address/address.d.ts +2 -13
  2. package/dist/buttons/add-to-cart-button/add-to-cart-button.js +1 -1
  3. package/dist/buttons/add-to-cart-button/connected-add-to-cart-button.js +1 -1
  4. package/dist/buttons/button/button.js +2 -1
  5. package/dist/cart-totals/cart-totals.d.ts +2 -1
  6. package/dist/cart-totals/cart-totals.js +2 -2
  7. package/dist/delivery-time/delivery-time.js +6 -5
  8. package/dist/display/info-display/info-display.d.ts +7 -0
  9. package/dist/display/info-display/info-display.js +8 -0
  10. package/dist/display/info-display/info-display.module.css.js +3 -0
  11. package/dist/exports.d.ts +13 -5
  12. package/dist/forms/input/input.d.ts +1 -0
  13. package/dist/forms/input/input.js +5 -3
  14. package/dist/forms/input/input.module.css.js +1 -1
  15. package/dist/forms/switch/switch.d.ts +2 -1
  16. package/dist/forms/switch/switch.js +2 -2
  17. package/dist/forms/text-field/password-reveal-toggle/password-reveal-toggle.d.ts +10 -0
  18. package/dist/forms/text-field/password-reveal-toggle/password-reveal-toggle.js +18 -0
  19. package/dist/forms/text-field/password-reveal-toggle/password-reveal-toggle.module.css.js +3 -0
  20. package/dist/forms/text-field/text-field.d.ts +3 -3
  21. package/dist/forms/text-field/text-field.js +9 -2
  22. package/dist/icons/stroke/stroke-dehashed-icon.js +7 -0
  23. package/dist/icons/stroke/stroke-hashed-icon.js +7 -0
  24. package/dist/index.js +14 -6
  25. package/dist/intl/translation-id.d.ts +1 -1
  26. package/dist/pages/checkout/cart-page/cart-page.js +6 -9
  27. package/dist/pages/checkout/cart-page/components/empty-cart-page.d.ts +1 -0
  28. package/dist/pages/checkout/cart-page/components/empty-cart-page.js +11 -0
  29. package/dist/pages/checkout/components/billing-and-invoice-information.d.ts +7 -0
  30. package/dist/pages/checkout/components/billing-and-invoice-information.js +12 -0
  31. package/dist/pages/checkout/components/billing-and-invoice-information.module.css.js +3 -0
  32. package/dist/pages/checkout/constants.d.ts +8 -0
  33. package/dist/pages/checkout/constants.js +10 -0
  34. package/dist/pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.module.css.js +1 -1
  35. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.d.ts +4 -0
  36. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.js +115 -0
  37. package/dist/pages/checkout/order-confirmation-page/order-confirmation-page.module.css.js +3 -0
  38. package/dist/{checkout → pages/checkout/payment-page/components}/adyen-payment.js +5 -5
  39. package/dist/pages/checkout/payment-page/components/adyen-payment.module.css.js +3 -0
  40. package/dist/{checkout → pages/checkout/payment-page/components}/payment.d.ts +4 -2
  41. package/dist/pages/checkout/payment-page/components/payment.js +243 -0
  42. package/dist/pages/checkout/payment-page/components/payment.module.css.js +3 -0
  43. package/dist/pages/checkout/payment-page/payment-page.js +18 -11
  44. package/dist/{checkout → pages/checkout/payment-page/utils}/parse-amount.js +1 -1
  45. package/dist/pages/checkout/shipping-page/components/edit-address.js +8 -4
  46. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.d.ts +12 -0
  47. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +21 -0
  48. package/dist/pages/checkout/shipping-page/shipping-page.js +45 -59
  49. package/dist/pages/checkout/shipping-page/shipping-page.module.css.js +1 -1
  50. package/dist/pages/components/page/page.d.ts +3 -2
  51. package/dist/pages/components/page/page.js +3 -2
  52. package/dist/pages/components/page-meta-data/page-meta-data.d.ts +3 -4
  53. package/dist/pages/components/page-meta-data/page-meta-data.js +2 -2
  54. package/dist/pages/product/product-details-page/product-details-page.js +2 -10
  55. package/dist/pages/product/product-details-page/product-details.js +10 -4
  56. package/dist/pages/product/product-listing-page/product-listing-page-data-types.d.ts +1 -1
  57. package/dist/pages/product/product-listing-page/product-listing-page.js +2 -10
  58. package/dist/pages/product/product-listing-page/product-listing.js +8 -1
  59. package/dist/pages/product/search-result-page/search-results-page.js +4 -7
  60. package/dist/shared/api/bff/model/bff.model.d.ts +4 -4
  61. package/dist/shared/api/bff/services/bff-service.js +1 -4
  62. package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.d.ts +8 -0
  63. package/dist/shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js +20 -0
  64. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.d.ts +1 -1
  65. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +3 -3
  66. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.d.ts +2 -5
  67. package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +3 -16
  68. package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +11 -8
  69. package/dist/shared/api/storefront/hooks/cart/use-place-order.js +2 -2
  70. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.d.ts +3 -1
  71. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.js +3 -1
  72. package/dist/shared/ga/use-data-layer.js +1 -1
  73. package/dist/shared/model/address.d.ts +13 -0
  74. package/dist/shared/providers/react-query-container.d.ts +2 -1
  75. package/dist/shared/providers/react-query-container.js +2 -2
  76. package/dist/shared/utils/date.d.ts +2 -0
  77. package/dist/shared/utils/date.js +11 -1
  78. package/dist/styles.css +331 -261
  79. package/dist/tooltip/tooltip.js +10 -5
  80. package/package.json +4 -5
  81. package/dist/checkout/adyen-payment.module.css.js +0 -3
  82. package/dist/checkout/payment.js +0 -186
  83. package/dist/checkout/payment.module.css.js +0 -3
  84. /package/dist/{checkout → pages/checkout/payment-page/components}/adyen-payment.d.ts +0 -0
  85. /package/dist/{checkout → pages/checkout/payment-page/hooks}/use-get-adyen-redirect-result.d.ts +0 -0
  86. /package/dist/{checkout → pages/checkout/payment-page/hooks}/use-get-adyen-redirect-result.js +0 -0
  87. /package/dist/{checkout → pages/checkout/payment-page/hooks}/use-has-returned-from-adyen.d.ts +0 -0
  88. /package/dist/{checkout → pages/checkout/payment-page/hooks}/use-has-returned-from-adyen.js +0 -0
  89. /package/dist/{checkout → pages/checkout/payment-page/utils}/parse-amount.d.ts +0 -0
@@ -1,14 +1,3 @@
1
- export interface AddressProps {
2
- address1?: string;
3
- address2?: string;
4
- address3?: string;
5
- city?: string;
6
- companyName?: string;
7
- country?: string;
8
- email?: string;
9
- firstName?: string;
10
- lastName?: string;
11
- phone?: string;
12
- postalCode?: string;
13
- }
1
+ import { AddressType } from '../shared/model/address';
2
+ export type AddressProps = AddressType;
14
3
  export declare function Address({ address1, address2, address3, city, companyName, country, email, firstName, lastName, phone, postalCode, }: AddressProps): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ import { Button } from '../button/button.js';
8
8
  import styles from './add-to-cart-button.module.css.js';
9
9
 
10
10
  function AddToCartButton({ initialState = 'initial', isDisabled = false, onChange, quantity, }) {
11
- const [currentState, setState] = useState(initialState);
11
+ const [currentState, setState] = useState(quantity > 0 ? 'spinner' : initialState);
12
12
  const [manualInputQuantity, setManualInputQuantity] = useState(null);
13
13
  useEffect(() => {
14
14
  setState(currentState => {
@@ -13,7 +13,7 @@ import { AddToCartButton } from './add-to-cart-button.js';
13
13
  const ConnectedAddToCartButton = ({ onAddToCart, productId }) => {
14
14
  const { createEcommerceEvent, dataLayer } = useDataLayer();
15
15
  const { isPending: isPendingAddToCart, mutate: addToCart } = useAddProductToCurrentCart();
16
- const { data: cartLines, isLoading: isLoadingCartLines } = useFetchCurrentCartLines();
16
+ const { data: cartLines, isFetching: isLoadingCartLines } = useFetchCurrentCartLines();
17
17
  const { isPending: isPendingDeleteCartLine, mutate: deleteCartLine } = useDeleteCartLineById();
18
18
  const { mutate: updateCartLine } = usePatchCartLineById();
19
19
  const { addToast } = useToast();
@@ -9,6 +9,7 @@ import buttonStyles from './button.module.css.js';
9
9
  function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, 'data-test-selector': dataTestSelector, form, icon, iconPosition = 'left', isDisabled, isLoading = false, onClick: _onClick, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
10
10
  const showIconOnLeft = icon && iconPosition === 'left';
11
11
  const showIconOnRight = icon && iconPosition === 'right';
12
+ const iconElement = icon && jsx("span", { className: buttonStyles.icon, children: icon });
12
13
  const onClick = (e) => {
13
14
  if (_onClick)
14
15
  _onClick(e);
@@ -20,7 +21,7 @@ function Button({ _pseudo = 'none', children, className, color = 'primary', cond
20
21
  return (jsx("button", { className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, { [buttonStyles['loading-uninformative']]: isLoading === true }, {
21
22
  [buttonStyles['loading-informative']]: isLoading &&
22
23
  (typeof isLoading === 'string' || isValidElement(isLoading)),
23
- }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, disabled: isDisabled, form: form, onClick: onClick, type: type, children: jsxs(Fragment, { children: [showIconOnLeft && jsx("span", { className: buttonStyles.icon, children: icon }), jsx("span", { className: buttonStyles.children, children: isLoading ? (isLoading === true ? children : isLoading) : children }), withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && jsx("span", { className: buttonStyles.icon, children: icon }), isLoading && (jsx(ProgressCircle, { className: buttonStyles.spinner, size: "sm", variant: color === 'primary' ? 'white' : 'gray' }))] }) }));
24
+ }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), "data-disabled": isDisabled ? true : undefined, "data-test-selector": dataTestSelector, disabled: isDisabled, form: form, onClick: onClick, type: type, children: jsxs(Fragment, { children: [showIconOnLeft && iconElement, jsx("span", { className: buttonStyles.children, children: isLoading ? (isLoading === true ? children : isLoading) : children }), withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && iconElement, isLoading && (jsx(ProgressCircle, { className: buttonStyles.spinner, size: "sm", variant: color === 'primary' ? 'white' : 'gray' }))] }) }));
24
25
  }
25
26
 
26
27
  export { Button };
@@ -1,6 +1,7 @@
1
1
  export interface CartTotalsProps {
2
2
  deliveryDate?: string;
3
3
  fulfillmentMethod?: string;
4
+ isPayByInvoice?: boolean;
4
5
  orderNumber?: string;
5
6
  shippingCost: string;
6
7
  subtotal: string;
@@ -9,4 +10,4 @@ export interface CartTotalsProps {
9
10
  vatPercentage: number | undefined;
10
11
  }
11
12
  export declare const formatDisplayPriceToSymbolSpaceValue: (displayPrice: string) => string;
12
- export declare function CartTotals({ deliveryDate, fulfillmentMethod, orderNumber, shippingCost, subtotal, tax, total, vatPercentage, }: CartTotalsProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function CartTotals({ deliveryDate, fulfillmentMethod, isPayByInvoice, orderNumber, shippingCost, subtotal, tax, total, vatPercentage, }: CartTotalsProps): import("react/jsx-runtime").JSX.Element;
@@ -5,9 +5,9 @@ import { Heading } from '../typography/heading/heading.js';
5
5
  import styles from './cart-totals.module.css.js';
6
6
 
7
7
  const formatDisplayPriceToSymbolSpaceValue = (displayPrice) => displayPrice.replace(/^(\D)([\d,.]*$)/, (_, symbol, value) => `${symbol} ${value}`);
8
- function CartTotals({ deliveryDate, fulfillmentMethod, orderNumber, shippingCost, subtotal, tax, total, vatPercentage, }) {
8
+ function CartTotals({ deliveryDate, fulfillmentMethod, isPayByInvoice, orderNumber, shippingCost, subtotal, tax, total, vatPercentage, }) {
9
9
  const t = useFormattedMessage();
10
- return (jsxs("div", { className: styles['cart-totals'], children: [orderNumber && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Order number" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "orderConfirmation_orderNumber", children: orderNumber }) }) })] })), deliveryDate !== undefined && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Delivery date" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "deliveryDate", children: deliveryDate || t('As soon as possible') }) }) })] })), fulfillmentMethod && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Fulfillment method" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "fulfillmentMethod", children: fulfillmentMethod }) }) })] })), jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Cost overview" }) }), jsxs("div", { children: [jsxs("div", { className: styles.line, children: [jsxs("p", { className: styles.label, children: [jsx(FormattedMessage, { id: "Subtotal" }), ' ', jsx(FormattedMessage, { id: "Excl. VAT" })] }), jsx("p", { className: styles.value, "data-test-selector": "cartTotal_subTotal", children: formatDisplayPriceToSymbolSpaceValue(subtotal) })] }), jsxs("div", { className: styles.line, children: [jsx("p", { className: styles.label, children: jsx(FormattedMessage, { id: "Shipping and handling" }) }), jsx("p", { className: styles.value, "data-test-selector": "shippingCost", children: formatDisplayPriceToSymbolSpaceValue(shippingCost) })] }), jsxs("div", { className: styles.line, children: [jsxs("p", { className: styles.label, children: [jsx(FormattedMessage, { id: "VAT" }), ' ', vatPercentage ? `${vatPercentage}%` : ''] }), jsx("p", { className: styles.value, "data-test-selector": "vatAmount", children: formatDisplayPriceToSymbolSpaceValue(tax) })] })] })] }), jsx("section", { className: styles.totals, children: jsxs("div", { className: styles.line, children: [jsx("p", { className: styles.label, children: jsx(FormattedMessage, { id: "Total" }) }), jsx("p", { className: styles.value, "data-test-selector": "cartTotal_orderGrandTotalDisplay", children: formatDisplayPriceToSymbolSpaceValue(total) })] }) })] }));
10
+ return (jsxs("div", { className: styles['cart-totals'], children: [orderNumber && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Order number" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "orderConfirmation_orderNumber", children: orderNumber }) }) })] })), deliveryDate !== undefined && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Delivery date" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "deliveryDate", children: deliveryDate || t('As soon as possible') }) }) })] })), fulfillmentMethod && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Fulfillment method" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "fulfillmentMethod", children: fulfillmentMethod }) }) })] })), isPayByInvoice && (jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Payment method" }) }), jsx("div", { children: jsx("div", { className: styles.line, children: jsx("p", { className: styles.label, "data-test-selector": "paymentMethod", children: jsx(FormattedMessage, { id: "Pay by invoice" }) }) }) })] })), jsxs("section", { className: styles.section, children: [jsx(Heading, { className: styles['section-header'], size: "xxxs", tag: "h3", children: jsx(FormattedMessage, { id: "Cost overview" }) }), jsxs("div", { children: [jsxs("div", { className: styles.line, children: [jsxs("p", { className: styles.label, children: [jsx(FormattedMessage, { id: "Subtotal" }), ' ', jsx(FormattedMessage, { id: "Excl. VAT" })] }), jsx("p", { className: styles.value, "data-test-selector": "cartTotal_subTotal", children: formatDisplayPriceToSymbolSpaceValue(subtotal) })] }), jsxs("div", { className: styles.line, children: [jsx("p", { className: styles.label, children: jsx(FormattedMessage, { id: "Shipping and handling" }) }), jsx("p", { className: styles.value, "data-test-selector": "shippingCost", children: formatDisplayPriceToSymbolSpaceValue(shippingCost) })] }), jsxs("div", { className: styles.line, children: [jsxs("p", { className: styles.label, children: [jsx(FormattedMessage, { id: "VAT" }), ' ', vatPercentage ? `${vatPercentage}%` : ''] }), jsx("p", { className: styles.value, "data-test-selector": "vatAmount", children: formatDisplayPriceToSymbolSpaceValue(tax) })] })] })] }), jsx("section", { className: styles.totals, children: jsxs("div", { className: styles.line, children: [jsx("p", { className: styles.label, children: jsx(FormattedMessage, { id: "Total" }) }), jsx("p", { className: styles.value, "data-test-selector": "cartTotal_orderGrandTotalDisplay", children: formatDisplayPriceToSymbolSpaceValue(total) })] }) })] }));
11
11
  }
12
12
 
13
13
  export { CartTotals, formatDisplayPriceToSymbolSpaceValue };
@@ -1,18 +1,19 @@
1
1
  "use client";
2
- import { jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import clsx from 'clsx';
4
4
  import { FormattedMessage } from '../intl/formatted-message.js';
5
5
  import { useFormattedMessage } from '../intl/use-formatted-message.js';
6
6
  import { getDateUnitObject } from '../shared/utils/date.js';
7
+ import { Tooltip } from '../tooltip/tooltip.js';
7
8
  import styles from './delivery-time.module.css.js';
8
9
 
9
10
  function DeliveryTime({ className, deliveryDate }) {
10
11
  const t = useFormattedMessage();
11
12
  const { number, unit } = getDateUnitObject(deliveryDate);
12
- return (jsx("p", { className: clsx(styles['delivery-time'], className), children: jsx(FormattedMessage, { id: "Delivery expected in {0} {1}", replacementValues: {
13
- '0': number.toString(),
14
- '1': t.pluralize('unit', unit, number),
15
- } }) }));
13
+ return (jsxs("div", { className: clsx(styles['delivery-time'], className), children: [jsx("p", { children: jsx(FormattedMessage, { id: "Delivery expected in {0} {1}", replacementValues: {
14
+ '0': number.toString(),
15
+ '1': t.pluralize('unit', unit, number),
16
+ } }) }), jsx(Tooltip, { text: t('The expected delivery is an indication based on the product availability and the shipping location.') })] }));
16
17
  }
17
18
 
18
19
  export { DeliveryTime };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export interface InfoDisplayProps {
3
+ id: string;
4
+ label: string;
5
+ value: string | ReactNode;
6
+ }
7
+ export declare function InfoDisplay({ id, label, value }: InfoDisplayProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import styles from './info-display.module.css.js';
3
+
4
+ function InfoDisplay({ id, label, value }) {
5
+ return (jsxs("div", { className: styles['info-display'], children: [jsx("span", { className: styles.label, id: id, children: label }), typeof value === 'string' ? (jsx("p", { "aria-labelledby": id, className: styles.value, children: value })) : (jsx("div", { "aria-labelledby": id, children: value }))] }));
6
+ }
7
+
8
+ export { InfoDisplay };
@@ -0,0 +1,3 @@
1
+ var styles = {"info-display":"info-display-module-jsSU0","label":"info-display-module-aGbJV","value":"info-display-module-bzl9Y"};
2
+
3
+ export { styles as default };
package/dist/exports.d.ts CHANGED
@@ -56,11 +56,6 @@ export * from './carousel/usp-carousel/product-usp-carousel-slide';
56
56
  export * from './carousel/usp-carousel/usp-carousel';
57
57
  export * from './cart-totals/cart-totals';
58
58
  export * from './cart-totals/cart-totals-summary';
59
- export * from './checkout/adyen-payment';
60
- export * from './checkout/parse-amount';
61
- export * from './checkout/payment';
62
- export * from './checkout/use-get-adyen-redirect-result';
63
- export * from './checkout/use-has-returned-from-adyen';
64
59
  export * from './collapsables/accordion/accordion';
65
60
  export * from './collapsables/accordion/accordion-item';
66
61
  export * from './collapsables/show-all/show-all';
@@ -71,6 +66,7 @@ export * from './country-selector/country-selector-dialog/country-selector-dialo
71
66
  export * from './country-selector/country-selector-trigger/country-selector-trigger';
72
67
  export * from './country-selector/use-countries-languages';
73
68
  export * from './delivery-time/delivery-time';
69
+ export * from './display/info-display/info-display';
74
70
  export * from './display/product-price/product-price';
75
71
  export * from './display/product-price/product-total-price';
76
72
  export * from './display/product-sku/product-sku';
@@ -85,6 +81,7 @@ export * from './forms/label/label';
85
81
  export * from './forms/number-field/number-field';
86
82
  export * from './forms/select/select';
87
83
  export * from './forms/switch/switch';
84
+ export * from './forms/text-field/password-reveal-toggle/password-reveal-toggle';
88
85
  export * from './forms/text-field/text-field';
89
86
  export * from './forms/textarea/textarea';
90
87
  export * from './global-search/categories-grid/categories-grid';
@@ -143,15 +140,25 @@ export * from './notifications/announcements/announcement-provider';
143
140
  export * from './notifications/announcements/connected-announcement';
144
141
  export * from './observers/intersection-observer';
145
142
  export * from './pages/checkout/cart-page/cart-page';
143
+ export * from './pages/checkout/cart-page/components/empty-cart-page';
144
+ export * from './pages/checkout/components/billing-and-invoice-information';
145
+ export * from './pages/checkout/constants';
146
146
  export * from './pages/checkout/layouts/checkout-page-layout/checkout-page-layout';
147
147
  export * from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section';
148
148
  export * from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content';
149
149
  export * from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header';
150
150
  export * from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link';
151
+ export * from './pages/checkout/order-confirmation-page/order-confirmation-page';
152
+ export * from './pages/checkout/payment-page/components/adyen-payment';
153
+ export * from './pages/checkout/payment-page/components/payment';
154
+ export * from './pages/checkout/payment-page/hooks/use-get-adyen-redirect-result';
155
+ export * from './pages/checkout/payment-page/hooks/use-has-returned-from-adyen';
151
156
  export * from './pages/checkout/payment-page/payment-page';
157
+ export * from './pages/checkout/payment-page/utils/parse-amount';
152
158
  export * from './pages/checkout/shipping-page/components/edit-address';
153
159
  export * from './pages/checkout/shipping-page/components/readonly-address';
154
160
  export * from './pages/checkout/shipping-page/components/sonic-address';
161
+ export * from './pages/checkout/shipping-page/hooks/use-patch-shipping-details';
155
162
  export * from './pages/checkout/shipping-page/shipping-page';
156
163
  export * from './pages/components/page-container/page-container';
157
164
  export * from './pages/components/page-meta-data/page-meta-data';
@@ -193,6 +200,7 @@ export * from './shared/api/storefront/hooks/authentication/use-sign-out';
193
200
  export * from './shared/api/storefront/hooks/cart/use-add-product-to-current-cart';
194
201
  export * from './shared/api/storefront/hooks/cart/use-delete-cart-line-by-id';
195
202
  export * from './shared/api/storefront/hooks/cart/use-delete-current-cart';
203
+ export * from './shared/api/storefront/hooks/cart/use-fetch-cart-by-id';
196
204
  export * from './shared/api/storefront/hooks/cart/use-fetch-current-cart';
197
205
  export * from './shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp';
198
206
  export * from './shared/api/storefront/hooks/cart/use-fetch-current-cart-count';
@@ -3,6 +3,7 @@ import { Input as AriaInput } from 'react-aria-components';
3
3
  export interface InputProps extends Omit<ComponentProps<typeof AriaInput>, 'size'> {
4
4
  _pseudo?: 'focus' | 'none';
5
5
  autoGrow?: boolean;
6
+ inlineElement?: React.ReactNode;
6
7
  label: string;
7
8
  size?: 'md' | 'lg';
8
9
  value?: string | number;
@@ -9,7 +9,7 @@ import styles from './input.module.css.js';
9
9
  * This component is used to create an input that grows as the user types.
10
10
  * It uses a shadow input to calculate the width of the input.
11
11
  */
12
- const Input = forwardRef(({ _pseudo = 'none', autoGrow, label, size = 'lg', ...inputProps }, inputRef) => {
12
+ const Input = forwardRef(({ _pseudo = 'none', autoGrow, inlineElement, label, size = 'lg', ...inputProps }, inputRef) => {
13
13
  const [props, ref] = useContextProps(inputProps, inputRef, InputContext);
14
14
  const { defaultValue, onChange, value: controlledValue } = props;
15
15
  const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
@@ -18,11 +18,13 @@ const Input = forwardRef(({ _pseudo = 'none', autoGrow, label, size = 'lg', ...i
18
18
  const handleChange = (event) => isControlled
19
19
  ? onChange?.(event)
20
20
  : setUncontrolledValue(event.target.value);
21
- return (jsx("div", { className: clsx(styles['input-container'], styles[size], styles[_pseudo]), children: jsxs("div", { className: clsx({ [styles['growing-input']]: autoGrow }), children: [jsx(Input$1, { "aria-label": label, size: autoGrow ? 1 : undefined, ...props, ref: ref, onChange: handleChange, onClick: e => {
21
+ return (jsx("div", { className: clsx(styles['input-container'], styles[size], styles[_pseudo]), children: jsxs("div", { className: clsx(styles.input, {
22
+ [styles['growing-input']]: autoGrow,
23
+ }), children: [jsx(Input$1, { "aria-label": label, size: autoGrow ? 1 : undefined, ...props, ref: ref, onChange: handleChange, onClick: e => {
22
24
  e.preventDefault();
23
25
  e.stopPropagation();
24
26
  e.target.focus();
25
- } }), autoGrow && jsx("span", { className: styles['shadow-input'], children: value })] }) }));
27
+ } }), inlineElement && (jsx("div", { className: styles['inline-element'], children: inlineElement })), autoGrow && jsx("span", { className: styles['shadow-input'], children: value })] }) }));
26
28
  });
27
29
  Input.displayName = 'Input';
28
30
 
@@ -1,3 +1,3 @@
1
- var styles = {"input-container":"input-module-2woJR","shadow-input":"input-module-pNKEt","lg":"input-module-Dx2qC","md":"input-module-sH6e7","focus":"input-module-hEEuy","growing-input":"input-module-6HwY4"};
1
+ var styles = {"input-container":"input-module-2woJR","shadow-input":"input-module-pNKEt","lg":"input-module-Dx2qC","md":"input-module-sH6e7","focus":"input-module-hEEuy","growing-input":"input-module-6HwY4","inline-element":"input-module-oeAz2","input":"input-module-zjVxG"};
2
2
 
3
3
  export { styles as default };
@@ -4,9 +4,10 @@ export interface SwitchProps {
4
4
  children?: ReactNode;
5
5
  className?: string;
6
6
  'data-test-selector'?: string;
7
+ defaultSelected?: boolean;
7
8
  isDisabled?: boolean;
8
9
  isSelected?: boolean;
9
10
  onChange?: (isSelected: boolean) => void;
10
11
  value?: string;
11
12
  }
12
- export declare function Switch({ _pseudo, children, className, 'data-test-selector': dataTestSelector, isDisabled, isSelected, onChange, value, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Switch({ _pseudo, children, className, 'data-test-selector': dataTestSelector, defaultSelected, isDisabled, isSelected, onChange, value, }: SwitchProps): import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,8 @@ import { Switch as Switch$1 } from 'react-aria-components';
4
4
  import clsx from 'clsx';
5
5
  import styles from './switch.module.css.js';
6
6
 
7
- function Switch({ _pseudo = 'none', children, className, 'data-test-selector': dataTestSelector, isDisabled, isSelected, onChange, value, }) {
8
- return (jsxs(Switch$1, { className: clsx(className, styles.switch, styles[_pseudo]), "data-test-selector": dataTestSelector, isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, value: value, children: [jsx("div", { className: styles.indicator }), children] }));
7
+ function Switch({ _pseudo = 'none', children, className, 'data-test-selector': dataTestSelector, defaultSelected, isDisabled, isSelected, onChange, value, }) {
8
+ return (jsxs(Switch$1, { className: clsx(className, styles.switch, styles[_pseudo]), "data-test-selector": dataTestSelector, defaultSelected: defaultSelected, isDisabled: isDisabled, isSelected: isSelected, onChange: onChange, value: value, children: [jsx("div", { className: styles.indicator }), children] }));
9
9
  }
10
10
 
11
11
  export { Switch };
@@ -0,0 +1,10 @@
1
+ interface PasswordRevealToggleProps {
2
+ onChange: (showPassword: boolean) => void;
3
+ showPassword: boolean;
4
+ }
5
+ /**
6
+ * This component is used to show a toggle to reveal password value.
7
+ * It can be used as inline element of the Input component.
8
+ */
9
+ export declare function PasswordRevealToggle({ onChange, showPassword, }: PasswordRevealToggleProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Checkbox } from 'react-aria-components';
3
+ import { StrokeDehashedIcon } from '../../../icons/stroke/stroke-dehashed-icon.js';
4
+ import { StrokeHashedIcon } from '../../../icons/stroke/stroke-hashed-icon.js';
5
+ import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
6
+ import styles from './password-reveal-toggle.module.css.js';
7
+
8
+ /**
9
+ * This component is used to show a toggle to reveal password value.
10
+ * It can be used as inline element of the Input component.
11
+ */
12
+ function PasswordRevealToggle({ onChange, showPassword, }) {
13
+ const t = useFormattedMessage();
14
+ const helpText = showPassword ? t('Conceal value') : t('Reveal value');
15
+ return (jsx(Checkbox, { "aria-label": helpText, className: styles.toggle, onChange: onChange, children: jsx("span", { title: helpText, children: showPassword ? jsx(StrokeHashedIcon, {}) : jsx(StrokeDehashedIcon, {}) }) }));
16
+ }
17
+
18
+ export { PasswordRevealToggle };
@@ -0,0 +1,3 @@
1
+ var styles = {"toggle":"password-reveal-toggle-module-uUQbW"};
2
+
3
+ export { styles as default };
@@ -1,5 +1,5 @@
1
- import { FormEventHandler, KeyboardEvent } from 'react';
2
- import { ValidateFunction } from '../field-error/field-error';
1
+ import { type FormEventHandler, type KeyboardEvent } from 'react';
2
+ import { type ValidateFunction } from '../field-error/field-error';
3
3
  interface TextFieldProps {
4
4
  autoFocus?: boolean;
5
5
  autoGrow?: boolean;
@@ -29,5 +29,5 @@ interface TextFieldProps {
29
29
  * It can be used as a single line input or as a textarea.
30
30
  * This field can also grow when a user types in text.
31
31
  */
32
- export declare function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, minLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel, size, type, validate, value, }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, minLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel, size, type: defaultType, validate, value, }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
33
33
  export {};
@@ -1,11 +1,13 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useState, useCallback } from 'react';
3
4
  import { TextField as TextField$1 } from 'react-aria-components';
4
5
  import clsx from 'clsx';
5
6
  import { FieldError } from '../field-error/field-error.js';
6
7
  import { Input } from '../input/input.js';
7
8
  import { Label } from '../label/label.js';
8
9
  import { TextArea } from '../textarea/textarea.js';
10
+ import { PasswordRevealToggle } from './password-reveal-toggle/password-reveal-toggle.js';
9
11
  import styles from './text-field.module.css.js';
10
12
 
11
13
  /**
@@ -13,10 +15,15 @@ import styles from './text-field.module.css.js';
13
15
  * It can be used as a single line input or as a textarea.
14
16
  * This field can also grow when a user types in text.
15
17
  */
16
- function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, minLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel = false, size = 'lg', type = 'text', validate, value, }) {
18
+ function TextField({ autoFocus, autoGrow, defaultValue, isDisabled, isInvalid, isMultiline, isReadOnly, isRequired, label, maxLength, minLength, name, onChange, onInput, onKeyUp, placeholder, rows, showLabel = false, size = 'lg', type: defaultType = 'text', validate, value, }) {
19
+ const [type, setType] = useState(defaultType);
20
+ const isPasswordInput = type === 'password';
21
+ const togglePasswordType = useCallback(() => {
22
+ setType(isPasswordInput ? 'text' : 'password');
23
+ }, [isPasswordInput]);
17
24
  return (jsxs(TextField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles.field, styles[size]), defaultValue: defaultValue, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxLength: maxLength, minLength: minLength, name: name, onChange: value => {
18
25
  onChange?.(value);
19
- }, onInput: onInput, onKeyUp: e => onKeyUp?.(e), validate: validate, value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), isMultiline ? (jsx(TextArea, { autoGrow: autoGrow, label: label, placeholder: placeholder, rows: rows, size: size })) : (jsx(Input, { autoGrow: autoGrow, label: label, placeholder: placeholder, size: size, type: type })), jsx(FieldError, {}, Math.random())] }));
26
+ }, onInput: onInput, onKeyUp: e => onKeyUp?.(e), validate: validate, value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), isMultiline ? (jsx(TextArea, { autoGrow: autoGrow, label: label, placeholder: placeholder, rows: rows, size: size })) : (jsx(Input, { autoGrow: autoGrow, inlineElement: defaultType === 'password' && (jsx(PasswordRevealToggle, { onChange: togglePasswordType, showPassword: !isPasswordInput })), label: label, placeholder: placeholder, size: size, type: type })), jsx(FieldError, {}, Math.random())] }));
20
27
  }
21
28
 
22
29
  export { TextField };
@@ -0,0 +1,7 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ function StrokeDehashedIcon(props) {
4
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M11.9999099,7.6660389 C9.53942024,7.6660389 7.53751323,9.61026864 7.53751323,11.9998688 C7.53751323,14.3896147 9.53942024,16.3338444 11.9999099,16.3338444 C14.4605497,16.3338444 16.4624567,14.3896147 16.4624567,11.9998688 C16.4624567,9.61026864 14.4605497,7.6660389 11.9999099,7.6660389 M11.9997748,5 C17.5138784,5 22,8.14019646 22,11.9997813 C22,15.8596577 17.5138784,19 11.9997748,19 C6.48597148,19 2,15.8596577 2,11.9997813 C2,8.14019646 6.48597148,5 11.9997748,5 Z M11.9997748,6.29192404 C9.61000954,6.29192404 7.37625851,6.93416735 5.70995473,8.1005302 C4.17533954,9.17472735 3.33025009,10.5595463 3.33025009,11.9997813 C3.33025009,13.4401621 4.17533954,14.824981 5.71010489,15.899324 C7.37625851,17.0656868 9.61000954,17.708076 11.9997748,17.708076 C14.3896901,17.708076 16.6235913,17.0656868 18.2898951,15.899324 C19.8246605,14.824981 20.6697499,13.4401621 20.6697499,11.9997813 C20.6697499,10.5595463 19.8246605,9.17487318 18.2898951,8.1005302 C16.6235913,6.93416735 14.3896901,6.29192404 11.9997748,6.29192404 Z M11.9999099,10.249887 C12.9936558,10.249887 13.8021067,11.0348996 13.8021067,11.9998688 C13.8021067,12.9649837 12.9936558,13.7501422 11.9999099,13.7501422 C11.0063141,13.7501422 10.1980134,12.9649837 10.1980134,11.9998688 C10.1980134,11.0348996 11.0063141,10.249887 11.9999099,10.249887 Z", fillRule: "evenodd" }) }));
5
+ }
6
+
7
+ export { StrokeDehashedIcon };
@@ -0,0 +1,7 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ function StrokeHashedIcon(props) {
4
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M4.93374005,4.18971899 L20.0027973,18.8949316 C20.2618651,19.1477442 20.2618651,19.5576512 20.0027973,19.8103175 C19.8734132,19.9367238 19.7035965,20 19.5337799,20 C19.3639632,20 19.1942963,19.9367238 19.0647624,19.8103175 L3.99555542,5.10495875 C3.73663742,4.85229237 3.73663742,4.44238537 3.99570517,4.18971899 C4.25462316,3.93676034 4.67452256,3.93676034 4.93374005,4.18971899 Z M4.94633404,7.794314 C5.19911228,8.05311803 5.18922877,8.46273276 4.92417102,8.70955376 C3.87906478,9.68237048 3.32663651,10.8200268 3.32663651,11.9994776 C3.32663651,15.1521812 7.20711193,17.7169861 11.9769535,17.7169861 C12.8107622,17.7169861 13.6414263,17.6357353 14.4460338,17.4752798 C14.8060331,17.40382 15.15555,17.6297438 15.2287778,17.9798819 C15.3020056,18.3303122 15.0704919,18.6722667 14.7116905,18.7437264 C13.8197787,18.9214258 12.8997138,19.0115907 11.9769535,19.0115907 C6.47573224,19.0115907 2,15.8660477 2,11.9994776 C2,10.4576135 2.69454116,8.99597719 4.0084489,7.77283224 C4.27350665,7.5258651 4.69340605,7.53580224 4.94633404,7.794314 Z M12.0231963,4.98695522 C17.5244175,4.98695522 22,8.13264437 22,11.9990684 C22,13.5409325 21.3054588,15.0024226 19.9917008,16.2255676 C19.8632152,16.3452517 19.6984901,16.4045822 19.5339147,16.4045822 C19.3588567,16.4045822 19.1840983,16.3373604 19.0538157,16.2040858 C18.8008877,15.9452818 18.810921,15.5356671 19.075829,15.2888461 C20.1209352,14.3160293 20.6732137,13.178373 20.6732137,11.9990684 C20.6732137,8.84636479 16.7928881,6.28170603 12.0231963,6.28170603 C11.1887885,6.28170603 10.3581245,6.36281062 9.55396621,6.52312006 C9.19441612,6.59531046 8.84474954,6.36880213 8.77137197,6.01851797 C8.69814415,5.66808767 8.92965787,5.32613317 9.28845921,5.25467345 C10.1797721,5.07697401 11.0999867,4.98695522 12.0231963,4.98695522 Z M7.64053377,11.1276836 C7.68815431,10.902052 7.97792084,10.8221165 8.14489225,10.9850564 L13.0393259,15.7613132 C13.2062973,15.9242531 13.124384,16.206877 12.8931697,16.2533477 C12.4097763,16.3505271 11.8983796,16.3712782 11.3714088,16.2990878 C9.42465696,16.0326848 7.86800423,14.5140561 7.59411123,12.614455 C7.51983516,12.0996235 7.54094993,11.5998438 7.64053377,11.1276836 Z M11.1026372,7.74588506 C11.5867795,7.64812115 12.0993742,7.62707779 12.6272434,7.69912205 C14.5757923,7.96537893 16.1339425,9.48576126 16.4064878,11.3872621 C16.4803146,11.9023859 16.4587506,12.4024578 16.3585677,12.8749103 C16.3107974,13.1003957 16.0211807,13.1801851 15.854359,13.0173914 L10.9566309,8.23791959 C10.7898092,8.07512587 10.8715728,7.79250194 11.1026372,7.74588506 Z", fillRule: "evenodd" }) }));
5
+ }
6
+
7
+ export { StrokeHashedIcon };
package/dist/index.js CHANGED
@@ -61,11 +61,6 @@ export { ProductUsp } from './carousel/usp-carousel/product-usp-carousel-slide.j
61
61
  export { USPCarousel } from './carousel/usp-carousel/usp-carousel.js';
62
62
  export { CartTotals, formatDisplayPriceToSymbolSpaceValue } from './cart-totals/cart-totals.js';
63
63
  export { CartTotalsSummary } from './cart-totals/cart-totals-summary.js';
64
- export { AdyenPayment } from './checkout/adyen-payment.js';
65
- export { parseAmount } from './checkout/parse-amount.js';
66
- export { Payment } from './checkout/payment.js';
67
- export { useGetAdyenRedirectResult } from './checkout/use-get-adyen-redirect-result.js';
68
- export { useHasReturnedFromAdyen } from './checkout/use-has-returned-from-adyen.js';
69
64
  export { Accordion } from './collapsables/accordion/accordion.js';
70
65
  export { AccordionItem } from './collapsables/accordion/accordion-item.js';
71
66
  export { ShowAll } from './collapsables/show-all/show-all.js';
@@ -76,6 +71,7 @@ export { CountrySelectorDialog } from './country-selector/country-selector-dialo
76
71
  export { CountrySelectorTrigger } from './country-selector/country-selector-trigger/country-selector-trigger.js';
77
72
  export { useCountriesLanguages } from './country-selector/use-countries-languages.js';
78
73
  export { DeliveryTime } from './delivery-time/delivery-time.js';
74
+ export { InfoDisplay } from './display/info-display/info-display.js';
79
75
  export { ProductPrice } from './display/product-price/product-price.js';
80
76
  export { ProductTotalPrice } from './display/product-price/product-total-price.js';
81
77
  export { ProductSku } from './display/product-sku/product-sku.js';
@@ -90,6 +86,7 @@ export { Label } from './forms/label/label.js';
90
86
  export { NumberField } from './forms/number-field/number-field.js';
91
87
  export { Select } from './forms/select/select.js';
92
88
  export { Switch } from './forms/switch/switch.js';
89
+ export { PasswordRevealToggle } from './forms/text-field/password-reveal-toggle/password-reveal-toggle.js';
93
90
  export { TextField } from './forms/text-field/text-field.js';
94
91
  export { TextArea } from './forms/textarea/textarea.js';
95
92
  export { CategoriesGrid } from './global-search/categories-grid/categories-grid.js';
@@ -146,15 +143,25 @@ export { AnnouncementProvider } from './notifications/announcements/announcement
146
143
  export { ConnectedAnnouncement, now } from './notifications/announcements/connected-announcement.js';
147
144
  export { IntersectionObserverComponent } from './observers/intersection-observer.js';
148
145
  export { CartPage } from './pages/checkout/cart-page/cart-page.js';
146
+ export { EmptyCart } from './pages/checkout/cart-page/components/empty-cart-page.js';
147
+ export { BillingAndInvoiceInformation } from './pages/checkout/components/billing-and-invoice-information.js';
148
+ export { CHECKOUT_PATHS } from './pages/checkout/constants.js';
149
149
  export { CheckoutPageLayout } from './pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js';
150
150
  export { CheckoutPageSection } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section.js';
151
151
  export { CheckoutPageSectionContent } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-content.js';
152
152
  export { CheckoutPageSectionHeader } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-header.js';
153
153
  export { CheckoutPageSectionLink } from './pages/checkout/layouts/checkout-page-layout/components/checkout-page-section-link.js';
154
+ export { OrderConfirmationPage } from './pages/checkout/order-confirmation-page/order-confirmation-page.js';
155
+ export { AdyenPayment } from './pages/checkout/payment-page/components/adyen-payment.js';
156
+ export { Payment } from './pages/checkout/payment-page/components/payment.js';
157
+ export { useGetAdyenRedirectResult } from './pages/checkout/payment-page/hooks/use-get-adyen-redirect-result.js';
158
+ export { useHasReturnedFromAdyen } from './pages/checkout/payment-page/hooks/use-has-returned-from-adyen.js';
154
159
  export { PaymentPage } from './pages/checkout/payment-page/payment-page.js';
160
+ export { parseAmount } from './pages/checkout/payment-page/utils/parse-amount.js';
155
161
  export { EDIT_ADDRESS_FORM_ID, EditAddresses } from './pages/checkout/shipping-page/components/edit-address.js';
156
162
  export { ReadOnlyAddresses } from './pages/checkout/shipping-page/components/readonly-address.js';
157
163
  export { SonicAddress } from './pages/checkout/shipping-page/components/sonic-address.js';
164
+ export { usePatchShippingDetails } from './pages/checkout/shipping-page/hooks/use-patch-shipping-details.js';
158
165
  export { ShippingPage } from './pages/checkout/shipping-page/shipping-page.js';
159
166
  export { PageContainer } from './pages/components/page-container/page-container.js';
160
167
  export { PageMetaData } from './pages/components/page-meta-data/page-meta-data.js';
@@ -195,6 +202,7 @@ export { useSignOut } from './shared/api/storefront/hooks/authentication/use-sig
195
202
  export { useAddProductToCurrentCart } from './shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js';
196
203
  export { useDeleteCartLineById } from './shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
197
204
  export { useDeleteCurrentCart } from './shared/api/storefront/hooks/cart/use-delete-current-cart.js';
205
+ export { useFetchCartById } from './shared/api/storefront/hooks/cart/use-fetch-cart-by-id.js';
198
206
  export { useFetchCurrentCart } from './shared/api/storefront/hooks/cart/use-fetch-current-cart.js';
199
207
  export { useFetchCurrentCheckoutAtp } from './shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js';
200
208
  export { useFetchCurrentCartCount } from './shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js';
@@ -274,7 +282,7 @@ export { RouteProvider, useBasePath, useNavigate, useOnNavigate } from './shared
274
282
  export { withRouting } from './shared/routing/with-routing.js';
275
283
  export { ensureArray } from './shared/utils/array.js';
276
284
  export { breakpoints, getCurrentBreakpoints } from './shared/utils/breakpoints.js';
277
- export { convertDateUnitToPluralOrSingle, getDateUnitObject } from './shared/utils/date.js';
285
+ export { convertDateUnitToPluralOrSingle, formatDateToLocaleString, getDateUnitObject } from './shared/utils/date.js';
278
286
  export { environment, environments } from './shared/utils/environment.js';
279
287
  export { EventEmitter } from './shared/utils/event-emitter.js';
280
288
  export { clone, deepMerge, isPlainObject, default as main, merge } from './shared/utils/merge.js';
@@ -1 +1 @@
1
- export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Billing address' | 'Billing and shipping address' | '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}' | 'Delivery date' | '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' | 'Pickup address' | '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' | 'Sonic address' | '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';
1
+ export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add order notes' | 'Add to list' | 'Address' | 'Amount: {0}' | 'An error occurred while processing your payment. Please try again.' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Are you sure you want to remove all items from your cart?' | 'Are you sure you want to remove this item from your cart?' | 'article' | 'articles' | 'As soon as possible' | 'Attention' | 'Billing address' | 'Billing and shipping address' | 'Billing and shipping information' | 'Cancel' | 'Cart' | 'Changing your address is currently not possible. Please contact customer support to change your address.' | 'Chosen filters' | 'City' | 'Clear filters' | 'Clear' | 'Click the button below to continue shopping.' | 'Company name' | 'Conceal value' | 'Continue shopping' | 'Continue' | 'Cost overview' | 'Country' | 'create account' | 'Create new list' | 'Delivery date' | 'Delivery expected in {0} {1}' | 'Double check your spelling' | 'Downloads' | 'Easily add your favorite products' | 'Edit billing address' | 'Edit shipping address' | 'Email' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'Features' | 'First name' | 'Fulfillment method' | 'General' | 'Hide filters' | 'Home' | 'Incl. VAT' | 'Includes' | 'Industry' | 'Language' | 'Last name' | 'List name already exists' | 'New list name' | 'of' | 'Order confirmation' | 'Order date' | 'Order number' | 'Order' | 'Pay by invoice' | 'Pay' | 'Payment method' | 'Payment' | 'pc' | 'Phone' | 'Pick up' | 'Pickup address' | 'Please enter a valid e-mail address' | 'Please enter a valid phone number' | 'Please Sign In' | 'PO Number' | 'Popular searches' | 'Postal Code' | 'Print' | 'Processing' | 'Product Features' | 'Product' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Remove all' | 'Requested delivery date' | 'Reveal value' | 'Review and payment' | 'Save order' | 'Save' | 'Saved cart for later.' | 'Search' | 'Searching again using more general terms' | 'See all results' | 'Select a desired delivery date' | 'Select a list' | 'Selecting As Soon As Possible will enable us to send the products to you as they become available.' | 'Share your favorite list with others' | 'Ship' | 'Shipping address' | 'Shipping and handling' | 'Shipping details' | 'Shop more efficiently and quicker with a favorites list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'sign in' | 'Sonic address' | 'Sonic Equipment' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'tag.limited' | 'tag.new' | 'The expected delivery is an indication based on the product availability and the shipping location.' | 'The product has been added to your cart.' | 'The product has been removed from your cart.' | 'The product has been updated in your cart.' | 'There are no products in your shopping cart.' | 'Total amount is' | 'Total' | 'Total' | 'Try another search' | 'Try another search' | 'Unable to add the product to your cart.' | 'Unable to add the product to your cart.' | 'Unable to empty your cart.' | 'Unable to empty your cart.' | 'Unable to remove the product from your cart.' | 'Unable to remove the product from your cart.' | 'Unable to save cart for later.' | 'Unable to save cart for later.' | 'Unable to update the product in your cart.' | 'Unable to update the product in your cart.' | 'Updating address' | 'Use billing address' | 'Use fewer keywords' | 'Validating' | 'validation.badInput' | 'validation.customError' | 'validation.invalid' | 'validation.patternMismatch' | 'validation.rangeOverflow' | 'validation.rangeUnderflow' | 'validation.stepMismatch' | 'validation.tooLong' | 'validation.tooShort' | 'validation.typeMismatch' | 'validation.valid' | 'validation.valueMissing' | 'VAT Number' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'Your cart has been emptied.' | 'Your favorites are available on multiple devices' | 'Your shopping cart is still empty';
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import { ConnectedOrderLineCard } from '../../../cards/orderline-card/connected-orderline-card.js';
3
3
  import { CartTotals } from '../../../cart-totals/cart-totals.js';
4
4
  import { CartTotalsSummary } from '../../../cart-totals/cart-totals-summary.js';
@@ -9,7 +9,6 @@ import { CheckoutPageLayout } from '../layouts/checkout-page-layout/checkout-pag
9
9
  import { Page } from '../../components/page/page.js';
10
10
  import { ErrorPage } from '../../error-page/error-page.js';
11
11
  import { LoadingPage } from '../../loading-page/loading-page.js';
12
- import { NoResults } from '../../product/product-listing-page/no-results/no-results.js';
13
12
  import { useIsAuthenticated } from '../../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
14
13
  import { useDeleteCartLineById } from '../../../shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
15
14
  import { useDeleteCurrentCart } from '../../../shared/api/storefront/hooks/cart/use-delete-current-cart.js';
@@ -18,11 +17,9 @@ import { RouteButton } from '../../../shared/routing/route-button.js';
18
17
  import { useToast } from '../../../toast/use-toast.js';
19
18
  import { useFetchCurrentCartLinesWithAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js';
20
19
  import { useFetchCurrentCartWithAtp } from '../../../shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js';
20
+ import { CHECKOUT_PATHS } from '../constants.js';
21
+ import { EmptyCart } from './components/empty-cart-page.js';
21
22
 
22
- function EmptyCart() {
23
- const t = useFormattedMessage();
24
- return (jsx(NoResults, { content: jsxs(Fragment, { children: [jsx(FormattedMessage, { id: "There are no products in your shopping cart." }), jsx("br", {}), jsx(FormattedMessage, { id: "Click the button below to continue shopping." })] }), title: t('Your shopping cart is still empty') }));
25
- }
26
23
  function CartContent({ cartLines }) {
27
24
  const { addToast } = useToast();
28
25
  const { data: currentCart } = useFetchCurrentCartWithAtp();
@@ -107,9 +104,9 @@ function CartPage() {
107
104
  if (isLoading)
108
105
  return jsx(LoadingPage, {});
109
106
  return (jsx(Page, { breadCrumb: [
110
- { href: '/', label: 'home' },
111
- { href: '/cart', label: t('Cart') },
112
- ], title: t('Cart'), children: cartLines?.length ? (jsx(CartContent, { cartLines: cartLines })) : (jsx(EmptyCart, {})) }));
107
+ { href: CHECKOUT_PATHS.HOME, label: 'home' },
108
+ { href: CHECKOUT_PATHS.CART, label: t('Cart') },
109
+ ], canonicalUrl: CHECKOUT_PATHS.CART, title: t('Cart'), children: cartLines?.length ? (jsx(CartContent, { cartLines: cartLines })) : (jsx(EmptyCart, {})) }));
113
110
  }
114
111
 
115
112
  export { CartPage };
@@ -0,0 +1 @@
1
+ export declare function EmptyCart(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { FormattedMessage } from '../../../../intl/formatted-message.js';
3
+ import { useFormattedMessage } from '../../../../intl/use-formatted-message.js';
4
+ import { NoResults } from '../../../product/product-listing-page/no-results/no-results.js';
5
+
6
+ function EmptyCart() {
7
+ const t = useFormattedMessage();
8
+ return (jsx(NoResults, { content: jsxs(Fragment, { children: [jsx(FormattedMessage, { id: "There are no products in your shopping cart." }), jsx("br", {}), jsx(FormattedMessage, { id: "Click the button below to continue shopping." })] }), title: t('Your shopping cart is still empty') }));
9
+ }
10
+
11
+ export { EmptyCart };
@@ -0,0 +1,7 @@
1
+ import { AddressType } from '../../../shared/model/address';
2
+ interface BillingAndInvoiceInformationProps {
3
+ billToAddress: AddressType;
4
+ shipToAddress: AddressType;
5
+ }
6
+ export declare function BillingAndInvoiceInformation({ billToAddress, shipToAddress, }: BillingAndInvoiceInformationProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Address } from '../../../address/address.js';
3
+ import { InfoDisplay } from '../../../display/info-display/info-display.js';
4
+ import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
5
+ import styles from './billing-and-invoice-information.module.css.js';
6
+
7
+ function BillingAndInvoiceInformation({ billToAddress, shipToAddress, }) {
8
+ const t = useFormattedMessage();
9
+ return (jsxs("div", { className: styles['billing-and-invoice-information'], children: [jsx("section", { className: styles.section, children: jsx(InfoDisplay, { id: "billing-address", label: t('Billing address'), value: jsx(Address, { ...billToAddress }) }) }), jsx("section", { className: styles.section, children: jsx(InfoDisplay, { id: "shipping-address", label: t('Shipping address'), value: jsx(Address, { ...shipToAddress }) }) })] }));
10
+ }
11
+
12
+ export { BillingAndInvoiceInformation };
@@ -0,0 +1,3 @@
1
+ var styles = {"billing-and-invoice-information":"billing-and-invoice-information-module-FXmcK","section":"billing-and-invoice-information-module-5-ORs"};
2
+
3
+ export { styles as default };
@@ -0,0 +1,8 @@
1
+ export declare const CHECKOUT_PATHS: {
2
+ readonly CART: "/cart";
3
+ readonly CHECKOUT_SHIPPING: "/CheckoutShipping";
4
+ readonly CHECKOUT_SHIPPING_VIA_SIGNIN: "/signin?returnUrl=/CheckoutShipping";
5
+ readonly HOME: "/";
6
+ readonly ORDER_CONFIRMATION: "/OrderConfirmation";
7
+ readonly REVIEW_AND_SUBMIT: "/CheckoutReviewAndSubmit";
8
+ };