@commercelayer/react-components 4.21.0-beta.2 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/ExternalFunction.d.ts +7 -0
- package/lib/cjs/components/ExternalFunction.js +2 -0
- package/lib/cjs/components/MetadataInput.d.ts +5 -0
- package/lib/cjs/components/MetadataInput.js +2 -0
- package/lib/cjs/components/SubmitButton.d.ts +10 -0
- package/lib/cjs/components/SubmitButton.js +2 -0
- package/lib/cjs/components/addresses/Address.d.ts +31 -0
- package/lib/cjs/components/addresses/Address.js +2 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.d.ts +34 -0
- package/lib/cjs/components/addresses/AddressCountrySelector.js +2 -0
- package/lib/cjs/components/addresses/AddressField.d.ts +61 -0
- package/lib/cjs/components/addresses/AddressField.js +2 -0
- package/lib/cjs/components/addresses/AddressInput.d.ts +34 -0
- package/lib/cjs/components/addresses/AddressInput.js +2 -0
- package/lib/cjs/components/addresses/AddressInputSelect.d.ts +29 -0
- package/lib/cjs/components/addresses/AddressInputSelect.js +2 -0
- package/lib/cjs/components/addresses/AddressStateSelector.d.ts +50 -0
- package/lib/cjs/components/addresses/AddressStateSelector.js +2 -0
- package/lib/cjs/components/addresses/AddressesContainer.d.ts +40 -0
- package/lib/cjs/components/addresses/AddressesContainer.js +2 -0
- package/lib/cjs/components/addresses/AddressesEmpty.d.ts +26 -0
- package/lib/cjs/components/addresses/AddressesEmpty.js +2 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/cjs/components/addresses/BillingAddressContainer.js +2 -0
- package/lib/cjs/components/addresses/BillingAddressForm.d.ts +34 -0
- package/lib/cjs/components/addresses/BillingAddressForm.js +2 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.d.ts +18 -0
- package/lib/cjs/components/addresses/SaveAddressesButton.js +2 -0
- package/lib/cjs/components/addresses/ShippingAddressContainer.d.ts +7 -0
- package/lib/cjs/components/addresses/ShippingAddressContainer.js +2 -0
- package/lib/cjs/components/addresses/ShippingAddressForm.d.ts +31 -0
- package/lib/cjs/components/addresses/ShippingAddressForm.js +2 -0
- package/lib/cjs/components/auth/CommerceLayer.d.ts +25 -0
- package/lib/cjs/components/auth/CommerceLayer.js +2 -0
- package/lib/cjs/components/customers/CustomerAddressForm.d.ts +13 -0
- package/lib/cjs/components/customers/CustomerAddressForm.js +2 -0
- package/lib/cjs/components/customers/CustomerContainer.d.ts +38 -0
- package/lib/cjs/components/customers/CustomerContainer.js +2 -0
- package/lib/cjs/components/customers/CustomerField.d.ts +25 -0
- package/lib/cjs/components/customers/CustomerField.js +2 -0
- package/lib/cjs/components/customers/CustomerInput.d.ts +11 -0
- package/lib/cjs/components/customers/CustomerInput.js +2 -0
- package/lib/cjs/components/customers/CustomerPaymentSource.d.ts +11 -0
- package/lib/cjs/components/customers/CustomerPaymentSource.js +2 -0
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
- package/lib/cjs/components/customers/CustomerPaymentSourceEmpty.js +2 -0
- package/lib/cjs/components/customers/MyAccountLink.d.ts +38 -0
- package/lib/cjs/components/customers/MyAccountLink.js +2 -0
- package/lib/cjs/components/customers/MyIdentityLink.d.ts +59 -0
- package/lib/cjs/components/customers/MyIdentityLink.js +2 -0
- package/lib/cjs/components/customers/SaveCustomerButton.d.ts +12 -0
- package/lib/cjs/components/customers/SaveCustomerButton.js +2 -0
- package/lib/cjs/components/errors/Errors.d.ts +31 -0
- package/lib/cjs/components/errors/Errors.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCard.d.ts +10 -0
- package/lib/cjs/components/gift_cards/GiftCard.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardContainer.d.ts +6 -0
- package/lib/cjs/components/gift_cards/GiftCardContainer.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
- package/lib/cjs/components/gift_cards/GiftCardCurrencySelector.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.d.ts +7 -0
- package/lib/cjs/components/gift_cards/GiftCardInput.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponCode.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponForm.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponInput.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
- package/lib/cjs/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/cjs/components/gift_cards/GiftCardRecipientInput.js +2 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
- package/lib/cjs/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
- package/lib/cjs/components/line_items/LineItem.d.ts +8 -0
- package/lib/cjs/components/line_items/LineItem.js +2 -0
- package/lib/cjs/components/line_items/LineItemAmount.d.ts +7 -0
- package/lib/cjs/components/line_items/LineItemAmount.js +2 -0
- package/lib/cjs/components/line_items/LineItemCode.d.ts +13 -0
- package/lib/cjs/components/line_items/LineItemCode.js +2 -0
- package/lib/cjs/components/line_items/LineItemField.d.ts +14 -0
- package/lib/cjs/components/line_items/LineItemField.js +2 -0
- package/lib/cjs/components/line_items/LineItemImage.d.ts +17 -0
- package/lib/cjs/components/line_items/LineItemImage.js +2 -0
- package/lib/cjs/components/line_items/LineItemName.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemName.js +2 -0
- package/lib/cjs/components/line_items/LineItemOption.d.ts +19 -0
- package/lib/cjs/components/line_items/LineItemOption.js +2 -0
- package/lib/cjs/components/line_items/LineItemOptions.d.ts +16 -0
- package/lib/cjs/components/line_items/LineItemOptions.js +2 -0
- package/lib/cjs/components/line_items/LineItemQuantity.d.ts +21 -0
- package/lib/cjs/components/line_items/LineItemQuantity.js +2 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.d.ts +14 -0
- package/lib/cjs/components/line_items/LineItemRemoveLink.js +2 -0
- package/lib/cjs/components/line_items/LineItemsContainer.d.ts +9 -0
- package/lib/cjs/components/line_items/LineItemsContainer.js +2 -0
- package/lib/cjs/components/line_items/LineItemsCount.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemsCount.js +2 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.d.ts +12 -0
- package/lib/cjs/components/line_items/LineItemsEmpty.js +2 -0
- package/lib/cjs/components/orders/AddToCartButton.d.ts +95 -0
- package/lib/cjs/components/orders/AddToCartButton.js +2 -0
- package/lib/cjs/components/orders/AdjustmentAmount.d.ts +4 -0
- package/lib/cjs/components/orders/AdjustmentAmount.js +2 -0
- package/lib/cjs/components/orders/CartLink.d.ts +47 -0
- package/lib/cjs/components/orders/CartLink.js +2 -0
- package/lib/cjs/components/orders/CheckoutLink.d.ts +28 -0
- package/lib/cjs/components/orders/CheckoutLink.js +2 -0
- package/lib/cjs/components/orders/DiscountAmount.d.ts +4 -0
- package/lib/cjs/components/orders/DiscountAmount.js +2 -0
- package/lib/cjs/components/orders/GiftCardAmount.d.ts +4 -0
- package/lib/cjs/components/orders/GiftCardAmount.js +2 -0
- package/lib/cjs/components/orders/HostedCart.d.ts +58 -0
- package/lib/cjs/components/orders/HostedCart.js +2 -0
- package/lib/cjs/components/orders/OrderContainer.d.ts +62 -0
- package/lib/cjs/components/orders/OrderContainer.js +2 -0
- package/lib/cjs/components/orders/OrderList.d.ts +83 -0
- package/lib/cjs/components/orders/OrderList.js +2 -0
- package/lib/cjs/components/orders/OrderListEmpty.d.ts +17 -0
- package/lib/cjs/components/orders/OrderListEmpty.js +2 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.d.ts +48 -0
- package/lib/cjs/components/orders/OrderListPaginationButtons.js +2 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/cjs/components/orders/OrderListPaginationInfo.js +2 -0
- package/lib/cjs/components/orders/OrderListRow.d.ts +29 -0
- package/lib/cjs/components/orders/OrderListRow.js +2 -0
- package/lib/cjs/components/orders/OrderNumber.d.ts +5 -0
- package/lib/cjs/components/orders/OrderNumber.js +2 -0
- package/lib/cjs/components/orders/OrderStorage.d.ts +31 -0
- package/lib/cjs/components/orders/OrderStorage.js +2 -0
- package/lib/cjs/components/orders/PaymentMethodAmount.d.ts +4 -0
- package/lib/cjs/components/orders/PaymentMethodAmount.js +2 -0
- package/lib/cjs/components/orders/PlaceOrderButton.d.ts +35 -0
- package/lib/cjs/components/orders/PlaceOrderButton.js +2 -0
- package/lib/cjs/components/orders/PlaceOrderContainer.d.ts +8 -0
- package/lib/cjs/components/orders/PlaceOrderContainer.js +2 -0
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
- package/lib/cjs/components/orders/PrivacyAndTermsCheckbox.js +2 -0
- package/lib/cjs/components/orders/ShippingAmount.d.ts +4 -0
- package/lib/cjs/components/orders/ShippingAmount.js +2 -0
- package/lib/cjs/components/orders/SubTotalAmount.d.ts +4 -0
- package/lib/cjs/components/orders/SubTotalAmount.js +2 -0
- package/lib/cjs/components/orders/TaxesAmount.d.ts +4 -0
- package/lib/cjs/components/orders/TaxesAmount.js +2 -0
- package/lib/cjs/components/orders/TotalAmount.d.ts +4 -0
- package/lib/cjs/components/orders/TotalAmount.js +2 -0
- package/lib/cjs/components/parcels/ParcelField.d.ts +14 -0
- package/lib/cjs/components/parcels/ParcelField.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItem.d.ts +7 -0
- package/lib/cjs/components/parcels/ParcelLineItem.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItemField.d.ts +14 -0
- package/lib/cjs/components/parcels/ParcelLineItemField.js +2 -0
- package/lib/cjs/components/parcels/ParcelLineItemsCount.d.ts +18 -0
- package/lib/cjs/components/parcels/ParcelLineItemsCount.js +2 -0
- package/lib/cjs/components/parcels/Parcels.d.ts +7 -0
- package/lib/cjs/components/parcels/Parcels.js +2 -0
- package/lib/cjs/components/parcels/ParcelsCount.d.ts +18 -0
- package/lib/cjs/components/parcels/ParcelsCount.js +2 -0
- package/lib/cjs/components/payment_gateways/AdyenGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/AdyenGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/BraintreeGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/BraintreeGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/CheckoutComGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/ExternalGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/ExternalGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/KlarnaGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/KlarnaGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/PaymentGateway.d.ts +16 -0
- package/lib/cjs/components/payment_gateways/PaymentGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/PaypalGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/PaypalGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/StripeGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/StripeGateway.js +2 -0
- package/lib/cjs/components/payment_gateways/WireTransferGateway.d.ts +5 -0
- package/lib/cjs/components/payment_gateways/WireTransferGateway.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethod.d.ts +45 -0
- package/lib/cjs/components/payment_methods/PaymentMethod.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.d.ts +10 -0
- package/lib/cjs/components/payment_methods/PaymentMethodName.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
- package/lib/cjs/components/payment_methods/PaymentMethodPrice.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
- package/lib/cjs/components/payment_methods/PaymentMethodRadioButton.js +2 -0
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
- package/lib/cjs/components/payment_methods/PaymentMethodsContainer.js +2 -0
- package/lib/cjs/components/payment_source/AdyenPayment.d.ts +66 -0
- package/lib/cjs/components/payment_source/AdyenPayment.js +2 -0
- package/lib/cjs/components/payment_source/BraintreePayment.d.ts +32 -0
- package/lib/cjs/components/payment_source/BraintreePayment.js +2 -0
- package/lib/cjs/components/payment_source/CheckoutComPayment.d.ts +23 -0
- package/lib/cjs/components/payment_source/CheckoutComPayment.js +2 -0
- package/lib/cjs/components/payment_source/ExternalPayment.d.ts +24 -0
- package/lib/cjs/components/payment_source/ExternalPayment.js +2 -0
- package/lib/cjs/components/payment_source/KlarnaPayment.d.ts +10 -0
- package/lib/cjs/components/payment_source/KlarnaPayment.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSource.d.ts +19 -0
- package/lib/cjs/components/payment_source/PaymentSource.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandIcon.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
- package/lib/cjs/components/payment_source/PaymentSourceBrandName.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.d.ts +15 -0
- package/lib/cjs/components/payment_source/PaymentSourceDetail.js +2 -0
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
- package/lib/cjs/components/payment_source/PaymentSourceEditButton.js +2 -0
- package/lib/cjs/components/payment_source/PaypalPayment.d.ts +12 -0
- package/lib/cjs/components/payment_source/PaypalPayment.js +2 -0
- package/lib/cjs/components/payment_source/StripeExpressPayment.d.ts +6 -0
- package/lib/cjs/components/payment_source/StripeExpressPayment.js +2 -0
- package/lib/cjs/components/payment_source/StripePayment.d.ts +21 -0
- package/lib/cjs/components/payment_source/StripePayment.js +2 -0
- package/lib/cjs/components/payment_source/WireTransferPayment.d.ts +12 -0
- package/lib/cjs/components/payment_source/WireTransferPayment.js +2 -0
- package/lib/cjs/components/prices/Price.d.ts +35 -0
- package/lib/cjs/components/prices/Price.js +2 -0
- package/lib/cjs/components/prices/PricesContainer.d.ts +41 -0
- package/lib/cjs/components/prices/PricesContainer.js +2 -0
- package/lib/cjs/components/shipments/Shipment.d.ts +10 -0
- package/lib/cjs/components/shipments/Shipment.js +2 -0
- package/lib/cjs/components/shipments/ShipmentField.d.ts +12 -0
- package/lib/cjs/components/shipments/ShipmentField.js +2 -0
- package/lib/cjs/components/shipments/ShipmentsContainer.d.ts +6 -0
- package/lib/cjs/components/shipments/ShipmentsContainer.js +2 -0
- package/lib/cjs/components/shipments/ShipmentsCount.d.ts +18 -0
- package/lib/cjs/components/shipments/ShipmentsCount.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethod.d.ts +8 -0
- package/lib/cjs/components/shipping_methods/ShippingMethod.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodName.d.ts +11 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodName.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodPrice.js +2 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
- package/lib/cjs/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
- package/lib/cjs/components/skus/AvailabilityContainer.d.ts +34 -0
- package/lib/cjs/components/skus/AvailabilityContainer.js +2 -0
- package/lib/cjs/components/skus/AvailabilityTemplate.d.ts +52 -0
- package/lib/cjs/components/skus/AvailabilityTemplate.js +2 -0
- package/lib/cjs/components/skus/DeliveryLeadTime.d.ts +10 -0
- package/lib/cjs/components/skus/DeliveryLeadTime.js +2 -0
- package/lib/cjs/components/skus/SkuField.d.ts +25 -0
- package/lib/cjs/components/skus/SkuField.js +2 -0
- package/lib/cjs/components/skus/SkuList.d.ts +10 -0
- package/lib/cjs/components/skus/SkuList.js +2 -0
- package/lib/cjs/components/skus/SkuListsContainer.d.ts +6 -0
- package/lib/cjs/components/skus/SkuListsContainer.js +2 -0
- package/lib/cjs/components/skus/Skus.d.ts +18 -0
- package/lib/cjs/components/skus/Skus.js +2 -0
- package/lib/cjs/components/skus/SkusContainer.d.ts +31 -0
- package/lib/cjs/components/skus/SkusContainer.js +2 -0
- package/lib/cjs/components/stock_transfers/StockTransfer.d.ts +7 -0
- package/lib/cjs/components/stock_transfers/StockTransfer.js +2 -0
- package/lib/cjs/components/stock_transfers/StockTransferField.d.ts +10 -0
- package/lib/cjs/components/stock_transfers/StockTransferField.js +2 -0
- package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +26 -0
- package/lib/cjs/components/utils/AddressCardsTemplate.js +2 -0
- package/lib/cjs/components/utils/BaseField.d.ts +8 -0
- package/lib/cjs/components/utils/BaseField.js +2 -0
- package/lib/cjs/components/utils/BaseInput.d.ts +5 -0
- package/lib/cjs/components/utils/BaseInput.js +2 -0
- package/lib/cjs/components/utils/BaseOrderPrice.d.ts +6 -0
- package/lib/cjs/components/utils/BaseOrderPrice.js +2 -0
- package/lib/cjs/components/utils/BaseSelect.d.ts +5 -0
- package/lib/cjs/components/utils/BaseSelect.js +2 -0
- package/lib/cjs/components/utils/ErrorBoundary.d.ts +14 -0
- package/lib/cjs/components/utils/ErrorBoundary.js +2 -0
- package/lib/cjs/components/utils/GenericFieldComponent.d.ts +58 -0
- package/lib/cjs/components/utils/GenericFieldComponent.js +2 -0
- package/lib/cjs/components/utils/Parent.d.ts +6 -0
- package/lib/cjs/components/utils/Parent.js +2 -0
- package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +41 -0
- package/lib/cjs/components/utils/PaymentCardsTemplate.js +2 -0
- package/lib/cjs/components/utils/PriceTemplate.d.ts +8 -0
- package/lib/cjs/components/utils/PriceTemplate.js +2 -0
- package/lib/cjs/components/utils/getAllErrors.d.ts +16 -0
- package/lib/cjs/components/utils/getAllErrors.js +2 -0
- package/lib/cjs/config/currency.d.ts +5 -0
- package/lib/cjs/config/currency.js +2 -0
- package/lib/cjs/context/AddressChildrenContext.d.ts +6 -0
- package/lib/cjs/context/AddressChildrenContext.js +2 -0
- package/lib/cjs/context/AddressContext.d.ts +18 -0
- package/lib/cjs/context/AddressContext.js +2 -0
- package/lib/cjs/context/AvailabilityContext.d.ts +2 -0
- package/lib/cjs/context/AvailabilityContext.js +2 -0
- package/lib/cjs/context/BillingAddressContext.d.ts +9 -0
- package/lib/cjs/context/BillingAddressContext.js +2 -0
- package/lib/cjs/context/BillingAddressFormContext.d.ts +22 -0
- package/lib/cjs/context/BillingAddressFormContext.js +2 -0
- package/lib/cjs/context/CommerceLayerContext.d.ts +6 -0
- package/lib/cjs/context/CommerceLayerContext.js +2 -0
- package/lib/cjs/context/CouponAndGiftCardFormContext.d.ts +8 -0
- package/lib/cjs/context/CouponAndGiftCardFormContext.js +2 -0
- package/lib/cjs/context/CustomerAddressFormContext.d.ts +17 -0
- package/lib/cjs/context/CustomerAddressFormContext.js +2 -0
- package/lib/cjs/context/CustomerContext.d.ts +29 -0
- package/lib/cjs/context/CustomerContext.js +2 -0
- package/lib/cjs/context/CustomerPaymentSourceContext.d.ts +11 -0
- package/lib/cjs/context/CustomerPaymentSourceContext.js +2 -0
- package/lib/cjs/context/ExternalFunctionContext.d.ts +11 -0
- package/lib/cjs/context/ExternalFunctionContext.js +2 -0
- package/lib/cjs/context/GiftCardContext.d.ts +10 -0
- package/lib/cjs/context/GiftCardContext.js +2 -0
- package/lib/cjs/context/InStockSubscriptionContext.d.ts +6 -0
- package/lib/cjs/context/InStockSubscriptionContext.js +2 -0
- package/lib/cjs/context/LineItemChildrenContext.d.ts +8 -0
- package/lib/cjs/context/LineItemChildrenContext.js +2 -0
- package/lib/cjs/context/LineItemContext.d.ts +7 -0
- package/lib/cjs/context/LineItemContext.js +2 -0
- package/lib/cjs/context/LineItemOptionChildrenContext.d.ts +9 -0
- package/lib/cjs/context/LineItemOptionChildrenContext.js +2 -0
- package/lib/cjs/context/OrderContext.d.ts +30 -0
- package/lib/cjs/context/OrderContext.js +2 -0
- package/lib/cjs/context/OrderListChildrenContext.d.ts +73 -0
- package/lib/cjs/context/OrderListChildrenContext.js +2 -0
- package/lib/cjs/context/OrderListPaginationContext.d.ts +15 -0
- package/lib/cjs/context/OrderListPaginationContext.js +2 -0
- package/lib/cjs/context/OrderStorageContext.d.ts +10 -0
- package/lib/cjs/context/OrderStorageContext.js +2 -0
- package/lib/cjs/context/ParcelChildrenContext.d.ts +6 -0
- package/lib/cjs/context/ParcelChildrenContext.js +2 -0
- package/lib/cjs/context/ParcelLineItemChildrenContext.d.ts +6 -0
- package/lib/cjs/context/ParcelLineItemChildrenContext.js +2 -0
- package/lib/cjs/context/PaymentMethodChildrenContext.d.ts +10 -0
- package/lib/cjs/context/PaymentMethodChildrenContext.js +2 -0
- package/lib/cjs/context/PaymentMethodContext.d.ts +13 -0
- package/lib/cjs/context/PaymentMethodContext.js +2 -0
- package/lib/cjs/context/PaymentSourceContext.d.ts +14 -0
- package/lib/cjs/context/PaymentSourceContext.js +2 -0
- package/lib/cjs/context/PlaceOrderContext.d.ts +12 -0
- package/lib/cjs/context/PlaceOrderContext.js +2 -0
- package/lib/cjs/context/PricesContext.d.ts +6 -0
- package/lib/cjs/context/PricesContext.js +2 -0
- package/lib/cjs/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/cjs/context/ShipmentChildrenContext.js +2 -0
- package/lib/cjs/context/ShipmentContext.d.ts +10 -0
- package/lib/cjs/context/ShipmentContext.js +2 -0
- package/lib/cjs/context/ShippingAddressContext.d.ts +9 -0
- package/lib/cjs/context/ShippingAddressContext.js +2 -0
- package/lib/cjs/context/ShippingAddressFormContext.d.ts +3 -0
- package/lib/cjs/context/ShippingAddressFormContext.js +2 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.d.ts +9 -0
- package/lib/cjs/context/ShippingMethodChildrenContext.js +2 -0
- package/lib/cjs/context/SkuChildrenContext.d.ts +8 -0
- package/lib/cjs/context/SkuChildrenContext.js +2 -0
- package/lib/cjs/context/SkuContext.d.ts +8 -0
- package/lib/cjs/context/SkuContext.js +2 -0
- package/lib/cjs/context/SkuListsContext.d.ts +5 -0
- package/lib/cjs/context/SkuListsContext.js +2 -0
- package/lib/cjs/context/StockTransferChildrenContext.d.ts +6 -0
- package/lib/cjs/context/StockTransferChildrenContext.js +2 -0
- package/lib/cjs/hooks/useCommerceLayer.d.ts +12 -0
- package/lib/cjs/hooks/useCommerceLayer.js +2 -0
- package/lib/cjs/hooks/useCustomerContainer.d.ts +12 -0
- package/lib/cjs/hooks/useCustomerContainer.js +2 -0
- package/lib/cjs/hooks/useOrderContainer.d.ts +16 -0
- package/lib/cjs/hooks/useOrderContainer.js +2 -0
- package/lib/cjs/index.d.ts +107 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/reducers/AddressReducer.d.ts +80 -0
- package/lib/cjs/reducers/AddressReducer.js +2 -0
- package/lib/cjs/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/cjs/reducers/AvailabilityReducer.js +2 -0
- package/lib/cjs/reducers/BillingAddressReducer.d.ts +31 -0
- package/lib/cjs/reducers/BillingAddressReducer.js +2 -0
- package/lib/cjs/reducers/CustomerReducer.d.ts +183 -0
- package/lib/cjs/reducers/CustomerReducer.js +2 -0
- package/lib/cjs/reducers/GiftCardReducer.d.ts +66 -0
- package/lib/cjs/reducers/GiftCardReducer.js +2 -0
- package/lib/cjs/reducers/InStockSubscriptionReducer.d.ts +33 -0
- package/lib/cjs/reducers/InStockSubscriptionReducer.js +2 -0
- package/lib/cjs/reducers/LineItemReducer.d.ts +47 -0
- package/lib/cjs/reducers/LineItemReducer.js +2 -0
- package/lib/cjs/reducers/OrderReducer.d.ts +171 -0
- package/lib/cjs/reducers/OrderReducer.js +2 -0
- package/lib/cjs/reducers/PaymentMethodReducer.d.ts +161 -0
- package/lib/cjs/reducers/PaymentMethodReducer.js +2 -0
- package/lib/cjs/reducers/PlaceOrderReducer.d.ts +72 -0
- package/lib/cjs/reducers/PlaceOrderReducer.js +2 -0
- package/lib/cjs/reducers/PriceReducer.d.ts +35 -0
- package/lib/cjs/reducers/PriceReducer.js +2 -0
- package/lib/cjs/reducers/ShipmentReducer.d.ts +41 -0
- package/lib/cjs/reducers/ShipmentReducer.js +2 -0
- package/lib/cjs/reducers/ShippingAddressReducer.d.ts +32 -0
- package/lib/cjs/reducers/ShippingAddressReducer.js +2 -0
- package/lib/cjs/reducers/SkuListsReducer.d.ts +21 -0
- package/lib/cjs/reducers/SkuListsReducer.js +2 -0
- package/lib/cjs/reducers/SkuReducer.d.ts +21 -0
- package/lib/cjs/reducers/SkuReducer.js +2 -0
- package/lib/cjs/typings/errors.d.ts +15 -0
- package/lib/cjs/typings/errors.js +2 -0
- package/lib/cjs/typings/globals.d.ts +6 -0
- package/lib/cjs/typings/globals.js +2 -0
- package/lib/cjs/typings/index.d.ts +117 -0
- package/lib/cjs/typings/index.js +2 -0
- package/lib/cjs/utils/PropsType.d.ts +33 -0
- package/lib/cjs/utils/PropsType.js +2 -0
- package/lib/cjs/utils/addressesManager.d.ts +64 -0
- package/lib/cjs/utils/addressesManager.js +2 -0
- package/lib/cjs/utils/adyen/manageGiftCard.d.ts +16 -0
- package/lib/cjs/utils/adyen/manageGiftCard.js +2 -0
- package/lib/cjs/utils/baseReducer.d.ts +3 -0
- package/lib/cjs/utils/baseReducer.js +2 -0
- package/lib/cjs/utils/browserInfo.d.ts +12 -0
- package/lib/cjs/utils/browserInfo.js +2 -0
- package/lib/cjs/utils/canPlaceOrder.d.ts +5 -0
- package/lib/cjs/utils/canPlaceOrder.js +2 -0
- package/lib/cjs/utils/checkIncludeResource.d.ts +8 -0
- package/lib/cjs/utils/checkIncludeResource.js +2 -0
- package/lib/cjs/utils/compareObjAttribute.d.ts +7 -0
- package/lib/cjs/utils/compareObjAttribute.js +2 -0
- package/lib/cjs/utils/countryStateCity.d.ts +801 -0
- package/lib/cjs/utils/countryStateCity.js +2 -0
- package/lib/cjs/utils/customMessages.d.ts +2 -0
- package/lib/cjs/utils/customMessages.js +2 -0
- package/lib/cjs/utils/customerOrderOptions.d.ts +3 -0
- package/lib/cjs/utils/customerOrderOptions.js +2 -0
- package/lib/cjs/utils/events.d.ts +5 -0
- package/lib/cjs/utils/events.js +2 -0
- package/lib/cjs/utils/expressPaymentHelper.d.ts +92 -0
- package/lib/cjs/utils/expressPaymentHelper.js +2 -0
- package/lib/cjs/utils/filterChildren.d.ts +12 -0
- package/lib/cjs/utils/filterChildren.js +2 -0
- package/lib/cjs/utils/formCleaner.d.ts +4 -0
- package/lib/cjs/utils/formCleaner.js +2 -0
- package/lib/cjs/utils/getAmount.d.ts +7 -0
- package/lib/cjs/utils/getAmount.js +2 -0
- package/lib/cjs/utils/getApplicationLink.d.ts +35 -0
- package/lib/cjs/utils/getApplicationLink.js +2 -0
- package/lib/cjs/utils/getCardDetails.d.ts +16 -0
- package/lib/cjs/utils/getCardDetails.js +2 -0
- package/lib/cjs/utils/getCustomerIdByToken.d.ts +6 -0
- package/lib/cjs/utils/getCustomerIdByToken.js +2 -0
- package/lib/cjs/utils/getDomain.d.ts +4 -0
- package/lib/cjs/utils/getDomain.js +2 -0
- package/lib/cjs/utils/getErrors.d.ts +19 -0
- package/lib/cjs/utils/getErrors.js +2 -0
- package/lib/cjs/utils/getLineItemsCount.d.ts +10 -0
- package/lib/cjs/utils/getLineItemsCount.js +2 -0
- package/lib/cjs/utils/getLoaderComponent.d.ts +3 -0
- package/lib/cjs/utils/getLoaderComponent.js +2 -0
- package/lib/cjs/utils/getPaymentAttributes.d.ts +17 -0
- package/lib/cjs/utils/getPaymentAttributes.js +2 -0
- package/lib/cjs/utils/getPrices.d.ts +6 -0
- package/lib/cjs/utils/getPrices.js +2 -0
- package/lib/cjs/utils/getPublicIp.d.ts +1 -0
- package/lib/cjs/utils/getPublicIp.js +2 -0
- package/lib/cjs/utils/getSdk.d.ts +3 -0
- package/lib/cjs/utils/getSdk.js +2 -0
- package/lib/cjs/utils/getSkus.d.ts +3 -0
- package/lib/cjs/utils/getSkus.js +2 -0
- package/lib/cjs/utils/hasSubscriptions.d.ts +7 -0
- package/lib/cjs/utils/hasSubscriptions.js +2 -0
- package/lib/cjs/utils/hooks/useCustomContext.d.ts +21 -0
- package/lib/cjs/utils/hooks/useCustomContext.js +2 -0
- package/lib/cjs/utils/hooks/useExternalScript.d.ts +1 -0
- package/lib/cjs/utils/hooks/useExternalScript.js +2 -0
- package/lib/cjs/utils/icons.d.ts +2 -0
- package/lib/cjs/utils/icons.js +2 -0
- package/lib/cjs/utils/isDate.d.ts +1 -0
- package/lib/cjs/utils/isDate.js +2 -0
- package/lib/cjs/utils/isEmpty.d.ts +1 -0
- package/lib/cjs/utils/isEmpty.js +2 -0
- package/lib/cjs/utils/isGuestToken.d.ts +6 -0
- package/lib/cjs/utils/isGuestToken.js +2 -0
- package/lib/cjs/utils/isJSON.d.ts +1 -0
- package/lib/cjs/utils/isJSON.js +2 -0
- package/lib/cjs/utils/jwt.d.ts +27 -0
- package/lib/cjs/utils/jwt.js +2 -0
- package/lib/cjs/utils/localStorage.d.ts +11 -0
- package/lib/cjs/utils/localStorage.js +2 -0
- package/lib/cjs/utils/omit.d.ts +1 -0
- package/lib/cjs/utils/omit.js +2 -0
- package/lib/cjs/utils/organization.d.ts +18 -0
- package/lib/cjs/utils/organization.js +2 -0
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
- package/lib/cjs/utils/payment-methods/sortPaymentMethods.js +2 -0
- package/lib/cjs/utils/pick.d.ts +1 -0
- package/lib/cjs/utils/pick.js +2 -0
- package/lib/cjs/utils/placeholderImages.d.ts +2 -0
- package/lib/cjs/utils/placeholderImages.js +2 -0
- package/lib/cjs/utils/promisify.d.ts +1 -0
- package/lib/cjs/utils/promisify.js +2 -0
- package/lib/cjs/utils/replace.d.ts +2 -0
- package/lib/cjs/utils/replace.js +2 -0
- package/lib/cjs/utils/scrollbarWidth.d.ts +1 -0
- package/lib/cjs/utils/scrollbarWidth.js +2 -0
- package/lib/cjs/utils/shipments.d.ts +3 -0
- package/lib/cjs/utils/shipments.js +2 -0
- package/lib/cjs/utils/snakeToCamelCase.d.ts +5 -0
- package/lib/cjs/utils/snakeToCamelCase.js +2 -0
- package/lib/cjs/utils/stripe/retrievePaymentIntent.d.ts +14 -0
- package/lib/cjs/utils/stripe/retrievePaymentIntent.js +2 -0
- package/lib/cjs/utils/triggerAttributeHelper.d.ts +31 -0
- package/lib/cjs/utils/triggerAttributeHelper.js +2 -0
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
- package/lib/cjs/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
- package/lib/cjs/utils/validateFormFields.d.ts +16 -0
- package/lib/cjs/utils/validateFormFields.js +2 -0
- package/lib/esm/components/ExternalFunction.d.ts +7 -0
- package/lib/esm/components/ExternalFunction.js +2 -0
- package/lib/esm/components/MetadataInput.d.ts +5 -0
- package/lib/esm/components/MetadataInput.js +2 -0
- package/lib/esm/components/SubmitButton.d.ts +10 -0
- package/lib/esm/components/SubmitButton.js +2 -0
- package/lib/esm/components/addresses/Address.d.ts +31 -0
- package/lib/esm/components/addresses/Address.js +2 -0
- package/lib/esm/components/addresses/AddressCountrySelector.d.ts +34 -0
- package/lib/esm/components/addresses/AddressCountrySelector.js +2 -0
- package/lib/esm/components/addresses/AddressField.d.ts +61 -0
- package/lib/esm/components/addresses/AddressField.js +2 -0
- package/lib/esm/components/addresses/AddressInput.d.ts +34 -0
- package/lib/esm/components/addresses/AddressInput.js +2 -0
- package/lib/esm/components/addresses/AddressInputSelect.d.ts +29 -0
- package/lib/esm/components/addresses/AddressInputSelect.js +2 -0
- package/lib/esm/components/addresses/AddressStateSelector.d.ts +50 -0
- package/lib/esm/components/addresses/AddressStateSelector.js +2 -0
- package/lib/esm/components/addresses/AddressesContainer.d.ts +40 -0
- package/lib/esm/components/addresses/AddressesContainer.js +2 -0
- package/lib/esm/components/addresses/AddressesEmpty.d.ts +26 -0
- package/lib/esm/components/addresses/AddressesEmpty.js +2 -0
- package/lib/esm/components/addresses/BillingAddressContainer.d.ts +6 -0
- package/lib/esm/components/addresses/BillingAddressContainer.js +2 -0
- package/lib/esm/components/addresses/BillingAddressForm.d.ts +34 -0
- package/lib/esm/components/addresses/BillingAddressForm.js +2 -0
- package/lib/esm/components/addresses/SaveAddressesButton.d.ts +18 -0
- package/lib/esm/components/addresses/SaveAddressesButton.js +2 -0
- package/lib/esm/components/addresses/ShippingAddressContainer.d.ts +7 -0
- package/lib/esm/components/addresses/ShippingAddressContainer.js +2 -0
- package/lib/esm/components/addresses/ShippingAddressForm.d.ts +31 -0
- package/lib/esm/components/addresses/ShippingAddressForm.js +2 -0
- package/lib/esm/components/auth/CommerceLayer.d.ts +25 -0
- package/lib/esm/components/auth/CommerceLayer.js +2 -0
- package/lib/esm/components/customers/CustomerAddressForm.d.ts +13 -0
- package/lib/esm/components/customers/CustomerAddressForm.js +2 -0
- package/lib/esm/components/customers/CustomerContainer.d.ts +38 -0
- package/lib/esm/components/customers/CustomerContainer.js +2 -0
- package/lib/esm/components/customers/CustomerField.d.ts +25 -0
- package/lib/esm/components/customers/CustomerField.js +2 -0
- package/lib/esm/components/customers/CustomerInput.d.ts +11 -0
- package/lib/esm/components/customers/CustomerInput.js +2 -0
- package/lib/esm/components/customers/CustomerPaymentSource.d.ts +11 -0
- package/lib/esm/components/customers/CustomerPaymentSource.js +2 -0
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.d.ts +14 -0
- package/lib/esm/components/customers/CustomerPaymentSourceEmpty.js +2 -0
- package/lib/esm/components/customers/MyAccountLink.d.ts +38 -0
- package/lib/esm/components/customers/MyAccountLink.js +2 -0
- package/lib/esm/components/customers/MyIdentityLink.d.ts +59 -0
- package/lib/esm/components/customers/MyIdentityLink.js +2 -0
- package/lib/esm/components/customers/SaveCustomerButton.d.ts +12 -0
- package/lib/esm/components/customers/SaveCustomerButton.js +2 -0
- package/lib/esm/components/errors/Errors.d.ts +31 -0
- package/lib/esm/components/errors/Errors.js +2 -0
- package/lib/esm/components/gift_cards/GiftCard.d.ts +10 -0
- package/lib/esm/components/gift_cards/GiftCard.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardContainer.d.ts +6 -0
- package/lib/esm/components/gift_cards/GiftCardContainer.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.d.ts +7 -0
- package/lib/esm/components/gift_cards/GiftCardCurrencySelector.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardInput.d.ts +7 -0
- package/lib/esm/components/gift_cards/GiftCardInput.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.d.ts +16 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponCode.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.d.ts +15 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponForm.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.d.ts +11 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponInput.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.d.ts +20 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponRemoveButton.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.d.ts +10 -0
- package/lib/esm/components/gift_cards/GiftCardOrCouponSubmit.js +2 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.d.ts +0 -0
- package/lib/esm/components/gift_cards/GiftCardRecipientInput.js +2 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.d.ts +36 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionButton.js +2 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.d.ts +10 -0
- package/lib/esm/components/in_stock_subscriptions/InStockSubscriptionsContainer.js +2 -0
- package/lib/esm/components/line_items/LineItem.d.ts +8 -0
- package/lib/esm/components/line_items/LineItem.js +2 -0
- package/lib/esm/components/line_items/LineItemAmount.d.ts +7 -0
- package/lib/esm/components/line_items/LineItemAmount.js +2 -0
- package/lib/esm/components/line_items/LineItemCode.d.ts +13 -0
- package/lib/esm/components/line_items/LineItemCode.js +2 -0
- package/lib/esm/components/line_items/LineItemField.d.ts +14 -0
- package/lib/esm/components/line_items/LineItemField.js +2 -0
- package/lib/esm/components/line_items/LineItemImage.d.ts +17 -0
- package/lib/esm/components/line_items/LineItemImage.js +2 -0
- package/lib/esm/components/line_items/LineItemName.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemName.js +2 -0
- package/lib/esm/components/line_items/LineItemOption.d.ts +19 -0
- package/lib/esm/components/line_items/LineItemOption.js +2 -0
- package/lib/esm/components/line_items/LineItemOptions.d.ts +16 -0
- package/lib/esm/components/line_items/LineItemOptions.js +2 -0
- package/lib/esm/components/line_items/LineItemQuantity.d.ts +21 -0
- package/lib/esm/components/line_items/LineItemQuantity.js +2 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.d.ts +14 -0
- package/lib/esm/components/line_items/LineItemRemoveLink.js +2 -0
- package/lib/esm/components/line_items/LineItemsContainer.d.ts +9 -0
- package/lib/esm/components/line_items/LineItemsContainer.js +2 -0
- package/lib/esm/components/line_items/LineItemsCount.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemsCount.js +2 -0
- package/lib/esm/components/line_items/LineItemsEmpty.d.ts +12 -0
- package/lib/esm/components/line_items/LineItemsEmpty.js +2 -0
- package/lib/esm/components/orders/AddToCartButton.d.ts +95 -0
- package/lib/esm/components/orders/AddToCartButton.js +2 -0
- package/lib/esm/components/orders/AdjustmentAmount.d.ts +4 -0
- package/lib/esm/components/orders/AdjustmentAmount.js +2 -0
- package/lib/esm/components/orders/CartLink.d.ts +47 -0
- package/lib/esm/components/orders/CartLink.js +2 -0
- package/lib/esm/components/orders/CheckoutLink.d.ts +28 -0
- package/lib/esm/components/orders/CheckoutLink.js +2 -0
- package/lib/esm/components/orders/DiscountAmount.d.ts +4 -0
- package/lib/esm/components/orders/DiscountAmount.js +2 -0
- package/lib/esm/components/orders/GiftCardAmount.d.ts +4 -0
- package/lib/esm/components/orders/GiftCardAmount.js +2 -0
- package/lib/esm/components/orders/HostedCart.d.ts +58 -0
- package/lib/esm/components/orders/HostedCart.js +2 -0
- package/lib/esm/components/orders/OrderContainer.d.ts +62 -0
- package/lib/esm/components/orders/OrderContainer.js +2 -0
- package/lib/esm/components/orders/OrderList.d.ts +83 -0
- package/lib/esm/components/orders/OrderList.js +2 -0
- package/lib/esm/components/orders/OrderListEmpty.d.ts +17 -0
- package/lib/esm/components/orders/OrderListEmpty.js +2 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.d.ts +48 -0
- package/lib/esm/components/orders/OrderListPaginationButtons.js +2 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.d.ts +29 -0
- package/lib/esm/components/orders/OrderListPaginationInfo.js +2 -0
- package/lib/esm/components/orders/OrderListRow.d.ts +29 -0
- package/lib/esm/components/orders/OrderListRow.js +2 -0
- package/lib/esm/components/orders/OrderNumber.d.ts +5 -0
- package/lib/esm/components/orders/OrderNumber.js +2 -0
- package/lib/esm/components/orders/OrderStorage.d.ts +31 -0
- package/lib/esm/components/orders/OrderStorage.js +2 -0
- package/lib/esm/components/orders/PaymentMethodAmount.d.ts +4 -0
- package/lib/esm/components/orders/PaymentMethodAmount.js +2 -0
- package/lib/esm/components/orders/PlaceOrderButton.d.ts +35 -0
- package/lib/esm/components/orders/PlaceOrderButton.js +2 -0
- package/lib/esm/components/orders/PlaceOrderContainer.d.ts +8 -0
- package/lib/esm/components/orders/PlaceOrderContainer.js +2 -0
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.d.ts +4 -0
- package/lib/esm/components/orders/PrivacyAndTermsCheckbox.js +2 -0
- package/lib/esm/components/orders/ShippingAmount.d.ts +4 -0
- package/lib/esm/components/orders/ShippingAmount.js +2 -0
- package/lib/esm/components/orders/SubTotalAmount.d.ts +4 -0
- package/lib/esm/components/orders/SubTotalAmount.js +2 -0
- package/lib/esm/components/orders/TaxesAmount.d.ts +4 -0
- package/lib/esm/components/orders/TaxesAmount.js +2 -0
- package/lib/esm/components/orders/TotalAmount.d.ts +4 -0
- package/lib/esm/components/orders/TotalAmount.js +2 -0
- package/lib/esm/components/parcels/ParcelField.d.ts +14 -0
- package/lib/esm/components/parcels/ParcelField.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItem.d.ts +7 -0
- package/lib/esm/components/parcels/ParcelLineItem.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItemField.d.ts +14 -0
- package/lib/esm/components/parcels/ParcelLineItemField.js +2 -0
- package/lib/esm/components/parcels/ParcelLineItemsCount.d.ts +18 -0
- package/lib/esm/components/parcels/ParcelLineItemsCount.js +2 -0
- package/lib/esm/components/parcels/Parcels.d.ts +7 -0
- package/lib/esm/components/parcels/Parcels.js +2 -0
- package/lib/esm/components/parcels/ParcelsCount.d.ts +18 -0
- package/lib/esm/components/parcels/ParcelsCount.js +2 -0
- package/lib/esm/components/payment_gateways/AdyenGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/AdyenGateway.js +2 -0
- package/lib/esm/components/payment_gateways/BraintreeGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/BraintreeGateway.js +2 -0
- package/lib/esm/components/payment_gateways/CheckoutComGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/CheckoutComGateway.js +2 -0
- package/lib/esm/components/payment_gateways/ExternalGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/ExternalGateway.js +2 -0
- package/lib/esm/components/payment_gateways/KlarnaGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/KlarnaGateway.js +2 -0
- package/lib/esm/components/payment_gateways/PaymentGateway.d.ts +16 -0
- package/lib/esm/components/payment_gateways/PaymentGateway.js +2 -0
- package/lib/esm/components/payment_gateways/PaypalGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/PaypalGateway.js +2 -0
- package/lib/esm/components/payment_gateways/StripeGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/StripeGateway.js +2 -0
- package/lib/esm/components/payment_gateways/WireTransferGateway.d.ts +5 -0
- package/lib/esm/components/payment_gateways/WireTransferGateway.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethod.d.ts +45 -0
- package/lib/esm/components/payment_methods/PaymentMethod.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.d.ts +10 -0
- package/lib/esm/components/payment_methods/PaymentMethodName.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.d.ts +8 -0
- package/lib/esm/components/payment_methods/PaymentMethodPrice.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.d.ts +17 -0
- package/lib/esm/components/payment_methods/PaymentMethodRadioButton.js +2 -0
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.d.ts +8 -0
- package/lib/esm/components/payment_methods/PaymentMethodsContainer.js +2 -0
- package/lib/esm/components/payment_source/AdyenPayment.d.ts +66 -0
- package/lib/esm/components/payment_source/AdyenPayment.js +2 -0
- package/lib/esm/components/payment_source/BraintreePayment.d.ts +32 -0
- package/lib/esm/components/payment_source/BraintreePayment.js +2 -0
- package/lib/esm/components/payment_source/CheckoutComPayment.d.ts +23 -0
- package/lib/esm/components/payment_source/CheckoutComPayment.js +2 -0
- package/lib/esm/components/payment_source/ExternalPayment.d.ts +24 -0
- package/lib/esm/components/payment_source/ExternalPayment.js +2 -0
- package/lib/esm/components/payment_source/KlarnaPayment.d.ts +10 -0
- package/lib/esm/components/payment_source/KlarnaPayment.js +2 -0
- package/lib/esm/components/payment_source/PaymentSource.d.ts +19 -0
- package/lib/esm/components/payment_source/PaymentSource.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.d.ts +15 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandIcon.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.d.ts +12 -0
- package/lib/esm/components/payment_source/PaymentSourceBrandName.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.d.ts +15 -0
- package/lib/esm/components/payment_source/PaymentSourceDetail.js +2 -0
- package/lib/esm/components/payment_source/PaymentSourceEditButton.d.ts +10 -0
- package/lib/esm/components/payment_source/PaymentSourceEditButton.js +2 -0
- package/lib/esm/components/payment_source/PaypalPayment.d.ts +12 -0
- package/lib/esm/components/payment_source/PaypalPayment.js +2 -0
- package/lib/esm/components/payment_source/StripeExpressPayment.d.ts +6 -0
- package/lib/esm/components/payment_source/StripeExpressPayment.js +2 -0
- package/lib/esm/components/payment_source/StripePayment.d.ts +21 -0
- package/lib/esm/components/payment_source/StripePayment.js +2 -0
- package/lib/esm/components/payment_source/WireTransferPayment.d.ts +12 -0
- package/lib/esm/components/payment_source/WireTransferPayment.js +2 -0
- package/lib/esm/components/prices/Price.d.ts +35 -0
- package/lib/esm/components/prices/Price.js +2 -0
- package/lib/esm/components/prices/PricesContainer.d.ts +41 -0
- package/lib/esm/components/prices/PricesContainer.js +2 -0
- package/lib/esm/components/shipments/Shipment.d.ts +10 -0
- package/lib/esm/components/shipments/Shipment.js +2 -0
- package/lib/esm/components/shipments/ShipmentField.d.ts +12 -0
- package/lib/esm/components/shipments/ShipmentField.js +2 -0
- package/lib/esm/components/shipments/ShipmentsContainer.d.ts +6 -0
- package/lib/esm/components/shipments/ShipmentsContainer.js +2 -0
- package/lib/esm/components/shipments/ShipmentsCount.d.ts +18 -0
- package/lib/esm/components/shipments/ShipmentsCount.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethod.d.ts +8 -0
- package/lib/esm/components/shipping_methods/ShippingMethod.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodName.d.ts +11 -0
- package/lib/esm/components/shipping_methods/ShippingMethodName.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.d.ts +20 -0
- package/lib/esm/components/shipping_methods/ShippingMethodPrice.js +2 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.d.ts +17 -0
- package/lib/esm/components/shipping_methods/ShippingMethodRadioButton.js +2 -0
- package/lib/esm/components/skus/AvailabilityContainer.d.ts +34 -0
- package/lib/esm/components/skus/AvailabilityContainer.js +2 -0
- package/lib/esm/components/skus/AvailabilityTemplate.d.ts +52 -0
- package/lib/esm/components/skus/AvailabilityTemplate.js +2 -0
- package/lib/esm/components/skus/DeliveryLeadTime.d.ts +10 -0
- package/lib/esm/components/skus/DeliveryLeadTime.js +2 -0
- package/lib/esm/components/skus/SkuField.d.ts +25 -0
- package/lib/esm/components/skus/SkuField.js +2 -0
- package/lib/esm/components/skus/SkuList.d.ts +10 -0
- package/lib/esm/components/skus/SkuList.js +2 -0
- package/lib/esm/components/skus/SkuListsContainer.d.ts +6 -0
- package/lib/esm/components/skus/SkuListsContainer.js +2 -0
- package/lib/esm/components/skus/Skus.d.ts +18 -0
- package/lib/esm/components/skus/Skus.js +2 -0
- package/lib/esm/components/skus/SkusContainer.d.ts +31 -0
- package/lib/esm/components/skus/SkusContainer.js +2 -0
- package/lib/esm/components/stock_transfers/StockTransfer.d.ts +7 -0
- package/lib/esm/components/stock_transfers/StockTransfer.js +2 -0
- package/lib/esm/components/stock_transfers/StockTransferField.d.ts +10 -0
- package/lib/esm/components/stock_transfers/StockTransferField.js +2 -0
- package/lib/esm/components/utils/AddressCardsTemplate.d.ts +26 -0
- package/lib/esm/components/utils/AddressCardsTemplate.js +2 -0
- package/lib/esm/components/utils/BaseField.d.ts +8 -0
- package/lib/esm/components/utils/BaseField.js +2 -0
- package/lib/esm/components/utils/BaseInput.d.ts +5 -0
- package/lib/esm/components/utils/BaseInput.js +2 -0
- package/lib/esm/components/utils/BaseOrderPrice.d.ts +6 -0
- package/lib/esm/components/utils/BaseOrderPrice.js +2 -0
- package/lib/esm/components/utils/BaseSelect.d.ts +5 -0
- package/lib/esm/components/utils/BaseSelect.js +2 -0
- package/lib/esm/components/utils/ErrorBoundary.d.ts +14 -0
- package/lib/esm/components/utils/ErrorBoundary.js +2 -0
- package/lib/esm/components/utils/GenericFieldComponent.d.ts +58 -0
- package/lib/esm/components/utils/GenericFieldComponent.js +2 -0
- package/lib/esm/components/utils/Parent.d.ts +6 -0
- package/lib/esm/components/utils/Parent.js +2 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +41 -0
- package/lib/esm/components/utils/PaymentCardsTemplate.js +2 -0
- package/lib/esm/components/utils/PriceTemplate.d.ts +8 -0
- package/lib/esm/components/utils/PriceTemplate.js +2 -0
- package/lib/esm/components/utils/getAllErrors.d.ts +16 -0
- package/lib/esm/components/utils/getAllErrors.js +2 -0
- package/lib/esm/config/currency.d.ts +5 -0
- package/lib/esm/config/currency.js +2 -0
- package/lib/esm/context/AddressChildrenContext.d.ts +6 -0
- package/lib/esm/context/AddressChildrenContext.js +2 -0
- package/lib/esm/context/AddressContext.d.ts +18 -0
- package/lib/esm/context/AddressContext.js +2 -0
- package/lib/esm/context/AvailabilityContext.d.ts +2 -0
- package/lib/esm/context/AvailabilityContext.js +2 -0
- package/lib/esm/context/BillingAddressContext.d.ts +9 -0
- package/lib/esm/context/BillingAddressContext.js +2 -0
- package/lib/esm/context/BillingAddressFormContext.d.ts +22 -0
- package/lib/esm/context/BillingAddressFormContext.js +2 -0
- package/lib/esm/context/CommerceLayerContext.d.ts +6 -0
- package/lib/esm/context/CommerceLayerContext.js +2 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.d.ts +8 -0
- package/lib/esm/context/CouponAndGiftCardFormContext.js +2 -0
- package/lib/esm/context/CustomerAddressFormContext.d.ts +17 -0
- package/lib/esm/context/CustomerAddressFormContext.js +2 -0
- package/lib/esm/context/CustomerContext.d.ts +29 -0
- package/lib/esm/context/CustomerContext.js +2 -0
- package/lib/esm/context/CustomerPaymentSourceContext.d.ts +11 -0
- package/lib/esm/context/CustomerPaymentSourceContext.js +2 -0
- package/lib/esm/context/ExternalFunctionContext.d.ts +11 -0
- package/lib/esm/context/ExternalFunctionContext.js +2 -0
- package/lib/esm/context/GiftCardContext.d.ts +10 -0
- package/lib/esm/context/GiftCardContext.js +2 -0
- package/lib/esm/context/InStockSubscriptionContext.d.ts +6 -0
- package/lib/esm/context/InStockSubscriptionContext.js +2 -0
- package/lib/esm/context/LineItemChildrenContext.d.ts +8 -0
- package/lib/esm/context/LineItemChildrenContext.js +2 -0
- package/lib/esm/context/LineItemContext.d.ts +7 -0
- package/lib/esm/context/LineItemContext.js +2 -0
- package/lib/esm/context/LineItemOptionChildrenContext.d.ts +9 -0
- package/lib/esm/context/LineItemOptionChildrenContext.js +2 -0
- package/lib/esm/context/OrderContext.d.ts +30 -0
- package/lib/esm/context/OrderContext.js +2 -0
- package/lib/esm/context/OrderListChildrenContext.d.ts +73 -0
- package/lib/esm/context/OrderListChildrenContext.js +2 -0
- package/lib/esm/context/OrderListPaginationContext.d.ts +15 -0
- package/lib/esm/context/OrderListPaginationContext.js +2 -0
- package/lib/esm/context/OrderStorageContext.d.ts +10 -0
- package/lib/esm/context/OrderStorageContext.js +2 -0
- package/lib/esm/context/ParcelChildrenContext.d.ts +6 -0
- package/lib/esm/context/ParcelChildrenContext.js +2 -0
- package/lib/esm/context/ParcelLineItemChildrenContext.d.ts +6 -0
- package/lib/esm/context/ParcelLineItemChildrenContext.js +2 -0
- package/lib/esm/context/PaymentMethodChildrenContext.d.ts +10 -0
- package/lib/esm/context/PaymentMethodChildrenContext.js +2 -0
- package/lib/esm/context/PaymentMethodContext.d.ts +13 -0
- package/lib/esm/context/PaymentMethodContext.js +2 -0
- package/lib/esm/context/PaymentSourceContext.d.ts +14 -0
- package/lib/esm/context/PaymentSourceContext.js +2 -0
- package/lib/esm/context/PlaceOrderContext.d.ts +12 -0
- package/lib/esm/context/PlaceOrderContext.js +2 -0
- package/lib/esm/context/PricesContext.d.ts +6 -0
- package/lib/esm/context/PricesContext.js +2 -0
- package/lib/esm/context/ShipmentChildrenContext.d.ts +13 -0
- package/lib/esm/context/ShipmentChildrenContext.js +2 -0
- package/lib/esm/context/ShipmentContext.d.ts +10 -0
- package/lib/esm/context/ShipmentContext.js +2 -0
- package/lib/esm/context/ShippingAddressContext.d.ts +9 -0
- package/lib/esm/context/ShippingAddressContext.js +2 -0
- package/lib/esm/context/ShippingAddressFormContext.d.ts +3 -0
- package/lib/esm/context/ShippingAddressFormContext.js +2 -0
- package/lib/esm/context/ShippingMethodChildrenContext.d.ts +9 -0
- package/lib/esm/context/ShippingMethodChildrenContext.js +2 -0
- package/lib/esm/context/SkuChildrenContext.d.ts +8 -0
- package/lib/esm/context/SkuChildrenContext.js +2 -0
- package/lib/esm/context/SkuContext.d.ts +8 -0
- package/lib/esm/context/SkuContext.js +2 -0
- package/lib/esm/context/SkuListsContext.d.ts +5 -0
- package/lib/esm/context/SkuListsContext.js +2 -0
- package/lib/esm/context/StockTransferChildrenContext.d.ts +6 -0
- package/lib/esm/context/StockTransferChildrenContext.js +2 -0
- package/lib/esm/hooks/useCommerceLayer.d.ts +12 -0
- package/lib/esm/hooks/useCommerceLayer.js +2 -0
- package/lib/esm/hooks/useCustomerContainer.d.ts +12 -0
- package/lib/esm/hooks/useCustomerContainer.js +2 -0
- package/lib/esm/hooks/useOrderContainer.d.ts +16 -0
- package/lib/esm/hooks/useOrderContainer.js +2 -0
- package/lib/esm/index.d.ts +107 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/reducers/AddressReducer.d.ts +80 -0
- package/lib/esm/reducers/AddressReducer.js +2 -0
- package/lib/esm/reducers/AvailabilityReducer.d.ts +53 -0
- package/lib/esm/reducers/AvailabilityReducer.js +2 -0
- package/lib/esm/reducers/BillingAddressReducer.d.ts +31 -0
- package/lib/esm/reducers/BillingAddressReducer.js +2 -0
- package/lib/esm/reducers/CustomerReducer.d.ts +183 -0
- package/lib/esm/reducers/CustomerReducer.js +2 -0
- package/lib/esm/reducers/GiftCardReducer.d.ts +66 -0
- package/lib/esm/reducers/GiftCardReducer.js +2 -0
- package/lib/esm/reducers/InStockSubscriptionReducer.d.ts +33 -0
- package/lib/esm/reducers/InStockSubscriptionReducer.js +2 -0
- package/lib/esm/reducers/LineItemReducer.d.ts +47 -0
- package/lib/esm/reducers/LineItemReducer.js +2 -0
- package/lib/esm/reducers/OrderReducer.d.ts +171 -0
- package/lib/esm/reducers/OrderReducer.js +2 -0
- package/lib/esm/reducers/PaymentMethodReducer.d.ts +161 -0
- package/lib/esm/reducers/PaymentMethodReducer.js +2 -0
- package/lib/esm/reducers/PlaceOrderReducer.d.ts +72 -0
- package/lib/esm/reducers/PlaceOrderReducer.js +2 -0
- package/lib/esm/reducers/PriceReducer.d.ts +35 -0
- package/lib/esm/reducers/PriceReducer.js +2 -0
- package/lib/esm/reducers/ShipmentReducer.d.ts +41 -0
- package/lib/esm/reducers/ShipmentReducer.js +2 -0
- package/lib/esm/reducers/ShippingAddressReducer.d.ts +32 -0
- package/lib/esm/reducers/ShippingAddressReducer.js +2 -0
- package/lib/esm/reducers/SkuListsReducer.d.ts +21 -0
- package/lib/esm/reducers/SkuListsReducer.js +2 -0
- package/lib/esm/reducers/SkuReducer.d.ts +21 -0
- package/lib/esm/reducers/SkuReducer.js +2 -0
- package/lib/esm/typings/errors.d.ts +15 -0
- package/lib/esm/typings/errors.js +2 -0
- package/lib/esm/typings/globals.d.ts +6 -0
- package/lib/esm/typings/globals.js +2 -0
- package/lib/esm/typings/index.d.ts +117 -0
- package/lib/esm/typings/index.js +2 -0
- package/lib/esm/utils/PropsType.d.ts +33 -0
- package/lib/esm/utils/PropsType.js +2 -0
- package/lib/esm/utils/addressesManager.d.ts +64 -0
- package/lib/esm/utils/addressesManager.js +2 -0
- package/lib/esm/utils/adyen/manageGiftCard.d.ts +16 -0
- package/lib/esm/utils/adyen/manageGiftCard.js +2 -0
- package/lib/esm/utils/baseReducer.d.ts +3 -0
- package/lib/esm/utils/baseReducer.js +2 -0
- package/lib/esm/utils/browserInfo.d.ts +12 -0
- package/lib/esm/utils/browserInfo.js +2 -0
- package/lib/esm/utils/canPlaceOrder.d.ts +5 -0
- package/lib/esm/utils/canPlaceOrder.js +2 -0
- package/lib/esm/utils/checkIncludeResource.d.ts +8 -0
- package/lib/esm/utils/checkIncludeResource.js +2 -0
- package/lib/esm/utils/compareObjAttribute.d.ts +7 -0
- package/lib/esm/utils/compareObjAttribute.js +2 -0
- package/lib/esm/utils/countryStateCity.d.ts +801 -0
- package/lib/esm/utils/countryStateCity.js +2 -0
- package/lib/esm/utils/customMessages.d.ts +2 -0
- package/lib/esm/utils/customMessages.js +2 -0
- package/lib/esm/utils/customerOrderOptions.d.ts +3 -0
- package/lib/esm/utils/customerOrderOptions.js +2 -0
- package/lib/esm/utils/events.d.ts +5 -0
- package/lib/esm/utils/events.js +2 -0
- package/lib/esm/utils/expressPaymentHelper.d.ts +92 -0
- package/lib/esm/utils/expressPaymentHelper.js +2 -0
- package/lib/esm/utils/filterChildren.d.ts +12 -0
- package/lib/esm/utils/filterChildren.js +2 -0
- package/lib/esm/utils/formCleaner.d.ts +4 -0
- package/lib/esm/utils/formCleaner.js +2 -0
- package/lib/esm/utils/getAmount.d.ts +7 -0
- package/lib/esm/utils/getAmount.js +2 -0
- package/lib/esm/utils/getApplicationLink.d.ts +35 -0
- package/lib/esm/utils/getApplicationLink.js +2 -0
- package/lib/esm/utils/getCardDetails.d.ts +16 -0
- package/lib/esm/utils/getCardDetails.js +2 -0
- package/lib/esm/utils/getCustomerIdByToken.d.ts +6 -0
- package/lib/esm/utils/getCustomerIdByToken.js +2 -0
- package/lib/esm/utils/getDomain.d.ts +4 -0
- package/lib/esm/utils/getDomain.js +2 -0
- package/lib/esm/utils/getErrors.d.ts +19 -0
- package/lib/esm/utils/getErrors.js +2 -0
- package/lib/esm/utils/getLineItemsCount.d.ts +10 -0
- package/lib/esm/utils/getLineItemsCount.js +2 -0
- package/lib/esm/utils/getLoaderComponent.d.ts +3 -0
- package/lib/esm/utils/getLoaderComponent.js +2 -0
- package/lib/esm/utils/getPaymentAttributes.d.ts +17 -0
- package/lib/esm/utils/getPaymentAttributes.js +2 -0
- package/lib/esm/utils/getPrices.d.ts +6 -0
- package/lib/esm/utils/getPrices.js +2 -0
- package/lib/esm/utils/getPublicIp.d.ts +1 -0
- package/lib/esm/utils/getPublicIp.js +2 -0
- package/lib/esm/utils/getSdk.d.ts +3 -0
- package/lib/esm/utils/getSdk.js +2 -0
- package/lib/esm/utils/getSkus.d.ts +3 -0
- package/lib/esm/utils/getSkus.js +2 -0
- package/lib/esm/utils/hasSubscriptions.d.ts +7 -0
- package/lib/esm/utils/hasSubscriptions.js +2 -0
- package/lib/esm/utils/hooks/useCustomContext.d.ts +21 -0
- package/lib/esm/utils/hooks/useCustomContext.js +2 -0
- package/lib/esm/utils/hooks/useExternalScript.d.ts +1 -0
- package/lib/esm/utils/hooks/useExternalScript.js +2 -0
- package/lib/esm/utils/icons.d.ts +2 -0
- package/lib/esm/utils/icons.js +2 -0
- package/lib/esm/utils/isDate.d.ts +1 -0
- package/lib/esm/utils/isDate.js +2 -0
- package/lib/esm/utils/isEmpty.d.ts +1 -0
- package/lib/esm/utils/isEmpty.js +2 -0
- package/lib/esm/utils/isGuestToken.d.ts +6 -0
- package/lib/esm/utils/isGuestToken.js +2 -0
- package/lib/esm/utils/isJSON.d.ts +1 -0
- package/lib/esm/utils/isJSON.js +2 -0
- package/lib/esm/utils/jwt.d.ts +27 -0
- package/lib/esm/utils/jwt.js +2 -0
- package/lib/esm/utils/localStorage.d.ts +11 -0
- package/lib/esm/utils/localStorage.js +2 -0
- package/lib/esm/utils/omit.d.ts +1 -0
- package/lib/esm/utils/omit.js +2 -0
- package/lib/esm/utils/organization.d.ts +18 -0
- package/lib/esm/utils/organization.js +2 -0
- package/lib/esm/utils/payment-methods/sortPaymentMethods.d.ts +2 -0
- package/lib/esm/utils/payment-methods/sortPaymentMethods.js +2 -0
- package/lib/esm/utils/pick.d.ts +1 -0
- package/lib/esm/utils/pick.js +2 -0
- package/lib/esm/utils/placeholderImages.d.ts +2 -0
- package/lib/esm/utils/placeholderImages.js +2 -0
- package/lib/esm/utils/promisify.d.ts +1 -0
- package/lib/esm/utils/promisify.js +2 -0
- package/lib/esm/utils/replace.d.ts +2 -0
- package/lib/esm/utils/replace.js +2 -0
- package/lib/esm/utils/scrollbarWidth.d.ts +1 -0
- package/lib/esm/utils/scrollbarWidth.js +2 -0
- package/lib/esm/utils/shipments.d.ts +3 -0
- package/lib/esm/utils/shipments.js +2 -0
- package/lib/esm/utils/snakeToCamelCase.d.ts +5 -0
- package/lib/esm/utils/snakeToCamelCase.js +2 -0
- package/lib/esm/utils/stripe/retrievePaymentIntent.d.ts +14 -0
- package/lib/esm/utils/stripe/retrievePaymentIntent.js +2 -0
- package/lib/esm/utils/triggerAttributeHelper.d.ts +31 -0
- package/lib/esm/utils/triggerAttributeHelper.js +2 -0
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.d.ts +8 -0
- package/lib/esm/utils/updateOrderSubscriptionCustomerPaymentSource.js +2 -0
- package/lib/esm/utils/validateFormFields.d.ts +16 -0
- package/lib/esm/utils/validateFormFields.js +2 -0
- package/lib/tsconfig.prod.esm.tsbuildinfo +1 -0
- package/lib/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +154 -19
- package/dist/index.cjs +0 -3
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3271
- package/dist/index.d.ts +0 -3271
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
2
|
+
import { type JSX } from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
/**
|
|
5
|
+
* The children of the component.
|
|
6
|
+
*/
|
|
7
|
+
children: DefaultChildrenType;
|
|
8
|
+
}
|
|
9
|
+
export declare function InStockSubscriptionsContainer({ children }: Props): JSX.Element | null;
|
|
10
|
+
export default InStockSubscriptionsContainer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InStockSubscriptionsContainer=InStockSubscriptionsContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),InStockSubscriptionContext_1=tslib_1.__importDefault(require("../../context/InStockSubscriptionContext")),InStockSubscriptionReducer_1=tslib_1.__importStar(require("../../reducers/InStockSubscriptionReducer")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),react_1=require("react");function InStockSubscriptionsContainer({children}){const config=(0,useCustomContext_1.default)({context:CommerceLayerContext_1.default,contextComponentName:"CommerceLayer",currentComponentName:"InStockSubscriptionsContainer",key:"accessToken"}),[state,dispatch]=(0,react_1.useReducer)(InStockSubscriptionReducer_1.default,InStockSubscriptionReducer_1.inStockSubscriptionInitialState),value=Object.assign(Object.assign({},state),{setInStockSubscription:_a=>tslib_1.__awaiter(this,[_a],void 0,function*({customerEmail,skuCode}){return yield(0,InStockSubscriptionReducer_1.setInStockSubscription)({customerEmail,skuCode,config,dispatch})})});return(0,jsx_runtime_1.jsx)(InStockSubscriptionContext_1.default.Provider,{value,children})}exports.default=InStockSubscriptionsContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
export type TLineItem = 'gift_cards' | 'payment_methods' | 'promotions' | 'shipments' | 'skus' | 'bundles' | 'adjustments';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: JSX.Element | JSX.Element[];
|
|
5
|
+
type?: TLineItem;
|
|
6
|
+
}
|
|
7
|
+
export declare function LineItem(props: Props): JSX.Element;
|
|
8
|
+
export default LineItem;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItem=LineItem;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),ShipmentChildrenContext_1=tslib_1.__importDefault(require("../../context/ShipmentChildrenContext"));function LineItem(props){const{type="skus",children}=props,{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),{lineItems:shipmentLineItems}=(0,react_1.useContext)(ShipmentChildrenContext_1.default),items=shipmentLineItems&&shipmentLineItems?.length>0?shipmentLineItems:lineItems,components=items?.filter(l=>l?.item_type===type).map((lineItem,k,check)=>{var _a;if(lineItem?.item_type==="bundles"&&k>0&&((_a=check[k-1])===null||_a===void 0?void 0:_a.bundle_code)===lineItem.bundle_code||lineItem?.item_type==="gift_cards"&&lineItem?.total_amount_cents&&lineItem?.total_amount_cents<=0)return null;const lineProps={lineItem};return(0,jsx_runtime_1.jsx)(LineItemChildrenContext_1.default.Provider,{value:lineProps,children},lineItem?.id)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:components})}exports.default=LineItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { BaseAmountComponent, BasePriceType } from '../../typings/index';
|
|
3
|
+
type Props = BaseAmountComponent & {
|
|
4
|
+
type?: BasePriceType;
|
|
5
|
+
};
|
|
6
|
+
export declare function LineItemAmount(props: Props): JSX.Element;
|
|
7
|
+
export default LineItemAmount;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemAmount=LineItemAmount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),getAmount_1=tslib_1.__importDefault(require("../../utils/getAmount")),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemAmount(props){const{format="formatted",type="total"}=props,p=tslib_1.__rest(props,["format","type"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),[price,setPrice]=(0,react_1.useState)("");(0,react_1.useEffect)(()=>{if(lineItem){const p2=(0,getAmount_1.default)({base:"amount",type,format,obj:lineItem});setPrice(p2)}return()=>{setPrice("")}},[lineItem]);const parentProps=Object.assign({price},p);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:price}))}exports.default=LineItemAmount;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { LineItem } from '@commercelayer/sdk';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
export interface TLineItemCode extends Omit<Props, 'children'> {
|
|
5
|
+
lineItem: LineItem;
|
|
6
|
+
skuCode: string;
|
|
7
|
+
}
|
|
8
|
+
interface Props extends Omit<JSX.IntrinsicElements['p'], 'children'> {
|
|
9
|
+
children?: ChildrenFunction<TLineItemCode>;
|
|
10
|
+
type?: 'sku_code' | 'bundle_code';
|
|
11
|
+
}
|
|
12
|
+
export declare function LineItemCode({ type, children, ...p }: Props): JSX.Element;
|
|
13
|
+
export default LineItemCode;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemCode=LineItemCode;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemCode(_a){var{type="sku_code",children}=_a,p=tslib_1.__rest(_a,["type","children"]);const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),labelName=lineItem?.[type],parentProps=Object.assign({lineItem,skuCode:labelName},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("p",Object.assign({},p,{children:labelName}))}exports.default=LineItemCode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConditionalElement } from '../../typings/index';
|
|
2
|
+
import { type TGenericChildrenProps, type TResources } from '../utils/GenericFieldComponent';
|
|
3
|
+
import type { JSX } from "react";
|
|
4
|
+
type LineItemFieldChildrenProps = TGenericChildrenProps<TResources['LineItem']>;
|
|
5
|
+
type TCondition = ConditionalElement<Exclude<TResources['LineItem'], 'resource'>>;
|
|
6
|
+
type Props = {
|
|
7
|
+
children?: (props: LineItemFieldChildrenProps) => JSX.Element;
|
|
8
|
+
} & TCondition;
|
|
9
|
+
/**
|
|
10
|
+
* @param props {@link Props}
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function LineItemField<P extends Props>(props: P): JSX.Element;
|
|
14
|
+
export default LineItemField;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemField=LineItemField;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),GenericFieldComponent_1=tslib_1.__importDefault(require("../utils/GenericFieldComponent"));function LineItemField(props){const{attribute,tagElement="span",children}=props,p=tslib_1.__rest(props,["attribute","tagElement","children"]);return(0,jsx_runtime_1.jsx)(GenericFieldComponent_1.default,Object.assign({resource:"lineItem",attribute,tagElement,context:LineItemChildrenContext_1.default},p,{children}))}exports.default=LineItemField;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { LineItem } from '@commercelayer/sdk';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
import type { TLineItem } from './LineItem';
|
|
5
|
+
export interface TLineItemImage extends Omit<Props, 'children'> {
|
|
6
|
+
src: string;
|
|
7
|
+
lineItem: LineItem;
|
|
8
|
+
}
|
|
9
|
+
type Props = {
|
|
10
|
+
children?: ChildrenFunction<TLineItemImage>;
|
|
11
|
+
width?: number;
|
|
12
|
+
placeholder?: {
|
|
13
|
+
[K in TLineItem]?: string;
|
|
14
|
+
};
|
|
15
|
+
} & Omit<JSX.IntrinsicElements['img'], 'src' | 'srcSet' | 'placeholder'>;
|
|
16
|
+
export declare function LineItemImage(props: Props): JSX.Element | null;
|
|
17
|
+
export default LineItemImage;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemImage=LineItemImage;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),placeholderImages_1=require("../../utils/placeholderImages"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemImage(props){var _a,_b;const{placeholder,children}=props,p=tslib_1.__rest(props,["placeholder","children"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),itemType=lineItem?.item_type;let src=lineItem?.image_url;src||(placeholder?.[itemType]?src=placeholder?.[itemType]:src=itemType==="gift_cards"?placeholderImages_1.defaultGiftCardImgUrl:placeholderImages_1.defaultImgUrl);const parenProps=Object.assign({lineItem,src,placeholder},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parenProps,{children})):src?(0,jsx_runtime_1.jsx)("img",Object.assign({"data-testid":`line-item-image-${(_a=lineItem?.sku_code)!==null&&_a!==void 0?_a:""}`,alt:(_b=lineItem?.name)!==null&&_b!==void 0?_b:"",src},p)):null}exports.default=LineItemImage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { LineItem } from '@commercelayer/sdk';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
export interface TLineItemName extends Omit<Props, 'children'> {
|
|
5
|
+
label: string;
|
|
6
|
+
lineItem: LineItem;
|
|
7
|
+
}
|
|
8
|
+
interface Props extends Omit<JSX.IntrinsicElements['p'], 'children'> {
|
|
9
|
+
children?: ChildrenFunction<TLineItemName>;
|
|
10
|
+
}
|
|
11
|
+
export declare function LineItemName(props: Props): JSX.Element;
|
|
12
|
+
export default LineItemName;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemName=LineItemName;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemName(props){var _a;const{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),label=lineItem?.name,parentProps=Object.assign({label,lineItem},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("p",Object.assign({"data-testid":`line-item-name-${(_a=lineItem?.sku_code)!==null&&_a!==void 0?_a:""}`},props,{children:label}))}exports.default=LineItemName;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CSSProperties, type JSX } from 'react';
|
|
2
|
+
import type { LineItemOption as LineItemOptionType } from '@commercelayer/sdk';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
export interface TLineItemOption extends Omit<Props, 'children'> {
|
|
5
|
+
lineItemOption: LineItemOptionType;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
id?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
children?: ChildrenFunction<TLineItemOption>;
|
|
13
|
+
name?: string;
|
|
14
|
+
valueClassName?: string;
|
|
15
|
+
tagElement?: keyof JSX.IntrinsicElements;
|
|
16
|
+
tagContainer?: keyof JSX.IntrinsicElements;
|
|
17
|
+
}
|
|
18
|
+
export declare function LineItemOption(props: Props): JSX.Element;
|
|
19
|
+
export default LineItemOption;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOption=LineItemOption;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext")),map_1=tslib_1.__importDefault(require("lodash/map")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),isJSON_1=tslib_1.__importDefault(require("../../utils/isJSON"));function LineItemOption(props){var _a;const{name,children,valueClassName,key,tagElement="li",tagContainer="ul"}=props,p=tslib_1.__rest(props,["name","children","valueClassName","key","tagElement","tagContainer"]),{lineItemOption,showAll}=(0,react_1.useContext)(LineItemOptionChildrenContext_1.default),parentProps=Object.assign(Object.assign({},props),{lineItemOption}),TagElement=tagElement,TagContainer=tagContainer,label=name!=null?(_a=lineItemOption?.options)===null||_a===void 0?void 0:_a[name]:"",components=showAll&&(0,isJSON_1.default)(JSON.stringify(lineItemOption?.options))?(0,map_1.default)(lineItemOption?.options,(value,key2)=>(0,jsx_runtime_1.jsxs)(TagElement,Object.assign({},p,{children:[`${key2}:`,(0,jsx_runtime_1.jsx)("span",{className:valueClassName,children:`${value}`})]}),key2)):name!=null&&lineItemOption?.options!=null&&name in lineItemOption.options?(0,jsx_runtime_1.jsxs)(TagElement,Object.assign({},p,{children:[`${name}:`,(0,jsx_runtime_1.jsx)("span",Object.assign({className:valueClassName},p,{children:label??""}))]}),key):null;return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)(TagContainer,{children:components})}exports.default=LineItemOption;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode, type JSX } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
showName?: boolean;
|
|
6
|
+
titleTagElement?: keyof JSX.IntrinsicElements;
|
|
7
|
+
titleClassName?: string;
|
|
8
|
+
} & Omit<JSX.IntrinsicElements['div'], 'children'> & ({
|
|
9
|
+
skuOptionId: string;
|
|
10
|
+
showAll?: never;
|
|
11
|
+
} | {
|
|
12
|
+
skuOptionId?: never;
|
|
13
|
+
showAll: true;
|
|
14
|
+
});
|
|
15
|
+
export declare function LineItemOptions(props: Props): JSX.Element;
|
|
16
|
+
export default LineItemOptions;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemOptions=LineItemOptions;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),LineItemOptionChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemOptionChildrenContext"));function LineItemOptions(props){const{skuOptionId,title,children,showName=!0,showAll,className,titleTagElement="h6",titleClassName}=props,p=tslib_1.__rest(props,["skuOptionId","title","children","showName","showAll","className","titleTagElement","titleClassName"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),lineItemOptions=lineItem!=null?lineItem?.line_item_options||[]:[],TitleTagElement=titleTagElement,options=lineItemOptions.filter(o=>showAll?!0:o.skuOption().id===skuOptionId).map((o,k)=>{const showTitle=showName?(0,jsx_runtime_1.jsx)(TitleTagElement,{className:titleClassName,children:title||o.name}):null,valueProps={lineItemOption:o,showAll};return(0,jsx_runtime_1.jsxs)("div",Object.assign({className},p,{children:[showTitle,(0,jsx_runtime_1.jsx)(LineItemOptionChildrenContext_1.default.Provider,{value:valueProps,children})]}),k)});return(0,jsx_runtime_1.jsx)(jsx_runtime_1.Fragment,{children:options})}exports.default=LineItemOptions;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
import type { LineItem } from '@commercelayer/sdk';
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
quantity: number;
|
|
6
|
+
handleChange: (event: React.MouseEvent<HTMLSelectElement>) => void;
|
|
7
|
+
lineItem?: LineItem;
|
|
8
|
+
}
|
|
9
|
+
type Props = {
|
|
10
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
11
|
+
max?: number;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* force the update of the line item price using `_external_price: true` attribute
|
|
16
|
+
* @link https://docs.commercelayer.io/core/external-resources/external-prices
|
|
17
|
+
*/
|
|
18
|
+
hasExternalPrice?: boolean;
|
|
19
|
+
} & (Omit<JSX.IntrinsicElements['select'], 'children'> & Omit<JSX.IntrinsicElements['span'], 'children'>);
|
|
20
|
+
export declare function LineItemQuantity(props: Props): JSX.Element;
|
|
21
|
+
export default LineItemQuantity;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemQuantity=LineItemQuantity;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function LineItemQuantity(props){var _a;const{max=50,readonly=!1,hasExternalPrice}=props,p=tslib_1.__rest(props,["max","readonly","hasExternalPrice"]),{lineItem}=(0,react_1.useContext)(LineItemChildrenContext_1.default),{updateLineItem}=(0,react_1.useContext)(LineItemContext_1.default),options=[];for(let i=1;i<=max;i++)options.push((0,jsx_runtime_1.jsx)("option",{value:`${i}`,children:i},i));const handleChange=e=>{const quantity2=Number(e.target.value);updateLineItem&&lineItem&&updateLineItem(lineItem.id,quantity2,hasExternalPrice)},quantity=lineItem?.quantity,parentProps=Object.assign({handleChange,quantity,lineItem},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):readonly?(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:quantity})):(0,jsx_runtime_1.jsx)("select",Object.assign({"data-testid":lineItem?.sku_code,title:(_a=lineItem?.name)!==null&&_a!==void 0?_a:"",value:quantity,onChange:handleChange},p,{children:options}))}exports.default=LineItemQuantity;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PropsWithoutRef, type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
import type { LineItem } from '@commercelayer/sdk';
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
handleRemove: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
lineItem?: LineItem;
|
|
8
|
+
}
|
|
9
|
+
interface Props extends PropsWithoutRef<Omit<JSX.IntrinsicElements['a'], 'children'>> {
|
|
10
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function LineItemRemoveLink(props: Props): JSX.Element;
|
|
14
|
+
export default LineItemRemoveLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemRemoveLink=LineItemRemoveLink;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemChildrenContext_1=tslib_1.__importDefault(require("../../context/LineItemChildrenContext")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function LineItemRemoveLink(props){var _a;const{label="Remove",onClick}=props,{lineItem}=(0,useCustomContext_1.default)({context:LineItemChildrenContext_1.default,contextComponentName:"LineItem",currentComponentName:"LineItemRemoveLink",key:"lineItem"}),{deleteLineItem}=(0,react_1.useContext)(LineItemContext_1.default),handleRemove=e=>{e.preventDefault(),deleteLineItem!=null&&lineItem!=null&&deleteLineItem(lineItem.id),onClick?.(e)},parentProps=Object.assign({handleRemove,lineItem},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("a",Object.assign({"data-testid":`line-item-remove-link-${(_a=lineItem?.sku_code)!==null&&_a!==void 0?_a:""}`},props,{href:"#",onClick:handleRemove,children:label}))}exports.default=LineItemRemoveLink;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { DefaultChildrenType } from '../../typings/globals';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: DefaultChildrenType;
|
|
5
|
+
filters?: Record<string, any>;
|
|
6
|
+
loader?: JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
export declare function LineItemsContainer(props: Props): JSX.Element;
|
|
9
|
+
export default LineItemsContainer;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsContainer=LineItemsContainer;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),LineItemReducer_1=tslib_1.__importStar(require("../../reducers/LineItemReducer")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext"));function LineItemsContainer(props){const{children,loader="Loading..."}=props,{order,addResourceToInclude,include,orderId,getOrder,includeLoaded}=(0,react_1.useContext)(OrderContext_1.default),config=(0,react_1.useContext)(CommerceLayerContext_1.default),[state,dispatch]=(0,react_1.useReducer)(LineItemReducer_1.default,LineItemReducer_1.lineItemInitialState);(0,react_1.useEffect)(()=>{include?.includes("line_items.line_item_options.sku_option")?includeLoaded?.["line_items.line_item_options.sku_option"]||addResourceToInclude({newResourceLoaded:{"line_items.line_item_options.sku_option":!0}}):addResourceToInclude({newResource:["line_items.line_item_options.sku_option"]}),include?.includes("line_items.item")?includeLoaded?.["line_items.item"]||addResourceToInclude({newResourceLoaded:{"line_items.item":!0}}):addResourceToInclude({newResource:["line_items.item"]})},[include,includeLoaded]),(0,react_1.useEffect)(()=>{order?.line_items&&dispatch({type:"setLineItems",payload:{lineItems:order.line_items}})},[order?.line_items]);const lineItemValue=Object.assign(Object.assign({},state),{loader,updateLineItem:(lineItemId_1,...args_1)=>tslib_1.__awaiter(this,[lineItemId_1,...args_1],void 0,function*(lineItemId,quantity=1,hasExternalPrice){yield(0,LineItemReducer_1.updateLineItem)({lineItemId,quantity,hasExternalPrice,dispatch,config,getOrder,orderId:orderId??"",errors:state.errors})}),deleteLineItem:lineItemId=>tslib_1.__awaiter(this,void 0,void 0,function*(){yield(0,LineItemReducer_1.deleteLineItem)({lineItemId,dispatch,config,getOrder,orderId:orderId??"",errors:state.errors})})});return(0,jsx_runtime_1.jsx)(LineItemContext_1.default.Provider,{value:lineItemValue,children:state.loading?loader:children})}exports.default=LineItemsContainer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import { type TypeAccepted } from '../../utils/getLineItemsCount';
|
|
3
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
4
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
5
|
+
quantity: number;
|
|
6
|
+
}
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
9
|
+
typeAccepted?: TypeAccepted[];
|
|
10
|
+
}
|
|
11
|
+
export declare function LineItemsCount(props: Props): JSX.Element;
|
|
12
|
+
export default LineItemsCount;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsCount=LineItemsCount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext"));function LineItemsCount(props){const{children,typeAccepted}=props,p=tslib_1.__rest(props,["children","typeAccepted"]),{lineItems}=(0,useCustomContext_1.default)({context:LineItemContext_1.default,contextComponentName:"LineItemsContainer",currentComponentName:"LineItemsCount",key:"lineItems"}),[quantity,setQuantity]=(0,react_1.useState)(0);(0,react_1.useEffect)(()=>{if(lineItems&&lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[],typeAccepted});setQuantity(qty)}return()=>{setQuantity(0)}},[lineItems,typeAccepted]);const parentProps=Object.assign({quantity,typeAccepted},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:quantity}))}exports.default=LineItemsCount;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
quantity: number;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements['span'], 'children'> {
|
|
8
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
9
|
+
text?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function LineItemsEmpty(props: Props): JSX.Element | null;
|
|
12
|
+
export default LineItemsEmpty;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineItemsEmpty=LineItemsEmpty;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),getLineItemsCount_1=tslib_1.__importDefault(require("../../utils/getLineItemsCount")),LineItemContext_1=tslib_1.__importDefault(require("../../context/LineItemContext"));function LineItemsEmpty(props){const{children,text="Your shopping bag is empty"}=props,p=tslib_1.__rest(props,["children","text"]),{lineItems}=(0,react_1.useContext)(LineItemContext_1.default),[quantity,setQuantity]=(0,react_1.useState)(),emptyText=quantity===0?(0,jsx_runtime_1.jsx)("span",Object.assign({},p,{children:text})):null;(0,react_1.useEffect)(()=>{if(lineItems)if(lineItems.length>0){const qty=(0,getLineItemsCount_1.default)({lineItems:lineItems||[]});setQuantity(qty)}else setQuantity(0);return()=>{setQuantity(void 0)}},[lineItems]);const parentProps=Object.assign({quantity,text},p);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):emptyText}exports.default=LineItemsEmpty;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type PropsWithoutRef, type JSX } from "react";
|
|
2
|
+
import type { ChildrenFunction } from "../../typings/index";
|
|
3
|
+
import type { AddToCartReturn, CustomLineItem, LineItemOption } from "../../reducers/OrderReducer";
|
|
4
|
+
interface TAddToCartButton extends Omit<Props, "children"> {
|
|
5
|
+
handleClick: () => AddToCartReturn;
|
|
6
|
+
}
|
|
7
|
+
type BuyNowMode = {
|
|
8
|
+
/**
|
|
9
|
+
* Once item has been added, it redirects to the hosted checkout micro-frontend.
|
|
10
|
+
*/
|
|
11
|
+
buyNowMode: true;
|
|
12
|
+
/**
|
|
13
|
+
* If you have a self-hosted checkout, you can pass the url to redirect to it.
|
|
14
|
+
*/
|
|
15
|
+
checkoutUrl?: string;
|
|
16
|
+
} | {
|
|
17
|
+
buyNowMode?: false;
|
|
18
|
+
checkoutUrl?: never;
|
|
19
|
+
};
|
|
20
|
+
type THostedCart = {
|
|
21
|
+
/**
|
|
22
|
+
* Once item has been added, it redirects to the hosted cart micro-frontend.
|
|
23
|
+
*/
|
|
24
|
+
redirectToHostedCart: true;
|
|
25
|
+
/**
|
|
26
|
+
* If you have a self-hosted cart, you can pass the url to redirect to it.
|
|
27
|
+
*/
|
|
28
|
+
hostedCartUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* If you have a self-hosted cart, you can pass the protocol to redirect to it.
|
|
31
|
+
*/
|
|
32
|
+
protocol?: "http" | "https";
|
|
33
|
+
} | {
|
|
34
|
+
redirectToHostedCart?: false;
|
|
35
|
+
hostedCartUrl?: never;
|
|
36
|
+
protocol?: never;
|
|
37
|
+
};
|
|
38
|
+
type TButton = PropsWithoutRef<Omit<JSX.IntrinsicElements["button"], "children">>;
|
|
39
|
+
type Props = {
|
|
40
|
+
/**
|
|
41
|
+
* Code of a bundle
|
|
42
|
+
*/
|
|
43
|
+
bundleCode?: string;
|
|
44
|
+
children?: ChildrenFunction<TAddToCartButton>;
|
|
45
|
+
/**
|
|
46
|
+
* Disable the cart button
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Label to display
|
|
51
|
+
*/
|
|
52
|
+
label?: string | JSX.Element;
|
|
53
|
+
/**
|
|
54
|
+
* Line item which allow you customize the cart item
|
|
55
|
+
*/
|
|
56
|
+
lineItem?: CustomLineItem;
|
|
57
|
+
/**
|
|
58
|
+
* Line item option to add to cart
|
|
59
|
+
*/
|
|
60
|
+
lineItemOption?: LineItemOption;
|
|
61
|
+
/**
|
|
62
|
+
* Quantity of the item
|
|
63
|
+
*/
|
|
64
|
+
quantity?: string;
|
|
65
|
+
/**
|
|
66
|
+
* SKU code to add to cart
|
|
67
|
+
*/
|
|
68
|
+
skuCode?: string;
|
|
69
|
+
/**
|
|
70
|
+
* SKU list to add to cart
|
|
71
|
+
*/
|
|
72
|
+
skuListId?: string;
|
|
73
|
+
} & TButton & BuyNowMode & THostedCart;
|
|
74
|
+
/**
|
|
75
|
+
* This component adds `line_items` to the cart (aka draft order), see the [how to create a shopping cart](https://docs.commercelayer.io/core/v/how-tos/placing-orders/shopping-cart/create-a-shopping-cart) documentation,
|
|
76
|
+
* for a general understanding of the process.
|
|
77
|
+
*
|
|
78
|
+
* It can be used to add `skus` or `bundle` by receiving `skuCode` or `bundleCode` from props.
|
|
79
|
+
* When `skuListId` is passed as prop , it will add all the `skus` in the `sku_list` to the cart.
|
|
80
|
+
*
|
|
81
|
+
* It's possible to select the quantity of the item to add to cart by passing the `quantity` prop.
|
|
82
|
+
*
|
|
83
|
+
* When this component is used inside a `<Skus>` or `<SkuList>` component, it will automatically get the `skuCode` and quantity from the context,
|
|
84
|
+
* so you don't need to pass it as prop.
|
|
85
|
+
*
|
|
86
|
+
* It can automatically redirect to the cart page of the application using the `redirectToHostedCart` prop and optionally a `hostedCartUrl`.
|
|
87
|
+
*
|
|
88
|
+
* With a similar logic, you can enable a "Buy Now" experience and automatically redirect the customer to the checkout page using the `buyNowMode` prop and optionally a `checkoutUrl`.
|
|
89
|
+
*
|
|
90
|
+
* <span title="Requirement" type="warning">
|
|
91
|
+
* Must be a child of the `<OrderContainer>` component.
|
|
92
|
+
* </span>
|
|
93
|
+
*/
|
|
94
|
+
export declare function AddToCartButton(props: Props): JSX.Element;
|
|
95
|
+
export default AddToCartButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AddToCartButton=AddToCartButton;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),SkuListsContext_1=tslib_1.__importDefault(require("../../context/SkuListsContext")),ExternalFunctionContext_1=tslib_1.__importDefault(require("../../context/ExternalFunctionContext")),SkuChildrenContext_1=tslib_1.__importDefault(require("../../context/SkuChildrenContext")),getApplicationLink_1=require("../../utils/getApplicationLink"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),getDomain_1=require("../../utils/getDomain"),events_1=require("../../utils/events"),organization_1=require("../../utils/organization");function AddToCartButton(props){var _a;const{label="Add to cart",children,skuCode,bundleCode,skuListId,lineItem,buyNowMode=!1,checkoutUrl,redirectToHostedCart,hostedCartUrl,quantity,lineItemOption,protocol="https"}=props,p=tslib_1.__rest(props,["label","children","skuCode","bundleCode","skuListId","lineItem","buyNowMode","checkoutUrl","redirectToHostedCart","hostedCartUrl","quantity","lineItemOption","protocol"]),{accessToken,endpoint}=(0,useCustomContext_1.default)({context:CommerceLayerContext_1.default,contextComponentName:"CommerceLayer",currentComponentName:"AddToCartButton",key:"accessToken"}),{addToCart,orderId,getOrder,setOrderErrors}=(0,useCustomContext_1.default)({context:OrderContext_1.default,contextComponentName:"OrderContainer",currentComponentName:"AddToCartButton",key:"addToCart"}),{url,callExternalFunction}=(0,react_1.useContext)(ExternalFunctionContext_1.default),{skuLists}=(0,react_1.useContext)(SkuListsContext_1.default),{sku}=(0,react_1.useContext)(SkuChildrenContext_1.default),sCode=(_a=sku?.code)!==null&&_a!==void 0?_a:skuCode,handleClick=()=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a2,_b,_c;const qty=quantity!=null?Number.parseInt(quantity):1;if(skuLists!=null&&skuListId&&url&&skuListId in skuLists){const lineItems=(_a2=skuLists?.[skuListId])===null||_a2===void 0?void 0:_a2.map(skuCode2=>({skuCode:skuCode2,quantity:qty,_update_quantity:1}));return yield callExternalFunction({url,data:{resourceType:"orders",inputs:[{id:orderId,lineItems}]}}).then(res=>tslib_1.__awaiter(this,void 0,void 0,function*(){return getOrder&&orderId&&(yield getOrder(orderId)),buyNowMode||(0,events_1.publish)("open-cart"),res})).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}if(!url&&addToCart!=null){const res=yield addToCart({bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl});if(redirectToHostedCart&&accessToken!=null&&endpoint!=null){const{slug,domain}=(0,getDomain_1.getDomain)(endpoint),orderId2=res?.orderId;if(hostedCartUrl&&orderId2)location.href=`${protocol}://${hostedCartUrl}/${orderId2}?accessToken=${accessToken}`;else if(orderId2&&slug){const config=yield(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{orderId:orderId2,accessToken,slug}});location.href=(_c=(_b=config?.links)===null||_b===void 0?void 0:_b.cart)!==null&&_c!==void 0?_c:(0,getApplicationLink_1.getApplicationLink)({orderId:orderId2,slug,accessToken,domain,applicationType:"cart"})}}return res}else if(url)return yield callExternalFunction({url,data:{bundleCode,skuCode:sCode,quantity:qty,lineItemOption,lineItem,buyNowMode,checkoutUrl}}).then(res=>tslib_1.__awaiter(this,void 0,void 0,function*(){return getOrder&&orderId&&(yield getOrder(orderId)),buyNowMode||(0,events_1.publish)("open-cart"),res})).catch(({response})=>(setOrderErrors&&setOrderErrors(response.data),response))}),parentProps=Object.assign({handleClick,label},props);return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("button",Object.assign({},p,{onClick:()=>{handleClick()},children:label}))}exports.default=AddToCartButton;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AdjustmentAmount=AdjustmentAmount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseOrderPrice_1=tslib_1.__importDefault(require("../utils/BaseOrderPrice"));function AdjustmentAmount(props){return(0,jsx_runtime_1.jsx)(BaseOrderPrice_1.default,Object.assign({base:"amount",type:"adjustment"},props))}exports.default=AdjustmentAmount;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactNode, type JSX } from 'react';
|
|
2
|
+
import type { ChildrenFunction } from '../../typings/index';
|
|
3
|
+
interface ChildrenProps extends Omit<Props, 'children'> {
|
|
4
|
+
/**
|
|
5
|
+
* The url of the cart
|
|
6
|
+
*/
|
|
7
|
+
href: string;
|
|
8
|
+
/**
|
|
9
|
+
* Callback to dispatch the click event
|
|
10
|
+
* @param e: MouseEvent<HTMLAnchorElement>
|
|
11
|
+
* @returns Promise<void>
|
|
12
|
+
*/
|
|
13
|
+
handleClick?: (e: MouseEvent<HTMLAnchorElement>) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* The order id
|
|
16
|
+
*/
|
|
17
|
+
orderId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The access token
|
|
20
|
+
*/
|
|
21
|
+
accessToken?: string;
|
|
22
|
+
}
|
|
23
|
+
interface Props extends Omit<JSX.IntrinsicElements['a'], 'children'> {
|
|
24
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
25
|
+
/**
|
|
26
|
+
* Label to display
|
|
27
|
+
*/
|
|
28
|
+
label?: string | ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* The type of the cart. Defaults to undefined. If set to 'mini', the cart will open in a modal.
|
|
31
|
+
*/
|
|
32
|
+
type?: 'mini';
|
|
33
|
+
/**
|
|
34
|
+
* The domain of your forked application
|
|
35
|
+
*/
|
|
36
|
+
customDomain?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This component generates a link to the hosted mfe-cart application.
|
|
40
|
+
* In this way you can connect your shop application with our hosted micro-frontend.
|
|
41
|
+
*
|
|
42
|
+
* <span title="Requirement" type="warning">
|
|
43
|
+
* Must be a child of the `<OrderContainer>` component. <br />
|
|
44
|
+
* </span>
|
|
45
|
+
*/
|
|
46
|
+
export declare function CartLink(props: Props): JSX.Element | null;
|
|
47
|
+
export default CartLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CartLink=CartLink;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),getApplicationLink_1=require("../../utils/getApplicationLink"),getDomain_1=require("../../utils/getDomain"),events_1=require("../../utils/events"),organization_1=require("../../utils/organization");function CartLink(props){const{label,children,type,customDomain}=props,p=tslib_1.__rest(props,["label","children","type","customDomain"]),{order,createOrder}=(0,react_1.useContext)(OrderContext_1.default),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default);if(accessToken==null)throw new Error("Cannot use `CartLink` outside of `CommerceLayer`");if(endpoint==null)throw new Error("Cannot use `CartLink` outside of `CommerceLayer`");const{domain,slug}=(0,getDomain_1.getDomain)(endpoint),href=slug&&order?.id?(0,getApplicationLink_1.getApplicationLink)({slug,orderId:order?.id,accessToken,domain,applicationType:"cart",customDomain}):void 0,handleClick=event=>tslib_1.__awaiter(this,void 0,void 0,function*(){var _a,_b,_c,_d,_e;if(event.preventDefault(),type!=="mini")if(order?.id){const config=yield(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{orderId:order?.id,accessToken,slug}});location.href=(_c=(_b=(_a=config?.links)===null||_a===void 0?void 0:_a.cart)!==null&&_b!==void 0?_b:href)!==null&&_c!==void 0?_c:""}else{const orderId=yield createOrder({}),config=yield(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{orderId:order?.id,accessToken,slug}});slug&&(location.href=(_e=(_d=config?.links)===null||_d===void 0?void 0:_d.cart)!==null&&_e!==void 0?_e:(0,getApplicationLink_1.getApplicationLink)({slug,orderId,accessToken,domain,applicationType:"cart",customDomain}))}else(0,events_1.publish)("open-cart")}),parentProps=Object.assign({handleClick,label,href,orderId:order?.id,accessToken},p);return accessToken?children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("a",Object.assign({href,onClick:e=>{handleClick(e)}},p,{children:label})):null}exports.default=CartLink;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { ChildrenFunction } from "../../typings/index";
|
|
3
|
+
interface ChildrenProps extends Omit<Props, "children"> {
|
|
4
|
+
checkoutUrl: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props extends Omit<JSX.IntrinsicElements["a"], "children"> {
|
|
8
|
+
children?: ChildrenFunction<ChildrenProps>;
|
|
9
|
+
/**
|
|
10
|
+
* Label for the checkout link
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Ignores `order.checkout_url` and redirects to the hosted checkout micro-frontend.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
hostedCheckout?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This component generates a link to the hosted mfe-checkout application.
|
|
21
|
+
* In this way you can connect your shop application with our hosted micro-frontend.
|
|
22
|
+
*
|
|
23
|
+
* By default it will takes the customer to our hosted checkout micro-frontend,
|
|
24
|
+
* but if `hostedCheckout` is set as `false` it will use the `checkout_url` attribute
|
|
25
|
+
* found in the `order` object.
|
|
26
|
+
*/
|
|
27
|
+
export declare function CheckoutLink(props: Props): JSX.Element;
|
|
28
|
+
export default CheckoutLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CheckoutLink=CheckoutLink;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),Parent_1=tslib_1.__importDefault(require("../utils/Parent")),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),getApplicationLink_1=require("../../utils/getApplicationLink"),getDomain_1=require("../../utils/getDomain"),organization_1=require("../../utils/organization");function CheckoutLink(props){var _a;const{label,hostedCheckout=!0,children,onClick}=props,p=tslib_1.__rest(props,["label","hostedCheckout","children","onClick"]),{order}=(0,react_1.useContext)(OrderContext_1.default),{accessToken,endpoint}=(0,react_1.useContext)(CommerceLayerContext_1.default);if(accessToken==null||endpoint==null)throw new Error("Cannot use `CheckoutLink` outside of `CommerceLayer`");const{domain,slug}=(0,getDomain_1.getDomain)(endpoint),href=hostedCheckout&&order?.id?(0,getApplicationLink_1.getApplicationLink)({slug,orderId:order?.id,accessToken,applicationType:"checkout",domain}):(_a=order?.checkout_url)!==null&&_a!==void 0?_a:"",parentProps=Object.assign({checkoutUrl:order?.checkout_url,hostedCheckout,label,href},p);function handleClick(e){e.preventDefault(),e.stopPropagation();const currentHref=e.currentTarget.href;accessToken&&endpoint&&order?.id?(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{accessToken,slug,orderId:order?.id}}).then(config=>{var _a2;!((_a2=config?.links)===null||_a2===void 0)&&_a2.checkout?window.open(config.links.checkout,"_top"):window.open(currentHref,"_top")}):window.open(currentHref,"_top")}return children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children})):(0,jsx_runtime_1.jsx)("a",Object.assign({href,onClick:handleClick},p,{children:label}))}exports.default=CheckoutLink;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DiscountAmount=DiscountAmount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseOrderPrice_1=tslib_1.__importDefault(require("../utils/BaseOrderPrice"));function DiscountAmount(props){return(0,jsx_runtime_1.jsx)(BaseOrderPrice_1.default,Object.assign({base:"amount",type:"discount"},props))}exports.default=DiscountAmount;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GiftCardAmount=GiftCardAmount;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),BaseOrderPrice_1=tslib_1.__importDefault(require("../utils/BaseOrderPrice")),react_1=require("react"),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),manageGiftCard_1=require("../../utils/adyen/manageGiftCard"),Parent_1=tslib_1.__importDefault(require("../utils/Parent"));function GiftCardAmount(props){const{manageAdyenGiftCard,order}=(0,react_1.useContext)(OrderContext_1.default);if(manageAdyenGiftCard){const giftCardData=(0,manageGiftCard_1.manageGiftCard)({order});if(!giftCardData)return null;const parentProps=Object.assign({priceCents:giftCardData.currentBalanceValue,price:`-${giftCardData?.formattedBalanceValue}`},props);return props.children?(0,jsx_runtime_1.jsx)(Parent_1.default,Object.assign({},parentProps,{children:props.children})):(0,jsx_runtime_1.jsx)("span",Object.assign({},props,{children:`-${giftCardData?.formattedBalanceValue}`}))}return(0,jsx_runtime_1.jsx)(BaseOrderPrice_1.default,Object.assign({base:"amount",type:"gift_card"},props))}exports.default=GiftCardAmount;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type CSSProperties, type JSX } from 'react';
|
|
2
|
+
interface Styles {
|
|
3
|
+
cart?: CSSProperties;
|
|
4
|
+
container?: CSSProperties;
|
|
5
|
+
background?: CSSProperties;
|
|
6
|
+
icon?: CSSProperties;
|
|
7
|
+
iconContainer?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
interface Props extends Omit<JSX.IntrinsicElements['div'], 'children' | 'style'> {
|
|
10
|
+
/**
|
|
11
|
+
* The style of the cart.
|
|
12
|
+
*/
|
|
13
|
+
style?: Styles;
|
|
14
|
+
/**
|
|
15
|
+
* The domain of your forked application.
|
|
16
|
+
*/
|
|
17
|
+
customDomain?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The type of the cart. Defaults to undefined.
|
|
20
|
+
*/
|
|
21
|
+
type?: 'mini';
|
|
22
|
+
/**
|
|
23
|
+
* If true, the cart will open when a line item is added to the order clicking the add to cart button. Defaults to false.
|
|
24
|
+
* Works only with the `type` prop set to `mini`.
|
|
25
|
+
*/
|
|
26
|
+
openAdd?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If true, the cart will be open. Defaults to false.
|
|
29
|
+
* Works only with the `type` prop set to `mini`.
|
|
30
|
+
*/
|
|
31
|
+
open?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* A function that will be called when the cart is open and the background is clicked.
|
|
34
|
+
* Works only with the `type` prop set to `mini`.
|
|
35
|
+
*/
|
|
36
|
+
handleOpen?: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This component allows to embed the cart application in your page as an `<iframe>`.
|
|
40
|
+
*
|
|
41
|
+
* By default, it will be rendered as inline cart and its content will fit the available container width
|
|
42
|
+
* while the height will be automatically adjusted to the content.
|
|
43
|
+
*
|
|
44
|
+
* Or it can work as mini cart - when `type` prop is set to `mini` - and it will be opened in a modal (popup).
|
|
45
|
+
*
|
|
46
|
+
* <span title="Requirement" type="warning">
|
|
47
|
+
* Must be a child of the `<OrderContainer>` component.
|
|
48
|
+
* </span>
|
|
49
|
+
*
|
|
50
|
+
* <span title="Mini cart" type="info">
|
|
51
|
+
* When set as `mini` cart, it requires the `<CartLink type='mini' />` component to be on the same page,
|
|
52
|
+
* to show the cart when clicked. <br />
|
|
53
|
+
* View the `<CartLink />` component documentation for more details and examples.
|
|
54
|
+
* </span>
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
export declare function HostedCart({ type, openAdd, style, open, handleOpen, customDomain, ...props }: Props): JSX.Element | null;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HostedCart=HostedCart;const tslib_1=require("tslib"),jsx_runtime_1=require("react/jsx-runtime"),CommerceLayerContext_1=tslib_1.__importDefault(require("../../context/CommerceLayerContext")),OrderContext_1=tslib_1.__importDefault(require("../../context/OrderContext")),OrderStorageContext_1=tslib_1.__importDefault(require("../../context/OrderStorageContext")),getApplicationLink_1=require("../../utils/getApplicationLink"),getDomain_1=require("../../utils/getDomain"),useCustomContext_1=tslib_1.__importDefault(require("../../utils/hooks/useCustomContext")),react_1=require("react"),iframe_resizer_1=require("iframe-resizer"),events_1=require("../../utils/events"),organization_1=require("../../utils/organization"),defaultIframeStyle={width:"1px",minWidth:"100%",minHeight:"100%",border:"none",paddingLeft:"20px",paddingRight:"20px"},defaultContainerStyle={position:"fixed",top:"0",right:"-25rem",height:"100%",width:"23rem",transition:"right 0.5s ease-in-out",pointerEvents:"none",overflow:"auto"},defaultBackgroundStyle={opacity:"0",position:"fixed",top:"0",left:"0",height:"100%",width:"100vw",transition:"opacity 0.5s ease-in-out",pointerEvents:"none",backgroundColor:"black"},defaultIconStyle={width:"1.25rem",height:"1.25rem"},defaultIconContainer={textAlign:"left",paddingLeft:"20px",paddingTop:"20px",background:"#ffffff",color:"#686E6E"},defaultStyle={cart:defaultIframeStyle,container:defaultContainerStyle,background:defaultBackgroundStyle,icon:defaultIconStyle,iconContainer:defaultIconContainer};function HostedCart(_a){var _b,_c,_d,_e,{type,openAdd=!1,style,open=!1,handleOpen,customDomain}=_a,props=tslib_1.__rest(_a,["type","openAdd","style","open","handleOpen","customDomain"]);const[isOpen,setOpen]=(0,react_1.useState)(!1),ref=(0,react_1.useRef)(null),{accessToken,endpoint}=(0,useCustomContext_1.default)({context:CommerceLayerContext_1.default,contextComponentName:"CommerceLayer",currentComponentName:"HostedCart",key:"accessToken"}),[src,setSrc]=(0,react_1.useState)();if(accessToken==null||endpoint==null)return null;const{order,createOrder,getOrder}=(0,react_1.useContext)(OrderContext_1.default),{persistKey}=(0,react_1.useContext)(OrderStorageContext_1.default),{domain,slug}=(0,getDomain_1.getDomain)(endpoint);function setOrder(openCart){return tslib_1.__awaiter(this,void 0,void 0,function*(){var _a2,_b2,_c2;const orderId=(_a2=localStorage.getItem(persistKey))!==null&&_a2!==void 0?_a2:yield createOrder({});if(orderId!=null&&accessToken&&endpoint){const config=yield(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{orderId:order?.id,accessToken,slug}});setSrc((_c2=(_b2=config?.links)===null||_b2===void 0?void 0:_b2.cart)!==null&&_c2!==void 0?_c2:(0,getApplicationLink_1.getApplicationLink)({slug,orderId,accessToken,domain,applicationType:"cart",customDomain})),openCart&&setTimeout(()=>{handleOpen!=null?handleOpen():setOpen(!0)},300)}})}function onMessage(data){var _a2;switch(data.message.type){case"update":data.message.payload!=null&&getOrder(data.message.payload.id);break;case"close":type==="mini"&&(handleOpen!=null?handleOpen():setOpen(!1));break;case"blur":type==="mini"&&isOpen&&((_a2=ref.current)===null||_a2===void 0||_a2.focus());break}}(0,react_1.useEffect)(()=>{const orderId=localStorage.getItem(persistKey);let ignore=!1;return open!=null&&open!==isOpen&&setOpen(open),openAdd&&type==="mini"&&(0,events_1.subscribe)("open-cart",()=>{window.document.body.style.overflow="hidden",src==null&&order?.id==null&&orderId==null?setOrder(!0):(src!=null&&ref.current!=null&&(ref.current.src=src),setTimeout(()=>{handleOpen!=null?handleOpen():setOpen(!0)},300))}),src==null&&order?.id==null&&orderId==null&&accessToken!=null&&!ignore&&isOpen?setOrder():src==null&&(order?.id!=null||orderId!=null)&&accessToken&&(0,organization_1.getOrganizationConfig)({accessToken,endpoint,params:{orderId:order?.id,accessToken,slug}}).then(config=>{var _a2,_b2,_c2,_d2;setSrc((_b2=(_a2=config?.links)===null||_a2===void 0?void 0:_a2.cart)!==null&&_b2!==void 0?_b2:(0,getApplicationLink_1.getApplicationLink)({slug,orderId:(_d2=(_c2=order?.id)!==null&&_c2!==void 0?_c2:orderId)!==null&&_d2!==void 0?_d2:"",accessToken,domain,applicationType:"cart"}))}),src!=null&&ref.current!=null&&(ref.current.src=src),()=>{ignore=!0,openAdd&&type==="mini"&&(0,events_1.unsubscribe)("open-cart",()=>{})}},[src,open,order?.id,accessToken]),(0,react_1.useEffect)(()=>{ref.current!=null&&(0,iframe_resizer_1.iframeResizer)({checkOrigin:!1,onMessage},ref.current)},[ref.current!=null]);function onCloseCart(){window.document.body.style.removeProperty("overflow"),handleOpen!=null?handleOpen():setOpen(!1)}return src==null?null:type==="mini"?(0,jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment,{children:[(0,jsx_runtime_1.jsx)("div",{"aria-hidden":"true",style:Object.assign(Object.assign(Object.assign({},defaultStyle.background),style?.background),{opacity:isOpen?"0.5":(_b=defaultStyle.background)===null||_b===void 0?void 0:_b.opacity,pointerEvents:isOpen?"initial":(_c=defaultStyle.background)===null||_c===void 0?void 0:_c.pointerEvents}),onClick:onCloseCart}),(0,jsx_runtime_1.jsxs)("div",Object.assign({style:Object.assign(Object.assign(Object.assign({},defaultStyle.container),style?.container),{right:isOpen?"0":(_d=defaultStyle.container)===null||_d===void 0?void 0:_d.right,pointerEvents:isOpen?"initial":(_e=defaultStyle.container)===null||_e===void 0?void 0:_e.pointerEvents})},props,{children:[(0,jsx_runtime_1.jsx)("div",{style:Object.assign(Object.assign({},defaultStyle.iconContainer),style?.iconContainer),children:(0,jsx_runtime_1.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",style:Object.assign(Object.assign({},defaultStyle.icon),style?.icon),onClick:onCloseCart,children:(0,jsx_runtime_1.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,jsx_runtime_1.jsx)("iframe",{title:"Cart",ref,style:Object.assign(Object.assign({},defaultStyle.cart),style?.cart),src,width:"100%",height:"100%"})]}))]}):(0,jsx_runtime_1.jsx)("iframe",{title:"Cart",ref,style:Object.assign(Object.assign({},defaultStyle.cart),style?.cart),src,width:"100%",height:"100%"})}
|