@sonic-equipment/ui 171.0.0 → 173.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.
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { ImageSourceType } from '../../shared/model/image';
3
3
  import { ProductTotalPriceType } from '../../shared/model/price';
4
4
  export interface BaseOrderLineCardProps {
5
- deliveryDate?: Date;
5
+ deliveryDate?: Date | null;
6
6
  href: string;
7
7
  image: ImageSourceType;
8
8
  isReadonly: boolean;
@@ -1,5 +1,5 @@
1
1
  export interface DeliveryTimeProps {
2
2
  className?: string;
3
- deliveryDate?: Date;
3
+ deliveryDate: Date | null | undefined;
4
4
  }
5
- export declare function DeliveryTime({ className, deliveryDate }: DeliveryTimeProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function DeliveryTime({ className, deliveryDate }: DeliveryTimeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -11,7 +11,9 @@ import styles from './delivery-time.module.css.js';
11
11
  function DeliveryTime({ className, deliveryDate }) {
12
12
  const { cultureCode } = useIntl();
13
13
  const t = useFormattedMessage();
14
- if (!deliveryDate) {
14
+ if (deliveryDate === undefined)
15
+ return null;
16
+ if (deliveryDate === null) {
15
17
  return (jsx("div", { className: clsx(styles['delivery-time'], className), children: jsx("p", {
16
18
  // eslint-disable-next-line @eslint-react/dom/no-dangerously-set-innerhtml
17
19
  dangerouslySetInnerHTML: {
@@ -85,7 +85,7 @@ function CartContent({ cartLines }) {
85
85
  secondary: isAuthenticated ? (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", onClick: () => {
86
86
  saveCartForLater.mutate({ cart: currentCart });
87
87
  }, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })) : (jsx(Button, { color: "secondary", "data-test-selector": "saveCartForLaterButton", href: PATHS.SIGN_IN, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })),
88
- }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: currentCart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, shippingCost: currentCart.shippingAndHandling, subtotal: currentCart.orderSubTotal, tax: currentCart.totalTax, total: currentCart.orderGrandTotal, vatPercentage: cartLines[0]?.pricing?.vatRate || 0 }), children: jsx(OrderLineList, { onRemoveAll: () => deleteCurrentCart.mutate(), children: cartLines.map(cartLine => (jsx(ConnectedOrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
88
+ }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: currentCart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, shippingCost: currentCart.shippingAndHandling, subtotal: currentCart.orderSubTotal, tax: currentCart.totalTax, total: currentCart.orderGrandTotal, vatPercentage: cartLines[0]?.pricing?.vatRate || 0 }), children: jsx(OrderLineList, { onRemoveAll: () => deleteCurrentCart.mutate(), children: cartLines.map(cartLine => (jsx(ConnectedOrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
89
89
  fit: 'contain',
90
90
  image: {
91
91
  '1': cartLine.smallImagePath,
@@ -76,7 +76,7 @@ function OrderConfirmationPageContent({ cart, }) {
76
76
  email: cart.shipTo?.email,
77
77
  phone: cart.shipTo?.phone,
78
78
  postalCode: cart.shipTo?.postalCode,
79
- } }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: t('Order'), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
79
+ } }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: t('Order'), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: undefined, href: cartLine.productUri, image: {
80
80
  fit: 'contain',
81
81
  image: {
82
82
  '1': cartLine.smallImagePath,
@@ -30,7 +30,7 @@ function PaymentPageContent({ atp, cart, formId, hasAtp, isProcessing, isValidat
30
30
  ], "data-test-selector": "paymentPage", title: t('Review and payment'), children: jsxs(CheckoutPageLayout, { actions: {
31
31
  primary: (jsx(Button, { withArrow: true, "data-test-selector": "checkoutReviewAndSubmit_placeOrder", form: formId, isDisabled: isProcessing, isLoading: isProcessing ? (jsx(FormattedMessage, { id: "Processing" })) : isValidatingVAT ? (jsx(FormattedMessage, { id: "Validating" })) : (false), type: "submit", children: cart.paymentMethod?.name === 'PBI' ? (jsx(FormattedMessage, { id: "Finalize order" })) : (jsx(FormattedMessage, { id: "Finalize payment" })) })),
32
32
  }, mobileSummary: jsx(CartTotalsSummary, { currencyCode: currencyCode, totalAmount: cart.orderGrandTotal }), overview: jsx(CartTotals, { currencyCode: currencyCode, deliveryDate: hasAtp ? undefined : cart.requestedDeliveryDate, fulfillmentMethod: cart.fulfillmentMethod, isPayByInvoice: (cart.paymentOptions?.paymentMethods?.length || 1) <= 1 &&
33
- cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing, onValidatingVAT: setIsValidatingVAT }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
33
+ cart.paymentMethod?.name === 'PBI', shippingCost: cart.shippingAndHandling, subtotal: cart.orderSubTotal, tax: cart.totalTax, total: cart.orderGrandTotal, vatPercentage: cart.cartLines?.[0]?.pricing?.vatRate || 0 }), children: [jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Payment" }), children: jsx(CheckoutPageSectionContent, { children: jsx(Payment, { atp: atp, cart: cart, form: formId, isProcessing: isProcessing, onPaymentComplete: onPaymentComplete, onProcessing: setIsProcessing, onValidatingVAT: setIsValidatingVAT }) }) }), jsx(CheckoutPageSection, { hasBorder: false, title: jsx(FormattedMessage, { id: "Order" }), children: jsx(CheckoutPageSectionContent, { stretch: true, children: jsx(OrderLineList, { children: cart.cartLines?.map(cartLine => (jsx(OrderLineCard, { deliveryDate: cartLine.atp?.date ?? null, href: cartLine.productUri, image: {
34
34
  fit: 'contain',
35
35
  image: {
36
36
  '1': cartLine.smallImagePath,
@@ -14,7 +14,7 @@ function useFetchCurrentCartWithAtp({ forceRecalculation = true, select = cartMo
14
14
  ...cartResult.data,
15
15
  cartLines: cartResult.data.cartLines?.map(line => ({
16
16
  ...line,
17
- atp: atp.find(a => a.productCode === line.erpNumber),
17
+ atp: atp.find(a => a.productCode === line.erpNumber) || null,
18
18
  })),
19
19
  }
20
20
  : cartResult.data),
package/dist/styles.css CHANGED
@@ -3747,9 +3747,12 @@ html {
3747
3747
 
3748
3748
  .carousel-module-ealh- .carousel-module-bUMlb {
3749
3749
  display: grid;
3750
+ flex-grow: 0;
3750
3751
  block-size: auto;
3752
+ font-size: inherit;
3751
3753
  inline-size: -moz-fit-content;
3752
3754
  inline-size: fit-content;
3755
+ text-align: left;
3753
3756
  }
3754
3757
 
3755
3758
  /* stylelint-disable-next-line no-descending-specificity */
@@ -4759,7 +4762,7 @@ button.swiper-pagination-bullet {
4759
4762
  display: grid;
4760
4763
  gap: var(--space-32);
4761
4764
  grid-template-columns: repeat(auto-fit, 220px);
4762
- margin-block-end: 104px;
4765
+ margin-block-end: 48px;
4763
4766
  }
4764
4767
 
4765
4768
  .footer-module-YzJ68 .footer-module-TZq-4 {
@@ -5393,6 +5396,7 @@ button.swiper-pagination-bullet {
5393
5396
  .search-section-module-qaTiw .search-section-module-E--U2 .search-section-module-AHlDR {
5394
5397
  margin: 0;
5395
5398
  color: var(--color-brand-dark-gray);
5399
+ font-family: inherit;
5396
5400
  font-size: var(--font-size-16);
5397
5401
  font-weight: var(--font-weight-normal);
5398
5402
  line-height: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "171.0.0",
3
+ "version": "173.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {