@salesforce/retail-react-app 7.1.0-preview.1 → 8.0.0-dev

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 (113) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/app/components/_app/index.jsx +9 -7
  3. package/app/components/_app/index.test.js +2 -2
  4. package/app/components/_app-config/index.jsx +9 -3
  5. package/app/components/drawer-menu/drawer-menu.jsx +3 -1
  6. package/app/components/footer/index.jsx +3 -1
  7. package/app/components/header/index.jsx +3 -1
  8. package/app/components/header/index.test.js +2 -2
  9. package/app/components/island/README.md +1 -1
  10. package/app/components/island/index.jsx +3 -1
  11. package/app/components/island/index.test.js +94 -5
  12. package/app/components/item-variant/item-attributes.jsx +12 -3
  13. package/app/components/multiship/multiship-order-summary.jsx +137 -0
  14. package/app/components/multiship/multiship-order-summary.test.js +121 -0
  15. package/app/components/order-summary/index.jsx +2 -4
  16. package/app/components/pickup-or-delivery/index.jsx +80 -0
  17. package/app/components/pickup-or-delivery/index.test.jsx +182 -0
  18. package/app/components/product-item/index.jsx +26 -16
  19. package/app/components/product-item/index.test.js +29 -2
  20. package/app/components/product-item-list/index.jsx +10 -0
  21. package/app/components/product-item-list/index.test.jsx +14 -0
  22. package/app/components/product-view/index.jsx +9 -6
  23. package/app/components/product-view/index.test.js +25 -21
  24. package/app/components/quantity-picker/index.test.jsx +12 -12
  25. package/app/components/reset-password/index.test.js +1 -1
  26. package/app/components/shared/ui/AlertDescription/index.jsx +8 -0
  27. package/app/components/shared/ui/index.jsx +1 -0
  28. package/app/components/store-display/index.jsx +28 -4
  29. package/app/components/store-display/index.test.js +71 -0
  30. package/app/components/store-locator/form.test.jsx +16 -4
  31. package/app/components/store-locator/list.jsx +9 -4
  32. package/app/components/toggle-card/index.jsx +14 -0
  33. package/app/components/unavailable-product-confirmation-modal/index.jsx +19 -5
  34. package/app/components/unavailable-product-confirmation-modal/index.test.js +122 -1
  35. package/app/constants.js +20 -6
  36. package/app/contexts/store-locator-provider.jsx +7 -1
  37. package/app/contexts/store-locator-provider.test.jsx +36 -1
  38. package/app/hooks/use-address-form.js +155 -0
  39. package/app/hooks/use-address-form.test.js +501 -0
  40. package/app/hooks/use-auth-modal.js +2 -6
  41. package/app/hooks/use-current-basket.js +71 -2
  42. package/app/hooks/use-current-basket.test.js +37 -1
  43. package/app/hooks/use-dnt-notification.js +4 -4
  44. package/app/hooks/use-dnt-notification.test.js +5 -5
  45. package/app/hooks/use-item-shipment-management.js +233 -0
  46. package/app/hooks/use-item-shipment-management.test.js +696 -0
  47. package/app/hooks/use-multiship.js +589 -0
  48. package/app/hooks/use-multiship.test.js +776 -0
  49. package/app/hooks/use-pickup-shipment.js +70 -106
  50. package/app/hooks/use-pickup-shipment.test.js +345 -209
  51. package/app/hooks/use-product-address-assignment.js +280 -0
  52. package/app/hooks/use-product-address-assignment.test.js +414 -0
  53. package/app/hooks/use-product-inventory.js +100 -0
  54. package/app/hooks/use-product-inventory.test.js +254 -0
  55. package/app/hooks/use-shipment-operations.js +168 -0
  56. package/app/hooks/use-shipment-operations.test.js +385 -0
  57. package/app/hooks/use-store-locator.js +24 -2
  58. package/app/hooks/use-store-locator.test.jsx +109 -1
  59. package/app/pages/account/index.test.js +1 -1
  60. package/app/pages/account/profile.test.js +0 -2
  61. package/app/pages/cart/index.jsx +397 -157
  62. package/app/pages/cart/index.test.js +353 -2
  63. package/app/pages/cart/partials/bonus-products-title.jsx +10 -8
  64. package/app/pages/cart/partials/cart-secondary-button-group.test.js +1 -1
  65. package/app/pages/cart/partials/order-type-display.jsx +68 -0
  66. package/app/pages/cart/partials/order-type-display.test.js +241 -0
  67. package/app/pages/checkout/confirmation.jsx +79 -158
  68. package/app/pages/checkout/index.jsx +34 -9
  69. package/app/pages/checkout/index.test.js +245 -118
  70. package/app/pages/checkout/partials/contact-info.jsx +2 -6
  71. package/app/pages/checkout/partials/contact-info.test.js +93 -7
  72. package/app/pages/checkout/partials/payment.jsx +19 -5
  73. package/app/pages/checkout/partials/pickup-address.jsx +340 -70
  74. package/app/pages/checkout/partials/pickup-address.test.js +1075 -82
  75. package/app/pages/checkout/partials/product-shipping-address-card.jsx +382 -0
  76. package/app/pages/checkout/partials/shipment-details.jsx +209 -0
  77. package/app/pages/checkout/partials/shipment-details.test.js +246 -0
  78. package/app/pages/checkout/partials/shipping-address.jsx +156 -68
  79. package/app/pages/checkout/partials/shipping-address.test.js +673 -0
  80. package/app/pages/checkout/partials/shipping-method-options.jsx +180 -0
  81. package/app/pages/checkout/partials/shipping-methods.jsx +403 -0
  82. package/app/pages/checkout/partials/shipping-methods.test.js +472 -0
  83. package/app/pages/checkout/partials/shipping-multi-address.jsx +259 -0
  84. package/app/pages/checkout/partials/shipping-multi-address.test.js +2088 -0
  85. package/app/pages/checkout/partials/shipping-product-cards.jsx +101 -0
  86. package/app/pages/checkout/util/checkout-context.js +25 -18
  87. package/app/pages/login/index.jsx +2 -6
  88. package/app/pages/product-detail/index.jsx +96 -81
  89. package/app/pages/product-detail/index.test.js +103 -19
  90. package/app/pages/product-list/index.jsx +3 -1
  91. package/app/pages/product-list/partials/inventory-filter.jsx +18 -21
  92. package/app/pages/product-list/partials/inventory-filter.test.js +15 -17
  93. package/app/pages/product-list/partials/selected-refinements.jsx +3 -1
  94. package/app/ssr.js +1 -1
  95. package/app/static/translations/compiled/en-GB.json +316 -30
  96. package/app/static/translations/compiled/en-US.json +316 -30
  97. package/app/static/translations/compiled/en-XA.json +673 -75
  98. package/app/utils/address-utils.js +112 -0
  99. package/app/utils/address-utils.test.js +484 -0
  100. package/app/utils/product-utils.js +17 -5
  101. package/app/utils/product-utils.test.js +17 -8
  102. package/app/utils/sfdc-user-agent-utils.js +32 -0
  103. package/app/utils/sfdc-user-agent-utils.test.js +82 -0
  104. package/app/utils/shipment-utils.js +196 -0
  105. package/app/utils/shipment-utils.test.js +458 -0
  106. package/app/utils/test-utils.js +4 -4
  107. package/app/utils/utils.js +6 -1
  108. package/config/default.js +4 -1
  109. package/config/mocks/default.js +3 -1
  110. package/package.json +9 -9
  111. package/translations/en-GB.json +127 -10
  112. package/translations/en-US.json +127 -10
  113. package/app/pages/checkout/partials/shipping-options.jsx +0 -269
@@ -532,21 +532,45 @@
532
532
  "cart.order_type.delivery": [
533
533
  {
534
534
  "type": 0,
535
- "value": "Delivery"
535
+ "value": "Delivery - "
536
+ },
537
+ {
538
+ "type": 1,
539
+ "value": "itemsInShipment"
540
+ },
541
+ {
542
+ "type": 0,
543
+ "value": " out of "
544
+ },
545
+ {
546
+ "type": 1,
547
+ "value": "totalItemsInCart"
548
+ },
549
+ {
550
+ "type": 0,
551
+ "value": " items"
536
552
  }
537
553
  ],
538
554
  "cart.order_type.pickup_in_store": [
539
555
  {
540
556
  "type": 0,
541
- "value": "Pick Up in Store ("
557
+ "value": "Pick Up in Store - "
542
558
  },
543
559
  {
544
560
  "type": 1,
545
- "value": "storeName"
561
+ "value": "itemsInShipment"
546
562
  },
547
563
  {
548
564
  "type": 0,
549
- "value": ")"
565
+ "value": " out of "
566
+ },
567
+ {
568
+ "type": 1,
569
+ "value": "totalItemsInCart"
570
+ },
571
+ {
572
+ "type": 0,
573
+ "value": " items"
550
574
  }
551
575
  ],
552
576
  "cart.product_edit_modal.modal_label": [
@@ -721,6 +745,16 @@
721
745
  "value": "Delivery Details"
722
746
  }
723
747
  ],
748
+ "checkout_confirmation.heading.delivery_number": [
749
+ {
750
+ "type": 0,
751
+ "value": "Delivery "
752
+ },
753
+ {
754
+ "type": 1,
755
+ "value": "number"
756
+ }
757
+ ],
724
758
  "checkout_confirmation.heading.order_summary": [
725
759
  {
726
760
  "type": 0,
@@ -745,6 +779,16 @@
745
779
  "value": "Pickup Details"
746
780
  }
747
781
  ],
782
+ "checkout_confirmation.heading.pickup_location_number": [
783
+ {
784
+ "type": 0,
785
+ "value": "Pickup Location "
786
+ },
787
+ {
788
+ "type": 1,
789
+ "value": "number"
790
+ }
791
+ ],
748
792
  "checkout_confirmation.heading.shipping_address": [
749
793
  {
750
794
  "type": 0,
@@ -793,24 +837,6 @@
793
837
  "value": "Shipping"
794
838
  }
795
839
  ],
796
- "checkout_confirmation.label.shipping.strikethrough.price": [
797
- {
798
- "type": 0,
799
- "value": "Originally "
800
- },
801
- {
802
- "type": 1,
803
- "value": "originalPrice"
804
- },
805
- {
806
- "type": 0,
807
- "value": ", now "
808
- },
809
- {
810
- "type": 1,
811
- "value": "newPrice"
812
- }
813
- ],
814
840
  "checkout_confirmation.label.subtotal": [
815
841
  {
816
842
  "type": 0,
@@ -1677,12 +1703,6 @@
1677
1703
  "value": "Wishlist"
1678
1704
  }
1679
1705
  ],
1680
- "global.error.create_account": [
1681
- {
1682
- "type": 0,
1683
- "value": "This feature is not currently available. You must create an account to access this feature."
1684
- }
1685
- ],
1686
1706
  "global.error.feature_unavailable": [
1687
1707
  {
1688
1708
  "type": 0,
@@ -1751,6 +1771,12 @@
1751
1771
  "value": "Item removed from wishlist"
1752
1772
  }
1753
1773
  ],
1774
+ "global.info.store_insufficient_inventory": [
1775
+ {
1776
+ "type": 0,
1777
+ "value": "Some items aren't available for pickup at this store."
1778
+ }
1779
+ ],
1754
1780
  "global.link.added_to_wishlist.view_wishlist": [
1755
1781
  {
1756
1782
  "type": 0,
@@ -2019,6 +2045,16 @@
2019
2045
  "value": "quantity"
2020
2046
  }
2021
2047
  ],
2048
+ "item_attributes.label.quantity_abbreviated": [
2049
+ {
2050
+ "type": 0,
2051
+ "value": "Qty: "
2052
+ },
2053
+ {
2054
+ "type": 1,
2055
+ "value": "quantity"
2056
+ }
2057
+ ],
2022
2058
  "item_attributes.label.selected_options": [
2023
2059
  {
2024
2060
  "type": 0,
@@ -2535,6 +2571,12 @@
2535
2571
  "value": "Order Summary"
2536
2572
  }
2537
2573
  ],
2574
+ "order_summary.label.delivery_items": [
2575
+ {
2576
+ "type": 0,
2577
+ "value": "Delivery Items"
2578
+ }
2579
+ ],
2538
2580
  "order_summary.label.estimated_total": [
2539
2581
  {
2540
2582
  "type": 0,
@@ -2553,6 +2595,12 @@
2553
2595
  "value": "Order Total"
2554
2596
  }
2555
2597
  ],
2598
+ "order_summary.label.pickup_items": [
2599
+ {
2600
+ "type": 0,
2601
+ "value": "Pickup Items"
2602
+ }
2603
+ ],
2556
2604
  "order_summary.label.promo_applied": [
2557
2605
  {
2558
2606
  "type": 0,
@@ -2719,12 +2767,30 @@
2719
2767
  "value": "This is a secure SSL encrypted payment."
2720
2768
  }
2721
2769
  ],
2770
+ "pickup_address.bonus_products.title": [
2771
+ {
2772
+ "type": 0,
2773
+ "value": "Bonus Items"
2774
+ }
2775
+ ],
2722
2776
  "pickup_address.button.continue_to_payment": [
2723
2777
  {
2724
2778
  "type": 0,
2725
2779
  "value": "Continue to Payment"
2726
2780
  }
2727
2781
  ],
2782
+ "pickup_address.button.continue_to_shipping_address": [
2783
+ {
2784
+ "type": 0,
2785
+ "value": "Continue to Shipping Address"
2786
+ }
2787
+ ],
2788
+ "pickup_address.button.show_products": [
2789
+ {
2790
+ "type": 0,
2791
+ "value": "Show Products"
2792
+ }
2793
+ ],
2728
2794
  "pickup_address.title.pickup_address": [
2729
2795
  {
2730
2796
  "type": 0,
@@ -2737,6 +2803,24 @@
2737
2803
  "value": "Store Information"
2738
2804
  }
2739
2805
  ],
2806
+ "pickup_or_delivery.label.choose_delivery_option": [
2807
+ {
2808
+ "type": 0,
2809
+ "value": "Choose delivery option"
2810
+ }
2811
+ ],
2812
+ "pickup_or_delivery.label.pickup_in_store": [
2813
+ {
2814
+ "type": 0,
2815
+ "value": "Pick Up in Store"
2816
+ }
2817
+ ],
2818
+ "pickup_or_delivery.label.ship_to_address": [
2819
+ {
2820
+ "type": 0,
2821
+ "value": "Ship to Address"
2822
+ }
2823
+ ],
2740
2824
  "price_per_item.label.each": [
2741
2825
  {
2742
2826
  "type": 0,
@@ -3329,12 +3413,36 @@
3329
3413
  "value": "In Stock"
3330
3414
  }
3331
3415
  ],
3416
+ "shipping_address.action.ship_to_multiple_addresses": [
3417
+ {
3418
+ "type": 0,
3419
+ "value": "Ship to Multiple Addresses"
3420
+ }
3421
+ ],
3422
+ "shipping_address.action.ship_to_single_address": [
3423
+ {
3424
+ "type": 0,
3425
+ "value": "Ship to Single Address"
3426
+ }
3427
+ ],
3428
+ "shipping_address.button.add_new_address": [
3429
+ {
3430
+ "type": 0,
3431
+ "value": "+ Add New Address"
3432
+ }
3433
+ ],
3332
3434
  "shipping_address.button.continue_to_shipping": [
3333
3435
  {
3334
3436
  "type": 0,
3335
3437
  "value": "Continue to Shipping Method"
3336
3438
  }
3337
3439
  ],
3440
+ "shipping_address.error.update_failed": [
3441
+ {
3442
+ "type": 0,
3443
+ "value": "Something went wrong while updating the shipping address. Try again."
3444
+ }
3445
+ ],
3338
3446
  "shipping_address.label.edit_button": [
3339
3447
  {
3340
3448
  "type": 0,
@@ -3355,12 +3463,30 @@
3355
3463
  "value": "address"
3356
3464
  }
3357
3465
  ],
3466
+ "shipping_address.label.shipping_address": [
3467
+ {
3468
+ "type": 0,
3469
+ "value": "Delivery Address"
3470
+ }
3471
+ ],
3358
3472
  "shipping_address.label.shipping_address_form": [
3359
3473
  {
3360
3474
  "type": 0,
3361
3475
  "value": "Shipping Address Form"
3362
3476
  }
3363
3477
  ],
3478
+ "shipping_address.message.no_items_in_basket": [
3479
+ {
3480
+ "type": 0,
3481
+ "value": "No items in basket."
3482
+ }
3483
+ ],
3484
+ "shipping_address.summary.multiple_addresses": [
3485
+ {
3486
+ "type": 0,
3487
+ "value": "Your items will be shipped to multiple addresses."
3488
+ }
3489
+ ],
3364
3490
  "shipping_address.title.shipping_address": [
3365
3491
  {
3366
3492
  "type": 0,
@@ -3373,6 +3499,12 @@
3373
3499
  "value": "Save & Continue to Shipping Method"
3374
3500
  }
3375
3501
  ],
3502
+ "shipping_address_form.button.save": [
3503
+ {
3504
+ "type": 0,
3505
+ "value": "Save"
3506
+ }
3507
+ ],
3376
3508
  "shipping_address_form.heading.edit_address": [
3377
3509
  {
3378
3510
  "type": 0,
@@ -3409,10 +3541,124 @@
3409
3541
  "value": "Edit Shipping Address"
3410
3542
  }
3411
3543
  ],
3412
- "shipping_options.action.send_as_a_gift": [
3544
+ "shipping_multi_address.add_new_address.aria_label": [
3545
+ {
3546
+ "type": 0,
3547
+ "value": "Add new delivery address for "
3548
+ },
3549
+ {
3550
+ "type": 1,
3551
+ "value": "productName"
3552
+ }
3553
+ ],
3554
+ "shipping_multi_address.error.duplicate_address": [
3555
+ {
3556
+ "type": 0,
3557
+ "value": "The address you entered already exists."
3558
+ }
3559
+ ],
3560
+ "shipping_multi_address.error.label": [
3561
+ {
3562
+ "type": 0,
3563
+ "value": "Something went wrong while loading products."
3564
+ }
3565
+ ],
3566
+ "shipping_multi_address.error.message": [
3567
+ {
3568
+ "type": 0,
3569
+ "value": "Something went wrong while loading products. Try again."
3570
+ }
3571
+ ],
3572
+ "shipping_multi_address.error.save_failed": [
3573
+ {
3574
+ "type": 0,
3575
+ "value": "Couldn't save the address."
3576
+ }
3577
+ ],
3578
+ "shipping_multi_address.error.submit_failed": [
3413
3579
  {
3414
3580
  "type": 0,
3415
- "value": "Do you want to send this as a gift?"
3581
+ "value": "Something went wrong while setting up shipments. Try again."
3582
+ }
3583
+ ],
3584
+ "shipping_multi_address.format.address_line_2": [
3585
+ {
3586
+ "type": 1,
3587
+ "value": "city"
3588
+ },
3589
+ {
3590
+ "type": 0,
3591
+ "value": ", "
3592
+ },
3593
+ {
3594
+ "type": 1,
3595
+ "value": "stateCode"
3596
+ },
3597
+ {
3598
+ "type": 0,
3599
+ "value": " "
3600
+ },
3601
+ {
3602
+ "type": 1,
3603
+ "value": "postalCode"
3604
+ }
3605
+ ],
3606
+ "shipping_multi_address.image.alt": [
3607
+ {
3608
+ "type": 0,
3609
+ "value": "Product image for "
3610
+ },
3611
+ {
3612
+ "type": 1,
3613
+ "value": "productName"
3614
+ }
3615
+ ],
3616
+ "shipping_multi_address.loading.message": [
3617
+ {
3618
+ "type": 0,
3619
+ "value": "Loading..."
3620
+ }
3621
+ ],
3622
+ "shipping_multi_address.loading_addresses": [
3623
+ {
3624
+ "type": 0,
3625
+ "value": "Loading addresses..."
3626
+ }
3627
+ ],
3628
+ "shipping_multi_address.no_addresses_available": [
3629
+ {
3630
+ "type": 0,
3631
+ "value": "No address available"
3632
+ }
3633
+ ],
3634
+ "shipping_multi_address.product_attributes.label": [
3635
+ {
3636
+ "type": 0,
3637
+ "value": "Product attributes"
3638
+ }
3639
+ ],
3640
+ "shipping_multi_address.quantity.label": [
3641
+ {
3642
+ "type": 0,
3643
+ "value": "Quantity"
3644
+ }
3645
+ ],
3646
+ "shipping_multi_address.submit.description": [
3647
+ {
3648
+ "type": 0,
3649
+ "value": "Continue to next step with selected delivery addresses"
3650
+ }
3651
+ ],
3652
+ "shipping_multi_address.submit.loading": [
3653
+ {
3654
+ "type": 0,
3655
+ "value": "Setting up shipments..."
3656
+ }
3657
+ ],
3658
+ "shipping_multi_address.success.address_saved": [
3659
+ {
3660
+ "type": 0,
3661
+ "value": "Address saved successfully"
3416
3662
  }
3417
3663
  ],
3418
3664
  "shipping_options.button.continue_to_payment": [
@@ -3421,6 +3667,34 @@
3421
3667
  "value": "Continue to Payment"
3422
3668
  }
3423
3669
  ],
3670
+ "shipping_options.free": [
3671
+ {
3672
+ "type": 0,
3673
+ "value": "Free"
3674
+ }
3675
+ ],
3676
+ "shipping_options.label.no_method_selected": [
3677
+ {
3678
+ "type": 0,
3679
+ "value": "No shipping method selected"
3680
+ }
3681
+ ],
3682
+ "shipping_options.label.shipping_to": [
3683
+ {
3684
+ "type": 0,
3685
+ "value": "Shipping to "
3686
+ },
3687
+ {
3688
+ "type": 1,
3689
+ "value": "name"
3690
+ }
3691
+ ],
3692
+ "shipping_options.label.total_shipping": [
3693
+ {
3694
+ "type": 0,
3695
+ "value": "Total Shipping"
3696
+ }
3697
+ ],
3424
3698
  "shipping_options.title.shipping_gift_options": [
3425
3699
  {
3426
3700
  "type": 0,
@@ -3477,6 +3751,12 @@
3477
3751
  "value": " to proceed."
3478
3752
  }
3479
3753
  ],
3754
+ "store_display.button.use_recent_store": [
3755
+ {
3756
+ "type": 0,
3757
+ "value": "Use Recent Store"
3758
+ }
3759
+ ],
3480
3760
  "store_display.format.address_line_2": [
3481
3761
  {
3482
3762
  "type": 1,
@@ -3749,6 +4029,12 @@
3749
4029
  "value": "Edit Shipping Address"
3750
4030
  }
3751
4031
  ],
4032
+ "toggle_card.action.editShippingAddresses": [
4033
+ {
4034
+ "type": 0,
4035
+ "value": "Edit Shipping Addresses"
4036
+ }
4037
+ ],
3752
4038
  "toggle_card.action.editShippingOptions": [
3753
4039
  {
3754
4040
  "type": 0,