@shopgate/engage 7.27.3-alpha.17 → 7.27.3-alpha.18
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.
- package/a11y/action-creators/index.js +9 -0
- package/a11y/components/FocusTrap/index.js +1 -0
- package/a11y/components/LiveMessage/index.js +1 -1
- package/a11y/components/LiveMessenger/helpers.js +1 -1
- package/a11y/components/LiveMessenger/index.js +2 -2
- package/a11y/components/ModalStateTracker/index.js +14 -0
- package/a11y/components/Navigation/index.js +1 -1
- package/a11y/components/Section/index.js +3 -3
- package/a11y/components/VisuallyHidden/index.js +1 -1
- package/a11y/components/index.js +1 -1
- package/a11y/constants/index.js +1 -0
- package/a11y/helpers/index.js +1 -0
- package/a11y/hooks/index.js +37 -0
- package/a11y/index.js +1 -4
- package/a11y/reducers/index.js +6 -0
- package/a11y/selectors/index.js +8 -0
- package/a11y/styles.js +2 -0
- package/account/actions/addContacts.js +4 -0
- package/account/actions/deleteContact.js +5 -0
- package/account/actions/deleteCustomer.js +4 -0
- package/account/actions/fetchContacts.js +4 -0
- package/account/actions/fetchCustomer.js +4 -0
- package/account/actions/updateContact.js +4 -0
- package/account/actions/updateCustomer.js +4 -0
- package/account/components/Account/Account.connector.js +5 -0
- package/account/components/Account/Account.js +4 -0
- package/account/components/Account/Account.style.js +1 -0
- package/account/components/Account/index.js +1 -0
- package/account/components/Profile/Profile.config.js +11 -0
- package/account/components/Profile/Profile.constraints.js +1 -0
- package/account/components/Profile/Profile.js +1 -0
- package/account/components/Profile/Profile.provider.js +22 -0
- package/account/components/Profile/ProfileAddressBook.js +6 -0
- package/account/components/Profile/ProfileAddressCard.js +3 -0
- package/account/components/Profile/ProfileForm.js +3 -0
- package/account/components/Profile/ProfileHeader.js +3 -0
- package/account/components/Profile/index.js +1 -0
- package/account/components/ProfileContact/ProfileContact.config.js +11 -0
- package/account/components/ProfileContact/ProfileContact.constraints.js +5 -0
- package/account/components/ProfileContact/ProfileContact.js +13 -0
- package/account/components/ProfileContact/index.js +1 -0
- package/account/components/index.js +1 -0
- package/account/constants/actions.js +1 -0
- package/account/constants/index.js +1 -1
- package/account/constants/pipelines.js +1 -0
- package/account/helper/form.js +61 -0
- package/account/index.js +1 -1
- package/account/reducers/index.js +6 -0
- package/account/selectors/contacts.js +7 -0
- package/account/selectors/customer.js +7 -0
- package/app-rating/actions/showModal.js +3 -3
- package/app-rating/helpers/index.js +1 -1
- package/app-rating/subscriptions/index.js +11 -6
- package/back-in-stock/actions/index.js +1 -1
- package/back-in-stock/components/BackInStockButton/index.js +3 -3
- package/back-in-stock/components/CharacteristicsButton/index.js +1 -1
- package/back-in-stock/components/ProductInfoBackInStockButton/index.js +1 -1
- package/back-in-stock/components/Subscriptions/components/List/index.js +2 -2
- package/back-in-stock/components/Subscriptions/components/Subscription/index.js +2 -2
- package/back-in-stock/components/Subscriptions/index.js +1 -1
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -1
- package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +1 -1
- package/back-in-stock/selectors/index.js +5 -3
- package/back-in-stock/streams/index.js +1 -1
- package/back-in-stock/subscriptions/index.js +2 -2
- package/cart/cart.constants.js +1 -0
- package/cart/cart.context.js +1 -0
- package/cart/cart.helpers.js +15 -0
- package/cart/cart.hooks.js +4 -0
- package/cart/cart.selectors.js +34 -0
- package/cart/cart.types.js +1 -0
- package/cart/components/CartHeaderWide/CartHeaderWide.js +3 -0
- package/cart/components/CartHeaderWide/CartHeaderWide.style.js +1 -0
- package/cart/components/CartHeaderWide/index.js +1 -0
- package/cart/components/CartItem/CartItem.hooks.js +7 -0
- package/cart/components/CartItem/CartItem.js +7 -0
- package/cart/components/CartItem/CartItem.style.js +1 -0
- package/cart/components/CartItem/CartItemCoupon.connector.js +7 -0
- package/cart/components/CartItem/CartItemCoupon.js +20 -0
- package/cart/components/CartItem/CartItemCoupon.style.js +5 -0
- package/cart/components/CartItem/CartItemCoupon.types.js +0 -0
- package/cart/components/CartItem/CartItemCouponCode.js +5 -0
- package/cart/components/CartItem/CartItemCouponDelete.js +5 -0
- package/cart/components/CartItem/CartItemCouponDelete.style.js +1 -0
- package/cart/components/CartItem/CartItemCouponFreeShipping.js +5 -0
- package/cart/components/CartItem/CartItemCouponIcon.js +4 -0
- package/cart/components/CartItem/CartItemCouponLayout.js +6 -0
- package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -0
- package/cart/components/CartItem/CartItemCouponPrice.js +5 -0
- package/cart/components/CartItem/CartItemCouponPrice.style.js +1 -0
- package/cart/components/CartItem/CartItemCouponTitle.js +5 -0
- package/cart/components/CartItem/CartItemCouponTitle.style.js +1 -0
- package/cart/components/CartItem/CartItemProduct.js +5 -0
- package/cart/components/CartItem/CartItemProduct.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayout.js +6 -0
- package/cart/components/CartItem/CartItemProductLayout.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWide.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.style.js +1 -0
- package/cart/components/CartItem/CartItemProductLayoutWideOrderDetails.js +3 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +4 -0
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.style.js +1 -0
- package/cart/components/CartItem/CartItemProductOrderDetails.js +3 -0
- package/cart/components/CartItem/CartItemProductOrderDetails.style.js +1 -0
- package/cart/components/CartItem/CartItemProductPriceCaption.js +4 -0
- package/cart/components/CartItem/CartItemProductPriceCaption.style.js +1 -0
- package/cart/components/CartItem/CartItemProductPriceList.js +5 -0
- package/cart/components/CartItem/CartItemProductPriceListPromotion.js +10 -0
- package/cart/components/CartItem/CartItemProductProvider.connector.js +9 -0
- package/cart/components/CartItem/CartItemProductProvider.context.js +1 -0
- package/cart/components/CartItem/CartItemProductProvider.js +12 -0
- package/cart/components/CartItem/CartItemProductProvider.types.js +1 -0
- package/cart/components/CartItem/CartItemProductProviderLegacy.js +22 -0
- package/cart/components/CartItem/CartItemProductTitle.js +7 -0
- package/cart/components/CartItem/CartItemProductTitle.style.js +1 -0
- package/cart/components/CartItem/CartItemProvider.connector.js +3 -0
- package/cart/components/CartItem/CartItemProvider.context.js +1 -0
- package/cart/components/CartItem/CartItemProvider.js +5 -0
- package/cart/components/CartItem/CartItemQuantityPicker.js +38 -0
- package/cart/components/CartItem/CartItemQuantityPicker.style.js +1 -0
- package/cart/components/CartItem/CartItemSubstitution.connector.js +5 -0
- package/cart/components/CartItem/CartItemSubstitution.js +5 -0
- package/cart/components/CartItem/CartItemSubstitution.style.js +1 -0
- package/cart/components/CartItem/index.js +1 -0
- package/cart/components/CartItems/CartItem.connector.js +4 -0
- package/cart/components/CartItems/CartItemCard.js +5 -0
- package/cart/components/CartItems/CartItemCard.style.js +1 -0
- package/cart/components/CartItems/CartItemCardReservation.js +5 -0
- package/cart/components/CartItems/CartItemCardReservationAccordion.js +4 -0
- package/cart/components/CartItems/CartItemCardReservationLabel.js +5 -0
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +3 -0
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.style.js +1 -0
- package/cart/components/CartItems/CartItemGroup.js +5 -0
- package/cart/components/CartItems/CartItemGroup.style.js +1 -0
- package/cart/components/CartItems/CartItemGroupReservation.js +5 -0
- package/cart/components/CartItems/CartItemGroupReservationLabel.js +5 -0
- package/cart/components/CartItems/CartItemGroupShipping.js +4 -0
- package/cart/components/CartItems/CartItems.js +5 -0
- package/cart/components/CartItems/CartItems.style.js +1 -0
- package/cart/components/CartItems/CartItemsHeaderWide.connector.js +3 -0
- package/cart/components/CartItems/CartItemsHeaderWide.js +3 -0
- package/cart/components/CartItems/CartItemsHeaderWide.style.js +1 -0
- package/cart/components/CartItems/CartItemsSubscription.connector.js +5 -0
- package/cart/components/CartItems/CartItemsSubstitution.js +5 -0
- package/cart/components/CartItems/index.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.connector.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWide.style.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.connector.js +5 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +4 -0
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -0
- package/cart/components/CartSummaryWide/CartSummaryWideFooter.js +3 -0
- package/cart/components/CartSummaryWide/index.js +1 -0
- package/cart/components/PaymentBar/PaymentBar.js +5 -0
- package/cart/components/PaymentBar/PaymentBarAppliedPromotions.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarAppliedPromotions.js +3 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +5 -0
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -0
- package/cart/components/PaymentBar/PaymentBarContent.js +4 -0
- package/cart/components/PaymentBar/PaymentBarContent.style.js +1 -0
- package/cart/components/PaymentBar/PaymentBarDiscounts.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarDiscounts.js +4 -0
- package/cart/components/PaymentBar/PaymentBarGrandTotal.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarGrandTotal.js +4 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +4 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCoupons.connector.js +8 -0
- package/cart/components/PaymentBar/PaymentBarPromotionCoupons.js +3 -0
- package/cart/components/PaymentBar/PaymentBarPromotionalText.js +4 -0
- package/cart/components/PaymentBar/PaymentBarReserveButton.connector.js +1 -0
- package/cart/components/PaymentBar/PaymentBarReserveButton.js +7 -0
- package/cart/components/PaymentBar/PaymentBarShippingCost.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarShippingCost.js +3 -0
- package/cart/components/PaymentBar/PaymentBarSubTotal.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarSubTotal.js +3 -0
- package/cart/components/PaymentBar/PaymentBarTax.connector.js +5 -0
- package/cart/components/PaymentBar/PaymentBarTax.js +4 -0
- package/cart/components/PaymentBar/index.js +1 -0
- package/cart/components/Substitution/connector.js +5 -0
- package/cart/components/Substitution/index.js +9 -0
- package/cart/components/Substitution/style.js +1 -0
- package/cart/components/SupplementalContent/SupplementalContent.connector.js +4 -0
- package/cart/components/SupplementalContent/SupplementalContent.js +5 -0
- package/cart/components/SupplementalContent/SupplementalContent.styles.js +1 -0
- package/cart/components/SupplementalContent/index.js +1 -0
- package/cart/index.js +10 -5
- package/cart/streams/index.js +1 -0
- package/category/actions/index.js +1 -0
- package/category/components/CategoryImage/connector.js +5 -0
- package/category/components/CategoryImage/index.js +5 -0
- package/category/components/CategoryList/index.js +2 -2
- package/category/components/CategoryList/style.js +1 -1
- package/category/components/index.js +1 -0
- package/category/constants/index.js +1 -0
- package/category/helpers/index.js +1 -0
- package/category/index.js +1 -7
- package/category/selectors/index.js +2 -0
- package/category/streams/index.js +1 -0
- package/checkout/action-creators/addCheckoutCampaign.js +5 -0
- package/checkout/action-creators/clearCheckoutCampaign.js +5 -0
- package/checkout/action-creators/clearCheckoutOrder.js +4 -0
- package/checkout/action-creators/index.js +1 -0
- package/checkout/action-creators/validationErrorsCheckout.js +5 -0
- package/checkout/actions/errorCheckout.js +17 -0
- package/checkout/actions/fetchCheckoutOrder.js +4 -0
- package/checkout/actions/fetchPaymentMethods.js +4 -0
- package/checkout/actions/index.js +1 -0
- package/checkout/actions/initializeCheckout.js +4 -0
- package/checkout/actions/prepareCheckout.js +8 -0
- package/checkout/actions/submitCheckoutOrder.js +5 -0
- package/checkout/actions/updateCheckoutOrder.js +5 -0
- package/checkout/components/AddressBook/AddressBook.js +5 -0
- package/checkout/components/AddressBook/AddressList.js +9 -0
- package/checkout/components/AddressBook/index.js +1 -0
- package/checkout/components/AddressBookContact/AddressBookContact.js +5 -0
- package/checkout/components/AddressBookContact/index.js +1 -0
- package/checkout/components/Checkout/Checkout.js +4 -0
- package/checkout/components/Checkout/CheckoutActions.js +4 -0
- package/checkout/components/Checkout/CheckoutAddress.js +6 -0
- package/checkout/components/Checkout/CheckoutHeader.js +4 -0
- package/checkout/components/Checkout/CheckoutPickupContactForm.config.js +8 -0
- package/checkout/components/Checkout/CheckoutPickupContactForm.js +4 -0
- package/checkout/components/Checkout/CheckoutSection.js +4 -0
- package/checkout/components/Checkout/CheckoutSectionInfo.js +4 -0
- package/checkout/components/Checkout/CheckoutSectionMessages.js +4 -0
- package/checkout/components/Checkout/CheckoutSummary.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.connector.js +3 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +7 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderContact.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationOrderSummary.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickUpContact.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationPickupNotes.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationSection.js +4 -0
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationShippedTo.js +4 -0
- package/checkout/components/CheckoutConfirmation/index.js +1 -0
- package/checkout/components/GuestCheckout/GuestCheckout.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutOptIn.config.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutOptIn.js +3 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickup.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.config.js +4 -0
- package/checkout/components/GuestCheckout/GuestCheckoutPickupNotes.js +4 -0
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +5 -0
- package/checkout/components/PaymentMethodButton/index.js +1 -0
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +4 -0
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.style.js +1 -0
- package/checkout/components/ResponsiveBackButton/index.js +1 -0
- package/checkout/components/ShippingMethods/ShippingMethod.js +5 -0
- package/checkout/components/ShippingMethods/ShippingMethods.js +23 -0
- package/checkout/components/ShippingMethods/connector.js +7 -0
- package/checkout/components/ShippingMethods/index.js +1 -0
- package/checkout/components/SupplementalContent/SupplementalContent.connector.js +4 -0
- package/checkout/components/SupplementalContent/SupplementalContent.js +5 -0
- package/checkout/components/SupplementalContent/SupplementalContent.styles.js +1 -0
- package/checkout/components/SupplementalContent/index.js +1 -0
- package/checkout/components/index.js +1 -0
- package/checkout/constants/actionTypes.js +1 -0
- package/checkout/constants/errorCodes.js +1 -0
- package/checkout/constants/index.js +1 -0
- package/checkout/constants/routes.js +1 -0
- package/checkout/helpers/index.js +34 -0
- package/checkout/hooks/common.js +7 -0
- package/checkout/index.js +6 -5
- package/checkout/paymentMethods/context.js +1 -0
- package/checkout/paymentMethods/index.js +28 -0
- package/checkout/paymentMethods/paypal/PaypalButton.js +5 -0
- package/checkout/paymentMethods/paypal/PaypalButtonApp.js +4 -0
- package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +8 -0
- package/checkout/paymentMethods/paypal/PaypalPayButton.js +12 -0
- package/checkout/paymentMethods/paypal/PaypalProvider.js +6 -0
- package/checkout/paymentMethods/paypal/index.js +1 -0
- package/checkout/paymentMethods/paypal/paypal_logo.png +0 -0
- package/checkout/paymentMethods/paypal/sdk.js +9 -0
- package/checkout/paymentMethods/stripe/StripeButton.connector.js +6 -0
- package/checkout/paymentMethods/stripe/StripeButton.js +5 -0
- package/checkout/paymentMethods/stripe/StripeCreditCard.js +10 -0
- package/checkout/paymentMethods/stripe/StripePayButton.js +6 -0
- package/checkout/paymentMethods/stripe/StripeProvider.connector.js +6 -0
- package/checkout/paymentMethods/stripe/StripeProvider.context.js +1 -0
- package/checkout/paymentMethods/stripe/StripeProvider.js +33 -0
- package/checkout/paymentMethods/stripe/applepay.svg +84 -0
- package/checkout/paymentMethods/stripe/googlepay.png +0 -0
- package/checkout/paymentMethods/stripe/index.js +1 -0
- package/checkout/paymentMethods/stripe/sdk.js +9 -0
- package/checkout/providers/AddressBookProvider.context.js +1 -0
- package/checkout/providers/AddressBookProvider.js +11 -0
- package/checkout/providers/CheckoutProvider.connector.js +7 -0
- package/checkout/providers/CheckoutProvider.constraints.js +1 -0
- package/checkout/providers/CheckoutProvider.context.js +1 -0
- package/checkout/providers/CheckoutProvider.js +28 -0
- package/checkout/reducers/index.js +6 -0
- package/checkout/selectors/campaign.js +5 -0
- package/checkout/selectors/guestCheckout.js +5 -0
- package/checkout/selectors/order.js +59 -0
- package/checkout/selectors/payment.js +17 -0
- package/checkout/selectors/route.js +4 -0
- package/checkout/streams/index.js +1 -0
- package/checkout/subscriptions/index.js +3 -0
- package/components/BrandingColorBanner/BrandingColorBanner.js +5 -0
- package/components/BrandingColorBanner/index.js +1 -0
- package/components/ChipLayout/index.js +7 -7
- package/components/ChipLayout/spec.js +1 -1
- package/components/ChipLayout/style.js +2 -2
- package/components/ConditionalWrapper/ConditionalWrapper.js +10 -0
- package/components/ConditionalWrapper/index.js +1 -5
- package/components/ConnectedReactPortal/index.js +13 -0
- package/components/Footer/Footer.js +4 -23
- package/components/Footer/Footer.style.js +1 -7
- package/components/Footer/constants.js +1 -0
- package/components/Footer/helpers.js +75 -0
- package/components/Form/Builder/Builder.constants.js +1 -1
- package/components/Form/Builder/Builder.js +53 -37
- package/components/Form/Builder/ElementCheckbox.js +2 -2
- package/components/Form/Builder/ElementMultiSelect.js +6 -0
- package/components/Form/Builder/ElementPhoneNumber.js +20 -0
- package/components/Form/Builder/ElementRadio.js +2 -2
- package/components/Form/Builder/ElementSelect.js +3 -3
- package/components/Form/Builder/ElementText.js +4 -4
- package/components/Form/Builder/FormHelper.js +5 -0
- package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
- package/components/Form/Builder/classes/ActionListener.js +72 -15
- package/components/Form/Builder/helpers/buildCountryList.js +3 -3
- package/components/Form/Builder/helpers/buildFormDefaults.js +1 -1
- package/components/Form/Builder/helpers/buildProvinceList.js +1 -1
- package/components/Form/Builder/helpers/common.js +6 -0
- package/components/Form/Builder/stylePresets.js +1 -0
- package/components/Form/Form.js +11 -8
- package/components/Form/index.js +1 -1
- package/components/IntersectionVisibility/index.js +13 -6
- package/components/Logo/connector.js +4 -0
- package/components/Logo/index.js +2 -2
- package/components/Logo/spec.js +1 -1
- package/components/Logo/style.js +1 -1
- package/components/Menu/components/Item/index.js +8 -0
- package/components/Menu/components/Item/style.js +4 -0
- package/components/Menu/components/Position/index.js +16 -0
- package/components/Menu/components/Position/style.js +1 -0
- package/components/Menu/index.js +12 -0
- package/components/Menu/style.js +1 -0
- package/components/MessageBar/MessageBar.js +9 -0
- package/components/MessageBar/MessageBar.style.js +11 -0
- package/components/MessageBar/index.js +1 -7
- package/components/NavigationHandler/connector.js +1 -1
- package/components/NavigationHandler/index.js +6 -6
- package/components/NavigationHandler/spec.js +1 -1
- package/components/Picker/components/Button/index.js +1 -1
- package/components/Picker/components/List/index.js +2 -2
- package/components/Picker/components/Modal/index.js +7 -7
- package/components/Picker/index.js +19 -10
- package/components/Picker/spec.js +2 -2
- package/components/PickerUtilize/components/Button/index.js +1 -1
- package/components/PickerUtilize/index.js +8 -6
- package/components/PickerUtilize/spec.js +2 -1
- package/components/QuantityInput/QuantityInput.js +5 -4
- package/components/QuantityLabel/QuantityLabel.js +4 -0
- package/components/QuantityLabel/index.js +1 -0
- package/components/Radio/Radio.js +5 -0
- package/components/Radio/index.js +1 -0
- package/components/RadioCard/RadioCard.js +9 -0
- package/components/RadioCard/index.js +1 -0
- package/components/RadioGroup/RadioGroup.context.js +1 -0
- package/components/RadioGroup/RadioGroup.js +4 -0
- package/components/RadioGroup/index.js +1 -0
- package/components/RadioGroup/useRadioGroup.js +4 -0
- package/components/RangeSlider/components/Handle/index.js +2 -2
- package/components/RangeSlider/components/Handle/style.js +1 -1
- package/components/RangeSlider/helper.js +3 -3
- package/components/RangeSlider/index.js +35 -23
- package/components/RangeSlider/spec.js +4 -4
- package/components/ResponsiveContainer/ResponsiveContainer.js +6 -0
- package/components/ResponsiveContainer/breakpoints.js +14 -0
- package/components/ResponsiveContainer/condition.js +6 -0
- package/components/ResponsiveContainer/hooks.js +20 -0
- package/components/ResponsiveContainer/index.js +1 -0
- package/components/ResponsiveContainer/listener.js +10 -0
- package/components/ResponsiveContainer/mediaQuery.js +8 -0
- package/components/ScrollHeader/index.js +22 -5
- package/components/ScrollHeader/style.js +1 -1
- package/components/SheetDrawer/index.js +4 -3
- package/components/SheetList/components/Item/index.js +5 -5
- package/components/SheetList/components/Item/spec.js +2 -2
- package/components/SheetList/components/Item/style.js +1 -1
- package/components/SheetList/index.js +4 -4
- package/components/SheetList/spec.js +1 -1
- package/components/SheetList/style.js +1 -1
- package/components/SideNavigation/SideNavigation.hooks.js +4 -0
- package/components/SideNavigation/SideNavigation.js +4 -0
- package/components/SideNavigation/SideNavigationCategories.connector.js +8 -0
- package/components/SideNavigation/SideNavigationCategories.js +4 -0
- package/components/SideNavigation/SideNavigationCategories.style.js +1 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.connector.js +8 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.js +5 -0
- package/components/SideNavigation/SideNavigationCategoriesItem.style.js +2 -0
- package/components/SideNavigation/SideNavigationCategoriesItemChildren.js +5 -0
- package/components/SideNavigation/SideNavigationContent.js +3 -0
- package/components/SideNavigation/SideNavigationContent.style.js +4 -0
- package/components/SideNavigation/SideNavigationItem.js +4 -0
- package/components/SideNavigation/SideNavigationItem.style.js +4 -0
- package/components/SideNavigation/SideNavigationLinks.js +4 -0
- package/components/SideNavigation/SideNavigationLinksLegal.connector.js +4 -0
- package/components/SideNavigation/SideNavigationLinksLegal.js +5 -0
- package/components/SideNavigation/SideNavigationLinksQuicklinks.connector.js +4 -0
- package/components/SideNavigation/SideNavigationLinksQuicklinks.js +5 -0
- package/components/SideNavigation/SideNavigationNestedItem.js +4 -0
- package/components/SideNavigation/SideNavigationProvider.connector.js +8 -0
- package/components/SideNavigation/SideNavigationProvider.context.js +1 -0
- package/components/SideNavigation/SideNavigationProvider.js +4 -0
- package/components/SideNavigation/index.js +1 -0
- package/components/SideNavigation/selectors.js +17 -0
- package/components/SnackBarContainer/index.js +1 -1
- package/components/Switch/index.js +1 -1
- package/components/Tabs/TabContext.js +7 -0
- package/components/Tabs/components/Tab.js +11 -0
- package/components/Tabs/components/Tab.style.js +1 -0
- package/components/Tabs/components/TabIndicator.js +5 -0
- package/components/Tabs/components/TabIndicator.style.js +1 -0
- package/components/Tabs/components/TabPanel.js +5 -0
- package/components/Tabs/components/Tabs.js +11 -0
- package/components/Tabs/components/Tabs.style.js +2 -0
- package/components/Tabs/debounce.js +11 -0
- package/components/Tabs/index.js +1 -0
- package/components/Tabs/ownerDocument.js +4 -0
- package/components/Tabs/ownerWindow.js +4 -0
- package/components/Tabs/useEventCallback.js +6 -0
- package/components/TextLink/TextLink.js +5 -0
- package/components/TextLink/TextLink.style.js +1 -0
- package/components/TimeBoundary/index.js +10 -8
- package/components/TimeBoundary/spec.js +3 -3
- package/components/Toggle/index.js +5 -0
- package/components/Toggle/style.js +1 -0
- package/components/VideoPlayer/index.js +9 -6
- package/components/View/components/Above/index.js +1 -1
- package/components/View/components/Below/index.js +1 -1
- package/components/View/components/Content/index.js +13 -13
- package/components/View/components/Content/style.js +1 -1
- package/components/View/context.js +1 -1
- package/components/View/index.js +5 -5
- package/components/View/provider.js +24 -7
- package/components/View/style.js +1 -6
- package/components/index.js +4 -4
- package/core/action-creators/appPermissions.js +1 -1
- package/core/action-creators/index.js +1 -1
- package/core/action-creators/merchantSettings.js +5 -0
- package/core/action-creators/optIns.js +37 -0
- package/core/action-creators/shopSettings.js +9 -0
- package/core/actions/getGeolocation.js +2 -2
- package/core/actions/grantAppTrackingTransparencyPermission.js +3 -1
- package/core/actions/grantGeolocationPermissions.js +6 -2
- package/core/actions/grantPermissions.js +16 -4
- package/core/actions/grantPushPermissions.js +4 -3
- package/core/actions/index.js +2 -2
- package/core/actions/requestAppPermission.js +7 -2
- package/core/actions/requestAppPermissionStatus.js +7 -2
- package/core/actions/updateStatusBarBackground.js +3 -3
- package/core/classes/GeolocationRequest.js +8 -4
- package/core/classes/GeolocationRequestApp.js +16 -0
- package/core/classes/GeolocationRequestBrowser.js +8 -0
- package/core/collections/AppInitialization.js +4 -6
- package/core/config/ThemeConfigResolver.js +3 -3
- package/core/config/config.action-creators.js +12 -0
- package/core/config/config.actions.js +3 -0
- package/core/config/config.constants.js +1 -0
- package/core/config/config.reducers.js +6 -0
- package/core/config/config.selectors.js +39 -0
- package/core/config/config.streams.js +1 -0
- package/core/config/config.subscriptions.js +4 -0
- package/core/config/config.types.js +0 -0
- package/core/config/index.js +1 -0
- package/core/constants/appFeatures.js +1 -1
- package/core/constants/deviceTypes.js +1 -0
- package/core/constants/geolocationRequest.js +1 -1
- package/core/constants/index.js +3 -3
- package/core/constants/merchantSettings.js +1 -0
- package/core/constants/optIns.js +1 -0
- package/core/constants/pipelines.js +1 -0
- package/core/constants/shopSettings.js +2 -0
- package/core/contexts/AppContext.js +1 -1
- package/core/contexts/ThemeResourcesContext.d.ts +60 -0
- package/core/contexts/ThemeResourcesContext.js +3 -0
- package/core/contexts/index.js +1 -0
- package/core/events/index.js +1 -0
- package/core/helpers/androidNavigationBar.js +12 -0
- package/core/helpers/appFeatures.js +21 -9
- package/core/helpers/appPermissions.js +58 -0
- package/core/helpers/baseUrl.js +1 -1
- package/core/helpers/bridge.js +4 -0
- package/core/helpers/deviceType.js +5 -0
- package/core/helpers/environment.js +4 -0
- package/core/helpers/errorBehavior.js +32 -0
- package/core/helpers/featureFlag.js +11 -0
- package/core/helpers/getFullImageSource.js +21 -2
- package/core/helpers/googleMaps.js +8 -0
- package/core/helpers/i18n.js +10 -5
- package/core/helpers/index.js +3 -3
- package/core/helpers/isIOSTheme.js +4 -0
- package/core/helpers/isTouchDevice.js +4 -0
- package/core/helpers/nl2br.js +1 -0
- package/core/helpers/scrollContainer.js +4 -0
- package/core/helpers/string.js +9 -0
- package/core/helpers/svgToDataUrl.js +9 -0
- package/core/helpers/updateLegacyNavigationBar.js +5 -2
- package/core/hocs/index.js +1 -0
- package/core/hocs/withApp.js +1 -1
- package/core/hocs/withCurrentProduct.js +3 -3
- package/core/hocs/withForwardedRef.js +1 -1
- package/core/hocs/withNavigation.js +1 -1
- package/core/hocs/withRoute.js +1 -1
- package/core/hocs/withTheme.js +42 -3
- package/core/hocs/withThemeResources.js +16 -0
- package/core/hocs/withWidgetSettings.js +1 -1
- package/core/hocs/withWidgetStyles.js +1 -1
- package/core/hooks/events/index.js +1 -0
- package/core/hooks/events/useLongPress.d.ts +68 -0
- package/core/hooks/events/useLongPress.js +13 -0
- package/core/hooks/events/useScrollDirectionChange.d.ts +74 -0
- package/core/hooks/events/useScrollDirectionChange.js +18 -0
- package/core/hooks/html/useLoadImage.js +1 -1
- package/core/hooks/index.js +1 -0
- package/core/hooks/layout/index.js +1 -0
- package/core/hooks/layout/useElementSize.d.ts +46 -0
- package/core/hooks/layout/useElementSize.js +18 -0
- package/core/hooks/useAsyncMemo.js +12 -0
- package/core/hooks/useFormState.js +27 -0
- package/core/hooks/usePrevious.js +2 -0
- package/core/hooks/useScrollTo.js +5 -0
- package/core/hooks/useTheme.js +38 -2
- package/core/hooks/useThemeResources.js +21 -0
- package/core/hooks/useWidgetStyles.js +1 -1
- package/core/index.js +5 -11
- package/core/initialization/index.js +19 -4
- package/core/providers/AppProvider.js +9 -9
- package/core/providers/ThemeResourcesProvider.js +15 -0
- package/core/providers/index.js +1 -0
- package/core/reducers/index.js +1 -1
- package/core/reducers/merchantSettings.js +6 -0
- package/core/reducers/shopSettings.js +6 -0
- package/core/selectors/index.js +1 -1
- package/core/selectors/merchantSettings.js +10 -0
- package/core/selectors/shopSettings.js +25 -0
- package/core/streams/app.js +1 -1
- package/core/streams/index.js +1 -1
- package/core/streams/optIns.js +13 -0
- package/core/subscriptions/app.js +4 -3
- package/core/validation/index.js +1 -0
- package/core/validation/validation.hooks.js +4 -0
- package/core/validation/validation.js +12 -0
- package/development/action-creators/index.js +1 -0
- package/development/action-creators/settings.js +9 -0
- package/development/action-creators/storage.js +6 -0
- package/development/components/DevelopmentTools/DevelopmentTools.js +6 -0
- package/development/components/DevelopmentTools/Shortcuts.js +4 -0
- package/development/components/DevelopmentTools/hooks.js +8 -0
- package/development/components/DevelopmentTools/index.js +1 -0
- package/development/components/SimulatedInsets/SimulatedInsetBottom.js +7 -0
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +12 -0
- package/development/components/SimulatedInsets/SimulatedInsets.js +6 -0
- package/development/components/SimulatedInsets/index.js +1 -0
- package/development/components/index.js +1 -0
- package/development/constants/actionTypes.js +1 -0
- package/development/constants/index.js +1 -0
- package/development/reducers/index.js +1 -0
- package/development/reducers/settings.js +10 -0
- package/development/reducers/storage.js +9 -0
- package/development/selectors/index.js +1 -0
- package/development/selectors/settings.js +21 -0
- package/development/selectors/storage.js +16 -0
- package/development/streams/index.js +1 -0
- package/development/streams/insets.js +4 -0
- package/development/subscriptions/index.js +6 -0
- package/favorites/components/CommentDialog/CommentDialog.js +12 -0
- package/favorites/components/CommentDialog/index.js +1 -0
- package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +8 -0
- package/favorites/components/FavoriteButtonWide/index.js +1 -0
- package/favorites/components/Item/Item.js +13 -9
- package/favorites/components/Item/ItemCharacteristics.js +2 -2
- package/favorites/components/Item/ItemNotes.js +7 -0
- package/favorites/components/Item/ItemQuantity.js +7 -0
- package/favorites/components/ItemFulfillmentMethod/ItemFulfillmentMethod.js +4 -0
- package/favorites/components/ItemFulfillmentMethod/index.js +1 -0
- package/favorites/components/List/List.js +19 -15
- package/favorites/components/List/ListAccordionHeader.js +8 -0
- package/favorites/components/List/ListAccordionLabel.js +5 -0
- package/favorites/components/List/ListContent.js +8 -0
- package/favorites/components/List/ListItemWrapper.js +6 -0
- package/favorites/components/List/styles.js +1 -0
- package/favorites/components/ListChooser/ListChooser.js +2 -2
- package/favorites/components/ListChooser/ListChooserItem.js +4 -5
- package/favorites/components/Lists/Lists.js +17 -13
- package/favorites/components/Lists/ListsModal.js +3 -4
- package/favorites/components/RemoveButton/RemoveButton.js +2 -2
- package/favorites/constants/Portals.js +1 -2
- package/favorites/constants/index.js +1 -0
- package/favorites/index.js +2 -2
- package/filter/actions/index.js +1 -0
- package/filter/components/FilterItem/index.js +2 -2
- package/filter/components/FilterItem/spec.js +1 -1
- package/filter/components/FilterPageContent/components/ApplyButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/ApplyButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/ApplyButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/ResetButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/ResetButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/ResetButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Selected/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/index.js +7 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/style.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/index.js +19 -0
- package/filter/components/FilterPageContent/components/Selector/spec.js +1 -0
- package/filter/components/FilterPageContent/components/Selector/style.js +1 -0
- package/filter/components/FilterPageContent/index.js +6 -0
- package/filter/components/FilterPageContentWithProvider/index.js +16 -0
- package/filter/components/PriceSlider/components/Label/index.js +3 -3
- package/filter/components/PriceSlider/components/Label/spec.js +1 -1
- package/filter/components/PriceSlider/index.js +8 -8
- package/filter/components/PriceSlider/spec.js +1 -1
- package/filter/components/PriceSlider/style.js +1 -1
- package/filter/components/index.js +1 -0
- package/filter/constants/index.js +1 -0
- package/filter/constants/sort.js +11 -0
- package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +2 -2
- package/filter/helpers/buildInitialFilters.js +2 -2
- package/filter/helpers/buildUpdatedFilters.js +2 -2
- package/filter/helpers/index.js +1 -0
- package/filter/helpers/translateFilterLabel.js +3 -3
- package/filter/hocs/index.js +1 -0
- package/filter/hocs/withSort.js +16 -0
- package/filter/hooks/filterPage.js +5 -0
- package/filter/hooks/index.js +4 -0
- package/filter/index.js +2 -7
- package/filter/providers/FilterPageProvider.context.js +54 -0
- package/filter/providers/FilterPageProvider.js +98 -0
- package/filter/providers/SortProvider.connector.js +3 -0
- package/filter/providers/SortProvider.context.js +1 -0
- package/filter/providers/SortProvider.helpers.js +8 -0
- package/filter/providers/SortProvider.js +6 -0
- package/filter/providers/index.js +1 -0
- package/filter/selectors/index.js +17 -0
- package/filter/streams/index.js +1 -0
- package/i18n/countries.helpers.js +6 -0
- package/i18n/countries.hooks.js +6 -0
- package/i18n/index.js +1 -0
- package/i18n/locale/cs-cz/countries.json +255 -0
- package/i18n/locale/de-de/countries.json +255 -0
- package/i18n/locale/el-gr/countries.json +255 -0
- package/i18n/locale/en-us/countries.json +255 -0
- package/i18n/locale/es-es/countries.json +255 -0
- package/i18n/locale/fi-fi/countries.json +255 -0
- package/i18n/locale/fr-fr/countries.json +255 -0
- package/i18n/locale/hu-hu/countries.json +255 -0
- package/i18n/locale/it-it/countries.json +255 -0
- package/i18n/locale/nl-nl/countries.json +255 -0
- package/i18n/locale/pl-pl/countries.json +255 -0
- package/i18n/locale/pt-pt/countries.json +255 -0
- package/i18n/locale/ro-ro/countries.json +255 -0
- package/i18n/locale/sv-se/countries.json +255 -0
- package/locations/action-creators/errorInventories.js +7 -0
- package/locations/action-creators/errorLocations.js +6 -0
- package/locations/action-creators/errorProductInventories.js +7 -0
- package/locations/action-creators/errorProductLocations.js +6 -0
- package/locations/action-creators/index.js +1 -0
- package/locations/action-creators/provideProductAlternativeLocation.js +5 -0
- package/locations/action-creators/receiveInventories.js +5 -0
- package/locations/action-creators/receiveLocations.js +6 -0
- package/locations/action-creators/receiveProductInventories.js +7 -0
- package/locations/action-creators/receiveProductLocations.js +7 -0
- package/locations/action-creators/requestInventories.js +6 -0
- package/locations/action-creators/requestLocations.js +5 -0
- package/locations/action-creators/requestProductInventories.js +6 -0
- package/locations/action-creators/requestProductLocations.js +5 -0
- package/locations/action-creators/selectGlobalLocation.js +5 -0
- package/locations/action-creators/selectLocation.js +6 -0
- package/locations/action-creators/setStoreFinderSearchRadius.js +5 -0
- package/locations/action-creators/setUserGeolocation.js +5 -0
- package/locations/action-creators/setUserSearchCountryCode.js +7 -0
- package/locations/action-creators/setUserSearchGeolocation.js +8 -0
- package/locations/action-creators/setUserSearchPostalCode.js +7 -0
- package/locations/action-creators/storeFormInput.js +5 -0
- package/locations/action-creators/storeFulfillmentMethod.js +5 -0
- package/locations/action-creators/submitReservationError.js +5 -0
- package/locations/action-creators/submitReservationRequest.js +5 -0
- package/locations/action-creators/submitReservationSuccess.js +5 -0
- package/locations/actions/fetchDefaultLocation.js +4 -0
- package/locations/actions/fetchFulfillmentSlots.js +6 -0
- package/locations/actions/fetchInventories.js +6 -0
- package/locations/actions/fetchLocations.js +19 -0
- package/locations/actions/fetchProductInventories.js +7 -0
- package/locations/actions/fetchProductLocations.js +12 -0
- package/locations/actions/index.js +5 -0
- package/locations/actions/sendDefaultLocationCode.js +6 -0
- package/locations/actions/setUserGeolocation.js +1 -0
- package/locations/actions/setUserSearchGeolocation.js +1 -0
- package/locations/actions/submitReservation.js +5 -0
- package/locations/assets/leaflet.css +765 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.connector.js +4 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.js +8 -0
- package/locations/components/Cart/CartChangeFulfillmentMethod.types.js +0 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillment.js +6 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +5 -0
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.style.js +1 -0
- package/locations/components/Cart/CartContextMenuItemChangeFulfillment.connector.js +4 -0
- package/locations/components/Cart/CartContextMenuItemChangeFulfillment.js +6 -0
- package/locations/components/Cart/CartContextMenuItemChangeLocation.js +7 -0
- package/locations/components/Cart/CartItemProductChangeLocation.connector.js +5 -0
- package/locations/components/Cart/CartItemProductChangeLocation.js +11 -0
- package/locations/components/Cart/CartItemProductChangeLocation.types.js +0 -0
- package/locations/components/Cart/index.js +1 -0
- package/locations/components/ChangeLocationButton/ChangeLocationButton.js +4 -0
- package/locations/components/ChangeLocationButton/ChangeLocationButton.style.js +2 -0
- package/locations/components/ChangeLocationButton/index.js +1 -0
- package/locations/components/FulfillmentPath/FulfillmentPath.js +4 -0
- package/locations/components/FulfillmentPath/FulfillmentPath.style.js +2 -0
- package/locations/components/FulfillmentPath/FulfillmentPathItem.js +6 -0
- package/locations/components/FulfillmentPath/index.js +1 -0
- package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.js +14 -0
- package/locations/components/FulfillmentPathSelector/FulfillmentPathSelector.style.js +1 -0
- package/locations/components/FulfillmentPathSelector/index.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.connector.js +9 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.context.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.hooks.js +3 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.js +20 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelector.types.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +10 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +8 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorBOPIS.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorDirectShip.js +5 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.js +8 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.js +4 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.style.js +1 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocationMethodNotAvailable.js +3 -0
- package/locations/components/FulfillmentSelector/FulfillmentSelectorROPIS.js +4 -0
- package/locations/components/FulfillmentSelector/index.js +1 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheet.js +6 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheet.style.js +1 -0
- package/locations/components/FulfillmentSheet/FulfillmentSheetContent.js +6 -0
- package/locations/components/FulfillmentSheet/index.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +28 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.connector.js +8 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.context.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.js +9 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.connector.js +4 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +4 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +3 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.style.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +3 -0
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.style.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/index.js +1 -0
- package/locations/components/FulfillmentSlotSwitcher/time.js +5 -0
- package/locations/components/GlobalLocationSelector/GlobalLocationSelector.js +16 -0
- package/locations/components/GlobalLocationSelector/index.js +1 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.connector.js +8 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.style.js +1 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +3 -0
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.style.js +1 -0
- package/locations/components/GlobalLocationSwitcher/index.js +1 -0
- package/locations/components/ReservationResponses/ReservationError.js +4 -0
- package/locations/components/ReservationResponses/ReservationResponse.style.js +1 -0
- package/locations/components/ReservationResponses/ReservationSuccess.js +4 -0
- package/locations/components/ReservationResponses/index.js +1 -0
- package/locations/components/ReserveForm/ReserveForm.constraints.js +1 -0
- package/locations/components/ReserveForm/ReserveForm.js +10 -0
- package/locations/components/ReserveForm/ReserveForm.style.js +1 -0
- package/locations/components/ReserveForm/ReserveFormPhone.connector.js +3 -0
- package/locations/components/ReserveForm/ReserveFormPhone.js +5 -0
- package/locations/components/ReserveForm/ReserveFormPhone.types.js +0 -0
- package/locations/components/ReserveForm/index.js +1 -0
- package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -0
- package/locations/components/StockInfo/StockInfo.js +8 -0
- package/locations/components/StockInfo/StockInfoInventory.js +9 -0
- package/locations/components/StockInfo/index.js +1 -0
- package/locations/components/StockInfoLists/index.js +9 -0
- package/locations/components/StoreDetails/components/FindMoreStores.js +4 -0
- package/locations/components/StoreDetails/components/GetDirectionsButton.js +7 -0
- package/locations/components/StoreDetails/components/StoreDetails.js +5 -0
- package/locations/components/StoreDetails/components/StoreFinderMap.js +20 -0
- package/locations/components/StoreDetails/components/StoreFinderMap.style.js +1 -0
- package/locations/components/StoreDetails/components/StoreLocationMap.js +4 -0
- package/locations/components/StoreDetails/components/StoresNearby.js +4 -0
- package/locations/components/StoreDetails/components/StoresNearbyListItem.js +9 -0
- package/locations/components/StoreDetails/index.js +4 -0
- package/locations/components/StoreFinder/Store.context.js +1 -0
- package/locations/components/StoreFinder/StoreFinder.js +3 -0
- package/locations/components/StoreFinder/StoreFinder.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.connector.js +4 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +4 -0
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocation.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocation.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationDetails.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocationDetails.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeader.js +3 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeader.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderLocationHeaderPhoneNumber.js +4 -0
- package/locations/components/StoreFinder/StoreFinderLocations.js +5 -0
- package/locations/components/StoreFinder/StoreFinderLocations.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderSearch.js +3 -0
- package/locations/components/StoreFinder/StoreFinderSearch.style.js +1 -0
- package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +5 -0
- package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +8 -0
- package/locations/components/StoreFinder/index.js +1 -0
- package/locations/components/StoreList/Store.context.js +1 -0
- package/locations/components/StoreList/Store.style.js +1 -0
- package/locations/components/StoreList/StoreAddress.js +7 -0
- package/locations/components/StoreList/StoreAddressShort.js +7 -0
- package/locations/components/StoreList/StoreCard.js +4 -0
- package/locations/components/StoreList/StoreDetails.js +4 -0
- package/locations/components/StoreList/StoreDetailsLine.js +8 -0
- package/locations/components/StoreList/StoreDistance.js +7 -0
- package/locations/components/StoreList/StoreHeader.js +4 -0
- package/locations/components/StoreList/StoreHoursToday.js +7 -0
- package/locations/components/StoreList/StoreList.js +4 -0
- package/locations/components/StoreList/StoreListLocations.js +4 -0
- package/locations/components/StoreList/StoreListProduct.js +4 -0
- package/locations/components/StoreList/StoreListProduct.style.js +1 -0
- package/locations/components/StoreList/StoreListProductInfo.js +4 -0
- package/locations/components/StoreList/StoreListProductName.js +4 -0
- package/locations/components/StoreList/StoreListSearch.connector.js +7 -0
- package/locations/components/StoreList/StoreListSearch.js +23 -0
- package/locations/components/StoreList/StoreListSearch.style.js +1 -0
- package/locations/components/StoreList/StoreListSearchRadius.connector.js +7 -0
- package/locations/components/StoreList/StoreListSearchRadius.js +4 -0
- package/locations/components/StoreList/StoreListSearchRadius.style.js +1 -0
- package/locations/components/StoreList/StoreOpeningHours.js +7 -0
- package/locations/components/StoreList/StoreOpeningHoursLine.js +7 -0
- package/locations/components/StoreList/StorePhoneNumber.js +6 -0
- package/locations/components/StoreList/StoreSelectLocationButton.js +4 -0
- package/locations/components/StoreList/index.js +1 -0
- package/locations/components/index.js +1 -0
- package/locations/constants/ActionTypes.js +10 -0
- package/locations/constants/Pipelines.js +1 -0
- package/locations/constants/Portals.js +2 -0
- package/locations/constants/Stages.js +1 -0
- package/locations/constants/index.js +7 -0
- package/locations/constants/routes.js +1 -0
- package/locations/helpers/createOrder.js +28 -0
- package/locations/helpers/formatDistance.js +9 -0
- package/locations/helpers/getAvailabilitySettings.js +12 -0
- package/locations/helpers/index.js +1 -0
- package/locations/helpers/productInventory.js +7 -0
- package/locations/helpers/showInventoryInLists.js +7 -0
- package/locations/index.js +9 -0
- package/locations/locations.context.js +1 -0
- package/locations/locations.hooks.js +4 -0
- package/locations/locations.streams.js +1 -0
- package/locations/locations.types.js +1 -0
- package/locations/providers/FulfillmentProvider.connector.js +10 -0
- package/locations/providers/FulfillmentProvider.js +49 -0
- package/locations/providers/FulfillmentProvider.types.js +1 -0
- package/locations/providers/StoreDetailsContext.js +1 -0
- package/locations/providers/StoreDetailsProvider.js +4 -0
- package/locations/providers/StoreFinder.connector.js +3 -0
- package/locations/providers/StoreFinderProvider.js +7 -0
- package/locations/providers/index.js +1 -0
- package/locations/reducers/index.js +1 -0
- package/locations/reducers/storage.js +24 -0
- package/locations/reducers/storeFinderSearch.js +6 -0
- package/locations/reducers/user.js +5 -0
- package/locations/reducers/userFormInput.js +8 -0
- package/locations/reducers/userSearch.js +6 -0
- package/locations/selectors/index.js +145 -0
- package/locations/subscriptions.js +27 -0
- package/login/action-creators/index.js +1 -0
- package/login/action-creators/resetPassword.js +14 -0
- package/login/actions/index.js +1 -0
- package/login/actions/resetPassword.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.connector.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.js +5 -0
- package/login/components/ForgotPassword/ForgotPassword.style.js +1 -0
- package/login/components/ForgotPassword/index.js +1 -0
- package/login/constants/actions.js +1 -0
- package/login/constants/index.js +1 -0
- package/login/constants/pipelines.js +1 -0
- package/login/constants/routes.js +1 -0
- package/login/index.js +1 -0
- package/orders/action-creators/index.js +1 -0
- package/orders/action-creators/orderDetails.js +22 -0
- package/orders/action-creators/orders.js +21 -0
- package/orders/actions/cancelOrder.js +8 -0
- package/orders/actions/fetchOrderDetails.js +10 -0
- package/orders/actions/fetchOrderHistory.js +7 -0
- package/orders/actions/index.js +1 -0
- package/orders/components/OrderDetails/OrderDetails.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsAuthenticateForm.config.js +8 -0
- package/orders/components/OrderDetails/OrderDetailsContent.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsContent.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrder.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrder.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrderHeader.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrderHeader.style.js +1 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.connector.js +3 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.js +4 -0
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.style.js +1 -0
- package/orders/components/OrderDetails/index.js +1 -0
- package/orders/components/OrderHistory/OrderHistory.js +4 -0
- package/orders/components/OrderHistory/OrderHistory.style.js +1 -0
- package/orders/components/OrderHistory/OrderHistoryList.js +9 -0
- package/orders/components/OrderHistory/OrderHistoryList.style.js +1 -0
- package/orders/components/OrderHistory/OrderHistoryLoader.js +4 -0
- package/orders/components/OrderHistory/OrderHistoryTable.js +9 -0
- package/orders/components/OrderHistory/OrderHistoryTable.style.js +1 -0
- package/orders/components/OrderHistory/index.js +1 -0
- package/orders/components/index.js +1 -0
- package/orders/constants/actionTypes.js +1 -0
- package/orders/constants/index.js +1 -0
- package/orders/constants/pipelines.js +1 -0
- package/orders/constants/routes.js +1 -0
- package/orders/constants/status.js +12 -0
- package/orders/helpers/index.js +1 -0
- package/orders/helpers/orderDetails.js +5 -0
- package/orders/helpers/orderStatus.js +15 -0
- package/orders/hooks/index.js +7 -0
- package/orders/index.js +1 -1
- package/orders/providers/OrderDetailsPrivateProvider.connector.js +11 -0
- package/orders/providers/OrderDetailsPrivateProvider.js +5 -0
- package/orders/providers/OrderDetailsProvider.connector.js +11 -0
- package/orders/providers/OrderDetailsProvider.constraints.js +1 -0
- package/orders/providers/OrderDetailsProvider.context.js +1 -0
- package/orders/providers/OrderDetailsProvider.js +11 -0
- package/orders/providers/OrderHistoryProvider.connector.js +9 -0
- package/orders/providers/OrderHistoryProvider.context.js +1 -0
- package/orders/providers/OrderHistoryProvider.js +4 -0
- package/orders/reducers/index.js +1 -0
- package/orders/reducers/orders.js +7 -0
- package/orders/reducers/ordersById.js +7 -0
- package/orders/reducers/ordersByNumber.js +7 -0
- package/orders/selectors/index.js +27 -0
- package/orders/subscriptions/index.js +4 -0
- package/package.json +26 -18
- package/page/actions/index.js +1 -0
- package/page/components/NotFound.js +3 -0
- package/page/components/index.js +1 -0
- package/page/index.js +2 -4
- package/page/selectors/index.js +7 -0
- package/product/collections/index.js +1 -0
- package/product/components/Availability/Availability.connector.js +5 -0
- package/product/components/Availability/Availability.js +6 -0
- package/product/components/Availability/Availability.style.js +1 -0
- package/product/components/Availability/index.js +1 -0
- package/product/components/Characteristics/Characteristic/components/Sheet/index.js +16 -4
- package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +8 -3
- package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -1
- package/product/components/Characteristics/Characteristic/index.js +15 -6
- package/product/components/Characteristics/Characteristic/style.js +1 -1
- package/product/components/Characteristics/Swatch/index.js +8 -6
- package/product/components/Characteristics/index.js +10 -3
- package/product/components/Characteristics/transition.js +1 -1
- package/product/components/Description/index.js +5 -6
- package/product/components/Description/style.js +1 -1
- package/product/components/EffectivityDates/helpers.js +5 -5
- package/product/components/EffectivityDates/index.js +2 -2
- package/product/components/EffectivityDates/style.js +1 -1
- package/product/components/Header/PriceStriked/index.js +2 -5
- package/product/components/Header/PriceStriked/style.js +1 -1
- package/product/components/Header/Shipping/components/Label/index.js +3 -3
- package/product/components/Header/Shipping/components/Label/style.js +1 -1
- package/product/components/Header/Shipping/index.js +1 -1
- package/product/components/Header/Shipping/spec.js +1 -1
- package/product/components/Header/Tiers/components/Tier/index.js +2 -2
- package/product/components/Header/Tiers/components/Tier/spec.js +1 -1
- package/product/components/Header/Tiers/index.js +1 -1
- package/product/components/Header/Tiers/spec.js +1 -1
- package/product/components/Header/index.js +1 -0
- package/product/components/MapPriceHint/index.js +1 -1
- package/product/components/Media/FeaturedMedia.js +2 -2
- package/product/components/Media/MediaImage.js +3 -3
- package/product/components/Media/MediaPlaceholder.js +1 -1
- package/product/components/MediaSlider/components/MediaImage/index.js +1 -1
- package/product/components/MediaSlider/components/MediaVideo/index.js +1 -1
- package/product/components/MediaSlider/index.js +4 -4
- package/product/components/Options/components/Content/index.js +8 -8
- package/product/components/Options/components/Content/spec.js +2 -2
- package/product/components/Options/components/Option/index.js +2 -2
- package/product/components/Options/components/TextOption/components/OptionInfo/index.js +3 -3
- package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -1
- package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -1
- package/product/components/Options/components/TextOption/index.js +19 -7
- package/product/components/Options/components/TextOption/style.js +1 -1
- package/product/components/Options/index.js +2 -2
- package/product/components/OrderQuantityHint/index.js +3 -2
- package/product/components/OrderQuantityHint/style.js +1 -1
- package/product/components/PriceDifference/index.js +1 -1
- package/product/components/PriceDifference/style.js +1 -1
- package/product/components/PriceInfo/PriceInfo.connector.js +4 -0
- package/product/components/PriceInfo/PriceInfo.js +4 -0
- package/product/components/PriceInfo/index.js +1 -0
- package/product/components/ProductBadges/index.js +2 -2
- package/product/components/ProductCard/index.js +12 -3
- package/product/components/ProductCard/style.js +1 -1
- package/product/components/ProductCharacteristics/context.js +1 -1
- package/product/components/ProductCharacteristics/helpers/index.js +1 -1
- package/product/components/ProductCharacteristics/index.js +30 -16
- package/product/components/ProductDiscountBadge/index.js +2 -2
- package/product/components/ProductDiscountBadge/spec.js +2 -2
- package/product/components/ProductDiscountBadge/style.js +1 -1
- package/product/components/ProductGridPrice/index.js +3 -3
- package/product/components/ProductGridPrice/style.js +1 -1
- package/product/components/ProductImage/ProductImagePlaceholder.js +5 -0
- package/product/components/ProductImage/connector.js +5 -0
- package/product/components/ProductImage/index.js +17 -13
- package/product/components/ProductImage/spec.js +1 -1
- package/product/components/ProductList/components/Item/index.js +2 -2
- package/product/components/ProductList/components/Iterator/index.js +1 -1
- package/product/components/ProductList/components/Layout/index.js +1 -1
- package/product/components/ProductList/index.js +2 -2
- package/product/components/ProductName/ProductName.js +4 -0
- package/product/components/ProductName/ProductNameContent.js +4 -0
- package/product/components/ProductName/index.js +1 -0
- package/product/components/ProductProperties/Content.js +4 -4
- package/product/components/ProductProperties/Group.js +1 -1
- package/product/components/ProductProperties/GroupedProperties.js +2 -2
- package/product/components/ProductProperties/Lists.js +1 -1
- package/product/components/ProductProperties/ListsHTML.js +5 -0
- package/product/components/ProductProperties/ProductProperties.js +2 -2
- package/product/components/ProductProperties/Row.js +1 -1
- package/product/components/ProductProperties/RowHTML.js +5 -0
- package/product/components/ProductProperties/Rows.js +2 -2
- package/product/components/ProductProperties/Wrapper.js +1 -1
- package/product/components/ProductProperties/helpers/getGroupsFromProperties.js +7 -2
- package/product/components/ProductProperties/style.js +1 -1
- package/product/components/ProductSlider/index.js +3 -2
- package/product/components/ProductSlider/spec.js +1 -1
- package/product/components/ProductVariants/VariantAvailability.connector.js +5 -0
- package/product/components/ProductVariants/VariantAvailability.js +5 -0
- package/product/components/ProductVariants/index.js +1 -0
- package/product/components/QuantityPicker/hooks.js +5 -0
- package/product/components/QuantityPicker/index.js +4 -3
- package/product/components/Rating/index.js +3 -3
- package/product/components/Rating/spec.js +2 -2
- package/product/components/RelationsSlider/RelationsSheet.js +2 -2
- package/product/components/RelationsSlider/RelationsSlider.js +1 -1
- package/product/components/RelationsSlider/RelationsSliderContent.js +1 -1
- package/product/components/RelationsSlider/style.js +1 -1
- package/product/components/Swatch/Swatch.js +1 -1
- package/product/components/Swatch/SwatchContent.js +1 -1
- package/product/components/Swatch/VariantSwatch.js +1 -1
- package/product/components/Swatch/style.js +1 -1
- package/product/components/Swatches/Swatches.js +1 -1
- package/product/components/UnitQuantityPicker/CartUnitQuantityPicker.js +4 -0
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +3 -6
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +11 -13
- package/product/components/UnitQuantityPicker/UnitQuantityPickerWithSection.js +5 -2
- package/product/components/UnitQuantityPicker/index.js +1 -1
- package/product/components/UnitQuantityPicker/styles.js +1 -0
- package/product/components/context.js +1 -1
- package/product/components/index.js +1 -0
- package/product/constants/index.js +2 -1
- package/product/contexts/index.js +1 -0
- package/product/helpers/index.js +2 -2
- package/product/helpers/redirects.js +2 -2
- package/product/hocs/index.js +1 -0
- package/product/hocs/withMapPricing.js +4 -4
- package/product/hocs/withPriceCalculation.js +2 -2
- package/product/hocs/withProduct.js +6 -0
- package/product/hocs/withProductListEntry.js +1 -1
- package/product/hocs/withProductListEntryProduct.js +12 -0
- package/product/hocs/withProductListType.js +1 -1
- package/product/hooks/index.js +1 -0
- package/product/hooks/useLoadProductImage.js +1 -1
- package/product/index.js +4 -11
- package/product/product.types.js +0 -0
- package/product/{components/ProductProvider → providers/Product}/index.js +1 -1
- package/product/providers/ProductListEntry/context.js +1 -1
- package/product/providers/ProductListEntry/index.js +1 -1
- package/product/providers/ProductListType/context.js +2 -1
- package/product/providers/ProductListType/index.js +2 -1
- package/product/providers/index.js +1 -0
- package/product/selectors/product.js +75 -6
- package/product/selectors/variants.js +4 -1
- package/product/streams/index.js +1 -0
- package/push-opt-in/action-creators/pushOptIn.js +2 -1
- package/push-opt-in/actions/pushOptInModal.js +3 -3
- package/push-opt-in/components/PushOptInModal/index.js +3 -6
- package/push-opt-in/components/PushOptInModal/push-opt-in.svg +58 -58
- package/push-opt-in/reducers/optInModal.js +2 -2
- package/push-opt-in/reducers/optInTrigger.js +2 -2
- package/push-opt-in/selectors/optInModal.js +5 -2
- package/push-opt-in/selectors/optInTrigger.js +4 -2
- package/push-opt-in/subscriptions/index.js +1 -1
- package/push-opt-in/subscriptions/optInTracking.js +4 -0
- package/push-opt-in/subscriptions/optInTrigger.js +6 -6
- package/registration/action-creators/index.js +18 -0
- package/registration/actions/index.js +1 -0
- package/registration/actions/submitRegistration.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistration.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistrationContent.js +4 -0
- package/registration/components/GuestRegistration/GuestRegistrationFormPickup.config.js +8 -0
- package/registration/components/GuestRegistration/GuestRegistrationFormPickup.js +4 -0
- package/registration/components/Registration/Registration.js +4 -0
- package/registration/components/Registration/RegistrationContent.js +4 -0
- package/registration/components/Registration/RegistrationContent.style.js +2 -0
- package/registration/components/Registration/RegistrationFormActions.js +5 -0
- package/registration/components/Registration/RegistrationFormBase.config.js +4 -0
- package/registration/components/Registration/RegistrationFormBase.js +4 -0
- package/registration/components/Registration/RegistrationFormBilling.config.js +5 -0
- package/registration/components/Registration/RegistrationFormBilling.js +5 -0
- package/registration/components/Registration/RegistrationFormExtra.config.js +5 -0
- package/registration/components/Registration/RegistrationFormExtra.js +5 -0
- package/registration/components/Registration/RegistrationFormShipping.config.js +5 -0
- package/registration/components/Registration/RegistrationFormShipping.js +5 -0
- package/registration/components/Registration/RegistrationFormToggle.js +4 -0
- package/registration/components/index.js +1 -0
- package/registration/constants/actionTypes.js +1 -0
- package/registration/constants/index.js +1 -0
- package/registration/constants/pipelines.js +1 -0
- package/registration/hooks/index.js +5 -0
- package/registration/index.js +2 -0
- package/registration/providers/GuestRegistrationProvider.actions.js +4 -0
- package/registration/providers/GuestRegistrationProvider.connector.js +7 -0
- package/registration/providers/GuestRegistrationProvider.constraints.js +18 -0
- package/registration/providers/GuestRegistrationProvider.context.js +1 -0
- package/registration/providers/GuestRegistrationProvider.js +22 -0
- package/registration/providers/RegistrationProvider.actions.js +8 -0
- package/registration/providers/RegistrationProvider.connector.js +6 -0
- package/registration/providers/RegistrationProvider.constraints.js +27 -0
- package/registration/providers/RegistrationProvider.context.js +1 -0
- package/registration/providers/RegistrationProvider.js +17 -0
- package/registration/streams/index.js +4 -0
- package/registration/subscriptions/index.js +5 -0
- package/reviews/actions/index.js +1 -0
- package/reviews/components/Reviews/components/AllReviewsLink/index.js +1 -1
- package/reviews/components/Reviews/components/Header/components/AverageRating/index.js +8 -6
- package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/style.js +1 -1
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +2 -2
- package/reviews/components/Reviews/components/Header/index.js +6 -4
- package/reviews/components/Reviews/components/Header/spec.js +2 -2
- package/reviews/components/Reviews/components/List/components/Info/components/Author/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Info/components/ReviewDate/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Info/index.js +2 -2
- package/reviews/components/Reviews/components/List/components/Info/style.js +1 -1
- package/reviews/components/Reviews/components/List/components/Rating/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Review/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Text/index.js +1 -1
- package/reviews/components/Reviews/components/List/components/Title/index.js +1 -1
- package/reviews/components/Reviews/components/List/index.js +3 -3
- package/reviews/components/Reviews/components/List/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/spec.js +1 -1
- package/reviews/components/Reviews/components/RatingCount/style.js +1 -1
- package/reviews/components/Reviews/components/ReviewsInfo/index.js +3 -4
- package/reviews/components/Reviews/connector.js +2 -6
- package/reviews/components/Reviews/index.js +1 -1
- package/reviews/components/Reviews/mock.js +2 -6
- package/reviews/components/Reviews/spec.js +4 -3
- package/reviews/components/index.js +1 -0
- package/reviews/constants/index.js +1 -0
- package/reviews/index.js +3 -6
- package/reviews/selectors/index.js +1 -0
- package/reviews/streams/index.js +1 -0
- package/scanner/action-creators/index.js +1 -0
- package/scanner/actions/index.js +1 -0
- package/scanner/classes/index.js +1 -0
- package/scanner/constants/index.js +1 -0
- package/scanner/helpers/index.js +1 -0
- package/scanner/index.js +1 -6
- package/scanner/streams/index.js +1 -0
- package/search/actions/index.js +1 -0
- package/search/constants/index.js +1 -0
- package/search/helpers/index.js +1 -0
- package/search/index.js +1 -6
- package/search/selectors/index.js +1 -0
- package/search/streams/index.js +1 -0
- package/styles/helpers/cssCustomProperties.js +16 -0
- package/styles/helpers/index.js +1 -0
- package/styles/helpers/initCSSCustomProperties.js +10 -0
- package/styles/helpers/loadCustomStyles.js +6 -0
- package/styles/helpers/setPageBackgroundColor.js +5 -0
- package/styles/helpers/setPageContentWidth.js +5 -0
- package/styles/helpers/setViewportHeight.js +3 -0
- package/styles/helpers/toggleBodyScroll.js +5 -0
- package/styles/helpers/updatePageInsets.js +15 -0
- package/styles/index.js +1 -0
- package/styles/reset/form.js +8 -0
- package/styles/reset/index.js +1 -0
- package/styles/reset/media.js +1 -0
- package/styles/reset/root.js +3 -0
- package/styles/reset/table.js +1 -0
- package/styles/reset/typography.js +1 -0
- package/tracking/action-creators/cookieConsent.js +2 -2
- package/tracking/actions/cookieConsent.js +17 -5
- package/tracking/components/CookieConsentModal/connector.js +3 -5
- package/tracking/components/CookieConsentModal/index.js +3 -6
- package/tracking/components/CookieConsentModal/tracking-opt-in.svg +14 -14
- package/tracking/components/PrivacySettings/connector.js +3 -5
- package/tracking/components/PrivacySettings/index.js +2 -2
- package/tracking/helpers/index.js +1 -0
- package/tracking/selectors/cookieConsent.js +10 -5
- package/tracking/streams/cookieConsent.js +10 -3
- package/tracking/subscriptions/analytics.js +5 -4
- package/tracking/subscriptions/cookieConsent.js +6 -10
- package/types.js +0 -0
- package/user/index.js +2 -2
- package/user/selectors/data.js +10 -0
- package/components/MessageBar/spec.js +0 -1
- package/components/MessageBar/style.js +0 -2
- package/favorites/constants/constants.js +0 -1
- package/product/components/Characteristics/Characteristic/components/VariantAvailability/connector.js +0 -9
- package/product/components/Characteristics/Characteristic/components/VariantAvailability/index.js +0 -5
- package/product/components/QuantityPicker/helpers.js +0 -5
- /package/product/components/{Characteristics/Characteristic/components/VariantAvailability/style.js → ProductVariants/VariantAvailability.style.js} +0 -0
- /package/product/{components/ProductProvider → providers/Product}/connector.js +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{useState,useMemo,useEffect}from'react';import{addListener}from"./listener";import{parser}from"./breakpoints";var comparators={'>=':function _(from,to,width){return width>=from;},'>':function _(from,to,width){return width>=to;},'<':function _(from,to,width){return width<from;},'<=':function _(from,to,width){return width<to;},'':function _(from,to,width){return width>=from&&width<to;}};/**
|
|
2
|
+
* Custom hook to determine the visibility or value based on the current active breakpoint
|
|
3
|
+
* and provided conditions.
|
|
4
|
+
* It listens for changes in the viewport or platform breakpoints and returns a value.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} [breakpoint=">=xs"] - The breakpoint condition to match (e.g., '>=md', '<lg').
|
|
7
|
+
* @param {Object} [options={}] - Additional options for customizing behavior.
|
|
8
|
+
* @param {*} [options.valueMatch=true] - Return value when the provided conditions match.
|
|
9
|
+
* @param {*} [options.valueMiss=false] - Return value when the provided conditions do not match.
|
|
10
|
+
* @param {boolean} [options.webOnly=false] If true, the hook will only match in PWA website mode.
|
|
11
|
+
* @param {boolean} [options.webAlways=false] If true, the hook will always match in PWA website
|
|
12
|
+
* mode regardless of the breakpoint.
|
|
13
|
+
* @param {boolean} [options.appOnly=false] If true, the hook will only match in PWA app mode.
|
|
14
|
+
* @param {boolean} [options.appAlways=false] If true, the hook will always match in PWA app mode,
|
|
15
|
+
* regardless of the breakpoint.
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/export var useResponsiveValue=function useResponsiveValue(){var breakpoint=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'>=xs';var options=arguments.length>1?arguments[1]:undefined;var _valueMatch$valueMiss=_extends({valueMatch:true,valueMiss:false,appAlways:false,appOnly:false,webAlways:false,webOnly:false},options),webOnly=_valueMatch$valueMiss.webOnly,webAlways=_valueMatch$valueMiss.webAlways,appOnly=_valueMatch$valueMiss.appOnly,appAlways=_valueMatch$valueMiss.appAlways,valueMiss=_valueMatch$valueMiss.valueMiss,valueMatch=_valueMatch$valueMiss.valueMatch;// Active breakpoint used for triggering rerenders on resize.
|
|
18
|
+
var _useState=useState(null),_useState2=_slicedToArray(_useState,2),activeBreakpoint=_useState2[0],setActiveBreakpoint=_useState2[1];// Calculate if we have a match for the conditions
|
|
19
|
+
/* eslint-disable react-hooks/exhaustive-deps */var isMatch=useMemo(function(){var parsed=parser(comparators,breakpoint,{breakpoint:breakpoint,webOnly:webOnly,webAlways:webAlways,appOnly:appOnly,appAlways:appAlways});return parsed;},[activeBreakpoint,breakpoint]);/* eslint-enable react-hooks/exhaustive-deps */ // Watch for resize changes.
|
|
20
|
+
useEffect(function(){return addListener(function(newBreakpoint){setActiveBreakpoint(newBreakpoint);});},[]);return isMatch?valueMatch:valueMiss;};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default}from"./ResponsiveContainer";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import debounce from'lodash/debounce';import breakpoints from"./breakpoints";var listeners=[];/**
|
|
2
|
+
* Adds a new listener to breakpoint changes.
|
|
3
|
+
* @param {Function} cb The callback that shall be triggered.
|
|
4
|
+
* @returns {Function}
|
|
5
|
+
*/export var addListener=function addListener(cb){listeners.push(cb);return function(){listeners=listeners.filter(function(a){return a!==cb;});};};/**
|
|
6
|
+
* Calculates the active breakpoint.
|
|
7
|
+
* @returns {Object}
|
|
8
|
+
*/var getActiveBreakpoint=function getActiveBreakpoint(){return breakpoints.find(function(bp){return bp.from<=document.documentElement.clientWidth&&bp.to>=document.documentElement.clientWidth;});};var activeBreakpoint=getActiveBreakpoint();/**
|
|
9
|
+
* Handles any event that might cause a breakpoint change.
|
|
10
|
+
*/var handleEvent=function handleEvent(){var newBreakpoint=getActiveBreakpoint();if(activeBreakpoint.name!==newBreakpoint.name){activeBreakpoint=newBreakpoint;listeners.forEach(function(listener){return listener(newBreakpoint);});}};window.addEventListener('resize',debounce(handleEvent,200));window.addEventListener('orientationchange',handleEvent);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{parser}from"./breakpoints";var comparators={'>=':function _(from){return"@media (min-width: ".concat(from,"px)");},'>':function _(from,to){return"@media (min-width: ".concat(to,"px)");},'<':function _(from){return"@media (max-width: ".concat(from+1,"px)");},'<=':function _(from,to){return"@media (max-width: ".concat(to-1,"px)");},'':function _(from,to){return"@media (min-width: ".concat(from,"px) and (max-width: ").concat(to,"px)");}};/**
|
|
2
|
+
* Generates a media query for different breakpoints and platform.
|
|
3
|
+
* @param {string} breakpoint Breakpoint rule.
|
|
4
|
+
* @param {Object} params Parameters needed to generation.
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/export var responsiveMediaQuery=function responsiveMediaQuery(breakpoint){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var parsed=parser(comparators,breakpoint,params);// Return media query that never evaluates for now.
|
|
7
|
+
if(!parsed){return'@media (height: 0)';}// Return media query that evaluates always.
|
|
8
|
+
if(parsed===true){return'@media (min-height: 0)';}return parsed;};
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
function
|
|
2
|
-
*
|
|
3
|
-
* @param {Object} props props
|
|
4
|
-
* @returns {JSX}
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,forwardRef,useEffect}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{useScrollDirectionChange}from'@shopgate/engage/core/hooks';import{root,scrolledIn,scrolledOut,transition}from"./style";/* eslint-disable react/prop-types */ /**
|
|
2
|
+
* A container component that hides its content on scroll down and shows it on scroll up.
|
|
5
3
|
*
|
|
6
|
-
|
|
4
|
+
* @param {Object} props The component props.
|
|
5
|
+
* @param {boolean} [props.hideOnScroll] Toggle hide-on-scroll (default: true).
|
|
6
|
+
* @param {number} [props.scrollOffset] Pixels to scroll before toggling (default: 100).
|
|
7
|
+
* @param {boolean} [props.onlyShowAtTop] When set to true, the component content will not be shown
|
|
8
|
+
* till the user scrolls to the top of the page again.
|
|
9
|
+
* @param {number} [props.onlyShowAtTopOffset] Pixel threshold from the top of the page at which the
|
|
10
|
+
* component content will reappear when `showOnScrollToTop` is enabled. The content shows again once
|
|
11
|
+
* the scroll position is less than or equal to this value.
|
|
12
|
+
* @param {Function} [props.onChange] Callback function that is called when the header changes
|
|
13
|
+
* @param {string} [props.className] Extra CSS classes on the root element.
|
|
14
|
+
* @param {Object} [props.classes] Override internal class names.
|
|
15
|
+
* @param {string} [props.classes.scrolledIn] Override class for the scrolled-in state
|
|
16
|
+
* (content is hidden).
|
|
17
|
+
* @param {string} [props.classes.scrolledOut] Override class for the scrolled-out state
|
|
18
|
+
* (content is visible).
|
|
19
|
+
* visibility. Contains a boolean indicating whether the header is visible.
|
|
20
|
+
* @param {React.ReactNode} props.children Content of the header.
|
|
21
|
+
* @param {React.Ref<HTMLDivElement>} ref Forwarded ref to the header `<div>`.
|
|
22
|
+
* @returns {JSX.Element}
|
|
23
|
+
*/function ScrollHeaderBase(_ref,ref){var className=_ref.className,children=_ref.children,_ref$hideOnScroll=_ref.hideOnScroll,hideOnScroll=_ref$hideOnScroll===void 0?true:_ref$hideOnScroll,_ref$scrollOffset=_ref.scrollOffset,scrollOffset=_ref$scrollOffset===void 0?100:_ref$scrollOffset,_ref$onlyShowAtTop=_ref.onlyShowAtTop,onlyShowAtTop=_ref$onlyShowAtTop===void 0?false:_ref$onlyShowAtTop,_ref$onlyShowAtTopOff=_ref.onlyShowAtTopOffset,onlyShowAtTopOffset=_ref$onlyShowAtTopOff===void 0?0:_ref$onlyShowAtTopOff,onChange=_ref.onChange,classes=_ref.classes;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),shouldHideHeader=_useState2[0],setShouldHideHeader=_useState2[1];useScrollDirectionChange({enabled:hideOnScroll,offset:scrollOffset,onlyFireOnScrollUpAtTop:onlyShowAtTop,onlyFireOnScrollUpAtTopOffset:onlyShowAtTopOffset,onScrollDown:function onScrollDown(){setShouldHideHeader(true);},onScrollUp:function onScrollUp(){setShouldHideHeader(false);}});useEffect(function(){if(typeof onChange!=='function'){return;}onChange(!shouldHideHeader);},[onChange,shouldHideHeader]);return React.createElement("div",{ref:ref,className:classNames(root,transition,className,_defineProperty(_defineProperty({},classNames(scrolledIn,classes===null||classes===void 0?void 0:classes.scrolledIn),!shouldHideHeader),classNames(scrolledOut,classes===null||classes===void 0?void 0:classes.scrolledOut),shouldHideHeader))},children);}/* eslint-enable react/prop-types */var ScrollHeader=forwardRef(ScrollHeaderBase);ScrollHeader.displayName='ScrollHeader';ScrollHeader.propTypes={children:PropTypes.node.isRequired,classes:PropTypes.shape({scrolledIn:PropTypes.string,scrolledOut:PropTypes.string}),className:PropTypes.string,hideOnScroll:PropTypes.bool,onChange:PropTypes.func,onlyShowAtTop:PropTypes.bool,onlyShowAtTopOffset:PropTypes.number,scrollOffset:PropTypes.number};ScrollHeader.defaultProps={className:null,hideOnScroll:true,scrollOffset:100,classes:{},onChange:null,onlyShowAtTop:false,onlyShowAtTopOffset:0};export default ScrollHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css}from'glamor';export var scrolledIn=css({'&&':{transform:'translateY(0%)'}})
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';export var root=css(_defineProperty({position:'sticky',left:0,backgroundColor:'#fff'},responsiveMediaQuery('<=xs',{appAlways:true}),{boxShadow:'rgba(0, 0, 0, 0.118) 0px 1px 6px, rgba(0, 0, 0, 0.118) 0px 1px 4px'}));export var scrolledIn=css({'&&':{transform:'translateY(0%)'}});export var scrolledOut=css({'&&':{transform:'translateY(-250%)'}});export var transition=css({transition:'transform 0.2s ease,transform 0.2s'});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from'react';import{createPortal}from'react-dom';import
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{createPortal}from'react-dom';import classNames from'classnames';import{useTrackModalState}from'@shopgate/engage/a11y/hooks';import{Sheet}from'@shopgate/engage/components';var node=document.getElementById('portals');/**
|
|
2
2
|
* @param {Object} props The props to be passed to the Sheet.
|
|
3
|
-
* @returns {JSX}
|
|
4
|
-
*/function SheetDrawer(props){
|
|
3
|
+
* @returns {JSX.Element}
|
|
4
|
+
*/function SheetDrawer(props){// Track modal visibility for accessibility purposes.
|
|
5
|
+
useTrackModalState(props.isOpen);return createPortal(React.createElement(Sheet,_extends({},props,{className:classNames(props.className,'engage__sheet-drawer')})),node);}export default SheetDrawer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _typeof(obj){
|
|
1
|
+
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import{withForwardedRef}from'@shopgate/engage/core';import Grid from'@shopgate/pwa-common/components/Grid';import Link from'@shopgate/pwa-common/components/Link';import Glow from'@shopgate/pwa-ui-shared/Glow';import styles from"./style";/**
|
|
2
2
|
* The list item component.
|
|
3
|
-
*/var Item=/*#__PURE__*/function(_Component){
|
|
3
|
+
*/var Item=/*#__PURE__*/function(_Component){function Item(){_classCallCheck(this,Item);return _callSuper(this,Item,arguments);}_inherits(Item,_Component);return _createClass(Item,[{key:"shouldComponentUpdate",value:/**
|
|
4
4
|
* Should only update what the `selected` or `disabled` props change.
|
|
5
5
|
* @param {Object} nextProps The next set of component props.
|
|
6
6
|
* @returns {JSX}
|
|
@@ -8,10 +8,10 @@ function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeo
|
|
|
8
8
|
* Renders the bulk of the content.
|
|
9
9
|
* @param {boolean} [isNested=true] Tells if the content is rendered nested.
|
|
10
10
|
* @returns {JSX}
|
|
11
|
-
*/},{key:"renderContent",value:function renderContent(){var
|
|
11
|
+
*/},{key:"renderContent",value:function renderContent(){var isNested=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;var _this$props=this.props,isDisabled=_this$props.isDisabled,isSelected=_this$props.isSelected,title=_this$props.title,image=_this$props.image,rightComponent=_this$props.rightComponent,forwardedRef=_this$props.forwardedRef,description=_this$props.description;var gridStyles=_defineProperty(_defineProperty({},styles.grid,true),styles.selected,isSelected);var titleStyles=_defineProperty(_defineProperty({},styles.title,true),styles.disabled,isDisabled);var ref=isNested?null:forwardedRef;return React.createElement("div",{"data-test-id":this.props.testId,ref:ref,className:"engage__sheet-list__item"},React.createElement(Grid,{className:classNames(gridStyles),component:"div"},image!==null&&React.createElement("div",{className:styles.image},image),React.createElement(Grid.Item,{className:classNames(titleStyles),component:"div",grow:1},React.createElement("div",null,title),description&&React.createElement("div",{className:styles.description,dangerouslySetInnerHTML:{__html:description}})),rightComponent!==null&&React.createElement(Grid.Item,{component:"div",grow:1},rightComponent)));}/**
|
|
12
12
|
* @returns {JSX}
|
|
13
|
-
*/},{key:"render",value:function render(){var _this$props2=this.props,link=_this$props2.link,linkState=_this$props2.linkState,onClick=_this$props2.onClick,className=_this$props2.className,isDisabled=_this$props2.isDisabled,testId=_this$props2.testId,forwardedRef=_this$props2.forwardedRef,isSelected=_this$props2.isSelected;/**
|
|
13
|
+
*/},{key:"render",value:function render(){var _this$props2=this.props,link=_this$props2.link,linkState=_this$props2.linkState,LinkComponent=_this$props2.linkComponent,onClick=_this$props2.onClick,className=_this$props2.className,isDisabled=_this$props2.isDisabled,testId=_this$props2.testId,forwardedRef=_this$props2.forwardedRef,isSelected=_this$props2.isSelected;/**
|
|
14
14
|
* If this item is disabled, selected or doesn't have a valid
|
|
15
15
|
* link or click handler then wrap the content with other components.
|
|
16
16
|
*/if(isDisabled||!link&&!onClick){return this.renderContent(false);}// Wrap with a <Link> if the `link` prop is set.
|
|
17
|
-
if(link){return
|
|
17
|
+
if(link){return React.createElement(Glow,{ref:forwardedRef,className:className,styles:{hover:styles.glowHover}},React.createElement(LinkComponent,{href:link,onClick:onClick,state:linkState,tabIndex:0},this.renderContent()));}return React.createElement("div",{onKeyPress:function onKeyPress(){},onClick:onClick,"data-test-id":testId,ref:forwardedRef,tabIndex:0,role:"option","aria-selected":isSelected},React.createElement(Glow,{className:className,styles:{hover:styles.glowHover}},this.renderContent()));}}]);}(Component);_defineProperty(Item,"defaultProps",{className:null,description:null,forwardedRef:null,image:null,isDisabled:false,isSelected:false,link:null,linkState:null,onClick:null,rightComponent:null,linkComponent:Link,testId:null});export default withForwardedRef(Item);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import React from'react';import{mount}from'enzyme';import Glow from'@shopgate/pwa-ui-shared/Glow';import Item from"./index";jest.mock('@shopgate/pwa-common/components/Link',function(){/**
|
|
2
2
|
* Mocked LinkComponent.
|
|
3
3
|
* @return {JSX}
|
|
4
|
-
*/var Link=function Link(){return
|
|
4
|
+
*/var Link=function Link(){return React.createElement("div",null);};return Link;});describe('<SheetList.Item />',function(){var title='My Title';it('should render with a title but no image',function(){var wrapper=mount(React.createElement(Item,{title:title}));expect(wrapper).toMatchSnapshot();expect(wrapper.find('img').exists()).toBeFalsy();});it('should render with an image',function(){var image=React.createElement("img",{src:"url/to/image",alt:"Alternative text"});var wrapper=mount(React.createElement(Item,{title:title,image:image}));expect(wrapper).toMatchSnapshot();expect(wrapper.find('img').exists()).toBeTruthy();});it('should render with a right component',function(){var rightComponent=React.createElement("span",null,"I`m a span.");var wrapper=mount(React.createElement(Item,{title:title,rightComponent:rightComponent}));expect(wrapper).toMatchSnapshot();expect(wrapper.contains(React.createElement("span",null,"I`m a span."))).toEqual(true);});it('should render without a Glow when selected',function(){var wrapper=mount(React.createElement(Item,{title:title,isSelected:true}));expect(wrapper).toMatchSnapshot();expect(wrapper.find(Glow).exists()).toBeFalsy();});it('should render without a Glow when disabled',function(){var wrapper=mount(React.createElement(Item,{title:title,isDisabled:true}));expect(wrapper).toMatchSnapshot();expect(wrapper.find(Glow).exists()).toBeFalsy();});it('should render with a link',function(){var wrapper=mount(React.createElement(Item,{title:title,link:"url/to/somewhere"}));expect(wrapper).toMatchSnapshot();expect(wrapper.find('Link').exists()).toBeTruthy();});it('should render with an onClick element',function(){var spy=jest.fn();// eslint-disable-next-line require-jsdoc
|
|
5
5
|
var clickHandler=function clickHandler(){/**
|
|
6
6
|
* The spy can't be assigned directly to the event, since the snapshot gets too big
|
|
7
7
|
* and the test execution is heavily slowed down.
|
|
8
|
-
*/spy();};var wrapper=mount(
|
|
8
|
+
*/spy();};var wrapper=mount(React.createElement(Item,{title:title,onClick:clickHandler}));wrapper.simulate('click');expect(wrapper).toMatchSnapshot();expect(spy).toHaveBeenCalledTimes(1);});it('should update the component when the isDisabled prop changed',function(){var wrapper=mount(React.createElement(Item,{title:title,isDisabled:true}));var props=wrapper.props();var updated=wrapper.find('Item').instance().shouldComponentUpdate(_extends({},props,{isDisabled:false}));expect(updated).toBe(true);});it('should update the component when the isSelected prop changed',function(){var wrapper=mount(React.createElement(Item,{title:title,isSelected:true}));var props=wrapper.props();var updated=wrapper.find('Item').instance().shouldComponentUpdate(_extends({},props,{isSelected:false}));expect(updated).toBe(true);});});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{IMAGE_SPACE}from"../../style";var colors=themeConfig.colors,variables=themeConfig.variables;var disabled=css({color:colors.shade5}).toString();var selected=css({background:colors.shade7,boxShadow:"-16px 0 0 0 ".concat(colors.shade7," !important")}).toString();var title=css({width:'100%',marginTop:variables.gap.xsmall,paddingRight:
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';import{responsiveMediaQuery}from'@shopgate/engage/styles';import{IMAGE_SPACE}from"../../style";var colors=themeConfig.colors,variables=themeConfig.variables;var disabled=css({color:colors.shade5,cursor:'not-allowed'}).toString();var selected=css({background:"var(--color-background-accent, ".concat(colors.shade7,")"),boxShadow:"-16px 0 0 0 var(--color-background-accent, ".concat(colors.shade7,") !important")}).toString();var title=css(_defineProperty({width:'100%',marginTop:variables.gap.xsmall,paddingRight:variables.gap.big,hyphens:'auto',overflowWrap:'break-word',wordBreak:'break-word',color:'var(--color-text-high-emphasis)'},responsiveMediaQuery('>xs',{webOnly:true}),{padding:variables.gap.big,margin:0,fontSize:'1.25rem',lineHeight:'1.5rem'})).toString();var description=css(_defineProperty({display:'none'},responsiveMediaQuery('>xs',{webOnly:true}),{display:'block',color:'var(--color-text-medium-emphasis)',fontSize:'0.875rem',lineHeight:'1.25rem',fontWeight:'initial',paddingTop:variables.gap.small}));var grid=css(_defineProperty({alignItems:'center',minHeight:56,padding:"".concat(variables.gap.small,"px 0"),position:'relative',zIndex:2},responsiveMediaQuery('>xs',{webOnly:true}),{padding:0})).toString();var image=css({alignSelf:'flex-start',flexShrink:0,margin:"0 ".concat(variables.gap.big,"px 0 ").concat(-IMAGE_SPACE+variables.gap.big,"px"),width:40}).toString();var glowHover={boxShadow:"-".concat(variables.gap.bigger,"px 0 0 ").concat(colors.shade8,", ").concat(variables.gap.bigger,"px 0 0 ").concat(colors.shade8)};export default{disabled:disabled,selected:selected,title:title,description:description,grid:grid,image:image,glowHover:glowHover};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _typeof(obj){
|
|
1
|
+
function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import List from'@shopgate/pwa-common/components/List';import Item from"./components/Item";import styles from"./style";/**
|
|
2
2
|
* The SheetList component.
|
|
3
3
|
* Styled sheet for List component
|
|
4
|
-
*/var SheetList=/*#__PURE__*/function(_Component){
|
|
4
|
+
*/var SheetList=/*#__PURE__*/function(_Component){function SheetList(){_classCallCheck(this,SheetList);return _callSuper(this,SheetList,arguments);}_inherits(SheetList,_Component);return _createClass(SheetList,[{key:"render",value:/**
|
|
5
5
|
* Renders the component.
|
|
6
6
|
* @returns {JSX}
|
|
7
|
-
*/function render(){var
|
|
7
|
+
*/function render(){var _this$props=this.props,children=_this$props.children,className=_this$props.className,hasImages=_this$props.hasImages,testId=_this$props.testId;if(!React.Children.count(children)){return null;}var itemClasses=_defineProperty(_defineProperty({},styles.item,true),styles.itemWithImage,hasImages);return React.createElement(List,{className:"".concat(className," engage__sheet-list"),role:"listbox"},React.Children.map(children,function(child,index){if(!React.isValidElement(child)){return null;}// The key for each child.
|
|
8
8
|
var key="child-".concat(index);// Selected state for the child.
|
|
9
|
-
var isSelected=child.props.isSelected;var childClasses=(
|
|
9
|
+
var isSelected=child.props.isSelected;var childClasses=_defineProperty(_defineProperty({},styles.itemSelected,isSelected),styles.itemNotLast,!isSelected);return React.createElement(List.Item,{className:classNames(itemClasses,childClasses),isSelected:isSelected,key:key,tabIndex:0},React.createElement("div",{className:styles.innerContainer,"data-test-id":testId},child));}));}}]);}(Component);_defineProperty(SheetList,"Item",Item);_defineProperty(SheetList,"defaultProps",{children:null,className:null,hasImages:false,testId:null});export default SheetList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from'react';import{mount}from'enzyme';import BaseListItem from'@shopgate/pwa-common/components/List/components/Item';import SheetList from"./index";import styles from"./style";describe('<SheetList />',function(){it('should render with two children',function(){var wrapper=mount(
|
|
1
|
+
import React from'react';import{mount}from'enzyme';import BaseListItem from'@shopgate/pwa-common/components/List/components/Item';import SheetList from"./index";import styles from"./style";describe('<SheetList />',function(){it('should render with two children',function(){var wrapper=mount(React.createElement(SheetList,null,React.createElement(SheetList.Item,{title:"List Item"}),React.createElement(SheetList.Item,{title:"List Item"})));expect(wrapper).toMatchSnapshot();expect(wrapper.find(SheetList.Item).length).toEqual(2);});it('should render a child and add styles for list items with images',function(){var wrapper=mount(React.createElement(SheetList,{hasImages:true},React.createElement(SheetList.Item,{title:"List Item"})));expect(wrapper).toMatchSnapshot();expect(wrapper.find(SheetList.Item).length).toEqual(1);expect(wrapper.find(BaseListItem).first().hasClass(styles.itemWithImage)).toBeTruthy();});it('should not render without children',function(){var wrapper=mount(React.createElement(SheetList,null));expect(wrapper).toMatchSnapshot();expect(wrapper.find(SheetList).html()).toBe(null);});it('should not render invalid children',function(){var wrapper=mount(React.createElement(SheetList,null,React.createElement(SheetList.Item,{title:"List Item"}),"xxx"));expect(wrapper).toMatchSnapshot();expect(wrapper.find(SheetList.Item).length).toEqual(1);});});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables,colors=themeConfig.colors;export var IMAGE_SPACE=72;var item=css({margin:"0 ".concat(variables.gap.big,"px")}).toString();var itemNotLast=css({'&:not(:last-child)':{boxShadow:"0 1px 0 0 ".concat(colors.darkGray),marginBottom:1}}).toString();var itemSelected=css({background:colors.shade7,boxShadow:"-".concat(variables.gap.bigger,"px 0 0 ").concat(colors.shade7,", ").concat(variables.gap.bigger,"px 0 0 ").concat(colors.shade7),marginTop:-1}).toString();var itemWithImage=css({marginLeft:IMAGE_SPACE}).toString();var innerContainer=css({minHeight:56,position:'relative'}).toString();export default{item:item,itemNotLast:itemNotLast,itemSelected:itemSelected,itemWithImage:itemWithImage,innerContainer:innerContainer};
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables,colors=themeConfig.colors;export var IMAGE_SPACE=72;var item=css({margin:"0 ".concat(variables.gap.big,"px"),cursor:'pointer'}).toString();var itemNotLast=css({'&:not(:last-child)':{boxShadow:"0 1px 0 0 ".concat(colors.darkGray),marginBottom:1}}).toString();var itemSelected=css({background:"var(--color-background-accent, ".concat(colors.shade7,")"),boxShadow:"-".concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,"), ").concat(variables.gap.bigger,"px 0 0 var(--color-background-accent, ").concat(colors.shade7,")"),marginTop:-1}).toString();var itemWithImage=css({marginLeft:IMAGE_SPACE}).toString();var innerContainer=css({minHeight:56,position:'relative'}).toString();export default{item:item,itemNotLast:itemNotLast,itemSelected:itemSelected,itemWithImage:itemWithImage,innerContainer:innerContainer};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{useContext}from'react';import SideNavigationContext from"./SideNavigationProvider.context";/**
|
|
2
|
+
* Returns the value of the side navigation provider state.
|
|
3
|
+
* @returns {Object}
|
|
4
|
+
*/export var useSideNavigation=function useSideNavigation(){return useContext(SideNavigationContext);};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from'react';import{hot}from'react-hot-loader/root';import SideNavigationProvider from"./SideNavigationProvider";import SideNavigationContent from"./SideNavigationContent";/**
|
|
2
|
+
* The SideNavigation component
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigation=function SideNavigation(_ref){var maxCategoryNesting=_ref.maxCategoryNesting,routePatternBlacklist=_ref.routePatternBlacklist,classNames=_ref.classNames;return React.createElement(SideNavigationProvider,{maxCategoryNesting:maxCategoryNesting,routePatternBlacklist:routePatternBlacklist},React.createElement(SideNavigationContent,{classNames:classNames}));};SideNavigation.defaultProps={maxCategoryNesting:3,routePatternBlacklist:[],classNames:null};export default hot(SideNavigation);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{fetchCategoryOrRootCategories}from'@shopgate/engage/category';import{makeGetAreRootCategoriesFetching,makeGetSubcategoriesByCategoryId}from"./selectors";/**
|
|
2
|
+
* Creates the mapStateToProps connector function.
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getAreRootCategoriesFetching=makeGetAreRootCategoriesFetching();var getSubcategoriesByCategoryId=makeGetSubcategoriesByCategoryId();return function(state,_ref){var categoryId=_ref.categoryId;return{rootCategoriesFetching:getAreRootCategoriesFetching(state),subcategories:getSubcategoriesByCategoryId(state,{categoryId:categoryId})};};};/**
|
|
5
|
+
* Maps the contents of the state to the component props.
|
|
6
|
+
* @param {Function} dispatch The redux dispatch function.
|
|
7
|
+
* @return {Object} The extended component props.
|
|
8
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{fetchCategory:function fetchCategory(id){return dispatch(fetchCategoryOrRootCategories(id));}};};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{useEffect}from'react';import{LoadingIndicator}from'@shopgate/pwa-ui-shared';import SideNavigationCategoriesItemChildren from"./SideNavigationCategoriesItemChildren";import connect from"./SideNavigationCategories.connector";import{list,loadingIndicator}from"./SideNavigationCategories.style";import{item}from"./SideNavigationItem.style";/**
|
|
2
|
+
* The SideNavigationCategories component
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigationCategories=function SideNavigationCategories(_ref){var categoryId=_ref.categoryId,subcategories=_ref.subcategories,fetchCategory=_ref.fetchCategory,rootCategoriesFetching=_ref.rootCategoriesFetching;useEffect(function(){if(!subcategories){fetchCategory(categoryId);}},[categoryId,fetchCategory,subcategories]);if(!subcategories&&rootCategoriesFetching){return React.createElement("li",{className:item},React.createElement(LoadingIndicator,{className:loadingIndicator}));}if(!subcategories||Array.isArray(subcategories)&&subcategories.length===0){return null;}return React.createElement("li",{className:list},React.createElement(SideNavigationCategoriesItemChildren,{level:0,subcategories:subcategories}));};SideNavigationCategories.defaultProps={subcategories:null,categoryId:null,rootCategoriesFetching:false};export default connect(SideNavigationCategories);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors;export var list=css({borderBottom:"1px solid ".concat(colors.shade7)});export var loadingIndicator=css({padding:0,margin:'auto'}).toString();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{connect}from'react-redux';import _fetchCategory from'@shopgate/pwa-common-commerce/category/actions/getCategory';import{getCategory}from'@shopgate/pwa-common-commerce/category/selectors';import{makeGetSubcategoriesByCategoryId,makeGetAreChildCategoriesFetching}from"./selectors";/**
|
|
2
|
+
* Creates the mapStateToProps connector function.
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getSubcategoriesByCategoryId=makeGetSubcategoriesByCategoryId();var getAreChildCategoriesFetching=makeGetAreChildCategoriesFetching();return function(state,_ref){var categoryId=_ref.categoryId;return{category:getCategory(state,{categoryId:categoryId}),subcategories:getSubcategoriesByCategoryId(state,{categoryId:categoryId}),subcategoriesFetching:getAreChildCategoriesFetching(state,{categoryId:categoryId})};};};/**
|
|
5
|
+
* Maps the contents of the state to the component props.
|
|
6
|
+
* @param {Function} dispatch The redux dispatch function.
|
|
7
|
+
* @return {Object} The extended component props.
|
|
8
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{fetchCategory:function fetchCategory(id){return dispatch(_fetchCategory(id));}};};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useCallback,useMemo,useEffect}from'react';import ArrowDrop from'@shopgate/pwa-ui-shared/icons/ArrowDropIcon';import{bin2hex}from'@shopgate/pwa-common/helpers/data';import{CATEGORY_PATH}from'@shopgate/pwa-common-commerce/category/constants';import{ProgressBar}from'@shopgate/pwa-ui-shared';// eslint-disable-next-line import/no-cycle
|
|
2
|
+
import SideNavigationCategoriesItemChildren from"./SideNavigationCategoriesItemChildren";import SideNavigationItem from"./SideNavigationItem";import connect from"./SideNavigationCategoriesItem.connector";import{chevronButton,chevronUp,chevronDown,progressBar,open}from"./SideNavigationCategoriesItem.style";import{useSideNavigation}from"./SideNavigation.hooks";/**
|
|
3
|
+
* The SideNavigationCategoriesItem component
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var SideNavigationCategoriesItem=function SideNavigationCategoriesItem(_ref){var categoryId=_ref.categoryId,category=_ref.category,subcategories=_ref.subcategories,subcategoriesFetching=_ref.subcategoriesFetching,fetchCategory=_ref.fetchCategory,level=_ref.level;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isOpen=_useState2[0],setIsOpen=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isLoading=_useState4[0],setIsLoading=_useState4[1];var _useSideNavigation=useSideNavigation(),maxCategoryNesting=_useSideNavigation.maxCategoryNesting,activeCategoryId=_useSideNavigation.activeCategoryId;var hasSubcategories=useMemo(function(){return category.childrenCount!==0;},[category.childrenCount]);var maxNestingReached=useMemo(function(){return level+1===maxCategoryNesting;},[level,maxCategoryNesting]);var handleClick=useCallback(function(){setIsOpen(!isOpen);if(hasSubcategories&&!subcategories){setIsLoading(true);fetchCategory(categoryId);}},[categoryId,fetchCategory,hasSubcategories,isOpen,subcategories]);useEffect(function(){if(isLoading&&(subcategories||!subcategoriesFetching)){setIsLoading(false);}},[isLoading,subcategories,subcategoriesFetching]);var buttonRight=useMemo(function(){if(!maxNestingReached&&hasSubcategories){return React.createElement("button",{type:"button",onClick:handleClick,className:chevronButton},React.createElement(ArrowDrop,{className:(isOpen&&subcategories?chevronUp:chevronDown).toString()}));}return null;},[handleClick,hasSubcategories,isOpen,maxNestingReached,subcategories]);if(!category){return null;}return React.createElement(SideNavigationItem,{href:"".concat(CATEGORY_PATH,"/").concat(bin2hex(categoryId)),label:category.name,level:level,buttonRight:buttonRight,forceActive:activeCategoryId===categoryId,className:level===0&&isOpen?open:null},isLoading&&React.createElement("div",{className:progressBar},React.createElement(ProgressBar,null)),!maxNestingReached&&isOpen&&hasSubcategories&&subcategories&&React.createElement(SideNavigationCategoriesItemChildren,{subcategories:subcategories,level:level+1}));};SideNavigationCategoriesItem.defaultProps={subcategories:null,subcategoriesFetching:false,categoryId:null,level:0};export default connect(SideNavigationCategoriesItem);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;export var chevronButton=css({flexShrink:0,outline:0,margin:"0 -".concat(variables.gap.big,"px 0 ").concat(variables.gap.small,"px"),fontSize:'1.6em',color:'#373D41',position:'relative'});export var chevron=css({transformOrigin:'center center',transition:'transform 250ms cubic-bezier(0.25, 0.1, 0.25, 1)'});export var chevronDown=css(chevron,{transform:'rotateZ(0deg)'});export var chevronUp=css(chevron,{transform:'rotateZ(180deg)'});export var progressBar=css({position:'absolute',overflow:'hidden',width:'100%',bottom:0,height:3});export var open=css({// borderRight: '2px solid var(--color-primary)',
|
|
2
|
+
}).toString();export var loadingIndicator=css({position:'absolute',padding:0,top:'50%',marginTop:'-50%',paddingTop:1,right:3}).toString();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';// eslint-disable-next-line import/no-cycle
|
|
2
|
+
import SideNavigationCategoriesItem from"./SideNavigationCategoriesItem";/**
|
|
3
|
+
* The SideNavigationCategoriesItemChildren component
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var SideNavigationCategoriesItemChildren=function SideNavigationCategoriesItemChildren(_ref){var subcategories=_ref.subcategories,level=_ref.level;return React.createElement("ul",null,subcategories.map(function(category){return React.createElement(SideNavigationCategoriesItem,{key:category.id,level:level,categoryId:category.id});}));};export default SideNavigationCategoriesItemChildren;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React,{useMemo}from'react';import{INDEX_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import SideNavigationCategories from"./SideNavigationCategories";import SideNavigationLinks from"./SideNavigationLinks";import SideNavigationItem from"./SideNavigationItem";import{useSideNavigation}from"./SideNavigation.hooks";import{container}from"./SideNavigationContent.style";/**
|
|
2
|
+
* @returns {JSX}
|
|
3
|
+
*/var SideNavigationContent=function SideNavigationContent(_ref){var classNames=_ref.classNames;var _useSideNavigation=useSideNavigation(),isVisible=_useSideNavigation.isVisible;var wrapperClass=useMemo(function(){if(!classNames){return'';}var _classNames$visible=classNames.visible,visible=_classNames$visible===void 0?'':_classNames$visible,_classNames$hidden=classNames.hidden,hidden=_classNames$hidden===void 0?'':_classNames$hidden;return isVisible?visible:hidden;},[classNames,isVisible]);return React.createElement("div",{className:wrapperClass},isVisible&&React.createElement("nav",{className:container},React.createElement("ul",null,React.createElement(SideNavigationItem,{href:INDEX_PATH,label:"navigation.home"}),React.createElement(SideNavigationCategories,null),React.createElement(SideNavigationLinks,null))));};SideNavigationContent.defaultProps={classNames:null};export default SideNavigationContent;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{useMemo,memo}from'react';import classNames from'classnames';import Link from'@shopgate/pwa-common/components/Link';import{i18n}from'@shopgate/engage/core';import{getIndentation,item,itemActive,link,linkActive,list}from"./SideNavigationItem.style";import{useSideNavigation}from"./SideNavigation.hooks";/**
|
|
2
|
+
* SideNavigationItem component
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigationItem=function SideNavigationItem(_ref){var level=_ref.level,href=_ref.href,label=_ref.label,buttonRight=_ref.buttonRight,children=_ref.children,forceActive=_ref.forceActive,forceInactive=_ref.forceInactive,className=_ref.className,onClick=_ref.onClick;var _useSideNavigation=useSideNavigation(),currentPathname=_useSideNavigation.currentPathname;var isActive=useMemo(function(){return!forceInactive&&(currentPathname===href||forceActive);},[currentPathname,forceActive,forceInactive,href]);return React.createElement("li",{className:classNames(list,className)},React.createElement("div",{className:classNames(item,_defineProperty({},itemActive,isActive))},href?React.createElement(Link,{tag:"a",href:href,className:classNames(link,getIndentation(level),_defineProperty({},linkActive,isActive))},i18n.text(label)):React.createElement("button",{type:"button",className:classNames(link,getIndentation(level),_defineProperty({},linkActive,isActive)),onClick:onClick},i18n.text(label)),buttonRight),children);};SideNavigationItem.defaultProps={buttonRight:null,children:null,forceActive:false,forceInactive:false,level:0,href:null,className:null,onClick:function onClick(){}};export default memo(SideNavigationItem);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var variables=themeConfig.variables;/**
|
|
2
|
+
* @param {number} level The indentation level
|
|
3
|
+
* @returns {string}
|
|
4
|
+
*/export var getIndentation=function getIndentation(){var level=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return css({paddingLeft:level*variables.gap.big}).toString();};export var list=css({position:'relative'}).toString();export var item=css({alignItems:'center',display:'flex',textAlign:'left',outline:0,padding:variables.gap.big,position:'relative',width:'100%',lineHeight:'1.45em'}).toString();export var itemActive=css({background:'var(--color-side-navigation-active-background)'}).toString();export var link=css({flexGrow:1,textAlign:'left',outline:0,color:'var(--color-text-high-emphasis)',':hover':{color:'var(--color-primary)'}}).toString();export var linkActive=css({color:'var(--color-primary) !important'}).toString();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React,{Fragment}from'react';import{FAVORITES_PATH}from'@shopgate/pwa-common-commerce/favorites/constants';import{CART_PATH}from'@shopgate/pwa-common-commerce/cart/constants';import{LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import appConfig from'@shopgate/pwa-common/helpers/config';import{useSideNavigation}from"./SideNavigation.hooks";import SideNavigationItem from"./SideNavigationItem";import SideNavigationNestedItem from"./SideNavigationNestedItem";import SideNavigationLinksQuicklinks from"./SideNavigationLinksQuicklinks";import SideNavigationLinksLegal from"./SideNavigationLinksLegal";import{PROFILE_PATH,WISH_LIST_PATH,ORDERS_PATH}from"../../account";/**
|
|
2
|
+
* SideNavigationLinks component
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigationLinks=function SideNavigationLinks(){var _useSideNavigation=useSideNavigation(),isLoggedIn=_useSideNavigation.isLoggedIn,logout=_useSideNavigation.logout,currentPathname=_useSideNavigation.currentPathname;var isAccountActive=currentPathname===PROFILE_PATH||currentPathname===ORDERS_PATH||currentPathname===WISH_LIST_PATH;return React.createElement(Fragment,null,React.createElement(SideNavigationItem,{href:CART_PATH,label:"navigation.cart"}),!isLoggedIn&&appConfig.hasFavorites?React.createElement(SideNavigationItem,{href:FAVORITES_PATH,label:"navigation.favorites"}):null,isLoggedIn&&React.createElement(SideNavigationNestedItem,{href:PROFILE_PATH,label:"navigation.your_account",forceActive:isAccountActive,level:0},React.createElement("ul",null,React.createElement(SideNavigationItem,{level:1,href:PROFILE_PATH,label:"titles.profile"}),React.createElement(SideNavigationItem,{level:1,href:ORDERS_PATH,label:"titles.order_history"}),appConfig.hasFavorites?React.createElement(SideNavigationItem,{level:1,href:WISH_LIST_PATH,label:"titles.favorites"}):null)),React.createElement(SideNavigationLinksQuicklinks,null),React.createElement(SideNavigationLinksLegal,null),isLoggedIn?React.createElement(SideNavigationItem,{onClick:logout,label:"navigation.logout"}):React.createElement(SideNavigationItem,{href:LOGIN_PATH,label:"navigation.login_register"}));};export default SideNavigationLinks;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{makeGetMenu,makeGetIsFetchingMenu}from'@shopgate/engage/core';import{LEGAL_MENU}from'@shopgate/pwa-common/constants/MenuIDs';/**
|
|
2
|
+
* Creates the mapStateToProps connector function.
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getMenu=makeGetMenu(LEGAL_MENU);var getIsFetchingMenu=makeGetIsFetchingMenu(LEGAL_MENU);return function(state){return{links:getMenu(state),isFetching:getIsFetchingMenu(state)};};};export default connect(makeMapStateToProps);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';import SideNavigationItem from"./SideNavigationItem";import connect from"./SideNavigationLinksLegal.connector";/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Object} props The component props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var SideNavigationLinksLegal=function SideNavigationLinksLegal(_ref){var links=_ref.links;if(!links){return null;}return links.map(function(_ref2){var label=_ref2.label,url=_ref2.url;return React.createElement(SideNavigationItem,{key:url,href:url,label:label});});};SideNavigationLinksLegal.defaultProps={links:null,isFetching:false};export default connect(SideNavigationLinksLegal);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{makeGetMenu,makeGetIsFetchingMenu}from'@shopgate/engage/core';import{QUICKLINKS_MENU}from'@shopgate/pwa-common/constants/MenuIDs';/**
|
|
2
|
+
* Creates the mapStateToProps connector function.
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){var getMenu=makeGetMenu(QUICKLINKS_MENU);var getIsFetchingMenu=makeGetIsFetchingMenu(QUICKLINKS_MENU);return function(state){return{links:getMenu(state),isFetching:getIsFetchingMenu(state)};};};export default connect(makeMapStateToProps);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from'react';import SideNavigationItem from"./SideNavigationItem";import connect from"./SideNavigationLinksQuicklinks.connector";/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Object} props The component props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var SideNavigationLinksQuicklinks=function SideNavigationLinksQuicklinks(_ref){var links=_ref.links;if(!links){return null;}return links.map(function(_ref2){var label=_ref2.label,url=_ref2.url;return React.createElement(SideNavigationItem,{key:url,href:url,label:label});});};SideNavigationLinksQuicklinks.defaultProps={links:null,isFetching:false};export default connect(SideNavigationLinksQuicklinks);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useCallback,useMemo,useEffect}from'react';import ArrowDrop from'@shopgate/pwa-ui-shared/icons/ArrowDropIcon';import{chevronButton,chevronUp,chevronDown,open}from"./SideNavigationCategoriesItem.style";import SideNavigationItem from"./SideNavigationItem";/**
|
|
2
|
+
* The SideNavigationCategoriesItem component
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigationNestedItem=function SideNavigationNestedItem(_ref){var level=_ref.level,label=_ref.label,href=_ref.href,children=_ref.children,forceActive=_ref.forceActive;var _useState=useState(forceActive),_useState2=_slicedToArray(_useState,2),isOpen=_useState2[0],setIsOpen=_useState2[1];useEffect(function(){if(forceActive){setIsOpen(true);}},[forceActive]);var handleClick=useCallback(function(){setIsOpen(!isOpen);},[isOpen]);var buttonRight=useMemo(function(){return React.createElement("button",{type:"button",onClick:handleClick,className:chevronButton},React.createElement(ArrowDrop,{className:(isOpen?chevronUp:chevronDown).toString()}));},[handleClick,isOpen]);return React.createElement(SideNavigationItem,{href:href,label:label,level:level,buttonRight:buttonRight,className:level===0&&isOpen?open:null,forceInactive:true},isOpen?children:null);};SideNavigationNestedItem.defaultProps={level:0,forceActive:false};export default SideNavigationNestedItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{connect}from'react-redux';import{getCurrentRoute,getCurrentPathname,getCurrentParams}from'@shopgate/pwa-common/selectors/router';import{isUserLoggedIn}from'@shopgate/pwa-common/selectors/user';import _logout from'@shopgate/pwa-common/actions/user/logout';/**
|
|
2
|
+
* Creates the mapStateToProps connector function.
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/var makeMapStateToProps=function makeMapStateToProps(){return function(state){return{currentParams:getCurrentParams(state),currentPathname:getCurrentPathname(state),currentRoute:getCurrentRoute(state),isLoggedIn:isUserLoggedIn(state)};};};/**
|
|
5
|
+
* Maps the contents of the state to the component props.
|
|
6
|
+
* @param {Function} dispatch The dispatch method from the store.
|
|
7
|
+
* @return {Object}
|
|
8
|
+
*/var mapDispatchToProps=function mapDispatchToProps(dispatch){return{logout:function logout(){return dispatch(_logout());}};};export default connect(makeMapStateToProps,mapDispatchToProps);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext}from'react';var initialContext={};export default createContext(initialContext);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState,useMemo,useEffect}from'react';import{CATEGORY_PATTERN,CATEGORY_FILTER_PATTERN}from'@shopgate/pwa-common-commerce/category/constants';import{ITEM_PATTERN,ITEM_GALLERY_PATTERN,ITEM_REVIEWS_PATTERN,ITEM_WRITE_REVIEW_PATTERN}from'@shopgate/pwa-common-commerce/product/constants';import{hex2bin}from'@shopgate/pwa-common/helpers/data';import Context from"./SideNavigationProvider.context";import connect from"./SideNavigationProvider.connector";var categoryPatterns=[CATEGORY_PATTERN,CATEGORY_FILTER_PATTERN];var itemPatterns=[ITEM_PATTERN,ITEM_GALLERY_PATTERN,ITEM_REVIEWS_PATTERN,ITEM_WRITE_REVIEW_PATTERN];/**
|
|
2
|
+
* SideNavigation Provider
|
|
3
|
+
* @returns {JSX}
|
|
4
|
+
*/var SideNavigationProvider=function SideNavigationProvider(_ref){var maxCategoryNesting=_ref.maxCategoryNesting,routePatternBlacklist=_ref.routePatternBlacklist,currentParams=_ref.currentParams,currentPathname=_ref.currentPathname,currentRoute=_ref.currentRoute,isLoggedIn=_ref.isLoggedIn,logout=_ref.logout,children=_ref.children;var _useState=useState(null),_useState2=_slicedToArray(_useState,2),activeCategoryId=_useState2[0],setActiveCategoryId=_useState2[1];var _useState3=useState(true),_useState4=_slicedToArray(_useState3,2),isVisible=_useState4[0],setIsVisible=_useState4[1];useEffect(function(){if(!currentRoute){return;}var pattern=currentRoute.pattern;if(categoryPatterns.includes(pattern)){var categoryId=currentParams.categoryId;setActiveCategoryId(hex2bin(categoryId));}else if(!itemPatterns.includes(pattern)){setActiveCategoryId(null);}setIsVisible(!routePatternBlacklist.includes(pattern));});var value=useMemo(function(){return{maxCategoryNesting:maxCategoryNesting,currentParams:currentParams,currentPathname:currentPathname,currentRoute:currentRoute,isLoggedIn:isLoggedIn,logout:logout,activeCategoryId:activeCategoryId,isVisible:isVisible};},[activeCategoryId,currentParams,currentPathname,currentRoute,isLoggedIn,isVisible,logout,maxCategoryNesting]);return React.createElement(Context.Provider,{value:value},children);};SideNavigationProvider.defaultProps={currentParams:null,currentPathname:'',routePatternBlacklist:[],currentRoute:null};export default connect(SideNavigationProvider);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{default as SideNavigation}from"./SideNavigation";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{createSelector}from'reselect';import{getCategoryChildren,getRootCategories,getRootCategoriesState,getChildCategoriesForCategory}from'@shopgate/pwa-common-commerce/category/selectors';/**
|
|
2
|
+
* Creates a getCategoriesById selector
|
|
3
|
+
* @returns {Function}
|
|
4
|
+
*/export var makeGetSubcategoriesByCategoryId=function makeGetSubcategoriesByCategoryId(){return(/**
|
|
5
|
+
* Retrieves categories from the state.
|
|
6
|
+
* If no category id is passed, root-categories will be returned.
|
|
7
|
+
* @param {Object} state The application state.
|
|
8
|
+
* @param {Object} props The component props.
|
|
9
|
+
* @returns {Object[]} The categories collection.
|
|
10
|
+
*/createSelector(getCategoryChildren,getRootCategories,function(state,props){return props.categoryId;},function(childCategories,rootCategories,categoryId){// Check if we have to handle the root-category
|
|
11
|
+
if(!categoryId&&rootCategories){return rootCategories;}return childCategories;}));};/**
|
|
12
|
+
* Creates a getAreRootCategoriesFetching selector
|
|
13
|
+
* @returns {Function}
|
|
14
|
+
*/export var makeGetAreRootCategoriesFetching=function makeGetAreRootCategoriesFetching(){return createSelector(getRootCategoriesState,function(rootCategories){return(rootCategories===null||rootCategories===void 0?void 0:rootCategories.isFetching)||false;});};/**
|
|
15
|
+
* Creates a getIsCategoryFetching selector
|
|
16
|
+
* @returns {Function}
|
|
17
|
+
*/export var makeGetAreChildCategoriesFetching=function makeGetAreChildCategoriesFetching(){return createSelector(getChildCategoriesForCategory,function(category){return(category===null||category===void 0?void 0:category.isFetching)||false;});};
|
|
@@ -2,4 +2,4 @@ import React from'react';import{createPortal}from'react-dom';import{SnackBar}fro
|
|
|
2
2
|
* The SnackBarContainer component.
|
|
3
3
|
* @param {Object} props The component props.
|
|
4
4
|
* @returns {JSX}
|
|
5
|
-
*/function SnackBarContainer(props){if(!props.toasts.length){return null;}return
|
|
5
|
+
*/function SnackBarContainer(props){if(!props.toasts.length){return null;}return createPortal(React.createElement(SnackBar,props),document.getElementById('portals'));}export default SnackBarContainer;
|
|
@@ -9,4 +9,4 @@ import React,{useMemo}from'react';import PropTypes from'prop-types';import{Visua
|
|
|
9
9
|
* when issues with the regular label are expected e.g. due to problematic layout.
|
|
10
10
|
* @param {string} [props.id=null] Optional custom id for checkbox input and label
|
|
11
11
|
* @returns {JSX.Element}
|
|
12
|
-
*/var Switch=function Switch(_ref){var disabled=_ref.disabled,checked=_ref.checked,onChange=_ref.onChange,id=_ref.id,a11yFallbackText=_ref.a11yFallbackText,children=_ref.children;var switchId=useMemo(function(){return id||Math.random();},[id]);return
|
|
12
|
+
*/var Switch=function Switch(_ref){var disabled=_ref.disabled,checked=_ref.checked,onChange=_ref.onChange,id=_ref.id,a11yFallbackText=_ref.a11yFallbackText,children=_ref.children;var switchId=useMemo(function(){return id||Math.random();},[id]);return React.createElement("div",{className:styles.container},React.createElement("input",{type:"checkbox",disabled:disabled,checked:checked,onChange:onChange,className:styles.input,id:switchId}),children&&React.createElement("label",{htmlFor:switchId},React.createElement("span",{"aria-hidden":!!a11yFallbackText},children),a11yFallbackText&&React.createElement(VisuallyHidden,null,a11yFallbackText)));};Switch.defaultProps={children:null,disabled:false,a11yFallbackText:null,checked:false,onChange:null,id:null};export default Switch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import*as React from'react';import*as PropTypes from'prop-types';var Context=React.createContext(null);/**
|
|
2
|
+
* Tab Context Provider
|
|
3
|
+
* @param {Object} props props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var TabContext=function TabContext(props){var children=props.children,value=props.value;var context=React.useMemo(function(){return{value:value};},[value]);return React.createElement(Context.Provider,{value:context},children);};/**
|
|
6
|
+
* @returns {unknown}
|
|
7
|
+
*/export var useTabContext=function useTabContext(){return React.useContext(Context);};export{TabContext};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React,{useContext}from'react';import PropTypes from'prop-types';import classNames from'classnames';import Button from'@shopgate/pwa-ui-shared/Button';import{root,wrapper}from"./Tab.style";import{ViewContext}from"../../View";/**
|
|
2
|
+
* Tab component
|
|
3
|
+
* @param {Object} props props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var Tab=function Tab(props){var className=props.className,_props$disabled=props.disabled,disabled=_props$disabled===void 0?false:_props$disabled,indicator=props.indicator,label=props.label,onChange=props.onChange,onFocus=props.onFocus,selected=props.selected,value=props.value;var _useContext=useContext(ViewContext),contentRef=_useContext.contentRef;/**
|
|
6
|
+
* Handle Click
|
|
7
|
+
* @param {Object} event event
|
|
8
|
+
*/var handleClick=function handleClick(event){if(onChange){onChange(event,value);contentRef.current.scrollTop=0;}};/**
|
|
9
|
+
* Handle Focus
|
|
10
|
+
* @param {Object} event event
|
|
11
|
+
*/var handleFocus=function handleFocus(event){if(onFocus){onFocus(event);}};return React.createElement(Button,{flat:true,type:selected?'secondary':'regular',className:classNames(root,className),role:"tab","aria-selected":selected,disabled:disabled,onClick:handleClick,onFocus:handleFocus,tabIndex:selected?0:-1},React.createElement("span",{className:wrapper},label),indicator);};Tab.defaultProps={className:null,value:null,disabled:false,onChange:null,onFocus:null};export default Tab;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{css}from'glamor';import{responsiveMediaQuery}from'@shopgate/engage/styles';export var root=css(_defineProperty({'&&':{maxWidth:200,minWidth:72,position:'relative',boxSizing:'border-box',minHeight:48,flexShrink:0,flexGrow:1,padding:'6px 6px',overflow:'hidden',whiteSpace:'normal',textAlign:'center'}},responsiveMediaQuery('<=xs',{appAlways:true}),{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:'none'})).toString();export var wrapper=css({display:'inline-flex',alignItems:'center',justifyContent:'center',width:'100%',flexDirection:'column'}).toString();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var _excluded=["className"];function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key];}return target;}import*as React from'react';import PropTypes from'prop-types';import classNames from'classnames';import{root}from"./TabIndicator.style";/**
|
|
2
|
+
* Tab indicator component
|
|
3
|
+
* @param {Object} props props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var TabIndicator=function TabIndicator(_ref){var className=_ref.className,other=_objectWithoutProperties(_ref,_excluded);return React.createElement("span",_extends({className:classNames(root,className)},other));};TabIndicator.defaultProps={className:null};export default TabIndicator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var colors=themeConfig.colors;export var root=css({position:'absolute',height:2,bottom:0,width:'100%',transition:'left .2s ease',backgroundColor:"var(--color-primary, ".concat(colors.primary,")")}).toString();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import*as React from'react';import PropTypes from'prop-types';import{useTabContext}from"../TabContext";/**
|
|
2
|
+
* Tab panel component
|
|
3
|
+
* @param {Object} props props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var TabPanel=function TabPanel(props){var children=props.children,className=props.className,value=props.value;var context=useTabContext();return React.createElement("div",{className:className,hidden:value!==context.value,role:"tabpanel"},value===context.value&&children);};TabPanel.defaultProps={children:null,className:null};export default TabPanel;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import*as React from'react';import PropTypes from'prop-types';import classNames from'classnames';import debounce from"../debounce";import ownerWindow from"../ownerWindow";import TabIndicator from"./TabIndicator";import useEventCallback from"../useEventCallback";import{root,fixed,flexContainer}from"./Tabs.style";import{useTabContext}from"../TabContext";/**
|
|
2
|
+
* C
|
|
3
|
+
* @param {Object} props props
|
|
4
|
+
* @returns {JSX}
|
|
5
|
+
*/var Tabs=function Tabs(props){var childrenProp=props.children,className=props.className,onChange=props.onChange;var _useTabContext=useTabContext(),value=_useTabContext.value;var start='left';var size='width';var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),mounted=_React$useState2[0],setMounted=_React$useState2[1];var _React$useState3=React.useState({}),_React$useState4=_slicedToArray(_React$useState3,2),indicatorStyle=_React$useState4[0],setIndicatorStyle=_React$useState4[1];var valueToIndex=new Map();var tabsRef=React.useRef(null);var tabListRef=React.useRef(null);/**
|
|
6
|
+
* Get Tabs Meta
|
|
7
|
+
* @returns {Object}
|
|
8
|
+
*/var getTabsMeta=function getTabsMeta(){var tabsNode=tabsRef.current;var tabsMeta;if(tabsNode){var rect=tabsNode.getBoundingClientRect();// create a new object with ClientRect class props + scrollLeft
|
|
9
|
+
tabsMeta={clientWidth:tabsNode.clientWidth,top:rect.top,bottom:rect.bottom,left:rect.left,right:rect.right};}var tabMeta;if(tabsNode&&value!==false){var _children=tabListRef.current.children;if(_children.length>0){var tab=_children[valueToIndex.get(value)];tabMeta=tab?tab.getBoundingClientRect():null;}}return{tabsMeta:tabsMeta,tabMeta:tabMeta};};var updateIndicatorState=useEventCallback(function(){var _getTabsMeta=getTabsMeta(),tabsMeta=_getTabsMeta.tabsMeta,tabMeta=_getTabsMeta.tabMeta;var startValue=0;if(tabMeta&&tabsMeta){startValue=tabMeta.left-tabsMeta.left;}var newIndicatorStyle=_defineProperty(_defineProperty({},start,startValue),size,tabMeta?tabMeta[size]:0);// IE 11 support, replace with Number.isNaN
|
|
10
|
+
// eslint-disable-next-line no-restricted-globals
|
|
11
|
+
if(isNaN(indicatorStyle[start])||isNaN(indicatorStyle[size])){setIndicatorStyle(newIndicatorStyle);}else{var dStart=Math.abs(indicatorStyle[start]-newIndicatorStyle[start]);var dSize=Math.abs(indicatorStyle[size]-newIndicatorStyle[size]);if(dStart>=1||dSize>=1){setIndicatorStyle(newIndicatorStyle);}}});React.useEffect(function(){var handleResize=debounce(function(){updateIndicatorState();});var win=ownerWindow(tabsRef.current);win.addEventListener('resize',handleResize);return function(){handleResize.clear();win.removeEventListener('resize',handleResize);};},[updateIndicatorState]);React.useEffect(function(){setMounted(true);},[]);React.useEffect(function(){updateIndicatorState();});var indicator=React.createElement(TabIndicator,{style:indicatorStyle});var childIndex=0;var children=React.Children.map(childrenProp,function(child){if(!React.isValidElement(child)){return null;}var childValue=child.props.value===undefined?childIndex:child.props.value;valueToIndex.set(childValue,childIndex);var selected=childValue===value;childIndex+=1;return React.cloneElement(child,{indicator:selected&&!mounted&&indicator,selected:selected,onChange:onChange,value:childValue});});return React.createElement("div",{className:classNames(root,className)},React.createElement("div",{className:classNames(fixed),ref:tabsRef},React.createElement("div",{className:classNames(flexContainer),ref:tabListRef,role:"tablist"},children),mounted&&indicator));};Tabs.defaultProps={className:null};export default Tabs;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{css}from'glamor';export var root=css({overflow:'hidden',minHeight:48,WebkitOverflowScrolling:'touch',// Add iOS momentum scrolling.
|
|
2
|
+
display:'flex',position:'relative'}).toString();export var fixed=css({overflowX:'hidden',width:'100%'}).toString();export var flexContainer=css({display:'flex'}).toString();export var centered=css({justifyContent:'center'}).toString();
|